From c5461139f18036fa42b9c851e8537d00dc30eb80 Mon Sep 17 00:00:00 2001 From: chengy4 Date: Fri, 25 Dec 2020 14:33:03 +0800 Subject: [PATCH] add hc32f4a0 --- bsp/hc32f4a0/.config | 533 + bsp/hc32f4a0/.gitignore | 42 + bsp/hc32f4a0/Kconfig | 23 + .../Device/HDSC/HC32F4A0/Include/ddl_config.h | 214 + .../HDSC/HC32F4A0/Include/hc32_common.h | 319 + .../Device/HDSC/HC32F4A0/Include/hc32_ddl.h | 346 + .../Device/HDSC/HC32F4A0/Include/hc32f4a0.h | 48442 +++++ .../HDSC/HC32F4A0/Include/system_hc32f4a0.h | 154 + .../HC32F4A0/Source/ARM/HDSC_HC32F4A0.SFR | Bin 0 -> 3317993 bytes .../HC32F4A0/Source/ARM/startup_hc32f4a0.s | 638 + .../HC32F4A0/Source/GCC/startup_hc32f4a0.S | 565 + .../HC32F4A0/Source/IAR/HDSC_HC32F4A0.svd | 164956 +++++++++++++++ .../HC32F4A0/Source/IAR/startup_hc32f4a0.s | 1039 + .../HDSC/HC32F4A0/Source/system_hc32f4a0.c | 168 + .../Libraries/CMSIS/Include/cmsis_armcc.h | 894 + .../Libraries/CMSIS/Include/cmsis_armclang.h | 1444 + .../CMSIS/Include/cmsis_armclang_ltm.h | 1891 + .../Libraries/CMSIS/Include/cmsis_compiler.h | 283 + .../Libraries/CMSIS/Include/cmsis_gcc.h | 2168 + .../Libraries/CMSIS/Include/cmsis_iccarm.h | 964 + .../Libraries/CMSIS/Include/cmsis_version.h | 39 + .../Libraries/CMSIS/Include/core_armv81mml.h | 2968 + .../Libraries/CMSIS/Include/core_armv8mbl.h | 1921 + .../Libraries/CMSIS/Include/core_armv8mml.h | 2835 + .../Libraries/CMSIS/Include/core_cm0.h | 952 + .../Libraries/CMSIS/Include/core_cm0plus.h | 1085 + .../Libraries/CMSIS/Include/core_cm1.h | 979 + .../Libraries/CMSIS/Include/core_cm23.h | 1996 + .../Libraries/CMSIS/Include/core_cm3.h | 1937 + .../Libraries/CMSIS/Include/core_cm33.h | 2910 + .../Libraries/CMSIS/Include/core_cm35p.h | 2910 + .../Libraries/CMSIS/Include/core_cm4.h | 2124 + .../Libraries/CMSIS/Include/core_cm7.h | 2725 + .../Libraries/CMSIS/Include/core_sc000.h | 1025 + .../Libraries/CMSIS/Include/core_sc300.h | 1912 + .../Libraries/CMSIS/Include/mpu_armv7.h | 272 + .../Libraries/CMSIS/Include/mpu_armv8.h | 346 + .../Libraries/CMSIS/Include/tz_context.h | 70 + .../inc/hc32f4a0_adc.h | 601 + .../inc/hc32f4a0_aes.h | 132 + .../inc/hc32f4a0_can.h | 723 + .../inc/hc32f4a0_clk.h | 1003 + .../inc/hc32f4a0_cmp.h | 374 + .../inc/hc32f4a0_crc.h | 143 + .../inc/hc32f4a0_ctc.h | 210 + .../inc/hc32f4a0_dac.h | 189 + .../inc/hc32f4a0_dcu.h | 347 + .../inc/hc32f4a0_dma.h | 553 + .../inc/hc32f4a0_dmc.h | 439 + .../inc/hc32f4a0_dvp.h | 293 + .../inc/hc32f4a0_efm.h | 1158 + .../inc/hc32f4a0_emb.h | 722 + .../inc/hc32f4a0_eth.h | 2506 + .../inc/hc32f4a0_fcm.h | 307 + .../inc/hc32f4a0_fmac.h | 214 + .../inc/hc32f4a0_gpio.h | 1408 + .../inc/hc32f4a0_hash.h | 233 + .../inc/hc32f4a0_hrpwm.h | 138 + .../inc/hc32f4a0_i2c.h | 266 + .../inc/hc32f4a0_i2s.h | 331 + .../inc/hc32f4a0_icg.h | 441 + .../inc/hc32f4a0_interrupts.h | 1033 + .../inc/hc32f4a0_keyscan.h | 239 + .../inc/hc32f4a0_mau.h | 122 + .../inc/hc32f4a0_mpu.h | 380 + .../inc/hc32f4a0_nfc.h | 635 + .../inc/hc32f4a0_ots.h | 212 + .../inc/hc32f4a0_pwc.h | 630 + .../inc/hc32f4a0_qspi.h | 430 + .../inc/hc32f4a0_rmu.h | 124 + .../inc/hc32f4a0_rtc.h | 458 + .../inc/hc32f4a0_sdioc.h | 753 + .../inc/hc32f4a0_smc.h | 379 + .../inc/hc32f4a0_spi.h | 446 + .../inc/hc32f4a0_sram.h | 252 + .../inc/hc32f4a0_swdt.h | 227 + .../inc/hc32f4a0_tmr0.h | 243 + .../inc/hc32f4a0_tmr2.h | 388 + .../inc/hc32f4a0_tmr4.h | 1052 + .../inc/hc32f4a0_tmr6.h | 895 + .../inc/hc32f4a0_tmra.h | 616 + .../inc/hc32f4a0_trng.h | 124 + .../inc/hc32f4a0_usart.h | 611 + .../inc/hc32f4a0_utility.h | 120 + .../inc/hc32f4a0_wdt.h | 228 + .../src/hc32f4a0_adc.c | 1588 + .../src/hc32f4a0_aes.c | 376 + .../src/hc32f4a0_can.c | 2107 + .../src/hc32f4a0_clk.c | 1990 + .../src/hc32f4a0_cmp.c | 782 + .../src/hc32f4a0_crc.c | 317 + .../src/hc32f4a0_ctc.c | 399 + .../src/hc32f4a0_dac.c | 636 + .../src/hc32f4a0_dcu.c | 1015 + .../src/hc32f4a0_dma.c | 1712 + .../src/hc32f4a0_dmc.c | 561 + .../src/hc32f4a0_dvp.c | 484 + .../src/hc32f4a0_efm.c | 1329 + .../src/hc32f4a0_emb.c | 923 + .../src/hc32f4a0_eth.c | 4709 + .../src/hc32f4a0_fcm.c | 383 + .../src/hc32f4a0_fmac.c | 350 + .../src/hc32f4a0_gpio.c | 651 + .../src/hc32f4a0_hash.c | 732 + .../src/hc32f4a0_hrpwm.c | 413 + .../src/hc32f4a0_i2c.c | 1631 + .../src/hc32f4a0_i2s.c | 1184 + .../src/hc32f4a0_icg.c | 124 + .../src/hc32f4a0_interrupts.c | 7673 + .../src/hc32f4a0_interrupts.txt | 1657 + .../src/hc32f4a0_keyscan.c | 232 + .../src/hc32f4a0_mau.c | 283 + .../src/hc32f4a0_mpu.c | 1106 + .../src/hc32f4a0_nfc.c | 1978 + .../src/hc32f4a0_ots.c | 445 + .../src/hc32f4a0_pwc.c | 1591 + .../src/hc32f4a0_qspi.c | 590 + .../src/hc32f4a0_rmu.c | 171 + .../src/hc32f4a0_rtc.c | 1240 + .../src/hc32f4a0_sdioc.c | 3050 + .../src/hc32f4a0_smc.c | 557 + .../src/hc32f4a0_spi.c | 1095 + .../src/hc32f4a0_sram.c | 332 + .../src/hc32f4a0_swdt.c | 262 + .../src/hc32f4a0_tmr0.c | 592 + .../src/hc32f4a0_tmr2.c | 1129 + .../src/hc32f4a0_tmr4.c | 3256 + .../src/hc32f4a0_tmr6.c | 2325 + .../src/hc32f4a0_tmra.c | 1561 + .../src/hc32f4a0_trng.c | 182 + .../src/hc32f4a0_usart.c | 2710 + .../src/hc32f4a0_utility.c | 541 + .../src/hc32f4a0_wdt.c | 263 + bsp/hc32f4a0/Libraries/SConscript | 70 + bsp/hc32f4a0/README.md | 117 + bsp/hc32f4a0/SConscript | 15 + bsp/hc32f4a0/SConstruct | 45 + bsp/hc32f4a0/applications/SConscript | 12 + bsp/hc32f4a0/applications/main.c | 75 + bsp/hc32f4a0/board/Kconfig | 336 + bsp/hc32f4a0/board/SConscript | 15 + bsp/hc32f4a0/board/board.c | 190 + bsp/hc32f4a0/board/board.h | 51 + bsp/hc32f4a0/board/board_config.c | 146 + bsp/hc32f4a0/board/board_config.h | 198 + bsp/hc32f4a0/board/linker_scripts/link.icf | 65 + bsp/hc32f4a0/board/linker_scripts/link.lds | 203 + bsp/hc32f4a0/board/linker_scripts/link.sct | 15 + bsp/hc32f4a0/drivers/SConscript | 40 + bsp/hc32f4a0/drivers/drv_dma.h | 39 + bsp/hc32f4a0/drivers/drv_gpio.c | 481 + bsp/hc32f4a0/drivers/drv_gpio.h | 152 + bsp/hc32f4a0/drivers/drv_hwtimer.c | 551 + bsp/hc32f4a0/drivers/drv_hwtimer.h | 145 + bsp/hc32f4a0/drivers/drv_irq.c | 79 + bsp/hc32f4a0/drivers/drv_irq.h | 59 + bsp/hc32f4a0/drivers/drv_pulse_encoder.c | 471 + bsp/hc32f4a0/drivers/drv_pulse_encoder.h | 241 + bsp/hc32f4a0/drivers/drv_pwm.c | 528 + bsp/hc32f4a0/drivers/drv_rtc.c | 192 + bsp/hc32f4a0/drivers/drv_soft_i2c.c | 218 + bsp/hc32f4a0/drivers/drv_soft_i2c.h | 128 + bsp/hc32f4a0/drivers/drv_spi.c | 1004 + bsp/hc32f4a0/drivers/drv_spi.h | 377 + bsp/hc32f4a0/drivers/drv_usart.c | 1546 + bsp/hc32f4a0/drivers/drv_usart.h | 56 + bsp/hc32f4a0/figures/board.jpg | Bin 0 -> 120964 bytes bsp/hc32f4a0/project.ewd | 3269 + bsp/hc32f4a0/project.ewp | 2240 + bsp/hc32f4a0/project.eww | 10 + bsp/hc32f4a0/project.uvoptx | 170 + bsp/hc32f4a0/project.uvprojx | 961 + bsp/hc32f4a0/rtconfig.h | 184 + bsp/hc32f4a0/rtconfig.py | 132 + bsp/hc32f4a0/template.ewp | 1925 + bsp/hc32f4a0/template.eww | 10 + bsp/hc32f4a0/template.uvoptx | 170 + bsp/hc32f4a0/template.uvprojx | 418 + 178 files changed, 353983 insertions(+) create mode 100644 bsp/hc32f4a0/.config create mode 100644 bsp/hc32f4a0/.gitignore create mode 100644 bsp/hc32f4a0/Kconfig create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Include/ddl_config.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Include/hc32_common.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Include/hc32_ddl.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Include/hc32f4a0.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Include/system_hc32f4a0.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/ARM/HDSC_HC32F4A0.SFR create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/ARM/startup_hc32f4a0.s create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/GCC/startup_hc32f4a0.S create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/IAR/HDSC_HC32F4A0.svd create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/IAR/startup_hc32f4a0.s create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/system_hc32f4a0.c create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_armcc.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_armclang.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_armclang_ltm.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_compiler.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_gcc.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_iccarm.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_version.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/core_armv81mml.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/core_armv8mbl.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/core_armv8mml.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm0.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm0plus.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm1.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm23.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm3.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm33.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm35p.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm4.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm7.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/core_sc000.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/core_sc300.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/mpu_armv7.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/mpu_armv8.h create mode 100644 bsp/hc32f4a0/Libraries/CMSIS/Include/tz_context.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_adc.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_aes.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_can.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_clk.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_cmp.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_crc.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_ctc.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_dac.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_dcu.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_dma.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_dmc.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_dvp.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_efm.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_emb.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_eth.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_fcm.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_fmac.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_gpio.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_hash.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_hrpwm.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_i2c.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_i2s.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_icg.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_interrupts.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_keyscan.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_mau.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_mpu.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_nfc.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_ots.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_pwc.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_qspi.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_rmu.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_rtc.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_sdioc.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_smc.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_spi.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_sram.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_swdt.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_tmr0.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_tmr2.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_tmr4.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_tmr6.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_tmra.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_trng.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_usart.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_utility.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_wdt.h create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_adc.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_aes.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_can.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_clk.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_cmp.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_crc.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_ctc.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_dac.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_dcu.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_dma.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_dmc.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_dvp.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_efm.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_emb.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_eth.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_fcm.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_fmac.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_gpio.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_hash.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_hrpwm.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_i2c.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_i2s.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_icg.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_interrupts.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_interrupts.txt create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_keyscan.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_mau.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_mpu.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_nfc.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_ots.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_pwc.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_qspi.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_rmu.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_rtc.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_sdioc.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_smc.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_spi.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_sram.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_swdt.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmr0.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmr2.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmr4.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmr6.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmra.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_trng.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_usart.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_utility.c create mode 100644 bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_wdt.c create mode 100644 bsp/hc32f4a0/Libraries/SConscript create mode 100644 bsp/hc32f4a0/README.md create mode 100644 bsp/hc32f4a0/SConscript create mode 100644 bsp/hc32f4a0/SConstruct create mode 100644 bsp/hc32f4a0/applications/SConscript create mode 100644 bsp/hc32f4a0/applications/main.c create mode 100644 bsp/hc32f4a0/board/Kconfig create mode 100644 bsp/hc32f4a0/board/SConscript create mode 100644 bsp/hc32f4a0/board/board.c create mode 100644 bsp/hc32f4a0/board/board.h create mode 100644 bsp/hc32f4a0/board/board_config.c create mode 100644 bsp/hc32f4a0/board/board_config.h create mode 100644 bsp/hc32f4a0/board/linker_scripts/link.icf create mode 100644 bsp/hc32f4a0/board/linker_scripts/link.lds create mode 100644 bsp/hc32f4a0/board/linker_scripts/link.sct create mode 100644 bsp/hc32f4a0/drivers/SConscript create mode 100644 bsp/hc32f4a0/drivers/drv_dma.h create mode 100644 bsp/hc32f4a0/drivers/drv_gpio.c create mode 100644 bsp/hc32f4a0/drivers/drv_gpio.h create mode 100644 bsp/hc32f4a0/drivers/drv_hwtimer.c create mode 100644 bsp/hc32f4a0/drivers/drv_hwtimer.h create mode 100644 bsp/hc32f4a0/drivers/drv_irq.c create mode 100644 bsp/hc32f4a0/drivers/drv_irq.h create mode 100644 bsp/hc32f4a0/drivers/drv_pulse_encoder.c create mode 100644 bsp/hc32f4a0/drivers/drv_pulse_encoder.h create mode 100644 bsp/hc32f4a0/drivers/drv_pwm.c create mode 100644 bsp/hc32f4a0/drivers/drv_rtc.c create mode 100644 bsp/hc32f4a0/drivers/drv_soft_i2c.c create mode 100644 bsp/hc32f4a0/drivers/drv_soft_i2c.h create mode 100644 bsp/hc32f4a0/drivers/drv_spi.c create mode 100644 bsp/hc32f4a0/drivers/drv_spi.h create mode 100644 bsp/hc32f4a0/drivers/drv_usart.c create mode 100644 bsp/hc32f4a0/drivers/drv_usart.h create mode 100644 bsp/hc32f4a0/figures/board.jpg create mode 100644 bsp/hc32f4a0/project.ewd create mode 100644 bsp/hc32f4a0/project.ewp create mode 100644 bsp/hc32f4a0/project.eww create mode 100644 bsp/hc32f4a0/project.uvoptx create mode 100644 bsp/hc32f4a0/project.uvprojx create mode 100644 bsp/hc32f4a0/rtconfig.h create mode 100644 bsp/hc32f4a0/rtconfig.py create mode 100644 bsp/hc32f4a0/template.ewp create mode 100644 bsp/hc32f4a0/template.eww create mode 100644 bsp/hc32f4a0/template.uvoptx create mode 100644 bsp/hc32f4a0/template.uvprojx diff --git a/bsp/hc32f4a0/.config b/bsp/hc32f4a0/.config new file mode 100644 index 0000000000..bd8816050a --- /dev/null +++ b/bsp/hc32f4a0/.config @@ -0,0 +1,533 @@ +# +# Automatically generated file; DO NOT EDIT. +# RT-Thread Project Configuration +# + +# +# RT-Thread Kernel +# +CONFIG_RT_NAME_MAX=8 +# CONFIG_RT_USING_ARCH_DATA_TYPE is not set +# CONFIG_RT_USING_SMP is not set +CONFIG_RT_ALIGN_SIZE=4 +# CONFIG_RT_THREAD_PRIORITY_8 is not set +CONFIG_RT_THREAD_PRIORITY_32=y +# CONFIG_RT_THREAD_PRIORITY_256 is not set +CONFIG_RT_THREAD_PRIORITY_MAX=32 +CONFIG_RT_TICK_PER_SECOND=1000 +CONFIG_RT_USING_OVERFLOW_CHECK=y +CONFIG_RT_USING_HOOK=y +CONFIG_RT_USING_IDLE_HOOK=y +CONFIG_RT_IDLE_HOOK_LIST_SIZE=4 +CONFIG_IDLE_THREAD_STACK_SIZE=256 +CONFIG_RT_USING_TIMER_SOFT=y +CONFIG_RT_TIMER_THREAD_PRIO=4 +CONFIG_RT_TIMER_THREAD_STACK_SIZE=512 +CONFIG_RT_DEBUG=y +# CONFIG_RT_DEBUG_COLOR is not set +# CONFIG_RT_DEBUG_INIT_CONFIG is not set +# CONFIG_RT_DEBUG_THREAD_CONFIG is not set +# CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set +# CONFIG_RT_DEBUG_IPC_CONFIG is not set +# CONFIG_RT_DEBUG_TIMER_CONFIG is not set +# CONFIG_RT_DEBUG_IRQ_CONFIG is not set +# CONFIG_RT_DEBUG_MEM_CONFIG is not set +# CONFIG_RT_DEBUG_SLAB_CONFIG is not set +# CONFIG_RT_DEBUG_MEMHEAP_CONFIG is not set +# CONFIG_RT_DEBUG_MODULE_CONFIG is not set + +# +# Inter-Thread communication +# +CONFIG_RT_USING_SEMAPHORE=y +CONFIG_RT_USING_MUTEX=y +CONFIG_RT_USING_EVENT=y +CONFIG_RT_USING_MAILBOX=y +CONFIG_RT_USING_MESSAGEQUEUE=y +# CONFIG_RT_USING_SIGNALS is not set + +# +# Memory Management +# +CONFIG_RT_USING_MEMPOOL=y +# CONFIG_RT_USING_MEMHEAP is not set +# CONFIG_RT_USING_NOHEAP is not set +CONFIG_RT_USING_SMALL_MEM=y +# CONFIG_RT_USING_SLAB is not set +# CONFIG_RT_USING_USERHEAP is not set +# CONFIG_RT_USING_MEMTRACE is not set +CONFIG_RT_USING_HEAP=y + +# +# Kernel Device Object +# +CONFIG_RT_USING_DEVICE=y +# CONFIG_RT_USING_DEVICE_OPS is not set +# CONFIG_RT_USING_INTERRUPT_INFO is not set +CONFIG_RT_USING_CONSOLE=y +CONFIG_RT_CONSOLEBUF_SIZE=128 +CONFIG_RT_CONSOLE_DEVICE_NAME="uart1" +CONFIG_RT_VER_NUM=0x40003 +CONFIG_ARCH_ARM=y +CONFIG_RT_USING_CPU_FFS=y +CONFIG_ARCH_ARM_CORTEX_M=y +CONFIG_ARCH_ARM_CORTEX_M4=y +# CONFIG_ARCH_CPU_STACK_GROWS_UPWARD is not set + +# +# RT-Thread Components +# +CONFIG_RT_USING_COMPONENTS_INIT=y +CONFIG_RT_USING_USER_MAIN=y +CONFIG_RT_MAIN_THREAD_STACK_SIZE=2048 +CONFIG_RT_MAIN_THREAD_PRIORITY=10 + +# +# C++ features +# +# CONFIG_RT_USING_CPLUSPLUS is not set + +# +# Command shell +# +CONFIG_RT_USING_FINSH=y +CONFIG_FINSH_THREAD_NAME="tshell" +CONFIG_FINSH_USING_HISTORY=y +CONFIG_FINSH_HISTORY_LINES=5 +CONFIG_FINSH_USING_SYMTAB=y +CONFIG_FINSH_USING_DESCRIPTION=y +# CONFIG_FINSH_ECHO_DISABLE_DEFAULT is not set +CONFIG_FINSH_THREAD_PRIORITY=20 +CONFIG_FINSH_THREAD_STACK_SIZE=4096 +CONFIG_FINSH_CMD_SIZE=80 +# CONFIG_FINSH_USING_AUTH is not set +CONFIG_FINSH_USING_MSH=y +CONFIG_FINSH_USING_MSH_DEFAULT=y +# CONFIG_FINSH_USING_MSH_ONLY is not set +CONFIG_FINSH_ARG_MAX=10 + +# +# Device virtual file system +# +CONFIG_RT_USING_DFS=y +CONFIG_DFS_USING_WORKDIR=y +CONFIG_DFS_FILESYSTEMS_MAX=2 +CONFIG_DFS_FILESYSTEM_TYPES_MAX=2 +CONFIG_DFS_FD_MAX=16 +# CONFIG_RT_USING_DFS_MNTTABLE is not set +# CONFIG_RT_USING_DFS_ELMFAT is not set +CONFIG_RT_USING_DFS_DEVFS=y +# CONFIG_RT_USING_DFS_ROMFS is not set +# CONFIG_RT_USING_DFS_RAMFS is not set +# CONFIG_RT_USING_DFS_UFFS is not set +# CONFIG_RT_USING_DFS_JFFS2 is not set + +# +# Device Drivers +# +CONFIG_RT_USING_DEVICE_IPC=y +CONFIG_RT_PIPE_BUFSZ=512 +# CONFIG_RT_USING_SYSTEM_WORKQUEUE is not set +CONFIG_RT_USING_SERIAL=y +CONFIG_RT_SERIAL_USING_DMA=y +CONFIG_RT_SERIAL_RB_BUFSZ=64 +# CONFIG_RT_USING_CAN is not set +# CONFIG_RT_USING_HWTIMER is not set +# CONFIG_RT_USING_CPUTIME is not set +# CONFIG_RT_USING_I2C is not set +# CONFIG_RT_USING_PHY is not set +CONFIG_RT_USING_PIN=y +# CONFIG_RT_USING_ADC is not set +# CONFIG_RT_USING_DAC is not set +# CONFIG_RT_USING_PWM is not set +# CONFIG_RT_USING_MTD_NOR is not set +# CONFIG_RT_USING_MTD_NAND is not set +# CONFIG_RT_USING_PM is not set +# CONFIG_RT_USING_RTC is not set +# CONFIG_RT_USING_SDIO is not set +# CONFIG_RT_USING_SPI is not set +# CONFIG_RT_USING_WDT is not set +# CONFIG_RT_USING_AUDIO is not set +# CONFIG_RT_USING_SENSOR is not set +# CONFIG_RT_USING_TOUCH is not set +# CONFIG_RT_USING_HWCRYPTO is not set +# CONFIG_RT_USING_PULSE_ENCODER is not set +# CONFIG_RT_USING_INPUT_CAPTURE is not set +# CONFIG_RT_USING_WIFI is not set + +# +# Using USB +# +# CONFIG_RT_USING_USB_HOST is not set +# CONFIG_RT_USING_USB_DEVICE is not set + +# +# POSIX layer and C standard library +# +CONFIG_RT_USING_LIBC=y +# CONFIG_RT_USING_PTHREADS is not set +CONFIG_RT_USING_POSIX=y +# CONFIG_RT_USING_POSIX_MMAP is not set +# CONFIG_RT_USING_POSIX_TERMIOS is not set +# CONFIG_RT_USING_POSIX_GETLINE is not set +# CONFIG_RT_USING_POSIX_AIO is not set +# CONFIG_RT_USING_MODULE is not set + +# +# Network +# + +# +# Socket abstraction layer +# +# CONFIG_RT_USING_SAL is not set + +# +# Network interface device +# +# CONFIG_RT_USING_NETDEV is not set + +# +# light weight TCP/IP stack +# +# CONFIG_RT_USING_LWIP is not set + +# +# AT commands +# +# CONFIG_RT_USING_AT is not set + +# +# VBUS(Virtual Software BUS) +# +# CONFIG_RT_USING_VBUS is not set + +# +# Utilities +# +# CONFIG_RT_USING_RYM is not set +# CONFIG_RT_USING_ULOG is not set +# CONFIG_RT_USING_UTEST is not set +# CONFIG_RT_USING_LWP is not set + +# +# RT-Thread online packages +# + +# +# IoT - internet of things +# +# CONFIG_PKG_USING_LORAWAN_DRIVER is not set +# CONFIG_PKG_USING_PAHOMQTT is not set +# CONFIG_PKG_USING_UMQTT is not set +# CONFIG_PKG_USING_WEBCLIENT is not set +# CONFIG_PKG_USING_WEBNET is not set +# CONFIG_PKG_USING_MONGOOSE is not set +# CONFIG_PKG_USING_MYMQTT is not set +# CONFIG_PKG_USING_KAWAII_MQTT is not set +# CONFIG_PKG_USING_BC28_MQTT is not set +# CONFIG_PKG_USING_WEBTERMINAL is not set +# CONFIG_PKG_USING_CJSON is not set +# CONFIG_PKG_USING_JSMN is not set +# CONFIG_PKG_USING_LIBMODBUS is not set +# CONFIG_PKG_USING_FREEMODBUS is not set +# CONFIG_PKG_USING_LJSON is not set +# CONFIG_PKG_USING_EZXML is not set +# CONFIG_PKG_USING_NANOPB is not set + +# +# Wi-Fi +# + +# +# Marvell WiFi +# +# CONFIG_PKG_USING_WLANMARVELL is not set + +# +# Wiced WiFi +# +# CONFIG_PKG_USING_WLAN_WICED is not set +# CONFIG_PKG_USING_RW007 is not set +# CONFIG_PKG_USING_COAP is not set +# CONFIG_PKG_USING_NOPOLL is not set +# CONFIG_PKG_USING_NETUTILS is not set +# CONFIG_PKG_USING_CMUX is not set +# CONFIG_PKG_USING_PPP_DEVICE is not set +# CONFIG_PKG_USING_AT_DEVICE is not set +# CONFIG_PKG_USING_ATSRV_SOCKET is not set +# CONFIG_PKG_USING_WIZNET is not set + +# +# IoT Cloud +# +# CONFIG_PKG_USING_ONENET is not set +# CONFIG_PKG_USING_GAGENT_CLOUD is not set +# CONFIG_PKG_USING_ALI_IOTKIT is not set +# CONFIG_PKG_USING_AZURE is not set +# CONFIG_PKG_USING_TENCENT_IOT_EXPLORER is not set +# CONFIG_PKG_USING_JIOT-C-SDK is not set +# CONFIG_PKG_USING_UCLOUD_IOT_SDK is not set +# CONFIG_PKG_USING_JOYLINK is not set +# CONFIG_PKG_USING_NIMBLE is not set +# CONFIG_PKG_USING_OTA_DOWNLOADER is not set +# CONFIG_PKG_USING_IPMSG is not set +# CONFIG_PKG_USING_LSSDP is not set +# CONFIG_PKG_USING_AIRKISS_OPEN is not set +# CONFIG_PKG_USING_LIBRWS is not set +# CONFIG_PKG_USING_TCPSERVER is not set +# CONFIG_PKG_USING_PROTOBUF_C is not set +# CONFIG_PKG_USING_ONNX_PARSER is not set +# CONFIG_PKG_USING_ONNX_BACKEND is not set +# CONFIG_PKG_USING_DLT645 is not set +# CONFIG_PKG_USING_QXWZ is not set +# CONFIG_PKG_USING_SMTP_CLIENT is not set +# CONFIG_PKG_USING_ABUP_FOTA is not set +# CONFIG_PKG_USING_LIBCURL2RTT is not set +# CONFIG_PKG_USING_CAPNP is not set +# CONFIG_PKG_USING_RT_CJSON_TOOLS is not set +# CONFIG_PKG_USING_AGILE_TELNET is not set +# CONFIG_PKG_USING_NMEALIB is not set +# CONFIG_PKG_USING_AGILE_JSMN is not set +# CONFIG_PKG_USING_PDULIB is not set +# CONFIG_PKG_USING_BTSTACK is not set +# CONFIG_PKG_USING_LORAWAN_ED_STACK is not set +# CONFIG_PKG_USING_WAYZ_IOTKIT is not set + +# +# security packages +# +# CONFIG_PKG_USING_MBEDTLS is not set +# CONFIG_PKG_USING_libsodium is not set +# CONFIG_PKG_USING_TINYCRYPT is not set +# CONFIG_PKG_USING_TFM is not set +# CONFIG_PKG_USING_YD_CRYPTO is not set + +# +# language packages +# +# CONFIG_PKG_USING_LUA is not set +# CONFIG_PKG_USING_JERRYSCRIPT is not set +# CONFIG_PKG_USING_MICROPYTHON is not set + +# +# multimedia packages +# +# CONFIG_PKG_USING_OPENMV is not set +# CONFIG_PKG_USING_MUPDF is not set +# CONFIG_PKG_USING_STEMWIN is not set +# CONFIG_PKG_USING_WAVPLAYER is not set +# CONFIG_PKG_USING_TJPGD is not set +# CONFIG_PKG_USING_HELIX is not set +# CONFIG_PKG_USING_AZUREGUIX is not set +# CONFIG_PKG_USING_TOUCHGFX2RTT is not set + +# +# tools packages +# +# CONFIG_PKG_USING_CMBACKTRACE is not set +# CONFIG_PKG_USING_EASYFLASH is not set +# CONFIG_PKG_USING_EASYLOGGER is not set +# CONFIG_PKG_USING_SYSTEMVIEW is not set +# CONFIG_PKG_USING_RDB is not set +# CONFIG_PKG_USING_QRCODE is not set +# CONFIG_PKG_USING_ULOG_EASYFLASH is not set +# CONFIG_PKG_USING_ADBD is not set +# CONFIG_PKG_USING_COREMARK is not set +# CONFIG_PKG_USING_DHRYSTONE is not set +# CONFIG_PKG_USING_MEMORYPERF is not set +# CONFIG_PKG_USING_NR_MICRO_SHELL is not set +# CONFIG_PKG_USING_CHINESE_FONT_LIBRARY is not set +# CONFIG_PKG_USING_LUNAR_CALENDAR is not set +# CONFIG_PKG_USING_BS8116A is not set +# CONFIG_PKG_USING_GPS_RMC is not set +# CONFIG_PKG_USING_URLENCODE is not set +# CONFIG_PKG_USING_UMCN is not set +# CONFIG_PKG_USING_LWRB2RTT is not set +# CONFIG_PKG_USING_CPU_USAGE is not set +# CONFIG_PKG_USING_GBK2UTF8 is not set +# CONFIG_PKG_USING_VCONSOLE is not set + +# +# system packages +# +# CONFIG_PKG_USING_GUIENGINE is not set +# CONFIG_PKG_USING_PERSIMMON is not set +# CONFIG_PKG_USING_CAIRO is not set +# CONFIG_PKG_USING_PIXMAN is not set +# CONFIG_PKG_USING_LWEXT4 is not set +# CONFIG_PKG_USING_PARTITION is not set +# CONFIG_PKG_USING_FAL is not set +# CONFIG_PKG_USING_FLASHDB is not set +# CONFIG_PKG_USING_SQLITE is not set +# CONFIG_PKG_USING_RTI is not set +# CONFIG_PKG_USING_LITTLEVGL2RTT is not set +# CONFIG_PKG_USING_CMSIS is not set +# CONFIG_PKG_USING_DFS_YAFFS is not set +# CONFIG_PKG_USING_LITTLEFS is not set +# CONFIG_PKG_USING_THREAD_POOL is not set +# CONFIG_PKG_USING_ROBOTS is not set +# CONFIG_PKG_USING_EV is not set +# CONFIG_PKG_USING_SYSWATCH is not set +# CONFIG_PKG_USING_SYS_LOAD_MONITOR is not set +# CONFIG_PKG_USING_PLCCORE is not set +# CONFIG_PKG_USING_RAMDISK is not set +# CONFIG_PKG_USING_MININI is not set +# CONFIG_PKG_USING_QBOOT is not set + +# +# Micrium: Micrium software products porting for RT-Thread +# +# CONFIG_PKG_USING_UCOSIII_WRAPPER is not set +# CONFIG_PKG_USING_UCOSII_WRAPPER is not set +# CONFIG_PKG_USING_UC_CRC is not set +# CONFIG_PKG_USING_UC_CLK is not set +# CONFIG_PKG_USING_UC_COMMON is not set +# CONFIG_PKG_USING_UC_MODBUS is not set +# CONFIG_PKG_USING_PPOOL is not set + +# +# peripheral libraries and drivers +# +# CONFIG_PKG_USING_SENSORS_DRIVERS is not set +# CONFIG_PKG_USING_REALTEK_AMEBA is not set +# CONFIG_PKG_USING_SHT2X is not set +# CONFIG_PKG_USING_SHT3X is not set +# CONFIG_PKG_USING_STM32_SDIO is not set +# CONFIG_PKG_USING_ICM20608 is not set +# CONFIG_PKG_USING_U8G2 is not set +# CONFIG_PKG_USING_BUTTON is not set +# CONFIG_PKG_USING_PCF8574 is not set +# CONFIG_PKG_USING_SX12XX is not set +# CONFIG_PKG_USING_SIGNAL_LED is not set +# CONFIG_PKG_USING_LEDBLINK is not set +# CONFIG_PKG_USING_LITTLED is not set +# CONFIG_PKG_USING_LKDGUI is not set +# CONFIG_PKG_USING_NRF5X_SDK is not set +# CONFIG_PKG_USING_NRFX is not set +# CONFIG_PKG_USING_WM_LIBRARIES is not set +# CONFIG_PKG_USING_KENDRYTE_SDK is not set +# CONFIG_PKG_USING_INFRARED is not set +# CONFIG_PKG_USING_ROSSERIAL is not set +# CONFIG_PKG_USING_AGILE_BUTTON is not set +# CONFIG_PKG_USING_AGILE_LED is not set +# CONFIG_PKG_USING_AT24CXX is not set +# CONFIG_PKG_USING_MOTIONDRIVER2RTT is not set +# CONFIG_PKG_USING_AD7746 is not set +# CONFIG_PKG_USING_PCA9685 is not set +# CONFIG_PKG_USING_I2C_TOOLS is not set +# CONFIG_PKG_USING_NRF24L01 is not set +# CONFIG_PKG_USING_TOUCH_DRIVERS is not set +# CONFIG_PKG_USING_MAX17048 is not set +# CONFIG_PKG_USING_RPLIDAR is not set +# CONFIG_PKG_USING_AS608 is not set +# CONFIG_PKG_USING_RC522 is not set +# CONFIG_PKG_USING_WS2812B is not set +# CONFIG_PKG_USING_EMBARC_BSP is not set +# CONFIG_PKG_USING_EXTERN_RTC_DRIVERS is not set +# CONFIG_PKG_USING_MULTI_RTIMER is not set +# CONFIG_PKG_USING_MAX7219 is not set +# CONFIG_PKG_USING_BEEP is not set +# CONFIG_PKG_USING_EASYBLINK is not set +# CONFIG_PKG_USING_PMS_SERIES is not set +# CONFIG_PKG_USING_CAN_YMODEM is not set +# CONFIG_PKG_USING_LORA_RADIO_DRIVER is not set +# CONFIG_PKG_USING_QLED is not set +# CONFIG_PKG_USING_PAJ7620 is not set +# CONFIG_PKG_USING_AGILE_CONSOLE is not set +# CONFIG_PKG_USING_LD3320 is not set +# CONFIG_PKG_USING_WK2124 is not set +# CONFIG_PKG_USING_LY68L6400 is not set +# CONFIG_PKG_USING_DM9051 is not set +# CONFIG_PKG_USING_SSD1306 is not set +# CONFIG_PKG_USING_QKEY is not set +# CONFIG_PKG_USING_RS485 is not set +# CONFIG_PKG_USING_NES is not set +# CONFIG_PKG_USING_VIRTUAL_SENSOR is not set +# CONFIG_PKG_USING_VDEVICE is not set + +# +# miscellaneous packages +# +# CONFIG_PKG_USING_LIBCSV is not set +# CONFIG_PKG_USING_OPTPARSE is not set +# CONFIG_PKG_USING_FASTLZ is not set +# CONFIG_PKG_USING_MINILZO is not set +# CONFIG_PKG_USING_QUICKLZ is not set +# CONFIG_PKG_USING_LZMA is not set +# CONFIG_PKG_USING_MULTIBUTTON is not set +# CONFIG_PKG_USING_FLEXIBLE_BUTTON is not set +# CONFIG_PKG_USING_CANFESTIVAL is not set +# CONFIG_PKG_USING_ZLIB is not set +# CONFIG_PKG_USING_DSTR is not set +# CONFIG_PKG_USING_TINYFRAME is not set +# CONFIG_PKG_USING_KENDRYTE_DEMO is not set +# CONFIG_PKG_USING_DIGITALCTRL is not set +# CONFIG_PKG_USING_UPACKER is not set +# CONFIG_PKG_USING_UPARAM is not set + +# +# samples: kernel and components samples +# +# CONFIG_PKG_USING_KERNEL_SAMPLES is not set +# CONFIG_PKG_USING_FILESYSTEM_SAMPLES is not set +# CONFIG_PKG_USING_NETWORK_SAMPLES is not set +# CONFIG_PKG_USING_PERIPHERAL_SAMPLES is not set +# CONFIG_PKG_USING_HELLO is not set +# CONFIG_PKG_USING_VI is not set +# CONFIG_PKG_USING_KI is not set +# CONFIG_PKG_USING_NNOM is not set +# CONFIG_PKG_USING_LIBANN is not set +# CONFIG_PKG_USING_ELAPACK is not set +# CONFIG_PKG_USING_ARMv7M_DWT is not set +# CONFIG_PKG_USING_VT100 is not set +# CONFIG_PKG_USING_ULAPACK is not set +# CONFIG_PKG_USING_UKAL is not set +# CONFIG_PKG_USING_CRCLIB is not set + +# +# games: games run on RT-Thread console +# +# CONFIG_PKG_USING_THREES is not set +# CONFIG_PKG_USING_2048 is not set +# CONFIG_PKG_USING_SNAKE is not set +# CONFIG_PKG_USING_TETRIS is not set +# CONFIG_PKG_USING_LWGPS is not set +# CONFIG_PKG_USING_TENSORFLOWLITEMICRO is not set + +# +# Hardware Drivers Config +# +CONFIG_MCU_HC32F4A0=y + +# +# Onboard Peripheral Drivers +# + +# +# On-chip Peripheral Drivers +# +CONFIG_BSP_USING_GPIO=y +CONFIG_BSP_USING_UART=y +CONFIG_BSP_USING_UART1=y +CONFIG_BSP_UART1_RX_USING_DMA=y +CONFIG_BSP_UART1_TX_USING_DMA=y +# CONFIG_BSP_USING_UART2 is not set +# CONFIG_BSP_USING_UART3 is not set +# CONFIG_BSP_USING_UART4 is not set +# CONFIG_BSP_USING_UART5 is not set +# CONFIG_BSP_USING_UART6 is not set +# CONFIG_BSP_USING_UART7 is not set +# CONFIG_BSP_USING_UART8 is not set +# CONFIG_BSP_USING_UART9 is not set +# CONFIG_BSP_USING_UART10 is not set +# CONFIG_BSP_USING_I2C1 is not set +# CONFIG_BSP_USING_SPI is not set +# CONFIG_BSP_USING_RTC is not set +# CONFIG_BSP_USING_PWM is not set +# CONFIG_BSP_USING_TIMER is not set +# CONFIG_BSP_USING_PULSE_ENCODER is not set + +# +# Board extended module Drivers +# diff --git a/bsp/hc32f4a0/.gitignore b/bsp/hc32f4a0/.gitignore new file mode 100644 index 0000000000..7221bde019 --- /dev/null +++ b/bsp/hc32f4a0/.gitignore @@ -0,0 +1,42 @@ +*.pyc +*.map +*.dblite +*.elf +*.bin +*.hex +*.axf +*.exe +*.pdb +*.idb +*.ilk +*.old +build +Debug +documentation/html +packages/ +*~ +*.o +*.obj +*.out +*.bak +*.dep +*.lib +*.i +*.d +.DS_Stor* +.config 3 +.config 4 +.config 5 +Midea-X1 +*.uimg +GPATH +GRTAGS +GTAGS +.vscode +JLinkLog.txt +JLinkSettings.ini +DebugConfig/ +RTE/ +settings/ +*.uvguix* +cconfig.h diff --git a/bsp/hc32f4a0/Kconfig b/bsp/hc32f4a0/Kconfig new file mode 100644 index 0000000000..f4ed99b3fa --- /dev/null +++ b/bsp/hc32f4a0/Kconfig @@ -0,0 +1,23 @@ +mainmenu "RT-Thread Project Configuration" + +config BSP_DIR + string + option env="BSP_ROOT" + default "." + +config RTT_DIR + string + option env="RTT_ROOT" + default "../.." + +config PKGS_DIR + string + option env="PKGS_ROOT" + default "packages" + +source "$RTT_DIR/Kconfig" +source "$PKGS_DIR/Kconfig" +source "board/Kconfig" + + + diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Include/ddl_config.h b/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Include/ddl_config.h new file mode 100644 index 0000000000..980e6cb205 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Include/ddl_config.h @@ -0,0 +1,214 @@ +/** + ******************************************************************************* + * @file adc/adc_01_base/source/ddl_config.h + * @brief This file contains HC32 Series Device Driver Library usage management. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Yangjp First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __DDL_CONFIG_H__ +#define __DDL_CONFIG_H__ + +/******************************************************************************* + * Include files + ******************************************************************************/ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/* Chip module on-off define */ +#define DDL_ON (1U) +#define DDL_OFF (0U) + +/** + * @brief This is the list of modules to be used in the Device Driver Library. + * Select the modules you need to use to DDL_ON. + * @note DDL_ICG_ENABLE must be turned on(DDL_ON) to ensure that the chip works + * properly. + * @note DDL_UTILITY_ENABLE must be turned on(DDL_ON) if using Device Driver + * Library. + * @note DDL_PRINT_ENABLE must be turned on(DDL_ON) if using printf function. + */ +#define DDL_ICG_ENABLE (DDL_ON) +#define DDL_UTILITY_ENABLE (DDL_ON) +#define DDL_PRINT_ENABLE (DDL_ON) + +#define DDL_ADC_ENABLE (DDL_ON) +#define DDL_AES_ENABLE (DDL_ON) +#define DDL_CAN_ENABLE (DDL_ON) +#define DDL_CLK_ENABLE (DDL_ON) +#define DDL_CMP_ENABLE (DDL_ON) +#define DDL_CRC_ENABLE (DDL_ON) +#define DDL_CTC_ENABLE (DDL_ON) +#define DDL_DAC_ENABLE (DDL_ON) +#define DDL_DCU_ENABLE (DDL_ON) +#define DDL_DMA_ENABLE (DDL_ON) +#define DDL_DMC_ENABLE (DDL_ON) +#define DDL_DVP_ENABLE (DDL_ON) +#define DDL_EFM_ENABLE (DDL_ON) +#define DDL_EMB_ENABLE (DDL_ON) +#define DDL_ETH_ENABLE (DDL_ON) +#define DDL_EVENT_PORT_ENABLE (DDL_OFF) +#define DDL_FCM_ENABLE (DDL_ON) +#define DDL_FMAC_ENABLE (DDL_ON) +#define DDL_GPIO_ENABLE (DDL_ON) +#define DDL_HASH_ENABLE (DDL_ON) +#define DDL_HRPWM_ENABLE (DDL_ON) +#define DDL_I2C_ENABLE (DDL_ON) +#define DDL_I2S_ENABLE (DDL_ON) +#define DDL_INTERRUPTS_ENABLE (DDL_ON) +#define DDL_KEYSCAN_ENABLE (DDL_ON) +#define DDL_MAU_ENABLE (DDL_ON) +#define DDL_MPU_ENABLE (DDL_ON) +#define DDL_NFC_ENABLE (DDL_ON) +#define DDL_OTS_ENABLE (DDL_ON) +#define DDL_PWC_ENABLE (DDL_ON) +#define DDL_QSPI_ENABLE (DDL_ON) +#define DDL_RMU_ENABLE (DDL_ON) +#define DDL_RTC_ENABLE (DDL_ON) +#define DDL_SDIOC_ENABLE (DDL_ON) +#define DDL_SMC_ENABLE (DDL_ON) +#define DDL_SPI_ENABLE (DDL_ON) +#define DDL_SRAM_ENABLE (DDL_ON) +#define DDL_SWDT_ENABLE (DDL_ON) +#define DDL_TMR0_ENABLE (DDL_ON) +#define DDL_TMR2_ENABLE (DDL_ON) +#define DDL_TMR4_ENABLE (DDL_ON) +#define DDL_TMR6_ENABLE (DDL_ON) +#define DDL_TMRA_ENABLE (DDL_ON) +#define DDL_TRNG_ENABLE (DDL_ON) +#define DDL_USART_ENABLE (DDL_ON) +#define DDL_USBFS_ENABLE (DDL_OFF) +#define DDL_USBHS_ENABLE (DDL_OFF) +#define DDL_WDT_ENABLE (DDL_ON) + +/* BSP on-off define */ +#define BSP_ON (1U) +#define BSP_OFF (0U) + +/** + * @brief The following is a list of currently supported BSP boards. + */ +#define BSP_EV_HC32F4A0_LQFP176 (1U) +#define BSP_MS_HC32F4A0_LQFP176_050_MEM (2U) + +/** + * @brief The macro BSP_EV_HC32F4A0 is used to specify the BSP board currently + * in use. + * The value should be set to one of the list of currently supported BSP boards. + * @note If there is no supported BSP board or the BSP function is not used, + * the value needs to be set to BSP_EV_HC32F4A0. + */ +#define BSP_EV_HC32F4A0 (BSP_EV_HC32F4A0) + +/** + * @brief This is the list of BSP components to be used. + * Select the components you need to use to BSP_ON. + */ +#define BSP_CY62167EV30LL_ENABLE (BSP_OFF) +#define BSP_IS42S16400J7TLI_ENABLE (BSP_OFF) +#define BSP_IS62WV51216_ENABLE (BSP_OFF) +#define BSP_MT29F2G08AB_ENABLE (BSP_OFF) +#define BSP_NT35510_ENABLE (BSP_OFF) +#define BSP_OV5640_ENABLE (BSP_OFF) +#define BSP_S29GL064N90TFI03_ENABLE (BSP_OFF) +#define BSP_TCA9539_ENABLE (BSP_OFF) +#define BSP_W25QXX_ENABLE (BSP_OFF) +#define BSP_WM8731_ENABLE (BSP_OFF) + +/** + * @brief Ethernet and PHY Configuration. + * @note PHY delay these values are based on a 1 ms Systick interrupt. + */ +/* MAC ADDRESS */ +#define ETH_MAC_ADDR0 (2U) +#define ETH_MAC_ADDR1 (0U) +#define ETH_MAC_ADDR2 (0U) +#define ETH_MAC_ADDR3 (0U) +#define ETH_MAC_ADDR4 (0U) +#define ETH_MAC_ADDR5 (0U) + +/* Ethernet driver buffers size and count */ +#define ETH_TXBUF_SIZE (ETH_PACKET_MAX_SIZE) /* Buffer size for receive */ +#define ETH_RXBUF_SIZE (ETH_PACKET_MAX_SIZE) /* Buffer size for transmit */ +#define ETH_TXBUF_NUMBER (4UL) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_RXBUF_NUMBER (4UL) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* PHY Address*/ +#define PHY_ADDRESS (0x00U) /* RTL8201F */ + +/* PHY Configuration delay */ +#define PHY_HW_RESET_DELAY (0x0000003FUL) +#define PHY_RESET_DELAY (0x0000007FUL) +#define PHY_CONFIG_DELAY (0x0000003FUL) +#define PHY_READ_TIMEOUT (0x00000005UL) +#define PHY_WRITE_TIMEOUT (0x00000005UL) + +/* Common PHY Registers */ +#define PHY_BCR (0x00U) /*!< Basic Control Register */ +#define PHY_BSR (0x01U) /*!< Basic Status Register */ + +#define PHY_SOFT_RESET (0x8000U) /*!< PHY Soft Reset */ +#define PHY_LOOPBACK (0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M (0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M (0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M (0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M (0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION (0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_POWERDOWN (0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE (0x0400U) /*!< Isolate PHY from MII */ +#define PHY_RESTART_AUTONEGOTIATION (0x0200U) /*!< Restart auto-negotiation function */ + +#define PHY_100BASE_TX_FD (0x4000U) /*!< 100Base-TX full duplex support */ +#define PHY_100BASE_TX_HD (0x2000U) /*!< 100Base-TX half duplex support */ +#define PHY_10BASE_T_FD (0x1000U) /*!< 10Base-T full duplex support */ +#define PHY_10BASE_T_HD (0x0800U) /*!< 10Base-T half duplex support */ +#define PHY_AUTONEGO_COMPLETE (0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINK_STATUS (0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION (0x0002U) /*!< Jabber condition detected */ + +/** + * @brief External clock source for I2S peripheral + */ +#ifndef I2S_EXT_CLK_FREQ + #define I2S_EXT_CLK_FREQ (12288000UL) /*!< Value of the external oscillator */ +#endif /* I2S_EXT_CLK_FREQ */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + * Global function prototypes (definition in C source) + ******************************************************************************/ + +#ifdef __cplusplus +} +#endif + +#endif /* __DDL_CONFIG_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Include/hc32_common.h b/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Include/hc32_common.h new file mode 100644 index 0000000000..12e7b2ecdc --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Include/hc32_common.h @@ -0,0 +1,319 @@ +/** + ******************************************************************************* + * @file hc32_common.h + * @brief This file contains the common part of the HC32 series. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Yangjp First version + 2020-09-07 Yangjp Add the precompiled configuration of ARM compiler V6 + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32_COMMON_H__ +#define __HC32_COMMON_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include +#include + +/** + * @addtogroup CMSIS + * @{ + */ + +/** + * @addtogroup HC32_Common_Part + * @{ + */ + +/** + * @brief HC32 Common Device Include + */ +#if defined(HC32F120) + #include "hc32f120.h" + #include "system_hc32f120.h" +#elif defined(HC32F4A0) + #include "hc32f4a0.h" + #include "system_hc32f4a0.h" +#elif defined(HC32M120) + #include "hc32m120.h" + #include "system_hc32m120.h" +#elif defined(HC32M423) + #include "hc32m423.h" + #include "system_hc32m423.h" +#else + #error "Please select first the target HC32xxxx device used in your application (in hc32xxxx.h file)" +#endif + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup HC32_Common_Global_Types HC32 Common Global Types + * @{ + */ + +/** + * @brief Single precision floating point number (4 byte) + */ +typedef float float32_t; + +/** + * @brief Double precision floating point number (8 byte) + */ +typedef double float64_t; + +/** + * @brief Function pointer type to void/void function + */ +typedef void (*func_ptr_t)(void); + +/** + * @brief Function pointer type to void/uint8_t function + */ +typedef void (*func_ptr_arg1_t)(uint8_t); + +/** + * @brief Functional state + */ +typedef enum +{ + Disable = 0U, + Enable = 1U, +} en_functional_state_t; + +/* Check if it is a functional state */ +#define IS_FUNCTIONAL_STATE(state) (((state) == Disable) || ((state) == Enable)) + +/** + * @brief Flag status + */ +typedef enum +{ + Reset = 0U, + Set = 1U, +} en_flag_status_t, en_int_status_t; + +/** + * @brief Generic error codes + */ +typedef enum +{ + Ok = 0U, /*!< No error */ + Error = 1U, /*!< Non-specific error code */ + ErrorAddressAlignment = 2U, /*!< Address alignment does not match */ + ErrorAccessRights = 3U, /*!< Wrong mode (e.g. user/system) mode is set */ + ErrorInvalidParameter = 4U, /*!< Provided parameter is not valid */ + ErrorOperationInProgress = 5U, /*!< A conflicting or requested operation is still in progress */ + ErrorInvalidMode = 6U, /*!< Operation not allowed in current mode */ + ErrorUninitialized = 7U, /*!< Module (or part of it) was not initialized properly */ + ErrorBufferEmpty = 8U, /*!< Circular buffer can not be read because the buffer is empty */ + ErrorBufferFull = 9U, /*!< Circular buffer can not be written because the buffer is full */ + ErrorTimeout = 10U, /*!< Time Out error occurred (e.g. I2C arbitration lost, Flash time-out, etc.) */ + ErrorNotReady = 11U, /*!< A requested final state is not reached */ + OperationInProgress = 12U, /*!< Indicator for operation in progress (e.g. ADC conversion not finished, DMA channel used, etc.) */ +} en_result_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup HC32_Common_Global_Macros HC32 Common Global Macros + * @{ + */ + +/** + * @brief Compiler Macro Definitions + */ +#ifndef __UNUSED + #define __UNUSED __attribute__((unused)) +#endif /* __UNUSED */ + +#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #ifndef __WEAKDEF + #define __WEAKDEF __attribute__((weak)) + #endif /* __WEAKDEF */ + #ifndef __ALIGN_BEGIN + #define __ALIGN_BEGIN __attribute__((aligned(4))) + #endif /* __ALIGN_BEGIN */ + #ifndef __NOINLINE + #define __NOINLINE __attribute__((noinline)) + #endif /* __NOINLINE */ + #ifndef __RAM_FUNC + #define __RAM_FUNC __attribute__((long_call, section(".ramfunc"))) + /* Usage: void __RAM_FUNC foo(void) */ + #endif /* __RAM_FUNC */ + #ifndef __NO_INIT + #define __NO_INIT + #endif /* __NO_INIT */ +#elif defined ( __GNUC__ ) && !defined (__CC_ARM) /*!< GNU Compiler */ + #ifndef __WEAKDEF + #define __WEAKDEF __attribute__((weak)) + #endif /* __WEAKDEF */ + #ifndef __ALIGN_BEGIN + #define __ALIGN_BEGIN __attribute__((aligned (4))) + #endif /* __ALIGN_BEGIN */ + #ifndef __NOINLINE + #define __NOINLINE __attribute__((noinline)) + #endif /* __NOINLINE */ + #ifndef __RAM_FUNC + #define __RAM_FUNC __attribute__((long_call, section(".ramfunc"))) + /* Usage: void __RAM_FUNC foo(void) */ + #endif /* __RAM_FUNC */ + #ifndef __NO_INIT + #define __NO_INIT __attribute__((section(".noinit"))) + #endif /* __NO_INIT */ +#elif defined (__ICCARM__) /*!< IAR Compiler */ + #ifndef __WEAKDEF + #define __WEAKDEF __weak + #endif /* __WEAKDEF */ + #ifndef __ALIGN_BEGIN + #define __ALIGN_BEGIN _Pragma("data_alignment=4") + #endif /* __ALIGN_BEGIN */ + #ifndef __NOINLINE + #define __NOINLINE _Pragma("optimize = no_inline") + #endif /* __NOINLINE */ + #ifndef __RAM_FUNC + #define __RAM_FUNC __ramfunc + #endif /* __RAM_FUNC */ +#ifndef __NO_INIT + #define __NO_INIT __no_init +#endif /* __NO_INIT */ +#elif defined (__CC_ARM) /*!< ARM Compiler */ + #ifndef __WEAKDEF + #define __WEAKDEF __attribute__((weak)) + #endif /* __WEAKDEF */ + #ifndef __ALIGN_BEGIN + #define __ALIGN_BEGIN __align(4) + #endif /* __ALIGN_BEGIN */ + #ifndef __NOINLINE + #define __NOINLINE __attribute__((noinline)) + #endif /* __NOINLINE */ + #ifndef __NO_INIT + #define __NO_INIT + #endif /* __NO_INIT */ + /* RAM functions are defined using the toolchain options. + Functions that are executed in RAM should reside in a separate source module. + Using the 'Options for File' dialog you can simply change the 'Code / Const' + area of a module to a memory space in physical RAM. */ + #define __RAM_FUNC +#else + #error "unsupported compiler!!" +#endif + +/** + * @defgroup Extend_Macro_Definitions Extend Macro Definitions + * @{ + */ +/* Decimal to BCD */ +#define DEC2BCD(x) ((((x) / 10U) << 4U) + ((x) % 10U)) + +/* BCD to decimal */ +#define BCD2DEC(x) ((((x) >> 4U) * 10U) + ((x) & 0x0FU)) + +/* Returns the dimension of an array */ +#define ARRAY_SZ(x) ((sizeof(x)) / (sizeof((x)[0]))) +/** + * @} + */ + +/** + * @defgroup Address_Align Address Align + * @{ + */ +#define IS_ADDRESS_ALIGN(addr, align) (0UL == (((uint32_t)(addr)) & (((uint32_t)(align)) - 1UL))) +#define IS_ADDRESS_ALIGN_HALFWORD(addr) (0UL == (((uint32_t)(addr)) & 0x1UL)) +#define IS_ADDRESS_ALIGN_WORD(addr) (0UL == (((uint32_t)(addr)) & 0x3UL)) +/** + * @} + */ + +/** + * @defgroup Register_Macro_Definitions Register Macro Definitions + * @{ + */ +#define RW_MEM8(addr) (*(volatile uint8_t *)(addr)) +#define RW_MEM16(addr) (*(volatile uint16_t *)(addr)) +#define RW_MEM32(addr) (*(volatile uint32_t *)(addr)) + +#define SET_REG8_BIT(REG, BIT) ((REG) |= ((uint8_t)(BIT))) +#define SET_REG16_BIT(REG, BIT) ((REG) |= ((uint16_t)(BIT))) +#define SET_REG32_BIT(REG, BIT) ((REG) |= ((uint32_t)(BIT))) + +#define CLEAR_REG8_BIT(REG, BIT) ((REG) &= ((uint8_t)(~((uint8_t)(BIT))))) +#define CLEAR_REG16_BIT(REG, BIT) ((REG) &= ((uint16_t)(~((uint16_t)(BIT))))) +#define CLEAR_REG32_BIT(REG, BIT) ((REG) &= ((uint32_t)(~((uint32_t)(BIT))))) + +#define READ_REG8_BIT(REG, BIT) ((REG) & ((uint8_t)(BIT))) +#define READ_REG16_BIT(REG, BIT) ((REG) & ((uint16_t)(BIT))) +#define READ_REG32_BIT(REG, BIT) ((REG) & ((uint32_t)(BIT))) + +#define CLEAR_REG8(REG) ((REG) = ((uint8_t)(0U))) +#define CLEAR_REG16(REG) ((REG) = ((uint16_t)(0U))) +#define CLEAR_REG32(REG) ((REG) = ((uint32_t)(0UL))) + +#define WRITE_REG8(REG, VAL) ((REG) = ((uint8_t)(VAL))) +#define WRITE_REG16(REG, VAL) ((REG) = ((uint16_t)(VAL))) +#define WRITE_REG32(REG, VAL) ((REG) = ((uint32_t)(VAL))) + +#define READ_REG8(REG) (REG) +#define READ_REG16(REG) (REG) +#define READ_REG32(REG) (REG) + +#define MODIFY_REG8(REGS, CLEARMASK, SETMASK) (WRITE_REG8((REGS), (((READ_REG8((REGS))) & ((uint8_t)(~((uint8_t)(CLEARMASK))))) | ((uint8_t)(SETMASK) & (uint8_t)(CLEARMASK))))) +#define MODIFY_REG16(REGS, CLEARMASK, SETMASK) (WRITE_REG16((REGS), (((READ_REG16((REGS))) & ((uint16_t)(~((uint16_t)(CLEARMASK))))) | ((uint16_t)(SETMASK) & (uint16_t)(CLEARMASK))))) +#define MODIFY_REG32(REGS, CLEARMASK, SETMASK) (WRITE_REG32((REGS), (((READ_REG32((REGS))) & ((uint32_t)(~((uint32_t)(CLEARMASK))))) | ((uint32_t)(SETMASK) & (uint32_t)(CLEARMASK))))) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + * Global function prototypes (definition in C source) + ******************************************************************************/ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32_COMMON_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Include/hc32_ddl.h b/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Include/hc32_ddl.h new file mode 100644 index 0000000000..f973175a5a --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Include/hc32_ddl.h @@ -0,0 +1,346 @@ +/** + ******************************************************************************* + * @file hc32_ddl.h + * @brief This file contains HC32 Series Device Driver Library file call + * management. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Yangjp First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32_DDL_H__ +#define __HC32_DDL_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/* Defined use Device Driver Library */ +#if !defined (USE_DDL_DRIVER) +/** + * @brief Comment the line below if you will not use the Device Driver Library. + * In this case, the application code will be based on direct access to + * peripherals registers. + */ + /* #define USE_DDL_DRIVER */ +#endif /* USE_DDL_DRIVER */ + +/** + * @brief HC32 Series Device Driver Library version number + */ +#define HC32_DDL_VERSION_MAIN 0x01U /*!< [31:24] main version */ +#define HC32_DDL_VERSION_SUB1 0x00U /*!< [23:16] sub1 version */ +#define HC32_DDL_VERSION_SUB2 0x04U /*!< [15:8] sub2 version */ +#define HC32_DDL_VERSION_RC 0x00U /*!< [7:0] release candidate */ +#define HC32_DDL_VERSION ((HC32_DDL_VERSION_MAIN << 24) | \ + (HC32_DDL_VERSION_SUB1 << 16) | \ + (HC32_DDL_VERSION_SUB2 << 8 ) | \ + (HC32_DDL_VERSION_RC)) + +/* Use Device Driver Library */ +#if defined (USE_DDL_DRIVER) + +/** + * @brief Include peripheral module's header file + */ +#if (DDL_ADC_ENABLE == DDL_ON) + #include "hc32f4a0_adc.h" +#endif /* DDL_ADC_ENABLE */ + +#if (DDL_AES_ENABLE == DDL_ON) + #include "hc32f4a0_aes.h" +#endif /* DDL_AES_ENABLE */ + +#if (DDL_CAN_ENABLE == DDL_ON) + #include "hc32f4a0_can.h" +#endif /* DDL_CAN_ENABLE */ + +#if (DDL_CLK_ENABLE == DDL_ON) + #include "hc32f4a0_clk.h" +#endif /* DDL_CLK_ENABLE */ + +#if (DDL_CMP_ENABLE == DDL_ON) + #include "hc32f4a0_cmp.h" +#endif /* DDL_CMP_ENABLE */ + +#if (DDL_CRC_ENABLE == DDL_ON) + #include "hc32f4a0_crc.h" +#endif /* DDL_CRC_ENABLE */ + +#if (DDL_CTC_ENABLE == DDL_ON) + #include "hc32f4a0_ctc.h" +#endif /* DDL_CTC_ENABLE */ + +#if (DDL_DAC_ENABLE == DDL_ON) + #include "hc32f4a0_dac.h" +#endif /* DDL_DAC_ENABLE */ + +#if (DDL_DCU_ENABLE == DDL_ON) + #include "hc32f4a0_dcu.h" +#endif /* DDL_DCU_ENABLE */ + +#if (DDL_DMA_ENABLE == DDL_ON) + #include "hc32f4a0_dma.h" +#endif /* DDL_DMA_ENABLE */ + +#if (DDL_DMC_ENABLE == DDL_ON) + #include "hc32f4a0_dmc.h" +#endif /* DDL_DMC_ENABLE */ + +#if (DDL_DVP_ENABLE == DDL_ON) + #include "hc32f4a0_dvp.h" +#endif /* DDL_DVP_ENABLE */ + +#if (DDL_EFM_ENABLE == DDL_ON) + #include "hc32f4a0_efm.h" +#endif /* DDL_EFM_ENABLE */ + +#if (DDL_EMB_ENABLE == DDL_ON) + #include "hc32f4a0_emb.h" +#endif /* DDL_EMB_ENABLE */ + +#if (DDL_ETH_ENABLE == DDL_ON) + #include "hc32f4a0_eth.h" +#endif /* DDL_ETH_ENABLE */ + +#if (DDL_EVENT_PORT_ENABLE == DDL_ON) + #include "hc32f4a0_event_port.h" +#endif /* DDL_EVENT_PORT_ENABLE */ + +#if (DDL_FCM_ENABLE == DDL_ON) + #include "hc32f4a0_fcm.h" +#endif /* DDL_FCM_ENABLE */ + +#if (DDL_FMAC_ENABLE == DDL_ON) + #include "hc32f4a0_fmac.h" +#endif /* DDL_FMAC_ENABLE */ + +#if (DDL_GPIO_ENABLE == DDL_ON) + #include "hc32f4a0_gpio.h" +#endif /* DDL_GPIO_ENABLE */ + +#if (DDL_HASH_ENABLE == DDL_ON) + #include "hc32f4a0_hash.h" +#endif /* DDL_HASH_ENABLE */ + +#if (DDL_I2C_ENABLE == DDL_ON) + #include "hc32f4a0_i2c.h" +#endif /* DDL_I2C_ENABLE */ + +#if (DDL_I2S_ENABLE == DDL_ON) + #include "hc32f4a0_i2s.h" +#endif /* DDL_I2S_ENABLE */ + +#if (DDL_ICG_ENABLE == DDL_ON) + #include "hc32f4a0_icg.h" +#endif /* DDL_ICG_ENABLE */ + +#if (DDL_INTERRUPTS_ENABLE == DDL_ON) + #include "hc32f4a0_interrupts.h" +#endif /* DDL_INTERRUPTS_ENABLE */ + +#if (DDL_KEYSCAN_ENABLE == DDL_ON) + #include "hc32f4a0_keyscan.h" +#endif /* DDL_KEYSCAN_ENABLE */ + +#if (DDL_MAU_ENABLE == DDL_ON) + #include "hc32f4a0_mau.h" +#endif /* DDL_MAU_ENABLE */ + +#if (DDL_MPU_ENABLE == DDL_ON) + #include "hc32f4a0_mpu.h" +#endif /* DDL_MPU_ENABLE */ + +#if (DDL_NFC_ENABLE == DDL_ON) + #include "hc32f4a0_nfc.h" +#endif /* DDL_NFC_ENABLE */ + +#if (DDL_OTS_ENABLE == DDL_ON) + #include "hc32f4a0_ots.h" +#endif /* DDL_OTS_ENABLE */ + +#if (DDL_PWC_ENABLE == DDL_ON) + #include "hc32f4a0_pwc.h" +#endif /* DDL_PWC_ENABLE */ + +#if (DDL_QSPI_ENABLE == DDL_ON) + #include "hc32f4a0_qspi.h" +#endif /* DDL_QSPI_ENABLE */ + +#if (DDL_RMU_ENABLE == DDL_ON) + #include "hc32f4a0_rmu.h" +#endif /* DDL_RMU_ENABLE */ + +#if (DDL_RTC_ENABLE == DDL_ON) + #include "hc32f4a0_rtc.h" +#endif /* DDL_RTC_ENABLE */ + +#if (DDL_SDIOC_ENABLE == DDL_ON) + #include "hc32f4a0_sdioc.h" +#endif /* DDL_SDIOC_ENABLE */ + +#if (DDL_SMC_ENABLE == DDL_ON) + #include "hc32f4a0_smc.h" +#endif /* DDL_SMC_ENABLE */ + +#if (DDL_SPI_ENABLE == DDL_ON) + #include "hc32f4a0_spi.h" +#endif /* DDL_SPI_ENABLE */ + +#if (DDL_SRAM_ENABLE == DDL_ON) + #include "hc32f4a0_sram.h" +#endif /* DDL_SRAM_ENABLE */ + +#if (DDL_SWDT_ENABLE == DDL_ON) + #include "hc32f4a0_swdt.h" +#endif /* DDL_SWDT_ENABLE */ + +#if (DDL_TMR0_ENABLE == DDL_ON) + #include "hc32f4a0_tmr0.h" +#endif /* DDL_TMR0_ENABLE */ + +#if (DDL_TMR2_ENABLE == DDL_ON) + #include "hc32f4a0_tmr2.h" +#endif /* DDL_TMR2_ENABLE */ + +#if (DDL_TMR4_ENABLE == DDL_ON) + #include "hc32f4a0_tmr4.h" +#endif /* DDL_TMR4_ENABLE */ + +#if (DDL_TMR6_ENABLE == DDL_ON) + #include "hc32f4a0_tmr6.h" +#endif /* DDL_TMR6_ENABLE */ + +#if (DDL_TMRA_ENABLE == DDL_ON) + #include "hc32f4a0_tmra.h" +#endif /* DDL_TMRA_ENABLE */ + +#if (DDL_TRNG_ENABLE == DDL_ON) + #include "hc32f4a0_trng.h" +#endif /* DDL_TRNG_ENABLE */ + +#if (DDL_USART_ENABLE == DDL_ON) + #include "hc32f4a0_usart.h" +#endif /* DDL_USART_ENABLE */ + +#if (DDL_USBFS_ENABLE == DDL_ON) + #include "hc32f4a0_usbfs.h" +#endif /* DDL_USBFS_ENABLE */ + +#if (DDL_USBHS_ENABLE == DDL_ON) + #include "hc32f4a0_usbhs.h" +#endif /* DDL_USBHS_ENABLE */ + +#if (DDL_UTILITY_ENABLE == DDL_ON) + #include "hc32f4a0_utility.h" +#endif /* DDL_UTILITY_ENABLE */ + +#if (DDL_WDT_ENABLE == DDL_ON) + #include "hc32f4a0_wdt.h" +#endif /* DDL_WDT_ENABLE */ + +#if (DDL_HRPWM_ENABLE == DDL_ON) + #include "hc32f4a0_hrpwm.h" +#endif /* DDL_HRPWM_ENABLE */ + + +/** + * @brief Include BSP board's header file + */ +#if (BSP_EV_HC32F4A0_LQFP176 == BSP_EV_HC32F4A0) + #include "ev_hc32f4a0_lqfp176.h" +#endif /* BSP_EV_HC32F4A0_LQFP176 */ + +#if (BSP_MS_HC32F4A0_LQFP176_050_MEM == BSP_EV_HC32F4A0) + #include "ms_hc32f4a0_lqfp176_050_mem.h" +#endif /* BSP_MS_HC32F4A0_LQFP176_050_MEM */ + + +/** + * @brief Include BSP device component's header file + */ +#if (BSP_CY62167EV30LL_ENABLE == BSP_ON) + #include "cy62167ev30ll.h" +#endif /* BSP_CY62167EV30LL_ENABLE */ + +#if (BSP_IS42S16400J7TLI_ENABLE == BSP_ON) + #include "is42s16400j7tli.h" +#endif /* BSP_IS42S16400J7TLI_ENABLE */ + +#if (BSP_IS62WV51216_ENABLE == BSP_ON) + #include "is62wv51216.h" +#endif /* BSP_IS62WV51216_ENABLE */ + +#if (BSP_MT29F2G08AB_ENABLE == BSP_ON) + #include "mt29f2g08ab.h" +#endif /* BSP_MT29F2G08AB_ENABLE */ + +#if (BSP_NT35510_ENABLE == BSP_ON) + #include "nt35510.h" +#endif /* BSP_NT35510_ENABLE */ + +#if (BSP_OV5640_ENABLE == BSP_ON) + #include "ov5640.h" +#endif /* BSP_OV5640_ENABLE */ + +#if (BSP_S29GL064N90TFI03_ENABLE == BSP_ON) + #include "s29gl064n90tfi03.h" +#endif /* BSP_S29GL064N90TFI03_ENABLE */ + +#if (BSP_TCA9539_ENABLE == BSP_ON) + #include "ev_hc32f4a0_lqfp176_tca9539.h" + #include "tca9539.h" +#endif /* BSP_TCA9539_ENABLE */ + +#if (BSP_W25QXX_ENABLE == BSP_ON) + #include "w25qxx.h" +#endif /* BSP_W25QXX_ENABLE */ + +#if (BSP_WM8731_ENABLE == BSP_ON) + #include "wm8731.h" +#endif /* BSP_WM8731_ENABLE */ + +#endif /* USE_DDL_DRIVER */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + * Global function prototypes (definition in C source) + ******************************************************************************/ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32_DDL_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Include/hc32f4a0.h b/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Include/hc32f4a0.h new file mode 100644 index 0000000000..c829401e3c --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Include/hc32f4a0.h @@ -0,0 +1,48442 @@ +/** + ******************************************************************************* + * @file HC32F4A0.h + * @brief Headerfile for HC32F4A0 series MCU + @verbatim + Change Logs: + Date Author Notes + 2020-09-14 Heqb First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + */ + +#ifndef __HC32F4A0_H__ +#define __HC32F4A0_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/******************************************************************************* + * Configuration of the Cortex-M4 Processor and Core Peripherals + ******************************************************************************/ +#define __MPU_PRESENT 1 /*!< HC32F4A0 provides MPU */ +#define __VTOR_PRESENT 1 /*!< HC32F4A0 supported vector table registers */ +#define __NVIC_PRIO_BITS 4 /*!< HC32F4A0 uses 4 Bits for the Priority Levels */ +#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */ +#define __FPU_PRESENT 1 /*!< FPU present */ + +/******************************************************************************* + * Interrupt Number Definition + ******************************************************************************/ +typedef enum IRQn +{ + NMI_IRQn = -14, /* 2 Non Maskable */ + HardFault_IRQn = -13, /* 3 Hard Fault */ + MemManageFault_IRQn = -12, /* 4 MemManage Fault */ + BusFault_IRQn = -11, /* 5 Bus Fault */ + UsageFault_IRQn = -10, /* 6 Usage Fault */ + SVC_IRQn = -5, /* 11 SVCall */ + DebugMonitor_IRQn = -4, /* 12 DebugMonitor */ + PendSV_IRQn = -2, /* 14 Pend SV */ + SysTick_IRQn = -1, /* 15 System Tick */ + Int000_IRQn = 0, + Int001_IRQn = 1, + Int002_IRQn = 2, + Int003_IRQn = 3, + Int004_IRQn = 4, + Int005_IRQn = 5, + Int006_IRQn = 6, + Int007_IRQn = 7, + Int008_IRQn = 8, + Int009_IRQn = 9, + Int010_IRQn = 10, + Int011_IRQn = 11, + Int012_IRQn = 12, + Int013_IRQn = 13, + Int014_IRQn = 14, + Int015_IRQn = 15, + Int016_IRQn = 16, + Int017_IRQn = 17, + Int018_IRQn = 18, + Int019_IRQn = 19, + Int020_IRQn = 20, + Int021_IRQn = 21, + Int022_IRQn = 22, + Int023_IRQn = 23, + Int024_IRQn = 24, + Int025_IRQn = 25, + Int026_IRQn = 26, + Int027_IRQn = 27, + Int028_IRQn = 28, + Int029_IRQn = 29, + Int030_IRQn = 30, + Int031_IRQn = 31, + Int032_IRQn = 32, + Int033_IRQn = 33, + Int034_IRQn = 34, + Int035_IRQn = 35, + Int036_IRQn = 36, + Int037_IRQn = 37, + Int038_IRQn = 38, + Int039_IRQn = 39, + Int040_IRQn = 40, + Int041_IRQn = 41, + Int042_IRQn = 42, + Int043_IRQn = 43, + Int044_IRQn = 44, + Int045_IRQn = 45, + Int046_IRQn = 46, + Int047_IRQn = 47, + Int048_IRQn = 48, + Int049_IRQn = 49, + Int050_IRQn = 50, + Int051_IRQn = 51, + Int052_IRQn = 52, + Int053_IRQn = 53, + Int054_IRQn = 54, + Int055_IRQn = 55, + Int056_IRQn = 56, + Int057_IRQn = 57, + Int058_IRQn = 58, + Int059_IRQn = 59, + Int060_IRQn = 60, + Int061_IRQn = 61, + Int062_IRQn = 62, + Int063_IRQn = 63, + Int064_IRQn = 64, + Int065_IRQn = 65, + Int066_IRQn = 66, + Int067_IRQn = 67, + Int068_IRQn = 68, + Int069_IRQn = 69, + Int070_IRQn = 70, + Int071_IRQn = 71, + Int072_IRQn = 72, + Int073_IRQn = 73, + Int074_IRQn = 74, + Int075_IRQn = 75, + Int076_IRQn = 76, + Int077_IRQn = 77, + Int078_IRQn = 78, + Int079_IRQn = 79, + Int080_IRQn = 80, + Int081_IRQn = 81, + Int082_IRQn = 82, + Int083_IRQn = 83, + Int084_IRQn = 84, + Int085_IRQn = 85, + Int086_IRQn = 86, + Int087_IRQn = 87, + Int088_IRQn = 88, + Int089_IRQn = 89, + Int090_IRQn = 90, + Int091_IRQn = 91, + Int092_IRQn = 92, + Int093_IRQn = 93, + Int094_IRQn = 94, + Int095_IRQn = 95, + Int096_IRQn = 96, + Int097_IRQn = 97, + Int098_IRQn = 98, + Int099_IRQn = 99, + Int100_IRQn = 100, + Int101_IRQn = 101, + Int102_IRQn = 102, + Int103_IRQn = 103, + Int104_IRQn = 104, + Int105_IRQn = 105, + Int106_IRQn = 106, + Int107_IRQn = 107, + Int108_IRQn = 108, + Int109_IRQn = 109, + Int110_IRQn = 110, + Int111_IRQn = 111, + Int112_IRQn = 112, + Int113_IRQn = 113, + Int114_IRQn = 114, + Int115_IRQn = 115, + Int116_IRQn = 116, + Int117_IRQn = 117, + Int118_IRQn = 118, + Int119_IRQn = 119, + Int120_IRQn = 120, + Int121_IRQn = 121, + Int122_IRQn = 122, + Int123_IRQn = 123, + Int124_IRQn = 124, + Int125_IRQn = 125, + Int126_IRQn = 126, + Int127_IRQn = 127, + Int128_IRQn = 128, + Int129_IRQn = 129, + Int130_IRQn = 130, + Int131_IRQn = 131, + Int132_IRQn = 132, + Int133_IRQn = 133, + Int134_IRQn = 134, + Int135_IRQn = 135, + Int136_IRQn = 136, + Int137_IRQn = 137, + Int138_IRQn = 138, + Int139_IRQn = 139, + Int140_IRQn = 140, + Int141_IRQn = 141, + Int142_IRQn = 142, + Int143_IRQn = 143, + +} IRQn_Type; + +#include +#include + +/** + ******************************************************************************* + ** \brief Event number enumeration + ******************************************************************************/ +typedef enum en_event_src +{ + EVT_SWI_IRQ0 = 0U, + EVT_SWI_IRQ1 = 1U, + EVT_SWI_IRQ2 = 2U, + EVT_SWI_IRQ3 = 3U, + EVT_SWI_IRQ4 = 4U, + EVT_SWI_IRQ5 = 5U, + EVT_SWI_IRQ6 = 6U, + EVT_SWI_IRQ7 = 7U, + EVT_SWI_IRQ8 = 8U, + EVT_SWI_IRQ9 = 9U, + EVT_SWI_IRQ10 = 10U, + EVT_SWI_IRQ11 = 11U, + EVT_SWI_IRQ12 = 12U, + EVT_SWI_IRQ13 = 13U, + EVT_SWI_IRQ14 = 14U, + EVT_SWI_IRQ15 = 15U, + EVT_SWI_IRQ16 = 16U, + EVT_SWI_IRQ17 = 17U, + EVT_SWI_IRQ18 = 18U, + EVT_SWI_IRQ19 = 19U, + EVT_SWI_IRQ20 = 20U, + EVT_SWI_IRQ21 = 21U, + EVT_SWI_IRQ22 = 22U, + EVT_SWI_IRQ23 = 23U, + EVT_SWI_IRQ24 = 24U, + EVT_SWI_IRQ25 = 25U, + EVT_SWI_IRQ26 = 26U, + EVT_SWI_IRQ27 = 27U, + EVT_SWI_IRQ28 = 28U, + EVT_SWI_IRQ29 = 29U, + EVT_SWI_IRQ30 = 30U, + EVT_SWI_IRQ31 = 31U, + /* External Interrupt */ + EVT_PORT_EIRQ0 = 0U, + EVT_PORT_EIRQ1 = 1U, + EVT_PORT_EIRQ2 = 2U, + EVT_PORT_EIRQ3 = 3U, + EVT_PORT_EIRQ4 = 4U, + EVT_PORT_EIRQ5 = 5U, + EVT_PORT_EIRQ6 = 6U, + EVT_PORT_EIRQ7 = 7U, + EVT_PORT_EIRQ8 = 8U, + EVT_PORT_EIRQ9 = 9U, + EVT_PORT_EIRQ10 = 10U, + EVT_PORT_EIRQ11 = 11U, + EVT_PORT_EIRQ12 = 12U, + EVT_PORT_EIRQ13 = 13U, + EVT_PORT_EIRQ14 = 14U, + EVT_PORT_EIRQ15 = 15U, + /* DMA_1 */ + EVT_DMA1_TC0 = 32U, + EVT_DMA1_TC1 = 33U, + EVT_DMA1_TC2 = 34U, + EVT_DMA1_TC3 = 35U, + EVT_DMA1_TC4 = 36U, + EVT_DMA1_TC5 = 37U, + EVT_DMA1_TC6 = 38U, + EVT_DMA1_TC7 = 39U, + EVT_DMA1_BTC0 = 40U, + EVT_DMA1_BTC1 = 41U, + EVT_DMA1_BTC2 = 42U, + EVT_DMA1_BTC3 = 43U, + EVT_DMA1_BTC4 = 44U, + EVT_DMA1_BTC5 = 45U, + EVT_DMA1_BTC6 = 46U, + EVT_DMA1_BTC7 = 47U, + /* EFM */ + EVT_EFM_OPTEND = 51U, + /* USBFS */ + EVT_USBFS_SOF = 52U, + /* USBHS */ + EVT_USBHS_SOF = 53U, + /* DCU */ + EVT_DCU1 = 55U, + EVT_DCU2 = 56U, + EVT_DCU3 = 57U, + EVT_DCU4 = 58U, + EVT_DCU5 = 59U, + EVT_DCU6 = 60U, + EVT_DCU7 = 61U, + EVT_DCU8 = 62U, + /* DMA_2 */ + EVT_DMA2_TC0 = 64U, + EVT_DMA2_TC1 = 65U, + EVT_DMA2_TC2 = 66U, + EVT_DMA2_TC3 = 67U, + EVT_DMA2_TC4 = 68U, + EVT_DMA2_TC5 = 69U, + EVT_DMA2_TC6 = 70U, + EVT_DMA2_TC7 = 71U, + EVT_DMA2_BTC0 = 72U, + EVT_DMA2_BTC1 = 73U, + EVT_DMA2_BTC2 = 74U, + EVT_DMA2_BTC3 = 75U, + EVT_DMA2_BTC4 = 76U, + EVT_DMA2_BTC5 = 77U, + EVT_DMA2_BTC6 = 78U, + EVT_DMA2_BTC7 = 79U, + /* MAU */ + EVT_MAU_SQRT = 83U, + /* DVP */ + EVT_DVP_FRAMSTA = 84U, + EVT_DVP_LINESTA = 85U, + EVT_DVP_LINEEND = 86U, + EVT_DVP_FRAMEND = 87U, + EVT_DVP_SQUERR = 88U, + EVT_DVP_FIFOERR = 89U, + EVT_DVP_DMAREQ = 90U, + /* FMAC */ + EVT_FMAC_1 = 91U, + EVT_FMAC_2 = 92U, + EVT_FMAC_3 = 93U, + EVT_FMAC_4 = 94U, + /* TIMER0 */ + EVT_TMR0_1_CMPA = 96U, + EVT_TMR0_1_CMPB = 97U, + EVT_TMR0_2_CMPA = 98U, + EVT_TMR0_2_CMPB = 99U, + /* TIMER2 */ + EVT_TMR2_1_CMPA = 100U, + EVT_TMR2_1_CMPB = 101U, + EVT_TMR2_1_OVFA = 102U, + EVT_TMR2_1_OVFB = 103U, + EVT_TMR2_2_CMPA = 104U, + EVT_TMR2_2_CMPB = 105U, + EVT_TMR2_2_OVFA = 106U, + EVT_TMR2_2_OVFB = 107U, + EVT_TMR2_3_CMPA = 108U, + EVT_TMR2_3_CMPB = 109U, + EVT_TMR2_3_OVFA = 110U, + EVT_TMR2_3_OVFB = 111U, + EVT_TMR2_4_CMPA = 112U, + EVT_TMR2_4_CMPB = 113U, + EVT_TMR2_4_OVFA = 114U, + EVT_TMR2_4_OVFB = 115U, + /* RTC */ + EVT_RTC_ALM = 121U, + EVT_RTC_PRD = 122U, + /* TIMER6_1 */ + EVT_TMR6_1_GCMA = 128U, + EVT_TMR6_1_GCMB = 129U, + EVT_TMR6_1_GCMC = 130U, + EVT_TMR6_1_GCMD = 131U, + EVT_TMR6_1_GCME = 132U, + EVT_TMR6_1_GCMF = 133U, + EVT_TMR6_1_GOVF = 134U, + EVT_TMR6_1_GUDF = 135U, + /* TIMER4_1 */ + EVT_TMR4_1_SCMUH = 136U, + EVT_TMR4_1_SCMUL = 137U, + EVT_TMR4_1_SCMVH = 138U, + EVT_TMR4_1_SCMVL = 139U, + EVT_TMR4_1_SCMWH = 140U, + EVT_TMR4_1_SCMWL = 141U, + /* TIMER6_2 */ + EVT_TMR6_2_GCMA = 144U, + EVT_TMR6_2_GCMB = 145U, + EVT_TMR6_2_GCMC = 146U, + EVT_TMR6_2_GCMD = 147U, + EVT_TMR6_2_GCME = 148U, + EVT_TMR6_2_GCMF = 149U, + EVT_TMR6_2_GOVF = 150U, + EVT_TMR6_2_GUDF = 151U, + /* TIMER4_2 */ + EVT_TMR4_2_SCMUH = 152U, + EVT_TMR4_2_SCMUL = 153U, + EVT_TMR4_2_SCMVH = 154U, + EVT_TMR4_2_SCMVL = 155U, + EVT_TMR4_2_SCMWH = 156U, + EVT_TMR4_2_SCMWL = 157U, + /* TIMER6_3 */ + EVT_TMR6_3_GCMA = 160U, + EVT_TMR6_3_GCMB = 161U, + EVT_TMR6_3_GCMC = 162U, + EVT_TMR6_3_GCMD = 163U, + EVT_TMR6_3_GCME = 164U, + EVT_TMR6_3_GCMF = 165U, + EVT_TMR6_3_GOVF = 166U, + EVT_TMR6_3_GUDF = 167U, + /* TIMER4_3 */ + EVT_TMR4_3_SCMUH = 168U, + EVT_TMR4_3_SCMUL = 169U, + EVT_TMR4_3_SCMVH = 170U, + EVT_TMR4_3_SCMVL = 171U, + EVT_TMR4_3_SCMWH = 172U, + EVT_TMR4_3_SCMWL = 173U, + /* TIMER6 */ + EVT_TMR6_1_SCMA = 179U, + EVT_TMR6_1_SCMB = 180U, + EVT_TMR6_2_SCMA = 187U, + EVT_TMR6_2_SCMB = 188U, + EVT_TMR6_3_SCMA = 195U, + EVT_TMR6_3_SCMB = 196U, + EVT_TMR6_4_GCMA = 208U, + EVT_TMR6_4_GCMB = 209U, + EVT_TMR6_4_GCMC = 210U, + EVT_TMR6_4_GCMD = 211U, + EVT_TMR6_4_GCME = 212U, + EVT_TMR6_4_GCMF = 213U, + EVT_TMR6_4_GOVF = 214U, + EVT_TMR6_4_GUDF = 215U, + EVT_TMR6_4_SCMA = 219U, + EVT_TMR6_4_SCMB = 220U, + EVT_TMR6_5_GCMA = 224U, + EVT_TMR6_5_GCMB = 225U, + EVT_TMR6_5_GCMC = 226U, + EVT_TMR6_5_GCMD = 227U, + EVT_TMR6_5_GCME = 228U, + EVT_TMR6_5_GCMF = 229U, + EVT_TMR6_5_GOVF = 230U, + EVT_TMR6_5_GUDF = 231U, + EVT_TMR6_5_SCMA = 235U, + EVT_TMR6_5_SCMB = 236U, + /* TIMERA_1 */ + EVT_TMRA_1_OVF = 237U, + EVT_TMRA_1_UDF = 238U, + EVT_TMRA_1_CMP = 239U, + /* TIMER6_6 */ + EVT_TMR6_6_GCMA = 240U, + EVT_TMR6_6_GCMB = 241U, + EVT_TMR6_6_GCMC = 242U, + EVT_TMR6_6_GCMD = 243U, + EVT_TMR6_6_GCME = 244U, + EVT_TMR6_6_GCMF = 245U, + EVT_TMR6_6_GOVF = 246U, + EVT_TMR6_6_GUDF = 247U, + EVT_TMR6_6_SCMA = 251U, + EVT_TMR6_6_SCMB = 252U, + /* TIMERA_2 */ + EVT_TMRA_2_OVF = 253U, + EVT_TMRA_2_UDF = 254U, + EVT_TMRA_2_CMP = 255U, + /* TIMER6_7 */ + EVT_TMR6_7_GCMA = 256U, + EVT_TMR6_7_GCMB = 257U, + EVT_TMR6_7_GCMC = 258U, + EVT_TMR6_7_GCMD = 259U, + EVT_TMR6_7_GCME = 260U, + EVT_TMR6_7_GCMF = 261U, + EVT_TMR6_7_GOVF = 262U, + EVT_TMR6_7_GUDF = 263U, + EVT_TMR6_7_SCMA = 267U, + EVT_TMR6_7_SCMB = 268U, + /* TIMERA_3 */ + EVT_TMRA_3_OVF = 269U, + EVT_TMRA_3_UDF = 270U, + EVT_TMRA_3_CMP = 271U, + /* TIMER6_8 */ + EVT_TMR6_8_GCMA = 272U, + EVT_TMR6_8_GCMB = 273U, + EVT_TMR6_8_GCMC = 274U, + EVT_TMR6_8_GCMD = 275U, + EVT_TMR6_8_GCME = 276U, + EVT_TMR6_8_GCMF = 277U, + EVT_TMR6_8_GOVF = 278U, + EVT_TMR6_8_GUDF = 279U, + EVT_TMR6_8_SCMA = 283U, + EVT_TMR6_8_SCMB = 284U, + /* TIMERA_4 */ + EVT_TMRA_4_OVF = 285U, + EVT_TMRA_4_UDF = 286U, + EVT_TMRA_4_CMP = 287U, + /* AOS_STRG */ + EVT_AOS_STRG = 299U, + /* USART1 USART2 */ + EVT_USART1_EI = 300U, + EVT_USART1_RI = 301U, + EVT_USART1_TI = 302U, + EVT_USART1_TCI = 303U, + EVT_USART1_RTO = 304U, + EVT_USART2_EI = 305U, + EVT_USART2_RI = 306U, + EVT_USART2_TI = 307U, + EVT_USART2_TCI = 308U, + EVT_USART2_RTO = 309U, + /* SPI1 SPI2 */ + EVT_SPI1_SPRI = 310U, + EVT_SPI1_SPTI = 311U, + EVT_SPI1_SPII = 312U, + EVT_SPI1_SPEI = 313U, + EVT_SPI1_SPEND = 314U, + EVT_SPI2_SPRI = 315U, + EVT_SPI2_SPTI = 316U, + EVT_SPI2_SPII = 317U, + EVT_SPI2_SPEI = 318U, + EVT_SPI2_SPEND = 319U, + /* TIMERA_5 TIMERA_6 TIMERA_7 TIMERA_8 */ + EVT_TMRA_5_OVF = 320U, + EVT_TMRA_5_UDF = 321U, + EVT_TMRA_5_CMP = 322U, + EVT_TMRA_6_OVF = 323U, + EVT_TMRA_6_UDF = 324U, + EVT_TMRA_6_CMP = 325U, + EVT_TMRA_7_OVF = 326U, + EVT_TMRA_7_UDF = 327U, + EVT_TMRA_7_CMP = 328U, + EVT_TMRA_8_OVF = 329U, + EVT_TMRA_8_UDF = 330U, + EVT_TMRA_8_CMP = 331U, + /* USART3 USART4 */ + EVT_USART3_EI = 332U, + EVT_USART3_RI = 333U, + EVT_USART3_TI = 334U, + EVT_USART3_TCI = 335U, + EVT_USART4_EI = 336U, + EVT_USART4_RI = 337U, + EVT_USART4_TI = 338U, + EVT_USART4_TCI = 339U, + /* SPI3 SPI4 */ + EVT_SPI3_SPRI = 342U, + EVT_SPI3_SPTI = 343U, + EVT_SPI3_SPII = 344U, + EVT_SPI3_SPEI = 345U, + EVT_SPI3_SPEND = 346U, + EVT_SPI4_SPRI = 347U, + EVT_SPI4_SPTI = 348U, + EVT_SPI4_SPII = 349U, + EVT_SPI4_SPEI = 350U, + EVT_SPI4_SPEND = 351U, + /* TIMERA_9 TIMERA_10 TIMERA_11 TIMERA_12 */ + EVT_TMRA_9_OVF = 352U, + EVT_TMRA_9_UDF = 353U, + EVT_TMRA_9_CMP = 354U, + EVT_TMRA_10_OVF = 355U, + EVT_TMRA_10_UDF = 356U, + EVT_TMRA_10_CMP = 357U, + EVT_TMRA_11_OVF = 358U, + EVT_TMRA_11_UDF = 359U, + EVT_TMRA_11_CMP = 360U, + EVT_TMRA_12_OVF = 361U, + EVT_TMRA_12_UDF = 362U, + EVT_TMRA_12_CMP = 363U, + /* USART5 USART6 */ + EVT_USART5_BRKWKPI = 364U, + EVT_USART5_EI = 365U, + EVT_USART5_RI = 366U, + EVT_USART5_TI = 367U, + EVT_USART5_TCI = 368U, + EVT_USART6_EI = 369U, + EVT_USART6_RI = 370U, + EVT_USART6_TI = 371U, + EVT_USART6_TCI = 372U, + EVT_USART6_RTO = 373U, + /* SPI5 SPI6 */ + EVT_SPI5_SPRI = 374U, + EVT_SPI5_SPTI = 375U, + EVT_SPI5_SPII = 376U, + EVT_SPI5_SPEI = 377U, + EVT_SPI5_SPEND = 378U, + EVT_SPI6_SPRI = 379U, + EVT_SPI6_SPTI = 380U, + EVT_SPI6_SPII = 381U, + EVT_SPI6_SPEI = 382U, + EVT_SPI6_SPEND = 383U, + /* I2S1 I2S2 */ + EVT_I2S1_TXIRQOUT = 384U, + EVT_I2S1_RXIRQOUT = 385U, + EVT_I2S2_TXIRQOUT = 387U, + EVT_I2S2_RXIRQOUT = 388U, + /* USART7 USART8 */ + EVT_USART7_EI = 390U, + EVT_USART7_RI = 391U, + EVT_USART7_TI = 392U, + EVT_USART7_TCI = 393U, + EVT_USART7_RTO = 394U, + EVT_USART8_EI = 395U, + EVT_USART8_RI = 396U, + EVT_USART8_TI = 397U, + EVT_USART8_TCI = 398U, + /* HASH */ + EVT_HASH = 401U, + /* SDIOC */ + EVT_SDIOC1_DMAR = 402U, + EVT_SDIOC1_DMAW = 403U, + EVT_SDIOC2_DMAR = 405U, + EVT_SDIOC2_DMAW = 406U, + /* EVENT PORT */ + EVT_EVENT_PORT1 = 408U, + EVT_EVENT_PORT2 = 409U, + EVT_EVENT_PORT3 = 410U, + EVT_EVENT_PORT4 = 411U, + /* ETHER */ + EVT_ETH_PPS_OUT_0 = 414U, + EVT_ETH_PPS_OUT_1 = 415U, + /* I2S3 I2S4 */ + EVT_I2S3_TXIRQOUT = 416U, + EVT_I2S3_RXIRQOUT = 417U, + EVT_I2S4_TXIRQOUT = 419U, + EVT_I2S4_RXIRQOUT = 420U, + /* USART9 USART10 */ + EVT_USART9_EI = 422U, + EVT_USART9_RI = 423U, + EVT_USART9_TI = 424U, + EVT_USART9_TCI = 425U, + EVT_USART10_BRKWKPI = 426U, + EVT_USART10_EI = 427U, + EVT_USART10_RI = 428U, + EVT_USART10_TI = 429U, + EVT_USART10_TCI = 430U, + /* I2C1 I2C2 I2C3 */ + EVT_I2C1_RXI = 432U, + EVT_I2C1_TXI = 433U, + EVT_I2C1_TEI = 434U, + EVT_I2C1_EEI = 435U, + EVT_I2C2_RXI = 436U, + EVT_I2C2_TXI = 437U, + EVT_I2C2_TEI = 438U, + EVT_I2C2_EEI = 439U, + EVT_I2C3_RXI = 440U, + EVT_I2C3_TXI = 441U, + EVT_I2C3_TEI = 442U, + EVT_I2C3_EEI = 443U, + /* ACMP */ + EVT_CMP1 = 444U, + EVT_CMP2 = 445U, + EVT_CMP3 = 446U, + EVT_CMP4 = 447U, + /* I2C4 I2C5 I2C6 */ + EVT_I2C4_RXI = 448U, + EVT_I2C4_TXI = 449U, + EVT_I2C4_TEI = 450U, + EVT_I2C4_EEI = 451U, + EVT_I2C5_RXI = 452U, + EVT_I2C5_TXI = 453U, + EVT_I2C5_TEI = 454U, + EVT_I2C5_EEI = 455U, + EVT_I2C6_RXI = 456U, + EVT_I2C6_TXI = 457U, + EVT_I2C6_TEI = 458U, + EVT_I2C6_EEI = 459U, + /* PVD */ + EVT_PVD_PVD1 = 461U, + EVT_PVD_PVD2 = 462U, + /* OTS */ + EVT_OTS = 463U, + /* WDT */ + EVT_WDT_REFUDF = 467U, + /* ADC */ + EVT_ADC1_EOCA = 480U, + EVT_ADC1_EOCB = 481U, + EVT_ADC1_CHCMP = 482U, + EVT_ADC1_SEQCMP = 483U, + EVT_ADC2_EOCA = 484U, + EVT_ADC2_EOCB = 485U, + EVT_ADC2_CHCMP = 486U, + EVT_ADC2_SEQCMP = 487U, + EVT_ADC3_EOCA = 488U, + EVT_ADC3_EOCB = 489U, + EVT_ADC3_CHCMP = 490U, + EVT_ADC3_SEQCMP = 491U, + /* TRNG */ + EVT_TRNG_END = 492U, + EVT_MAX = 511U, +} en_event_src_t; + +/** + ******************************************************************************* + ** \brief InterrUpt nUmber enumeration + ******************************************************************************/ +typedef enum en_int_src +{ + INT_SWI_IRQ0 = 0U, + INT_SWI_IRQ1 = 1U, + INT_SWI_IRQ2 = 2U, + INT_SWI_IRQ3 = 3U, + INT_SWI_IRQ4 = 4U, + INT_SWI_IRQ5 = 5U, + INT_SWI_IRQ6 = 6U, + INT_SWI_IRQ7 = 7U, + INT_SWI_IRQ8 = 8U, + INT_SWI_IRQ9 = 9U, + INT_SWI_IRQ10 = 10U, + INT_SWI_IRQ11 = 11U, + INT_SWI_IRQ12 = 12U, + INT_SWI_IRQ13 = 13U, + INT_SWI_IRQ14 = 14U, + INT_SWI_IRQ15 = 15U, + INT_SWI_IRQ16 = 16U, + INT_SWI_IRQ17 = 17U, + INT_SWI_IRQ18 = 18U, + INT_SWI_IRQ19 = 19U, + INT_SWI_IRQ20 = 20U, + INT_SWI_IRQ21 = 21U, + INT_SWI_IRQ22 = 22U, + INT_SWI_IRQ23 = 23U, + INT_SWI_IRQ24 = 24U, + INT_SWI_IRQ25 = 25U, + INT_SWI_IRQ26 = 26U, + INT_SWI_IRQ27 = 27U, + INT_SWI_IRQ28 = 28U, + INT_SWI_IRQ29 = 29U, + INT_SWI_IRQ30 = 30U, + INT_SWI_IRQ31 = 31U, + /* External Interrupt */ + INT_PORT_EIRQ0 = 0U, + INT_PORT_EIRQ1 = 1U, + INT_PORT_EIRQ2 = 2U, + INT_PORT_EIRQ3 = 3U, + INT_PORT_EIRQ4 = 4U, + INT_PORT_EIRQ5 = 5U, + INT_PORT_EIRQ6 = 6U, + INT_PORT_EIRQ7 = 7U, + INT_PORT_EIRQ8 = 8U, + INT_PORT_EIRQ9 = 9U, + INT_PORT_EIRQ10 = 10U, + INT_PORT_EIRQ11 = 11U, + INT_PORT_EIRQ12 = 12U, + INT_PORT_EIRQ13 = 13U, + INT_PORT_EIRQ14 = 14U, + INT_PORT_EIRQ15 = 15U, + /* DMA_1 */ + INT_DMA1_TC0 = 32U, + INT_DMA1_TC1 = 33U, + INT_DMA1_TC2 = 34U, + INT_DMA1_TC3 = 35U, + INT_DMA1_TC4 = 36U, + INT_DMA1_TC5 = 37U, + INT_DMA1_TC6 = 38U, + INT_DMA1_TC7 = 39U, + INT_DMA1_BTC0 = 40U, + INT_DMA1_BTC1 = 41U, + INT_DMA1_BTC2 = 42U, + INT_DMA1_BTC3 = 43U, + INT_DAM1_BTC4 = 44U, + INT_DMA1_BTC5 = 45U, + INT_DMA1_BTC6 = 46U, + INT_DMA1_BTC7 = 47U, + INT_DMA1_ERR = 48U, + /* EFM */ + INT_EFM_PEERR = 49U, + INT_EFM_RDCOL = 50U, + INT_EFM_OPTEND = 51U, + /* QSPI */ + INT_QSPI_INTR = 54U, + /* DCU */ + INT_DCU1 = 55U, + INT_DCU2 = 56U, + INT_DCU3 = 57U, + INT_DCU4 = 58U, + INT_DCU5 = 59U, + INT_DCU6 = 60U, + INT_DCU7 = 61U, + INT_DCU8 = 62U, + /* DMA2 */ + INT_DMA2_TC0 = 64U, + INT_DMA2_TC1 = 65U, + INT_DMA2_TC2 = 66U, + INT_DMA2_TC3 = 67U, + INT_DMA2_TC4 = 68U, + INT_DMA2_TC5 = 69U, + INT_DMA2_TC6 = 70U, + INT_DMA2_TC7 = 71U, + INT_DMA2_BTC0 = 72U, + INT_DMA2_BTC1 = 73U, + INT_DMA2_BTC2 = 74U, + INT_DMA2_BTC3 = 75U, + INT_DMA2_BTC4 = 76U, + INT_DMA2_BTC5 = 77U, + INT_DMA2_BTC6 = 78U, + INT_DMA2_BTC7 = 79U, + INT_DMA2_ERR = 80U, + /* MAU */ + INT_MAU_SQRT = 83U, + /* DVP */ + INT_DVP_FRAMSTA = 84U, + INT_DVP_LINESTA = 85U, + INT_DVP_LINEEND = 86U, + INT_DVP_FRAMEND = 87U, + INT_DVP_SQUERR = 88U, + INT_DVP_FIFOERR = 89U, + /* FMAC */ + INT_FMAC_1 = 91U, + INT_FMAC_2 = 92U, + INT_FMAC_3 = 93U, + INT_FMAC_4 = 94U, + /* TIMER0 */ + INT_TMR0_1_CMPA = 96U, + INT_TMR0_1_CMPB = 97U, + INT_TMR0_2_CMPA = 98U, + INT_TMR0_2_CMPB = 99U, + /* TIMER2 */ + INT_TMR2_1_CMPA = 100U, + INT_TMR2_1_CMPB = 101U, + INT_TMR2_1_OVFA = 102U, + INT_TMR2_1_OVFB = 103U, + INT_TMR2_2_CMPA = 104U, + INT_TMR2_2_CMPB = 105U, + INT_TMR2_2_OVFA = 106U, + INT_TMR2_2_OVFB = 107U, + INT_TMR2_3_CMPA = 108U, + INT_TMR2_3_CMPB = 109U, + INT_TMR2_3_OVFA = 110U, + INT_TMR2_3_OVFB = 111U, + INT_TMR2_4_CMPA = 112U, + INT_TMR2_4_CMPB = 113U, + INT_TMR2_4_OVFA = 114U, + INT_TMR2_4_OVFB = 115U, + /* RTC */ + INT_RTC_TP = 120U, + INT_RTC_ALM = 121U, + INT_RTC_PRD = 122U, + /* XTAL */ + INT_XTAL_STOP = 125U, + /* WKTM */ + INT_WKTM_PRD = 126U, + /* SWDT */ + INT_SWDT_REFUDF = 127U, + /* TIMER6_1 */ + INT_TMR6_1_GCMA = 128U, + INT_TMR6_1_GCMB = 129U, + INT_TMR6_1_GCMC = 130U, + INT_TMR6_1_GCMD = 131U, + INT_TMR6_1_GCME = 132U, + INT_TMR6_1_GCMF = 133U, + INT_TMR6_1_GOVF = 134U, + INT_TMR6_1_GUDF = 135U, + /* TIMER4_1 */ + INT_TMR4_1_GCMUH = 136U, + INT_TMR4_1_GCMUL = 137U, + INT_TMR4_1_GCMVH = 138U, + INT_TMR4_1_GCMVL = 139U, + INT_TMR4_1_GCMWH = 140U, + INT_TMR4_1_GCMWL = 141U, + INT_TMR4_1_GOVF = 142U, + INT_TMR4_1_GUDF = 143U, + /* TIMER6_2 */ + INT_TMR6_2_GCMA = 144U, + INT_TMR6_2_GCMB = 145U, + INT_TMR6_2_GCMC = 146U, + INT_TMR6_2_GCMD = 147U, + INT_TMR6_2_GCME = 148U, + INT_TMR6_2_GCMF = 149U, + INT_TMR6_2_GOVF = 150U, + INT_TMR6_2_GUDF = 151U, + /* TIMER4_2 */ + INT_TMR4_2_GCMUH = 152U, + INT_TMR4_2_GCMUL = 153U, + INT_TMR4_2_GCMVH = 154U, + INT_TMR4_2_GCMVL = 155U, + INT_TMR4_2_GCMWH = 156U, + INT_TMR4_2_GCMWL = 157U, + INT_TMR4_2_GOVF = 158U, + INT_TMR4_2_GUDF = 159U, + /* TIMER6_3 */ + INT_TMR6_3_GCMA = 160U, + INT_TMR6_3_GCMB = 161U, + INT_TMR6_3_GCMC = 162U, + INT_TMR6_3_GCMD = 163U, + INT_TMR6_3_GCME = 164U, + INT_TMR6_3_GCMF = 165U, + INT_TMR6_3_GOVF = 166U, + INT_TMR6_3_GUDF = 167U, + /* TIMER4_3 */ + INT_TMR4_3_GCMUH = 168U, + INT_TMR4_3_GCMUL = 169U, + INT_TMR4_3_GCMVH = 170U, + INT_TMR4_3_GCMVL = 171U, + INT_TMR4_3_GCMWH = 172U, + INT_TMR4_3_GCMWL = 173U, + INT_TMR4_3_GOVF = 174U, + INT_TMR4_3_GUDF = 175U, + /* TIMER6_1 */ + INT_TMR6_1_GDTE = 176U, + INT_TMR6_1_SCMA = 179U, + INT_TMR6_1_SCMB = 180U, + /* TIMER4_1 */ + INT_TMR4_1_RLOU = 181U, + INT_TMR4_1_RLOV = 182U, + INT_TMR4_1_RLOW = 183U, + /* TIMER6_2 */ + INT_TMR6_2_GDTE = 184U, + INT_TMR6_2_SCMA = 187U, + INT_TMR6_2_SCMB = 188U, + /* TIMER4_2 */ + INT_TMR4_2_RLOU = 189U, + INT_TMR4_2_RLOV = 190U, + INT_TMR4_2_RLOW = 191U, + /* TIMER6_3 */ + INT_TMR6_3_GDTE = 192U, + INT_TMR6_3_SCMA = 195U, + INT_TMR6_3_SCMB = 196U, + /* TIMER4_3 */ + INT_TMR4_3_RLOU = 197U, + INT_TMR4_3_RLOV = 198U, + INT_TMR4_3_RLOW = 199U, + /* TIMER6_4 TIMER6_5 */ + INT_TMR6_4_GCMA = 208U, + INT_TMR6_4_GCMB = 209U, + INT_TMR6_4_GCMC = 210U, + INT_TMR6_4_GCMD = 211U, + INT_TMR6_4_GCME = 212U, + INT_TMR6_4_GCMF = 213U, + INT_TMR6_4_GOVF = 214U, + INT_TMR6_4_GUDF = 215U, + INT_TMR6_4_GDTE = 216U, + INT_TMR6_4_SCMA = 219U, + INT_TMR6_4_SCMB = 220U, + INT_TMR6_5_GCMA = 224U, + INT_TMR6_5_GCMB = 225U, + INT_TMR6_5_GCMC = 226U, + INT_TMR6_5_GCMD = 227U, + INT_TMR6_5_GCME = 228U, + INT_TMR6_5_GCMF = 229U, + INT_TMR6_5_GOVF = 230U, + INT_TMR6_5_GUDF = 231U, + INT_TMR6_5_GDTE = 232U, + INT_TMR6_5_SCMA = 235U, + INT_TMR6_5_SCMB = 236U, + /* TIMERA_1 */ + INT_TMRA_1_OVF = 237U, + INT_TMRA_1_UDF = 238U, + INT_TMRA_1_CMP = 239U, + /* TIMER6_6 */ + INT_TMR6_6_GCMA = 240U, + INT_TMR6_6_GCMB = 241U, + INT_TMR6_6_GCMC = 242U, + INT_TMR6_6_GCMD = 243U, + INT_TMR6_6_GCME = 244U, + INT_TMR6_6_GCMF = 245U, + INT_TMR6_6_GOVF = 246U, + INT_TMR6_6_GUDF = 247U, + INT_TMR6_6_GDTE = 248U, + INT_TMR6_6_SCMA = 251U, + INT_TMR6_6_SCMB = 252U, + /* TIMERA_2 */ + INT_TMRA_2_OVF = 253U, + INT_TMRA_2_UDF = 254U, + INT_TMRA_2_CMP = 255U, + /* TIMER6_7 */ + INT_TMR6_7_GCMA = 256U, + INT_TMR6_7_GCMB = 257U, + INT_TMR6_7_GCMC = 258U, + INT_TMR6_7_GCMD = 259U, + INT_TMR6_7_GCME = 260U, + INT_TMR6_7_GCMF = 261U, + INT_TMR6_7_GOVF = 262U, + INT_TMR6_7_GUDF = 263U, + INT_TMR6_7_GDTE = 264U, + INT_TMR6_7_SCMA = 267U, + INT_TMR6_7_SCMB = 268U, + /* TIMERA_3 */ + INT_TMRA_3_OVF = 269U, + INT_TMRA_3_UDF = 270U, + INT_TMRA_3_CMP = 271U, + /* TIMER6_8 */ + INT_TMR6_8_GCMA = 272U, + INT_TMR6_8_GCMB = 273U, + INT_TMR6_8_GCMC = 274U, + INT_TMR6_8_GCMD = 275U, + INT_TMR6_8_GCME = 276U, + INT_TMR6_8_GCMF = 277U, + INT_TMR6_8_GOVF = 278U, + INT_TMR6_8_GUDF = 279U, + INT_TMR6_8_GDTE = 280U, + INT_TMR6_8_SCMA = 283U, + INT_TMR6_8_SCMB = 284U, + /* TIMERA_4 */ + INT_TMRA_4_OVF = 285U, + INT_TMRA_4_UDF = 286U, + INT_TMRA_4_CMP = 287U, + /* EMB */ + INT_EMB_GR0 = 288U, + INT_EMB_GR1 = 289U, + INT_EMB_GR2 = 290U, + INT_EMB_GR3 = 291U, + INT_EMB_GR4 = 292U, + INT_EMB_GR5 = 293U, + INT_EMB_GR6 = 294U, + /* USBHS */ + INT_USBHS_EP1_OUT = 295U, + INT_USBHS_EP1_IN = 296U, + INT_USBHS_GLB = 297U, + INT_USBHS_WKUP = 298U, + /* USART1 USART2 */ + INT_USART1_EI = 300U, + INT_USART1_RI = 301U, + INT_USART1_TI = 302U, + INT_USART1_TCI = 303U, + INT_USART1_RTO = 304U, + INT_USART2_EI = 305U, + INT_USART2_RI = 306U, + INT_USART2_TI = 307U, + INT_USART2_TCI = 308U, + INT_USART2_RTO = 309U, + /* SPI1 SPI2 */ + INT_SPI1_SPRI = 310U, + INT_SPI1_SPTI = 311U, + INT_SPI1_SPII = 312U, + INT_SPI1_SPEI = 313U, + INT_SPI2_SPRI = 315U, + INT_SPI2_SPTI = 316U, + INT_SPI2_SPII = 317U, + INT_SPI2_SPEI = 318U, + /* TIMERA_5 TIMERA_6 TIMERA_7 TIMERA_8 */ + INT_TMRA_5_OVF = 320U, + INT_TMRA_5_UDF = 321U, + INT_TMRA_5_CMP = 322U, + INT_TMRA_6_OVF = 323U, + INT_TMRA_6_UDF = 324U, + INT_TMRA_6_CMP = 325U, + INT_TMRA_7_OVF = 326U, + INT_TMRA_7_UDF = 327U, + INT_TMRA_7_CMP = 328U, + INT_TMRA_8_OVF = 329U, + INT_TMRA_8_UDF = 330U, + INT_TMRA_8_CMP = 331U, + /* USART3 USART4 */ + INT_USART3_EI = 332U, + INT_USART3_RI = 333U, + INT_USART3_TI = 334U, + INT_USART3_TCI = 335U, + INT_USART4_EI = 336U, + INT_USART4_RI = 337U, + INT_USART4_TI = 338U, + INT_USART4_TCI = 339U, + /* CAN1 CAN2 */ + INT_CAN1_HOST = 340U, + INT_CAN2_HOST = 341U, + /* SPI3 SPI4 */ + INT_SPI3_SPRI = 342U, + INT_SPI3_SPTI = 343U, + INT_SPI3_SPII = 344U, + INT_SPI3_SPEI = 345U, + INT_SPI4_SPRI = 347U, + INT_SPI4_SPTI = 348U, + INT_SPI4_SPII = 349U, + INT_SPI4_SPEI = 350U, + /* TIMERA_9 TIMERA_10 TIMER_11 TIMER_12 */ + INT_TMRA_9_OVF = 352U, + INT_TMRA_9_UDF = 353U, + INT_TMRA_9_CMP = 354U, + INT_TMRA_10_OVF = 355U, + INT_TMRA_10_UDF = 356U, + INT_TMRA_10_CMP = 357U, + INT_TMRA_11_OVF = 358U, + INT_TMRA_11_UDF = 359U, + INT_TMRA_11_CMP = 360U, + INT_TMRA_12_OVF = 361U, + INT_TMRA_12_UDF = 362U, + INT_TMRA_12_CMP = 363U, + /* USART5 USART6 */ + INT_USART5_BRKWKPI = 364U, + INT_USART5_EI = 365U, + INT_USART5_RI = 366U, + INT_USART5_TI = 367U, + INT_USART5_TCI = 368U, + INT_USART6_EI = 369U, + INT_USART6_RI = 370U, + INT_USART6_TI = 371U, + INT_USART6_TCI = 372U, + INT_USART6_RTO = 373U, + /* SPI5 SPI6 */ + INT_SPI5_SPRI = 374U, + INT_SPI5_SPTI = 375U, + INT_SPI5_SPII = 376U, + INT_SPI5_SPEI = 377U, + INT_SPI6_SPRI = 379U, + INT_SPI6_SPTI = 380U, + INT_SPI6_SPII = 381U, + INT_SPI6_SPEI = 382U, + /* I2S1 I2S2 */ + INT_I2S1_TXIRQOUT = 384U, + INT_I2S1_RXIRQOUT = 385U, + INT_I2S1_ERRIRQOUT = 386U, + INT_I2S2_TXIRQOUT = 387U, + INT_I2S2_RXIRQOUT = 388U, + INT_I2S2_ERRIRQOUT = 389U, + /* USART7 USART8 */ + INT_USART7_EI = 390U, + INT_USART7_RI = 391U, + INT_USART7_TI = 392U, + INT_USART7_TCI = 393U, + INT_USART7_RTO = 394U, + INT_USART8_EI = 395U, + INT_USART8_RI = 396U, + INT_USART8_TI = 397U, + INT_USART8_TCI = 398U, + /* USBFS */ + INT_USBFS_GLB = 399U, + INT_USBFS_WKUP = 400U, + /* HASH */ + INT_HASH = 401U, + /* SDIOC */ + INT_SDIOC1_SD = 404U, + INT_SDIOC2_SD = 407U, + /* EVENT PORT */ + INT_EVENT_PORT1 = 408U, + INT_EVENT_PORT2 = 409U, + INT_EVENT_PORT3 = 410U, + INT_EVENT_PORT4 = 411U, + /* ETHER */ + INT_ETH_GLB_INT = 412U, + INT_ETH_WKP_INT = 413U, + /* I2S3 I2S4 */ + INT_I2S3_TXIRQOUT = 416U, + INT_I2S3_RXIRQOUT = 417U, + INT_I2S3_ERRIRQOUT = 418U, + INT_I2S4_TXIRQOUT = 419U, + INT_I2S4_RXIRQOUT = 420U, + INT_I2S4_ERRIRQOUT = 421U, + /* USART9 USART10 */ + INT_USART9_EI = 422U, + INT_USART9_RI = 423U, + INT_USART9_TI = 424U, + INT_USART9_TCI = 425U, + INT_USART10_BRKWKPI = 426U, + INT_USART10_EI = 427U, + INT_USART10_RI = 428U, + INT_USART10_TI = 429U, + INT_USART10_TCI = 430U, + /* I2C1 I2C2 I2C3 */ + INT_I2C1_RXI = 432U, + INT_I2C1_TXI = 433U, + INT_I2C1_TEI = 434U, + INT_I2C1_EEI = 435U, + INT_I2C2_RXI = 436U, + INT_I2C2_TXI = 437U, + INT_I2C2_TEI = 438U, + INT_I2C2_EEI = 439U, + INT_I2C3_RXI = 440U, + INT_I2C3_TXI = 441U, + INT_I2C3_TEI = 442U, + INT_I2C3_EEI = 443U, + /* ACMP */ + INT_CMP1 = 444U, + INT_CMP2 = 445U, + INT_CMP3 = 446U, + INT_CMP4 = 447U, + /* I2C4 I2C5 I2C6 */ + INT_I2C4_RXI = 448U, + INT_I2C4_TXI = 449U, + INT_I2C4_TEI = 450U, + INT_I2C4_EEI = 451U, + INT_I2C5_RXI = 452U, + INT_I2C5_TXI = 453U, + INT_I2C5_TEI = 454U, + INT_I2C5_EEI = 455U, + INT_I2C6_RXI = 456U, + INT_I2C6_TXI = 457U, + INT_I2C6_TEI = 458U, + INT_I2C6_EEI = 459U, + /* USART1 */ + INT_USART1_WUPI = 460U, + /* PVD */ + INT_PVD_PVD1 = 461U, + INT_PVD_PVD2 = 462U, + /* OTS */ + INT_OTS = 463U, + /* FCM */ + INT_FCMFERRI = 464U, + INT_FCMMENDI = 465U, + INT_FCMCOVFI = 466U, + /* WDT */ + INT_WDT_REFUDF = 467U, + /* CTC */ + INT_CTC_ERR = 468U, + /* ADC */ + INT_ADC1_EOCA = 480U, + INT_ADC1_EOCB = 481U, + INT_ADC1_CMP0 = 482U, + INT_ADC1_CMP1 = 483U, + INT_ADC2_EOCA = 484U, + INT_ADC2_EOCB = 485U, + INT_ADC2_CMP0 = 486U, + INT_ADC2_CMP1 = 487U, + INT_ADC3_EOCA = 488U, + INT_ADC3_EOCB = 489U, + INT_ADC3_CMP0 = 490U, + INT_ADC3_CMP1 = 491U, + /* TRNG */ + INT_TRNG_END = 492U, + /* NFC */ + INT_NFC_INT = 496U, + INT_SRC_MAX = 511U, +} en_int_src_t; + +#if defined ( __CC_ARM ) +#pragma anon_unions +#endif + +/******************************************************************************/ +/* Device Specific Peripheral Registers structures */ +/******************************************************************************/ +/** + * @brief ADC + */ +typedef struct +{ + __IO uint8_t STR; + uint8_t RESERVED0[1]; + __IO uint16_t CR0; + __IO uint16_t CR1; + uint8_t RESERVED1[4]; + __IO uint16_t TRGSR; + __IO uint32_t CHSELRA; + __IO uint32_t CHSELRB; + __IO uint32_t AVCHSELR; + __IO uint8_t EXCHSELR; + uint8_t RESERVED2[1]; + __IO uint16_t SHCR; + uint8_t RESERVED3[4]; + __IO uint8_t SSTR0; + __IO uint8_t SSTR1; + __IO uint8_t SSTR2; + __IO uint8_t SSTR3; + __IO uint8_t SSTR4; + __IO uint8_t SSTR5; + __IO uint8_t SSTR6; + __IO uint8_t SSTR7; + __IO uint8_t SSTR8; + __IO uint8_t SSTR9; + __IO uint8_t SSTR10; + __IO uint8_t SSTR11; + __IO uint8_t SSTR12; + __IO uint8_t SSTR13; + __IO uint8_t SSTR14; + __IO uint8_t SSTR15; + __IO uint8_t SSTRL; + uint8_t RESERVED4[7]; + __IO uint16_t CHMUXR0; + __IO uint16_t CHMUXR1; + __IO uint16_t CHMUXR2; + __IO uint16_t CHMUXR3; + uint8_t RESERVED5[4]; + __IO uint8_t ISR; + __IO uint8_t ICR; + __IO uint8_t ISCLRR; + uint8_t RESERVED6[5]; + __IO uint16_t SYNCCR; + uint8_t RESERVED7[2]; + __IO uint16_t DR0; + __IO uint16_t DR1; + __IO uint16_t DR2; + __IO uint16_t DR3; + __IO uint16_t DR4; + __IO uint16_t DR5; + __IO uint16_t DR6; + __IO uint16_t DR7; + __IO uint16_t DR8; + __IO uint16_t DR9; + __IO uint16_t DR10; + __IO uint16_t DR11; + __IO uint16_t DR12; + __IO uint16_t DR13; + __IO uint16_t DR14; + __IO uint16_t DR15; + __IO uint16_t DR16; + __IO uint16_t DR17; + __IO uint16_t DR18; + __IO uint16_t DR19; + uint8_t RESERVED8[40]; + __IO uint16_t AWDCR; + __IO uint8_t AWDSR; + __IO uint8_t AWDSCLRR; + __IO uint16_t AWD0DR0; + __IO uint16_t AWD0DR1; + __IO uint16_t AWD0CHSR; + uint8_t RESERVED9[2]; + __IO uint16_t AWD1DR0; + __IO uint16_t AWD1DR1; + __IO uint16_t AWD1CHSR; + uint8_t RESERVED10[14]; + __IO uint8_t PGACR1; + __IO uint8_t PGACR2; + __IO uint8_t PGACR3; + uint8_t RESERVED11[1]; + __IO uint8_t PGAVSSENR; +} M4_ADC_TypeDef; + +/** + * @brief AES + */ +typedef struct +{ + __IO uint32_t CR; + uint8_t RESERVED0[12]; + __IO uint32_t DR0; + __IO uint32_t DR1; + __IO uint32_t DR2; + __IO uint32_t DR3; + __IO uint32_t KR0; + __IO uint32_t KR1; + __IO uint32_t KR2; + __IO uint32_t KR3; + __IO uint32_t KR4; + __IO uint32_t KR5; + __IO uint32_t KR6; + __IO uint32_t KR7; +} M4_AES_TypeDef; + +/** + * @brief AOS + */ +typedef struct +{ + __IO uint32_t INT_SFTTRG; + __IO uint32_t DCU_1_TRGSEL; + __IO uint32_t DCU_2_TRGSEL; + __IO uint32_t DCU_3_TRGSEL; + __IO uint32_t DCU_4_TRGSEL; + __IO uint32_t DMA_1_TRGSEL0; + __IO uint32_t DMA_1_TRGSEL1; + __IO uint32_t DMA_1_TRGSEL2; + __IO uint32_t DMA_1_TRGSEL3; + __IO uint32_t DMA_1_TRGSEL4; + __IO uint32_t DMA_1_TRGSEL5; + __IO uint32_t DMA_1_TRGSEL6; + __IO uint32_t DMA_1_TRGSEL7; + __IO uint32_t DMA_2_TRGSEL0; + __IO uint32_t DMA_2_TRGSEL1; + __IO uint32_t DMA_2_TRGSEL2; + __IO uint32_t DMA_2_TRGSEL3; + __IO uint32_t DMA_2_TRGSEL4; + __IO uint32_t DMA_2_TRGSEL5; + __IO uint32_t DMA_2_TRGSEL6; + __IO uint32_t DMA_2_TRGSEL7; + __IO uint32_t DMA_TRGSELRC; + __IO uint32_t TMR6_HTSSR1; + __IO uint32_t TMR6_HTSSR2; + __IO uint32_t TMR6_HTSSR3; + __IO uint32_t TMR6_HTSSR4; + __IO uint32_t PORT_PEVNTTRGSR12; + __IO uint32_t PORT_PEVNTTRGSR34; + __IO uint32_t TMR0_HTSSR; + __IO uint32_t TMR2_HTSSR; + __IO uint32_t HASH_ITRGSELA; + __IO uint32_t HASH_ITRGSELB; + __IO uint32_t TMRA_HTSSR0; + __IO uint32_t TMRA_HTSSR1; + __IO uint32_t TMRA_HTSSR2; + __IO uint32_t TMRA_HTSSR3; + __IO uint32_t OTS_TRG; + __IO uint32_t ADC_1_ITRGSELR0; + __IO uint32_t ADC_1_ITRGSELR1; + __IO uint32_t ADC_2_ITRGSELR0; + __IO uint32_t ADC_2_ITRGSELR1; + __IO uint32_t ADC_3_ITRGSELR0; + __IO uint32_t ADC_3_ITRGSELR1; + __IO uint32_t COMTRG1; + __IO uint32_t COMTRG2; + uint8_t RESERVED0[76]; + __IO uint32_t GPIO_PEVNTDIRR1; + __IO uint32_t GPIO_PEVNTIDR1; + __IO uint32_t GPIO_PEVNTODR1; + __IO uint32_t GPIO_PEVNTORR1; + __IO uint32_t GPIO_PEVNTOSR1; + __IO uint32_t GPIO_PEVNTRISR1; + __IO uint32_t GPIO_PEVNTFAL1; + __IO uint32_t GPIO_PEVNTDIRR2; + __IO uint32_t GPIO_PEVNTIDR2; + __IO uint32_t GPIO_PEVNTODR2; + __IO uint32_t GPIO_PEVNTORR2; + __IO uint32_t GPIO_PEVNTOSR2; + __IO uint32_t GPIO_PEVNTRISR2; + __IO uint32_t GPIO_PEVNTFAL2; + __IO uint32_t GPIO_PEVNTDIRR3; + __IO uint32_t GPIO_PEVNTIDR3; + __IO uint32_t GPIO_PEVNTODR3; + __IO uint32_t GPIO_PEVNTORR3; + __IO uint32_t GPIO_PEVNTOSR3; + __IO uint32_t GPIO_PEVNTRISR3; + __IO uint32_t GPIO_PEVNTFAL3; + __IO uint32_t GPIO_PEVNTDIRR4; + __IO uint32_t GPIO_PEVNTIDR4; + __IO uint32_t GPIO_PEVNTODR4; + __IO uint32_t GPIO_PEVNTORR4; + __IO uint32_t GPIO_PEVNTOSR4; + __IO uint32_t GPIO_PEVNTRISR4; + __IO uint32_t GPIO_PEVNTFAL4; + __IO uint32_t GPIO_PEVNTNFCR; +} M4_AOS_TypeDef; + +/** + * @brief CAN + */ +typedef struct +{ + __IO uint32_t RBUF; + uint8_t RESERVED0[76]; + __IO uint32_t TBUF; + uint8_t RESERVED1[76]; + __IO uint8_t CFG_STAT; + __IO uint8_t TCMD; + __IO uint8_t TCTRL; + __IO uint8_t RCTRL; + __IO uint8_t RTIE; + __IO uint8_t RTIF; + __IO uint8_t ERRINT; + __IO uint8_t LIMIT; + __IO uint32_t SBT; + __IO uint32_t FBT; + __IO uint8_t EALCAP; + __IO uint8_t TDC; + __IO uint8_t RECNT; + __IO uint8_t TECNT; + __IO uint8_t ACFCTRL; + uint8_t RESERVED2[1]; + __IO uint16_t ACFEN; + __IO uint32_t ACF; + uint8_t RESERVED3[2]; + __IO uint8_t TBSLOT; + __IO uint8_t TTCFG; + __IO uint32_t REF_MSG; + __IO uint16_t TRG_CFG; + __IO uint16_t TT_TRIG; + __IO uint16_t TT_WTRIG; +} M4_CAN_TypeDef; + +/** + * @brief CMP + */ +typedef struct +{ + __IO uint8_t MDR; + __IO uint8_t FIR; + __IO uint8_t OCR; + __IO uint8_t PMSR; + __IO uint16_t TWSR; + __IO uint16_t TWPR; + __IO uint16_t VISR; +} M4_CMP_TypeDef; + +/** + * @brief CMU + */ +typedef struct +{ + __IO uint8_t XTAL32CR; + uint8_t RESERVED0[3]; + __IO uint8_t XTAL32CFGR; + uint8_t RESERVED1[15]; + __IO uint8_t XTAL32NFR; + uint8_t RESERVED2[7]; + __IO uint8_t LRCCR; + uint8_t RESERVED3[3]; + __IO uint8_t RTCLRCCR; + uint8_t RESERVED4[3]; + __IO uint8_t LRCTRM; + uint8_t RESERVED5[7]; + __IO uint8_t RTCLRCTRM; + uint8_t RESERVED6[2123]; + __IO uint8_t XTALCFGR; + uint8_t RESERVED7[29591]; + __IO uint16_t PERICKSEL; + __IO uint16_t I2SCKSEL; + uint8_t RESERVED8[4]; + __IO uint8_t CANCKCFGR; + uint8_t RESERVED9[7]; + __IO uint32_t SCFGR; + __IO uint8_t USBCKCFGR; + uint8_t RESERVED10[1]; + __IO uint8_t CKSWR; + uint8_t RESERVED11[3]; + __IO uint8_t PLLHCR; + uint8_t RESERVED12[3]; + __IO uint8_t PLLACR; + uint8_t RESERVED13[3]; + __IO uint8_t XTALCR; + uint8_t RESERVED14[3]; + __IO uint8_t HRCCR; + uint8_t RESERVED15[1]; + __IO uint8_t MRCCR; + uint8_t RESERVED16[3]; + __IO uint8_t OSCSTBSR; + __IO uint8_t MCO1CFGR; + __IO uint8_t MCO2CFGR; + __IO uint8_t TPIUCKCFGR; + __IO uint8_t XTALSTDCR; + __IO uint8_t XTALSTDSR; + uint8_t RESERVED17[31]; + __IO uint8_t MRCTRM; + __IO uint8_t HRCTRM; + uint8_t RESERVED18[63]; + __IO uint8_t XTALSTBCR; + uint8_t RESERVED19[93]; + __IO uint32_t PLLHCFGR; + __IO uint32_t PLLACFGR; +} M4_CMU_TypeDef; + +/** + * @brief CRC + */ +typedef struct +{ + __IO uint32_t CR; + __IO uint32_t RESLT; + uint8_t RESERVED0[120]; + __IO uint32_t DAT0; + __IO uint32_t DAT1; + __IO uint32_t DAT2; + __IO uint32_t DAT3; + __IO uint32_t DAT4; + __IO uint32_t DAT5; + __IO uint32_t DAT6; + __IO uint32_t DAT7; + __IO uint32_t DAT8; + __IO uint32_t DAT9; + __IO uint32_t DAT10; + __IO uint32_t DAT11; + __IO uint32_t DAT12; + __IO uint32_t DAT13; + __IO uint32_t DAT14; + __IO uint32_t DAT15; + __IO uint32_t DAT16; + __IO uint32_t DAT17; + __IO uint32_t DAT18; + __IO uint32_t DAT19; + __IO uint32_t DAT20; + __IO uint32_t DAT21; + __IO uint32_t DAT22; + __IO uint32_t DAT23; + __IO uint32_t DAT24; + __IO uint32_t DAT25; + __IO uint32_t DAT26; + __IO uint32_t DAT27; + __IO uint32_t DAT28; + __IO uint32_t DAT29; + __IO uint32_t DAT30; + __IO uint32_t DAT31; +} M4_CRC_TypeDef; + +/** + * @brief CTC + */ +typedef struct +{ + __IO uint32_t CR1; + __IO uint32_t CR2; + __IO uint32_t STR; +} M4_CTC_TypeDef; + +/** + * @brief DAC + */ +typedef struct +{ + __IO uint16_t DADR1; + __IO uint16_t DADR2; + __IO uint16_t DACR; + __IO uint16_t DAADPCR; + uint8_t RESERVED0[20]; + __IO uint16_t DAOCR; +} M4_DAC_TypeDef; + +/** + * @brief DBGC + */ +typedef struct +{ + __IO uint32_t AUTHID0; + __IO uint32_t AUTHID1; + __IO uint32_t AUTHID2; + __IO uint32_t RESV0; + __IO uint32_t MCUSTAT; + __IO uint32_t MCUCTL; + __IO uint32_t FMCCTL; + __IO uint32_t MCUDBGCSTAT; + __IO uint32_t MCUSTPCTL; + __IO uint32_t MCUTRACECTL; + __IO uint32_t MCUSTPCTL2; +} M4_DBGC_TypeDef; + +/** + * @brief DCU + */ +typedef struct +{ + __IO uint32_t CTL; + __IO uint32_t FLAG; + __IO uint32_t DATA0; + __IO uint32_t DATA1; + __IO uint32_t DATA2; + __IO uint32_t FLAGCLR; + __IO uint32_t INTEVTSEL; +} M4_DCU_TypeDef; + +/** + * @brief DMA + */ +typedef struct +{ + __IO uint32_t EN; + __IO uint32_t INTSTAT0; + __IO uint32_t INTSTAT1; + __IO uint32_t INTMASK0; + __IO uint32_t INTMASK1; + __IO uint32_t INTCLR0; + __IO uint32_t INTCLR1; + __IO uint32_t CHEN; + __IO uint32_t REQSTAT; + __IO uint32_t CHSTAT; + uint8_t RESERVED0[4]; + __IO uint32_t RCFGCTL; + uint8_t RESERVED1[4]; + __IO uint32_t CHENCLR; + uint8_t RESERVED2[8]; + __IO uint32_t SAR0; + __IO uint32_t DAR0; + __IO uint32_t DTCTL0; + union + { + __IO uint32_t RPT0; + __IO uint32_t RPTB0; + }; + union + { + __IO uint32_t SNSEQCTL0; + __IO uint32_t SNSEQCTLB0; + }; + union + { + __IO uint32_t DNSEQCTL0; + __IO uint32_t DNSEQCTLB0; + }; + __IO uint32_t LLP0; + __IO uint32_t CHCTL0; + __IO uint32_t MONSAR0; + __IO uint32_t MONDAR0; + __IO uint32_t MONDTCTL0; + __IO uint32_t MONRPT0; + __IO uint32_t MONSNSEQCTL0; + __IO uint32_t MONDNSEQCTL0; + uint8_t RESERVED3[8]; + __IO uint32_t SAR1; + __IO uint32_t DAR1; + __IO uint32_t DTCTL1; + union + { + __IO uint32_t RPT1; + __IO uint32_t RPTB1; + }; + union + { + __IO uint32_t SNSEQCTL1; + __IO uint32_t SNSEQCTLB1; + }; + union + { + __IO uint32_t DNSEQCTL1; + __IO uint32_t DNSEQCTLB1; + }; + __IO uint32_t LLP1; + __IO uint32_t CHCTL1; + __IO uint32_t MONSAR1; + __IO uint32_t MONDAR1; + __IO uint32_t MONDTCTL1; + __IO uint32_t MONRPT1; + __IO uint32_t MONSNSEQCTL1; + __IO uint32_t MONDNSEQCTL1; + uint8_t RESERVED4[8]; + __IO uint32_t SAR2; + __IO uint32_t DAR2; + __IO uint32_t DTCTL2; + union + { + __IO uint32_t RPT2; + __IO uint32_t RPTB2; + }; + union + { + __IO uint32_t SNSEQCTL2; + __IO uint32_t SNSEQCTLB2; + }; + union + { + __IO uint32_t DNSEQCTL2; + __IO uint32_t DNSEQCTLB2; + }; + __IO uint32_t LLP2; + __IO uint32_t CHCTL2; + __IO uint32_t MONSAR2; + __IO uint32_t MONDAR2; + __IO uint32_t MONDTCTL2; + __IO uint32_t MONRPT2; + __IO uint32_t MONSNSEQCTL2; + __IO uint32_t MONDNSEQCTL2; + uint8_t RESERVED5[8]; + __IO uint32_t SAR3; + __IO uint32_t DAR3; + __IO uint32_t DTCTL3; + union + { + __IO uint32_t RPT3; + __IO uint32_t RPTB3; + }; + union + { + __IO uint32_t SNSEQCTL3; + __IO uint32_t SNSEQCTLB3; + }; + union + { + __IO uint32_t DNSEQCTL3; + __IO uint32_t DNSEQCTLB3; + }; + __IO uint32_t LLP3; + __IO uint32_t CHCTL3; + __IO uint32_t MONSAR3; + __IO uint32_t MONDAR3; + __IO uint32_t MONDTCTL3; + __IO uint32_t MONRPT3; + __IO uint32_t MONSNSEQCTL3; + __IO uint32_t MONDNSEQCTL3; + uint8_t RESERVED6[8]; + __IO uint32_t SAR4; + __IO uint32_t DAR4; + __IO uint32_t DTCTL4; + union + { + __IO uint32_t RPT4; + __IO uint32_t RPTB4; + }; + union + { + __IO uint32_t SNSEQCTL4; + __IO uint32_t SNSEQCTLB4; + }; + union + { + __IO uint32_t DNSEQCTL4; + __IO uint32_t DNSEQCTLB4; + }; + __IO uint32_t LLP4; + __IO uint32_t CHCTL4; + __IO uint32_t MONSAR4; + __IO uint32_t MONDAR4; + __IO uint32_t MONDTCTL4; + __IO uint32_t MONRPT4; + __IO uint32_t MONSNSEQCTL4; + __IO uint32_t MONDNSEQCTL4; + uint8_t RESERVED7[8]; + __IO uint32_t SAR5; + __IO uint32_t DAR5; + __IO uint32_t DTCTL5; + union + { + __IO uint32_t RPT5; + __IO uint32_t RPTB5; + }; + union + { + __IO uint32_t SNSEQCTL5; + __IO uint32_t SNSEQCTLB5; + }; + union + { + __IO uint32_t DNSEQCTL5; + __IO uint32_t DNSEQCTLB5; + }; + __IO uint32_t LLP5; + __IO uint32_t CHCTL5; + __IO uint32_t MONSAR5; + __IO uint32_t MONDAR5; + __IO uint32_t MONDTCTL5; + __IO uint32_t MONRPT5; + __IO uint32_t MONSNSEQCTL5; + __IO uint32_t MONDNSEQCTL5; + uint8_t RESERVED8[8]; + __IO uint32_t SAR6; + __IO uint32_t DAR6; + __IO uint32_t DTCTL6; + union + { + __IO uint32_t RPT6; + __IO uint32_t RPTB6; + }; + union + { + __IO uint32_t SNSEQCTL6; + __IO uint32_t SNSEQCTLB6; + }; + union + { + __IO uint32_t DNSEQCTL6; + __IO uint32_t DNSEQCTLB6; + }; + __IO uint32_t LLP6; + __IO uint32_t CHCTL6; + __IO uint32_t MONSAR6; + __IO uint32_t MONDAR6; + __IO uint32_t MONDTCTL6; + __IO uint32_t MONRPT6; + __IO uint32_t MONSNSEQCTL6; + __IO uint32_t MONDNSEQCTL6; + uint8_t RESERVED9[8]; + __IO uint32_t SAR7; + __IO uint32_t DAR7; + __IO uint32_t DTCTL7; + union + { + __IO uint32_t RPT7; + __IO uint32_t RPTB7; + }; + union + { + __IO uint32_t SNSEQCTL7; + __IO uint32_t SNSEQCTLB7; + }; + union + { + __IO uint32_t DNSEQCTL7; + __IO uint32_t DNSEQCTLB7; + }; + __IO uint32_t LLP7; + __IO uint32_t CHCTL7; + __IO uint32_t MONSAR7; + __IO uint32_t MONDAR7; + __IO uint32_t MONDTCTL7; + __IO uint32_t MONRPT7; + __IO uint32_t MONSNSEQCTL7; + __IO uint32_t MONDNSEQCTL7; +} M4_DMA_TypeDef; + +/** + * @brief DMC + */ +typedef struct +{ + __IO uint32_t STSR; + __IO uint32_t STCR; + __IO uint32_t CMDR; + __IO uint32_t CPCR; + __IO uint32_t RFTR; + __IO uint32_t TMCR_T_CASL; + __IO uint32_t TMCR_T_DQSS; + __IO uint32_t TMCR_T_MRD; + __IO uint32_t TMCR_T_RAS; + __IO uint32_t TMCR_T_RC; + __IO uint32_t TMCR_T_RCD; + __IO uint32_t TMCR_T_RFC; + __IO uint32_t TMCR_T_RP; + __IO uint32_t TMCR_T_RRD; + __IO uint32_t TMCR_T_WR; + __IO uint32_t TMCR_T_WTR; + __IO uint32_t TMCR_T_XP; + __IO uint32_t TMCR_T_XSR; + __IO uint32_t TMCR_T_ESR; + uint8_t RESERVED0[436]; + __IO uint32_t CSCR0; + __IO uint32_t CSCR1; + __IO uint32_t CSCR2; + __IO uint32_t CSCR3; + uint8_t RESERVED1[240]; + __IO uint32_t BACR; +} M4_DMC_TypeDef; + +/** + * @brief DVP + */ +typedef struct +{ + __IO uint32_t CTR; + __IO uint32_t DTR; + __IO uint32_t STR; + __IO uint32_t IER; + __IO uint32_t DMR; + uint8_t RESERVED0[12]; + __IO uint32_t SSYNDR; + __IO uint32_t SSYNMR; + __IO uint32_t CPSFTR; + __IO uint32_t CPSZER; +} M4_DVP_TypeDef; + +/** + * @brief EFM + */ +typedef struct +{ + __IO uint32_t FAPRT; + __IO uint32_t KEY1; + __IO uint32_t KEY2; + uint8_t RESERVED0[8]; + __IO uint32_t FSTP; + __IO uint32_t FRMC; + __IO uint32_t FWMC; + __IO uint32_t FSR; + __IO uint32_t FSCLR; + __IO uint32_t FITE; + __IO uint32_t FSWP; + uint8_t RESERVED1[16]; + __IO uint32_t FHDFG; + uint8_t RESERVED2[12]; + __IO uint32_t UQID0; + __IO uint32_t UQID1; + __IO uint32_t UQID2; + uint8_t RESERVED3[164]; + __IO uint32_t REMPRT; + __IO uint32_t REMCR0; + __IO uint32_t REMCR1; + uint8_t RESERVED4[116]; + __IO uint32_t WLOCK; + uint8_t RESERVED5[12]; + __IO uint32_t F0NWPRT0; + __IO uint32_t F0NWPRT1; + __IO uint32_t F0NWPRT2; + __IO uint32_t F0NWPRT3; + __IO uint32_t F1NWPRT0; + __IO uint32_t F1NWPRT1; + __IO uint32_t F1NWPRT2; + __IO uint32_t F1NWPRT3; +} M4_EFM_TypeDef; + +/** + * @brief EMB + */ +typedef struct +{ + __IO uint32_t CTL1; + __IO uint32_t CTL2; + __IO uint32_t SOE; + __IO uint32_t STAT; + __IO uint32_t STATCLR; + __IO uint32_t INTEN; + __IO uint32_t RLSSEL; +} M4_EMB_TypeDef; + +/** + * @brief ETH + */ +typedef struct +{ + uint8_t RESERVED0[21520]; + __IO uint32_t MAC_IFCONFR; + uint8_t RESERVED1[44012]; + __IO uint32_t MAC_CONFIGR; + __IO uint32_t MAC_FLTCTLR; + __IO uint32_t MAC_HASHTHR; + __IO uint32_t MAC_HASHTLR; + __IO uint32_t MAC_SMIADDR; + __IO uint32_t MAC_SMIDATR; + __IO uint32_t MAC_FLOCTLR; + __IO uint32_t MAC_VTAFLTR; + uint8_t RESERVED2[4]; + __IO uint32_t MAC_MACSTSR; + __IO uint32_t MAC_RTWKFFR; + __IO uint32_t MAC_PMTCTLR; + uint8_t RESERVED3[8]; + __IO uint32_t MAC_INTSTSR; + __IO uint32_t MAC_INTMSKR; + __IO uint32_t MAC_MACADHR0; + __IO uint32_t MAC_MACADLR0; + __IO uint32_t MAC_MACADHR1; + __IO uint32_t MAC_MACADLR1; + __IO uint32_t MAC_MACADHR2; + __IO uint32_t MAC_MACADLR2; + __IO uint32_t MAC_MACADHR3; + __IO uint32_t MAC_MACADLR3; + __IO uint32_t MAC_MACADHR4; + __IO uint32_t MAC_MACADLR4; + uint8_t RESERVED4[152]; + __IO uint32_t MMC_MMCCTLR; + __IO uint32_t MMC_REVSTSR; + __IO uint32_t MMC_TRSSTSR; + __IO uint32_t MMC_RITCTLR; + __IO uint32_t MMC_TITCTLR; + uint8_t RESERVED5[8]; + __IO uint32_t MMC_TXBRGFR; + __IO uint32_t MMC_TXMUGFR; + uint8_t RESERVED6[48]; + __IO uint32_t MMC_TXDEEFR; + __IO uint32_t MMC_TXLCEFR; + __IO uint32_t MMC_TXECEFR; + __IO uint32_t MMC_TXCAEFR; + uint8_t RESERVED7[4]; + __IO uint32_t MMC_TXUNGFR; + __IO uint32_t MMC_TXEDEFR; + uint8_t RESERVED8[28]; + __IO uint32_t MMC_RXBRGFR; + __IO uint32_t MMC_RXMUGFR; + __IO uint32_t MMC_RXCREFR; + __IO uint32_t MMC_RXALEFR; + __IO uint32_t MMC_RXRUEFR; + uint8_t RESERVED9[36]; + __IO uint32_t MMC_RXUNGFR; + __IO uint32_t MMC_RXLEEFR; + __IO uint32_t MMC_RXOREFR; + uint8_t RESERVED10[560]; + __IO uint32_t MAC_L34CTLR; + __IO uint32_t MAC_L4PORTR; + uint8_t RESERVED11[8]; + __IO uint32_t MAC_L3ADDRR0; + __IO uint32_t MAC_L3ADDRR1; + __IO uint32_t MAC_L3ADDRR2; + __IO uint32_t MAC_L3ADDRR3; + uint8_t RESERVED12[356]; + __IO uint32_t MAC_VTACTLR; + __IO uint32_t MAC_VLAHTBR; + uint8_t RESERVED13[372]; + __IO uint32_t PTP_TSPCTLR; + __IO uint32_t PTP_TSPNSAR; + __IO uint32_t PTP_TMSSECR; + __IO uint32_t PTP_TMSNSER; + __IO uint32_t PTP_TMUSECR; + __IO uint32_t PTP_TMUNSER; + __IO uint32_t PTP_TSPADDR; + __IO uint32_t PTP_TMTSECR0; + __IO uint32_t PTP_TMTNSER0; + uint8_t RESERVED14[4]; + __IO uint32_t PTP_TSPSTSR; + __IO uint32_t PTP_PPSCTLR; + uint8_t RESERVED15[80]; + __IO uint32_t PTP_TMTSECR1; + __IO uint32_t PTP_TMTNSER1; + uint8_t RESERVED16[2168]; + __IO uint32_t DMA_BUSMODR; + __IO uint32_t DMA_TXPOLLR; + __IO uint32_t DMA_RXPOLLR; + __IO uint32_t DMA_RXDLADR; + __IO uint32_t DMA_TXDLADR; + __IO uint32_t DMA_DMASTSR; + __IO uint32_t DMA_OPRMODR; + __IO uint32_t DMA_INTENAR; + __IO uint32_t DMA_RFRCNTR; + __IO uint32_t DMA_REVWDTR; + uint8_t RESERVED17[32]; + __IO uint32_t DMA_CHTXDER; + __IO uint32_t DMA_CHRXDER; + __IO uint32_t DMA_CHTXBFR; + __IO uint32_t DMA_CHRXBFR; +} M4_ETH_TypeDef; + +/** + * @brief FCM + */ +typedef struct +{ + __IO uint32_t LVR; + __IO uint32_t UVR; + __IO uint32_t CNTR; + __IO uint32_t STR; + __IO uint32_t MCCR; + __IO uint32_t RCCR; + __IO uint32_t RIER; + __IO uint32_t SR; + __IO uint32_t CLR; +} M4_FCM_TypeDef; + +/** + * @brief FMAC + */ +typedef struct +{ + __IO uint32_t ENR; + __IO uint32_t CTR; + __IO uint32_t IER; + __IO uint32_t DTR; + __IO uint32_t RTR0; + __IO uint32_t RTR1; + __IO uint32_t STR; + uint8_t RESERVED0[4]; + __IO uint32_t COR0; + __IO uint32_t COR1; + __IO uint32_t COR2; + __IO uint32_t COR3; + __IO uint32_t COR4; + __IO uint32_t COR5; + __IO uint32_t COR6; + __IO uint32_t COR7; + __IO uint32_t COR8; + __IO uint32_t COR9; + __IO uint32_t COR10; + __IO uint32_t COR11; + __IO uint32_t COR12; + __IO uint32_t COR13; + __IO uint32_t COR14; + __IO uint32_t COR15; + __IO uint32_t COR16; +} M4_FMAC_TypeDef; + +/** + * @brief GPIO + */ +typedef struct +{ + __IO uint16_t PIDRA; + uint8_t RESERVED0[2]; + __IO uint16_t PODRA; + __IO uint16_t POERA; + __IO uint16_t POSRA; + __IO uint16_t PORRA; + __IO uint16_t POTRA; + uint8_t RESERVED1[2]; + __IO uint16_t PIDRB; + uint8_t RESERVED2[2]; + __IO uint16_t PODRB; + __IO uint16_t POERB; + __IO uint16_t POSRB; + __IO uint16_t PORRB; + __IO uint16_t POTRB; + uint8_t RESERVED3[2]; + __IO uint16_t PIDRC; + uint8_t RESERVED4[2]; + __IO uint16_t PODRC; + __IO uint16_t POERC; + __IO uint16_t POSRC; + __IO uint16_t PORRC; + __IO uint16_t POTRC; + uint8_t RESERVED5[2]; + __IO uint16_t PIDRD; + uint8_t RESERVED6[2]; + __IO uint16_t PODRD; + __IO uint16_t POERD; + __IO uint16_t POSRD; + __IO uint16_t PORRD; + __IO uint16_t POTRD; + uint8_t RESERVED7[2]; + __IO uint16_t PIDRE; + uint8_t RESERVED8[2]; + __IO uint16_t PODRE; + __IO uint16_t POERE; + __IO uint16_t POSRE; + __IO uint16_t PORRE; + __IO uint16_t POTRE; + uint8_t RESERVED9[2]; + __IO uint16_t PIDRF; + uint8_t RESERVED10[2]; + __IO uint16_t PODRF; + __IO uint16_t POERF; + __IO uint16_t POSRF; + __IO uint16_t PORRF; + __IO uint16_t POTRF; + uint8_t RESERVED11[2]; + __IO uint16_t PIDRG; + uint8_t RESERVED12[2]; + __IO uint16_t PODRG; + __IO uint16_t POERG; + __IO uint16_t POSRG; + __IO uint16_t PORRG; + __IO uint16_t POTRG; + uint8_t RESERVED13[2]; + __IO uint16_t PIDRH; + uint8_t RESERVED14[2]; + __IO uint16_t PODRH; + __IO uint16_t POERH; + __IO uint16_t POSRH; + __IO uint16_t PORRH; + __IO uint16_t POTRH; + uint8_t RESERVED15[2]; + __IO uint16_t PIDRI; + uint8_t RESERVED16[2]; + __IO uint16_t PODRI; + __IO uint16_t POERI; + __IO uint16_t POSRI; + __IO uint16_t PORRI; + __IO uint16_t POTRI; + uint8_t RESERVED17[870]; + __IO uint16_t PSPCR; + uint8_t RESERVED18[2]; + __IO uint16_t PCCR; + __IO uint16_t PINAER; + __IO uint16_t PWPR; + uint8_t RESERVED19[2]; + __IO uint16_t PCRA0; + __IO uint16_t PFSRA0; + __IO uint16_t PCRA1; + __IO uint16_t PFSRA1; + __IO uint16_t PCRA2; + __IO uint16_t PFSRA2; + __IO uint16_t PCRA3; + __IO uint16_t PFSRA3; + __IO uint16_t PCRA4; + __IO uint16_t PFSRA4; + __IO uint16_t PCRA5; + __IO uint16_t PFSRA5; + __IO uint16_t PCRA6; + __IO uint16_t PFSRA6; + __IO uint16_t PCRA7; + __IO uint16_t PFSRA7; + __IO uint16_t PCRA8; + __IO uint16_t PFSRA8; + __IO uint16_t PCRA9; + __IO uint16_t PFSRA9; + __IO uint16_t PCRA10; + __IO uint16_t PFSRA10; + __IO uint16_t PCRA11; + __IO uint16_t PFSRA11; + __IO uint16_t PCRA12; + __IO uint16_t PFSRA12; + __IO uint16_t PCRA13; + __IO uint16_t PFSRA13; + __IO uint16_t PCRA14; + __IO uint16_t PFSRA14; + __IO uint16_t PCRA15; + __IO uint16_t PFSRA15; + __IO uint16_t PCRB0; + __IO uint16_t PFSRB0; + __IO uint16_t PCRB1; + __IO uint16_t PFSRB1; + __IO uint16_t PCRB2; + __IO uint16_t PFSRB2; + __IO uint16_t PCRB3; + __IO uint16_t PFSRB3; + __IO uint16_t PCRB4; + __IO uint16_t PFSRB4; + __IO uint16_t PCRB5; + __IO uint16_t PFSRB5; + __IO uint16_t PCRB6; + __IO uint16_t PFSRB6; + __IO uint16_t PCRB7; + __IO uint16_t PFSRB7; + __IO uint16_t PCRB8; + __IO uint16_t PFSRB8; + __IO uint16_t PCRB9; + __IO uint16_t PFSRB9; + __IO uint16_t PCRB10; + __IO uint16_t PFSRB10; + __IO uint16_t PCRB11; + __IO uint16_t PFSRB11; + __IO uint16_t PCRB12; + __IO uint16_t PFSRB12; + __IO uint16_t PCRB13; + __IO uint16_t PFSRB13; + __IO uint16_t PCRB14; + __IO uint16_t PFSRB14; + __IO uint16_t PCRB15; + __IO uint16_t PFSRB15; + __IO uint16_t PCRC0; + __IO uint16_t PFSRC0; + __IO uint16_t PCRC1; + __IO uint16_t PFSRC1; + __IO uint16_t PCRC2; + __IO uint16_t PFSRC2; + __IO uint16_t PCRC3; + __IO uint16_t PFSRC3; + __IO uint16_t PCRC4; + __IO uint16_t PFSRC4; + __IO uint16_t PCRC5; + __IO uint16_t PFSRC5; + __IO uint16_t PCRC6; + __IO uint16_t PFSRC6; + __IO uint16_t PCRC7; + __IO uint16_t PFSRC7; + __IO uint16_t PCRC8; + __IO uint16_t PFSRC8; + __IO uint16_t PCRC9; + __IO uint16_t PFSRC9; + __IO uint16_t PCRC10; + __IO uint16_t PFSRC10; + __IO uint16_t PCRC11; + __IO uint16_t PFSRC11; + __IO uint16_t PCRC12; + __IO uint16_t PFSRC12; + __IO uint16_t PCRC13; + __IO uint16_t PFSRC13; + __IO uint16_t PCRC14; + __IO uint16_t PFSRC14; + __IO uint16_t PCRC15; + __IO uint16_t PFSRC15; + __IO uint16_t PCRD0; + __IO uint16_t PFSRD0; + __IO uint16_t PCRD1; + __IO uint16_t PFSRD1; + __IO uint16_t PCRD2; + __IO uint16_t PFSRD2; + __IO uint16_t PCRD3; + __IO uint16_t PFSRD3; + __IO uint16_t PCRD4; + __IO uint16_t PFSRD4; + __IO uint16_t PCRD5; + __IO uint16_t PFSRD5; + __IO uint16_t PCRD6; + __IO uint16_t PFSRD6; + __IO uint16_t PCRD7; + __IO uint16_t PFSRD7; + __IO uint16_t PCRD8; + __IO uint16_t PFSRD8; + __IO uint16_t PCRD9; + __IO uint16_t PFSRD9; + __IO uint16_t PCRD10; + __IO uint16_t PFSRD10; + __IO uint16_t PCRD11; + __IO uint16_t PFSRD11; + __IO uint16_t PCRD12; + __IO uint16_t PFSRD12; + __IO uint16_t PCRD13; + __IO uint16_t PFSRD13; + __IO uint16_t PCRD14; + __IO uint16_t PFSRD14; + __IO uint16_t PCRD15; + __IO uint16_t PFSRD15; + __IO uint16_t PCRE0; + __IO uint16_t PFSRE0; + __IO uint16_t PCRE1; + __IO uint16_t PFSRE1; + __IO uint16_t PCRE2; + __IO uint16_t PFSRE2; + __IO uint16_t PCRE3; + __IO uint16_t PFSRE3; + __IO uint16_t PCRE4; + __IO uint16_t PFSRE4; + __IO uint16_t PCRE5; + __IO uint16_t PFSRE5; + __IO uint16_t PCRE6; + __IO uint16_t PFSRE6; + __IO uint16_t PCRE7; + __IO uint16_t PFSRE7; + __IO uint16_t PCRE8; + __IO uint16_t PFSRE8; + __IO uint16_t PCRE9; + __IO uint16_t PFSRE9; + __IO uint16_t PCRE10; + __IO uint16_t PFSRE10; + __IO uint16_t PCRE11; + __IO uint16_t PFSRE11; + __IO uint16_t PCRE12; + __IO uint16_t PFSRE12; + __IO uint16_t PCRE13; + __IO uint16_t PFSRE13; + __IO uint16_t PCRE14; + __IO uint16_t PFSRE14; + __IO uint16_t PCRE15; + __IO uint16_t PFSRE15; + __IO uint16_t PCRF0; + __IO uint16_t PFSRF0; + __IO uint16_t PCRF1; + __IO uint16_t PFSRF1; + __IO uint16_t PCRF2; + __IO uint16_t PFSRF2; + __IO uint16_t PCRF3; + __IO uint16_t PFSRF3; + __IO uint16_t PCRF4; + __IO uint16_t PFSRF4; + __IO uint16_t PCRF5; + __IO uint16_t PFSRF5; + __IO uint16_t PCRF6; + __IO uint16_t PFSRF6; + __IO uint16_t PCRF7; + __IO uint16_t PFSRF7; + __IO uint16_t PCRF8; + __IO uint16_t PFSRF8; + __IO uint16_t PCRF9; + __IO uint16_t PFSRF9; + __IO uint16_t PCRF10; + __IO uint16_t PFSRF10; + __IO uint16_t PCRF11; + __IO uint16_t PFSRF11; + __IO uint16_t PCRF12; + __IO uint16_t PFSRF12; + __IO uint16_t PCRF13; + __IO uint16_t PFSRF13; + __IO uint16_t PCRF14; + __IO uint16_t PFSRF14; + __IO uint16_t PCRF15; + __IO uint16_t PFSRF15; + __IO uint16_t PCRG0; + __IO uint16_t PFSRG0; + __IO uint16_t PCRG1; + __IO uint16_t PFSRG1; + __IO uint16_t PCRG2; + __IO uint16_t PFSRG2; + __IO uint16_t PCRG3; + __IO uint16_t PFSRG3; + __IO uint16_t PCRG4; + __IO uint16_t PFSRG4; + __IO uint16_t PCRG5; + __IO uint16_t PFSRG5; + __IO uint16_t PCRG6; + __IO uint16_t PFSRG6; + __IO uint16_t PCRG7; + __IO uint16_t PFSRG7; + __IO uint16_t PCRG8; + __IO uint16_t PFSRG8; + __IO uint16_t PCRG9; + __IO uint16_t PFSRG9; + __IO uint16_t PCRG10; + __IO uint16_t PFSRG10; + __IO uint16_t PCRG11; + __IO uint16_t PFSRG11; + __IO uint16_t PCRG12; + __IO uint16_t PFSRG12; + __IO uint16_t PCRG13; + __IO uint16_t PFSRG13; + __IO uint16_t PCRG14; + __IO uint16_t PFSRG14; + __IO uint16_t PCRG15; + __IO uint16_t PFSRG15; + __IO uint16_t PCRH0; + __IO uint16_t PFSRH0; + __IO uint16_t PCRH1; + __IO uint16_t PFSRH1; + __IO uint16_t PCRH2; + __IO uint16_t PFSRH2; + __IO uint16_t PCRH3; + __IO uint16_t PFSRH3; + __IO uint16_t PCRH4; + __IO uint16_t PFSRH4; + __IO uint16_t PCRH5; + __IO uint16_t PFSRH5; + __IO uint16_t PCRH6; + __IO uint16_t PFSRH6; + __IO uint16_t PCRH7; + __IO uint16_t PFSRH7; + __IO uint16_t PCRH8; + __IO uint16_t PFSRH8; + __IO uint16_t PCRH9; + __IO uint16_t PFSRH9; + __IO uint16_t PCRH10; + __IO uint16_t PFSRH10; + __IO uint16_t PCRH11; + __IO uint16_t PFSRH11; + __IO uint16_t PCRH12; + __IO uint16_t PFSRH12; + __IO uint16_t PCRH13; + __IO uint16_t PFSRH13; + __IO uint16_t PCRH14; + __IO uint16_t PFSRH14; + __IO uint16_t PCRH15; + __IO uint16_t PFSRH15; + __IO uint16_t PCRI0; + __IO uint16_t PFSRI0; + __IO uint16_t PCRI1; + __IO uint16_t PFSRI1; + __IO uint16_t PCRI2; + __IO uint16_t PFSRI2; + __IO uint16_t PCRI3; + __IO uint16_t PFSRI3; + __IO uint16_t PCRI4; + __IO uint16_t PFSRI4; + __IO uint16_t PCRI5; + __IO uint16_t PFSRI5; + __IO uint16_t PCRI6; + __IO uint16_t PFSRI6; + __IO uint16_t PCRI7; + __IO uint16_t PFSRI7; + __IO uint16_t PCRI8; + __IO uint16_t PFSRI8; + __IO uint16_t PCRI9; + __IO uint16_t PFSRI9; + __IO uint16_t PCRI10; + __IO uint16_t PFSRI10; + __IO uint16_t PCRI11; + __IO uint16_t PFSRI11; + __IO uint16_t PCRI12; + __IO uint16_t PFSRI12; + __IO uint16_t PCRI13; + __IO uint16_t PFSRI13; +} M4_GPIO_TypeDef; + +/** + * @brief HASH + */ +typedef struct +{ + __IO uint32_t CR; + uint8_t RESERVED0[12]; + __IO uint32_t HR7; + __IO uint32_t HR6; + __IO uint32_t HR5; + __IO uint32_t HR4; + __IO uint32_t HR3; + __IO uint32_t HR2; + __IO uint32_t HR1; + __IO uint32_t HR0; + uint8_t RESERVED1[16]; + __IO uint32_t DR15; + __IO uint32_t DR14; + __IO uint32_t DR13; + __IO uint32_t DR12; + __IO uint32_t DR11; + __IO uint32_t DR10; + __IO uint32_t DR9; + __IO uint32_t DR8; + __IO uint32_t DR7; + __IO uint32_t DR6; + __IO uint32_t DR5; + __IO uint32_t DR4; + __IO uint32_t DR3; + __IO uint32_t DR2; + __IO uint32_t DR1; + __IO uint32_t DR0; +} M4_HASH_TypeDef; + +/** + * @brief HRPWM + */ +typedef struct +{ + __IO uint32_t CR1; + __IO uint32_t CR2; + __IO uint32_t CR3; + __IO uint32_t CR4; + __IO uint32_t CR5; + __IO uint32_t CR6; + __IO uint32_t CR7; + __IO uint32_t CR8; + __IO uint32_t CR9; + __IO uint32_t CR10; + __IO uint32_t CR11; + __IO uint32_t CR12; + __IO uint32_t CR13; + __IO uint32_t CR14; + __IO uint32_t CR15; + __IO uint32_t CR16; + uint8_t RESERVED0[16]; + __IO uint32_t CALCR0; + __IO uint32_t CALCR1; +} M4_HRPWM_TypeDef; + +/** + * @brief I2C + */ +typedef struct +{ + __IO uint32_t CR1; + __IO uint32_t CR2; + __IO uint32_t CR3; + uint8_t RESERVED0[4]; + __IO uint32_t SLR0; + __IO uint32_t SLR1; + __IO uint32_t SLTR; + __IO uint32_t SR; + __IO uint32_t CLR; + __IO uint8_t DTR; + uint8_t RESERVED1[3]; + __IO uint8_t DRR; + uint8_t RESERVED2[3]; + __IO uint32_t CCR; + __IO uint32_t FLTR; +} M4_I2C_TypeDef; + +/** + * @brief I2S + */ +typedef struct +{ + __IO uint32_t CTRL; + __IO uint32_t SR; + __IO uint32_t ER; + __IO uint32_t CFGR; + __IO uint32_t TXBUF; + __IO uint32_t RXBUF; + __IO uint32_t PR; +} M4_I2S_TypeDef; + +/** + * @brief ICG + */ +typedef struct +{ + __IO uint32_t ICG0; + __IO uint32_t ICG1; + __IO uint32_t ICG2; + __IO uint32_t ICG3; +} M4_ICG_TypeDef; + +/** + * @brief INTC + */ +typedef struct +{ + __IO uint32_t NOCCR; + __IO uint32_t NMIENR; + __IO uint32_t NMIFR; + __IO uint32_t NMICFR; + __IO uint32_t EIRQCR0; + __IO uint32_t EIRQCR1; + __IO uint32_t EIRQCR2; + __IO uint32_t EIRQCR3; + __IO uint32_t EIRQCR4; + __IO uint32_t EIRQCR5; + __IO uint32_t EIRQCR6; + __IO uint32_t EIRQCR7; + __IO uint32_t EIRQCR8; + __IO uint32_t EIRQCR9; + __IO uint32_t EIRQCR10; + __IO uint32_t EIRQCR11; + __IO uint32_t EIRQCR12; + __IO uint32_t EIRQCR13; + __IO uint32_t EIRQCR14; + __IO uint32_t EIRQCR15; + __IO uint32_t WUPEN; + __IO uint32_t EIFR; + __IO uint32_t EICFR; + __IO uint32_t SEL0; + __IO uint32_t SEL1; + __IO uint32_t SEL2; + __IO uint32_t SEL3; + __IO uint32_t SEL4; + __IO uint32_t SEL5; + __IO uint32_t SEL6; + __IO uint32_t SEL7; + __IO uint32_t SEL8; + __IO uint32_t SEL9; + __IO uint32_t SEL10; + __IO uint32_t SEL11; + __IO uint32_t SEL12; + __IO uint32_t SEL13; + __IO uint32_t SEL14; + __IO uint32_t SEL15; + __IO uint32_t SEL16; + __IO uint32_t SEL17; + __IO uint32_t SEL18; + __IO uint32_t SEL19; + __IO uint32_t SEL20; + __IO uint32_t SEL21; + __IO uint32_t SEL22; + __IO uint32_t SEL23; + __IO uint32_t SEL24; + __IO uint32_t SEL25; + __IO uint32_t SEL26; + __IO uint32_t SEL27; + __IO uint32_t SEL28; + __IO uint32_t SEL29; + __IO uint32_t SEL30; + __IO uint32_t SEL31; + __IO uint32_t SEL32; + __IO uint32_t SEL33; + __IO uint32_t SEL34; + __IO uint32_t SEL35; + __IO uint32_t SEL36; + __IO uint32_t SEL37; + __IO uint32_t SEL38; + __IO uint32_t SEL39; + __IO uint32_t SEL40; + __IO uint32_t SEL41; + __IO uint32_t SEL42; + __IO uint32_t SEL43; + __IO uint32_t SEL44; + __IO uint32_t SEL45; + __IO uint32_t SEL46; + __IO uint32_t SEL47; + __IO uint32_t SEL48; + __IO uint32_t SEL49; + __IO uint32_t SEL50; + __IO uint32_t SEL51; + __IO uint32_t SEL52; + __IO uint32_t SEL53; + __IO uint32_t SEL54; + __IO uint32_t SEL55; + __IO uint32_t SEL56; + __IO uint32_t SEL57; + __IO uint32_t SEL58; + __IO uint32_t SEL59; + __IO uint32_t SEL60; + __IO uint32_t SEL61; + __IO uint32_t SEL62; + __IO uint32_t SEL63; + __IO uint32_t SEL64; + __IO uint32_t SEL65; + __IO uint32_t SEL66; + __IO uint32_t SEL67; + __IO uint32_t SEL68; + __IO uint32_t SEL69; + __IO uint32_t SEL70; + __IO uint32_t SEL71; + __IO uint32_t SEL72; + __IO uint32_t SEL73; + __IO uint32_t SEL74; + __IO uint32_t SEL75; + __IO uint32_t SEL76; + __IO uint32_t SEL77; + __IO uint32_t SEL78; + __IO uint32_t SEL79; + __IO uint32_t SEL80; + __IO uint32_t SEL81; + __IO uint32_t SEL82; + __IO uint32_t SEL83; + __IO uint32_t SEL84; + __IO uint32_t SEL85; + __IO uint32_t SEL86; + __IO uint32_t SEL87; + __IO uint32_t SEL88; + __IO uint32_t SEL89; + __IO uint32_t SEL90; + __IO uint32_t SEL91; + __IO uint32_t SEL92; + __IO uint32_t SEL93; + __IO uint32_t SEL94; + __IO uint32_t SEL95; + __IO uint32_t SEL96; + __IO uint32_t SEL97; + __IO uint32_t SEL98; + __IO uint32_t SEL99; + __IO uint32_t SEL100; + __IO uint32_t SEL101; + __IO uint32_t SEL102; + __IO uint32_t SEL103; + __IO uint32_t SEL104; + __IO uint32_t SEL105; + __IO uint32_t SEL106; + __IO uint32_t SEL107; + __IO uint32_t SEL108; + __IO uint32_t SEL109; + __IO uint32_t SEL110; + __IO uint32_t SEL111; + __IO uint32_t SEL112; + __IO uint32_t SEL113; + __IO uint32_t SEL114; + __IO uint32_t SEL115; + __IO uint32_t SEL116; + __IO uint32_t SEL117; + __IO uint32_t SEL118; + __IO uint32_t SEL119; + __IO uint32_t SEL120; + __IO uint32_t SEL121; + __IO uint32_t SEL122; + __IO uint32_t SEL123; + __IO uint32_t SEL124; + __IO uint32_t SEL125; + __IO uint32_t SEL126; + __IO uint32_t SEL127; + __IO uint32_t VSSEL128; + __IO uint32_t VSSEL129; + __IO uint32_t VSSEL130; + __IO uint32_t VSSEL131; + __IO uint32_t VSSEL132; + __IO uint32_t VSSEL133; + __IO uint32_t VSSEL134; + __IO uint32_t VSSEL135; + __IO uint32_t VSSEL136; + __IO uint32_t VSSEL137; + __IO uint32_t VSSEL138; + __IO uint32_t VSSEL139; + __IO uint32_t VSSEL140; + __IO uint32_t VSSEL141; + __IO uint32_t VSSEL142; + __IO uint32_t VSSEL143; + __IO uint32_t SWIER; + __IO uint32_t EVTER; + __IO uint32_t IER; +} M4_INTC_TypeDef; + +/** + * @brief KEYSCAN + */ +typedef struct +{ + __IO uint32_t SCR; + __IO uint32_t SER; + __IO uint32_t SSR; +} M4_KEYSCAN_TypeDef; + +/** + * @brief MAU + */ +typedef struct +{ + __IO uint32_t CSR; + __IO uint32_t DTR0; + uint8_t RESERVED0[4]; + __IO uint32_t RTR0; + __IO uint32_t DTR1; + __IO uint32_t RTR1; +} M4_MAU_TypeDef; + +/** + * @brief MPU + */ +typedef struct +{ + __IO uint32_t RGD0; + __IO uint32_t RGD1; + __IO uint32_t RGD2; + __IO uint32_t RGD3; + __IO uint32_t RGD4; + __IO uint32_t RGD5; + __IO uint32_t RGD6; + __IO uint32_t RGD7; + __IO uint32_t RGD8; + __IO uint32_t RGD9; + __IO uint32_t RGD10; + __IO uint32_t RGD11; + __IO uint32_t RGD12; + __IO uint32_t RGD13; + __IO uint32_t RGD14; + __IO uint32_t RGD15; + __IO uint32_t SR; + __IO uint32_t ECLR; + __IO uint32_t WP; + __IO uint32_t IPPR; + __IO uint32_t S1RGE; + __IO uint32_t S1RGWP; + __IO uint32_t S1RGRP; + __IO uint32_t S1CR; + __IO uint32_t S2RGE; + __IO uint32_t S2RGWP; + __IO uint32_t S2RGRP; + __IO uint32_t S2CR; + __IO uint32_t FRGE; + __IO uint32_t FRGWP; + __IO uint32_t FRGRP; + __IO uint32_t FCR; + __IO uint32_t HRGE; + __IO uint32_t HRGWP; + __IO uint32_t HRGRP; + __IO uint32_t HCR; + __IO uint32_t ERGE; + __IO uint32_t ERGWP; + __IO uint32_t ERGRP; + __IO uint32_t ECR; +} M4_MPU_TypeDef; + +/** + * @brief NFC + */ +typedef struct +{ + __IO uint32_t DATR_BASE; + uint8_t RESERVED0[32764]; + __IO uint32_t CMDR; + __IO uint32_t IDXR0; + uint8_t RESERVED1[40]; + __IO uint32_t IENR; + __IO uint32_t ISTR; + __IO uint32_t IRSR; + uint8_t RESERVED2[12]; + __IO uint32_t IDXR1; + __IO uint32_t TMCR0; + __IO uint32_t TMCR1; + __IO uint32_t BACR; + uint8_t RESERVED3[4]; + __IO uint32_t TMCR2; + __IO uint32_t ECCR0; + __IO uint32_t ECCR1; + __IO uint32_t ECCR2; + __IO uint32_t ECCR3; + __IO uint32_t ECCR4; + __IO uint32_t ECCR5; + __IO uint32_t ECCR6; + __IO uint32_t ECC_STAT; + __IO uint32_t ECC_SYND0_0; + __IO uint32_t ECC_SYND0_1; + __IO uint32_t ECC_SYND0_2; + __IO uint32_t ECC_SYND0_3; + __IO uint32_t ECC_SYND1_0; + __IO uint32_t ECC_SYND1_1; + __IO uint32_t ECC_SYND1_2; + __IO uint32_t ECC_SYND1_3; + __IO uint32_t ECC_SYND2_0; + __IO uint32_t ECC_SYND2_1; + __IO uint32_t ECC_SYND2_2; + __IO uint32_t ECC_SYND2_3; + __IO uint32_t ECC_SYND3_0; + __IO uint32_t ECC_SYND3_1; + __IO uint32_t ECC_SYND3_2; + __IO uint32_t ECC_SYND3_3; + __IO uint32_t ECC_SYND4_0; + __IO uint32_t ECC_SYND4_1; + __IO uint32_t ECC_SYND4_2; + __IO uint32_t ECC_SYND4_3; + __IO uint32_t ECC_SYND5_0; + __IO uint32_t ECC_SYND5_1; + __IO uint32_t ECC_SYND5_2; + __IO uint32_t ECC_SYND5_3; + __IO uint32_t ECC_SYND6_0; + __IO uint32_t ECC_SYND6_1; + __IO uint32_t ECC_SYND6_2; + __IO uint32_t ECC_SYND6_3; + __IO uint32_t ECC_SYND7_0; + __IO uint32_t ECC_SYND7_1; + __IO uint32_t ECC_SYND7_2; + __IO uint32_t ECC_SYND7_3; + __IO uint32_t ECC_SYND8_0; + __IO uint32_t ECC_SYND8_1; + __IO uint32_t ECC_SYND8_2; + __IO uint32_t ECC_SYND8_3; + __IO uint32_t ECC_SYND9_0; + __IO uint32_t ECC_SYND9_1; + __IO uint32_t ECC_SYND9_2; + __IO uint32_t ECC_SYND9_3; + __IO uint32_t ECC_SYND10_0; + __IO uint32_t ECC_SYND10_1; + __IO uint32_t ECC_SYND10_2; + __IO uint32_t ECC_SYND10_3; + __IO uint32_t ECC_SYND11_0; + __IO uint32_t ECC_SYND11_1; + __IO uint32_t ECC_SYND11_2; + __IO uint32_t ECC_SYND11_3; + __IO uint32_t ECC_SYND12_0; + __IO uint32_t ECC_SYND12_1; + __IO uint32_t ECC_SYND12_2; + __IO uint32_t ECC_SYND12_3; + __IO uint32_t ECC_SYND13_0; + __IO uint32_t ECC_SYND13_1; + __IO uint32_t ECC_SYND13_2; + __IO uint32_t ECC_SYND13_3; + __IO uint32_t ECC_SYND14_0; + __IO uint32_t ECC_SYND14_1; + __IO uint32_t ECC_SYND14_2; + __IO uint32_t ECC_SYND14_3; + __IO uint32_t ECC_SYND15_0; + __IO uint32_t ECC_SYND15_1; + __IO uint32_t ECC_SYND15_2; + __IO uint32_t ECC_SYND15_3; +} M4_NFC_TypeDef; + +/** + * @brief OTS + */ +typedef struct +{ + __IO uint16_t CTL; + __IO uint16_t DR1; + __IO uint16_t DR2; + __IO uint16_t ECR; + __IO uint32_t LPR; +} M4_OTS_TypeDef; + +/** + * @brief PERIC + */ +typedef struct +{ + __IO uint32_t USB_SYCTLREG; + __IO uint32_t SDIOC_SYCTLREG; + __IO uint32_t NFC_SYCTLREG; + __IO uint32_t EXMC_ENAR; + uint8_t RESERVED0[8]; + __IO uint32_t CAN_SYCTLREG; + __IO uint32_t USART1_NFC; + uint8_t RESERVED1[8]; + __IO uint32_t NFC_SYSTATREG; +} M4_PERIC_TypeDef; + +/** + * @brief PWC + */ +typedef struct +{ + __IO uint32_t FCG0; + __IO uint32_t FCG1; + __IO uint32_t FCG2; + __IO uint32_t FCG3; + __IO uint32_t FCG0PC; + uint8_t RESERVED0[17436]; + __IO uint8_t VBATRSTR; + uint8_t RESERVED1[15]; + __IO uint8_t VBATCR; + uint8_t RESERVED2[15]; + __IO uint8_t WKTC0; + uint8_t RESERVED3[3]; + __IO uint8_t WKTC1; + uint8_t RESERVED4[3]; + __IO uint8_t WKTC2; + uint8_t RESERVED5[423]; + __IO uint8_t BKR0; + uint8_t RESERVED6[3]; + __IO uint8_t BKR1; + uint8_t RESERVED7[3]; + __IO uint8_t BKR2; + uint8_t RESERVED8[3]; + __IO uint8_t BKR3; + uint8_t RESERVED9[3]; + __IO uint8_t BKR4; + uint8_t RESERVED10[3]; + __IO uint8_t BKR5; + uint8_t RESERVED11[3]; + __IO uint8_t BKR6; + uint8_t RESERVED12[3]; + __IO uint8_t BKR7; + uint8_t RESERVED13[3]; + __IO uint8_t BKR8; + uint8_t RESERVED14[3]; + __IO uint8_t BKR9; + uint8_t RESERVED15[3]; + __IO uint8_t BKR10; + uint8_t RESERVED16[3]; + __IO uint8_t BKR11; + uint8_t RESERVED17[3]; + __IO uint8_t BKR12; + uint8_t RESERVED18[3]; + __IO uint8_t BKR13; + uint8_t RESERVED19[3]; + __IO uint8_t BKR14; + uint8_t RESERVED20[3]; + __IO uint8_t BKR15; + uint8_t RESERVED21[3]; + __IO uint8_t BKR16; + uint8_t RESERVED22[3]; + __IO uint8_t BKR17; + uint8_t RESERVED23[3]; + __IO uint8_t BKR18; + uint8_t RESERVED24[3]; + __IO uint8_t BKR19; + uint8_t RESERVED25[3]; + __IO uint8_t BKR20; + uint8_t RESERVED26[3]; + __IO uint8_t BKR21; + uint8_t RESERVED27[3]; + __IO uint8_t BKR22; + uint8_t RESERVED28[3]; + __IO uint8_t BKR23; + uint8_t RESERVED29[3]; + __IO uint8_t BKR24; + uint8_t RESERVED30[3]; + __IO uint8_t BKR25; + uint8_t RESERVED31[3]; + __IO uint8_t BKR26; + uint8_t RESERVED32[3]; + __IO uint8_t BKR27; + uint8_t RESERVED33[3]; + __IO uint8_t BKR28; + uint8_t RESERVED34[3]; + __IO uint8_t BKR29; + uint8_t RESERVED35[3]; + __IO uint8_t BKR30; + uint8_t RESERVED36[3]; + __IO uint8_t BKR31; + uint8_t RESERVED37[3]; + __IO uint8_t BKR32; + uint8_t RESERVED38[3]; + __IO uint8_t BKR33; + uint8_t RESERVED39[3]; + __IO uint8_t BKR34; + uint8_t RESERVED40[3]; + __IO uint8_t BKR35; + uint8_t RESERVED41[3]; + __IO uint8_t BKR36; + uint8_t RESERVED42[3]; + __IO uint8_t BKR37; + uint8_t RESERVED43[3]; + __IO uint8_t BKR38; + uint8_t RESERVED44[3]; + __IO uint8_t BKR39; + uint8_t RESERVED45[3]; + __IO uint8_t BKR40; + uint8_t RESERVED46[3]; + __IO uint8_t BKR41; + uint8_t RESERVED47[3]; + __IO uint8_t BKR42; + uint8_t RESERVED48[3]; + __IO uint8_t BKR43; + uint8_t RESERVED49[3]; + __IO uint8_t BKR44; + uint8_t RESERVED50[3]; + __IO uint8_t BKR45; + uint8_t RESERVED51[3]; + __IO uint8_t BKR46; + uint8_t RESERVED52[3]; + __IO uint8_t BKR47; + uint8_t RESERVED53[3]; + __IO uint8_t BKR48; + uint8_t RESERVED54[3]; + __IO uint8_t BKR49; + uint8_t RESERVED55[3]; + __IO uint8_t BKR50; + uint8_t RESERVED56[3]; + __IO uint8_t BKR51; + uint8_t RESERVED57[3]; + __IO uint8_t BKR52; + uint8_t RESERVED58[3]; + __IO uint8_t BKR53; + uint8_t RESERVED59[3]; + __IO uint8_t BKR54; + uint8_t RESERVED60[3]; + __IO uint8_t BKR55; + uint8_t RESERVED61[3]; + __IO uint8_t BKR56; + uint8_t RESERVED62[3]; + __IO uint8_t BKR57; + uint8_t RESERVED63[3]; + __IO uint8_t BKR58; + uint8_t RESERVED64[3]; + __IO uint8_t BKR59; + uint8_t RESERVED65[3]; + __IO uint8_t BKR60; + uint8_t RESERVED66[3]; + __IO uint8_t BKR61; + uint8_t RESERVED67[3]; + __IO uint8_t BKR62; + uint8_t RESERVED68[3]; + __IO uint8_t BKR63; + uint8_t RESERVED69[3]; + __IO uint8_t BKR64; + uint8_t RESERVED70[3]; + __IO uint8_t BKR65; + uint8_t RESERVED71[3]; + __IO uint8_t BKR66; + uint8_t RESERVED72[3]; + __IO uint8_t BKR67; + uint8_t RESERVED73[3]; + __IO uint8_t BKR68; + uint8_t RESERVED74[3]; + __IO uint8_t BKR69; + uint8_t RESERVED75[3]; + __IO uint8_t BKR70; + uint8_t RESERVED76[3]; + __IO uint8_t BKR71; + uint8_t RESERVED77[3]; + __IO uint8_t BKR72; + uint8_t RESERVED78[3]; + __IO uint8_t BKR73; + uint8_t RESERVED79[3]; + __IO uint8_t BKR74; + uint8_t RESERVED80[3]; + __IO uint8_t BKR75; + uint8_t RESERVED81[3]; + __IO uint8_t BKR76; + uint8_t RESERVED82[3]; + __IO uint8_t BKR77; + uint8_t RESERVED83[3]; + __IO uint8_t BKR78; + uint8_t RESERVED84[3]; + __IO uint8_t BKR79; + uint8_t RESERVED85[3]; + __IO uint8_t BKR80; + uint8_t RESERVED86[3]; + __IO uint8_t BKR81; + uint8_t RESERVED87[3]; + __IO uint8_t BKR82; + uint8_t RESERVED88[3]; + __IO uint8_t BKR83; + uint8_t RESERVED89[3]; + __IO uint8_t BKR84; + uint8_t RESERVED90[3]; + __IO uint8_t BKR85; + uint8_t RESERVED91[3]; + __IO uint8_t BKR86; + uint8_t RESERVED92[3]; + __IO uint8_t BKR87; + uint8_t RESERVED93[3]; + __IO uint8_t BKR88; + uint8_t RESERVED94[3]; + __IO uint8_t BKR89; + uint8_t RESERVED95[3]; + __IO uint8_t BKR90; + uint8_t RESERVED96[3]; + __IO uint8_t BKR91; + uint8_t RESERVED97[3]; + __IO uint8_t BKR92; + uint8_t RESERVED98[3]; + __IO uint8_t BKR93; + uint8_t RESERVED99[3]; + __IO uint8_t BKR94; + uint8_t RESERVED100[3]; + __IO uint8_t BKR95; + uint8_t RESERVED101[3]; + __IO uint8_t BKR96; + uint8_t RESERVED102[3]; + __IO uint8_t BKR97; + uint8_t RESERVED103[3]; + __IO uint8_t BKR98; + uint8_t RESERVED104[3]; + __IO uint8_t BKR99; + uint8_t RESERVED105[3]; + __IO uint8_t BKR100; + uint8_t RESERVED106[3]; + __IO uint8_t BKR101; + uint8_t RESERVED107[3]; + __IO uint8_t BKR102; + uint8_t RESERVED108[3]; + __IO uint8_t BKR103; + uint8_t RESERVED109[3]; + __IO uint8_t BKR104; + uint8_t RESERVED110[3]; + __IO uint8_t BKR105; + uint8_t RESERVED111[3]; + __IO uint8_t BKR106; + uint8_t RESERVED112[3]; + __IO uint8_t BKR107; + uint8_t RESERVED113[3]; + __IO uint8_t BKR108; + uint8_t RESERVED114[3]; + __IO uint8_t BKR109; + uint8_t RESERVED115[3]; + __IO uint8_t BKR110; + uint8_t RESERVED116[3]; + __IO uint8_t BKR111; + uint8_t RESERVED117[3]; + __IO uint8_t BKR112; + uint8_t RESERVED118[3]; + __IO uint8_t BKR113; + uint8_t RESERVED119[3]; + __IO uint8_t BKR114; + uint8_t RESERVED120[3]; + __IO uint8_t BKR115; + uint8_t RESERVED121[3]; + __IO uint8_t BKR116; + uint8_t RESERVED122[3]; + __IO uint8_t BKR117; + uint8_t RESERVED123[3]; + __IO uint8_t BKR118; + uint8_t RESERVED124[3]; + __IO uint8_t BKR119; + uint8_t RESERVED125[3]; + __IO uint8_t BKR120; + uint8_t RESERVED126[3]; + __IO uint8_t BKR121; + uint8_t RESERVED127[3]; + __IO uint8_t BKR122; + uint8_t RESERVED128[3]; + __IO uint8_t BKR123; + uint8_t RESERVED129[3]; + __IO uint8_t BKR124; + uint8_t RESERVED130[3]; + __IO uint8_t BKR125; + uint8_t RESERVED131[3]; + __IO uint8_t BKR126; + uint8_t RESERVED132[3]; + __IO uint8_t BKR127; + uint8_t RESERVED133[1027]; + __IO uint8_t PWRC0; + uint8_t RESERVED134[3]; + __IO uint8_t PWRC1; + uint8_t RESERVED135[3]; + __IO uint8_t PWRC2; + uint8_t RESERVED136[3]; + __IO uint8_t PWRC3; + uint8_t RESERVED137[3]; + __IO uint8_t PWRC4; + uint8_t RESERVED138[3]; + __IO uint8_t PVDCR0; + uint8_t RESERVED139[3]; + __IO uint8_t PVDCR1; + uint8_t RESERVED140[3]; + __IO uint8_t PVDFCR; + uint8_t RESERVED141[3]; + __IO uint8_t PVDLCR; + uint8_t RESERVED142[7]; + __IO uint8_t PDWKE0; + uint8_t RESERVED143[3]; + __IO uint8_t PDWKE1; + uint8_t RESERVED144[3]; + __IO uint8_t PDWKE2; + uint8_t RESERVED145[3]; + __IO uint8_t PDWKES; + uint8_t RESERVED146[3]; + __IO uint8_t PDWKF0; + uint8_t RESERVED147[3]; + __IO uint8_t PDWKF1; + uint8_t RESERVED148[163]; + __IO uint32_t RAMPC0; + __IO uint32_t RAMOPM; + __IO uint32_t PRAMLPC; + uint8_t RESERVED149[4]; + __IO uint8_t PVDICR; + uint8_t RESERVED150[3]; + __IO uint8_t PVDDSR; + uint8_t RESERVED151[29463]; + __IO uint16_t STPMCR; + uint8_t RESERVED152[1008]; + __IO uint16_t FPRC; +} M4_PWC_TypeDef; + +/** + * @brief QSPI + */ +typedef struct +{ + __IO uint32_t CR; + __IO uint32_t CSCR; + __IO uint32_t FCR; + __IO uint32_t SR; + __IO uint32_t DCOM; + __IO uint32_t CCMD; + __IO uint32_t XCMD; + uint8_t RESERVED0[8]; + __IO uint32_t SR2; + uint8_t RESERVED1[2012]; + __IO uint32_t EXAR; +} M4_QSPI_TypeDef; + +/** + * @brief RMU + */ +typedef struct +{ + uint8_t RESERVED0[248]; + __IO uint8_t PRSTCR0; + uint8_t RESERVED1[3]; + __IO uint32_t RSTF0; +} M4_RMU_TypeDef; + +/** + * @brief RTC + */ +typedef struct +{ + __IO uint8_t CR0; + uint8_t RESERVED0[3]; + __IO uint8_t CR1; + uint8_t RESERVED1[3]; + __IO uint8_t CR2; + uint8_t RESERVED2[3]; + __IO uint8_t CR3; + uint8_t RESERVED3[3]; + __IO uint8_t SEC; + uint8_t RESERVED4[3]; + __IO uint8_t MIN; + uint8_t RESERVED5[3]; + __IO uint8_t HOUR; + uint8_t RESERVED6[3]; + __IO uint8_t WEEK; + uint8_t RESERVED7[3]; + __IO uint8_t DAY; + uint8_t RESERVED8[3]; + __IO uint8_t MON; + uint8_t RESERVED9[3]; + __IO uint8_t YEAR; + uint8_t RESERVED10[3]; + __IO uint8_t ALMMIN; + uint8_t RESERVED11[3]; + __IO uint8_t ALMHOUR; + uint8_t RESERVED12[3]; + __IO uint8_t ALMWEEK; + uint8_t RESERVED13[3]; + __IO uint8_t ERRCRH; + uint8_t RESERVED14[3]; + __IO uint8_t ERRCRL; + uint8_t RESERVED15[3]; + __IO uint8_t TPCR0; + uint8_t RESERVED16[3]; + __IO uint8_t TPCR1; + uint8_t RESERVED17[3]; + __IO uint8_t TPSR; + uint8_t RESERVED18[3]; + __IO uint8_t SECTP; + uint8_t RESERVED19[3]; + __IO uint8_t MINTP; + uint8_t RESERVED20[3]; + __IO uint8_t HOURTP; + uint8_t RESERVED21[3]; + __IO uint8_t DAYTP; + uint8_t RESERVED22[3]; + __IO uint8_t MONTP; +} M4_RTC_TypeDef; + +/** + * @brief SDIOC + */ +typedef struct +{ + uint8_t RESERVED0[4]; + __IO uint16_t BLKSIZE; + __IO uint16_t BLKCNT; + __IO uint16_t ARG0; + __IO uint16_t ARG1; + __IO uint16_t TRANSMODE; + __IO uint16_t CMD; + __IO uint16_t RESP0; + __IO uint16_t RESP1; + __IO uint16_t RESP2; + __IO uint16_t RESP3; + __IO uint16_t RESP4; + __IO uint16_t RESP5; + __IO uint16_t RESP6; + __IO uint16_t RESP7; + __IO uint16_t BUF0; + __IO uint16_t BUF1; + __IO uint32_t PSTAT; + __IO uint8_t HOSTCON; + __IO uint8_t PWRCON; + __IO uint8_t BLKGPCON; + uint8_t RESERVED1[1]; + __IO uint16_t CLKCON; + __IO uint8_t TOUTCON; + __IO uint8_t SFTRST; + __IO uint16_t NORINTST; + __IO uint16_t ERRINTST; + __IO uint16_t NORINTSTEN; + __IO uint16_t ERRINTSTEN; + __IO uint16_t NORINTSGEN; + __IO uint16_t ERRINTSGEN; + __IO uint16_t ATCERRST; + uint8_t RESERVED2[18]; + __IO uint16_t FEA; + __IO uint16_t FEE; +} M4_SDIOC_TypeDef; + +/** + * @brief SMC + */ +typedef struct +{ + __IO uint32_t STSR; + uint8_t RESERVED0[4]; + __IO uint32_t STCR0; + __IO uint32_t STCR1; + __IO uint32_t CMDR; + __IO uint32_t TMCR; + __IO uint32_t CPCR; + uint8_t RESERVED1[4]; + __IO uint32_t RFTR; + uint8_t RESERVED2[220]; + __IO uint32_t TMSR0; + __IO uint32_t CPSR0; + uint8_t RESERVED3[24]; + __IO uint32_t TMSR1; + __IO uint32_t CPSR1; + uint8_t RESERVED4[24]; + __IO uint32_t TMSR2; + __IO uint32_t CPSR2; + uint8_t RESERVED5[24]; + __IO uint32_t TMSR3; + __IO uint32_t CPSR3; + uint8_t RESERVED6[152]; + __IO uint32_t BACR; + uint8_t RESERVED7[4]; + __IO uint32_t CSCR0; + __IO uint32_t CSCR1; +} M4_SMC_TypeDef; + +/** + * @brief SPI + */ +typedef struct +{ + __IO uint32_t DR; + __IO uint32_t CR1; + uint8_t RESERVED0[4]; + __IO uint32_t CFG1; + uint8_t RESERVED1[4]; + __IO uint32_t SR; + __IO uint32_t CFG2; +} M4_SPI_TypeDef; + +/** + * @brief SRAMC + */ +typedef struct +{ + __IO uint32_t WTCR; + __IO uint32_t WTPR; + __IO uint32_t CKCR; + __IO uint32_t CKPR; + __IO uint32_t CKSR; +} M4_SRAMC_TypeDef; + +/** + * @brief SWDT + */ +typedef struct +{ + __IO uint32_t CR; + __IO uint32_t SR; + __IO uint32_t RR; +} M4_SWDT_TypeDef; + +/** + * @brief TMR0 + */ +typedef struct +{ + __IO uint32_t CNTAR; + __IO uint32_t CNTBR; + __IO uint32_t CMPAR; + __IO uint32_t CMPBR; + __IO uint32_t BCONR; + __IO uint32_t STFLR; +} M4_TMR0_TypeDef; + +/** + * @brief TMR2 + */ +typedef struct +{ + __IO uint32_t CNTAR; + __IO uint32_t CNTBR; + __IO uint32_t CMPAR; + __IO uint32_t CMPBR; + __IO uint32_t BCONR; + __IO uint32_t ICONR; + __IO uint32_t PCONR; + __IO uint32_t HCONR; + __IO uint32_t STFLR; +} M4_TMR2_TypeDef; + +/** + * @brief TMR4 + */ +typedef struct +{ + uint8_t RESERVED0[2]; + __IO uint16_t OCCRUH; + uint8_t RESERVED1[2]; + __IO uint16_t OCCRUL; + uint8_t RESERVED2[2]; + __IO uint16_t OCCRVH; + uint8_t RESERVED3[2]; + __IO uint16_t OCCRVL; + uint8_t RESERVED4[2]; + __IO uint16_t OCCRWH; + uint8_t RESERVED5[2]; + __IO uint16_t OCCRWL; + __IO uint16_t OCSRU; + __IO uint16_t OCERU; + __IO uint16_t OCSRV; + __IO uint16_t OCERV; + __IO uint16_t OCSRW; + __IO uint16_t OCERW; + __IO uint16_t OCMRHUH; + uint8_t RESERVED6[2]; + __IO uint32_t OCMRLUL; + __IO uint16_t OCMRHVH; + uint8_t RESERVED7[2]; + __IO uint32_t OCMRLVL; + __IO uint16_t OCMRHWH; + uint8_t RESERVED8[2]; + __IO uint32_t OCMRLWL; + uint8_t RESERVED9[6]; + __IO uint16_t CPSR; + uint8_t RESERVED10[2]; + __IO uint16_t CNTR; + __IO uint16_t CCSR; + __IO uint16_t CVPR; + uint8_t RESERVED11[54]; + __IO uint16_t PFSRU; + __IO uint16_t PDARU; + __IO uint16_t PDBRU; + uint8_t RESERVED12[2]; + __IO uint16_t PFSRV; + __IO uint16_t PDARV; + __IO uint16_t PDBRV; + uint8_t RESERVED13[2]; + __IO uint16_t PFSRW; + __IO uint16_t PDARW; + __IO uint16_t PDBRW; + __IO uint16_t POCRU; + uint8_t RESERVED14[2]; + __IO uint16_t POCRV; + uint8_t RESERVED15[2]; + __IO uint16_t POCRW; + uint8_t RESERVED16[2]; + __IO uint16_t RCSR; + uint8_t RESERVED17[12]; + __IO uint16_t SCCRUH; + uint8_t RESERVED18[2]; + __IO uint16_t SCCRUL; + uint8_t RESERVED19[2]; + __IO uint16_t SCCRVH; + uint8_t RESERVED20[2]; + __IO uint16_t SCCRVL; + uint8_t RESERVED21[2]; + __IO uint16_t SCCRWH; + uint8_t RESERVED22[2]; + __IO uint16_t SCCRWL; + __IO uint16_t SCSRUH; + __IO uint16_t SCMRUH; + __IO uint16_t SCSRUL; + __IO uint16_t SCMRUL; + __IO uint16_t SCSRVH; + __IO uint16_t SCMRVH; + __IO uint16_t SCSRVL; + __IO uint16_t SCMRVL; + __IO uint16_t SCSRWH; + __IO uint16_t SCMRWH; + __IO uint16_t SCSRWL; + __IO uint16_t SCMRWL; + __IO uint32_t PSCR; + __IO uint16_t SCER; +} M4_TMR4_TypeDef; + +/** + * @brief TMR6 + */ +typedef struct +{ + __IO uint32_t CNTER; + __IO uint32_t UPDAR; + uint8_t RESERVED0[56]; + __IO uint32_t PERAR; + __IO uint32_t PERBR; + __IO uint32_t PERCR; + uint8_t RESERVED1[52]; + __IO uint32_t GCMAR; + __IO uint32_t GCMBR; + __IO uint32_t GCMCR; + __IO uint32_t GCMDR; + __IO uint32_t GCMER; + __IO uint32_t GCMFR; + uint8_t RESERVED2[40]; + __IO uint32_t SCMAR; + __IO uint32_t SCMBR; + __IO uint32_t SCMCR; + __IO uint32_t SCMDR; + __IO uint32_t SCMER; + __IO uint32_t SCMFR; + uint8_t RESERVED3[40]; + __IO uint32_t DTUAR; + __IO uint32_t DTDAR; + __IO uint32_t DTUBR; + __IO uint32_t DTDBR; + uint8_t RESERVED4[48]; + __IO uint32_t GCONR; + __IO uint32_t ICONR; + __IO uint32_t BCONR; + __IO uint32_t DCONR; + uint8_t RESERVED5[4]; + __IO uint32_t PCNAR; + __IO uint32_t PCNBR; + __IO uint32_t FCNGR; + __IO uint32_t VPERR; + __IO uint32_t STFLR; + uint8_t RESERVED6[24]; + __IO uint32_t HSTAR; + __IO uint32_t HSTPR; + __IO uint32_t HCLRR; + __IO uint32_t HUPDR; + __IO uint32_t HCPAR; + __IO uint32_t HCPBR; + __IO uint32_t HCUPR; + __IO uint32_t HCDOR; + uint8_t RESERVED7[588]; + __IO uint32_t FCNTR; + __IO uint32_t SSTAR; + __IO uint32_t SSTPR; + __IO uint32_t SCLRR; + __IO uint32_t SUPDR; +} M4_TMR6_TypeDef; + +/** + * @brief TMRA + */ +typedef struct +{ + __IO uint32_t CNTER; + __IO uint32_t PERAR; + uint8_t RESERVED0[56]; + __IO uint32_t CMPAR1; + __IO uint32_t CMPAR2; + __IO uint32_t CMPAR3; + __IO uint32_t CMPAR4; + uint8_t RESERVED1[48]; + __IO uint32_t BCSTR; + __IO uint32_t HCONR; + __IO uint32_t HCUPR; + __IO uint32_t HCDOR; + __IO uint32_t ICONR; + __IO uint32_t ECONR; + __IO uint32_t FCONR; + __IO uint32_t STFLR; + uint8_t RESERVED2[32]; + __IO uint32_t BCONR1; + uint8_t RESERVED3[4]; + __IO uint32_t BCONR2; + uint8_t RESERVED4[52]; + __IO uint32_t CCONR1; + __IO uint32_t CCONR2; + __IO uint32_t CCONR3; + __IO uint32_t CCONR4; + uint8_t RESERVED5[48]; + __IO uint32_t PCONR1; + __IO uint32_t PCONR2; + __IO uint32_t PCONR3; + __IO uint32_t PCONR4; +} M4_TMRA_TypeDef; + +/** + * @brief TRNG + */ +typedef struct +{ + __IO uint32_t CR; + __IO uint32_t MR; + uint8_t RESERVED0[4]; + __IO uint32_t DR0; + __IO uint32_t DR1; +} M4_TRNG_TypeDef; + +/** + * @brief USART + */ +typedef struct +{ + __IO uint32_t SR; + __IO uint32_t DR; + __IO uint32_t BRR; + __IO uint32_t CR1; + __IO uint32_t CR2; + __IO uint32_t CR3; + __IO uint32_t PR; + __IO uint32_t LBMC; +} M4_USART_TypeDef; + +/** + * @brief USBFS + */ +typedef struct +{ + __IO uint32_t GOTGCTL; + __IO uint32_t GOTGINT; + __IO uint32_t GAHBCFG; + __IO uint32_t GUSBCFG; + __IO uint32_t GRSTCTL; + __IO uint32_t GINTSTS; + __IO uint32_t GINTMSK; + __IO uint32_t GRXSTSR; + __IO uint32_t GRXSTSP; + __IO uint32_t GRXFSIZ; + __IO uint32_t GNPTXFSIZ; + __IO uint32_t GNPTXSTS; + uint8_t RESERVED0[12]; + __IO uint32_t GUID; + uint8_t RESERVED1[20]; + __IO uint32_t GLPMCFG; + uint8_t RESERVED2[4]; + __IO uint32_t GDFIFOCFG; + uint8_t RESERVED3[160]; + __IO uint32_t HPTXFSIZ; + __IO uint32_t DIEPTXF1; + __IO uint32_t DIEPTXF2; + __IO uint32_t DIEPTXF3; + __IO uint32_t DIEPTXF4; + __IO uint32_t DIEPTXF5; + __IO uint32_t DIEPTXF6; + __IO uint32_t DIEPTXF7; + __IO uint32_t DIEPTXF8; + __IO uint32_t DIEPTXF9; + __IO uint32_t DIEPTXF10; + __IO uint32_t DIEPTXF11; + __IO uint32_t DIEPTXF12; + __IO uint32_t DIEPTXF13; + __IO uint32_t DIEPTXF14; + __IO uint32_t DIEPTXF15; + uint8_t RESERVED4[704]; + __IO uint32_t HCFG; + __IO uint32_t HFIR; + __IO uint32_t HFNUM; + uint8_t RESERVED5[4]; + __IO uint32_t HPTXSTS; + __IO uint32_t HAINT; + __IO uint32_t HAINTMSK; + uint8_t RESERVED6[36]; + __IO uint32_t HPRT; + uint8_t RESERVED7[188]; + __IO uint32_t HCCHAR0; + __IO uint32_t HCSPLT0; + __IO uint32_t HCINT0; + __IO uint32_t HCINTMSK0; + __IO uint32_t HCTSIZ0; + __IO uint32_t HCDMA0; + uint8_t RESERVED8[8]; + __IO uint32_t HCCHAR1; + __IO uint32_t HCSPLT1; + __IO uint32_t HCINT1; + __IO uint32_t HCINTMSK1; + __IO uint32_t HCTSIZ1; + __IO uint32_t HCDMA1; + uint8_t RESERVED9[8]; + __IO uint32_t HCCHAR2; + __IO uint32_t HCSPLT2; + __IO uint32_t HCINT2; + __IO uint32_t HCINTMSK2; + __IO uint32_t HCTSIZ2; + __IO uint32_t HCDMA2; + uint8_t RESERVED10[8]; + __IO uint32_t HCCHAR3; + __IO uint32_t HCSPLT3; + __IO uint32_t HCINT3; + __IO uint32_t HCINTMSK3; + __IO uint32_t HCTSIZ3; + __IO uint32_t HCDMA3; + uint8_t RESERVED11[8]; + __IO uint32_t HCCHAR4; + __IO uint32_t HCSPLT4; + __IO uint32_t HCINT4; + __IO uint32_t HCINTMSK4; + __IO uint32_t HCTSIZ4; + __IO uint32_t HCDMA4; + uint8_t RESERVED12[8]; + __IO uint32_t HCCHAR5; + __IO uint32_t HCSPLT5; + __IO uint32_t HCINT5; + __IO uint32_t HCINTMSK5; + __IO uint32_t HCTSIZ5; + __IO uint32_t HCDMA5; + uint8_t RESERVED13[8]; + __IO uint32_t HCCHAR6; + __IO uint32_t HCSPLT6; + __IO uint32_t HCINT6; + __IO uint32_t HCINTMSK6; + __IO uint32_t HCTSIZ6; + __IO uint32_t HCDMA6; + uint8_t RESERVED14[8]; + __IO uint32_t HCCHAR7; + __IO uint32_t HCSPLT7; + __IO uint32_t HCINT7; + __IO uint32_t HCINTMSK7; + __IO uint32_t HCTSIZ7; + __IO uint32_t HCDMA7; + uint8_t RESERVED15[8]; + __IO uint32_t HCCHAR8; + __IO uint32_t HCSPLT8; + __IO uint32_t HCINT8; + __IO uint32_t HCINTMSK8; + __IO uint32_t HCTSIZ8; + __IO uint32_t HCDMA8; + uint8_t RESERVED16[8]; + __IO uint32_t HCCHAR9; + __IO uint32_t HCSPLT9; + __IO uint32_t HCINT9; + __IO uint32_t HCINTMSK9; + __IO uint32_t HCTSIZ9; + __IO uint32_t HCDMA9; + uint8_t RESERVED17[8]; + __IO uint32_t HCCHAR10; + __IO uint32_t HCSPLT10; + __IO uint32_t HCINT10; + __IO uint32_t HCINTMSK10; + __IO uint32_t HCTSIZ10; + __IO uint32_t HCDMA10; + uint8_t RESERVED18[8]; + __IO uint32_t HCCHAR11; + __IO uint32_t HCSPLT11; + __IO uint32_t HCINT11; + __IO uint32_t HCINTMSK11; + __IO uint32_t HCTSIZ11; + __IO uint32_t HCDMA11; + uint8_t RESERVED19[8]; + __IO uint32_t HCCHAR12; + __IO uint32_t HCSPLT12; + __IO uint32_t HCINT12; + __IO uint32_t HCINTMSK12; + __IO uint32_t HCTSIZ12; + __IO uint32_t HCDMA12; + uint8_t RESERVED20[8]; + __IO uint32_t HCCHAR13; + __IO uint32_t HCSPLT13; + __IO uint32_t HCINT13; + __IO uint32_t HCINTMSK13; + __IO uint32_t HCTSIZ13; + __IO uint32_t HCDMA13; + uint8_t RESERVED21[8]; + __IO uint32_t HCCHAR14; + __IO uint32_t HCSPLT14; + __IO uint32_t HCINT14; + __IO uint32_t HCINTMSK14; + __IO uint32_t HCTSIZ14; + __IO uint32_t HCDMA14; + uint8_t RESERVED22[8]; + __IO uint32_t HCCHAR15; + __IO uint32_t HCSPLT15; + __IO uint32_t HCINT15; + __IO uint32_t HCINTMSK15; + __IO uint32_t HCTSIZ15; + __IO uint32_t HCDMA15; + uint8_t RESERVED23[264]; + __IO uint32_t DCFG; + __IO uint32_t DCTL; + __IO uint32_t DSTS; + uint8_t RESERVED24[4]; + __IO uint32_t DIEPMSK; + __IO uint32_t DOEPMSK; + __IO uint32_t DAINT; + __IO uint32_t DAINTMSK; + uint8_t RESERVED25[20]; + __IO uint32_t DIEPEMPMSK; + uint8_t RESERVED26[200]; + __IO uint32_t DIEPCTL0; + uint8_t RESERVED27[4]; + __IO uint32_t DIEPINT0; + uint8_t RESERVED28[4]; + __IO uint32_t DIEPTSIZ0; + __IO uint32_t DIEPDMA0; + __IO uint32_t DTXFSTS0; + uint8_t RESERVED29[4]; + __IO uint32_t DIEPCTL1; + uint8_t RESERVED30[4]; + __IO uint32_t DIEPINT1; + uint8_t RESERVED31[4]; + __IO uint32_t DIEPTSIZ1; + __IO uint32_t DIEPDMA1; + __IO uint32_t DTXFSTS1; + uint8_t RESERVED32[4]; + __IO uint32_t DIEPCTL2; + uint8_t RESERVED33[4]; + __IO uint32_t DIEPINT2; + uint8_t RESERVED34[4]; + __IO uint32_t DIEPTSIZ2; + __IO uint32_t DIEPDMA2; + __IO uint32_t DTXFSTS2; + uint8_t RESERVED35[4]; + __IO uint32_t DIEPCTL3; + uint8_t RESERVED36[4]; + __IO uint32_t DIEPINT3; + uint8_t RESERVED37[4]; + __IO uint32_t DIEPTSIZ3; + __IO uint32_t DIEPDMA3; + __IO uint32_t DTXFSTS3; + uint8_t RESERVED38[4]; + __IO uint32_t DIEPCTL4; + uint8_t RESERVED39[4]; + __IO uint32_t DIEPINT4; + uint8_t RESERVED40[4]; + __IO uint32_t DIEPTSIZ4; + __IO uint32_t DIEPDMA4; + __IO uint32_t DTXFSTS4; + uint8_t RESERVED41[4]; + __IO uint32_t DIEPCTL5; + uint8_t RESERVED42[4]; + __IO uint32_t DIEPINT5; + uint8_t RESERVED43[4]; + __IO uint32_t DIEPTSIZ5; + __IO uint32_t DIEPDMA5; + __IO uint32_t DTXFSTS5; + uint8_t RESERVED44[4]; + __IO uint32_t DIEPCTL6; + uint8_t RESERVED45[4]; + __IO uint32_t DIEPINT6; + uint8_t RESERVED46[4]; + __IO uint32_t DIEPTSIZ6; + __IO uint32_t DIEPDMA6; + __IO uint32_t DTXFSTS6; + uint8_t RESERVED47[4]; + __IO uint32_t DIEPCTL7; + uint8_t RESERVED48[4]; + __IO uint32_t DIEPINT7; + uint8_t RESERVED49[4]; + __IO uint32_t DIEPTSIZ7; + __IO uint32_t DIEPDMA7; + __IO uint32_t DTXFSTS7; + uint8_t RESERVED50[4]; + __IO uint32_t DIEPCTL8; + uint8_t RESERVED51[4]; + __IO uint32_t DIEPINT8; + uint8_t RESERVED52[4]; + __IO uint32_t DIEPTSIZ8; + __IO uint32_t DIEPDMA8; + __IO uint32_t DTXFSTS8; + uint8_t RESERVED53[4]; + __IO uint32_t DIEPCTL9; + uint8_t RESERVED54[4]; + __IO uint32_t DIEPINT9; + uint8_t RESERVED55[4]; + __IO uint32_t DIEPTSIZ9; + __IO uint32_t DIEPDMA9; + __IO uint32_t DTXFSTS9; + uint8_t RESERVED56[4]; + __IO uint32_t DIEPCTL10; + uint8_t RESERVED57[4]; + __IO uint32_t DIEPINT10; + uint8_t RESERVED58[4]; + __IO uint32_t DIEPTSIZ10; + __IO uint32_t DIEPDMA10; + __IO uint32_t DTXFSTS10; + uint8_t RESERVED59[4]; + __IO uint32_t DIEPCTL11; + uint8_t RESERVED60[4]; + __IO uint32_t DIEPINT11; + uint8_t RESERVED61[4]; + __IO uint32_t DIEPTSIZ11; + __IO uint32_t DIEPDMA11; + __IO uint32_t DTXFSTS11; + uint8_t RESERVED62[4]; + __IO uint32_t DIEPCTL12; + uint8_t RESERVED63[4]; + __IO uint32_t DIEPINT12; + uint8_t RESERVED64[4]; + __IO uint32_t DIEPTSIZ12; + __IO uint32_t DIEPDMA12; + __IO uint32_t DTXFSTS12; + uint8_t RESERVED65[4]; + __IO uint32_t DIEPCTL13; + uint8_t RESERVED66[4]; + __IO uint32_t DIEPINT13; + uint8_t RESERVED67[4]; + __IO uint32_t DIEPTSIZ13; + __IO uint32_t DIEPDMA13; + __IO uint32_t DTXFSTS13; + uint8_t RESERVED68[4]; + __IO uint32_t DIEPCTL14; + uint8_t RESERVED69[4]; + __IO uint32_t DIEPINT14; + uint8_t RESERVED70[4]; + __IO uint32_t DIEPTSIZ14; + __IO uint32_t DIEPDMA14; + __IO uint32_t DTXFSTS14; + uint8_t RESERVED71[4]; + __IO uint32_t DIEPCTL15; + uint8_t RESERVED72[4]; + __IO uint32_t DIEPINT15; + uint8_t RESERVED73[4]; + __IO uint32_t DIEPTSIZ15; + __IO uint32_t DIEPDMA15; + __IO uint32_t DTXFSTS15; + uint8_t RESERVED74[4]; + __IO uint32_t DOEPCTL0; + uint8_t RESERVED75[4]; + __IO uint32_t DOEPINT0; + uint8_t RESERVED76[4]; + __IO uint32_t DOEPTSIZ0; + __IO uint32_t DOEPDMA0; + uint8_t RESERVED77[8]; + __IO uint32_t DOEPCTL1; + uint8_t RESERVED78[4]; + __IO uint32_t DOEPINT1; + uint8_t RESERVED79[4]; + __IO uint32_t DOEPTSIZ1; + __IO uint32_t DOEPDMA1; + uint8_t RESERVED80[8]; + __IO uint32_t DOEPCTL2; + uint8_t RESERVED81[4]; + __IO uint32_t DOEPINT2; + uint8_t RESERVED82[4]; + __IO uint32_t DOEPTSIZ2; + __IO uint32_t DOEPDMA2; + uint8_t RESERVED83[8]; + __IO uint32_t DOEPCTL3; + uint8_t RESERVED84[4]; + __IO uint32_t DOEPINT3; + uint8_t RESERVED85[4]; + __IO uint32_t DOEPTSIZ3; + __IO uint32_t DOEPDMA3; + uint8_t RESERVED86[8]; + __IO uint32_t DOEPCTL4; + uint8_t RESERVED87[4]; + __IO uint32_t DOEPINT4; + uint8_t RESERVED88[4]; + __IO uint32_t DOEPTSIZ4; + __IO uint32_t DOEPDMA4; + uint8_t RESERVED89[8]; + __IO uint32_t DOEPCTL5; + uint8_t RESERVED90[4]; + __IO uint32_t DOEPINT5; + uint8_t RESERVED91[4]; + __IO uint32_t DOEPTSIZ5; + __IO uint32_t DOEPDMA5; + uint8_t RESERVED92[8]; + __IO uint32_t DOEPCTL6; + uint8_t RESERVED93[4]; + __IO uint32_t DOEPINT6; + uint8_t RESERVED94[4]; + __IO uint32_t DOEPTSIZ6; + __IO uint32_t DOEPDMA6; + uint8_t RESERVED95[8]; + __IO uint32_t DOEPCTL7; + uint8_t RESERVED96[4]; + __IO uint32_t DOEPINT7; + uint8_t RESERVED97[4]; + __IO uint32_t DOEPTSIZ7; + __IO uint32_t DOEPDMA7; + uint8_t RESERVED98[8]; + __IO uint32_t DOEPCTL8; + uint8_t RESERVED99[4]; + __IO uint32_t DOEPINT8; + uint8_t RESERVED100[4]; + __IO uint32_t DOEPTSIZ8; + __IO uint32_t DOEPDMA8; + uint8_t RESERVED101[8]; + __IO uint32_t DOEPCTL9; + uint8_t RESERVED102[4]; + __IO uint32_t DOEPINT9; + uint8_t RESERVED103[4]; + __IO uint32_t DOEPTSIZ9; + __IO uint32_t DOEPDMA9; + uint8_t RESERVED104[8]; + __IO uint32_t DOEPCTL10; + uint8_t RESERVED105[4]; + __IO uint32_t DOEPINT10; + uint8_t RESERVED106[4]; + __IO uint32_t DOEPTSIZ10; + __IO uint32_t DOEPDMA10; + uint8_t RESERVED107[8]; + __IO uint32_t DOEPCTL11; + uint8_t RESERVED108[4]; + __IO uint32_t DOEPINT11; + uint8_t RESERVED109[4]; + __IO uint32_t DOEPTSIZ11; + __IO uint32_t DOEPDMA11; + uint8_t RESERVED110[8]; + __IO uint32_t DOEPCTL12; + uint8_t RESERVED111[4]; + __IO uint32_t DOEPINT12; + uint8_t RESERVED112[4]; + __IO uint32_t DOEPTSIZ12; + __IO uint32_t DOEPDMA12; + uint8_t RESERVED113[8]; + __IO uint32_t DOEPCTL13; + uint8_t RESERVED114[4]; + __IO uint32_t DOEPINT13; + uint8_t RESERVED115[4]; + __IO uint32_t DOEPTSIZ13; + __IO uint32_t DOEPDMA13; + uint8_t RESERVED116[8]; + __IO uint32_t DOEPCTL14; + uint8_t RESERVED117[4]; + __IO uint32_t DOEPINT14; + uint8_t RESERVED118[4]; + __IO uint32_t DOEPTSIZ14; + __IO uint32_t DOEPDMA14; + uint8_t RESERVED119[8]; + __IO uint32_t DOEPCTL15; + uint8_t RESERVED120[4]; + __IO uint32_t DOEPINT15; + uint8_t RESERVED121[4]; + __IO uint32_t DOEPTSIZ15; + __IO uint32_t DOEPDMA15; + uint8_t RESERVED122[264]; + __IO uint32_t PCGCCTL; +} M4_USBFS_TypeDef; + +/** + * @brief USBHS + */ +typedef struct +{ + __IO uint32_t GOTGCTL; + __IO uint32_t GOTGINT; + __IO uint32_t GAHBCFG; + __IO uint32_t GUSBCFG; + __IO uint32_t GRSTCTL; + __IO uint32_t GINTSTS; + __IO uint32_t GINTMSK; + __IO uint32_t GRXSTSR; + __IO uint32_t GRXSTSP; + __IO uint32_t GRXFSIZ; + __IO uint32_t GNPTXFSIZ; + __IO uint32_t GNPTXSTS; + uint8_t RESERVED0[4]; + __IO uint32_t GPVNDCTL; + uint8_t RESERVED1[4]; + __IO uint32_t GUID; + uint8_t RESERVED2[20]; + __IO uint32_t GLPMCFG; + uint8_t RESERVED3[4]; + __IO uint32_t GDFIFOCFG; + uint8_t RESERVED4[160]; + __IO uint32_t HPTXFSIZ; + __IO uint32_t DIEPTXF1; + __IO uint32_t DIEPTXF2; + __IO uint32_t DIEPTXF3; + __IO uint32_t DIEPTXF4; + __IO uint32_t DIEPTXF5; + __IO uint32_t DIEPTXF6; + __IO uint32_t DIEPTXF7; + __IO uint32_t DIEPTXF8; + __IO uint32_t DIEPTXF9; + __IO uint32_t DIEPTXF10; + __IO uint32_t DIEPTXF11; + __IO uint32_t DIEPTXF12; + __IO uint32_t DIEPTXF13; + __IO uint32_t DIEPTXF14; + __IO uint32_t DIEPTXF15; + uint8_t RESERVED5[704]; + __IO uint32_t HCFG; + __IO uint32_t HFIR; + __IO uint32_t HFNUM; + uint8_t RESERVED6[4]; + __IO uint32_t HPTXSTS; + __IO uint32_t HAINT; + __IO uint32_t HAINTMSK; + uint8_t RESERVED7[36]; + __IO uint32_t HPRT; + uint8_t RESERVED8[188]; + __IO uint32_t HCCHAR0; + __IO uint32_t HCSPLT0; + __IO uint32_t HCINT0; + __IO uint32_t HCINTMSK0; + __IO uint32_t HCTSIZ0; + __IO uint32_t HCDMA0; + uint8_t RESERVED9[8]; + __IO uint32_t HCCHAR1; + __IO uint32_t HCSPLT1; + __IO uint32_t HCINT1; + __IO uint32_t HCINTMSK1; + __IO uint32_t HCTSIZ1; + __IO uint32_t HCDMA1; + uint8_t RESERVED10[8]; + __IO uint32_t HCCHAR2; + __IO uint32_t HCSPLT2; + __IO uint32_t HCINT2; + __IO uint32_t HCINTMSK2; + __IO uint32_t HCTSIZ2; + __IO uint32_t HCDMA2; + uint8_t RESERVED11[8]; + __IO uint32_t HCCHAR3; + __IO uint32_t HCSPLT3; + __IO uint32_t HCINT3; + __IO uint32_t HCINTMSK3; + __IO uint32_t HCTSIZ3; + __IO uint32_t HCDMA3; + uint8_t RESERVED12[8]; + __IO uint32_t HCCHAR4; + __IO uint32_t HCSPLT4; + __IO uint32_t HCINT4; + __IO uint32_t HCINTMSK4; + __IO uint32_t HCTSIZ4; + __IO uint32_t HCDMA4; + uint8_t RESERVED13[8]; + __IO uint32_t HCCHAR5; + __IO uint32_t HCSPLT5; + __IO uint32_t HCINT5; + __IO uint32_t HCINTMSK5; + __IO uint32_t HCTSIZ5; + __IO uint32_t HCDMA5; + uint8_t RESERVED14[8]; + __IO uint32_t HCCHAR6; + __IO uint32_t HCSPLT6; + __IO uint32_t HCINT6; + __IO uint32_t HCINTMSK6; + __IO uint32_t HCTSIZ6; + __IO uint32_t HCDMA6; + uint8_t RESERVED15[8]; + __IO uint32_t HCCHAR7; + __IO uint32_t HCSPLT7; + __IO uint32_t HCINT7; + __IO uint32_t HCINTMSK7; + __IO uint32_t HCTSIZ7; + __IO uint32_t HCDMA7; + uint8_t RESERVED16[8]; + __IO uint32_t HCCHAR8; + __IO uint32_t HCSPLT8; + __IO uint32_t HCINT8; + __IO uint32_t HCINTMSK8; + __IO uint32_t HCTSIZ8; + __IO uint32_t HCDMA8; + uint8_t RESERVED17[8]; + __IO uint32_t HCCHAR9; + __IO uint32_t HCSPLT9; + __IO uint32_t HCINT9; + __IO uint32_t HCINTMSK9; + __IO uint32_t HCTSIZ9; + __IO uint32_t HCDMA9; + uint8_t RESERVED18[8]; + __IO uint32_t HCCHAR10; + __IO uint32_t HCSPLT10; + __IO uint32_t HCINT10; + __IO uint32_t HCINTMSK10; + __IO uint32_t HCTSIZ10; + __IO uint32_t HCDMA10; + uint8_t RESERVED19[8]; + __IO uint32_t HCCHAR11; + __IO uint32_t HCSPLT11; + __IO uint32_t HCINT11; + __IO uint32_t HCINTMSK11; + __IO uint32_t HCTSIZ11; + __IO uint32_t HCDMA11; + uint8_t RESERVED20[8]; + __IO uint32_t HCCHAR12; + __IO uint32_t HCSPLT12; + __IO uint32_t HCINT12; + __IO uint32_t HCINTMSK12; + __IO uint32_t HCTSIZ12; + __IO uint32_t HCDMA12; + uint8_t RESERVED21[8]; + __IO uint32_t HCCHAR13; + __IO uint32_t HCSPLT13; + __IO uint32_t HCINT13; + __IO uint32_t HCINTMSK13; + __IO uint32_t HCTSIZ13; + __IO uint32_t HCDMA13; + uint8_t RESERVED22[8]; + __IO uint32_t HCCHAR14; + __IO uint32_t HCSPLT14; + __IO uint32_t HCINT14; + __IO uint32_t HCINTMSK14; + __IO uint32_t HCTSIZ14; + __IO uint32_t HCDMA14; + uint8_t RESERVED23[8]; + __IO uint32_t HCCHAR15; + __IO uint32_t HCSPLT15; + __IO uint32_t HCINT15; + __IO uint32_t HCINTMSK15; + __IO uint32_t HCTSIZ15; + __IO uint32_t HCDMA15; + uint8_t RESERVED24[264]; + __IO uint32_t DCFG; + __IO uint32_t DCTL; + __IO uint32_t DSTS; + uint8_t RESERVED25[4]; + __IO uint32_t DIEPMSK; + __IO uint32_t DOEPMSK; + __IO uint32_t DAINT; + __IO uint32_t DAINTMSK; + uint8_t RESERVED26[16]; + __IO uint32_t DTHRCTL; + __IO uint32_t DIEPEMPMSK; + __IO uint32_t DEACHINT; + __IO uint32_t DEACHINTMSK; + uint8_t RESERVED27[4]; + __IO uint32_t DIEPEACHMSK1; + uint8_t RESERVED28[60]; + __IO uint32_t DOEPEACHMSK1; + uint8_t RESERVED29[120]; + __IO uint32_t DIEPCTL0; + uint8_t RESERVED30[4]; + __IO uint32_t DIEPINT0; + uint8_t RESERVED31[4]; + __IO uint32_t DIEPTSIZ0; + __IO uint32_t DIEPDMA0; + __IO uint32_t DTXFSTS0; + uint8_t RESERVED32[4]; + __IO uint32_t DIEPCTL1; + uint8_t RESERVED33[4]; + __IO uint32_t DIEPINT1; + uint8_t RESERVED34[4]; + __IO uint32_t DIEPTSIZ1; + __IO uint32_t DIEPDMA1; + __IO uint32_t DTXFSTS1; + uint8_t RESERVED35[4]; + __IO uint32_t DIEPCTL2; + uint8_t RESERVED36[4]; + __IO uint32_t DIEPINT2; + uint8_t RESERVED37[4]; + __IO uint32_t DIEPTSIZ2; + __IO uint32_t DIEPDMA2; + __IO uint32_t DTXFSTS2; + uint8_t RESERVED38[4]; + __IO uint32_t DIEPCTL3; + uint8_t RESERVED39[4]; + __IO uint32_t DIEPINT3; + uint8_t RESERVED40[4]; + __IO uint32_t DIEPTSIZ3; + __IO uint32_t DIEPDMA3; + __IO uint32_t DTXFSTS3; + uint8_t RESERVED41[4]; + __IO uint32_t DIEPCTL4; + uint8_t RESERVED42[4]; + __IO uint32_t DIEPINT4; + uint8_t RESERVED43[4]; + __IO uint32_t DIEPTSIZ4; + __IO uint32_t DIEPDMA4; + __IO uint32_t DTXFSTS4; + uint8_t RESERVED44[4]; + __IO uint32_t DIEPCTL5; + uint8_t RESERVED45[4]; + __IO uint32_t DIEPINT5; + uint8_t RESERVED46[4]; + __IO uint32_t DIEPTSIZ5; + __IO uint32_t DIEPDMA5; + __IO uint32_t DTXFSTS5; + uint8_t RESERVED47[4]; + __IO uint32_t DIEPCTL6; + uint8_t RESERVED48[4]; + __IO uint32_t DIEPINT6; + uint8_t RESERVED49[4]; + __IO uint32_t DIEPTSIZ6; + __IO uint32_t DIEPDMA6; + __IO uint32_t DTXFSTS6; + uint8_t RESERVED50[4]; + __IO uint32_t DIEPCTL7; + uint8_t RESERVED51[4]; + __IO uint32_t DIEPINT7; + uint8_t RESERVED52[4]; + __IO uint32_t DIEPTSIZ7; + __IO uint32_t DIEPDMA7; + __IO uint32_t DTXFSTS7; + uint8_t RESERVED53[4]; + __IO uint32_t DIEPCTL8; + uint8_t RESERVED54[4]; + __IO uint32_t DIEPINT8; + uint8_t RESERVED55[4]; + __IO uint32_t DIEPTSIZ8; + __IO uint32_t DIEPDMA8; + __IO uint32_t DTXFSTS8; + uint8_t RESERVED56[4]; + __IO uint32_t DIEPCTL9; + uint8_t RESERVED57[4]; + __IO uint32_t DIEPINT9; + uint8_t RESERVED58[4]; + __IO uint32_t DIEPTSIZ9; + __IO uint32_t DIEPDMA9; + __IO uint32_t DTXFSTS9; + uint8_t RESERVED59[4]; + __IO uint32_t DIEPCTL10; + uint8_t RESERVED60[4]; + __IO uint32_t DIEPINT10; + uint8_t RESERVED61[4]; + __IO uint32_t DIEPTSIZ10; + __IO uint32_t DIEPDMA10; + __IO uint32_t DTXFSTS10; + uint8_t RESERVED62[4]; + __IO uint32_t DIEPCTL11; + uint8_t RESERVED63[4]; + __IO uint32_t DIEPINT11; + uint8_t RESERVED64[4]; + __IO uint32_t DIEPTSIZ11; + __IO uint32_t DIEPDMA11; + __IO uint32_t DTXFSTS11; + uint8_t RESERVED65[4]; + __IO uint32_t DIEPCTL12; + uint8_t RESERVED66[4]; + __IO uint32_t DIEPINT12; + uint8_t RESERVED67[4]; + __IO uint32_t DIEPTSIZ12; + __IO uint32_t DIEPDMA12; + __IO uint32_t DTXFSTS12; + uint8_t RESERVED68[4]; + __IO uint32_t DIEPCTL13; + uint8_t RESERVED69[4]; + __IO uint32_t DIEPINT13; + uint8_t RESERVED70[4]; + __IO uint32_t DIEPTSIZ13; + __IO uint32_t DIEPDMA13; + __IO uint32_t DTXFSTS13; + uint8_t RESERVED71[4]; + __IO uint32_t DIEPCTL14; + uint8_t RESERVED72[4]; + __IO uint32_t DIEPINT14; + uint8_t RESERVED73[4]; + __IO uint32_t DIEPTSIZ14; + __IO uint32_t DIEPDMA14; + __IO uint32_t DTXFSTS14; + uint8_t RESERVED74[4]; + __IO uint32_t DIEPCTL15; + uint8_t RESERVED75[4]; + __IO uint32_t DIEPINT15; + uint8_t RESERVED76[4]; + __IO uint32_t DIEPTSIZ15; + __IO uint32_t DIEPDMA15; + __IO uint32_t DTXFSTS15; + uint8_t RESERVED77[4]; + __IO uint32_t DOEPCTL0; + uint8_t RESERVED78[4]; + __IO uint32_t DOEPINT0; + uint8_t RESERVED79[4]; + __IO uint32_t DOEPTSIZ0; + __IO uint32_t DOEPDMA0; + uint8_t RESERVED80[8]; + __IO uint32_t DOEPCTL1; + uint8_t RESERVED81[4]; + __IO uint32_t DOEPINT1; + uint8_t RESERVED82[4]; + __IO uint32_t DOEPTSIZ1; + __IO uint32_t DOEPDMA1; + uint8_t RESERVED83[8]; + __IO uint32_t DOEPCTL2; + uint8_t RESERVED84[4]; + __IO uint32_t DOEPINT2; + uint8_t RESERVED85[4]; + __IO uint32_t DOEPTSIZ2; + __IO uint32_t DOEPDMA2; + uint8_t RESERVED86[8]; + __IO uint32_t DOEPCTL3; + uint8_t RESERVED87[4]; + __IO uint32_t DOEPINT3; + uint8_t RESERVED88[4]; + __IO uint32_t DOEPTSIZ3; + __IO uint32_t DOEPDMA3; + uint8_t RESERVED89[8]; + __IO uint32_t DOEPCTL4; + uint8_t RESERVED90[4]; + __IO uint32_t DOEPINT4; + uint8_t RESERVED91[4]; + __IO uint32_t DOEPTSIZ4; + __IO uint32_t DOEPDMA4; + uint8_t RESERVED92[8]; + __IO uint32_t DOEPCTL5; + uint8_t RESERVED93[4]; + __IO uint32_t DOEPINT5; + uint8_t RESERVED94[4]; + __IO uint32_t DOEPTSIZ5; + __IO uint32_t DOEPDMA5; + uint8_t RESERVED95[8]; + __IO uint32_t DOEPCTL6; + uint8_t RESERVED96[4]; + __IO uint32_t DOEPINT6; + uint8_t RESERVED97[4]; + __IO uint32_t DOEPTSIZ6; + __IO uint32_t DOEPDMA6; + uint8_t RESERVED98[8]; + __IO uint32_t DOEPCTL7; + uint8_t RESERVED99[4]; + __IO uint32_t DOEPINT7; + uint8_t RESERVED100[4]; + __IO uint32_t DOEPTSIZ7; + __IO uint32_t DOEPDMA7; + uint8_t RESERVED101[8]; + __IO uint32_t DOEPCTL8; + uint8_t RESERVED102[4]; + __IO uint32_t DOEPINT8; + uint8_t RESERVED103[4]; + __IO uint32_t DOEPTSIZ8; + __IO uint32_t DOEPDMA8; + uint8_t RESERVED104[8]; + __IO uint32_t DOEPCTL9; + uint8_t RESERVED105[4]; + __IO uint32_t DOEPINT9; + uint8_t RESERVED106[4]; + __IO uint32_t DOEPTSIZ9; + __IO uint32_t DOEPDMA9; + uint8_t RESERVED107[8]; + __IO uint32_t DOEPCTL10; + uint8_t RESERVED108[4]; + __IO uint32_t DOEPINT10; + uint8_t RESERVED109[4]; + __IO uint32_t DOEPTSIZ10; + __IO uint32_t DOEPDMA10; + uint8_t RESERVED110[8]; + __IO uint32_t DOEPCTL11; + uint8_t RESERVED111[4]; + __IO uint32_t DOEPINT11; + uint8_t RESERVED112[4]; + __IO uint32_t DOEPTSIZ11; + __IO uint32_t DOEPDMA11; + uint8_t RESERVED113[8]; + __IO uint32_t DOEPCTL12; + uint8_t RESERVED114[4]; + __IO uint32_t DOEPINT12; + uint8_t RESERVED115[4]; + __IO uint32_t DOEPTSIZ12; + __IO uint32_t DOEPDMA12; + uint8_t RESERVED116[8]; + __IO uint32_t DOEPCTL13; + uint8_t RESERVED117[4]; + __IO uint32_t DOEPINT13; + uint8_t RESERVED118[4]; + __IO uint32_t DOEPTSIZ13; + __IO uint32_t DOEPDMA13; + uint8_t RESERVED119[8]; + __IO uint32_t DOEPCTL14; + uint8_t RESERVED120[4]; + __IO uint32_t DOEPINT14; + uint8_t RESERVED121[4]; + __IO uint32_t DOEPTSIZ14; + __IO uint32_t DOEPDMA14; + uint8_t RESERVED122[8]; + __IO uint32_t DOEPCTL15; + uint8_t RESERVED123[4]; + __IO uint32_t DOEPINT15; + uint8_t RESERVED124[4]; + __IO uint32_t DOEPTSIZ15; + __IO uint32_t DOEPDMA15; + uint8_t RESERVED125[264]; + __IO uint32_t PCGCCTL; +} M4_USBHS_TypeDef; + +/** + * @brief WDT + */ +typedef struct +{ + __IO uint32_t CR; + __IO uint32_t SR; + __IO uint32_t RR; +} M4_WDT_TypeDef; + + + +/******************************************************************************/ +/* Device Specific Peripheral declaration & memory map */ +/******************************************************************************/ + +#define M4_ADC1 ((M4_ADC_TypeDef *)0x40040000UL) +#define M4_ADC2 ((M4_ADC_TypeDef *)0x40040400UL) +#define M4_ADC3 ((M4_ADC_TypeDef *)0x40040800UL) +#define M4_AES ((M4_AES_TypeDef *)0x40008000UL) +#define M4_AOS ((M4_AOS_TypeDef *)0x40010800UL) +#define M4_CAN1 ((M4_CAN_TypeDef *)0x40009000UL) +#define M4_CAN2 ((M4_CAN_TypeDef *)0x40078000UL) +#define M4_CMP1 ((M4_CMP_TypeDef *)0x4004A000UL) +#define M4_CMP2 ((M4_CMP_TypeDef *)0x4004A010UL) +#define M4_CMP3 ((M4_CMP_TypeDef *)0x4004A400UL) +#define M4_CMP4 ((M4_CMP_TypeDef *)0x4004A410UL) +#define M4_CMU ((M4_CMU_TypeDef *)0x4004C400UL) +#define M4_CRC ((M4_CRC_TypeDef *)0x40008C00UL) +#define M4_CTC ((M4_CTC_TypeDef *)0x40049C00UL) +#define M4_DAC1 ((M4_DAC_TypeDef *)0x40041000UL) +#define M4_DAC2 ((M4_DAC_TypeDef *)0x40041400UL) +#define M4_DBGC ((M4_DBGC_TypeDef *)0xE0042000UL) +#define M4_DCU1 ((M4_DCU_TypeDef *)0x40056000UL) +#define M4_DCU2 ((M4_DCU_TypeDef *)0x40056400UL) +#define M4_DCU3 ((M4_DCU_TypeDef *)0x40056800UL) +#define M4_DCU4 ((M4_DCU_TypeDef *)0x40056C00UL) +#define M4_DCU5 ((M4_DCU_TypeDef *)0x40057000UL) +#define M4_DCU6 ((M4_DCU_TypeDef *)0x40057400UL) +#define M4_DCU7 ((M4_DCU_TypeDef *)0x40057800UL) +#define M4_DCU8 ((M4_DCU_TypeDef *)0x40057C00UL) +#define M4_DMA1 ((M4_DMA_TypeDef *)0x40053000UL) +#define M4_DMA2 ((M4_DMA_TypeDef *)0x40053400UL) +#define M4_DMC ((M4_DMC_TypeDef *)0x88000400UL) +#define M4_DVP ((M4_DVP_TypeDef *)0x40055800UL) +#define M4_EFM ((M4_EFM_TypeDef *)0x40010400UL) +#define M4_EMB0 ((M4_EMB_TypeDef *)0x40017C00UL) +#define M4_EMB1 ((M4_EMB_TypeDef *)0x40017C20UL) +#define M4_EMB2 ((M4_EMB_TypeDef *)0x40017C40UL) +#define M4_EMB3 ((M4_EMB_TypeDef *)0x40017C60UL) +#define M4_EMB4 ((M4_EMB_TypeDef *)0x40017C80UL) +#define M4_EMB5 ((M4_EMB_TypeDef *)0x40017CA0UL) +#define M4_EMB6 ((M4_EMB_TypeDef *)0x40017CC0UL) +#define M4_ETH ((M4_ETH_TypeDef *)0x40050000UL) +#define M4_FCM ((M4_FCM_TypeDef *)0x40048400UL) +#define M4_FMAC1 ((M4_FMAC_TypeDef *)0x40058000UL) +#define M4_FMAC2 ((M4_FMAC_TypeDef *)0x40058400UL) +#define M4_FMAC3 ((M4_FMAC_TypeDef *)0x40058800UL) +#define M4_FMAC4 ((M4_FMAC_TypeDef *)0x40058C00UL) +#define M4_GPIO ((M4_GPIO_TypeDef *)0x40053800UL) +#define M4_HASH ((M4_HASH_TypeDef *)0x40008400UL) +#define M4_HRPWM ((M4_HRPWM_TypeDef *)0x4003C000UL) +#define M4_I2C1 ((M4_I2C_TypeDef *)0x4004E000UL) +#define M4_I2C2 ((M4_I2C_TypeDef *)0x4004E400UL) +#define M4_I2C3 ((M4_I2C_TypeDef *)0x4004E800UL) +#define M4_I2C4 ((M4_I2C_TypeDef *)0x4004EC00UL) +#define M4_I2C5 ((M4_I2C_TypeDef *)0x4004F000UL) +#define M4_I2C6 ((M4_I2C_TypeDef *)0x4004F800UL) +#define M4_I2S1 ((M4_I2S_TypeDef *)0x4001E000UL) +#define M4_I2S2 ((M4_I2S_TypeDef *)0x4001E400UL) +#define M4_I2S3 ((M4_I2S_TypeDef *)0x40022000UL) +#define M4_I2S4 ((M4_I2S_TypeDef *)0x40022400UL) +#define M4_ICG ((M4_ICG_TypeDef *)0x00000400UL) +#define M4_INTC ((M4_INTC_TypeDef *)0x40051000UL) +#define M4_KEYSCAN ((M4_KEYSCAN_TypeDef *)0x40050C00UL) +#define M4_MAU ((M4_MAU_TypeDef *)0x40055000UL) +#define M4_MPU ((M4_MPU_TypeDef *)0x40050000UL) +#define M4_NFC ((M4_NFC_TypeDef *)0x88100000UL) +#define M4_OTS ((M4_OTS_TypeDef *)0x4004A800UL) +#define M4_PERIC ((M4_PERIC_TypeDef *)0x40055400UL) +#define M4_PWC ((M4_PWC_TypeDef *)0x40048000UL) +#define M4_QSPI ((M4_QSPI_TypeDef *)0x9C000000UL) +#define M4_RMU ((M4_RMU_TypeDef *)0x4004CC00UL) +#define M4_RTC ((M4_RTC_TypeDef *)0x4004C000UL) +#define M4_SDIOC1 ((M4_SDIOC_TypeDef *)0x40070000UL) +#define M4_SDIOC2 ((M4_SDIOC_TypeDef *)0x40078400UL) +#define M4_SMC ((M4_SMC_TypeDef *)0x88000000UL) +#define M4_SPI1 ((M4_SPI_TypeDef *)0x4001C000UL) +#define M4_SPI2 ((M4_SPI_TypeDef *)0x4001C400UL) +#define M4_SPI3 ((M4_SPI_TypeDef *)0x4001C800UL) +#define M4_SPI4 ((M4_SPI_TypeDef *)0x40020000UL) +#define M4_SPI5 ((M4_SPI_TypeDef *)0x40020400UL) +#define M4_SPI6 ((M4_SPI_TypeDef *)0x40020800UL) +#define M4_SRAMC ((M4_SRAMC_TypeDef *)0x40050800UL) +#define M4_SWDT ((M4_SWDT_TypeDef *)0x40049400UL) +#define M4_TMR0_1 ((M4_TMR0_TypeDef *)0x40024000UL) +#define M4_TMR0_2 ((M4_TMR0_TypeDef *)0x40024400UL) +#define M4_TMR2_1 ((M4_TMR2_TypeDef *)0x40024800UL) +#define M4_TMR2_2 ((M4_TMR2_TypeDef *)0x40024C00UL) +#define M4_TMR2_3 ((M4_TMR2_TypeDef *)0x40025000UL) +#define M4_TMR2_4 ((M4_TMR2_TypeDef *)0x40025400UL) +#define M4_TMR4_1 ((M4_TMR4_TypeDef *)0x40038000UL) +#define M4_TMR4_2 ((M4_TMR4_TypeDef *)0x40038400UL) +#define M4_TMR4_3 ((M4_TMR4_TypeDef *)0x40038800UL) +#define M4_TMR6_1 ((M4_TMR6_TypeDef *)0x40018000UL) +#define M4_TMR6_2 ((M4_TMR6_TypeDef *)0x40018400UL) +#define M4_TMR6_3 ((M4_TMR6_TypeDef *)0x40018800UL) +#define M4_TMR6_4 ((M4_TMR6_TypeDef *)0x40018C00UL) +#define M4_TMR6_5 ((M4_TMR6_TypeDef *)0x40019000UL) +#define M4_TMR6_6 ((M4_TMR6_TypeDef *)0x40019400UL) +#define M4_TMR6_7 ((M4_TMR6_TypeDef *)0x40019800UL) +#define M4_TMR6_8 ((M4_TMR6_TypeDef *)0x40019C00UL) +#define M4_TMRA_1 ((M4_TMRA_TypeDef *)0x4003A000UL) +#define M4_TMRA_10 ((M4_TMRA_TypeDef *)0x40027400UL) +#define M4_TMRA_11 ((M4_TMRA_TypeDef *)0x40027800UL) +#define M4_TMRA_12 ((M4_TMRA_TypeDef *)0x40027C00UL) +#define M4_TMRA_2 ((M4_TMRA_TypeDef *)0x4003A400UL) +#define M4_TMRA_3 ((M4_TMRA_TypeDef *)0x4003A800UL) +#define M4_TMRA_4 ((M4_TMRA_TypeDef *)0x4003AC00UL) +#define M4_TMRA_5 ((M4_TMRA_TypeDef *)0x40026000UL) +#define M4_TMRA_6 ((M4_TMRA_TypeDef *)0x40026400UL) +#define M4_TMRA_7 ((M4_TMRA_TypeDef *)0x40026800UL) +#define M4_TMRA_8 ((M4_TMRA_TypeDef *)0x40026C00UL) +#define M4_TMRA_9 ((M4_TMRA_TypeDef *)0x40027000UL) +#define M4_TRNG ((M4_TRNG_TypeDef *)0x40042000UL) +#define M4_USART1 ((M4_USART_TypeDef *)0x4001CC00UL) +#define M4_USART10 ((M4_USART_TypeDef *)0x40021C00UL) +#define M4_USART2 ((M4_USART_TypeDef *)0x4001D000UL) +#define M4_USART3 ((M4_USART_TypeDef *)0x4001D400UL) +#define M4_USART4 ((M4_USART_TypeDef *)0x4001D800UL) +#define M4_USART5 ((M4_USART_TypeDef *)0x4001DC00UL) +#define M4_USART6 ((M4_USART_TypeDef *)0x40020C00UL) +#define M4_USART7 ((M4_USART_TypeDef *)0x40021000UL) +#define M4_USART8 ((M4_USART_TypeDef *)0x40021400UL) +#define M4_USART9 ((M4_USART_TypeDef *)0x40021800UL) +#define M4_USBFS ((M4_USBFS_TypeDef *)0x40080000UL) +#define M4_USBHS ((M4_USBHS_TypeDef *)0x400C0000UL) +#define M4_WDT ((M4_WDT_TypeDef *)0x40049000UL) + + +/******************************************************************************/ +/* Peripheral Registers Bits Definition */ +/******************************************************************************/ + +/******************************************************************************* + Bit definition for Peripheral ADC +*******************************************************************************/ +/* Bit definition for ADC_STR register */ +#define ADC_STR_STRT (0x01U) + +/* Bit definition for ADC_CR0 register */ +#define ADC_CR0_MS_POS (0U) +#define ADC_CR0_MS (0x0003U) +#define ADC_CR0_MS_0 (0x0001U) +#define ADC_CR0_MS_1 (0x0002U) +#define ADC_CR0_ACCSEL_POS (4U) +#define ADC_CR0_ACCSEL (0x0030U) +#define ADC_CR0_ACCSEL_0 (0x0010U) +#define ADC_CR0_ACCSEL_1 (0x0020U) +#define ADC_CR0_CLREN_POS (6U) +#define ADC_CR0_CLREN (0x0040U) +#define ADC_CR0_DFMT_POS (7U) +#define ADC_CR0_DFMT (0x0080U) +#define ADC_CR0_AVCNT_POS (8U) +#define ADC_CR0_AVCNT (0x0700U) +#define ADC_CR0_AVCNT_0 (0x0100U) +#define ADC_CR0_AVCNT_1 (0x0200U) +#define ADC_CR0_AVCNT_2 (0x0400U) + +/* Bit definition for ADC_CR1 register */ +#define ADC_CR1_RSCHSEL_POS (2U) +#define ADC_CR1_RSCHSEL (0x0004U) + +/* Bit definition for ADC_TRGSR register */ +#define ADC_TRGSR_TRGSELA_POS (0U) +#define ADC_TRGSR_TRGSELA (0x0003U) +#define ADC_TRGSR_TRGSELA_0 (0x0001U) +#define ADC_TRGSR_TRGSELA_1 (0x0002U) +#define ADC_TRGSR_TRGENA_POS (7U) +#define ADC_TRGSR_TRGENA (0x0080U) +#define ADC_TRGSR_TRGSELB_POS (8U) +#define ADC_TRGSR_TRGSELB (0x0300U) +#define ADC_TRGSR_TRGSELB_0 (0x0100U) +#define ADC_TRGSR_TRGSELB_1 (0x0200U) +#define ADC_TRGSR_TRGENB_POS (15U) +#define ADC_TRGSR_TRGENB (0x8000U) + +/* Bit definition for ADC_CHSELRA register */ +#define ADC_CHSELRA_CHSELA (0x000FFFFFUL) + +/* Bit definition for ADC_CHSELRB register */ +#define ADC_CHSELRB_CHSELB (0x000FFFFFUL) + +/* Bit definition for ADC_AVCHSELR register */ +#define ADC_AVCHSELR_AVCHSEL (0x000FFFFFUL) + +/* Bit definition for ADC_EXCHSELR register */ +#define ADC_EXCHSELR_EXCHSEL (0x01U) + +/* Bit definition for ADC_SHCR register */ +#define ADC_SHCR_SHSST_POS (0U) +#define ADC_SHCR_SHSST (0x00FFU) +#define ADC_SHCR_SHSST_0 (0x0001U) +#define ADC_SHCR_SHSST_1 (0x0002U) +#define ADC_SHCR_SHSST_2 (0x0004U) +#define ADC_SHCR_SHSST_3 (0x0008U) +#define ADC_SHCR_SHSST_4 (0x0010U) +#define ADC_SHCR_SHSST_5 (0x0020U) +#define ADC_SHCR_SHSST_6 (0x0040U) +#define ADC_SHCR_SHSST_7 (0x0080U) +#define ADC_SHCR_SHSEL_POS (8U) +#define ADC_SHCR_SHSEL (0x0700U) +#define ADC_SHCR_SHSEL_0 (0x0100U) +#define ADC_SHCR_SHSEL_1 (0x0200U) +#define ADC_SHCR_SHSEL_2 (0x0400U) + +/* Bit definition for ADC_SSTR0 register */ +#define ADC_SSTR0 (0xFFU) + +/* Bit definition for ADC_SSTR1 register */ +#define ADC_SSTR1 (0xFFU) + +/* Bit definition for ADC_SSTR2 register */ +#define ADC_SSTR2 (0xFFU) + +/* Bit definition for ADC_SSTR3 register */ +#define ADC_SSTR3 (0xFFU) + +/* Bit definition for ADC_SSTR4 register */ +#define ADC_SSTR4 (0xFFU) + +/* Bit definition for ADC_SSTR5 register */ +#define ADC_SSTR5 (0xFFU) + +/* Bit definition for ADC_SSTR6 register */ +#define ADC_SSTR6 (0xFFU) + +/* Bit definition for ADC_SSTR7 register */ +#define ADC_SSTR7 (0xFFU) + +/* Bit definition for ADC_SSTR8 register */ +#define ADC_SSTR8 (0xFFU) + +/* Bit definition for ADC_SSTR9 register */ +#define ADC_SSTR9 (0xFFU) + +/* Bit definition for ADC_SSTR10 register */ +#define ADC_SSTR10 (0xFFU) + +/* Bit definition for ADC_SSTR11 register */ +#define ADC_SSTR11 (0xFFU) + +/* Bit definition for ADC_SSTR12 register */ +#define ADC_SSTR12 (0xFFU) + +/* Bit definition for ADC_SSTR13 register */ +#define ADC_SSTR13 (0xFFU) + +/* Bit definition for ADC_SSTR14 register */ +#define ADC_SSTR14 (0xFFU) + +/* Bit definition for ADC_SSTR15 register */ +#define ADC_SSTR15 (0xFFU) + +/* Bit definition for ADC_SSTRL register */ +#define ADC_SSTRL (0xFFU) + +/* Bit definition for ADC_CHMUXR0 register */ +#define ADC_CHMUXR0_CH00MUX_POS (0U) +#define ADC_CHMUXR0_CH00MUX (0x000FU) +#define ADC_CHMUXR0_CH00MUX_0 (0x0001U) +#define ADC_CHMUXR0_CH00MUX_1 (0x0002U) +#define ADC_CHMUXR0_CH00MUX_2 (0x0004U) +#define ADC_CHMUXR0_CH00MUX_3 (0x0008U) +#define ADC_CHMUXR0_CH01MUX_POS (4U) +#define ADC_CHMUXR0_CH01MUX (0x00F0U) +#define ADC_CHMUXR0_CH01MUX_0 (0x0010U) +#define ADC_CHMUXR0_CH01MUX_1 (0x0020U) +#define ADC_CHMUXR0_CH01MUX_2 (0x0040U) +#define ADC_CHMUXR0_CH01MUX_3 (0x0080U) +#define ADC_CHMUXR0_CH02MUX_POS (8U) +#define ADC_CHMUXR0_CH02MUX (0x0F00U) +#define ADC_CHMUXR0_CH02MUX_0 (0x0100U) +#define ADC_CHMUXR0_CH02MUX_1 (0x0200U) +#define ADC_CHMUXR0_CH02MUX_2 (0x0400U) +#define ADC_CHMUXR0_CH02MUX_3 (0x0800U) +#define ADC_CHMUXR0_CH03MUX_POS (12U) +#define ADC_CHMUXR0_CH03MUX (0xF000U) +#define ADC_CHMUXR0_CH03MUX_0 (0x1000U) +#define ADC_CHMUXR0_CH03MUX_1 (0x2000U) +#define ADC_CHMUXR0_CH03MUX_2 (0x4000U) +#define ADC_CHMUXR0_CH03MUX_3 (0x8000U) + +/* Bit definition for ADC_CHMUXR1 register */ +#define ADC_CHMUXR1_CH04MUX_POS (0U) +#define ADC_CHMUXR1_CH04MUX (0x000FU) +#define ADC_CHMUXR1_CH04MUX_0 (0x0001U) +#define ADC_CHMUXR1_CH04MUX_1 (0x0002U) +#define ADC_CHMUXR1_CH04MUX_2 (0x0004U) +#define ADC_CHMUXR1_CH04MUX_3 (0x0008U) +#define ADC_CHMUXR1_CH05MUX_POS (4U) +#define ADC_CHMUXR1_CH05MUX (0x00F0U) +#define ADC_CHMUXR1_CH05MUX_0 (0x0010U) +#define ADC_CHMUXR1_CH05MUX_1 (0x0020U) +#define ADC_CHMUXR1_CH05MUX_2 (0x0040U) +#define ADC_CHMUXR1_CH05MUX_3 (0x0080U) +#define ADC_CHMUXR1_CH06MUX_POS (8U) +#define ADC_CHMUXR1_CH06MUX (0x0F00U) +#define ADC_CHMUXR1_CH06MUX_0 (0x0100U) +#define ADC_CHMUXR1_CH06MUX_1 (0x0200U) +#define ADC_CHMUXR1_CH06MUX_2 (0x0400U) +#define ADC_CHMUXR1_CH06MUX_3 (0x0800U) +#define ADC_CHMUXR1_CH07MUX_POS (12U) +#define ADC_CHMUXR1_CH07MUX (0xF000U) +#define ADC_CHMUXR1_CH07MUX_0 (0x1000U) +#define ADC_CHMUXR1_CH07MUX_1 (0x2000U) +#define ADC_CHMUXR1_CH07MUX_2 (0x4000U) +#define ADC_CHMUXR1_CH07MUX_3 (0x8000U) + +/* Bit definition for ADC_CHMUXR2 register */ +#define ADC_CHMUXR2_CH08MUX_POS (0U) +#define ADC_CHMUXR2_CH08MUX (0x000FU) +#define ADC_CHMUXR2_CH08MUX_0 (0x0001U) +#define ADC_CHMUXR2_CH08MUX_1 (0x0002U) +#define ADC_CHMUXR2_CH08MUX_2 (0x0004U) +#define ADC_CHMUXR2_CH08MUX_3 (0x0008U) +#define ADC_CHMUXR2_CH09MUX_POS (4U) +#define ADC_CHMUXR2_CH09MUX (0x00F0U) +#define ADC_CHMUXR2_CH09MUX_0 (0x0010U) +#define ADC_CHMUXR2_CH09MUX_1 (0x0020U) +#define ADC_CHMUXR2_CH09MUX_2 (0x0040U) +#define ADC_CHMUXR2_CH09MUX_3 (0x0080U) +#define ADC_CHMUXR2_CH10MUX_POS (8U) +#define ADC_CHMUXR2_CH10MUX (0x0F00U) +#define ADC_CHMUXR2_CH10MUX_0 (0x0100U) +#define ADC_CHMUXR2_CH10MUX_1 (0x0200U) +#define ADC_CHMUXR2_CH10MUX_2 (0x0400U) +#define ADC_CHMUXR2_CH10MUX_3 (0x0800U) +#define ADC_CHMUXR2_CH11MUX_POS (12U) +#define ADC_CHMUXR2_CH11MUX (0xF000U) +#define ADC_CHMUXR2_CH11MUX_0 (0x1000U) +#define ADC_CHMUXR2_CH11MUX_1 (0x2000U) +#define ADC_CHMUXR2_CH11MUX_2 (0x4000U) +#define ADC_CHMUXR2_CH11MUX_3 (0x8000U) + +/* Bit definition for ADC_CHMUXR3 register */ +#define ADC_CHMUXR3_CH12MUX_POS (0U) +#define ADC_CHMUXR3_CH12MUX (0x000FU) +#define ADC_CHMUXR3_CH12MUX_0 (0x0001U) +#define ADC_CHMUXR3_CH12MUX_1 (0x0002U) +#define ADC_CHMUXR3_CH12MUX_2 (0x0004U) +#define ADC_CHMUXR3_CH12MUX_3 (0x0008U) +#define ADC_CHMUXR3_CH13MUX_POS (4U) +#define ADC_CHMUXR3_CH13MUX (0x00F0U) +#define ADC_CHMUXR3_CH13MUX_0 (0x0010U) +#define ADC_CHMUXR3_CH13MUX_1 (0x0020U) +#define ADC_CHMUXR3_CH13MUX_2 (0x0040U) +#define ADC_CHMUXR3_CH13MUX_3 (0x0080U) +#define ADC_CHMUXR3_CH14MUX_POS (8U) +#define ADC_CHMUXR3_CH14MUX (0x0F00U) +#define ADC_CHMUXR3_CH14MUX_0 (0x0100U) +#define ADC_CHMUXR3_CH14MUX_1 (0x0200U) +#define ADC_CHMUXR3_CH14MUX_2 (0x0400U) +#define ADC_CHMUXR3_CH14MUX_3 (0x0800U) +#define ADC_CHMUXR3_CH15MUX_POS (12U) +#define ADC_CHMUXR3_CH15MUX (0xF000U) +#define ADC_CHMUXR3_CH15MUX_0 (0x1000U) +#define ADC_CHMUXR3_CH15MUX_1 (0x2000U) +#define ADC_CHMUXR3_CH15MUX_2 (0x4000U) +#define ADC_CHMUXR3_CH15MUX_3 (0x8000U) + +/* Bit definition for ADC_ISR register */ +#define ADC_ISR_EOCAF_POS (0U) +#define ADC_ISR_EOCAF (0x01U) +#define ADC_ISR_EOCBF_POS (1U) +#define ADC_ISR_EOCBF (0x02U) +#define ADC_ISR_SASTPDF_POS (4U) +#define ADC_ISR_SASTPDF (0x10U) + +/* Bit definition for ADC_ICR register */ +#define ADC_ICR_EOCAIEN_POS (0U) +#define ADC_ICR_EOCAIEN (0x01U) +#define ADC_ICR_EOCBIEN_POS (1U) +#define ADC_ICR_EOCBIEN (0x02U) + +/* Bit definition for ADC_ISCLRR register */ +#define ADC_ISCLRR_CLREOCAF_POS (0U) +#define ADC_ISCLRR_CLREOCAF (0x01U) +#define ADC_ISCLRR_CLREOCBF_POS (1U) +#define ADC_ISCLRR_CLREOCBF (0x02U) +#define ADC_ISCLRR_CLRSASTPDF_POS (4U) +#define ADC_ISCLRR_CLRSASTPDF (0x10U) + +/* Bit definition for ADC_SYNCCR register */ +#define ADC_SYNCCR_SYNCEN_POS (0U) +#define ADC_SYNCCR_SYNCEN (0x0001U) +#define ADC_SYNCCR_SYNCMD_POS (4U) +#define ADC_SYNCCR_SYNCMD (0x0070U) +#define ADC_SYNCCR_SYNCMD_0 (0x0010U) +#define ADC_SYNCCR_SYNCMD_1 (0x0020U) +#define ADC_SYNCCR_SYNCMD_2 (0x0040U) +#define ADC_SYNCCR_SYNCDLY_POS (8U) +#define ADC_SYNCCR_SYNCDLY (0xFF00U) +#define ADC_SYNCCR_SYNCDLY_0 (0x0100U) +#define ADC_SYNCCR_SYNCDLY_1 (0x0200U) +#define ADC_SYNCCR_SYNCDLY_2 (0x0400U) +#define ADC_SYNCCR_SYNCDLY_3 (0x0800U) +#define ADC_SYNCCR_SYNCDLY_4 (0x1000U) +#define ADC_SYNCCR_SYNCDLY_5 (0x2000U) +#define ADC_SYNCCR_SYNCDLY_6 (0x4000U) +#define ADC_SYNCCR_SYNCDLY_7 (0x8000U) + +/* Bit definition for ADC_DR0 register */ +#define ADC_DR0 (0xFFFFU) + +/* Bit definition for ADC_DR1 register */ +#define ADC_DR1 (0xFFFFU) + +/* Bit definition for ADC_DR2 register */ +#define ADC_DR2 (0xFFFFU) + +/* Bit definition for ADC_DR3 register */ +#define ADC_DR3 (0xFFFFU) + +/* Bit definition for ADC_DR4 register */ +#define ADC_DR4 (0xFFFFU) + +/* Bit definition for ADC_DR5 register */ +#define ADC_DR5 (0xFFFFU) + +/* Bit definition for ADC_DR6 register */ +#define ADC_DR6 (0xFFFFU) + +/* Bit definition for ADC_DR7 register */ +#define ADC_DR7 (0xFFFFU) + +/* Bit definition for ADC_DR8 register */ +#define ADC_DR8 (0xFFFFU) + +/* Bit definition for ADC_DR9 register */ +#define ADC_DR9 (0xFFFFU) + +/* Bit definition for ADC_DR10 register */ +#define ADC_DR10 (0xFFFFU) + +/* Bit definition for ADC_DR11 register */ +#define ADC_DR11 (0xFFFFU) + +/* Bit definition for ADC_DR12 register */ +#define ADC_DR12 (0xFFFFU) + +/* Bit definition for ADC_DR13 register */ +#define ADC_DR13 (0xFFFFU) + +/* Bit definition for ADC_DR14 register */ +#define ADC_DR14 (0xFFFFU) + +/* Bit definition for ADC_DR15 register */ +#define ADC_DR15 (0xFFFFU) + +/* Bit definition for ADC_DR16 register */ +#define ADC_DR16 (0xFFFFU) + +/* Bit definition for ADC_DR17 register */ +#define ADC_DR17 (0xFFFFU) + +/* Bit definition for ADC_DR18 register */ +#define ADC_DR18 (0xFFFFU) + +/* Bit definition for ADC_DR19 register */ +#define ADC_DR19 (0xFFFFU) + +/* Bit definition for ADC_AWDCR register */ +#define ADC_AWDCR_AWD0EN_POS (0U) +#define ADC_AWDCR_AWD0EN (0x0001U) +#define ADC_AWDCR_AWD0IEN_POS (1U) +#define ADC_AWDCR_AWD0IEN (0x0002U) +#define ADC_AWDCR_AWD0MD_POS (2U) +#define ADC_AWDCR_AWD0MD (0x0004U) +#define ADC_AWDCR_AWD1EN_POS (4U) +#define ADC_AWDCR_AWD1EN (0x0010U) +#define ADC_AWDCR_AWD1IEN_POS (5U) +#define ADC_AWDCR_AWD1IEN (0x0020U) +#define ADC_AWDCR_AWD1MD_POS (6U) +#define ADC_AWDCR_AWD1MD (0x0040U) +#define ADC_AWDCR_AWDCM_POS (8U) +#define ADC_AWDCR_AWDCM (0x0300U) +#define ADC_AWDCR_AWDCM_0 (0x0100U) +#define ADC_AWDCR_AWDCM_1 (0x0200U) + +/* Bit definition for ADC_AWDSR register */ +#define ADC_AWDSR_AWD0F_POS (0U) +#define ADC_AWDSR_AWD0F (0x01U) +#define ADC_AWDSR_AWD1F_POS (1U) +#define ADC_AWDSR_AWD1F (0x02U) +#define ADC_AWDSR_AWDCMF_POS (4U) +#define ADC_AWDSR_AWDCMF (0x10U) + +/* Bit definition for ADC_AWDSCLRR register */ +#define ADC_AWDSCLRR_CLRAWD0F_POS (0U) +#define ADC_AWDSCLRR_CLRAWD0F (0x01U) +#define ADC_AWDSCLRR_CLRAWD1F_POS (1U) +#define ADC_AWDSCLRR_CLRAWD1F (0x02U) +#define ADC_AWDSCLRR_CLRAWDCMF_POS (4U) +#define ADC_AWDSCLRR_CLRAWDCMF (0x10U) + +/* Bit definition for ADC_AWD0DR0 register */ +#define ADC_AWD0DR0 (0xFFFFU) + +/* Bit definition for ADC_AWD0DR1 register */ +#define ADC_AWD0DR1 (0xFFFFU) + +/* Bit definition for ADC_AWD0CHSR register */ +#define ADC_AWD0CHSR_AWDCH (0x001FU) + +/* Bit definition for ADC_AWD1DR0 register */ +#define ADC_AWD1DR0 (0xFFFFU) + +/* Bit definition for ADC_AWD1DR1 register */ +#define ADC_AWD1DR1 (0xFFFFU) + +/* Bit definition for ADC_AWD1CHSR register */ +#define ADC_AWD1CHSR_AWDCH (0x001FU) + +/* Bit definition for ADC_PGACR1 register */ +#define ADC_PGACR1_PGACTL_POS (0U) +#define ADC_PGACR1_PGACTL (0x0FU) +#define ADC_PGACR1_PGACTL_0 (0x01U) +#define ADC_PGACR1_PGACTL_1 (0x02U) +#define ADC_PGACR1_PGACTL_2 (0x04U) +#define ADC_PGACR1_PGACTL_3 (0x08U) +#define ADC_PGACR1_PGAGAIN_POS (4U) +#define ADC_PGACR1_PGAGAIN (0xF0U) +#define ADC_PGACR1_PGAGAIN_0 (0x10U) +#define ADC_PGACR1_PGAGAIN_1 (0x20U) +#define ADC_PGACR1_PGAGAIN_2 (0x40U) +#define ADC_PGACR1_PGAGAIN_3 (0x80U) + +/* Bit definition for ADC_PGACR2 register */ +#define ADC_PGACR2_PGACTL_POS (0U) +#define ADC_PGACR2_PGACTL (0x0FU) +#define ADC_PGACR2_PGACTL_0 (0x01U) +#define ADC_PGACR2_PGACTL_1 (0x02U) +#define ADC_PGACR2_PGACTL_2 (0x04U) +#define ADC_PGACR2_PGACTL_3 (0x08U) +#define ADC_PGACR2_PGAGAIN_POS (4U) +#define ADC_PGACR2_PGAGAIN (0xF0U) +#define ADC_PGACR2_PGAGAIN_0 (0x10U) +#define ADC_PGACR2_PGAGAIN_1 (0x20U) +#define ADC_PGACR2_PGAGAIN_2 (0x40U) +#define ADC_PGACR2_PGAGAIN_3 (0x80U) + +/* Bit definition for ADC_PGACR3 register */ +#define ADC_PGACR3_PGACTL_POS (0U) +#define ADC_PGACR3_PGACTL (0x0FU) +#define ADC_PGACR3_PGACTL_0 (0x01U) +#define ADC_PGACR3_PGACTL_1 (0x02U) +#define ADC_PGACR3_PGACTL_2 (0x04U) +#define ADC_PGACR3_PGACTL_3 (0x08U) +#define ADC_PGACR3_PGAGAIN_POS (4U) +#define ADC_PGACR3_PGAGAIN (0xF0U) +#define ADC_PGACR3_PGAGAIN_0 (0x10U) +#define ADC_PGACR3_PGAGAIN_1 (0x20U) +#define ADC_PGACR3_PGAGAIN_2 (0x40U) +#define ADC_PGACR3_PGAGAIN_3 (0x80U) + +/* Bit definition for ADC_PGAVSSENR register */ +#define ADC_PGAVSSENR_PGAVSSEN (0x07U) + +/******************************************************************************* + Bit definition for Peripheral AES +*******************************************************************************/ +/* Bit definition for AES_CR register */ +#define AES_CR_START_POS (0U) +#define AES_CR_START (0x00000001UL) +#define AES_CR_MODE_POS (1U) +#define AES_CR_MODE (0x00000002UL) +#define AES_CR_KEYSIZE_POS (3U) +#define AES_CR_KEYSIZE (0x00000018UL) + +/* Bit definition for AES_DR0 register */ +#define AES_DR0 (0xFFFFFFFFUL) + +/* Bit definition for AES_DR1 register */ +#define AES_DR1 (0xFFFFFFFFUL) + +/* Bit definition for AES_DR2 register */ +#define AES_DR2 (0xFFFFFFFFUL) + +/* Bit definition for AES_DR3 register */ +#define AES_DR3 (0xFFFFFFFFUL) + +/* Bit definition for AES_KR0 register */ +#define AES_KR0 (0xFFFFFFFFUL) + +/* Bit definition for AES_KR1 register */ +#define AES_KR1 (0xFFFFFFFFUL) + +/* Bit definition for AES_KR2 register */ +#define AES_KR2 (0xFFFFFFFFUL) + +/* Bit definition for AES_KR3 register */ +#define AES_KR3 (0xFFFFFFFFUL) + +/* Bit definition for AES_KR4 register */ +#define AES_KR4 (0xFFFFFFFFUL) + +/* Bit definition for AES_KR5 register */ +#define AES_KR5 (0xFFFFFFFFUL) + +/* Bit definition for AES_KR6 register */ +#define AES_KR6 (0xFFFFFFFFUL) + +/* Bit definition for AES_KR7 register */ +#define AES_KR7 (0xFFFFFFFFUL) + +/******************************************************************************* + Bit definition for Peripheral AOS +*******************************************************************************/ +/* Bit definition for AOS_INT_SFTTRG register */ +#define AOS_INT_SFTTRG_STRG (0x00000001UL) + +/* Bit definition for AOS_DCU_1_TRGSEL register */ +#define AOS_DCU_1_TRGSEL_TRGSEL_POS (0U) +#define AOS_DCU_1_TRGSEL_TRGSEL (0x000001FFUL) +#define AOS_DCU_1_TRGSEL_COMTRG_EN_POS (30U) +#define AOS_DCU_1_TRGSEL_COMTRG_EN (0xC0000000UL) +#define AOS_DCU_1_TRGSEL_COMTRG_EN_0 (0x40000000UL) +#define AOS_DCU_1_TRGSEL_COMTRG_EN_1 (0x80000000UL) + +/* Bit definition for AOS_DCU_2_TRGSEL register */ +#define AOS_DCU_2_TRGSEL_TRGSEL_POS (0U) +#define AOS_DCU_2_TRGSEL_TRGSEL (0x000001FFUL) +#define AOS_DCU_2_TRGSEL_COMTRG_EN_POS (30U) +#define AOS_DCU_2_TRGSEL_COMTRG_EN (0xC0000000UL) +#define AOS_DCU_2_TRGSEL_COMTRG_EN_0 (0x40000000UL) +#define AOS_DCU_2_TRGSEL_COMTRG_EN_1 (0x80000000UL) + +/* Bit definition for AOS_DCU_3_TRGSEL register */ +#define AOS_DCU_3_TRGSEL_TRGSEL_POS (0U) +#define AOS_DCU_3_TRGSEL_TRGSEL (0x000001FFUL) +#define AOS_DCU_3_TRGSEL_COMTRG_EN_POS (30U) +#define AOS_DCU_3_TRGSEL_COMTRG_EN (0xC0000000UL) +#define AOS_DCU_3_TRGSEL_COMTRG_EN_0 (0x40000000UL) +#define AOS_DCU_3_TRGSEL_COMTRG_EN_1 (0x80000000UL) + +/* Bit definition for AOS_DCU_4_TRGSEL register */ +#define AOS_DCU_4_TRGSEL_TRGSEL_POS (0U) +#define AOS_DCU_4_TRGSEL_TRGSEL (0x000001FFUL) +#define AOS_DCU_4_TRGSEL_COMTRG_EN_POS (30U) +#define AOS_DCU_4_TRGSEL_COMTRG_EN (0xC0000000UL) +#define AOS_DCU_4_TRGSEL_COMTRG_EN_0 (0x40000000UL) +#define AOS_DCU_4_TRGSEL_COMTRG_EN_1 (0x80000000UL) + +/* Bit definition for AOS_DMA_1_TRGSEL register */ +#define AOS_DMA_1_TRGSEL_TRGSEL_POS (0U) +#define AOS_DMA_1_TRGSEL_TRGSEL (0x000001FFUL) +#define AOS_DMA_1_TRGSEL_COMTRG_EN_POS (30U) +#define AOS_DMA_1_TRGSEL_COMTRG_EN (0xC0000000UL) +#define AOS_DMA_1_TRGSEL_COMTRG_EN_0 (0x40000000UL) +#define AOS_DMA_1_TRGSEL_COMTRG_EN_1 (0x80000000UL) + +/* Bit definition for AOS_DMA_2_TRGSEL register */ +#define AOS_DMA_2_TRGSEL_TRGSEL_POS (0U) +#define AOS_DMA_2_TRGSEL_TRGSEL (0x000001FFUL) +#define AOS_DMA_2_TRGSEL_COMTRG_EN_POS (30U) +#define AOS_DMA_2_TRGSEL_COMTRG_EN (0xC0000000UL) +#define AOS_DMA_2_TRGSEL_COMTRG_EN_0 (0x40000000UL) +#define AOS_DMA_2_TRGSEL_COMTRG_EN_1 (0x80000000UL) + +/* Bit definition for AOS_DMA_TRGSELRC register */ +#define AOS_DMA_TRGSELRC_TRGSEL_POS (0U) +#define AOS_DMA_TRGSELRC_TRGSEL (0x000001FFUL) +#define AOS_DMA_TRGSELRC_COMTRG_EN_POS (30U) +#define AOS_DMA_TRGSELRC_COMTRG_EN (0xC0000000UL) +#define AOS_DMA_TRGSELRC_COMTRG_EN_0 (0x40000000UL) +#define AOS_DMA_TRGSELRC_COMTRG_EN_1 (0x80000000UL) + +/* Bit definition for AOS_TMR6_HTSSR register */ +#define AOS_TMR6_HTSSR_TRGSEL_POS (0U) +#define AOS_TMR6_HTSSR_TRGSEL (0x000001FFUL) +#define AOS_TMR6_HTSSR_COMTRG_EN_POS (30U) +#define AOS_TMR6_HTSSR_COMTRG_EN (0xC0000000UL) +#define AOS_TMR6_HTSSR_COMTRG_EN_0 (0x40000000UL) +#define AOS_TMR6_HTSSR_COMTRG_EN_1 (0x80000000UL) + +/* Bit definition for AOS_PORT_PEVNTTRGSR12 register */ +#define AOS_PORT_PEVNTTRGSR12_TRGSEL_POS (0U) +#define AOS_PORT_PEVNTTRGSR12_TRGSEL (0x000001FFUL) +#define AOS_PORT_PEVNTTRGSR12_COMTRG_EN_POS (30U) +#define AOS_PORT_PEVNTTRGSR12_COMTRG_EN (0xC0000000UL) +#define AOS_PORT_PEVNTTRGSR12_COMTRG_EN_0 (0x40000000UL) +#define AOS_PORT_PEVNTTRGSR12_COMTRG_EN_1 (0x80000000UL) + +/* Bit definition for AOS_PORT_PEVNTTRGSR34 register */ +#define AOS_PORT_PEVNTTRGSR34_TRGSEL_POS (0U) +#define AOS_PORT_PEVNTTRGSR34_TRGSEL (0x000001FFUL) +#define AOS_PORT_PEVNTTRGSR34_COMTRG_EN_POS (30U) +#define AOS_PORT_PEVNTTRGSR34_COMTRG_EN (0xC0000000UL) +#define AOS_PORT_PEVNTTRGSR34_COMTRG_EN_0 (0x40000000UL) +#define AOS_PORT_PEVNTTRGSR34_COMTRG_EN_1 (0x80000000UL) + +/* Bit definition for AOS_TMR0_HTSSR register */ +#define AOS_TMR0_HTSSR_TRGSEL_POS (0U) +#define AOS_TMR0_HTSSR_TRGSEL (0x000001FFUL) +#define AOS_TMR0_HTSSR_COMTRG_EN_POS (30U) +#define AOS_TMR0_HTSSR_COMTRG_EN (0xC0000000UL) +#define AOS_TMR0_HTSSR_COMTRG_EN_0 (0x40000000UL) +#define AOS_TMR0_HTSSR_COMTRG_EN_1 (0x80000000UL) + +/* Bit definition for AOS_TMR2_HTSSR register */ +#define AOS_TMR2_HTSSR_TRGSEL_POS (0U) +#define AOS_TMR2_HTSSR_TRGSEL (0x000001FFUL) +#define AOS_TMR2_HTSSR_COMTRG_EN_POS (30U) +#define AOS_TMR2_HTSSR_COMTRG_EN (0xC0000000UL) +#define AOS_TMR2_HTSSR_COMTRG_EN_0 (0x40000000UL) +#define AOS_TMR2_HTSSR_COMTRG_EN_1 (0x80000000UL) + +/* Bit definition for AOS_HASH_ITRGSELA register */ +#define AOS_HASH_ITRGSELA_TRGSEL_POS (0U) +#define AOS_HASH_ITRGSELA_TRGSEL (0x000001FFUL) +#define AOS_HASH_ITRGSELA_COMTRG_EN_POS (30U) +#define AOS_HASH_ITRGSELA_COMTRG_EN (0xC0000000UL) +#define AOS_HASH_ITRGSELA_COMTRG_EN_0 (0x40000000UL) +#define AOS_HASH_ITRGSELA_COMTRG_EN_1 (0x80000000UL) + +/* Bit definition for AOS_HASH_ITRGSELB register */ +#define AOS_HASH_ITRGSELB_TRGSEL_POS (0U) +#define AOS_HASH_ITRGSELB_TRGSEL (0x000001FFUL) +#define AOS_HASH_ITRGSELB_COMTRG_EN_POS (30U) +#define AOS_HASH_ITRGSELB_COMTRG_EN (0xC0000000UL) +#define AOS_HASH_ITRGSELB_COMTRG_EN_0 (0x40000000UL) +#define AOS_HASH_ITRGSELB_COMTRG_EN_1 (0x80000000UL) + +/* Bit definition for AOS_TMRA_HTSSR register */ +#define AOS_TMRA_HTSSR_TRGSEL_POS (0U) +#define AOS_TMRA_HTSSR_TRGSEL (0x000001FFUL) +#define AOS_TMRA_HTSSR_COMTRG_EN_POS (30U) +#define AOS_TMRA_HTSSR_COMTRG_EN (0xC0000000UL) +#define AOS_TMRA_HTSSR_COMTRG_EN_0 (0x40000000UL) +#define AOS_TMRA_HTSSR_COMTRG_EN_1 (0x80000000UL) + +/* Bit definition for AOS_OTS_TRG register */ +#define AOS_OTS_TRG_TRGSEL_POS (0U) +#define AOS_OTS_TRG_TRGSEL (0x000001FFUL) +#define AOS_OTS_TRG_COMTRG_EN_POS (30U) +#define AOS_OTS_TRG_COMTRG_EN (0xC0000000UL) +#define AOS_OTS_TRG_COMTRG_EN_0 (0x40000000UL) +#define AOS_OTS_TRG_COMTRG_EN_1 (0x80000000UL) + +/* Bit definition for AOS_ADC_1_ITRGSELR register */ +#define AOS_ADC_1_ITRGSELR_TRGSEL_POS (0U) +#define AOS_ADC_1_ITRGSELR_TRGSEL (0x000001FFUL) +#define AOS_ADC_1_ITRGSELR_COMTRG_EN_POS (30U) +#define AOS_ADC_1_ITRGSELR_COMTRG_EN (0xC0000000UL) +#define AOS_ADC_1_ITRGSELR_COMTRG_EN_0 (0x40000000UL) +#define AOS_ADC_1_ITRGSELR_COMTRG_EN_1 (0x80000000UL) + +/* Bit definition for AOS_ADC_2_ITRGSELR register */ +#define AOS_ADC_2_ITRGSELR_TRGSEL_POS (0U) +#define AOS_ADC_2_ITRGSELR_TRGSEL (0x000001FFUL) +#define AOS_ADC_2_ITRGSELR_COMTRG_EN_POS (30U) +#define AOS_ADC_2_ITRGSELR_COMTRG_EN (0xC0000000UL) +#define AOS_ADC_2_ITRGSELR_COMTRG_EN_0 (0x40000000UL) +#define AOS_ADC_2_ITRGSELR_COMTRG_EN_1 (0x80000000UL) + +/* Bit definition for AOS_ADC_3_ITRGSELR register */ +#define AOS_ADC_3_ITRGSELR_TRGSEL_POS (0U) +#define AOS_ADC_3_ITRGSELR_TRGSEL (0x000001FFUL) +#define AOS_ADC_3_ITRGSELR_COMTRG_EN_POS (30U) +#define AOS_ADC_3_ITRGSELR_COMTRG_EN (0xC0000000UL) +#define AOS_ADC_3_ITRGSELR_COMTRG_EN_0 (0x40000000UL) +#define AOS_ADC_3_ITRGSELR_COMTRG_EN_1 (0x80000000UL) + +/* Bit definition for AOS_COMTRG1 register */ +#define AOS_COMTRG1_TRGSEL (0x000001FFUL) + +/* Bit definition for AOS_COMTRG2 register */ +#define AOS_COMTRG2_TRGSEL (0x000001FFUL) + +/* Bit definition for AOS_GPIO_PEVNTDIRR register */ +#define AOS_GPIO_PEVNTDIRR_PDIR (0x0000FFFFUL) + +/* Bit definition for AOS_GPIO_PEVNTIDR register */ +#define AOS_GPIO_PEVNTIDR_PIN (0x0000FFFFUL) + +/* Bit definition for AOS_GPIO_PEVNTODR register */ +#define AOS_GPIO_PEVNTODR_POUT (0x0000FFFFUL) + +/* Bit definition for AOS_GPIO_PEVNTORR register */ +#define AOS_GPIO_PEVNTORR_POR (0x0000FFFFUL) + +/* Bit definition for AOS_GPIO_PEVNTOSR register */ +#define AOS_GPIO_PEVNTOSR_POS (0x0000FFFFUL) + +/* Bit definition for AOS_GPIO_PEVNTRISR register */ +#define AOS_GPIO_PEVNTRISR_RIS (0x0000FFFFUL) + +/* Bit definition for AOS_GPIO_PEVNTFAL register */ +#define AOS_GPIO_PEVNTFAL_FAL (0x0000FFFFUL) + +/* Bit definition for AOS_GPIO_PEVNTNFCR register */ +#define AOS_GPIO_PEVNTNFCR_NFEN1_POS (0U) +#define AOS_GPIO_PEVNTNFCR_NFEN1 (0x00000001UL) +#define AOS_GPIO_PEVNTNFCR_DIVS1_POS (1U) +#define AOS_GPIO_PEVNTNFCR_DIVS1 (0x00000006UL) +#define AOS_GPIO_PEVNTNFCR_NFEN2_POS (8U) +#define AOS_GPIO_PEVNTNFCR_NFEN2 (0x00000100UL) +#define AOS_GPIO_PEVNTNFCR_DIVS2_POS (9U) +#define AOS_GPIO_PEVNTNFCR_DIVS2 (0x00000600UL) +#define AOS_GPIO_PEVNTNFCR_NFEN3_POS (16U) +#define AOS_GPIO_PEVNTNFCR_NFEN3 (0x00010000UL) +#define AOS_GPIO_PEVNTNFCR_DIVS3_POS (17U) +#define AOS_GPIO_PEVNTNFCR_DIVS3 (0x00060000UL) +#define AOS_GPIO_PEVNTNFCR_NFEN4_POS (24U) +#define AOS_GPIO_PEVNTNFCR_NFEN4 (0x01000000UL) +#define AOS_GPIO_PEVNTNFCR_DIVS4_POS (25U) +#define AOS_GPIO_PEVNTNFCR_DIVS4 (0x06000000UL) + +/******************************************************************************* + Bit definition for Peripheral CAN +*******************************************************************************/ +/* Bit definition for CAN_RBUF register */ +#define CAN_RBUF (0xFFFFFFFFUL) + +/* Bit definition for CAN_TBUF register */ +#define CAN_TBUF (0xFFFFFFFFUL) + +/* Bit definition for CAN_CFG_STAT register */ +#define CAN_CFG_STAT_BUSOFF_POS (0U) +#define CAN_CFG_STAT_BUSOFF (0x01U) +#define CAN_CFG_STAT_TACTIVE_POS (1U) +#define CAN_CFG_STAT_TACTIVE (0x02U) +#define CAN_CFG_STAT_RACTIVE_POS (2U) +#define CAN_CFG_STAT_RACTIVE (0x04U) +#define CAN_CFG_STAT_TSSS_POS (3U) +#define CAN_CFG_STAT_TSSS (0x08U) +#define CAN_CFG_STAT_TPSS_POS (4U) +#define CAN_CFG_STAT_TPSS (0x10U) +#define CAN_CFG_STAT_LBMI_POS (5U) +#define CAN_CFG_STAT_LBMI (0x20U) +#define CAN_CFG_STAT_LBME_POS (6U) +#define CAN_CFG_STAT_LBME (0x40U) +#define CAN_CFG_STAT_RESET_POS (7U) +#define CAN_CFG_STAT_RESET (0x80U) + +/* Bit definition for CAN_TCMD register */ +#define CAN_TCMD_TSA_POS (0U) +#define CAN_TCMD_TSA (0x01U) +#define CAN_TCMD_TSALL_POS (1U) +#define CAN_TCMD_TSALL (0x02U) +#define CAN_TCMD_TSONE_POS (2U) +#define CAN_TCMD_TSONE (0x04U) +#define CAN_TCMD_TPA_POS (3U) +#define CAN_TCMD_TPA (0x08U) +#define CAN_TCMD_TPE_POS (4U) +#define CAN_TCMD_TPE (0x10U) +#define CAN_TCMD_LOM_POS (6U) +#define CAN_TCMD_LOM (0x40U) +#define CAN_TCMD_TBSEL_POS (7U) +#define CAN_TCMD_TBSEL (0x80U) + +/* Bit definition for CAN_TCTRL register */ +#define CAN_TCTRL_TSSTAT_POS (0U) +#define CAN_TCTRL_TSSTAT (0x03U) +#define CAN_TCTRL_TSSTAT_0 (0x01U) +#define CAN_TCTRL_TSSTAT_1 (0x02U) +#define CAN_TCTRL_TTTBM_POS (4U) +#define CAN_TCTRL_TTTBM (0x10U) +#define CAN_TCTRL_TSMODE_POS (5U) +#define CAN_TCTRL_TSMODE (0x20U) +#define CAN_TCTRL_TSNEXT_POS (6U) +#define CAN_TCTRL_TSNEXT (0x40U) +#define CAN_TCTRL_FD_ISO_POS (7U) +#define CAN_TCTRL_FD_ISO (0x80U) + +/* Bit definition for CAN_RCTRL register */ +#define CAN_RCTRL_RSTAT_POS (0U) +#define CAN_RCTRL_RSTAT (0x03U) +#define CAN_RCTRL_RSTAT_0 (0x01U) +#define CAN_RCTRL_RSTAT_1 (0x02U) +#define CAN_RCTRL_RBALL_POS (3U) +#define CAN_RCTRL_RBALL (0x08U) +#define CAN_RCTRL_RREL_POS (4U) +#define CAN_RCTRL_RREL (0x10U) +#define CAN_RCTRL_ROV_POS (5U) +#define CAN_RCTRL_ROV (0x20U) +#define CAN_RCTRL_ROM_POS (6U) +#define CAN_RCTRL_ROM (0x40U) +#define CAN_RCTRL_SACK_POS (7U) +#define CAN_RCTRL_SACK (0x80U) + +/* Bit definition for CAN_RTIE register */ +#define CAN_RTIE_TSFF_POS (0U) +#define CAN_RTIE_TSFF (0x01U) +#define CAN_RTIE_EIE_POS (1U) +#define CAN_RTIE_EIE (0x02U) +#define CAN_RTIE_TSIE_POS (2U) +#define CAN_RTIE_TSIE (0x04U) +#define CAN_RTIE_TPIE_POS (3U) +#define CAN_RTIE_TPIE (0x08U) +#define CAN_RTIE_RAFIE_POS (4U) +#define CAN_RTIE_RAFIE (0x10U) +#define CAN_RTIE_RFIE_POS (5U) +#define CAN_RTIE_RFIE (0x20U) +#define CAN_RTIE_ROIE_POS (6U) +#define CAN_RTIE_ROIE (0x40U) +#define CAN_RTIE_RIE_POS (7U) +#define CAN_RTIE_RIE (0x80U) + +/* Bit definition for CAN_RTIF register */ +#define CAN_RTIF_AIF_POS (0U) +#define CAN_RTIF_AIF (0x01U) +#define CAN_RTIF_EIF_POS (1U) +#define CAN_RTIF_EIF (0x02U) +#define CAN_RTIF_TSIF_POS (2U) +#define CAN_RTIF_TSIF (0x04U) +#define CAN_RTIF_TPIF_POS (3U) +#define CAN_RTIF_TPIF (0x08U) +#define CAN_RTIF_RAFIF_POS (4U) +#define CAN_RTIF_RAFIF (0x10U) +#define CAN_RTIF_RFIF_POS (5U) +#define CAN_RTIF_RFIF (0x20U) +#define CAN_RTIF_ROIF_POS (6U) +#define CAN_RTIF_ROIF (0x40U) +#define CAN_RTIF_RIF_POS (7U) +#define CAN_RTIF_RIF (0x80U) + +/* Bit definition for CAN_ERRINT register */ +#define CAN_ERRINT_BEIF_POS (0U) +#define CAN_ERRINT_BEIF (0x01U) +#define CAN_ERRINT_BEIE_POS (1U) +#define CAN_ERRINT_BEIE (0x02U) +#define CAN_ERRINT_ALIF_POS (2U) +#define CAN_ERRINT_ALIF (0x04U) +#define CAN_ERRINT_ALIE_POS (3U) +#define CAN_ERRINT_ALIE (0x08U) +#define CAN_ERRINT_EPIF_POS (4U) +#define CAN_ERRINT_EPIF (0x10U) +#define CAN_ERRINT_EPIE_POS (5U) +#define CAN_ERRINT_EPIE (0x20U) +#define CAN_ERRINT_EPASS_POS (6U) +#define CAN_ERRINT_EPASS (0x40U) +#define CAN_ERRINT_EWARN_POS (7U) +#define CAN_ERRINT_EWARN (0x80U) + +/* Bit definition for CAN_LIMIT register */ +#define CAN_LIMIT_EWL_POS (0U) +#define CAN_LIMIT_EWL (0x0FU) +#define CAN_LIMIT_EWL_0 (0x01U) +#define CAN_LIMIT_EWL_1 (0x02U) +#define CAN_LIMIT_EWL_2 (0x04U) +#define CAN_LIMIT_EWL_3 (0x08U) +#define CAN_LIMIT_AFWL_POS (4U) +#define CAN_LIMIT_AFWL (0xF0U) +#define CAN_LIMIT_AFWL_0 (0x10U) +#define CAN_LIMIT_AFWL_1 (0x20U) +#define CAN_LIMIT_AFWL_2 (0x40U) +#define CAN_LIMIT_AFWL_3 (0x80U) + +/* Bit definition for CAN_SBT register */ +#define CAN_SBT_S_SEG_1_POS (0U) +#define CAN_SBT_S_SEG_1 (0x000000FFUL) +#define CAN_SBT_S_SEG_1_0 (0x00000001UL) +#define CAN_SBT_S_SEG_1_1 (0x00000002UL) +#define CAN_SBT_S_SEG_1_2 (0x00000004UL) +#define CAN_SBT_S_SEG_1_3 (0x00000008UL) +#define CAN_SBT_S_SEG_1_4 (0x00000010UL) +#define CAN_SBT_S_SEG_1_5 (0x00000020UL) +#define CAN_SBT_S_SEG_1_6 (0x00000040UL) +#define CAN_SBT_S_SEG_1_7 (0x00000080UL) +#define CAN_SBT_S_SEG_2_POS (8U) +#define CAN_SBT_S_SEG_2 (0x00007F00UL) +#define CAN_SBT_S_SEG_2_0 (0x00000100UL) +#define CAN_SBT_S_SEG_2_1 (0x00000200UL) +#define CAN_SBT_S_SEG_2_2 (0x00000400UL) +#define CAN_SBT_S_SEG_2_3 (0x00000800UL) +#define CAN_SBT_S_SEG_2_4 (0x00001000UL) +#define CAN_SBT_S_SEG_2_5 (0x00002000UL) +#define CAN_SBT_S_SEG_2_6 (0x00004000UL) +#define CAN_SBT_S_SJW_POS (16U) +#define CAN_SBT_S_SJW (0x007F0000UL) +#define CAN_SBT_S_SJW_0 (0x00010000UL) +#define CAN_SBT_S_SJW_1 (0x00020000UL) +#define CAN_SBT_S_SJW_2 (0x00040000UL) +#define CAN_SBT_S_SJW_3 (0x00080000UL) +#define CAN_SBT_S_SJW_4 (0x00100000UL) +#define CAN_SBT_S_SJW_5 (0x00200000UL) +#define CAN_SBT_S_SJW_6 (0x00400000UL) +#define CAN_SBT_S_PRESC_POS (24U) +#define CAN_SBT_S_PRESC (0xFF000000UL) +#define CAN_SBT_S_PRESC_0 (0x01000000UL) +#define CAN_SBT_S_PRESC_1 (0x02000000UL) +#define CAN_SBT_S_PRESC_2 (0x04000000UL) +#define CAN_SBT_S_PRESC_3 (0x08000000UL) +#define CAN_SBT_S_PRESC_4 (0x10000000UL) +#define CAN_SBT_S_PRESC_5 (0x20000000UL) +#define CAN_SBT_S_PRESC_6 (0x40000000UL) +#define CAN_SBT_S_PRESC_7 (0x80000000UL) + +/* Bit definition for CAN_FBT register */ +#define CAN_FBT_F_SEG_1_POS (0U) +#define CAN_FBT_F_SEG_1 (0x0000001FUL) +#define CAN_FBT_F_SEG_1_0 (0x00000001UL) +#define CAN_FBT_F_SEG_1_1 (0x00000002UL) +#define CAN_FBT_F_SEG_1_2 (0x00000004UL) +#define CAN_FBT_F_SEG_1_3 (0x00000008UL) +#define CAN_FBT_F_SEG_1_4 (0x00000010UL) +#define CAN_FBT_F_SEG_2_POS (8U) +#define CAN_FBT_F_SEG_2 (0x00000F00UL) +#define CAN_FBT_F_SEG_2_0 (0x00000100UL) +#define CAN_FBT_F_SEG_2_1 (0x00000200UL) +#define CAN_FBT_F_SEG_2_2 (0x00000400UL) +#define CAN_FBT_F_SEG_2_3 (0x00000800UL) +#define CAN_FBT_F_SJW_POS (16U) +#define CAN_FBT_F_SJW (0x000F0000UL) +#define CAN_FBT_F_SJW_0 (0x00010000UL) +#define CAN_FBT_F_SJW_1 (0x00020000UL) +#define CAN_FBT_F_SJW_2 (0x00040000UL) +#define CAN_FBT_F_SJW_3 (0x00080000UL) +#define CAN_FBT_F_PRESC_POS (24U) +#define CAN_FBT_F_PRESC (0xFF000000UL) +#define CAN_FBT_F_PRESC_0 (0x01000000UL) +#define CAN_FBT_F_PRESC_1 (0x02000000UL) +#define CAN_FBT_F_PRESC_2 (0x04000000UL) +#define CAN_FBT_F_PRESC_3 (0x08000000UL) +#define CAN_FBT_F_PRESC_4 (0x10000000UL) +#define CAN_FBT_F_PRESC_5 (0x20000000UL) +#define CAN_FBT_F_PRESC_6 (0x40000000UL) +#define CAN_FBT_F_PRESC_7 (0x80000000UL) + +/* Bit definition for CAN_EALCAP register */ +#define CAN_EALCAP_ALC_POS (0U) +#define CAN_EALCAP_ALC (0x1FU) +#define CAN_EALCAP_ALC_0 (0x01U) +#define CAN_EALCAP_ALC_1 (0x02U) +#define CAN_EALCAP_ALC_2 (0x04U) +#define CAN_EALCAP_ALC_3 (0x08U) +#define CAN_EALCAP_ALC_4 (0x10U) +#define CAN_EALCAP_KOER_POS (5U) +#define CAN_EALCAP_KOER (0xE0U) +#define CAN_EALCAP_KOER_0 (0x20U) +#define CAN_EALCAP_KOER_1 (0x40U) +#define CAN_EALCAP_KOER_2 (0x80U) + +/* Bit definition for CAN_TDC register */ +#define CAN_TDC_SSPOFF_POS (0U) +#define CAN_TDC_SSPOFF (0x7FU) +#define CAN_TDC_SSPOFF_0 (0x01U) +#define CAN_TDC_SSPOFF_1 (0x02U) +#define CAN_TDC_SSPOFF_2 (0x04U) +#define CAN_TDC_SSPOFF_3 (0x08U) +#define CAN_TDC_SSPOFF_4 (0x10U) +#define CAN_TDC_SSPOFF_5 (0x20U) +#define CAN_TDC_SSPOFF_6 (0x40U) +#define CAN_TDC_TDCEN_POS (7U) +#define CAN_TDC_TDCEN (0x80U) + +/* Bit definition for CAN_RECNT register */ +#define CAN_RECNT (0xFFU) + +/* Bit definition for CAN_TECNT register */ +#define CAN_TECNT (0xFFU) + +/* Bit definition for CAN_ACFCTRL register */ +#define CAN_ACFCTRL_ACFADR_POS (0U) +#define CAN_ACFCTRL_ACFADR (0x0FU) +#define CAN_ACFCTRL_ACFADR_0 (0x01U) +#define CAN_ACFCTRL_ACFADR_1 (0x02U) +#define CAN_ACFCTRL_ACFADR_2 (0x04U) +#define CAN_ACFCTRL_ACFADR_3 (0x08U) +#define CAN_ACFCTRL_SELMASK_POS (5U) +#define CAN_ACFCTRL_SELMASK (0x20U) + +/* Bit definition for CAN_ACFEN register */ +#define CAN_ACFEN_AE_1_POS (0U) +#define CAN_ACFEN_AE_1 (0x0001U) +#define CAN_ACFEN_AE_2_POS (1U) +#define CAN_ACFEN_AE_2 (0x0002U) +#define CAN_ACFEN_AE_3_POS (2U) +#define CAN_ACFEN_AE_3 (0x0004U) +#define CAN_ACFEN_AE_4_POS (3U) +#define CAN_ACFEN_AE_4 (0x0008U) +#define CAN_ACFEN_AE_5_POS (4U) +#define CAN_ACFEN_AE_5 (0x0010U) +#define CAN_ACFEN_AE_6_POS (5U) +#define CAN_ACFEN_AE_6 (0x0020U) +#define CAN_ACFEN_AE_7_POS (6U) +#define CAN_ACFEN_AE_7 (0x0040U) +#define CAN_ACFEN_AE_8_POS (7U) +#define CAN_ACFEN_AE_8 (0x0080U) +#define CAN_ACFEN_AE_9_POS (8U) +#define CAN_ACFEN_AE_9 (0x0100U) +#define CAN_ACFEN_AE_10_POS (9U) +#define CAN_ACFEN_AE_10 (0x0200U) +#define CAN_ACFEN_AE_11_POS (10U) +#define CAN_ACFEN_AE_11 (0x0400U) +#define CAN_ACFEN_AE_12_POS (11U) +#define CAN_ACFEN_AE_12 (0x0800U) +#define CAN_ACFEN_AE_13_POS (12U) +#define CAN_ACFEN_AE_13 (0x1000U) +#define CAN_ACFEN_AE_14_POS (13U) +#define CAN_ACFEN_AE_14 (0x2000U) +#define CAN_ACFEN_AE_15_POS (14U) +#define CAN_ACFEN_AE_15 (0x4000U) +#define CAN_ACFEN_AE_16_POS (15U) +#define CAN_ACFEN_AE_16 (0x8000U) + +/* Bit definition for CAN_ACF register */ +#define CAN_ACF_ACODEORAMASK_POS (0U) +#define CAN_ACF_ACODEORAMASK (0x1FFFFFFFUL) +#define CAN_ACF_ACODEORAMASK_0 (0x00000001UL) +#define CAN_ACF_ACODEORAMASK_1 (0x00000002UL) +#define CAN_ACF_ACODEORAMASK_2 (0x00000004UL) +#define CAN_ACF_ACODEORAMASK_3 (0x00000008UL) +#define CAN_ACF_ACODEORAMASK_4 (0x00000010UL) +#define CAN_ACF_ACODEORAMASK_5 (0x00000020UL) +#define CAN_ACF_ACODEORAMASK_6 (0x00000040UL) +#define CAN_ACF_ACODEORAMASK_7 (0x00000080UL) +#define CAN_ACF_ACODEORAMASK_8 (0x00000100UL) +#define CAN_ACF_ACODEORAMASK_9 (0x00000200UL) +#define CAN_ACF_ACODEORAMASK_10 (0x00000400UL) +#define CAN_ACF_ACODEORAMASK_11 (0x00000800UL) +#define CAN_ACF_ACODEORAMASK_12 (0x00001000UL) +#define CAN_ACF_ACODEORAMASK_13 (0x00002000UL) +#define CAN_ACF_ACODEORAMASK_14 (0x00004000UL) +#define CAN_ACF_ACODEORAMASK_15 (0x00008000UL) +#define CAN_ACF_ACODEORAMASK_16 (0x00010000UL) +#define CAN_ACF_ACODEORAMASK_17 (0x00020000UL) +#define CAN_ACF_ACODEORAMASK_18 (0x00040000UL) +#define CAN_ACF_ACODEORAMASK_19 (0x00080000UL) +#define CAN_ACF_ACODEORAMASK_20 (0x00100000UL) +#define CAN_ACF_ACODEORAMASK_21 (0x00200000UL) +#define CAN_ACF_ACODEORAMASK_22 (0x00400000UL) +#define CAN_ACF_ACODEORAMASK_23 (0x00800000UL) +#define CAN_ACF_ACODEORAMASK_24 (0x01000000UL) +#define CAN_ACF_ACODEORAMASK_25 (0x02000000UL) +#define CAN_ACF_ACODEORAMASK_26 (0x04000000UL) +#define CAN_ACF_ACODEORAMASK_27 (0x08000000UL) +#define CAN_ACF_ACODEORAMASK_28 (0x10000000UL) +#define CAN_ACF_AIDE_POS (29U) +#define CAN_ACF_AIDE (0x20000000UL) +#define CAN_ACF_AIDEE_POS (30U) +#define CAN_ACF_AIDEE (0x40000000UL) + +/* Bit definition for CAN_TBSLOT register */ +#define CAN_TBSLOT_TBPTR_POS (0U) +#define CAN_TBSLOT_TBPTR (0x3FU) +#define CAN_TBSLOT_TBPTR_0 (0x01U) +#define CAN_TBSLOT_TBPTR_1 (0x02U) +#define CAN_TBSLOT_TBPTR_2 (0x04U) +#define CAN_TBSLOT_TBPTR_3 (0x08U) +#define CAN_TBSLOT_TBPTR_4 (0x10U) +#define CAN_TBSLOT_TBPTR_5 (0x20U) +#define CAN_TBSLOT_TBF_POS (6U) +#define CAN_TBSLOT_TBF (0x40U) +#define CAN_TBSLOT_TBE_POS (7U) +#define CAN_TBSLOT_TBE (0x80U) + +/* Bit definition for CAN_TTCFG register */ +#define CAN_TTCFG_TTEN_POS (0U) +#define CAN_TTCFG_TTEN (0x01U) +#define CAN_TTCFG_T_PRESC_POS (1U) +#define CAN_TTCFG_T_PRESC (0x06U) +#define CAN_TTCFG_T_PRESC_0 (0x02U) +#define CAN_TTCFG_T_PRESC_1 (0x04U) +#define CAN_TTCFG_TTIF_POS (3U) +#define CAN_TTCFG_TTIF (0x08U) +#define CAN_TTCFG_TTIE_POS (4U) +#define CAN_TTCFG_TTIE (0x10U) +#define CAN_TTCFG_TEIF_POS (5U) +#define CAN_TTCFG_TEIF (0x20U) +#define CAN_TTCFG_WTIF_POS (6U) +#define CAN_TTCFG_WTIF (0x40U) +#define CAN_TTCFG_WTIE_POS (7U) +#define CAN_TTCFG_WTIE (0x80U) + +/* Bit definition for CAN_REF_MSG register */ +#define CAN_REF_MSG_REF_ID_POS (0U) +#define CAN_REF_MSG_REF_ID (0x1FFFFFFFUL) +#define CAN_REF_MSG_REF_ID_0 (0x00000001UL) +#define CAN_REF_MSG_REF_ID_1 (0x00000002UL) +#define CAN_REF_MSG_REF_ID_2 (0x00000004UL) +#define CAN_REF_MSG_REF_ID_3 (0x00000008UL) +#define CAN_REF_MSG_REF_ID_4 (0x00000010UL) +#define CAN_REF_MSG_REF_ID_5 (0x00000020UL) +#define CAN_REF_MSG_REF_ID_6 (0x00000040UL) +#define CAN_REF_MSG_REF_ID_7 (0x00000080UL) +#define CAN_REF_MSG_REF_ID_8 (0x00000100UL) +#define CAN_REF_MSG_REF_ID_9 (0x00000200UL) +#define CAN_REF_MSG_REF_ID_10 (0x00000400UL) +#define CAN_REF_MSG_REF_ID_11 (0x00000800UL) +#define CAN_REF_MSG_REF_ID_12 (0x00001000UL) +#define CAN_REF_MSG_REF_ID_13 (0x00002000UL) +#define CAN_REF_MSG_REF_ID_14 (0x00004000UL) +#define CAN_REF_MSG_REF_ID_15 (0x00008000UL) +#define CAN_REF_MSG_REF_ID_16 (0x00010000UL) +#define CAN_REF_MSG_REF_ID_17 (0x00020000UL) +#define CAN_REF_MSG_REF_ID_18 (0x00040000UL) +#define CAN_REF_MSG_REF_ID_19 (0x00080000UL) +#define CAN_REF_MSG_REF_ID_20 (0x00100000UL) +#define CAN_REF_MSG_REF_ID_21 (0x00200000UL) +#define CAN_REF_MSG_REF_ID_22 (0x00400000UL) +#define CAN_REF_MSG_REF_ID_23 (0x00800000UL) +#define CAN_REF_MSG_REF_ID_24 (0x01000000UL) +#define CAN_REF_MSG_REF_ID_25 (0x02000000UL) +#define CAN_REF_MSG_REF_ID_26 (0x04000000UL) +#define CAN_REF_MSG_REF_ID_27 (0x08000000UL) +#define CAN_REF_MSG_REF_ID_28 (0x10000000UL) +#define CAN_REF_MSG_REF_IDE_POS (31U) +#define CAN_REF_MSG_REF_IDE (0x80000000UL) + +/* Bit definition for CAN_TRG_CFG register */ +#define CAN_TRG_CFG_TTPTR_POS (0U) +#define CAN_TRG_CFG_TTPTR (0x003FU) +#define CAN_TRG_CFG_TTPTR_0 (0x0001U) +#define CAN_TRG_CFG_TTPTR_1 (0x0002U) +#define CAN_TRG_CFG_TTPTR_2 (0x0004U) +#define CAN_TRG_CFG_TTPTR_3 (0x0008U) +#define CAN_TRG_CFG_TTPTR_4 (0x0010U) +#define CAN_TRG_CFG_TTPTR_5 (0x0020U) +#define CAN_TRG_CFG_TTYPE_POS (8U) +#define CAN_TRG_CFG_TTYPE (0x0700U) +#define CAN_TRG_CFG_TTYPE_0 (0x0100U) +#define CAN_TRG_CFG_TTYPE_1 (0x0200U) +#define CAN_TRG_CFG_TTYPE_2 (0x0400U) +#define CAN_TRG_CFG_TEW_POS (12U) +#define CAN_TRG_CFG_TEW (0xF000U) +#define CAN_TRG_CFG_TEW_0 (0x1000U) +#define CAN_TRG_CFG_TEW_1 (0x2000U) +#define CAN_TRG_CFG_TEW_2 (0x4000U) +#define CAN_TRG_CFG_TEW_3 (0x8000U) + +/* Bit definition for CAN_TT_TRIG register */ +#define CAN_TT_TRIG (0xFFFFU) + +/* Bit definition for CAN_TT_WTRIG register */ +#define CAN_TT_WTRIG (0xFFFFU) + +/******************************************************************************* + Bit definition for Peripheral CMP +*******************************************************************************/ +/* Bit definition for CMP_MDR register */ +#define CMP_MDR_CENB_POS (0U) +#define CMP_MDR_CENB (0x01U) +#define CMP_MDR_CWDE_POS (1U) +#define CMP_MDR_CWDE (0x02U) +#define CMP_MDR_CMON_POS (7U) +#define CMP_MDR_CMON (0x80U) + +/* Bit definition for CMP_FIR register */ +#define CMP_FIR_FCKS_POS (0U) +#define CMP_FIR_FCKS (0x03U) +#define CMP_FIR_FCKS_0 (0x01U) +#define CMP_FIR_FCKS_1 (0x02U) +#define CMP_FIR_EDGS_POS (4U) +#define CMP_FIR_EDGS (0x30U) +#define CMP_FIR_EDGS_0 (0x10U) +#define CMP_FIR_EDGS_1 (0x20U) +#define CMP_FIR_CIEN_POS (6U) +#define CMP_FIR_CIEN (0x40U) + +/* Bit definition for CMP_OCR register */ +#define CMP_OCR_COEN_POS (0U) +#define CMP_OCR_COEN (0x01U) +#define CMP_OCR_COPS_POS (1U) +#define CMP_OCR_COPS (0x02U) +#define CMP_OCR_CPOE_POS (2U) +#define CMP_OCR_CPOE (0x04U) +#define CMP_OCR_TWOE_POS (3U) +#define CMP_OCR_TWOE (0x08U) +#define CMP_OCR_TWOL_POS (4U) +#define CMP_OCR_TWOL (0x10U) + +/* Bit definition for CMP_PMSR register */ +#define CMP_PMSR_RVSL_POS (0U) +#define CMP_PMSR_RVSL (0x0FU) +#define CMP_PMSR_RVSL_0 (0x01U) +#define CMP_PMSR_RVSL_1 (0x02U) +#define CMP_PMSR_RVSL_2 (0x04U) +#define CMP_PMSR_RVSL_3 (0x08U) +#define CMP_PMSR_CVSL_POS (4U) +#define CMP_PMSR_CVSL (0xF0U) +#define CMP_PMSR_CVSL_0 (0x10U) +#define CMP_PMSR_CVSL_1 (0x20U) +#define CMP_PMSR_CVSL_2 (0x40U) +#define CMP_PMSR_CVSL_3 (0x80U) + +/* Bit definition for CMP_TWSR register */ +#define CMP_TWSR_CTWS0_POS (0U) +#define CMP_TWSR_CTWS0 (0x0001U) +#define CMP_TWSR_CTWS1_POS (1U) +#define CMP_TWSR_CTWS1 (0x0002U) +#define CMP_TWSR_CTWS2_POS (2U) +#define CMP_TWSR_CTWS2 (0x0004U) +#define CMP_TWSR_CTWS3_POS (3U) +#define CMP_TWSR_CTWS3 (0x0008U) +#define CMP_TWSR_CTWS4_POS (4U) +#define CMP_TWSR_CTWS4 (0x0010U) +#define CMP_TWSR_CTWS5_POS (5U) +#define CMP_TWSR_CTWS5 (0x0020U) +#define CMP_TWSR_CTWS6_POS (6U) +#define CMP_TWSR_CTWS6 (0x0040U) +#define CMP_TWSR_CTWS7_POS (7U) +#define CMP_TWSR_CTWS7 (0x0080U) +#define CMP_TWSR_CTWS8_POS (8U) +#define CMP_TWSR_CTWS8 (0x0100U) +#define CMP_TWSR_CTWS9_POS (9U) +#define CMP_TWSR_CTWS9 (0x0200U) +#define CMP_TWSR_CTWS10_POS (10U) +#define CMP_TWSR_CTWS10 (0x0400U) +#define CMP_TWSR_CTWS11_POS (11U) +#define CMP_TWSR_CTWS11 (0x0800U) +#define CMP_TWSR_CTWS12_POS (12U) +#define CMP_TWSR_CTWS12 (0x1000U) +#define CMP_TWSR_CTWS13_POS (13U) +#define CMP_TWSR_CTWS13 (0x2000U) +#define CMP_TWSR_CTWS14_POS (14U) +#define CMP_TWSR_CTWS14 (0x4000U) +#define CMP_TWSR_CTWS15_POS (15U) +#define CMP_TWSR_CTWS15 (0x8000U) + +/* Bit definition for CMP_TWPR register */ +#define CMP_TWPR_CTWP0_POS (0U) +#define CMP_TWPR_CTWP0 (0x0001U) +#define CMP_TWPR_CTWP1_POS (1U) +#define CMP_TWPR_CTWP1 (0x0002U) +#define CMP_TWPR_CTWP2_POS (2U) +#define CMP_TWPR_CTWP2 (0x0004U) +#define CMP_TWPR_CTWP3_POS (3U) +#define CMP_TWPR_CTWP3 (0x0008U) +#define CMP_TWPR_CTWP4_POS (4U) +#define CMP_TWPR_CTWP4 (0x0010U) +#define CMP_TWPR_CTWP5_POS (5U) +#define CMP_TWPR_CTWP5 (0x0020U) +#define CMP_TWPR_CTWP6_POS (6U) +#define CMP_TWPR_CTWP6 (0x0040U) +#define CMP_TWPR_CTWP7_POS (7U) +#define CMP_TWPR_CTWP7 (0x0080U) +#define CMP_TWPR_CTWP8_POS (8U) +#define CMP_TWPR_CTWP8 (0x0100U) +#define CMP_TWPR_CTWP9_POS (9U) +#define CMP_TWPR_CTWP9 (0x0200U) +#define CMP_TWPR_CTWP10_POS (10U) +#define CMP_TWPR_CTWP10 (0x0400U) +#define CMP_TWPR_CTWP11_POS (11U) +#define CMP_TWPR_CTWP11 (0x0800U) +#define CMP_TWPR_CTWP12_POS (12U) +#define CMP_TWPR_CTWP12 (0x1000U) +#define CMP_TWPR_CTWP13_POS (13U) +#define CMP_TWPR_CTWP13 (0x2000U) +#define CMP_TWPR_CTWP14_POS (14U) +#define CMP_TWPR_CTWP14 (0x4000U) +#define CMP_TWPR_CTWP15_POS (15U) +#define CMP_TWPR_CTWP15 (0x8000U) + +/* Bit definition for CMP_VISR register */ +#define CMP_VISR_P2SL_POS (0U) +#define CMP_VISR_P2SL (0x0007U) +#define CMP_VISR_P2SL_0 (0x0001U) +#define CMP_VISR_P2SL_1 (0x0002U) +#define CMP_VISR_P2SL_2 (0x0004U) +#define CMP_VISR_P3SL_POS (4U) +#define CMP_VISR_P3SL (0x0030U) +#define CMP_VISR_P3SL_0 (0x0010U) +#define CMP_VISR_P3SL_1 (0x0020U) + +/******************************************************************************* + Bit definition for Peripheral CMU +*******************************************************************************/ +/* Bit definition for CMU_XTAL32CR register */ +#define CMU_XTAL32CR_XTAL32STP (0x01U) + +/* Bit definition for CMU_XTAL32CFGR register */ +#define CMU_XTAL32CFGR_XTAL32DRV (0x07U) + +/* Bit definition for CMU_XTAL32NFR register */ +#define CMU_XTAL32NFR_XTAL32NF (0x03U) + +/* Bit definition for CMU_LRCCR register */ +#define CMU_LRCCR_LRCSTP (0x01U) + +/* Bit definition for CMU_RTCLRCCR register */ +#define CMU_RTCLRCCR_RTCLRCSTP (0x01U) + +/* Bit definition for CMU_LRCTRM register */ +#define CMU_LRCTRM (0xFFU) + +/* Bit definition for CMU_RTCLRCTRM register */ +#define CMU_RTCLRCTRM (0xFFU) + +/* Bit definition for CMU_XTALCFGR register */ +#define CMU_XTALCFGR_XTALDRV_POS (4U) +#define CMU_XTALCFGR_XTALDRV (0x30U) +#define CMU_XTALCFGR_XTALMS_POS (6U) +#define CMU_XTALCFGR_XTALMS (0x40U) + +/* Bit definition for CMU_PERICKSEL register */ +#define CMU_PERICKSEL_PERICKSEL (0x000FU) + +/* Bit definition for CMU_I2SCKSEL register */ +#define CMU_I2SCKSEL_I2S1CKSEL_POS (0U) +#define CMU_I2SCKSEL_I2S1CKSEL (0x000FU) +#define CMU_I2SCKSEL_I2S2CKSEL_POS (4U) +#define CMU_I2SCKSEL_I2S2CKSEL (0x00F0U) +#define CMU_I2SCKSEL_I2S3CKSEL_POS (8U) +#define CMU_I2SCKSEL_I2S3CKSEL (0x0F00U) +#define CMU_I2SCKSEL_I2S4CKSEL_POS (12U) +#define CMU_I2SCKSEL_I2S4CKSEL (0xF000U) + +/* Bit definition for CMU_CANCKCFGR register */ +#define CMU_CANCKCFGR_CAN1CKS_POS (0U) +#define CMU_CANCKCFGR_CAN1CKS (0x0FU) +#define CMU_CANCKCFGR_CAN2CKS_POS (4U) +#define CMU_CANCKCFGR_CAN2CKS (0xF0U) + +/* Bit definition for CMU_SCFGR register */ +#define CMU_SCFGR_PCLK0S_POS (0U) +#define CMU_SCFGR_PCLK0S (0x00000007UL) +#define CMU_SCFGR_PCLK1S_POS (4U) +#define CMU_SCFGR_PCLK1S (0x00000070UL) +#define CMU_SCFGR_PCLK2S_POS (8U) +#define CMU_SCFGR_PCLK2S (0x00000700UL) +#define CMU_SCFGR_PCLK3S_POS (12U) +#define CMU_SCFGR_PCLK3S (0x00007000UL) +#define CMU_SCFGR_PCLK4S_POS (16U) +#define CMU_SCFGR_PCLK4S (0x00070000UL) +#define CMU_SCFGR_EXCKS_POS (20U) +#define CMU_SCFGR_EXCKS (0x00700000UL) +#define CMU_SCFGR_HCLKS_POS (24U) +#define CMU_SCFGR_HCLKS (0x07000000UL) + +/* Bit definition for CMU_USBCKCFGR register */ +#define CMU_USBCKCFGR_USBCKS_POS (4U) +#define CMU_USBCKCFGR_USBCKS (0xF0U) + +/* Bit definition for CMU_CKSWR register */ +#define CMU_CKSWR_CKSW (0x07U) + +/* Bit definition for CMU_PLLHCR register */ +#define CMU_PLLHCR_PLLHOFF (0x01U) + +/* Bit definition for CMU_PLLACR register */ +#define CMU_PLLACR_PLLAOFF (0x01U) + +/* Bit definition for CMU_XTALCR register */ +#define CMU_XTALCR_XTALSTP (0x01U) + +/* Bit definition for CMU_HRCCR register */ +#define CMU_HRCCR_HRCSTP (0x01U) + +/* Bit definition for CMU_MRCCR register */ +#define CMU_MRCCR_MRCSTP (0x01U) + +/* Bit definition for CMU_OSCSTBSR register */ +#define CMU_OSCSTBSR_HRCSTBF_POS (0U) +#define CMU_OSCSTBSR_HRCSTBF (0x01U) +#define CMU_OSCSTBSR_XTALSTBF_POS (3U) +#define CMU_OSCSTBSR_XTALSTBF (0x08U) +#define CMU_OSCSTBSR_PLLHSTBF_POS (5U) +#define CMU_OSCSTBSR_PLLHSTBF (0x20U) +#define CMU_OSCSTBSR_PLLASTBF_POS (6U) +#define CMU_OSCSTBSR_PLLASTBF (0x40U) +#define CMU_OSCSTBSR_PLLBSTBF_POS (7U) +#define CMU_OSCSTBSR_PLLBSTBF (0x80U) + +/* Bit definition for CMU_MCO1CFGR register */ +#define CMU_MCO1CFGR_MCO1SEL_POS (0U) +#define CMU_MCO1CFGR_MCO1SEL (0x0FU) +#define CMU_MCO1CFGR_MCO1DIV_POS (4U) +#define CMU_MCO1CFGR_MCO1DIV (0x70U) +#define CMU_MCO1CFGR_MCO1EN_POS (7U) +#define CMU_MCO1CFGR_MCO1EN (0x80U) + +/* Bit definition for CMU_MCO2CFGR register */ +#define CMU_MCO2CFGR_MCO2SEL_POS (0U) +#define CMU_MCO2CFGR_MCO2SEL (0x0FU) +#define CMU_MCO2CFGR_MCO2DIV_POS (4U) +#define CMU_MCO2CFGR_MCO2DIV (0x70U) +#define CMU_MCO2CFGR_MCO2EN_POS (7U) +#define CMU_MCO2CFGR_MCO2EN (0x80U) + +/* Bit definition for CMU_TPIUCKCFGR register */ +#define CMU_TPIUCKCFGR_TPIUCKS_POS (0U) +#define CMU_TPIUCKCFGR_TPIUCKS (0x03U) +#define CMU_TPIUCKCFGR_TPIUCKOE_POS (7U) +#define CMU_TPIUCKCFGR_TPIUCKOE (0x80U) + +/* Bit definition for CMU_XTALSTDCR register */ +#define CMU_XTALSTDCR_XTALSTDIE_POS (0U) +#define CMU_XTALSTDCR_XTALSTDIE (0x01U) +#define CMU_XTALSTDCR_XTALSTDRE_POS (1U) +#define CMU_XTALSTDCR_XTALSTDRE (0x02U) +#define CMU_XTALSTDCR_XTALSTDRIS_POS (2U) +#define CMU_XTALSTDCR_XTALSTDRIS (0x04U) +#define CMU_XTALSTDCR_XTALSTDE_POS (7U) +#define CMU_XTALSTDCR_XTALSTDE (0x80U) + +/* Bit definition for CMU_XTALSTDSR register */ +#define CMU_XTALSTDSR_XTALSTDF (0x01U) + +/* Bit definition for CMU_MRCTRM register */ +#define CMU_MRCTRM (0xFFU) + +/* Bit definition for CMU_HRCTRM register */ +#define CMU_HRCTRM (0xFFU) + +/* Bit definition for CMU_XTALSTBCR register */ +#define CMU_XTALSTBCR_XTALSTB (0x0FU) + +/* Bit definition for CMU_PLLHCFGR register */ +#define CMU_PLLHCFGR_PLLHM_POS (0U) +#define CMU_PLLHCFGR_PLLHM (0x00000003UL) +#define CMU_PLLHCFGR_PLLSRC_POS (7U) +#define CMU_PLLHCFGR_PLLSRC (0x00000080UL) +#define CMU_PLLHCFGR_PLLHN_POS (8U) +#define CMU_PLLHCFGR_PLLHN (0x0001FF00UL) +#define CMU_PLLHCFGR_PLLHR_POS (20U) +#define CMU_PLLHCFGR_PLLHR (0x00F00000UL) +#define CMU_PLLHCFGR_PLLHQ_POS (24U) +#define CMU_PLLHCFGR_PLLHQ (0x0F000000UL) +#define CMU_PLLHCFGR_PLLHP_POS (28U) +#define CMU_PLLHCFGR_PLLHP (0xF0000000UL) + +/* Bit definition for CMU_PLLACFGR register */ +#define CMU_PLLACFGR_PLLAM_POS (0U) +#define CMU_PLLACFGR_PLLAM (0x0000001FUL) +#define CMU_PLLACFGR_PLLAN_POS (8U) +#define CMU_PLLACFGR_PLLAN (0x0001FF00UL) +#define CMU_PLLACFGR_PLLAR_POS (20U) +#define CMU_PLLACFGR_PLLAR (0x00F00000UL) +#define CMU_PLLACFGR_PLLAQ_POS (24U) +#define CMU_PLLACFGR_PLLAQ (0x0F000000UL) +#define CMU_PLLACFGR_PLLAP_POS (28U) +#define CMU_PLLACFGR_PLLAP (0xF0000000UL) + +/******************************************************************************* + Bit definition for Peripheral CRC +*******************************************************************************/ +/* Bit definition for CRC_CR register */ +#define CRC_CR_CR_POS (0U) +#define CRC_CR_CR (0x00000001UL) +#define CRC_CR_FLAG_POS (1U) +#define CRC_CR_FLAG (0x00000002UL) + +/* Bit definition for CRC_RESLT register */ +#define CRC_RESLT (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT0 register */ +#define CRC_DAT0 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT1 register */ +#define CRC_DAT1 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT2 register */ +#define CRC_DAT2 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT3 register */ +#define CRC_DAT3 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT4 register */ +#define CRC_DAT4 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT5 register */ +#define CRC_DAT5 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT6 register */ +#define CRC_DAT6 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT7 register */ +#define CRC_DAT7 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT8 register */ +#define CRC_DAT8 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT9 register */ +#define CRC_DAT9 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT10 register */ +#define CRC_DAT10 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT11 register */ +#define CRC_DAT11 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT12 register */ +#define CRC_DAT12 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT13 register */ +#define CRC_DAT13 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT14 register */ +#define CRC_DAT14 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT15 register */ +#define CRC_DAT15 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT16 register */ +#define CRC_DAT16 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT17 register */ +#define CRC_DAT17 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT18 register */ +#define CRC_DAT18 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT19 register */ +#define CRC_DAT19 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT20 register */ +#define CRC_DAT20 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT21 register */ +#define CRC_DAT21 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT22 register */ +#define CRC_DAT22 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT23 register */ +#define CRC_DAT23 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT24 register */ +#define CRC_DAT24 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT25 register */ +#define CRC_DAT25 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT26 register */ +#define CRC_DAT26 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT27 register */ +#define CRC_DAT27 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT28 register */ +#define CRC_DAT28 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT29 register */ +#define CRC_DAT29 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT30 register */ +#define CRC_DAT30 (0xFFFFFFFFUL) + +/* Bit definition for CRC_DAT31 register */ +#define CRC_DAT31 (0xFFFFFFFFUL) + +/******************************************************************************* + Bit definition for Peripheral CTC +*******************************************************************************/ +/* Bit definition for CTC_CR1 register */ +#define CTC_CR1_REFPSC_POS (0U) +#define CTC_CR1_REFPSC (0x00000007UL) +#define CTC_CR1_REFPSC_0 (0x00000001UL) +#define CTC_CR1_REFPSC_1 (0x00000002UL) +#define CTC_CR1_REFPSC_2 (0x00000004UL) +#define CTC_CR1_REFCKS_POS (4U) +#define CTC_CR1_REFCKS (0x00000030UL) +#define CTC_CR1_REFCKS_0 (0x00000010UL) +#define CTC_CR1_REFCKS_1 (0x00000020UL) +#define CTC_CR1_ERRIE_POS (6U) +#define CTC_CR1_ERRIE (0x00000040UL) +#define CTC_CR1_CTCEN_POS (7U) +#define CTC_CR1_CTCEN (0x00000080UL) +#define CTC_CR1_TRMVAL_POS (16U) +#define CTC_CR1_TRMVAL (0x003F0000UL) + +/* Bit definition for CTC_CR2 register */ +#define CTC_CR2_OFSVAL_POS (0U) +#define CTC_CR2_OFSVAL (0x000000FFUL) +#define CTC_CR2_OFSVAL_0 (0x00000001UL) +#define CTC_CR2_OFSVAL_1 (0x00000002UL) +#define CTC_CR2_OFSVAL_2 (0x00000004UL) +#define CTC_CR2_OFSVAL_3 (0x00000008UL) +#define CTC_CR2_OFSVAL_4 (0x00000010UL) +#define CTC_CR2_OFSVAL_5 (0x00000020UL) +#define CTC_CR2_OFSVAL_6 (0x00000040UL) +#define CTC_CR2_OFSVAL_7 (0x00000080UL) +#define CTC_CR2_RLDVAL_POS (16U) +#define CTC_CR2_RLDVAL (0xFFFF0000UL) + +/* Bit definition for CTC_STR register */ +#define CTC_STR_TRIMOK_POS (0U) +#define CTC_STR_TRIMOK (0x00000001UL) +#define CTC_STR_TRMOVF_POS (1U) +#define CTC_STR_TRMOVF (0x00000002UL) +#define CTC_STR_TRMUDF_POS (2U) +#define CTC_STR_TRMUDF (0x00000004UL) +#define CTC_STR_CTCBSY_POS (3U) +#define CTC_STR_CTCBSY (0x00000008UL) + +/******************************************************************************* + Bit definition for Peripheral DAC +*******************************************************************************/ +/* Bit definition for DAC_DADR1 register */ +#define DAC_DADR1_DR0_POS (0U) +#define DAC_DADR1_DR0 (0x0001U) +#define DAC_DADR1_DR1_POS (1U) +#define DAC_DADR1_DR1 (0x0002U) +#define DAC_DADR1_DR2_POS (2U) +#define DAC_DADR1_DR2 (0x0004U) +#define DAC_DADR1_DR3_POS (3U) +#define DAC_DADR1_DR3 (0x0008U) +#define DAC_DADR1_DL0R4_POS (4U) +#define DAC_DADR1_DL0R4 (0x0010U) +#define DAC_DADR1_DL1R5_POS (5U) +#define DAC_DADR1_DL1R5 (0x0020U) +#define DAC_DADR1_DL2R6_POS (6U) +#define DAC_DADR1_DL2R6 (0x0040U) +#define DAC_DADR1_DL3R7_POS (7U) +#define DAC_DADR1_DL3R7 (0x0080U) +#define DAC_DADR1_DL4R8_POS (8U) +#define DAC_DADR1_DL4R8 (0x0100U) +#define DAC_DADR1_DL5R9_POS (9U) +#define DAC_DADR1_DL5R9 (0x0200U) +#define DAC_DADR1_DL6R10_POS (10U) +#define DAC_DADR1_DL6R10 (0x0400U) +#define DAC_DADR1_DL7R11_POS (11U) +#define DAC_DADR1_DL7R11 (0x0800U) +#define DAC_DADR1_DL8_POS (12U) +#define DAC_DADR1_DL8 (0x1000U) +#define DAC_DADR1_DL9_POS (13U) +#define DAC_DADR1_DL9 (0x2000U) +#define DAC_DADR1_DL10_POS (14U) +#define DAC_DADR1_DL10 (0x4000U) +#define DAC_DADR1_DL11_POS (15U) +#define DAC_DADR1_DL11 (0x8000U) + +/* Bit definition for DAC_DADR2 register */ +#define DAC_DADR2_DR0_POS (0U) +#define DAC_DADR2_DR0 (0x0001U) +#define DAC_DADR2_DR1_POS (1U) +#define DAC_DADR2_DR1 (0x0002U) +#define DAC_DADR2_DR2_POS (2U) +#define DAC_DADR2_DR2 (0x0004U) +#define DAC_DADR2_DR3_POS (3U) +#define DAC_DADR2_DR3 (0x0008U) +#define DAC_DADR2_DL0R4_POS (4U) +#define DAC_DADR2_DL0R4 (0x0010U) +#define DAC_DADR2_DL1R5_POS (5U) +#define DAC_DADR2_DL1R5 (0x0020U) +#define DAC_DADR2_DL2R6_POS (6U) +#define DAC_DADR2_DL2R6 (0x0040U) +#define DAC_DADR2_DL3R7_POS (7U) +#define DAC_DADR2_DL3R7 (0x0080U) +#define DAC_DADR2_DL4R8_POS (8U) +#define DAC_DADR2_DL4R8 (0x0100U) +#define DAC_DADR2_DL5R9_POS (9U) +#define DAC_DADR2_DL5R9 (0x0200U) +#define DAC_DADR2_DL6R10_POS (10U) +#define DAC_DADR2_DL6R10 (0x0400U) +#define DAC_DADR2_DL7R11_POS (11U) +#define DAC_DADR2_DL7R11 (0x0800U) +#define DAC_DADR2_DL8_POS (12U) +#define DAC_DADR2_DL8 (0x1000U) +#define DAC_DADR2_DL9_POS (13U) +#define DAC_DADR2_DL9 (0x2000U) +#define DAC_DADR2_DL10_POS (14U) +#define DAC_DADR2_DL10 (0x4000U) +#define DAC_DADR2_DL11_POS (15U) +#define DAC_DADR2_DL11 (0x8000U) + +/* Bit definition for DAC_DACR register */ +#define DAC_DACR_DAE_POS (0U) +#define DAC_DACR_DAE (0x0001U) +#define DAC_DACR_DA1E_POS (1U) +#define DAC_DACR_DA1E (0x0002U) +#define DAC_DACR_DA2E_POS (2U) +#define DAC_DACR_DA2E (0x0004U) +#define DAC_DACR_DPSEL_POS (8U) +#define DAC_DACR_DPSEL (0x0100U) +#define DAC_DACR_DAAMP1_POS (9U) +#define DAC_DACR_DAAMP1 (0x0200U) +#define DAC_DACR_DAAMP2_POS (10U) +#define DAC_DACR_DAAMP2 (0x0400U) +#define DAC_DACR_EXTDSL1_POS (11U) +#define DAC_DACR_EXTDSL1 (0x0800U) +#define DAC_DACR_EXTDSL2_POS (12U) +#define DAC_DACR_EXTDSL2 (0x1000U) + +/* Bit definition for DAC_DAADPCR register */ +#define DAC_DAADPCR_ADPSL1_POS (0U) +#define DAC_DAADPCR_ADPSL1 (0x0001U) +#define DAC_DAADPCR_ADPSL2_POS (1U) +#define DAC_DAADPCR_ADPSL2 (0x0002U) +#define DAC_DAADPCR_ADPSL3_POS (2U) +#define DAC_DAADPCR_ADPSL3 (0x0004U) +#define DAC_DAADPCR_DA1SF_POS (8U) +#define DAC_DAADPCR_DA1SF (0x0100U) +#define DAC_DAADPCR_DA2SF_POS (9U) +#define DAC_DAADPCR_DA2SF (0x0200U) +#define DAC_DAADPCR_ADPEN_POS (15U) +#define DAC_DAADPCR_ADPEN (0x8000U) + +/* Bit definition for DAC_DAOCR register */ +#define DAC_DAOCR_DAODIS1_POS (14U) +#define DAC_DAOCR_DAODIS1 (0x4000U) +#define DAC_DAOCR_DAODIS2_POS (15U) +#define DAC_DAOCR_DAODIS2 (0x8000U) + +/******************************************************************************* + Bit definition for Peripheral DBGC +*******************************************************************************/ +/* Bit definition for DBGC_AUTHID0 register */ +#define DBGC_AUTHID0 (0xFFFFFFFFUL) + +/* Bit definition for DBGC_AUTHID1 register */ +#define DBGC_AUTHID1 (0xFFFFFFFFUL) + +/* Bit definition for DBGC_AUTHID2 register */ +#define DBGC_AUTHID2 (0xFFFFFFFFUL) + +/* Bit definition for DBGC_RESV0 register */ +#define DBGC_RESV0 (0xFFFFFFFFUL) + +/* Bit definition for DBGC_MCUSTAT register */ +#define DBGC_MCUSTAT_AUTH_POS (0U) +#define DBGC_MCUSTAT_AUTH (0x00000001UL) +#define DBGC_MCUSTAT_REMVLOCK_POS (1U) +#define DBGC_MCUSTAT_REMVLOCK (0x00000002UL) +#define DBGC_MCUSTAT_SAFTYLOCK1_POS (2U) +#define DBGC_MCUSTAT_SAFTYLOCK1 (0x00000004UL) +#define DBGC_MCUSTAT_SAFTYLOCK2_POS (3U) +#define DBGC_MCUSTAT_SAFTYLOCK2 (0x00000008UL) +#define DBGC_MCUSTAT_CPUSTOP_POS (8U) +#define DBGC_MCUSTAT_CPUSTOP (0x00000100UL) +#define DBGC_MCUSTAT_CPUSLEEP_POS (9U) +#define DBGC_MCUSTAT_CPUSLEEP (0x00000200UL) + +/* Bit definition for DBGC_MCUCTL register */ +#define DBGC_MCUCTL_EDBGRQ_POS (0U) +#define DBGC_MCUCTL_EDBGRQ (0x00000001UL) +#define DBGC_MCUCTL_RESTART_POS (1U) +#define DBGC_MCUCTL_RESTART (0x00000002UL) +#define DBGC_MCUCTL_DIRQ_POS (8U) +#define DBGC_MCUCTL_DIRQ (0x00000100UL) + +/* Bit definition for DBGC_FMCCTL register */ +#define DBGC_FMCCTL_ERASEREQ_POS (0U) +#define DBGC_FMCCTL_ERASEREQ (0x00000001UL) +#define DBGC_FMCCTL_ERASEACK_POS (1U) +#define DBGC_FMCCTL_ERASEACK (0x00000002UL) +#define DBGC_FMCCTL_ERASEERR_POS (2U) +#define DBGC_FMCCTL_ERASEERR (0x00000004UL) + +/* Bit definition for DBGC_MCUDBGCSTAT register */ +#define DBGC_MCUDBGCSTAT_CDBGPWRUPREQ_POS (0U) +#define DBGC_MCUDBGCSTAT_CDBGPWRUPREQ (0x00000001UL) +#define DBGC_MCUDBGCSTAT_CDBGPWRUPACK_POS (1U) +#define DBGC_MCUDBGCSTAT_CDBGPWRUPACK (0x00000002UL) + +/* Bit definition for DBGC_MCUSTPCTL register */ +#define DBGC_MCUSTPCTL_SWDTSTP_POS (0U) +#define DBGC_MCUSTPCTL_SWDTSTP (0x00000001UL) +#define DBGC_MCUSTPCTL_WDTSTP_POS (1U) +#define DBGC_MCUSTPCTL_WDTSTP (0x00000002UL) +#define DBGC_MCUSTPCTL_RTCSTP_POS (2U) +#define DBGC_MCUSTPCTL_RTCSTP (0x00000004UL) +#define DBGC_MCUSTPCTL_PVD0STP_POS (3U) +#define DBGC_MCUSTPCTL_PVD0STP (0x00000008UL) +#define DBGC_MCUSTPCTL_PVD1STP_POS (4U) +#define DBGC_MCUSTPCTL_PVD1STP (0x00000010UL) +#define DBGC_MCUSTPCTL_PVD2STP_POS (5U) +#define DBGC_MCUSTPCTL_PVD2STP (0x00000020UL) +#define DBGC_MCUSTPCTL_M06STP_POS (6U) +#define DBGC_MCUSTPCTL_M06STP (0x00000040UL) +#define DBGC_MCUSTPCTL_M07STP_POS (7U) +#define DBGC_MCUSTPCTL_M07STP (0x00000080UL) +#define DBGC_MCUSTPCTL_M08STP_POS (8U) +#define DBGC_MCUSTPCTL_M08STP (0x00000100UL) +#define DBGC_MCUSTPCTL_M09STP_POS (9U) +#define DBGC_MCUSTPCTL_M09STP (0x00000200UL) +#define DBGC_MCUSTPCTL_M10STP_POS (10U) +#define DBGC_MCUSTPCTL_M10STP (0x00000400UL) +#define DBGC_MCUSTPCTL_M11STP_POS (11U) +#define DBGC_MCUSTPCTL_M11STP (0x00000800UL) +#define DBGC_MCUSTPCTL_M12STP_POS (12U) +#define DBGC_MCUSTPCTL_M12STP (0x00001000UL) +#define DBGC_MCUSTPCTL_M13STP_POS (13U) +#define DBGC_MCUSTPCTL_M13STP (0x00002000UL) +#define DBGC_MCUSTPCTL_M14STP_POS (14U) +#define DBGC_MCUSTPCTL_M14STP (0x00004000UL) +#define DBGC_MCUSTPCTL_M15STP_POS (15U) +#define DBGC_MCUSTPCTL_M15STP (0x00008000UL) +#define DBGC_MCUSTPCTL_M16STP_POS (16U) +#define DBGC_MCUSTPCTL_M16STP (0x00010000UL) +#define DBGC_MCUSTPCTL_M17STP_POS (17U) +#define DBGC_MCUSTPCTL_M17STP (0x00020000UL) +#define DBGC_MCUSTPCTL_M18STP_POS (18U) +#define DBGC_MCUSTPCTL_M18STP (0x00040000UL) +#define DBGC_MCUSTPCTL_M19STP_POS (19U) +#define DBGC_MCUSTPCTL_M19STP (0x00080000UL) +#define DBGC_MCUSTPCTL_M20STP_POS (20U) +#define DBGC_MCUSTPCTL_M20STP (0x00100000UL) +#define DBGC_MCUSTPCTL_M21STP_POS (21U) +#define DBGC_MCUSTPCTL_M21STP (0x00200000UL) +#define DBGC_MCUSTPCTL_M22STP_POS (22U) +#define DBGC_MCUSTPCTL_M22STP (0x00400000UL) +#define DBGC_MCUSTPCTL_M23STP_POS (23U) +#define DBGC_MCUSTPCTL_M23STP (0x00800000UL) +#define DBGC_MCUSTPCTL_M24STP_POS (24U) +#define DBGC_MCUSTPCTL_M24STP (0x01000000UL) +#define DBGC_MCUSTPCTL_M25STP_POS (25U) +#define DBGC_MCUSTPCTL_M25STP (0x02000000UL) +#define DBGC_MCUSTPCTL_M26STP_POS (26U) +#define DBGC_MCUSTPCTL_M26STP (0x04000000UL) +#define DBGC_MCUSTPCTL_M27STP_POS (27U) +#define DBGC_MCUSTPCTL_M27STP (0x08000000UL) +#define DBGC_MCUSTPCTL_M28STP_POS (28U) +#define DBGC_MCUSTPCTL_M28STP (0x10000000UL) +#define DBGC_MCUSTPCTL_M29STP_POS (29U) +#define DBGC_MCUSTPCTL_M29STP (0x20000000UL) +#define DBGC_MCUSTPCTL_M30STP_POS (30U) +#define DBGC_MCUSTPCTL_M30STP (0x40000000UL) +#define DBGC_MCUSTPCTL_M31STP_POS (31U) +#define DBGC_MCUSTPCTL_M31STP (0x80000000UL) + +/* Bit definition for DBGC_MCUTRACECTL register */ +#define DBGC_MCUTRACECTL_TRACEMODE_POS (0U) +#define DBGC_MCUTRACECTL_TRACEMODE (0x00000003UL) +#define DBGC_MCUTRACECTL_TRACEIOEN_POS (2U) +#define DBGC_MCUTRACECTL_TRACEIOEN (0x00000004UL) + +/* Bit definition for DBGC_MCUSTPCTL2 register */ +#define DBGC_MCUSTPCTL2_M32STP_POS (0U) +#define DBGC_MCUSTPCTL2_M32STP (0x00000001UL) +#define DBGC_MCUSTPCTL2_M33STP_POS (1U) +#define DBGC_MCUSTPCTL2_M33STP (0x00000002UL) +#define DBGC_MCUSTPCTL2_M34STP_POS (2U) +#define DBGC_MCUSTPCTL2_M34STP (0x00000004UL) +#define DBGC_MCUSTPCTL2_M35STP_POS (3U) +#define DBGC_MCUSTPCTL2_M35STP (0x00000008UL) +#define DBGC_MCUSTPCTL2_M36STP_POS (4U) +#define DBGC_MCUSTPCTL2_M36STP (0x00000010UL) +#define DBGC_MCUSTPCTL2_M37STP_POS (5U) +#define DBGC_MCUSTPCTL2_M37STP (0x00000020UL) +#define DBGC_MCUSTPCTL2_M38STP_POS (6U) +#define DBGC_MCUSTPCTL2_M38STP (0x00000040UL) +#define DBGC_MCUSTPCTL2_M39STP_POS (7U) +#define DBGC_MCUSTPCTL2_M39STP (0x00000080UL) +#define DBGC_MCUSTPCTL2_M40STP_POS (8U) +#define DBGC_MCUSTPCTL2_M40STP (0x00000100UL) +#define DBGC_MCUSTPCTL2_M41STP_POS (9U) +#define DBGC_MCUSTPCTL2_M41STP (0x00000200UL) +#define DBGC_MCUSTPCTL2_M42STP_POS (10U) +#define DBGC_MCUSTPCTL2_M42STP (0x00000400UL) +#define DBGC_MCUSTPCTL2_M43STP_POS (11U) +#define DBGC_MCUSTPCTL2_M43STP (0x00000800UL) +#define DBGC_MCUSTPCTL2_M44STP_POS (12U) +#define DBGC_MCUSTPCTL2_M44STP (0x00001000UL) +#define DBGC_MCUSTPCTL2_M45STP_POS (13U) +#define DBGC_MCUSTPCTL2_M45STP (0x00002000UL) +#define DBGC_MCUSTPCTL2_M46STP_POS (14U) +#define DBGC_MCUSTPCTL2_M46STP (0x00004000UL) +#define DBGC_MCUSTPCTL2_M47STP_POS (15U) +#define DBGC_MCUSTPCTL2_M47STP (0x00008000UL) +#define DBGC_MCUSTPCTL2_M48STP_POS (16U) +#define DBGC_MCUSTPCTL2_M48STP (0x00010000UL) +#define DBGC_MCUSTPCTL2_M49STP_POS (17U) +#define DBGC_MCUSTPCTL2_M49STP (0x00020000UL) +#define DBGC_MCUSTPCTL2_M50STP_POS (18U) +#define DBGC_MCUSTPCTL2_M50STP (0x00040000UL) +#define DBGC_MCUSTPCTL2_M51STP_POS (19U) +#define DBGC_MCUSTPCTL2_M51STP (0x00080000UL) +#define DBGC_MCUSTPCTL2_M52STP_POS (20U) +#define DBGC_MCUSTPCTL2_M52STP (0x00100000UL) +#define DBGC_MCUSTPCTL2_M53STP_POS (21U) +#define DBGC_MCUSTPCTL2_M53STP (0x00200000UL) +#define DBGC_MCUSTPCTL2_M54STP_POS (22U) +#define DBGC_MCUSTPCTL2_M54STP (0x00400000UL) +#define DBGC_MCUSTPCTL2_M55STP_POS (23U) +#define DBGC_MCUSTPCTL2_M55STP (0x00800000UL) +#define DBGC_MCUSTPCTL2_M56STP_POS (24U) +#define DBGC_MCUSTPCTL2_M56STP (0x01000000UL) +#define DBGC_MCUSTPCTL2_M57STP_POS (25U) +#define DBGC_MCUSTPCTL2_M57STP (0x02000000UL) +#define DBGC_MCUSTPCTL2_M58STP_POS (26U) +#define DBGC_MCUSTPCTL2_M58STP (0x04000000UL) +#define DBGC_MCUSTPCTL2_M59STP_POS (27U) +#define DBGC_MCUSTPCTL2_M59STP (0x08000000UL) +#define DBGC_MCUSTPCTL2_M60STP_POS (28U) +#define DBGC_MCUSTPCTL2_M60STP (0x10000000UL) +#define DBGC_MCUSTPCTL2_M61STP_POS (29U) +#define DBGC_MCUSTPCTL2_M61STP (0x20000000UL) +#define DBGC_MCUSTPCTL2_M62STP_POS (30U) +#define DBGC_MCUSTPCTL2_M62STP (0x40000000UL) +#define DBGC_MCUSTPCTL2_M63STP_POS (31U) +#define DBGC_MCUSTPCTL2_M63STP (0x80000000UL) + +/******************************************************************************* + Bit definition for Peripheral DCU +*******************************************************************************/ +/* Bit definition for DCU_CTL register */ +#define DCU_CTL_MODE_POS (0U) +#define DCU_CTL_MODE (0x0000000FUL) +#define DCU_CTL_MODE_0 (0x00000001UL) +#define DCU_CTL_MODE_1 (0x00000002UL) +#define DCU_CTL_MODE_2 (0x00000004UL) +#define DCU_CTL_MODE_3 (0x00000008UL) +#define DCU_CTL_DATASIZE_POS (4U) +#define DCU_CTL_DATASIZE (0x00000030UL) +#define DCU_CTL_DATASIZE_0 (0x00000010UL) +#define DCU_CTL_DATASIZE_1 (0x00000020UL) +#define DCU_CTL_COMP_TRG_POS (8U) +#define DCU_CTL_COMP_TRG (0x00000100UL) +#define DCU_CTL_INTEN_POS (31U) +#define DCU_CTL_INTEN (0x80000000UL) + +/* Bit definition for DCU_FLAG register */ +#define DCU_FLAG_FLAG_OP_POS (0U) +#define DCU_FLAG_FLAG_OP (0x00000001UL) +#define DCU_FLAG_FLAG_LS2_POS (1U) +#define DCU_FLAG_FLAG_LS2 (0x00000002UL) +#define DCU_FLAG_FLAG_EQ2_POS (2U) +#define DCU_FLAG_FLAG_EQ2 (0x00000004UL) +#define DCU_FLAG_FLAG_GT2_POS (3U) +#define DCU_FLAG_FLAG_GT2 (0x00000008UL) +#define DCU_FLAG_FLAG_LS1_POS (4U) +#define DCU_FLAG_FLAG_LS1 (0x00000010UL) +#define DCU_FLAG_FLAG_EQ1_POS (5U) +#define DCU_FLAG_FLAG_EQ1 (0x00000020UL) +#define DCU_FLAG_FLAG_GT1_POS (6U) +#define DCU_FLAG_FLAG_GT1 (0x00000040UL) +#define DCU_FLAG_FLAG_RLD_POS (9U) +#define DCU_FLAG_FLAG_RLD (0x00000200UL) +#define DCU_FLAG_FLAG_BTM_POS (10U) +#define DCU_FLAG_FLAG_BTM (0x00000400UL) +#define DCU_FLAG_FLAG_TOP_POS (11U) +#define DCU_FLAG_FLAG_TOP (0x00000800UL) + +/* Bit definition for DCU_DATA0 register */ +#define DCU_DATA0 (0xFFFFFFFFUL) + +/* Bit definition for DCU_DATA1 register */ +#define DCU_DATA1 (0xFFFFFFFFUL) + +/* Bit definition for DCU_DATA2 register */ +#define DCU_DATA2 (0xFFFFFFFFUL) + +/* Bit definition for DCU_FLAGCLR register */ +#define DCU_FLAGCLR_CLR_OP_POS (0U) +#define DCU_FLAGCLR_CLR_OP (0x00000001UL) +#define DCU_FLAGCLR_CLR_LS2_POS (1U) +#define DCU_FLAGCLR_CLR_LS2 (0x00000002UL) +#define DCU_FLAGCLR_CLR_EQ2_POS (2U) +#define DCU_FLAGCLR_CLR_EQ2 (0x00000004UL) +#define DCU_FLAGCLR_CLR_GT2_POS (3U) +#define DCU_FLAGCLR_CLR_GT2 (0x00000008UL) +#define DCU_FLAGCLR_CLR_LS1_POS (4U) +#define DCU_FLAGCLR_CLR_LS1 (0x00000010UL) +#define DCU_FLAGCLR_CLR_EQ1_POS (5U) +#define DCU_FLAGCLR_CLR_EQ1 (0x00000020UL) +#define DCU_FLAGCLR_CLR_GT1_POS (6U) +#define DCU_FLAGCLR_CLR_GT1 (0x00000040UL) +#define DCU_FLAGCLR_CLR_RLD_POS (9U) +#define DCU_FLAGCLR_CLR_RLD (0x00000200UL) +#define DCU_FLAGCLR_CLR_BTM_POS (10U) +#define DCU_FLAGCLR_CLR_BTM (0x00000400UL) +#define DCU_FLAGCLR_CLR_TOP_POS (11U) +#define DCU_FLAGCLR_CLR_TOP (0x00000800UL) + +/* Bit definition for DCU_INTEVTSEL register */ +#define DCU_INTEVTSEL_SEL_OP_POS (0U) +#define DCU_INTEVTSEL_SEL_OP (0x00000001UL) +#define DCU_INTEVTSEL_SEL_LS2_POS (1U) +#define DCU_INTEVTSEL_SEL_LS2 (0x00000002UL) +#define DCU_INTEVTSEL_SEL_EQ2_POS (2U) +#define DCU_INTEVTSEL_SEL_EQ2 (0x00000004UL) +#define DCU_INTEVTSEL_SEL_GT2_POS (3U) +#define DCU_INTEVTSEL_SEL_GT2 (0x00000008UL) +#define DCU_INTEVTSEL_SEL_LS1_POS (4U) +#define DCU_INTEVTSEL_SEL_LS1 (0x00000010UL) +#define DCU_INTEVTSEL_SEL_EQ1_POS (5U) +#define DCU_INTEVTSEL_SEL_EQ1 (0x00000020UL) +#define DCU_INTEVTSEL_SEL_GT1_POS (6U) +#define DCU_INTEVTSEL_SEL_GT1 (0x00000040UL) +#define DCU_INTEVTSEL_SEL_WIN_POS (7U) +#define DCU_INTEVTSEL_SEL_WIN (0x00000180UL) +#define DCU_INTEVTSEL_SEL_WIN_0 (0x00000080UL) +#define DCU_INTEVTSEL_SEL_WIN_1 (0x00000100UL) +#define DCU_INTEVTSEL_SEL_RLD_POS (9U) +#define DCU_INTEVTSEL_SEL_RLD (0x00000200UL) +#define DCU_INTEVTSEL_SEL_BTM_POS (10U) +#define DCU_INTEVTSEL_SEL_BTM (0x00000400UL) +#define DCU_INTEVTSEL_SEL_TOP_POS (11U) +#define DCU_INTEVTSEL_SEL_TOP (0x00000800UL) + +/******************************************************************************* + Bit definition for Peripheral DMA +*******************************************************************************/ +/* Bit definition for DMA_EN register */ +#define DMA_EN_EN (0x00000001UL) + +/* Bit definition for DMA_INTSTAT0 register */ +#define DMA_INTSTAT0_TRNERR_POS (0U) +#define DMA_INTSTAT0_TRNERR (0x000000FFUL) +#define DMA_INTSTAT0_TRNERR_0 (0x00000001UL) +#define DMA_INTSTAT0_TRNERR_1 (0x00000002UL) +#define DMA_INTSTAT0_TRNERR_2 (0x00000004UL) +#define DMA_INTSTAT0_TRNERR_3 (0x00000008UL) +#define DMA_INTSTAT0_TRNERR_4 (0x00000010UL) +#define DMA_INTSTAT0_TRNERR_5 (0x00000020UL) +#define DMA_INTSTAT0_TRNERR_6 (0x00000040UL) +#define DMA_INTSTAT0_TRNERR_7 (0x00000080UL) +#define DMA_INTSTAT0_REQERR_POS (16U) +#define DMA_INTSTAT0_REQERR (0x00FF0000UL) +#define DMA_INTSTAT0_REQERR_0 (0x00010000UL) +#define DMA_INTSTAT0_REQERR_1 (0x00020000UL) +#define DMA_INTSTAT0_REQERR_2 (0x00040000UL) +#define DMA_INTSTAT0_REQERR_3 (0x00080000UL) +#define DMA_INTSTAT0_REQERR_4 (0x00100000UL) +#define DMA_INTSTAT0_REQERR_5 (0x00200000UL) +#define DMA_INTSTAT0_REQERR_6 (0x00400000UL) +#define DMA_INTSTAT0_REQERR_7 (0x00800000UL) + +/* Bit definition for DMA_INTSTAT1 register */ +#define DMA_INTSTAT1_TC_POS (0U) +#define DMA_INTSTAT1_TC (0x000000FFUL) +#define DMA_INTSTAT1_TC_0 (0x00000001UL) +#define DMA_INTSTAT1_TC_1 (0x00000002UL) +#define DMA_INTSTAT1_TC_2 (0x00000004UL) +#define DMA_INTSTAT1_TC_3 (0x00000008UL) +#define DMA_INTSTAT1_TC_4 (0x00000010UL) +#define DMA_INTSTAT1_TC_5 (0x00000020UL) +#define DMA_INTSTAT1_TC_6 (0x00000040UL) +#define DMA_INTSTAT1_TC_7 (0x00000080UL) +#define DMA_INTSTAT1_BTC_POS (16U) +#define DMA_INTSTAT1_BTC (0x00FF0000UL) +#define DMA_INTSTAT1_BTC_0 (0x00010000UL) +#define DMA_INTSTAT1_BTC_1 (0x00020000UL) +#define DMA_INTSTAT1_BTC_2 (0x00040000UL) +#define DMA_INTSTAT1_BTC_3 (0x00080000UL) +#define DMA_INTSTAT1_BTC_4 (0x00100000UL) +#define DMA_INTSTAT1_BTC_5 (0x00200000UL) +#define DMA_INTSTAT1_BTC_6 (0x00400000UL) +#define DMA_INTSTAT1_BTC_7 (0x00800000UL) + +/* Bit definition for DMA_INTMASK0 register */ +#define DMA_INTMASK0_MSKTRNERR_POS (0U) +#define DMA_INTMASK0_MSKTRNERR (0x000000FFUL) +#define DMA_INTMASK0_MSKTRNERR_0 (0x00000001UL) +#define DMA_INTMASK0_MSKTRNERR_1 (0x00000002UL) +#define DMA_INTMASK0_MSKTRNERR_2 (0x00000004UL) +#define DMA_INTMASK0_MSKTRNERR_3 (0x00000008UL) +#define DMA_INTMASK0_MSKTRNERR_4 (0x00000010UL) +#define DMA_INTMASK0_MSKTRNERR_5 (0x00000020UL) +#define DMA_INTMASK0_MSKTRNERR_6 (0x00000040UL) +#define DMA_INTMASK0_MSKTRNERR_7 (0x00000080UL) +#define DMA_INTMASK0_MSKREQERR_POS (16U) +#define DMA_INTMASK0_MSKREQERR (0x00FF0000UL) +#define DMA_INTMASK0_MSKREQERR_0 (0x00010000UL) +#define DMA_INTMASK0_MSKREQERR_1 (0x00020000UL) +#define DMA_INTMASK0_MSKREQERR_2 (0x00040000UL) +#define DMA_INTMASK0_MSKREQERR_3 (0x00080000UL) +#define DMA_INTMASK0_MSKREQERR_4 (0x00100000UL) +#define DMA_INTMASK0_MSKREQERR_5 (0x00200000UL) +#define DMA_INTMASK0_MSKREQERR_6 (0x00400000UL) +#define DMA_INTMASK0_MSKREQERR_7 (0x00800000UL) + +/* Bit definition for DMA_INTMASK1 register */ +#define DMA_INTMASK1_MSKTC_POS (0U) +#define DMA_INTMASK1_MSKTC (0x000000FFUL) +#define DMA_INTMASK1_MSKTC_0 (0x00000001UL) +#define DMA_INTMASK1_MSKTC_1 (0x00000002UL) +#define DMA_INTMASK1_MSKTC_2 (0x00000004UL) +#define DMA_INTMASK1_MSKTC_3 (0x00000008UL) +#define DMA_INTMASK1_MSKTC_4 (0x00000010UL) +#define DMA_INTMASK1_MSKTC_5 (0x00000020UL) +#define DMA_INTMASK1_MSKTC_6 (0x00000040UL) +#define DMA_INTMASK1_MSKTC_7 (0x00000080UL) +#define DMA_INTMASK1_MSKBTC_POS (16U) +#define DMA_INTMASK1_MSKBTC (0x00FF0000UL) +#define DMA_INTMASK1_MSKBTC_0 (0x00010000UL) +#define DMA_INTMASK1_MSKBTC_1 (0x00020000UL) +#define DMA_INTMASK1_MSKBTC_2 (0x00040000UL) +#define DMA_INTMASK1_MSKBTC_3 (0x00080000UL) +#define DMA_INTMASK1_MSKBTC_4 (0x00100000UL) +#define DMA_INTMASK1_MSKBTC_5 (0x00200000UL) +#define DMA_INTMASK1_MSKBTC_6 (0x00400000UL) +#define DMA_INTMASK1_MSKBTC_7 (0x00800000UL) + +/* Bit definition for DMA_INTCLR0 register */ +#define DMA_INTCLR0_CLRTRNERR_POS (0U) +#define DMA_INTCLR0_CLRTRNERR (0x000000FFUL) +#define DMA_INTCLR0_CLRTRNERR_0 (0x00000001UL) +#define DMA_INTCLR0_CLRTRNERR_1 (0x00000002UL) +#define DMA_INTCLR0_CLRTRNERR_2 (0x00000004UL) +#define DMA_INTCLR0_CLRTRNERR_3 (0x00000008UL) +#define DMA_INTCLR0_CLRTRNERR_4 (0x00000010UL) +#define DMA_INTCLR0_CLRTRNERR_5 (0x00000020UL) +#define DMA_INTCLR0_CLRTRNERR_6 (0x00000040UL) +#define DMA_INTCLR0_CLRTRNERR_7 (0x00000080UL) +#define DMA_INTCLR0_CLRREQERR_POS (16U) +#define DMA_INTCLR0_CLRREQERR (0x00FF0000UL) +#define DMA_INTCLR0_CLRREQERR_0 (0x00010000UL) +#define DMA_INTCLR0_CLRREQERR_1 (0x00020000UL) +#define DMA_INTCLR0_CLRREQERR_2 (0x00040000UL) +#define DMA_INTCLR0_CLRREQERR_3 (0x00080000UL) +#define DMA_INTCLR0_CLRREQERR_4 (0x00100000UL) +#define DMA_INTCLR0_CLRREQERR_5 (0x00200000UL) +#define DMA_INTCLR0_CLRREQERR_6 (0x00400000UL) +#define DMA_INTCLR0_CLRREQERR_7 (0x00800000UL) + +/* Bit definition for DMA_INTCLR1 register */ +#define DMA_INTCLR1_CLRTC_POS (0U) +#define DMA_INTCLR1_CLRTC (0x000000FFUL) +#define DMA_INTCLR1_CLRTC_0 (0x00000001UL) +#define DMA_INTCLR1_CLRTC_1 (0x00000002UL) +#define DMA_INTCLR1_CLRTC_2 (0x00000004UL) +#define DMA_INTCLR1_CLRTC_3 (0x00000008UL) +#define DMA_INTCLR1_CLRTC_4 (0x00000010UL) +#define DMA_INTCLR1_CLRTC_5 (0x00000020UL) +#define DMA_INTCLR1_CLRTC_6 (0x00000040UL) +#define DMA_INTCLR1_CLRTC_7 (0x00000080UL) +#define DMA_INTCLR1_CLRBTC_POS (16U) +#define DMA_INTCLR1_CLRBTC (0x00FF0000UL) +#define DMA_INTCLR1_CLRBTC_0 (0x00010000UL) +#define DMA_INTCLR1_CLRBTC_1 (0x00020000UL) +#define DMA_INTCLR1_CLRBTC_2 (0x00040000UL) +#define DMA_INTCLR1_CLRBTC_3 (0x00080000UL) +#define DMA_INTCLR1_CLRBTC_4 (0x00100000UL) +#define DMA_INTCLR1_CLRBTC_5 (0x00200000UL) +#define DMA_INTCLR1_CLRBTC_6 (0x00400000UL) +#define DMA_INTCLR1_CLRBTC_7 (0x00800000UL) + +/* Bit definition for DMA_CHEN register */ +#define DMA_CHEN_CHEN (0x000000FFUL) + +/* Bit definition for DMA_REQSTAT register */ +#define DMA_REQSTAT_CHREQ_POS (0U) +#define DMA_REQSTAT_CHREQ (0x000000FFUL) +#define DMA_REQSTAT_CHREQ_0 (0x00000001UL) +#define DMA_REQSTAT_CHREQ_1 (0x00000002UL) +#define DMA_REQSTAT_CHREQ_2 (0x00000004UL) +#define DMA_REQSTAT_CHREQ_3 (0x00000008UL) +#define DMA_REQSTAT_CHREQ_4 (0x00000010UL) +#define DMA_REQSTAT_CHREQ_5 (0x00000020UL) +#define DMA_REQSTAT_CHREQ_6 (0x00000040UL) +#define DMA_REQSTAT_CHREQ_7 (0x00000080UL) +#define DMA_REQSTAT_RCFGREQ_POS (15U) +#define DMA_REQSTAT_RCFGREQ (0x00008000UL) + +/* Bit definition for DMA_CHSTAT register */ +#define DMA_CHSTAT_DMAACT_POS (0U) +#define DMA_CHSTAT_DMAACT (0x00000001UL) +#define DMA_CHSTAT_RCFGACT_POS (1U) +#define DMA_CHSTAT_RCFGACT (0x00000002UL) +#define DMA_CHSTAT_CHACT_POS (16U) +#define DMA_CHSTAT_CHACT (0x00FF0000UL) +#define DMA_CHSTAT_CHACT_0 (0x00010000UL) +#define DMA_CHSTAT_CHACT_1 (0x00020000UL) +#define DMA_CHSTAT_CHACT_2 (0x00040000UL) +#define DMA_CHSTAT_CHACT_3 (0x00080000UL) +#define DMA_CHSTAT_CHACT_4 (0x00100000UL) +#define DMA_CHSTAT_CHACT_5 (0x00200000UL) +#define DMA_CHSTAT_CHACT_6 (0x00400000UL) +#define DMA_CHSTAT_CHACT_7 (0x00800000UL) + +/* Bit definition for DMA_RCFGCTL register */ +#define DMA_RCFGCTL_RCFGEN_POS (0U) +#define DMA_RCFGCTL_RCFGEN (0x00000001UL) +#define DMA_RCFGCTL_RCFGLLP_POS (1U) +#define DMA_RCFGCTL_RCFGLLP (0x00000002UL) +#define DMA_RCFGCTL_RCFGCHS_POS (8U) +#define DMA_RCFGCTL_RCFGCHS (0x00000F00UL) +#define DMA_RCFGCTL_SARMD_POS (16U) +#define DMA_RCFGCTL_SARMD (0x00030000UL) +#define DMA_RCFGCTL_SARMD_0 (0x00010000UL) +#define DMA_RCFGCTL_SARMD_1 (0x00020000UL) +#define DMA_RCFGCTL_DARMD_POS (18U) +#define DMA_RCFGCTL_DARMD (0x000C0000UL) +#define DMA_RCFGCTL_DARMD_0 (0x00040000UL) +#define DMA_RCFGCTL_DARMD_1 (0x00080000UL) +#define DMA_RCFGCTL_CNTMD_POS (20U) +#define DMA_RCFGCTL_CNTMD (0x00300000UL) +#define DMA_RCFGCTL_CNTMD_0 (0x00100000UL) +#define DMA_RCFGCTL_CNTMD_1 (0x00200000UL) + +/* Bit definition for DMA_CHENCLR register */ +#define DMA_CHENCLR_CHENCLR (0x000000FFUL) + +/* Bit definition for DMA_SAR register */ +#define DMA_SAR_SAR (0xFFFFFFFFUL) + +/* Bit definition for DMA_DAR register */ +#define DMA_DAR_DAR (0xFFFFFFFFUL) + +/* Bit definition for DMA_DTCTL register */ +#define DMA_DTCTL_BLKSIZE_POS (0U) +#define DMA_DTCTL_BLKSIZE (0x000003FFUL) +#define DMA_DTCTL_CNT_POS (16U) +#define DMA_DTCTL_CNT (0xFFFF0000UL) + +/* Bit definition for DMA_RPT register */ +#define DMA_RPT_SRPT_POS (0U) +#define DMA_RPT_SRPT (0x000003FFUL) +#define DMA_RPT_DRPT_POS (16U) +#define DMA_RPT_DRPT (0x03FF0000UL) + +/* Bit definition for DMA_RPTB register */ +#define DMA_RPTB_SRPTB_POS (0U) +#define DMA_RPTB_SRPTB (0x000003FFUL) +#define DMA_RPTB_DRPTB_POS (16U) +#define DMA_RPTB_DRPTB (0x03FF0000UL) + +/* Bit definition for DMA_SNSEQCTL register */ +#define DMA_SNSEQCTL_SOFFSET_POS (0U) +#define DMA_SNSEQCTL_SOFFSET (0x000FFFFFUL) +#define DMA_SNSEQCTL_SNSCNT_POS (20U) +#define DMA_SNSEQCTL_SNSCNT (0xFFF00000UL) + +/* Bit definition for DMA_SNSEQCTLB register */ +#define DMA_SNSEQCTLB_SNSDIST_POS (0U) +#define DMA_SNSEQCTLB_SNSDIST (0x000FFFFFUL) +#define DMA_SNSEQCTLB_SNSCNTB_POS (20U) +#define DMA_SNSEQCTLB_SNSCNTB (0xFFF00000UL) + +/* Bit definition for DMA_DNSEQCTL register */ +#define DMA_DNSEQCTL_DOFFSET_POS (0U) +#define DMA_DNSEQCTL_DOFFSET (0x000FFFFFUL) +#define DMA_DNSEQCTL_DNSCNT_POS (20U) +#define DMA_DNSEQCTL_DNSCNT (0xFFF00000UL) + +/* Bit definition for DMA_DNSEQCTLB register */ +#define DMA_DNSEQCTLB_DNSDIST_POS (0U) +#define DMA_DNSEQCTLB_DNSDIST (0x000FFFFFUL) +#define DMA_DNSEQCTLB_DNSCNTB_POS (20U) +#define DMA_DNSEQCTLB_DNSCNTB (0xFFF00000UL) + +/* Bit definition for DMA_LLP register */ +#define DMA_LLP_LLP_POS (2U) +#define DMA_LLP_LLP (0xFFFFFFFCUL) + +/* Bit definition for DMA_CHCTL register */ +#define DMA_CHCTL_SINC_POS (0U) +#define DMA_CHCTL_SINC (0x00000003UL) +#define DMA_CHCTL_SINC_0 (0x00000001UL) +#define DMA_CHCTL_SINC_1 (0x00000002UL) +#define DMA_CHCTL_DINC_POS (2U) +#define DMA_CHCTL_DINC (0x0000000CUL) +#define DMA_CHCTL_DINC_0 (0x00000004UL) +#define DMA_CHCTL_DINC_1 (0x00000008UL) +#define DMA_CHCTL_SRTPEN_POS (4U) +#define DMA_CHCTL_SRTPEN (0x00000010UL) +#define DMA_CHCTL_DRPTEN_POS (5U) +#define DMA_CHCTL_DRPTEN (0x00000020UL) +#define DMA_CHCTL_SNSEQEN_POS (6U) +#define DMA_CHCTL_SNSEQEN (0x00000040UL) +#define DMA_CHCTL_DNSEQEN_POS (7U) +#define DMA_CHCTL_DNSEQEN (0x00000080UL) +#define DMA_CHCTL_HSIZE_POS (8U) +#define DMA_CHCTL_HSIZE (0x00000300UL) +#define DMA_CHCTL_HSIZE_0 (0x00000100UL) +#define DMA_CHCTL_HSIZE_1 (0x00000200UL) +#define DMA_CHCTL_LLPEN_POS (10U) +#define DMA_CHCTL_LLPEN (0x00000400UL) +#define DMA_CHCTL_LLPRUN_POS (11U) +#define DMA_CHCTL_LLPRUN (0x00000800UL) +#define DMA_CHCTL_IE_POS (12U) +#define DMA_CHCTL_IE (0x00001000UL) + +/* Bit definition for DMA_MONSAR register */ +#define DMA_MONSAR_MONSAR (0xFFFFFFFFUL) + +/* Bit definition for DMA_MONDAR register */ +#define DMA_MONDAR_MONDAR (0xFFFFFFFFUL) + +/* Bit definition for DMA_MONDTCTL register */ +#define DMA_MONDTCTL_BLKSIZE_POS (0U) +#define DMA_MONDTCTL_BLKSIZE (0x000003FFUL) +#define DMA_MONDTCTL_CNT_POS (16U) +#define DMA_MONDTCTL_CNT (0xFFFF0000UL) + +/* Bit definition for DMA_MONRPT register */ +#define DMA_MONRPT_SRPT_POS (0U) +#define DMA_MONRPT_SRPT (0x000003FFUL) +#define DMA_MONRPT_DRPT_POS (16U) +#define DMA_MONRPT_DRPT (0x03FF0000UL) + +/* Bit definition for DMA_MONSNSEQCTL register */ +#define DMA_MONSNSEQCTL_SOFFSET_POS (0U) +#define DMA_MONSNSEQCTL_SOFFSET (0x000FFFFFUL) +#define DMA_MONSNSEQCTL_SNSCNT_POS (20U) +#define DMA_MONSNSEQCTL_SNSCNT (0xFFF00000UL) + +/* Bit definition for DMA_MONDNSEQCTL register */ +#define DMA_MONDNSEQCTL_DOFFSET_POS (0U) +#define DMA_MONDNSEQCTL_DOFFSET (0x000FFFFFUL) +#define DMA_MONDNSEQCTL_DNSCNT_POS (20U) +#define DMA_MONDNSEQCTL_DNSCNT (0xFFF00000UL) + +/******************************************************************************* + Bit definition for Peripheral DMC +*******************************************************************************/ +/* Bit definition for DMC_STSR register */ +#define DMC_STSR_STATUS_POS (0U) +#define DMC_STSR_STATUS (0x00000003UL) +#define DMC_STSR_STATUS_0 (0x00000001UL) +#define DMC_STSR_STATUS_1 (0x00000002UL) +#define DMC_STSR_MEMMW_POS (2U) +#define DMC_STSR_MEMMW (0x0000000CUL) +#define DMC_STSR_MEMMW_0 (0x00000004UL) +#define DMC_STSR_MEMMW_1 (0x00000008UL) + +/* Bit definition for DMC_STCR register */ +#define DMC_STCR_STCTL (0x00000007UL) + +/* Bit definition for DMC_CMDR register */ +#define DMC_CMDR_CMDADD_POS (0U) +#define DMC_CMDR_CMDADD (0x00003FFFUL) +#define DMC_CMDR_CMDBA_POS (16U) +#define DMC_CMDR_CMDBA (0x00030000UL) +#define DMC_CMDR_CMDBA_0 (0x00010000UL) +#define DMC_CMDR_CMDBA_1 (0x00020000UL) +#define DMC_CMDR_CMD_POS (18U) +#define DMC_CMDR_CMD (0x000C0000UL) +#define DMC_CMDR_CMD_0 (0x00040000UL) +#define DMC_CMDR_CMD_1 (0x00080000UL) +#define DMC_CMDR_CMDCHIP_POS (20U) +#define DMC_CMDR_CMDCHIP (0x00300000UL) +#define DMC_CMDR_CMDCHIP_0 (0x00100000UL) +#define DMC_CMDR_CMDCHIP_1 (0x00200000UL) +#define DMC_CMDR_RESV5_POS (24U) +#define DMC_CMDR_RESV5 (0x01000000UL) + +/* Bit definition for DMC_CPCR register */ +#define DMC_CPCR_COLBS_POS (0U) +#define DMC_CPCR_COLBS (0x00000007UL) +#define DMC_CPCR_COLBS_0 (0x00000001UL) +#define DMC_CPCR_COLBS_1 (0x00000002UL) +#define DMC_CPCR_COLBS_2 (0x00000004UL) +#define DMC_CPCR_ROWBS_POS (4U) +#define DMC_CPCR_ROWBS (0x00000070UL) +#define DMC_CPCR_ROWBS_0 (0x00000010UL) +#define DMC_CPCR_ROWBS_1 (0x00000020UL) +#define DMC_CPCR_ROWBS_2 (0x00000040UL) +#define DMC_CPCR_APBS_POS (7U) +#define DMC_CPCR_APBS (0x00000080UL) +#define DMC_CPCR_CKEDIS_POS (8U) +#define DMC_CPCR_CKEDIS (0x00000100UL) +#define DMC_CPCR_CKSTOP_POS (9U) +#define DMC_CPCR_CKSTOP (0x00000200UL) +#define DMC_CPCR_CKEDISPRD_POS (10U) +#define DMC_CPCR_CKEDISPRD (0x0000FC00UL) +#define DMC_CPCR_BURST_POS (16U) +#define DMC_CPCR_BURST (0x00070000UL) +#define DMC_CPCR_BURST_0 (0x00010000UL) +#define DMC_CPCR_BURST_1 (0x00020000UL) +#define DMC_CPCR_BURST_2 (0x00040000UL) +#define DMC_CPCR_ACTCP_POS (24U) +#define DMC_CPCR_ACTCP (0x03000000UL) +#define DMC_CPCR_ACTCP_0 (0x01000000UL) +#define DMC_CPCR_ACTCP_1 (0x02000000UL) + +/* Bit definition for DMC_RFTR register */ +#define DMC_RFTR_REFPRD (0x00007FFFUL) + +/* Bit definition for DMC_TMCR_T_CASL register */ +#define DMC_TMCR_T_CASL_T_CASL (0x00000007UL) + +/* Bit definition for DMC_TMCR_T_DQSS register */ +#define DMC_TMCR_T_DQSS_T_DQSS (0x00000003UL) + +/* Bit definition for DMC_TMCR_T_MRD register */ +#define DMC_TMCR_T_MRD_T_MRD (0x0000007FUL) + +/* Bit definition for DMC_TMCR_T_RAS register */ +#define DMC_TMCR_T_RAS_T_RAS (0x0000000FUL) + +/* Bit definition for DMC_TMCR_T_RC register */ +#define DMC_TMCR_T_RC_T_RC (0x0000000FUL) + +/* Bit definition for DMC_TMCR_T_RCD register */ +#define DMC_TMCR_T_RCD_T_RCD (0x00000007UL) + +/* Bit definition for DMC_TMCR_T_RFC register */ +#define DMC_TMCR_T_RFC_T_RFC (0x0000001FUL) + +/* Bit definition for DMC_TMCR_T_RP register */ +#define DMC_TMCR_T_RP_T_RP (0x00000007UL) + +/* Bit definition for DMC_TMCR_T_RRD register */ +#define DMC_TMCR_T_RRD_T_RRD (0x0000000FUL) + +/* Bit definition for DMC_TMCR_T_WR register */ +#define DMC_TMCR_T_WR_T_WR (0x00000007UL) + +/* Bit definition for DMC_TMCR_T_WTR register */ +#define DMC_TMCR_T_WTR_T_WTR (0x00000007UL) + +/* Bit definition for DMC_TMCR_T_XP register */ +#define DMC_TMCR_T_XP_T_XP (0x000000FFUL) + +/* Bit definition for DMC_TMCR_T_XSR register */ +#define DMC_TMCR_T_XSR_T_XSR (0x000000FFUL) + +/* Bit definition for DMC_TMCR_T_ESR register */ +#define DMC_TMCR_T_ESR_T_ESR (0x000000FFUL) + +/* Bit definition for DMC_CSCR register */ +#define DMC_CSCR_ADDMSK_POS (0U) +#define DMC_CSCR_ADDMSK (0x000000FFUL) +#define DMC_CSCR_ADDMAT_POS (8U) +#define DMC_CSCR_ADDMAT (0x0000FF00UL) +#define DMC_CSCR_BRC_POS (16U) +#define DMC_CSCR_BRC (0x00010000UL) +#define DMC_CSCR_RESV8_POS (24U) +#define DMC_CSCR_RESV8 (0x01000000UL) + +/* Bit definition for DMC_BACR register */ +#define DMC_BACR_DMCMW_POS (0U) +#define DMC_BACR_DMCMW (0x00000003UL) +#define DMC_BACR_DMCMW_0 (0x00000001UL) +#define DMC_BACR_DMCMW_1 (0x00000002UL) +#define DMC_BACR_RESV11_POS (24U) +#define DMC_BACR_RESV11 (0x01000000UL) + +/******************************************************************************* + Bit definition for Peripheral DVP +*******************************************************************************/ +/* Bit definition for DVP_CTR register */ +#define DVP_CTR_CAPEN_POS (0U) +#define DVP_CTR_CAPEN (0x00000001UL) +#define DVP_CTR_CAPMD_POS (1U) +#define DVP_CTR_CAPMD (0x00000002UL) +#define DVP_CTR_CROPEN_POS (2U) +#define DVP_CTR_CROPEN (0x00000004UL) +#define DVP_CTR_JPEGEN_POS (3U) +#define DVP_CTR_JPEGEN (0x00000008UL) +#define DVP_CTR_SWSYNC_POS (4U) +#define DVP_CTR_SWSYNC (0x00000010UL) +#define DVP_CTR_PIXCKSEL_POS (5U) +#define DVP_CTR_PIXCKSEL (0x00000020UL) +#define DVP_CTR_HSYNCSEL_POS (6U) +#define DVP_CTR_HSYNCSEL (0x00000040UL) +#define DVP_CTR_VSYNCSEL_POS (7U) +#define DVP_CTR_VSYNCSEL (0x00000080UL) +#define DVP_CTR_CAPFRC_POS (8U) +#define DVP_CTR_CAPFRC (0x00000300UL) +#define DVP_CTR_CAPFRC_0 (0x00000100UL) +#define DVP_CTR_CAPFRC_1 (0x00000200UL) +#define DVP_CTR_BITSEL_POS (10U) +#define DVP_CTR_BITSEL (0x00000C00UL) +#define DVP_CTR_BITSEL_0 (0x00000400UL) +#define DVP_CTR_BITSEL_1 (0x00000800UL) +#define DVP_CTR_DVPEN_POS (14U) +#define DVP_CTR_DVPEN (0x00004000UL) + +/* Bit definition for DVP_DTR register */ +#define DVP_DTR (0xFFFFFFFFUL) + +/* Bit definition for DVP_STR register */ +#define DVP_STR_FSF_POS (0U) +#define DVP_STR_FSF (0x00000001UL) +#define DVP_STR_LSF_POS (1U) +#define DVP_STR_LSF (0x00000002UL) +#define DVP_STR_LEF_POS (2U) +#define DVP_STR_LEF (0x00000004UL) +#define DVP_STR_FEF_POS (3U) +#define DVP_STR_FEF (0x00000008UL) +#define DVP_STR_SQUERF_POS (4U) +#define DVP_STR_SQUERF (0x00000010UL) +#define DVP_STR_FIFOERF_POS (5U) +#define DVP_STR_FIFOERF (0x00000020UL) + +/* Bit definition for DVP_IER register */ +#define DVP_IER_FSIEN_POS (0U) +#define DVP_IER_FSIEN (0x00000001UL) +#define DVP_IER_LSIEN_POS (1U) +#define DVP_IER_LSIEN (0x00000002UL) +#define DVP_IER_LEIEN_POS (2U) +#define DVP_IER_LEIEN (0x00000004UL) +#define DVP_IER_FEIEN_POS (3U) +#define DVP_IER_FEIEN (0x00000008UL) +#define DVP_IER_SQUERIEN_POS (4U) +#define DVP_IER_SQUERIEN (0x00000010UL) +#define DVP_IER_FIFOERIEN_POS (5U) +#define DVP_IER_FIFOERIEN (0x00000020UL) + +/* Bit definition for DVP_DMR register */ +#define DVP_DMR (0xFFFFFFFFUL) + +/* Bit definition for DVP_SSYNDR register */ +#define DVP_SSYNDR_FSDAT_POS (0U) +#define DVP_SSYNDR_FSDAT (0x000000FFUL) +#define DVP_SSYNDR_LSDAT_POS (8U) +#define DVP_SSYNDR_LSDAT (0x0000FF00UL) +#define DVP_SSYNDR_LEDAT_POS (16U) +#define DVP_SSYNDR_LEDAT (0x00FF0000UL) +#define DVP_SSYNDR_FEDAT_POS (24U) +#define DVP_SSYNDR_FEDAT (0xFF000000UL) + +/* Bit definition for DVP_SSYNMR register */ +#define DVP_SSYNMR_FSMSK_POS (0U) +#define DVP_SSYNMR_FSMSK (0x000000FFUL) +#define DVP_SSYNMR_LSMSK_POS (8U) +#define DVP_SSYNMR_LSMSK (0x0000FF00UL) +#define DVP_SSYNMR_LEMSK_POS (16U) +#define DVP_SSYNMR_LEMSK (0x00FF0000UL) +#define DVP_SSYNMR_FEMSK_POS (24U) +#define DVP_SSYNMR_FEMSK (0xFF000000UL) + +/* Bit definition for DVP_CPSFTR register */ +#define DVP_CPSFTR_RSHIFT_POS (0U) +#define DVP_CPSFTR_RSHIFT (0x00003FFFUL) +#define DVP_CPSFTR_CSHIFT_POS (16U) +#define DVP_CPSFTR_CSHIFT (0x3FFF0000UL) + +/* Bit definition for DVP_CPSZER register */ +#define DVP_CPSZER_RSIZE_POS (0U) +#define DVP_CPSZER_RSIZE (0x00003FFFUL) +#define DVP_CPSZER_CSIZE_POS (16U) +#define DVP_CPSZER_CSIZE (0x3FFF0000UL) + +/******************************************************************************* + Bit definition for Peripheral EFM +*******************************************************************************/ +/* Bit definition for EFM_FAPRT register */ +#define EFM_FAPRT_FAPRT (0x0000FFFFUL) + +/* Bit definition for EFM_KEY1 register */ +#define EFM_KEY1 (0xFFFFFFFFUL) + +/* Bit definition for EFM_KEY2 register */ +#define EFM_KEY2 (0xFFFFFFFFUL) + +/* Bit definition for EFM_FSTP register */ +#define EFM_FSTP_F0STP_POS (0U) +#define EFM_FSTP_F0STP (0x00000001UL) +#define EFM_FSTP_F1STP_POS (1U) +#define EFM_FSTP_F1STP (0x00000002UL) + +/* Bit definition for EFM_FRMC register */ +#define EFM_FRMC_FLWT_POS (0U) +#define EFM_FRMC_FLWT (0x0000000FUL) +#define EFM_FRMC_FLWT_0 (0x00000001UL) +#define EFM_FRMC_FLWT_1 (0x00000002UL) +#define EFM_FRMC_FLWT_2 (0x00000004UL) +#define EFM_FRMC_FLWT_3 (0x00000008UL) +#define EFM_FRMC_LVM_POS (8U) +#define EFM_FRMC_LVM (0x00000100UL) +#define EFM_FRMC_ICACHE_POS (16U) +#define EFM_FRMC_ICACHE (0x00010000UL) +#define EFM_FRMC_DCACHE_POS (17U) +#define EFM_FRMC_DCACHE (0x00020000UL) +#define EFM_FRMC_PREFE_POS (18U) +#define EFM_FRMC_PREFE (0x00040000UL) +#define EFM_FRMC_CRST_POS (19U) +#define EFM_FRMC_CRST (0x00080000UL) + +/* Bit definition for EFM_FWMC register */ +#define EFM_FWMC_PEMOD_POS (0U) +#define EFM_FWMC_PEMOD (0x00000007UL) +#define EFM_FWMC_BUSHLDCTL_POS (8U) +#define EFM_FWMC_BUSHLDCTL (0x00000100UL) +#define EFM_FWMC_KEY1LOCK_POS (16U) +#define EFM_FWMC_KEY1LOCK (0x00010000UL) +#define EFM_FWMC_KEY2LOCK_POS (17U) +#define EFM_FWMC_KEY2LOCK (0x00020000UL) + +/* Bit definition for EFM_FSR register */ +#define EFM_FSR_OTPWERR0_POS (0U) +#define EFM_FSR_OTPWERR0 (0x00000001UL) +#define EFM_FSR_PRTWERR0_POS (1U) +#define EFM_FSR_PRTWERR0 (0x00000002UL) +#define EFM_FSR_PGSZERR0_POS (2U) +#define EFM_FSR_PGSZERR0 (0x00000004UL) +#define EFM_FSR_MISMTCH0_POS (3U) +#define EFM_FSR_MISMTCH0 (0x00000008UL) +#define EFM_FSR_OPTEND0_POS (4U) +#define EFM_FSR_OPTEND0 (0x00000010UL) +#define EFM_FSR_COLERR0_POS (5U) +#define EFM_FSR_COLERR0 (0x00000020UL) +#define EFM_FSR_RDY0_POS (8U) +#define EFM_FSR_RDY0 (0x00000100UL) +#define EFM_FSR_PRTWERR1_POS (17U) +#define EFM_FSR_PRTWERR1 (0x00020000UL) +#define EFM_FSR_PGSZERR1_POS (18U) +#define EFM_FSR_PGSZERR1 (0x00040000UL) +#define EFM_FSR_MISMTCH1_POS (19U) +#define EFM_FSR_MISMTCH1 (0x00080000UL) +#define EFM_FSR_OPTEND1_POS (20U) +#define EFM_FSR_OPTEND1 (0x00100000UL) +#define EFM_FSR_COLERR1_POS (21U) +#define EFM_FSR_COLERR1 (0x00200000UL) +#define EFM_FSR_RDY1_POS (24U) +#define EFM_FSR_RDY1 (0x01000000UL) + +/* Bit definition for EFM_FSCLR register */ +#define EFM_FSCLR_OTPWERRCLR0_POS (0U) +#define EFM_FSCLR_OTPWERRCLR0 (0x00000001UL) +#define EFM_FSCLR_PRTWERRCLR0_POS (1U) +#define EFM_FSCLR_PRTWERRCLR0 (0x00000002UL) +#define EFM_FSCLR_PGSZERRCLR0_POS (2U) +#define EFM_FSCLR_PGSZERRCLR0 (0x00000004UL) +#define EFM_FSCLR_MISMTCHCLR0_POS (3U) +#define EFM_FSCLR_MISMTCHCLR0 (0x00000008UL) +#define EFM_FSCLR_OPTENDCLR0_POS (4U) +#define EFM_FSCLR_OPTENDCLR0 (0x00000010UL) +#define EFM_FSCLR_COLERRCLR0_POS (5U) +#define EFM_FSCLR_COLERRCLR0 (0x00000020UL) +#define EFM_FSCLR_PRTWERRCLR1_POS (17U) +#define EFM_FSCLR_PRTWERRCLR1 (0x00020000UL) +#define EFM_FSCLR_PGSZERRCLR1_POS (18U) +#define EFM_FSCLR_PGSZERRCLR1 (0x00040000UL) +#define EFM_FSCLR_MISMTCHCLR1_POS (19U) +#define EFM_FSCLR_MISMTCHCLR1 (0x00080000UL) +#define EFM_FSCLR_OPTENDCLR1_POS (20U) +#define EFM_FSCLR_OPTENDCLR1 (0x00100000UL) +#define EFM_FSCLR_COLERRCLR1_POS (21U) +#define EFM_FSCLR_COLERRCLR1 (0x00200000UL) + +/* Bit definition for EFM_FITE register */ +#define EFM_FITE_PEERRITE_POS (0U) +#define EFM_FITE_PEERRITE (0x00000001UL) +#define EFM_FITE_OPTENDITE_POS (1U) +#define EFM_FITE_OPTENDITE (0x00000002UL) +#define EFM_FITE_COLERRITE_POS (2U) +#define EFM_FITE_COLERRITE (0x00000004UL) + +/* Bit definition for EFM_FSWP register */ +#define EFM_FSWP_FSWP (0x00000001UL) + +/* Bit definition for EFM_FHDFG register */ +#define EFM_FHDFG (0xFFFFFFFFUL) + +/* Bit definition for EFM_UQID0 register */ +#define EFM_UQID0 (0xFFFFFFFFUL) + +/* Bit definition for EFM_UQID1 register */ +#define EFM_UQID1 (0xFFFFFFFFUL) + +/* Bit definition for EFM_UQID2 register */ +#define EFM_UQID2 (0xFFFFFFFFUL) + +/* Bit definition for MMF_REMPRT register */ +#define MMF_REMPRT_REMPRT (0x0000FFFFUL) + +/* Bit definition for MMF_REMCR0 register */ +#define MMF_REMCR0_RM0SIZE_POS (0U) +#define MMF_REMCR0_RM0SIZE (0x0000001FUL) +#define MMF_REMCR0_RM0TADDR_POS (12U) +#define MMF_REMCR0_RM0TADDR (0x1FFFF000UL) +#define MMF_REMCR0_EN0_POS (31U) +#define MMF_REMCR0_EN0 (0x80000000UL) + +/* Bit definition for MMF_REMCR1 register */ +#define MMF_REMCR1_RM1SIZE_POS (0U) +#define MMF_REMCR1_RM1SIZE (0x0000001FUL) +#define MMF_REMCR1_RM1TADDR_POS (12U) +#define MMF_REMCR1_RM1TADDR (0x1FFFF000UL) +#define MMF_REMCR1_EN1_POS (31U) +#define MMF_REMCR1_EN1 (0x80000000UL) + +/* Bit definition for EFM_WLOCK register */ +#define EFM_WLOCK_WLOCK0_POS (0U) +#define EFM_WLOCK_WLOCK0 (0x00000001UL) +#define EFM_WLOCK_WLOCK1_POS (1U) +#define EFM_WLOCK_WLOCK1 (0x00000002UL) +#define EFM_WLOCK_WLOCK2_POS (2U) +#define EFM_WLOCK_WLOCK2 (0x00000004UL) +#define EFM_WLOCK_WLOCK3_POS (3U) +#define EFM_WLOCK_WLOCK3 (0x00000008UL) +#define EFM_WLOCK_WLOCK4_POS (4U) +#define EFM_WLOCK_WLOCK4 (0x00000010UL) +#define EFM_WLOCK_WLOCK5_POS (5U) +#define EFM_WLOCK_WLOCK5 (0x00000020UL) +#define EFM_WLOCK_WLOCK6_POS (6U) +#define EFM_WLOCK_WLOCK6 (0x00000040UL) +#define EFM_WLOCK_WLOCK7_POS (7U) +#define EFM_WLOCK_WLOCK7 (0x00000080UL) + +/* Bit definition for EFM_F0NWPRT0 register */ +#define EFM_F0NWPRT0 (0xFFFFFFFFUL) + +/* Bit definition for EFM_F0NWPRT1 register */ +#define EFM_F0NWPRT1 (0xFFFFFFFFUL) + +/* Bit definition for EFM_F0NWPRT2 register */ +#define EFM_F0NWPRT2 (0xFFFFFFFFUL) + +/* Bit definition for EFM_F0NWPRT3 register */ +#define EFM_F0NWPRT3 (0xFFFFFFFFUL) + +/* Bit definition for EFM_F1NWPRT0 register */ +#define EFM_F1NWPRT0 (0xFFFFFFFFUL) + +/* Bit definition for EFM_F1NWPRT1 register */ +#define EFM_F1NWPRT1 (0xFFFFFFFFUL) + +/* Bit definition for EFM_F1NWPRT2 register */ +#define EFM_F1NWPRT2 (0xFFFFFFFFUL) + +/* Bit definition for EFM_F1NWPRT3 register */ +#define EFM_F1NWPRT3 (0xFFFFFFFFUL) + +/******************************************************************************* + Bit definition for Peripheral EMB +*******************************************************************************/ +/* Bit definition for EMB_CTL1 register */ +#define EMB_CTL1_CMPEN_POS (0U) +#define EMB_CTL1_CMPEN (0x0000000FUL) +#define EMB_CTL1_CMPEN_0 (0x00000001UL) +#define EMB_CTL1_CMPEN_1 (0x00000002UL) +#define EMB_CTL1_CMPEN_2 (0x00000004UL) +#define EMB_CTL1_CMPEN_3 (0x00000008UL) +#define EMB_CTL1_OSCSTPEN_POS (4U) +#define EMB_CTL1_OSCSTPEN (0x00000010UL) +#define EMB_CTL1_PWMSEN_POS (5U) +#define EMB_CTL1_PWMSEN (0x00001FE0UL) +#define EMB_CTL1_PWMSEN_0 (0x00000020UL) +#define EMB_CTL1_PWMSEN_1 (0x00000040UL) +#define EMB_CTL1_PWMSEN_2 (0x00000080UL) +#define EMB_CTL1_PWMSEN_3 (0x00000100UL) +#define EMB_CTL1_PWMSEN_4 (0x00000200UL) +#define EMB_CTL1_PWMSEN_5 (0x00000400UL) +#define EMB_CTL1_PWMSEN_6 (0x00000800UL) +#define EMB_CTL1_PWMSEN_7 (0x00001000UL) +#define EMB_CTL1_PORTINEN1_POS (16U) +#define EMB_CTL1_PORTINEN1 (0x00010000UL) +#define EMB_CTL1_PORTINEN2_POS (17U) +#define EMB_CTL1_PORTINEN2 (0x00020000UL) +#define EMB_CTL1_PORTINEN3_POS (18U) +#define EMB_CTL1_PORTINEN3 (0x00040000UL) +#define EMB_CTL1_PORTINEN4_POS (19U) +#define EMB_CTL1_PORTINEN4 (0x00080000UL) +#define EMB_CTL1_INVSEL1_POS (22U) +#define EMB_CTL1_INVSEL1 (0x00400000UL) +#define EMB_CTL1_INVSEL2_POS (23U) +#define EMB_CTL1_INVSEL2 (0x00800000UL) +#define EMB_CTL1_INVSEL3_POS (24U) +#define EMB_CTL1_INVSEL3 (0x01000000UL) +#define EMB_CTL1_INVSEL4_POS (25U) +#define EMB_CTL1_INVSEL4 (0x02000000UL) + +/* Bit definition for EMB_CTL2 register */ +#define EMB_CTL2_PWMLV_POS (0U) +#define EMB_CTL2_PWMLV (0x000000FFUL) +#define EMB_CTL2_PWMLV_0 (0x00000001UL) +#define EMB_CTL2_PWMLV_1 (0x00000002UL) +#define EMB_CTL2_PWMLV_2 (0x00000004UL) +#define EMB_CTL2_PWMLV_3 (0x00000008UL) +#define EMB_CTL2_PWMLV_4 (0x00000010UL) +#define EMB_CTL2_PWMLV_5 (0x00000020UL) +#define EMB_CTL2_PWMLV_6 (0x00000040UL) +#define EMB_CTL2_PWMLV_7 (0x00000080UL) +#define EMB_CTL2_NFSEL1_POS (16U) +#define EMB_CTL2_NFSEL1 (0x00030000UL) +#define EMB_CTL2_NFSEL1_0 (0x00010000UL) +#define EMB_CTL2_NFSEL1_1 (0x00020000UL) +#define EMB_CTL2_NFEN1_POS (18U) +#define EMB_CTL2_NFEN1 (0x00040000UL) +#define EMB_CTL2_NFSEL2_POS (19U) +#define EMB_CTL2_NFSEL2 (0x00180000UL) +#define EMB_CTL2_NFSEL2_0 (0x00080000UL) +#define EMB_CTL2_NFSEL2_1 (0x00100000UL) +#define EMB_CTL2_NFEN2_POS (21U) +#define EMB_CTL2_NFEN2 (0x00200000UL) +#define EMB_CTL2_NFSEL3_POS (22U) +#define EMB_CTL2_NFSEL3 (0x00C00000UL) +#define EMB_CTL2_NFSEL3_0 (0x00400000UL) +#define EMB_CTL2_NFSEL3_1 (0x00800000UL) +#define EMB_CTL2_NFEN3_POS (24U) +#define EMB_CTL2_NFEN3 (0x01000000UL) +#define EMB_CTL2_NFSEL4_POS (25U) +#define EMB_CTL2_NFSEL4 (0x06000000UL) +#define EMB_CTL2_NFSEL4_0 (0x02000000UL) +#define EMB_CTL2_NFSEL4_1 (0x04000000UL) +#define EMB_CTL2_NFEN4_POS (27U) +#define EMB_CTL2_NFEN4 (0x08000000UL) + +/* Bit definition for EMB_SOE register */ +#define EMB_SOE_SOE (0x00000001UL) + +/* Bit definition for EMB_STAT register */ +#define EMB_STAT_PWMSF_POS (1U) +#define EMB_STAT_PWMSF (0x00000002UL) +#define EMB_STAT_CMPF_POS (2U) +#define EMB_STAT_CMPF (0x00000004UL) +#define EMB_STAT_OSF_POS (3U) +#define EMB_STAT_OSF (0x00000008UL) +#define EMB_STAT_PWMST_POS (5U) +#define EMB_STAT_PWMST (0x00000020UL) +#define EMB_STAT_CMPST_POS (6U) +#define EMB_STAT_CMPST (0x00000040UL) +#define EMB_STAT_OSST_POS (7U) +#define EMB_STAT_OSST (0x00000080UL) +#define EMB_STAT_PORTINF1_POS (8U) +#define EMB_STAT_PORTINF1 (0x00000100UL) +#define EMB_STAT_PORTINF2_POS (9U) +#define EMB_STAT_PORTINF2 (0x00000200UL) +#define EMB_STAT_PORTINF3_POS (10U) +#define EMB_STAT_PORTINF3 (0x00000400UL) +#define EMB_STAT_PORTINF4_POS (11U) +#define EMB_STAT_PORTINF4 (0x00000800UL) +#define EMB_STAT_PORTINST1_POS (14U) +#define EMB_STAT_PORTINST1 (0x00004000UL) +#define EMB_STAT_PORTINST2_POS (15U) +#define EMB_STAT_PORTINST2 (0x00008000UL) +#define EMB_STAT_PORTINST3_POS (16U) +#define EMB_STAT_PORTINST3 (0x00010000UL) +#define EMB_STAT_PORTINST4_POS (17U) +#define EMB_STAT_PORTINST4 (0x00020000UL) + +/* Bit definition for EMB_STATCLR register */ +#define EMB_STATCLR_PWMSFCLR_POS (1U) +#define EMB_STATCLR_PWMSFCLR (0x00000002UL) +#define EMB_STATCLR_CMPFCLR_POS (2U) +#define EMB_STATCLR_CMPFCLR (0x00000004UL) +#define EMB_STATCLR_OSFCLR_POS (3U) +#define EMB_STATCLR_OSFCLR (0x00000008UL) +#define EMB_STATCLR_PORTINFCLR1_POS (8U) +#define EMB_STATCLR_PORTINFCLR1 (0x00000100UL) +#define EMB_STATCLR_PORTINFCLR2_POS (9U) +#define EMB_STATCLR_PORTINFCLR2 (0x00000200UL) +#define EMB_STATCLR_PORTINFCLR3_POS (10U) +#define EMB_STATCLR_PORTINFCLR3 (0x00000400UL) +#define EMB_STATCLR_PORTINFCLR4_POS (11U) +#define EMB_STATCLR_PORTINFCLR4 (0x00000800UL) + +/* Bit definition for EMB_INTEN register */ +#define EMB_INTEN_PWMSINTEN_POS (1U) +#define EMB_INTEN_PWMSINTEN (0x00000002UL) +#define EMB_INTEN_CMPINTEN_POS (2U) +#define EMB_INTEN_CMPINTEN (0x00000004UL) +#define EMB_INTEN_OSINTEN_POS (3U) +#define EMB_INTEN_OSINTEN (0x00000008UL) +#define EMB_INTEN_PORTINTEN1_POS (8U) +#define EMB_INTEN_PORTINTEN1 (0x00000100UL) +#define EMB_INTEN_PORTINTEN2_POS (9U) +#define EMB_INTEN_PORTINTEN2 (0x00000200UL) +#define EMB_INTEN_PORTINTEN3_POS (10U) +#define EMB_INTEN_PORTINTEN3 (0x00000400UL) +#define EMB_INTEN_PORTINTEN4_POS (11U) +#define EMB_INTEN_PORTINTEN4 (0x00000800UL) + +/* Bit definition for EMB_RLSSEL register */ +#define EMB_RLSSEL_PWMRSEL_POS (1U) +#define EMB_RLSSEL_PWMRSEL (0x00000002UL) +#define EMB_RLSSEL_CMPRSEL_POS (2U) +#define EMB_RLSSEL_CMPRSEL (0x00000004UL) +#define EMB_RLSSEL_OSRSEL_POS (3U) +#define EMB_RLSSEL_OSRSEL (0x00000008UL) +#define EMB_RLSSEL_PORTINRSEL1_POS (8U) +#define EMB_RLSSEL_PORTINRSEL1 (0x00000100UL) +#define EMB_RLSSEL_PORTINRSEL2_POS (9U) +#define EMB_RLSSEL_PORTINRSEL2 (0x00000200UL) +#define EMB_RLSSEL_PORTINRSEL3_POS (10U) +#define EMB_RLSSEL_PORTINRSEL3 (0x00000400UL) +#define EMB_RLSSEL_PORTINRSEL4_POS (11U) +#define EMB_RLSSEL_PORTINRSEL4 (0x00000800UL) + +/******************************************************************************* + Bit definition for Peripheral ETH +*******************************************************************************/ +/* Bit definition for ETH_MAC_IFCONFR register */ +#define ETH_MAC_IFCONFR_IFSEL_POS (0U) +#define ETH_MAC_IFCONFR_IFSEL (0x00000001UL) +#define ETH_MAC_IFCONFR_RCKINV_POS (4U) +#define ETH_MAC_IFCONFR_RCKINV (0x00000010UL) +#define ETH_MAC_IFCONFR_TCKINV_POS (5U) +#define ETH_MAC_IFCONFR_TCKINV (0x00000020UL) + +/* Bit definition for ETH_MAC_CONFIGR register */ +#define ETH_MAC_CONFIGR_RE_POS (2U) +#define ETH_MAC_CONFIGR_RE (0x00000004UL) +#define ETH_MAC_CONFIGR_TE_POS (3U) +#define ETH_MAC_CONFIGR_TE (0x00000008UL) +#define ETH_MAC_CONFIGR_DC_POS (4U) +#define ETH_MAC_CONFIGR_DC (0x00000010UL) +#define ETH_MAC_CONFIGR_BL_POS (5U) +#define ETH_MAC_CONFIGR_BL (0x00000060UL) +#define ETH_MAC_CONFIGR_BL_0 (0x00000020UL) +#define ETH_MAC_CONFIGR_BL_1 (0x00000040UL) +#define ETH_MAC_CONFIGR_ACS_POS (7U) +#define ETH_MAC_CONFIGR_ACS (0x00000080UL) +#define ETH_MAC_CONFIGR_DRTY_POS (9U) +#define ETH_MAC_CONFIGR_DRTY (0x00000200UL) +#define ETH_MAC_CONFIGR_IPCO_POS (10U) +#define ETH_MAC_CONFIGR_IPCO (0x00000400UL) +#define ETH_MAC_CONFIGR_DM_POS (11U) +#define ETH_MAC_CONFIGR_DM (0x00000800UL) +#define ETH_MAC_CONFIGR_LM_POS (12U) +#define ETH_MAC_CONFIGR_LM (0x00001000UL) +#define ETH_MAC_CONFIGR_DO_POS (13U) +#define ETH_MAC_CONFIGR_DO (0x00002000UL) +#define ETH_MAC_CONFIGR_FES_POS (14U) +#define ETH_MAC_CONFIGR_FES (0x00004000UL) +#define ETH_MAC_CONFIGR_DCRS_POS (16U) +#define ETH_MAC_CONFIGR_DCRS (0x00010000UL) +#define ETH_MAC_CONFIGR_IFG_POS (17U) +#define ETH_MAC_CONFIGR_IFG (0x000E0000UL) +#define ETH_MAC_CONFIGR_IFG_0 (0x00020000UL) +#define ETH_MAC_CONFIGR_IFG_1 (0x00040000UL) +#define ETH_MAC_CONFIGR_IFG_2 (0x00080000UL) +#define ETH_MAC_CONFIGR_MJB_POS (22U) +#define ETH_MAC_CONFIGR_MJB (0x00400000UL) +#define ETH_MAC_CONFIGR_MWD_POS (23U) +#define ETH_MAC_CONFIGR_MWD (0x00800000UL) +#define ETH_MAC_CONFIGR_CST_POS (25U) +#define ETH_MAC_CONFIGR_CST (0x02000000UL) +#define ETH_MAC_CONFIGR_SAIRC_POS (28U) +#define ETH_MAC_CONFIGR_SAIRC (0x70000000UL) +#define ETH_MAC_CONFIGR_SAIRC_0 (0x10000000UL) +#define ETH_MAC_CONFIGR_SAIRC_1 (0x20000000UL) +#define ETH_MAC_CONFIGR_SAIRC_2 (0x40000000UL) + +/* Bit definition for ETH_MAC_FLTCTLR register */ +#define ETH_MAC_FLTCTLR_PR_POS (0U) +#define ETH_MAC_FLTCTLR_PR (0x00000001UL) +#define ETH_MAC_FLTCTLR_HUC_POS (1U) +#define ETH_MAC_FLTCTLR_HUC (0x00000002UL) +#define ETH_MAC_FLTCTLR_HMC_POS (2U) +#define ETH_MAC_FLTCTLR_HMC (0x00000004UL) +#define ETH_MAC_FLTCTLR_DAIF_POS (3U) +#define ETH_MAC_FLTCTLR_DAIF (0x00000008UL) +#define ETH_MAC_FLTCTLR_PMF_POS (4U) +#define ETH_MAC_FLTCTLR_PMF (0x00000010UL) +#define ETH_MAC_FLTCTLR_DBF_POS (5U) +#define ETH_MAC_FLTCTLR_DBF (0x00000020UL) +#define ETH_MAC_FLTCTLR_PCF_POS (6U) +#define ETH_MAC_FLTCTLR_PCF (0x000000C0UL) +#define ETH_MAC_FLTCTLR_PCF_0 (0x00000040UL) +#define ETH_MAC_FLTCTLR_PCF_1 (0x00000080UL) +#define ETH_MAC_FLTCTLR_SAIF_POS (8U) +#define ETH_MAC_FLTCTLR_SAIF (0x00000100UL) +#define ETH_MAC_FLTCTLR_SAF_POS (9U) +#define ETH_MAC_FLTCTLR_SAF (0x00000200UL) +#define ETH_MAC_FLTCTLR_HPF_POS (10U) +#define ETH_MAC_FLTCTLR_HPF (0x00000400UL) +#define ETH_MAC_FLTCTLR_VTFE_POS (16U) +#define ETH_MAC_FLTCTLR_VTFE (0x00010000UL) +#define ETH_MAC_FLTCTLR_IPFE_POS (20U) +#define ETH_MAC_FLTCTLR_IPFE (0x00100000UL) +#define ETH_MAC_FLTCTLR_DNTU_POS (21U) +#define ETH_MAC_FLTCTLR_DNTU (0x00200000UL) +#define ETH_MAC_FLTCTLR_RA_POS (31U) +#define ETH_MAC_FLTCTLR_RA (0x80000000UL) + +/* Bit definition for ETH_MAC_HASHTHR register */ +#define ETH_MAC_HASHTHR_HTH (0xFFFFFFFFUL) + +/* Bit definition for ETH_MAC_HASHTLR register */ +#define ETH_MAC_HASHTLR_HTL (0xFFFFFFFFUL) + +/* Bit definition for ETH_MAC_SMIADDR register */ +#define ETH_MAC_SMIADDR_SMIB_POS (0U) +#define ETH_MAC_SMIADDR_SMIB (0x00000001UL) +#define ETH_MAC_SMIADDR_SMIW_POS (1U) +#define ETH_MAC_SMIADDR_SMIW (0x00000002UL) +#define ETH_MAC_SMIADDR_SMIC_POS (2U) +#define ETH_MAC_SMIADDR_SMIC (0x0000003CUL) +#define ETH_MAC_SMIADDR_SMIC_0 (0x00000004UL) +#define ETH_MAC_SMIADDR_SMIC_1 (0x00000008UL) +#define ETH_MAC_SMIADDR_SMIC_2 (0x00000010UL) +#define ETH_MAC_SMIADDR_SMIC_3 (0x00000020UL) +#define ETH_MAC_SMIADDR_SMIR_POS (6U) +#define ETH_MAC_SMIADDR_SMIR (0x000007C0UL) +#define ETH_MAC_SMIADDR_SMIR_0 (0x00000040UL) +#define ETH_MAC_SMIADDR_SMIR_1 (0x00000080UL) +#define ETH_MAC_SMIADDR_SMIR_2 (0x00000100UL) +#define ETH_MAC_SMIADDR_SMIR_3 (0x00000200UL) +#define ETH_MAC_SMIADDR_SMIR_4 (0x00000400UL) +#define ETH_MAC_SMIADDR_SMIA_POS (11U) +#define ETH_MAC_SMIADDR_SMIA (0x0000F800UL) +#define ETH_MAC_SMIADDR_SMIA_0 (0x00000800UL) +#define ETH_MAC_SMIADDR_SMIA_1 (0x00001000UL) +#define ETH_MAC_SMIADDR_SMIA_2 (0x00002000UL) +#define ETH_MAC_SMIADDR_SMIA_3 (0x00004000UL) +#define ETH_MAC_SMIADDR_SMIA_4 (0x00008000UL) + +/* Bit definition for ETH_MAC_SMIDATR register */ +#define ETH_MAC_SMIDATR_SMID (0x0000FFFFUL) + +/* Bit definition for ETH_MAC_FLOCTLR register */ +#define ETH_MAC_FLOCTLR_FCA_BPA_POS (0U) +#define ETH_MAC_FLOCTLR_FCA_BPA (0x00000001UL) +#define ETH_MAC_FLOCTLR_TFE_POS (1U) +#define ETH_MAC_FLOCTLR_TFE (0x00000002UL) +#define ETH_MAC_FLOCTLR_RFE_POS (2U) +#define ETH_MAC_FLOCTLR_RFE (0x00000004UL) +#define ETH_MAC_FLOCTLR_UNP_POS (3U) +#define ETH_MAC_FLOCTLR_UNP (0x00000008UL) +#define ETH_MAC_FLOCTLR_PLT_POS (4U) +#define ETH_MAC_FLOCTLR_PLT (0x00000030UL) +#define ETH_MAC_FLOCTLR_PLT_0 (0x00000010UL) +#define ETH_MAC_FLOCTLR_PLT_1 (0x00000020UL) +#define ETH_MAC_FLOCTLR_DZPQ_POS (7U) +#define ETH_MAC_FLOCTLR_DZPQ (0x00000080UL) +#define ETH_MAC_FLOCTLR_PAUSET_POS (16U) +#define ETH_MAC_FLOCTLR_PAUSET (0xFFFF0000UL) + +/* Bit definition for ETH_MAC_VTAFLTR register */ +#define ETH_MAC_VTAFLTR_VLFLT_POS (0U) +#define ETH_MAC_VTAFLTR_VLFLT (0x0000FFFFUL) +#define ETH_MAC_VTAFLTR_VTAL_POS (16U) +#define ETH_MAC_VTAFLTR_VTAL (0x00010000UL) +#define ETH_MAC_VTAFLTR_VTIM_POS (17U) +#define ETH_MAC_VTAFLTR_VTIM (0x00020000UL) +#define ETH_MAC_VTAFLTR_VTHM_POS (19U) +#define ETH_MAC_VTAFLTR_VTHM (0x00080000UL) + +/* Bit definition for ETH_MAC_MACSTSR register */ +#define ETH_MAC_MACSTSR_MREA_POS (0U) +#define ETH_MAC_MACSTSR_MREA (0x00000001UL) +#define ETH_MAC_MACSTSR_MRS_POS (1U) +#define ETH_MAC_MACSTSR_MRS (0x00000006UL) +#define ETH_MAC_MACSTSR_MRS_0 (0x00000002UL) +#define ETH_MAC_MACSTSR_MRS_1 (0x00000004UL) +#define ETH_MAC_MACSTSR_RFWA_POS (4U) +#define ETH_MAC_MACSTSR_RFWA (0x00000010UL) +#define ETH_MAC_MACSTSR_RFRS_POS (5U) +#define ETH_MAC_MACSTSR_RFRS (0x00000060UL) +#define ETH_MAC_MACSTSR_RFRS_0 (0x00000020UL) +#define ETH_MAC_MACSTSR_RFRS_1 (0x00000040UL) +#define ETH_MAC_MACSTSR_RFFL_POS (8U) +#define ETH_MAC_MACSTSR_RFFL (0x00000300UL) +#define ETH_MAC_MACSTSR_RFFL_0 (0x00000100UL) +#define ETH_MAC_MACSTSR_RFFL_1 (0x00000200UL) +#define ETH_MAC_MACSTSR_MTEA_POS (16U) +#define ETH_MAC_MACSTSR_MTEA (0x00010000UL) +#define ETH_MAC_MACSTSR_MTS_POS (17U) +#define ETH_MAC_MACSTSR_MTS (0x00060000UL) +#define ETH_MAC_MACSTSR_MTS_0 (0x00020000UL) +#define ETH_MAC_MACSTSR_MTS_1 (0x00040000UL) +#define ETH_MAC_MACSTSR_MTP_POS (19U) +#define ETH_MAC_MACSTSR_MTP (0x00080000UL) +#define ETH_MAC_MACSTSR_TFRS_POS (20U) +#define ETH_MAC_MACSTSR_TFRS (0x00300000UL) +#define ETH_MAC_MACSTSR_TFRS_0 (0x00100000UL) +#define ETH_MAC_MACSTSR_TFRS_1 (0x00200000UL) +#define ETH_MAC_MACSTSR_TFWA_POS (22U) +#define ETH_MAC_MACSTSR_TFWA (0x00400000UL) +#define ETH_MAC_MACSTSR_TFNE_POS (24U) +#define ETH_MAC_MACSTSR_TFNE (0x01000000UL) +#define ETH_MAC_MACSTSR_TFF_POS (25U) +#define ETH_MAC_MACSTSR_TFF (0x02000000UL) + +/* Bit definition for ETH_MAC_RTWKFFR register */ +#define ETH_MAC_RTWKFFR_WKUPFRMFT (0xFFFFFFFFUL) + +/* Bit definition for ETH_MAC_PMTCTLR register */ +#define ETH_MAC_PMTCTLR_PWDN_POS (0U) +#define ETH_MAC_PMTCTLR_PWDN (0x00000001UL) +#define ETH_MAC_PMTCTLR_MPEN_POS (1U) +#define ETH_MAC_PMTCTLR_MPEN (0x00000002UL) +#define ETH_MAC_PMTCTLR_WKEN_POS (2U) +#define ETH_MAC_PMTCTLR_WKEN (0x00000004UL) +#define ETH_MAC_PMTCTLR_MPFR_POS (5U) +#define ETH_MAC_PMTCTLR_MPFR (0x00000020UL) +#define ETH_MAC_PMTCTLR_WKFR_POS (6U) +#define ETH_MAC_PMTCTLR_WKFR (0x00000040UL) +#define ETH_MAC_PMTCTLR_GLUB_POS (9U) +#define ETH_MAC_PMTCTLR_GLUB (0x00000200UL) +#define ETH_MAC_PMTCTLR_RTWKTR_POS (10U) +#define ETH_MAC_PMTCTLR_RTWKTR (0x00000400UL) +#define ETH_MAC_PMTCTLR_RTWKPT_POS (24U) +#define ETH_MAC_PMTCTLR_RTWKPT (0x07000000UL) +#define ETH_MAC_PMTCTLR_RTWKPT_0 (0x01000000UL) +#define ETH_MAC_PMTCTLR_RTWKPT_1 (0x02000000UL) +#define ETH_MAC_PMTCTLR_RTWKPT_2 (0x04000000UL) +#define ETH_MAC_PMTCTLR_RTWKFR_POS (31U) +#define ETH_MAC_PMTCTLR_RTWKFR (0x80000000UL) + +/* Bit definition for ETH_MAC_INTSTSR register */ +#define ETH_MAC_INTSTSR_PMTIS_POS (3U) +#define ETH_MAC_INTSTSR_PMTIS (0x00000008UL) +#define ETH_MAC_INTSTSR_MMCIS_POS (4U) +#define ETH_MAC_INTSTSR_MMCIS (0x00000010UL) +#define ETH_MAC_INTSTSR_MMCRXIS_POS (5U) +#define ETH_MAC_INTSTSR_MMCRXIS (0x00000020UL) +#define ETH_MAC_INTSTSR_MMCTXIS_POS (6U) +#define ETH_MAC_INTSTSR_MMCTXIS (0x00000040UL) +#define ETH_MAC_INTSTSR_TSPIS_POS (9U) +#define ETH_MAC_INTSTSR_TSPIS (0x00000200UL) + +/* Bit definition for ETH_MAC_INTMSKR register */ +#define ETH_MAC_INTMSKR_PMTIM_POS (3U) +#define ETH_MAC_INTMSKR_PMTIM (0x00000008UL) +#define ETH_MAC_INTMSKR_TSPIM_POS (9U) +#define ETH_MAC_INTMSKR_TSPIM (0x00000200UL) + +/* Bit definition for ETH_MAC_MACADHR0 register */ +#define ETH_MAC_MACADHR0_ADDRH0_POS (0U) +#define ETH_MAC_MACADHR0_ADDRH0 (0x0000FFFFUL) +#define ETH_MAC_MACADHR0_AE0_POS (31U) +#define ETH_MAC_MACADHR0_AE0 (0x80000000UL) + +/* Bit definition for ETH_MAC_MACADLR0 register */ +#define ETH_MAC_MACADLR0_ADDRL0 (0xFFFFFFFFUL) + +/* Bit definition for ETH_MAC_MACADHR1 register */ +#define ETH_MAC_MACADHR1_ADDRH1_POS (0U) +#define ETH_MAC_MACADHR1_ADDRH1 (0x0000FFFFUL) +#define ETH_MAC_MACADHR1_MBC1_POS (24U) +#define ETH_MAC_MACADHR1_MBC1 (0x3F000000UL) +#define ETH_MAC_MACADHR1_MBC1_0 (0x01000000UL) +#define ETH_MAC_MACADHR1_MBC1_1 (0x02000000UL) +#define ETH_MAC_MACADHR1_MBC1_2 (0x04000000UL) +#define ETH_MAC_MACADHR1_MBC1_3 (0x08000000UL) +#define ETH_MAC_MACADHR1_MBC1_4 (0x10000000UL) +#define ETH_MAC_MACADHR1_MBC1_5 (0x20000000UL) +#define ETH_MAC_MACADHR1_SA1_POS (30U) +#define ETH_MAC_MACADHR1_SA1 (0x40000000UL) +#define ETH_MAC_MACADHR1_AE1_POS (31U) +#define ETH_MAC_MACADHR1_AE1 (0x80000000UL) + +/* Bit definition for ETH_MAC_MACADLR1 register */ +#define ETH_MAC_MACADLR1_ADDRL1 (0xFFFFFFFFUL) + +/* Bit definition for ETH_MAC_MACADHR2 register */ +#define ETH_MAC_MACADHR2_ADDRH2_POS (0U) +#define ETH_MAC_MACADHR2_ADDRH2 (0x0000FFFFUL) +#define ETH_MAC_MACADHR2_MBC2_POS (24U) +#define ETH_MAC_MACADHR2_MBC2 (0x3F000000UL) +#define ETH_MAC_MACADHR2_MBC2_0 (0x01000000UL) +#define ETH_MAC_MACADHR2_MBC2_1 (0x02000000UL) +#define ETH_MAC_MACADHR2_MBC2_2 (0x04000000UL) +#define ETH_MAC_MACADHR2_MBC2_3 (0x08000000UL) +#define ETH_MAC_MACADHR2_MBC2_4 (0x10000000UL) +#define ETH_MAC_MACADHR2_MBC2_5 (0x20000000UL) +#define ETH_MAC_MACADHR2_SA2_POS (30U) +#define ETH_MAC_MACADHR2_SA2 (0x40000000UL) +#define ETH_MAC_MACADHR2_AE2_POS (31U) +#define ETH_MAC_MACADHR2_AE2 (0x80000000UL) + +/* Bit definition for ETH_MAC_MACADLR2 register */ +#define ETH_MAC_MACADLR2_ADDRL2 (0xFFFFFFFFUL) + +/* Bit definition for ETH_MAC_MACADHR3 register */ +#define ETH_MAC_MACADHR3_ADDRH3_POS (0U) +#define ETH_MAC_MACADHR3_ADDRH3 (0x0000FFFFUL) +#define ETH_MAC_MACADHR3_MBC3_POS (24U) +#define ETH_MAC_MACADHR3_MBC3 (0x3F000000UL) +#define ETH_MAC_MACADHR3_MBC3_0 (0x01000000UL) +#define ETH_MAC_MACADHR3_MBC3_1 (0x02000000UL) +#define ETH_MAC_MACADHR3_MBC3_2 (0x04000000UL) +#define ETH_MAC_MACADHR3_MBC3_3 (0x08000000UL) +#define ETH_MAC_MACADHR3_MBC3_4 (0x10000000UL) +#define ETH_MAC_MACADHR3_MBC3_5 (0x20000000UL) +#define ETH_MAC_MACADHR3_SA3_POS (30U) +#define ETH_MAC_MACADHR3_SA3 (0x40000000UL) +#define ETH_MAC_MACADHR3_AE3_POS (31U) +#define ETH_MAC_MACADHR3_AE3 (0x80000000UL) + +/* Bit definition for ETH_MAC_MACADLR3 register */ +#define ETH_MAC_MACADLR3_ADDRL3 (0xFFFFFFFFUL) + +/* Bit definition for ETH_MAC_MACADHR4 register */ +#define ETH_MAC_MACADHR4_ADDRH4_POS (0U) +#define ETH_MAC_MACADHR4_ADDRH4 (0x0000FFFFUL) +#define ETH_MAC_MACADHR4_MBC4_POS (24U) +#define ETH_MAC_MACADHR4_MBC4 (0x3F000000UL) +#define ETH_MAC_MACADHR4_MBC4_0 (0x01000000UL) +#define ETH_MAC_MACADHR4_MBC4_1 (0x02000000UL) +#define ETH_MAC_MACADHR4_MBC4_2 (0x04000000UL) +#define ETH_MAC_MACADHR4_MBC4_3 (0x08000000UL) +#define ETH_MAC_MACADHR4_MBC4_4 (0x10000000UL) +#define ETH_MAC_MACADHR4_MBC4_5 (0x20000000UL) +#define ETH_MAC_MACADHR4_SA4_POS (30U) +#define ETH_MAC_MACADHR4_SA4 (0x40000000UL) +#define ETH_MAC_MACADHR4_AE4_POS (31U) +#define ETH_MAC_MACADHR4_AE4 (0x80000000UL) + +/* Bit definition for ETH_MAC_MACADLR4 register */ +#define ETH_MAC_MACADLR4_ADDRL4 (0xFFFFFFFFUL) + +/* Bit definition for ETH_MMC_MMCCTLR register */ +#define ETH_MMC_MMCCTLR_CRST_POS (0U) +#define ETH_MMC_MMCCTLR_CRST (0x00000001UL) +#define ETH_MMC_MMCCTLR_COS_POS (1U) +#define ETH_MMC_MMCCTLR_COS (0x00000002UL) +#define ETH_MMC_MMCCTLR_ROR_POS (2U) +#define ETH_MMC_MMCCTLR_ROR (0x00000004UL) +#define ETH_MMC_MMCCTLR_MCF_POS (3U) +#define ETH_MMC_MMCCTLR_MCF (0x00000008UL) +#define ETH_MMC_MMCCTLR_MCPSET_POS (4U) +#define ETH_MMC_MMCCTLR_MCPSET (0x00000010UL) +#define ETH_MMC_MMCCTLR_MCPSEL_POS (5U) +#define ETH_MMC_MMCCTLR_MCPSEL (0x00000020UL) + +/* Bit definition for ETH_MMC_REVSTSR register */ +#define ETH_MMC_REVSTSR_RXBGIS_POS (3U) +#define ETH_MMC_REVSTSR_RXBGIS (0x00000008UL) +#define ETH_MMC_REVSTSR_RXMGIS_POS (4U) +#define ETH_MMC_REVSTSR_RXMGIS (0x00000010UL) +#define ETH_MMC_REVSTSR_RXCEIS_POS (5U) +#define ETH_MMC_REVSTSR_RXCEIS (0x00000020UL) +#define ETH_MMC_REVSTSR_RXAEIS_POS (6U) +#define ETH_MMC_REVSTSR_RXAEIS (0x00000040UL) +#define ETH_MMC_REVSTSR_RXREIS_POS (7U) +#define ETH_MMC_REVSTSR_RXREIS (0x00000080UL) +#define ETH_MMC_REVSTSR_RXUGIS_POS (17U) +#define ETH_MMC_REVSTSR_RXUGIS (0x00020000UL) +#define ETH_MMC_REVSTSR_RXLEIS_POS (18U) +#define ETH_MMC_REVSTSR_RXLEIS (0x00040000UL) +#define ETH_MMC_REVSTSR_RXOEIS_POS (19U) +#define ETH_MMC_REVSTSR_RXOEIS (0x00080000UL) + +/* Bit definition for ETH_MMC_TRSSTSR register */ +#define ETH_MMC_TRSSTSR_TXBGIS_POS (2U) +#define ETH_MMC_TRSSTSR_TXBGIS (0x00000004UL) +#define ETH_MMC_TRSSTSR_TXMGIS_POS (3U) +#define ETH_MMC_TRSSTSR_TXMGIS (0x00000008UL) +#define ETH_MMC_TRSSTSR_TXDEEIS_POS (16U) +#define ETH_MMC_TRSSTSR_TXDEEIS (0x00010000UL) +#define ETH_MMC_TRSSTSR_TXLCEIS_POS (17U) +#define ETH_MMC_TRSSTSR_TXLCEIS (0x00020000UL) +#define ETH_MMC_TRSSTSR_TXECEIS_POS (18U) +#define ETH_MMC_TRSSTSR_TXECEIS (0x00040000UL) +#define ETH_MMC_TRSSTSR_TXCAEIS_POS (19U) +#define ETH_MMC_TRSSTSR_TXCAEIS (0x00080000UL) +#define ETH_MMC_TRSSTSR_TXUGIS_POS (21U) +#define ETH_MMC_TRSSTSR_TXUGIS (0x00200000UL) +#define ETH_MMC_TRSSTSR_TXEDEIS_POS (22U) +#define ETH_MMC_TRSSTSR_TXEDEIS (0x00400000UL) + +/* Bit definition for ETH_MMC_RITCTLR register */ +#define ETH_MMC_RITCTLR_RXBGIM_POS (3U) +#define ETH_MMC_RITCTLR_RXBGIM (0x00000008UL) +#define ETH_MMC_RITCTLR_RXMGIM_POS (4U) +#define ETH_MMC_RITCTLR_RXMGIM (0x00000010UL) +#define ETH_MMC_RITCTLR_RXCEIM_POS (5U) +#define ETH_MMC_RITCTLR_RXCEIM (0x00000020UL) +#define ETH_MMC_RITCTLR_RXAEIM_POS (6U) +#define ETH_MMC_RITCTLR_RXAEIM (0x00000040UL) +#define ETH_MMC_RITCTLR_RXREIM_POS (7U) +#define ETH_MMC_RITCTLR_RXREIM (0x00000080UL) +#define ETH_MMC_RITCTLR_RXUGIM_POS (17U) +#define ETH_MMC_RITCTLR_RXUGIM (0x00020000UL) +#define ETH_MMC_RITCTLR_RXLEIM_POS (18U) +#define ETH_MMC_RITCTLR_RXLEIM (0x00040000UL) +#define ETH_MMC_RITCTLR_RXOEIM_POS (19U) +#define ETH_MMC_RITCTLR_RXOEIM (0x00080000UL) + +/* Bit definition for ETH_MMC_TITCTLR register */ +#define ETH_MMC_TITCTLR_TXBGIM_POS (2U) +#define ETH_MMC_TITCTLR_TXBGIM (0x00000004UL) +#define ETH_MMC_TITCTLR_TXMGIM_POS (3U) +#define ETH_MMC_TITCTLR_TXMGIM (0x00000008UL) +#define ETH_MMC_TITCTLR_TXDEEIM_POS (16U) +#define ETH_MMC_TITCTLR_TXDEEIM (0x00010000UL) +#define ETH_MMC_TITCTLR_TXLCEIM_POS (17U) +#define ETH_MMC_TITCTLR_TXLCEIM (0x00020000UL) +#define ETH_MMC_TITCTLR_TXECEIM_POS (18U) +#define ETH_MMC_TITCTLR_TXECEIM (0x00040000UL) +#define ETH_MMC_TITCTLR_TXCAEIM_POS (19U) +#define ETH_MMC_TITCTLR_TXCAEIM (0x00080000UL) +#define ETH_MMC_TITCTLR_TXUGIM_POS (21U) +#define ETH_MMC_TITCTLR_TXUGIM (0x00200000UL) +#define ETH_MMC_TITCTLR_TXEDEIM_POS (22U) +#define ETH_MMC_TITCTLR_TXEDEIM (0x00400000UL) + +/* Bit definition for ETH_MMC_TXBRGFR register */ +#define ETH_MMC_TXBRGFR_TXBRGCNT (0x0000FFFFUL) + +/* Bit definition for ETH_MMC_TXMUGFR register */ +#define ETH_MMC_TXMUGFR_TXMUGCNT (0x0000FFFFUL) + +/* Bit definition for ETH_MMC_TXDEEFR register */ +#define ETH_MMC_TXDEEFR_TXDEECNT (0x0000FFFFUL) + +/* Bit definition for ETH_MMC_TXLCEFR register */ +#define ETH_MMC_TXLCEFR_TXLCECNT (0x0000FFFFUL) + +/* Bit definition for ETH_MMC_TXECEFR register */ +#define ETH_MMC_TXECEFR_TXECECNT (0x0000FFFFUL) + +/* Bit definition for ETH_MMC_TXCAEFR register */ +#define ETH_MMC_TXCAEFR_TXCAECNT (0x0000FFFFUL) + +/* Bit definition for ETH_MMC_TXUNGFR register */ +#define ETH_MMC_TXUNGFR_TXUNGCNT (0x0000FFFFUL) + +/* Bit definition for ETH_MMC_TXEDEFR register */ +#define ETH_MMC_TXEDEFR_TXEDECNT (0x0000FFFFUL) + +/* Bit definition for ETH_MMC_RXBRGFR register */ +#define ETH_MMC_RXBRGFR_RXBRGCNT (0x0000FFFFUL) + +/* Bit definition for ETH_MMC_RXMUGFR register */ +#define ETH_MMC_RXMUGFR_RXMUGCNT (0x0000FFFFUL) + +/* Bit definition for ETH_MMC_RXCREFR register */ +#define ETH_MMC_RXCREFR_RXCRECNT (0x0000FFFFUL) + +/* Bit definition for ETH_MMC_RXALEFR register */ +#define ETH_MMC_RXALEFR_RXALECNT (0x0000FFFFUL) + +/* Bit definition for ETH_MMC_RXRUEFR register */ +#define ETH_MMC_RXRUEFR_RXRUECNT (0x0000FFFFUL) + +/* Bit definition for ETH_MMC_RXUNGFR register */ +#define ETH_MMC_RXUNGFR_RXUNGCNT (0x0000FFFFUL) + +/* Bit definition for ETH_MMC_RXLEEFR register */ +#define ETH_MMC_RXLEEFR_RXLEECNT (0x0000FFFFUL) + +/* Bit definition for ETH_MMC_RXOREFR register */ +#define ETH_MMC_RXOREFR_RXORECNT (0x0000FFFFUL) + +/* Bit definition for ETH_MAC_L34CTLR register */ +#define ETH_MAC_L34CTLR_L3PEN_POS (0U) +#define ETH_MAC_L34CTLR_L3PEN (0x00000001UL) +#define ETH_MAC_L34CTLR_L3SAM_POS (2U) +#define ETH_MAC_L34CTLR_L3SAM (0x00000004UL) +#define ETH_MAC_L34CTLR_L3SAIM_POS (3U) +#define ETH_MAC_L34CTLR_L3SAIM (0x00000008UL) +#define ETH_MAC_L34CTLR_L3DAM_POS (4U) +#define ETH_MAC_L34CTLR_L3DAM (0x00000010UL) +#define ETH_MAC_L34CTLR_L3DAIM_POS (5U) +#define ETH_MAC_L34CTLR_L3DAIM (0x00000020UL) +#define ETH_MAC_L34CTLR_L3HSBM_POS (6U) +#define ETH_MAC_L34CTLR_L3HSBM (0x000007C0UL) +#define ETH_MAC_L34CTLR_L3HSBM_0 (0x00000040UL) +#define ETH_MAC_L34CTLR_L3HSBM_1 (0x00000080UL) +#define ETH_MAC_L34CTLR_L3HSBM_2 (0x00000100UL) +#define ETH_MAC_L34CTLR_L3HSBM_3 (0x00000200UL) +#define ETH_MAC_L34CTLR_L3HSBM_4 (0x00000400UL) +#define ETH_MAC_L34CTLR_L3HDBM_POS (11U) +#define ETH_MAC_L34CTLR_L3HDBM (0x0000F800UL) +#define ETH_MAC_L34CTLR_L3HDBM_0 (0x00000800UL) +#define ETH_MAC_L34CTLR_L3HDBM_1 (0x00001000UL) +#define ETH_MAC_L34CTLR_L3HDBM_2 (0x00002000UL) +#define ETH_MAC_L34CTLR_L3HDBM_3 (0x00004000UL) +#define ETH_MAC_L34CTLR_L3HDBM_4 (0x00008000UL) +#define ETH_MAC_L34CTLR_L4PEN_POS (16U) +#define ETH_MAC_L34CTLR_L4PEN (0x00010000UL) +#define ETH_MAC_L34CTLR_L4SPM_POS (18U) +#define ETH_MAC_L34CTLR_L4SPM (0x00040000UL) +#define ETH_MAC_L34CTLR_L4SPIM_POS (19U) +#define ETH_MAC_L34CTLR_L4SPIM (0x00080000UL) +#define ETH_MAC_L34CTLR_L4DPM_POS (20U) +#define ETH_MAC_L34CTLR_L4DPM (0x00100000UL) +#define ETH_MAC_L34CTLR_L4DPIM_POS (21U) +#define ETH_MAC_L34CTLR_L4DPIM (0x00200000UL) + +/* Bit definition for ETH_MAC_L4PORTR register */ +#define ETH_MAC_L4PORTR_L4SPVAL_POS (0U) +#define ETH_MAC_L4PORTR_L4SPVAL (0x0000FFFFUL) +#define ETH_MAC_L4PORTR_L4DPVAL_POS (16U) +#define ETH_MAC_L4PORTR_L4DPVAL (0xFFFF0000UL) + +/* Bit definition for ETH_MAC_L3ADDRR0 register */ +#define ETH_MAC_L3ADDRR0_L3ADDR0 (0xFFFFFFFFUL) + +/* Bit definition for ETH_MAC_L3ADDRR1 register */ +#define ETH_MAC_L3ADDRR1_L3ADDR2 (0xFFFFFFFFUL) + +/* Bit definition for ETH_MAC_L3ADDRR2 register */ +#define ETH_MAC_L3ADDRR2_L3ADDR2 (0xFFFFFFFFUL) + +/* Bit definition for ETH_MAC_L3ADDRR3 register */ +#define ETH_MAC_L3ADDRR3_L3ADDR3 (0xFFFFFFFFUL) + +/* Bit definition for ETH_MAC_VTACTLR register */ +#define ETH_MAC_VTACTLR_VLANV_POS (0U) +#define ETH_MAC_VTACTLR_VLANV (0x0000FFFFUL) +#define ETH_MAC_VTACTLR_VLANC_POS (16U) +#define ETH_MAC_VTACTLR_VLANC (0x00030000UL) +#define ETH_MAC_VTACTLR_VLANC_0 (0x00010000UL) +#define ETH_MAC_VTACTLR_VLANC_1 (0x00020000UL) +#define ETH_MAC_VTACTLR_VLANS_POS (18U) +#define ETH_MAC_VTACTLR_VLANS (0x00040000UL) + +/* Bit definition for ETH_MAC_VLAHTBR register */ +#define ETH_MAC_VLAHTBR_VLHT (0x0000FFFFUL) + +/* Bit definition for ETH_PTP_TSPCTLR register */ +#define ETH_PTP_TSPCTLR_TSPEN_POS (0U) +#define ETH_PTP_TSPCTLR_TSPEN (0x00000001UL) +#define ETH_PTP_TSPCTLR_TSPUPSEL_POS (1U) +#define ETH_PTP_TSPCTLR_TSPUPSEL (0x00000002UL) +#define ETH_PTP_TSPCTLR_TSPINI_POS (2U) +#define ETH_PTP_TSPCTLR_TSPINI (0x00000004UL) +#define ETH_PTP_TSPCTLR_TSPUP_POS (3U) +#define ETH_PTP_TSPCTLR_TSPUP (0x00000008UL) +#define ETH_PTP_TSPCTLR_TSPINT_POS (4U) +#define ETH_PTP_TSPCTLR_TSPINT (0x00000010UL) +#define ETH_PTP_TSPCTLR_TSPADUP_POS (5U) +#define ETH_PTP_TSPCTLR_TSPADUP (0x00000020UL) +#define ETH_PTP_TSPCTLR_TSPEALL_POS (8U) +#define ETH_PTP_TSPCTLR_TSPEALL (0x00000100UL) +#define ETH_PTP_TSPCTLR_TSPSSR_POS (9U) +#define ETH_PTP_TSPCTLR_TSPSSR (0x00000200UL) +#define ETH_PTP_TSPCTLR_TSPVER_POS (10U) +#define ETH_PTP_TSPCTLR_TSPVER (0x00000400UL) +#define ETH_PTP_TSPCTLR_TSPOVETH_POS (11U) +#define ETH_PTP_TSPCTLR_TSPOVETH (0x00000800UL) +#define ETH_PTP_TSPCTLR_TSPOVIPV6_POS (12U) +#define ETH_PTP_TSPCTLR_TSPOVIPV6 (0x00001000UL) +#define ETH_PTP_TSPCTLR_TSPOVIPV4_POS (13U) +#define ETH_PTP_TSPCTLR_TSPOVIPV4 (0x00002000UL) +#define ETH_PTP_TSPCTLR_TSPMTSEL_POS (14U) +#define ETH_PTP_TSPCTLR_TSPMTSEL (0x0003C000UL) +#define ETH_PTP_TSPCTLR_TSPMTSEL_0 (0x00004000UL) +#define ETH_PTP_TSPCTLR_TSPMTSEL_1 (0x00008000UL) +#define ETH_PTP_TSPCTLR_TSPMTSEL_2 (0x00010000UL) +#define ETH_PTP_TSPCTLR_TSPMTSEL_3 (0x00020000UL) +#define ETH_PTP_TSPCTLR_TSPADF_POS (18U) +#define ETH_PTP_TSPCTLR_TSPADF (0x00040000UL) + +/* Bit definition for ETH_PTP_TSPNSAR register */ +#define ETH_PTP_TSPNSAR_TSPNSEADD (0x000000FFUL) + +/* Bit definition for ETH_PTP_TMSSECR register */ +#define ETH_PTP_TMSSECR_TSPSYSSEC (0xFFFFFFFFUL) + +/* Bit definition for ETH_PTP_TMSNSER register */ +#define ETH_PTP_TMSNSER_TSPSYSNSEC (0xFFFFFFFFUL) + +/* Bit definition for ETH_PTP_TMUSECR register */ +#define ETH_PTP_TMUSECR_TSPUPSEC (0xFFFFFFFFUL) + +/* Bit definition for ETH_PTP_TMUNSER register */ +#define ETH_PTP_TMUNSER_TSPUPNSE_POS (0U) +#define ETH_PTP_TMUNSER_TSPUPNSE (0x7FFFFFFFUL) +#define ETH_PTP_TMUNSER_TSPUPNS_POS (31U) +#define ETH_PTP_TMUNSER_TSPUPNS (0x80000000UL) + +/* Bit definition for ETH_PTP_TSPADDR register */ +#define ETH_PTP_TSPADDR_TSPADD (0xFFFFFFFFUL) + +/* Bit definition for ETH_PTP_TMTSECR0 register */ +#define ETH_PTP_TMTSECR0_TSPTAGSEC0 (0xFFFFFFFFUL) + +/* Bit definition for ETH_PTP_TMTNSER0 register */ +#define ETH_PTP_TMTNSER0_TSPTAGNSEC0 (0xFFFFFFFFUL) + +/* Bit definition for ETH_PTP_TSPSTSR register */ +#define ETH_PTP_TSPSTSR_TSOVF_POS (0U) +#define ETH_PTP_TSPSTSR_TSOVF (0x00000001UL) +#define ETH_PTP_TSPSTSR_TSTAR0_POS (1U) +#define ETH_PTP_TSPSTSR_TSTAR0 (0x00000002UL) +#define ETH_PTP_TSPSTSR_TSERR0_POS (3U) +#define ETH_PTP_TSPSTSR_TSERR0 (0x00000008UL) +#define ETH_PTP_TSPSTSR_TSTAR1_POS (4U) +#define ETH_PTP_TSPSTSR_TSTAR1 (0x00000010UL) +#define ETH_PTP_TSPSTSR_TSERR1_POS (5U) +#define ETH_PTP_TSPSTSR_TSERR1 (0x00000020UL) + +/* Bit definition for ETH_PTP_PPSCTLR register */ +#define ETH_PTP_PPSCTLR_PPSFRE0_POS (0U) +#define ETH_PTP_PPSCTLR_PPSFRE0 (0x0000000FUL) +#define ETH_PTP_PPSCTLR_PPSFRE0_0 (0x00000001UL) +#define ETH_PTP_PPSCTLR_PPSFRE0_1 (0x00000002UL) +#define ETH_PTP_PPSCTLR_PPSFRE0_2 (0x00000004UL) +#define ETH_PTP_PPSCTLR_PPSFRE0_3 (0x00000008UL) +#define ETH_PTP_PPSCTLR_PPSOMD_POS (4U) +#define ETH_PTP_PPSCTLR_PPSOMD (0x00000010UL) +#define ETH_PTP_PPSCTLR_TT0SEL_POS (5U) +#define ETH_PTP_PPSCTLR_TT0SEL (0x00000060UL) +#define ETH_PTP_PPSCTLR_TT0SEL_0 (0x00000020UL) +#define ETH_PTP_PPSCTLR_TT0SEL_1 (0x00000040UL) +#define ETH_PTP_PPSCTLR_PPSFRE1_POS (8U) +#define ETH_PTP_PPSCTLR_PPSFRE1 (0x00000700UL) +#define ETH_PTP_PPSCTLR_PPSFRE1_0 (0x00000100UL) +#define ETH_PTP_PPSCTLR_PPSFRE1_1 (0x00000200UL) +#define ETH_PTP_PPSCTLR_PPSFRE1_2 (0x00000400UL) +#define ETH_PTP_PPSCTLR_TT1SEL_POS (13U) +#define ETH_PTP_PPSCTLR_TT1SEL (0x00006000UL) +#define ETH_PTP_PPSCTLR_TT1SEL_0 (0x00002000UL) +#define ETH_PTP_PPSCTLR_TT1SEL_1 (0x00004000UL) + +/* Bit definition for ETH_PTP_TMTSECR1 register */ +#define ETH_PTP_TMTSECR1_TSPTAGSEC1 (0xFFFFFFFFUL) + +/* Bit definition for ETH_PTP_TMTNSER1 register */ +#define ETH_PTP_TMTNSER1_TSPTAGNSEC1 (0xFFFFFFFFUL) + +/* Bit definition for ETH_DMA_BUSMODR register */ +#define ETH_DMA_BUSMODR_SWR_POS (0U) +#define ETH_DMA_BUSMODR_SWR (0x00000001UL) +#define ETH_DMA_BUSMODR_DMAA_POS (1U) +#define ETH_DMA_BUSMODR_DMAA (0x00000002UL) +#define ETH_DMA_BUSMODR_DSL_POS (2U) +#define ETH_DMA_BUSMODR_DSL (0x0000007CUL) +#define ETH_DMA_BUSMODR_DSL_0 (0x00000004UL) +#define ETH_DMA_BUSMODR_DSL_1 (0x00000008UL) +#define ETH_DMA_BUSMODR_DSL_2 (0x00000010UL) +#define ETH_DMA_BUSMODR_DSL_3 (0x00000020UL) +#define ETH_DMA_BUSMODR_DSL_4 (0x00000040UL) +#define ETH_DMA_BUSMODR_DSEN_POS (7U) +#define ETH_DMA_BUSMODR_DSEN (0x00000080UL) +#define ETH_DMA_BUSMODR_TPBL_POS (8U) +#define ETH_DMA_BUSMODR_TPBL (0x00003F00UL) +#define ETH_DMA_BUSMODR_TPBL_0 (0x00000100UL) +#define ETH_DMA_BUSMODR_TPBL_1 (0x00000200UL) +#define ETH_DMA_BUSMODR_TPBL_2 (0x00000400UL) +#define ETH_DMA_BUSMODR_TPBL_3 (0x00000800UL) +#define ETH_DMA_BUSMODR_TPBL_4 (0x00001000UL) +#define ETH_DMA_BUSMODR_TPBL_5 (0x00002000UL) +#define ETH_DMA_BUSMODR_PRAT_POS (14U) +#define ETH_DMA_BUSMODR_PRAT (0x0000C000UL) +#define ETH_DMA_BUSMODR_PRAT_0 (0x00004000UL) +#define ETH_DMA_BUSMODR_PRAT_1 (0x00008000UL) +#define ETH_DMA_BUSMODR_FBST_POS (16U) +#define ETH_DMA_BUSMODR_FBST (0x00010000UL) +#define ETH_DMA_BUSMODR_RPBL_POS (17U) +#define ETH_DMA_BUSMODR_RPBL (0x007E0000UL) +#define ETH_DMA_BUSMODR_RPBL_0 (0x00020000UL) +#define ETH_DMA_BUSMODR_RPBL_1 (0x00040000UL) +#define ETH_DMA_BUSMODR_RPBL_2 (0x00080000UL) +#define ETH_DMA_BUSMODR_RPBL_3 (0x00100000UL) +#define ETH_DMA_BUSMODR_RPBL_4 (0x00200000UL) +#define ETH_DMA_BUSMODR_RPBL_5 (0x00400000UL) +#define ETH_DMA_BUSMODR_SPBL_POS (23U) +#define ETH_DMA_BUSMODR_SPBL (0x00800000UL) +#define ETH_DMA_BUSMODR_M8PBL_POS (24U) +#define ETH_DMA_BUSMODR_M8PBL (0x01000000UL) +#define ETH_DMA_BUSMODR_AAL_POS (25U) +#define ETH_DMA_BUSMODR_AAL (0x02000000UL) +#define ETH_DMA_BUSMODR_MBST_POS (26U) +#define ETH_DMA_BUSMODR_MBST (0x04000000UL) +#define ETH_DMA_BUSMODR_TXPR_POS (27U) +#define ETH_DMA_BUSMODR_TXPR (0x08000000UL) + +/* Bit definition for ETH_DMA_TXPOLLR register */ +#define ETH_DMA_TXPOLLR_TXPOLL (0xFFFFFFFFUL) + +/* Bit definition for ETH_DMA_RXPOLLR register */ +#define ETH_DMA_RXPOLLR_RXPOLL (0xFFFFFFFFUL) + +/* Bit definition for ETH_DMA_RXDLADR register */ +#define ETH_DMA_RXDLADR_RXDLAD (0xFFFFFFFFUL) + +/* Bit definition for ETH_DMA_TXDLADR register */ +#define ETH_DMA_TXDLADR_TXDLAD (0xFFFFFFFFUL) + +/* Bit definition for ETH_DMA_DMASTSR register */ +#define ETH_DMA_DMASTSR_TIS_POS (0U) +#define ETH_DMA_DMASTSR_TIS (0x00000001UL) +#define ETH_DMA_DMASTSR_TSS_POS (1U) +#define ETH_DMA_DMASTSR_TSS (0x00000002UL) +#define ETH_DMA_DMASTSR_TUS_POS (2U) +#define ETH_DMA_DMASTSR_TUS (0x00000004UL) +#define ETH_DMA_DMASTSR_TJS_POS (3U) +#define ETH_DMA_DMASTSR_TJS (0x00000008UL) +#define ETH_DMA_DMASTSR_OVS_POS (4U) +#define ETH_DMA_DMASTSR_OVS (0x00000010UL) +#define ETH_DMA_DMASTSR_UNS_POS (5U) +#define ETH_DMA_DMASTSR_UNS (0x00000020UL) +#define ETH_DMA_DMASTSR_RIS_POS (6U) +#define ETH_DMA_DMASTSR_RIS (0x00000040UL) +#define ETH_DMA_DMASTSR_RUS_POS (7U) +#define ETH_DMA_DMASTSR_RUS (0x00000080UL) +#define ETH_DMA_DMASTSR_RSS_POS (8U) +#define ETH_DMA_DMASTSR_RSS (0x00000100UL) +#define ETH_DMA_DMASTSR_RWS_POS (9U) +#define ETH_DMA_DMASTSR_RWS (0x00000200UL) +#define ETH_DMA_DMASTSR_ETS_POS (10U) +#define ETH_DMA_DMASTSR_ETS (0x00000400UL) +#define ETH_DMA_DMASTSR_FBS_POS (13U) +#define ETH_DMA_DMASTSR_FBS (0x00002000UL) +#define ETH_DMA_DMASTSR_ERS_POS (14U) +#define ETH_DMA_DMASTSR_ERS (0x00004000UL) +#define ETH_DMA_DMASTSR_AIS_POS (15U) +#define ETH_DMA_DMASTSR_AIS (0x00008000UL) +#define ETH_DMA_DMASTSR_NIS_POS (16U) +#define ETH_DMA_DMASTSR_NIS (0x00010000UL) +#define ETH_DMA_DMASTSR_RSTS_POS (17U) +#define ETH_DMA_DMASTSR_RSTS (0x000E0000UL) +#define ETH_DMA_DMASTSR_RSTS_0 (0x00020000UL) +#define ETH_DMA_DMASTSR_RSTS_1 (0x00040000UL) +#define ETH_DMA_DMASTSR_RSTS_2 (0x00080000UL) +#define ETH_DMA_DMASTSR_TSTS_POS (20U) +#define ETH_DMA_DMASTSR_TSTS (0x00700000UL) +#define ETH_DMA_DMASTSR_TSTS_0 (0x00100000UL) +#define ETH_DMA_DMASTSR_TSTS_1 (0x00200000UL) +#define ETH_DMA_DMASTSR_TSTS_2 (0x00400000UL) +#define ETH_DMA_DMASTSR_EBUS_POS (23U) +#define ETH_DMA_DMASTSR_EBUS (0x03800000UL) +#define ETH_DMA_DMASTSR_EBUS_0 (0x00800000UL) +#define ETH_DMA_DMASTSR_EBUS_1 (0x01000000UL) +#define ETH_DMA_DMASTSR_EBUS_2 (0x02000000UL) +#define ETH_DMA_DMASTSR_MMCS_POS (27U) +#define ETH_DMA_DMASTSR_MMCS (0x08000000UL) +#define ETH_DMA_DMASTSR_PMTS_POS (28U) +#define ETH_DMA_DMASTSR_PMTS (0x10000000UL) +#define ETH_DMA_DMASTSR_PTPS_POS (29U) +#define ETH_DMA_DMASTSR_PTPS (0x20000000UL) + +/* Bit definition for ETH_DMA_OPRMODR register */ +#define ETH_DMA_OPRMODR_STR_POS (1U) +#define ETH_DMA_OPRMODR_STR (0x00000002UL) +#define ETH_DMA_OPRMODR_OSF_POS (2U) +#define ETH_DMA_OPRMODR_OSF (0x00000004UL) +#define ETH_DMA_OPRMODR_RTC_POS (3U) +#define ETH_DMA_OPRMODR_RTC (0x00000018UL) +#define ETH_DMA_OPRMODR_RTC_0 (0x00000008UL) +#define ETH_DMA_OPRMODR_RTC_1 (0x00000010UL) +#define ETH_DMA_OPRMODR_DGF_POS (5U) +#define ETH_DMA_OPRMODR_DGF (0x00000020UL) +#define ETH_DMA_OPRMODR_FUF_POS (6U) +#define ETH_DMA_OPRMODR_FUF (0x00000040UL) +#define ETH_DMA_OPRMODR_FEF_POS (7U) +#define ETH_DMA_OPRMODR_FEF (0x00000080UL) +#define ETH_DMA_OPRMODR_STT_POS (13U) +#define ETH_DMA_OPRMODR_STT (0x00002000UL) +#define ETH_DMA_OPRMODR_TTC_POS (14U) +#define ETH_DMA_OPRMODR_TTC (0x0001C000UL) +#define ETH_DMA_OPRMODR_TTC_0 (0x00004000UL) +#define ETH_DMA_OPRMODR_TTC_1 (0x00008000UL) +#define ETH_DMA_OPRMODR_TTC_2 (0x00010000UL) +#define ETH_DMA_OPRMODR_FTF_POS (20U) +#define ETH_DMA_OPRMODR_FTF (0x00100000UL) +#define ETH_DMA_OPRMODR_TSF_POS (21U) +#define ETH_DMA_OPRMODR_TSF (0x00200000UL) +#define ETH_DMA_OPRMODR_DFRF_POS (24U) +#define ETH_DMA_OPRMODR_DFRF (0x01000000UL) +#define ETH_DMA_OPRMODR_RSF_POS (25U) +#define ETH_DMA_OPRMODR_RSF (0x02000000UL) +#define ETH_DMA_OPRMODR_DTCOE_POS (26U) +#define ETH_DMA_OPRMODR_DTCOE (0x04000000UL) + +/* Bit definition for ETH_DMA_INTENAR register */ +#define ETH_DMA_INTENAR_TIE_POS (0U) +#define ETH_DMA_INTENAR_TIE (0x00000001UL) +#define ETH_DMA_INTENAR_TSE_POS (1U) +#define ETH_DMA_INTENAR_TSE (0x00000002UL) +#define ETH_DMA_INTENAR_TUE_POS (2U) +#define ETH_DMA_INTENAR_TUE (0x00000004UL) +#define ETH_DMA_INTENAR_TJE_POS (3U) +#define ETH_DMA_INTENAR_TJE (0x00000008UL) +#define ETH_DMA_INTENAR_OVE_POS (4U) +#define ETH_DMA_INTENAR_OVE (0x00000010UL) +#define ETH_DMA_INTENAR_UNE_POS (5U) +#define ETH_DMA_INTENAR_UNE (0x00000020UL) +#define ETH_DMA_INTENAR_RIE_POS (6U) +#define ETH_DMA_INTENAR_RIE (0x00000040UL) +#define ETH_DMA_INTENAR_RUE_POS (7U) +#define ETH_DMA_INTENAR_RUE (0x00000080UL) +#define ETH_DMA_INTENAR_RSE_POS (8U) +#define ETH_DMA_INTENAR_RSE (0x00000100UL) +#define ETH_DMA_INTENAR_RWE_POS (9U) +#define ETH_DMA_INTENAR_RWE (0x00000200UL) +#define ETH_DMA_INTENAR_ETE_POS (10U) +#define ETH_DMA_INTENAR_ETE (0x00000400UL) +#define ETH_DMA_INTENAR_FBE_POS (13U) +#define ETH_DMA_INTENAR_FBE (0x00002000UL) +#define ETH_DMA_INTENAR_ERE_POS (14U) +#define ETH_DMA_INTENAR_ERE (0x00004000UL) +#define ETH_DMA_INTENAR_AIE_POS (15U) +#define ETH_DMA_INTENAR_AIE (0x00008000UL) +#define ETH_DMA_INTENAR_NIE_POS (16U) +#define ETH_DMA_INTENAR_NIE (0x00010000UL) + +/* Bit definition for ETH_DMA_RFRCNTR register */ +#define ETH_DMA_RFRCNTR_UNACNT_POS (0U) +#define ETH_DMA_RFRCNTR_UNACNT (0x0000FFFFUL) +#define ETH_DMA_RFRCNTR_UNAOVF_POS (16U) +#define ETH_DMA_RFRCNTR_UNAOVF (0x00010000UL) +#define ETH_DMA_RFRCNTR_OVFCNT_POS (17U) +#define ETH_DMA_RFRCNTR_OVFCNT (0x0FFE0000UL) +#define ETH_DMA_RFRCNTR_OVFOVF_POS (28U) +#define ETH_DMA_RFRCNTR_OVFOVF (0x10000000UL) + +/* Bit definition for ETH_DMA_REVWDTR register */ +#define ETH_DMA_REVWDTR_RIWT (0x000000FFUL) + +/* Bit definition for ETH_DMA_CHTXDER register */ +#define ETH_DMA_CHTXDER_CHTXDE (0xFFFFFFFFUL) + +/* Bit definition for ETH_DMA_CHRXDER register */ +#define ETH_DMA_CHRXDER_CHRXDE (0xFFFFFFFFUL) + +/* Bit definition for ETH_DMA_CHTXBFR register */ +#define ETH_DMA_CHTXBFR_CHTXBF (0xFFFFFFFFUL) + +/* Bit definition for ETH_DMA_CHRXBFR register */ +#define ETH_DMA_CHRXBFR_CHRXBF (0xFFFFFFFFUL) + +/******************************************************************************* + Bit definition for Peripheral FCM +*******************************************************************************/ +/* Bit definition for FCM_LVR register */ +#define FCM_LVR_LVR (0x0000FFFFUL) + +/* Bit definition for FCM_UVR register */ +#define FCM_UVR_UVR (0x0000FFFFUL) + +/* Bit definition for FCM_CNTR register */ +#define FCM_CNTR_CNTR (0x0000FFFFUL) + +/* Bit definition for FCM_STR register */ +#define FCM_STR_START (0x00000001UL) + +/* Bit definition for FCM_MCCR register */ +#define FCM_MCCR_MDIVS_POS (0U) +#define FCM_MCCR_MDIVS (0x00000003UL) +#define FCM_MCCR_MCKS_POS (4U) +#define FCM_MCCR_MCKS (0x000000F0UL) + +/* Bit definition for FCM_RCCR register */ +#define FCM_RCCR_RDIVS_POS (0U) +#define FCM_RCCR_RDIVS (0x00000003UL) +#define FCM_RCCR_RCKS_POS (3U) +#define FCM_RCCR_RCKS (0x00000078UL) +#define FCM_RCCR_INEXS_POS (7U) +#define FCM_RCCR_INEXS (0x00000080UL) +#define FCM_RCCR_DNFS_POS (8U) +#define FCM_RCCR_DNFS (0x00000300UL) +#define FCM_RCCR_DNFS_0 (0x00000100UL) +#define FCM_RCCR_DNFS_1 (0x00000200UL) +#define FCM_RCCR_EDGES_POS (12U) +#define FCM_RCCR_EDGES (0x00003000UL) +#define FCM_RCCR_EDGES_0 (0x00001000UL) +#define FCM_RCCR_EDGES_1 (0x00002000UL) +#define FCM_RCCR_EXREFE_POS (15U) +#define FCM_RCCR_EXREFE (0x00008000UL) + +/* Bit definition for FCM_RIER register */ +#define FCM_RIER_ERRIE_POS (0U) +#define FCM_RIER_ERRIE (0x00000001UL) +#define FCM_RIER_MENDIE_POS (1U) +#define FCM_RIER_MENDIE (0x00000002UL) +#define FCM_RIER_OVFIE_POS (2U) +#define FCM_RIER_OVFIE (0x00000004UL) +#define FCM_RIER_ERRINTRS_POS (4U) +#define FCM_RIER_ERRINTRS (0x00000010UL) +#define FCM_RIER_ERRE_POS (7U) +#define FCM_RIER_ERRE (0x00000080UL) + +/* Bit definition for FCM_SR register */ +#define FCM_SR_ERRF_POS (0U) +#define FCM_SR_ERRF (0x00000001UL) +#define FCM_SR_MENDF_POS (1U) +#define FCM_SR_MENDF (0x00000002UL) +#define FCM_SR_OVF_POS (2U) +#define FCM_SR_OVF (0x00000004UL) + +/* Bit definition for FCM_CLR register */ +#define FCM_CLR_ERRFCLR_POS (0U) +#define FCM_CLR_ERRFCLR (0x00000001UL) +#define FCM_CLR_MENDFCLR_POS (1U) +#define FCM_CLR_MENDFCLR (0x00000002UL) +#define FCM_CLR_OVFCLR_POS (2U) +#define FCM_CLR_OVFCLR (0x00000004UL) + +/******************************************************************************* + Bit definition for Peripheral FMAC +*******************************************************************************/ +/* Bit definition for FMAC_ENR register */ +#define FMAC_ENR_FMACEN (0x00000001UL) + +/* Bit definition for FMAC_CTR register */ +#define FMAC_CTR_STAGE_NUM_POS (0U) +#define FMAC_CTR_STAGE_NUM (0x0000001FUL) +#define FMAC_CTR_SHIFT_POS (8U) +#define FMAC_CTR_SHIFT (0x00001F00UL) + +/* Bit definition for FMAC_IER register */ +#define FMAC_IER_INTEN (0x00000001UL) + +/* Bit definition for FMAC_DTR register */ +#define FMAC_DTR_DIN (0x0000FFFFUL) + +/* Bit definition for FMAC_RTR0 register */ +#define FMAC_RTR0 (0xFFFFFFFFUL) + +/* Bit definition for FMAC_RTR1 register */ +#define FMAC_RTR1 (0xFFFFFFFFUL) + +/* Bit definition for FMAC_STR register */ +#define FMAC_STR_READY_POS (31U) +#define FMAC_STR_READY (0x80000000UL) + +/* Bit definition for FMAC_COR0 register */ +#define FMAC_COR0_CIN0 (0x0000FFFFUL) + +/* Bit definition for FMAC_COR1 register */ +#define FMAC_COR1_CIN1 (0x0000FFFFUL) + +/* Bit definition for FMAC_COR2 register */ +#define FMAC_COR2_CIN2 (0x0000FFFFUL) + +/* Bit definition for FMAC_COR3 register */ +#define FMAC_COR3_CIN3 (0x0000FFFFUL) + +/* Bit definition for FMAC_COR4 register */ +#define FMAC_COR4_CIN4 (0x0000FFFFUL) + +/* Bit definition for FMAC_COR5 register */ +#define FMAC_COR5_CIN5 (0x0000FFFFUL) + +/* Bit definition for FMAC_COR6 register */ +#define FMAC_COR6_CIN6 (0x0000FFFFUL) + +/* Bit definition for FMAC_COR7 register */ +#define FMAC_COR7_CIN7 (0x0000FFFFUL) + +/* Bit definition for FMAC_COR8 register */ +#define FMAC_COR8_CIN8 (0x0000FFFFUL) + +/* Bit definition for FMAC_COR9 register */ +#define FMAC_COR9_CIN9 (0x0000FFFFUL) + +/* Bit definition for FMAC_COR10 register */ +#define FMAC_COR10_CIN10 (0x0000FFFFUL) + +/* Bit definition for FMAC_COR11 register */ +#define FMAC_COR11_CIN11 (0x0000FFFFUL) + +/* Bit definition for FMAC_COR12 register */ +#define FMAC_COR12_CIN12 (0x0000FFFFUL) + +/* Bit definition for FMAC_COR13 register */ +#define FMAC_COR13_CIN13 (0x0000FFFFUL) + +/* Bit definition for FMAC_COR14 register */ +#define FMAC_COR14_CIN14 (0x0000FFFFUL) + +/* Bit definition for FMAC_COR15 register */ +#define FMAC_COR15_CIN15 (0x0000FFFFUL) + +/* Bit definition for FMAC_COR16 register */ +#define FMAC_COR16_CIN16 (0x0000FFFFUL) + +/******************************************************************************* + Bit definition for Peripheral GPIO +*******************************************************************************/ +/* Bit definition for GPIO_PIDRA register */ +#define GPIO_PIDRA_PIN00_POS (0U) +#define GPIO_PIDRA_PIN00 (0x0001U) +#define GPIO_PIDRA_PIN01_POS (1U) +#define GPIO_PIDRA_PIN01 (0x0002U) +#define GPIO_PIDRA_PIN02_POS (2U) +#define GPIO_PIDRA_PIN02 (0x0004U) +#define GPIO_PIDRA_PIN03_POS (3U) +#define GPIO_PIDRA_PIN03 (0x0008U) +#define GPIO_PIDRA_PIN04_POS (4U) +#define GPIO_PIDRA_PIN04 (0x0010U) +#define GPIO_PIDRA_PIN05_POS (5U) +#define GPIO_PIDRA_PIN05 (0x0020U) +#define GPIO_PIDRA_PIN06_POS (6U) +#define GPIO_PIDRA_PIN06 (0x0040U) +#define GPIO_PIDRA_PIN07_POS (7U) +#define GPIO_PIDRA_PIN07 (0x0080U) +#define GPIO_PIDRA_PIN08_POS (8U) +#define GPIO_PIDRA_PIN08 (0x0100U) +#define GPIO_PIDRA_PIN09_POS (9U) +#define GPIO_PIDRA_PIN09 (0x0200U) +#define GPIO_PIDRA_PIN10_POS (10U) +#define GPIO_PIDRA_PIN10 (0x0400U) +#define GPIO_PIDRA_PIN11_POS (11U) +#define GPIO_PIDRA_PIN11 (0x0800U) +#define GPIO_PIDRA_PIN12_POS (12U) +#define GPIO_PIDRA_PIN12 (0x1000U) +#define GPIO_PIDRA_PIN13_POS (13U) +#define GPIO_PIDRA_PIN13 (0x2000U) +#define GPIO_PIDRA_PIN14_POS (14U) +#define GPIO_PIDRA_PIN14 (0x4000U) +#define GPIO_PIDRA_PIN15_POS (15U) +#define GPIO_PIDRA_PIN15 (0x8000U) + +/* Bit definition for GPIO_PODRA register */ +#define GPIO_PODRA_POUT00_POS (0U) +#define GPIO_PODRA_POUT00 (0x0001U) +#define GPIO_PODRA_POUT01_POS (1U) +#define GPIO_PODRA_POUT01 (0x0002U) +#define GPIO_PODRA_POUT02_POS (2U) +#define GPIO_PODRA_POUT02 (0x0004U) +#define GPIO_PODRA_POUT03_POS (3U) +#define GPIO_PODRA_POUT03 (0x0008U) +#define GPIO_PODRA_POUT04_POS (4U) +#define GPIO_PODRA_POUT04 (0x0010U) +#define GPIO_PODRA_POUT05_POS (5U) +#define GPIO_PODRA_POUT05 (0x0020U) +#define GPIO_PODRA_POUT06_POS (6U) +#define GPIO_PODRA_POUT06 (0x0040U) +#define GPIO_PODRA_POUT07_POS (7U) +#define GPIO_PODRA_POUT07 (0x0080U) +#define GPIO_PODRA_POUT08_POS (8U) +#define GPIO_PODRA_POUT08 (0x0100U) +#define GPIO_PODRA_POUT09_POS (9U) +#define GPIO_PODRA_POUT09 (0x0200U) +#define GPIO_PODRA_POUT10_POS (10U) +#define GPIO_PODRA_POUT10 (0x0400U) +#define GPIO_PODRA_POUT11_POS (11U) +#define GPIO_PODRA_POUT11 (0x0800U) +#define GPIO_PODRA_POUT12_POS (12U) +#define GPIO_PODRA_POUT12 (0x1000U) +#define GPIO_PODRA_POUT13_POS (13U) +#define GPIO_PODRA_POUT13 (0x2000U) +#define GPIO_PODRA_POUT14_POS (14U) +#define GPIO_PODRA_POUT14 (0x4000U) +#define GPIO_PODRA_POUT15_POS (15U) +#define GPIO_PODRA_POUT15 (0x8000U) + +/* Bit definition for GPIO_POERA register */ +#define GPIO_POERA_POUTE00_POS (0U) +#define GPIO_POERA_POUTE00 (0x0001U) +#define GPIO_POERA_POUTE01_POS (1U) +#define GPIO_POERA_POUTE01 (0x0002U) +#define GPIO_POERA_POUTE02_POS (2U) +#define GPIO_POERA_POUTE02 (0x0004U) +#define GPIO_POERA_POUTE03_POS (3U) +#define GPIO_POERA_POUTE03 (0x0008U) +#define GPIO_POERA_POUTE04_POS (4U) +#define GPIO_POERA_POUTE04 (0x0010U) +#define GPIO_POERA_POUTE05_POS (5U) +#define GPIO_POERA_POUTE05 (0x0020U) +#define GPIO_POERA_POUTE06_POS (6U) +#define GPIO_POERA_POUTE06 (0x0040U) +#define GPIO_POERA_POUTE07_POS (7U) +#define GPIO_POERA_POUTE07 (0x0080U) +#define GPIO_POERA_POUTE08_POS (8U) +#define GPIO_POERA_POUTE08 (0x0100U) +#define GPIO_POERA_POUTE09_POS (9U) +#define GPIO_POERA_POUTE09 (0x0200U) +#define GPIO_POERA_POUTE10_POS (10U) +#define GPIO_POERA_POUTE10 (0x0400U) +#define GPIO_POERA_POUTE11_POS (11U) +#define GPIO_POERA_POUTE11 (0x0800U) +#define GPIO_POERA_POUTE12_POS (12U) +#define GPIO_POERA_POUTE12 (0x1000U) +#define GPIO_POERA_POUTE13_POS (13U) +#define GPIO_POERA_POUTE13 (0x2000U) +#define GPIO_POERA_POUTE14_POS (14U) +#define GPIO_POERA_POUTE14 (0x4000U) +#define GPIO_POERA_POUTE15_POS (15U) +#define GPIO_POERA_POUTE15 (0x8000U) + +/* Bit definition for GPIO_POSRA register */ +#define GPIO_POSRA_POS00_POS (0U) +#define GPIO_POSRA_POS00 (0x0001U) +#define GPIO_POSRA_POS01_POS (1U) +#define GPIO_POSRA_POS01 (0x0002U) +#define GPIO_POSRA_POS02_POS (2U) +#define GPIO_POSRA_POS02 (0x0004U) +#define GPIO_POSRA_POS03_POS (3U) +#define GPIO_POSRA_POS03 (0x0008U) +#define GPIO_POSRA_POS04_POS (4U) +#define GPIO_POSRA_POS04 (0x0010U) +#define GPIO_POSRA_POS05_POS (5U) +#define GPIO_POSRA_POS05 (0x0020U) +#define GPIO_POSRA_POS06_POS (6U) +#define GPIO_POSRA_POS06 (0x0040U) +#define GPIO_POSRA_POS07_POS (7U) +#define GPIO_POSRA_POS07 (0x0080U) +#define GPIO_POSRA_POS08_POS (8U) +#define GPIO_POSRA_POS08 (0x0100U) +#define GPIO_POSRA_POS09_POS (9U) +#define GPIO_POSRA_POS09 (0x0200U) +#define GPIO_POSRA_POS10_POS (10U) +#define GPIO_POSRA_POS10 (0x0400U) +#define GPIO_POSRA_POS11_POS (11U) +#define GPIO_POSRA_POS11 (0x0800U) +#define GPIO_POSRA_POS12_POS (12U) +#define GPIO_POSRA_POS12 (0x1000U) +#define GPIO_POSRA_POS13_POS (13U) +#define GPIO_POSRA_POS13 (0x2000U) +#define GPIO_POSRA_POS14_POS (14U) +#define GPIO_POSRA_POS14 (0x4000U) +#define GPIO_POSRA_POS15_POS (15U) +#define GPIO_POSRA_POS15 (0x8000U) + +/* Bit definition for GPIO_PORRA register */ +#define GPIO_PORRA_POR00_POS (0U) +#define GPIO_PORRA_POR00 (0x0001U) +#define GPIO_PORRA_POR01_POS (1U) +#define GPIO_PORRA_POR01 (0x0002U) +#define GPIO_PORRA_POR02_POS (2U) +#define GPIO_PORRA_POR02 (0x0004U) +#define GPIO_PORRA_POR03_POS (3U) +#define GPIO_PORRA_POR03 (0x0008U) +#define GPIO_PORRA_POR04_POS (4U) +#define GPIO_PORRA_POR04 (0x0010U) +#define GPIO_PORRA_POR05_POS (5U) +#define GPIO_PORRA_POR05 (0x0020U) +#define GPIO_PORRA_POR06_POS (6U) +#define GPIO_PORRA_POR06 (0x0040U) +#define GPIO_PORRA_POR07_POS (7U) +#define GPIO_PORRA_POR07 (0x0080U) +#define GPIO_PORRA_POR08_POS (8U) +#define GPIO_PORRA_POR08 (0x0100U) +#define GPIO_PORRA_POR09_POS (9U) +#define GPIO_PORRA_POR09 (0x0200U) +#define GPIO_PORRA_POR10_POS (10U) +#define GPIO_PORRA_POR10 (0x0400U) +#define GPIO_PORRA_POR11_POS (11U) +#define GPIO_PORRA_POR11 (0x0800U) +#define GPIO_PORRA_POR12_POS (12U) +#define GPIO_PORRA_POR12 (0x1000U) +#define GPIO_PORRA_POR13_POS (13U) +#define GPIO_PORRA_POR13 (0x2000U) +#define GPIO_PORRA_POR14_POS (14U) +#define GPIO_PORRA_POR14 (0x4000U) +#define GPIO_PORRA_POR15_POS (15U) +#define GPIO_PORRA_POR15 (0x8000U) + +/* Bit definition for GPIO_POTRA register */ +#define GPIO_POTRA_POT00_POS (0U) +#define GPIO_POTRA_POT00 (0x0001U) +#define GPIO_POTRA_POT01_POS (1U) +#define GPIO_POTRA_POT01 (0x0002U) +#define GPIO_POTRA_POT02_POS (2U) +#define GPIO_POTRA_POT02 (0x0004U) +#define GPIO_POTRA_POT03_POS (3U) +#define GPIO_POTRA_POT03 (0x0008U) +#define GPIO_POTRA_POT04_POS (4U) +#define GPIO_POTRA_POT04 (0x0010U) +#define GPIO_POTRA_POT05_POS (5U) +#define GPIO_POTRA_POT05 (0x0020U) +#define GPIO_POTRA_POT06_POS (6U) +#define GPIO_POTRA_POT06 (0x0040U) +#define GPIO_POTRA_POT07_POS (7U) +#define GPIO_POTRA_POT07 (0x0080U) +#define GPIO_POTRA_POT08_POS (8U) +#define GPIO_POTRA_POT08 (0x0100U) +#define GPIO_POTRA_POT09_POS (9U) +#define GPIO_POTRA_POT09 (0x0200U) +#define GPIO_POTRA_POT10_POS (10U) +#define GPIO_POTRA_POT10 (0x0400U) +#define GPIO_POTRA_POT11_POS (11U) +#define GPIO_POTRA_POT11 (0x0800U) +#define GPIO_POTRA_POT12_POS (12U) +#define GPIO_POTRA_POT12 (0x1000U) +#define GPIO_POTRA_POT13_POS (13U) +#define GPIO_POTRA_POT13 (0x2000U) +#define GPIO_POTRA_POT14_POS (14U) +#define GPIO_POTRA_POT14 (0x4000U) +#define GPIO_POTRA_POT15_POS (15U) +#define GPIO_POTRA_POT15 (0x8000U) + +/* Bit definition for GPIO_PIDRB register */ +#define GPIO_PIDRB_PIN00_POS (0U) +#define GPIO_PIDRB_PIN00 (0x0001U) +#define GPIO_PIDRB_PIN01_POS (1U) +#define GPIO_PIDRB_PIN01 (0x0002U) +#define GPIO_PIDRB_PIN02_POS (2U) +#define GPIO_PIDRB_PIN02 (0x0004U) +#define GPIO_PIDRB_PIN03_POS (3U) +#define GPIO_PIDRB_PIN03 (0x0008U) +#define GPIO_PIDRB_PIN04_POS (4U) +#define GPIO_PIDRB_PIN04 (0x0010U) +#define GPIO_PIDRB_PIN05_POS (5U) +#define GPIO_PIDRB_PIN05 (0x0020U) +#define GPIO_PIDRB_PIN06_POS (6U) +#define GPIO_PIDRB_PIN06 (0x0040U) +#define GPIO_PIDRB_PIN07_POS (7U) +#define GPIO_PIDRB_PIN07 (0x0080U) +#define GPIO_PIDRB_PIN08_POS (8U) +#define GPIO_PIDRB_PIN08 (0x0100U) +#define GPIO_PIDRB_PIN09_POS (9U) +#define GPIO_PIDRB_PIN09 (0x0200U) +#define GPIO_PIDRB_PIN10_POS (10U) +#define GPIO_PIDRB_PIN10 (0x0400U) +#define GPIO_PIDRB_PIN11_POS (11U) +#define GPIO_PIDRB_PIN11 (0x0800U) +#define GPIO_PIDRB_PIN12_POS (12U) +#define GPIO_PIDRB_PIN12 (0x1000U) +#define GPIO_PIDRB_PIN13_POS (13U) +#define GPIO_PIDRB_PIN13 (0x2000U) +#define GPIO_PIDRB_PIN14_POS (14U) +#define GPIO_PIDRB_PIN14 (0x4000U) +#define GPIO_PIDRB_PIN15_POS (15U) +#define GPIO_PIDRB_PIN15 (0x8000U) + +/* Bit definition for GPIO_PODRB register */ +#define GPIO_PODRB_POUT00_POS (0U) +#define GPIO_PODRB_POUT00 (0x0001U) +#define GPIO_PODRB_POUT01_POS (1U) +#define GPIO_PODRB_POUT01 (0x0002U) +#define GPIO_PODRB_POUT02_POS (2U) +#define GPIO_PODRB_POUT02 (0x0004U) +#define GPIO_PODRB_POUT03_POS (3U) +#define GPIO_PODRB_POUT03 (0x0008U) +#define GPIO_PODRB_POUT04_POS (4U) +#define GPIO_PODRB_POUT04 (0x0010U) +#define GPIO_PODRB_POUT05_POS (5U) +#define GPIO_PODRB_POUT05 (0x0020U) +#define GPIO_PODRB_POUT06_POS (6U) +#define GPIO_PODRB_POUT06 (0x0040U) +#define GPIO_PODRB_POUT07_POS (7U) +#define GPIO_PODRB_POUT07 (0x0080U) +#define GPIO_PODRB_POUT08_POS (8U) +#define GPIO_PODRB_POUT08 (0x0100U) +#define GPIO_PODRB_POUT09_POS (9U) +#define GPIO_PODRB_POUT09 (0x0200U) +#define GPIO_PODRB_POUT10_POS (10U) +#define GPIO_PODRB_POUT10 (0x0400U) +#define GPIO_PODRB_POUT11_POS (11U) +#define GPIO_PODRB_POUT11 (0x0800U) +#define GPIO_PODRB_POUT12_POS (12U) +#define GPIO_PODRB_POUT12 (0x1000U) +#define GPIO_PODRB_POUT13_POS (13U) +#define GPIO_PODRB_POUT13 (0x2000U) +#define GPIO_PODRB_POUT14_POS (14U) +#define GPIO_PODRB_POUT14 (0x4000U) +#define GPIO_PODRB_POUT15_POS (15U) +#define GPIO_PODRB_POUT15 (0x8000U) + +/* Bit definition for GPIO_POERB register */ +#define GPIO_POERB_POUTE00_POS (0U) +#define GPIO_POERB_POUTE00 (0x0001U) +#define GPIO_POERB_POUTE01_POS (1U) +#define GPIO_POERB_POUTE01 (0x0002U) +#define GPIO_POERB_POUTE02_POS (2U) +#define GPIO_POERB_POUTE02 (0x0004U) +#define GPIO_POERB_POUTE03_POS (3U) +#define GPIO_POERB_POUTE03 (0x0008U) +#define GPIO_POERB_POUTE04_POS (4U) +#define GPIO_POERB_POUTE04 (0x0010U) +#define GPIO_POERB_POUTE05_POS (5U) +#define GPIO_POERB_POUTE05 (0x0020U) +#define GPIO_POERB_POUTE06_POS (6U) +#define GPIO_POERB_POUTE06 (0x0040U) +#define GPIO_POERB_POUTE07_POS (7U) +#define GPIO_POERB_POUTE07 (0x0080U) +#define GPIO_POERB_POUTE08_POS (8U) +#define GPIO_POERB_POUTE08 (0x0100U) +#define GPIO_POERB_POUTE09_POS (9U) +#define GPIO_POERB_POUTE09 (0x0200U) +#define GPIO_POERB_POUTE10_POS (10U) +#define GPIO_POERB_POUTE10 (0x0400U) +#define GPIO_POERB_POUTE11_POS (11U) +#define GPIO_POERB_POUTE11 (0x0800U) +#define GPIO_POERB_POUTE12_POS (12U) +#define GPIO_POERB_POUTE12 (0x1000U) +#define GPIO_POERB_POUTE13_POS (13U) +#define GPIO_POERB_POUTE13 (0x2000U) +#define GPIO_POERB_POUTE14_POS (14U) +#define GPIO_POERB_POUTE14 (0x4000U) +#define GPIO_POERB_POUTE15_POS (15U) +#define GPIO_POERB_POUTE15 (0x8000U) + +/* Bit definition for GPIO_POSRB register */ +#define GPIO_POSRB_POS00_POS (0U) +#define GPIO_POSRB_POS00 (0x0001U) +#define GPIO_POSRB_POS01_POS (1U) +#define GPIO_POSRB_POS01 (0x0002U) +#define GPIO_POSRB_POS02_POS (2U) +#define GPIO_POSRB_POS02 (0x0004U) +#define GPIO_POSRB_POS03_POS (3U) +#define GPIO_POSRB_POS03 (0x0008U) +#define GPIO_POSRB_POS04_POS (4U) +#define GPIO_POSRB_POS04 (0x0010U) +#define GPIO_POSRB_POS05_POS (5U) +#define GPIO_POSRB_POS05 (0x0020U) +#define GPIO_POSRB_POS06_POS (6U) +#define GPIO_POSRB_POS06 (0x0040U) +#define GPIO_POSRB_POS07_POS (7U) +#define GPIO_POSRB_POS07 (0x0080U) +#define GPIO_POSRB_POS08_POS (8U) +#define GPIO_POSRB_POS08 (0x0100U) +#define GPIO_POSRB_POS09_POS (9U) +#define GPIO_POSRB_POS09 (0x0200U) +#define GPIO_POSRB_POS10_POS (10U) +#define GPIO_POSRB_POS10 (0x0400U) +#define GPIO_POSRB_POS11_POS (11U) +#define GPIO_POSRB_POS11 (0x0800U) +#define GPIO_POSRB_POS12_POS (12U) +#define GPIO_POSRB_POS12 (0x1000U) +#define GPIO_POSRB_POS13_POS (13U) +#define GPIO_POSRB_POS13 (0x2000U) +#define GPIO_POSRB_POS14_POS (14U) +#define GPIO_POSRB_POS14 (0x4000U) +#define GPIO_POSRB_POS15_POS (15U) +#define GPIO_POSRB_POS15 (0x8000U) + +/* Bit definition for GPIO_PORRB register */ +#define GPIO_PORRB_POR00_POS (0U) +#define GPIO_PORRB_POR00 (0x0001U) +#define GPIO_PORRB_POR01_POS (1U) +#define GPIO_PORRB_POR01 (0x0002U) +#define GPIO_PORRB_POR02_POS (2U) +#define GPIO_PORRB_POR02 (0x0004U) +#define GPIO_PORRB_POR03_POS (3U) +#define GPIO_PORRB_POR03 (0x0008U) +#define GPIO_PORRB_POR04_POS (4U) +#define GPIO_PORRB_POR04 (0x0010U) +#define GPIO_PORRB_POR05_POS (5U) +#define GPIO_PORRB_POR05 (0x0020U) +#define GPIO_PORRB_POR06_POS (6U) +#define GPIO_PORRB_POR06 (0x0040U) +#define GPIO_PORRB_POR07_POS (7U) +#define GPIO_PORRB_POR07 (0x0080U) +#define GPIO_PORRB_POR08_POS (8U) +#define GPIO_PORRB_POR08 (0x0100U) +#define GPIO_PORRB_POR09_POS (9U) +#define GPIO_PORRB_POR09 (0x0200U) +#define GPIO_PORRB_POR10_POS (10U) +#define GPIO_PORRB_POR10 (0x0400U) +#define GPIO_PORRB_POR11_POS (11U) +#define GPIO_PORRB_POR11 (0x0800U) +#define GPIO_PORRB_POR12_POS (12U) +#define GPIO_PORRB_POR12 (0x1000U) +#define GPIO_PORRB_POR13_POS (13U) +#define GPIO_PORRB_POR13 (0x2000U) +#define GPIO_PORRB_POR14_POS (14U) +#define GPIO_PORRB_POR14 (0x4000U) +#define GPIO_PORRB_POR15_POS (15U) +#define GPIO_PORRB_POR15 (0x8000U) + +/* Bit definition for GPIO_POTRB register */ +#define GPIO_POTRB_POT00_POS (0U) +#define GPIO_POTRB_POT00 (0x0001U) +#define GPIO_POTRB_POT01_POS (1U) +#define GPIO_POTRB_POT01 (0x0002U) +#define GPIO_POTRB_POT02_POS (2U) +#define GPIO_POTRB_POT02 (0x0004U) +#define GPIO_POTRB_POT03_POS (3U) +#define GPIO_POTRB_POT03 (0x0008U) +#define GPIO_POTRB_POT04_POS (4U) +#define GPIO_POTRB_POT04 (0x0010U) +#define GPIO_POTRB_POT05_POS (5U) +#define GPIO_POTRB_POT05 (0x0020U) +#define GPIO_POTRB_POT06_POS (6U) +#define GPIO_POTRB_POT06 (0x0040U) +#define GPIO_POTRB_POT07_POS (7U) +#define GPIO_POTRB_POT07 (0x0080U) +#define GPIO_POTRB_POT08_POS (8U) +#define GPIO_POTRB_POT08 (0x0100U) +#define GPIO_POTRB_POT09_POS (9U) +#define GPIO_POTRB_POT09 (0x0200U) +#define GPIO_POTRB_POT10_POS (10U) +#define GPIO_POTRB_POT10 (0x0400U) +#define GPIO_POTRB_POT11_POS (11U) +#define GPIO_POTRB_POT11 (0x0800U) +#define GPIO_POTRB_POT12_POS (12U) +#define GPIO_POTRB_POT12 (0x1000U) +#define GPIO_POTRB_POT13_POS (13U) +#define GPIO_POTRB_POT13 (0x2000U) +#define GPIO_POTRB_POT14_POS (14U) +#define GPIO_POTRB_POT14 (0x4000U) +#define GPIO_POTRB_POT15_POS (15U) +#define GPIO_POTRB_POT15 (0x8000U) + +/* Bit definition for GPIO_PIDRC register */ +#define GPIO_PIDRC_PIN00_POS (0U) +#define GPIO_PIDRC_PIN00 (0x0001U) +#define GPIO_PIDRC_PIN01_POS (1U) +#define GPIO_PIDRC_PIN01 (0x0002U) +#define GPIO_PIDRC_PIN02_POS (2U) +#define GPIO_PIDRC_PIN02 (0x0004U) +#define GPIO_PIDRC_PIN03_POS (3U) +#define GPIO_PIDRC_PIN03 (0x0008U) +#define GPIO_PIDRC_PIN04_POS (4U) +#define GPIO_PIDRC_PIN04 (0x0010U) +#define GPIO_PIDRC_PIN05_POS (5U) +#define GPIO_PIDRC_PIN05 (0x0020U) +#define GPIO_PIDRC_PIN06_POS (6U) +#define GPIO_PIDRC_PIN06 (0x0040U) +#define GPIO_PIDRC_PIN07_POS (7U) +#define GPIO_PIDRC_PIN07 (0x0080U) +#define GPIO_PIDRC_PIN08_POS (8U) +#define GPIO_PIDRC_PIN08 (0x0100U) +#define GPIO_PIDRC_PIN09_POS (9U) +#define GPIO_PIDRC_PIN09 (0x0200U) +#define GPIO_PIDRC_PIN10_POS (10U) +#define GPIO_PIDRC_PIN10 (0x0400U) +#define GPIO_PIDRC_PIN11_POS (11U) +#define GPIO_PIDRC_PIN11 (0x0800U) +#define GPIO_PIDRC_PIN12_POS (12U) +#define GPIO_PIDRC_PIN12 (0x1000U) +#define GPIO_PIDRC_PIN13_POS (13U) +#define GPIO_PIDRC_PIN13 (0x2000U) +#define GPIO_PIDRC_PIN14_POS (14U) +#define GPIO_PIDRC_PIN14 (0x4000U) +#define GPIO_PIDRC_PIN15_POS (15U) +#define GPIO_PIDRC_PIN15 (0x8000U) + +/* Bit definition for GPIO_PODRC register */ +#define GPIO_PODRC_POUT00_POS (0U) +#define GPIO_PODRC_POUT00 (0x0001U) +#define GPIO_PODRC_POUT01_POS (1U) +#define GPIO_PODRC_POUT01 (0x0002U) +#define GPIO_PODRC_POUT02_POS (2U) +#define GPIO_PODRC_POUT02 (0x0004U) +#define GPIO_PODRC_POUT03_POS (3U) +#define GPIO_PODRC_POUT03 (0x0008U) +#define GPIO_PODRC_POUT04_POS (4U) +#define GPIO_PODRC_POUT04 (0x0010U) +#define GPIO_PODRC_POUT05_POS (5U) +#define GPIO_PODRC_POUT05 (0x0020U) +#define GPIO_PODRC_POUT06_POS (6U) +#define GPIO_PODRC_POUT06 (0x0040U) +#define GPIO_PODRC_POUT07_POS (7U) +#define GPIO_PODRC_POUT07 (0x0080U) +#define GPIO_PODRC_POUT08_POS (8U) +#define GPIO_PODRC_POUT08 (0x0100U) +#define GPIO_PODRC_POUT09_POS (9U) +#define GPIO_PODRC_POUT09 (0x0200U) +#define GPIO_PODRC_POUT10_POS (10U) +#define GPIO_PODRC_POUT10 (0x0400U) +#define GPIO_PODRC_POUT11_POS (11U) +#define GPIO_PODRC_POUT11 (0x0800U) +#define GPIO_PODRC_POUT12_POS (12U) +#define GPIO_PODRC_POUT12 (0x1000U) +#define GPIO_PODRC_POUT13_POS (13U) +#define GPIO_PODRC_POUT13 (0x2000U) +#define GPIO_PODRC_POUT14_POS (14U) +#define GPIO_PODRC_POUT14 (0x4000U) +#define GPIO_PODRC_POUT15_POS (15U) +#define GPIO_PODRC_POUT15 (0x8000U) + +/* Bit definition for GPIO_POERC register */ +#define GPIO_POERC_POUTE00_POS (0U) +#define GPIO_POERC_POUTE00 (0x0001U) +#define GPIO_POERC_POUTE01_POS (1U) +#define GPIO_POERC_POUTE01 (0x0002U) +#define GPIO_POERC_POUTE02_POS (2U) +#define GPIO_POERC_POUTE02 (0x0004U) +#define GPIO_POERC_POUTE03_POS (3U) +#define GPIO_POERC_POUTE03 (0x0008U) +#define GPIO_POERC_POUTE04_POS (4U) +#define GPIO_POERC_POUTE04 (0x0010U) +#define GPIO_POERC_POUTE05_POS (5U) +#define GPIO_POERC_POUTE05 (0x0020U) +#define GPIO_POERC_POUTE06_POS (6U) +#define GPIO_POERC_POUTE06 (0x0040U) +#define GPIO_POERC_POUTE07_POS (7U) +#define GPIO_POERC_POUTE07 (0x0080U) +#define GPIO_POERC_POUTE08_POS (8U) +#define GPIO_POERC_POUTE08 (0x0100U) +#define GPIO_POERC_POUTE09_POS (9U) +#define GPIO_POERC_POUTE09 (0x0200U) +#define GPIO_POERC_POUTE10_POS (10U) +#define GPIO_POERC_POUTE10 (0x0400U) +#define GPIO_POERC_POUTE11_POS (11U) +#define GPIO_POERC_POUTE11 (0x0800U) +#define GPIO_POERC_POUTE12_POS (12U) +#define GPIO_POERC_POUTE12 (0x1000U) +#define GPIO_POERC_POUTE13_POS (13U) +#define GPIO_POERC_POUTE13 (0x2000U) +#define GPIO_POERC_POUTE14_POS (14U) +#define GPIO_POERC_POUTE14 (0x4000U) +#define GPIO_POERC_POUTE15_POS (15U) +#define GPIO_POERC_POUTE15 (0x8000U) + +/* Bit definition for GPIO_POSRC register */ +#define GPIO_POSRC_POS00_POS (0U) +#define GPIO_POSRC_POS00 (0x0001U) +#define GPIO_POSRC_POS01_POS (1U) +#define GPIO_POSRC_POS01 (0x0002U) +#define GPIO_POSRC_POS02_POS (2U) +#define GPIO_POSRC_POS02 (0x0004U) +#define GPIO_POSRC_POS03_POS (3U) +#define GPIO_POSRC_POS03 (0x0008U) +#define GPIO_POSRC_POS04_POS (4U) +#define GPIO_POSRC_POS04 (0x0010U) +#define GPIO_POSRC_POS05_POS (5U) +#define GPIO_POSRC_POS05 (0x0020U) +#define GPIO_POSRC_POS06_POS (6U) +#define GPIO_POSRC_POS06 (0x0040U) +#define GPIO_POSRC_POS07_POS (7U) +#define GPIO_POSRC_POS07 (0x0080U) +#define GPIO_POSRC_POS08_POS (8U) +#define GPIO_POSRC_POS08 (0x0100U) +#define GPIO_POSRC_POS09_POS (9U) +#define GPIO_POSRC_POS09 (0x0200U) +#define GPIO_POSRC_POS10_POS (10U) +#define GPIO_POSRC_POS10 (0x0400U) +#define GPIO_POSRC_POS11_POS (11U) +#define GPIO_POSRC_POS11 (0x0800U) +#define GPIO_POSRC_POS12_POS (12U) +#define GPIO_POSRC_POS12 (0x1000U) +#define GPIO_POSRC_POS13_POS (13U) +#define GPIO_POSRC_POS13 (0x2000U) +#define GPIO_POSRC_POS14_POS (14U) +#define GPIO_POSRC_POS14 (0x4000U) +#define GPIO_POSRC_POS15_POS (15U) +#define GPIO_POSRC_POS15 (0x8000U) + +/* Bit definition for GPIO_PORRC register */ +#define GPIO_PORRC_POR00_POS (0U) +#define GPIO_PORRC_POR00 (0x0001U) +#define GPIO_PORRC_POR01_POS (1U) +#define GPIO_PORRC_POR01 (0x0002U) +#define GPIO_PORRC_POR02_POS (2U) +#define GPIO_PORRC_POR02 (0x0004U) +#define GPIO_PORRC_POR03_POS (3U) +#define GPIO_PORRC_POR03 (0x0008U) +#define GPIO_PORRC_POR04_POS (4U) +#define GPIO_PORRC_POR04 (0x0010U) +#define GPIO_PORRC_POR05_POS (5U) +#define GPIO_PORRC_POR05 (0x0020U) +#define GPIO_PORRC_POR06_POS (6U) +#define GPIO_PORRC_POR06 (0x0040U) +#define GPIO_PORRC_POR07_POS (7U) +#define GPIO_PORRC_POR07 (0x0080U) +#define GPIO_PORRC_POR08_POS (8U) +#define GPIO_PORRC_POR08 (0x0100U) +#define GPIO_PORRC_POR09_POS (9U) +#define GPIO_PORRC_POR09 (0x0200U) +#define GPIO_PORRC_POR10_POS (10U) +#define GPIO_PORRC_POR10 (0x0400U) +#define GPIO_PORRC_POR11_POS (11U) +#define GPIO_PORRC_POR11 (0x0800U) +#define GPIO_PORRC_POR12_POS (12U) +#define GPIO_PORRC_POR12 (0x1000U) +#define GPIO_PORRC_POR13_POS (13U) +#define GPIO_PORRC_POR13 (0x2000U) +#define GPIO_PORRC_POR14_POS (14U) +#define GPIO_PORRC_POR14 (0x4000U) +#define GPIO_PORRC_POR15_POS (15U) +#define GPIO_PORRC_POR15 (0x8000U) + +/* Bit definition for GPIO_POTRC register */ +#define GPIO_POTRC_POT00_POS (0U) +#define GPIO_POTRC_POT00 (0x0001U) +#define GPIO_POTRC_POT01_POS (1U) +#define GPIO_POTRC_POT01 (0x0002U) +#define GPIO_POTRC_POT02_POS (2U) +#define GPIO_POTRC_POT02 (0x0004U) +#define GPIO_POTRC_POT03_POS (3U) +#define GPIO_POTRC_POT03 (0x0008U) +#define GPIO_POTRC_POT04_POS (4U) +#define GPIO_POTRC_POT04 (0x0010U) +#define GPIO_POTRC_POT05_POS (5U) +#define GPIO_POTRC_POT05 (0x0020U) +#define GPIO_POTRC_POT06_POS (6U) +#define GPIO_POTRC_POT06 (0x0040U) +#define GPIO_POTRC_POT07_POS (7U) +#define GPIO_POTRC_POT07 (0x0080U) +#define GPIO_POTRC_POT08_POS (8U) +#define GPIO_POTRC_POT08 (0x0100U) +#define GPIO_POTRC_POT09_POS (9U) +#define GPIO_POTRC_POT09 (0x0200U) +#define GPIO_POTRC_POT10_POS (10U) +#define GPIO_POTRC_POT10 (0x0400U) +#define GPIO_POTRC_POT11_POS (11U) +#define GPIO_POTRC_POT11 (0x0800U) +#define GPIO_POTRC_POT12_POS (12U) +#define GPIO_POTRC_POT12 (0x1000U) +#define GPIO_POTRC_POT13_POS (13U) +#define GPIO_POTRC_POT13 (0x2000U) +#define GPIO_POTRC_POT14_POS (14U) +#define GPIO_POTRC_POT14 (0x4000U) +#define GPIO_POTRC_POT15_POS (15U) +#define GPIO_POTRC_POT15 (0x8000U) + +/* Bit definition for GPIO_PIDRD register */ +#define GPIO_PIDRD_PIN00_POS (0U) +#define GPIO_PIDRD_PIN00 (0x0001U) +#define GPIO_PIDRD_PIN01_POS (1U) +#define GPIO_PIDRD_PIN01 (0x0002U) +#define GPIO_PIDRD_PIN02_POS (2U) +#define GPIO_PIDRD_PIN02 (0x0004U) +#define GPIO_PIDRD_PIN03_POS (3U) +#define GPIO_PIDRD_PIN03 (0x0008U) +#define GPIO_PIDRD_PIN04_POS (4U) +#define GPIO_PIDRD_PIN04 (0x0010U) +#define GPIO_PIDRD_PIN05_POS (5U) +#define GPIO_PIDRD_PIN05 (0x0020U) +#define GPIO_PIDRD_PIN06_POS (6U) +#define GPIO_PIDRD_PIN06 (0x0040U) +#define GPIO_PIDRD_PIN07_POS (7U) +#define GPIO_PIDRD_PIN07 (0x0080U) +#define GPIO_PIDRD_PIN08_POS (8U) +#define GPIO_PIDRD_PIN08 (0x0100U) +#define GPIO_PIDRD_PIN09_POS (9U) +#define GPIO_PIDRD_PIN09 (0x0200U) +#define GPIO_PIDRD_PIN10_POS (10U) +#define GPIO_PIDRD_PIN10 (0x0400U) +#define GPIO_PIDRD_PIN11_POS (11U) +#define GPIO_PIDRD_PIN11 (0x0800U) +#define GPIO_PIDRD_PIN12_POS (12U) +#define GPIO_PIDRD_PIN12 (0x1000U) +#define GPIO_PIDRD_PIN13_POS (13U) +#define GPIO_PIDRD_PIN13 (0x2000U) +#define GPIO_PIDRD_PIN14_POS (14U) +#define GPIO_PIDRD_PIN14 (0x4000U) +#define GPIO_PIDRD_PIN15_POS (15U) +#define GPIO_PIDRD_PIN15 (0x8000U) + +/* Bit definition for GPIO_PODRD register */ +#define GPIO_PODRD_POUT00_POS (0U) +#define GPIO_PODRD_POUT00 (0x0001U) +#define GPIO_PODRD_POUT01_POS (1U) +#define GPIO_PODRD_POUT01 (0x0002U) +#define GPIO_PODRD_POUT02_POS (2U) +#define GPIO_PODRD_POUT02 (0x0004U) +#define GPIO_PODRD_POUT03_POS (3U) +#define GPIO_PODRD_POUT03 (0x0008U) +#define GPIO_PODRD_POUT04_POS (4U) +#define GPIO_PODRD_POUT04 (0x0010U) +#define GPIO_PODRD_POUT05_POS (5U) +#define GPIO_PODRD_POUT05 (0x0020U) +#define GPIO_PODRD_POUT06_POS (6U) +#define GPIO_PODRD_POUT06 (0x0040U) +#define GPIO_PODRD_POUT07_POS (7U) +#define GPIO_PODRD_POUT07 (0x0080U) +#define GPIO_PODRD_POUT08_POS (8U) +#define GPIO_PODRD_POUT08 (0x0100U) +#define GPIO_PODRD_POUT09_POS (9U) +#define GPIO_PODRD_POUT09 (0x0200U) +#define GPIO_PODRD_POUT10_POS (10U) +#define GPIO_PODRD_POUT10 (0x0400U) +#define GPIO_PODRD_POUT11_POS (11U) +#define GPIO_PODRD_POUT11 (0x0800U) +#define GPIO_PODRD_POUT12_POS (12U) +#define GPIO_PODRD_POUT12 (0x1000U) +#define GPIO_PODRD_POUT13_POS (13U) +#define GPIO_PODRD_POUT13 (0x2000U) +#define GPIO_PODRD_POUT14_POS (14U) +#define GPIO_PODRD_POUT14 (0x4000U) +#define GPIO_PODRD_POUT15_POS (15U) +#define GPIO_PODRD_POUT15 (0x8000U) + +/* Bit definition for GPIO_POERD register */ +#define GPIO_POERD_POUTE00_POS (0U) +#define GPIO_POERD_POUTE00 (0x0001U) +#define GPIO_POERD_POUTE01_POS (1U) +#define GPIO_POERD_POUTE01 (0x0002U) +#define GPIO_POERD_POUTE02_POS (2U) +#define GPIO_POERD_POUTE02 (0x0004U) +#define GPIO_POERD_POUTE03_POS (3U) +#define GPIO_POERD_POUTE03 (0x0008U) +#define GPIO_POERD_POUTE04_POS (4U) +#define GPIO_POERD_POUTE04 (0x0010U) +#define GPIO_POERD_POUTE05_POS (5U) +#define GPIO_POERD_POUTE05 (0x0020U) +#define GPIO_POERD_POUTE06_POS (6U) +#define GPIO_POERD_POUTE06 (0x0040U) +#define GPIO_POERD_POUTE07_POS (7U) +#define GPIO_POERD_POUTE07 (0x0080U) +#define GPIO_POERD_POUTE08_POS (8U) +#define GPIO_POERD_POUTE08 (0x0100U) +#define GPIO_POERD_POUTE09_POS (9U) +#define GPIO_POERD_POUTE09 (0x0200U) +#define GPIO_POERD_POUTE10_POS (10U) +#define GPIO_POERD_POUTE10 (0x0400U) +#define GPIO_POERD_POUTE11_POS (11U) +#define GPIO_POERD_POUTE11 (0x0800U) +#define GPIO_POERD_POUTE12_POS (12U) +#define GPIO_POERD_POUTE12 (0x1000U) +#define GPIO_POERD_POUTE13_POS (13U) +#define GPIO_POERD_POUTE13 (0x2000U) +#define GPIO_POERD_POUTE14_POS (14U) +#define GPIO_POERD_POUTE14 (0x4000U) +#define GPIO_POERD_POUTE15_POS (15U) +#define GPIO_POERD_POUTE15 (0x8000U) + +/* Bit definition for GPIO_POSRD register */ +#define GPIO_POSRD_POS00_POS (0U) +#define GPIO_POSRD_POS00 (0x0001U) +#define GPIO_POSRD_POS01_POS (1U) +#define GPIO_POSRD_POS01 (0x0002U) +#define GPIO_POSRD_POS02_POS (2U) +#define GPIO_POSRD_POS02 (0x0004U) +#define GPIO_POSRD_POS03_POS (3U) +#define GPIO_POSRD_POS03 (0x0008U) +#define GPIO_POSRD_POS04_POS (4U) +#define GPIO_POSRD_POS04 (0x0010U) +#define GPIO_POSRD_POS05_POS (5U) +#define GPIO_POSRD_POS05 (0x0020U) +#define GPIO_POSRD_POS06_POS (6U) +#define GPIO_POSRD_POS06 (0x0040U) +#define GPIO_POSRD_POS07_POS (7U) +#define GPIO_POSRD_POS07 (0x0080U) +#define GPIO_POSRD_POS08_POS (8U) +#define GPIO_POSRD_POS08 (0x0100U) +#define GPIO_POSRD_POS09_POS (9U) +#define GPIO_POSRD_POS09 (0x0200U) +#define GPIO_POSRD_POS10_POS (10U) +#define GPIO_POSRD_POS10 (0x0400U) +#define GPIO_POSRD_POS11_POS (11U) +#define GPIO_POSRD_POS11 (0x0800U) +#define GPIO_POSRD_POS12_POS (12U) +#define GPIO_POSRD_POS12 (0x1000U) +#define GPIO_POSRD_POS13_POS (13U) +#define GPIO_POSRD_POS13 (0x2000U) +#define GPIO_POSRD_POS14_POS (14U) +#define GPIO_POSRD_POS14 (0x4000U) +#define GPIO_POSRD_POS15_POS (15U) +#define GPIO_POSRD_POS15 (0x8000U) + +/* Bit definition for GPIO_PORRD register */ +#define GPIO_PORRD_POR00_POS (0U) +#define GPIO_PORRD_POR00 (0x0001U) +#define GPIO_PORRD_POR01_POS (1U) +#define GPIO_PORRD_POR01 (0x0002U) +#define GPIO_PORRD_POR02_POS (2U) +#define GPIO_PORRD_POR02 (0x0004U) +#define GPIO_PORRD_POR03_POS (3U) +#define GPIO_PORRD_POR03 (0x0008U) +#define GPIO_PORRD_POR04_POS (4U) +#define GPIO_PORRD_POR04 (0x0010U) +#define GPIO_PORRD_POR05_POS (5U) +#define GPIO_PORRD_POR05 (0x0020U) +#define GPIO_PORRD_POR06_POS (6U) +#define GPIO_PORRD_POR06 (0x0040U) +#define GPIO_PORRD_POR07_POS (7U) +#define GPIO_PORRD_POR07 (0x0080U) +#define GPIO_PORRD_POR08_POS (8U) +#define GPIO_PORRD_POR08 (0x0100U) +#define GPIO_PORRD_POR09_POS (9U) +#define GPIO_PORRD_POR09 (0x0200U) +#define GPIO_PORRD_POR10_POS (10U) +#define GPIO_PORRD_POR10 (0x0400U) +#define GPIO_PORRD_POR11_POS (11U) +#define GPIO_PORRD_POR11 (0x0800U) +#define GPIO_PORRD_POR12_POS (12U) +#define GPIO_PORRD_POR12 (0x1000U) +#define GPIO_PORRD_POR13_POS (13U) +#define GPIO_PORRD_POR13 (0x2000U) +#define GPIO_PORRD_POR14_POS (14U) +#define GPIO_PORRD_POR14 (0x4000U) +#define GPIO_PORRD_POR15_POS (15U) +#define GPIO_PORRD_POR15 (0x8000U) + +/* Bit definition for GPIO_POTRD register */ +#define GPIO_POTRD_POT00_POS (0U) +#define GPIO_POTRD_POT00 (0x0001U) +#define GPIO_POTRD_POT01_POS (1U) +#define GPIO_POTRD_POT01 (0x0002U) +#define GPIO_POTRD_POT02_POS (2U) +#define GPIO_POTRD_POT02 (0x0004U) +#define GPIO_POTRD_POT03_POS (3U) +#define GPIO_POTRD_POT03 (0x0008U) +#define GPIO_POTRD_POT04_POS (4U) +#define GPIO_POTRD_POT04 (0x0010U) +#define GPIO_POTRD_POT05_POS (5U) +#define GPIO_POTRD_POT05 (0x0020U) +#define GPIO_POTRD_POT06_POS (6U) +#define GPIO_POTRD_POT06 (0x0040U) +#define GPIO_POTRD_POT07_POS (7U) +#define GPIO_POTRD_POT07 (0x0080U) +#define GPIO_POTRD_POT08_POS (8U) +#define GPIO_POTRD_POT08 (0x0100U) +#define GPIO_POTRD_POT09_POS (9U) +#define GPIO_POTRD_POT09 (0x0200U) +#define GPIO_POTRD_POT10_POS (10U) +#define GPIO_POTRD_POT10 (0x0400U) +#define GPIO_POTRD_POT11_POS (11U) +#define GPIO_POTRD_POT11 (0x0800U) +#define GPIO_POTRD_POT12_POS (12U) +#define GPIO_POTRD_POT12 (0x1000U) +#define GPIO_POTRD_POT13_POS (13U) +#define GPIO_POTRD_POT13 (0x2000U) +#define GPIO_POTRD_POT14_POS (14U) +#define GPIO_POTRD_POT14 (0x4000U) +#define GPIO_POTRD_POT15_POS (15U) +#define GPIO_POTRD_POT15 (0x8000U) + +/* Bit definition for GPIO_PIDRE register */ +#define GPIO_PIDRE_PIN00_POS (0U) +#define GPIO_PIDRE_PIN00 (0x0001U) +#define GPIO_PIDRE_PIN01_POS (1U) +#define GPIO_PIDRE_PIN01 (0x0002U) +#define GPIO_PIDRE_PIN02_POS (2U) +#define GPIO_PIDRE_PIN02 (0x0004U) +#define GPIO_PIDRE_PIN03_POS (3U) +#define GPIO_PIDRE_PIN03 (0x0008U) +#define GPIO_PIDRE_PIN04_POS (4U) +#define GPIO_PIDRE_PIN04 (0x0010U) +#define GPIO_PIDRE_PIN05_POS (5U) +#define GPIO_PIDRE_PIN05 (0x0020U) +#define GPIO_PIDRE_PIN06_POS (6U) +#define GPIO_PIDRE_PIN06 (0x0040U) +#define GPIO_PIDRE_PIN07_POS (7U) +#define GPIO_PIDRE_PIN07 (0x0080U) +#define GPIO_PIDRE_PIN08_POS (8U) +#define GPIO_PIDRE_PIN08 (0x0100U) +#define GPIO_PIDRE_PIN09_POS (9U) +#define GPIO_PIDRE_PIN09 (0x0200U) +#define GPIO_PIDRE_PIN10_POS (10U) +#define GPIO_PIDRE_PIN10 (0x0400U) +#define GPIO_PIDRE_PIN11_POS (11U) +#define GPIO_PIDRE_PIN11 (0x0800U) +#define GPIO_PIDRE_PIN12_POS (12U) +#define GPIO_PIDRE_PIN12 (0x1000U) +#define GPIO_PIDRE_PIN13_POS (13U) +#define GPIO_PIDRE_PIN13 (0x2000U) +#define GPIO_PIDRE_PIN14_POS (14U) +#define GPIO_PIDRE_PIN14 (0x4000U) +#define GPIO_PIDRE_PIN15_POS (15U) +#define GPIO_PIDRE_PIN15 (0x8000U) + +/* Bit definition for GPIO_PODRE register */ +#define GPIO_PODRE_POUT00_POS (0U) +#define GPIO_PODRE_POUT00 (0x0001U) +#define GPIO_PODRE_POUT01_POS (1U) +#define GPIO_PODRE_POUT01 (0x0002U) +#define GPIO_PODRE_POUT02_POS (2U) +#define GPIO_PODRE_POUT02 (0x0004U) +#define GPIO_PODRE_POUT03_POS (3U) +#define GPIO_PODRE_POUT03 (0x0008U) +#define GPIO_PODRE_POUT04_POS (4U) +#define GPIO_PODRE_POUT04 (0x0010U) +#define GPIO_PODRE_POUT05_POS (5U) +#define GPIO_PODRE_POUT05 (0x0020U) +#define GPIO_PODRE_POUT06_POS (6U) +#define GPIO_PODRE_POUT06 (0x0040U) +#define GPIO_PODRE_POUT07_POS (7U) +#define GPIO_PODRE_POUT07 (0x0080U) +#define GPIO_PODRE_POUT08_POS (8U) +#define GPIO_PODRE_POUT08 (0x0100U) +#define GPIO_PODRE_POUT09_POS (9U) +#define GPIO_PODRE_POUT09 (0x0200U) +#define GPIO_PODRE_POUT10_POS (10U) +#define GPIO_PODRE_POUT10 (0x0400U) +#define GPIO_PODRE_POUT11_POS (11U) +#define GPIO_PODRE_POUT11 (0x0800U) +#define GPIO_PODRE_POUT12_POS (12U) +#define GPIO_PODRE_POUT12 (0x1000U) +#define GPIO_PODRE_POUT13_POS (13U) +#define GPIO_PODRE_POUT13 (0x2000U) +#define GPIO_PODRE_POUT14_POS (14U) +#define GPIO_PODRE_POUT14 (0x4000U) +#define GPIO_PODRE_POUT15_POS (15U) +#define GPIO_PODRE_POUT15 (0x8000U) + +/* Bit definition for GPIO_POERE register */ +#define GPIO_POERE_POUTE00_POS (0U) +#define GPIO_POERE_POUTE00 (0x0001U) +#define GPIO_POERE_POUTE01_POS (1U) +#define GPIO_POERE_POUTE01 (0x0002U) +#define GPIO_POERE_POUTE02_POS (2U) +#define GPIO_POERE_POUTE02 (0x0004U) +#define GPIO_POERE_POUTE03_POS (3U) +#define GPIO_POERE_POUTE03 (0x0008U) +#define GPIO_POERE_POUTE04_POS (4U) +#define GPIO_POERE_POUTE04 (0x0010U) +#define GPIO_POERE_POUTE05_POS (5U) +#define GPIO_POERE_POUTE05 (0x0020U) +#define GPIO_POERE_POUTE06_POS (6U) +#define GPIO_POERE_POUTE06 (0x0040U) +#define GPIO_POERE_POUTE07_POS (7U) +#define GPIO_POERE_POUTE07 (0x0080U) +#define GPIO_POERE_POUTE08_POS (8U) +#define GPIO_POERE_POUTE08 (0x0100U) +#define GPIO_POERE_POUTE09_POS (9U) +#define GPIO_POERE_POUTE09 (0x0200U) +#define GPIO_POERE_POUTE10_POS (10U) +#define GPIO_POERE_POUTE10 (0x0400U) +#define GPIO_POERE_POUTE11_POS (11U) +#define GPIO_POERE_POUTE11 (0x0800U) +#define GPIO_POERE_POUTE12_POS (12U) +#define GPIO_POERE_POUTE12 (0x1000U) +#define GPIO_POERE_POUTE13_POS (13U) +#define GPIO_POERE_POUTE13 (0x2000U) +#define GPIO_POERE_POUTE14_POS (14U) +#define GPIO_POERE_POUTE14 (0x4000U) +#define GPIO_POERE_POUTE15_POS (15U) +#define GPIO_POERE_POUTE15 (0x8000U) + +/* Bit definition for GPIO_POSRE register */ +#define GPIO_POSRE_POS00_POS (0U) +#define GPIO_POSRE_POS00 (0x0001U) +#define GPIO_POSRE_POS01_POS (1U) +#define GPIO_POSRE_POS01 (0x0002U) +#define GPIO_POSRE_POS02_POS (2U) +#define GPIO_POSRE_POS02 (0x0004U) +#define GPIO_POSRE_POS03_POS (3U) +#define GPIO_POSRE_POS03 (0x0008U) +#define GPIO_POSRE_POS04_POS (4U) +#define GPIO_POSRE_POS04 (0x0010U) +#define GPIO_POSRE_POS05_POS (5U) +#define GPIO_POSRE_POS05 (0x0020U) +#define GPIO_POSRE_POS06_POS (6U) +#define GPIO_POSRE_POS06 (0x0040U) +#define GPIO_POSRE_POS07_POS (7U) +#define GPIO_POSRE_POS07 (0x0080U) +#define GPIO_POSRE_POS08_POS (8U) +#define GPIO_POSRE_POS08 (0x0100U) +#define GPIO_POSRE_POS09_POS (9U) +#define GPIO_POSRE_POS09 (0x0200U) +#define GPIO_POSRE_POS10_POS (10U) +#define GPIO_POSRE_POS10 (0x0400U) +#define GPIO_POSRE_POS11_POS (11U) +#define GPIO_POSRE_POS11 (0x0800U) +#define GPIO_POSRE_POS12_POS (12U) +#define GPIO_POSRE_POS12 (0x1000U) +#define GPIO_POSRE_POS13_POS (13U) +#define GPIO_POSRE_POS13 (0x2000U) +#define GPIO_POSRE_POS14_POS (14U) +#define GPIO_POSRE_POS14 (0x4000U) +#define GPIO_POSRE_POS15_POS (15U) +#define GPIO_POSRE_POS15 (0x8000U) + +/* Bit definition for GPIO_PORRE register */ +#define GPIO_PORRE_POR00_POS (0U) +#define GPIO_PORRE_POR00 (0x0001U) +#define GPIO_PORRE_POR01_POS (1U) +#define GPIO_PORRE_POR01 (0x0002U) +#define GPIO_PORRE_POR02_POS (2U) +#define GPIO_PORRE_POR02 (0x0004U) +#define GPIO_PORRE_POR03_POS (3U) +#define GPIO_PORRE_POR03 (0x0008U) +#define GPIO_PORRE_POR04_POS (4U) +#define GPIO_PORRE_POR04 (0x0010U) +#define GPIO_PORRE_POR05_POS (5U) +#define GPIO_PORRE_POR05 (0x0020U) +#define GPIO_PORRE_POR06_POS (6U) +#define GPIO_PORRE_POR06 (0x0040U) +#define GPIO_PORRE_POR07_POS (7U) +#define GPIO_PORRE_POR07 (0x0080U) +#define GPIO_PORRE_POR08_POS (8U) +#define GPIO_PORRE_POR08 (0x0100U) +#define GPIO_PORRE_POR09_POS (9U) +#define GPIO_PORRE_POR09 (0x0200U) +#define GPIO_PORRE_POR10_POS (10U) +#define GPIO_PORRE_POR10 (0x0400U) +#define GPIO_PORRE_POR11_POS (11U) +#define GPIO_PORRE_POR11 (0x0800U) +#define GPIO_PORRE_POR12_POS (12U) +#define GPIO_PORRE_POR12 (0x1000U) +#define GPIO_PORRE_POR13_POS (13U) +#define GPIO_PORRE_POR13 (0x2000U) +#define GPIO_PORRE_POR14_POS (14U) +#define GPIO_PORRE_POR14 (0x4000U) +#define GPIO_PORRE_POR15_POS (15U) +#define GPIO_PORRE_POR15 (0x8000U) + +/* Bit definition for GPIO_POTRE register */ +#define GPIO_POTRE_POT00_POS (0U) +#define GPIO_POTRE_POT00 (0x0001U) +#define GPIO_POTRE_POT01_POS (1U) +#define GPIO_POTRE_POT01 (0x0002U) +#define GPIO_POTRE_POT02_POS (2U) +#define GPIO_POTRE_POT02 (0x0004U) +#define GPIO_POTRE_POT03_POS (3U) +#define GPIO_POTRE_POT03 (0x0008U) +#define GPIO_POTRE_POT04_POS (4U) +#define GPIO_POTRE_POT04 (0x0010U) +#define GPIO_POTRE_POT05_POS (5U) +#define GPIO_POTRE_POT05 (0x0020U) +#define GPIO_POTRE_POT06_POS (6U) +#define GPIO_POTRE_POT06 (0x0040U) +#define GPIO_POTRE_POT07_POS (7U) +#define GPIO_POTRE_POT07 (0x0080U) +#define GPIO_POTRE_POT08_POS (8U) +#define GPIO_POTRE_POT08 (0x0100U) +#define GPIO_POTRE_POT09_POS (9U) +#define GPIO_POTRE_POT09 (0x0200U) +#define GPIO_POTRE_POT10_POS (10U) +#define GPIO_POTRE_POT10 (0x0400U) +#define GPIO_POTRE_POT11_POS (11U) +#define GPIO_POTRE_POT11 (0x0800U) +#define GPIO_POTRE_POT12_POS (12U) +#define GPIO_POTRE_POT12 (0x1000U) +#define GPIO_POTRE_POT13_POS (13U) +#define GPIO_POTRE_POT13 (0x2000U) +#define GPIO_POTRE_POT14_POS (14U) +#define GPIO_POTRE_POT14 (0x4000U) +#define GPIO_POTRE_POT15_POS (15U) +#define GPIO_POTRE_POT15 (0x8000U) + +/* Bit definition for GPIO_PIDRF register */ +#define GPIO_PIDRF_PIN00_POS (0U) +#define GPIO_PIDRF_PIN00 (0x0001U) +#define GPIO_PIDRF_PIN01_POS (1U) +#define GPIO_PIDRF_PIN01 (0x0002U) +#define GPIO_PIDRF_PIN02_POS (2U) +#define GPIO_PIDRF_PIN02 (0x0004U) +#define GPIO_PIDRF_PIN03_POS (3U) +#define GPIO_PIDRF_PIN03 (0x0008U) +#define GPIO_PIDRF_PIN04_POS (4U) +#define GPIO_PIDRF_PIN04 (0x0010U) +#define GPIO_PIDRF_PIN05_POS (5U) +#define GPIO_PIDRF_PIN05 (0x0020U) +#define GPIO_PIDRF_PIN06_POS (6U) +#define GPIO_PIDRF_PIN06 (0x0040U) +#define GPIO_PIDRF_PIN07_POS (7U) +#define GPIO_PIDRF_PIN07 (0x0080U) +#define GPIO_PIDRF_PIN08_POS (8U) +#define GPIO_PIDRF_PIN08 (0x0100U) +#define GPIO_PIDRF_PIN09_POS (9U) +#define GPIO_PIDRF_PIN09 (0x0200U) +#define GPIO_PIDRF_PIN10_POS (10U) +#define GPIO_PIDRF_PIN10 (0x0400U) +#define GPIO_PIDRF_PIN11_POS (11U) +#define GPIO_PIDRF_PIN11 (0x0800U) +#define GPIO_PIDRF_PIN12_POS (12U) +#define GPIO_PIDRF_PIN12 (0x1000U) +#define GPIO_PIDRF_PIN13_POS (13U) +#define GPIO_PIDRF_PIN13 (0x2000U) +#define GPIO_PIDRF_PIN14_POS (14U) +#define GPIO_PIDRF_PIN14 (0x4000U) +#define GPIO_PIDRF_PIN15_POS (15U) +#define GPIO_PIDRF_PIN15 (0x8000U) + +/* Bit definition for GPIO_PODRF register */ +#define GPIO_PODRF_POUT00_POS (0U) +#define GPIO_PODRF_POUT00 (0x0001U) +#define GPIO_PODRF_POUT01_POS (1U) +#define GPIO_PODRF_POUT01 (0x0002U) +#define GPIO_PODRF_POUT02_POS (2U) +#define GPIO_PODRF_POUT02 (0x0004U) +#define GPIO_PODRF_POUT03_POS (3U) +#define GPIO_PODRF_POUT03 (0x0008U) +#define GPIO_PODRF_POUT04_POS (4U) +#define GPIO_PODRF_POUT04 (0x0010U) +#define GPIO_PODRF_POUT05_POS (5U) +#define GPIO_PODRF_POUT05 (0x0020U) +#define GPIO_PODRF_POUT06_POS (6U) +#define GPIO_PODRF_POUT06 (0x0040U) +#define GPIO_PODRF_POUT07_POS (7U) +#define GPIO_PODRF_POUT07 (0x0080U) +#define GPIO_PODRF_POUT08_POS (8U) +#define GPIO_PODRF_POUT08 (0x0100U) +#define GPIO_PODRF_POUT09_POS (9U) +#define GPIO_PODRF_POUT09 (0x0200U) +#define GPIO_PODRF_POUT10_POS (10U) +#define GPIO_PODRF_POUT10 (0x0400U) +#define GPIO_PODRF_POUT11_POS (11U) +#define GPIO_PODRF_POUT11 (0x0800U) +#define GPIO_PODRF_POUT12_POS (12U) +#define GPIO_PODRF_POUT12 (0x1000U) +#define GPIO_PODRF_POUT13_POS (13U) +#define GPIO_PODRF_POUT13 (0x2000U) +#define GPIO_PODRF_POUT14_POS (14U) +#define GPIO_PODRF_POUT14 (0x4000U) +#define GPIO_PODRF_POUT15_POS (15U) +#define GPIO_PODRF_POUT15 (0x8000U) + +/* Bit definition for GPIO_POERF register */ +#define GPIO_POERF_POUTE00_POS (0U) +#define GPIO_POERF_POUTE00 (0x0001U) +#define GPIO_POERF_POUTE01_POS (1U) +#define GPIO_POERF_POUTE01 (0x0002U) +#define GPIO_POERF_POUTE02_POS (2U) +#define GPIO_POERF_POUTE02 (0x0004U) +#define GPIO_POERF_POUTE03_POS (3U) +#define GPIO_POERF_POUTE03 (0x0008U) +#define GPIO_POERF_POUTE04_POS (4U) +#define GPIO_POERF_POUTE04 (0x0010U) +#define GPIO_POERF_POUTE05_POS (5U) +#define GPIO_POERF_POUTE05 (0x0020U) +#define GPIO_POERF_POUTE06_POS (6U) +#define GPIO_POERF_POUTE06 (0x0040U) +#define GPIO_POERF_POUTE07_POS (7U) +#define GPIO_POERF_POUTE07 (0x0080U) +#define GPIO_POERF_POUTE08_POS (8U) +#define GPIO_POERF_POUTE08 (0x0100U) +#define GPIO_POERF_POUTE09_POS (9U) +#define GPIO_POERF_POUTE09 (0x0200U) +#define GPIO_POERF_POUTE10_POS (10U) +#define GPIO_POERF_POUTE10 (0x0400U) +#define GPIO_POERF_POUTE11_POS (11U) +#define GPIO_POERF_POUTE11 (0x0800U) +#define GPIO_POERF_POUTE12_POS (12U) +#define GPIO_POERF_POUTE12 (0x1000U) +#define GPIO_POERF_POUTE13_POS (13U) +#define GPIO_POERF_POUTE13 (0x2000U) +#define GPIO_POERF_POUTE14_POS (14U) +#define GPIO_POERF_POUTE14 (0x4000U) +#define GPIO_POERF_POUTE15_POS (15U) +#define GPIO_POERF_POUTE15 (0x8000U) + +/* Bit definition for GPIO_POSRF register */ +#define GPIO_POSRF_POS00_POS (0U) +#define GPIO_POSRF_POS00 (0x0001U) +#define GPIO_POSRF_POS01_POS (1U) +#define GPIO_POSRF_POS01 (0x0002U) +#define GPIO_POSRF_POS02_POS (2U) +#define GPIO_POSRF_POS02 (0x0004U) +#define GPIO_POSRF_POS03_POS (3U) +#define GPIO_POSRF_POS03 (0x0008U) +#define GPIO_POSRF_POS04_POS (4U) +#define GPIO_POSRF_POS04 (0x0010U) +#define GPIO_POSRF_POS05_POS (5U) +#define GPIO_POSRF_POS05 (0x0020U) +#define GPIO_POSRF_POS06_POS (6U) +#define GPIO_POSRF_POS06 (0x0040U) +#define GPIO_POSRF_POS07_POS (7U) +#define GPIO_POSRF_POS07 (0x0080U) +#define GPIO_POSRF_POS08_POS (8U) +#define GPIO_POSRF_POS08 (0x0100U) +#define GPIO_POSRF_POS09_POS (9U) +#define GPIO_POSRF_POS09 (0x0200U) +#define GPIO_POSRF_POS10_POS (10U) +#define GPIO_POSRF_POS10 (0x0400U) +#define GPIO_POSRF_POS11_POS (11U) +#define GPIO_POSRF_POS11 (0x0800U) +#define GPIO_POSRF_POS12_POS (12U) +#define GPIO_POSRF_POS12 (0x1000U) +#define GPIO_POSRF_POS13_POS (13U) +#define GPIO_POSRF_POS13 (0x2000U) +#define GPIO_POSRF_POS14_POS (14U) +#define GPIO_POSRF_POS14 (0x4000U) +#define GPIO_POSRF_POS15_POS (15U) +#define GPIO_POSRF_POS15 (0x8000U) + +/* Bit definition for GPIO_PORRF register */ +#define GPIO_PORRF_POR00_POS (0U) +#define GPIO_PORRF_POR00 (0x0001U) +#define GPIO_PORRF_POR01_POS (1U) +#define GPIO_PORRF_POR01 (0x0002U) +#define GPIO_PORRF_POR02_POS (2U) +#define GPIO_PORRF_POR02 (0x0004U) +#define GPIO_PORRF_POR03_POS (3U) +#define GPIO_PORRF_POR03 (0x0008U) +#define GPIO_PORRF_POR04_POS (4U) +#define GPIO_PORRF_POR04 (0x0010U) +#define GPIO_PORRF_POR05_POS (5U) +#define GPIO_PORRF_POR05 (0x0020U) +#define GPIO_PORRF_POR06_POS (6U) +#define GPIO_PORRF_POR06 (0x0040U) +#define GPIO_PORRF_POR07_POS (7U) +#define GPIO_PORRF_POR07 (0x0080U) +#define GPIO_PORRF_POR08_POS (8U) +#define GPIO_PORRF_POR08 (0x0100U) +#define GPIO_PORRF_POR09_POS (9U) +#define GPIO_PORRF_POR09 (0x0200U) +#define GPIO_PORRF_POR10_POS (10U) +#define GPIO_PORRF_POR10 (0x0400U) +#define GPIO_PORRF_POR11_POS (11U) +#define GPIO_PORRF_POR11 (0x0800U) +#define GPIO_PORRF_POR12_POS (12U) +#define GPIO_PORRF_POR12 (0x1000U) +#define GPIO_PORRF_POR13_POS (13U) +#define GPIO_PORRF_POR13 (0x2000U) +#define GPIO_PORRF_POR14_POS (14U) +#define GPIO_PORRF_POR14 (0x4000U) +#define GPIO_PORRF_POR15_POS (15U) +#define GPIO_PORRF_POR15 (0x8000U) + +/* Bit definition for GPIO_POTRF register */ +#define GPIO_POTRF_POT00_POS (0U) +#define GPIO_POTRF_POT00 (0x0001U) +#define GPIO_POTRF_POT01_POS (1U) +#define GPIO_POTRF_POT01 (0x0002U) +#define GPIO_POTRF_POT02_POS (2U) +#define GPIO_POTRF_POT02 (0x0004U) +#define GPIO_POTRF_POT03_POS (3U) +#define GPIO_POTRF_POT03 (0x0008U) +#define GPIO_POTRF_POT04_POS (4U) +#define GPIO_POTRF_POT04 (0x0010U) +#define GPIO_POTRF_POT05_POS (5U) +#define GPIO_POTRF_POT05 (0x0020U) +#define GPIO_POTRF_POT06_POS (6U) +#define GPIO_POTRF_POT06 (0x0040U) +#define GPIO_POTRF_POT07_POS (7U) +#define GPIO_POTRF_POT07 (0x0080U) +#define GPIO_POTRF_POT08_POS (8U) +#define GPIO_POTRF_POT08 (0x0100U) +#define GPIO_POTRF_POT09_POS (9U) +#define GPIO_POTRF_POT09 (0x0200U) +#define GPIO_POTRF_POT10_POS (10U) +#define GPIO_POTRF_POT10 (0x0400U) +#define GPIO_POTRF_POT11_POS (11U) +#define GPIO_POTRF_POT11 (0x0800U) +#define GPIO_POTRF_POT12_POS (12U) +#define GPIO_POTRF_POT12 (0x1000U) +#define GPIO_POTRF_POT13_POS (13U) +#define GPIO_POTRF_POT13 (0x2000U) +#define GPIO_POTRF_POT14_POS (14U) +#define GPIO_POTRF_POT14 (0x4000U) +#define GPIO_POTRF_POT15_POS (15U) +#define GPIO_POTRF_POT15 (0x8000U) + +/* Bit definition for GPIO_PIDRG register */ +#define GPIO_PIDRG_PIN00_POS (0U) +#define GPIO_PIDRG_PIN00 (0x0001U) +#define GPIO_PIDRG_PIN01_POS (1U) +#define GPIO_PIDRG_PIN01 (0x0002U) +#define GPIO_PIDRG_PIN02_POS (2U) +#define GPIO_PIDRG_PIN02 (0x0004U) +#define GPIO_PIDRG_PIN03_POS (3U) +#define GPIO_PIDRG_PIN03 (0x0008U) +#define GPIO_PIDRG_PIN04_POS (4U) +#define GPIO_PIDRG_PIN04 (0x0010U) +#define GPIO_PIDRG_PIN05_POS (5U) +#define GPIO_PIDRG_PIN05 (0x0020U) +#define GPIO_PIDRG_PIN06_POS (6U) +#define GPIO_PIDRG_PIN06 (0x0040U) +#define GPIO_PIDRG_PIN07_POS (7U) +#define GPIO_PIDRG_PIN07 (0x0080U) +#define GPIO_PIDRG_PIN08_POS (8U) +#define GPIO_PIDRG_PIN08 (0x0100U) +#define GPIO_PIDRG_PIN09_POS (9U) +#define GPIO_PIDRG_PIN09 (0x0200U) +#define GPIO_PIDRG_PIN10_POS (10U) +#define GPIO_PIDRG_PIN10 (0x0400U) +#define GPIO_PIDRG_PIN11_POS (11U) +#define GPIO_PIDRG_PIN11 (0x0800U) +#define GPIO_PIDRG_PIN12_POS (12U) +#define GPIO_PIDRG_PIN12 (0x1000U) +#define GPIO_PIDRG_PIN13_POS (13U) +#define GPIO_PIDRG_PIN13 (0x2000U) +#define GPIO_PIDRG_PIN14_POS (14U) +#define GPIO_PIDRG_PIN14 (0x4000U) +#define GPIO_PIDRG_PIN15_POS (15U) +#define GPIO_PIDRG_PIN15 (0x8000U) + +/* Bit definition for GPIO_PODRG register */ +#define GPIO_PODRG_POUT00_POS (0U) +#define GPIO_PODRG_POUT00 (0x0001U) +#define GPIO_PODRG_POUT01_POS (1U) +#define GPIO_PODRG_POUT01 (0x0002U) +#define GPIO_PODRG_POUT02_POS (2U) +#define GPIO_PODRG_POUT02 (0x0004U) +#define GPIO_PODRG_POUT03_POS (3U) +#define GPIO_PODRG_POUT03 (0x0008U) +#define GPIO_PODRG_POUT04_POS (4U) +#define GPIO_PODRG_POUT04 (0x0010U) +#define GPIO_PODRG_POUT05_POS (5U) +#define GPIO_PODRG_POUT05 (0x0020U) +#define GPIO_PODRG_POUT06_POS (6U) +#define GPIO_PODRG_POUT06 (0x0040U) +#define GPIO_PODRG_POUT07_POS (7U) +#define GPIO_PODRG_POUT07 (0x0080U) +#define GPIO_PODRG_POUT08_POS (8U) +#define GPIO_PODRG_POUT08 (0x0100U) +#define GPIO_PODRG_POUT09_POS (9U) +#define GPIO_PODRG_POUT09 (0x0200U) +#define GPIO_PODRG_POUT10_POS (10U) +#define GPIO_PODRG_POUT10 (0x0400U) +#define GPIO_PODRG_POUT11_POS (11U) +#define GPIO_PODRG_POUT11 (0x0800U) +#define GPIO_PODRG_POUT12_POS (12U) +#define GPIO_PODRG_POUT12 (0x1000U) +#define GPIO_PODRG_POUT13_POS (13U) +#define GPIO_PODRG_POUT13 (0x2000U) +#define GPIO_PODRG_POUT14_POS (14U) +#define GPIO_PODRG_POUT14 (0x4000U) +#define GPIO_PODRG_POUT15_POS (15U) +#define GPIO_PODRG_POUT15 (0x8000U) + +/* Bit definition for GPIO_POERG register */ +#define GPIO_POERG_POUTE00_POS (0U) +#define GPIO_POERG_POUTE00 (0x0001U) +#define GPIO_POERG_POUTE01_POS (1U) +#define GPIO_POERG_POUTE01 (0x0002U) +#define GPIO_POERG_POUTE02_POS (2U) +#define GPIO_POERG_POUTE02 (0x0004U) +#define GPIO_POERG_POUTE03_POS (3U) +#define GPIO_POERG_POUTE03 (0x0008U) +#define GPIO_POERG_POUTE04_POS (4U) +#define GPIO_POERG_POUTE04 (0x0010U) +#define GPIO_POERG_POUTE05_POS (5U) +#define GPIO_POERG_POUTE05 (0x0020U) +#define GPIO_POERG_POUTE06_POS (6U) +#define GPIO_POERG_POUTE06 (0x0040U) +#define GPIO_POERG_POUTE07_POS (7U) +#define GPIO_POERG_POUTE07 (0x0080U) +#define GPIO_POERG_POUTE08_POS (8U) +#define GPIO_POERG_POUTE08 (0x0100U) +#define GPIO_POERG_POUTE09_POS (9U) +#define GPIO_POERG_POUTE09 (0x0200U) +#define GPIO_POERG_POUTE10_POS (10U) +#define GPIO_POERG_POUTE10 (0x0400U) +#define GPIO_POERG_POUTE11_POS (11U) +#define GPIO_POERG_POUTE11 (0x0800U) +#define GPIO_POERG_POUTE12_POS (12U) +#define GPIO_POERG_POUTE12 (0x1000U) +#define GPIO_POERG_POUTE13_POS (13U) +#define GPIO_POERG_POUTE13 (0x2000U) +#define GPIO_POERG_POUTE14_POS (14U) +#define GPIO_POERG_POUTE14 (0x4000U) +#define GPIO_POERG_POUTE15_POS (15U) +#define GPIO_POERG_POUTE15 (0x8000U) + +/* Bit definition for GPIO_POSRG register */ +#define GPIO_POSRG_POS00_POS (0U) +#define GPIO_POSRG_POS00 (0x0001U) +#define GPIO_POSRG_POS01_POS (1U) +#define GPIO_POSRG_POS01 (0x0002U) +#define GPIO_POSRG_POS02_POS (2U) +#define GPIO_POSRG_POS02 (0x0004U) +#define GPIO_POSRG_POS03_POS (3U) +#define GPIO_POSRG_POS03 (0x0008U) +#define GPIO_POSRG_POS04_POS (4U) +#define GPIO_POSRG_POS04 (0x0010U) +#define GPIO_POSRG_POS05_POS (5U) +#define GPIO_POSRG_POS05 (0x0020U) +#define GPIO_POSRG_POS06_POS (6U) +#define GPIO_POSRG_POS06 (0x0040U) +#define GPIO_POSRG_POS07_POS (7U) +#define GPIO_POSRG_POS07 (0x0080U) +#define GPIO_POSRG_POS08_POS (8U) +#define GPIO_POSRG_POS08 (0x0100U) +#define GPIO_POSRG_POS09_POS (9U) +#define GPIO_POSRG_POS09 (0x0200U) +#define GPIO_POSRG_POS10_POS (10U) +#define GPIO_POSRG_POS10 (0x0400U) +#define GPIO_POSRG_POS11_POS (11U) +#define GPIO_POSRG_POS11 (0x0800U) +#define GPIO_POSRG_POS12_POS (12U) +#define GPIO_POSRG_POS12 (0x1000U) +#define GPIO_POSRG_POS13_POS (13U) +#define GPIO_POSRG_POS13 (0x2000U) +#define GPIO_POSRG_POS14_POS (14U) +#define GPIO_POSRG_POS14 (0x4000U) +#define GPIO_POSRG_POS15_POS (15U) +#define GPIO_POSRG_POS15 (0x8000U) + +/* Bit definition for GPIO_PORRG register */ +#define GPIO_PORRG_POR00_POS (0U) +#define GPIO_PORRG_POR00 (0x0001U) +#define GPIO_PORRG_POR01_POS (1U) +#define GPIO_PORRG_POR01 (0x0002U) +#define GPIO_PORRG_POR02_POS (2U) +#define GPIO_PORRG_POR02 (0x0004U) +#define GPIO_PORRG_POR03_POS (3U) +#define GPIO_PORRG_POR03 (0x0008U) +#define GPIO_PORRG_POR04_POS (4U) +#define GPIO_PORRG_POR04 (0x0010U) +#define GPIO_PORRG_POR05_POS (5U) +#define GPIO_PORRG_POR05 (0x0020U) +#define GPIO_PORRG_POR06_POS (6U) +#define GPIO_PORRG_POR06 (0x0040U) +#define GPIO_PORRG_POR07_POS (7U) +#define GPIO_PORRG_POR07 (0x0080U) +#define GPIO_PORRG_POR08_POS (8U) +#define GPIO_PORRG_POR08 (0x0100U) +#define GPIO_PORRG_POR09_POS (9U) +#define GPIO_PORRG_POR09 (0x0200U) +#define GPIO_PORRG_POR10_POS (10U) +#define GPIO_PORRG_POR10 (0x0400U) +#define GPIO_PORRG_POR11_POS (11U) +#define GPIO_PORRG_POR11 (0x0800U) +#define GPIO_PORRG_POR12_POS (12U) +#define GPIO_PORRG_POR12 (0x1000U) +#define GPIO_PORRG_POR13_POS (13U) +#define GPIO_PORRG_POR13 (0x2000U) +#define GPIO_PORRG_POR14_POS (14U) +#define GPIO_PORRG_POR14 (0x4000U) +#define GPIO_PORRG_POR15_POS (15U) +#define GPIO_PORRG_POR15 (0x8000U) + +/* Bit definition for GPIO_POTRG register */ +#define GPIO_POTRG_POT00_POS (0U) +#define GPIO_POTRG_POT00 (0x0001U) +#define GPIO_POTRG_POT01_POS (1U) +#define GPIO_POTRG_POT01 (0x0002U) +#define GPIO_POTRG_POT02_POS (2U) +#define GPIO_POTRG_POT02 (0x0004U) +#define GPIO_POTRG_POT03_POS (3U) +#define GPIO_POTRG_POT03 (0x0008U) +#define GPIO_POTRG_POT04_POS (4U) +#define GPIO_POTRG_POT04 (0x0010U) +#define GPIO_POTRG_POT05_POS (5U) +#define GPIO_POTRG_POT05 (0x0020U) +#define GPIO_POTRG_POT06_POS (6U) +#define GPIO_POTRG_POT06 (0x0040U) +#define GPIO_POTRG_POT07_POS (7U) +#define GPIO_POTRG_POT07 (0x0080U) +#define GPIO_POTRG_POT08_POS (8U) +#define GPIO_POTRG_POT08 (0x0100U) +#define GPIO_POTRG_POT09_POS (9U) +#define GPIO_POTRG_POT09 (0x0200U) +#define GPIO_POTRG_POT10_POS (10U) +#define GPIO_POTRG_POT10 (0x0400U) +#define GPIO_POTRG_POT11_POS (11U) +#define GPIO_POTRG_POT11 (0x0800U) +#define GPIO_POTRG_POT12_POS (12U) +#define GPIO_POTRG_POT12 (0x1000U) +#define GPIO_POTRG_POT13_POS (13U) +#define GPIO_POTRG_POT13 (0x2000U) +#define GPIO_POTRG_POT14_POS (14U) +#define GPIO_POTRG_POT14 (0x4000U) +#define GPIO_POTRG_POT15_POS (15U) +#define GPIO_POTRG_POT15 (0x8000U) + +/* Bit definition for GPIO_PIDRH register */ +#define GPIO_PIDRH_PIN00_POS (0U) +#define GPIO_PIDRH_PIN00 (0x0001U) +#define GPIO_PIDRH_PIN01_POS (1U) +#define GPIO_PIDRH_PIN01 (0x0002U) +#define GPIO_PIDRH_PIN02_POS (2U) +#define GPIO_PIDRH_PIN02 (0x0004U) +#define GPIO_PIDRH_PIN03_POS (3U) +#define GPIO_PIDRH_PIN03 (0x0008U) +#define GPIO_PIDRH_PIN04_POS (4U) +#define GPIO_PIDRH_PIN04 (0x0010U) +#define GPIO_PIDRH_PIN05_POS (5U) +#define GPIO_PIDRH_PIN05 (0x0020U) +#define GPIO_PIDRH_PIN06_POS (6U) +#define GPIO_PIDRH_PIN06 (0x0040U) +#define GPIO_PIDRH_PIN07_POS (7U) +#define GPIO_PIDRH_PIN07 (0x0080U) +#define GPIO_PIDRH_PIN08_POS (8U) +#define GPIO_PIDRH_PIN08 (0x0100U) +#define GPIO_PIDRH_PIN09_POS (9U) +#define GPIO_PIDRH_PIN09 (0x0200U) +#define GPIO_PIDRH_PIN10_POS (10U) +#define GPIO_PIDRH_PIN10 (0x0400U) +#define GPIO_PIDRH_PIN11_POS (11U) +#define GPIO_PIDRH_PIN11 (0x0800U) +#define GPIO_PIDRH_PIN12_POS (12U) +#define GPIO_PIDRH_PIN12 (0x1000U) +#define GPIO_PIDRH_PIN13_POS (13U) +#define GPIO_PIDRH_PIN13 (0x2000U) +#define GPIO_PIDRH_PIN14_POS (14U) +#define GPIO_PIDRH_PIN14 (0x4000U) +#define GPIO_PIDRH_PIN15_POS (15U) +#define GPIO_PIDRH_PIN15 (0x8000U) + +/* Bit definition for GPIO_PODRH register */ +#define GPIO_PODRH_POUT00_POS (0U) +#define GPIO_PODRH_POUT00 (0x0001U) +#define GPIO_PODRH_POUT01_POS (1U) +#define GPIO_PODRH_POUT01 (0x0002U) +#define GPIO_PODRH_POUT02_POS (2U) +#define GPIO_PODRH_POUT02 (0x0004U) +#define GPIO_PODRH_POUT03_POS (3U) +#define GPIO_PODRH_POUT03 (0x0008U) +#define GPIO_PODRH_POUT04_POS (4U) +#define GPIO_PODRH_POUT04 (0x0010U) +#define GPIO_PODRH_POUT05_POS (5U) +#define GPIO_PODRH_POUT05 (0x0020U) +#define GPIO_PODRH_POUT06_POS (6U) +#define GPIO_PODRH_POUT06 (0x0040U) +#define GPIO_PODRH_POUT07_POS (7U) +#define GPIO_PODRH_POUT07 (0x0080U) +#define GPIO_PODRH_POUT08_POS (8U) +#define GPIO_PODRH_POUT08 (0x0100U) +#define GPIO_PODRH_POUT09_POS (9U) +#define GPIO_PODRH_POUT09 (0x0200U) +#define GPIO_PODRH_POUT10_POS (10U) +#define GPIO_PODRH_POUT10 (0x0400U) +#define GPIO_PODRH_POUT11_POS (11U) +#define GPIO_PODRH_POUT11 (0x0800U) +#define GPIO_PODRH_POUT12_POS (12U) +#define GPIO_PODRH_POUT12 (0x1000U) +#define GPIO_PODRH_POUT13_POS (13U) +#define GPIO_PODRH_POUT13 (0x2000U) +#define GPIO_PODRH_POUT14_POS (14U) +#define GPIO_PODRH_POUT14 (0x4000U) +#define GPIO_PODRH_POUT15_POS (15U) +#define GPIO_PODRH_POUT15 (0x8000U) + +/* Bit definition for GPIO_POERH register */ +#define GPIO_POERH_POUTE00_POS (0U) +#define GPIO_POERH_POUTE00 (0x0001U) +#define GPIO_POERH_POUTE01_POS (1U) +#define GPIO_POERH_POUTE01 (0x0002U) +#define GPIO_POERH_POUTE02_POS (2U) +#define GPIO_POERH_POUTE02 (0x0004U) +#define GPIO_POERH_POUTE03_POS (3U) +#define GPIO_POERH_POUTE03 (0x0008U) +#define GPIO_POERH_POUTE04_POS (4U) +#define GPIO_POERH_POUTE04 (0x0010U) +#define GPIO_POERH_POUTE05_POS (5U) +#define GPIO_POERH_POUTE05 (0x0020U) +#define GPIO_POERH_POUTE06_POS (6U) +#define GPIO_POERH_POUTE06 (0x0040U) +#define GPIO_POERH_POUTE07_POS (7U) +#define GPIO_POERH_POUTE07 (0x0080U) +#define GPIO_POERH_POUTE08_POS (8U) +#define GPIO_POERH_POUTE08 (0x0100U) +#define GPIO_POERH_POUTE09_POS (9U) +#define GPIO_POERH_POUTE09 (0x0200U) +#define GPIO_POERH_POUTE10_POS (10U) +#define GPIO_POERH_POUTE10 (0x0400U) +#define GPIO_POERH_POUTE11_POS (11U) +#define GPIO_POERH_POUTE11 (0x0800U) +#define GPIO_POERH_POUTE12_POS (12U) +#define GPIO_POERH_POUTE12 (0x1000U) +#define GPIO_POERH_POUTE13_POS (13U) +#define GPIO_POERH_POUTE13 (0x2000U) +#define GPIO_POERH_POUTE14_POS (14U) +#define GPIO_POERH_POUTE14 (0x4000U) +#define GPIO_POERH_POUTE15_POS (15U) +#define GPIO_POERH_POUTE15 (0x8000U) + +/* Bit definition for GPIO_POSRH register */ +#define GPIO_POSRH_POS00_POS (0U) +#define GPIO_POSRH_POS00 (0x0001U) +#define GPIO_POSRH_POS01_POS (1U) +#define GPIO_POSRH_POS01 (0x0002U) +#define GPIO_POSRH_POS02_POS (2U) +#define GPIO_POSRH_POS02 (0x0004U) +#define GPIO_POSRH_POS03_POS (3U) +#define GPIO_POSRH_POS03 (0x0008U) +#define GPIO_POSRH_POS04_POS (4U) +#define GPIO_POSRH_POS04 (0x0010U) +#define GPIO_POSRH_POS05_POS (5U) +#define GPIO_POSRH_POS05 (0x0020U) +#define GPIO_POSRH_POS06_POS (6U) +#define GPIO_POSRH_POS06 (0x0040U) +#define GPIO_POSRH_POS07_POS (7U) +#define GPIO_POSRH_POS07 (0x0080U) +#define GPIO_POSRH_POS08_POS (8U) +#define GPIO_POSRH_POS08 (0x0100U) +#define GPIO_POSRH_POS09_POS (9U) +#define GPIO_POSRH_POS09 (0x0200U) +#define GPIO_POSRH_POS10_POS (10U) +#define GPIO_POSRH_POS10 (0x0400U) +#define GPIO_POSRH_POS11_POS (11U) +#define GPIO_POSRH_POS11 (0x0800U) +#define GPIO_POSRH_POS12_POS (12U) +#define GPIO_POSRH_POS12 (0x1000U) +#define GPIO_POSRH_POS13_POS (13U) +#define GPIO_POSRH_POS13 (0x2000U) +#define GPIO_POSRH_POS14_POS (14U) +#define GPIO_POSRH_POS14 (0x4000U) +#define GPIO_POSRH_POS15_POS (15U) +#define GPIO_POSRH_POS15 (0x8000U) + +/* Bit definition for GPIO_PORRH register */ +#define GPIO_PORRH_POR00_POS (0U) +#define GPIO_PORRH_POR00 (0x0001U) +#define GPIO_PORRH_POR01_POS (1U) +#define GPIO_PORRH_POR01 (0x0002U) +#define GPIO_PORRH_POR02_POS (2U) +#define GPIO_PORRH_POR02 (0x0004U) +#define GPIO_PORRH_POR03_POS (3U) +#define GPIO_PORRH_POR03 (0x0008U) +#define GPIO_PORRH_POR04_POS (4U) +#define GPIO_PORRH_POR04 (0x0010U) +#define GPIO_PORRH_POR05_POS (5U) +#define GPIO_PORRH_POR05 (0x0020U) +#define GPIO_PORRH_POR06_POS (6U) +#define GPIO_PORRH_POR06 (0x0040U) +#define GPIO_PORRH_POR07_POS (7U) +#define GPIO_PORRH_POR07 (0x0080U) +#define GPIO_PORRH_POR08_POS (8U) +#define GPIO_PORRH_POR08 (0x0100U) +#define GPIO_PORRH_POR09_POS (9U) +#define GPIO_PORRH_POR09 (0x0200U) +#define GPIO_PORRH_POR10_POS (10U) +#define GPIO_PORRH_POR10 (0x0400U) +#define GPIO_PORRH_POR11_POS (11U) +#define GPIO_PORRH_POR11 (0x0800U) +#define GPIO_PORRH_POR12_POS (12U) +#define GPIO_PORRH_POR12 (0x1000U) +#define GPIO_PORRH_POR13_POS (13U) +#define GPIO_PORRH_POR13 (0x2000U) +#define GPIO_PORRH_POR14_POS (14U) +#define GPIO_PORRH_POR14 (0x4000U) +#define GPIO_PORRH_POR15_POS (15U) +#define GPIO_PORRH_POR15 (0x8000U) + +/* Bit definition for GPIO_POTRH register */ +#define GPIO_POTRH_POT00_POS (0U) +#define GPIO_POTRH_POT00 (0x0001U) +#define GPIO_POTRH_POT01_POS (1U) +#define GPIO_POTRH_POT01 (0x0002U) +#define GPIO_POTRH_POT02_POS (2U) +#define GPIO_POTRH_POT02 (0x0004U) +#define GPIO_POTRH_POT03_POS (3U) +#define GPIO_POTRH_POT03 (0x0008U) +#define GPIO_POTRH_POT04_POS (4U) +#define GPIO_POTRH_POT04 (0x0010U) +#define GPIO_POTRH_POT05_POS (5U) +#define GPIO_POTRH_POT05 (0x0020U) +#define GPIO_POTRH_POT06_POS (6U) +#define GPIO_POTRH_POT06 (0x0040U) +#define GPIO_POTRH_POT07_POS (7U) +#define GPIO_POTRH_POT07 (0x0080U) +#define GPIO_POTRH_POT08_POS (8U) +#define GPIO_POTRH_POT08 (0x0100U) +#define GPIO_POTRH_POT09_POS (9U) +#define GPIO_POTRH_POT09 (0x0200U) +#define GPIO_POTRH_POT10_POS (10U) +#define GPIO_POTRH_POT10 (0x0400U) +#define GPIO_POTRH_POT11_POS (11U) +#define GPIO_POTRH_POT11 (0x0800U) +#define GPIO_POTRH_POT12_POS (12U) +#define GPIO_POTRH_POT12 (0x1000U) +#define GPIO_POTRH_POT13_POS (13U) +#define GPIO_POTRH_POT13 (0x2000U) +#define GPIO_POTRH_POT14_POS (14U) +#define GPIO_POTRH_POT14 (0x4000U) +#define GPIO_POTRH_POT15_POS (15U) +#define GPIO_POTRH_POT15 (0x8000U) + +/* Bit definition for GPIO_PIDRI register */ +#define GPIO_PIDRI_PIN00_POS (0U) +#define GPIO_PIDRI_PIN00 (0x0001U) +#define GPIO_PIDRI_PIN01_POS (1U) +#define GPIO_PIDRI_PIN01 (0x0002U) +#define GPIO_PIDRI_PIN02_POS (2U) +#define GPIO_PIDRI_PIN02 (0x0004U) +#define GPIO_PIDRI_PIN03_POS (3U) +#define GPIO_PIDRI_PIN03 (0x0008U) +#define GPIO_PIDRI_PIN04_POS (4U) +#define GPIO_PIDRI_PIN04 (0x0010U) +#define GPIO_PIDRI_PIN05_POS (5U) +#define GPIO_PIDRI_PIN05 (0x0020U) +#define GPIO_PIDRI_PIN06_POS (6U) +#define GPIO_PIDRI_PIN06 (0x0040U) +#define GPIO_PIDRI_PIN07_POS (7U) +#define GPIO_PIDRI_PIN07 (0x0080U) +#define GPIO_PIDRI_PIN08_POS (8U) +#define GPIO_PIDRI_PIN08 (0x0100U) +#define GPIO_PIDRI_PIN09_POS (9U) +#define GPIO_PIDRI_PIN09 (0x0200U) +#define GPIO_PIDRI_PIN10_POS (10U) +#define GPIO_PIDRI_PIN10 (0x0400U) +#define GPIO_PIDRI_PIN11_POS (11U) +#define GPIO_PIDRI_PIN11 (0x0800U) +#define GPIO_PIDRI_PIN12_POS (12U) +#define GPIO_PIDRI_PIN12 (0x1000U) +#define GPIO_PIDRI_PIN13_POS (13U) +#define GPIO_PIDRI_PIN13 (0x2000U) + +/* Bit definition for GPIO_PODRI register */ +#define GPIO_PODRI_POUT00_POS (0U) +#define GPIO_PODRI_POUT00 (0x0001U) +#define GPIO_PODRI_POUT01_POS (1U) +#define GPIO_PODRI_POUT01 (0x0002U) +#define GPIO_PODRI_POUT02_POS (2U) +#define GPIO_PODRI_POUT02 (0x0004U) +#define GPIO_PODRI_POUT03_POS (3U) +#define GPIO_PODRI_POUT03 (0x0008U) +#define GPIO_PODRI_POUT04_POS (4U) +#define GPIO_PODRI_POUT04 (0x0010U) +#define GPIO_PODRI_POUT05_POS (5U) +#define GPIO_PODRI_POUT05 (0x0020U) +#define GPIO_PODRI_POUT06_POS (6U) +#define GPIO_PODRI_POUT06 (0x0040U) +#define GPIO_PODRI_POUT07_POS (7U) +#define GPIO_PODRI_POUT07 (0x0080U) +#define GPIO_PODRI_POUT08_POS (8U) +#define GPIO_PODRI_POUT08 (0x0100U) +#define GPIO_PODRI_POUT09_POS (9U) +#define GPIO_PODRI_POUT09 (0x0200U) +#define GPIO_PODRI_POUT10_POS (10U) +#define GPIO_PODRI_POUT10 (0x0400U) +#define GPIO_PODRI_POUT11_POS (11U) +#define GPIO_PODRI_POUT11 (0x0800U) +#define GPIO_PODRI_POUT12_POS (12U) +#define GPIO_PODRI_POUT12 (0x1000U) +#define GPIO_PODRI_POUT13_POS (13U) +#define GPIO_PODRI_POUT13 (0x2000U) + +/* Bit definition for GPIO_POERI register */ +#define GPIO_POERI_POUTE00_POS (0U) +#define GPIO_POERI_POUTE00 (0x0001U) +#define GPIO_POERI_POUTE01_POS (1U) +#define GPIO_POERI_POUTE01 (0x0002U) +#define GPIO_POERI_POUTE02_POS (2U) +#define GPIO_POERI_POUTE02 (0x0004U) +#define GPIO_POERI_POUTE03_POS (3U) +#define GPIO_POERI_POUTE03 (0x0008U) +#define GPIO_POERI_POUTE04_POS (4U) +#define GPIO_POERI_POUTE04 (0x0010U) +#define GPIO_POERI_POUTE05_POS (5U) +#define GPIO_POERI_POUTE05 (0x0020U) +#define GPIO_POERI_POUTE06_POS (6U) +#define GPIO_POERI_POUTE06 (0x0040U) +#define GPIO_POERI_POUTE07_POS (7U) +#define GPIO_POERI_POUTE07 (0x0080U) +#define GPIO_POERI_POUTE08_POS (8U) +#define GPIO_POERI_POUTE08 (0x0100U) +#define GPIO_POERI_POUTE09_POS (9U) +#define GPIO_POERI_POUTE09 (0x0200U) +#define GPIO_POERI_POUTE10_POS (10U) +#define GPIO_POERI_POUTE10 (0x0400U) +#define GPIO_POERI_POUTE11_POS (11U) +#define GPIO_POERI_POUTE11 (0x0800U) +#define GPIO_POERI_POUTE12_POS (12U) +#define GPIO_POERI_POUTE12 (0x1000U) +#define GPIO_POERI_POUTE13_POS (13U) +#define GPIO_POERI_POUTE13 (0x2000U) + +/* Bit definition for GPIO_POSRI register */ +#define GPIO_POSRI_POS00_POS (0U) +#define GPIO_POSRI_POS00 (0x0001U) +#define GPIO_POSRI_POS01_POS (1U) +#define GPIO_POSRI_POS01 (0x0002U) +#define GPIO_POSRI_POS02_POS (2U) +#define GPIO_POSRI_POS02 (0x0004U) +#define GPIO_POSRI_POS03_POS (3U) +#define GPIO_POSRI_POS03 (0x0008U) +#define GPIO_POSRI_POS04_POS (4U) +#define GPIO_POSRI_POS04 (0x0010U) +#define GPIO_POSRI_POS05_POS (5U) +#define GPIO_POSRI_POS05 (0x0020U) +#define GPIO_POSRI_POS06_POS (6U) +#define GPIO_POSRI_POS06 (0x0040U) +#define GPIO_POSRI_POS07_POS (7U) +#define GPIO_POSRI_POS07 (0x0080U) +#define GPIO_POSRI_POS08_POS (8U) +#define GPIO_POSRI_POS08 (0x0100U) +#define GPIO_POSRI_POS09_POS (9U) +#define GPIO_POSRI_POS09 (0x0200U) +#define GPIO_POSRI_POS10_POS (10U) +#define GPIO_POSRI_POS10 (0x0400U) +#define GPIO_POSRI_POS11_POS (11U) +#define GPIO_POSRI_POS11 (0x0800U) +#define GPIO_POSRI_POS12_POS (12U) +#define GPIO_POSRI_POS12 (0x1000U) +#define GPIO_POSRI_POS13_POS (13U) +#define GPIO_POSRI_POS13 (0x2000U) + +/* Bit definition for GPIO_PORRI register */ +#define GPIO_PORRI_POR00_POS (0U) +#define GPIO_PORRI_POR00 (0x0001U) +#define GPIO_PORRI_POR01_POS (1U) +#define GPIO_PORRI_POR01 (0x0002U) +#define GPIO_PORRI_POR02_POS (2U) +#define GPIO_PORRI_POR02 (0x0004U) +#define GPIO_PORRI_POR03_POS (3U) +#define GPIO_PORRI_POR03 (0x0008U) +#define GPIO_PORRI_POR04_POS (4U) +#define GPIO_PORRI_POR04 (0x0010U) +#define GPIO_PORRI_POR05_POS (5U) +#define GPIO_PORRI_POR05 (0x0020U) +#define GPIO_PORRI_POR06_POS (6U) +#define GPIO_PORRI_POR06 (0x0040U) +#define GPIO_PORRI_POR07_POS (7U) +#define GPIO_PORRI_POR07 (0x0080U) +#define GPIO_PORRI_POR08_POS (8U) +#define GPIO_PORRI_POR08 (0x0100U) +#define GPIO_PORRI_POR09_POS (9U) +#define GPIO_PORRI_POR09 (0x0200U) +#define GPIO_PORRI_POR10_POS (10U) +#define GPIO_PORRI_POR10 (0x0400U) +#define GPIO_PORRI_POR11_POS (11U) +#define GPIO_PORRI_POR11 (0x0800U) +#define GPIO_PORRI_POR12_POS (12U) +#define GPIO_PORRI_POR12 (0x1000U) +#define GPIO_PORRI_POR13_POS (13U) +#define GPIO_PORRI_POR13 (0x2000U) + +/* Bit definition for GPIO_POTRI register */ +#define GPIO_POTRI_POT00_POS (0U) +#define GPIO_POTRI_POT00 (0x0001U) +#define GPIO_POTRI_POT01_POS (1U) +#define GPIO_POTRI_POT01 (0x0002U) +#define GPIO_POTRI_POT02_POS (2U) +#define GPIO_POTRI_POT02 (0x0004U) +#define GPIO_POTRI_POT03_POS (3U) +#define GPIO_POTRI_POT03 (0x0008U) +#define GPIO_POTRI_POT04_POS (4U) +#define GPIO_POTRI_POT04 (0x0010U) +#define GPIO_POTRI_POT05_POS (5U) +#define GPIO_POTRI_POT05 (0x0020U) +#define GPIO_POTRI_POT06_POS (6U) +#define GPIO_POTRI_POT06 (0x0040U) +#define GPIO_POTRI_POT07_POS (7U) +#define GPIO_POTRI_POT07 (0x0080U) +#define GPIO_POTRI_POT08_POS (8U) +#define GPIO_POTRI_POT08 (0x0100U) +#define GPIO_POTRI_POT09_POS (9U) +#define GPIO_POTRI_POT09 (0x0200U) +#define GPIO_POTRI_POT10_POS (10U) +#define GPIO_POTRI_POT10 (0x0400U) +#define GPIO_POTRI_POT11_POS (11U) +#define GPIO_POTRI_POT11 (0x0800U) +#define GPIO_POTRI_POT12_POS (12U) +#define GPIO_POTRI_POT12 (0x1000U) +#define GPIO_POTRI_POT13_POS (13U) +#define GPIO_POTRI_POT13 (0x2000U) + +/* Bit definition for GPIO_PSPCR register */ +#define GPIO_PSPCR_SPFE (0x001FU) + +/* Bit definition for GPIO_PCCR register */ +#define GPIO_PCCR_BFSEL_POS (0U) +#define GPIO_PCCR_BFSEL (0x003FU) +#define GPIO_PCCR_RDWT_POS (12U) +#define GPIO_PCCR_RDWT (0x7000U) + +/* Bit definition for GPIO_PINAER register */ +#define GPIO_PINAER_PINAE (0x01FFU) + +/* Bit definition for GPIO_PWPR register */ +#define GPIO_PWPR_WE_POS (0U) +#define GPIO_PWPR_WE (0x0001U) +#define GPIO_PWPR_WP_POS (8U) +#define GPIO_PWPR_WP (0xFF00U) + +/* Bit definition for GPIO_PCR register */ +#define GPIO_PCR_POUT_POS (0U) +#define GPIO_PCR_POUT (0x0001U) +#define GPIO_PCR_POUTE_POS (1U) +#define GPIO_PCR_POUTE (0x0002U) +#define GPIO_PCR_NOD_POS (2U) +#define GPIO_PCR_NOD (0x0004U) +#define GPIO_PCR_DRV_POS (4U) +#define GPIO_PCR_DRV (0x0030U) +#define GPIO_PCR_DRV_0 (0x0010U) +#define GPIO_PCR_DRV_1 (0x0020U) +#define GPIO_PCR_PUU_POS (6U) +#define GPIO_PCR_PUU (0x0040U) +#define GPIO_PCR_PIN_POS (8U) +#define GPIO_PCR_PIN (0x0100U) +#define GPIO_PCR_INVE_POS (9U) +#define GPIO_PCR_INVE (0x0200U) +#define GPIO_PCR_CINSEL_POS (10U) +#define GPIO_PCR_CINSEL (0x0400U) +#define GPIO_PCR_INTE_POS (12U) +#define GPIO_PCR_INTE (0x1000U) +#define GPIO_PCR_LTE_POS (14U) +#define GPIO_PCR_LTE (0x4000U) +#define GPIO_PCR_DDIS_POS (15U) +#define GPIO_PCR_DDIS (0x8000U) + +/* Bit definition for GPIO_PFSR register */ +#define GPIO_PFSR_FSEL_POS (0U) +#define GPIO_PFSR_FSEL (0x003FU) +#define GPIO_PFSR_BFE_POS (8U) +#define GPIO_PFSR_BFE (0x0100U) + +/******************************************************************************* + Bit definition for Peripheral HASH +*******************************************************************************/ +/* Bit definition for HASH_CR register */ +#define HASH_CR_START_POS (0U) +#define HASH_CR_START (0x00000001UL) +#define HASH_CR_FST_GRP_POS (1U) +#define HASH_CR_FST_GRP (0x00000002UL) +#define HASH_CR_KMSG_END_POS (2U) +#define HASH_CR_KMSG_END (0x00000004UL) +#define HASH_CR_MODE_POS (4U) +#define HASH_CR_MODE (0x00000030UL) +#define HASH_CR_MODE_0 (0x00000010UL) +#define HASH_CR_MODE_1 (0x00000020UL) +#define HASH_CR_LKEY_POS (6U) +#define HASH_CR_LKEY (0x00000040UL) +#define HASH_CR_BUSY_POS (8U) +#define HASH_CR_BUSY (0x00000100UL) +#define HASH_CR_CYC_END_POS (9U) +#define HASH_CR_CYC_END (0x00000200UL) +#define HASH_CR_HMAC_END_POS (10U) +#define HASH_CR_HMAC_END (0x00000400UL) +#define HASH_CR_HCIE_POS (14U) +#define HASH_CR_HCIE (0x00004000UL) +#define HASH_CR_HEIE_POS (15U) +#define HASH_CR_HEIE (0x00008000UL) + +/* Bit definition for HASH_HR7 register */ +#define HASH_HR7 (0xFFFFFFFFUL) + +/* Bit definition for HASH_HR6 register */ +#define HASH_HR6 (0xFFFFFFFFUL) + +/* Bit definition for HASH_HR5 register */ +#define HASH_HR5 (0xFFFFFFFFUL) + +/* Bit definition for HASH_HR4 register */ +#define HASH_HR4 (0xFFFFFFFFUL) + +/* Bit definition for HASH_HR3 register */ +#define HASH_HR3 (0xFFFFFFFFUL) + +/* Bit definition for HASH_HR2 register */ +#define HASH_HR2 (0xFFFFFFFFUL) + +/* Bit definition for HASH_HR1 register */ +#define HASH_HR1 (0xFFFFFFFFUL) + +/* Bit definition for HASH_HR0 register */ +#define HASH_HR0 (0xFFFFFFFFUL) + +/* Bit definition for HASH_DR15 register */ +#define HASH_DR15 (0xFFFFFFFFUL) + +/* Bit definition for HASH_DR14 register */ +#define HASH_DR14 (0xFFFFFFFFUL) + +/* Bit definition for HASH_DR13 register */ +#define HASH_DR13 (0xFFFFFFFFUL) + +/* Bit definition for HASH_DR12 register */ +#define HASH_DR12 (0xFFFFFFFFUL) + +/* Bit definition for HASH_DR11 register */ +#define HASH_DR11 (0xFFFFFFFFUL) + +/* Bit definition for HASH_DR10 register */ +#define HASH_DR10 (0xFFFFFFFFUL) + +/* Bit definition for HASH_DR9 register */ +#define HASH_DR9 (0xFFFFFFFFUL) + +/* Bit definition for HASH_DR8 register */ +#define HASH_DR8 (0xFFFFFFFFUL) + +/* Bit definition for HASH_DR7 register */ +#define HASH_DR7 (0xFFFFFFFFUL) + +/* Bit definition for HASH_DR6 register */ +#define HASH_DR6 (0xFFFFFFFFUL) + +/* Bit definition for HASH_DR5 register */ +#define HASH_DR5 (0xFFFFFFFFUL) + +/* Bit definition for HASH_DR4 register */ +#define HASH_DR4 (0xFFFFFFFFUL) + +/* Bit definition for HASH_DR3 register */ +#define HASH_DR3 (0xFFFFFFFFUL) + +/* Bit definition for HASH_DR2 register */ +#define HASH_DR2 (0xFFFFFFFFUL) + +/* Bit definition for HASH_DR1 register */ +#define HASH_DR1 (0xFFFFFFFFUL) + +/* Bit definition for HASH_DR0 register */ +#define HASH_DR0 (0xFFFFFFFFUL) + +/******************************************************************************* + Bit definition for Peripheral HRPWM +*******************************************************************************/ +/* Bit definition for HRPWM_CR register */ +#define HRPWM_CR_NSEL_POS (0U) +#define HRPWM_CR_NSEL (0x000000FFUL) +#define HRPWM_CR_PSEL_POS (8U) +#define HRPWM_CR_PSEL (0x0000FF00UL) +#define HRPWM_CR_NE_POS (29U) +#define HRPWM_CR_NE (0x20000000UL) +#define HRPWM_CR_PE_POS (30U) +#define HRPWM_CR_PE (0x40000000UL) +#define HRPWM_CR_EN_POS (31U) +#define HRPWM_CR_EN (0x80000000UL) + +/* Bit definition for HRPWM_CALCR register */ +#define HRPWM_CALCR_CALCODE_POS (0U) +#define HRPWM_CALCR_CALCODE (0x000000FFUL) +#define HRPWM_CALCR_ENDF_POS (12U) +#define HRPWM_CALCR_ENDF (0x00001000UL) +#define HRPWM_CALCR_CALEN_POS (15U) +#define HRPWM_CALCR_CALEN (0x00008000UL) + +/******************************************************************************* + Bit definition for Peripheral I2C +*******************************************************************************/ +/* Bit definition for I2C_CR1 register */ +#define I2C_CR1_PE_POS (0U) +#define I2C_CR1_PE (0x00000001UL) +#define I2C_CR1_SMBUS_POS (1U) +#define I2C_CR1_SMBUS (0x00000002UL) +#define I2C_CR1_SMBALRTEN_POS (2U) +#define I2C_CR1_SMBALRTEN (0x00000004UL) +#define I2C_CR1_SMBDEFAULTEN_POS (3U) +#define I2C_CR1_SMBDEFAULTEN (0x00000008UL) +#define I2C_CR1_SMBHOSTEN_POS (4U) +#define I2C_CR1_SMBHOSTEN (0x00000010UL) +#define I2C_CR1_ENGC_POS (6U) +#define I2C_CR1_ENGC (0x00000040UL) +#define I2C_CR1_RESTART_POS (7U) +#define I2C_CR1_RESTART (0x00000080UL) +#define I2C_CR1_START_POS (8U) +#define I2C_CR1_START (0x00000100UL) +#define I2C_CR1_STOP_POS (9U) +#define I2C_CR1_STOP (0x00000200UL) +#define I2C_CR1_ACK_POS (10U) +#define I2C_CR1_ACK (0x00000400UL) +#define I2C_CR1_SWRST_POS (15U) +#define I2C_CR1_SWRST (0x00008000UL) + +/* Bit definition for I2C_CR2 register */ +#define I2C_CR2_STARTIE_POS (0U) +#define I2C_CR2_STARTIE (0x00000001UL) +#define I2C_CR2_SLADDR0IE_POS (1U) +#define I2C_CR2_SLADDR0IE (0x00000002UL) +#define I2C_CR2_SLADDR1IE_POS (2U) +#define I2C_CR2_SLADDR1IE (0x00000004UL) +#define I2C_CR2_TENDIE_POS (3U) +#define I2C_CR2_TENDIE (0x00000008UL) +#define I2C_CR2_STOPIE_POS (4U) +#define I2C_CR2_STOPIE (0x00000010UL) +#define I2C_CR2_RFULLIE_POS (6U) +#define I2C_CR2_RFULLIE (0x00000040UL) +#define I2C_CR2_TEMPTYIE_POS (7U) +#define I2C_CR2_TEMPTYIE (0x00000080UL) +#define I2C_CR2_ARLOIE_POS (9U) +#define I2C_CR2_ARLOIE (0x00000200UL) +#define I2C_CR2_NACKIE_POS (12U) +#define I2C_CR2_NACKIE (0x00001000UL) +#define I2C_CR2_TMOUTIE_POS (14U) +#define I2C_CR2_TMOUTIE (0x00004000UL) +#define I2C_CR2_GENCALLIE_POS (20U) +#define I2C_CR2_GENCALLIE (0x00100000UL) +#define I2C_CR2_SMBDEFAULTIE_POS (21U) +#define I2C_CR2_SMBDEFAULTIE (0x00200000UL) +#define I2C_CR2_SMHOSTIE_POS (22U) +#define I2C_CR2_SMHOSTIE (0x00400000UL) +#define I2C_CR2_SMBALRTIE_POS (23U) +#define I2C_CR2_SMBALRTIE (0x00800000UL) + +/* Bit definition for I2C_CR3 register */ +#define I2C_CR3_TMOUTEN_POS (0U) +#define I2C_CR3_TMOUTEN (0x00000001UL) +#define I2C_CR3_LTMOUT_POS (1U) +#define I2C_CR3_LTMOUT (0x00000002UL) +#define I2C_CR3_HTMOUT_POS (2U) +#define I2C_CR3_HTMOUT (0x00000004UL) +#define I2C_CR3_FACKEN_POS (7U) +#define I2C_CR3_FACKEN (0x00000080UL) + +/* Bit definition for I2C_SLR0 register */ +#define I2C_SLR0_SLADDR0_POS (0U) +#define I2C_SLR0_SLADDR0 (0x000003FFUL) +#define I2C_SLR0_SLADDR0EN_POS (12U) +#define I2C_SLR0_SLADDR0EN (0x00001000UL) +#define I2C_SLR0_ADDRMOD0_POS (15U) +#define I2C_SLR0_ADDRMOD0 (0x00008000UL) + +/* Bit definition for I2C_SLR1 register */ +#define I2C_SLR1_SLADDR1_POS (0U) +#define I2C_SLR1_SLADDR1 (0x000003FFUL) +#define I2C_SLR1_SLADDR1EN_POS (12U) +#define I2C_SLR1_SLADDR1EN (0x00001000UL) +#define I2C_SLR1_ADDRMOD1_POS (15U) +#define I2C_SLR1_ADDRMOD1 (0x00008000UL) + +/* Bit definition for I2C_SLTR register */ +#define I2C_SLTR_TOUTLOW_POS (0U) +#define I2C_SLTR_TOUTLOW (0x0000FFFFUL) +#define I2C_SLTR_TOUTHIGH_POS (16U) +#define I2C_SLTR_TOUTHIGH (0xFFFF0000UL) + +/* Bit definition for I2C_SR register */ +#define I2C_SR_STARTF_POS (0U) +#define I2C_SR_STARTF (0x00000001UL) +#define I2C_SR_SLADDR0F_POS (1U) +#define I2C_SR_SLADDR0F (0x00000002UL) +#define I2C_SR_SLADDR1F_POS (2U) +#define I2C_SR_SLADDR1F (0x00000004UL) +#define I2C_SR_TENDF_POS (3U) +#define I2C_SR_TENDF (0x00000008UL) +#define I2C_SR_STOPF_POS (4U) +#define I2C_SR_STOPF (0x00000010UL) +#define I2C_SR_RFULLF_POS (6U) +#define I2C_SR_RFULLF (0x00000040UL) +#define I2C_SR_TEMPTYF_POS (7U) +#define I2C_SR_TEMPTYF (0x00000080UL) +#define I2C_SR_ARLOF_POS (9U) +#define I2C_SR_ARLOF (0x00000200UL) +#define I2C_SR_ACKRF_POS (10U) +#define I2C_SR_ACKRF (0x00000400UL) +#define I2C_SR_NACKF_POS (12U) +#define I2C_SR_NACKF (0x00001000UL) +#define I2C_SR_TMOUTF_POS (14U) +#define I2C_SR_TMOUTF (0x00004000UL) +#define I2C_SR_MSL_POS (16U) +#define I2C_SR_MSL (0x00010000UL) +#define I2C_SR_BUSY_POS (17U) +#define I2C_SR_BUSY (0x00020000UL) +#define I2C_SR_TRA_POS (18U) +#define I2C_SR_TRA (0x00040000UL) +#define I2C_SR_GENCALLF_POS (20U) +#define I2C_SR_GENCALLF (0x00100000UL) +#define I2C_SR_SMBDEFAULTF_POS (21U) +#define I2C_SR_SMBDEFAULTF (0x00200000UL) +#define I2C_SR_SMBHOSTF_POS (22U) +#define I2C_SR_SMBHOSTF (0x00400000UL) +#define I2C_SR_SMBALRTF_POS (23U) +#define I2C_SR_SMBALRTF (0x00800000UL) + +/* Bit definition for I2C_CLR register */ +#define I2C_CLR_STARTFCLR_POS (0U) +#define I2C_CLR_STARTFCLR (0x00000001UL) +#define I2C_CLR_SLADDR0FCLR_POS (1U) +#define I2C_CLR_SLADDR0FCLR (0x00000002UL) +#define I2C_CLR_SLADDR1FCLR_POS (2U) +#define I2C_CLR_SLADDR1FCLR (0x00000004UL) +#define I2C_CLR_TENDFCLR_POS (3U) +#define I2C_CLR_TENDFCLR (0x00000008UL) +#define I2C_CLR_STOPFCLR_POS (4U) +#define I2C_CLR_STOPFCLR (0x00000010UL) +#define I2C_CLR_RFULLFCLR_POS (6U) +#define I2C_CLR_RFULLFCLR (0x00000040UL) +#define I2C_CLR_TEMPTYFCLR_POS (7U) +#define I2C_CLR_TEMPTYFCLR (0x00000080UL) +#define I2C_CLR_ARLOFCLR_POS (9U) +#define I2C_CLR_ARLOFCLR (0x00000200UL) +#define I2C_CLR_NACKFCLR_POS (12U) +#define I2C_CLR_NACKFCLR (0x00001000UL) +#define I2C_CLR_TMOUTFCLR_POS (14U) +#define I2C_CLR_TMOUTFCLR (0x00004000UL) +#define I2C_CLR_GENCALLFCLR_POS (20U) +#define I2C_CLR_GENCALLFCLR (0x00100000UL) +#define I2C_CLR_SMBDEFAULTFCLR_POS (21U) +#define I2C_CLR_SMBDEFAULTFCLR (0x00200000UL) +#define I2C_CLR_SMBHOSTFCLR_POS (22U) +#define I2C_CLR_SMBHOSTFCLR (0x00400000UL) +#define I2C_CLR_SMBALRTFCLR_POS (23U) +#define I2C_CLR_SMBALRTFCLR (0x00800000UL) + +/* Bit definition for I2C_DTR register */ +#define I2C_DTR_DT (0xFFU) + +/* Bit definition for I2C_DRR register */ +#define I2C_DRR_DR (0xFFU) + +/* Bit definition for I2C_CCR register */ +#define I2C_CCR_SLOWW_POS (0U) +#define I2C_CCR_SLOWW (0x0000001FUL) +#define I2C_CCR_SHIGHW_POS (8U) +#define I2C_CCR_SHIGHW (0x00001F00UL) +#define I2C_CCR_FREQ_POS (16U) +#define I2C_CCR_FREQ (0x00070000UL) + +/* Bit definition for I2C_FLTR register */ +#define I2C_FLTR_DNF_POS (0U) +#define I2C_FLTR_DNF (0x00000003UL) +#define I2C_FLTR_DNFEN_POS (4U) +#define I2C_FLTR_DNFEN (0x00000010UL) +#define I2C_FLTR_ANFEN_POS (5U) +#define I2C_FLTR_ANFEN (0x00000020UL) + +/******************************************************************************* + Bit definition for Peripheral I2S +*******************************************************************************/ +/* Bit definition for I2S_CTRL register */ +#define I2S_CTRL_TXE_POS (0U) +#define I2S_CTRL_TXE (0x00000001UL) +#define I2S_CTRL_TXIE_POS (1U) +#define I2S_CTRL_TXIE (0x00000002UL) +#define I2S_CTRL_RXE_POS (2U) +#define I2S_CTRL_RXE (0x00000004UL) +#define I2S_CTRL_RXIE_POS (3U) +#define I2S_CTRL_RXIE (0x00000008UL) +#define I2S_CTRL_EIE_POS (4U) +#define I2S_CTRL_EIE (0x00000010UL) +#define I2S_CTRL_WMS_POS (5U) +#define I2S_CTRL_WMS (0x00000020UL) +#define I2S_CTRL_ODD_POS (6U) +#define I2S_CTRL_ODD (0x00000040UL) +#define I2S_CTRL_MCKOE_POS (7U) +#define I2S_CTRL_MCKOE (0x00000080UL) +#define I2S_CTRL_TXBIRQWL_POS (8U) +#define I2S_CTRL_TXBIRQWL (0x00000700UL) +#define I2S_CTRL_TXBIRQWL_0 (0x00000100UL) +#define I2S_CTRL_TXBIRQWL_1 (0x00000200UL) +#define I2S_CTRL_TXBIRQWL_2 (0x00000400UL) +#define I2S_CTRL_RXBIRQWL_POS (12U) +#define I2S_CTRL_RXBIRQWL (0x00007000UL) +#define I2S_CTRL_RXBIRQWL_0 (0x00001000UL) +#define I2S_CTRL_RXBIRQWL_1 (0x00002000UL) +#define I2S_CTRL_RXBIRQWL_2 (0x00004000UL) +#define I2S_CTRL_FIFOR_POS (16U) +#define I2S_CTRL_FIFOR (0x00010000UL) +#define I2S_CTRL_CODECRC_POS (17U) +#define I2S_CTRL_CODECRC (0x00020000UL) +#define I2S_CTRL_I2SPLLSEL_POS (18U) +#define I2S_CTRL_I2SPLLSEL (0x00040000UL) +#define I2S_CTRL_SDOE_POS (19U) +#define I2S_CTRL_SDOE (0x00080000UL) +#define I2S_CTRL_LRCKOE_POS (20U) +#define I2S_CTRL_LRCKOE (0x00100000UL) +#define I2S_CTRL_CKOE_POS (21U) +#define I2S_CTRL_CKOE (0x00200000UL) +#define I2S_CTRL_DUPLEX_POS (22U) +#define I2S_CTRL_DUPLEX (0x00400000UL) +#define I2S_CTRL_CLKSEL_POS (23U) +#define I2S_CTRL_CLKSEL (0x00800000UL) +#define I2S_CTRL_SRST_POS (24U) +#define I2S_CTRL_SRST (0x01000000UL) + +/* Bit definition for I2S_SR register */ +#define I2S_SR_TXBA_POS (0U) +#define I2S_SR_TXBA (0x00000001UL) +#define I2S_SR_RXBA_POS (1U) +#define I2S_SR_RXBA (0x00000002UL) +#define I2S_SR_TXBE_POS (2U) +#define I2S_SR_TXBE (0x00000004UL) +#define I2S_SR_TXBF_POS (3U) +#define I2S_SR_TXBF (0x00000008UL) +#define I2S_SR_RXBE_POS (4U) +#define I2S_SR_RXBE (0x00000010UL) +#define I2S_SR_RXBF_POS (5U) +#define I2S_SR_RXBF (0x00000020UL) + +/* Bit definition for I2S_ER register */ +#define I2S_ER_TXERR_POS (0U) +#define I2S_ER_TXERR (0x00000001UL) +#define I2S_ER_RXERR_POS (1U) +#define I2S_ER_RXERR (0x00000002UL) + +/* Bit definition for I2S_CFGR register */ +#define I2S_CFGR_I2SSTD_POS (0U) +#define I2S_CFGR_I2SSTD (0x00000003UL) +#define I2S_CFGR_I2SSTD_0 (0x00000001UL) +#define I2S_CFGR_I2SSTD_1 (0x00000002UL) +#define I2S_CFGR_DATLEN_POS (2U) +#define I2S_CFGR_DATLEN (0x0000000CUL) +#define I2S_CFGR_DATLEN_0 (0x00000004UL) +#define I2S_CFGR_DATLEN_1 (0x00000008UL) +#define I2S_CFGR_CHLEN_POS (4U) +#define I2S_CFGR_CHLEN (0x00000010UL) +#define I2S_CFGR_PCMSYNC_POS (5U) +#define I2S_CFGR_PCMSYNC (0x00000020UL) + +/* Bit definition for I2S_TXBUF register */ +#define I2S_TXBUF (0xFFFFFFFFUL) + +/* Bit definition for I2S_RXBUF register */ +#define I2S_RXBUF (0xFFFFFFFFUL) + +/* Bit definition for I2S_PR register */ +#define I2S_PR_I2SDIV (0x000000FFUL) + +/******************************************************************************* + Bit definition for Peripheral ICG +*******************************************************************************/ +/* Bit definition for ICG_ICG0 register */ +#define ICG_ICG0_SWDTAUTS_POS (0U) +#define ICG_ICG0_SWDTAUTS (0x00000001UL) +#define ICG_ICG0_SWDTITS_POS (1U) +#define ICG_ICG0_SWDTITS (0x00000002UL) +#define ICG_ICG0_SWDTPERI_POS (2U) +#define ICG_ICG0_SWDTPERI (0x0000000CUL) +#define ICG_ICG0_SWDTPERI_0 (0x00000004UL) +#define ICG_ICG0_SWDTPERI_1 (0x00000008UL) +#define ICG_ICG0_SWDTCKS_POS (4U) +#define ICG_ICG0_SWDTCKS (0x000000F0UL) +#define ICG_ICG0_SWDTCKS_0 (0x00000010UL) +#define ICG_ICG0_SWDTCKS_1 (0x00000020UL) +#define ICG_ICG0_SWDTCKS_2 (0x00000040UL) +#define ICG_ICG0_SWDTCKS_3 (0x00000080UL) +#define ICG_ICG0_SWDTWDPT_POS (8U) +#define ICG_ICG0_SWDTWDPT (0x00000F00UL) +#define ICG_ICG0_SWDTWDPT_0 (0x00000100UL) +#define ICG_ICG0_SWDTWDPT_1 (0x00000200UL) +#define ICG_ICG0_SWDTWDPT_2 (0x00000400UL) +#define ICG_ICG0_SWDTWDPT_3 (0x00000800UL) +#define ICG_ICG0_SWDTSLPOFF_POS (12U) +#define ICG_ICG0_SWDTSLPOFF (0x00001000UL) +#define ICG_ICG0_WDTAUTS_POS (16U) +#define ICG_ICG0_WDTAUTS (0x00010000UL) +#define ICG_ICG0_WDTITS_POS (17U) +#define ICG_ICG0_WDTITS (0x00020000UL) +#define ICG_ICG0_WDTPERI_POS (18U) +#define ICG_ICG0_WDTPERI (0x000C0000UL) +#define ICG_ICG0_WDTPERI_0 (0x00040000UL) +#define ICG_ICG0_WDTPERI_1 (0x00080000UL) +#define ICG_ICG0_WDTCKS_POS (20U) +#define ICG_ICG0_WDTCKS (0x00F00000UL) +#define ICG_ICG0_WDTCKS_0 (0x00100000UL) +#define ICG_ICG0_WDTCKS_1 (0x00200000UL) +#define ICG_ICG0_WDTCKS_2 (0x00400000UL) +#define ICG_ICG0_WDTCKS_3 (0x00800000UL) +#define ICG_ICG0_WDTWDPT_POS (24U) +#define ICG_ICG0_WDTWDPT (0x0F000000UL) +#define ICG_ICG0_WDTWDPT_0 (0x01000000UL) +#define ICG_ICG0_WDTWDPT_1 (0x02000000UL) +#define ICG_ICG0_WDTWDPT_2 (0x04000000UL) +#define ICG_ICG0_WDTWDPT_3 (0x08000000UL) +#define ICG_ICG0_WDTSLPOFF_POS (28U) +#define ICG_ICG0_WDTSLPOFF (0x10000000UL) + +/* Bit definition for ICG_ICG1 register */ +#define ICG_ICG1_HRCFREQSEL_POS (0U) +#define ICG_ICG1_HRCFREQSEL (0x00000001UL) +#define ICG_ICG1_HRCSTOP_POS (8U) +#define ICG_ICG1_HRCSTOP (0x00000100UL) +#define ICG_ICG1_BOR_LEV_POS (16U) +#define ICG_ICG1_BOR_LEV (0x00030000UL) +#define ICG_ICG1_BOR_LEV_0 (0x00010000UL) +#define ICG_ICG1_BOR_LEV_1 (0x00020000UL) +#define ICG_ICG1_BORDIS_POS (18U) +#define ICG_ICG1_BORDIS (0x00040000UL) + +/* Bit definition for ICG_ICG2 register */ +#define ICG_ICG2_BGO1M (0x00FFFFFFUL) + +/* Bit definition for ICG_ICG3 register */ +#define ICG_ICG3_DBUSPRT (0x0000FFFFUL) + +/******************************************************************************* + Bit definition for Peripheral INTC +*******************************************************************************/ +/* Bit definition for INTC_NOCCR register */ +#define INTC_NOCCR_NOCSEL_POS (12U) +#define INTC_NOCCR_NOCSEL (0x00003000UL) + +/* Bit definition for INTC_NMIENR register */ +#define INTC_NMIENR_SWDTENR_POS (1U) +#define INTC_NMIENR_SWDTENR (0x00000002UL) +#define INTC_NMIENR_PVD1ENR_POS (2U) +#define INTC_NMIENR_PVD1ENR (0x00000004UL) +#define INTC_NMIENR_PVD2ENR_POS (3U) +#define INTC_NMIENR_PVD2ENR (0x00000008UL) +#define INTC_NMIENR_XTAL32STPENR_POS (4U) +#define INTC_NMIENR_XTAL32STPENR (0x00000010UL) +#define INTC_NMIENR_XTALSTPENR_POS (5U) +#define INTC_NMIENR_XTALSTPENR (0x00000020UL) +#define INTC_NMIENR_REPENR_POS (8U) +#define INTC_NMIENR_REPENR (0x00000100UL) +#define INTC_NMIENR_RECCENR_POS (9U) +#define INTC_NMIENR_RECCENR (0x00000200UL) +#define INTC_NMIENR_BUSMENR_POS (10U) +#define INTC_NMIENR_BUSMENR (0x00000400UL) +#define INTC_NMIENR_WDTENR_POS (11U) +#define INTC_NMIENR_WDTENR (0x00000800UL) + +/* Bit definition for INTC_NMIFR register */ +#define INTC_NMIFR_SWDTFR_POS (1U) +#define INTC_NMIFR_SWDTFR (0x00000002UL) +#define INTC_NMIFR_PVD1FR_POS (2U) +#define INTC_NMIFR_PVD1FR (0x00000004UL) +#define INTC_NMIFR_PVD2FR_POS (3U) +#define INTC_NMIFR_PVD2FR (0x00000008UL) +#define INTC_NMIFR_XTAL32STPFR_POS (4U) +#define INTC_NMIFR_XTAL32STPFR (0x00000010UL) +#define INTC_NMIFR_XTALSTPFR_POS (5U) +#define INTC_NMIFR_XTALSTPFR (0x00000020UL) +#define INTC_NMIFR_REPFR_POS (8U) +#define INTC_NMIFR_REPFR (0x00000100UL) +#define INTC_NMIFR_RECCFR_POS (9U) +#define INTC_NMIFR_RECCFR (0x00000200UL) +#define INTC_NMIFR_BUSMFR_POS (10U) +#define INTC_NMIFR_BUSMFR (0x00000400UL) +#define INTC_NMIFR_WDTFR_POS (11U) +#define INTC_NMIFR_WDTFR (0x00000800UL) + +/* Bit definition for INTC_NMICFR register */ +#define INTC_NMICFR_SWDTCFR_POS (1U) +#define INTC_NMICFR_SWDTCFR (0x00000002UL) +#define INTC_NMICFR_PVD1CFR_POS (2U) +#define INTC_NMICFR_PVD1CFR (0x00000004UL) +#define INTC_NMICFR_PVD2CFR_POS (3U) +#define INTC_NMICFR_PVD2CFR (0x00000008UL) +#define INTC_NMICFR_XTAL32STPCFR_POS (4U) +#define INTC_NMICFR_XTAL32STPCFR (0x00000010UL) +#define INTC_NMICFR_XTALSTPCFR_POS (5U) +#define INTC_NMICFR_XTALSTPCFR (0x00000020UL) +#define INTC_NMICFR_REPCFR_POS (8U) +#define INTC_NMICFR_REPCFR (0x00000100UL) +#define INTC_NMICFR_RECCCFR_POS (9U) +#define INTC_NMICFR_RECCCFR (0x00000200UL) +#define INTC_NMICFR_BUSMCFR_POS (10U) +#define INTC_NMICFR_BUSMCFR (0x00000400UL) +#define INTC_NMICFR_WDTCFR_POS (11U) +#define INTC_NMICFR_WDTCFR (0x00000800UL) + +/* Bit definition for INTC_EIRQCR register */ +#define INTC_EIRQCR_EIRQTRG_POS (0U) +#define INTC_EIRQCR_EIRQTRG (0x00000003UL) +#define INTC_EIRQCR_EIRQTRG_0 (0x00000001UL) +#define INTC_EIRQCR_EIRQTRG_1 (0x00000002UL) +#define INTC_EIRQCR_EISMPCLK_POS (4U) +#define INTC_EIRQCR_EISMPCLK (0x00000030UL) +#define INTC_EIRQCR_EISMPCLK_0 (0x00000010UL) +#define INTC_EIRQCR_EISMPCLK_1 (0x00000020UL) +#define INTC_EIRQCR_EFEN_POS (7U) +#define INTC_EIRQCR_EFEN (0x00000080UL) +#define INTC_EIRQCR_NOCEN_POS (15U) +#define INTC_EIRQCR_NOCEN (0x00008000UL) + +/* Bit definition for INTC_WUPEN register */ +#define INTC_WUPEN_EIRQWUEN_POS (0U) +#define INTC_WUPEN_EIRQWUEN (0x0000FFFFUL) +#define INTC_WUPEN_EIRQWUEN_0 (0x00000001UL) +#define INTC_WUPEN_EIRQWUEN_1 (0x00000002UL) +#define INTC_WUPEN_EIRQWUEN_2 (0x00000004UL) +#define INTC_WUPEN_EIRQWUEN_3 (0x00000008UL) +#define INTC_WUPEN_EIRQWUEN_4 (0x00000010UL) +#define INTC_WUPEN_EIRQWUEN_5 (0x00000020UL) +#define INTC_WUPEN_EIRQWUEN_6 (0x00000040UL) +#define INTC_WUPEN_EIRQWUEN_7 (0x00000080UL) +#define INTC_WUPEN_EIRQWUEN_8 (0x00000100UL) +#define INTC_WUPEN_EIRQWUEN_9 (0x00000200UL) +#define INTC_WUPEN_EIRQWUEN_10 (0x00000400UL) +#define INTC_WUPEN_EIRQWUEN_11 (0x00000800UL) +#define INTC_WUPEN_EIRQWUEN_12 (0x00001000UL) +#define INTC_WUPEN_EIRQWUEN_13 (0x00002000UL) +#define INTC_WUPEN_EIRQWUEN_14 (0x00004000UL) +#define INTC_WUPEN_EIRQWUEN_15 (0x00008000UL) +#define INTC_WUPEN_SWDTWUEN_POS (16U) +#define INTC_WUPEN_SWDTWUEN (0x00010000UL) +#define INTC_WUPEN_PVD1WUEN_POS (17U) +#define INTC_WUPEN_PVD1WUEN (0x00020000UL) +#define INTC_WUPEN_PVD2WUEN_POS (18U) +#define INTC_WUPEN_PVD2WUEN (0x00040000UL) +#define INTC_WUPEN_CMPWUEN_POS (19U) +#define INTC_WUPEN_CMPWUEN (0x00080000UL) +#define INTC_WUPEN_WKTMWUEN_POS (20U) +#define INTC_WUPEN_WKTMWUEN (0x00100000UL) +#define INTC_WUPEN_RTCALMWUEN_POS (21U) +#define INTC_WUPEN_RTCALMWUEN (0x00200000UL) +#define INTC_WUPEN_RTCPRDWUEN_POS (22U) +#define INTC_WUPEN_RTCPRDWUEN (0x00400000UL) +#define INTC_WUPEN_TMR0GCMWUEN_POS (23U) +#define INTC_WUPEN_TMR0GCMWUEN (0x00800000UL) +#define INTC_WUPEN_TMR2GCMWUEN_POS (24U) +#define INTC_WUPEN_TMR2GCMWUEN (0x01000000UL) +#define INTC_WUPEN_TMR2OVFWUEN_POS (25U) +#define INTC_WUPEN_TMR2OVFWUEN (0x02000000UL) +#define INTC_WUPEN_RXWUEN_POS (26U) +#define INTC_WUPEN_RXWUEN (0x04000000UL) +#define INTC_WUPEN_USHWUEN_POS (27U) +#define INTC_WUPEN_USHWUEN (0x08000000UL) +#define INTC_WUPEN_USFWUEN_POS (28U) +#define INTC_WUPEN_USFWUEN (0x10000000UL) +#define INTC_WUPEN_ETHWUEN_POS (29U) +#define INTC_WUPEN_ETHWUEN (0x20000000UL) + +/* Bit definition for INTC_EIFR register */ +#define INTC_EIFR_EIFR0_POS (0U) +#define INTC_EIFR_EIFR0 (0x00000001UL) +#define INTC_EIFR_EIFR1_POS (1U) +#define INTC_EIFR_EIFR1 (0x00000002UL) +#define INTC_EIFR_EIFR2_POS (2U) +#define INTC_EIFR_EIFR2 (0x00000004UL) +#define INTC_EIFR_EIFR3_POS (3U) +#define INTC_EIFR_EIFR3 (0x00000008UL) +#define INTC_EIFR_EIFR4_POS (4U) +#define INTC_EIFR_EIFR4 (0x00000010UL) +#define INTC_EIFR_EIFR5_POS (5U) +#define INTC_EIFR_EIFR5 (0x00000020UL) +#define INTC_EIFR_EIFR6_POS (6U) +#define INTC_EIFR_EIFR6 (0x00000040UL) +#define INTC_EIFR_EIFR7_POS (7U) +#define INTC_EIFR_EIFR7 (0x00000080UL) +#define INTC_EIFR_EIFR8_POS (8U) +#define INTC_EIFR_EIFR8 (0x00000100UL) +#define INTC_EIFR_EIFR9_POS (9U) +#define INTC_EIFR_EIFR9 (0x00000200UL) +#define INTC_EIFR_EIFR10_POS (10U) +#define INTC_EIFR_EIFR10 (0x00000400UL) +#define INTC_EIFR_EIFR11_POS (11U) +#define INTC_EIFR_EIFR11 (0x00000800UL) +#define INTC_EIFR_EIFR12_POS (12U) +#define INTC_EIFR_EIFR12 (0x00001000UL) +#define INTC_EIFR_EIFR13_POS (13U) +#define INTC_EIFR_EIFR13 (0x00002000UL) +#define INTC_EIFR_EIFR14_POS (14U) +#define INTC_EIFR_EIFR14 (0x00004000UL) +#define INTC_EIFR_EIFR15_POS (15U) +#define INTC_EIFR_EIFR15 (0x00008000UL) + +/* Bit definition for INTC_EICFR register */ +#define INTC_EICFR_EICFR0_POS (0U) +#define INTC_EICFR_EICFR0 (0x00000001UL) +#define INTC_EICFR_EICFR1_POS (1U) +#define INTC_EICFR_EICFR1 (0x00000002UL) +#define INTC_EICFR_EICFR2_POS (2U) +#define INTC_EICFR_EICFR2 (0x00000004UL) +#define INTC_EICFR_EICFR3_POS (3U) +#define INTC_EICFR_EICFR3 (0x00000008UL) +#define INTC_EICFR_EICFR4_POS (4U) +#define INTC_EICFR_EICFR4 (0x00000010UL) +#define INTC_EICFR_EICFR5_POS (5U) +#define INTC_EICFR_EICFR5 (0x00000020UL) +#define INTC_EICFR_EICFR6_POS (6U) +#define INTC_EICFR_EICFR6 (0x00000040UL) +#define INTC_EICFR_EICFR7_POS (7U) +#define INTC_EICFR_EICFR7 (0x00000080UL) +#define INTC_EICFR_EICFR8_POS (8U) +#define INTC_EICFR_EICFR8 (0x00000100UL) +#define INTC_EICFR_EICFR9_POS (9U) +#define INTC_EICFR_EICFR9 (0x00000200UL) +#define INTC_EICFR_EICFR10_POS (10U) +#define INTC_EICFR_EICFR10 (0x00000400UL) +#define INTC_EICFR_EICFR11_POS (11U) +#define INTC_EICFR_EICFR11 (0x00000800UL) +#define INTC_EICFR_EICFR12_POS (12U) +#define INTC_EICFR_EICFR12 (0x00001000UL) +#define INTC_EICFR_EICFR13_POS (13U) +#define INTC_EICFR_EICFR13 (0x00002000UL) +#define INTC_EICFR_EICFR14_POS (14U) +#define INTC_EICFR_EICFR14 (0x00004000UL) +#define INTC_EICFR_EICFR15_POS (15U) +#define INTC_EICFR_EICFR15 (0x00008000UL) + +/* Bit definition for INTC_SEL0 register */ +#define INTC_SEL0_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL1 register */ +#define INTC_SEL1_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL2 register */ +#define INTC_SEL2_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL3 register */ +#define INTC_SEL3_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL4 register */ +#define INTC_SEL4_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL5 register */ +#define INTC_SEL5_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL6 register */ +#define INTC_SEL6_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL7 register */ +#define INTC_SEL7_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL8 register */ +#define INTC_SEL8_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL9 register */ +#define INTC_SEL9_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL10 register */ +#define INTC_SEL10_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL11 register */ +#define INTC_SEL11_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL12 register */ +#define INTC_SEL12_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL13 register */ +#define INTC_SEL13_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL14 register */ +#define INTC_SEL14_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL15 register */ +#define INTC_SEL15_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL16 register */ +#define INTC_SEL16_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL17 register */ +#define INTC_SEL17_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL18 register */ +#define INTC_SEL18_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL19 register */ +#define INTC_SEL19_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL20 register */ +#define INTC_SEL20_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL21 register */ +#define INTC_SEL21_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL22 register */ +#define INTC_SEL22_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL23 register */ +#define INTC_SEL23_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL24 register */ +#define INTC_SEL24_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL25 register */ +#define INTC_SEL25_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL26 register */ +#define INTC_SEL26_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL27 register */ +#define INTC_SEL27_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL28 register */ +#define INTC_SEL28_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL29 register */ +#define INTC_SEL29_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL30 register */ +#define INTC_SEL30_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL31 register */ +#define INTC_SEL31_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL32 register */ +#define INTC_SEL32_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL33 register */ +#define INTC_SEL33_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL34 register */ +#define INTC_SEL34_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL35 register */ +#define INTC_SEL35_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL36 register */ +#define INTC_SEL36_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL37 register */ +#define INTC_SEL37_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL38 register */ +#define INTC_SEL38_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL39 register */ +#define INTC_SEL39_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL40 register */ +#define INTC_SEL40_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL41 register */ +#define INTC_SEL41_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL42 register */ +#define INTC_SEL42_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL43 register */ +#define INTC_SEL43_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL44 register */ +#define INTC_SEL44_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL45 register */ +#define INTC_SEL45_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL46 register */ +#define INTC_SEL46_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL47 register */ +#define INTC_SEL47_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL48 register */ +#define INTC_SEL48_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL49 register */ +#define INTC_SEL49_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL50 register */ +#define INTC_SEL50_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL51 register */ +#define INTC_SEL51_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL52 register */ +#define INTC_SEL52_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL53 register */ +#define INTC_SEL53_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL54 register */ +#define INTC_SEL54_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL55 register */ +#define INTC_SEL55_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL56 register */ +#define INTC_SEL56_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL57 register */ +#define INTC_SEL57_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL58 register */ +#define INTC_SEL58_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL59 register */ +#define INTC_SEL59_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL60 register */ +#define INTC_SEL60_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL61 register */ +#define INTC_SEL61_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL62 register */ +#define INTC_SEL62_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL63 register */ +#define INTC_SEL63_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL64 register */ +#define INTC_SEL64_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL65 register */ +#define INTC_SEL65_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL66 register */ +#define INTC_SEL66_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL67 register */ +#define INTC_SEL67_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL68 register */ +#define INTC_SEL68_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL69 register */ +#define INTC_SEL69_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL70 register */ +#define INTC_SEL70_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL71 register */ +#define INTC_SEL71_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL72 register */ +#define INTC_SEL72_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL73 register */ +#define INTC_SEL73_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL74 register */ +#define INTC_SEL74_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL75 register */ +#define INTC_SEL75_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL76 register */ +#define INTC_SEL76_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL77 register */ +#define INTC_SEL77_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL78 register */ +#define INTC_SEL78_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL79 register */ +#define INTC_SEL79_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL80 register */ +#define INTC_SEL80_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL81 register */ +#define INTC_SEL81_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL82 register */ +#define INTC_SEL82_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL83 register */ +#define INTC_SEL83_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL84 register */ +#define INTC_SEL84_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL85 register */ +#define INTC_SEL85_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL86 register */ +#define INTC_SEL86_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL87 register */ +#define INTC_SEL87_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL88 register */ +#define INTC_SEL88_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL89 register */ +#define INTC_SEL89_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL90 register */ +#define INTC_SEL90_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL91 register */ +#define INTC_SEL91_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL92 register */ +#define INTC_SEL92_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL93 register */ +#define INTC_SEL93_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL94 register */ +#define INTC_SEL94_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL95 register */ +#define INTC_SEL95_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL96 register */ +#define INTC_SEL96_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL97 register */ +#define INTC_SEL97_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL98 register */ +#define INTC_SEL98_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL99 register */ +#define INTC_SEL99_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL100 register */ +#define INTC_SEL100_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL101 register */ +#define INTC_SEL101_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL102 register */ +#define INTC_SEL102_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL103 register */ +#define INTC_SEL103_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL104 register */ +#define INTC_SEL104_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL105 register */ +#define INTC_SEL105_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL106 register */ +#define INTC_SEL106_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL107 register */ +#define INTC_SEL107_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL108 register */ +#define INTC_SEL108_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL109 register */ +#define INTC_SEL109_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL110 register */ +#define INTC_SEL110_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL111 register */ +#define INTC_SEL111_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL112 register */ +#define INTC_SEL112_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL113 register */ +#define INTC_SEL113_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL114 register */ +#define INTC_SEL114_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL115 register */ +#define INTC_SEL115_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL116 register */ +#define INTC_SEL116_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL117 register */ +#define INTC_SEL117_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL118 register */ +#define INTC_SEL118_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL119 register */ +#define INTC_SEL119_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL120 register */ +#define INTC_SEL120_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL121 register */ +#define INTC_SEL121_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL122 register */ +#define INTC_SEL122_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL123 register */ +#define INTC_SEL123_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL124 register */ +#define INTC_SEL124_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL125 register */ +#define INTC_SEL125_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL126 register */ +#define INTC_SEL126_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_SEL127 register */ +#define INTC_SEL127_INTSEL (0x000001FFUL) + +/* Bit definition for INTC_VSSEL register */ +#define INTC_VSSEL_VSEL0_POS (0U) +#define INTC_VSSEL_VSEL0 (0x00000001UL) +#define INTC_VSSEL_VSEL1_POS (1U) +#define INTC_VSSEL_VSEL1 (0x00000002UL) +#define INTC_VSSEL_VSEL2_POS (2U) +#define INTC_VSSEL_VSEL2 (0x00000004UL) +#define INTC_VSSEL_VSEL3_POS (3U) +#define INTC_VSSEL_VSEL3 (0x00000008UL) +#define INTC_VSSEL_VSEL4_POS (4U) +#define INTC_VSSEL_VSEL4 (0x00000010UL) +#define INTC_VSSEL_VSEL5_POS (5U) +#define INTC_VSSEL_VSEL5 (0x00000020UL) +#define INTC_VSSEL_VSEL6_POS (6U) +#define INTC_VSSEL_VSEL6 (0x00000040UL) +#define INTC_VSSEL_VSEL7_POS (7U) +#define INTC_VSSEL_VSEL7 (0x00000080UL) +#define INTC_VSSEL_VSEL8_POS (8U) +#define INTC_VSSEL_VSEL8 (0x00000100UL) +#define INTC_VSSEL_VSEL9_POS (9U) +#define INTC_VSSEL_VSEL9 (0x00000200UL) +#define INTC_VSSEL_VSEL10_POS (10U) +#define INTC_VSSEL_VSEL10 (0x00000400UL) +#define INTC_VSSEL_VSEL11_POS (11U) +#define INTC_VSSEL_VSEL11 (0x00000800UL) +#define INTC_VSSEL_VSEL12_POS (12U) +#define INTC_VSSEL_VSEL12 (0x00001000UL) +#define INTC_VSSEL_VSEL13_POS (13U) +#define INTC_VSSEL_VSEL13 (0x00002000UL) +#define INTC_VSSEL_VSEL14_POS (14U) +#define INTC_VSSEL_VSEL14 (0x00004000UL) +#define INTC_VSSEL_VSEL15_POS (15U) +#define INTC_VSSEL_VSEL15 (0x00008000UL) +#define INTC_VSSEL_VSEL16_POS (16U) +#define INTC_VSSEL_VSEL16 (0x00010000UL) +#define INTC_VSSEL_VSEL17_POS (17U) +#define INTC_VSSEL_VSEL17 (0x00020000UL) +#define INTC_VSSEL_VSEL18_POS (18U) +#define INTC_VSSEL_VSEL18 (0x00040000UL) +#define INTC_VSSEL_VSEL19_POS (19U) +#define INTC_VSSEL_VSEL19 (0x00080000UL) +#define INTC_VSSEL_VSEL20_POS (20U) +#define INTC_VSSEL_VSEL20 (0x00100000UL) +#define INTC_VSSEL_VSEL21_POS (21U) +#define INTC_VSSEL_VSEL21 (0x00200000UL) +#define INTC_VSSEL_VSEL22_POS (22U) +#define INTC_VSSEL_VSEL22 (0x00400000UL) +#define INTC_VSSEL_VSEL23_POS (23U) +#define INTC_VSSEL_VSEL23 (0x00800000UL) +#define INTC_VSSEL_VSEL24_POS (24U) +#define INTC_VSSEL_VSEL24 (0x01000000UL) +#define INTC_VSSEL_VSEL25_POS (25U) +#define INTC_VSSEL_VSEL25 (0x02000000UL) +#define INTC_VSSEL_VSEL26_POS (26U) +#define INTC_VSSEL_VSEL26 (0x04000000UL) +#define INTC_VSSEL_VSEL27_POS (27U) +#define INTC_VSSEL_VSEL27 (0x08000000UL) +#define INTC_VSSEL_VSEL28_POS (28U) +#define INTC_VSSEL_VSEL28 (0x10000000UL) +#define INTC_VSSEL_VSEL29_POS (29U) +#define INTC_VSSEL_VSEL29 (0x20000000UL) +#define INTC_VSSEL_VSEL30_POS (30U) +#define INTC_VSSEL_VSEL30 (0x40000000UL) +#define INTC_VSSEL_VSEL31_POS (31U) +#define INTC_VSSEL_VSEL31 (0x80000000UL) + +/* Bit definition for INTC_SWIER register */ +#define INTC_SWIER_SWIE0_POS (0U) +#define INTC_SWIER_SWIE0 (0x00000001UL) +#define INTC_SWIER_SWIE1_POS (1U) +#define INTC_SWIER_SWIE1 (0x00000002UL) +#define INTC_SWIER_SWIE2_POS (2U) +#define INTC_SWIER_SWIE2 (0x00000004UL) +#define INTC_SWIER_SWIE3_POS (3U) +#define INTC_SWIER_SWIE3 (0x00000008UL) +#define INTC_SWIER_SWIE4_POS (4U) +#define INTC_SWIER_SWIE4 (0x00000010UL) +#define INTC_SWIER_SWIE5_POS (5U) +#define INTC_SWIER_SWIE5 (0x00000020UL) +#define INTC_SWIER_SWIE6_POS (6U) +#define INTC_SWIER_SWIE6 (0x00000040UL) +#define INTC_SWIER_SWIE7_POS (7U) +#define INTC_SWIER_SWIE7 (0x00000080UL) +#define INTC_SWIER_SWIE8_POS (8U) +#define INTC_SWIER_SWIE8 (0x00000100UL) +#define INTC_SWIER_SWIE9_POS (9U) +#define INTC_SWIER_SWIE9 (0x00000200UL) +#define INTC_SWIER_SWIE10_POS (10U) +#define INTC_SWIER_SWIE10 (0x00000400UL) +#define INTC_SWIER_SWIE11_POS (11U) +#define INTC_SWIER_SWIE11 (0x00000800UL) +#define INTC_SWIER_SWIE12_POS (12U) +#define INTC_SWIER_SWIE12 (0x00001000UL) +#define INTC_SWIER_SWIE13_POS (13U) +#define INTC_SWIER_SWIE13 (0x00002000UL) +#define INTC_SWIER_SWIE14_POS (14U) +#define INTC_SWIER_SWIE14 (0x00004000UL) +#define INTC_SWIER_SWIE15_POS (15U) +#define INTC_SWIER_SWIE15 (0x00008000UL) +#define INTC_SWIER_SWIE16_POS (16U) +#define INTC_SWIER_SWIE16 (0x00010000UL) +#define INTC_SWIER_SWIE17_POS (17U) +#define INTC_SWIER_SWIE17 (0x00020000UL) +#define INTC_SWIER_SWIE18_POS (18U) +#define INTC_SWIER_SWIE18 (0x00040000UL) +#define INTC_SWIER_SWIE19_POS (19U) +#define INTC_SWIER_SWIE19 (0x00080000UL) +#define INTC_SWIER_SWIE20_POS (20U) +#define INTC_SWIER_SWIE20 (0x00100000UL) +#define INTC_SWIER_SWIE21_POS (21U) +#define INTC_SWIER_SWIE21 (0x00200000UL) +#define INTC_SWIER_SWIE22_POS (22U) +#define INTC_SWIER_SWIE22 (0x00400000UL) +#define INTC_SWIER_SWIE23_POS (23U) +#define INTC_SWIER_SWIE23 (0x00800000UL) +#define INTC_SWIER_SWIE24_POS (24U) +#define INTC_SWIER_SWIE24 (0x01000000UL) +#define INTC_SWIER_SWIE25_POS (25U) +#define INTC_SWIER_SWIE25 (0x02000000UL) +#define INTC_SWIER_SWIE26_POS (26U) +#define INTC_SWIER_SWIE26 (0x04000000UL) +#define INTC_SWIER_SWIE27_POS (27U) +#define INTC_SWIER_SWIE27 (0x08000000UL) +#define INTC_SWIER_SWIE28_POS (28U) +#define INTC_SWIER_SWIE28 (0x10000000UL) +#define INTC_SWIER_SWIE29_POS (29U) +#define INTC_SWIER_SWIE29 (0x20000000UL) +#define INTC_SWIER_SWIE30_POS (30U) +#define INTC_SWIER_SWIE30 (0x40000000UL) +#define INTC_SWIER_SWIE31_POS (31U) +#define INTC_SWIER_SWIE31 (0x80000000UL) + +/* Bit definition for INTC_EVTER register */ +#define INTC_EVTER_EVTE0_POS (0U) +#define INTC_EVTER_EVTE0 (0x00000001UL) +#define INTC_EVTER_EVTE1_POS (1U) +#define INTC_EVTER_EVTE1 (0x00000002UL) +#define INTC_EVTER_EVTE2_POS (2U) +#define INTC_EVTER_EVTE2 (0x00000004UL) +#define INTC_EVTER_EVTE3_POS (3U) +#define INTC_EVTER_EVTE3 (0x00000008UL) +#define INTC_EVTER_EVTE4_POS (4U) +#define INTC_EVTER_EVTE4 (0x00000010UL) +#define INTC_EVTER_EVTE5_POS (5U) +#define INTC_EVTER_EVTE5 (0x00000020UL) +#define INTC_EVTER_EVTE6_POS (6U) +#define INTC_EVTER_EVTE6 (0x00000040UL) +#define INTC_EVTER_EVTE7_POS (7U) +#define INTC_EVTER_EVTE7 (0x00000080UL) +#define INTC_EVTER_EVTE8_POS (8U) +#define INTC_EVTER_EVTE8 (0x00000100UL) +#define INTC_EVTER_EVTE9_POS (9U) +#define INTC_EVTER_EVTE9 (0x00000200UL) +#define INTC_EVTER_EVTE10_POS (10U) +#define INTC_EVTER_EVTE10 (0x00000400UL) +#define INTC_EVTER_EVTE11_POS (11U) +#define INTC_EVTER_EVTE11 (0x00000800UL) +#define INTC_EVTER_EVTE12_POS (12U) +#define INTC_EVTER_EVTE12 (0x00001000UL) +#define INTC_EVTER_EVTE13_POS (13U) +#define INTC_EVTER_EVTE13 (0x00002000UL) +#define INTC_EVTER_EVTE14_POS (14U) +#define INTC_EVTER_EVTE14 (0x00004000UL) +#define INTC_EVTER_EVTE15_POS (15U) +#define INTC_EVTER_EVTE15 (0x00008000UL) +#define INTC_EVTER_EVTE16_POS (16U) +#define INTC_EVTER_EVTE16 (0x00010000UL) +#define INTC_EVTER_EVTE17_POS (17U) +#define INTC_EVTER_EVTE17 (0x00020000UL) +#define INTC_EVTER_EVTE18_POS (18U) +#define INTC_EVTER_EVTE18 (0x00040000UL) +#define INTC_EVTER_EVTE19_POS (19U) +#define INTC_EVTER_EVTE19 (0x00080000UL) +#define INTC_EVTER_EVTE20_POS (20U) +#define INTC_EVTER_EVTE20 (0x00100000UL) +#define INTC_EVTER_EVTE21_POS (21U) +#define INTC_EVTER_EVTE21 (0x00200000UL) +#define INTC_EVTER_EVTE22_POS (22U) +#define INTC_EVTER_EVTE22 (0x00400000UL) +#define INTC_EVTER_EVTE23_POS (23U) +#define INTC_EVTER_EVTE23 (0x00800000UL) +#define INTC_EVTER_EVTE24_POS (24U) +#define INTC_EVTER_EVTE24 (0x01000000UL) +#define INTC_EVTER_EVTE25_POS (25U) +#define INTC_EVTER_EVTE25 (0x02000000UL) +#define INTC_EVTER_EVTE26_POS (26U) +#define INTC_EVTER_EVTE26 (0x04000000UL) +#define INTC_EVTER_EVTE27_POS (27U) +#define INTC_EVTER_EVTE27 (0x08000000UL) +#define INTC_EVTER_EVTE28_POS (28U) +#define INTC_EVTER_EVTE28 (0x10000000UL) +#define INTC_EVTER_EVTE29_POS (29U) +#define INTC_EVTER_EVTE29 (0x20000000UL) +#define INTC_EVTER_EVTE30_POS (30U) +#define INTC_EVTER_EVTE30 (0x40000000UL) +#define INTC_EVTER_EVTE31_POS (31U) +#define INTC_EVTER_EVTE31 (0x80000000UL) + +/* Bit definition for INTC_IER register */ +#define INTC_IER_IER0_POS (0U) +#define INTC_IER_IER0 (0x00000001UL) +#define INTC_IER_IER1_POS (1U) +#define INTC_IER_IER1 (0x00000002UL) +#define INTC_IER_IER2_POS (2U) +#define INTC_IER_IER2 (0x00000004UL) +#define INTC_IER_IER3_POS (3U) +#define INTC_IER_IER3 (0x00000008UL) +#define INTC_IER_IER4_POS (4U) +#define INTC_IER_IER4 (0x00000010UL) +#define INTC_IER_IER5_POS (5U) +#define INTC_IER_IER5 (0x00000020UL) +#define INTC_IER_IER6_POS (6U) +#define INTC_IER_IER6 (0x00000040UL) +#define INTC_IER_IER7_POS (7U) +#define INTC_IER_IER7 (0x00000080UL) +#define INTC_IER_IER8_POS (8U) +#define INTC_IER_IER8 (0x00000100UL) +#define INTC_IER_IER9_POS (9U) +#define INTC_IER_IER9 (0x00000200UL) +#define INTC_IER_IER10_POS (10U) +#define INTC_IER_IER10 (0x00000400UL) +#define INTC_IER_IER11_POS (11U) +#define INTC_IER_IER11 (0x00000800UL) +#define INTC_IER_IER12_POS (12U) +#define INTC_IER_IER12 (0x00001000UL) +#define INTC_IER_IER13_POS (13U) +#define INTC_IER_IER13 (0x00002000UL) +#define INTC_IER_IER14_POS (14U) +#define INTC_IER_IER14 (0x00004000UL) +#define INTC_IER_IER15_POS (15U) +#define INTC_IER_IER15 (0x00008000UL) +#define INTC_IER_IER16_POS (16U) +#define INTC_IER_IER16 (0x00010000UL) +#define INTC_IER_IER17_POS (17U) +#define INTC_IER_IER17 (0x00020000UL) +#define INTC_IER_IER18_POS (18U) +#define INTC_IER_IER18 (0x00040000UL) +#define INTC_IER_IER19_POS (19U) +#define INTC_IER_IER19 (0x00080000UL) +#define INTC_IER_IER20_POS (20U) +#define INTC_IER_IER20 (0x00100000UL) +#define INTC_IER_IER21_POS (21U) +#define INTC_IER_IER21 (0x00200000UL) +#define INTC_IER_IER22_POS (22U) +#define INTC_IER_IER22 (0x00400000UL) +#define INTC_IER_IER23_POS (23U) +#define INTC_IER_IER23 (0x00800000UL) +#define INTC_IER_IER24_POS (24U) +#define INTC_IER_IER24 (0x01000000UL) +#define INTC_IER_IER25_POS (25U) +#define INTC_IER_IER25 (0x02000000UL) +#define INTC_IER_IER26_POS (26U) +#define INTC_IER_IER26 (0x04000000UL) +#define INTC_IER_IER27_POS (27U) +#define INTC_IER_IER27 (0x08000000UL) +#define INTC_IER_IER28_POS (28U) +#define INTC_IER_IER28 (0x10000000UL) +#define INTC_IER_IER29_POS (29U) +#define INTC_IER_IER29 (0x20000000UL) +#define INTC_IER_IER30_POS (30U) +#define INTC_IER_IER30 (0x40000000UL) +#define INTC_IER_IER31_POS (31U) +#define INTC_IER_IER31 (0x80000000UL) + +/******************************************************************************* + Bit definition for Peripheral KEYSCAN +*******************************************************************************/ +/* Bit definition for KEYSCAN_SCR register */ +#define KEYSCAN_SCR_KEYINSEL_POS (0U) +#define KEYSCAN_SCR_KEYINSEL (0x0000FFFFUL) +#define KEYSCAN_SCR_KEYINSEL_0 (0x00000001UL) +#define KEYSCAN_SCR_KEYINSEL_1 (0x00000002UL) +#define KEYSCAN_SCR_KEYINSEL_2 (0x00000004UL) +#define KEYSCAN_SCR_KEYINSEL_3 (0x00000008UL) +#define KEYSCAN_SCR_KEYINSEL_4 (0x00000010UL) +#define KEYSCAN_SCR_KEYINSEL_5 (0x00000020UL) +#define KEYSCAN_SCR_KEYINSEL_6 (0x00000040UL) +#define KEYSCAN_SCR_KEYINSEL_7 (0x00000080UL) +#define KEYSCAN_SCR_KEYINSEL_8 (0x00000100UL) +#define KEYSCAN_SCR_KEYINSEL_9 (0x00000200UL) +#define KEYSCAN_SCR_KEYINSEL_10 (0x00000400UL) +#define KEYSCAN_SCR_KEYINSEL_11 (0x00000800UL) +#define KEYSCAN_SCR_KEYINSEL_12 (0x00001000UL) +#define KEYSCAN_SCR_KEYINSEL_13 (0x00002000UL) +#define KEYSCAN_SCR_KEYINSEL_14 (0x00004000UL) +#define KEYSCAN_SCR_KEYINSEL_15 (0x00008000UL) +#define KEYSCAN_SCR_KEYOUTSEL_POS (16U) +#define KEYSCAN_SCR_KEYOUTSEL (0x00070000UL) +#define KEYSCAN_SCR_CKSEL_POS (20U) +#define KEYSCAN_SCR_CKSEL (0x00300000UL) +#define KEYSCAN_SCR_CKSEL_0 (0x00100000UL) +#define KEYSCAN_SCR_CKSEL_1 (0x00200000UL) +#define KEYSCAN_SCR_T_LLEVEL_POS (24U) +#define KEYSCAN_SCR_T_LLEVEL (0x1F000000UL) +#define KEYSCAN_SCR_T_HIZ_POS (29U) +#define KEYSCAN_SCR_T_HIZ (0xE0000000UL) + +/* Bit definition for KEYSCAN_SER register */ +#define KEYSCAN_SER_SEN (0x00000001UL) + +/* Bit definition for KEYSCAN_SSR register */ +#define KEYSCAN_SSR_INDEX (0x00000007UL) + +/******************************************************************************* + Bit definition for Peripheral MAU +*******************************************************************************/ +/* Bit definition for MAU_CSR register */ +#define MAU_CSR_START_POS (0U) +#define MAU_CSR_START (0x00000001UL) +#define MAU_CSR_INTEN_POS (1U) +#define MAU_CSR_INTEN (0x00000002UL) +#define MAU_CSR_BUSY_POS (3U) +#define MAU_CSR_BUSY (0x00000008UL) +#define MAU_CSR_SHIFT_POS (8U) +#define MAU_CSR_SHIFT (0x00001F00UL) + +/* Bit definition for MAU_DTR0 register */ +#define MAU_DTR0 (0xFFFFFFFFUL) + +/* Bit definition for MAU_RTR0 register */ +#define MAU_RTR0_SQRT_DOUT (0x0001FFFFUL) + +/* Bit definition for MAU_DTR1 register */ +#define MAU_DTR1_SIN_DIN (0x00000FFFUL) + +/* Bit definition for MAU_RTR1 register */ +#define MAU_RTR1_SIN_DOUT (0x0000FFFFUL) + +/******************************************************************************* + Bit definition for Peripheral MPU +*******************************************************************************/ +/* Bit definition for MPU_RGD register */ +#define MPU_RGD_MPURGSIZE_POS (0U) +#define MPU_RGD_MPURGSIZE (0x0000001FUL) +#define MPU_RGD_MPURGSIZE_0 (0x00000001UL) +#define MPU_RGD_MPURGSIZE_1 (0x00000002UL) +#define MPU_RGD_MPURGSIZE_2 (0x00000004UL) +#define MPU_RGD_MPURGSIZE_3 (0x00000008UL) +#define MPU_RGD_MPURGSIZE_4 (0x00000010UL) +#define MPU_RGD_MPURGADDR_POS (5U) +#define MPU_RGD_MPURGADDR (0xFFFFFFE0UL) + +/* Bit definition for MPU_SR register */ +#define MPU_SR_SMPU1EAF_POS (0U) +#define MPU_SR_SMPU1EAF (0x00000001UL) +#define MPU_SR_SMPU2EAF_POS (1U) +#define MPU_SR_SMPU2EAF (0x00000002UL) +#define MPU_SR_FMPUEAF_POS (2U) +#define MPU_SR_FMPUEAF (0x00000004UL) +#define MPU_SR_HMPUEAF_POS (3U) +#define MPU_SR_HMPUEAF (0x00000008UL) +#define MPU_SR_EMPUEAF_POS (4U) +#define MPU_SR_EMPUEAF (0x00000010UL) + +/* Bit definition for MPU_ECLR register */ +#define MPU_ECLR_SMPU1ECLR_POS (0U) +#define MPU_ECLR_SMPU1ECLR (0x00000001UL) +#define MPU_ECLR_SMPU2ECLR_POS (1U) +#define MPU_ECLR_SMPU2ECLR (0x00000002UL) +#define MPU_ECLR_FMPUECLR_POS (2U) +#define MPU_ECLR_FMPUECLR (0x00000004UL) +#define MPU_ECLR_HMPUECLR_POS (3U) +#define MPU_ECLR_HMPUECLR (0x00000008UL) +#define MPU_ECLR_EMPUECLR_POS (4U) +#define MPU_ECLR_EMPUECLR (0x00000010UL) + +/* Bit definition for MPU_WP register */ +#define MPU_WP_MPUWE_POS (0U) +#define MPU_WP_MPUWE (0x00000001UL) +#define MPU_WP_WKEY_POS (1U) +#define MPU_WP_WKEY (0x0000FFFEUL) + +/* Bit definition for MPU_IPPR register */ +#define MPU_IPPR_AESRDP_POS (0U) +#define MPU_IPPR_AESRDP (0x00000001UL) +#define MPU_IPPR_AESWRP_POS (1U) +#define MPU_IPPR_AESWRP (0x00000002UL) +#define MPU_IPPR_HASHRDP_POS (2U) +#define MPU_IPPR_HASHRDP (0x00000004UL) +#define MPU_IPPR_HASHWRP_POS (3U) +#define MPU_IPPR_HASHWRP (0x00000008UL) +#define MPU_IPPR_TRNGRDP_POS (4U) +#define MPU_IPPR_TRNGRDP (0x00000010UL) +#define MPU_IPPR_TRNGWRP_POS (5U) +#define MPU_IPPR_TRNGWRP (0x00000020UL) +#define MPU_IPPR_CRCRDP_POS (6U) +#define MPU_IPPR_CRCRDP (0x00000040UL) +#define MPU_IPPR_CRCWRP_POS (7U) +#define MPU_IPPR_CRCWRP (0x00000080UL) +#define MPU_IPPR_FMCRDP_POS (8U) +#define MPU_IPPR_FMCRDP (0x00000100UL) +#define MPU_IPPR_FMCWRP_POS (9U) +#define MPU_IPPR_FMCWRP (0x00000200UL) +#define MPU_IPPR_WDTRDP_POS (12U) +#define MPU_IPPR_WDTRDP (0x00001000UL) +#define MPU_IPPR_WDTWRP_POS (13U) +#define MPU_IPPR_WDTWRP (0x00002000UL) +#define MPU_IPPR_SWDTRDP_POS (14U) +#define MPU_IPPR_SWDTRDP (0x00004000UL) +#define MPU_IPPR_SWDTWRP_POS (15U) +#define MPU_IPPR_SWDTWRP (0x00008000UL) +#define MPU_IPPR_BKSRAMRDP_POS (16U) +#define MPU_IPPR_BKSRAMRDP (0x00010000UL) +#define MPU_IPPR_BKSRAMWRP_POS (17U) +#define MPU_IPPR_BKSRAMWRP (0x00020000UL) +#define MPU_IPPR_RTCRDP_POS (18U) +#define MPU_IPPR_RTCRDP (0x00040000UL) +#define MPU_IPPR_RTCWRP_POS (19U) +#define MPU_IPPR_RTCWRP (0x00080000UL) +#define MPU_IPPR_DMPURDP_POS (20U) +#define MPU_IPPR_DMPURDP (0x00100000UL) +#define MPU_IPPR_DMPUWRP_POS (21U) +#define MPU_IPPR_DMPUWRP (0x00200000UL) +#define MPU_IPPR_SRAMCRDP_POS (22U) +#define MPU_IPPR_SRAMCRDP (0x00400000UL) +#define MPU_IPPR_SRAMCWRP_POS (23U) +#define MPU_IPPR_SRAMCWRP (0x00800000UL) +#define MPU_IPPR_INTCRDP_POS (24U) +#define MPU_IPPR_INTCRDP (0x01000000UL) +#define MPU_IPPR_INTCWRP_POS (25U) +#define MPU_IPPR_INTCWRP (0x02000000UL) +#define MPU_IPPR_SYSCRDP_POS (26U) +#define MPU_IPPR_SYSCRDP (0x04000000UL) +#define MPU_IPPR_SYSCWRP_POS (27U) +#define MPU_IPPR_SYSCWRP (0x08000000UL) +#define MPU_IPPR_MSTPRDP_POS (28U) +#define MPU_IPPR_MSTPRDP (0x10000000UL) +#define MPU_IPPR_MSPTWRP_POS (29U) +#define MPU_IPPR_MSPTWRP (0x20000000UL) +#define MPU_IPPR_BUSERRE_POS (31U) +#define MPU_IPPR_BUSERRE (0x80000000UL) + +/* Bit definition for MPU_S1RGE register */ +#define MPU_S1RGE_S1RG0E_POS (0U) +#define MPU_S1RGE_S1RG0E (0x00000001UL) +#define MPU_S1RGE_S1RG1E_POS (1U) +#define MPU_S1RGE_S1RG1E (0x00000002UL) +#define MPU_S1RGE_S1RG2E_POS (2U) +#define MPU_S1RGE_S1RG2E (0x00000004UL) +#define MPU_S1RGE_S1RG3E_POS (3U) +#define MPU_S1RGE_S1RG3E (0x00000008UL) +#define MPU_S1RGE_S1RG4E_POS (4U) +#define MPU_S1RGE_S1RG4E (0x00000010UL) +#define MPU_S1RGE_S1RG5E_POS (5U) +#define MPU_S1RGE_S1RG5E (0x00000020UL) +#define MPU_S1RGE_S1RG6E_POS (6U) +#define MPU_S1RGE_S1RG6E (0x00000040UL) +#define MPU_S1RGE_S1RG7E_POS (7U) +#define MPU_S1RGE_S1RG7E (0x00000080UL) +#define MPU_S1RGE_S1RG8E_POS (8U) +#define MPU_S1RGE_S1RG8E (0x00000100UL) +#define MPU_S1RGE_S1RG9E_POS (9U) +#define MPU_S1RGE_S1RG9E (0x00000200UL) +#define MPU_S1RGE_S1RG10E_POS (10U) +#define MPU_S1RGE_S1RG10E (0x00000400UL) +#define MPU_S1RGE_S1RG11E_POS (11U) +#define MPU_S1RGE_S1RG11E (0x00000800UL) +#define MPU_S1RGE_S1RG12E_POS (12U) +#define MPU_S1RGE_S1RG12E (0x00001000UL) +#define MPU_S1RGE_S1RG13E_POS (13U) +#define MPU_S1RGE_S1RG13E (0x00002000UL) +#define MPU_S1RGE_S1RG14E_POS (14U) +#define MPU_S1RGE_S1RG14E (0x00004000UL) +#define MPU_S1RGE_S1RG15E_POS (15U) +#define MPU_S1RGE_S1RG15E (0x00008000UL) + +/* Bit definition for MPU_S1RGWP register */ +#define MPU_S1RGWP_S1RG0WP_POS (0U) +#define MPU_S1RGWP_S1RG0WP (0x00000001UL) +#define MPU_S1RGWP_S1RG1WP_POS (1U) +#define MPU_S1RGWP_S1RG1WP (0x00000002UL) +#define MPU_S1RGWP_S1RG2WP_POS (2U) +#define MPU_S1RGWP_S1RG2WP (0x00000004UL) +#define MPU_S1RGWP_S1RG3WP_POS (3U) +#define MPU_S1RGWP_S1RG3WP (0x00000008UL) +#define MPU_S1RGWP_S1RG4WP_POS (4U) +#define MPU_S1RGWP_S1RG4WP (0x00000010UL) +#define MPU_S1RGWP_S1RG5WP_POS (5U) +#define MPU_S1RGWP_S1RG5WP (0x00000020UL) +#define MPU_S1RGWP_S1RG6WP_POS (6U) +#define MPU_S1RGWP_S1RG6WP (0x00000040UL) +#define MPU_S1RGWP_S1RG7WP_POS (7U) +#define MPU_S1RGWP_S1RG7WP (0x00000080UL) +#define MPU_S1RGWP_S1RG8WP_POS (8U) +#define MPU_S1RGWP_S1RG8WP (0x00000100UL) +#define MPU_S1RGWP_S1RG9WP_POS (9U) +#define MPU_S1RGWP_S1RG9WP (0x00000200UL) +#define MPU_S1RGWP_S1RG10WP_POS (10U) +#define MPU_S1RGWP_S1RG10WP (0x00000400UL) +#define MPU_S1RGWP_S1RG11WP_POS (11U) +#define MPU_S1RGWP_S1RG11WP (0x00000800UL) +#define MPU_S1RGWP_S1RG12WP_POS (12U) +#define MPU_S1RGWP_S1RG12WP (0x00001000UL) +#define MPU_S1RGWP_S1RG13WP_POS (13U) +#define MPU_S1RGWP_S1RG13WP (0x00002000UL) +#define MPU_S1RGWP_S1RG14WP_POS (14U) +#define MPU_S1RGWP_S1RG14WP (0x00004000UL) +#define MPU_S1RGWP_S1RG15WP_POS (15U) +#define MPU_S1RGWP_S1RG15WP (0x00008000UL) + +/* Bit definition for MPU_S1RGRP register */ +#define MPU_S1RGRP_S1RG0RP_POS (0U) +#define MPU_S1RGRP_S1RG0RP (0x00000001UL) +#define MPU_S1RGRP_S1RG1RP_POS (1U) +#define MPU_S1RGRP_S1RG1RP (0x00000002UL) +#define MPU_S1RGRP_S1RG2RP_POS (2U) +#define MPU_S1RGRP_S1RG2RP (0x00000004UL) +#define MPU_S1RGRP_S1RG3RP_POS (3U) +#define MPU_S1RGRP_S1RG3RP (0x00000008UL) +#define MPU_S1RGRP_S1RG4RP_POS (4U) +#define MPU_S1RGRP_S1RG4RP (0x00000010UL) +#define MPU_S1RGRP_S1RG5RP_POS (5U) +#define MPU_S1RGRP_S1RG5RP (0x00000020UL) +#define MPU_S1RGRP_S1RG6RP_POS (6U) +#define MPU_S1RGRP_S1RG6RP (0x00000040UL) +#define MPU_S1RGRP_S1RG7RP_POS (7U) +#define MPU_S1RGRP_S1RG7RP (0x00000080UL) +#define MPU_S1RGRP_S1RG8RP_POS (8U) +#define MPU_S1RGRP_S1RG8RP (0x00000100UL) +#define MPU_S1RGRP_S1RG9RP_POS (9U) +#define MPU_S1RGRP_S1RG9RP (0x00000200UL) +#define MPU_S1RGRP_S1RG10RP_POS (10U) +#define MPU_S1RGRP_S1RG10RP (0x00000400UL) +#define MPU_S1RGRP_S1RG11RP_POS (11U) +#define MPU_S1RGRP_S1RG11RP (0x00000800UL) +#define MPU_S1RGRP_S1RG12RP_POS (12U) +#define MPU_S1RGRP_S1RG12RP (0x00001000UL) +#define MPU_S1RGRP_S1RG13RP_POS (13U) +#define MPU_S1RGRP_S1RG13RP (0x00002000UL) +#define MPU_S1RGRP_S1RG14RP_POS (14U) +#define MPU_S1RGRP_S1RG14RP (0x00004000UL) +#define MPU_S1RGRP_S1RG15RP_POS (15U) +#define MPU_S1RGRP_S1RG15RP (0x00008000UL) + +/* Bit definition for MPU_S1CR register */ +#define MPU_S1CR_SMPU1BRP_POS (0U) +#define MPU_S1CR_SMPU1BRP (0x00000001UL) +#define MPU_S1CR_SMPU1BWP_POS (1U) +#define MPU_S1CR_SMPU1BWP (0x00000002UL) +#define MPU_S1CR_SMPU1ACT_POS (2U) +#define MPU_S1CR_SMPU1ACT (0x0000000CUL) +#define MPU_S1CR_SMPU1ACT_0 (0x00000004UL) +#define MPU_S1CR_SMPU1ACT_1 (0x00000008UL) +#define MPU_S1CR_SMPU1E_POS (7U) +#define MPU_S1CR_SMPU1E (0x00000080UL) + +/* Bit definition for MPU_S2RGE register */ +#define MPU_S2RGE_S2RG0E_POS (0U) +#define MPU_S2RGE_S2RG0E (0x00000001UL) +#define MPU_S2RGE_S2RG1E_POS (1U) +#define MPU_S2RGE_S2RG1E (0x00000002UL) +#define MPU_S2RGE_S2RG2E_POS (2U) +#define MPU_S2RGE_S2RG2E (0x00000004UL) +#define MPU_S2RGE_S2RG3E_POS (3U) +#define MPU_S2RGE_S2RG3E (0x00000008UL) +#define MPU_S2RGE_S2RG4E_POS (4U) +#define MPU_S2RGE_S2RG4E (0x00000010UL) +#define MPU_S2RGE_S2RG5E_POS (5U) +#define MPU_S2RGE_S2RG5E (0x00000020UL) +#define MPU_S2RGE_S2RG6E_POS (6U) +#define MPU_S2RGE_S2RG6E (0x00000040UL) +#define MPU_S2RGE_S2RG7E_POS (7U) +#define MPU_S2RGE_S2RG7E (0x00000080UL) +#define MPU_S2RGE_S2RG8E_POS (8U) +#define MPU_S2RGE_S2RG8E (0x00000100UL) +#define MPU_S2RGE_S2RG9E_POS (9U) +#define MPU_S2RGE_S2RG9E (0x00000200UL) +#define MPU_S2RGE_S2RG10E_POS (10U) +#define MPU_S2RGE_S2RG10E (0x00000400UL) +#define MPU_S2RGE_S2RG11E_POS (11U) +#define MPU_S2RGE_S2RG11E (0x00000800UL) +#define MPU_S2RGE_S2RG12E_POS (12U) +#define MPU_S2RGE_S2RG12E (0x00001000UL) +#define MPU_S2RGE_S2RG13E_POS (13U) +#define MPU_S2RGE_S2RG13E (0x00002000UL) +#define MPU_S2RGE_S2RG14E_POS (14U) +#define MPU_S2RGE_S2RG14E (0x00004000UL) +#define MPU_S2RGE_S2RG15E_POS (15U) +#define MPU_S2RGE_S2RG15E (0x00008000UL) + +/* Bit definition for MPU_S2RGWP register */ +#define MPU_S2RGWP_S2RG0WP_POS (0U) +#define MPU_S2RGWP_S2RG0WP (0x00000001UL) +#define MPU_S2RGWP_S2RG1WP_POS (1U) +#define MPU_S2RGWP_S2RG1WP (0x00000002UL) +#define MPU_S2RGWP_S2RG2WP_POS (2U) +#define MPU_S2RGWP_S2RG2WP (0x00000004UL) +#define MPU_S2RGWP_S2RG3WP_POS (3U) +#define MPU_S2RGWP_S2RG3WP (0x00000008UL) +#define MPU_S2RGWP_S2RG4WP_POS (4U) +#define MPU_S2RGWP_S2RG4WP (0x00000010UL) +#define MPU_S2RGWP_S2RG5WP_POS (5U) +#define MPU_S2RGWP_S2RG5WP (0x00000020UL) +#define MPU_S2RGWP_S2RG6WP_POS (6U) +#define MPU_S2RGWP_S2RG6WP (0x00000040UL) +#define MPU_S2RGWP_S2RG7WP_POS (7U) +#define MPU_S2RGWP_S2RG7WP (0x00000080UL) +#define MPU_S2RGWP_S2RG8WP_POS (8U) +#define MPU_S2RGWP_S2RG8WP (0x00000100UL) +#define MPU_S2RGWP_S2RG9WP_POS (9U) +#define MPU_S2RGWP_S2RG9WP (0x00000200UL) +#define MPU_S2RGWP_S2RG10WP_POS (10U) +#define MPU_S2RGWP_S2RG10WP (0x00000400UL) +#define MPU_S2RGWP_S2RG11WP_POS (11U) +#define MPU_S2RGWP_S2RG11WP (0x00000800UL) +#define MPU_S2RGWP_S2RG12WP_POS (12U) +#define MPU_S2RGWP_S2RG12WP (0x00001000UL) +#define MPU_S2RGWP_S2RG13WP_POS (13U) +#define MPU_S2RGWP_S2RG13WP (0x00002000UL) +#define MPU_S2RGWP_S2RG14WP_POS (14U) +#define MPU_S2RGWP_S2RG14WP (0x00004000UL) +#define MPU_S2RGWP_S2RG15WP_POS (15U) +#define MPU_S2RGWP_S2RG15WP (0x00008000UL) + +/* Bit definition for MPU_S2RGRP register */ +#define MPU_S2RGRP_S2RG0RP_POS (0U) +#define MPU_S2RGRP_S2RG0RP (0x00000001UL) +#define MPU_S2RGRP_S2RG1RP_POS (1U) +#define MPU_S2RGRP_S2RG1RP (0x00000002UL) +#define MPU_S2RGRP_S2RG2RP_POS (2U) +#define MPU_S2RGRP_S2RG2RP (0x00000004UL) +#define MPU_S2RGRP_S2RG3RP_POS (3U) +#define MPU_S2RGRP_S2RG3RP (0x00000008UL) +#define MPU_S2RGRP_S2RG4RP_POS (4U) +#define MPU_S2RGRP_S2RG4RP (0x00000010UL) +#define MPU_S2RGRP_S2RG5RP_POS (5U) +#define MPU_S2RGRP_S2RG5RP (0x00000020UL) +#define MPU_S2RGRP_S2RG6RP_POS (6U) +#define MPU_S2RGRP_S2RG6RP (0x00000040UL) +#define MPU_S2RGRP_S2RG7RP_POS (7U) +#define MPU_S2RGRP_S2RG7RP (0x00000080UL) +#define MPU_S2RGRP_S2RG8RP_POS (8U) +#define MPU_S2RGRP_S2RG8RP (0x00000100UL) +#define MPU_S2RGRP_S2RG9RP_POS (9U) +#define MPU_S2RGRP_S2RG9RP (0x00000200UL) +#define MPU_S2RGRP_S2RG10RP_POS (10U) +#define MPU_S2RGRP_S2RG10RP (0x00000400UL) +#define MPU_S2RGRP_S2RG11RP_POS (11U) +#define MPU_S2RGRP_S2RG11RP (0x00000800UL) +#define MPU_S2RGRP_S2RG12RP_POS (12U) +#define MPU_S2RGRP_S2RG12RP (0x00001000UL) +#define MPU_S2RGRP_S2RG13RP_POS (13U) +#define MPU_S2RGRP_S2RG13RP (0x00002000UL) +#define MPU_S2RGRP_S2RG14RP_POS (14U) +#define MPU_S2RGRP_S2RG14RP (0x00004000UL) +#define MPU_S2RGRP_S2RG15RP_POS (15U) +#define MPU_S2RGRP_S2RG15RP (0x00008000UL) + +/* Bit definition for MPU_S2CR register */ +#define MPU_S2CR_SMPU2BRP_POS (0U) +#define MPU_S2CR_SMPU2BRP (0x00000001UL) +#define MPU_S2CR_SMPU2BWP_POS (1U) +#define MPU_S2CR_SMPU2BWP (0x00000002UL) +#define MPU_S2CR_SMPU2ACT_POS (2U) +#define MPU_S2CR_SMPU2ACT (0x0000000CUL) +#define MPU_S2CR_SMPU2ACT_0 (0x00000004UL) +#define MPU_S2CR_SMPU2ACT_1 (0x00000008UL) +#define MPU_S2CR_SMPU2E_POS (7U) +#define MPU_S2CR_SMPU2E (0x00000080UL) + +/* Bit definition for MPU_FRGE register */ +#define MPU_FRGE_FMPU0E_POS (0U) +#define MPU_FRGE_FMPU0E (0x00000001UL) +#define MPU_FRGE_FMPU1E_POS (1U) +#define MPU_FRGE_FMPU1E (0x00000002UL) +#define MPU_FRGE_FMPU2E_POS (2U) +#define MPU_FRGE_FMPU2E (0x00000004UL) +#define MPU_FRGE_FMPU3E_POS (3U) +#define MPU_FRGE_FMPU3E (0x00000008UL) +#define MPU_FRGE_FMPU4E_POS (4U) +#define MPU_FRGE_FMPU4E (0x00000010UL) +#define MPU_FRGE_FMPU5E_POS (5U) +#define MPU_FRGE_FMPU5E (0x00000020UL) +#define MPU_FRGE_FMPU6E_POS (6U) +#define MPU_FRGE_FMPU6E (0x00000040UL) +#define MPU_FRGE_FMPU7E_POS (7U) +#define MPU_FRGE_FMPU7E (0x00000080UL) + +/* Bit definition for MPU_FRGWP register */ +#define MPU_FRGWP_FMPU0WP_POS (0U) +#define MPU_FRGWP_FMPU0WP (0x00000001UL) +#define MPU_FRGWP_FMPU1WP_POS (1U) +#define MPU_FRGWP_FMPU1WP (0x00000002UL) +#define MPU_FRGWP_FMPU2WP_POS (2U) +#define MPU_FRGWP_FMPU2WP (0x00000004UL) +#define MPU_FRGWP_FMPU3WP_POS (3U) +#define MPU_FRGWP_FMPU3WP (0x00000008UL) +#define MPU_FRGWP_FMPU4WP_POS (4U) +#define MPU_FRGWP_FMPU4WP (0x00000010UL) +#define MPU_FRGWP_FMPU5WP_POS (5U) +#define MPU_FRGWP_FMPU5WP (0x00000020UL) +#define MPU_FRGWP_FMPU6WP_POS (6U) +#define MPU_FRGWP_FMPU6WP (0x00000040UL) +#define MPU_FRGWP_FMPU7WP_POS (7U) +#define MPU_FRGWP_FMPU7WP (0x00000080UL) + +/* Bit definition for MPU_FRGRP register */ +#define MPU_FRGRP_FMPU0RP_POS (0U) +#define MPU_FRGRP_FMPU0RP (0x00000001UL) +#define MPU_FRGRP_FMPU1RP_POS (1U) +#define MPU_FRGRP_FMPU1RP (0x00000002UL) +#define MPU_FRGRP_FMPU2RP_POS (2U) +#define MPU_FRGRP_FMPU2RP (0x00000004UL) +#define MPU_FRGRP_FMPU3RP_POS (3U) +#define MPU_FRGRP_FMPU3RP (0x00000008UL) +#define MPU_FRGRP_FMPU4RP_POS (4U) +#define MPU_FRGRP_FMPU4RP (0x00000010UL) +#define MPU_FRGRP_FMPU5RP_POS (5U) +#define MPU_FRGRP_FMPU5RP (0x00000020UL) +#define MPU_FRGRP_FMPU6RP_POS (6U) +#define MPU_FRGRP_FMPU6RP (0x00000040UL) +#define MPU_FRGRP_FMPU7RP_POS (7U) +#define MPU_FRGRP_FMPU7RP (0x00000080UL) + +/* Bit definition for MPU_FCR register */ +#define MPU_FCR_FMPUBRP_POS (0U) +#define MPU_FCR_FMPUBRP (0x00000001UL) +#define MPU_FCR_FMPUBWP_POS (1U) +#define MPU_FCR_FMPUBWP (0x00000002UL) +#define MPU_FCR_FMPUACT_POS (2U) +#define MPU_FCR_FMPUACT (0x0000000CUL) +#define MPU_FCR_FMPUACT_0 (0x00000004UL) +#define MPU_FCR_FMPUACT_1 (0x00000008UL) +#define MPU_FCR_FMPUE_POS (7U) +#define MPU_FCR_FMPUE (0x00000080UL) + +/* Bit definition for MPU_HRGE register */ +#define MPU_HRGE_HMPU0E_POS (0U) +#define MPU_HRGE_HMPU0E (0x00000001UL) +#define MPU_HRGE_HMPU1E_POS (1U) +#define MPU_HRGE_HMPU1E (0x00000002UL) +#define MPU_HRGE_HMPU2E_POS (2U) +#define MPU_HRGE_HMPU2E (0x00000004UL) +#define MPU_HRGE_HMPU3E_POS (3U) +#define MPU_HRGE_HMPU3E (0x00000008UL) +#define MPU_HRGE_HMPU4E_POS (4U) +#define MPU_HRGE_HMPU4E (0x00000010UL) +#define MPU_HRGE_HMPU5E_POS (5U) +#define MPU_HRGE_HMPU5E (0x00000020UL) +#define MPU_HRGE_HMPU6E_POS (6U) +#define MPU_HRGE_HMPU6E (0x00000040UL) +#define MPU_HRGE_HMPU7E_POS (7U) +#define MPU_HRGE_HMPU7E (0x00000080UL) + +/* Bit definition for MPU_HRGWP register */ +#define MPU_HRGWP_HMPU0WP_POS (0U) +#define MPU_HRGWP_HMPU0WP (0x00000001UL) +#define MPU_HRGWP_HMPU1WP_POS (1U) +#define MPU_HRGWP_HMPU1WP (0x00000002UL) +#define MPU_HRGWP_HMPU2WP_POS (2U) +#define MPU_HRGWP_HMPU2WP (0x00000004UL) +#define MPU_HRGWP_HMPU3WP_POS (3U) +#define MPU_HRGWP_HMPU3WP (0x00000008UL) +#define MPU_HRGWP_HMPU4WP_POS (4U) +#define MPU_HRGWP_HMPU4WP (0x00000010UL) +#define MPU_HRGWP_HMPU5WP_POS (5U) +#define MPU_HRGWP_HMPU5WP (0x00000020UL) +#define MPU_HRGWP_HMPU6WP_POS (6U) +#define MPU_HRGWP_HMPU6WP (0x00000040UL) +#define MPU_HRGWP_HMPU7WP_POS (7U) +#define MPU_HRGWP_HMPU7WP (0x00000080UL) + +/* Bit definition for MPU_HRGRP register */ +#define MPU_HRGRP_HMPU0RP_POS (0U) +#define MPU_HRGRP_HMPU0RP (0x00000001UL) +#define MPU_HRGRP_HMPU1RP_POS (1U) +#define MPU_HRGRP_HMPU1RP (0x00000002UL) +#define MPU_HRGRP_HMPU2RP_POS (2U) +#define MPU_HRGRP_HMPU2RP (0x00000004UL) +#define MPU_HRGRP_HMPU3RP_POS (3U) +#define MPU_HRGRP_HMPU3RP (0x00000008UL) +#define MPU_HRGRP_HMPU4RP_POS (4U) +#define MPU_HRGRP_HMPU4RP (0x00000010UL) +#define MPU_HRGRP_HMPU5RP_POS (5U) +#define MPU_HRGRP_HMPU5RP (0x00000020UL) +#define MPU_HRGRP_HMPU6RP_POS (6U) +#define MPU_HRGRP_HMPU6RP (0x00000040UL) +#define MPU_HRGRP_HMPU7RP_POS (7U) +#define MPU_HRGRP_HMPU7RP (0x00000080UL) + +/* Bit definition for MPU_HCR register */ +#define MPU_HCR_HMPUBRP_POS (0U) +#define MPU_HCR_HMPUBRP (0x00000001UL) +#define MPU_HCR_HMPUBWP_POS (1U) +#define MPU_HCR_HMPUBWP (0x00000002UL) +#define MPU_HCR_HMPUACT_POS (2U) +#define MPU_HCR_HMPUACT (0x0000000CUL) +#define MPU_HCR_HMPUACT_0 (0x00000004UL) +#define MPU_HCR_HMPUACT_1 (0x00000008UL) +#define MPU_HCR_HMPUE_POS (7U) +#define MPU_HCR_HMPUE (0x00000080UL) + +/* Bit definition for MPU_ERGE register */ +#define MPU_ERGE_EMPU0E_POS (0U) +#define MPU_ERGE_EMPU0E (0x00000001UL) +#define MPU_ERGE_EMPU1E_POS (1U) +#define MPU_ERGE_EMPU1E (0x00000002UL) +#define MPU_ERGE_EMPU2E_POS (2U) +#define MPU_ERGE_EMPU2E (0x00000004UL) +#define MPU_ERGE_EMPU3E_POS (3U) +#define MPU_ERGE_EMPU3E (0x00000008UL) +#define MPU_ERGE_EMPU4E_POS (4U) +#define MPU_ERGE_EMPU4E (0x00000010UL) +#define MPU_ERGE_EMPU5E_POS (5U) +#define MPU_ERGE_EMPU5E (0x00000020UL) +#define MPU_ERGE_EMPU6E_POS (6U) +#define MPU_ERGE_EMPU6E (0x00000040UL) +#define MPU_ERGE_EMPU7E_POS (7U) +#define MPU_ERGE_EMPU7E (0x00000080UL) + +/* Bit definition for MPU_ERGWP register */ +#define MPU_ERGWP_EMPU0WP_POS (0U) +#define MPU_ERGWP_EMPU0WP (0x00000001UL) +#define MPU_ERGWP_EMPU1WP_POS (1U) +#define MPU_ERGWP_EMPU1WP (0x00000002UL) +#define MPU_ERGWP_EMPU2WP_POS (2U) +#define MPU_ERGWP_EMPU2WP (0x00000004UL) +#define MPU_ERGWP_EMPU3WP_POS (3U) +#define MPU_ERGWP_EMPU3WP (0x00000008UL) +#define MPU_ERGWP_EMPU4WP_POS (4U) +#define MPU_ERGWP_EMPU4WP (0x00000010UL) +#define MPU_ERGWP_EMPU5WP_POS (5U) +#define MPU_ERGWP_EMPU5WP (0x00000020UL) +#define MPU_ERGWP_EMPU6WP_POS (6U) +#define MPU_ERGWP_EMPU6WP (0x00000040UL) +#define MPU_ERGWP_EMPU7WP_POS (7U) +#define MPU_ERGWP_EMPU7WP (0x00000080UL) + +/* Bit definition for MPU_ERGRP register */ +#define MPU_ERGRP_EMPU0RP_POS (0U) +#define MPU_ERGRP_EMPU0RP (0x00000001UL) +#define MPU_ERGRP_EMPU1RP_POS (1U) +#define MPU_ERGRP_EMPU1RP (0x00000002UL) +#define MPU_ERGRP_EMPU2RP_POS (2U) +#define MPU_ERGRP_EMPU2RP (0x00000004UL) +#define MPU_ERGRP_EMPU3RP_POS (3U) +#define MPU_ERGRP_EMPU3RP (0x00000008UL) +#define MPU_ERGRP_EMPU4RP_POS (4U) +#define MPU_ERGRP_EMPU4RP (0x00000010UL) +#define MPU_ERGRP_EMPU5RP_POS (5U) +#define MPU_ERGRP_EMPU5RP (0x00000020UL) +#define MPU_ERGRP_EMPU6RP_POS (6U) +#define MPU_ERGRP_EMPU6RP (0x00000040UL) +#define MPU_ERGRP_EMPU7RP_POS (7U) +#define MPU_ERGRP_EMPU7RP (0x00000080UL) + +/* Bit definition for MPU_ECR register */ +#define MPU_ECR_EMPUBRP_POS (0U) +#define MPU_ECR_EMPUBRP (0x00000001UL) +#define MPU_ECR_EMPUBWP_POS (1U) +#define MPU_ECR_EMPUBWP (0x00000002UL) +#define MPU_ECR_EMPUACT_POS (2U) +#define MPU_ECR_EMPUACT (0x0000000CUL) +#define MPU_ECR_EMPUACT_0 (0x00000004UL) +#define MPU_ECR_EMPUACT_1 (0x00000008UL) +#define MPU_ECR_EMPUE_POS (7U) +#define MPU_ECR_EMPUE (0x00000080UL) + +/******************************************************************************* + Bit definition for Peripheral NFC +*******************************************************************************/ +/* Bit definition for NFC_DATR_BASE register */ +#define NFC_DATR_BASE (0xFFFFFFFFUL) + +/* Bit definition for NFC_CMDR register */ +#define NFC_CMDR_CMD_POS (0U) +#define NFC_CMDR_CMD (0x000000FFUL) +#define NFC_CMDR_ARG_POS (8U) +#define NFC_CMDR_ARG (0xFFFFFF00UL) + +/* Bit definition for NFC_IDXR0 register */ +#define NFC_IDXR0 (0xFFFFFFFFUL) + +/* Bit definition for NFC_IENR register */ +#define NFC_IENR_ECCEUEN_POS (0U) +#define NFC_IENR_ECCEUEN (0x00000001UL) +#define NFC_IENR_ECCECEN_POS (1U) +#define NFC_IENR_ECCECEN (0x00000002UL) +#define NFC_IENR_ECCCEN_POS (4U) +#define NFC_IENR_ECCCEN (0x00000010UL) +#define NFC_IENR_ECCEEN_POS (6U) +#define NFC_IENR_ECCEEN (0x00000040UL) +#define NFC_IENR_ECCDIS_POS (7U) +#define NFC_IENR_ECCDIS (0x00000080UL) +#define NFC_IENR_RBEN_POS (8U) +#define NFC_IENR_RBEN (0x0000FF00UL) +#define NFC_IENR_RBEN_0 (0x00000100UL) +#define NFC_IENR_RBEN_1 (0x00000200UL) +#define NFC_IENR_RBEN_2 (0x00000400UL) +#define NFC_IENR_RBEN_3 (0x00000800UL) +#define NFC_IENR_RBEN_4 (0x00001000UL) +#define NFC_IENR_RBEN_5 (0x00002000UL) +#define NFC_IENR_RBEN_6 (0x00004000UL) +#define NFC_IENR_RBEN_7 (0x00008000UL) +#define NFC_IENR_RESV_POS (31U) +#define NFC_IENR_RESV (0x80000000UL) + +/* Bit definition for NFC_ISTR register */ +#define NFC_ISTR_ECCEUST_POS (0U) +#define NFC_ISTR_ECCEUST (0x00000001UL) +#define NFC_ISTR_ECCECST_POS (1U) +#define NFC_ISTR_ECCECST (0x00000002UL) +#define NFC_ISTR_ECCCST_POS (4U) +#define NFC_ISTR_ECCCST (0x00000010UL) +#define NFC_ISTR_ECCEST_POS (6U) +#define NFC_ISTR_ECCEST (0x00000040UL) +#define NFC_ISTR_RBST_POS (8U) +#define NFC_ISTR_RBST (0x0000FF00UL) +#define NFC_ISTR_RBST_0 (0x00000100UL) +#define NFC_ISTR_RBST_1 (0x00000200UL) +#define NFC_ISTR_RBST_2 (0x00000400UL) +#define NFC_ISTR_RBST_3 (0x00000800UL) +#define NFC_ISTR_RBST_4 (0x00001000UL) +#define NFC_ISTR_RBST_5 (0x00002000UL) +#define NFC_ISTR_RBST_6 (0x00004000UL) +#define NFC_ISTR_RBST_7 (0x00008000UL) +#define NFC_ISTR_RESV_POS (31U) +#define NFC_ISTR_RESV (0x80000000UL) + +/* Bit definition for NFC_IRSR register */ +#define NFC_IRSR_ECCEURS_POS (0U) +#define NFC_IRSR_ECCEURS (0x00000001UL) +#define NFC_IRSR_ECCECRS_POS (1U) +#define NFC_IRSR_ECCECRS (0x00000002UL) +#define NFC_IRSR_ECCCRS_POS (4U) +#define NFC_IRSR_ECCCRS (0x00000010UL) +#define NFC_IRSR_ECCERS_POS (6U) +#define NFC_IRSR_ECCERS (0x00000040UL) +#define NFC_IRSR_RBRS_POS (8U) +#define NFC_IRSR_RBRS (0x0000FF00UL) +#define NFC_IRSR_RBRS_0 (0x00000100UL) +#define NFC_IRSR_RBRS_1 (0x00000200UL) +#define NFC_IRSR_RBRS_2 (0x00000400UL) +#define NFC_IRSR_RBRS_3 (0x00000800UL) +#define NFC_IRSR_RBRS_4 (0x00001000UL) +#define NFC_IRSR_RBRS_5 (0x00002000UL) +#define NFC_IRSR_RBRS_6 (0x00004000UL) +#define NFC_IRSR_RBRS_7 (0x00008000UL) +#define NFC_IRSR_RESV_POS (31U) +#define NFC_IRSR_RESV (0x80000000UL) + +/* Bit definition for NFC_IDXR1 register */ +#define NFC_IDXR1_IDX1_POS (0U) +#define NFC_IDXR1_IDX1 (0x000000FFUL) +#define NFC_IDXR1_RESV_POS (8U) +#define NFC_IDXR1_RESV (0xFFFFFF00UL) + +/* Bit definition for NFC_TMCR0 register */ +#define NFC_TMCR0_TS_POS (0U) +#define NFC_TMCR0_TS (0x000000FFUL) +#define NFC_TMCR0_TS_0 (0x00000001UL) +#define NFC_TMCR0_TS_1 (0x00000002UL) +#define NFC_TMCR0_TS_2 (0x00000004UL) +#define NFC_TMCR0_TS_3 (0x00000008UL) +#define NFC_TMCR0_TS_4 (0x00000010UL) +#define NFC_TMCR0_TS_5 (0x00000020UL) +#define NFC_TMCR0_TS_6 (0x00000040UL) +#define NFC_TMCR0_TS_7 (0x00000080UL) +#define NFC_TMCR0_TWP_POS (8U) +#define NFC_TMCR0_TWP (0x0000FF00UL) +#define NFC_TMCR0_TWP_0 (0x00000100UL) +#define NFC_TMCR0_TWP_1 (0x00000200UL) +#define NFC_TMCR0_TWP_2 (0x00000400UL) +#define NFC_TMCR0_TWP_3 (0x00000800UL) +#define NFC_TMCR0_TWP_4 (0x00001000UL) +#define NFC_TMCR0_TWP_5 (0x00002000UL) +#define NFC_TMCR0_TWP_6 (0x00004000UL) +#define NFC_TMCR0_TWP_7 (0x00008000UL) +#define NFC_TMCR0_TRP_POS (16U) +#define NFC_TMCR0_TRP (0x00FF0000UL) +#define NFC_TMCR0_TRP_0 (0x00010000UL) +#define NFC_TMCR0_TRP_1 (0x00020000UL) +#define NFC_TMCR0_TRP_2 (0x00040000UL) +#define NFC_TMCR0_TRP_3 (0x00080000UL) +#define NFC_TMCR0_TRP_4 (0x00100000UL) +#define NFC_TMCR0_TRP_5 (0x00200000UL) +#define NFC_TMCR0_TRP_6 (0x00400000UL) +#define NFC_TMCR0_TRP_7 (0x00800000UL) +#define NFC_TMCR0_TH_POS (24U) +#define NFC_TMCR0_TH (0xFF000000UL) +#define NFC_TMCR0_TH_0 (0x01000000UL) +#define NFC_TMCR0_TH_1 (0x02000000UL) +#define NFC_TMCR0_TH_2 (0x04000000UL) +#define NFC_TMCR0_TH_3 (0x08000000UL) +#define NFC_TMCR0_TH_4 (0x10000000UL) +#define NFC_TMCR0_TH_5 (0x20000000UL) +#define NFC_TMCR0_TH_6 (0x40000000UL) +#define NFC_TMCR0_TH_7 (0x80000000UL) + +/* Bit definition for NFC_TMCR1 register */ +#define NFC_TMCR1_TWH_POS (0U) +#define NFC_TMCR1_TWH (0x000000FFUL) +#define NFC_TMCR1_TRH_POS (8U) +#define NFC_TMCR1_TRH (0x0000FF00UL) +#define NFC_TMCR1_TRR_POS (16U) +#define NFC_TMCR1_TRR (0x00FF0000UL) +#define NFC_TMCR1_TWB_POS (24U) +#define NFC_TMCR1_TWB (0xFF000000UL) + +/* Bit definition for NFC_BACR register */ +#define NFC_BACR_SIZE_POS (0U) +#define NFC_BACR_SIZE (0x00000007UL) +#define NFC_BACR_SIZE_0 (0x00000001UL) +#define NFC_BACR_SIZE_1 (0x00000002UL) +#define NFC_BACR_SIZE_2 (0x00000004UL) +#define NFC_BACR_B16BIT_POS (3U) +#define NFC_BACR_B16BIT (0x00000008UL) +#define NFC_BACR_BANK_POS (6U) +#define NFC_BACR_BANK (0x000000C0UL) +#define NFC_BACR_BANK_0 (0x00000040UL) +#define NFC_BACR_BANK_1 (0x00000080UL) +#define NFC_BACR_PAGE_POS (8U) +#define NFC_BACR_PAGE (0x00000300UL) +#define NFC_BACR_PAGE_0 (0x00000100UL) +#define NFC_BACR_PAGE_1 (0x00000200UL) +#define NFC_BACR_WP_POS (10U) +#define NFC_BACR_WP (0x00000400UL) +#define NFC_BACR_ECCM_POS (11U) +#define NFC_BACR_ECCM (0x00001800UL) +#define NFC_BACR_ECCM_0 (0x00000800UL) +#define NFC_BACR_ECCM_1 (0x00001000UL) +#define NFC_BACR_RAC_POS (13U) +#define NFC_BACR_RAC (0x00002000UL) +#define NFC_BACR_SCS_POS (16U) +#define NFC_BACR_SCS (0x00FF0000UL) +#define NFC_BACR_SCS_0 (0x00010000UL) +#define NFC_BACR_SCS_1 (0x00020000UL) +#define NFC_BACR_SCS_2 (0x00040000UL) +#define NFC_BACR_SCS_3 (0x00080000UL) +#define NFC_BACR_SCS_4 (0x00100000UL) +#define NFC_BACR_SCS_5 (0x00200000UL) +#define NFC_BACR_SCS_6 (0x00400000UL) +#define NFC_BACR_SCS_7 (0x00800000UL) + +/* Bit definition for NFC_TMCR2 register */ +#define NFC_TMCR2_TCCS_POS (0U) +#define NFC_TMCR2_TCCS (0x000000FFUL) +#define NFC_TMCR2_TWTR_POS (8U) +#define NFC_TMCR2_TWTR (0x0000FF00UL) +#define NFC_TMCR2_TRTW_POS (16U) +#define NFC_TMCR2_TRTW (0x00FF0000UL) +#define NFC_TMCR2_TADL_POS (24U) +#define NFC_TMCR2_TADL (0xFF000000UL) + +/* Bit definition for NFC_ECCR register */ +#define NFC_ECCR_ERRLOC_POS (0U) +#define NFC_ECCR_ERRLOC (0x00000FFFUL) +#define NFC_ECCR_SE_POS (12U) +#define NFC_ECCR_SE (0x00001000UL) +#define NFC_ECCR_ME_POS (13U) +#define NFC_ECCR_ME (0x00002000UL) + +/* Bit definition for NFC_ECC_STAT register */ +#define NFC_ECC_STAT_ERRSEC_POS (0U) +#define NFC_ECC_STAT_ERRSEC (0x0000FFFFUL) +#define NFC_ECC_STAT_ERRSEC_0 (0x00000001UL) +#define NFC_ECC_STAT_ERRSEC_1 (0x00000002UL) +#define NFC_ECC_STAT_ERRSEC_2 (0x00000004UL) +#define NFC_ECC_STAT_ERRSEC_3 (0x00000008UL) +#define NFC_ECC_STAT_ERRSEC_4 (0x00000010UL) +#define NFC_ECC_STAT_ERRSEC_5 (0x00000020UL) +#define NFC_ECC_STAT_ERRSEC_6 (0x00000040UL) +#define NFC_ECC_STAT_ERRSEC_7 (0x00000080UL) +#define NFC_ECC_STAT_ERRSEC_8 (0x00000100UL) +#define NFC_ECC_STAT_ERRSEC_9 (0x00000200UL) +#define NFC_ECC_STAT_ERRSEC_10 (0x00000400UL) +#define NFC_ECC_STAT_ERRSEC_11 (0x00000800UL) +#define NFC_ECC_STAT_ERRSEC_12 (0x00001000UL) +#define NFC_ECC_STAT_ERRSEC_13 (0x00002000UL) +#define NFC_ECC_STAT_ERRSEC_14 (0x00004000UL) +#define NFC_ECC_STAT_ERRSEC_15 (0x00008000UL) +#define NFC_ECC_STAT_RESV_POS (16U) +#define NFC_ECC_STAT_RESV (0xFFFF0000UL) + +/* Bit definition for NFC_ECC_SYND0_0 register */ +#define NFC_ECC_SYND0_0_S1_POS (0U) +#define NFC_ECC_SYND0_0_S1 (0x00001FFFUL) +#define NFC_ECC_SYND0_0_S2_POS (16U) +#define NFC_ECC_SYND0_0_S2 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND0_1 register */ +#define NFC_ECC_SYND0_1_S3_POS (0U) +#define NFC_ECC_SYND0_1_S3 (0x00001FFFUL) +#define NFC_ECC_SYND0_1_S4_POS (16U) +#define NFC_ECC_SYND0_1_S4 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND0_2 register */ +#define NFC_ECC_SYND0_2_S5_POS (0U) +#define NFC_ECC_SYND0_2_S5 (0x00001FFFUL) +#define NFC_ECC_SYND0_2_S6_POS (16U) +#define NFC_ECC_SYND0_2_S6 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND0_3 register */ +#define NFC_ECC_SYND0_3_S7_POS (0U) +#define NFC_ECC_SYND0_3_S7 (0x00001FFFUL) +#define NFC_ECC_SYND0_3_S8_POS (16U) +#define NFC_ECC_SYND0_3_S8 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND1_0 register */ +#define NFC_ECC_SYND1_0_S1_POS (0U) +#define NFC_ECC_SYND1_0_S1 (0x00001FFFUL) +#define NFC_ECC_SYND1_0_S2_POS (16U) +#define NFC_ECC_SYND1_0_S2 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND1_1 register */ +#define NFC_ECC_SYND1_1_S3_POS (0U) +#define NFC_ECC_SYND1_1_S3 (0x00001FFFUL) +#define NFC_ECC_SYND1_1_S4_POS (16U) +#define NFC_ECC_SYND1_1_S4 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND1_2 register */ +#define NFC_ECC_SYND1_2_S5_POS (0U) +#define NFC_ECC_SYND1_2_S5 (0x00001FFFUL) +#define NFC_ECC_SYND1_2_S6_POS (16U) +#define NFC_ECC_SYND1_2_S6 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND1_3 register */ +#define NFC_ECC_SYND1_3_S7_POS (0U) +#define NFC_ECC_SYND1_3_S7 (0x00001FFFUL) +#define NFC_ECC_SYND1_3_S8_POS (16U) +#define NFC_ECC_SYND1_3_S8 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND2_0 register */ +#define NFC_ECC_SYND2_0_S1_POS (0U) +#define NFC_ECC_SYND2_0_S1 (0x00001FFFUL) +#define NFC_ECC_SYND2_0_S2_POS (16U) +#define NFC_ECC_SYND2_0_S2 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND2_1 register */ +#define NFC_ECC_SYND2_1_S3_POS (0U) +#define NFC_ECC_SYND2_1_S3 (0x00001FFFUL) +#define NFC_ECC_SYND2_1_S4_POS (16U) +#define NFC_ECC_SYND2_1_S4 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND2_2 register */ +#define NFC_ECC_SYND2_2_S5_POS (0U) +#define NFC_ECC_SYND2_2_S5 (0x00001FFFUL) +#define NFC_ECC_SYND2_2_S6_POS (16U) +#define NFC_ECC_SYND2_2_S6 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND2_3 register */ +#define NFC_ECC_SYND2_3_S7_POS (0U) +#define NFC_ECC_SYND2_3_S7 (0x00001FFFUL) +#define NFC_ECC_SYND2_3_S8_POS (16U) +#define NFC_ECC_SYND2_3_S8 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND3_0 register */ +#define NFC_ECC_SYND3_0_S1_POS (0U) +#define NFC_ECC_SYND3_0_S1 (0x00001FFFUL) +#define NFC_ECC_SYND3_0_S2_POS (16U) +#define NFC_ECC_SYND3_0_S2 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND3_1 register */ +#define NFC_ECC_SYND3_1_S3_POS (0U) +#define NFC_ECC_SYND3_1_S3 (0x00001FFFUL) +#define NFC_ECC_SYND3_1_S4_POS (16U) +#define NFC_ECC_SYND3_1_S4 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND3_2 register */ +#define NFC_ECC_SYND3_2_S5_POS (0U) +#define NFC_ECC_SYND3_2_S5 (0x00001FFFUL) +#define NFC_ECC_SYND3_2_S6_POS (16U) +#define NFC_ECC_SYND3_2_S6 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND3_3 register */ +#define NFC_ECC_SYND3_3_S7_POS (0U) +#define NFC_ECC_SYND3_3_S7 (0x00001FFFUL) +#define NFC_ECC_SYND3_3_S8_POS (16U) +#define NFC_ECC_SYND3_3_S8 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND4_0 register */ +#define NFC_ECC_SYND4_0_S1_POS (0U) +#define NFC_ECC_SYND4_0_S1 (0x00001FFFUL) +#define NFC_ECC_SYND4_0_S2_POS (16U) +#define NFC_ECC_SYND4_0_S2 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND4_1 register */ +#define NFC_ECC_SYND4_1_S3_POS (0U) +#define NFC_ECC_SYND4_1_S3 (0x00001FFFUL) +#define NFC_ECC_SYND4_1_S4_POS (16U) +#define NFC_ECC_SYND4_1_S4 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND4_2 register */ +#define NFC_ECC_SYND4_2_S5_POS (0U) +#define NFC_ECC_SYND4_2_S5 (0x00001FFFUL) +#define NFC_ECC_SYND4_2_S6_POS (16U) +#define NFC_ECC_SYND4_2_S6 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND4_3 register */ +#define NFC_ECC_SYND4_3_S7_POS (0U) +#define NFC_ECC_SYND4_3_S7 (0x00001FFFUL) +#define NFC_ECC_SYND4_3_S8_POS (16U) +#define NFC_ECC_SYND4_3_S8 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND5_0 register */ +#define NFC_ECC_SYND5_0_S1_POS (0U) +#define NFC_ECC_SYND5_0_S1 (0x00001FFFUL) +#define NFC_ECC_SYND5_0_S2_POS (16U) +#define NFC_ECC_SYND5_0_S2 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND5_1 register */ +#define NFC_ECC_SYND5_1_S3_POS (0U) +#define NFC_ECC_SYND5_1_S3 (0x00001FFFUL) +#define NFC_ECC_SYND5_1_S4_POS (16U) +#define NFC_ECC_SYND5_1_S4 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND5_2 register */ +#define NFC_ECC_SYND5_2_S5_POS (0U) +#define NFC_ECC_SYND5_2_S5 (0x00001FFFUL) +#define NFC_ECC_SYND5_2_S6_POS (16U) +#define NFC_ECC_SYND5_2_S6 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND5_3 register */ +#define NFC_ECC_SYND5_3_S7_POS (0U) +#define NFC_ECC_SYND5_3_S7 (0x00001FFFUL) +#define NFC_ECC_SYND5_3_S8_POS (16U) +#define NFC_ECC_SYND5_3_S8 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND6_0 register */ +#define NFC_ECC_SYND6_0_S1_POS (0U) +#define NFC_ECC_SYND6_0_S1 (0x00001FFFUL) +#define NFC_ECC_SYND6_0_S2_POS (16U) +#define NFC_ECC_SYND6_0_S2 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND6_1 register */ +#define NFC_ECC_SYND6_1_S3_POS (0U) +#define NFC_ECC_SYND6_1_S3 (0x00001FFFUL) +#define NFC_ECC_SYND6_1_S3_0 (0x00000001UL) +#define NFC_ECC_SYND6_1_S3_1 (0x00000002UL) +#define NFC_ECC_SYND6_1_S3_2 (0x00000004UL) +#define NFC_ECC_SYND6_1_S3_3 (0x00000008UL) +#define NFC_ECC_SYND6_1_S3_4 (0x00000010UL) +#define NFC_ECC_SYND6_1_S3_5 (0x00000020UL) +#define NFC_ECC_SYND6_1_S3_6 (0x00000040UL) +#define NFC_ECC_SYND6_1_S3_7 (0x00000080UL) +#define NFC_ECC_SYND6_1_S3_8 (0x00000100UL) +#define NFC_ECC_SYND6_1_S3_9 (0x00000200UL) +#define NFC_ECC_SYND6_1_S3_10 (0x00000400UL) +#define NFC_ECC_SYND6_1_S3_11 (0x00000800UL) +#define NFC_ECC_SYND6_1_S3_12 (0x00001000UL) +#define NFC_ECC_SYND6_1_S4_POS (16U) +#define NFC_ECC_SYND6_1_S4 (0x1FFF0000UL) +#define NFC_ECC_SYND6_1_S4_0 (0x00010000UL) +#define NFC_ECC_SYND6_1_S4_1 (0x00020000UL) +#define NFC_ECC_SYND6_1_S4_2 (0x00040000UL) +#define NFC_ECC_SYND6_1_S4_3 (0x00080000UL) +#define NFC_ECC_SYND6_1_S4_4 (0x00100000UL) +#define NFC_ECC_SYND6_1_S4_5 (0x00200000UL) +#define NFC_ECC_SYND6_1_S4_6 (0x00400000UL) +#define NFC_ECC_SYND6_1_S4_7 (0x00800000UL) +#define NFC_ECC_SYND6_1_S4_8 (0x01000000UL) +#define NFC_ECC_SYND6_1_S4_9 (0x02000000UL) +#define NFC_ECC_SYND6_1_S4_10 (0x04000000UL) +#define NFC_ECC_SYND6_1_S4_11 (0x08000000UL) +#define NFC_ECC_SYND6_1_S4_12 (0x10000000UL) +#define NFC_ECC_SYND6_1_RESV_POS (31U) +#define NFC_ECC_SYND6_1_RESV (0x80000000UL) + +/* Bit definition for NFC_ECC_SYND6_2 register */ +#define NFC_ECC_SYND6_2_S5_POS (0U) +#define NFC_ECC_SYND6_2_S5 (0x00001FFFUL) +#define NFC_ECC_SYND6_2_S6_POS (16U) +#define NFC_ECC_SYND6_2_S6 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND6_3 register */ +#define NFC_ECC_SYND6_3_S7_POS (0U) +#define NFC_ECC_SYND6_3_S7 (0x00001FFFUL) +#define NFC_ECC_SYND6_3_S8_POS (16U) +#define NFC_ECC_SYND6_3_S8 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND7_0 register */ +#define NFC_ECC_SYND7_0_S1_POS (0U) +#define NFC_ECC_SYND7_0_S1 (0x00001FFFUL) +#define NFC_ECC_SYND7_0_S2_POS (16U) +#define NFC_ECC_SYND7_0_S2 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND7_1 register */ +#define NFC_ECC_SYND7_1_S3_POS (0U) +#define NFC_ECC_SYND7_1_S3 (0x00001FFFUL) +#define NFC_ECC_SYND7_1_S4_POS (16U) +#define NFC_ECC_SYND7_1_S4 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND7_2 register */ +#define NFC_ECC_SYND7_2_S5_POS (0U) +#define NFC_ECC_SYND7_2_S5 (0x00001FFFUL) +#define NFC_ECC_SYND7_2_S6_POS (16U) +#define NFC_ECC_SYND7_2_S6 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND7_3 register */ +#define NFC_ECC_SYND7_3_S7_POS (0U) +#define NFC_ECC_SYND7_3_S7 (0x00001FFFUL) +#define NFC_ECC_SYND7_3_S8_POS (16U) +#define NFC_ECC_SYND7_3_S8 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND8_0 register */ +#define NFC_ECC_SYND8_0_S1_POS (0U) +#define NFC_ECC_SYND8_0_S1 (0x00001FFFUL) +#define NFC_ECC_SYND8_0_S2_POS (16U) +#define NFC_ECC_SYND8_0_S2 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND8_1 register */ +#define NFC_ECC_SYND8_1_S3_POS (0U) +#define NFC_ECC_SYND8_1_S3 (0x00001FFFUL) +#define NFC_ECC_SYND8_1_S4_POS (16U) +#define NFC_ECC_SYND8_1_S4 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND8_2 register */ +#define NFC_ECC_SYND8_2_S5_POS (0U) +#define NFC_ECC_SYND8_2_S5 (0x00001FFFUL) +#define NFC_ECC_SYND8_2_S6_POS (16U) +#define NFC_ECC_SYND8_2_S6 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND8_3 register */ +#define NFC_ECC_SYND8_3_S7_POS (0U) +#define NFC_ECC_SYND8_3_S7 (0x00001FFFUL) +#define NFC_ECC_SYND8_3_S8_POS (16U) +#define NFC_ECC_SYND8_3_S8 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND9_0 register */ +#define NFC_ECC_SYND9_0_S1_POS (0U) +#define NFC_ECC_SYND9_0_S1 (0x00001FFFUL) +#define NFC_ECC_SYND9_0_S2_POS (16U) +#define NFC_ECC_SYND9_0_S2 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND9_1 register */ +#define NFC_ECC_SYND9_1_S3_POS (0U) +#define NFC_ECC_SYND9_1_S3 (0x00001FFFUL) +#define NFC_ECC_SYND9_1_S4_POS (16U) +#define NFC_ECC_SYND9_1_S4 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND9_2 register */ +#define NFC_ECC_SYND9_2_S5_POS (0U) +#define NFC_ECC_SYND9_2_S5 (0x00001FFFUL) +#define NFC_ECC_SYND9_2_S6_POS (16U) +#define NFC_ECC_SYND9_2_S6 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND9_3 register */ +#define NFC_ECC_SYND9_3_S7_POS (0U) +#define NFC_ECC_SYND9_3_S7 (0x00001FFFUL) +#define NFC_ECC_SYND9_3_S8_POS (16U) +#define NFC_ECC_SYND9_3_S8 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND10_0 register */ +#define NFC_ECC_SYND10_0_S1_POS (0U) +#define NFC_ECC_SYND10_0_S1 (0x00001FFFUL) +#define NFC_ECC_SYND10_0_S2_POS (16U) +#define NFC_ECC_SYND10_0_S2 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND10_1 register */ +#define NFC_ECC_SYND10_1_S3_POS (0U) +#define NFC_ECC_SYND10_1_S3 (0x00001FFFUL) +#define NFC_ECC_SYND10_1_S4_POS (16U) +#define NFC_ECC_SYND10_1_S4 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND10_2 register */ +#define NFC_ECC_SYND10_2_S5_POS (0U) +#define NFC_ECC_SYND10_2_S5 (0x00001FFFUL) +#define NFC_ECC_SYND10_2_S6_POS (16U) +#define NFC_ECC_SYND10_2_S6 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND10_3 register */ +#define NFC_ECC_SYND10_3_S7_POS (0U) +#define NFC_ECC_SYND10_3_S7 (0x00001FFFUL) +#define NFC_ECC_SYND10_3_S8_POS (16U) +#define NFC_ECC_SYND10_3_S8 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND11_0 register */ +#define NFC_ECC_SYND11_0_S1_POS (0U) +#define NFC_ECC_SYND11_0_S1 (0x00001FFFUL) +#define NFC_ECC_SYND11_0_S2_POS (16U) +#define NFC_ECC_SYND11_0_S2 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND11_1 register */ +#define NFC_ECC_SYND11_1_S3_POS (0U) +#define NFC_ECC_SYND11_1_S3 (0x00001FFFUL) +#define NFC_ECC_SYND11_1_S4_POS (16U) +#define NFC_ECC_SYND11_1_S4 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND11_2 register */ +#define NFC_ECC_SYND11_2_S5_POS (0U) +#define NFC_ECC_SYND11_2_S5 (0x00001FFFUL) +#define NFC_ECC_SYND11_2_S6_POS (16U) +#define NFC_ECC_SYND11_2_S6 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND11_3 register */ +#define NFC_ECC_SYND11_3_S7_POS (0U) +#define NFC_ECC_SYND11_3_S7 (0x00001FFFUL) +#define NFC_ECC_SYND11_3_S8_POS (16U) +#define NFC_ECC_SYND11_3_S8 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND12_0 register */ +#define NFC_ECC_SYND12_0_S1_POS (0U) +#define NFC_ECC_SYND12_0_S1 (0x00001FFFUL) +#define NFC_ECC_SYND12_0_S2_POS (16U) +#define NFC_ECC_SYND12_0_S2 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND12_1 register */ +#define NFC_ECC_SYND12_1_S3_POS (0U) +#define NFC_ECC_SYND12_1_S3 (0x00001FFFUL) +#define NFC_ECC_SYND12_1_S4_POS (16U) +#define NFC_ECC_SYND12_1_S4 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND12_2 register */ +#define NFC_ECC_SYND12_2_S5_POS (0U) +#define NFC_ECC_SYND12_2_S5 (0x00001FFFUL) +#define NFC_ECC_SYND12_2_S6_POS (16U) +#define NFC_ECC_SYND12_2_S6 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND12_3 register */ +#define NFC_ECC_SYND12_3_S7_POS (0U) +#define NFC_ECC_SYND12_3_S7 (0x00001FFFUL) +#define NFC_ECC_SYND12_3_S8_POS (16U) +#define NFC_ECC_SYND12_3_S8 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND13_0 register */ +#define NFC_ECC_SYND13_0_S1_POS (0U) +#define NFC_ECC_SYND13_0_S1 (0x00001FFFUL) +#define NFC_ECC_SYND13_0_S2_POS (16U) +#define NFC_ECC_SYND13_0_S2 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND13_1 register */ +#define NFC_ECC_SYND13_1_S3_POS (0U) +#define NFC_ECC_SYND13_1_S3 (0x00001FFFUL) +#define NFC_ECC_SYND13_1_S4_POS (16U) +#define NFC_ECC_SYND13_1_S4 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND13_2 register */ +#define NFC_ECC_SYND13_2_S5_POS (0U) +#define NFC_ECC_SYND13_2_S5 (0x00001FFFUL) +#define NFC_ECC_SYND13_2_S6_POS (16U) +#define NFC_ECC_SYND13_2_S6 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND13_3 register */ +#define NFC_ECC_SYND13_3_S7_POS (0U) +#define NFC_ECC_SYND13_3_S7 (0x00001FFFUL) +#define NFC_ECC_SYND13_3_S8_POS (16U) +#define NFC_ECC_SYND13_3_S8 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND14_0 register */ +#define NFC_ECC_SYND14_0_S1_POS (0U) +#define NFC_ECC_SYND14_0_S1 (0x00001FFFUL) +#define NFC_ECC_SYND14_0_S2_POS (16U) +#define NFC_ECC_SYND14_0_S2 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND14_1 register */ +#define NFC_ECC_SYND14_1_S3_POS (0U) +#define NFC_ECC_SYND14_1_S3 (0x00001FFFUL) +#define NFC_ECC_SYND14_1_S4_POS (16U) +#define NFC_ECC_SYND14_1_S4 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND14_2 register */ +#define NFC_ECC_SYND14_2_S5_POS (0U) +#define NFC_ECC_SYND14_2_S5 (0x00001FFFUL) +#define NFC_ECC_SYND14_2_S6_POS (16U) +#define NFC_ECC_SYND14_2_S6 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND14_3 register */ +#define NFC_ECC_SYND14_3_S7_POS (0U) +#define NFC_ECC_SYND14_3_S7 (0x00001FFFUL) +#define NFC_ECC_SYND14_3_S8_POS (16U) +#define NFC_ECC_SYND14_3_S8 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND15_0 register */ +#define NFC_ECC_SYND15_0_S1_POS (0U) +#define NFC_ECC_SYND15_0_S1 (0x00001FFFUL) +#define NFC_ECC_SYND15_0_S2_POS (16U) +#define NFC_ECC_SYND15_0_S2 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND15_1 register */ +#define NFC_ECC_SYND15_1_S3_POS (0U) +#define NFC_ECC_SYND15_1_S3 (0x00001FFFUL) +#define NFC_ECC_SYND15_1_S4_POS (16U) +#define NFC_ECC_SYND15_1_S4 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND15_2 register */ +#define NFC_ECC_SYND15_2_S5_POS (0U) +#define NFC_ECC_SYND15_2_S5 (0x00001FFFUL) +#define NFC_ECC_SYND15_2_S6_POS (16U) +#define NFC_ECC_SYND15_2_S6 (0x1FFF0000UL) + +/* Bit definition for NFC_ECC_SYND15_3 register */ +#define NFC_ECC_SYND15_3_S7_POS (0U) +#define NFC_ECC_SYND15_3_S7 (0x00001FFFUL) +#define NFC_ECC_SYND15_3_S8_POS (16U) +#define NFC_ECC_SYND15_3_S8 (0x1FFF0000UL) + +/******************************************************************************* + Bit definition for Peripheral OTS +*******************************************************************************/ +/* Bit definition for OTS_CTL register */ +#define OTS_CTL_OTSST_POS (0U) +#define OTS_CTL_OTSST (0x0001U) +#define OTS_CTL_OTSCK_POS (1U) +#define OTS_CTL_OTSCK (0x0002U) +#define OTS_CTL_OTSIE_POS (2U) +#define OTS_CTL_OTSIE (0x0004U) +#define OTS_CTL_TSSTP_POS (3U) +#define OTS_CTL_TSSTP (0x0008U) + +/* Bit definition for OTS_DR1 register */ +#define OTS_DR1 (0xFFFFU) + +/* Bit definition for OTS_DR2 register */ +#define OTS_DR2 (0xFFFFU) + +/* Bit definition for OTS_ECR register */ +#define OTS_ECR (0xFFFFU) + +/* Bit definition for OTS_LPR register */ +#define OTS_LPR_TSOFS_POS (0U) +#define OTS_LPR_TSOFS (0x000000FFUL) +#define OTS_LPR_TSOFS_0 (0x00000001UL) +#define OTS_LPR_TSOFS_1 (0x00000002UL) +#define OTS_LPR_TSOFS_2 (0x00000004UL) +#define OTS_LPR_TSOFS_3 (0x00000008UL) +#define OTS_LPR_TSOFS_4 (0x00000010UL) +#define OTS_LPR_TSOFS_5 (0x00000020UL) +#define OTS_LPR_TSOFS_6 (0x00000040UL) +#define OTS_LPR_TSOFS_7 (0x00000080UL) +#define OTS_LPR_TSSLP_POS (8U) +#define OTS_LPR_TSSLP (0xFFFFFF00UL) +#define OTS_LPR_TSSLP_0 (0x00000100UL) +#define OTS_LPR_TSSLP_1 (0x00000200UL) +#define OTS_LPR_TSSLP_2 (0x00000400UL) +#define OTS_LPR_TSSLP_3 (0x00000800UL) +#define OTS_LPR_TSSLP_4 (0x00001000UL) +#define OTS_LPR_TSSLP_5 (0x00002000UL) +#define OTS_LPR_TSSLP_6 (0x00004000UL) +#define OTS_LPR_TSSLP_7 (0x00008000UL) +#define OTS_LPR_TSSLP_8 (0x00010000UL) +#define OTS_LPR_TSSLP_9 (0x00020000UL) +#define OTS_LPR_TSSLP_10 (0x00040000UL) +#define OTS_LPR_TSSLP_11 (0x00080000UL) +#define OTS_LPR_TSSLP_12 (0x00100000UL) +#define OTS_LPR_TSSLP_13 (0x00200000UL) +#define OTS_LPR_TSSLP_14 (0x00400000UL) +#define OTS_LPR_TSSLP_15 (0x00800000UL) +#define OTS_LPR_TSSLP_16 (0x01000000UL) +#define OTS_LPR_TSSLP_17 (0x02000000UL) +#define OTS_LPR_TSSLP_18 (0x04000000UL) +#define OTS_LPR_TSSLP_19 (0x08000000UL) +#define OTS_LPR_TSSLP_20 (0x10000000UL) +#define OTS_LPR_TSSLP_21 (0x20000000UL) +#define OTS_LPR_TSSLP_22 (0x40000000UL) +#define OTS_LPR_TSSLP_23 (0x80000000UL) + +/******************************************************************************* + Bit definition for Peripheral PERIC +*******************************************************************************/ +/* Bit definition for PERIC_USB_SYCTLREG register */ +#define PERIC_USB_SYCTLREG_USBFS_DFB_POS (0U) +#define PERIC_USB_SYCTLREG_USBFS_DFB (0x00000001UL) +#define PERIC_USB_SYCTLREG_USBFS_SOFEN_POS (1U) +#define PERIC_USB_SYCTLREG_USBFS_SOFEN (0x00000002UL) +#define PERIC_USB_SYCTLREG_USBHS_DFB_POS (8U) +#define PERIC_USB_SYCTLREG_USBHS_DFB (0x00000100UL) +#define PERIC_USB_SYCTLREG_USBHS_SOFEN_POS (9U) +#define PERIC_USB_SYCTLREG_USBHS_SOFEN (0x00000200UL) +#define PERIC_USB_SYCTLREG_USBHS_FSPHYE_POS (10U) +#define PERIC_USB_SYCTLREG_USBHS_FSPHYE (0x00000400UL) +#define PERIC_USB_SYCTLREG_USBFS_NFS_POS (16U) +#define PERIC_USB_SYCTLREG_USBFS_NFS (0x00030000UL) +#define PERIC_USB_SYCTLREG_USBFS_NFS_0 (0x00010000UL) +#define PERIC_USB_SYCTLREG_USBFS_NFS_1 (0x00020000UL) +#define PERIC_USB_SYCTLREG_USBFS_NFE_POS (18U) +#define PERIC_USB_SYCTLREG_USBFS_NFE (0x00040000UL) +#define PERIC_USB_SYCTLREG_USBHS_NFS_POS (24U) +#define PERIC_USB_SYCTLREG_USBHS_NFS (0x03000000UL) +#define PERIC_USB_SYCTLREG_USBHS_NFS_0 (0x01000000UL) +#define PERIC_USB_SYCTLREG_USBHS_NFS_1 (0x02000000UL) +#define PERIC_USB_SYCTLREG_USBHS_NFE_POS (26U) +#define PERIC_USB_SYCTLREG_USBHS_NFE (0x04000000UL) + +/* Bit definition for PERIC_SDIOC_SYCTLREG register */ +#define PERIC_SDIOC_SYCTLREG_SELMMC1_POS (1U) +#define PERIC_SDIOC_SYCTLREG_SELMMC1 (0x00000002UL) +#define PERIC_SDIOC_SYCTLREG_SELMMC2_POS (3U) +#define PERIC_SDIOC_SYCTLREG_SELMMC2 (0x00000008UL) + +/* Bit definition for PERIC_NFC_SYCTLREG register */ +#define PERIC_NFC_SYCTLREG_OPO (0x00000001UL) + +/* Bit definition for PERIC_EXMC_ENAR register */ +#define PERIC_EXMC_ENAR_DMCEN_POS (0U) +#define PERIC_EXMC_ENAR_DMCEN (0x00000001UL) +#define PERIC_EXMC_ENAR_SMCEN_POS (1U) +#define PERIC_EXMC_ENAR_SMCEN (0x00000002UL) +#define PERIC_EXMC_ENAR_NFCEN_POS (2U) +#define PERIC_EXMC_ENAR_NFCEN (0x00000004UL) + +/* Bit definition for PERIC_CAN_SYCTLREG register */ +#define PERIC_CAN_SYCTLREG_CAN1FDE_POS (0U) +#define PERIC_CAN_SYCTLREG_CAN1FDE (0x00000001UL) +#define PERIC_CAN_SYCTLREG_CAN2FDE_POS (1U) +#define PERIC_CAN_SYCTLREG_CAN2FDE (0x00000002UL) + +/* Bit definition for PERIC_USART1_NFC register */ +#define PERIC_USART1_NFC_NFS_POS (0U) +#define PERIC_USART1_NFC_NFS (0x00000003UL) +#define PERIC_USART1_NFC_NFS_0 (0x00000001UL) +#define PERIC_USART1_NFC_NFS_1 (0x00000002UL) +#define PERIC_USART1_NFC_NFE_POS (2U) +#define PERIC_USART1_NFC_NFE (0x00000004UL) + +/* Bit definition for PERIC_NFC_SYSTATREG register */ +#define PERIC_NFC_SYSTATREG_CHIPBUSY_POS (0U) +#define PERIC_NFC_SYSTATREG_CHIPBUSY (0x000000FFUL) +#define PERIC_NFC_SYSTATREG_CHIPBUSY_0 (0x00000001UL) +#define PERIC_NFC_SYSTATREG_CHIPBUSY_1 (0x00000002UL) +#define PERIC_NFC_SYSTATREG_CHIPBUSY_2 (0x00000004UL) +#define PERIC_NFC_SYSTATREG_CHIPBUSY_3 (0x00000008UL) +#define PERIC_NFC_SYSTATREG_CHIPBUSY_4 (0x00000010UL) +#define PERIC_NFC_SYSTATREG_CHIPBUSY_5 (0x00000020UL) +#define PERIC_NFC_SYSTATREG_CHIPBUSY_6 (0x00000040UL) +#define PERIC_NFC_SYSTATREG_CHIPBUSY_7 (0x00000080UL) +#define PERIC_NFC_SYSTATREG_PECC_POS (8U) +#define PERIC_NFC_SYSTATREG_PECC (0x00000100UL) + +/******************************************************************************* + Bit definition for Peripheral PWC +*******************************************************************************/ +/* Bit definition for PWC_FCG0 register */ +#define PWC_FCG0_SRAMH_POS (0U) +#define PWC_FCG0_SRAMH (0x00000001UL) +#define PWC_FCG0_SRAM1_POS (4U) +#define PWC_FCG0_SRAM1 (0x00000010UL) +#define PWC_FCG0_SRAM2_POS (5U) +#define PWC_FCG0_SRAM2 (0x00000020UL) +#define PWC_FCG0_SRAM3_POS (6U) +#define PWC_FCG0_SRAM3 (0x00000040UL) +#define PWC_FCG0_SRAM4_POS (7U) +#define PWC_FCG0_SRAM4 (0x00000080UL) +#define PWC_FCG0_SRAMB_POS (10U) +#define PWC_FCG0_SRAMB (0x00000400UL) +#define PWC_FCG0_KEY_POS (13U) +#define PWC_FCG0_KEY (0x00002000UL) +#define PWC_FCG0_DMA1_POS (14U) +#define PWC_FCG0_DMA1 (0x00004000UL) +#define PWC_FCG0_DMA2_POS (15U) +#define PWC_FCG0_DMA2 (0x00008000UL) +#define PWC_FCG0_FCM_POS (16U) +#define PWC_FCG0_FCM (0x00010000UL) +#define PWC_FCG0_AOS_POS (17U) +#define PWC_FCG0_AOS (0x00020000UL) +#define PWC_FCG0_CTC_POS (18U) +#define PWC_FCG0_CTC (0x00040000UL) +#define PWC_FCG0_CORDIC_POS (19U) +#define PWC_FCG0_CORDIC (0x00080000UL) +#define PWC_FCG0_AES_POS (20U) +#define PWC_FCG0_AES (0x00100000UL) +#define PWC_FCG0_HASH_POS (21U) +#define PWC_FCG0_HASH (0x00200000UL) +#define PWC_FCG0_TRNG_POS (22U) +#define PWC_FCG0_TRNG (0x00400000UL) +#define PWC_FCG0_CRC_POS (23U) +#define PWC_FCG0_CRC (0x00800000UL) +#define PWC_FCG0_DCU1_POS (24U) +#define PWC_FCG0_DCU1 (0x01000000UL) +#define PWC_FCG0_DCU2_POS (25U) +#define PWC_FCG0_DCU2 (0x02000000UL) +#define PWC_FCG0_DCU3_POS (26U) +#define PWC_FCG0_DCU3 (0x04000000UL) +#define PWC_FCG0_DCU4_POS (27U) +#define PWC_FCG0_DCU4 (0x08000000UL) +#define PWC_FCG0_DCU5_POS (28U) +#define PWC_FCG0_DCU5 (0x10000000UL) +#define PWC_FCG0_DCU6_POS (29U) +#define PWC_FCG0_DCU6 (0x20000000UL) +#define PWC_FCG0_DCU7_POS (30U) +#define PWC_FCG0_DCU7 (0x40000000UL) +#define PWC_FCG0_DCU8_POS (31U) +#define PWC_FCG0_DCU8 (0x80000000UL) + +/* Bit definition for PWC_FCG1 register */ +#define PWC_FCG1_CAN1_POS (0U) +#define PWC_FCG1_CAN1 (0x00000001UL) +#define PWC_FCG1_CAN2_POS (1U) +#define PWC_FCG1_CAN2 (0x00000002UL) +#define PWC_FCG1_ETHER_POS (2U) +#define PWC_FCG1_ETHER (0x00000004UL) +#define PWC_FCG1_QSPI_POS (3U) +#define PWC_FCG1_QSPI (0x00000008UL) +#define PWC_FCG1_IIC1_POS (4U) +#define PWC_FCG1_IIC1 (0x00000010UL) +#define PWC_FCG1_IIC2_POS (5U) +#define PWC_FCG1_IIC2 (0x00000020UL) +#define PWC_FCG1_IIC3_POS (6U) +#define PWC_FCG1_IIC3 (0x00000040UL) +#define PWC_FCG1_IIC4_POS (7U) +#define PWC_FCG1_IIC4 (0x00000080UL) +#define PWC_FCG1_IIC5_POS (8U) +#define PWC_FCG1_IIC5 (0x00000100UL) +#define PWC_FCG1_IIC6_POS (9U) +#define PWC_FCG1_IIC6 (0x00000200UL) +#define PWC_FCG1_SDIOC1_POS (10U) +#define PWC_FCG1_SDIOC1 (0x00000400UL) +#define PWC_FCG1_SDIOC2_POS (11U) +#define PWC_FCG1_SDIOC2 (0x00000800UL) +#define PWC_FCG1_I2S1_POS (12U) +#define PWC_FCG1_I2S1 (0x00001000UL) +#define PWC_FCG1_I2S2_POS (13U) +#define PWC_FCG1_I2S2 (0x00002000UL) +#define PWC_FCG1_I2S3_POS (14U) +#define PWC_FCG1_I2S3 (0x00004000UL) +#define PWC_FCG1_I2S4_POS (15U) +#define PWC_FCG1_I2S4 (0x00008000UL) +#define PWC_FCG1_SPI1_POS (16U) +#define PWC_FCG1_SPI1 (0x00010000UL) +#define PWC_FCG1_SPI2_POS (17U) +#define PWC_FCG1_SPI2 (0x00020000UL) +#define PWC_FCG1_SPI3_POS (18U) +#define PWC_FCG1_SPI3 (0x00040000UL) +#define PWC_FCG1_SPI4_POS (19U) +#define PWC_FCG1_SPI4 (0x00080000UL) +#define PWC_FCG1_SPI5_POS (20U) +#define PWC_FCG1_SPI5 (0x00100000UL) +#define PWC_FCG1_SPI6_POS (21U) +#define PWC_FCG1_SPI6 (0x00200000UL) +#define PWC_FCG1_USBFS_POS (22U) +#define PWC_FCG1_USBFS (0x00400000UL) +#define PWC_FCG1_USBHS_POS (23U) +#define PWC_FCG1_USBHS (0x00800000UL) +#define PWC_FCG1_FMAC1_POS (24U) +#define PWC_FCG1_FMAC1 (0x01000000UL) +#define PWC_FCG1_FMAC2_POS (25U) +#define PWC_FCG1_FMAC2 (0x02000000UL) +#define PWC_FCG1_FMAC3_POS (26U) +#define PWC_FCG1_FMAC3 (0x04000000UL) +#define PWC_FCG1_FMAC4_POS (27U) +#define PWC_FCG1_FMAC4 (0x08000000UL) + +/* Bit definition for PWC_FCG2 register */ +#define PWC_FCG2_TMR6_1_POS (0U) +#define PWC_FCG2_TMR6_1 (0x00000001UL) +#define PWC_FCG2_TMR6_2_POS (1U) +#define PWC_FCG2_TMR6_2 (0x00000002UL) +#define PWC_FCG2_TMR6_3_POS (2U) +#define PWC_FCG2_TMR6_3 (0x00000004UL) +#define PWC_FCG2_TMR6_4_POS (3U) +#define PWC_FCG2_TMR6_4 (0x00000008UL) +#define PWC_FCG2_TMR6_5_POS (4U) +#define PWC_FCG2_TMR6_5 (0x00000010UL) +#define PWC_FCG2_TMR6_6_POS (5U) +#define PWC_FCG2_TMR6_6 (0x00000020UL) +#define PWC_FCG2_TMR6_7_POS (6U) +#define PWC_FCG2_TMR6_7 (0x00000040UL) +#define PWC_FCG2_TMR6_8_POS (7U) +#define PWC_FCG2_TMR6_8 (0x00000080UL) +#define PWC_FCG2_TMR4_1_POS (8U) +#define PWC_FCG2_TMR4_1 (0x00000100UL) +#define PWC_FCG2_TMR4_2_POS (9U) +#define PWC_FCG2_TMR4_2 (0x00000200UL) +#define PWC_FCG2_TMR4_3_POS (10U) +#define PWC_FCG2_TMR4_3 (0x00000400UL) +#define PWC_FCG2_HRPWM_POS (11U) +#define PWC_FCG2_HRPWM (0x00000800UL) +#define PWC_FCG2_TMR0_1_POS (12U) +#define PWC_FCG2_TMR0_1 (0x00001000UL) +#define PWC_FCG2_TMR0_2_POS (13U) +#define PWC_FCG2_TMR0_2 (0x00002000UL) +#define PWC_FCG2_EMB_POS (15U) +#define PWC_FCG2_EMB (0x00008000UL) +#define PWC_FCG2_TMR2_1_POS (16U) +#define PWC_FCG2_TMR2_1 (0x00010000UL) +#define PWC_FCG2_TMR2_2_POS (17U) +#define PWC_FCG2_TMR2_2 (0x00020000UL) +#define PWC_FCG2_TMR2_3_POS (18U) +#define PWC_FCG2_TMR2_3 (0x00040000UL) +#define PWC_FCG2_TMR2_4_POS (19U) +#define PWC_FCG2_TMR2_4 (0x00080000UL) +#define PWC_FCG2_TMRA_1_POS (20U) +#define PWC_FCG2_TMRA_1 (0x00100000UL) +#define PWC_FCG2_TMRA_2_POS (21U) +#define PWC_FCG2_TMRA_2 (0x00200000UL) +#define PWC_FCG2_TMRA_3_POS (22U) +#define PWC_FCG2_TMRA_3 (0x00400000UL) +#define PWC_FCG2_TMRA_4_POS (23U) +#define PWC_FCG2_TMRA_4 (0x00800000UL) +#define PWC_FCG2_TMRA_5_POS (24U) +#define PWC_FCG2_TMRA_5 (0x01000000UL) +#define PWC_FCG2_TMRA_6_POS (25U) +#define PWC_FCG2_TMRA_6 (0x02000000UL) +#define PWC_FCG2_TMRA_7_POS (26U) +#define PWC_FCG2_TMRA_7 (0x04000000UL) +#define PWC_FCG2_TMRA_8_POS (27U) +#define PWC_FCG2_TMRA_8 (0x08000000UL) +#define PWC_FCG2_TMRA_9_POS (28U) +#define PWC_FCG2_TMRA_9 (0x10000000UL) +#define PWC_FCG2_TMRA_10_POS (29U) +#define PWC_FCG2_TMRA_10 (0x20000000UL) +#define PWC_FCG2_TMRA_11_POS (30U) +#define PWC_FCG2_TMRA_11 (0x40000000UL) +#define PWC_FCG2_TMRA_12_POS (31U) +#define PWC_FCG2_TMRA_12 (0x80000000UL) + +/* Bit definition for PWC_FCG3 register */ +#define PWC_FCG3_ADC1_POS (0U) +#define PWC_FCG3_ADC1 (0x00000001UL) +#define PWC_FCG3_ADC2_POS (1U) +#define PWC_FCG3_ADC2 (0x00000002UL) +#define PWC_FCG3_ADC3_POS (2U) +#define PWC_FCG3_ADC3 (0x00000004UL) +#define PWC_FCG3_CMBIAS_POS (3U) +#define PWC_FCG3_CMBIAS (0x00000008UL) +#define PWC_FCG3_DAC1_POS (4U) +#define PWC_FCG3_DAC1 (0x00000010UL) +#define PWC_FCG3_DAC2_POS (5U) +#define PWC_FCG3_DAC2 (0x00000020UL) +#define PWC_FCG3_CMP1_POS (8U) +#define PWC_FCG3_CMP1 (0x00000100UL) +#define PWC_FCG3_CMP2_POS (9U) +#define PWC_FCG3_CMP2 (0x00000200UL) +#define PWC_FCG3_OTS_POS (12U) +#define PWC_FCG3_OTS (0x00001000UL) +#define PWC_FCG3_DVP_POS (15U) +#define PWC_FCG3_DVP (0x00008000UL) +#define PWC_FCG3_SMC_POS (16U) +#define PWC_FCG3_SMC (0x00010000UL) +#define PWC_FCG3_DMC_POS (17U) +#define PWC_FCG3_DMC (0x00020000UL) +#define PWC_FCG3_NFC_POS (18U) +#define PWC_FCG3_NFC (0x00040000UL) +#define PWC_FCG3_USART1_POS (20U) +#define PWC_FCG3_USART1 (0x00100000UL) +#define PWC_FCG3_USART2_POS (21U) +#define PWC_FCG3_USART2 (0x00200000UL) +#define PWC_FCG3_USART3_POS (22U) +#define PWC_FCG3_USART3 (0x00400000UL) +#define PWC_FCG3_USART4_POS (23U) +#define PWC_FCG3_USART4 (0x00800000UL) +#define PWC_FCG3_USART5_POS (24U) +#define PWC_FCG3_USART5 (0x01000000UL) +#define PWC_FCG3_USART6_POS (25U) +#define PWC_FCG3_USART6 (0x02000000UL) +#define PWC_FCG3_USART7_POS (26U) +#define PWC_FCG3_USART7 (0x04000000UL) +#define PWC_FCG3_USART8_POS (27U) +#define PWC_FCG3_USART8 (0x08000000UL) +#define PWC_FCG3_USART9_POS (28U) +#define PWC_FCG3_USART9 (0x10000000UL) +#define PWC_FCG3_USART10_POS (29U) +#define PWC_FCG3_USART10 (0x20000000UL) + +/* Bit definition for PWC_FCG0PC register */ +#define PWC_FCG0PC_PRT0_POS (0U) +#define PWC_FCG0PC_PRT0 (0x00000001UL) +#define PWC_FCG0PC_FCG0PCWE_POS (16U) +#define PWC_FCG0PC_FCG0PCWE (0xFFFF0000UL) + +/* Bit definition for PWC_VBATRSTR register */ +#define PWC_VBATRSTR (0xFFU) + +/* Bit definition for PWC_VBATCR register */ +#define PWC_VBATCR_VBTRSD_POS (0U) +#define PWC_VBATCR_VBTRSD (0x01U) +#define PWC_VBATCR_RAMVALID_POS (1U) +#define PWC_VBATCR_RAMVALID (0x02U) +#define PWC_VBATCR_RAMPDF_POS (2U) +#define PWC_VBATCR_RAMPDF (0x04U) +#define PWC_VBATCR_VBATDIVMONE_POS (3U) +#define PWC_VBATCR_VBATDIVMONE (0x08U) +#define PWC_VBATCR_CSDIS_POS (7U) +#define PWC_VBATCR_CSDIS (0x80U) + +/* Bit definition for PWC_WKTC0 register */ +#define PWC_WKTC0_WKTMCMP (0xFFU) + +/* Bit definition for PWC_WKTC1 register */ +#define PWC_WKTC1_WKTMCMP (0x0FU) + +/* Bit definition for PWC_WKTC2 register */ +#define PWC_WKTC2_WKOVF_POS (4U) +#define PWC_WKTC2_WKOVF (0x10U) +#define PWC_WKTC2_WKCKS_POS (5U) +#define PWC_WKTC2_WKCKS (0x60U) +#define PWC_WKTC2_WKCKS_0 (0x20U) +#define PWC_WKTC2_WKCKS_1 (0x40U) +#define PWC_WKTC2_WKTCE_POS (7U) +#define PWC_WKTC2_WKTCE (0x80U) + +/* Bit definition for PWC_BKR0 register */ +#define PWC_BKR0 (0xFFU) + +/* Bit definition for PWC_BKR1 register */ +#define PWC_BKR1 (0xFFU) + +/* Bit definition for PWC_BKR2 register */ +#define PWC_BKR2 (0xFFU) + +/* Bit definition for PWC_BKR3 register */ +#define PWC_BKR3 (0xFFU) + +/* Bit definition for PWC_BKR4 register */ +#define PWC_BKR4 (0xFFU) + +/* Bit definition for PWC_BKR5 register */ +#define PWC_BKR5 (0xFFU) + +/* Bit definition for PWC_BKR6 register */ +#define PWC_BKR6 (0xFFU) + +/* Bit definition for PWC_BKR7 register */ +#define PWC_BKR7 (0xFFU) + +/* Bit definition for PWC_BKR8 register */ +#define PWC_BKR8 (0xFFU) + +/* Bit definition for PWC_BKR9 register */ +#define PWC_BKR9 (0xFFU) + +/* Bit definition for PWC_BKR10 register */ +#define PWC_BKR10 (0xFFU) + +/* Bit definition for PWC_BKR11 register */ +#define PWC_BKR11 (0xFFU) + +/* Bit definition for PWC_BKR12 register */ +#define PWC_BKR12 (0xFFU) + +/* Bit definition for PWC_BKR13 register */ +#define PWC_BKR13 (0xFFU) + +/* Bit definition for PWC_BKR14 register */ +#define PWC_BKR14 (0xFFU) + +/* Bit definition for PWC_BKR15 register */ +#define PWC_BKR15 (0xFFU) + +/* Bit definition for PWC_BKR16 register */ +#define PWC_BKR16 (0xFFU) + +/* Bit definition for PWC_BKR17 register */ +#define PWC_BKR17 (0xFFU) + +/* Bit definition for PWC_BKR18 register */ +#define PWC_BKR18 (0xFFU) + +/* Bit definition for PWC_BKR19 register */ +#define PWC_BKR19 (0xFFU) + +/* Bit definition for PWC_BKR20 register */ +#define PWC_BKR20 (0xFFU) + +/* Bit definition for PWC_BKR21 register */ +#define PWC_BKR21 (0xFFU) + +/* Bit definition for PWC_BKR22 register */ +#define PWC_BKR22 (0xFFU) + +/* Bit definition for PWC_BKR23 register */ +#define PWC_BKR23 (0xFFU) + +/* Bit definition for PWC_BKR24 register */ +#define PWC_BKR24 (0xFFU) + +/* Bit definition for PWC_BKR25 register */ +#define PWC_BKR25 (0xFFU) + +/* Bit definition for PWC_BKR26 register */ +#define PWC_BKR26 (0xFFU) + +/* Bit definition for PWC_BKR27 register */ +#define PWC_BKR27 (0xFFU) + +/* Bit definition for PWC_BKR28 register */ +#define PWC_BKR28 (0xFFU) + +/* Bit definition for PWC_BKR29 register */ +#define PWC_BKR29 (0xFFU) + +/* Bit definition for PWC_BKR30 register */ +#define PWC_BKR30 (0xFFU) + +/* Bit definition for PWC_BKR31 register */ +#define PWC_BKR31 (0xFFU) + +/* Bit definition for PWC_BKR32 register */ +#define PWC_BKR32 (0xFFU) + +/* Bit definition for PWC_BKR33 register */ +#define PWC_BKR33 (0xFFU) + +/* Bit definition for PWC_BKR34 register */ +#define PWC_BKR34 (0xFFU) + +/* Bit definition for PWC_BKR35 register */ +#define PWC_BKR35 (0xFFU) + +/* Bit definition for PWC_BKR36 register */ +#define PWC_BKR36 (0xFFU) + +/* Bit definition for PWC_BKR37 register */ +#define PWC_BKR37 (0xFFU) + +/* Bit definition for PWC_BKR38 register */ +#define PWC_BKR38 (0xFFU) + +/* Bit definition for PWC_BKR39 register */ +#define PWC_BKR39 (0xFFU) + +/* Bit definition for PWC_BKR40 register */ +#define PWC_BKR40 (0xFFU) + +/* Bit definition for PWC_BKR41 register */ +#define PWC_BKR41 (0xFFU) + +/* Bit definition for PWC_BKR42 register */ +#define PWC_BKR42 (0xFFU) + +/* Bit definition for PWC_BKR43 register */ +#define PWC_BKR43 (0xFFU) + +/* Bit definition for PWC_BKR44 register */ +#define PWC_BKR44 (0xFFU) + +/* Bit definition for PWC_BKR45 register */ +#define PWC_BKR45 (0xFFU) + +/* Bit definition for PWC_BKR46 register */ +#define PWC_BKR46 (0xFFU) + +/* Bit definition for PWC_BKR47 register */ +#define PWC_BKR47 (0xFFU) + +/* Bit definition for PWC_BKR48 register */ +#define PWC_BKR48 (0xFFU) + +/* Bit definition for PWC_BKR49 register */ +#define PWC_BKR49 (0xFFU) + +/* Bit definition for PWC_BKR50 register */ +#define PWC_BKR50 (0xFFU) + +/* Bit definition for PWC_BKR51 register */ +#define PWC_BKR51 (0xFFU) + +/* Bit definition for PWC_BKR52 register */ +#define PWC_BKR52 (0xFFU) + +/* Bit definition for PWC_BKR53 register */ +#define PWC_BKR53 (0xFFU) + +/* Bit definition for PWC_BKR54 register */ +#define PWC_BKR54 (0xFFU) + +/* Bit definition for PWC_BKR55 register */ +#define PWC_BKR55 (0xFFU) + +/* Bit definition for PWC_BKR56 register */ +#define PWC_BKR56 (0xFFU) + +/* Bit definition for PWC_BKR57 register */ +#define PWC_BKR57 (0xFFU) + +/* Bit definition for PWC_BKR58 register */ +#define PWC_BKR58 (0xFFU) + +/* Bit definition for PWC_BKR59 register */ +#define PWC_BKR59 (0xFFU) + +/* Bit definition for PWC_BKR60 register */ +#define PWC_BKR60 (0xFFU) + +/* Bit definition for PWC_BKR61 register */ +#define PWC_BKR61 (0xFFU) + +/* Bit definition for PWC_BKR62 register */ +#define PWC_BKR62 (0xFFU) + +/* Bit definition for PWC_BKR63 register */ +#define PWC_BKR63 (0xFFU) + +/* Bit definition for PWC_BKR64 register */ +#define PWC_BKR64 (0xFFU) + +/* Bit definition for PWC_BKR65 register */ +#define PWC_BKR65 (0xFFU) + +/* Bit definition for PWC_BKR66 register */ +#define PWC_BKR66 (0xFFU) + +/* Bit definition for PWC_BKR67 register */ +#define PWC_BKR67 (0xFFU) + +/* Bit definition for PWC_BKR68 register */ +#define PWC_BKR68 (0xFFU) + +/* Bit definition for PWC_BKR69 register */ +#define PWC_BKR69 (0xFFU) + +/* Bit definition for PWC_BKR70 register */ +#define PWC_BKR70 (0xFFU) + +/* Bit definition for PWC_BKR71 register */ +#define PWC_BKR71 (0xFFU) + +/* Bit definition for PWC_BKR72 register */ +#define PWC_BKR72 (0xFFU) + +/* Bit definition for PWC_BKR73 register */ +#define PWC_BKR73 (0xFFU) + +/* Bit definition for PWC_BKR74 register */ +#define PWC_BKR74 (0xFFU) + +/* Bit definition for PWC_BKR75 register */ +#define PWC_BKR75 (0xFFU) + +/* Bit definition for PWC_BKR76 register */ +#define PWC_BKR76 (0xFFU) + +/* Bit definition for PWC_BKR77 register */ +#define PWC_BKR77 (0xFFU) + +/* Bit definition for PWC_BKR78 register */ +#define PWC_BKR78 (0xFFU) + +/* Bit definition for PWC_BKR79 register */ +#define PWC_BKR79 (0xFFU) + +/* Bit definition for PWC_BKR80 register */ +#define PWC_BKR80 (0xFFU) + +/* Bit definition for PWC_BKR81 register */ +#define PWC_BKR81 (0xFFU) + +/* Bit definition for PWC_BKR82 register */ +#define PWC_BKR82 (0xFFU) + +/* Bit definition for PWC_BKR83 register */ +#define PWC_BKR83 (0xFFU) + +/* Bit definition for PWC_BKR84 register */ +#define PWC_BKR84 (0xFFU) + +/* Bit definition for PWC_BKR85 register */ +#define PWC_BKR85 (0xFFU) + +/* Bit definition for PWC_BKR86 register */ +#define PWC_BKR86 (0xFFU) + +/* Bit definition for PWC_BKR87 register */ +#define PWC_BKR87 (0xFFU) + +/* Bit definition for PWC_BKR88 register */ +#define PWC_BKR88 (0xFFU) + +/* Bit definition for PWC_BKR89 register */ +#define PWC_BKR89 (0xFFU) + +/* Bit definition for PWC_BKR90 register */ +#define PWC_BKR90 (0xFFU) + +/* Bit definition for PWC_BKR91 register */ +#define PWC_BKR91 (0xFFU) + +/* Bit definition for PWC_BKR92 register */ +#define PWC_BKR92 (0xFFU) + +/* Bit definition for PWC_BKR93 register */ +#define PWC_BKR93 (0xFFU) + +/* Bit definition for PWC_BKR94 register */ +#define PWC_BKR94 (0xFFU) + +/* Bit definition for PWC_BKR95 register */ +#define PWC_BKR95 (0xFFU) + +/* Bit definition for PWC_BKR96 register */ +#define PWC_BKR96 (0xFFU) + +/* Bit definition for PWC_BKR97 register */ +#define PWC_BKR97 (0xFFU) + +/* Bit definition for PWC_BKR98 register */ +#define PWC_BKR98 (0xFFU) + +/* Bit definition for PWC_BKR99 register */ +#define PWC_BKR99 (0xFFU) + +/* Bit definition for PWC_BKR100 register */ +#define PWC_BKR100 (0xFFU) + +/* Bit definition for PWC_BKR101 register */ +#define PWC_BKR101 (0xFFU) + +/* Bit definition for PWC_BKR102 register */ +#define PWC_BKR102 (0xFFU) + +/* Bit definition for PWC_BKR103 register */ +#define PWC_BKR103 (0xFFU) + +/* Bit definition for PWC_BKR104 register */ +#define PWC_BKR104 (0xFFU) + +/* Bit definition for PWC_BKR105 register */ +#define PWC_BKR105 (0xFFU) + +/* Bit definition for PWC_BKR106 register */ +#define PWC_BKR106 (0xFFU) + +/* Bit definition for PWC_BKR107 register */ +#define PWC_BKR107 (0xFFU) + +/* Bit definition for PWC_BKR108 register */ +#define PWC_BKR108 (0xFFU) + +/* Bit definition for PWC_BKR109 register */ +#define PWC_BKR109 (0xFFU) + +/* Bit definition for PWC_BKR110 register */ +#define PWC_BKR110 (0xFFU) + +/* Bit definition for PWC_BKR111 register */ +#define PWC_BKR111 (0xFFU) + +/* Bit definition for PWC_BKR112 register */ +#define PWC_BKR112 (0xFFU) + +/* Bit definition for PWC_BKR113 register */ +#define PWC_BKR113 (0xFFU) + +/* Bit definition for PWC_BKR114 register */ +#define PWC_BKR114 (0xFFU) + +/* Bit definition for PWC_BKR115 register */ +#define PWC_BKR115 (0xFFU) + +/* Bit definition for PWC_BKR116 register */ +#define PWC_BKR116 (0xFFU) + +/* Bit definition for PWC_BKR117 register */ +#define PWC_BKR117 (0xFFU) + +/* Bit definition for PWC_BKR118 register */ +#define PWC_BKR118 (0xFFU) + +/* Bit definition for PWC_BKR119 register */ +#define PWC_BKR119 (0xFFU) + +/* Bit definition for PWC_BKR120 register */ +#define PWC_BKR120 (0xFFU) + +/* Bit definition for PWC_BKR121 register */ +#define PWC_BKR121 (0xFFU) + +/* Bit definition for PWC_BKR122 register */ +#define PWC_BKR122 (0xFFU) + +/* Bit definition for PWC_BKR123 register */ +#define PWC_BKR123 (0xFFU) + +/* Bit definition for PWC_BKR124 register */ +#define PWC_BKR124 (0xFFU) + +/* Bit definition for PWC_BKR125 register */ +#define PWC_BKR125 (0xFFU) + +/* Bit definition for PWC_BKR126 register */ +#define PWC_BKR126 (0xFFU) + +/* Bit definition for PWC_BKR127 register */ +#define PWC_BKR127 (0xFFU) + +/* Bit definition for PWC_PWRC0 register */ +#define PWC_PWRC0_PDMDS_POS (0U) +#define PWC_PWRC0_PDMDS (0x03U) +#define PWC_PWRC0_PDMDS_0 (0x01U) +#define PWC_PWRC0_PDMDS_1 (0x02U) +#define PWC_PWRC0_IORTN_POS (4U) +#define PWC_PWRC0_IORTN (0x30U) +#define PWC_PWRC0_IORTN_0 (0x10U) +#define PWC_PWRC0_IORTN_1 (0x20U) +#define PWC_PWRC0_PWDN_POS (7U) +#define PWC_PWRC0_PWDN (0x80U) + +/* Bit definition for PWC_PWRC1 register */ +#define PWC_PWRC1_VPLLSD_POS (0U) +#define PWC_PWRC1_VPLLSD (0x03U) +#define PWC_PWRC1_VPLLSD_0 (0x01U) +#define PWC_PWRC1_VPLLSD_1 (0x02U) +#define PWC_PWRC1_VHRCSD_POS (2U) +#define PWC_PWRC1_VHRCSD (0x04U) +#define PWC_PWRC1_PDTS_POS (3U) +#define PWC_PWRC1_PDTS (0x08U) +#define PWC_PWRC1_STPDAS_POS (6U) +#define PWC_PWRC1_STPDAS (0xC0U) +#define PWC_PWRC1_STPDAS_0 (0x40U) +#define PWC_PWRC1_STPDAS_1 (0x80U) + +/* Bit definition for PWC_PWRC2 register */ +#define PWC_PWRC2_DDAS_POS (0U) +#define PWC_PWRC2_DDAS (0x0FU) +#define PWC_PWRC2_DVS_POS (4U) +#define PWC_PWRC2_DVS (0x30U) +#define PWC_PWRC2_DVS_0 (0x10U) +#define PWC_PWRC2_DVS_1 (0x20U) + +/* Bit definition for PWC_PWRC3 register */ +#define PWC_PWRC3_DDAS (0xFFU) + +/* Bit definition for PWC_PWRC4 register */ +#define PWC_PWRC4_VBATREFSEL_POS (0U) +#define PWC_PWRC4_VBATREFSEL (0x01U) +#define PWC_PWRC4_VBATME_POS (1U) +#define PWC_PWRC4_VBATME (0x02U) +#define PWC_PWRC4_VBATMON_POS (4U) +#define PWC_PWRC4_VBATMON (0x10U) +#define PWC_PWRC4_ADBUFS_POS (6U) +#define PWC_PWRC4_ADBUFS (0x40U) +#define PWC_PWRC4_ADBUFE_POS (7U) +#define PWC_PWRC4_ADBUFE (0x80U) + +/* Bit definition for PWC_PVDCR0 register */ +#define PWC_PVDCR0_EXVCCINEN_POS (0U) +#define PWC_PVDCR0_EXVCCINEN (0x01U) +#define PWC_PVDCR0_PVD1EN_POS (5U) +#define PWC_PVDCR0_PVD1EN (0x20U) +#define PWC_PVDCR0_PVD2EN_POS (6U) +#define PWC_PVDCR0_PVD2EN (0x40U) + +/* Bit definition for PWC_PVDCR1 register */ +#define PWC_PVDCR1_PVD1IRE_POS (0U) +#define PWC_PVDCR1_PVD1IRE (0x01U) +#define PWC_PVDCR1_PVD1IRS_POS (1U) +#define PWC_PVDCR1_PVD1IRS (0x02U) +#define PWC_PVDCR1_PVD1CMPOE_POS (2U) +#define PWC_PVDCR1_PVD1CMPOE (0x04U) +#define PWC_PVDCR1_PVD2IRE_POS (4U) +#define PWC_PVDCR1_PVD2IRE (0x10U) +#define PWC_PVDCR1_PVD2IRS_POS (5U) +#define PWC_PVDCR1_PVD2IRS (0x20U) +#define PWC_PVDCR1_PVD2CMPOE_POS (6U) +#define PWC_PVDCR1_PVD2CMPOE (0x40U) + +/* Bit definition for PWC_PVDFCR register */ +#define PWC_PVDFCR_PVD1NFDIS_POS (0U) +#define PWC_PVDFCR_PVD1NFDIS (0x01U) +#define PWC_PVDFCR_PVD1NFCKS_POS (1U) +#define PWC_PVDFCR_PVD1NFCKS (0x06U) +#define PWC_PVDFCR_PVD1NFCKS_0 (0x02U) +#define PWC_PVDFCR_PVD1NFCKS_1 (0x04U) +#define PWC_PVDFCR_PVD2NFDIS_POS (4U) +#define PWC_PVDFCR_PVD2NFDIS (0x10U) +#define PWC_PVDFCR_PVD2NFCKS_POS (5U) +#define PWC_PVDFCR_PVD2NFCKS (0x60U) +#define PWC_PVDFCR_PVD2NFCKS_0 (0x20U) +#define PWC_PVDFCR_PVD2NFCKS_1 (0x40U) + +/* Bit definition for PWC_PVDLCR register */ +#define PWC_PVDLCR_PVD1LVL_POS (0U) +#define PWC_PVDLCR_PVD1LVL (0x07U) +#define PWC_PVDLCR_PVD1LVL_0 (0x01U) +#define PWC_PVDLCR_PVD1LVL_1 (0x02U) +#define PWC_PVDLCR_PVD1LVL_2 (0x04U) +#define PWC_PVDLCR_PVD2LVL_POS (4U) +#define PWC_PVDLCR_PVD2LVL (0x70U) +#define PWC_PVDLCR_PVD2LVL_0 (0x10U) +#define PWC_PVDLCR_PVD2LVL_1 (0x20U) +#define PWC_PVDLCR_PVD2LVL_2 (0x40U) + +/* Bit definition for PWC_PDWKE0 register */ +#define PWC_PDWKE0_WKE0_0_POS (0U) +#define PWC_PDWKE0_WKE0_0 (0x01U) +#define PWC_PDWKE0_WKE0_1_POS (1U) +#define PWC_PDWKE0_WKE0_1 (0x02U) +#define PWC_PDWKE0_WKE0_2_POS (2U) +#define PWC_PDWKE0_WKE0_2 (0x04U) +#define PWC_PDWKE0_WKE0_3_POS (3U) +#define PWC_PDWKE0_WKE0_3 (0x08U) +#define PWC_PDWKE0_WKE1_0_POS (4U) +#define PWC_PDWKE0_WKE1_0 (0x10U) +#define PWC_PDWKE0_WKE1_1_POS (5U) +#define PWC_PDWKE0_WKE1_1 (0x20U) +#define PWC_PDWKE0_WKE1_2_POS (6U) +#define PWC_PDWKE0_WKE1_2 (0x40U) +#define PWC_PDWKE0_WKE1_3_POS (7U) +#define PWC_PDWKE0_WKE1_3 (0x80U) + +/* Bit definition for PWC_PDWKE1 register */ +#define PWC_PDWKE1_WKE2_0_POS (0U) +#define PWC_PDWKE1_WKE2_0 (0x01U) +#define PWC_PDWKE1_WKE2_1_POS (1U) +#define PWC_PDWKE1_WKE2_1 (0x02U) +#define PWC_PDWKE1_WKE2_2_POS (2U) +#define PWC_PDWKE1_WKE2_2 (0x04U) +#define PWC_PDWKE1_WKE2_3_POS (3U) +#define PWC_PDWKE1_WKE2_3 (0x08U) +#define PWC_PDWKE1_WKE3_0_POS (4U) +#define PWC_PDWKE1_WKE3_0 (0x10U) +#define PWC_PDWKE1_WKE3_1_POS (5U) +#define PWC_PDWKE1_WKE3_1 (0x20U) +#define PWC_PDWKE1_WKE3_2_POS (6U) +#define PWC_PDWKE1_WKE3_2 (0x40U) +#define PWC_PDWKE1_WKE3_3_POS (7U) +#define PWC_PDWKE1_WKE3_3 (0x80U) + +/* Bit definition for PWC_PDWKE2 register */ +#define PWC_PDWKE2_VD1WKE_POS (0U) +#define PWC_PDWKE2_VD1WKE (0x01U) +#define PWC_PDWKE2_VD2WKE_POS (1U) +#define PWC_PDWKE2_VD2WKE (0x02U) +#define PWC_PDWKE2_RTCPRDWKE_POS (4U) +#define PWC_PDWKE2_RTCPRDWKE (0x10U) +#define PWC_PDWKE2_RTCALMWKE_POS (5U) +#define PWC_PDWKE2_RTCALMWKE (0x20U) +#define PWC_PDWKE2_XTAL32ERWKE_POS (6U) +#define PWC_PDWKE2_XTAL32ERWKE (0x40U) +#define PWC_PDWKE2_WKTMWKE_POS (7U) +#define PWC_PDWKE2_WKTMWKE (0x80U) + +/* Bit definition for PWC_PDWKES register */ +#define PWC_PDWKES_WK0EGS_POS (0U) +#define PWC_PDWKES_WK0EGS (0x01U) +#define PWC_PDWKES_WK1EGS_POS (1U) +#define PWC_PDWKES_WK1EGS (0x02U) +#define PWC_PDWKES_WK2EGS_POS (2U) +#define PWC_PDWKES_WK2EGS (0x04U) +#define PWC_PDWKES_WK3EGS_POS (3U) +#define PWC_PDWKES_WK3EGS (0x08U) +#define PWC_PDWKES_VD1EGS_POS (4U) +#define PWC_PDWKES_VD1EGS (0x10U) +#define PWC_PDWKES_VD2EGS_POS (5U) +#define PWC_PDWKES_VD2EGS (0x20U) + +/* Bit definition for PWC_PDWKF0 register */ +#define PWC_PDWKF0_PTWK0F_POS (0U) +#define PWC_PDWKF0_PTWK0F (0x01U) +#define PWC_PDWKF0_PTWK1F_POS (1U) +#define PWC_PDWKF0_PTWK1F (0x02U) +#define PWC_PDWKF0_PTWK2F_POS (2U) +#define PWC_PDWKF0_PTWK2F (0x04U) +#define PWC_PDWKF0_PTWK3F_POS (3U) +#define PWC_PDWKF0_PTWK3F (0x08U) +#define PWC_PDWKF0_VD1WKF_POS (4U) +#define PWC_PDWKF0_VD1WKF (0x10U) +#define PWC_PDWKF0_VD2WKF_POS (5U) +#define PWC_PDWKF0_VD2WKF (0x20U) + +/* Bit definition for PWC_PDWKF1 register */ +#define PWC_PDWKF1_RXD0WKF_POS (3U) +#define PWC_PDWKF1_RXD0WKF (0x08U) +#define PWC_PDWKF1_RTCPRDWKF_POS (4U) +#define PWC_PDWKF1_RTCPRDWKF (0x10U) +#define PWC_PDWKF1_RTCALMWKF_POS (5U) +#define PWC_PDWKF1_RTCALMWKF (0x20U) +#define PWC_PDWKF1_XTAL32ERWKF_POS (6U) +#define PWC_PDWKF1_XTAL32ERWKF (0x40U) +#define PWC_PDWKF1_WKTMWKF_POS (7U) +#define PWC_PDWKF1_WKTMWKF (0x80U) + +/* Bit definition for PWC_RAMPC0 register */ +#define PWC_RAMPC0_RAMPDC0_POS (0U) +#define PWC_RAMPC0_RAMPDC0 (0x00000001UL) +#define PWC_RAMPC0_RAMPDC1_POS (1U) +#define PWC_RAMPC0_RAMPDC1 (0x00000002UL) +#define PWC_RAMPC0_RAMPDC2_POS (2U) +#define PWC_RAMPC0_RAMPDC2 (0x00000004UL) +#define PWC_RAMPC0_RAMPDC3_POS (3U) +#define PWC_RAMPC0_RAMPDC3 (0x00000008UL) +#define PWC_RAMPC0_RAMPDC4_POS (4U) +#define PWC_RAMPC0_RAMPDC4 (0x00000010UL) +#define PWC_RAMPC0_RAMPDC5_POS (5U) +#define PWC_RAMPC0_RAMPDC5 (0x00000020UL) +#define PWC_RAMPC0_RAMPDC6_POS (6U) +#define PWC_RAMPC0_RAMPDC6 (0x00000040UL) +#define PWC_RAMPC0_RAMPDC7_POS (7U) +#define PWC_RAMPC0_RAMPDC7 (0x00000080UL) +#define PWC_RAMPC0_RAMPDC8_POS (8U) +#define PWC_RAMPC0_RAMPDC8 (0x00000100UL) +#define PWC_RAMPC0_RAMPDC9_POS (9U) +#define PWC_RAMPC0_RAMPDC9 (0x00000200UL) +#define PWC_RAMPC0_RAMPDC10_POS (10U) +#define PWC_RAMPC0_RAMPDC10 (0x00000400UL) + +/* Bit definition for PWC_RAMOPM register */ +#define PWC_RAMOPM_RAMOPM (0x0000FFFFUL) + +/* Bit definition for PWC_PRAMLPC register */ +#define PWC_PRAMLPC_PRAMPDC0_POS (0U) +#define PWC_PRAMLPC_PRAMPDC0 (0x00000001UL) +#define PWC_PRAMLPC_PRAMPDC1_POS (1U) +#define PWC_PRAMLPC_PRAMPDC1 (0x00000002UL) +#define PWC_PRAMLPC_PRAMPDC2_POS (2U) +#define PWC_PRAMLPC_PRAMPDC2 (0x00000004UL) +#define PWC_PRAMLPC_PRAMPDC3_POS (3U) +#define PWC_PRAMLPC_PRAMPDC3 (0x00000008UL) +#define PWC_PRAMLPC_PRAMPDC4_POS (4U) +#define PWC_PRAMLPC_PRAMPDC4 (0x00000010UL) +#define PWC_PRAMLPC_PRAMPDC5_POS (5U) +#define PWC_PRAMLPC_PRAMPDC5 (0x00000020UL) +#define PWC_PRAMLPC_PRAMPDC6_POS (6U) +#define PWC_PRAMLPC_PRAMPDC6 (0x00000040UL) +#define PWC_PRAMLPC_PRAMPDC7_POS (7U) +#define PWC_PRAMLPC_PRAMPDC7 (0x00000080UL) +#define PWC_PRAMLPC_PRAMPDC8_POS (8U) +#define PWC_PRAMLPC_PRAMPDC8 (0x00000100UL) +#define PWC_PRAMLPC_PRAMPDC9_POS (9U) +#define PWC_PRAMLPC_PRAMPDC9 (0x00000200UL) + +/* Bit definition for PWC_PVDICR register */ +#define PWC_PVDICR_PVD1NMIS_POS (0U) +#define PWC_PVDICR_PVD1NMIS (0x01U) +#define PWC_PVDICR_PVD1EDGS_POS (1U) +#define PWC_PVDICR_PVD1EDGS (0x06U) +#define PWC_PVDICR_PVD1EDGS_0 (0x02U) +#define PWC_PVDICR_PVD1EDGS_1 (0x04U) +#define PWC_PVDICR_PVD2NMIS_POS (4U) +#define PWC_PVDICR_PVD2NMIS (0x10U) +#define PWC_PVDICR_PVD2EDGS_POS (5U) +#define PWC_PVDICR_PVD2EDGS (0x60U) +#define PWC_PVDICR_PVD2EDGS_0 (0x20U) +#define PWC_PVDICR_PVD2EDGS_1 (0x40U) + +/* Bit definition for PWC_PVDDSR register */ +#define PWC_PVDDSR_PVD1MON_POS (0U) +#define PWC_PVDDSR_PVD1MON (0x01U) +#define PWC_PVDDSR_PVD1DETFLG_POS (1U) +#define PWC_PVDDSR_PVD1DETFLG (0x02U) +#define PWC_PVDDSR_PVD2MON_POS (4U) +#define PWC_PVDDSR_PVD2MON (0x10U) +#define PWC_PVDDSR_PVD2DETFLG_POS (5U) +#define PWC_PVDDSR_PVD2DETFLG (0x20U) + +/* Bit definition for PWC_STPMCR register */ +#define PWC_STPMCR_FLNWT_POS (0U) +#define PWC_STPMCR_FLNWT (0x0001U) +#define PWC_STPMCR_CKSMRC_POS (1U) +#define PWC_STPMCR_CKSMRC (0x0002U) +#define PWC_STPMCR_EXBUSOE_POS (14U) +#define PWC_STPMCR_EXBUSOE (0x4000U) +#define PWC_STPMCR_STOP_POS (15U) +#define PWC_STPMCR_STOP (0x8000U) + +/* Bit definition for PWC_FPRC register */ +#define PWC_FPRC_FPRCB0_POS (0U) +#define PWC_FPRC_FPRCB0 (0x0001U) +#define PWC_FPRC_FPRCB1_POS (1U) +#define PWC_FPRC_FPRCB1 (0x0002U) +#define PWC_FPRC_FPRCB2_POS (2U) +#define PWC_FPRC_FPRCB2 (0x0004U) +#define PWC_FPRC_FPRCB3_POS (3U) +#define PWC_FPRC_FPRCB3 (0x0008U) +#define PWC_FPRC_FPRCWE_POS (8U) +#define PWC_FPRC_FPRCWE (0xFF00U) + +/******************************************************************************* + Bit definition for Peripheral QSPI +*******************************************************************************/ +/* Bit definition for QSPI_CR register */ +#define QSPI_CR_MDSEL_POS (0U) +#define QSPI_CR_MDSEL (0x00000007UL) +#define QSPI_CR_MDSEL_0 (0x00000001UL) +#define QSPI_CR_MDSEL_1 (0x00000002UL) +#define QSPI_CR_MDSEL_2 (0x00000004UL) +#define QSPI_CR_PFE_POS (3U) +#define QSPI_CR_PFE (0x00000008UL) +#define QSPI_CR_PFSAE_POS (4U) +#define QSPI_CR_PFSAE (0x00000010UL) +#define QSPI_CR_DCOME_POS (5U) +#define QSPI_CR_DCOME (0x00000020UL) +#define QSPI_CR_XIPE_POS (6U) +#define QSPI_CR_XIPE (0x00000040UL) +#define QSPI_CR_SPIMD3_POS (7U) +#define QSPI_CR_SPIMD3 (0x00000080UL) +#define QSPI_CR_IPRSL_POS (8U) +#define QSPI_CR_IPRSL (0x00000300UL) +#define QSPI_CR_IPRSL_0 (0x00000100UL) +#define QSPI_CR_IPRSL_1 (0x00000200UL) +#define QSPI_CR_APRSL_POS (10U) +#define QSPI_CR_APRSL (0x00000C00UL) +#define QSPI_CR_APRSL_0 (0x00000400UL) +#define QSPI_CR_APRSL_1 (0x00000800UL) +#define QSPI_CR_DPRSL_POS (12U) +#define QSPI_CR_DPRSL (0x00003000UL) +#define QSPI_CR_DPRSL_0 (0x00001000UL) +#define QSPI_CR_DPRSL_1 (0x00002000UL) +#define QSPI_CR_DIV_POS (16U) +#define QSPI_CR_DIV (0x003F0000UL) +#define QSPI_CR_DIV_0 (0x00010000UL) +#define QSPI_CR_DIV_1 (0x00020000UL) +#define QSPI_CR_DIV_2 (0x00040000UL) +#define QSPI_CR_DIV_3 (0x00080000UL) +#define QSPI_CR_DIV_4 (0x00100000UL) +#define QSPI_CR_DIV_5 (0x00200000UL) + +/* Bit definition for QSPI_CSCR register */ +#define QSPI_CSCR_SSHW_POS (0U) +#define QSPI_CSCR_SSHW (0x0000000FUL) +#define QSPI_CSCR_SSHW_0 (0x00000001UL) +#define QSPI_CSCR_SSHW_1 (0x00000002UL) +#define QSPI_CSCR_SSHW_2 (0x00000004UL) +#define QSPI_CSCR_SSHW_3 (0x00000008UL) +#define QSPI_CSCR_SSNW_POS (4U) +#define QSPI_CSCR_SSNW (0x00000030UL) +#define QSPI_CSCR_SSNW_0 (0x00000010UL) +#define QSPI_CSCR_SSNW_1 (0x00000020UL) + +/* Bit definition for QSPI_FCR register */ +#define QSPI_FCR_AWSL_POS (0U) +#define QSPI_FCR_AWSL (0x00000003UL) +#define QSPI_FCR_AWSL_0 (0x00000001UL) +#define QSPI_FCR_AWSL_1 (0x00000002UL) +#define QSPI_FCR_FOUR_BIC_POS (2U) +#define QSPI_FCR_FOUR_BIC (0x00000004UL) +#define QSPI_FCR_SSNHD_POS (4U) +#define QSPI_FCR_SSNHD (0x00000010UL) +#define QSPI_FCR_SSNLD_POS (5U) +#define QSPI_FCR_SSNLD (0x00000020UL) +#define QSPI_FCR_WPOL_POS (6U) +#define QSPI_FCR_WPOL (0x00000040UL) +#define QSPI_FCR_DMCYCN_POS (8U) +#define QSPI_FCR_DMCYCN (0x00000F00UL) +#define QSPI_FCR_DMCYCN_0 (0x00000100UL) +#define QSPI_FCR_DMCYCN_1 (0x00000200UL) +#define QSPI_FCR_DMCYCN_2 (0x00000400UL) +#define QSPI_FCR_DMCYCN_3 (0x00000800UL) +#define QSPI_FCR_DUTY_POS (15U) +#define QSPI_FCR_DUTY (0x00008000UL) + +/* Bit definition for QSPI_SR register */ +#define QSPI_SR_BUSY_POS (0U) +#define QSPI_SR_BUSY (0x00000001UL) +#define QSPI_SR_XIPF_POS (6U) +#define QSPI_SR_XIPF (0x00000040UL) +#define QSPI_SR_RAER_POS (7U) +#define QSPI_SR_RAER (0x00000080UL) +#define QSPI_SR_PFNUM_POS (8U) +#define QSPI_SR_PFNUM (0x00001F00UL) +#define QSPI_SR_PFNUM_0 (0x00000100UL) +#define QSPI_SR_PFNUM_1 (0x00000200UL) +#define QSPI_SR_PFNUM_2 (0x00000400UL) +#define QSPI_SR_PFNUM_3 (0x00000800UL) +#define QSPI_SR_PFNUM_4 (0x00001000UL) +#define QSPI_SR_PFFUL_POS (14U) +#define QSPI_SR_PFFUL (0x00004000UL) +#define QSPI_SR_PFAN_POS (15U) +#define QSPI_SR_PFAN (0x00008000UL) + +/* Bit definition for QSPI_DCOM register */ +#define QSPI_DCOM_DCOM (0x000000FFUL) + +/* Bit definition for QSPI_CCMD register */ +#define QSPI_CCMD_RIC (0x000000FFUL) + +/* Bit definition for QSPI_XCMD register */ +#define QSPI_XCMD_XIPMC (0x000000FFUL) + +/* Bit definition for QSPI_SR2 register */ +#define QSPI_SR2_RAERCLR_POS (7U) +#define QSPI_SR2_RAERCLR (0x00000080UL) + +/* Bit definition for QSPI_EXAR register */ +#define QSPI_EXAR_EXADR_POS (26U) +#define QSPI_EXAR_EXADR (0xFC000000UL) + +/******************************************************************************* + Bit definition for Peripheral RMU +*******************************************************************************/ +/* Bit definition for RMU_PRSTCR0 register */ +#define RMU_PRSTCR0_LKUPREN_POS (5U) +#define RMU_PRSTCR0_LKUPREN (0x60U) + +/* Bit definition for RMU_RSTF0 register */ +#define RMU_RSTF0_PORF_POS (0U) +#define RMU_RSTF0_PORF (0x00000001UL) +#define RMU_RSTF0_PINRF_POS (1U) +#define RMU_RSTF0_PINRF (0x00000002UL) +#define RMU_RSTF0_BORF_POS (2U) +#define RMU_RSTF0_BORF (0x00000004UL) +#define RMU_RSTF0_PVD1RF_POS (3U) +#define RMU_RSTF0_PVD1RF (0x00000008UL) +#define RMU_RSTF0_PVD2RF_POS (4U) +#define RMU_RSTF0_PVD2RF (0x00000010UL) +#define RMU_RSTF0_WDRF_POS (5U) +#define RMU_RSTF0_WDRF (0x00000020UL) +#define RMU_RSTF0_SWDRF_POS (6U) +#define RMU_RSTF0_SWDRF (0x00000040UL) +#define RMU_RSTF0_PDRF_POS (7U) +#define RMU_RSTF0_PDRF (0x00000080UL) +#define RMU_RSTF0_SWRF_POS (8U) +#define RMU_RSTF0_SWRF (0x00000100UL) +#define RMU_RSTF0_MPUERF_POS (9U) +#define RMU_RSTF0_MPUERF (0x00000200UL) +#define RMU_RSTF0_RAPERF_POS (10U) +#define RMU_RSTF0_RAPERF (0x00000400UL) +#define RMU_RSTF0_RAECRF_POS (11U) +#define RMU_RSTF0_RAECRF (0x00000800UL) +#define RMU_RSTF0_CKFERF_POS (12U) +#define RMU_RSTF0_CKFERF (0x00001000UL) +#define RMU_RSTF0_XTALERF_POS (13U) +#define RMU_RSTF0_XTALERF (0x00002000UL) +#define RMU_RSTF0_LKUPRF_POS (14U) +#define RMU_RSTF0_LKUPRF (0x00004000UL) +#define RMU_RSTF0_MULTIRF_POS (30U) +#define RMU_RSTF0_MULTIRF (0x40000000UL) +#define RMU_RSTF0_CLRF_POS (31U) +#define RMU_RSTF0_CLRF (0x80000000UL) + +/******************************************************************************* + Bit definition for Peripheral RTC +*******************************************************************************/ +/* Bit definition for RTC_CR0 register */ +#define RTC_CR0_RESET (0x01U) + +/* Bit definition for RTC_CR1 register */ +#define RTC_CR1_PRDS_POS (0U) +#define RTC_CR1_PRDS (0x07U) +#define RTC_CR1_PRDS_0 (0x01U) +#define RTC_CR1_PRDS_1 (0x02U) +#define RTC_CR1_PRDS_2 (0x04U) +#define RTC_CR1_AMPM_POS (3U) +#define RTC_CR1_AMPM (0x08U) +#define RTC_CR1_ONEHZOE_POS (5U) +#define RTC_CR1_ONEHZOE (0x20U) +#define RTC_CR1_ONEHZSEL_POS (6U) +#define RTC_CR1_ONEHZSEL (0x40U) +#define RTC_CR1_START_POS (7U) +#define RTC_CR1_START (0x80U) + +/* Bit definition for RTC_CR2 register */ +#define RTC_CR2_RWREQ_POS (0U) +#define RTC_CR2_RWREQ (0x01U) +#define RTC_CR2_RWEN_POS (1U) +#define RTC_CR2_RWEN (0x02U) +#define RTC_CR2_PRDF_POS (2U) +#define RTC_CR2_PRDF (0x04U) +#define RTC_CR2_ALMF_POS (3U) +#define RTC_CR2_ALMF (0x08U) +#define RTC_CR2_PRDIE_POS (5U) +#define RTC_CR2_PRDIE (0x20U) +#define RTC_CR2_ALMIE_POS (6U) +#define RTC_CR2_ALMIE (0x40U) +#define RTC_CR2_ALME_POS (7U) +#define RTC_CR2_ALME (0x80U) + +/* Bit definition for RTC_CR3 register */ +#define RTC_CR3_LRCEN_POS (4U) +#define RTC_CR3_LRCEN (0x10U) +#define RTC_CR3_RCKSEL_POS (7U) +#define RTC_CR3_RCKSEL (0x80U) + +/* Bit definition for RTC_SEC register */ +#define RTC_SEC_SECU_POS (0U) +#define RTC_SEC_SECU (0x0FU) +#define RTC_SEC_SECD_POS (4U) +#define RTC_SEC_SECD (0x70U) + +/* Bit definition for RTC_MIN register */ +#define RTC_MIN_MINU_POS (0U) +#define RTC_MIN_MINU (0x0FU) +#define RTC_MIN_MIND_POS (4U) +#define RTC_MIN_MIND (0x70U) + +/* Bit definition for RTC_HOUR register */ +#define RTC_HOUR_HOURU_POS (0U) +#define RTC_HOUR_HOURU (0x0FU) +#define RTC_HOUR_HOURU_0 (0x01U) +#define RTC_HOUR_HOURU_1 (0x02U) +#define RTC_HOUR_HOURU_2 (0x04U) +#define RTC_HOUR_HOURU_3 (0x08U) +#define RTC_HOUR_HOURD_POS (4U) +#define RTC_HOUR_HOURD (0x30U) +#define RTC_HOUR_HOURD_0 (0x10U) +#define RTC_HOUR_HOURD_1 (0x20U) + +/* Bit definition for RTC_WEEK register */ +#define RTC_WEEK_WEEK (0x07U) + +/* Bit definition for RTC_DAY register */ +#define RTC_DAY_DAYU_POS (0U) +#define RTC_DAY_DAYU (0x0FU) +#define RTC_DAY_DAYD_POS (4U) +#define RTC_DAY_DAYD (0x30U) + +/* Bit definition for RTC_MON register */ +#define RTC_MON_MON (0x1FU) + +/* Bit definition for RTC_YEAR register */ +#define RTC_YEAR_YEARU_POS (0U) +#define RTC_YEAR_YEARU (0x0FU) +#define RTC_YEAR_YEARD_POS (4U) +#define RTC_YEAR_YEARD (0xF0U) + +/* Bit definition for RTC_ALMMIN register */ +#define RTC_ALMMIN_ALMMINU_POS (0U) +#define RTC_ALMMIN_ALMMINU (0x0FU) +#define RTC_ALMMIN_ALMMIND_POS (4U) +#define RTC_ALMMIN_ALMMIND (0x70U) + +/* Bit definition for RTC_ALMHOUR register */ +#define RTC_ALMHOUR_ALMHOURU_POS (0U) +#define RTC_ALMHOUR_ALMHOURU (0x0FU) +#define RTC_ALMHOUR_ALMHOURU_0 (0x01U) +#define RTC_ALMHOUR_ALMHOURU_1 (0x02U) +#define RTC_ALMHOUR_ALMHOURU_2 (0x04U) +#define RTC_ALMHOUR_ALMHOURU_3 (0x08U) +#define RTC_ALMHOUR_ALMHOURD_POS (4U) +#define RTC_ALMHOUR_ALMHOURD (0x30U) +#define RTC_ALMHOUR_ALMHOURD_0 (0x10U) +#define RTC_ALMHOUR_ALMHOURD_1 (0x20U) + +/* Bit definition for RTC_ALMWEEK register */ +#define RTC_ALMWEEK_ALMWEEK (0x7FU) + +/* Bit definition for RTC_ERRCRH register */ +#define RTC_ERRCRH_COMP8_POS (0U) +#define RTC_ERRCRH_COMP8 (0x01U) +#define RTC_ERRCRH_COMPEN_POS (7U) +#define RTC_ERRCRH_COMPEN (0x80U) + +/* Bit definition for RTC_ERRCRL register */ +#define RTC_ERRCRL_COMP (0xFFU) + +/* Bit definition for RTC_TPCR0 register */ +#define RTC_TPCR0_TPCT0_POS (0U) +#define RTC_TPCR0_TPCT0 (0x03U) +#define RTC_TPCR0_TPCT0_0 (0x01U) +#define RTC_TPCR0_TPCT0_1 (0x02U) +#define RTC_TPCR0_TPNF0_POS (2U) +#define RTC_TPCR0_TPNF0 (0x0CU) +#define RTC_TPCR0_TPNF0_0 (0x04U) +#define RTC_TPCR0_TPNF0_1 (0x08U) +#define RTC_TPCR0_TPRSTE0_POS (4U) +#define RTC_TPCR0_TPRSTE0 (0x10U) +#define RTC_TPCR0_TPIE0_POS (5U) +#define RTC_TPCR0_TPIE0 (0x20U) +#define RTC_TPCR0_TSTPE0_POS (6U) +#define RTC_TPCR0_TSTPE0 (0x40U) +#define RTC_TPCR0_TPEN0_POS (7U) +#define RTC_TPCR0_TPEN0 (0x80U) + +/* Bit definition for RTC_TPCR1 register */ +#define RTC_TPCR1_TPCT1_POS (0U) +#define RTC_TPCR1_TPCT1 (0x03U) +#define RTC_TPCR1_TPCT1_0 (0x01U) +#define RTC_TPCR1_TPCT1_1 (0x02U) +#define RTC_TPCR1_TPNF1_POS (2U) +#define RTC_TPCR1_TPNF1 (0x0CU) +#define RTC_TPCR1_TPNF1_0 (0x04U) +#define RTC_TPCR1_TPNF1_1 (0x08U) +#define RTC_TPCR1_TPRSTE1_POS (4U) +#define RTC_TPCR1_TPRSTE1 (0x10U) +#define RTC_TPCR1_TPIE1_POS (5U) +#define RTC_TPCR1_TPIE1 (0x20U) +#define RTC_TPCR1_TSTPE1_POS (6U) +#define RTC_TPCR1_TSTPE1 (0x40U) +#define RTC_TPCR1_TPEN1_POS (7U) +#define RTC_TPCR1_TPEN1 (0x80U) + +/* Bit definition for RTC_TPSR register */ +#define RTC_TPSR_TPF0_POS (0U) +#define RTC_TPSR_TPF0 (0x01U) +#define RTC_TPSR_TPF1_POS (1U) +#define RTC_TPSR_TPF1 (0x02U) +#define RTC_TPSR_TPOVF_POS (2U) +#define RTC_TPSR_TPOVF (0x04U) + +/* Bit definition for RTC_SECTP register */ +#define RTC_SECTP_SECTPU_POS (0U) +#define RTC_SECTP_SECTPU (0x0FU) +#define RTC_SECTP_SECTPD_POS (4U) +#define RTC_SECTP_SECTPD (0x70U) + +/* Bit definition for RTC_MINTP register */ +#define RTC_MINTP_MINTPU_POS (0U) +#define RTC_MINTP_MINTPU (0x0FU) +#define RTC_MINTP_MINTPD_POS (4U) +#define RTC_MINTP_MINTPD (0x70U) + +/* Bit definition for RTC_HOURTP register */ +#define RTC_HOURTP_HOURTPU_POS (0U) +#define RTC_HOURTP_HOURTPU (0x0FU) +#define RTC_HOURTP_HOURTPU_0 (0x01U) +#define RTC_HOURTP_HOURTPU_1 (0x02U) +#define RTC_HOURTP_HOURTPU_2 (0x04U) +#define RTC_HOURTP_HOURTPU_3 (0x08U) +#define RTC_HOURTP_HOURTPD_POS (4U) +#define RTC_HOURTP_HOURTPD (0x30U) +#define RTC_HOURTP_HOURTPD_0 (0x10U) +#define RTC_HOURTP_HOURTPD_1 (0x20U) + +/* Bit definition for RTC_DAYTP register */ +#define RTC_DAYTP_DAYTPU_POS (0U) +#define RTC_DAYTP_DAYTPU (0x0FU) +#define RTC_DAYTP_DAYTPD_POS (4U) +#define RTC_DAYTP_DAYTPD (0x30U) + +/* Bit definition for RTC_MONTP register */ +#define RTC_MONTP_MONTP (0x1FU) + +/******************************************************************************* + Bit definition for Peripheral SDIOC +*******************************************************************************/ +/* Bit definition for SDIOC_BLKSIZE register */ +#define SDIOC_BLKSIZE_TBS (0x0FFFU) + +/* Bit definition for SDIOC_BLKCNT register */ +#define SDIOC_BLKCNT (0xFFFFU) + +/* Bit definition for SDIOC_ARG0 register */ +#define SDIOC_ARG0 (0xFFFFU) + +/* Bit definition for SDIOC_ARG1 register */ +#define SDIOC_ARG1 (0xFFFFU) + +/* Bit definition for SDIOC_TRANSMODE register */ +#define SDIOC_TRANSMODE_BCE_POS (1U) +#define SDIOC_TRANSMODE_BCE (0x0002U) +#define SDIOC_TRANSMODE_ATCEN_POS (2U) +#define SDIOC_TRANSMODE_ATCEN (0x000CU) +#define SDIOC_TRANSMODE_ATCEN_0 (0x0004U) +#define SDIOC_TRANSMODE_ATCEN_1 (0x0008U) +#define SDIOC_TRANSMODE_DDIR_POS (4U) +#define SDIOC_TRANSMODE_DDIR (0x0010U) +#define SDIOC_TRANSMODE_MULB_POS (5U) +#define SDIOC_TRANSMODE_MULB (0x0020U) + +/* Bit definition for SDIOC_CMD register */ +#define SDIOC_CMD_RESTYP_POS (0U) +#define SDIOC_CMD_RESTYP (0x0003U) +#define SDIOC_CMD_RESTYP_0 (0x0001U) +#define SDIOC_CMD_RESTYP_1 (0x0002U) +#define SDIOC_CMD_CCE_POS (3U) +#define SDIOC_CMD_CCE (0x0008U) +#define SDIOC_CMD_ICE_POS (4U) +#define SDIOC_CMD_ICE (0x0010U) +#define SDIOC_CMD_DAT_POS (5U) +#define SDIOC_CMD_DAT (0x0020U) +#define SDIOC_CMD_TYP_POS (6U) +#define SDIOC_CMD_TYP (0x00C0U) +#define SDIOC_CMD_TYP_0 (0x0040U) +#define SDIOC_CMD_TYP_1 (0x0080U) +#define SDIOC_CMD_IDX_POS (8U) +#define SDIOC_CMD_IDX (0x3F00U) +#define SDIOC_CMD_IDX_0 (0x0100U) +#define SDIOC_CMD_IDX_1 (0x0200U) +#define SDIOC_CMD_IDX_2 (0x0400U) +#define SDIOC_CMD_IDX_3 (0x0800U) +#define SDIOC_CMD_IDX_4 (0x1000U) +#define SDIOC_CMD_IDX_5 (0x2000U) + +/* Bit definition for SDIOC_RESP0 register */ +#define SDIOC_RESP0 (0xFFFFU) + +/* Bit definition for SDIOC_RESP1 register */ +#define SDIOC_RESP1 (0xFFFFU) + +/* Bit definition for SDIOC_RESP2 register */ +#define SDIOC_RESP2 (0xFFFFU) + +/* Bit definition for SDIOC_RESP3 register */ +#define SDIOC_RESP3 (0xFFFFU) + +/* Bit definition for SDIOC_RESP4 register */ +#define SDIOC_RESP4 (0xFFFFU) + +/* Bit definition for SDIOC_RESP5 register */ +#define SDIOC_RESP5 (0xFFFFU) + +/* Bit definition for SDIOC_RESP6 register */ +#define SDIOC_RESP6 (0xFFFFU) + +/* Bit definition for SDIOC_RESP7 register */ +#define SDIOC_RESP7 (0xFFFFU) + +/* Bit definition for SDIOC_BUF0 register */ +#define SDIOC_BUF0 (0xFFFFU) + +/* Bit definition for SDIOC_BUF1 register */ +#define SDIOC_BUF1 (0xFFFFU) + +/* Bit definition for SDIOC_PSTAT register */ +#define SDIOC_PSTAT_CIC_POS (0U) +#define SDIOC_PSTAT_CIC (0x00000001UL) +#define SDIOC_PSTAT_CID_POS (1U) +#define SDIOC_PSTAT_CID (0x00000002UL) +#define SDIOC_PSTAT_DA_POS (2U) +#define SDIOC_PSTAT_DA (0x00000004UL) +#define SDIOC_PSTAT_WTA_POS (8U) +#define SDIOC_PSTAT_WTA (0x00000100UL) +#define SDIOC_PSTAT_RTA_POS (9U) +#define SDIOC_PSTAT_RTA (0x00000200UL) +#define SDIOC_PSTAT_BWE_POS (10U) +#define SDIOC_PSTAT_BWE (0x00000400UL) +#define SDIOC_PSTAT_BRE_POS (11U) +#define SDIOC_PSTAT_BRE (0x00000800UL) +#define SDIOC_PSTAT_CIN_POS (16U) +#define SDIOC_PSTAT_CIN (0x00010000UL) +#define SDIOC_PSTAT_CSS_POS (17U) +#define SDIOC_PSTAT_CSS (0x00020000UL) +#define SDIOC_PSTAT_CDL_POS (18U) +#define SDIOC_PSTAT_CDL (0x00040000UL) +#define SDIOC_PSTAT_WPL_POS (19U) +#define SDIOC_PSTAT_WPL (0x00080000UL) +#define SDIOC_PSTAT_DATL_POS (20U) +#define SDIOC_PSTAT_DATL (0x00F00000UL) +#define SDIOC_PSTAT_DATL_0 (0x00100000UL) +#define SDIOC_PSTAT_DATL_1 (0x00200000UL) +#define SDIOC_PSTAT_DATL_2 (0x00400000UL) +#define SDIOC_PSTAT_DATL_3 (0x00800000UL) +#define SDIOC_PSTAT_CMDL_POS (24U) +#define SDIOC_PSTAT_CMDL (0x01000000UL) + +/* Bit definition for SDIOC_HOSTCON register */ +#define SDIOC_HOSTCON_DW_POS (1U) +#define SDIOC_HOSTCON_DW (0x02U) +#define SDIOC_HOSTCON_HSEN_POS (2U) +#define SDIOC_HOSTCON_HSEN (0x04U) +#define SDIOC_HOSTCON_EXDW_POS (5U) +#define SDIOC_HOSTCON_EXDW (0x20U) +#define SDIOC_HOSTCON_CDTL_POS (6U) +#define SDIOC_HOSTCON_CDTL (0x40U) +#define SDIOC_HOSTCON_CDSS_POS (7U) +#define SDIOC_HOSTCON_CDSS (0x80U) + +/* Bit definition for SDIOC_PWRCON register */ +#define SDIOC_PWRCON_PWON (0x01U) + +/* Bit definition for SDIOC_BLKGPCON register */ +#define SDIOC_BLKGPCON_SABGR_POS (0U) +#define SDIOC_BLKGPCON_SABGR (0x01U) +#define SDIOC_BLKGPCON_CR_POS (1U) +#define SDIOC_BLKGPCON_CR (0x02U) +#define SDIOC_BLKGPCON_RWC_POS (2U) +#define SDIOC_BLKGPCON_RWC (0x04U) +#define SDIOC_BLKGPCON_IABG_POS (3U) +#define SDIOC_BLKGPCON_IABG (0x08U) + +/* Bit definition for SDIOC_CLKCON register */ +#define SDIOC_CLKCON_ICE_POS (0U) +#define SDIOC_CLKCON_ICE (0x0001U) +#define SDIOC_CLKCON_CE_POS (2U) +#define SDIOC_CLKCON_CE (0x0004U) +#define SDIOC_CLKCON_FS_POS (8U) +#define SDIOC_CLKCON_FS (0xFF00U) +#define SDIOC_CLKCON_FS_0 (0x0100U) +#define SDIOC_CLKCON_FS_1 (0x0200U) +#define SDIOC_CLKCON_FS_2 (0x0400U) +#define SDIOC_CLKCON_FS_3 (0x0800U) +#define SDIOC_CLKCON_FS_4 (0x1000U) +#define SDIOC_CLKCON_FS_5 (0x2000U) +#define SDIOC_CLKCON_FS_6 (0x4000U) +#define SDIOC_CLKCON_FS_7 (0x8000U) + +/* Bit definition for SDIOC_TOUTCON register */ +#define SDIOC_TOUTCON_DTO (0x0FU) + +/* Bit definition for SDIOC_SFTRST register */ +#define SDIOC_SFTRST_RSTA_POS (0U) +#define SDIOC_SFTRST_RSTA (0x01U) +#define SDIOC_SFTRST_RSTC_POS (1U) +#define SDIOC_SFTRST_RSTC (0x02U) +#define SDIOC_SFTRST_RSTD_POS (2U) +#define SDIOC_SFTRST_RSTD (0x04U) + +/* Bit definition for SDIOC_NORINTST register */ +#define SDIOC_NORINTST_CC_POS (0U) +#define SDIOC_NORINTST_CC (0x0001U) +#define SDIOC_NORINTST_TC_POS (1U) +#define SDIOC_NORINTST_TC (0x0002U) +#define SDIOC_NORINTST_BGE_POS (2U) +#define SDIOC_NORINTST_BGE (0x0004U) +#define SDIOC_NORINTST_BWR_POS (4U) +#define SDIOC_NORINTST_BWR (0x0010U) +#define SDIOC_NORINTST_BRR_POS (5U) +#define SDIOC_NORINTST_BRR (0x0020U) +#define SDIOC_NORINTST_CIST_POS (6U) +#define SDIOC_NORINTST_CIST (0x0040U) +#define SDIOC_NORINTST_CRM_POS (7U) +#define SDIOC_NORINTST_CRM (0x0080U) +#define SDIOC_NORINTST_CINT_POS (8U) +#define SDIOC_NORINTST_CINT (0x0100U) +#define SDIOC_NORINTST_EI_POS (15U) +#define SDIOC_NORINTST_EI (0x8000U) + +/* Bit definition for SDIOC_ERRINTST register */ +#define SDIOC_ERRINTST_CTOE_POS (0U) +#define SDIOC_ERRINTST_CTOE (0x0001U) +#define SDIOC_ERRINTST_CCE_POS (1U) +#define SDIOC_ERRINTST_CCE (0x0002U) +#define SDIOC_ERRINTST_CEBE_POS (2U) +#define SDIOC_ERRINTST_CEBE (0x0004U) +#define SDIOC_ERRINTST_CIE_POS (3U) +#define SDIOC_ERRINTST_CIE (0x0008U) +#define SDIOC_ERRINTST_DTOE_POS (4U) +#define SDIOC_ERRINTST_DTOE (0x0010U) +#define SDIOC_ERRINTST_DCE_POS (5U) +#define SDIOC_ERRINTST_DCE (0x0020U) +#define SDIOC_ERRINTST_DEBE_POS (6U) +#define SDIOC_ERRINTST_DEBE (0x0040U) +#define SDIOC_ERRINTST_ACE_POS (8U) +#define SDIOC_ERRINTST_ACE (0x0100U) + +/* Bit definition for SDIOC_NORINTSTEN register */ +#define SDIOC_NORINTSTEN_CCEN_POS (0U) +#define SDIOC_NORINTSTEN_CCEN (0x0001U) +#define SDIOC_NORINTSTEN_TCEN_POS (1U) +#define SDIOC_NORINTSTEN_TCEN (0x0002U) +#define SDIOC_NORINTSTEN_BGEEN_POS (2U) +#define SDIOC_NORINTSTEN_BGEEN (0x0004U) +#define SDIOC_NORINTSTEN_BWREN_POS (4U) +#define SDIOC_NORINTSTEN_BWREN (0x0010U) +#define SDIOC_NORINTSTEN_BRREN_POS (5U) +#define SDIOC_NORINTSTEN_BRREN (0x0020U) +#define SDIOC_NORINTSTEN_CISTEN_POS (6U) +#define SDIOC_NORINTSTEN_CISTEN (0x0040U) +#define SDIOC_NORINTSTEN_CRMEN_POS (7U) +#define SDIOC_NORINTSTEN_CRMEN (0x0080U) +#define SDIOC_NORINTSTEN_CINTEN_POS (8U) +#define SDIOC_NORINTSTEN_CINTEN (0x0100U) + +/* Bit definition for SDIOC_ERRINTSTEN register */ +#define SDIOC_ERRINTSTEN_CTOEEN_POS (0U) +#define SDIOC_ERRINTSTEN_CTOEEN (0x0001U) +#define SDIOC_ERRINTSTEN_CCEEN_POS (1U) +#define SDIOC_ERRINTSTEN_CCEEN (0x0002U) +#define SDIOC_ERRINTSTEN_CEBEEN_POS (2U) +#define SDIOC_ERRINTSTEN_CEBEEN (0x0004U) +#define SDIOC_ERRINTSTEN_CIEEN_POS (3U) +#define SDIOC_ERRINTSTEN_CIEEN (0x0008U) +#define SDIOC_ERRINTSTEN_DTOEEN_POS (4U) +#define SDIOC_ERRINTSTEN_DTOEEN (0x0010U) +#define SDIOC_ERRINTSTEN_DCEEN_POS (5U) +#define SDIOC_ERRINTSTEN_DCEEN (0x0020U) +#define SDIOC_ERRINTSTEN_DEBEEN_POS (6U) +#define SDIOC_ERRINTSTEN_DEBEEN (0x0040U) +#define SDIOC_ERRINTSTEN_ACEEN_POS (8U) +#define SDIOC_ERRINTSTEN_ACEEN (0x0100U) + +/* Bit definition for SDIOC_NORINTSGEN register */ +#define SDIOC_NORINTSGEN_CCSEN_POS (0U) +#define SDIOC_NORINTSGEN_CCSEN (0x0001U) +#define SDIOC_NORINTSGEN_TCSEN_POS (1U) +#define SDIOC_NORINTSGEN_TCSEN (0x0002U) +#define SDIOC_NORINTSGEN_BGESEN_POS (2U) +#define SDIOC_NORINTSGEN_BGESEN (0x0004U) +#define SDIOC_NORINTSGEN_BWRSEN_POS (4U) +#define SDIOC_NORINTSGEN_BWRSEN (0x0010U) +#define SDIOC_NORINTSGEN_BRRSEN_POS (5U) +#define SDIOC_NORINTSGEN_BRRSEN (0x0020U) +#define SDIOC_NORINTSGEN_CISTSEN_POS (6U) +#define SDIOC_NORINTSGEN_CISTSEN (0x0040U) +#define SDIOC_NORINTSGEN_CRMSEN_POS (7U) +#define SDIOC_NORINTSGEN_CRMSEN (0x0080U) +#define SDIOC_NORINTSGEN_CINTSEN_POS (8U) +#define SDIOC_NORINTSGEN_CINTSEN (0x0100U) + +/* Bit definition for SDIOC_ERRINTSGEN register */ +#define SDIOC_ERRINTSGEN_CTOESEN_POS (0U) +#define SDIOC_ERRINTSGEN_CTOESEN (0x0001U) +#define SDIOC_ERRINTSGEN_CCESEN_POS (1U) +#define SDIOC_ERRINTSGEN_CCESEN (0x0002U) +#define SDIOC_ERRINTSGEN_CEBESEN_POS (2U) +#define SDIOC_ERRINTSGEN_CEBESEN (0x0004U) +#define SDIOC_ERRINTSGEN_CIESEN_POS (3U) +#define SDIOC_ERRINTSGEN_CIESEN (0x0008U) +#define SDIOC_ERRINTSGEN_DTOESEN_POS (4U) +#define SDIOC_ERRINTSGEN_DTOESEN (0x0010U) +#define SDIOC_ERRINTSGEN_DCESEN_POS (5U) +#define SDIOC_ERRINTSGEN_DCESEN (0x0020U) +#define SDIOC_ERRINTSGEN_DEBESEN_POS (6U) +#define SDIOC_ERRINTSGEN_DEBESEN (0x0040U) +#define SDIOC_ERRINTSGEN_ACESEN_POS (8U) +#define SDIOC_ERRINTSGEN_ACESEN (0x0100U) + +/* Bit definition for SDIOC_ATCERRST register */ +#define SDIOC_ATCERRST_NE_POS (0U) +#define SDIOC_ATCERRST_NE (0x0001U) +#define SDIOC_ATCERRST_TOE_POS (1U) +#define SDIOC_ATCERRST_TOE (0x0002U) +#define SDIOC_ATCERRST_CE_POS (2U) +#define SDIOC_ATCERRST_CE (0x0004U) +#define SDIOC_ATCERRST_EBE_POS (3U) +#define SDIOC_ATCERRST_EBE (0x0008U) +#define SDIOC_ATCERRST_IE_POS (4U) +#define SDIOC_ATCERRST_IE (0x0010U) +#define SDIOC_ATCERRST_CMDE_POS (7U) +#define SDIOC_ATCERRST_CMDE (0x0080U) + +/* Bit definition for SDIOC_FEA register */ +#define SDIOC_FEA_FNE_POS (0U) +#define SDIOC_FEA_FNE (0x0001U) +#define SDIOC_FEA_FTOE_POS (1U) +#define SDIOC_FEA_FTOE (0x0002U) +#define SDIOC_FEA_FCE_POS (2U) +#define SDIOC_FEA_FCE (0x0004U) +#define SDIOC_FEA_FEBE_POS (3U) +#define SDIOC_FEA_FEBE (0x0008U) +#define SDIOC_FEA_FIE_POS (4U) +#define SDIOC_FEA_FIE (0x0010U) +#define SDIOC_FEA_FCMDE_POS (7U) +#define SDIOC_FEA_FCMDE (0x0080U) + +/* Bit definition for SDIOC_FEE register */ +#define SDIOC_FEE_FCTOE_POS (0U) +#define SDIOC_FEE_FCTOE (0x0001U) +#define SDIOC_FEE_FCCE_POS (1U) +#define SDIOC_FEE_FCCE (0x0002U) +#define SDIOC_FEE_FCEBE_POS (2U) +#define SDIOC_FEE_FCEBE (0x0004U) +#define SDIOC_FEE_FCIE_POS (3U) +#define SDIOC_FEE_FCIE (0x0008U) +#define SDIOC_FEE_FDTOE_POS (4U) +#define SDIOC_FEE_FDTOE (0x0010U) +#define SDIOC_FEE_FDCE_POS (5U) +#define SDIOC_FEE_FDCE (0x0020U) +#define SDIOC_FEE_FDEBE_POS (6U) +#define SDIOC_FEE_FDEBE (0x0040U) +#define SDIOC_FEE_FACE_POS (8U) +#define SDIOC_FEE_FACE (0x0100U) + +/******************************************************************************* + Bit definition for Peripheral SMC +*******************************************************************************/ +/* Bit definition for SMC_STSR register */ +#define SMC_STSR_STATUS (0x00000001UL) + +/* Bit definition for SMC_STCR0 register */ +#define SMC_STCR0_LPWIR_POS (2U) +#define SMC_STCR0_LPWIR (0x00000004UL) + +/* Bit definition for SMC_STCR1 register */ +#define SMC_STCR1_LPWOR_POS (2U) +#define SMC_STCR1_LPWOR (0x00000004UL) + +/* Bit definition for SMC_CMDR register */ +#define SMC_CMDR_CMDADD_POS (0U) +#define SMC_CMDR_CMDADD (0x000FFFFFUL) +#define SMC_CMDR_CRES_POS (20U) +#define SMC_CMDR_CRES (0x00100000UL) +#define SMC_CMDR_CMD_POS (21U) +#define SMC_CMDR_CMD (0x00600000UL) +#define SMC_CMDR_CMD_0 (0x00200000UL) +#define SMC_CMDR_CMD_1 (0x00400000UL) +#define SMC_CMDR_CMDCHIP_POS (23U) +#define SMC_CMDR_CMDCHIP (0x03800000UL) +#define SMC_CMDR_CMDCHIP_0 (0x00800000UL) +#define SMC_CMDR_CMDCHIP_1 (0x01000000UL) +#define SMC_CMDR_CMDCHIP_2 (0x02000000UL) + +/* Bit definition for SMC_TMCR register */ +#define SMC_TMCR_T_RC_POS (0U) +#define SMC_TMCR_T_RC (0x0000000FUL) +#define SMC_TMCR_T_WC_POS (4U) +#define SMC_TMCR_T_WC (0x000000F0UL) +#define SMC_TMCR_T_CEOE_POS (8U) +#define SMC_TMCR_T_CEOE (0x00000700UL) +#define SMC_TMCR_T_WP_POS (12U) +#define SMC_TMCR_T_WP (0x00007000UL) +#define SMC_TMCR_T_PC_POS (16U) +#define SMC_TMCR_T_PC (0x00070000UL) +#define SMC_TMCR_T_TR_POS (20U) +#define SMC_TMCR_T_TR (0x00700000UL) + +/* Bit definition for SMC_CPCR register */ +#define SMC_CPCR_RSYN_POS (0U) +#define SMC_CPCR_RSYN (0x00000001UL) +#define SMC_CPCR_RBL_POS (1U) +#define SMC_CPCR_RBL (0x0000000EUL) +#define SMC_CPCR_RBL_0 (0x00000002UL) +#define SMC_CPCR_RBL_1 (0x00000004UL) +#define SMC_CPCR_RBL_2 (0x00000008UL) +#define SMC_CPCR_WSYN_POS (4U) +#define SMC_CPCR_WSYN (0x00000010UL) +#define SMC_CPCR_WBL_POS (5U) +#define SMC_CPCR_WBL (0x000000E0UL) +#define SMC_CPCR_WBL_0 (0x00000020UL) +#define SMC_CPCR_WBL_1 (0x00000040UL) +#define SMC_CPCR_WBL_2 (0x00000080UL) +#define SMC_CPCR_MW_POS (8U) +#define SMC_CPCR_MW (0x00000300UL) +#define SMC_CPCR_MW_0 (0x00000100UL) +#define SMC_CPCR_MW_1 (0x00000200UL) +#define SMC_CPCR_BAAS_POS (10U) +#define SMC_CPCR_BAAS (0x00000400UL) +#define SMC_CPCR_ADVS_POS (11U) +#define SMC_CPCR_ADVS (0x00000800UL) +#define SMC_CPCR_BLSS_POS (12U) +#define SMC_CPCR_BLSS (0x00001000UL) + +/* Bit definition for SMC_RFTR register */ +#define SMC_RFTR_REFPRD (0x0000000FUL) + +/* Bit definition for SMC_TMSR register */ +#define SMC_TMSR_T_RC_POS (0U) +#define SMC_TMSR_T_RC (0x0000000FUL) +#define SMC_TMSR_T_WC_POS (4U) +#define SMC_TMSR_T_WC (0x000000F0UL) +#define SMC_TMSR_T_CEOE_POS (8U) +#define SMC_TMSR_T_CEOE (0x00000700UL) +#define SMC_TMSR_T_WP_POS (12U) +#define SMC_TMSR_T_WP (0x00007000UL) +#define SMC_TMSR_T_PC_POS (16U) +#define SMC_TMSR_T_PC (0x00070000UL) +#define SMC_TMSR_T_TR_POS (20U) +#define SMC_TMSR_T_TR (0x00700000UL) + +/* Bit definition for SMC_CPSR register */ +#define SMC_CPSR_RSYN_POS (0U) +#define SMC_CPSR_RSYN (0x00000001UL) +#define SMC_CPSR_RBL_POS (1U) +#define SMC_CPSR_RBL (0x0000000EUL) +#define SMC_CPSR_RBL_0 (0x00000002UL) +#define SMC_CPSR_RBL_1 (0x00000004UL) +#define SMC_CPSR_RBL_2 (0x00000008UL) +#define SMC_CPSR_WSYN_POS (4U) +#define SMC_CPSR_WSYN (0x00000010UL) +#define SMC_CPSR_WBL_POS (5U) +#define SMC_CPSR_WBL (0x000000E0UL) +#define SMC_CPSR_WBL_0 (0x00000020UL) +#define SMC_CPSR_WBL_1 (0x00000040UL) +#define SMC_CPSR_WBL_2 (0x00000080UL) +#define SMC_CPSR_MW_POS (8U) +#define SMC_CPSR_MW (0x00000300UL) +#define SMC_CPSR_MW_0 (0x00000100UL) +#define SMC_CPSR_MW_1 (0x00000200UL) +#define SMC_CPSR_BAAS_POS (10U) +#define SMC_CPSR_BAAS (0x00000400UL) +#define SMC_CPSR_ADVS_POS (11U) +#define SMC_CPSR_ADVS (0x00000800UL) +#define SMC_CPSR_BLSS_POS (12U) +#define SMC_CPSR_BLSS (0x00001000UL) +#define SMC_CPSR_ADDMSK_POS (16U) +#define SMC_CPSR_ADDMSK (0x00FF0000UL) +#define SMC_CPSR_ADDMAT_POS (24U) +#define SMC_CPSR_ADDMAT (0xFF000000UL) + +/* Bit definition for SMC_BACR register */ +#define SMC_BACR_MUXMD_POS (4U) +#define SMC_BACR_MUXMD (0x00000010UL) + +/* Bit definition for SMC_CSCR0 register */ +#define SMC_CSCR0_ADDMSK0_POS (0U) +#define SMC_CSCR0_ADDMSK0 (0x000000FFUL) +#define SMC_CSCR0_ADDMSK1_POS (8U) +#define SMC_CSCR0_ADDMSK1 (0x0000FF00UL) +#define SMC_CSCR0_ADDMSK2_POS (16U) +#define SMC_CSCR0_ADDMSK2 (0x00FF0000UL) +#define SMC_CSCR0_ADDMSK3_POS (24U) +#define SMC_CSCR0_ADDMSK3 (0xFF000000UL) + +/* Bit definition for SMC_CSCR1 register */ +#define SMC_CSCR1_ADDMAT0_POS (0U) +#define SMC_CSCR1_ADDMAT0 (0x000000FFUL) +#define SMC_CSCR1_ADDMAT1_POS (8U) +#define SMC_CSCR1_ADDMAT1 (0x0000FF00UL) +#define SMC_CSCR1_ADDMAT2_POS (16U) +#define SMC_CSCR1_ADDMAT2 (0x00FF0000UL) +#define SMC_CSCR1_ADDMAT3_POS (24U) +#define SMC_CSCR1_ADDMAT3 (0xFF000000UL) + +/******************************************************************************* + Bit definition for Peripheral SPI +*******************************************************************************/ +/* Bit definition for SPI_DR register */ +#define SPI_DR (0xFFFFFFFFUL) + +/* Bit definition for SPI_CR1 register */ +#define SPI_CR1_SPIMDS_POS (0U) +#define SPI_CR1_SPIMDS (0x00000001UL) +#define SPI_CR1_TXMDS_POS (1U) +#define SPI_CR1_TXMDS (0x00000002UL) +#define SPI_CR1_MSTR_POS (3U) +#define SPI_CR1_MSTR (0x00000008UL) +#define SPI_CR1_SPLPBK_POS (4U) +#define SPI_CR1_SPLPBK (0x00000010UL) +#define SPI_CR1_SPLPBK2_POS (5U) +#define SPI_CR1_SPLPBK2 (0x00000020UL) +#define SPI_CR1_SPE_POS (6U) +#define SPI_CR1_SPE (0x00000040UL) +#define SPI_CR1_CSUSPE_POS (7U) +#define SPI_CR1_CSUSPE (0x00000080UL) +#define SPI_CR1_EIE_POS (8U) +#define SPI_CR1_EIE (0x00000100UL) +#define SPI_CR1_TXIE_POS (9U) +#define SPI_CR1_TXIE (0x00000200UL) +#define SPI_CR1_RXIE_POS (10U) +#define SPI_CR1_RXIE (0x00000400UL) +#define SPI_CR1_IDIE_POS (11U) +#define SPI_CR1_IDIE (0x00000800UL) +#define SPI_CR1_MODFE_POS (12U) +#define SPI_CR1_MODFE (0x00001000UL) +#define SPI_CR1_PATE_POS (13U) +#define SPI_CR1_PATE (0x00002000UL) +#define SPI_CR1_PAOE_POS (14U) +#define SPI_CR1_PAOE (0x00004000UL) +#define SPI_CR1_PAE_POS (15U) +#define SPI_CR1_PAE (0x00008000UL) + +/* Bit definition for SPI_CFG1 register */ +#define SPI_CFG1_FTHLV_POS (0U) +#define SPI_CFG1_FTHLV (0x00000003UL) +#define SPI_CFG1_FTHLV_0 (0x00000001UL) +#define SPI_CFG1_FTHLV_1 (0x00000002UL) +#define SPI_CFG1_SPRDTD_POS (6U) +#define SPI_CFG1_SPRDTD (0x00000040UL) +#define SPI_CFG1_SS0PV_POS (8U) +#define SPI_CFG1_SS0PV (0x00000100UL) +#define SPI_CFG1_SS1PV_POS (9U) +#define SPI_CFG1_SS1PV (0x00000200UL) +#define SPI_CFG1_SS2PV_POS (10U) +#define SPI_CFG1_SS2PV (0x00000400UL) +#define SPI_CFG1_SS3PV_POS (11U) +#define SPI_CFG1_SS3PV (0x00000800UL) +#define SPI_CFG1_MSSI_POS (20U) +#define SPI_CFG1_MSSI (0x00700000UL) +#define SPI_CFG1_MSSI_0 (0x00100000UL) +#define SPI_CFG1_MSSI_1 (0x00200000UL) +#define SPI_CFG1_MSSI_2 (0x00400000UL) +#define SPI_CFG1_MSSDL_POS (24U) +#define SPI_CFG1_MSSDL (0x07000000UL) +#define SPI_CFG1_MSSDL_0 (0x01000000UL) +#define SPI_CFG1_MSSDL_1 (0x02000000UL) +#define SPI_CFG1_MSSDL_2 (0x04000000UL) +#define SPI_CFG1_MIDI_POS (28U) +#define SPI_CFG1_MIDI (0x70000000UL) +#define SPI_CFG1_MIDI_0 (0x10000000UL) +#define SPI_CFG1_MIDI_1 (0x20000000UL) +#define SPI_CFG1_MIDI_2 (0x40000000UL) + +/* Bit definition for SPI_SR register */ +#define SPI_SR_OVRERF_POS (0U) +#define SPI_SR_OVRERF (0x00000001UL) +#define SPI_SR_IDLNF_POS (1U) +#define SPI_SR_IDLNF (0x00000002UL) +#define SPI_SR_MODFERF_POS (2U) +#define SPI_SR_MODFERF (0x00000004UL) +#define SPI_SR_PERF_POS (3U) +#define SPI_SR_PERF (0x00000008UL) +#define SPI_SR_UDRERF_POS (4U) +#define SPI_SR_UDRERF (0x00000010UL) +#define SPI_SR_TDEF_POS (5U) +#define SPI_SR_TDEF (0x00000020UL) +#define SPI_SR_RDFF_POS (7U) +#define SPI_SR_RDFF (0x00000080UL) + +/* Bit definition for SPI_CFG2 register */ +#define SPI_CFG2_CPHA_POS (0U) +#define SPI_CFG2_CPHA (0x00000001UL) +#define SPI_CFG2_CPOL_POS (1U) +#define SPI_CFG2_CPOL (0x00000002UL) +#define SPI_CFG2_MBR_POS (2U) +#define SPI_CFG2_MBR (0x0000001CUL) +#define SPI_CFG2_MBR_0 (0x00000004UL) +#define SPI_CFG2_MBR_1 (0x00000008UL) +#define SPI_CFG2_MBR_2 (0x00000010UL) +#define SPI_CFG2_SSA_POS (5U) +#define SPI_CFG2_SSA (0x000000E0UL) +#define SPI_CFG2_SSA_0 (0x00000020UL) +#define SPI_CFG2_SSA_1 (0x00000040UL) +#define SPI_CFG2_SSA_2 (0x00000080UL) +#define SPI_CFG2_DSIZE_POS (8U) +#define SPI_CFG2_DSIZE (0x00000F00UL) +#define SPI_CFG2_DSIZE_0 (0x00000100UL) +#define SPI_CFG2_DSIZE_1 (0x00000200UL) +#define SPI_CFG2_DSIZE_2 (0x00000400UL) +#define SPI_CFG2_DSIZE_3 (0x00000800UL) +#define SPI_CFG2_LSBF_POS (12U) +#define SPI_CFG2_LSBF (0x00001000UL) +#define SPI_CFG2_MIDIE_POS (13U) +#define SPI_CFG2_MIDIE (0x00002000UL) +#define SPI_CFG2_MSSDLE_POS (14U) +#define SPI_CFG2_MSSDLE (0x00004000UL) +#define SPI_CFG2_MSSIE_POS (15U) +#define SPI_CFG2_MSSIE (0x00008000UL) + +/******************************************************************************* + Bit definition for Peripheral SRAMC +*******************************************************************************/ +/* Bit definition for SRAMC_WTCR register */ +#define SRAMC_WTCR_SRAM123RWT_POS (0U) +#define SRAMC_WTCR_SRAM123RWT (0x00000007UL) +#define SRAMC_WTCR_SRAM123RWT_0 (0x00000001UL) +#define SRAMC_WTCR_SRAM123RWT_1 (0x00000002UL) +#define SRAMC_WTCR_SRAM123RWT_2 (0x00000004UL) +#define SRAMC_WTCR_SRAM123WWT_POS (4U) +#define SRAMC_WTCR_SRAM123WWT (0x00000070UL) +#define SRAMC_WTCR_SRAM123WWT_0 (0x00000010UL) +#define SRAMC_WTCR_SRAM123WWT_1 (0x00000020UL) +#define SRAMC_WTCR_SRAM123WWT_2 (0x00000040UL) +#define SRAMC_WTCR_SRAM4RWT_POS (8U) +#define SRAMC_WTCR_SRAM4RWT (0x00000700UL) +#define SRAMC_WTCR_SRAM4RWT_0 (0x00000100UL) +#define SRAMC_WTCR_SRAM4RWT_1 (0x00000200UL) +#define SRAMC_WTCR_SRAM4RWT_2 (0x00000400UL) +#define SRAMC_WTCR_SRAM4WWT_POS (12U) +#define SRAMC_WTCR_SRAM4WWT (0x00007000UL) +#define SRAMC_WTCR_SRAM4WWT_0 (0x00001000UL) +#define SRAMC_WTCR_SRAM4WWT_1 (0x00002000UL) +#define SRAMC_WTCR_SRAM4WWT_2 (0x00004000UL) +#define SRAMC_WTCR_SRAMHRWT_POS (16U) +#define SRAMC_WTCR_SRAMHRWT (0x00070000UL) +#define SRAMC_WTCR_SRAMHRWT_0 (0x00010000UL) +#define SRAMC_WTCR_SRAMHRWT_1 (0x00020000UL) +#define SRAMC_WTCR_SRAMHRWT_2 (0x00040000UL) +#define SRAMC_WTCR_SRAMHWWT_POS (20U) +#define SRAMC_WTCR_SRAMHWWT (0x00700000UL) +#define SRAMC_WTCR_SRAMHWWT_0 (0x00100000UL) +#define SRAMC_WTCR_SRAMHWWT_1 (0x00200000UL) +#define SRAMC_WTCR_SRAMHWWT_2 (0x00400000UL) +#define SRAMC_WTCR_SRAMBRWT_POS (24U) +#define SRAMC_WTCR_SRAMBRWT (0x07000000UL) +#define SRAMC_WTCR_SRAMBRWT_0 (0x01000000UL) +#define SRAMC_WTCR_SRAMBRWT_1 (0x02000000UL) +#define SRAMC_WTCR_SRAMBRWT_2 (0x04000000UL) +#define SRAMC_WTCR_SRAMBWWT_POS (28U) +#define SRAMC_WTCR_SRAMBWWT (0x70000000UL) +#define SRAMC_WTCR_SRAMBWWT_0 (0x10000000UL) +#define SRAMC_WTCR_SRAMBWWT_1 (0x20000000UL) +#define SRAMC_WTCR_SRAMBWWT_2 (0x40000000UL) + +/* Bit definition for SRAMC_WTPR register */ +#define SRAMC_WTPR_WTPRC_POS (0U) +#define SRAMC_WTPR_WTPRC (0x00000001UL) +#define SRAMC_WTPR_WTPRKW_POS (1U) +#define SRAMC_WTPR_WTPRKW (0x000000FEUL) +#define SRAMC_WTPR_WTPRKW_0 (0x00000002UL) +#define SRAMC_WTPR_WTPRKW_1 (0x00000004UL) +#define SRAMC_WTPR_WTPRKW_2 (0x00000008UL) +#define SRAMC_WTPR_WTPRKW_3 (0x00000010UL) +#define SRAMC_WTPR_WTPRKW_4 (0x00000020UL) +#define SRAMC_WTPR_WTPRKW_5 (0x00000040UL) +#define SRAMC_WTPR_WTPRKW_6 (0x00000080UL) + +/* Bit definition for SRAMC_CKCR register */ +#define SRAMC_CKCR_PYOAD_POS (0U) +#define SRAMC_CKCR_PYOAD (0x00000001UL) +#define SRAMC_CKCR_ECCOAD_POS (16U) +#define SRAMC_CKCR_ECCOAD (0x00010000UL) +#define SRAMC_CKCR_BECCOAD_POS (17U) +#define SRAMC_CKCR_BECCOAD (0x00020000UL) +#define SRAMC_CKCR_ECCMOD_POS (24U) +#define SRAMC_CKCR_ECCMOD (0x03000000UL) +#define SRAMC_CKCR_ECCMOD_0 (0x01000000UL) +#define SRAMC_CKCR_ECCMOD_1 (0x02000000UL) +#define SRAMC_CKCR_BECCMOD_POS (26U) +#define SRAMC_CKCR_BECCMOD (0x0C000000UL) +#define SRAMC_CKCR_BECCMOD_0 (0x04000000UL) +#define SRAMC_CKCR_BECCMOD_1 (0x08000000UL) + +/* Bit definition for SRAMC_CKPR register */ +#define SRAMC_CKPR_CKPRC_POS (0U) +#define SRAMC_CKPR_CKPRC (0x00000001UL) +#define SRAMC_CKPR_CKPRKW_POS (1U) +#define SRAMC_CKPR_CKPRKW (0x000000FEUL) +#define SRAMC_CKPR_CKPRKW_0 (0x00000002UL) +#define SRAMC_CKPR_CKPRKW_1 (0x00000004UL) +#define SRAMC_CKPR_CKPRKW_2 (0x00000008UL) +#define SRAMC_CKPR_CKPRKW_3 (0x00000010UL) +#define SRAMC_CKPR_CKPRKW_4 (0x00000020UL) +#define SRAMC_CKPR_CKPRKW_5 (0x00000040UL) +#define SRAMC_CKPR_CKPRKW_6 (0x00000080UL) + +/* Bit definition for SRAMC_CKSR register */ +#define SRAMC_CKSR_SRAM1_PYERR_POS (0U) +#define SRAMC_CKSR_SRAM1_PYERR (0x00000001UL) +#define SRAMC_CKSR_SRAM2_PYERR_POS (1U) +#define SRAMC_CKSR_SRAM2_PYERR (0x00000002UL) +#define SRAMC_CKSR_SRAM3_PYERR_POS (2U) +#define SRAMC_CKSR_SRAM3_PYERR (0x00000004UL) +#define SRAMC_CKSR_SRAMH_PYERR_POS (3U) +#define SRAMC_CKSR_SRAMH_PYERR (0x00000008UL) +#define SRAMC_CKSR_SRAM4_1ERR_POS (4U) +#define SRAMC_CKSR_SRAM4_1ERR (0x00000010UL) +#define SRAMC_CKSR_SRAM4_2ERR_POS (5U) +#define SRAMC_CKSR_SRAM4_2ERR (0x00000020UL) +#define SRAMC_CKSR_SRAMB_1ERR_POS (6U) +#define SRAMC_CKSR_SRAMB_1ERR (0x00000040UL) +#define SRAMC_CKSR_SRAMB_2ERR_POS (7U) +#define SRAMC_CKSR_SRAMB_2ERR (0x00000080UL) +#define SRAMC_CKSR_CACHE_PYERR_POS (8U) +#define SRAMC_CKSR_CACHE_PYERR (0x00000100UL) + +/******************************************************************************* + Bit definition for Peripheral SWDT +*******************************************************************************/ +/* Bit definition for SWDT_CR register */ +#define SWDT_CR_PERI_POS (0U) +#define SWDT_CR_PERI (0x00000003UL) +#define SWDT_CR_PERI_0 (0x00000001UL) +#define SWDT_CR_PERI_1 (0x00000002UL) +#define SWDT_CR_CKS_POS (4U) +#define SWDT_CR_CKS (0x000000F0UL) +#define SWDT_CR_CKS_0 (0x00000010UL) +#define SWDT_CR_CKS_1 (0x00000020UL) +#define SWDT_CR_CKS_2 (0x00000040UL) +#define SWDT_CR_CKS_3 (0x00000080UL) +#define SWDT_CR_WDPT_POS (8U) +#define SWDT_CR_WDPT (0x00000F00UL) +#define SWDT_CR_WDPT_0 (0x00000100UL) +#define SWDT_CR_WDPT_1 (0x00000200UL) +#define SWDT_CR_WDPT_2 (0x00000400UL) +#define SWDT_CR_WDPT_3 (0x00000800UL) +#define SWDT_CR_SLPOFF_POS (16U) +#define SWDT_CR_SLPOFF (0x00010000UL) +#define SWDT_CR_ITS_POS (31U) +#define SWDT_CR_ITS (0x80000000UL) + +/* Bit definition for SWDT_SR register */ +#define SWDT_SR_CNT_POS (0U) +#define SWDT_SR_CNT (0x0000FFFFUL) +#define SWDT_SR_UDF_POS (16U) +#define SWDT_SR_UDF (0x00010000UL) +#define SWDT_SR_REF_POS (17U) +#define SWDT_SR_REF (0x00020000UL) + +/* Bit definition for SWDT_RR register */ +#define SWDT_RR_RF (0x0000FFFFUL) + +/******************************************************************************* + Bit definition for Peripheral TMR0 +*******************************************************************************/ +/* Bit definition for TMR0_CNTAR register */ +#define TMR0_CNTAR_CNTA (0x0000FFFFUL) + +/* Bit definition for TMR0_CNTBR register */ +#define TMR0_CNTBR_CNTB (0x0000FFFFUL) + +/* Bit definition for TMR0_CMPAR register */ +#define TMR0_CMPAR_CMPA (0x0000FFFFUL) + +/* Bit definition for TMR0_CMPBR register */ +#define TMR0_CMPBR_CMPB (0x0000FFFFUL) + +/* Bit definition for TMR0_BCONR register */ +#define TMR0_BCONR_CSTA_POS (0U) +#define TMR0_BCONR_CSTA (0x00000001UL) +#define TMR0_BCONR_CAPMDA_POS (1U) +#define TMR0_BCONR_CAPMDA (0x00000002UL) +#define TMR0_BCONR_INTENA_POS (2U) +#define TMR0_BCONR_INTENA (0x00000004UL) +#define TMR0_BCONR_CKDIVA_POS (4U) +#define TMR0_BCONR_CKDIVA (0x000000F0UL) +#define TMR0_BCONR_SYNSA_POS (8U) +#define TMR0_BCONR_SYNSA (0x00000100UL) +#define TMR0_BCONR_SYNCLKA_POS (9U) +#define TMR0_BCONR_SYNCLKA (0x00000200UL) +#define TMR0_BCONR_ASYNCLKA_POS (10U) +#define TMR0_BCONR_ASYNCLKA (0x00000400UL) +#define TMR0_BCONR_HSTAA_POS (12U) +#define TMR0_BCONR_HSTAA (0x00001000UL) +#define TMR0_BCONR_HSTPA_POS (13U) +#define TMR0_BCONR_HSTPA (0x00002000UL) +#define TMR0_BCONR_HCLEA_POS (14U) +#define TMR0_BCONR_HCLEA (0x00004000UL) +#define TMR0_BCONR_HICPA_POS (15U) +#define TMR0_BCONR_HICPA (0x00008000UL) +#define TMR0_BCONR_CSTB_POS (16U) +#define TMR0_BCONR_CSTB (0x00010000UL) +#define TMR0_BCONR_CAPMDB_POS (17U) +#define TMR0_BCONR_CAPMDB (0x00020000UL) +#define TMR0_BCONR_INTENB_POS (18U) +#define TMR0_BCONR_INTENB (0x00040000UL) +#define TMR0_BCONR_CKDIVB_POS (20U) +#define TMR0_BCONR_CKDIVB (0x00F00000UL) +#define TMR0_BCONR_SYNSB_POS (24U) +#define TMR0_BCONR_SYNSB (0x01000000UL) +#define TMR0_BCONR_SYNCLKB_POS (25U) +#define TMR0_BCONR_SYNCLKB (0x02000000UL) +#define TMR0_BCONR_ASYNCLKB_POS (26U) +#define TMR0_BCONR_ASYNCLKB (0x04000000UL) +#define TMR0_BCONR_HSTAB_POS (28U) +#define TMR0_BCONR_HSTAB (0x10000000UL) +#define TMR0_BCONR_HSTPB_POS (29U) +#define TMR0_BCONR_HSTPB (0x20000000UL) +#define TMR0_BCONR_HCLEB_POS (30U) +#define TMR0_BCONR_HCLEB (0x40000000UL) +#define TMR0_BCONR_HICPB_POS (31U) +#define TMR0_BCONR_HICPB (0x80000000UL) + +/* Bit definition for TMR0_STFLR register */ +#define TMR0_STFLR_CMFA_POS (0U) +#define TMR0_STFLR_CMFA (0x00000001UL) +#define TMR0_STFLR_CMFB_POS (16U) +#define TMR0_STFLR_CMFB (0x00010000UL) + +/******************************************************************************* + Bit definition for Peripheral TMR2 +*******************************************************************************/ +/* Bit definition for TMR2_CNTAR register */ +#define TMR2_CNTAR_CNTA (0x0000FFFFUL) + +/* Bit definition for TMR2_CNTBR register */ +#define TMR2_CNTBR_CNTB (0x0000FFFFUL) + +/* Bit definition for TMR2_CMPAR register */ +#define TMR2_CMPAR_CMPA (0x0000FFFFUL) + +/* Bit definition for TMR2_CMPBR register */ +#define TMR2_CMPBR_CMPB (0x0000FFFFUL) + +/* Bit definition for TMR2_BCONR register */ +#define TMR2_BCONR_CSTA_POS (0U) +#define TMR2_BCONR_CSTA (0x00000001UL) +#define TMR2_BCONR_CAPMDA_POS (1U) +#define TMR2_BCONR_CAPMDA (0x00000002UL) +#define TMR2_BCONR_SYNSA_POS (3U) +#define TMR2_BCONR_SYNSA (0x00000008UL) +#define TMR2_BCONR_CKDIVA_POS (4U) +#define TMR2_BCONR_CKDIVA (0x000000F0UL) +#define TMR2_BCONR_CKDIVA_0 (0x00000010UL) +#define TMR2_BCONR_CKDIVA_1 (0x00000020UL) +#define TMR2_BCONR_CKDIVA_2 (0x00000040UL) +#define TMR2_BCONR_CKDIVA_3 (0x00000080UL) +#define TMR2_BCONR_SYNCLKA_POS (8U) +#define TMR2_BCONR_SYNCLKA (0x00000300UL) +#define TMR2_BCONR_SYNCLKA_0 (0x00000100UL) +#define TMR2_BCONR_SYNCLKA_1 (0x00000200UL) +#define TMR2_BCONR_ASYNCLKA_POS (10U) +#define TMR2_BCONR_ASYNCLKA (0x00000C00UL) +#define TMR2_BCONR_ASYNCLKA_0 (0x00000400UL) +#define TMR2_BCONR_ASYNCLKA_1 (0x00000800UL) +#define TMR2_BCONR_SYNCLKAT_POS (12U) +#define TMR2_BCONR_SYNCLKAT (0x00003000UL) +#define TMR2_BCONR_SYNCLKAT_0 (0x00001000UL) +#define TMR2_BCONR_SYNCLKAT_1 (0x00002000UL) +#define TMR2_BCONR_CSTB_POS (16U) +#define TMR2_BCONR_CSTB (0x00010000UL) +#define TMR2_BCONR_CAPMDB_POS (17U) +#define TMR2_BCONR_CAPMDB (0x00020000UL) +#define TMR2_BCONR_SYNSB_POS (19U) +#define TMR2_BCONR_SYNSB (0x00080000UL) +#define TMR2_BCONR_CKDIVB_POS (20U) +#define TMR2_BCONR_CKDIVB (0x00F00000UL) +#define TMR2_BCONR_CKDIVB_0 (0x00100000UL) +#define TMR2_BCONR_CKDIVB_1 (0x00200000UL) +#define TMR2_BCONR_CKDIVB_2 (0x00400000UL) +#define TMR2_BCONR_CKDIVB_3 (0x00800000UL) +#define TMR2_BCONR_SYNCLKB_POS (24U) +#define TMR2_BCONR_SYNCLKB (0x03000000UL) +#define TMR2_BCONR_SYNCLKB_0 (0x01000000UL) +#define TMR2_BCONR_SYNCLKB_1 (0x02000000UL) +#define TMR2_BCONR_ASYNCLKB_POS (26U) +#define TMR2_BCONR_ASYNCLKB (0x0C000000UL) +#define TMR2_BCONR_ASYNCLKB_0 (0x04000000UL) +#define TMR2_BCONR_ASYNCLKB_1 (0x08000000UL) +#define TMR2_BCONR_SYNCLKBT_POS (28U) +#define TMR2_BCONR_SYNCLKBT (0x30000000UL) +#define TMR2_BCONR_SYNCLKBT_0 (0x10000000UL) +#define TMR2_BCONR_SYNCLKBT_1 (0x20000000UL) + +/* Bit definition for TMR2_ICONR register */ +#define TMR2_ICONR_CMENA_POS (0U) +#define TMR2_ICONR_CMENA (0x00000001UL) +#define TMR2_ICONR_OVENA_POS (1U) +#define TMR2_ICONR_OVENA (0x00000002UL) +#define TMR2_ICONR_CMENB_POS (16U) +#define TMR2_ICONR_CMENB (0x00010000UL) +#define TMR2_ICONR_OVENB_POS (17U) +#define TMR2_ICONR_OVENB (0x00020000UL) +#define TMR2_ICONR_RESV_POS (24U) +#define TMR2_ICONR_RESV (0x01000000UL) + +/* Bit definition for TMR2_PCONR register */ +#define TMR2_PCONR_STACA_POS (0U) +#define TMR2_PCONR_STACA (0x00000003UL) +#define TMR2_PCONR_STACA_0 (0x00000001UL) +#define TMR2_PCONR_STACA_1 (0x00000002UL) +#define TMR2_PCONR_STPCA_POS (2U) +#define TMR2_PCONR_STPCA (0x0000000CUL) +#define TMR2_PCONR_STPCA_0 (0x00000004UL) +#define TMR2_PCONR_STPCA_1 (0x00000008UL) +#define TMR2_PCONR_CMPCA_POS (4U) +#define TMR2_PCONR_CMPCA (0x00000030UL) +#define TMR2_PCONR_CMPCA_0 (0x00000010UL) +#define TMR2_PCONR_CMPCA_1 (0x00000020UL) +#define TMR2_PCONR_OUTENA_POS (8U) +#define TMR2_PCONR_OUTENA (0x00000100UL) +#define TMR2_PCONR_NOFIENA_POS (12U) +#define TMR2_PCONR_NOFIENA (0x00001000UL) +#define TMR2_PCONR_NOFICKA_POS (13U) +#define TMR2_PCONR_NOFICKA (0x00006000UL) +#define TMR2_PCONR_NOFICKA_0 (0x00002000UL) +#define TMR2_PCONR_NOFICKA_1 (0x00004000UL) +#define TMR2_PCONR_STACB_POS (16U) +#define TMR2_PCONR_STACB (0x00030000UL) +#define TMR2_PCONR_STACB_0 (0x00010000UL) +#define TMR2_PCONR_STACB_1 (0x00020000UL) +#define TMR2_PCONR_STPCB_POS (18U) +#define TMR2_PCONR_STPCB (0x000C0000UL) +#define TMR2_PCONR_STPCB_0 (0x00040000UL) +#define TMR2_PCONR_STPCB_1 (0x00080000UL) +#define TMR2_PCONR_CMPCB_POS (20U) +#define TMR2_PCONR_CMPCB (0x00300000UL) +#define TMR2_PCONR_CMPCB_0 (0x00100000UL) +#define TMR2_PCONR_CMPCB_1 (0x00200000UL) +#define TMR2_PCONR_OUTENB_POS (24U) +#define TMR2_PCONR_OUTENB (0x01000000UL) +#define TMR2_PCONR_NOFIENB_POS (28U) +#define TMR2_PCONR_NOFIENB (0x10000000UL) +#define TMR2_PCONR_NOFICKB_POS (29U) +#define TMR2_PCONR_NOFICKB (0x60000000UL) +#define TMR2_PCONR_NOFICKB_0 (0x20000000UL) +#define TMR2_PCONR_NOFICKB_1 (0x40000000UL) + +/* Bit definition for TMR2_HCONR register */ +#define TMR2_HCONR_HSTAA0_POS (0U) +#define TMR2_HCONR_HSTAA0 (0x00000001UL) +#define TMR2_HCONR_HSTAA1_POS (1U) +#define TMR2_HCONR_HSTAA1 (0x00000002UL) +#define TMR2_HCONR_HSTAA2_POS (2U) +#define TMR2_HCONR_HSTAA2 (0x00000004UL) +#define TMR2_HCONR_HSTPA0_POS (4U) +#define TMR2_HCONR_HSTPA0 (0x00000010UL) +#define TMR2_HCONR_HSTPA1_POS (5U) +#define TMR2_HCONR_HSTPA1 (0x00000020UL) +#define TMR2_HCONR_HSTPA2_POS (6U) +#define TMR2_HCONR_HSTPA2 (0x00000040UL) +#define TMR2_HCONR_HCLEA0_POS (8U) +#define TMR2_HCONR_HCLEA0 (0x00000100UL) +#define TMR2_HCONR_HCLEA1_POS (9U) +#define TMR2_HCONR_HCLEA1 (0x00000200UL) +#define TMR2_HCONR_HCLEA2_POS (10U) +#define TMR2_HCONR_HCLEA2 (0x00000400UL) +#define TMR2_HCONR_HICPA0_POS (12U) +#define TMR2_HCONR_HICPA0 (0x00001000UL) +#define TMR2_HCONR_HICPA1_POS (13U) +#define TMR2_HCONR_HICPA1 (0x00002000UL) +#define TMR2_HCONR_HICPA2_POS (14U) +#define TMR2_HCONR_HICPA2 (0x00004000UL) +#define TMR2_HCONR_HSTAB0_POS (16U) +#define TMR2_HCONR_HSTAB0 (0x00010000UL) +#define TMR2_HCONR_HSTAB1_POS (17U) +#define TMR2_HCONR_HSTAB1 (0x00020000UL) +#define TMR2_HCONR_HSTAB2_POS (18U) +#define TMR2_HCONR_HSTAB2 (0x00040000UL) +#define TMR2_HCONR_HSTPB0_POS (20U) +#define TMR2_HCONR_HSTPB0 (0x00100000UL) +#define TMR2_HCONR_HSTPB1_POS (21U) +#define TMR2_HCONR_HSTPB1 (0x00200000UL) +#define TMR2_HCONR_HSTPB2_POS (22U) +#define TMR2_HCONR_HSTPB2 (0x00400000UL) +#define TMR2_HCONR_HCLEB0_POS (24U) +#define TMR2_HCONR_HCLEB0 (0x01000000UL) +#define TMR2_HCONR_HCLEB1_POS (25U) +#define TMR2_HCONR_HCLEB1 (0x02000000UL) +#define TMR2_HCONR_HCLEB2_POS (26U) +#define TMR2_HCONR_HCLEB2 (0x04000000UL) +#define TMR2_HCONR_HICPB0_POS (28U) +#define TMR2_HCONR_HICPB0 (0x10000000UL) +#define TMR2_HCONR_HICPB1_POS (29U) +#define TMR2_HCONR_HICPB1 (0x20000000UL) +#define TMR2_HCONR_HICPB2_POS (30U) +#define TMR2_HCONR_HICPB2 (0x40000000UL) + +/* Bit definition for TMR2_STFLR register */ +#define TMR2_STFLR_CMFA_POS (0U) +#define TMR2_STFLR_CMFA (0x00000001UL) +#define TMR2_STFLR_OVFA_POS (1U) +#define TMR2_STFLR_OVFA (0x00000002UL) +#define TMR2_STFLR_CMFB_POS (16U) +#define TMR2_STFLR_CMFB (0x00010000UL) +#define TMR2_STFLR_OVFB_POS (17U) +#define TMR2_STFLR_OVFB (0x00020000UL) +#define TMR2_STFLR_RESV_POS (24U) +#define TMR2_STFLR_RESV (0x01000000UL) + +/******************************************************************************* + Bit definition for Peripheral TMR4 +*******************************************************************************/ +/* Bit definition for TMR4_OCCRUH register */ +#define TMR4_OCCRUH (0xFFFFU) + +/* Bit definition for TMR4_OCCRUL register */ +#define TMR4_OCCRUL (0xFFFFU) + +/* Bit definition for TMR4_OCCRVH register */ +#define TMR4_OCCRVH (0xFFFFU) + +/* Bit definition for TMR4_OCCRVL register */ +#define TMR4_OCCRVL (0xFFFFU) + +/* Bit definition for TMR4_OCCRWH register */ +#define TMR4_OCCRWH (0xFFFFU) + +/* Bit definition for TMR4_OCCRWL register */ +#define TMR4_OCCRWL (0xFFFFU) + +/* Bit definition for TMR4_OCSR register */ +#define TMR4_OCSR_OCEH_POS (0U) +#define TMR4_OCSR_OCEH (0x0001U) +#define TMR4_OCSR_OCEL_POS (1U) +#define TMR4_OCSR_OCEL (0x0002U) +#define TMR4_OCSR_OCPH_POS (2U) +#define TMR4_OCSR_OCPH (0x0004U) +#define TMR4_OCSR_OCPL_POS (3U) +#define TMR4_OCSR_OCPL (0x0008U) +#define TMR4_OCSR_OCIEH_POS (4U) +#define TMR4_OCSR_OCIEH (0x0010U) +#define TMR4_OCSR_OCIEL_POS (5U) +#define TMR4_OCSR_OCIEL (0x0020U) +#define TMR4_OCSR_OCFH_POS (6U) +#define TMR4_OCSR_OCFH (0x0040U) +#define TMR4_OCSR_OCFL_POS (7U) +#define TMR4_OCSR_OCFL (0x0080U) + +/* Bit definition for TMR4_OCER register */ +#define TMR4_OCER_CHBUFEN_POS (0U) +#define TMR4_OCER_CHBUFEN (0x0003U) +#define TMR4_OCER_CHBUFEN_0 (0x0001U) +#define TMR4_OCER_CHBUFEN_1 (0x0002U) +#define TMR4_OCER_CLBUFEN_POS (2U) +#define TMR4_OCER_CLBUFEN (0x000CU) +#define TMR4_OCER_CLBUFEN_0 (0x0004U) +#define TMR4_OCER_CLBUFEN_1 (0x0008U) +#define TMR4_OCER_MHBUFEN_POS (4U) +#define TMR4_OCER_MHBUFEN (0x0030U) +#define TMR4_OCER_MHBUFEN_0 (0x0010U) +#define TMR4_OCER_MHBUFEN_1 (0x0020U) +#define TMR4_OCER_MLBUFEN_POS (6U) +#define TMR4_OCER_MLBUFEN (0x00C0U) +#define TMR4_OCER_MLBUFEN_0 (0x0040U) +#define TMR4_OCER_MLBUFEN_1 (0x0080U) +#define TMR4_OCER_LMCH_POS (8U) +#define TMR4_OCER_LMCH (0x0100U) +#define TMR4_OCER_LMCL_POS (9U) +#define TMR4_OCER_LMCL (0x0200U) +#define TMR4_OCER_LMMH_POS (10U) +#define TMR4_OCER_LMMH (0x0400U) +#define TMR4_OCER_LMML_POS (11U) +#define TMR4_OCER_LMML (0x0800U) +#define TMR4_OCER_MCECH_POS (12U) +#define TMR4_OCER_MCECH (0x1000U) +#define TMR4_OCER_MCECL_POS (13U) +#define TMR4_OCER_MCECL (0x2000U) + +/* Bit definition for TMR4_OCMRH register */ +#define TMR4_OCMRH_OCFDCH_POS (0U) +#define TMR4_OCMRH_OCFDCH (0x0001U) +#define TMR4_OCMRH_OCFPKH_POS (1U) +#define TMR4_OCMRH_OCFPKH (0x0002U) +#define TMR4_OCMRH_OCFUCH_POS (2U) +#define TMR4_OCMRH_OCFUCH (0x0004U) +#define TMR4_OCMRH_OCFZRH_POS (3U) +#define TMR4_OCMRH_OCFZRH (0x0008U) +#define TMR4_OCMRH_OPDCH_POS (4U) +#define TMR4_OCMRH_OPDCH (0x0030U) +#define TMR4_OCMRH_OPDCH_0 (0x0010U) +#define TMR4_OCMRH_OPDCH_1 (0x0020U) +#define TMR4_OCMRH_OPPKH_POS (6U) +#define TMR4_OCMRH_OPPKH (0x00C0U) +#define TMR4_OCMRH_OPPKH_0 (0x0040U) +#define TMR4_OCMRH_OPPKH_1 (0x0080U) +#define TMR4_OCMRH_OPUCH_POS (8U) +#define TMR4_OCMRH_OPUCH (0x0300U) +#define TMR4_OCMRH_OPUCH_0 (0x0100U) +#define TMR4_OCMRH_OPUCH_1 (0x0200U) +#define TMR4_OCMRH_OPZRH_POS (10U) +#define TMR4_OCMRH_OPZRH (0x0C00U) +#define TMR4_OCMRH_OPZRH_0 (0x0400U) +#define TMR4_OCMRH_OPZRH_1 (0x0800U) +#define TMR4_OCMRH_OPNPKH_POS (12U) +#define TMR4_OCMRH_OPNPKH (0x3000U) +#define TMR4_OCMRH_OPNPKH_0 (0x1000U) +#define TMR4_OCMRH_OPNPKH_1 (0x2000U) +#define TMR4_OCMRH_OPNZRH_POS (14U) +#define TMR4_OCMRH_OPNZRH (0xC000U) +#define TMR4_OCMRH_OPNZRH_0 (0x4000U) +#define TMR4_OCMRH_OPNZRH_1 (0x8000U) + +/* Bit definition for TMR4_OCMRL register */ +#define TMR4_OCMRL_OCFDCL_POS (0U) +#define TMR4_OCMRL_OCFDCL (0x00000001UL) +#define TMR4_OCMRL_OCFPKL_POS (1U) +#define TMR4_OCMRL_OCFPKL (0x00000002UL) +#define TMR4_OCMRL_OCFUCL_POS (2U) +#define TMR4_OCMRL_OCFUCL (0x00000004UL) +#define TMR4_OCMRL_OCFZRL_POS (3U) +#define TMR4_OCMRL_OCFZRL (0x00000008UL) +#define TMR4_OCMRL_OPDCL_POS (4U) +#define TMR4_OCMRL_OPDCL (0x00000030UL) +#define TMR4_OCMRL_OPDCL_0 (0x00000010UL) +#define TMR4_OCMRL_OPDCL_1 (0x00000020UL) +#define TMR4_OCMRL_OPPKL_POS (6U) +#define TMR4_OCMRL_OPPKL (0x000000C0UL) +#define TMR4_OCMRL_OPPKL_0 (0x00000040UL) +#define TMR4_OCMRL_OPPKL_1 (0x00000080UL) +#define TMR4_OCMRL_OPUCL_POS (8U) +#define TMR4_OCMRL_OPUCL (0x00000300UL) +#define TMR4_OCMRL_OPUCL_0 (0x00000100UL) +#define TMR4_OCMRL_OPUCL_1 (0x00000200UL) +#define TMR4_OCMRL_OPZRL_POS (10U) +#define TMR4_OCMRL_OPZRL (0x00000C00UL) +#define TMR4_OCMRL_OPZRL_0 (0x00000400UL) +#define TMR4_OCMRL_OPZRL_1 (0x00000800UL) +#define TMR4_OCMRL_OPNPKL_POS (12U) +#define TMR4_OCMRL_OPNPKL (0x00003000UL) +#define TMR4_OCMRL_OPNPKL_0 (0x00001000UL) +#define TMR4_OCMRL_OPNPKL_1 (0x00002000UL) +#define TMR4_OCMRL_OPNZRL_POS (14U) +#define TMR4_OCMRL_OPNZRL (0x0000C000UL) +#define TMR4_OCMRL_OPNZRL_0 (0x00004000UL) +#define TMR4_OCMRL_OPNZRL_1 (0x00008000UL) +#define TMR4_OCMRL_EOPNDCL_POS (16U) +#define TMR4_OCMRL_EOPNDCL (0x00030000UL) +#define TMR4_OCMRL_EOPNDCL_0 (0x00010000UL) +#define TMR4_OCMRL_EOPNDCL_1 (0x00020000UL) +#define TMR4_OCMRL_EOPNUCL_POS (18U) +#define TMR4_OCMRL_EOPNUCL (0x000C0000UL) +#define TMR4_OCMRL_EOPNUCL_0 (0x00040000UL) +#define TMR4_OCMRL_EOPNUCL_1 (0x00080000UL) +#define TMR4_OCMRL_EOPDCL_POS (20U) +#define TMR4_OCMRL_EOPDCL (0x00300000UL) +#define TMR4_OCMRL_EOPDCL_0 (0x00100000UL) +#define TMR4_OCMRL_EOPDCL_1 (0x00200000UL) +#define TMR4_OCMRL_EOPPKL_POS (22U) +#define TMR4_OCMRL_EOPPKL (0x00C00000UL) +#define TMR4_OCMRL_EOPPKL_0 (0x00400000UL) +#define TMR4_OCMRL_EOPPKL_1 (0x00800000UL) +#define TMR4_OCMRL_EOPUCL_POS (24U) +#define TMR4_OCMRL_EOPUCL (0x03000000UL) +#define TMR4_OCMRL_EOPUCL_0 (0x01000000UL) +#define TMR4_OCMRL_EOPUCL_1 (0x02000000UL) +#define TMR4_OCMRL_EOPZRL_POS (26U) +#define TMR4_OCMRL_EOPZRL (0x0C000000UL) +#define TMR4_OCMRL_EOPZRL_0 (0x04000000UL) +#define TMR4_OCMRL_EOPZRL_1 (0x08000000UL) +#define TMR4_OCMRL_EOPNPKL_POS (28U) +#define TMR4_OCMRL_EOPNPKL (0x30000000UL) +#define TMR4_OCMRL_EOPNPKL_0 (0x10000000UL) +#define TMR4_OCMRL_EOPNPKL_1 (0x20000000UL) +#define TMR4_OCMRL_EOPNZRL_POS (30U) +#define TMR4_OCMRL_EOPNZRL (0xC0000000UL) +#define TMR4_OCMRL_EOPNZRL_0 (0x40000000UL) +#define TMR4_OCMRL_EOPNZRL_1 (0x80000000UL) + +/* Bit definition for TMR4_CPSR register */ +#define TMR4_CPSR (0xFFFFU) + +/* Bit definition for TMR4_CNTR register */ +#define TMR4_CNTR (0xFFFFU) + +/* Bit definition for TMR4_CCSR register */ +#define TMR4_CCSR_CKDIV_POS (0U) +#define TMR4_CCSR_CKDIV (0x000FU) +#define TMR4_CCSR_CKDIV_0 (0x0001U) +#define TMR4_CCSR_CKDIV_1 (0x0002U) +#define TMR4_CCSR_CKDIV_2 (0x0004U) +#define TMR4_CCSR_CKDIV_3 (0x0008U) +#define TMR4_CCSR_CLEAR_POS (4U) +#define TMR4_CCSR_CLEAR (0x0010U) +#define TMR4_CCSR_MODE_POS (5U) +#define TMR4_CCSR_MODE (0x0020U) +#define TMR4_CCSR_STOP_POS (6U) +#define TMR4_CCSR_STOP (0x0040U) +#define TMR4_CCSR_BUFEN_POS (7U) +#define TMR4_CCSR_BUFEN (0x0080U) +#define TMR4_CCSR_IRQPEN_POS (8U) +#define TMR4_CCSR_IRQPEN (0x0100U) +#define TMR4_CCSR_IRQPF_POS (9U) +#define TMR4_CCSR_IRQPF (0x0200U) +#define TMR4_CCSR_IRQZEN_POS (13U) +#define TMR4_CCSR_IRQZEN (0x2000U) +#define TMR4_CCSR_IRQZF_POS (14U) +#define TMR4_CCSR_IRQZF (0x4000U) +#define TMR4_CCSR_ECKEN_POS (15U) +#define TMR4_CCSR_ECKEN (0x8000U) + +/* Bit definition for TMR4_CVPR register */ +#define TMR4_CVPR_ZIM_POS (0U) +#define TMR4_CVPR_ZIM (0x000FU) +#define TMR4_CVPR_PIM_POS (4U) +#define TMR4_CVPR_PIM (0x00F0U) +#define TMR4_CVPR_ZIC_POS (8U) +#define TMR4_CVPR_ZIC (0x0F00U) +#define TMR4_CVPR_PIC_POS (12U) +#define TMR4_CVPR_PIC (0xF000U) + +/* Bit definition for TMR4_PFSRU register */ +#define TMR4_PFSRU (0xFFFFU) + +/* Bit definition for TMR4_PDARU register */ +#define TMR4_PDARU (0xFFFFU) + +/* Bit definition for TMR4_PDBRU register */ +#define TMR4_PDBRU (0xFFFFU) + +/* Bit definition for TMR4_PFSRV register */ +#define TMR4_PFSRV (0xFFFFU) + +/* Bit definition for TMR4_PDARV register */ +#define TMR4_PDARV (0xFFFFU) + +/* Bit definition for TMR4_PDBRV register */ +#define TMR4_PDBRV (0xFFFFU) + +/* Bit definition for TMR4_PFSRW register */ +#define TMR4_PFSRW (0xFFFFU) + +/* Bit definition for TMR4_PDARW register */ +#define TMR4_PDARW (0xFFFFU) + +/* Bit definition for TMR4_PDBRW register */ +#define TMR4_PDBRW (0xFFFFU) + +/* Bit definition for TMR4_POCR register */ +#define TMR4_POCR_DIVCK_POS (0U) +#define TMR4_POCR_DIVCK (0x0007U) +#define TMR4_POCR_DIVCK_0 (0x0001U) +#define TMR4_POCR_DIVCK_1 (0x0002U) +#define TMR4_POCR_DIVCK_2 (0x0004U) +#define TMR4_POCR_PWMMD_POS (4U) +#define TMR4_POCR_PWMMD (0x0030U) +#define TMR4_POCR_PWMMD_0 (0x0010U) +#define TMR4_POCR_PWMMD_1 (0x0020U) +#define TMR4_POCR_LVLS_POS (6U) +#define TMR4_POCR_LVLS (0x00C0U) +#define TMR4_POCR_LVLS_0 (0x0040U) +#define TMR4_POCR_LVLS_1 (0x0080U) + +/* Bit definition for TMR4_RCSR register */ +#define TMR4_RCSR_RTIDU_POS (0U) +#define TMR4_RCSR_RTIDU (0x0001U) +#define TMR4_RCSR_RTIDV_POS (1U) +#define TMR4_RCSR_RTIDV (0x0002U) +#define TMR4_RCSR_RTIDW_POS (2U) +#define TMR4_RCSR_RTIDW (0x0004U) +#define TMR4_RCSR_RTIFU_POS (4U) +#define TMR4_RCSR_RTIFU (0x0010U) +#define TMR4_RCSR_RTICU_POS (5U) +#define TMR4_RCSR_RTICU (0x0020U) +#define TMR4_RCSR_RTEU_POS (6U) +#define TMR4_RCSR_RTEU (0x0040U) +#define TMR4_RCSR_RTSU_POS (7U) +#define TMR4_RCSR_RTSU (0x0080U) +#define TMR4_RCSR_RTIFV_POS (8U) +#define TMR4_RCSR_RTIFV (0x0100U) +#define TMR4_RCSR_RTICV_POS (9U) +#define TMR4_RCSR_RTICV (0x0200U) +#define TMR4_RCSR_RTEV_POS (10U) +#define TMR4_RCSR_RTEV (0x0400U) +#define TMR4_RCSR_RTSV_POS (11U) +#define TMR4_RCSR_RTSV (0x0800U) +#define TMR4_RCSR_RTIFW_POS (12U) +#define TMR4_RCSR_RTIFW (0x1000U) +#define TMR4_RCSR_RTICW_POS (13U) +#define TMR4_RCSR_RTICW (0x2000U) +#define TMR4_RCSR_RTEW_POS (14U) +#define TMR4_RCSR_RTEW (0x4000U) +#define TMR4_RCSR_RTSW_POS (15U) +#define TMR4_RCSR_RTSW (0x8000U) + +/* Bit definition for TMR4_SCCRUH register */ +#define TMR4_SCCRUH (0xFFFFU) + +/* Bit definition for TMR4_SCCRUL register */ +#define TMR4_SCCRUL (0xFFFFU) + +/* Bit definition for TMR4_SCCRVH register */ +#define TMR4_SCCRVH (0xFFFFU) + +/* Bit definition for TMR4_SCCRVL register */ +#define TMR4_SCCRVL (0xFFFFU) + +/* Bit definition for TMR4_SCCRWH register */ +#define TMR4_SCCRWH (0xFFFFU) + +/* Bit definition for TMR4_SCCRWL register */ +#define TMR4_SCCRWL (0xFFFFU) + +/* Bit definition for TMR4_SCSR register */ +#define TMR4_SCSR_BUFEN_POS (0U) +#define TMR4_SCSR_BUFEN (0x0003U) +#define TMR4_SCSR_BUFEN_0 (0x0001U) +#define TMR4_SCSR_BUFEN_1 (0x0002U) +#define TMR4_SCSR_EVTOS_POS (2U) +#define TMR4_SCSR_EVTOS (0x001CU) +#define TMR4_SCSR_EVTOS_0 (0x0004U) +#define TMR4_SCSR_EVTOS_1 (0x0008U) +#define TMR4_SCSR_EVTOS_2 (0x0010U) +#define TMR4_SCSR_LMC_POS (5U) +#define TMR4_SCSR_LMC (0x0020U) +#define TMR4_SCSR_EVTMS_POS (8U) +#define TMR4_SCSR_EVTMS (0x0100U) +#define TMR4_SCSR_EVTDS_POS (9U) +#define TMR4_SCSR_EVTDS (0x0200U) +#define TMR4_SCSR_DEN_POS (12U) +#define TMR4_SCSR_DEN (0x1000U) +#define TMR4_SCSR_PEN_POS (13U) +#define TMR4_SCSR_PEN (0x2000U) +#define TMR4_SCSR_UEN_POS (14U) +#define TMR4_SCSR_UEN (0x4000U) +#define TMR4_SCSR_ZEN_POS (15U) +#define TMR4_SCSR_ZEN (0x8000U) + +/* Bit definition for TMR4_SCMR register */ +#define TMR4_SCMR_AMC_POS (0U) +#define TMR4_SCMR_AMC (0x000FU) +#define TMR4_SCMR_MZCE_POS (6U) +#define TMR4_SCMR_MZCE (0x0040U) +#define TMR4_SCMR_MPCE_POS (7U) +#define TMR4_SCMR_MPCE (0x0080U) + +/* Bit definition for TMR4_PSCR register */ +#define TMR4_PSCR_OEUH_POS (0U) +#define TMR4_PSCR_OEUH (0x00000001UL) +#define TMR4_PSCR_OEUL_POS (1U) +#define TMR4_PSCR_OEUL (0x00000002UL) +#define TMR4_PSCR_OEVH_POS (2U) +#define TMR4_PSCR_OEVH (0x00000004UL) +#define TMR4_PSCR_OEVL_POS (3U) +#define TMR4_PSCR_OEVL (0x00000008UL) +#define TMR4_PSCR_OEWH_POS (4U) +#define TMR4_PSCR_OEWH (0x00000010UL) +#define TMR4_PSCR_OEWL_POS (5U) +#define TMR4_PSCR_OEWL (0x00000020UL) +#define TMR4_PSCR_ODT_POS (6U) +#define TMR4_PSCR_ODT (0x000000C0UL) +#define TMR4_PSCR_ODT_0 (0x00000040UL) +#define TMR4_PSCR_ODT_1 (0x00000080UL) +#define TMR4_PSCR_MOE_POS (8U) +#define TMR4_PSCR_MOE (0x00000100UL) +#define TMR4_PSCR_AOE_POS (9U) +#define TMR4_PSCR_AOE (0x00000200UL) +#define TMR4_PSCR_OSUH_POS (16U) +#define TMR4_PSCR_OSUH (0x00030000UL) +#define TMR4_PSCR_OSUH_0 (0x00010000UL) +#define TMR4_PSCR_OSUH_1 (0x00020000UL) +#define TMR4_PSCR_OSUL_POS (18U) +#define TMR4_PSCR_OSUL (0x000C0000UL) +#define TMR4_PSCR_OSUL_0 (0x00040000UL) +#define TMR4_PSCR_OSUL_1 (0x00080000UL) +#define TMR4_PSCR_OSVH_POS (20U) +#define TMR4_PSCR_OSVH (0x00300000UL) +#define TMR4_PSCR_OSVH_0 (0x00100000UL) +#define TMR4_PSCR_OSVH_1 (0x00200000UL) +#define TMR4_PSCR_OSVL_POS (22U) +#define TMR4_PSCR_OSVL (0x00C00000UL) +#define TMR4_PSCR_OSVL_0 (0x00400000UL) +#define TMR4_PSCR_OSVL_1 (0x00800000UL) +#define TMR4_PSCR_OSWH_POS (24U) +#define TMR4_PSCR_OSWH (0x03000000UL) +#define TMR4_PSCR_OSWH_0 (0x01000000UL) +#define TMR4_PSCR_OSWH_1 (0x02000000UL) +#define TMR4_PSCR_OSWL_POS (26U) +#define TMR4_PSCR_OSWL (0x0C000000UL) +#define TMR4_PSCR_OSWL_0 (0x04000000UL) +#define TMR4_PSCR_OSWL_1 (0x08000000UL) + +/* Bit definition for TMR4_SCER register */ +#define TMR4_SCER_EVTRS_POS (0U) +#define TMR4_SCER_EVTRS (0x0007U) +#define TMR4_SCER_EVTRS_0 (0x0001U) +#define TMR4_SCER_EVTRS_1 (0x0002U) +#define TMR4_SCER_EVTRS_2 (0x0004U) +#define TMR4_SCER_PCTS_POS (3U) +#define TMR4_SCER_PCTS (0x0008U) + +/******************************************************************************* + Bit definition for Peripheral TMR6 +*******************************************************************************/ +/* Bit definition for TMR6_CNTER register */ +#define TMR6_CNTER (0xFFFFFFFFUL) + +/* Bit definition for TMR6_UPDAR register */ +#define TMR6_UPDAR (0xFFFFFFFFUL) + +/* Bit definition for TMR6_PERAR register */ +#define TMR6_PERAR (0xFFFFFFFFUL) + +/* Bit definition for TMR6_PERBR register */ +#define TMR6_PERBR (0xFFFFFFFFUL) + +/* Bit definition for TMR6_PERCR register */ +#define TMR6_PERCR (0xFFFFFFFFUL) + +/* Bit definition for TMR6_GCMAR register */ +#define TMR6_GCMAR (0xFFFFFFFFUL) + +/* Bit definition for TMR6_GCMBR register */ +#define TMR6_GCMBR (0xFFFFFFFFUL) + +/* Bit definition for TMR6_GCMCR register */ +#define TMR6_GCMCR (0xFFFFFFFFUL) + +/* Bit definition for TMR6_GCMDR register */ +#define TMR6_GCMDR (0xFFFFFFFFUL) + +/* Bit definition for TMR6_GCMER register */ +#define TMR6_GCMER (0xFFFFFFFFUL) + +/* Bit definition for TMR6_GCMFR register */ +#define TMR6_GCMFR (0xFFFFFFFFUL) + +/* Bit definition for TMR6_SCMAR register */ +#define TMR6_SCMAR (0xFFFFFFFFUL) + +/* Bit definition for TMR6_SCMBR register */ +#define TMR6_SCMBR (0xFFFFFFFFUL) + +/* Bit definition for TMR6_SCMCR register */ +#define TMR6_SCMCR (0xFFFFFFFFUL) + +/* Bit definition for TMR6_SCMDR register */ +#define TMR6_SCMDR (0xFFFFFFFFUL) + +/* Bit definition for TMR6_SCMER register */ +#define TMR6_SCMER (0xFFFFFFFFUL) + +/* Bit definition for TMR6_SCMFR register */ +#define TMR6_SCMFR (0xFFFFFFFFUL) + +/* Bit definition for TMR6_DTUAR register */ +#define TMR6_DTUAR (0xFFFFFFFFUL) + +/* Bit definition for TMR6_DTDAR register */ +#define TMR6_DTDAR (0xFFFFFFFFUL) + +/* Bit definition for TMR6_DTUBR register */ +#define TMR6_DTUBR (0xFFFFFFFFUL) + +/* Bit definition for TMR6_DTDBR register */ +#define TMR6_DTDBR (0xFFFFFFFFUL) + +/* Bit definition for TMR6_GCONR register */ +#define TMR6_GCONR_START_POS (0U) +#define TMR6_GCONR_START (0x00000001UL) +#define TMR6_GCONR_DIR_POS (1U) +#define TMR6_GCONR_DIR (0x00000002UL) +#define TMR6_GCONR_MODE_POS (2U) +#define TMR6_GCONR_MODE (0x00000004UL) +#define TMR6_GCONR_CKDIV_POS (4U) +#define TMR6_GCONR_CKDIV (0x000000F0UL) +#define TMR6_GCONR_CKDIV_0 (0x00000010UL) +#define TMR6_GCONR_CKDIV_1 (0x00000020UL) +#define TMR6_GCONR_CKDIV_2 (0x00000040UL) +#define TMR6_GCONR_CKDIV_3 (0x00000080UL) +#define TMR6_GCONR_OVSTP_POS (8U) +#define TMR6_GCONR_OVSTP (0x00000100UL) +#define TMR6_GCONR_ZMSKREV_POS (16U) +#define TMR6_GCONR_ZMSKREV (0x00010000UL) +#define TMR6_GCONR_ZMSKPOS_POS (17U) +#define TMR6_GCONR_ZMSKPOS (0x00020000UL) +#define TMR6_GCONR_ZMSKVAL_POS (18U) +#define TMR6_GCONR_ZMSKVAL (0x000C0000UL) +#define TMR6_GCONR_ZMSKVAL_0 (0x00040000UL) +#define TMR6_GCONR_ZMSKVAL_1 (0x00080000UL) + +/* Bit definition for TMR6_ICONR register */ +#define TMR6_ICONR_INTENA_POS (0U) +#define TMR6_ICONR_INTENA (0x00000001UL) +#define TMR6_ICONR_INTENB_POS (1U) +#define TMR6_ICONR_INTENB (0x00000002UL) +#define TMR6_ICONR_INTENC_POS (2U) +#define TMR6_ICONR_INTENC (0x00000004UL) +#define TMR6_ICONR_INTEND_POS (3U) +#define TMR6_ICONR_INTEND (0x00000008UL) +#define TMR6_ICONR_INTENE_POS (4U) +#define TMR6_ICONR_INTENE (0x00000010UL) +#define TMR6_ICONR_INTENF_POS (5U) +#define TMR6_ICONR_INTENF (0x00000020UL) +#define TMR6_ICONR_INTENOVF_POS (6U) +#define TMR6_ICONR_INTENOVF (0x00000040UL) +#define TMR6_ICONR_INTENUDF_POS (7U) +#define TMR6_ICONR_INTENUDF (0x00000080UL) +#define TMR6_ICONR_INTENDTE_POS (8U) +#define TMR6_ICONR_INTENDTE (0x00000100UL) +#define TMR6_ICONR_INTENSAU_POS (16U) +#define TMR6_ICONR_INTENSAU (0x00010000UL) +#define TMR6_ICONR_INTENSAD_POS (17U) +#define TMR6_ICONR_INTENSAD (0x00020000UL) +#define TMR6_ICONR_INTENSBU_POS (18U) +#define TMR6_ICONR_INTENSBU (0x00040000UL) +#define TMR6_ICONR_INTENSBD_POS (19U) +#define TMR6_ICONR_INTENSBD (0x00080000UL) + +/* Bit definition for TMR6_BCONR register */ +#define TMR6_BCONR_BENA_POS (0U) +#define TMR6_BCONR_BENA (0x00000001UL) +#define TMR6_BCONR_BSEA_POS (1U) +#define TMR6_BCONR_BSEA (0x00000002UL) +#define TMR6_BCONR_BTRUA_POS (2U) +#define TMR6_BCONR_BTRUA (0x00000004UL) +#define TMR6_BCONR_BTRDA_POS (3U) +#define TMR6_BCONR_BTRDA (0x00000008UL) +#define TMR6_BCONR_BENB_POS (4U) +#define TMR6_BCONR_BENB (0x00000010UL) +#define TMR6_BCONR_BSEB_POS (5U) +#define TMR6_BCONR_BSEB (0x00000020UL) +#define TMR6_BCONR_BTRUB_POS (6U) +#define TMR6_BCONR_BTRUB (0x00000040UL) +#define TMR6_BCONR_BTRDB_POS (7U) +#define TMR6_BCONR_BTRDB (0x00000080UL) +#define TMR6_BCONR_BENP_POS (8U) +#define TMR6_BCONR_BENP (0x00000100UL) +#define TMR6_BCONR_BSEP_POS (9U) +#define TMR6_BCONR_BSEP (0x00000200UL) +#define TMR6_BCONR_BTRUP_POS (10U) +#define TMR6_BCONR_BTRUP (0x00000400UL) +#define TMR6_BCONR_BTRDP_POS (11U) +#define TMR6_BCONR_BTRDP (0x00000800UL) +#define TMR6_BCONR_BENSPA_POS (16U) +#define TMR6_BCONR_BENSPA (0x00010000UL) +#define TMR6_BCONR_BSESPA_POS (17U) +#define TMR6_BCONR_BSESPA (0x00020000UL) +#define TMR6_BCONR_BTRUSPA_POS (18U) +#define TMR6_BCONR_BTRUSPA (0x00040000UL) +#define TMR6_BCONR_BTRDSPA_POS (19U) +#define TMR6_BCONR_BTRDSPA (0x00080000UL) +#define TMR6_BCONR_BENSPB_POS (20U) +#define TMR6_BCONR_BENSPB (0x00100000UL) +#define TMR6_BCONR_BSESPB_POS (21U) +#define TMR6_BCONR_BSESPB (0x00200000UL) +#define TMR6_BCONR_BTRUSPB_POS (22U) +#define TMR6_BCONR_BTRUSPB (0x00400000UL) +#define TMR6_BCONR_BTRDSPB_POS (23U) +#define TMR6_BCONR_BTRDSPB (0x00800000UL) + +/* Bit definition for TMR6_DCONR register */ +#define TMR6_DCONR_DTCEN_POS (0U) +#define TMR6_DCONR_DTCEN (0x00000001UL) +#define TMR6_DCONR_SEPA_POS (1U) +#define TMR6_DCONR_SEPA (0x00000002UL) +#define TMR6_DCONR_DTBENU_POS (4U) +#define TMR6_DCONR_DTBENU (0x00000010UL) +#define TMR6_DCONR_DTBEND_POS (5U) +#define TMR6_DCONR_DTBEND (0x00000020UL) +#define TMR6_DCONR_DTBTRU_POS (6U) +#define TMR6_DCONR_DTBTRU (0x00000040UL) +#define TMR6_DCONR_DTBTRD_POS (7U) +#define TMR6_DCONR_DTBTRD (0x00000080UL) + +/* Bit definition for TMR6_PCNAR register */ +#define TMR6_PCNAR_STACA_POS (0U) +#define TMR6_PCNAR_STACA (0x00000003UL) +#define TMR6_PCNAR_STACA_0 (0x00000001UL) +#define TMR6_PCNAR_STACA_1 (0x00000002UL) +#define TMR6_PCNAR_STPCA_POS (2U) +#define TMR6_PCNAR_STPCA (0x0000000CUL) +#define TMR6_PCNAR_STPCA_0 (0x00000004UL) +#define TMR6_PCNAR_STPCA_1 (0x00000008UL) +#define TMR6_PCNAR_OVFCA_POS (4U) +#define TMR6_PCNAR_OVFCA (0x00000030UL) +#define TMR6_PCNAR_OVFCA_0 (0x00000010UL) +#define TMR6_PCNAR_OVFCA_1 (0x00000020UL) +#define TMR6_PCNAR_UDFCA_POS (6U) +#define TMR6_PCNAR_UDFCA (0x000000C0UL) +#define TMR6_PCNAR_UDFCA_0 (0x00000040UL) +#define TMR6_PCNAR_UDFCA_1 (0x00000080UL) +#define TMR6_PCNAR_CMAUCA_POS (8U) +#define TMR6_PCNAR_CMAUCA (0x00000300UL) +#define TMR6_PCNAR_CMAUCA_0 (0x00000100UL) +#define TMR6_PCNAR_CMAUCA_1 (0x00000200UL) +#define TMR6_PCNAR_CMADCA_POS (10U) +#define TMR6_PCNAR_CMADCA (0x00000C00UL) +#define TMR6_PCNAR_CMADCA_0 (0x00000400UL) +#define TMR6_PCNAR_CMADCA_1 (0x00000800UL) +#define TMR6_PCNAR_CMBUCA_POS (12U) +#define TMR6_PCNAR_CMBUCA (0x00003000UL) +#define TMR6_PCNAR_CMBUCA_0 (0x00001000UL) +#define TMR6_PCNAR_CMBUCA_1 (0x00002000UL) +#define TMR6_PCNAR_CMBDCA_POS (14U) +#define TMR6_PCNAR_CMBDCA (0x0000C000UL) +#define TMR6_PCNAR_CMBDCA_0 (0x00004000UL) +#define TMR6_PCNAR_CMBDCA_1 (0x00008000UL) +#define TMR6_PCNAR_FORCA_POS (16U) +#define TMR6_PCNAR_FORCA (0x00030000UL) +#define TMR6_PCNAR_FORCA_0 (0x00010000UL) +#define TMR6_PCNAR_FORCA_1 (0x00020000UL) +#define TMR6_PCNAR_EMBCA_POS (20U) +#define TMR6_PCNAR_EMBCA (0x00300000UL) +#define TMR6_PCNAR_EMBCA_0 (0x00100000UL) +#define TMR6_PCNAR_EMBCA_1 (0x00200000UL) +#define TMR6_PCNAR_EMBRA_POS (22U) +#define TMR6_PCNAR_EMBRA (0x00C00000UL) +#define TMR6_PCNAR_EMBRA_0 (0x00400000UL) +#define TMR6_PCNAR_EMBRA_1 (0x00800000UL) +#define TMR6_PCNAR_EMBSA_POS (24U) +#define TMR6_PCNAR_EMBSA (0x03000000UL) +#define TMR6_PCNAR_EMBSA_0 (0x01000000UL) +#define TMR6_PCNAR_EMBSA_1 (0x02000000UL) +#define TMR6_PCNAR_OUTENA_POS (28U) +#define TMR6_PCNAR_OUTENA (0x10000000UL) +#define TMR6_PCNAR_CAPMDA_POS (31U) +#define TMR6_PCNAR_CAPMDA (0x80000000UL) + +/* Bit definition for TMR6_PCNBR register */ +#define TMR6_PCNBR_STACB_POS (0U) +#define TMR6_PCNBR_STACB (0x00000003UL) +#define TMR6_PCNBR_STACB_0 (0x00000001UL) +#define TMR6_PCNBR_STACB_1 (0x00000002UL) +#define TMR6_PCNBR_STPCB_POS (2U) +#define TMR6_PCNBR_STPCB (0x0000000CUL) +#define TMR6_PCNBR_STPCB_0 (0x00000004UL) +#define TMR6_PCNBR_STPCB_1 (0x00000008UL) +#define TMR6_PCNBR_OVFCB_POS (4U) +#define TMR6_PCNBR_OVFCB (0x00000030UL) +#define TMR6_PCNBR_OVFCB_0 (0x00000010UL) +#define TMR6_PCNBR_OVFCB_1 (0x00000020UL) +#define TMR6_PCNBR_UDFCB_POS (6U) +#define TMR6_PCNBR_UDFCB (0x000000C0UL) +#define TMR6_PCNBR_UDFCB_0 (0x00000040UL) +#define TMR6_PCNBR_UDFCB_1 (0x00000080UL) +#define TMR6_PCNBR_CMAUCB_POS (8U) +#define TMR6_PCNBR_CMAUCB (0x00000300UL) +#define TMR6_PCNBR_CMAUCB_0 (0x00000100UL) +#define TMR6_PCNBR_CMAUCB_1 (0x00000200UL) +#define TMR6_PCNBR_CMADCB_POS (10U) +#define TMR6_PCNBR_CMADCB (0x00000C00UL) +#define TMR6_PCNBR_CMADCB_0 (0x00000400UL) +#define TMR6_PCNBR_CMADCB_1 (0x00000800UL) +#define TMR6_PCNBR_CMBUCB_POS (12U) +#define TMR6_PCNBR_CMBUCB (0x00003000UL) +#define TMR6_PCNBR_CMBUCB_0 (0x00001000UL) +#define TMR6_PCNBR_CMBUCB_1 (0x00002000UL) +#define TMR6_PCNBR_CMBDCB_POS (14U) +#define TMR6_PCNBR_CMBDCB (0x0000C000UL) +#define TMR6_PCNBR_CMBDCB_0 (0x00004000UL) +#define TMR6_PCNBR_CMBDCB_1 (0x00008000UL) +#define TMR6_PCNBR_FORCB_POS (16U) +#define TMR6_PCNBR_FORCB (0x00030000UL) +#define TMR6_PCNBR_FORCB_0 (0x00010000UL) +#define TMR6_PCNBR_FORCB_1 (0x00020000UL) +#define TMR6_PCNBR_EMBCB_POS (20U) +#define TMR6_PCNBR_EMBCB (0x00300000UL) +#define TMR6_PCNBR_EMBCB_0 (0x00100000UL) +#define TMR6_PCNBR_EMBCB_1 (0x00200000UL) +#define TMR6_PCNBR_EMBRB_POS (22U) +#define TMR6_PCNBR_EMBRB (0x00C00000UL) +#define TMR6_PCNBR_EMBRB_0 (0x00400000UL) +#define TMR6_PCNBR_EMBRB_1 (0x00800000UL) +#define TMR6_PCNBR_EMBSB_POS (24U) +#define TMR6_PCNBR_EMBSB (0x03000000UL) +#define TMR6_PCNBR_EMBSB_0 (0x01000000UL) +#define TMR6_PCNBR_EMBSB_1 (0x02000000UL) +#define TMR6_PCNBR_OUTENB_POS (28U) +#define TMR6_PCNBR_OUTENB (0x10000000UL) +#define TMR6_PCNBR_CAPMDB_POS (31U) +#define TMR6_PCNBR_CAPMDB (0x80000000UL) + +/* Bit definition for TMR6_FCNGR register */ +#define TMR6_FCNGR_NOFIENGA_POS (0U) +#define TMR6_FCNGR_NOFIENGA (0x00000001UL) +#define TMR6_FCNGR_NOFICKGA_POS (1U) +#define TMR6_FCNGR_NOFICKGA (0x00000006UL) +#define TMR6_FCNGR_NOFICKGA_0 (0x00000002UL) +#define TMR6_FCNGR_NOFICKGA_1 (0x00000004UL) +#define TMR6_FCNGR_NOFIENGB_POS (4U) +#define TMR6_FCNGR_NOFIENGB (0x00000010UL) +#define TMR6_FCNGR_NOFICKGB_POS (5U) +#define TMR6_FCNGR_NOFICKGB (0x00000060UL) +#define TMR6_FCNGR_NOFICKGB_0 (0x00000020UL) +#define TMR6_FCNGR_NOFICKGB_1 (0x00000040UL) + +/* Bit definition for TMR6_VPERR register */ +#define TMR6_VPERR_SPPERIA_POS (8U) +#define TMR6_VPERR_SPPERIA (0x00000100UL) +#define TMR6_VPERR_SPPERIB_POS (9U) +#define TMR6_VPERR_SPPERIB (0x00000200UL) +#define TMR6_VPERR_PCNTE_POS (16U) +#define TMR6_VPERR_PCNTE (0x00030000UL) +#define TMR6_VPERR_PCNTE_0 (0x00010000UL) +#define TMR6_VPERR_PCNTE_1 (0x00020000UL) +#define TMR6_VPERR_PCNTS_POS (18U) +#define TMR6_VPERR_PCNTS (0x001C0000UL) +#define TMR6_VPERR_PCNTS_0 (0x00040000UL) +#define TMR6_VPERR_PCNTS_1 (0x00080000UL) +#define TMR6_VPERR_PCNTS_2 (0x00100000UL) + +/* Bit definition for TMR6_STFLR register */ +#define TMR6_STFLR_CMAF_POS (0U) +#define TMR6_STFLR_CMAF (0x00000001UL) +#define TMR6_STFLR_CMBF_POS (1U) +#define TMR6_STFLR_CMBF (0x00000002UL) +#define TMR6_STFLR_CMCF_POS (2U) +#define TMR6_STFLR_CMCF (0x00000004UL) +#define TMR6_STFLR_CMDF_POS (3U) +#define TMR6_STFLR_CMDF (0x00000008UL) +#define TMR6_STFLR_CMEF_POS (4U) +#define TMR6_STFLR_CMEF (0x00000010UL) +#define TMR6_STFLR_CMFF_POS (5U) +#define TMR6_STFLR_CMFF (0x00000020UL) +#define TMR6_STFLR_OVFF_POS (6U) +#define TMR6_STFLR_OVFF (0x00000040UL) +#define TMR6_STFLR_UDFF_POS (7U) +#define TMR6_STFLR_UDFF (0x00000080UL) +#define TMR6_STFLR_DTEF_POS (8U) +#define TMR6_STFLR_DTEF (0x00000100UL) +#define TMR6_STFLR_CMSAUF_POS (9U) +#define TMR6_STFLR_CMSAUF (0x00000200UL) +#define TMR6_STFLR_CMSADF_POS (10U) +#define TMR6_STFLR_CMSADF (0x00000400UL) +#define TMR6_STFLR_CMSBUF_POS (11U) +#define TMR6_STFLR_CMSBUF (0x00000800UL) +#define TMR6_STFLR_CMSBDF_POS (12U) +#define TMR6_STFLR_CMSBDF (0x00001000UL) +#define TMR6_STFLR_VPERNUM_POS (21U) +#define TMR6_STFLR_VPERNUM (0x00E00000UL) +#define TMR6_STFLR_VPERNUM_0 (0x00200000UL) +#define TMR6_STFLR_VPERNUM_1 (0x00400000UL) +#define TMR6_STFLR_VPERNUM_2 (0x00800000UL) +#define TMR6_STFLR_DIRF_POS (31U) +#define TMR6_STFLR_DIRF (0x80000000UL) + +/* Bit definition for TMR6_HSTAR register */ +#define TMR6_HSTAR_HSTA0_POS (0U) +#define TMR6_HSTAR_HSTA0 (0x00000001UL) +#define TMR6_HSTAR_HSTA1_POS (1U) +#define TMR6_HSTAR_HSTA1 (0x00000002UL) +#define TMR6_HSTAR_HSTA2_POS (2U) +#define TMR6_HSTAR_HSTA2 (0x00000004UL) +#define TMR6_HSTAR_HSTA3_POS (3U) +#define TMR6_HSTAR_HSTA3 (0x00000008UL) +#define TMR6_HSTAR_STAS_POS (7U) +#define TMR6_HSTAR_STAS (0x00000080UL) +#define TMR6_HSTAR_HSTA8_POS (8U) +#define TMR6_HSTAR_HSTA8 (0x00000100UL) +#define TMR6_HSTAR_HSTA9_POS (9U) +#define TMR6_HSTAR_HSTA9 (0x00000200UL) +#define TMR6_HSTAR_HSTA10_POS (10U) +#define TMR6_HSTAR_HSTA10 (0x00000400UL) +#define TMR6_HSTAR_HSTA11_POS (11U) +#define TMR6_HSTAR_HSTA11 (0x00000800UL) +#define TMR6_HSTAR_HSTA16_POS (16U) +#define TMR6_HSTAR_HSTA16 (0x00010000UL) +#define TMR6_HSTAR_HSTA17_POS (17U) +#define TMR6_HSTAR_HSTA17 (0x00020000UL) +#define TMR6_HSTAR_HSTA18_POS (18U) +#define TMR6_HSTAR_HSTA18 (0x00040000UL) +#define TMR6_HSTAR_HSTA19_POS (19U) +#define TMR6_HSTAR_HSTA19 (0x00080000UL) +#define TMR6_HSTAR_HSTA20_POS (20U) +#define TMR6_HSTAR_HSTA20 (0x00100000UL) +#define TMR6_HSTAR_HSTA21_POS (21U) +#define TMR6_HSTAR_HSTA21 (0x00200000UL) +#define TMR6_HSTAR_HSTA22_POS (22U) +#define TMR6_HSTAR_HSTA22 (0x00400000UL) +#define TMR6_HSTAR_HSTA23_POS (23U) +#define TMR6_HSTAR_HSTA23 (0x00800000UL) + +/* Bit definition for TMR6_HSTPR register */ +#define TMR6_HSTPR_HSTP0_POS (0U) +#define TMR6_HSTPR_HSTP0 (0x00000001UL) +#define TMR6_HSTPR_HSTP1_POS (1U) +#define TMR6_HSTPR_HSTP1 (0x00000002UL) +#define TMR6_HSTPR_HSTP2_POS (2U) +#define TMR6_HSTPR_HSTP2 (0x00000004UL) +#define TMR6_HSTPR_HSTP3_POS (3U) +#define TMR6_HSTPR_HSTP3 (0x00000008UL) +#define TMR6_HSTPR_STPS_POS (7U) +#define TMR6_HSTPR_STPS (0x00000080UL) +#define TMR6_HSTPR_HSTP8_POS (8U) +#define TMR6_HSTPR_HSTP8 (0x00000100UL) +#define TMR6_HSTPR_HSTP9_POS (9U) +#define TMR6_HSTPR_HSTP9 (0x00000200UL) +#define TMR6_HSTPR_HSTP10_POS (10U) +#define TMR6_HSTPR_HSTP10 (0x00000400UL) +#define TMR6_HSTPR_HSTP11_POS (11U) +#define TMR6_HSTPR_HSTP11 (0x00000800UL) +#define TMR6_HSTPR_HSTP16_POS (16U) +#define TMR6_HSTPR_HSTP16 (0x00010000UL) +#define TMR6_HSTPR_HSTP17_POS (17U) +#define TMR6_HSTPR_HSTP17 (0x00020000UL) +#define TMR6_HSTPR_HSTP18_POS (18U) +#define TMR6_HSTPR_HSTP18 (0x00040000UL) +#define TMR6_HSTPR_HSTP19_POS (19U) +#define TMR6_HSTPR_HSTP19 (0x00080000UL) +#define TMR6_HSTPR_HSTP20_POS (20U) +#define TMR6_HSTPR_HSTP20 (0x00100000UL) +#define TMR6_HSTPR_HSTP21_POS (21U) +#define TMR6_HSTPR_HSTP21 (0x00200000UL) +#define TMR6_HSTPR_HSTP22_POS (22U) +#define TMR6_HSTPR_HSTP22 (0x00400000UL) +#define TMR6_HSTPR_HSTP23_POS (23U) +#define TMR6_HSTPR_HSTP23 (0x00800000UL) + +/* Bit definition for TMR6_HCLRR register */ +#define TMR6_HCLRR_HCLE0_POS (0U) +#define TMR6_HCLRR_HCLE0 (0x00000001UL) +#define TMR6_HCLRR_HCLE1_POS (1U) +#define TMR6_HCLRR_HCLE1 (0x00000002UL) +#define TMR6_HCLRR_HCLE2_POS (2U) +#define TMR6_HCLRR_HCLE2 (0x00000004UL) +#define TMR6_HCLRR_HCLE3_POS (3U) +#define TMR6_HCLRR_HCLE3 (0x00000008UL) +#define TMR6_HCLRR_CLES_POS (7U) +#define TMR6_HCLRR_CLES (0x00000080UL) +#define TMR6_HCLRR_HCLE8_POS (8U) +#define TMR6_HCLRR_HCLE8 (0x00000100UL) +#define TMR6_HCLRR_HCLE9_POS (9U) +#define TMR6_HCLRR_HCLE9 (0x00000200UL) +#define TMR6_HCLRR_HCLE10_POS (10U) +#define TMR6_HCLRR_HCLE10 (0x00000400UL) +#define TMR6_HCLRR_HCLE11_POS (11U) +#define TMR6_HCLRR_HCLE11 (0x00000800UL) +#define TMR6_HCLRR_HCLE16_POS (16U) +#define TMR6_HCLRR_HCLE16 (0x00010000UL) +#define TMR6_HCLRR_HCLE17_POS (17U) +#define TMR6_HCLRR_HCLE17 (0x00020000UL) +#define TMR6_HCLRR_HCLE18_POS (18U) +#define TMR6_HCLRR_HCLE18 (0x00040000UL) +#define TMR6_HCLRR_HCLE19_POS (19U) +#define TMR6_HCLRR_HCLE19 (0x00080000UL) +#define TMR6_HCLRR_HCLE20_POS (20U) +#define TMR6_HCLRR_HCLE20 (0x00100000UL) +#define TMR6_HCLRR_HCLE21_POS (21U) +#define TMR6_HCLRR_HCLE21 (0x00200000UL) +#define TMR6_HCLRR_HCLE22_POS (22U) +#define TMR6_HCLRR_HCLE22 (0x00400000UL) +#define TMR6_HCLRR_HCLE23_POS (23U) +#define TMR6_HCLRR_HCLE23 (0x00800000UL) + +/* Bit definition for TMR6_HUPDR register */ +#define TMR6_HUPDR_HUPD0_POS (0U) +#define TMR6_HUPDR_HUPD0 (0x00000001UL) +#define TMR6_HUPDR_HUPD1_POS (1U) +#define TMR6_HUPDR_HUPD1 (0x00000002UL) +#define TMR6_HUPDR_HUPD2_POS (2U) +#define TMR6_HUPDR_HUPD2 (0x00000004UL) +#define TMR6_HUPDR_HUPD3_POS (3U) +#define TMR6_HUPDR_HUPD3 (0x00000008UL) +#define TMR6_HUPDR_UPDS_POS (7U) +#define TMR6_HUPDR_UPDS (0x00000080UL) +#define TMR6_HUPDR_HUPD8_POS (8U) +#define TMR6_HUPDR_HUPD8 (0x00000100UL) +#define TMR6_HUPDR_HUPD9_POS (9U) +#define TMR6_HUPDR_HUPD9 (0x00000200UL) +#define TMR6_HUPDR_HUPD10_POS (10U) +#define TMR6_HUPDR_HUPD10 (0x00000400UL) +#define TMR6_HUPDR_HUPD11_POS (11U) +#define TMR6_HUPDR_HUPD11 (0x00000800UL) +#define TMR6_HUPDR_HUPD16_POS (16U) +#define TMR6_HUPDR_HUPD16 (0x00010000UL) +#define TMR6_HUPDR_HUPD17_POS (17U) +#define TMR6_HUPDR_HUPD17 (0x00020000UL) +#define TMR6_HUPDR_HUPD18_POS (18U) +#define TMR6_HUPDR_HUPD18 (0x00040000UL) +#define TMR6_HUPDR_HUPD19_POS (19U) +#define TMR6_HUPDR_HUPD19 (0x00080000UL) +#define TMR6_HUPDR_HUPD20_POS (20U) +#define TMR6_HUPDR_HUPD20 (0x00100000UL) +#define TMR6_HUPDR_HUPD21_POS (21U) +#define TMR6_HUPDR_HUPD21 (0x00200000UL) +#define TMR6_HUPDR_HUPD22_POS (22U) +#define TMR6_HUPDR_HUPD22 (0x00400000UL) +#define TMR6_HUPDR_HUPD23_POS (23U) +#define TMR6_HUPDR_HUPD23 (0x00800000UL) + +/* Bit definition for TMR6_HCPAR register */ +#define TMR6_HCPAR_HCPA0_POS (0U) +#define TMR6_HCPAR_HCPA0 (0x00000001UL) +#define TMR6_HCPAR_HCPA1_POS (1U) +#define TMR6_HCPAR_HCPA1 (0x00000002UL) +#define TMR6_HCPAR_HCPA2_POS (2U) +#define TMR6_HCPAR_HCPA2 (0x00000004UL) +#define TMR6_HCPAR_HCPA3_POS (3U) +#define TMR6_HCPAR_HCPA3 (0x00000008UL) +#define TMR6_HCPAR_HCPA8_POS (8U) +#define TMR6_HCPAR_HCPA8 (0x00000100UL) +#define TMR6_HCPAR_HCPA9_POS (9U) +#define TMR6_HCPAR_HCPA9 (0x00000200UL) +#define TMR6_HCPAR_HCPA10_POS (10U) +#define TMR6_HCPAR_HCPA10 (0x00000400UL) +#define TMR6_HCPAR_HCPA11_POS (11U) +#define TMR6_HCPAR_HCPA11 (0x00000800UL) +#define TMR6_HCPAR_HCPA16_POS (16U) +#define TMR6_HCPAR_HCPA16 (0x00010000UL) +#define TMR6_HCPAR_HCPA17_POS (17U) +#define TMR6_HCPAR_HCPA17 (0x00020000UL) +#define TMR6_HCPAR_HCPA18_POS (18U) +#define TMR6_HCPAR_HCPA18 (0x00040000UL) +#define TMR6_HCPAR_HCPA19_POS (19U) +#define TMR6_HCPAR_HCPA19 (0x00080000UL) +#define TMR6_HCPAR_HCPA20_POS (20U) +#define TMR6_HCPAR_HCPA20 (0x00100000UL) +#define TMR6_HCPAR_HCPA21_POS (21U) +#define TMR6_HCPAR_HCPA21 (0x00200000UL) +#define TMR6_HCPAR_HCPA22_POS (22U) +#define TMR6_HCPAR_HCPA22 (0x00400000UL) +#define TMR6_HCPAR_HCPA23_POS (23U) +#define TMR6_HCPAR_HCPA23 (0x00800000UL) + +/* Bit definition for TMR6_HCPBR register */ +#define TMR6_HCPBR_HCPB0_POS (0U) +#define TMR6_HCPBR_HCPB0 (0x00000001UL) +#define TMR6_HCPBR_HCPB1_POS (1U) +#define TMR6_HCPBR_HCPB1 (0x00000002UL) +#define TMR6_HCPBR_HCPB2_POS (2U) +#define TMR6_HCPBR_HCPB2 (0x00000004UL) +#define TMR6_HCPBR_HCPB3_POS (3U) +#define TMR6_HCPBR_HCPB3 (0x00000008UL) +#define TMR6_HCPBR_HCPB8_POS (8U) +#define TMR6_HCPBR_HCPB8 (0x00000100UL) +#define TMR6_HCPBR_HCPB9_POS (9U) +#define TMR6_HCPBR_HCPB9 (0x00000200UL) +#define TMR6_HCPBR_HCPB10_POS (10U) +#define TMR6_HCPBR_HCPB10 (0x00000400UL) +#define TMR6_HCPBR_HCPB11_POS (11U) +#define TMR6_HCPBR_HCPB11 (0x00000800UL) +#define TMR6_HCPBR_HCPB16_POS (16U) +#define TMR6_HCPBR_HCPB16 (0x00010000UL) +#define TMR6_HCPBR_HCPB17_POS (17U) +#define TMR6_HCPBR_HCPB17 (0x00020000UL) +#define TMR6_HCPBR_HCPB18_POS (18U) +#define TMR6_HCPBR_HCPB18 (0x00040000UL) +#define TMR6_HCPBR_HCPB19_POS (19U) +#define TMR6_HCPBR_HCPB19 (0x00080000UL) +#define TMR6_HCPBR_HCPB20_POS (20U) +#define TMR6_HCPBR_HCPB20 (0x00100000UL) +#define TMR6_HCPBR_HCPB21_POS (21U) +#define TMR6_HCPBR_HCPB21 (0x00200000UL) +#define TMR6_HCPBR_HCPB22_POS (22U) +#define TMR6_HCPBR_HCPB22 (0x00400000UL) +#define TMR6_HCPBR_HCPB23_POS (23U) +#define TMR6_HCPBR_HCPB23 (0x00800000UL) + +/* Bit definition for TMR6_HCUPR register */ +#define TMR6_HCUPR_HCUP0_POS (0U) +#define TMR6_HCUPR_HCUP0 (0x00000001UL) +#define TMR6_HCUPR_HCUP1_POS (1U) +#define TMR6_HCUPR_HCUP1 (0x00000002UL) +#define TMR6_HCUPR_HCUP2_POS (2U) +#define TMR6_HCUPR_HCUP2 (0x00000004UL) +#define TMR6_HCUPR_HCUP3_POS (3U) +#define TMR6_HCUPR_HCUP3 (0x00000008UL) +#define TMR6_HCUPR_HCUP4_POS (4U) +#define TMR6_HCUPR_HCUP4 (0x00000010UL) +#define TMR6_HCUPR_HCUP5_POS (5U) +#define TMR6_HCUPR_HCUP5 (0x00000020UL) +#define TMR6_HCUPR_HCUP6_POS (6U) +#define TMR6_HCUPR_HCUP6 (0x00000040UL) +#define TMR6_HCUPR_HCUP7_POS (7U) +#define TMR6_HCUPR_HCUP7 (0x00000080UL) +#define TMR6_HCUPR_HCUP8_POS (8U) +#define TMR6_HCUPR_HCUP8 (0x00000100UL) +#define TMR6_HCUPR_HCUP9_POS (9U) +#define TMR6_HCUPR_HCUP9 (0x00000200UL) +#define TMR6_HCUPR_HCUP10_POS (10U) +#define TMR6_HCUPR_HCUP10 (0x00000400UL) +#define TMR6_HCUPR_HCUP11_POS (11U) +#define TMR6_HCUPR_HCUP11 (0x00000800UL) +#define TMR6_HCUPR_HCUP16_POS (16U) +#define TMR6_HCUPR_HCUP16 (0x00010000UL) +#define TMR6_HCUPR_HCUP17_POS (17U) +#define TMR6_HCUPR_HCUP17 (0x00020000UL) +#define TMR6_HCUPR_HCUP18_POS (18U) +#define TMR6_HCUPR_HCUP18 (0x00040000UL) +#define TMR6_HCUPR_HCUP19_POS (19U) +#define TMR6_HCUPR_HCUP19 (0x00080000UL) +#define TMR6_HCUPR_HCUP20_POS (20U) +#define TMR6_HCUPR_HCUP20 (0x00100000UL) +#define TMR6_HCUPR_HCUP21_POS (21U) +#define TMR6_HCUPR_HCUP21 (0x00200000UL) +#define TMR6_HCUPR_HCUP22_POS (22U) +#define TMR6_HCUPR_HCUP22 (0x00400000UL) +#define TMR6_HCUPR_HCUP23_POS (23U) +#define TMR6_HCUPR_HCUP23 (0x00800000UL) + +/* Bit definition for TMR6_HCDOR register */ +#define TMR6_HCDOR_HCDO0_POS (0U) +#define TMR6_HCDOR_HCDO0 (0x00000001UL) +#define TMR6_HCDOR_HCDO1_POS (1U) +#define TMR6_HCDOR_HCDO1 (0x00000002UL) +#define TMR6_HCDOR_HCDO2_POS (2U) +#define TMR6_HCDOR_HCDO2 (0x00000004UL) +#define TMR6_HCDOR_HCDO3_POS (3U) +#define TMR6_HCDOR_HCDO3 (0x00000008UL) +#define TMR6_HCDOR_HCDO4_POS (4U) +#define TMR6_HCDOR_HCDO4 (0x00000010UL) +#define TMR6_HCDOR_HCDO5_POS (5U) +#define TMR6_HCDOR_HCDO5 (0x00000020UL) +#define TMR6_HCDOR_HCDO6_POS (6U) +#define TMR6_HCDOR_HCDO6 (0x00000040UL) +#define TMR6_HCDOR_HCDO7_POS (7U) +#define TMR6_HCDOR_HCDO7 (0x00000080UL) +#define TMR6_HCDOR_HCDO8_POS (8U) +#define TMR6_HCDOR_HCDO8 (0x00000100UL) +#define TMR6_HCDOR_HCDO9_POS (9U) +#define TMR6_HCDOR_HCDO9 (0x00000200UL) +#define TMR6_HCDOR_HCDO10_POS (10U) +#define TMR6_HCDOR_HCDO10 (0x00000400UL) +#define TMR6_HCDOR_HCDO11_POS (11U) +#define TMR6_HCDOR_HCDO11 (0x00000800UL) +#define TMR6_HCDOR_HCDO16_POS (16U) +#define TMR6_HCDOR_HCDO16 (0x00010000UL) +#define TMR6_HCDOR_HCDO17_POS (17U) +#define TMR6_HCDOR_HCDO17 (0x00020000UL) +#define TMR6_HCDOR_HCDO18_POS (18U) +#define TMR6_HCDOR_HCDO18 (0x00040000UL) +#define TMR6_HCDOR_HCDO19_POS (19U) +#define TMR6_HCDOR_HCDO19 (0x00080000UL) +#define TMR6_HCDOR_HCDO20_POS (20U) +#define TMR6_HCDOR_HCDO20 (0x00100000UL) +#define TMR6_HCDOR_HCDO21_POS (21U) +#define TMR6_HCDOR_HCDO21 (0x00200000UL) +#define TMR6_HCDOR_HCDO22_POS (22U) +#define TMR6_HCDOR_HCDO22 (0x00400000UL) +#define TMR6_HCDOR_HCDO23_POS (23U) +#define TMR6_HCDOR_HCDO23 (0x00800000UL) + +/* Bit definition for TMR6_FCNTR register */ +#define TMR6_FCNTR_NOFIENTA_POS (0U) +#define TMR6_FCNTR_NOFIENTA (0x00000001UL) +#define TMR6_FCNTR_NOFICKTA_POS (1U) +#define TMR6_FCNTR_NOFICKTA (0x00000006UL) +#define TMR6_FCNTR_NOFICKTA_0 (0x00000002UL) +#define TMR6_FCNTR_NOFICKTA_1 (0x00000004UL) +#define TMR6_FCNTR_NOFIENTB_POS (4U) +#define TMR6_FCNTR_NOFIENTB (0x00000010UL) +#define TMR6_FCNTR_NOFICKTB_POS (5U) +#define TMR6_FCNTR_NOFICKTB (0x00000060UL) +#define TMR6_FCNTR_NOFICKTB_0 (0x00000020UL) +#define TMR6_FCNTR_NOFICKTB_1 (0x00000040UL) +#define TMR6_FCNTR_NOFIENTC_POS (8U) +#define TMR6_FCNTR_NOFIENTC (0x00000100UL) +#define TMR6_FCNTR_NOFICKTC_POS (9U) +#define TMR6_FCNTR_NOFICKTC (0x00000600UL) +#define TMR6_FCNTR_NOFICKTC_0 (0x00000200UL) +#define TMR6_FCNTR_NOFICKTC_1 (0x00000400UL) +#define TMR6_FCNTR_NOFIENTD_POS (12U) +#define TMR6_FCNTR_NOFIENTD (0x00001000UL) +#define TMR6_FCNTR_NOFICKTD_POS (13U) +#define TMR6_FCNTR_NOFICKTD (0x00006000UL) +#define TMR6_FCNTR_NOFICKTD_0 (0x00002000UL) +#define TMR6_FCNTR_NOFICKTD_1 (0x00004000UL) + +/* Bit definition for TMR6_SSTAR register */ +#define TMR6_SSTAR_SSTA1_POS (0U) +#define TMR6_SSTAR_SSTA1 (0x00000001UL) +#define TMR6_SSTAR_SSTA2_POS (1U) +#define TMR6_SSTAR_SSTA2 (0x00000002UL) +#define TMR6_SSTAR_SSTA3_POS (2U) +#define TMR6_SSTAR_SSTA3 (0x00000004UL) +#define TMR6_SSTAR_SSTA4_POS (3U) +#define TMR6_SSTAR_SSTA4 (0x00000008UL) +#define TMR6_SSTAR_SSTA5_POS (4U) +#define TMR6_SSTAR_SSTA5 (0x00000010UL) +#define TMR6_SSTAR_SSTA6_POS (5U) +#define TMR6_SSTAR_SSTA6 (0x00000020UL) +#define TMR6_SSTAR_SSTA7_POS (6U) +#define TMR6_SSTAR_SSTA7 (0x00000040UL) +#define TMR6_SSTAR_SSTA8_POS (7U) +#define TMR6_SSTAR_SSTA8 (0x00000080UL) + +/* Bit definition for TMR6_SSTPR register */ +#define TMR6_SSTPR_SSTP1_POS (0U) +#define TMR6_SSTPR_SSTP1 (0x00000001UL) +#define TMR6_SSTPR_SSTP2_POS (1U) +#define TMR6_SSTPR_SSTP2 (0x00000002UL) +#define TMR6_SSTPR_SSTP3_POS (2U) +#define TMR6_SSTPR_SSTP3 (0x00000004UL) +#define TMR6_SSTPR_SSTP4_POS (3U) +#define TMR6_SSTPR_SSTP4 (0x00000008UL) +#define TMR6_SSTPR_SSTP5_POS (4U) +#define TMR6_SSTPR_SSTP5 (0x00000010UL) +#define TMR6_SSTPR_SSTP6_POS (5U) +#define TMR6_SSTPR_SSTP6 (0x00000020UL) +#define TMR6_SSTPR_SSTP7_POS (6U) +#define TMR6_SSTPR_SSTP7 (0x00000040UL) +#define TMR6_SSTPR_SSTP8_POS (7U) +#define TMR6_SSTPR_SSTP8 (0x00000080UL) + +/* Bit definition for TMR6_SCLRR register */ +#define TMR6_SCLRR_SCLE1_POS (0U) +#define TMR6_SCLRR_SCLE1 (0x00000001UL) +#define TMR6_SCLRR_SCLE2_POS (1U) +#define TMR6_SCLRR_SCLE2 (0x00000002UL) +#define TMR6_SCLRR_SCLE3_POS (2U) +#define TMR6_SCLRR_SCLE3 (0x00000004UL) +#define TMR6_SCLRR_SCLE4_POS (3U) +#define TMR6_SCLRR_SCLE4 (0x00000008UL) +#define TMR6_SCLRR_SCLE5_POS (4U) +#define TMR6_SCLRR_SCLE5 (0x00000010UL) +#define TMR6_SCLRR_SCLE6_POS (5U) +#define TMR6_SCLRR_SCLE6 (0x00000020UL) +#define TMR6_SCLRR_SCLE7_POS (6U) +#define TMR6_SCLRR_SCLE7 (0x00000040UL) +#define TMR6_SCLRR_SCLE8_POS (7U) +#define TMR6_SCLRR_SCLE8 (0x00000080UL) + +/* Bit definition for TMR6_SUPDR register */ +#define TMR6_SUPDR_SUPD1_POS (0U) +#define TMR6_SUPDR_SUPD1 (0x00000001UL) +#define TMR6_SUPDR_SUPD2_POS (1U) +#define TMR6_SUPDR_SUPD2 (0x00000002UL) +#define TMR6_SUPDR_SUPD3_POS (2U) +#define TMR6_SUPDR_SUPD3 (0x00000004UL) +#define TMR6_SUPDR_SUPD4_POS (3U) +#define TMR6_SUPDR_SUPD4 (0x00000008UL) +#define TMR6_SUPDR_SUPD5_POS (4U) +#define TMR6_SUPDR_SUPD5 (0x00000010UL) +#define TMR6_SUPDR_SUPD6_POS (5U) +#define TMR6_SUPDR_SUPD6 (0x00000020UL) +#define TMR6_SUPDR_SUPD7_POS (6U) +#define TMR6_SUPDR_SUPD7 (0x00000040UL) +#define TMR6_SUPDR_SUPD8_POS (7U) +#define TMR6_SUPDR_SUPD8 (0x00000080UL) + +/******************************************************************************* + Bit definition for Peripheral TMRA +*******************************************************************************/ +/* Bit definition for TMRA_CNTER register */ +#define TMRA_CNTER_CNT (0x0000FFFFUL) + +/* Bit definition for TMRA_PERAR register */ +#define TMRA_PERAR_PER (0x0000FFFFUL) + +/* Bit definition for TMRA_CMPAR1 register */ +#define TMRA_CMPAR1_CMP (0x0000FFFFUL) + +/* Bit definition for TMRA_CMPAR2 register */ +#define TMRA_CMPAR2_CMP (0x0000FFFFUL) + +/* Bit definition for TMRA_CMPAR3 register */ +#define TMRA_CMPAR3_CMP (0x0000FFFFUL) + +/* Bit definition for TMRA_CMPAR4 register */ +#define TMRA_CMPAR4_CMP (0x0000FFFFUL) + +/* Bit definition for TMRA_BCSTR register */ +#define TMRA_BCSTR_START_POS (0U) +#define TMRA_BCSTR_START (0x00000001UL) +#define TMRA_BCSTR_DIR_POS (1U) +#define TMRA_BCSTR_DIR (0x00000002UL) +#define TMRA_BCSTR_MODE_POS (2U) +#define TMRA_BCSTR_MODE (0x00000004UL) +#define TMRA_BCSTR_SYNST_POS (3U) +#define TMRA_BCSTR_SYNST (0x00000008UL) +#define TMRA_BCSTR_CKDIV_POS (4U) +#define TMRA_BCSTR_CKDIV (0x000000F0UL) +#define TMRA_BCSTR_CKDIV_0 (0x00000010UL) +#define TMRA_BCSTR_CKDIV_1 (0x00000020UL) +#define TMRA_BCSTR_CKDIV_2 (0x00000040UL) +#define TMRA_BCSTR_CKDIV_3 (0x00000080UL) +#define TMRA_BCSTR_OVSTP_POS (8U) +#define TMRA_BCSTR_OVSTP (0x00000100UL) +#define TMRA_BCSTR_ITENOVF_POS (12U) +#define TMRA_BCSTR_ITENOVF (0x00001000UL) +#define TMRA_BCSTR_ITENUDF_POS (13U) +#define TMRA_BCSTR_ITENUDF (0x00002000UL) +#define TMRA_BCSTR_OVFF_POS (14U) +#define TMRA_BCSTR_OVFF (0x00004000UL) +#define TMRA_BCSTR_UDFF_POS (15U) +#define TMRA_BCSTR_UDFF (0x00008000UL) + +/* Bit definition for TMRA_HCONR register */ +#define TMRA_HCONR_HSTA0_POS (0U) +#define TMRA_HCONR_HSTA0 (0x00000001UL) +#define TMRA_HCONR_HSTA1_POS (1U) +#define TMRA_HCONR_HSTA1 (0x00000002UL) +#define TMRA_HCONR_HSTA2_POS (2U) +#define TMRA_HCONR_HSTA2 (0x00000004UL) +#define TMRA_HCONR_HSTP0_POS (4U) +#define TMRA_HCONR_HSTP0 (0x00000010UL) +#define TMRA_HCONR_HSTP1_POS (5U) +#define TMRA_HCONR_HSTP1 (0x00000020UL) +#define TMRA_HCONR_HSTP2_POS (6U) +#define TMRA_HCONR_HSTP2 (0x00000040UL) +#define TMRA_HCONR_HCLE0_POS (8U) +#define TMRA_HCONR_HCLE0 (0x00000100UL) +#define TMRA_HCONR_HCLE1_POS (9U) +#define TMRA_HCONR_HCLE1 (0x00000200UL) +#define TMRA_HCONR_HCLE2_POS (10U) +#define TMRA_HCONR_HCLE2 (0x00000400UL) +#define TMRA_HCONR_HCLE3_POS (12U) +#define TMRA_HCONR_HCLE3 (0x00001000UL) +#define TMRA_HCONR_HCLE4_POS (13U) +#define TMRA_HCONR_HCLE4 (0x00002000UL) +#define TMRA_HCONR_HCLE5_POS (14U) +#define TMRA_HCONR_HCLE5 (0x00004000UL) +#define TMRA_HCONR_HCLE6_POS (15U) +#define TMRA_HCONR_HCLE6 (0x00008000UL) + +/* Bit definition for TMRA_HCUPR register */ +#define TMRA_HCUPR_HCUP0_POS (0U) +#define TMRA_HCUPR_HCUP0 (0x00000001UL) +#define TMRA_HCUPR_HCUP1_POS (1U) +#define TMRA_HCUPR_HCUP1 (0x00000002UL) +#define TMRA_HCUPR_HCUP2_POS (2U) +#define TMRA_HCUPR_HCUP2 (0x00000004UL) +#define TMRA_HCUPR_HCUP3_POS (3U) +#define TMRA_HCUPR_HCUP3 (0x00000008UL) +#define TMRA_HCUPR_HCUP4_POS (4U) +#define TMRA_HCUPR_HCUP4 (0x00000010UL) +#define TMRA_HCUPR_HCUP5_POS (5U) +#define TMRA_HCUPR_HCUP5 (0x00000020UL) +#define TMRA_HCUPR_HCUP6_POS (6U) +#define TMRA_HCUPR_HCUP6 (0x00000040UL) +#define TMRA_HCUPR_HCUP7_POS (7U) +#define TMRA_HCUPR_HCUP7 (0x00000080UL) +#define TMRA_HCUPR_HCUP8_POS (8U) +#define TMRA_HCUPR_HCUP8 (0x00000100UL) +#define TMRA_HCUPR_HCUP9_POS (9U) +#define TMRA_HCUPR_HCUP9 (0x00000200UL) +#define TMRA_HCUPR_HCUP10_POS (10U) +#define TMRA_HCUPR_HCUP10 (0x00000400UL) +#define TMRA_HCUPR_HCUP11_POS (11U) +#define TMRA_HCUPR_HCUP11 (0x00000800UL) +#define TMRA_HCUPR_HCUP12_POS (12U) +#define TMRA_HCUPR_HCUP12 (0x00001000UL) + +/* Bit definition for TMRA_HCDOR register */ +#define TMRA_HCDOR_HCDO0_POS (0U) +#define TMRA_HCDOR_HCDO0 (0x00000001UL) +#define TMRA_HCDOR_HCDO1_POS (1U) +#define TMRA_HCDOR_HCDO1 (0x00000002UL) +#define TMRA_HCDOR_HCDO2_POS (2U) +#define TMRA_HCDOR_HCDO2 (0x00000004UL) +#define TMRA_HCDOR_HCDO3_POS (3U) +#define TMRA_HCDOR_HCDO3 (0x00000008UL) +#define TMRA_HCDOR_HCDO4_POS (4U) +#define TMRA_HCDOR_HCDO4 (0x00000010UL) +#define TMRA_HCDOR_HCDO5_POS (5U) +#define TMRA_HCDOR_HCDO5 (0x00000020UL) +#define TMRA_HCDOR_HCDO6_POS (6U) +#define TMRA_HCDOR_HCDO6 (0x00000040UL) +#define TMRA_HCDOR_HCDO7_POS (7U) +#define TMRA_HCDOR_HCDO7 (0x00000080UL) +#define TMRA_HCDOR_HCDO8_POS (8U) +#define TMRA_HCDOR_HCDO8 (0x00000100UL) +#define TMRA_HCDOR_HCDO9_POS (9U) +#define TMRA_HCDOR_HCDO9 (0x00000200UL) +#define TMRA_HCDOR_HCDO10_POS (10U) +#define TMRA_HCDOR_HCDO10 (0x00000400UL) +#define TMRA_HCDOR_HCDO11_POS (11U) +#define TMRA_HCDOR_HCDO11 (0x00000800UL) +#define TMRA_HCDOR_HCDO12_POS (12U) +#define TMRA_HCDOR_HCDO12 (0x00001000UL) + +/* Bit definition for TMRA_ICONR register */ +#define TMRA_ICONR_ITEN1_POS (0U) +#define TMRA_ICONR_ITEN1 (0x00000001UL) +#define TMRA_ICONR_ITEN2_POS (1U) +#define TMRA_ICONR_ITEN2 (0x00000002UL) +#define TMRA_ICONR_ITEN3_POS (2U) +#define TMRA_ICONR_ITEN3 (0x00000004UL) +#define TMRA_ICONR_ITEN4_POS (3U) +#define TMRA_ICONR_ITEN4 (0x00000008UL) + +/* Bit definition for TMRA_ECONR register */ +#define TMRA_ECONR_ETEN1_POS (0U) +#define TMRA_ECONR_ETEN1 (0x00000001UL) +#define TMRA_ECONR_ETEN2_POS (1U) +#define TMRA_ECONR_ETEN2 (0x00000002UL) +#define TMRA_ECONR_ETEN3_POS (2U) +#define TMRA_ECONR_ETEN3 (0x00000004UL) +#define TMRA_ECONR_ETEN4_POS (3U) +#define TMRA_ECONR_ETEN4 (0x00000008UL) + +/* Bit definition for TMRA_FCONR register */ +#define TMRA_FCONR_NOFIENTG_POS (0U) +#define TMRA_FCONR_NOFIENTG (0x00000001UL) +#define TMRA_FCONR_NOFICKTG_POS (1U) +#define TMRA_FCONR_NOFICKTG (0x00000006UL) +#define TMRA_FCONR_NOFICKTG_0 (0x00000002UL) +#define TMRA_FCONR_NOFICKTG_1 (0x00000004UL) +#define TMRA_FCONR_NOFIENCA_POS (8U) +#define TMRA_FCONR_NOFIENCA (0x00000100UL) +#define TMRA_FCONR_NOFICKCA_POS (9U) +#define TMRA_FCONR_NOFICKCA (0x00000600UL) +#define TMRA_FCONR_NOFICKCA_0 (0x00000200UL) +#define TMRA_FCONR_NOFICKCA_1 (0x00000400UL) +#define TMRA_FCONR_NOFIENCB_POS (12U) +#define TMRA_FCONR_NOFIENCB (0x00001000UL) +#define TMRA_FCONR_NOFICKCB_POS (13U) +#define TMRA_FCONR_NOFICKCB (0x00006000UL) +#define TMRA_FCONR_NOFICKCB_0 (0x00002000UL) +#define TMRA_FCONR_NOFICKCB_1 (0x00004000UL) + +/* Bit definition for TMRA_STFLR register */ +#define TMRA_STFLR_CMPF1_POS (0U) +#define TMRA_STFLR_CMPF1 (0x00000001UL) +#define TMRA_STFLR_CMPF2_POS (1U) +#define TMRA_STFLR_CMPF2 (0x00000002UL) +#define TMRA_STFLR_CMPF3_POS (2U) +#define TMRA_STFLR_CMPF3 (0x00000004UL) +#define TMRA_STFLR_CMPF4_POS (3U) +#define TMRA_STFLR_CMPF4 (0x00000008UL) + +/* Bit definition for TMRA_BCONR register */ +#define TMRA_BCONR_BEN_POS (0U) +#define TMRA_BCONR_BEN (0x00000001UL) +#define TMRA_BCONR_BSE0_POS (1U) +#define TMRA_BCONR_BSE0 (0x00000002UL) +#define TMRA_BCONR_BSE1_POS (2U) +#define TMRA_BCONR_BSE1 (0x00000004UL) + +/* Bit definition for TMRA_CCONR register */ +#define TMRA_CCONR_CAPMD_POS (0U) +#define TMRA_CCONR_CAPMD (0x00000001UL) +#define TMRA_CCONR_HICP0_POS (4U) +#define TMRA_CCONR_HICP0 (0x00000010UL) +#define TMRA_CCONR_HICP1_POS (5U) +#define TMRA_CCONR_HICP1 (0x00000020UL) +#define TMRA_CCONR_HICP2_POS (6U) +#define TMRA_CCONR_HICP2 (0x00000040UL) +#define TMRA_CCONR_HICP3_POS (8U) +#define TMRA_CCONR_HICP3 (0x00000100UL) +#define TMRA_CCONR_HICP4_POS (9U) +#define TMRA_CCONR_HICP4 (0x00000200UL) +#define TMRA_CCONR_NOFIENCP_POS (12U) +#define TMRA_CCONR_NOFIENCP (0x00001000UL) +#define TMRA_CCONR_NOFICKCP_POS (13U) +#define TMRA_CCONR_NOFICKCP (0x00006000UL) +#define TMRA_CCONR_NOFICKCP_0 (0x00002000UL) +#define TMRA_CCONR_NOFICKCP_1 (0x00004000UL) + +/* Bit definition for TMRA_PCONR register */ +#define TMRA_PCONR_STAC_POS (0U) +#define TMRA_PCONR_STAC (0x00000003UL) +#define TMRA_PCONR_STAC_0 (0x00000001UL) +#define TMRA_PCONR_STAC_1 (0x00000002UL) +#define TMRA_PCONR_STPC_POS (2U) +#define TMRA_PCONR_STPC (0x0000000CUL) +#define TMRA_PCONR_STPC_0 (0x00000004UL) +#define TMRA_PCONR_STPC_1 (0x00000008UL) +#define TMRA_PCONR_CMPC_POS (4U) +#define TMRA_PCONR_CMPC (0x00000030UL) +#define TMRA_PCONR_CMPC_0 (0x00000010UL) +#define TMRA_PCONR_CMPC_1 (0x00000020UL) +#define TMRA_PCONR_PERC_POS (6U) +#define TMRA_PCONR_PERC (0x000000C0UL) +#define TMRA_PCONR_PERC_0 (0x00000040UL) +#define TMRA_PCONR_PERC_1 (0x00000080UL) +#define TMRA_PCONR_FORC_POS (8U) +#define TMRA_PCONR_FORC (0x00000300UL) +#define TMRA_PCONR_FORC_0 (0x00000100UL) +#define TMRA_PCONR_FORC_1 (0x00000200UL) +#define TMRA_PCONR_OUTEN_POS (12U) +#define TMRA_PCONR_OUTEN (0x00001000UL) + +/******************************************************************************* + Bit definition for Peripheral TRNG +*******************************************************************************/ +/* Bit definition for TRNG_CR register */ +#define TRNG_CR_EN_POS (0U) +#define TRNG_CR_EN (0x00000001UL) +#define TRNG_CR_RUN_POS (1U) +#define TRNG_CR_RUN (0x00000002UL) + +/* Bit definition for TRNG_MR register */ +#define TRNG_MR_LOAD_POS (0U) +#define TRNG_MR_LOAD (0x00000001UL) +#define TRNG_MR_CNT_POS (2U) +#define TRNG_MR_CNT (0x0000001CUL) + +/* Bit definition for TRNG_DR0 register */ +#define TRNG_DR0 (0xFFFFFFFFUL) + +/* Bit definition for TRNG_DR1 register */ +#define TRNG_DR1 (0xFFFFFFFFUL) + +/******************************************************************************* + Bit definition for Peripheral USART +*******************************************************************************/ +/* Bit definition for USART_SR register */ +#define USART_SR_PE_POS (0U) +#define USART_SR_PE (0x00000001UL) +#define USART_SR_FE_POS (1U) +#define USART_SR_FE (0x00000002UL) +#define USART_SR_ORE_POS (3U) +#define USART_SR_ORE (0x00000008UL) +#define USART_SR_BE_POS (4U) +#define USART_SR_BE (0x00000010UL) +#define USART_SR_RXNE_POS (5U) +#define USART_SR_RXNE (0x00000020UL) +#define USART_SR_TC_POS (6U) +#define USART_SR_TC (0x00000040UL) +#define USART_SR_TXE_POS (7U) +#define USART_SR_TXE (0x00000080UL) +#define USART_SR_RTOF_POS (8U) +#define USART_SR_RTOF (0x00000100UL) +#define USART_SR_WKUP_POS (9U) +#define USART_SR_WKUP (0x00000200UL) +#define USART_SR_LBD_POS (10U) +#define USART_SR_LBD (0x00000400UL) +#define USART_SR_MPB_POS (16U) +#define USART_SR_MPB (0x00010000UL) + +/* Bit definition for USART_DR register */ +#define USART_DR_TDR_POS (0U) +#define USART_DR_TDR (0x000001FFUL) +#define USART_DR_MPID_POS (9U) +#define USART_DR_MPID (0x00000200UL) +#define USART_DR_RDR_POS (16U) +#define USART_DR_RDR (0x01FF0000UL) + +/* Bit definition for USART_BRR register */ +#define USART_BRR_DIV_FRACTION_POS (0U) +#define USART_BRR_DIV_FRACTION (0x0000007FUL) +#define USART_BRR_DIV_INTEGER_POS (8U) +#define USART_BRR_DIV_INTEGER (0x0000FF00UL) + +/* Bit definition for USART_CR1 register */ +#define USART_CR1_RTOE_POS (0U) +#define USART_CR1_RTOE (0x00000001UL) +#define USART_CR1_RTOIE_POS (1U) +#define USART_CR1_RTOIE (0x00000002UL) +#define USART_CR1_RE_POS (2U) +#define USART_CR1_RE (0x00000004UL) +#define USART_CR1_TE_POS (3U) +#define USART_CR1_TE (0x00000008UL) +#define USART_CR1_SLME_POS (4U) +#define USART_CR1_SLME (0x00000010UL) +#define USART_CR1_RIE_POS (5U) +#define USART_CR1_RIE (0x00000020UL) +#define USART_CR1_TCIE_POS (6U) +#define USART_CR1_TCIE (0x00000040UL) +#define USART_CR1_TXEIE_POS (7U) +#define USART_CR1_TXEIE (0x00000080UL) +#define USART_CR1_PS_POS (9U) +#define USART_CR1_PS (0x00000200UL) +#define USART_CR1_PCE_POS (10U) +#define USART_CR1_PCE (0x00000400UL) +#define USART_CR1_M_POS (12U) +#define USART_CR1_M (0x00001000UL) +#define USART_CR1_OVER8_POS (15U) +#define USART_CR1_OVER8 (0x00008000UL) +#define USART_CR1_CPE_POS (16U) +#define USART_CR1_CPE (0x00010000UL) +#define USART_CR1_CFE_POS (17U) +#define USART_CR1_CFE (0x00020000UL) +#define USART_CR1_CNF_POS (18U) +#define USART_CR1_CNF (0x00040000UL) +#define USART_CR1_CORE_POS (19U) +#define USART_CR1_CORE (0x00080000UL) +#define USART_CR1_CRTOF_POS (20U) +#define USART_CR1_CRTOF (0x00100000UL) +#define USART_CR1_CBE_POS (21U) +#define USART_CR1_CBE (0x00200000UL) +#define USART_CR1_CWKUP_POS (22U) +#define USART_CR1_CWKUP (0x00400000UL) +#define USART_CR1_CLBD_POS (23U) +#define USART_CR1_CLBD (0x00800000UL) +#define USART_CR1_MS_POS (24U) +#define USART_CR1_MS (0x01000000UL) +#define USART_CR1_ML_POS (28U) +#define USART_CR1_ML (0x10000000UL) +#define USART_CR1_FBME_POS (29U) +#define USART_CR1_FBME (0x20000000UL) +#define USART_CR1_NFE_POS (30U) +#define USART_CR1_NFE (0x40000000UL) +#define USART_CR1_SBS_POS (31U) +#define USART_CR1_SBS (0x80000000UL) + +/* Bit definition for USART_CR2 register */ +#define USART_CR2_MPE_POS (0U) +#define USART_CR2_MPE (0x00000001UL) +#define USART_CR2_WKUPIE_POS (1U) +#define USART_CR2_WKUPIE (0x00000002UL) +#define USART_CR2_BEIE_POS (2U) +#define USART_CR2_BEIE (0x00000004UL) +#define USART_CR2_BEE_POS (3U) +#define USART_CR2_BEE (0x00000008UL) +#define USART_CR2_LBDIE_POS (4U) +#define USART_CR2_LBDIE (0x00000010UL) +#define USART_CR2_LBDL_POS (5U) +#define USART_CR2_LBDL (0x00000020UL) +#define USART_CR2_SBKL_POS (6U) +#define USART_CR2_SBKL (0x000000C0UL) +#define USART_CR2_SBKL_0 (0x00000040UL) +#define USART_CR2_SBKL_1 (0x00000080UL) +#define USART_CR2_WKUPE_POS (8U) +#define USART_CR2_WKUPE (0x00000100UL) +#define USART_CR2_CLKC_POS (11U) +#define USART_CR2_CLKC (0x00001800UL) +#define USART_CR2_CLKC_0 (0x00000800UL) +#define USART_CR2_CLKC_1 (0x00001000UL) +#define USART_CR2_STOP_POS (13U) +#define USART_CR2_STOP (0x00002000UL) +#define USART_CR2_LINEN_POS (14U) +#define USART_CR2_LINEN (0x00004000UL) +#define USART_CR2_SBK_POS (16U) +#define USART_CR2_SBK (0x00010000UL) +#define USART_CR2_SBKM_POS (17U) +#define USART_CR2_SBKM (0x00020000UL) + +/* Bit definition for USART_CR3 register */ +#define USART_CR3_HDSEL_POS (3U) +#define USART_CR3_HDSEL (0x00000008UL) +#define USART_CR3_LOOP_POS (4U) +#define USART_CR3_LOOP (0x00000010UL) +#define USART_CR3_SCEN_POS (5U) +#define USART_CR3_SCEN (0x00000020UL) +#define USART_CR3_RTSE_POS (8U) +#define USART_CR3_RTSE (0x00000100UL) +#define USART_CR3_CTSE_POS (9U) +#define USART_CR3_CTSE (0x00000200UL) +#define USART_CR3_BCN_POS (21U) +#define USART_CR3_BCN (0x00E00000UL) +#define USART_CR3_BCN_0 (0x00200000UL) +#define USART_CR3_BCN_1 (0x00400000UL) +#define USART_CR3_BCN_2 (0x00800000UL) + +/* Bit definition for USART_PR register */ +#define USART_PR_PSC_POS (0U) +#define USART_PR_PSC (0x00000003UL) +#define USART_PR_PSC_0 (0x00000001UL) +#define USART_PR_PSC_1 (0x00000002UL) +#define USART_PR_LBMPSC_POS (2U) +#define USART_PR_LBMPSC (0x0000000CUL) +#define USART_PR_LBMPSC_0 (0x00000004UL) +#define USART_PR_LBMPSC_1 (0x00000008UL) + +/* Bit definition for USART_LBMC register */ +#define USART_LBMC_LBMC (0x0000FFFFUL) + +/******************************************************************************* + Bit definition for Peripheral USBFS +*******************************************************************************/ +/* Bit definition for USBFS_GOTGCTL register */ +#define USBFS_GOTGCTL_SESREQSCS_POS (0U) +#define USBFS_GOTGCTL_SESREQSCS (0x00000001UL) +#define USBFS_GOTGCTL_SESREQ_POS (1U) +#define USBFS_GOTGCTL_SESREQ (0x00000002UL) +#define USBFS_GOTGCTL_VBVALIDOVEN_POS (2U) +#define USBFS_GOTGCTL_VBVALIDOVEN (0x00000004UL) +#define USBFS_GOTGCTL_VBVALIDOVVAL_POS (3U) +#define USBFS_GOTGCTL_VBVALIDOVVAL (0x00000008UL) +#define USBFS_GOTGCTL_AVALIDOVEN_POS (4U) +#define USBFS_GOTGCTL_AVALIDOVEN (0x00000010UL) +#define USBFS_GOTGCTL_AVALIDOVVAL_POS (5U) +#define USBFS_GOTGCTL_AVALIDOVVAL (0x00000020UL) +#define USBFS_GOTGCTL_BVALIDOVEN_POS (6U) +#define USBFS_GOTGCTL_BVALIDOVEN (0x00000040UL) +#define USBFS_GOTGCTL_BVALIDOVVAL_POS (7U) +#define USBFS_GOTGCTL_BVALIDOVVAL (0x00000080UL) +#define USBFS_GOTGCTL_HSTNEGSCS_POS (8U) +#define USBFS_GOTGCTL_HSTNEGSCS (0x00000100UL) +#define USBFS_GOTGCTL_HNPREQ_POS (9U) +#define USBFS_GOTGCTL_HNPREQ (0x00000200UL) +#define USBFS_GOTGCTL_HSTSETHNPEN_POS (10U) +#define USBFS_GOTGCTL_HSTSETHNPEN (0x00000400UL) +#define USBFS_GOTGCTL_DEVHNPEN_POS (11U) +#define USBFS_GOTGCTL_DEVHNPEN (0x00000800UL) +#define USBFS_GOTGCTL_EHEN_POS (12U) +#define USBFS_GOTGCTL_EHEN (0x00001000UL) +#define USBFS_GOTGCTL_DBNCEFLTRBYPASS_POS (15U) +#define USBFS_GOTGCTL_DBNCEFLTRBYPASS (0x00008000UL) +#define USBFS_GOTGCTL_CONIDSTS_POS (16U) +#define USBFS_GOTGCTL_CONIDSTS (0x00010000UL) +#define USBFS_GOTGCTL_DBNCTIME_POS (17U) +#define USBFS_GOTGCTL_DBNCTIME (0x00020000UL) +#define USBFS_GOTGCTL_ASESVLD_POS (18U) +#define USBFS_GOTGCTL_ASESVLD (0x00040000UL) +#define USBFS_GOTGCTL_BSESVLD_POS (19U) +#define USBFS_GOTGCTL_BSESVLD (0x00080000UL) +#define USBFS_GOTGCTL_OTGVER_POS (20U) +#define USBFS_GOTGCTL_OTGVER (0x00100000UL) +#define USBFS_GOTGCTL_CURMOD_POS (21U) +#define USBFS_GOTGCTL_CURMOD (0x00200000UL) + +/* Bit definition for USBFS_GOTGINT register */ +#define USBFS_GOTGINT_SESENDDET_POS (2U) +#define USBFS_GOTGINT_SESENDDET (0x00000004UL) +#define USBFS_GOTGINT_SESREQSUCSTSCHNG_POS (8U) +#define USBFS_GOTGINT_SESREQSUCSTSCHNG (0x00000100UL) +#define USBFS_GOTGINT_HSTNEGSUCSTSCHNG_POS (9U) +#define USBFS_GOTGINT_HSTNEGSUCSTSCHNG (0x00000200UL) +#define USBFS_GOTGINT_HSTNEGDET_POS (17U) +#define USBFS_GOTGINT_HSTNEGDET (0x00020000UL) +#define USBFS_GOTGINT_ADEVTOUTCHG_POS (18U) +#define USBFS_GOTGINT_ADEVTOUTCHG (0x00040000UL) +#define USBFS_GOTGINT_DBNCEDONE_POS (19U) +#define USBFS_GOTGINT_DBNCEDONE (0x00080000UL) + +/* Bit definition for USBFS_GAHBCFG register */ +#define USBFS_GAHBCFG_GLBLINTRMSK_POS (0U) +#define USBFS_GAHBCFG_GLBLINTRMSK (0x00000001UL) +#define USBFS_GAHBCFG_HBSTLEN_POS (1U) +#define USBFS_GAHBCFG_HBSTLEN (0x0000001EUL) +#define USBFS_GAHBCFG_HBSTLEN_0 (0x00000002UL) +#define USBFS_GAHBCFG_HBSTLEN_1 (0x00000004UL) +#define USBFS_GAHBCFG_HBSTLEN_2 (0x00000008UL) +#define USBFS_GAHBCFG_HBSTLEN_3 (0x00000010UL) +#define USBFS_GAHBCFG_DMAEN_POS (5U) +#define USBFS_GAHBCFG_DMAEN (0x00000020UL) +#define USBFS_GAHBCFG_NPTXFEMPLVL_POS (7U) +#define USBFS_GAHBCFG_NPTXFEMPLVL (0x00000080UL) +#define USBFS_GAHBCFG_PTXFEMPLVL_POS (8U) +#define USBFS_GAHBCFG_PTXFEMPLVL (0x00000100UL) +#define USBFS_GAHBCFG_REMMEMSUPP_POS (21U) +#define USBFS_GAHBCFG_REMMEMSUPP (0x00200000UL) +#define USBFS_GAHBCFG_NOTIALLDMAWRIT_POS (22U) +#define USBFS_GAHBCFG_NOTIALLDMAWRIT (0x00400000UL) +#define USBFS_GAHBCFG_AHBSINGLE_POS (23U) +#define USBFS_GAHBCFG_AHBSINGLE (0x00800000UL) + +/* Bit definition for USBFS_GUSBCFG register */ +#define USBFS_GUSBCFG_TOUTCAL_POS (0U) +#define USBFS_GUSBCFG_TOUTCAL (0x00000007UL) +#define USBFS_GUSBCFG_TOUTCAL_0 (0x00000001UL) +#define USBFS_GUSBCFG_TOUTCAL_1 (0x00000002UL) +#define USBFS_GUSBCFG_TOUTCAL_2 (0x00000004UL) +#define USBFS_GUSBCFG_PHYIF_POS (3U) +#define USBFS_GUSBCFG_PHYIF (0x00000008UL) +#define USBFS_GUSBCFG_FSINTF_POS (5U) +#define USBFS_GUSBCFG_FSINTF (0x00000020UL) +#define USBFS_GUSBCFG_PHYSEL_POS (6U) +#define USBFS_GUSBCFG_PHYSEL (0x00000040UL) +#define USBFS_GUSBCFG_SRPCAP_POS (8U) +#define USBFS_GUSBCFG_SRPCAP (0x00000100UL) +#define USBFS_GUSBCFG_HNPCAP_POS (9U) +#define USBFS_GUSBCFG_HNPCAP (0x00000200UL) +#define USBFS_GUSBCFG_USBTRDTIM_POS (10U) +#define USBFS_GUSBCFG_USBTRDTIM (0x00003C00UL) +#define USBFS_GUSBCFG_USBTRDTIM_0 (0x00000400UL) +#define USBFS_GUSBCFG_USBTRDTIM_1 (0x00000800UL) +#define USBFS_GUSBCFG_USBTRDTIM_2 (0x00001000UL) +#define USBFS_GUSBCFG_USBTRDTIM_3 (0x00002000UL) +#define USBFS_GUSBCFG_TERMSELDLPULSE_POS (22U) +#define USBFS_GUSBCFG_TERMSELDLPULSE (0x00400000UL) +#define USBFS_GUSBCFG_IC_USBCAP_POS (26U) +#define USBFS_GUSBCFG_IC_USBCAP (0x04000000UL) +#define USBFS_GUSBCFG_TXENDDELAY_POS (28U) +#define USBFS_GUSBCFG_TXENDDELAY (0x10000000UL) +#define USBFS_GUSBCFG_FORCEHSTMODE_POS (29U) +#define USBFS_GUSBCFG_FORCEHSTMODE (0x20000000UL) +#define USBFS_GUSBCFG_FORCEDEVMODE_POS (30U) +#define USBFS_GUSBCFG_FORCEDEVMODE (0x40000000UL) +#define USBFS_GUSBCFG_CORRUPTTXPKT_POS (31U) +#define USBFS_GUSBCFG_CORRUPTTXPKT (0x80000000UL) + +/* Bit definition for USBFS_GRSTCTL register */ +#define USBFS_GRSTCTL_CSFTRST_POS (0U) +#define USBFS_GRSTCTL_CSFTRST (0x00000001UL) +#define USBFS_GRSTCTL_PIUFSSFTRST_POS (1U) +#define USBFS_GRSTCTL_PIUFSSFTRST (0x00000002UL) +#define USBFS_GRSTCTL_FRMCNTRRST_POS (2U) +#define USBFS_GRSTCTL_FRMCNTRRST (0x00000004UL) +#define USBFS_GRSTCTL_RXFFLSH_POS (4U) +#define USBFS_GRSTCTL_RXFFLSH (0x00000010UL) +#define USBFS_GRSTCTL_TXFFLSH_POS (5U) +#define USBFS_GRSTCTL_TXFFLSH (0x00000020UL) +#define USBFS_GRSTCTL_TXFNUM_POS (6U) +#define USBFS_GRSTCTL_TXFNUM (0x000007C0UL) +#define USBFS_GRSTCTL_DMAREQ_POS (30U) +#define USBFS_GRSTCTL_DMAREQ (0x40000000UL) +#define USBFS_GRSTCTL_AHBIDLE_POS (31U) +#define USBFS_GRSTCTL_AHBIDLE (0x80000000UL) + +/* Bit definition for USBFS_GINTSTS register */ +#define USBFS_GINTSTS_CURMOD_POS (0U) +#define USBFS_GINTSTS_CURMOD (0x00000001UL) +#define USBFS_GINTSTS_MODEMIS_POS (1U) +#define USBFS_GINTSTS_MODEMIS (0x00000002UL) +#define USBFS_GINTSTS_OTGINT_POS (2U) +#define USBFS_GINTSTS_OTGINT (0x00000004UL) +#define USBFS_GINTSTS_SOF_POS (3U) +#define USBFS_GINTSTS_SOF (0x00000008UL) +#define USBFS_GINTSTS_RXFLVL_POS (4U) +#define USBFS_GINTSTS_RXFLVL (0x00000010UL) +#define USBFS_GINTSTS_NPTXFEMP_POS (5U) +#define USBFS_GINTSTS_NPTXFEMP (0x00000020UL) +#define USBFS_GINTSTS_GINNAKEFF_POS (6U) +#define USBFS_GINTSTS_GINNAKEFF (0x00000040UL) +#define USBFS_GINTSTS_GOUTNAKEFF_POS (7U) +#define USBFS_GINTSTS_GOUTNAKEFF (0x00000080UL) +#define USBFS_GINTSTS_ERLYSUSP_POS (10U) +#define USBFS_GINTSTS_ERLYSUSP (0x00000400UL) +#define USBFS_GINTSTS_USBSUSP_POS (11U) +#define USBFS_GINTSTS_USBSUSP (0x00000800UL) +#define USBFS_GINTSTS_USBRST_POS (12U) +#define USBFS_GINTSTS_USBRST (0x00001000UL) +#define USBFS_GINTSTS_ENUMDONE_POS (13U) +#define USBFS_GINTSTS_ENUMDONE (0x00002000UL) +#define USBFS_GINTSTS_ISOOUTDROP_POS (14U) +#define USBFS_GINTSTS_ISOOUTDROP (0x00004000UL) +#define USBFS_GINTSTS_EOPF_POS (15U) +#define USBFS_GINTSTS_EOPF (0x00008000UL) +#define USBFS_GINTSTS_EPMIS_POS (17U) +#define USBFS_GINTSTS_EPMIS (0x00020000UL) +#define USBFS_GINTSTS_IEPINT_POS (18U) +#define USBFS_GINTSTS_IEPINT (0x00040000UL) +#define USBFS_GINTSTS_OEPINT_POS (19U) +#define USBFS_GINTSTS_OEPINT (0x00080000UL) +#define USBFS_GINTSTS_INCOMPISOIN_POS (20U) +#define USBFS_GINTSTS_INCOMPISOIN (0x00100000UL) +#define USBFS_GINTSTS_INCOMPLP_POS (21U) +#define USBFS_GINTSTS_INCOMPLP (0x00200000UL) +#define USBFS_GINTSTS_FETSUSP_POS (22U) +#define USBFS_GINTSTS_FETSUSP (0x00400000UL) +#define USBFS_GINTSTS_RESETDET_POS (23U) +#define USBFS_GINTSTS_RESETDET (0x00800000UL) +#define USBFS_GINTSTS_PRTINT_POS (24U) +#define USBFS_GINTSTS_PRTINT (0x01000000UL) +#define USBFS_GINTSTS_HCHINT_POS (25U) +#define USBFS_GINTSTS_HCHINT (0x02000000UL) +#define USBFS_GINTSTS_PTXFEMP_POS (26U) +#define USBFS_GINTSTS_PTXFEMP (0x04000000UL) +#define USBFS_GINTSTS_LPM_INT_POS (27U) +#define USBFS_GINTSTS_LPM_INT (0x08000000UL) +#define USBFS_GINTSTS_CONIDSTSCHNG_POS (28U) +#define USBFS_GINTSTS_CONIDSTSCHNG (0x10000000UL) +#define USBFS_GINTSTS_DISCONNINT_POS (29U) +#define USBFS_GINTSTS_DISCONNINT (0x20000000UL) +#define USBFS_GINTSTS_SESSREQINT_POS (30U) +#define USBFS_GINTSTS_SESSREQINT (0x40000000UL) +#define USBFS_GINTSTS_WKUPINT_POS (31U) +#define USBFS_GINTSTS_WKUPINT (0x80000000UL) + +/* Bit definition for USBFS_GINTMSK register */ +#define USBFS_GINTMSK_MODEMISMSK_POS (1U) +#define USBFS_GINTMSK_MODEMISMSK (0x00000002UL) +#define USBFS_GINTMSK_OTGINTMSK_POS (2U) +#define USBFS_GINTMSK_OTGINTMSK (0x00000004UL) +#define USBFS_GINTMSK_SOFMSK_POS (3U) +#define USBFS_GINTMSK_SOFMSK (0x00000008UL) +#define USBFS_GINTMSK_RXFLVLMSK_POS (4U) +#define USBFS_GINTMSK_RXFLVLMSK (0x00000010UL) +#define USBFS_GINTMSK_NPTXFEMPMSK_POS (5U) +#define USBFS_GINTMSK_NPTXFEMPMSK (0x00000020UL) +#define USBFS_GINTMSK_GINNAKEFFMSK_POS (6U) +#define USBFS_GINTMSK_GINNAKEFFMSK (0x00000040UL) +#define USBFS_GINTMSK_GOUTNAKEFFMSK_POS (7U) +#define USBFS_GINTMSK_GOUTNAKEFFMSK (0x00000080UL) +#define USBFS_GINTMSK_ERLYSUSPMSK_POS (10U) +#define USBFS_GINTMSK_ERLYSUSPMSK (0x00000400UL) +#define USBFS_GINTMSK_USBSUSPMSK_POS (11U) +#define USBFS_GINTMSK_USBSUSPMSK (0x00000800UL) +#define USBFS_GINTMSK_USBRSTMSK_POS (12U) +#define USBFS_GINTMSK_USBRSTMSK (0x00001000UL) +#define USBFS_GINTMSK_ENUMDONEMSK_POS (13U) +#define USBFS_GINTMSK_ENUMDONEMSK (0x00002000UL) +#define USBFS_GINTMSK_ISOOUTDROPMSK_POS (14U) +#define USBFS_GINTMSK_ISOOUTDROPMSK (0x00004000UL) +#define USBFS_GINTMSK_EOPFMSK_POS (15U) +#define USBFS_GINTMSK_EOPFMSK (0x00008000UL) +#define USBFS_GINTMSK_EPMISMSK_POS (17U) +#define USBFS_GINTMSK_EPMISMSK (0x00020000UL) +#define USBFS_GINTMSK_IEPINTMSK_POS (18U) +#define USBFS_GINTMSK_IEPINTMSK (0x00040000UL) +#define USBFS_GINTMSK_OEPINTMSK_POS (19U) +#define USBFS_GINTMSK_OEPINTMSK (0x00080000UL) +#define USBFS_GINTMSK_INCOMPLPMSK_POS (21U) +#define USBFS_GINTMSK_INCOMPLPMSK (0x00200000UL) +#define USBFS_GINTMSK_FETSUSPMSK_POS (22U) +#define USBFS_GINTMSK_FETSUSPMSK (0x00400000UL) +#define USBFS_GINTMSK_RESETDETMSK_POS (23U) +#define USBFS_GINTMSK_RESETDETMSK (0x00800000UL) +#define USBFS_GINTMSK_PRTINTMSK_POS (24U) +#define USBFS_GINTMSK_PRTINTMSK (0x01000000UL) +#define USBFS_GINTMSK_HCHINTMSK_POS (25U) +#define USBFS_GINTMSK_HCHINTMSK (0x02000000UL) +#define USBFS_GINTMSK_PTXFEMPMSK_POS (26U) +#define USBFS_GINTMSK_PTXFEMPMSK (0x04000000UL) +#define USBFS_GINTMSK_LPM_INTMSK_POS (27U) +#define USBFS_GINTMSK_LPM_INTMSK (0x08000000UL) +#define USBFS_GINTMSK_CONIDSTSCHNGMSK_POS (28U) +#define USBFS_GINTMSK_CONIDSTSCHNGMSK (0x10000000UL) +#define USBFS_GINTMSK_DISCONNINTMSK_POS (29U) +#define USBFS_GINTMSK_DISCONNINTMSK (0x20000000UL) +#define USBFS_GINTMSK_SESSREQINTMSK_POS (30U) +#define USBFS_GINTMSK_SESSREQINTMSK (0x40000000UL) +#define USBFS_GINTMSK_WKUPINTMSK_POS (31U) +#define USBFS_GINTMSK_WKUPINTMSK (0x80000000UL) + +/* Bit definition for USBFS_GRXSTSR register */ +#define USBFS_GRXSTSR_CHNUM_POS (0U) +#define USBFS_GRXSTSR_CHNUM (0x0000000FUL) +#define USBFS_GRXSTSR_BCNT_POS (4U) +#define USBFS_GRXSTSR_BCNT (0x00007FF0UL) +#define USBFS_GRXSTSR_DPID_POS (15U) +#define USBFS_GRXSTSR_DPID (0x00018000UL) +#define USBFS_GRXSTSR_DPID_0 (0x00008000UL) +#define USBFS_GRXSTSR_DPID_1 (0x00010000UL) +#define USBFS_GRXSTSR_PKTSTS_POS (17U) +#define USBFS_GRXSTSR_PKTSTS (0x001E0000UL) +#define USBFS_GRXSTSR_PKTSTS_0 (0x00020000UL) +#define USBFS_GRXSTSR_PKTSTS_1 (0x00040000UL) +#define USBFS_GRXSTSR_PKTSTS_2 (0x00080000UL) +#define USBFS_GRXSTSR_PKTSTS_3 (0x00100000UL) +#define USBFS_GRXSTSR_FN_POS (21U) +#define USBFS_GRXSTSR_FN (0x01E00000UL) + +/* Bit definition for USBFS_GRXSTSP register */ +#define USBFS_GRXSTSP_CHNUM_POS (0U) +#define USBFS_GRXSTSP_CHNUM (0x0000000FUL) +#define USBFS_GRXSTSP_BCNT_POS (4U) +#define USBFS_GRXSTSP_BCNT (0x00007FF0UL) +#define USBFS_GRXSTSP_DPID_POS (15U) +#define USBFS_GRXSTSP_DPID (0x00018000UL) +#define USBFS_GRXSTSP_DPID_0 (0x00008000UL) +#define USBFS_GRXSTSP_DPID_1 (0x00010000UL) +#define USBFS_GRXSTSP_PKTSTS_POS (17U) +#define USBFS_GRXSTSP_PKTSTS (0x001E0000UL) +#define USBFS_GRXSTSP_PKTSTS_0 (0x00020000UL) +#define USBFS_GRXSTSP_PKTSTS_1 (0x00040000UL) +#define USBFS_GRXSTSP_PKTSTS_2 (0x00080000UL) +#define USBFS_GRXSTSP_PKTSTS_3 (0x00100000UL) +#define USBFS_GRXSTSP_FN_POS (21U) +#define USBFS_GRXSTSP_FN (0x01E00000UL) + +/* Bit definition for USBFS_GRXFSIZ register */ +#define USBFS_GRXFSIZ_RXFDEP (0x000003FFUL) + +/* Bit definition for USBFS_GNPTXFSIZ register */ +#define USBFS_GNPTXFSIZ_NPTXFSTADDR_POS (0U) +#define USBFS_GNPTXFSIZ_NPTXFSTADDR (0x000003FFUL) +#define USBFS_GNPTXFSIZ_NPTXFDEP_POS (16U) +#define USBFS_GNPTXFSIZ_NPTXFDEP (0x03FF0000UL) + +/* Bit definition for USBFS_GNPTXSTS register */ +#define USBFS_GNPTXSTS_NPTXFSPCAVAIL_POS (0U) +#define USBFS_GNPTXSTS_NPTXFSPCAVAIL (0x0000FFFFUL) +#define USBFS_GNPTXSTS_NPTXQSPCAVAIL_POS (16U) +#define USBFS_GNPTXSTS_NPTXQSPCAVAIL (0x00FF0000UL) +#define USBFS_GNPTXSTS_NPTXQTOP_POS (24U) +#define USBFS_GNPTXSTS_NPTXQTOP (0x7F000000UL) +#define USBFS_GNPTXSTS_NPTXQTOP_0 (0x01000000UL) +#define USBFS_GNPTXSTS_NPTXQTOP_1 (0x02000000UL) +#define USBFS_GNPTXSTS_NPTXQTOP_2 (0x04000000UL) +#define USBFS_GNPTXSTS_NPTXQTOP_3 (0x08000000UL) +#define USBFS_GNPTXSTS_NPTXQTOP_4 (0x10000000UL) +#define USBFS_GNPTXSTS_NPTXQTOP_5 (0x20000000UL) +#define USBFS_GNPTXSTS_NPTXQTOP_6 (0x40000000UL) + +/* Bit definition for USBFS_GUID register */ +#define USBFS_GUID (0xFFFFFFFFUL) + +/* Bit definition for USBFS_GLPMCFG register */ +#define USBFS_GLPMCFG_LPMCAP_POS (0U) +#define USBFS_GLPMCFG_LPMCAP (0x00000001UL) +#define USBFS_GLPMCFG_APPL1RES_POS (1U) +#define USBFS_GLPMCFG_APPL1RES (0x00000002UL) +#define USBFS_GLPMCFG_HIRD_POS (2U) +#define USBFS_GLPMCFG_HIRD (0x0000003CUL) +#define USBFS_GLPMCFG_HIRD_0 (0x00000004UL) +#define USBFS_GLPMCFG_HIRD_1 (0x00000008UL) +#define USBFS_GLPMCFG_HIRD_2 (0x00000010UL) +#define USBFS_GLPMCFG_HIRD_3 (0x00000020UL) +#define USBFS_GLPMCFG_BREMOTEWAKE_POS (6U) +#define USBFS_GLPMCFG_BREMOTEWAKE (0x00000040UL) +#define USBFS_GLPMCFG_ENBLSLPM_POS (7U) +#define USBFS_GLPMCFG_ENBLSLPM (0x00000080UL) +#define USBFS_GLPMCFG_HIRD_THRES_POS (8U) +#define USBFS_GLPMCFG_HIRD_THRES (0x00001F00UL) +#define USBFS_GLPMCFG_HIRD_THRES_0 (0x00000100UL) +#define USBFS_GLPMCFG_HIRD_THRES_1 (0x00000200UL) +#define USBFS_GLPMCFG_HIRD_THRES_2 (0x00000400UL) +#define USBFS_GLPMCFG_HIRD_THRES_3 (0x00000800UL) +#define USBFS_GLPMCFG_HIRD_THRES_4 (0x00001000UL) +#define USBFS_GLPMCFG_COREL1RES_POS (13U) +#define USBFS_GLPMCFG_COREL1RES (0x00006000UL) +#define USBFS_GLPMCFG_COREL1RES_0 (0x00002000UL) +#define USBFS_GLPMCFG_COREL1RES_1 (0x00004000UL) +#define USBFS_GLPMCFG_SLPSTS_POS (15U) +#define USBFS_GLPMCFG_SLPSTS (0x00008000UL) +#define USBFS_GLPMCFG_L1RESUMEOK_POS (16U) +#define USBFS_GLPMCFG_L1RESUMEOK (0x00010000UL) +#define USBFS_GLPMCFG_LPM_CHNL_INDX_POS (17U) +#define USBFS_GLPMCFG_LPM_CHNL_INDX (0x001E0000UL) +#define USBFS_GLPMCFG_LPM_RETRY_CNT_POS (21U) +#define USBFS_GLPMCFG_LPM_RETRY_CNT (0x00E00000UL) +#define USBFS_GLPMCFG_SNDLPM_POS (24U) +#define USBFS_GLPMCFG_SNDLPM (0x01000000UL) +#define USBFS_GLPMCFG_LPM_RETRYCNT_STS_POS (25U) +#define USBFS_GLPMCFG_LPM_RETRYCNT_STS (0x0E000000UL) +#define USBFS_GLPMCFG_LPM_ENBESL_POS (28U) +#define USBFS_GLPMCFG_LPM_ENBESL (0x10000000UL) +#define USBFS_GLPMCFG_LPM_RESTORESLPSTS_POS (29U) +#define USBFS_GLPMCFG_LPM_RESTORESLPSTS (0x20000000UL) + +/* Bit definition for USBFS_GDFIFOCFG register */ +#define USBFS_GDFIFOCFG_GDFIFOCFG_POS (0U) +#define USBFS_GDFIFOCFG_GDFIFOCFG (0x0000FFFFUL) +#define USBFS_GDFIFOCFG_EPINFOBASEADDR_POS (16U) +#define USBFS_GDFIFOCFG_EPINFOBASEADDR (0xFFFF0000UL) + +/* Bit definition for USBFS_HPTXFSIZ register */ +#define USBFS_HPTXFSIZ_PTXFSTADDR_POS (0U) +#define USBFS_HPTXFSIZ_PTXFSTADDR (0x000007FFUL) +#define USBFS_HPTXFSIZ_PTXFSIZE_POS (16U) +#define USBFS_HPTXFSIZ_PTXFSIZE (0x03FF0000UL) + +/* Bit definition for USBFS_DIEPTXF1 register */ +#define USBFS_DIEPTXF1_INEPNTXFSTADDR_POS (0U) +#define USBFS_DIEPTXF1_INEPNTXFSTADDR (0x000007FFUL) +#define USBFS_DIEPTXF1_INEPNTXFDEP_POS (16U) +#define USBFS_DIEPTXF1_INEPNTXFDEP (0x03FF0000UL) + +/* Bit definition for USBFS_DIEPTXF2 register */ +#define USBFS_DIEPTXF2_INEPNTXFSTADDR_POS (0U) +#define USBFS_DIEPTXF2_INEPNTXFSTADDR (0x000007FFUL) +#define USBFS_DIEPTXF2_INEPNTXFDEP_POS (16U) +#define USBFS_DIEPTXF2_INEPNTXFDEP (0x03FF0000UL) + +/* Bit definition for USBFS_DIEPTXF3 register */ +#define USBFS_DIEPTXF3_INEPNTXFSTADDR_POS (0U) +#define USBFS_DIEPTXF3_INEPNTXFSTADDR (0x00000FFFUL) +#define USBFS_DIEPTXF3_INEPNTXFDEP_POS (16U) +#define USBFS_DIEPTXF3_INEPNTXFDEP (0x03FF0000UL) + +/* Bit definition for USBFS_DIEPTXF4 register */ +#define USBFS_DIEPTXF4_INEPNTXFSTADDR_POS (0U) +#define USBFS_DIEPTXF4_INEPNTXFSTADDR (0x00000FFFUL) +#define USBFS_DIEPTXF4_INEPNTXFDEP_POS (16U) +#define USBFS_DIEPTXF4_INEPNTXFDEP (0x03FF0000UL) + +/* Bit definition for USBFS_DIEPTXF5 register */ +#define USBFS_DIEPTXF5_INEPNTXFSTADDR_POS (0U) +#define USBFS_DIEPTXF5_INEPNTXFSTADDR (0x00000FFFUL) +#define USBFS_DIEPTXF5_INEPNTXFDEP_POS (16U) +#define USBFS_DIEPTXF5_INEPNTXFDEP (0x03FF0000UL) + +/* Bit definition for USBFS_DIEPTXF6 register */ +#define USBFS_DIEPTXF6_INEPNTXFSTADDR_POS (0U) +#define USBFS_DIEPTXF6_INEPNTXFSTADDR (0x00001FFFUL) +#define USBFS_DIEPTXF6_INEPNTXFDEP_POS (16U) +#define USBFS_DIEPTXF6_INEPNTXFDEP (0x03FF0000UL) + +/* Bit definition for USBFS_DIEPTXF7 register */ +#define USBFS_DIEPTXF7_INEPNTXFSTADDR_POS (0U) +#define USBFS_DIEPTXF7_INEPNTXFSTADDR (0x00001FFFUL) +#define USBFS_DIEPTXF7_INEPNTXFDEP_POS (16U) +#define USBFS_DIEPTXF7_INEPNTXFDEP (0x03FF0000UL) + +/* Bit definition for USBFS_DIEPTXF8 register */ +#define USBFS_DIEPTXF8_INEPNTXFSTADDR_POS (0U) +#define USBFS_DIEPTXF8_INEPNTXFSTADDR (0x00001FFFUL) +#define USBFS_DIEPTXF8_INEPNTXFDEP_POS (16U) +#define USBFS_DIEPTXF8_INEPNTXFDEP (0x03FF0000UL) + +/* Bit definition for USBFS_DIEPTXF9 register */ +#define USBFS_DIEPTXF9_INEPNTXFSTADDR_POS (0U) +#define USBFS_DIEPTXF9_INEPNTXFSTADDR (0x00001FFFUL) +#define USBFS_DIEPTXF9_INEPNTXFDEP_POS (16U) +#define USBFS_DIEPTXF9_INEPNTXFDEP (0x03FF0000UL) + +/* Bit definition for USBFS_DIEPTXF10 register */ +#define USBFS_DIEPTXF10_INEPNTXFSTADDR_POS (0U) +#define USBFS_DIEPTXF10_INEPNTXFSTADDR (0x00001FFFUL) +#define USBFS_DIEPTXF10_INEPNTXFDEP_POS (16U) +#define USBFS_DIEPTXF10_INEPNTXFDEP (0x03FF0000UL) + +/* Bit definition for USBFS_DIEPTXF11 register */ +#define USBFS_DIEPTXF11_INEPNTXFSTADDR_POS (0U) +#define USBFS_DIEPTXF11_INEPNTXFSTADDR (0x00001FFFUL) +#define USBFS_DIEPTXF11_INEPNTXFDEP_POS (16U) +#define USBFS_DIEPTXF11_INEPNTXFDEP (0x03FF0000UL) + +/* Bit definition for USBFS_DIEPTXF12 register */ +#define USBFS_DIEPTXF12_INEPNTXFSTADDR_POS (0U) +#define USBFS_DIEPTXF12_INEPNTXFSTADDR (0x00003FFFUL) +#define USBFS_DIEPTXF12_INEPNTXFDEP_POS (16U) +#define USBFS_DIEPTXF12_INEPNTXFDEP (0x03FF0000UL) + +/* Bit definition for USBFS_DIEPTXF13 register */ +#define USBFS_DIEPTXF13_INEPNTXFSTADDR_POS (0U) +#define USBFS_DIEPTXF13_INEPNTXFSTADDR (0x00003FFFUL) +#define USBFS_DIEPTXF13_INEPNTXFDEP_POS (16U) +#define USBFS_DIEPTXF13_INEPNTXFDEP (0x03FF0000UL) + +/* Bit definition for USBFS_DIEPTXF14 register */ +#define USBFS_DIEPTXF14_INEPNTXFSTADDR_POS (0U) +#define USBFS_DIEPTXF14_INEPNTXFSTADDR (0x00003FFFUL) +#define USBFS_DIEPTXF14_INEPNTXFDEP_POS (16U) +#define USBFS_DIEPTXF14_INEPNTXFDEP (0x03FF0000UL) + +/* Bit definition for USBFS_DIEPTXF15 register */ +#define USBFS_DIEPTXF15_INEPNTXFSTADDR_POS (0U) +#define USBFS_DIEPTXF15_INEPNTXFSTADDR (0x00003FFFUL) +#define USBFS_DIEPTXF15_INEPNTXFDEP_POS (16U) +#define USBFS_DIEPTXF15_INEPNTXFDEP (0x03FF0000UL) + +/* Bit definition for USBFS_HCFG register */ +#define USBFS_HCFG_FSLSPCLKSEL_POS (0U) +#define USBFS_HCFG_FSLSPCLKSEL (0x00000003UL) +#define USBFS_HCFG_FSLSPCLKSEL_0 (0x00000001UL) +#define USBFS_HCFG_FSLSPCLKSEL_1 (0x00000002UL) +#define USBFS_HCFG_FSLSSUPP_POS (2U) +#define USBFS_HCFG_FSLSSUPP (0x00000004UL) +#define USBFS_HCFG_ENA32KHZS_POS (7U) +#define USBFS_HCFG_ENA32KHZS (0x00000080UL) +#define USBFS_HCFG_RESVALID_POS (8U) +#define USBFS_HCFG_RESVALID (0x0000FF00UL) +#define USBFS_HCFG_MODECHTIMEN_POS (31U) +#define USBFS_HCFG_MODECHTIMEN (0x80000000UL) + +/* Bit definition for USBFS_HFIR register */ +#define USBFS_HFIR_FRINT_POS (0U) +#define USBFS_HFIR_FRINT (0x0000FFFFUL) +#define USBFS_HFIR_HFIRRLDCTRL_POS (16U) +#define USBFS_HFIR_HFIRRLDCTRL (0x00010000UL) + +/* Bit definition for USBFS_HFNUM register */ +#define USBFS_HFNUM_FRNUM_POS (0U) +#define USBFS_HFNUM_FRNUM (0x0000FFFFUL) +#define USBFS_HFNUM_FRREM_POS (16U) +#define USBFS_HFNUM_FRREM (0xFFFF0000UL) + +/* Bit definition for USBFS_HPTXSTS register */ +#define USBFS_HPTXSTS_PTXFSPCAVAIL_POS (0U) +#define USBFS_HPTXSTS_PTXFSPCAVAIL (0x0000FFFFUL) +#define USBFS_HPTXSTS_PTXQSPCAVAIL_POS (16U) +#define USBFS_HPTXSTS_PTXQSPCAVAIL (0x00FF0000UL) +#define USBFS_HPTXSTS_PTXQTOP_POS (24U) +#define USBFS_HPTXSTS_PTXQTOP (0xFF000000UL) +#define USBFS_HPTXSTS_PTXQTOP_0 (0x01000000UL) +#define USBFS_HPTXSTS_PTXQTOP_1 (0x02000000UL) +#define USBFS_HPTXSTS_PTXQTOP_2 (0x04000000UL) +#define USBFS_HPTXSTS_PTXQTOP_3 (0x08000000UL) +#define USBFS_HPTXSTS_PTXQTOP_4 (0x10000000UL) +#define USBFS_HPTXSTS_PTXQTOP_5 (0x20000000UL) +#define USBFS_HPTXSTS_PTXQTOP_6 (0x40000000UL) +#define USBFS_HPTXSTS_PTXQTOP_7 (0x80000000UL) + +/* Bit definition for USBFS_HAINT register */ +#define USBFS_HAINT_HAINT (0x0000FFFFUL) + +/* Bit definition for USBFS_HAINTMSK register */ +#define USBFS_HAINTMSK_HAINTMSK (0x0000FFFFUL) + +/* Bit definition for USBFS_HPRT register */ +#define USBFS_HPRT_PRTCONNSTS_POS (0U) +#define USBFS_HPRT_PRTCONNSTS (0x00000001UL) +#define USBFS_HPRT_PRTCONNDET_POS (1U) +#define USBFS_HPRT_PRTCONNDET (0x00000002UL) +#define USBFS_HPRT_PRTENA_POS (2U) +#define USBFS_HPRT_PRTENA (0x00000004UL) +#define USBFS_HPRT_PRTENCHNG_POS (3U) +#define USBFS_HPRT_PRTENCHNG (0x00000008UL) +#define USBFS_HPRT_PRTOVRCURRACT_POS (4U) +#define USBFS_HPRT_PRTOVRCURRACT (0x00000010UL) +#define USBFS_HPRT_PRTOVRCURRCHNG_POS (5U) +#define USBFS_HPRT_PRTOVRCURRCHNG (0x00000020UL) +#define USBFS_HPRT_PRTRES_POS (6U) +#define USBFS_HPRT_PRTRES (0x00000040UL) +#define USBFS_HPRT_PRTSUSP_POS (7U) +#define USBFS_HPRT_PRTSUSP (0x00000080UL) +#define USBFS_HPRT_PRTRST_POS (8U) +#define USBFS_HPRT_PRTRST (0x00000100UL) +#define USBFS_HPRT_PRTLNSTS_POS (10U) +#define USBFS_HPRT_PRTLNSTS (0x00000C00UL) +#define USBFS_HPRT_PRTLNSTS_0 (0x00000400UL) +#define USBFS_HPRT_PRTLNSTS_1 (0x00000800UL) +#define USBFS_HPRT_PRTPWR_POS (12U) +#define USBFS_HPRT_PRTPWR (0x00001000UL) +#define USBFS_HPRT_PRTTSTCTL_POS (13U) +#define USBFS_HPRT_PRTTSTCTL (0x0001E000UL) +#define USBFS_HPRT_PRTTSTCTL_0 (0x00002000UL) +#define USBFS_HPRT_PRTTSTCTL_1 (0x00004000UL) +#define USBFS_HPRT_PRTTSTCTL_2 (0x00008000UL) +#define USBFS_HPRT_PRTTSTCTL_3 (0x00010000UL) +#define USBFS_HPRT_PRTSPD_POS (17U) +#define USBFS_HPRT_PRTSPD (0x00060000UL) +#define USBFS_HPRT_PRTSPD_0 (0x00020000UL) +#define USBFS_HPRT_PRTSPD_1 (0x00040000UL) + +/* Bit definition for USBFS_HCCHAR0 register */ +#define USBFS_HCCHAR0_MPS_POS (0U) +#define USBFS_HCCHAR0_MPS (0x000007FFUL) +#define USBFS_HCCHAR0_EPNUM_POS (11U) +#define USBFS_HCCHAR0_EPNUM (0x00007800UL) +#define USBFS_HCCHAR0_EPDIR_POS (15U) +#define USBFS_HCCHAR0_EPDIR (0x00008000UL) +#define USBFS_HCCHAR0_LSPDDEV_POS (17U) +#define USBFS_HCCHAR0_LSPDDEV (0x00020000UL) +#define USBFS_HCCHAR0_EPTYPE_POS (18U) +#define USBFS_HCCHAR0_EPTYPE (0x000C0000UL) +#define USBFS_HCCHAR0_EPTYPE_0 (0x00040000UL) +#define USBFS_HCCHAR0_EPTYPE_1 (0x00080000UL) +#define USBFS_HCCHAR0_EC_POS (20U) +#define USBFS_HCCHAR0_EC (0x00300000UL) +#define USBFS_HCCHAR0_EC_0 (0x00100000UL) +#define USBFS_HCCHAR0_EC_1 (0x00200000UL) +#define USBFS_HCCHAR0_DEVADDR_POS (22U) +#define USBFS_HCCHAR0_DEVADDR (0x1FC00000UL) +#define USBFS_HCCHAR0_ODDFRM_POS (29U) +#define USBFS_HCCHAR0_ODDFRM (0x20000000UL) +#define USBFS_HCCHAR0_CHDIS_POS (30U) +#define USBFS_HCCHAR0_CHDIS (0x40000000UL) +#define USBFS_HCCHAR0_CHENA_POS (31U) +#define USBFS_HCCHAR0_CHENA (0x80000000UL) + +/* Bit definition for USBFS_HCSPLT0 register */ +#define USBFS_HCSPLT0_PRTADDR_POS (0U) +#define USBFS_HCSPLT0_PRTADDR (0x0000007FUL) +#define USBFS_HCSPLT0_HUBADDR_POS (7U) +#define USBFS_HCSPLT0_HUBADDR (0x00003F80UL) +#define USBFS_HCSPLT0_XACTPOS_POS (14U) +#define USBFS_HCSPLT0_XACTPOS (0x0000C000UL) +#define USBFS_HCSPLT0_XACTPOS_0 (0x00004000UL) +#define USBFS_HCSPLT0_XACTPOS_1 (0x00008000UL) +#define USBFS_HCSPLT0_COMPSPLT_POS (16U) +#define USBFS_HCSPLT0_COMPSPLT (0x00010000UL) +#define USBFS_HCSPLT0_SPLTENA_POS (31U) +#define USBFS_HCSPLT0_SPLTENA (0x80000000UL) + +/* Bit definition for USBFS_HCINT0 register */ +#define USBFS_HCINT0_XFERCOMPL_POS (0U) +#define USBFS_HCINT0_XFERCOMPL (0x00000001UL) +#define USBFS_HCINT0_CHHLTD_POS (1U) +#define USBFS_HCINT0_CHHLTD (0x00000002UL) +#define USBFS_HCINT0_AHBERR_POS (2U) +#define USBFS_HCINT0_AHBERR (0x00000004UL) +#define USBFS_HCINT0_STALL_POS (3U) +#define USBFS_HCINT0_STALL (0x00000008UL) +#define USBFS_HCINT0_NAK_POS (4U) +#define USBFS_HCINT0_NAK (0x00000010UL) +#define USBFS_HCINT0_ACK_POS (5U) +#define USBFS_HCINT0_ACK (0x00000020UL) +#define USBFS_HCINT0_NYET_POS (6U) +#define USBFS_HCINT0_NYET (0x00000040UL) +#define USBFS_HCINT0_XACTERR_POS (7U) +#define USBFS_HCINT0_XACTERR (0x00000080UL) +#define USBFS_HCINT0_BBLERR_POS (8U) +#define USBFS_HCINT0_BBLERR (0x00000100UL) +#define USBFS_HCINT0_FRMOVRUN_POS (9U) +#define USBFS_HCINT0_FRMOVRUN (0x00000200UL) +#define USBFS_HCINT0_DATATGLERR_POS (10U) +#define USBFS_HCINT0_DATATGLERR (0x00000400UL) + +/* Bit definition for USBFS_HCINTMSK0 register */ +#define USBFS_HCINTMSK0_XFERCOMPLMSK_POS (0U) +#define USBFS_HCINTMSK0_XFERCOMPLMSK (0x00000001UL) +#define USBFS_HCINTMSK0_CHHLTDMSK_POS (1U) +#define USBFS_HCINTMSK0_CHHLTDMSK (0x00000002UL) +#define USBFS_HCINTMSK0_AHBERRMSK_POS (2U) +#define USBFS_HCINTMSK0_AHBERRMSK (0x00000004UL) +#define USBFS_HCINTMSK0_STALLMSK_POS (3U) +#define USBFS_HCINTMSK0_STALLMSK (0x00000008UL) +#define USBFS_HCINTMSK0_NAKMSK_POS (4U) +#define USBFS_HCINTMSK0_NAKMSK (0x00000010UL) +#define USBFS_HCINTMSK0_ACKMSK_POS (5U) +#define USBFS_HCINTMSK0_ACKMSK (0x00000020UL) +#define USBFS_HCINTMSK0_NYETMSK_POS (6U) +#define USBFS_HCINTMSK0_NYETMSK (0x00000040UL) +#define USBFS_HCINTMSK0_XACTERRMSK_POS (7U) +#define USBFS_HCINTMSK0_XACTERRMSK (0x00000080UL) +#define USBFS_HCINTMSK0_BBLERRMSK_POS (8U) +#define USBFS_HCINTMSK0_BBLERRMSK (0x00000100UL) +#define USBFS_HCINTMSK0_FRMOVRUNMSK_POS (9U) +#define USBFS_HCINTMSK0_FRMOVRUNMSK (0x00000200UL) +#define USBFS_HCINTMSK0_DATATGLERRMSK_POS (10U) +#define USBFS_HCINTMSK0_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBFS_HCTSIZ0 register */ +#define USBFS_HCTSIZ0_XFERSIZE_POS (0U) +#define USBFS_HCTSIZ0_XFERSIZE (0x0007FFFFUL) +#define USBFS_HCTSIZ0_PKTCNT_POS (19U) +#define USBFS_HCTSIZ0_PKTCNT (0x1FF80000UL) +#define USBFS_HCTSIZ0_PID_POS (29U) +#define USBFS_HCTSIZ0_PID (0x60000000UL) +#define USBFS_HCTSIZ0_PID_0 (0x20000000UL) +#define USBFS_HCTSIZ0_PID_1 (0x40000000UL) +#define USBFS_HCTSIZ0_DOPNG_POS (31U) +#define USBFS_HCTSIZ0_DOPNG (0x80000000UL) + +/* Bit definition for USBFS_HCDMA0 register */ +#define USBFS_HCDMA0 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_HCCHAR1 register */ +#define USBFS_HCCHAR1_MPS_POS (0U) +#define USBFS_HCCHAR1_MPS (0x000007FFUL) +#define USBFS_HCCHAR1_EPNUM_POS (11U) +#define USBFS_HCCHAR1_EPNUM (0x00007800UL) +#define USBFS_HCCHAR1_EPDIR_POS (15U) +#define USBFS_HCCHAR1_EPDIR (0x00008000UL) +#define USBFS_HCCHAR1_LSPDDEV_POS (17U) +#define USBFS_HCCHAR1_LSPDDEV (0x00020000UL) +#define USBFS_HCCHAR1_EPTYPE_POS (18U) +#define USBFS_HCCHAR1_EPTYPE (0x000C0000UL) +#define USBFS_HCCHAR1_EPTYPE_0 (0x00040000UL) +#define USBFS_HCCHAR1_EPTYPE_1 (0x00080000UL) +#define USBFS_HCCHAR1_EC_POS (20U) +#define USBFS_HCCHAR1_EC (0x00300000UL) +#define USBFS_HCCHAR1_DEVADDR_POS (22U) +#define USBFS_HCCHAR1_DEVADDR (0x1FC00000UL) +#define USBFS_HCCHAR1_ODDFRM_POS (29U) +#define USBFS_HCCHAR1_ODDFRM (0x20000000UL) +#define USBFS_HCCHAR1_CHDIS_POS (30U) +#define USBFS_HCCHAR1_CHDIS (0x40000000UL) +#define USBFS_HCCHAR1_CHENA_POS (31U) +#define USBFS_HCCHAR1_CHENA (0x80000000UL) + +/* Bit definition for USBFS_HCSPLT1 register */ +#define USBFS_HCSPLT1_PRTADDR_POS (0U) +#define USBFS_HCSPLT1_PRTADDR (0x0000007FUL) +#define USBFS_HCSPLT1_HUBADDR_POS (7U) +#define USBFS_HCSPLT1_HUBADDR (0x00003F80UL) +#define USBFS_HCSPLT1_XACTPOS_POS (14U) +#define USBFS_HCSPLT1_XACTPOS (0x0000C000UL) +#define USBFS_HCSPLT1_XACTPOS_0 (0x00004000UL) +#define USBFS_HCSPLT1_XACTPOS_1 (0x00008000UL) +#define USBFS_HCSPLT1_COMPSPLT_POS (16U) +#define USBFS_HCSPLT1_COMPSPLT (0x00010000UL) +#define USBFS_HCSPLT1_SPLTENA_POS (31U) +#define USBFS_HCSPLT1_SPLTENA (0x80000000UL) + +/* Bit definition for USBFS_HCINT1 register */ +#define USBFS_HCINT1_XFERCOMPL_POS (0U) +#define USBFS_HCINT1_XFERCOMPL (0x00000001UL) +#define USBFS_HCINT1_CHHLTD_POS (1U) +#define USBFS_HCINT1_CHHLTD (0x00000002UL) +#define USBFS_HCINT1_AHBERR_POS (2U) +#define USBFS_HCINT1_AHBERR (0x00000004UL) +#define USBFS_HCINT1_STALL_POS (3U) +#define USBFS_HCINT1_STALL (0x00000008UL) +#define USBFS_HCINT1_NAK_POS (4U) +#define USBFS_HCINT1_NAK (0x00000010UL) +#define USBFS_HCINT1_ACK_POS (5U) +#define USBFS_HCINT1_ACK (0x00000020UL) +#define USBFS_HCINT1_NYET_POS (6U) +#define USBFS_HCINT1_NYET (0x00000040UL) +#define USBFS_HCINT1_XACTERR_POS (7U) +#define USBFS_HCINT1_XACTERR (0x00000080UL) +#define USBFS_HCINT1_BBLERR_POS (8U) +#define USBFS_HCINT1_BBLERR (0x00000100UL) +#define USBFS_HCINT1_FRMOVRUN_POS (9U) +#define USBFS_HCINT1_FRMOVRUN (0x00000200UL) +#define USBFS_HCINT1_DATATGLERR_POS (10U) +#define USBFS_HCINT1_DATATGLERR (0x00000400UL) + +/* Bit definition for USBFS_HCINTMSK1 register */ +#define USBFS_HCINTMSK1_XFERCOMPLMSK_POS (0U) +#define USBFS_HCINTMSK1_XFERCOMPLMSK (0x00000001UL) +#define USBFS_HCINTMSK1_CHHLTDMSK_POS (1U) +#define USBFS_HCINTMSK1_CHHLTDMSK (0x00000002UL) +#define USBFS_HCINTMSK1_AHBERRMSK_POS (2U) +#define USBFS_HCINTMSK1_AHBERRMSK (0x00000004UL) +#define USBFS_HCINTMSK1_STALLMSK_POS (3U) +#define USBFS_HCINTMSK1_STALLMSK (0x00000008UL) +#define USBFS_HCINTMSK1_NAKMSK_POS (4U) +#define USBFS_HCINTMSK1_NAKMSK (0x00000010UL) +#define USBFS_HCINTMSK1_ACKMSK_POS (5U) +#define USBFS_HCINTMSK1_ACKMSK (0x00000020UL) +#define USBFS_HCINTMSK1_NYETMSK_POS (6U) +#define USBFS_HCINTMSK1_NYETMSK (0x00000040UL) +#define USBFS_HCINTMSK1_XACTERRMSK_POS (7U) +#define USBFS_HCINTMSK1_XACTERRMSK (0x00000080UL) +#define USBFS_HCINTMSK1_BBLERRMSK_POS (8U) +#define USBFS_HCINTMSK1_BBLERRMSK (0x00000100UL) +#define USBFS_HCINTMSK1_FRMOVRUNMSK_POS (9U) +#define USBFS_HCINTMSK1_FRMOVRUNMSK (0x00000200UL) +#define USBFS_HCINTMSK1_DATATGLERRMSK_POS (10U) +#define USBFS_HCINTMSK1_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBFS_HCTSIZ1 register */ +#define USBFS_HCTSIZ1_XFERSIZE_POS (0U) +#define USBFS_HCTSIZ1_XFERSIZE (0x0007FFFFUL) +#define USBFS_HCTSIZ1_PKTCNT_POS (19U) +#define USBFS_HCTSIZ1_PKTCNT (0x1FF80000UL) +#define USBFS_HCTSIZ1_PID_POS (29U) +#define USBFS_HCTSIZ1_PID (0x60000000UL) +#define USBFS_HCTSIZ1_PID_0 (0x20000000UL) +#define USBFS_HCTSIZ1_PID_1 (0x40000000UL) +#define USBFS_HCTSIZ1_DOPNG_POS (31U) +#define USBFS_HCTSIZ1_DOPNG (0x80000000UL) + +/* Bit definition for USBFS_HCDMA1 register */ +#define USBFS_HCDMA1 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_HCCHAR2 register */ +#define USBFS_HCCHAR2_MPS_POS (0U) +#define USBFS_HCCHAR2_MPS (0x000007FFUL) +#define USBFS_HCCHAR2_EPNUM_POS (11U) +#define USBFS_HCCHAR2_EPNUM (0x00007800UL) +#define USBFS_HCCHAR2_EPDIR_POS (15U) +#define USBFS_HCCHAR2_EPDIR (0x00008000UL) +#define USBFS_HCCHAR2_LSPDDEV_POS (17U) +#define USBFS_HCCHAR2_LSPDDEV (0x00020000UL) +#define USBFS_HCCHAR2_EPTYPE_POS (18U) +#define USBFS_HCCHAR2_EPTYPE (0x000C0000UL) +#define USBFS_HCCHAR2_EPTYPE_0 (0x00040000UL) +#define USBFS_HCCHAR2_EPTYPE_1 (0x00080000UL) +#define USBFS_HCCHAR2_EC_POS (20U) +#define USBFS_HCCHAR2_EC (0x00300000UL) +#define USBFS_HCCHAR2_DEVADDR_POS (22U) +#define USBFS_HCCHAR2_DEVADDR (0x1FC00000UL) +#define USBFS_HCCHAR2_ODDFRM_POS (29U) +#define USBFS_HCCHAR2_ODDFRM (0x20000000UL) +#define USBFS_HCCHAR2_CHDIS_POS (30U) +#define USBFS_HCCHAR2_CHDIS (0x40000000UL) +#define USBFS_HCCHAR2_CHENA_POS (31U) +#define USBFS_HCCHAR2_CHENA (0x80000000UL) + +/* Bit definition for USBFS_HCSPLT2 register */ +#define USBFS_HCSPLT2_PRTADDR_POS (0U) +#define USBFS_HCSPLT2_PRTADDR (0x0000007FUL) +#define USBFS_HCSPLT2_HUBADDR_POS (7U) +#define USBFS_HCSPLT2_HUBADDR (0x00003F80UL) +#define USBFS_HCSPLT2_XACTPOS_POS (14U) +#define USBFS_HCSPLT2_XACTPOS (0x0000C000UL) +#define USBFS_HCSPLT2_XACTPOS_0 (0x00004000UL) +#define USBFS_HCSPLT2_XACTPOS_1 (0x00008000UL) +#define USBFS_HCSPLT2_COMPSPLT_POS (16U) +#define USBFS_HCSPLT2_COMPSPLT (0x00010000UL) +#define USBFS_HCSPLT2_SPLTENA_POS (31U) +#define USBFS_HCSPLT2_SPLTENA (0x80000000UL) + +/* Bit definition for USBFS_HCINT2 register */ +#define USBFS_HCINT2_XFERCOMPL_POS (0U) +#define USBFS_HCINT2_XFERCOMPL (0x00000001UL) +#define USBFS_HCINT2_CHHLTD_POS (1U) +#define USBFS_HCINT2_CHHLTD (0x00000002UL) +#define USBFS_HCINT2_AHBERR_POS (2U) +#define USBFS_HCINT2_AHBERR (0x00000004UL) +#define USBFS_HCINT2_STALL_POS (3U) +#define USBFS_HCINT2_STALL (0x00000008UL) +#define USBFS_HCINT2_NAK_POS (4U) +#define USBFS_HCINT2_NAK (0x00000010UL) +#define USBFS_HCINT2_ACK_POS (5U) +#define USBFS_HCINT2_ACK (0x00000020UL) +#define USBFS_HCINT2_NYET_POS (6U) +#define USBFS_HCINT2_NYET (0x00000040UL) +#define USBFS_HCINT2_XACTERR_POS (7U) +#define USBFS_HCINT2_XACTERR (0x00000080UL) +#define USBFS_HCINT2_BBLERR_POS (8U) +#define USBFS_HCINT2_BBLERR (0x00000100UL) +#define USBFS_HCINT2_FRMOVRUN_POS (9U) +#define USBFS_HCINT2_FRMOVRUN (0x00000200UL) +#define USBFS_HCINT2_DATATGLERR_POS (10U) +#define USBFS_HCINT2_DATATGLERR (0x00000400UL) + +/* Bit definition for USBFS_HCINTMSK2 register */ +#define USBFS_HCINTMSK2_XFERCOMPLMSK_POS (0U) +#define USBFS_HCINTMSK2_XFERCOMPLMSK (0x00000001UL) +#define USBFS_HCINTMSK2_CHHLTDMSK_POS (1U) +#define USBFS_HCINTMSK2_CHHLTDMSK (0x00000002UL) +#define USBFS_HCINTMSK2_AHBERRMSK_POS (2U) +#define USBFS_HCINTMSK2_AHBERRMSK (0x00000004UL) +#define USBFS_HCINTMSK2_STALLMSK_POS (3U) +#define USBFS_HCINTMSK2_STALLMSK (0x00000008UL) +#define USBFS_HCINTMSK2_NAKMSK_POS (4U) +#define USBFS_HCINTMSK2_NAKMSK (0x00000010UL) +#define USBFS_HCINTMSK2_ACKMSK_POS (5U) +#define USBFS_HCINTMSK2_ACKMSK (0x00000020UL) +#define USBFS_HCINTMSK2_NYETMSK_POS (6U) +#define USBFS_HCINTMSK2_NYETMSK (0x00000040UL) +#define USBFS_HCINTMSK2_XACTERRMSK_POS (7U) +#define USBFS_HCINTMSK2_XACTERRMSK (0x00000080UL) +#define USBFS_HCINTMSK2_BBLERRMSK_POS (8U) +#define USBFS_HCINTMSK2_BBLERRMSK (0x00000100UL) +#define USBFS_HCINTMSK2_FRMOVRUNMSK_POS (9U) +#define USBFS_HCINTMSK2_FRMOVRUNMSK (0x00000200UL) +#define USBFS_HCINTMSK2_DATATGLERRMSK_POS (10U) +#define USBFS_HCINTMSK2_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBFS_HCTSIZ2 register */ +#define USBFS_HCTSIZ2_XFERSIZE_POS (0U) +#define USBFS_HCTSIZ2_XFERSIZE (0x0007FFFFUL) +#define USBFS_HCTSIZ2_PKTCNT_POS (19U) +#define USBFS_HCTSIZ2_PKTCNT (0x1FF80000UL) +#define USBFS_HCTSIZ2_PID_POS (29U) +#define USBFS_HCTSIZ2_PID (0x60000000UL) +#define USBFS_HCTSIZ2_PID_0 (0x20000000UL) +#define USBFS_HCTSIZ2_PID_1 (0x40000000UL) +#define USBFS_HCTSIZ2_DOPNG_POS (31U) +#define USBFS_HCTSIZ2_DOPNG (0x80000000UL) + +/* Bit definition for USBFS_HCDMA2 register */ +#define USBFS_HCDMA2 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_HCCHAR3 register */ +#define USBFS_HCCHAR3_MPS_POS (0U) +#define USBFS_HCCHAR3_MPS (0x000007FFUL) +#define USBFS_HCCHAR3_EPNUM_POS (11U) +#define USBFS_HCCHAR3_EPNUM (0x00007800UL) +#define USBFS_HCCHAR3_EPDIR_POS (15U) +#define USBFS_HCCHAR3_EPDIR (0x00008000UL) +#define USBFS_HCCHAR3_LSPDDEV_POS (17U) +#define USBFS_HCCHAR3_LSPDDEV (0x00020000UL) +#define USBFS_HCCHAR3_EPTYPE_POS (18U) +#define USBFS_HCCHAR3_EPTYPE (0x000C0000UL) +#define USBFS_HCCHAR3_EPTYPE_0 (0x00040000UL) +#define USBFS_HCCHAR3_EPTYPE_1 (0x00080000UL) +#define USBFS_HCCHAR3_EC_POS (20U) +#define USBFS_HCCHAR3_EC (0x00300000UL) +#define USBFS_HCCHAR3_DEVADDR_POS (22U) +#define USBFS_HCCHAR3_DEVADDR (0x1FC00000UL) +#define USBFS_HCCHAR3_ODDFRM_POS (29U) +#define USBFS_HCCHAR3_ODDFRM (0x20000000UL) +#define USBFS_HCCHAR3_CHDIS_POS (30U) +#define USBFS_HCCHAR3_CHDIS (0x40000000UL) +#define USBFS_HCCHAR3_CHENA_POS (31U) +#define USBFS_HCCHAR3_CHENA (0x80000000UL) + +/* Bit definition for USBFS_HCSPLT3 register */ +#define USBFS_HCSPLT3_PRTADDR_POS (0U) +#define USBFS_HCSPLT3_PRTADDR (0x0000007FUL) +#define USBFS_HCSPLT3_HUBADDR_POS (7U) +#define USBFS_HCSPLT3_HUBADDR (0x00003F80UL) +#define USBFS_HCSPLT3_XACTPOS_POS (14U) +#define USBFS_HCSPLT3_XACTPOS (0x0000C000UL) +#define USBFS_HCSPLT3_XACTPOS_0 (0x00004000UL) +#define USBFS_HCSPLT3_XACTPOS_1 (0x00008000UL) +#define USBFS_HCSPLT3_COMPSPLT_POS (16U) +#define USBFS_HCSPLT3_COMPSPLT (0x00010000UL) +#define USBFS_HCSPLT3_SPLTENA_POS (31U) +#define USBFS_HCSPLT3_SPLTENA (0x80000000UL) + +/* Bit definition for USBFS_HCINT3 register */ +#define USBFS_HCINT3_XFERCOMPL_POS (0U) +#define USBFS_HCINT3_XFERCOMPL (0x00000001UL) +#define USBFS_HCINT3_CHHLTD_POS (1U) +#define USBFS_HCINT3_CHHLTD (0x00000002UL) +#define USBFS_HCINT3_AHBERR_POS (2U) +#define USBFS_HCINT3_AHBERR (0x00000004UL) +#define USBFS_HCINT3_STALL_POS (3U) +#define USBFS_HCINT3_STALL (0x00000008UL) +#define USBFS_HCINT3_NAK_POS (4U) +#define USBFS_HCINT3_NAK (0x00000010UL) +#define USBFS_HCINT3_ACK_POS (5U) +#define USBFS_HCINT3_ACK (0x00000020UL) +#define USBFS_HCINT3_NYET_POS (6U) +#define USBFS_HCINT3_NYET (0x00000040UL) +#define USBFS_HCINT3_XACTERR_POS (7U) +#define USBFS_HCINT3_XACTERR (0x00000080UL) +#define USBFS_HCINT3_BBLERR_POS (8U) +#define USBFS_HCINT3_BBLERR (0x00000100UL) +#define USBFS_HCINT3_FRMOVRUN_POS (9U) +#define USBFS_HCINT3_FRMOVRUN (0x00000200UL) +#define USBFS_HCINT3_DATATGLERR_POS (10U) +#define USBFS_HCINT3_DATATGLERR (0x00000400UL) + +/* Bit definition for USBFS_HCINTMSK3 register */ +#define USBFS_HCINTMSK3_XFERCOMPLMSK_POS (0U) +#define USBFS_HCINTMSK3_XFERCOMPLMSK (0x00000001UL) +#define USBFS_HCINTMSK3_CHHLTDMSK_POS (1U) +#define USBFS_HCINTMSK3_CHHLTDMSK (0x00000002UL) +#define USBFS_HCINTMSK3_AHBERRMSK_POS (2U) +#define USBFS_HCINTMSK3_AHBERRMSK (0x00000004UL) +#define USBFS_HCINTMSK3_STALLMSK_POS (3U) +#define USBFS_HCINTMSK3_STALLMSK (0x00000008UL) +#define USBFS_HCINTMSK3_NAKMSK_POS (4U) +#define USBFS_HCINTMSK3_NAKMSK (0x00000010UL) +#define USBFS_HCINTMSK3_ACKMSK_POS (5U) +#define USBFS_HCINTMSK3_ACKMSK (0x00000020UL) +#define USBFS_HCINTMSK3_NYETMSK_POS (6U) +#define USBFS_HCINTMSK3_NYETMSK (0x00000040UL) +#define USBFS_HCINTMSK3_XACTERRMSK_POS (7U) +#define USBFS_HCINTMSK3_XACTERRMSK (0x00000080UL) +#define USBFS_HCINTMSK3_BBLERRMSK_POS (8U) +#define USBFS_HCINTMSK3_BBLERRMSK (0x00000100UL) +#define USBFS_HCINTMSK3_FRMOVRUNMSK_POS (9U) +#define USBFS_HCINTMSK3_FRMOVRUNMSK (0x00000200UL) +#define USBFS_HCINTMSK3_DATATGLERRMSK_POS (10U) +#define USBFS_HCINTMSK3_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBFS_HCTSIZ3 register */ +#define USBFS_HCTSIZ3_XFERSIZE_POS (0U) +#define USBFS_HCTSIZ3_XFERSIZE (0x0007FFFFUL) +#define USBFS_HCTSIZ3_PKTCNT_POS (19U) +#define USBFS_HCTSIZ3_PKTCNT (0x1FF80000UL) +#define USBFS_HCTSIZ3_PID_POS (29U) +#define USBFS_HCTSIZ3_PID (0x60000000UL) +#define USBFS_HCTSIZ3_PID_0 (0x20000000UL) +#define USBFS_HCTSIZ3_PID_1 (0x40000000UL) +#define USBFS_HCTSIZ3_DOPNG_POS (31U) +#define USBFS_HCTSIZ3_DOPNG (0x80000000UL) + +/* Bit definition for USBFS_HCDMA3 register */ +#define USBFS_HCDMA3 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_HCCHAR4 register */ +#define USBFS_HCCHAR4_MPS_POS (0U) +#define USBFS_HCCHAR4_MPS (0x000007FFUL) +#define USBFS_HCCHAR4_EPNUM_POS (11U) +#define USBFS_HCCHAR4_EPNUM (0x00007800UL) +#define USBFS_HCCHAR4_EPDIR_POS (15U) +#define USBFS_HCCHAR4_EPDIR (0x00008000UL) +#define USBFS_HCCHAR4_LSPDDEV_POS (17U) +#define USBFS_HCCHAR4_LSPDDEV (0x00020000UL) +#define USBFS_HCCHAR4_EPTYPE_POS (18U) +#define USBFS_HCCHAR4_EPTYPE (0x000C0000UL) +#define USBFS_HCCHAR4_EPTYPE_0 (0x00040000UL) +#define USBFS_HCCHAR4_EPTYPE_1 (0x00080000UL) +#define USBFS_HCCHAR4_EC_POS (20U) +#define USBFS_HCCHAR4_EC (0x00300000UL) +#define USBFS_HCCHAR4_DEVADDR_POS (22U) +#define USBFS_HCCHAR4_DEVADDR (0x1FC00000UL) +#define USBFS_HCCHAR4_ODDFRM_POS (29U) +#define USBFS_HCCHAR4_ODDFRM (0x20000000UL) +#define USBFS_HCCHAR4_CHDIS_POS (30U) +#define USBFS_HCCHAR4_CHDIS (0x40000000UL) +#define USBFS_HCCHAR4_CHENA_POS (31U) +#define USBFS_HCCHAR4_CHENA (0x80000000UL) + +/* Bit definition for USBFS_HCSPLT4 register */ +#define USBFS_HCSPLT4_PRTADDR_POS (0U) +#define USBFS_HCSPLT4_PRTADDR (0x0000007FUL) +#define USBFS_HCSPLT4_HUBADDR_POS (7U) +#define USBFS_HCSPLT4_HUBADDR (0x00003F80UL) +#define USBFS_HCSPLT4_XACTPOS_POS (14U) +#define USBFS_HCSPLT4_XACTPOS (0x0000C000UL) +#define USBFS_HCSPLT4_XACTPOS_0 (0x00004000UL) +#define USBFS_HCSPLT4_XACTPOS_1 (0x00008000UL) +#define USBFS_HCSPLT4_COMPSPLT_POS (16U) +#define USBFS_HCSPLT4_COMPSPLT (0x00010000UL) +#define USBFS_HCSPLT4_SPLTENA_POS (31U) +#define USBFS_HCSPLT4_SPLTENA (0x80000000UL) + +/* Bit definition for USBFS_HCINT4 register */ +#define USBFS_HCINT4_XFERCOMPL_POS (0U) +#define USBFS_HCINT4_XFERCOMPL (0x00000001UL) +#define USBFS_HCINT4_CHHLTD_POS (1U) +#define USBFS_HCINT4_CHHLTD (0x00000002UL) +#define USBFS_HCINT4_AHBERR_POS (2U) +#define USBFS_HCINT4_AHBERR (0x00000004UL) +#define USBFS_HCINT4_STALL_POS (3U) +#define USBFS_HCINT4_STALL (0x00000008UL) +#define USBFS_HCINT4_NAK_POS (4U) +#define USBFS_HCINT4_NAK (0x00000010UL) +#define USBFS_HCINT4_ACK_POS (5U) +#define USBFS_HCINT4_ACK (0x00000020UL) +#define USBFS_HCINT4_NYET_POS (6U) +#define USBFS_HCINT4_NYET (0x00000040UL) +#define USBFS_HCINT4_XACTERR_POS (7U) +#define USBFS_HCINT4_XACTERR (0x00000080UL) +#define USBFS_HCINT4_BBLERR_POS (8U) +#define USBFS_HCINT4_BBLERR (0x00000100UL) +#define USBFS_HCINT4_FRMOVRUN_POS (9U) +#define USBFS_HCINT4_FRMOVRUN (0x00000200UL) +#define USBFS_HCINT4_DATATGLERR_POS (10U) +#define USBFS_HCINT4_DATATGLERR (0x00000400UL) + +/* Bit definition for USBFS_HCINTMSK4 register */ +#define USBFS_HCINTMSK4_XFERCOMPLMSK_POS (0U) +#define USBFS_HCINTMSK4_XFERCOMPLMSK (0x00000001UL) +#define USBFS_HCINTMSK4_CHHLTDMSK_POS (1U) +#define USBFS_HCINTMSK4_CHHLTDMSK (0x00000002UL) +#define USBFS_HCINTMSK4_AHBERRMSK_POS (2U) +#define USBFS_HCINTMSK4_AHBERRMSK (0x00000004UL) +#define USBFS_HCINTMSK4_STALLMSK_POS (3U) +#define USBFS_HCINTMSK4_STALLMSK (0x00000008UL) +#define USBFS_HCINTMSK4_NAKMSK_POS (4U) +#define USBFS_HCINTMSK4_NAKMSK (0x00000010UL) +#define USBFS_HCINTMSK4_ACKMSK_POS (5U) +#define USBFS_HCINTMSK4_ACKMSK (0x00000020UL) +#define USBFS_HCINTMSK4_NYETMSK_POS (6U) +#define USBFS_HCINTMSK4_NYETMSK (0x00000040UL) +#define USBFS_HCINTMSK4_XACTERRMSK_POS (7U) +#define USBFS_HCINTMSK4_XACTERRMSK (0x00000080UL) +#define USBFS_HCINTMSK4_BBLERRMSK_POS (8U) +#define USBFS_HCINTMSK4_BBLERRMSK (0x00000100UL) +#define USBFS_HCINTMSK4_FRMOVRUNMSK_POS (9U) +#define USBFS_HCINTMSK4_FRMOVRUNMSK (0x00000200UL) +#define USBFS_HCINTMSK4_DATATGLERRMSK_POS (10U) +#define USBFS_HCINTMSK4_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBFS_HCTSIZ4 register */ +#define USBFS_HCTSIZ4_XFERSIZE_POS (0U) +#define USBFS_HCTSIZ4_XFERSIZE (0x0007FFFFUL) +#define USBFS_HCTSIZ4_PKTCNT_POS (19U) +#define USBFS_HCTSIZ4_PKTCNT (0x1FF80000UL) +#define USBFS_HCTSIZ4_PID_POS (29U) +#define USBFS_HCTSIZ4_PID (0x60000000UL) +#define USBFS_HCTSIZ4_PID_0 (0x20000000UL) +#define USBFS_HCTSIZ4_PID_1 (0x40000000UL) +#define USBFS_HCTSIZ4_DOPNG_POS (31U) +#define USBFS_HCTSIZ4_DOPNG (0x80000000UL) + +/* Bit definition for USBFS_HCDMA4 register */ +#define USBFS_HCDMA4 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_HCCHAR5 register */ +#define USBFS_HCCHAR5_MPS_POS (0U) +#define USBFS_HCCHAR5_MPS (0x000007FFUL) +#define USBFS_HCCHAR5_EPNUM_POS (11U) +#define USBFS_HCCHAR5_EPNUM (0x00007800UL) +#define USBFS_HCCHAR5_EPDIR_POS (15U) +#define USBFS_HCCHAR5_EPDIR (0x00008000UL) +#define USBFS_HCCHAR5_LSPDDEV_POS (17U) +#define USBFS_HCCHAR5_LSPDDEV (0x00020000UL) +#define USBFS_HCCHAR5_EPTYPE_POS (18U) +#define USBFS_HCCHAR5_EPTYPE (0x000C0000UL) +#define USBFS_HCCHAR5_EPTYPE_0 (0x00040000UL) +#define USBFS_HCCHAR5_EPTYPE_1 (0x00080000UL) +#define USBFS_HCCHAR5_EC_POS (20U) +#define USBFS_HCCHAR5_EC (0x00300000UL) +#define USBFS_HCCHAR5_DEVADDR_POS (22U) +#define USBFS_HCCHAR5_DEVADDR (0x1FC00000UL) +#define USBFS_HCCHAR5_ODDFRM_POS (29U) +#define USBFS_HCCHAR5_ODDFRM (0x20000000UL) +#define USBFS_HCCHAR5_CHDIS_POS (30U) +#define USBFS_HCCHAR5_CHDIS (0x40000000UL) +#define USBFS_HCCHAR5_CHENA_POS (31U) +#define USBFS_HCCHAR5_CHENA (0x80000000UL) + +/* Bit definition for USBFS_HCSPLT5 register */ +#define USBFS_HCSPLT5_PRTADDR_POS (0U) +#define USBFS_HCSPLT5_PRTADDR (0x0000007FUL) +#define USBFS_HCSPLT5_HUBADDR_POS (7U) +#define USBFS_HCSPLT5_HUBADDR (0x00003F80UL) +#define USBFS_HCSPLT5_XACTPOS_POS (14U) +#define USBFS_HCSPLT5_XACTPOS (0x0000C000UL) +#define USBFS_HCSPLT5_XACTPOS_0 (0x00004000UL) +#define USBFS_HCSPLT5_XACTPOS_1 (0x00008000UL) +#define USBFS_HCSPLT5_COMPSPLT_POS (16U) +#define USBFS_HCSPLT5_COMPSPLT (0x00010000UL) +#define USBFS_HCSPLT5_SPLTENA_POS (31U) +#define USBFS_HCSPLT5_SPLTENA (0x80000000UL) + +/* Bit definition for USBFS_HCINT5 register */ +#define USBFS_HCINT5_XFERCOMPL_POS (0U) +#define USBFS_HCINT5_XFERCOMPL (0x00000001UL) +#define USBFS_HCINT5_CHHLTD_POS (1U) +#define USBFS_HCINT5_CHHLTD (0x00000002UL) +#define USBFS_HCINT5_AHBERR_POS (2U) +#define USBFS_HCINT5_AHBERR (0x00000004UL) +#define USBFS_HCINT5_STALL_POS (3U) +#define USBFS_HCINT5_STALL (0x00000008UL) +#define USBFS_HCINT5_NAK_POS (4U) +#define USBFS_HCINT5_NAK (0x00000010UL) +#define USBFS_HCINT5_ACK_POS (5U) +#define USBFS_HCINT5_ACK (0x00000020UL) +#define USBFS_HCINT5_NYET_POS (6U) +#define USBFS_HCINT5_NYET (0x00000040UL) +#define USBFS_HCINT5_XACTERR_POS (7U) +#define USBFS_HCINT5_XACTERR (0x00000080UL) +#define USBFS_HCINT5_BBLERR_POS (8U) +#define USBFS_HCINT5_BBLERR (0x00000100UL) +#define USBFS_HCINT5_FRMOVRUN_POS (9U) +#define USBFS_HCINT5_FRMOVRUN (0x00000200UL) +#define USBFS_HCINT5_DATATGLERR_POS (10U) +#define USBFS_HCINT5_DATATGLERR (0x00000400UL) + +/* Bit definition for USBFS_HCINTMSK5 register */ +#define USBFS_HCINTMSK5_XFERCOMPLMSK_POS (0U) +#define USBFS_HCINTMSK5_XFERCOMPLMSK (0x00000001UL) +#define USBFS_HCINTMSK5_CHHLTDMSK_POS (1U) +#define USBFS_HCINTMSK5_CHHLTDMSK (0x00000002UL) +#define USBFS_HCINTMSK5_AHBERRMSK_POS (2U) +#define USBFS_HCINTMSK5_AHBERRMSK (0x00000004UL) +#define USBFS_HCINTMSK5_STALLMSK_POS (3U) +#define USBFS_HCINTMSK5_STALLMSK (0x00000008UL) +#define USBFS_HCINTMSK5_NAKMSK_POS (4U) +#define USBFS_HCINTMSK5_NAKMSK (0x00000010UL) +#define USBFS_HCINTMSK5_ACKMSK_POS (5U) +#define USBFS_HCINTMSK5_ACKMSK (0x00000020UL) +#define USBFS_HCINTMSK5_NYETMSK_POS (6U) +#define USBFS_HCINTMSK5_NYETMSK (0x00000040UL) +#define USBFS_HCINTMSK5_XACTERRMSK_POS (7U) +#define USBFS_HCINTMSK5_XACTERRMSK (0x00000080UL) +#define USBFS_HCINTMSK5_BBLERRMSK_POS (8U) +#define USBFS_HCINTMSK5_BBLERRMSK (0x00000100UL) +#define USBFS_HCINTMSK5_FRMOVRUNMSK_POS (9U) +#define USBFS_HCINTMSK5_FRMOVRUNMSK (0x00000200UL) +#define USBFS_HCINTMSK5_DATATGLERRMSK_POS (10U) +#define USBFS_HCINTMSK5_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBFS_HCTSIZ5 register */ +#define USBFS_HCTSIZ5_XFERSIZE_POS (0U) +#define USBFS_HCTSIZ5_XFERSIZE (0x0007FFFFUL) +#define USBFS_HCTSIZ5_PKTCNT_POS (19U) +#define USBFS_HCTSIZ5_PKTCNT (0x1FF80000UL) +#define USBFS_HCTSIZ5_PID_POS (29U) +#define USBFS_HCTSIZ5_PID (0x60000000UL) +#define USBFS_HCTSIZ5_PID_0 (0x20000000UL) +#define USBFS_HCTSIZ5_PID_1 (0x40000000UL) +#define USBFS_HCTSIZ5_DOPNG_POS (31U) +#define USBFS_HCTSIZ5_DOPNG (0x80000000UL) + +/* Bit definition for USBFS_HCDMA5 register */ +#define USBFS_HCDMA5 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_HCCHAR6 register */ +#define USBFS_HCCHAR6_MPS_POS (0U) +#define USBFS_HCCHAR6_MPS (0x000007FFUL) +#define USBFS_HCCHAR6_EPNUM_POS (11U) +#define USBFS_HCCHAR6_EPNUM (0x00007800UL) +#define USBFS_HCCHAR6_EPDIR_POS (15U) +#define USBFS_HCCHAR6_EPDIR (0x00008000UL) +#define USBFS_HCCHAR6_LSPDDEV_POS (17U) +#define USBFS_HCCHAR6_LSPDDEV (0x00020000UL) +#define USBFS_HCCHAR6_EPTYPE_POS (18U) +#define USBFS_HCCHAR6_EPTYPE (0x000C0000UL) +#define USBFS_HCCHAR6_EPTYPE_0 (0x00040000UL) +#define USBFS_HCCHAR6_EPTYPE_1 (0x00080000UL) +#define USBFS_HCCHAR6_EC_POS (20U) +#define USBFS_HCCHAR6_EC (0x00300000UL) +#define USBFS_HCCHAR6_DEVADDR_POS (22U) +#define USBFS_HCCHAR6_DEVADDR (0x1FC00000UL) +#define USBFS_HCCHAR6_ODDFRM_POS (29U) +#define USBFS_HCCHAR6_ODDFRM (0x20000000UL) +#define USBFS_HCCHAR6_CHDIS_POS (30U) +#define USBFS_HCCHAR6_CHDIS (0x40000000UL) +#define USBFS_HCCHAR6_CHENA_POS (31U) +#define USBFS_HCCHAR6_CHENA (0x80000000UL) + +/* Bit definition for USBFS_HCSPLT6 register */ +#define USBFS_HCSPLT6_PRTADDR_POS (0U) +#define USBFS_HCSPLT6_PRTADDR (0x0000007FUL) +#define USBFS_HCSPLT6_HUBADDR_POS (7U) +#define USBFS_HCSPLT6_HUBADDR (0x00003F80UL) +#define USBFS_HCSPLT6_XACTPOS_POS (14U) +#define USBFS_HCSPLT6_XACTPOS (0x0000C000UL) +#define USBFS_HCSPLT6_XACTPOS_0 (0x00004000UL) +#define USBFS_HCSPLT6_XACTPOS_1 (0x00008000UL) +#define USBFS_HCSPLT6_COMPSPLT_POS (16U) +#define USBFS_HCSPLT6_COMPSPLT (0x00010000UL) +#define USBFS_HCSPLT6_SPLTENA_POS (31U) +#define USBFS_HCSPLT6_SPLTENA (0x80000000UL) + +/* Bit definition for USBFS_HCINT6 register */ +#define USBFS_HCINT6_XFERCOMPL_POS (0U) +#define USBFS_HCINT6_XFERCOMPL (0x00000001UL) +#define USBFS_HCINT6_CHHLTD_POS (1U) +#define USBFS_HCINT6_CHHLTD (0x00000002UL) +#define USBFS_HCINT6_AHBERR_POS (2U) +#define USBFS_HCINT6_AHBERR (0x00000004UL) +#define USBFS_HCINT6_STALL_POS (3U) +#define USBFS_HCINT6_STALL (0x00000008UL) +#define USBFS_HCINT6_NAK_POS (4U) +#define USBFS_HCINT6_NAK (0x00000010UL) +#define USBFS_HCINT6_ACK_POS (5U) +#define USBFS_HCINT6_ACK (0x00000020UL) +#define USBFS_HCINT6_NYET_POS (6U) +#define USBFS_HCINT6_NYET (0x00000040UL) +#define USBFS_HCINT6_XACTERR_POS (7U) +#define USBFS_HCINT6_XACTERR (0x00000080UL) +#define USBFS_HCINT6_BBLERR_POS (8U) +#define USBFS_HCINT6_BBLERR (0x00000100UL) +#define USBFS_HCINT6_FRMOVRUN_POS (9U) +#define USBFS_HCINT6_FRMOVRUN (0x00000200UL) +#define USBFS_HCINT6_DATATGLERR_POS (10U) +#define USBFS_HCINT6_DATATGLERR (0x00000400UL) + +/* Bit definition for USBFS_HCINTMSK6 register */ +#define USBFS_HCINTMSK6_XFERCOMPLMSK_POS (0U) +#define USBFS_HCINTMSK6_XFERCOMPLMSK (0x00000001UL) +#define USBFS_HCINTMSK6_CHHLTDMSK_POS (1U) +#define USBFS_HCINTMSK6_CHHLTDMSK (0x00000002UL) +#define USBFS_HCINTMSK6_AHBERRMSK_POS (2U) +#define USBFS_HCINTMSK6_AHBERRMSK (0x00000004UL) +#define USBFS_HCINTMSK6_STALLMSK_POS (3U) +#define USBFS_HCINTMSK6_STALLMSK (0x00000008UL) +#define USBFS_HCINTMSK6_NAKMSK_POS (4U) +#define USBFS_HCINTMSK6_NAKMSK (0x00000010UL) +#define USBFS_HCINTMSK6_ACKMSK_POS (5U) +#define USBFS_HCINTMSK6_ACKMSK (0x00000020UL) +#define USBFS_HCINTMSK6_NYETMSK_POS (6U) +#define USBFS_HCINTMSK6_NYETMSK (0x00000040UL) +#define USBFS_HCINTMSK6_XACTERRMSK_POS (7U) +#define USBFS_HCINTMSK6_XACTERRMSK (0x00000080UL) +#define USBFS_HCINTMSK6_BBLERRMSK_POS (8U) +#define USBFS_HCINTMSK6_BBLERRMSK (0x00000100UL) +#define USBFS_HCINTMSK6_FRMOVRUNMSK_POS (9U) +#define USBFS_HCINTMSK6_FRMOVRUNMSK (0x00000200UL) +#define USBFS_HCINTMSK6_DATATGLERRMSK_POS (10U) +#define USBFS_HCINTMSK6_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBFS_HCTSIZ6 register */ +#define USBFS_HCTSIZ6_XFERSIZE_POS (0U) +#define USBFS_HCTSIZ6_XFERSIZE (0x0007FFFFUL) +#define USBFS_HCTSIZ6_PKTCNT_POS (19U) +#define USBFS_HCTSIZ6_PKTCNT (0x1FF80000UL) +#define USBFS_HCTSIZ6_PID_POS (29U) +#define USBFS_HCTSIZ6_PID (0x60000000UL) +#define USBFS_HCTSIZ6_PID_0 (0x20000000UL) +#define USBFS_HCTSIZ6_PID_1 (0x40000000UL) +#define USBFS_HCTSIZ6_DOPNG_POS (31U) +#define USBFS_HCTSIZ6_DOPNG (0x80000000UL) + +/* Bit definition for USBFS_HCDMA6 register */ +#define USBFS_HCDMA6 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_HCCHAR7 register */ +#define USBFS_HCCHAR7_MPS_POS (0U) +#define USBFS_HCCHAR7_MPS (0x000007FFUL) +#define USBFS_HCCHAR7_EPNUM_POS (11U) +#define USBFS_HCCHAR7_EPNUM (0x00007800UL) +#define USBFS_HCCHAR7_EPDIR_POS (15U) +#define USBFS_HCCHAR7_EPDIR (0x00008000UL) +#define USBFS_HCCHAR7_LSPDDEV_POS (17U) +#define USBFS_HCCHAR7_LSPDDEV (0x00020000UL) +#define USBFS_HCCHAR7_EPTYPE_POS (18U) +#define USBFS_HCCHAR7_EPTYPE (0x000C0000UL) +#define USBFS_HCCHAR7_EPTYPE_0 (0x00040000UL) +#define USBFS_HCCHAR7_EPTYPE_1 (0x00080000UL) +#define USBFS_HCCHAR7_EC_POS (20U) +#define USBFS_HCCHAR7_EC (0x00300000UL) +#define USBFS_HCCHAR7_DEVADDR_POS (22U) +#define USBFS_HCCHAR7_DEVADDR (0x1FC00000UL) +#define USBFS_HCCHAR7_ODDFRM_POS (29U) +#define USBFS_HCCHAR7_ODDFRM (0x20000000UL) +#define USBFS_HCCHAR7_CHDIS_POS (30U) +#define USBFS_HCCHAR7_CHDIS (0x40000000UL) +#define USBFS_HCCHAR7_CHENA_POS (31U) +#define USBFS_HCCHAR7_CHENA (0x80000000UL) + +/* Bit definition for USBFS_HCSPLT7 register */ +#define USBFS_HCSPLT7_PRTADDR_POS (0U) +#define USBFS_HCSPLT7_PRTADDR (0x0000007FUL) +#define USBFS_HCSPLT7_HUBADDR_POS (7U) +#define USBFS_HCSPLT7_HUBADDR (0x00003F80UL) +#define USBFS_HCSPLT7_XACTPOS_POS (14U) +#define USBFS_HCSPLT7_XACTPOS (0x0000C000UL) +#define USBFS_HCSPLT7_XACTPOS_0 (0x00004000UL) +#define USBFS_HCSPLT7_XACTPOS_1 (0x00008000UL) +#define USBFS_HCSPLT7_COMPSPLT_POS (16U) +#define USBFS_HCSPLT7_COMPSPLT (0x00010000UL) +#define USBFS_HCSPLT7_SPLTENA_POS (31U) +#define USBFS_HCSPLT7_SPLTENA (0x80000000UL) + +/* Bit definition for USBFS_HCINT7 register */ +#define USBFS_HCINT7_XFERCOMPL_POS (0U) +#define USBFS_HCINT7_XFERCOMPL (0x00000001UL) +#define USBFS_HCINT7_CHHLTD_POS (1U) +#define USBFS_HCINT7_CHHLTD (0x00000002UL) +#define USBFS_HCINT7_AHBERR_POS (2U) +#define USBFS_HCINT7_AHBERR (0x00000004UL) +#define USBFS_HCINT7_STALL_POS (3U) +#define USBFS_HCINT7_STALL (0x00000008UL) +#define USBFS_HCINT7_NAK_POS (4U) +#define USBFS_HCINT7_NAK (0x00000010UL) +#define USBFS_HCINT7_ACK_POS (5U) +#define USBFS_HCINT7_ACK (0x00000020UL) +#define USBFS_HCINT7_NYET_POS (6U) +#define USBFS_HCINT7_NYET (0x00000040UL) +#define USBFS_HCINT7_XACTERR_POS (7U) +#define USBFS_HCINT7_XACTERR (0x00000080UL) +#define USBFS_HCINT7_BBLERR_POS (8U) +#define USBFS_HCINT7_BBLERR (0x00000100UL) +#define USBFS_HCINT7_FRMOVRUN_POS (9U) +#define USBFS_HCINT7_FRMOVRUN (0x00000200UL) +#define USBFS_HCINT7_DATATGLERR_POS (10U) +#define USBFS_HCINT7_DATATGLERR (0x00000400UL) + +/* Bit definition for USBFS_HCINTMSK7 register */ +#define USBFS_HCINTMSK7_XFERCOMPLMSK_POS (0U) +#define USBFS_HCINTMSK7_XFERCOMPLMSK (0x00000001UL) +#define USBFS_HCINTMSK7_CHHLTDMSK_POS (1U) +#define USBFS_HCINTMSK7_CHHLTDMSK (0x00000002UL) +#define USBFS_HCINTMSK7_AHBERRMSK_POS (2U) +#define USBFS_HCINTMSK7_AHBERRMSK (0x00000004UL) +#define USBFS_HCINTMSK7_STALLMSK_POS (3U) +#define USBFS_HCINTMSK7_STALLMSK (0x00000008UL) +#define USBFS_HCINTMSK7_NAKMSK_POS (4U) +#define USBFS_HCINTMSK7_NAKMSK (0x00000010UL) +#define USBFS_HCINTMSK7_ACKMSK_POS (5U) +#define USBFS_HCINTMSK7_ACKMSK (0x00000020UL) +#define USBFS_HCINTMSK7_NYETMSK_POS (6U) +#define USBFS_HCINTMSK7_NYETMSK (0x00000040UL) +#define USBFS_HCINTMSK7_XACTERRMSK_POS (7U) +#define USBFS_HCINTMSK7_XACTERRMSK (0x00000080UL) +#define USBFS_HCINTMSK7_BBLERRMSK_POS (8U) +#define USBFS_HCINTMSK7_BBLERRMSK (0x00000100UL) +#define USBFS_HCINTMSK7_FRMOVRUNMSK_POS (9U) +#define USBFS_HCINTMSK7_FRMOVRUNMSK (0x00000200UL) +#define USBFS_HCINTMSK7_DATATGLERRMSK_POS (10U) +#define USBFS_HCINTMSK7_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBFS_HCTSIZ7 register */ +#define USBFS_HCTSIZ7_XFERSIZE_POS (0U) +#define USBFS_HCTSIZ7_XFERSIZE (0x0007FFFFUL) +#define USBFS_HCTSIZ7_PKTCNT_POS (19U) +#define USBFS_HCTSIZ7_PKTCNT (0x1FF80000UL) +#define USBFS_HCTSIZ7_PID_POS (29U) +#define USBFS_HCTSIZ7_PID (0x60000000UL) +#define USBFS_HCTSIZ7_PID_0 (0x20000000UL) +#define USBFS_HCTSIZ7_PID_1 (0x40000000UL) +#define USBFS_HCTSIZ7_DOPNG_POS (31U) +#define USBFS_HCTSIZ7_DOPNG (0x80000000UL) + +/* Bit definition for USBFS_HCDMA7 register */ +#define USBFS_HCDMA7 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_HCCHAR8 register */ +#define USBFS_HCCHAR8_MPS_POS (0U) +#define USBFS_HCCHAR8_MPS (0x000007FFUL) +#define USBFS_HCCHAR8_EPNUM_POS (11U) +#define USBFS_HCCHAR8_EPNUM (0x00007800UL) +#define USBFS_HCCHAR8_EPDIR_POS (15U) +#define USBFS_HCCHAR8_EPDIR (0x00008000UL) +#define USBFS_HCCHAR8_LSPDDEV_POS (17U) +#define USBFS_HCCHAR8_LSPDDEV (0x00020000UL) +#define USBFS_HCCHAR8_EPTYPE_POS (18U) +#define USBFS_HCCHAR8_EPTYPE (0x000C0000UL) +#define USBFS_HCCHAR8_EPTYPE_0 (0x00040000UL) +#define USBFS_HCCHAR8_EPTYPE_1 (0x00080000UL) +#define USBFS_HCCHAR8_EC_POS (20U) +#define USBFS_HCCHAR8_EC (0x00300000UL) +#define USBFS_HCCHAR8_DEVADDR_POS (22U) +#define USBFS_HCCHAR8_DEVADDR (0x1FC00000UL) +#define USBFS_HCCHAR8_ODDFRM_POS (29U) +#define USBFS_HCCHAR8_ODDFRM (0x20000000UL) +#define USBFS_HCCHAR8_CHDIS_POS (30U) +#define USBFS_HCCHAR8_CHDIS (0x40000000UL) +#define USBFS_HCCHAR8_CHENA_POS (31U) +#define USBFS_HCCHAR8_CHENA (0x80000000UL) + +/* Bit definition for USBFS_HCSPLT8 register */ +#define USBFS_HCSPLT8_PRTADDR_POS (0U) +#define USBFS_HCSPLT8_PRTADDR (0x0000007FUL) +#define USBFS_HCSPLT8_HUBADDR_POS (7U) +#define USBFS_HCSPLT8_HUBADDR (0x00003F80UL) +#define USBFS_HCSPLT8_XACTPOS_POS (14U) +#define USBFS_HCSPLT8_XACTPOS (0x0000C000UL) +#define USBFS_HCSPLT8_XACTPOS_0 (0x00004000UL) +#define USBFS_HCSPLT8_XACTPOS_1 (0x00008000UL) +#define USBFS_HCSPLT8_COMPSPLT_POS (16U) +#define USBFS_HCSPLT8_COMPSPLT (0x00010000UL) +#define USBFS_HCSPLT8_SPLTENA_POS (31U) +#define USBFS_HCSPLT8_SPLTENA (0x80000000UL) + +/* Bit definition for USBFS_HCINT8 register */ +#define USBFS_HCINT8_XFERCOMPL_POS (0U) +#define USBFS_HCINT8_XFERCOMPL (0x00000001UL) +#define USBFS_HCINT8_CHHLTD_POS (1U) +#define USBFS_HCINT8_CHHLTD (0x00000002UL) +#define USBFS_HCINT8_AHBERR_POS (2U) +#define USBFS_HCINT8_AHBERR (0x00000004UL) +#define USBFS_HCINT8_STALL_POS (3U) +#define USBFS_HCINT8_STALL (0x00000008UL) +#define USBFS_HCINT8_NAK_POS (4U) +#define USBFS_HCINT8_NAK (0x00000010UL) +#define USBFS_HCINT8_ACK_POS (5U) +#define USBFS_HCINT8_ACK (0x00000020UL) +#define USBFS_HCINT8_NYET_POS (6U) +#define USBFS_HCINT8_NYET (0x00000040UL) +#define USBFS_HCINT8_XACTERR_POS (7U) +#define USBFS_HCINT8_XACTERR (0x00000080UL) +#define USBFS_HCINT8_BBLERR_POS (8U) +#define USBFS_HCINT8_BBLERR (0x00000100UL) +#define USBFS_HCINT8_FRMOVRUN_POS (9U) +#define USBFS_HCINT8_FRMOVRUN (0x00000200UL) +#define USBFS_HCINT8_DATATGLERR_POS (10U) +#define USBFS_HCINT8_DATATGLERR (0x00000400UL) + +/* Bit definition for USBFS_HCINTMSK8 register */ +#define USBFS_HCINTMSK8_XFERCOMPLMSK_POS (0U) +#define USBFS_HCINTMSK8_XFERCOMPLMSK (0x00000001UL) +#define USBFS_HCINTMSK8_CHHLTDMSK_POS (1U) +#define USBFS_HCINTMSK8_CHHLTDMSK (0x00000002UL) +#define USBFS_HCINTMSK8_AHBERRMSK_POS (2U) +#define USBFS_HCINTMSK8_AHBERRMSK (0x00000004UL) +#define USBFS_HCINTMSK8_STALLMSK_POS (3U) +#define USBFS_HCINTMSK8_STALLMSK (0x00000008UL) +#define USBFS_HCINTMSK8_NAKMSK_POS (4U) +#define USBFS_HCINTMSK8_NAKMSK (0x00000010UL) +#define USBFS_HCINTMSK8_ACKMSK_POS (5U) +#define USBFS_HCINTMSK8_ACKMSK (0x00000020UL) +#define USBFS_HCINTMSK8_NYETMSK_POS (6U) +#define USBFS_HCINTMSK8_NYETMSK (0x00000040UL) +#define USBFS_HCINTMSK8_XACTERRMSK_POS (7U) +#define USBFS_HCINTMSK8_XACTERRMSK (0x00000080UL) +#define USBFS_HCINTMSK8_BBLERRMSK_POS (8U) +#define USBFS_HCINTMSK8_BBLERRMSK (0x00000100UL) +#define USBFS_HCINTMSK8_FRMOVRUNMSK_POS (9U) +#define USBFS_HCINTMSK8_FRMOVRUNMSK (0x00000200UL) +#define USBFS_HCINTMSK8_DATATGLERRMSK_POS (10U) +#define USBFS_HCINTMSK8_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBFS_HCTSIZ8 register */ +#define USBFS_HCTSIZ8_XFERSIZE_POS (0U) +#define USBFS_HCTSIZ8_XFERSIZE (0x0007FFFFUL) +#define USBFS_HCTSIZ8_PKTCNT_POS (19U) +#define USBFS_HCTSIZ8_PKTCNT (0x1FF80000UL) +#define USBFS_HCTSIZ8_PID_POS (29U) +#define USBFS_HCTSIZ8_PID (0x60000000UL) +#define USBFS_HCTSIZ8_PID_0 (0x20000000UL) +#define USBFS_HCTSIZ8_PID_1 (0x40000000UL) +#define USBFS_HCTSIZ8_DOPNG_POS (31U) +#define USBFS_HCTSIZ8_DOPNG (0x80000000UL) + +/* Bit definition for USBFS_HCDMA8 register */ +#define USBFS_HCDMA8 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_HCCHAR9 register */ +#define USBFS_HCCHAR9_MPS_POS (0U) +#define USBFS_HCCHAR9_MPS (0x000007FFUL) +#define USBFS_HCCHAR9_EPNUM_POS (11U) +#define USBFS_HCCHAR9_EPNUM (0x00007800UL) +#define USBFS_HCCHAR9_EPDIR_POS (15U) +#define USBFS_HCCHAR9_EPDIR (0x00008000UL) +#define USBFS_HCCHAR9_LSPDDEV_POS (17U) +#define USBFS_HCCHAR9_LSPDDEV (0x00020000UL) +#define USBFS_HCCHAR9_EPTYPE_POS (18U) +#define USBFS_HCCHAR9_EPTYPE (0x000C0000UL) +#define USBFS_HCCHAR9_EPTYPE_0 (0x00040000UL) +#define USBFS_HCCHAR9_EPTYPE_1 (0x00080000UL) +#define USBFS_HCCHAR9_EC_POS (20U) +#define USBFS_HCCHAR9_EC (0x00300000UL) +#define USBFS_HCCHAR9_DEVADDR_POS (22U) +#define USBFS_HCCHAR9_DEVADDR (0x1FC00000UL) +#define USBFS_HCCHAR9_ODDFRM_POS (29U) +#define USBFS_HCCHAR9_ODDFRM (0x20000000UL) +#define USBFS_HCCHAR9_CHDIS_POS (30U) +#define USBFS_HCCHAR9_CHDIS (0x40000000UL) +#define USBFS_HCCHAR9_CHENA_POS (31U) +#define USBFS_HCCHAR9_CHENA (0x80000000UL) + +/* Bit definition for USBFS_HCSPLT9 register */ +#define USBFS_HCSPLT9_PRTADDR_POS (0U) +#define USBFS_HCSPLT9_PRTADDR (0x0000007FUL) +#define USBFS_HCSPLT9_HUBADDR_POS (7U) +#define USBFS_HCSPLT9_HUBADDR (0x00003F80UL) +#define USBFS_HCSPLT9_XACTPOS_POS (14U) +#define USBFS_HCSPLT9_XACTPOS (0x0000C000UL) +#define USBFS_HCSPLT9_XACTPOS_0 (0x00004000UL) +#define USBFS_HCSPLT9_XACTPOS_1 (0x00008000UL) +#define USBFS_HCSPLT9_COMPSPLT_POS (16U) +#define USBFS_HCSPLT9_COMPSPLT (0x00010000UL) +#define USBFS_HCSPLT9_SPLTENA_POS (31U) +#define USBFS_HCSPLT9_SPLTENA (0x80000000UL) + +/* Bit definition for USBFS_HCINT9 register */ +#define USBFS_HCINT9_XFERCOMPL_POS (0U) +#define USBFS_HCINT9_XFERCOMPL (0x00000001UL) +#define USBFS_HCINT9_CHHLTD_POS (1U) +#define USBFS_HCINT9_CHHLTD (0x00000002UL) +#define USBFS_HCINT9_AHBERR_POS (2U) +#define USBFS_HCINT9_AHBERR (0x00000004UL) +#define USBFS_HCINT9_STALL_POS (3U) +#define USBFS_HCINT9_STALL (0x00000008UL) +#define USBFS_HCINT9_NAK_POS (4U) +#define USBFS_HCINT9_NAK (0x00000010UL) +#define USBFS_HCINT9_ACK_POS (5U) +#define USBFS_HCINT9_ACK (0x00000020UL) +#define USBFS_HCINT9_NYET_POS (6U) +#define USBFS_HCINT9_NYET (0x00000040UL) +#define USBFS_HCINT9_XACTERR_POS (7U) +#define USBFS_HCINT9_XACTERR (0x00000080UL) +#define USBFS_HCINT9_BBLERR_POS (8U) +#define USBFS_HCINT9_BBLERR (0x00000100UL) +#define USBFS_HCINT9_FRMOVRUN_POS (9U) +#define USBFS_HCINT9_FRMOVRUN (0x00000200UL) +#define USBFS_HCINT9_DATATGLERR_POS (10U) +#define USBFS_HCINT9_DATATGLERR (0x00000400UL) + +/* Bit definition for USBFS_HCINTMSK9 register */ +#define USBFS_HCINTMSK9_XFERCOMPLMSK_POS (0U) +#define USBFS_HCINTMSK9_XFERCOMPLMSK (0x00000001UL) +#define USBFS_HCINTMSK9_CHHLTDMSK_POS (1U) +#define USBFS_HCINTMSK9_CHHLTDMSK (0x00000002UL) +#define USBFS_HCINTMSK9_AHBERRMSK_POS (2U) +#define USBFS_HCINTMSK9_AHBERRMSK (0x00000004UL) +#define USBFS_HCINTMSK9_STALLMSK_POS (3U) +#define USBFS_HCINTMSK9_STALLMSK (0x00000008UL) +#define USBFS_HCINTMSK9_NAKMSK_POS (4U) +#define USBFS_HCINTMSK9_NAKMSK (0x00000010UL) +#define USBFS_HCINTMSK9_ACKMSK_POS (5U) +#define USBFS_HCINTMSK9_ACKMSK (0x00000020UL) +#define USBFS_HCINTMSK9_NYETMSK_POS (6U) +#define USBFS_HCINTMSK9_NYETMSK (0x00000040UL) +#define USBFS_HCINTMSK9_XACTERRMSK_POS (7U) +#define USBFS_HCINTMSK9_XACTERRMSK (0x00000080UL) +#define USBFS_HCINTMSK9_BBLERRMSK_POS (8U) +#define USBFS_HCINTMSK9_BBLERRMSK (0x00000100UL) +#define USBFS_HCINTMSK9_FRMOVRUNMSK_POS (9U) +#define USBFS_HCINTMSK9_FRMOVRUNMSK (0x00000200UL) +#define USBFS_HCINTMSK9_DATATGLERRMSK_POS (10U) +#define USBFS_HCINTMSK9_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBFS_HCTSIZ9 register */ +#define USBFS_HCTSIZ9_XFERSIZE_POS (0U) +#define USBFS_HCTSIZ9_XFERSIZE (0x0007FFFFUL) +#define USBFS_HCTSIZ9_PKTCNT_POS (19U) +#define USBFS_HCTSIZ9_PKTCNT (0x1FF80000UL) +#define USBFS_HCTSIZ9_PID_POS (29U) +#define USBFS_HCTSIZ9_PID (0x60000000UL) +#define USBFS_HCTSIZ9_PID_0 (0x20000000UL) +#define USBFS_HCTSIZ9_PID_1 (0x40000000UL) +#define USBFS_HCTSIZ9_DOPNG_POS (31U) +#define USBFS_HCTSIZ9_DOPNG (0x80000000UL) + +/* Bit definition for USBFS_HCDMA9 register */ +#define USBFS_HCDMA9 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_HCCHAR10 register */ +#define USBFS_HCCHAR10_MPS_POS (0U) +#define USBFS_HCCHAR10_MPS (0x000007FFUL) +#define USBFS_HCCHAR10_EPNUM_POS (11U) +#define USBFS_HCCHAR10_EPNUM (0x00007800UL) +#define USBFS_HCCHAR10_EPDIR_POS (15U) +#define USBFS_HCCHAR10_EPDIR (0x00008000UL) +#define USBFS_HCCHAR10_LSPDDEV_POS (17U) +#define USBFS_HCCHAR10_LSPDDEV (0x00020000UL) +#define USBFS_HCCHAR10_EPTYPE_POS (18U) +#define USBFS_HCCHAR10_EPTYPE (0x000C0000UL) +#define USBFS_HCCHAR10_EPTYPE_0 (0x00040000UL) +#define USBFS_HCCHAR10_EPTYPE_1 (0x00080000UL) +#define USBFS_HCCHAR10_EC_POS (20U) +#define USBFS_HCCHAR10_EC (0x00300000UL) +#define USBFS_HCCHAR10_DEVADDR_POS (22U) +#define USBFS_HCCHAR10_DEVADDR (0x1FC00000UL) +#define USBFS_HCCHAR10_ODDFRM_POS (29U) +#define USBFS_HCCHAR10_ODDFRM (0x20000000UL) +#define USBFS_HCCHAR10_CHDIS_POS (30U) +#define USBFS_HCCHAR10_CHDIS (0x40000000UL) +#define USBFS_HCCHAR10_CHENA_POS (31U) +#define USBFS_HCCHAR10_CHENA (0x80000000UL) + +/* Bit definition for USBFS_HCSPLT10 register */ +#define USBFS_HCSPLT10_PRTADDR_POS (0U) +#define USBFS_HCSPLT10_PRTADDR (0x0000007FUL) +#define USBFS_HCSPLT10_HUBADDR_POS (7U) +#define USBFS_HCSPLT10_HUBADDR (0x00003F80UL) +#define USBFS_HCSPLT10_XACTPOS_POS (14U) +#define USBFS_HCSPLT10_XACTPOS (0x0000C000UL) +#define USBFS_HCSPLT10_XACTPOS_0 (0x00004000UL) +#define USBFS_HCSPLT10_XACTPOS_1 (0x00008000UL) +#define USBFS_HCSPLT10_COMPSPLT_POS (16U) +#define USBFS_HCSPLT10_COMPSPLT (0x00010000UL) +#define USBFS_HCSPLT10_SPLTENA_POS (31U) +#define USBFS_HCSPLT10_SPLTENA (0x80000000UL) + +/* Bit definition for USBFS_HCINT10 register */ +#define USBFS_HCINT10_XFERCOMPL_POS (0U) +#define USBFS_HCINT10_XFERCOMPL (0x00000001UL) +#define USBFS_HCINT10_CHHLTD_POS (1U) +#define USBFS_HCINT10_CHHLTD (0x00000002UL) +#define USBFS_HCINT10_AHBERR_POS (2U) +#define USBFS_HCINT10_AHBERR (0x00000004UL) +#define USBFS_HCINT10_STALL_POS (3U) +#define USBFS_HCINT10_STALL (0x00000008UL) +#define USBFS_HCINT10_NAK_POS (4U) +#define USBFS_HCINT10_NAK (0x00000010UL) +#define USBFS_HCINT10_ACK_POS (5U) +#define USBFS_HCINT10_ACK (0x00000020UL) +#define USBFS_HCINT10_NYET_POS (6U) +#define USBFS_HCINT10_NYET (0x00000040UL) +#define USBFS_HCINT10_XACTERR_POS (7U) +#define USBFS_HCINT10_XACTERR (0x00000080UL) +#define USBFS_HCINT10_BBLERR_POS (8U) +#define USBFS_HCINT10_BBLERR (0x00000100UL) +#define USBFS_HCINT10_FRMOVRUN_POS (9U) +#define USBFS_HCINT10_FRMOVRUN (0x00000200UL) +#define USBFS_HCINT10_DATATGLERR_POS (10U) +#define USBFS_HCINT10_DATATGLERR (0x00000400UL) + +/* Bit definition for USBFS_HCINTMSK10 register */ +#define USBFS_HCINTMSK10_XFERCOMPLMSK_POS (0U) +#define USBFS_HCINTMSK10_XFERCOMPLMSK (0x00000001UL) +#define USBFS_HCINTMSK10_CHHLTDMSK_POS (1U) +#define USBFS_HCINTMSK10_CHHLTDMSK (0x00000002UL) +#define USBFS_HCINTMSK10_AHBERRMSK_POS (2U) +#define USBFS_HCINTMSK10_AHBERRMSK (0x00000004UL) +#define USBFS_HCINTMSK10_STALLMSK_POS (3U) +#define USBFS_HCINTMSK10_STALLMSK (0x00000008UL) +#define USBFS_HCINTMSK10_NAKMSK_POS (4U) +#define USBFS_HCINTMSK10_NAKMSK (0x00000010UL) +#define USBFS_HCINTMSK10_ACKMSK_POS (5U) +#define USBFS_HCINTMSK10_ACKMSK (0x00000020UL) +#define USBFS_HCINTMSK10_NYETMSK_POS (6U) +#define USBFS_HCINTMSK10_NYETMSK (0x00000040UL) +#define USBFS_HCINTMSK10_XACTERRMSK_POS (7U) +#define USBFS_HCINTMSK10_XACTERRMSK (0x00000080UL) +#define USBFS_HCINTMSK10_BBLERRMSK_POS (8U) +#define USBFS_HCINTMSK10_BBLERRMSK (0x00000100UL) +#define USBFS_HCINTMSK10_FRMOVRUNMSK_POS (9U) +#define USBFS_HCINTMSK10_FRMOVRUNMSK (0x00000200UL) +#define USBFS_HCINTMSK10_DATATGLERRMSK_POS (10U) +#define USBFS_HCINTMSK10_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBFS_HCTSIZ10 register */ +#define USBFS_HCTSIZ10_XFERSIZE_POS (0U) +#define USBFS_HCTSIZ10_XFERSIZE (0x0007FFFFUL) +#define USBFS_HCTSIZ10_PKTCNT_POS (19U) +#define USBFS_HCTSIZ10_PKTCNT (0x1FF80000UL) +#define USBFS_HCTSIZ10_PID_POS (29U) +#define USBFS_HCTSIZ10_PID (0x60000000UL) +#define USBFS_HCTSIZ10_PID_0 (0x20000000UL) +#define USBFS_HCTSIZ10_PID_1 (0x40000000UL) +#define USBFS_HCTSIZ10_DOPNG_POS (31U) +#define USBFS_HCTSIZ10_DOPNG (0x80000000UL) + +/* Bit definition for USBFS_HCDMA10 register */ +#define USBFS_HCDMA10 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_HCCHAR11 register */ +#define USBFS_HCCHAR11_MPS_POS (0U) +#define USBFS_HCCHAR11_MPS (0x000007FFUL) +#define USBFS_HCCHAR11_EPNUM_POS (11U) +#define USBFS_HCCHAR11_EPNUM (0x00007800UL) +#define USBFS_HCCHAR11_EPDIR_POS (15U) +#define USBFS_HCCHAR11_EPDIR (0x00008000UL) +#define USBFS_HCCHAR11_LSPDDEV_POS (17U) +#define USBFS_HCCHAR11_LSPDDEV (0x00020000UL) +#define USBFS_HCCHAR11_EPTYPE_POS (18U) +#define USBFS_HCCHAR11_EPTYPE (0x000C0000UL) +#define USBFS_HCCHAR11_EPTYPE_0 (0x00040000UL) +#define USBFS_HCCHAR11_EPTYPE_1 (0x00080000UL) +#define USBFS_HCCHAR11_EC_POS (20U) +#define USBFS_HCCHAR11_EC (0x00300000UL) +#define USBFS_HCCHAR11_DEVADDR_POS (22U) +#define USBFS_HCCHAR11_DEVADDR (0x1FC00000UL) +#define USBFS_HCCHAR11_ODDFRM_POS (29U) +#define USBFS_HCCHAR11_ODDFRM (0x20000000UL) +#define USBFS_HCCHAR11_CHDIS_POS (30U) +#define USBFS_HCCHAR11_CHDIS (0x40000000UL) +#define USBFS_HCCHAR11_CHENA_POS (31U) +#define USBFS_HCCHAR11_CHENA (0x80000000UL) + +/* Bit definition for USBFS_HCSPLT11 register */ +#define USBFS_HCSPLT11_PRTADDR_POS (0U) +#define USBFS_HCSPLT11_PRTADDR (0x0000007FUL) +#define USBFS_HCSPLT11_HUBADDR_POS (7U) +#define USBFS_HCSPLT11_HUBADDR (0x00003F80UL) +#define USBFS_HCSPLT11_XACTPOS_POS (14U) +#define USBFS_HCSPLT11_XACTPOS (0x0000C000UL) +#define USBFS_HCSPLT11_XACTPOS_0 (0x00004000UL) +#define USBFS_HCSPLT11_XACTPOS_1 (0x00008000UL) +#define USBFS_HCSPLT11_COMPSPLT_POS (16U) +#define USBFS_HCSPLT11_COMPSPLT (0x00010000UL) +#define USBFS_HCSPLT11_SPLTENA_POS (31U) +#define USBFS_HCSPLT11_SPLTENA (0x80000000UL) + +/* Bit definition for USBFS_HCINT11 register */ +#define USBFS_HCINT11_XFERCOMPL_POS (0U) +#define USBFS_HCINT11_XFERCOMPL (0x00000001UL) +#define USBFS_HCINT11_CHHLTD_POS (1U) +#define USBFS_HCINT11_CHHLTD (0x00000002UL) +#define USBFS_HCINT11_AHBERR_POS (2U) +#define USBFS_HCINT11_AHBERR (0x00000004UL) +#define USBFS_HCINT11_STALL_POS (3U) +#define USBFS_HCINT11_STALL (0x00000008UL) +#define USBFS_HCINT11_NAK_POS (4U) +#define USBFS_HCINT11_NAK (0x00000010UL) +#define USBFS_HCINT11_ACK_POS (5U) +#define USBFS_HCINT11_ACK (0x00000020UL) +#define USBFS_HCINT11_NYET_POS (6U) +#define USBFS_HCINT11_NYET (0x00000040UL) +#define USBFS_HCINT11_XACTERR_POS (7U) +#define USBFS_HCINT11_XACTERR (0x00000080UL) +#define USBFS_HCINT11_BBLERR_POS (8U) +#define USBFS_HCINT11_BBLERR (0x00000100UL) +#define USBFS_HCINT11_FRMOVRUN_POS (9U) +#define USBFS_HCINT11_FRMOVRUN (0x00000200UL) +#define USBFS_HCINT11_DATATGLERR_POS (10U) +#define USBFS_HCINT11_DATATGLERR (0x00000400UL) + +/* Bit definition for USBFS_HCINTMSK11 register */ +#define USBFS_HCINTMSK11_XFERCOMPLMSK_POS (0U) +#define USBFS_HCINTMSK11_XFERCOMPLMSK (0x00000001UL) +#define USBFS_HCINTMSK11_CHHLTDMSK_POS (1U) +#define USBFS_HCINTMSK11_CHHLTDMSK (0x00000002UL) +#define USBFS_HCINTMSK11_AHBERRMSK_POS (2U) +#define USBFS_HCINTMSK11_AHBERRMSK (0x00000004UL) +#define USBFS_HCINTMSK11_STALLMSK_POS (3U) +#define USBFS_HCINTMSK11_STALLMSK (0x00000008UL) +#define USBFS_HCINTMSK11_NAKMSK_POS (4U) +#define USBFS_HCINTMSK11_NAKMSK (0x00000010UL) +#define USBFS_HCINTMSK11_ACKMSK_POS (5U) +#define USBFS_HCINTMSK11_ACKMSK (0x00000020UL) +#define USBFS_HCINTMSK11_NYETMSK_POS (6U) +#define USBFS_HCINTMSK11_NYETMSK (0x00000040UL) +#define USBFS_HCINTMSK11_XACTERRMSK_POS (7U) +#define USBFS_HCINTMSK11_XACTERRMSK (0x00000080UL) +#define USBFS_HCINTMSK11_BBLERRMSK_POS (8U) +#define USBFS_HCINTMSK11_BBLERRMSK (0x00000100UL) +#define USBFS_HCINTMSK11_FRMOVRUNMSK_POS (9U) +#define USBFS_HCINTMSK11_FRMOVRUNMSK (0x00000200UL) +#define USBFS_HCINTMSK11_DATATGLERRMSK_POS (10U) +#define USBFS_HCINTMSK11_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBFS_HCTSIZ11 register */ +#define USBFS_HCTSIZ11_XFERSIZE_POS (0U) +#define USBFS_HCTSIZ11_XFERSIZE (0x0007FFFFUL) +#define USBFS_HCTSIZ11_PKTCNT_POS (19U) +#define USBFS_HCTSIZ11_PKTCNT (0x1FF80000UL) +#define USBFS_HCTSIZ11_PID_POS (29U) +#define USBFS_HCTSIZ11_PID (0x60000000UL) +#define USBFS_HCTSIZ11_PID_0 (0x20000000UL) +#define USBFS_HCTSIZ11_PID_1 (0x40000000UL) +#define USBFS_HCTSIZ11_DOPNG_POS (31U) +#define USBFS_HCTSIZ11_DOPNG (0x80000000UL) + +/* Bit definition for USBFS_HCDMA11 register */ +#define USBFS_HCDMA11 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_HCCHAR12 register */ +#define USBFS_HCCHAR12_MPS_POS (0U) +#define USBFS_HCCHAR12_MPS (0x000007FFUL) +#define USBFS_HCCHAR12_EPNUM_POS (11U) +#define USBFS_HCCHAR12_EPNUM (0x00007800UL) +#define USBFS_HCCHAR12_EPDIR_POS (15U) +#define USBFS_HCCHAR12_EPDIR (0x00008000UL) +#define USBFS_HCCHAR12_LSPDDEV_POS (17U) +#define USBFS_HCCHAR12_LSPDDEV (0x00020000UL) +#define USBFS_HCCHAR12_EPTYPE_POS (18U) +#define USBFS_HCCHAR12_EPTYPE (0x000C0000UL) +#define USBFS_HCCHAR12_EPTYPE_0 (0x00040000UL) +#define USBFS_HCCHAR12_EPTYPE_1 (0x00080000UL) +#define USBFS_HCCHAR12_EC_POS (20U) +#define USBFS_HCCHAR12_EC (0x00300000UL) +#define USBFS_HCCHAR12_DEVADDR_POS (22U) +#define USBFS_HCCHAR12_DEVADDR (0x1FC00000UL) +#define USBFS_HCCHAR12_ODDFRM_POS (29U) +#define USBFS_HCCHAR12_ODDFRM (0x20000000UL) +#define USBFS_HCCHAR12_CHDIS_POS (30U) +#define USBFS_HCCHAR12_CHDIS (0x40000000UL) +#define USBFS_HCCHAR12_CHENA_POS (31U) +#define USBFS_HCCHAR12_CHENA (0x80000000UL) + +/* Bit definition for USBFS_HCSPLT12 register */ +#define USBFS_HCSPLT12_PRTADDR_POS (0U) +#define USBFS_HCSPLT12_PRTADDR (0x0000007FUL) +#define USBFS_HCSPLT12_HUBADDR_POS (7U) +#define USBFS_HCSPLT12_HUBADDR (0x00003F80UL) +#define USBFS_HCSPLT12_XACTPOS_POS (14U) +#define USBFS_HCSPLT12_XACTPOS (0x0000C000UL) +#define USBFS_HCSPLT12_XACTPOS_0 (0x00004000UL) +#define USBFS_HCSPLT12_XACTPOS_1 (0x00008000UL) +#define USBFS_HCSPLT12_COMPSPLT_POS (16U) +#define USBFS_HCSPLT12_COMPSPLT (0x00010000UL) +#define USBFS_HCSPLT12_SPLTENA_POS (31U) +#define USBFS_HCSPLT12_SPLTENA (0x80000000UL) + +/* Bit definition for USBFS_HCINT12 register */ +#define USBFS_HCINT12_XFERCOMPL_POS (0U) +#define USBFS_HCINT12_XFERCOMPL (0x00000001UL) +#define USBFS_HCINT12_CHHLTD_POS (1U) +#define USBFS_HCINT12_CHHLTD (0x00000002UL) +#define USBFS_HCINT12_AHBERR_POS (2U) +#define USBFS_HCINT12_AHBERR (0x00000004UL) +#define USBFS_HCINT12_STALL_POS (3U) +#define USBFS_HCINT12_STALL (0x00000008UL) +#define USBFS_HCINT12_NAK_POS (4U) +#define USBFS_HCINT12_NAK (0x00000010UL) +#define USBFS_HCINT12_ACK_POS (5U) +#define USBFS_HCINT12_ACK (0x00000020UL) +#define USBFS_HCINT12_NYET_POS (6U) +#define USBFS_HCINT12_NYET (0x00000040UL) +#define USBFS_HCINT12_XACTERR_POS (7U) +#define USBFS_HCINT12_XACTERR (0x00000080UL) +#define USBFS_HCINT12_BBLERR_POS (8U) +#define USBFS_HCINT12_BBLERR (0x00000100UL) +#define USBFS_HCINT12_FRMOVRUN_POS (9U) +#define USBFS_HCINT12_FRMOVRUN (0x00000200UL) +#define USBFS_HCINT12_DATATGLERR_POS (10U) +#define USBFS_HCINT12_DATATGLERR (0x00000400UL) + +/* Bit definition for USBFS_HCINTMSK12 register */ +#define USBFS_HCINTMSK12_XFERCOMPLMSK_POS (0U) +#define USBFS_HCINTMSK12_XFERCOMPLMSK (0x00000001UL) +#define USBFS_HCINTMSK12_CHHLTDMSK_POS (1U) +#define USBFS_HCINTMSK12_CHHLTDMSK (0x00000002UL) +#define USBFS_HCINTMSK12_AHBERRMSK_POS (2U) +#define USBFS_HCINTMSK12_AHBERRMSK (0x00000004UL) +#define USBFS_HCINTMSK12_STALLMSK_POS (3U) +#define USBFS_HCINTMSK12_STALLMSK (0x00000008UL) +#define USBFS_HCINTMSK12_NAKMSK_POS (4U) +#define USBFS_HCINTMSK12_NAKMSK (0x00000010UL) +#define USBFS_HCINTMSK12_ACKMSK_POS (5U) +#define USBFS_HCINTMSK12_ACKMSK (0x00000020UL) +#define USBFS_HCINTMSK12_NYETMSK_POS (6U) +#define USBFS_HCINTMSK12_NYETMSK (0x00000040UL) +#define USBFS_HCINTMSK12_XACTERRMSK_POS (7U) +#define USBFS_HCINTMSK12_XACTERRMSK (0x00000080UL) +#define USBFS_HCINTMSK12_BBLERRMSK_POS (8U) +#define USBFS_HCINTMSK12_BBLERRMSK (0x00000100UL) +#define USBFS_HCINTMSK12_FRMOVRUNMSK_POS (9U) +#define USBFS_HCINTMSK12_FRMOVRUNMSK (0x00000200UL) +#define USBFS_HCINTMSK12_DATATGLERRMSK_POS (10U) +#define USBFS_HCINTMSK12_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBFS_HCTSIZ12 register */ +#define USBFS_HCTSIZ12_XFERSIZE_POS (0U) +#define USBFS_HCTSIZ12_XFERSIZE (0x0007FFFFUL) +#define USBFS_HCTSIZ12_PKTCNT_POS (19U) +#define USBFS_HCTSIZ12_PKTCNT (0x1FF80000UL) +#define USBFS_HCTSIZ12_PID_POS (29U) +#define USBFS_HCTSIZ12_PID (0x60000000UL) +#define USBFS_HCTSIZ12_PID_0 (0x20000000UL) +#define USBFS_HCTSIZ12_PID_1 (0x40000000UL) +#define USBFS_HCTSIZ12_DOPNG_POS (31U) +#define USBFS_HCTSIZ12_DOPNG (0x80000000UL) + +/* Bit definition for USBFS_HCDMA12 register */ +#define USBFS_HCDMA12 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_HCCHAR13 register */ +#define USBFS_HCCHAR13_MPS_POS (0U) +#define USBFS_HCCHAR13_MPS (0x000007FFUL) +#define USBFS_HCCHAR13_EPNUM_POS (11U) +#define USBFS_HCCHAR13_EPNUM (0x00007800UL) +#define USBFS_HCCHAR13_EPDIR_POS (15U) +#define USBFS_HCCHAR13_EPDIR (0x00008000UL) +#define USBFS_HCCHAR13_LSPDDEV_POS (17U) +#define USBFS_HCCHAR13_LSPDDEV (0x00020000UL) +#define USBFS_HCCHAR13_EPTYPE_POS (18U) +#define USBFS_HCCHAR13_EPTYPE (0x000C0000UL) +#define USBFS_HCCHAR13_EPTYPE_0 (0x00040000UL) +#define USBFS_HCCHAR13_EPTYPE_1 (0x00080000UL) +#define USBFS_HCCHAR13_EC_POS (20U) +#define USBFS_HCCHAR13_EC (0x00300000UL) +#define USBFS_HCCHAR13_DEVADDR_POS (22U) +#define USBFS_HCCHAR13_DEVADDR (0x1FC00000UL) +#define USBFS_HCCHAR13_ODDFRM_POS (29U) +#define USBFS_HCCHAR13_ODDFRM (0x20000000UL) +#define USBFS_HCCHAR13_CHDIS_POS (30U) +#define USBFS_HCCHAR13_CHDIS (0x40000000UL) +#define USBFS_HCCHAR13_CHENA_POS (31U) +#define USBFS_HCCHAR13_CHENA (0x80000000UL) + +/* Bit definition for USBFS_HCSPLT13 register */ +#define USBFS_HCSPLT13_PRTADDR_POS (0U) +#define USBFS_HCSPLT13_PRTADDR (0x0000007FUL) +#define USBFS_HCSPLT13_HUBADDR_POS (7U) +#define USBFS_HCSPLT13_HUBADDR (0x00003F80UL) +#define USBFS_HCSPLT13_XACTPOS_POS (14U) +#define USBFS_HCSPLT13_XACTPOS (0x0000C000UL) +#define USBFS_HCSPLT13_XACTPOS_0 (0x00004000UL) +#define USBFS_HCSPLT13_XACTPOS_1 (0x00008000UL) +#define USBFS_HCSPLT13_COMPSPLT_POS (16U) +#define USBFS_HCSPLT13_COMPSPLT (0x00010000UL) +#define USBFS_HCSPLT13_SPLTENA_POS (31U) +#define USBFS_HCSPLT13_SPLTENA (0x80000000UL) + +/* Bit definition for USBFS_HCINT13 register */ +#define USBFS_HCINT13_XFERCOMPL_POS (0U) +#define USBFS_HCINT13_XFERCOMPL (0x00000001UL) +#define USBFS_HCINT13_CHHLTD_POS (1U) +#define USBFS_HCINT13_CHHLTD (0x00000002UL) +#define USBFS_HCINT13_AHBERR_POS (2U) +#define USBFS_HCINT13_AHBERR (0x00000004UL) +#define USBFS_HCINT13_STALL_POS (3U) +#define USBFS_HCINT13_STALL (0x00000008UL) +#define USBFS_HCINT13_NAK_POS (4U) +#define USBFS_HCINT13_NAK (0x00000010UL) +#define USBFS_HCINT13_ACK_POS (5U) +#define USBFS_HCINT13_ACK (0x00000020UL) +#define USBFS_HCINT13_NYET_POS (6U) +#define USBFS_HCINT13_NYET (0x00000040UL) +#define USBFS_HCINT13_XACTERR_POS (7U) +#define USBFS_HCINT13_XACTERR (0x00000080UL) +#define USBFS_HCINT13_BBLERR_POS (8U) +#define USBFS_HCINT13_BBLERR (0x00000100UL) +#define USBFS_HCINT13_FRMOVRUN_POS (9U) +#define USBFS_HCINT13_FRMOVRUN (0x00000200UL) +#define USBFS_HCINT13_DATATGLERR_POS (10U) +#define USBFS_HCINT13_DATATGLERR (0x00000400UL) + +/* Bit definition for USBFS_HCINTMSK13 register */ +#define USBFS_HCINTMSK13_XFERCOMPLMSK_POS (0U) +#define USBFS_HCINTMSK13_XFERCOMPLMSK (0x00000001UL) +#define USBFS_HCINTMSK13_CHHLTDMSK_POS (1U) +#define USBFS_HCINTMSK13_CHHLTDMSK (0x00000002UL) +#define USBFS_HCINTMSK13_AHBERRMSK_POS (2U) +#define USBFS_HCINTMSK13_AHBERRMSK (0x00000004UL) +#define USBFS_HCINTMSK13_STALLMSK_POS (3U) +#define USBFS_HCINTMSK13_STALLMSK (0x00000008UL) +#define USBFS_HCINTMSK13_NAKMSK_POS (4U) +#define USBFS_HCINTMSK13_NAKMSK (0x00000010UL) +#define USBFS_HCINTMSK13_ACKMSK_POS (5U) +#define USBFS_HCINTMSK13_ACKMSK (0x00000020UL) +#define USBFS_HCINTMSK13_NYETMSK_POS (6U) +#define USBFS_HCINTMSK13_NYETMSK (0x00000040UL) +#define USBFS_HCINTMSK13_XACTERRMSK_POS (7U) +#define USBFS_HCINTMSK13_XACTERRMSK (0x00000080UL) +#define USBFS_HCINTMSK13_BBLERRMSK_POS (8U) +#define USBFS_HCINTMSK13_BBLERRMSK (0x00000100UL) +#define USBFS_HCINTMSK13_FRMOVRUNMSK_POS (9U) +#define USBFS_HCINTMSK13_FRMOVRUNMSK (0x00000200UL) +#define USBFS_HCINTMSK13_DATATGLERRMSK_POS (10U) +#define USBFS_HCINTMSK13_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBFS_HCTSIZ13 register */ +#define USBFS_HCTSIZ13_XFERSIZE_POS (0U) +#define USBFS_HCTSIZ13_XFERSIZE (0x0007FFFFUL) +#define USBFS_HCTSIZ13_PKTCNT_POS (19U) +#define USBFS_HCTSIZ13_PKTCNT (0x1FF80000UL) +#define USBFS_HCTSIZ13_PID_POS (29U) +#define USBFS_HCTSIZ13_PID (0x60000000UL) +#define USBFS_HCTSIZ13_PID_0 (0x20000000UL) +#define USBFS_HCTSIZ13_PID_1 (0x40000000UL) +#define USBFS_HCTSIZ13_DOPNG_POS (31U) +#define USBFS_HCTSIZ13_DOPNG (0x80000000UL) + +/* Bit definition for USBFS_HCDMA13 register */ +#define USBFS_HCDMA13 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_HCCHAR14 register */ +#define USBFS_HCCHAR14_MPS_POS (0U) +#define USBFS_HCCHAR14_MPS (0x000007FFUL) +#define USBFS_HCCHAR14_EPNUM_POS (11U) +#define USBFS_HCCHAR14_EPNUM (0x00007800UL) +#define USBFS_HCCHAR14_EPDIR_POS (15U) +#define USBFS_HCCHAR14_EPDIR (0x00008000UL) +#define USBFS_HCCHAR14_LSPDDEV_POS (17U) +#define USBFS_HCCHAR14_LSPDDEV (0x00020000UL) +#define USBFS_HCCHAR14_EPTYPE_POS (18U) +#define USBFS_HCCHAR14_EPTYPE (0x000C0000UL) +#define USBFS_HCCHAR14_EPTYPE_0 (0x00040000UL) +#define USBFS_HCCHAR14_EPTYPE_1 (0x00080000UL) +#define USBFS_HCCHAR14_EC_POS (20U) +#define USBFS_HCCHAR14_EC (0x00300000UL) +#define USBFS_HCCHAR14_DEVADDR_POS (22U) +#define USBFS_HCCHAR14_DEVADDR (0x1FC00000UL) +#define USBFS_HCCHAR14_ODDFRM_POS (29U) +#define USBFS_HCCHAR14_ODDFRM (0x20000000UL) +#define USBFS_HCCHAR14_CHDIS_POS (30U) +#define USBFS_HCCHAR14_CHDIS (0x40000000UL) +#define USBFS_HCCHAR14_CHENA_POS (31U) +#define USBFS_HCCHAR14_CHENA (0x80000000UL) + +/* Bit definition for USBFS_HCSPLT14 register */ +#define USBFS_HCSPLT14_PRTADDR_POS (0U) +#define USBFS_HCSPLT14_PRTADDR (0x0000007FUL) +#define USBFS_HCSPLT14_HUBADDR_POS (7U) +#define USBFS_HCSPLT14_HUBADDR (0x00003F80UL) +#define USBFS_HCSPLT14_XACTPOS_POS (14U) +#define USBFS_HCSPLT14_XACTPOS (0x0000C000UL) +#define USBFS_HCSPLT14_XACTPOS_0 (0x00004000UL) +#define USBFS_HCSPLT14_XACTPOS_1 (0x00008000UL) +#define USBFS_HCSPLT14_COMPSPLT_POS (16U) +#define USBFS_HCSPLT14_COMPSPLT (0x00010000UL) +#define USBFS_HCSPLT14_SPLTENA_POS (31U) +#define USBFS_HCSPLT14_SPLTENA (0x80000000UL) + +/* Bit definition for USBFS_HCINT14 register */ +#define USBFS_HCINT14_XFERCOMPL_POS (0U) +#define USBFS_HCINT14_XFERCOMPL (0x00000001UL) +#define USBFS_HCINT14_CHHLTD_POS (1U) +#define USBFS_HCINT14_CHHLTD (0x00000002UL) +#define USBFS_HCINT14_AHBERR_POS (2U) +#define USBFS_HCINT14_AHBERR (0x00000004UL) +#define USBFS_HCINT14_STALL_POS (3U) +#define USBFS_HCINT14_STALL (0x00000008UL) +#define USBFS_HCINT14_NAK_POS (4U) +#define USBFS_HCINT14_NAK (0x00000010UL) +#define USBFS_HCINT14_ACK_POS (5U) +#define USBFS_HCINT14_ACK (0x00000020UL) +#define USBFS_HCINT14_NYET_POS (6U) +#define USBFS_HCINT14_NYET (0x00000040UL) +#define USBFS_HCINT14_XACTERR_POS (7U) +#define USBFS_HCINT14_XACTERR (0x00000080UL) +#define USBFS_HCINT14_BBLERR_POS (8U) +#define USBFS_HCINT14_BBLERR (0x00000100UL) +#define USBFS_HCINT14_FRMOVRUN_POS (9U) +#define USBFS_HCINT14_FRMOVRUN (0x00000200UL) +#define USBFS_HCINT14_DATATGLERR_POS (10U) +#define USBFS_HCINT14_DATATGLERR (0x00000400UL) + +/* Bit definition for USBFS_HCINTMSK14 register */ +#define USBFS_HCINTMSK14_XFERCOMPLMSK_POS (0U) +#define USBFS_HCINTMSK14_XFERCOMPLMSK (0x00000001UL) +#define USBFS_HCINTMSK14_CHHLTDMSK_POS (1U) +#define USBFS_HCINTMSK14_CHHLTDMSK (0x00000002UL) +#define USBFS_HCINTMSK14_AHBERRMSK_POS (2U) +#define USBFS_HCINTMSK14_AHBERRMSK (0x00000004UL) +#define USBFS_HCINTMSK14_STALLMSK_POS (3U) +#define USBFS_HCINTMSK14_STALLMSK (0x00000008UL) +#define USBFS_HCINTMSK14_NAKMSK_POS (4U) +#define USBFS_HCINTMSK14_NAKMSK (0x00000010UL) +#define USBFS_HCINTMSK14_ACKMSK_POS (5U) +#define USBFS_HCINTMSK14_ACKMSK (0x00000020UL) +#define USBFS_HCINTMSK14_NYETMSK_POS (6U) +#define USBFS_HCINTMSK14_NYETMSK (0x00000040UL) +#define USBFS_HCINTMSK14_XACTERRMSK_POS (7U) +#define USBFS_HCINTMSK14_XACTERRMSK (0x00000080UL) +#define USBFS_HCINTMSK14_BBLERRMSK_POS (8U) +#define USBFS_HCINTMSK14_BBLERRMSK (0x00000100UL) +#define USBFS_HCINTMSK14_FRMOVRUNMSK_POS (9U) +#define USBFS_HCINTMSK14_FRMOVRUNMSK (0x00000200UL) +#define USBFS_HCINTMSK14_DATATGLERRMSK_POS (10U) +#define USBFS_HCINTMSK14_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBFS_HCTSIZ14 register */ +#define USBFS_HCTSIZ14_XFERSIZE_POS (0U) +#define USBFS_HCTSIZ14_XFERSIZE (0x0007FFFFUL) +#define USBFS_HCTSIZ14_PKTCNT_POS (19U) +#define USBFS_HCTSIZ14_PKTCNT (0x1FF80000UL) +#define USBFS_HCTSIZ14_PID_POS (29U) +#define USBFS_HCTSIZ14_PID (0x60000000UL) +#define USBFS_HCTSIZ14_PID_0 (0x20000000UL) +#define USBFS_HCTSIZ14_PID_1 (0x40000000UL) +#define USBFS_HCTSIZ14_DOPNG_POS (31U) +#define USBFS_HCTSIZ14_DOPNG (0x80000000UL) + +/* Bit definition for USBFS_HCDMA14 register */ +#define USBFS_HCDMA14 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_HCCHAR15 register */ +#define USBFS_HCCHAR15_MPS_POS (0U) +#define USBFS_HCCHAR15_MPS (0x000007FFUL) +#define USBFS_HCCHAR15_EPNUM_POS (11U) +#define USBFS_HCCHAR15_EPNUM (0x00007800UL) +#define USBFS_HCCHAR15_EPDIR_POS (15U) +#define USBFS_HCCHAR15_EPDIR (0x00008000UL) +#define USBFS_HCCHAR15_LSPDDEV_POS (17U) +#define USBFS_HCCHAR15_LSPDDEV (0x00020000UL) +#define USBFS_HCCHAR15_EPTYPE_POS (18U) +#define USBFS_HCCHAR15_EPTYPE (0x000C0000UL) +#define USBFS_HCCHAR15_EPTYPE_0 (0x00040000UL) +#define USBFS_HCCHAR15_EPTYPE_1 (0x00080000UL) +#define USBFS_HCCHAR15_EC_POS (20U) +#define USBFS_HCCHAR15_EC (0x00300000UL) +#define USBFS_HCCHAR15_DEVADDR_POS (22U) +#define USBFS_HCCHAR15_DEVADDR (0x1FC00000UL) +#define USBFS_HCCHAR15_ODDFRM_POS (29U) +#define USBFS_HCCHAR15_ODDFRM (0x20000000UL) +#define USBFS_HCCHAR15_CHDIS_POS (30U) +#define USBFS_HCCHAR15_CHDIS (0x40000000UL) +#define USBFS_HCCHAR15_CHENA_POS (31U) +#define USBFS_HCCHAR15_CHENA (0x80000000UL) + +/* Bit definition for USBFS_HCSPLT15 register */ +#define USBFS_HCSPLT15_PRTADDR_POS (0U) +#define USBFS_HCSPLT15_PRTADDR (0x0000007FUL) +#define USBFS_HCSPLT15_HUBADDR_POS (7U) +#define USBFS_HCSPLT15_HUBADDR (0x00003F80UL) +#define USBFS_HCSPLT15_XACTPOS_POS (14U) +#define USBFS_HCSPLT15_XACTPOS (0x0000C000UL) +#define USBFS_HCSPLT15_XACTPOS_0 (0x00004000UL) +#define USBFS_HCSPLT15_XACTPOS_1 (0x00008000UL) +#define USBFS_HCSPLT15_COMPSPLT_POS (16U) +#define USBFS_HCSPLT15_COMPSPLT (0x00010000UL) +#define USBFS_HCSPLT15_SPLTENA_POS (31U) +#define USBFS_HCSPLT15_SPLTENA (0x80000000UL) + +/* Bit definition for USBFS_HCINT15 register */ +#define USBFS_HCINT15_XFERCOMPL_POS (0U) +#define USBFS_HCINT15_XFERCOMPL (0x00000001UL) +#define USBFS_HCINT15_CHHLTD_POS (1U) +#define USBFS_HCINT15_CHHLTD (0x00000002UL) +#define USBFS_HCINT15_AHBERR_POS (2U) +#define USBFS_HCINT15_AHBERR (0x00000004UL) +#define USBFS_HCINT15_STALL_POS (3U) +#define USBFS_HCINT15_STALL (0x00000008UL) +#define USBFS_HCINT15_NAK_POS (4U) +#define USBFS_HCINT15_NAK (0x00000010UL) +#define USBFS_HCINT15_ACK_POS (5U) +#define USBFS_HCINT15_ACK (0x00000020UL) +#define USBFS_HCINT15_NYET_POS (6U) +#define USBFS_HCINT15_NYET (0x00000040UL) +#define USBFS_HCINT15_XACTERR_POS (7U) +#define USBFS_HCINT15_XACTERR (0x00000080UL) +#define USBFS_HCINT15_BBLERR_POS (8U) +#define USBFS_HCINT15_BBLERR (0x00000100UL) +#define USBFS_HCINT15_FRMOVRUN_POS (9U) +#define USBFS_HCINT15_FRMOVRUN (0x00000200UL) +#define USBFS_HCINT15_DATATGLERR_POS (10U) +#define USBFS_HCINT15_DATATGLERR (0x00000400UL) + +/* Bit definition for USBFS_HCINTMSK15 register */ +#define USBFS_HCINTMSK15_XFERCOMPLMSK_POS (0U) +#define USBFS_HCINTMSK15_XFERCOMPLMSK (0x00000001UL) +#define USBFS_HCINTMSK15_CHHLTDMSK_POS (1U) +#define USBFS_HCINTMSK15_CHHLTDMSK (0x00000002UL) +#define USBFS_HCINTMSK15_AHBERRMSK_POS (2U) +#define USBFS_HCINTMSK15_AHBERRMSK (0x00000004UL) +#define USBFS_HCINTMSK15_STALLMSK_POS (3U) +#define USBFS_HCINTMSK15_STALLMSK (0x00000008UL) +#define USBFS_HCINTMSK15_NAKMSK_POS (4U) +#define USBFS_HCINTMSK15_NAKMSK (0x00000010UL) +#define USBFS_HCINTMSK15_ACKMSK_POS (5U) +#define USBFS_HCINTMSK15_ACKMSK (0x00000020UL) +#define USBFS_HCINTMSK15_NYETMSK_POS (6U) +#define USBFS_HCINTMSK15_NYETMSK (0x00000040UL) +#define USBFS_HCINTMSK15_XACTERRMSK_POS (7U) +#define USBFS_HCINTMSK15_XACTERRMSK (0x00000080UL) +#define USBFS_HCINTMSK15_BBLERRMSK_POS (8U) +#define USBFS_HCINTMSK15_BBLERRMSK (0x00000100UL) +#define USBFS_HCINTMSK15_FRMOVRUNMSK_POS (9U) +#define USBFS_HCINTMSK15_FRMOVRUNMSK (0x00000200UL) +#define USBFS_HCINTMSK15_DATATGLERRMSK_POS (10U) +#define USBFS_HCINTMSK15_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBFS_HCTSIZ15 register */ +#define USBFS_HCTSIZ15_XFERSIZE_POS (0U) +#define USBFS_HCTSIZ15_XFERSIZE (0x0007FFFFUL) +#define USBFS_HCTSIZ15_PKTCNT_POS (19U) +#define USBFS_HCTSIZ15_PKTCNT (0x1FF80000UL) +#define USBFS_HCTSIZ15_PID_POS (29U) +#define USBFS_HCTSIZ15_PID (0x60000000UL) +#define USBFS_HCTSIZ15_PID_0 (0x20000000UL) +#define USBFS_HCTSIZ15_PID_1 (0x40000000UL) +#define USBFS_HCTSIZ15_DOPNG_POS (31U) +#define USBFS_HCTSIZ15_DOPNG (0x80000000UL) + +/* Bit definition for USBFS_HCDMA15 register */ +#define USBFS_HCDMA15 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DCFG register */ +#define USBFS_DCFG_DEVSPD_POS (0U) +#define USBFS_DCFG_DEVSPD (0x00000003UL) +#define USBFS_DCFG_DEVSPD_0 (0x00000001UL) +#define USBFS_DCFG_DEVSPD_1 (0x00000002UL) +#define USBFS_DCFG_NZSTSOUTHSHK_POS (2U) +#define USBFS_DCFG_NZSTSOUTHSHK (0x00000004UL) +#define USBFS_DCFG_ENA32KHZSUSP_POS (3U) +#define USBFS_DCFG_ENA32KHZSUSP (0x00000008UL) +#define USBFS_DCFG_DEVADDR_POS (4U) +#define USBFS_DCFG_DEVADDR (0x000007F0UL) +#define USBFS_DCFG_PERFRINT_POS (11U) +#define USBFS_DCFG_PERFRINT (0x00001800UL) +#define USBFS_DCFG_PERFRINT_0 (0x00000800UL) +#define USBFS_DCFG_PERFRINT_1 (0x00001000UL) +#define USBFS_DCFG_XCVRDLY_POS (14U) +#define USBFS_DCFG_XCVRDLY (0x00004000UL) +#define USBFS_DCFG_ERRATICINTMSK_POS (15U) +#define USBFS_DCFG_ERRATICINTMSK (0x00008000UL) +#define USBFS_DCFG_PERSCHINTVL_POS (24U) +#define USBFS_DCFG_PERSCHINTVL (0x03000000UL) +#define USBFS_DCFG_PERSCHINTVL_0 (0x01000000UL) +#define USBFS_DCFG_PERSCHINTVL_1 (0x02000000UL) +#define USBFS_DCFG_RESVALID_POS (26U) +#define USBFS_DCFG_RESVALID (0xFC000000UL) + +/* Bit definition for USBFS_DCTL register */ +#define USBFS_DCTL_RMTWKUPSIG_POS (0U) +#define USBFS_DCTL_RMTWKUPSIG (0x00000001UL) +#define USBFS_DCTL_SFTDISCON_POS (1U) +#define USBFS_DCTL_SFTDISCON (0x00000002UL) +#define USBFS_DCTL_GNPINNAKSTS_POS (2U) +#define USBFS_DCTL_GNPINNAKSTS (0x00000004UL) +#define USBFS_DCTL_GOUTNAKSTS_POS (3U) +#define USBFS_DCTL_GOUTNAKSTS (0x00000008UL) +#define USBFS_DCTL_TSTCTL_POS (4U) +#define USBFS_DCTL_TSTCTL (0x00000070UL) +#define USBFS_DCTL_TSTCTL_0 (0x00000010UL) +#define USBFS_DCTL_TSTCTL_1 (0x00000020UL) +#define USBFS_DCTL_TSTCTL_2 (0x00000040UL) +#define USBFS_DCTL_SGNPINNAK_POS (7U) +#define USBFS_DCTL_SGNPINNAK (0x00000080UL) +#define USBFS_DCTL_CGNPINNAK_POS (8U) +#define USBFS_DCTL_CGNPINNAK (0x00000100UL) +#define USBFS_DCTL_SGOUTNAK_POS (9U) +#define USBFS_DCTL_SGOUTNAK (0x00000200UL) +#define USBFS_DCTL_CGOUTNAK_POS (10U) +#define USBFS_DCTL_CGOUTNAK (0x00000400UL) +#define USBFS_DCTL_PWRONPRGDONE_POS (11U) +#define USBFS_DCTL_PWRONPRGDONE (0x00000800UL) +#define USBFS_DCTL_IGNRFRMNUM_POS (15U) +#define USBFS_DCTL_IGNRFRMNUM (0x00008000UL) +#define USBFS_DCTL_NAKONBBLE_POS (16U) +#define USBFS_DCTL_NAKONBBLE (0x00010000UL) +#define USBFS_DCTL_DEEPSLEEPBESLREJECT_POS (18U) +#define USBFS_DCTL_DEEPSLEEPBESLREJECT (0x00040000UL) +#define USBFS_DCTL_SERVINT_POS (19U) +#define USBFS_DCTL_SERVINT (0x00080000UL) + +/* Bit definition for USBFS_DSTS register */ +#define USBFS_DSTS_SUSPSTS_POS (0U) +#define USBFS_DSTS_SUSPSTS (0x00000001UL) +#define USBFS_DSTS_ENUMSPD_POS (1U) +#define USBFS_DSTS_ENUMSPD (0x00000006UL) +#define USBFS_DSTS_ENUMSPD_0 (0x00000002UL) +#define USBFS_DSTS_ENUMSPD_1 (0x00000004UL) +#define USBFS_DSTS_ERRTICERR_POS (3U) +#define USBFS_DSTS_ERRTICERR (0x00000008UL) +#define USBFS_DSTS_SOFFN_POS (8U) +#define USBFS_DSTS_SOFFN (0x003FFF00UL) +#define USBFS_DSTS_DEVLNSTS_POS (22U) +#define USBFS_DSTS_DEVLNSTS (0x00C00000UL) +#define USBFS_DSTS_DEVLNSTS_0 (0x00400000UL) +#define USBFS_DSTS_DEVLNSTS_1 (0x00800000UL) + +/* Bit definition for USBFS_DIEPMSK register */ +#define USBFS_DIEPMSK_XFERCOMPLMSK_POS (0U) +#define USBFS_DIEPMSK_XFERCOMPLMSK (0x00000001UL) +#define USBFS_DIEPMSK_EPDISBLDMSK_POS (1U) +#define USBFS_DIEPMSK_EPDISBLDMSK (0x00000002UL) +#define USBFS_DIEPMSK_AHBERRMSK_POS (2U) +#define USBFS_DIEPMSK_AHBERRMSK (0x00000004UL) +#define USBFS_DIEPMSK_TIMEOUTMSK_POS (3U) +#define USBFS_DIEPMSK_TIMEOUTMSK (0x00000008UL) +#define USBFS_DIEPMSK_INTKNTXFEMPMSK_POS (4U) +#define USBFS_DIEPMSK_INTKNTXFEMPMSK (0x00000010UL) +#define USBFS_DIEPMSK_INTKNEPMISMSK_POS (5U) +#define USBFS_DIEPMSK_INTKNEPMISMSK (0x00000020UL) +#define USBFS_DIEPMSK_INEPNAKEFFMSK_POS (6U) +#define USBFS_DIEPMSK_INEPNAKEFFMSK (0x00000040UL) +#define USBFS_DIEPMSK_TXFIFOUNDRNMSK_POS (8U) +#define USBFS_DIEPMSK_TXFIFOUNDRNMSK (0x00000100UL) +#define USBFS_DIEPMSK_NAKMSK_POS (13U) +#define USBFS_DIEPMSK_NAKMSK (0x00002000UL) + +/* Bit definition for USBFS_DOEPMSK register */ +#define USBFS_DOEPMSK_XFERCOMPLMSK_POS (0U) +#define USBFS_DOEPMSK_XFERCOMPLMSK (0x00000001UL) +#define USBFS_DOEPMSK_EPDISBLDMSK_POS (1U) +#define USBFS_DOEPMSK_EPDISBLDMSK (0x00000002UL) +#define USBFS_DOEPMSK_AHBERRMSK_POS (2U) +#define USBFS_DOEPMSK_AHBERRMSK (0x00000004UL) +#define USBFS_DOEPMSK_SETUPMSK_POS (3U) +#define USBFS_DOEPMSK_SETUPMSK (0x00000008UL) +#define USBFS_DOEPMSK_OUTTKNEPDISMSK_POS (4U) +#define USBFS_DOEPMSK_OUTTKNEPDISMSK (0x00000010UL) +#define USBFS_DOEPMSK_STSPHSERCVDMSK_POS (5U) +#define USBFS_DOEPMSK_STSPHSERCVDMSK (0x00000020UL) +#define USBFS_DOEPMSK_BACK2BACKSETUP_POS (6U) +#define USBFS_DOEPMSK_BACK2BACKSETUP (0x00000040UL) +#define USBFS_DOEPMSK_OUTPKTERRMSK_POS (8U) +#define USBFS_DOEPMSK_OUTPKTERRMSK (0x00000100UL) +#define USBFS_DOEPMSK_BBLEERRMSK_POS (12U) +#define USBFS_DOEPMSK_BBLEERRMSK (0x00001000UL) +#define USBFS_DOEPMSK_NAKMSK_POS (13U) +#define USBFS_DOEPMSK_NAKMSK (0x00002000UL) +#define USBFS_DOEPMSK_NYETMSK_POS (14U) +#define USBFS_DOEPMSK_NYETMSK (0x00004000UL) + +/* Bit definition for USBFS_DAINT register */ +#define USBFS_DAINT_INEPINT0_POS (0U) +#define USBFS_DAINT_INEPINT0 (0x00000001UL) +#define USBFS_DAINT_INEPINT1_POS (1U) +#define USBFS_DAINT_INEPINT1 (0x00000002UL) +#define USBFS_DAINT_INEPINT2_POS (2U) +#define USBFS_DAINT_INEPINT2 (0x00000004UL) +#define USBFS_DAINT_INEPINT3_POS (3U) +#define USBFS_DAINT_INEPINT3 (0x00000008UL) +#define USBFS_DAINT_INEPINT4_POS (4U) +#define USBFS_DAINT_INEPINT4 (0x00000010UL) +#define USBFS_DAINT_INEPINT5_POS (5U) +#define USBFS_DAINT_INEPINT5 (0x00000020UL) +#define USBFS_DAINT_INEPINT6_POS (6U) +#define USBFS_DAINT_INEPINT6 (0x00000040UL) +#define USBFS_DAINT_INEPINT7_POS (7U) +#define USBFS_DAINT_INEPINT7 (0x00000080UL) +#define USBFS_DAINT_INEPINT8_POS (8U) +#define USBFS_DAINT_INEPINT8 (0x00000100UL) +#define USBFS_DAINT_INEPINT9_POS (9U) +#define USBFS_DAINT_INEPINT9 (0x00000200UL) +#define USBFS_DAINT_INEPINT10_POS (10U) +#define USBFS_DAINT_INEPINT10 (0x00000400UL) +#define USBFS_DAINT_INEPINT11_POS (11U) +#define USBFS_DAINT_INEPINT11 (0x00000800UL) +#define USBFS_DAINT_INEPINT12_POS (12U) +#define USBFS_DAINT_INEPINT12 (0x00001000UL) +#define USBFS_DAINT_INEPINT13_POS (13U) +#define USBFS_DAINT_INEPINT13 (0x00002000UL) +#define USBFS_DAINT_INEPINT14_POS (14U) +#define USBFS_DAINT_INEPINT14 (0x00004000UL) +#define USBFS_DAINT_INEPINT15_POS (15U) +#define USBFS_DAINT_INEPINT15 (0x00008000UL) +#define USBFS_DAINT_OUTEPINT0_POS (16U) +#define USBFS_DAINT_OUTEPINT0 (0x00010000UL) +#define USBFS_DAINT_OUTEPINT1_POS (17U) +#define USBFS_DAINT_OUTEPINT1 (0x00020000UL) +#define USBFS_DAINT_OUTEPINT2_POS (18U) +#define USBFS_DAINT_OUTEPINT2 (0x00040000UL) +#define USBFS_DAINT_OUTEPINT3_POS (19U) +#define USBFS_DAINT_OUTEPINT3 (0x00080000UL) +#define USBFS_DAINT_OUTEPINT4_POS (20U) +#define USBFS_DAINT_OUTEPINT4 (0x00100000UL) +#define USBFS_DAINT_OUTEPINT5_POS (21U) +#define USBFS_DAINT_OUTEPINT5 (0x00200000UL) +#define USBFS_DAINT_OUTEPINT6_POS (22U) +#define USBFS_DAINT_OUTEPINT6 (0x00400000UL) +#define USBFS_DAINT_OUTEPINT7_POS (23U) +#define USBFS_DAINT_OUTEPINT7 (0x00800000UL) +#define USBFS_DAINT_OUTEPINT8_POS (24U) +#define USBFS_DAINT_OUTEPINT8 (0x01000000UL) +#define USBFS_DAINT_OUTEPINT9_POS (25U) +#define USBFS_DAINT_OUTEPINT9 (0x02000000UL) +#define USBFS_DAINT_OUTEPINT10_POS (26U) +#define USBFS_DAINT_OUTEPINT10 (0x04000000UL) +#define USBFS_DAINT_OUTEPINT11_POS (27U) +#define USBFS_DAINT_OUTEPINT11 (0x08000000UL) +#define USBFS_DAINT_OUTEPINT12_POS (28U) +#define USBFS_DAINT_OUTEPINT12 (0x10000000UL) +#define USBFS_DAINT_OUTEPINT13_POS (29U) +#define USBFS_DAINT_OUTEPINT13 (0x20000000UL) +#define USBFS_DAINT_OUTEPINT14_POS (30U) +#define USBFS_DAINT_OUTEPINT14 (0x40000000UL) +#define USBFS_DAINT_OUTEPINT15_POS (31U) +#define USBFS_DAINT_OUTEPINT15 (0x80000000UL) + +/* Bit definition for USBFS_DAINTMSK register */ +#define USBFS_DAINTMSK_INEPMSK0_POS (0U) +#define USBFS_DAINTMSK_INEPMSK0 (0x00000001UL) +#define USBFS_DAINTMSK_INEPMSK1_POS (1U) +#define USBFS_DAINTMSK_INEPMSK1 (0x00000002UL) +#define USBFS_DAINTMSK_INEPMSK2_POS (2U) +#define USBFS_DAINTMSK_INEPMSK2 (0x00000004UL) +#define USBFS_DAINTMSK_INEPMSK3_POS (3U) +#define USBFS_DAINTMSK_INEPMSK3 (0x00000008UL) +#define USBFS_DAINTMSK_INEPMSK4_POS (4U) +#define USBFS_DAINTMSK_INEPMSK4 (0x00000010UL) +#define USBFS_DAINTMSK_INEPMSK5_POS (5U) +#define USBFS_DAINTMSK_INEPMSK5 (0x00000020UL) +#define USBFS_DAINTMSK_INEPMSK6_POS (6U) +#define USBFS_DAINTMSK_INEPMSK6 (0x00000040UL) +#define USBFS_DAINTMSK_INEPMSK7_POS (7U) +#define USBFS_DAINTMSK_INEPMSK7 (0x00000080UL) +#define USBFS_DAINTMSK_INEPMSK8_POS (8U) +#define USBFS_DAINTMSK_INEPMSK8 (0x00000100UL) +#define USBFS_DAINTMSK_INEPMSK9_POS (9U) +#define USBFS_DAINTMSK_INEPMSK9 (0x00000200UL) +#define USBFS_DAINTMSK_INEPMSK10_POS (10U) +#define USBFS_DAINTMSK_INEPMSK10 (0x00000400UL) +#define USBFS_DAINTMSK_INEPMSK11_POS (11U) +#define USBFS_DAINTMSK_INEPMSK11 (0x00000800UL) +#define USBFS_DAINTMSK_INEPMSK12_POS (12U) +#define USBFS_DAINTMSK_INEPMSK12 (0x00001000UL) +#define USBFS_DAINTMSK_INEPMSK13_POS (13U) +#define USBFS_DAINTMSK_INEPMSK13 (0x00002000UL) +#define USBFS_DAINTMSK_INEPMSK14_POS (14U) +#define USBFS_DAINTMSK_INEPMSK14 (0x00004000UL) +#define USBFS_DAINTMSK_INEPMSK15_POS (15U) +#define USBFS_DAINTMSK_INEPMSK15 (0x00008000UL) +#define USBFS_DAINTMSK_OUTEPMSK0_POS (16U) +#define USBFS_DAINTMSK_OUTEPMSK0 (0x00010000UL) +#define USBFS_DAINTMSK_OUTEPMSK1_POS (17U) +#define USBFS_DAINTMSK_OUTEPMSK1 (0x00020000UL) +#define USBFS_DAINTMSK_OUTEPMSK2_POS (18U) +#define USBFS_DAINTMSK_OUTEPMSK2 (0x00040000UL) +#define USBFS_DAINTMSK_OUTEPMSK3_POS (19U) +#define USBFS_DAINTMSK_OUTEPMSK3 (0x00080000UL) +#define USBFS_DAINTMSK_OUTEPMSK4_POS (20U) +#define USBFS_DAINTMSK_OUTEPMSK4 (0x00100000UL) +#define USBFS_DAINTMSK_OUTEPMSK5_POS (21U) +#define USBFS_DAINTMSK_OUTEPMSK5 (0x00200000UL) +#define USBFS_DAINTMSK_OUTEPMSK6_POS (22U) +#define USBFS_DAINTMSK_OUTEPMSK6 (0x00400000UL) +#define USBFS_DAINTMSK_OUTEPMSK7_POS (23U) +#define USBFS_DAINTMSK_OUTEPMSK7 (0x00800000UL) +#define USBFS_DAINTMSK_OUTEPMSK8_POS (24U) +#define USBFS_DAINTMSK_OUTEPMSK8 (0x01000000UL) +#define USBFS_DAINTMSK_OUTEPMSK9_POS (25U) +#define USBFS_DAINTMSK_OUTEPMSK9 (0x02000000UL) +#define USBFS_DAINTMSK_OUTEPMSK10_POS (26U) +#define USBFS_DAINTMSK_OUTEPMSK10 (0x04000000UL) +#define USBFS_DAINTMSK_OUTEPMSK11_POS (27U) +#define USBFS_DAINTMSK_OUTEPMSK11 (0x08000000UL) +#define USBFS_DAINTMSK_OUTEPMSK12_POS (28U) +#define USBFS_DAINTMSK_OUTEPMSK12 (0x10000000UL) +#define USBFS_DAINTMSK_OUTEPMSK13_POS (29U) +#define USBFS_DAINTMSK_OUTEPMSK13 (0x20000000UL) +#define USBFS_DAINTMSK_OUTEPMSK14_POS (30U) +#define USBFS_DAINTMSK_OUTEPMSK14 (0x40000000UL) +#define USBFS_DAINTMSK_OUTEPMSK15_POS (31U) +#define USBFS_DAINTMSK_OUTEPMSK15 (0x80000000UL) + +/* Bit definition for USBFS_DIEPEMPMSK register */ +#define USBFS_DIEPEMPMSK_INEPTXFEMPMSK (0x0000FFFFUL) + +/* Bit definition for USBFS_DIEPCTL0 register */ +#define USBFS_DIEPCTL0_MPS_POS (0U) +#define USBFS_DIEPCTL0_MPS (0x00000003UL) +#define USBFS_DIEPCTL0_USBACTEP_POS (15U) +#define USBFS_DIEPCTL0_USBACTEP (0x00008000UL) +#define USBFS_DIEPCTL0_NAKSTS_POS (17U) +#define USBFS_DIEPCTL0_NAKSTS (0x00020000UL) +#define USBFS_DIEPCTL0_EPTYPE_POS (18U) +#define USBFS_DIEPCTL0_EPTYPE (0x000C0000UL) +#define USBFS_DIEPCTL0_EPTYPE_0 (0x00040000UL) +#define USBFS_DIEPCTL0_EPTYPE_1 (0x00080000UL) +#define USBFS_DIEPCTL0_STALL_POS (21U) +#define USBFS_DIEPCTL0_STALL (0x00200000UL) +#define USBFS_DIEPCTL0_TXFNUM_POS (22U) +#define USBFS_DIEPCTL0_TXFNUM (0x03C00000UL) +#define USBFS_DIEPCTL0_CNAK_POS (26U) +#define USBFS_DIEPCTL0_CNAK (0x04000000UL) +#define USBFS_DIEPCTL0_SNAK_POS (27U) +#define USBFS_DIEPCTL0_SNAK (0x08000000UL) +#define USBFS_DIEPCTL0_EPDIS_POS (30U) +#define USBFS_DIEPCTL0_EPDIS (0x40000000UL) +#define USBFS_DIEPCTL0_EPENA_POS (31U) +#define USBFS_DIEPCTL0_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DIEPINT0 register */ +#define USBFS_DIEPINT0_XFERCOMPL_POS (0U) +#define USBFS_DIEPINT0_XFERCOMPL (0x00000001UL) +#define USBFS_DIEPINT0_EPDISBLD_POS (1U) +#define USBFS_DIEPINT0_EPDISBLD (0x00000002UL) +#define USBFS_DIEPINT0_AHBERR_POS (2U) +#define USBFS_DIEPINT0_AHBERR (0x00000004UL) +#define USBFS_DIEPINT0_TIMEOUT_POS (3U) +#define USBFS_DIEPINT0_TIMEOUT (0x00000008UL) +#define USBFS_DIEPINT0_INTKNTXFEMP_POS (4U) +#define USBFS_DIEPINT0_INTKNTXFEMP (0x00000010UL) +#define USBFS_DIEPINT0_INTKNEPMIS_POS (5U) +#define USBFS_DIEPINT0_INTKNEPMIS (0x00000020UL) +#define USBFS_DIEPINT0_INEPNAKEFF_POS (6U) +#define USBFS_DIEPINT0_INEPNAKEFF (0x00000040UL) +#define USBFS_DIEPINT0_TXFEMP_POS (7U) +#define USBFS_DIEPINT0_TXFEMP (0x00000080UL) +#define USBFS_DIEPINT0_TXFIFOUNDRN_POS (8U) +#define USBFS_DIEPINT0_TXFIFOUNDRN (0x00000100UL) +#define USBFS_DIEPINT0_BNAINTR_POS (9U) +#define USBFS_DIEPINT0_BNAINTR (0x00000200UL) +#define USBFS_DIEPINT0_PKTDRPSTS_POS (11U) +#define USBFS_DIEPINT0_PKTDRPSTS (0x00000800UL) +#define USBFS_DIEPINT0_BBLEERR_POS (12U) +#define USBFS_DIEPINT0_BBLEERR (0x00001000UL) +#define USBFS_DIEPINT0_NAKINTRPT_POS (13U) +#define USBFS_DIEPINT0_NAKINTRPT (0x00002000UL) +#define USBFS_DIEPINT0_NYETINTRPT_POS (14U) +#define USBFS_DIEPINT0_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBFS_DIEPTSIZ0 register */ +#define USBFS_DIEPTSIZ0_XFERSIZE_POS (0U) +#define USBFS_DIEPTSIZ0_XFERSIZE (0x0000007FUL) +#define USBFS_DIEPTSIZ0_PKTCNT_POS (19U) +#define USBFS_DIEPTSIZ0_PKTCNT (0x00180000UL) + +/* Bit definition for USBFS_DIEPDMA0 register */ +#define USBFS_DIEPDMA0 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DTXFSTS0 register */ +#define USBFS_DTXFSTS0_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBFS_DIEPCTL1 register */ +#define USBFS_DIEPCTL1_MPS_POS (0U) +#define USBFS_DIEPCTL1_MPS (0x000007FFUL) +#define USBFS_DIEPCTL1_USBACTEP_POS (15U) +#define USBFS_DIEPCTL1_USBACTEP (0x00008000UL) +#define USBFS_DIEPCTL1_DPID_POS (16U) +#define USBFS_DIEPCTL1_DPID (0x00010000UL) +#define USBFS_DIEPCTL1_NAKSTS_POS (17U) +#define USBFS_DIEPCTL1_NAKSTS (0x00020000UL) +#define USBFS_DIEPCTL1_EPTYPE_POS (18U) +#define USBFS_DIEPCTL1_EPTYPE (0x000C0000UL) +#define USBFS_DIEPCTL1_EPTYPE_0 (0x00040000UL) +#define USBFS_DIEPCTL1_EPTYPE_1 (0x00080000UL) +#define USBFS_DIEPCTL1_STALL_POS (21U) +#define USBFS_DIEPCTL1_STALL (0x00200000UL) +#define USBFS_DIEPCTL1_TXFNUM_POS (22U) +#define USBFS_DIEPCTL1_TXFNUM (0x03C00000UL) +#define USBFS_DIEPCTL1_CNAK_POS (26U) +#define USBFS_DIEPCTL1_CNAK (0x04000000UL) +#define USBFS_DIEPCTL1_SNAK_POS (27U) +#define USBFS_DIEPCTL1_SNAK (0x08000000UL) +#define USBFS_DIEPCTL1_SETD0PID_POS (28U) +#define USBFS_DIEPCTL1_SETD0PID (0x10000000UL) +#define USBFS_DIEPCTL1_SETD1PID_POS (29U) +#define USBFS_DIEPCTL1_SETD1PID (0x20000000UL) +#define USBFS_DIEPCTL1_EPDIS_POS (30U) +#define USBFS_DIEPCTL1_EPDIS (0x40000000UL) +#define USBFS_DIEPCTL1_EPENA_POS (31U) +#define USBFS_DIEPCTL1_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DIEPINT1 register */ +#define USBFS_DIEPINT1_XFERCOMPL_POS (0U) +#define USBFS_DIEPINT1_XFERCOMPL (0x00000001UL) +#define USBFS_DIEPINT1_EPDISBLD_POS (1U) +#define USBFS_DIEPINT1_EPDISBLD (0x00000002UL) +#define USBFS_DIEPINT1_AHBERR_POS (2U) +#define USBFS_DIEPINT1_AHBERR (0x00000004UL) +#define USBFS_DIEPINT1_TIMEOUT_POS (3U) +#define USBFS_DIEPINT1_TIMEOUT (0x00000008UL) +#define USBFS_DIEPINT1_INTKNTXFEMP_POS (4U) +#define USBFS_DIEPINT1_INTKNTXFEMP (0x00000010UL) +#define USBFS_DIEPINT1_INTKNEPMIS_POS (5U) +#define USBFS_DIEPINT1_INTKNEPMIS (0x00000020UL) +#define USBFS_DIEPINT1_INEPNAKEFF_POS (6U) +#define USBFS_DIEPINT1_INEPNAKEFF (0x00000040UL) +#define USBFS_DIEPINT1_TXFEMP_POS (7U) +#define USBFS_DIEPINT1_TXFEMP (0x00000080UL) +#define USBFS_DIEPINT1_TXFIFOUNDRN_POS (8U) +#define USBFS_DIEPINT1_TXFIFOUNDRN (0x00000100UL) +#define USBFS_DIEPINT1_BNAINTR_POS (9U) +#define USBFS_DIEPINT1_BNAINTR (0x00000200UL) +#define USBFS_DIEPINT1_PKTDRPSTS_POS (11U) +#define USBFS_DIEPINT1_PKTDRPSTS (0x00000800UL) +#define USBFS_DIEPINT1_BBLEERR_POS (12U) +#define USBFS_DIEPINT1_BBLEERR (0x00001000UL) +#define USBFS_DIEPINT1_NAKINTRPT_POS (13U) +#define USBFS_DIEPINT1_NAKINTRPT (0x00002000UL) +#define USBFS_DIEPINT1_NYETINTRPT_POS (14U) +#define USBFS_DIEPINT1_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBFS_DIEPTSIZ1 register */ +#define USBFS_DIEPTSIZ1_XFERSIZE_POS (0U) +#define USBFS_DIEPTSIZ1_XFERSIZE (0x0007FFFFUL) +#define USBFS_DIEPTSIZ1_PKTCNT_POS (19U) +#define USBFS_DIEPTSIZ1_PKTCNT (0x1FF80000UL) +#define USBFS_DIEPTSIZ1_MC_POS (29U) +#define USBFS_DIEPTSIZ1_MC (0x60000000UL) + +/* Bit definition for USBFS_DIEPDMA1 register */ +#define USBFS_DIEPDMA1 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DTXFSTS1 register */ +#define USBFS_DTXFSTS1_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBFS_DIEPCTL2 register */ +#define USBFS_DIEPCTL2_MPS_POS (0U) +#define USBFS_DIEPCTL2_MPS (0x000007FFUL) +#define USBFS_DIEPCTL2_USBACTEP_POS (15U) +#define USBFS_DIEPCTL2_USBACTEP (0x00008000UL) +#define USBFS_DIEPCTL2_DPID_POS (16U) +#define USBFS_DIEPCTL2_DPID (0x00010000UL) +#define USBFS_DIEPCTL2_NAKSTS_POS (17U) +#define USBFS_DIEPCTL2_NAKSTS (0x00020000UL) +#define USBFS_DIEPCTL2_EPTYPE_POS (18U) +#define USBFS_DIEPCTL2_EPTYPE (0x000C0000UL) +#define USBFS_DIEPCTL2_EPTYPE_0 (0x00040000UL) +#define USBFS_DIEPCTL2_EPTYPE_1 (0x00080000UL) +#define USBFS_DIEPCTL2_STALL_POS (21U) +#define USBFS_DIEPCTL2_STALL (0x00200000UL) +#define USBFS_DIEPCTL2_TXFNUM_POS (22U) +#define USBFS_DIEPCTL2_TXFNUM (0x03C00000UL) +#define USBFS_DIEPCTL2_CNAK_POS (26U) +#define USBFS_DIEPCTL2_CNAK (0x04000000UL) +#define USBFS_DIEPCTL2_SNAK_POS (27U) +#define USBFS_DIEPCTL2_SNAK (0x08000000UL) +#define USBFS_DIEPCTL2_SETD0PID_POS (28U) +#define USBFS_DIEPCTL2_SETD0PID (0x10000000UL) +#define USBFS_DIEPCTL2_SETD1PID_POS (29U) +#define USBFS_DIEPCTL2_SETD1PID (0x20000000UL) +#define USBFS_DIEPCTL2_EPDIS_POS (30U) +#define USBFS_DIEPCTL2_EPDIS (0x40000000UL) +#define USBFS_DIEPCTL2_EPENA_POS (31U) +#define USBFS_DIEPCTL2_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DIEPINT2 register */ +#define USBFS_DIEPINT2_XFERCOMPL_POS (0U) +#define USBFS_DIEPINT2_XFERCOMPL (0x00000001UL) +#define USBFS_DIEPINT2_EPDISBLD_POS (1U) +#define USBFS_DIEPINT2_EPDISBLD (0x00000002UL) +#define USBFS_DIEPINT2_AHBERR_POS (2U) +#define USBFS_DIEPINT2_AHBERR (0x00000004UL) +#define USBFS_DIEPINT2_TIMEOUT_POS (3U) +#define USBFS_DIEPINT2_TIMEOUT (0x00000008UL) +#define USBFS_DIEPINT2_INTKNTXFEMP_POS (4U) +#define USBFS_DIEPINT2_INTKNTXFEMP (0x00000010UL) +#define USBFS_DIEPINT2_INTKNEPMIS_POS (5U) +#define USBFS_DIEPINT2_INTKNEPMIS (0x00000020UL) +#define USBFS_DIEPINT2_INEPNAKEFF_POS (6U) +#define USBFS_DIEPINT2_INEPNAKEFF (0x00000040UL) +#define USBFS_DIEPINT2_TXFEMP_POS (7U) +#define USBFS_DIEPINT2_TXFEMP (0x00000080UL) +#define USBFS_DIEPINT2_TXFIFOUNDRN_POS (8U) +#define USBFS_DIEPINT2_TXFIFOUNDRN (0x00000100UL) +#define USBFS_DIEPINT2_BNAINTR_POS (9U) +#define USBFS_DIEPINT2_BNAINTR (0x00000200UL) +#define USBFS_DIEPINT2_PKTDRPSTS_POS (11U) +#define USBFS_DIEPINT2_PKTDRPSTS (0x00000800UL) +#define USBFS_DIEPINT2_BBLEERR_POS (12U) +#define USBFS_DIEPINT2_BBLEERR (0x00001000UL) +#define USBFS_DIEPINT2_NAKINTRPT_POS (13U) +#define USBFS_DIEPINT2_NAKINTRPT (0x00002000UL) +#define USBFS_DIEPINT2_NYETINTRPT_POS (14U) +#define USBFS_DIEPINT2_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBFS_DIEPTSIZ2 register */ +#define USBFS_DIEPTSIZ2_XFERSIZE_POS (0U) +#define USBFS_DIEPTSIZ2_XFERSIZE (0x0007FFFFUL) +#define USBFS_DIEPTSIZ2_PKTCNT_POS (19U) +#define USBFS_DIEPTSIZ2_PKTCNT (0x1FF80000UL) +#define USBFS_DIEPTSIZ2_MC_POS (29U) +#define USBFS_DIEPTSIZ2_MC (0x60000000UL) + +/* Bit definition for USBFS_DIEPDMA2 register */ +#define USBFS_DIEPDMA2 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DTXFSTS2 register */ +#define USBFS_DTXFSTS2_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBFS_DIEPCTL3 register */ +#define USBFS_DIEPCTL3_MPS_POS (0U) +#define USBFS_DIEPCTL3_MPS (0x000007FFUL) +#define USBFS_DIEPCTL3_USBACTEP_POS (15U) +#define USBFS_DIEPCTL3_USBACTEP (0x00008000UL) +#define USBFS_DIEPCTL3_DPID_POS (16U) +#define USBFS_DIEPCTL3_DPID (0x00010000UL) +#define USBFS_DIEPCTL3_NAKSTS_POS (17U) +#define USBFS_DIEPCTL3_NAKSTS (0x00020000UL) +#define USBFS_DIEPCTL3_EPTYPE_POS (18U) +#define USBFS_DIEPCTL3_EPTYPE (0x000C0000UL) +#define USBFS_DIEPCTL3_EPTYPE_0 (0x00040000UL) +#define USBFS_DIEPCTL3_EPTYPE_1 (0x00080000UL) +#define USBFS_DIEPCTL3_STALL_POS (21U) +#define USBFS_DIEPCTL3_STALL (0x00200000UL) +#define USBFS_DIEPCTL3_TXFNUM_POS (22U) +#define USBFS_DIEPCTL3_TXFNUM (0x03C00000UL) +#define USBFS_DIEPCTL3_CNAK_POS (26U) +#define USBFS_DIEPCTL3_CNAK (0x04000000UL) +#define USBFS_DIEPCTL3_SNAK_POS (27U) +#define USBFS_DIEPCTL3_SNAK (0x08000000UL) +#define USBFS_DIEPCTL3_SETD0PID_POS (28U) +#define USBFS_DIEPCTL3_SETD0PID (0x10000000UL) +#define USBFS_DIEPCTL3_SETD1PID_POS (29U) +#define USBFS_DIEPCTL3_SETD1PID (0x20000000UL) +#define USBFS_DIEPCTL3_EPDIS_POS (30U) +#define USBFS_DIEPCTL3_EPDIS (0x40000000UL) +#define USBFS_DIEPCTL3_EPENA_POS (31U) +#define USBFS_DIEPCTL3_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DIEPINT3 register */ +#define USBFS_DIEPINT3_XFERCOMPL_POS (0U) +#define USBFS_DIEPINT3_XFERCOMPL (0x00000001UL) +#define USBFS_DIEPINT3_EPDISBLD_POS (1U) +#define USBFS_DIEPINT3_EPDISBLD (0x00000002UL) +#define USBFS_DIEPINT3_AHBERR_POS (2U) +#define USBFS_DIEPINT3_AHBERR (0x00000004UL) +#define USBFS_DIEPINT3_TIMEOUT_POS (3U) +#define USBFS_DIEPINT3_TIMEOUT (0x00000008UL) +#define USBFS_DIEPINT3_INTKNTXFEMP_POS (4U) +#define USBFS_DIEPINT3_INTKNTXFEMP (0x00000010UL) +#define USBFS_DIEPINT3_INTKNEPMIS_POS (5U) +#define USBFS_DIEPINT3_INTKNEPMIS (0x00000020UL) +#define USBFS_DIEPINT3_INEPNAKEFF_POS (6U) +#define USBFS_DIEPINT3_INEPNAKEFF (0x00000040UL) +#define USBFS_DIEPINT3_TXFEMP_POS (7U) +#define USBFS_DIEPINT3_TXFEMP (0x00000080UL) +#define USBFS_DIEPINT3_TXFIFOUNDRN_POS (8U) +#define USBFS_DIEPINT3_TXFIFOUNDRN (0x00000100UL) +#define USBFS_DIEPINT3_BNAINTR_POS (9U) +#define USBFS_DIEPINT3_BNAINTR (0x00000200UL) +#define USBFS_DIEPINT3_PKTDRPSTS_POS (11U) +#define USBFS_DIEPINT3_PKTDRPSTS (0x00000800UL) +#define USBFS_DIEPINT3_BBLEERR_POS (12U) +#define USBFS_DIEPINT3_BBLEERR (0x00001000UL) +#define USBFS_DIEPINT3_NAKINTRPT_POS (13U) +#define USBFS_DIEPINT3_NAKINTRPT (0x00002000UL) +#define USBFS_DIEPINT3_NYETINTRPT_POS (14U) +#define USBFS_DIEPINT3_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBFS_DIEPTSIZ3 register */ +#define USBFS_DIEPTSIZ3_XFERSIZE_POS (0U) +#define USBFS_DIEPTSIZ3_XFERSIZE (0x0007FFFFUL) +#define USBFS_DIEPTSIZ3_PKTCNT_POS (19U) +#define USBFS_DIEPTSIZ3_PKTCNT (0x1FF80000UL) +#define USBFS_DIEPTSIZ3_MC_POS (29U) +#define USBFS_DIEPTSIZ3_MC (0x60000000UL) + +/* Bit definition for USBFS_DIEPDMA3 register */ +#define USBFS_DIEPDMA3 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DTXFSTS3 register */ +#define USBFS_DTXFSTS3_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBFS_DIEPCTL4 register */ +#define USBFS_DIEPCTL4_MPS_POS (0U) +#define USBFS_DIEPCTL4_MPS (0x000007FFUL) +#define USBFS_DIEPCTL4_USBACTEP_POS (15U) +#define USBFS_DIEPCTL4_USBACTEP (0x00008000UL) +#define USBFS_DIEPCTL4_DPID_POS (16U) +#define USBFS_DIEPCTL4_DPID (0x00010000UL) +#define USBFS_DIEPCTL4_NAKSTS_POS (17U) +#define USBFS_DIEPCTL4_NAKSTS (0x00020000UL) +#define USBFS_DIEPCTL4_EPTYPE_POS (18U) +#define USBFS_DIEPCTL4_EPTYPE (0x000C0000UL) +#define USBFS_DIEPCTL4_EPTYPE_0 (0x00040000UL) +#define USBFS_DIEPCTL4_EPTYPE_1 (0x00080000UL) +#define USBFS_DIEPCTL4_STALL_POS (21U) +#define USBFS_DIEPCTL4_STALL (0x00200000UL) +#define USBFS_DIEPCTL4_TXFNUM_POS (22U) +#define USBFS_DIEPCTL4_TXFNUM (0x03C00000UL) +#define USBFS_DIEPCTL4_CNAK_POS (26U) +#define USBFS_DIEPCTL4_CNAK (0x04000000UL) +#define USBFS_DIEPCTL4_SNAK_POS (27U) +#define USBFS_DIEPCTL4_SNAK (0x08000000UL) +#define USBFS_DIEPCTL4_SETD0PID_POS (28U) +#define USBFS_DIEPCTL4_SETD0PID (0x10000000UL) +#define USBFS_DIEPCTL4_SETD1PID_POS (29U) +#define USBFS_DIEPCTL4_SETD1PID (0x20000000UL) +#define USBFS_DIEPCTL4_EPDIS_POS (30U) +#define USBFS_DIEPCTL4_EPDIS (0x40000000UL) +#define USBFS_DIEPCTL4_EPENA_POS (31U) +#define USBFS_DIEPCTL4_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DIEPINT4 register */ +#define USBFS_DIEPINT4_XFERCOMPL_POS (0U) +#define USBFS_DIEPINT4_XFERCOMPL (0x00000001UL) +#define USBFS_DIEPINT4_EPDISBLD_POS (1U) +#define USBFS_DIEPINT4_EPDISBLD (0x00000002UL) +#define USBFS_DIEPINT4_AHBERR_POS (2U) +#define USBFS_DIEPINT4_AHBERR (0x00000004UL) +#define USBFS_DIEPINT4_TIMEOUT_POS (3U) +#define USBFS_DIEPINT4_TIMEOUT (0x00000008UL) +#define USBFS_DIEPINT4_INTKNTXFEMP_POS (4U) +#define USBFS_DIEPINT4_INTKNTXFEMP (0x00000010UL) +#define USBFS_DIEPINT4_INTKNEPMIS_POS (5U) +#define USBFS_DIEPINT4_INTKNEPMIS (0x00000020UL) +#define USBFS_DIEPINT4_INEPNAKEFF_POS (6U) +#define USBFS_DIEPINT4_INEPNAKEFF (0x00000040UL) +#define USBFS_DIEPINT4_TXFEMP_POS (7U) +#define USBFS_DIEPINT4_TXFEMP (0x00000080UL) +#define USBFS_DIEPINT4_TXFIFOUNDRN_POS (8U) +#define USBFS_DIEPINT4_TXFIFOUNDRN (0x00000100UL) +#define USBFS_DIEPINT4_BNAINTR_POS (9U) +#define USBFS_DIEPINT4_BNAINTR (0x00000200UL) +#define USBFS_DIEPINT4_PKTDRPSTS_POS (11U) +#define USBFS_DIEPINT4_PKTDRPSTS (0x00000800UL) +#define USBFS_DIEPINT4_BBLEERR_POS (12U) +#define USBFS_DIEPINT4_BBLEERR (0x00001000UL) +#define USBFS_DIEPINT4_NAKINTRPT_POS (13U) +#define USBFS_DIEPINT4_NAKINTRPT (0x00002000UL) +#define USBFS_DIEPINT4_NYETINTRPT_POS (14U) +#define USBFS_DIEPINT4_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBFS_DIEPTSIZ4 register */ +#define USBFS_DIEPTSIZ4_XFERSIZE_POS (0U) +#define USBFS_DIEPTSIZ4_XFERSIZE (0x0007FFFFUL) +#define USBFS_DIEPTSIZ4_PKTCNT_POS (19U) +#define USBFS_DIEPTSIZ4_PKTCNT (0x1FF80000UL) +#define USBFS_DIEPTSIZ4_MC_POS (29U) +#define USBFS_DIEPTSIZ4_MC (0x60000000UL) + +/* Bit definition for USBFS_DIEPDMA4 register */ +#define USBFS_DIEPDMA4 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DTXFSTS4 register */ +#define USBFS_DTXFSTS4_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBFS_DIEPCTL5 register */ +#define USBFS_DIEPCTL5_MPS_POS (0U) +#define USBFS_DIEPCTL5_MPS (0x000007FFUL) +#define USBFS_DIEPCTL5_USBACTEP_POS (15U) +#define USBFS_DIEPCTL5_USBACTEP (0x00008000UL) +#define USBFS_DIEPCTL5_DPID_POS (16U) +#define USBFS_DIEPCTL5_DPID (0x00010000UL) +#define USBFS_DIEPCTL5_NAKSTS_POS (17U) +#define USBFS_DIEPCTL5_NAKSTS (0x00020000UL) +#define USBFS_DIEPCTL5_EPTYPE_POS (18U) +#define USBFS_DIEPCTL5_EPTYPE (0x000C0000UL) +#define USBFS_DIEPCTL5_EPTYPE_0 (0x00040000UL) +#define USBFS_DIEPCTL5_EPTYPE_1 (0x00080000UL) +#define USBFS_DIEPCTL5_STALL_POS (21U) +#define USBFS_DIEPCTL5_STALL (0x00200000UL) +#define USBFS_DIEPCTL5_TXFNUM_POS (22U) +#define USBFS_DIEPCTL5_TXFNUM (0x03C00000UL) +#define USBFS_DIEPCTL5_CNAK_POS (26U) +#define USBFS_DIEPCTL5_CNAK (0x04000000UL) +#define USBFS_DIEPCTL5_SNAK_POS (27U) +#define USBFS_DIEPCTL5_SNAK (0x08000000UL) +#define USBFS_DIEPCTL5_SETD0PID_POS (28U) +#define USBFS_DIEPCTL5_SETD0PID (0x10000000UL) +#define USBFS_DIEPCTL5_SETD1PID_POS (29U) +#define USBFS_DIEPCTL5_SETD1PID (0x20000000UL) +#define USBFS_DIEPCTL5_EPDIS_POS (30U) +#define USBFS_DIEPCTL5_EPDIS (0x40000000UL) +#define USBFS_DIEPCTL5_EPENA_POS (31U) +#define USBFS_DIEPCTL5_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DIEPINT5 register */ +#define USBFS_DIEPINT5_XFERCOMPL_POS (0U) +#define USBFS_DIEPINT5_XFERCOMPL (0x00000001UL) +#define USBFS_DIEPINT5_EPDISBLD_POS (1U) +#define USBFS_DIEPINT5_EPDISBLD (0x00000002UL) +#define USBFS_DIEPINT5_AHBERR_POS (2U) +#define USBFS_DIEPINT5_AHBERR (0x00000004UL) +#define USBFS_DIEPINT5_TIMEOUT_POS (3U) +#define USBFS_DIEPINT5_TIMEOUT (0x00000008UL) +#define USBFS_DIEPINT5_INTKNTXFEMP_POS (4U) +#define USBFS_DIEPINT5_INTKNTXFEMP (0x00000010UL) +#define USBFS_DIEPINT5_INTKNEPMIS_POS (5U) +#define USBFS_DIEPINT5_INTKNEPMIS (0x00000020UL) +#define USBFS_DIEPINT5_INEPNAKEFF_POS (6U) +#define USBFS_DIEPINT5_INEPNAKEFF (0x00000040UL) +#define USBFS_DIEPINT5_TXFEMP_POS (7U) +#define USBFS_DIEPINT5_TXFEMP (0x00000080UL) +#define USBFS_DIEPINT5_TXFIFOUNDRN_POS (8U) +#define USBFS_DIEPINT5_TXFIFOUNDRN (0x00000100UL) +#define USBFS_DIEPINT5_BNAINTR_POS (9U) +#define USBFS_DIEPINT5_BNAINTR (0x00000200UL) +#define USBFS_DIEPINT5_PKTDRPSTS_POS (11U) +#define USBFS_DIEPINT5_PKTDRPSTS (0x00000800UL) +#define USBFS_DIEPINT5_BBLEERR_POS (12U) +#define USBFS_DIEPINT5_BBLEERR (0x00001000UL) +#define USBFS_DIEPINT5_NAKINTRPT_POS (13U) +#define USBFS_DIEPINT5_NAKINTRPT (0x00002000UL) +#define USBFS_DIEPINT5_NYETINTRPT_POS (14U) +#define USBFS_DIEPINT5_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBFS_DIEPTSIZ5 register */ +#define USBFS_DIEPTSIZ5_XFERSIZE_POS (0U) +#define USBFS_DIEPTSIZ5_XFERSIZE (0x0007FFFFUL) +#define USBFS_DIEPTSIZ5_PKTCNT_POS (19U) +#define USBFS_DIEPTSIZ5_PKTCNT (0x1FF80000UL) +#define USBFS_DIEPTSIZ5_MC_POS (29U) +#define USBFS_DIEPTSIZ5_MC (0x60000000UL) + +/* Bit definition for USBFS_DIEPDMA5 register */ +#define USBFS_DIEPDMA5 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DTXFSTS5 register */ +#define USBFS_DTXFSTS5_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBFS_DIEPCTL6 register */ +#define USBFS_DIEPCTL6_MPS_POS (0U) +#define USBFS_DIEPCTL6_MPS (0x000007FFUL) +#define USBFS_DIEPCTL6_USBACTEP_POS (15U) +#define USBFS_DIEPCTL6_USBACTEP (0x00008000UL) +#define USBFS_DIEPCTL6_DPID_POS (16U) +#define USBFS_DIEPCTL6_DPID (0x00010000UL) +#define USBFS_DIEPCTL6_NAKSTS_POS (17U) +#define USBFS_DIEPCTL6_NAKSTS (0x00020000UL) +#define USBFS_DIEPCTL6_EPTYPE_POS (18U) +#define USBFS_DIEPCTL6_EPTYPE (0x000C0000UL) +#define USBFS_DIEPCTL6_EPTYPE_0 (0x00040000UL) +#define USBFS_DIEPCTL6_EPTYPE_1 (0x00080000UL) +#define USBFS_DIEPCTL6_STALL_POS (21U) +#define USBFS_DIEPCTL6_STALL (0x00200000UL) +#define USBFS_DIEPCTL6_TXFNUM_POS (22U) +#define USBFS_DIEPCTL6_TXFNUM (0x03C00000UL) +#define USBFS_DIEPCTL6_CNAK_POS (26U) +#define USBFS_DIEPCTL6_CNAK (0x04000000UL) +#define USBFS_DIEPCTL6_SNAK_POS (27U) +#define USBFS_DIEPCTL6_SNAK (0x08000000UL) +#define USBFS_DIEPCTL6_SETD0PID_POS (28U) +#define USBFS_DIEPCTL6_SETD0PID (0x10000000UL) +#define USBFS_DIEPCTL6_SETD1PID_POS (29U) +#define USBFS_DIEPCTL6_SETD1PID (0x20000000UL) +#define USBFS_DIEPCTL6_EPDIS_POS (30U) +#define USBFS_DIEPCTL6_EPDIS (0x40000000UL) +#define USBFS_DIEPCTL6_EPENA_POS (31U) +#define USBFS_DIEPCTL6_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DIEPINT6 register */ +#define USBFS_DIEPINT6_XFERCOMPL_POS (0U) +#define USBFS_DIEPINT6_XFERCOMPL (0x00000001UL) +#define USBFS_DIEPINT6_EPDISBLD_POS (1U) +#define USBFS_DIEPINT6_EPDISBLD (0x00000002UL) +#define USBFS_DIEPINT6_AHBERR_POS (2U) +#define USBFS_DIEPINT6_AHBERR (0x00000004UL) +#define USBFS_DIEPINT6_TIMEOUT_POS (3U) +#define USBFS_DIEPINT6_TIMEOUT (0x00000008UL) +#define USBFS_DIEPINT6_INTKNTXFEMP_POS (4U) +#define USBFS_DIEPINT6_INTKNTXFEMP (0x00000010UL) +#define USBFS_DIEPINT6_INTKNEPMIS_POS (5U) +#define USBFS_DIEPINT6_INTKNEPMIS (0x00000020UL) +#define USBFS_DIEPINT6_INEPNAKEFF_POS (6U) +#define USBFS_DIEPINT6_INEPNAKEFF (0x00000040UL) +#define USBFS_DIEPINT6_TXFEMP_POS (7U) +#define USBFS_DIEPINT6_TXFEMP (0x00000080UL) +#define USBFS_DIEPINT6_TXFIFOUNDRN_POS (8U) +#define USBFS_DIEPINT6_TXFIFOUNDRN (0x00000100UL) +#define USBFS_DIEPINT6_BNAINTR_POS (9U) +#define USBFS_DIEPINT6_BNAINTR (0x00000200UL) +#define USBFS_DIEPINT6_PKTDRPSTS_POS (11U) +#define USBFS_DIEPINT6_PKTDRPSTS (0x00000800UL) +#define USBFS_DIEPINT6_BBLEERR_POS (12U) +#define USBFS_DIEPINT6_BBLEERR (0x00001000UL) +#define USBFS_DIEPINT6_NAKINTRPT_POS (13U) +#define USBFS_DIEPINT6_NAKINTRPT (0x00002000UL) +#define USBFS_DIEPINT6_NYETINTRPT_POS (14U) +#define USBFS_DIEPINT6_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBFS_DIEPTSIZ6 register */ +#define USBFS_DIEPTSIZ6_XFERSIZE_POS (0U) +#define USBFS_DIEPTSIZ6_XFERSIZE (0x0007FFFFUL) +#define USBFS_DIEPTSIZ6_PKTCNT_POS (19U) +#define USBFS_DIEPTSIZ6_PKTCNT (0x1FF80000UL) +#define USBFS_DIEPTSIZ6_MC_POS (29U) +#define USBFS_DIEPTSIZ6_MC (0x60000000UL) + +/* Bit definition for USBFS_DIEPDMA6 register */ +#define USBFS_DIEPDMA6 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DTXFSTS6 register */ +#define USBFS_DTXFSTS6_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBFS_DIEPCTL7 register */ +#define USBFS_DIEPCTL7_MPS_POS (0U) +#define USBFS_DIEPCTL7_MPS (0x000007FFUL) +#define USBFS_DIEPCTL7_USBACTEP_POS (15U) +#define USBFS_DIEPCTL7_USBACTEP (0x00008000UL) +#define USBFS_DIEPCTL7_DPID_POS (16U) +#define USBFS_DIEPCTL7_DPID (0x00010000UL) +#define USBFS_DIEPCTL7_NAKSTS_POS (17U) +#define USBFS_DIEPCTL7_NAKSTS (0x00020000UL) +#define USBFS_DIEPCTL7_EPTYPE_POS (18U) +#define USBFS_DIEPCTL7_EPTYPE (0x000C0000UL) +#define USBFS_DIEPCTL7_EPTYPE_0 (0x00040000UL) +#define USBFS_DIEPCTL7_EPTYPE_1 (0x00080000UL) +#define USBFS_DIEPCTL7_STALL_POS (21U) +#define USBFS_DIEPCTL7_STALL (0x00200000UL) +#define USBFS_DIEPCTL7_TXFNUM_POS (22U) +#define USBFS_DIEPCTL7_TXFNUM (0x03C00000UL) +#define USBFS_DIEPCTL7_CNAK_POS (26U) +#define USBFS_DIEPCTL7_CNAK (0x04000000UL) +#define USBFS_DIEPCTL7_SNAK_POS (27U) +#define USBFS_DIEPCTL7_SNAK (0x08000000UL) +#define USBFS_DIEPCTL7_SETD0PID_POS (28U) +#define USBFS_DIEPCTL7_SETD0PID (0x10000000UL) +#define USBFS_DIEPCTL7_SETD1PID_POS (29U) +#define USBFS_DIEPCTL7_SETD1PID (0x20000000UL) +#define USBFS_DIEPCTL7_EPDIS_POS (30U) +#define USBFS_DIEPCTL7_EPDIS (0x40000000UL) +#define USBFS_DIEPCTL7_EPENA_POS (31U) +#define USBFS_DIEPCTL7_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DIEPINT7 register */ +#define USBFS_DIEPINT7_XFERCOMPL_POS (0U) +#define USBFS_DIEPINT7_XFERCOMPL (0x00000001UL) +#define USBFS_DIEPINT7_EPDISBLD_POS (1U) +#define USBFS_DIEPINT7_EPDISBLD (0x00000002UL) +#define USBFS_DIEPINT7_AHBERR_POS (2U) +#define USBFS_DIEPINT7_AHBERR (0x00000004UL) +#define USBFS_DIEPINT7_TIMEOUT_POS (3U) +#define USBFS_DIEPINT7_TIMEOUT (0x00000008UL) +#define USBFS_DIEPINT7_INTKNTXFEMP_POS (4U) +#define USBFS_DIEPINT7_INTKNTXFEMP (0x00000010UL) +#define USBFS_DIEPINT7_INTKNEPMIS_POS (5U) +#define USBFS_DIEPINT7_INTKNEPMIS (0x00000020UL) +#define USBFS_DIEPINT7_INEPNAKEFF_POS (6U) +#define USBFS_DIEPINT7_INEPNAKEFF (0x00000040UL) +#define USBFS_DIEPINT7_TXFEMP_POS (7U) +#define USBFS_DIEPINT7_TXFEMP (0x00000080UL) +#define USBFS_DIEPINT7_TXFIFOUNDRN_POS (8U) +#define USBFS_DIEPINT7_TXFIFOUNDRN (0x00000100UL) +#define USBFS_DIEPINT7_BNAINTR_POS (9U) +#define USBFS_DIEPINT7_BNAINTR (0x00000200UL) +#define USBFS_DIEPINT7_PKTDRPSTS_POS (11U) +#define USBFS_DIEPINT7_PKTDRPSTS (0x00000800UL) +#define USBFS_DIEPINT7_BBLEERR_POS (12U) +#define USBFS_DIEPINT7_BBLEERR (0x00001000UL) +#define USBFS_DIEPINT7_NAKINTRPT_POS (13U) +#define USBFS_DIEPINT7_NAKINTRPT (0x00002000UL) +#define USBFS_DIEPINT7_NYETINTRPT_POS (14U) +#define USBFS_DIEPINT7_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBFS_DIEPTSIZ7 register */ +#define USBFS_DIEPTSIZ7_XFERSIZE_POS (0U) +#define USBFS_DIEPTSIZ7_XFERSIZE (0x0007FFFFUL) +#define USBFS_DIEPTSIZ7_PKTCNT_POS (19U) +#define USBFS_DIEPTSIZ7_PKTCNT (0x1FF80000UL) +#define USBFS_DIEPTSIZ7_MC_POS (29U) +#define USBFS_DIEPTSIZ7_MC (0x60000000UL) + +/* Bit definition for USBFS_DIEPDMA7 register */ +#define USBFS_DIEPDMA7 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DTXFSTS7 register */ +#define USBFS_DTXFSTS7_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBFS_DIEPCTL8 register */ +#define USBFS_DIEPCTL8_MPS_POS (0U) +#define USBFS_DIEPCTL8_MPS (0x000007FFUL) +#define USBFS_DIEPCTL8_USBACTEP_POS (15U) +#define USBFS_DIEPCTL8_USBACTEP (0x00008000UL) +#define USBFS_DIEPCTL8_DPID_POS (16U) +#define USBFS_DIEPCTL8_DPID (0x00010000UL) +#define USBFS_DIEPCTL8_NAKSTS_POS (17U) +#define USBFS_DIEPCTL8_NAKSTS (0x00020000UL) +#define USBFS_DIEPCTL8_EPTYPE_POS (18U) +#define USBFS_DIEPCTL8_EPTYPE (0x000C0000UL) +#define USBFS_DIEPCTL8_EPTYPE_0 (0x00040000UL) +#define USBFS_DIEPCTL8_EPTYPE_1 (0x00080000UL) +#define USBFS_DIEPCTL8_STALL_POS (21U) +#define USBFS_DIEPCTL8_STALL (0x00200000UL) +#define USBFS_DIEPCTL8_TXFNUM_POS (22U) +#define USBFS_DIEPCTL8_TXFNUM (0x03C00000UL) +#define USBFS_DIEPCTL8_CNAK_POS (26U) +#define USBFS_DIEPCTL8_CNAK (0x04000000UL) +#define USBFS_DIEPCTL8_SNAK_POS (27U) +#define USBFS_DIEPCTL8_SNAK (0x08000000UL) +#define USBFS_DIEPCTL8_SETD0PID_POS (28U) +#define USBFS_DIEPCTL8_SETD0PID (0x10000000UL) +#define USBFS_DIEPCTL8_SETD1PID_POS (29U) +#define USBFS_DIEPCTL8_SETD1PID (0x20000000UL) +#define USBFS_DIEPCTL8_EPDIS_POS (30U) +#define USBFS_DIEPCTL8_EPDIS (0x40000000UL) +#define USBFS_DIEPCTL8_EPENA_POS (31U) +#define USBFS_DIEPCTL8_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DIEPINT8 register */ +#define USBFS_DIEPINT8_XFERCOMPL_POS (0U) +#define USBFS_DIEPINT8_XFERCOMPL (0x00000001UL) +#define USBFS_DIEPINT8_EPDISBLD_POS (1U) +#define USBFS_DIEPINT8_EPDISBLD (0x00000002UL) +#define USBFS_DIEPINT8_AHBERR_POS (2U) +#define USBFS_DIEPINT8_AHBERR (0x00000004UL) +#define USBFS_DIEPINT8_TIMEOUT_POS (3U) +#define USBFS_DIEPINT8_TIMEOUT (0x00000008UL) +#define USBFS_DIEPINT8_INTKNTXFEMP_POS (4U) +#define USBFS_DIEPINT8_INTKNTXFEMP (0x00000010UL) +#define USBFS_DIEPINT8_INTKNEPMIS_POS (5U) +#define USBFS_DIEPINT8_INTKNEPMIS (0x00000020UL) +#define USBFS_DIEPINT8_INEPNAKEFF_POS (6U) +#define USBFS_DIEPINT8_INEPNAKEFF (0x00000040UL) +#define USBFS_DIEPINT8_TXFEMP_POS (7U) +#define USBFS_DIEPINT8_TXFEMP (0x00000080UL) +#define USBFS_DIEPINT8_TXFIFOUNDRN_POS (8U) +#define USBFS_DIEPINT8_TXFIFOUNDRN (0x00000100UL) +#define USBFS_DIEPINT8_BNAINTR_POS (9U) +#define USBFS_DIEPINT8_BNAINTR (0x00000200UL) +#define USBFS_DIEPINT8_PKTDRPSTS_POS (11U) +#define USBFS_DIEPINT8_PKTDRPSTS (0x00000800UL) +#define USBFS_DIEPINT8_BBLEERR_POS (12U) +#define USBFS_DIEPINT8_BBLEERR (0x00001000UL) +#define USBFS_DIEPINT8_NAKINTRPT_POS (13U) +#define USBFS_DIEPINT8_NAKINTRPT (0x00002000UL) +#define USBFS_DIEPINT8_NYETINTRPT_POS (14U) +#define USBFS_DIEPINT8_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBFS_DIEPTSIZ8 register */ +#define USBFS_DIEPTSIZ8_XFERSIZE_POS (0U) +#define USBFS_DIEPTSIZ8_XFERSIZE (0x0007FFFFUL) +#define USBFS_DIEPTSIZ8_PKTCNT_POS (19U) +#define USBFS_DIEPTSIZ8_PKTCNT (0x1FF80000UL) +#define USBFS_DIEPTSIZ8_MC_POS (29U) +#define USBFS_DIEPTSIZ8_MC (0x60000000UL) + +/* Bit definition for USBFS_DIEPDMA8 register */ +#define USBFS_DIEPDMA8 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DTXFSTS8 register */ +#define USBFS_DTXFSTS8_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBFS_DIEPCTL9 register */ +#define USBFS_DIEPCTL9_MPS_POS (0U) +#define USBFS_DIEPCTL9_MPS (0x000007FFUL) +#define USBFS_DIEPCTL9_USBACTEP_POS (15U) +#define USBFS_DIEPCTL9_USBACTEP (0x00008000UL) +#define USBFS_DIEPCTL9_DPID_POS (16U) +#define USBFS_DIEPCTL9_DPID (0x00010000UL) +#define USBFS_DIEPCTL9_NAKSTS_POS (17U) +#define USBFS_DIEPCTL9_NAKSTS (0x00020000UL) +#define USBFS_DIEPCTL9_EPTYPE_POS (18U) +#define USBFS_DIEPCTL9_EPTYPE (0x000C0000UL) +#define USBFS_DIEPCTL9_EPTYPE_0 (0x00040000UL) +#define USBFS_DIEPCTL9_EPTYPE_1 (0x00080000UL) +#define USBFS_DIEPCTL9_STALL_POS (21U) +#define USBFS_DIEPCTL9_STALL (0x00200000UL) +#define USBFS_DIEPCTL9_TXFNUM_POS (22U) +#define USBFS_DIEPCTL9_TXFNUM (0x03C00000UL) +#define USBFS_DIEPCTL9_CNAK_POS (26U) +#define USBFS_DIEPCTL9_CNAK (0x04000000UL) +#define USBFS_DIEPCTL9_SNAK_POS (27U) +#define USBFS_DIEPCTL9_SNAK (0x08000000UL) +#define USBFS_DIEPCTL9_SETD0PID_POS (28U) +#define USBFS_DIEPCTL9_SETD0PID (0x10000000UL) +#define USBFS_DIEPCTL9_SETD1PID_POS (29U) +#define USBFS_DIEPCTL9_SETD1PID (0x20000000UL) +#define USBFS_DIEPCTL9_EPDIS_POS (30U) +#define USBFS_DIEPCTL9_EPDIS (0x40000000UL) +#define USBFS_DIEPCTL9_EPENA_POS (31U) +#define USBFS_DIEPCTL9_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DIEPINT9 register */ +#define USBFS_DIEPINT9_XFERCOMPL_POS (0U) +#define USBFS_DIEPINT9_XFERCOMPL (0x00000001UL) +#define USBFS_DIEPINT9_EPDISBLD_POS (1U) +#define USBFS_DIEPINT9_EPDISBLD (0x00000002UL) +#define USBFS_DIEPINT9_AHBERR_POS (2U) +#define USBFS_DIEPINT9_AHBERR (0x00000004UL) +#define USBFS_DIEPINT9_TIMEOUT_POS (3U) +#define USBFS_DIEPINT9_TIMEOUT (0x00000008UL) +#define USBFS_DIEPINT9_INTKNTXFEMP_POS (4U) +#define USBFS_DIEPINT9_INTKNTXFEMP (0x00000010UL) +#define USBFS_DIEPINT9_INTKNEPMIS_POS (5U) +#define USBFS_DIEPINT9_INTKNEPMIS (0x00000020UL) +#define USBFS_DIEPINT9_INEPNAKEFF_POS (6U) +#define USBFS_DIEPINT9_INEPNAKEFF (0x00000040UL) +#define USBFS_DIEPINT9_TXFEMP_POS (7U) +#define USBFS_DIEPINT9_TXFEMP (0x00000080UL) +#define USBFS_DIEPINT9_TXFIFOUNDRN_POS (8U) +#define USBFS_DIEPINT9_TXFIFOUNDRN (0x00000100UL) +#define USBFS_DIEPINT9_BNAINTR_POS (9U) +#define USBFS_DIEPINT9_BNAINTR (0x00000200UL) +#define USBFS_DIEPINT9_PKTDRPSTS_POS (11U) +#define USBFS_DIEPINT9_PKTDRPSTS (0x00000800UL) +#define USBFS_DIEPINT9_BBLEERR_POS (12U) +#define USBFS_DIEPINT9_BBLEERR (0x00001000UL) +#define USBFS_DIEPINT9_NAKINTRPT_POS (13U) +#define USBFS_DIEPINT9_NAKINTRPT (0x00002000UL) +#define USBFS_DIEPINT9_NYETINTRPT_POS (14U) +#define USBFS_DIEPINT9_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBFS_DIEPTSIZ9 register */ +#define USBFS_DIEPTSIZ9_XFERSIZE_POS (0U) +#define USBFS_DIEPTSIZ9_XFERSIZE (0x0007FFFFUL) +#define USBFS_DIEPTSIZ9_PKTCNT_POS (19U) +#define USBFS_DIEPTSIZ9_PKTCNT (0x1FF80000UL) +#define USBFS_DIEPTSIZ9_MC_POS (29U) +#define USBFS_DIEPTSIZ9_MC (0x60000000UL) + +/* Bit definition for USBFS_DIEPDMA9 register */ +#define USBFS_DIEPDMA9 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DTXFSTS9 register */ +#define USBFS_DTXFSTS9_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBFS_DIEPCTL10 register */ +#define USBFS_DIEPCTL10_MPS_POS (0U) +#define USBFS_DIEPCTL10_MPS (0x000007FFUL) +#define USBFS_DIEPCTL10_USBACTEP_POS (15U) +#define USBFS_DIEPCTL10_USBACTEP (0x00008000UL) +#define USBFS_DIEPCTL10_DPID_POS (16U) +#define USBFS_DIEPCTL10_DPID (0x00010000UL) +#define USBFS_DIEPCTL10_NAKSTS_POS (17U) +#define USBFS_DIEPCTL10_NAKSTS (0x00020000UL) +#define USBFS_DIEPCTL10_EPTYPE_POS (18U) +#define USBFS_DIEPCTL10_EPTYPE (0x000C0000UL) +#define USBFS_DIEPCTL10_EPTYPE_0 (0x00040000UL) +#define USBFS_DIEPCTL10_EPTYPE_1 (0x00080000UL) +#define USBFS_DIEPCTL10_STALL_POS (21U) +#define USBFS_DIEPCTL10_STALL (0x00200000UL) +#define USBFS_DIEPCTL10_TXFNUM_POS (22U) +#define USBFS_DIEPCTL10_TXFNUM (0x03C00000UL) +#define USBFS_DIEPCTL10_CNAK_POS (26U) +#define USBFS_DIEPCTL10_CNAK (0x04000000UL) +#define USBFS_DIEPCTL10_SNAK_POS (27U) +#define USBFS_DIEPCTL10_SNAK (0x08000000UL) +#define USBFS_DIEPCTL10_SETD0PID_POS (28U) +#define USBFS_DIEPCTL10_SETD0PID (0x10000000UL) +#define USBFS_DIEPCTL10_SETD1PID_POS (29U) +#define USBFS_DIEPCTL10_SETD1PID (0x20000000UL) +#define USBFS_DIEPCTL10_EPDIS_POS (30U) +#define USBFS_DIEPCTL10_EPDIS (0x40000000UL) +#define USBFS_DIEPCTL10_EPENA_POS (31U) +#define USBFS_DIEPCTL10_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DIEPINT10 register */ +#define USBFS_DIEPINT10_XFERCOMPL_POS (0U) +#define USBFS_DIEPINT10_XFERCOMPL (0x00000001UL) +#define USBFS_DIEPINT10_EPDISBLD_POS (1U) +#define USBFS_DIEPINT10_EPDISBLD (0x00000002UL) +#define USBFS_DIEPINT10_AHBERR_POS (2U) +#define USBFS_DIEPINT10_AHBERR (0x00000004UL) +#define USBFS_DIEPINT10_TIMEOUT_POS (3U) +#define USBFS_DIEPINT10_TIMEOUT (0x00000008UL) +#define USBFS_DIEPINT10_INTKNTXFEMP_POS (4U) +#define USBFS_DIEPINT10_INTKNTXFEMP (0x00000010UL) +#define USBFS_DIEPINT10_INTKNEPMIS_POS (5U) +#define USBFS_DIEPINT10_INTKNEPMIS (0x00000020UL) +#define USBFS_DIEPINT10_INEPNAKEFF_POS (6U) +#define USBFS_DIEPINT10_INEPNAKEFF (0x00000040UL) +#define USBFS_DIEPINT10_TXFEMP_POS (7U) +#define USBFS_DIEPINT10_TXFEMP (0x00000080UL) +#define USBFS_DIEPINT10_TXFIFOUNDRN_POS (8U) +#define USBFS_DIEPINT10_TXFIFOUNDRN (0x00000100UL) +#define USBFS_DIEPINT10_BNAINTR_POS (9U) +#define USBFS_DIEPINT10_BNAINTR (0x00000200UL) +#define USBFS_DIEPINT10_PKTDRPSTS_POS (11U) +#define USBFS_DIEPINT10_PKTDRPSTS (0x00000800UL) +#define USBFS_DIEPINT10_BBLEERR_POS (12U) +#define USBFS_DIEPINT10_BBLEERR (0x00001000UL) +#define USBFS_DIEPINT10_NAKINTRPT_POS (13U) +#define USBFS_DIEPINT10_NAKINTRPT (0x00002000UL) +#define USBFS_DIEPINT10_NYETINTRPT_POS (14U) +#define USBFS_DIEPINT10_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBFS_DIEPTSIZ10 register */ +#define USBFS_DIEPTSIZ10_XFERSIZE_POS (0U) +#define USBFS_DIEPTSIZ10_XFERSIZE (0x0007FFFFUL) +#define USBFS_DIEPTSIZ10_PKTCNT_POS (19U) +#define USBFS_DIEPTSIZ10_PKTCNT (0x1FF80000UL) +#define USBFS_DIEPTSIZ10_MC_POS (29U) +#define USBFS_DIEPTSIZ10_MC (0x60000000UL) + +/* Bit definition for USBFS_DIEPDMA10 register */ +#define USBFS_DIEPDMA10 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DTXFSTS10 register */ +#define USBFS_DTXFSTS10_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBFS_DIEPCTL11 register */ +#define USBFS_DIEPCTL11_MPS_POS (0U) +#define USBFS_DIEPCTL11_MPS (0x000007FFUL) +#define USBFS_DIEPCTL11_USBACTEP_POS (15U) +#define USBFS_DIEPCTL11_USBACTEP (0x00008000UL) +#define USBFS_DIEPCTL11_DPID_POS (16U) +#define USBFS_DIEPCTL11_DPID (0x00010000UL) +#define USBFS_DIEPCTL11_NAKSTS_POS (17U) +#define USBFS_DIEPCTL11_NAKSTS (0x00020000UL) +#define USBFS_DIEPCTL11_EPTYPE_POS (18U) +#define USBFS_DIEPCTL11_EPTYPE (0x000C0000UL) +#define USBFS_DIEPCTL11_EPTYPE_0 (0x00040000UL) +#define USBFS_DIEPCTL11_EPTYPE_1 (0x00080000UL) +#define USBFS_DIEPCTL11_STALL_POS (21U) +#define USBFS_DIEPCTL11_STALL (0x00200000UL) +#define USBFS_DIEPCTL11_TXFNUM_POS (22U) +#define USBFS_DIEPCTL11_TXFNUM (0x03C00000UL) +#define USBFS_DIEPCTL11_CNAK_POS (26U) +#define USBFS_DIEPCTL11_CNAK (0x04000000UL) +#define USBFS_DIEPCTL11_SNAK_POS (27U) +#define USBFS_DIEPCTL11_SNAK (0x08000000UL) +#define USBFS_DIEPCTL11_SETD0PID_POS (28U) +#define USBFS_DIEPCTL11_SETD0PID (0x10000000UL) +#define USBFS_DIEPCTL11_SETD1PID_POS (29U) +#define USBFS_DIEPCTL11_SETD1PID (0x20000000UL) +#define USBFS_DIEPCTL11_EPDIS_POS (30U) +#define USBFS_DIEPCTL11_EPDIS (0x40000000UL) +#define USBFS_DIEPCTL11_EPENA_POS (31U) +#define USBFS_DIEPCTL11_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DIEPINT11 register */ +#define USBFS_DIEPINT11_XFERCOMPL_POS (0U) +#define USBFS_DIEPINT11_XFERCOMPL (0x00000001UL) +#define USBFS_DIEPINT11_EPDISBLD_POS (1U) +#define USBFS_DIEPINT11_EPDISBLD (0x00000002UL) +#define USBFS_DIEPINT11_AHBERR_POS (2U) +#define USBFS_DIEPINT11_AHBERR (0x00000004UL) +#define USBFS_DIEPINT11_TIMEOUT_POS (3U) +#define USBFS_DIEPINT11_TIMEOUT (0x00000008UL) +#define USBFS_DIEPINT11_INTKNTXFEMP_POS (4U) +#define USBFS_DIEPINT11_INTKNTXFEMP (0x00000010UL) +#define USBFS_DIEPINT11_INTKNEPMIS_POS (5U) +#define USBFS_DIEPINT11_INTKNEPMIS (0x00000020UL) +#define USBFS_DIEPINT11_INEPNAKEFF_POS (6U) +#define USBFS_DIEPINT11_INEPNAKEFF (0x00000040UL) +#define USBFS_DIEPINT11_TXFEMP_POS (7U) +#define USBFS_DIEPINT11_TXFEMP (0x00000080UL) +#define USBFS_DIEPINT11_TXFIFOUNDRN_POS (8U) +#define USBFS_DIEPINT11_TXFIFOUNDRN (0x00000100UL) +#define USBFS_DIEPINT11_BNAINTR_POS (9U) +#define USBFS_DIEPINT11_BNAINTR (0x00000200UL) +#define USBFS_DIEPINT11_PKTDRPSTS_POS (11U) +#define USBFS_DIEPINT11_PKTDRPSTS (0x00000800UL) +#define USBFS_DIEPINT11_BBLEERR_POS (12U) +#define USBFS_DIEPINT11_BBLEERR (0x00001000UL) +#define USBFS_DIEPINT11_NAKINTRPT_POS (13U) +#define USBFS_DIEPINT11_NAKINTRPT (0x00002000UL) +#define USBFS_DIEPINT11_NYETINTRPT_POS (14U) +#define USBFS_DIEPINT11_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBFS_DIEPTSIZ11 register */ +#define USBFS_DIEPTSIZ11_XFERSIZE_POS (0U) +#define USBFS_DIEPTSIZ11_XFERSIZE (0x0007FFFFUL) +#define USBFS_DIEPTSIZ11_PKTCNT_POS (19U) +#define USBFS_DIEPTSIZ11_PKTCNT (0x1FF80000UL) +#define USBFS_DIEPTSIZ11_MC_POS (29U) +#define USBFS_DIEPTSIZ11_MC (0x60000000UL) + +/* Bit definition for USBFS_DIEPDMA11 register */ +#define USBFS_DIEPDMA11 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DTXFSTS11 register */ +#define USBFS_DTXFSTS11_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBFS_DIEPCTL12 register */ +#define USBFS_DIEPCTL12_MPS_POS (0U) +#define USBFS_DIEPCTL12_MPS (0x000007FFUL) +#define USBFS_DIEPCTL12_USBACTEP_POS (15U) +#define USBFS_DIEPCTL12_USBACTEP (0x00008000UL) +#define USBFS_DIEPCTL12_DPID_POS (16U) +#define USBFS_DIEPCTL12_DPID (0x00010000UL) +#define USBFS_DIEPCTL12_NAKSTS_POS (17U) +#define USBFS_DIEPCTL12_NAKSTS (0x00020000UL) +#define USBFS_DIEPCTL12_EPTYPE_POS (18U) +#define USBFS_DIEPCTL12_EPTYPE (0x000C0000UL) +#define USBFS_DIEPCTL12_EPTYPE_0 (0x00040000UL) +#define USBFS_DIEPCTL12_EPTYPE_1 (0x00080000UL) +#define USBFS_DIEPCTL12_STALL_POS (21U) +#define USBFS_DIEPCTL12_STALL (0x00200000UL) +#define USBFS_DIEPCTL12_TXFNUM_POS (22U) +#define USBFS_DIEPCTL12_TXFNUM (0x03C00000UL) +#define USBFS_DIEPCTL12_CNAK_POS (26U) +#define USBFS_DIEPCTL12_CNAK (0x04000000UL) +#define USBFS_DIEPCTL12_SNAK_POS (27U) +#define USBFS_DIEPCTL12_SNAK (0x08000000UL) +#define USBFS_DIEPCTL12_SETD0PID_POS (28U) +#define USBFS_DIEPCTL12_SETD0PID (0x10000000UL) +#define USBFS_DIEPCTL12_SETD1PID_POS (29U) +#define USBFS_DIEPCTL12_SETD1PID (0x20000000UL) +#define USBFS_DIEPCTL12_EPDIS_POS (30U) +#define USBFS_DIEPCTL12_EPDIS (0x40000000UL) +#define USBFS_DIEPCTL12_EPENA_POS (31U) +#define USBFS_DIEPCTL12_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DIEPINT12 register */ +#define USBFS_DIEPINT12_XFERCOMPL_POS (0U) +#define USBFS_DIEPINT12_XFERCOMPL (0x00000001UL) +#define USBFS_DIEPINT12_EPDISBLD_POS (1U) +#define USBFS_DIEPINT12_EPDISBLD (0x00000002UL) +#define USBFS_DIEPINT12_AHBERR_POS (2U) +#define USBFS_DIEPINT12_AHBERR (0x00000004UL) +#define USBFS_DIEPINT12_TIMEOUT_POS (3U) +#define USBFS_DIEPINT12_TIMEOUT (0x00000008UL) +#define USBFS_DIEPINT12_INTKNTXFEMP_POS (4U) +#define USBFS_DIEPINT12_INTKNTXFEMP (0x00000010UL) +#define USBFS_DIEPINT12_INTKNEPMIS_POS (5U) +#define USBFS_DIEPINT12_INTKNEPMIS (0x00000020UL) +#define USBFS_DIEPINT12_INEPNAKEFF_POS (6U) +#define USBFS_DIEPINT12_INEPNAKEFF (0x00000040UL) +#define USBFS_DIEPINT12_TXFEMP_POS (7U) +#define USBFS_DIEPINT12_TXFEMP (0x00000080UL) +#define USBFS_DIEPINT12_TXFIFOUNDRN_POS (8U) +#define USBFS_DIEPINT12_TXFIFOUNDRN (0x00000100UL) +#define USBFS_DIEPINT12_BNAINTR_POS (9U) +#define USBFS_DIEPINT12_BNAINTR (0x00000200UL) +#define USBFS_DIEPINT12_PKTDRPSTS_POS (11U) +#define USBFS_DIEPINT12_PKTDRPSTS (0x00000800UL) +#define USBFS_DIEPINT12_BBLEERR_POS (12U) +#define USBFS_DIEPINT12_BBLEERR (0x00001000UL) +#define USBFS_DIEPINT12_NAKINTRPT_POS (13U) +#define USBFS_DIEPINT12_NAKINTRPT (0x00002000UL) +#define USBFS_DIEPINT12_NYETINTRPT_POS (14U) +#define USBFS_DIEPINT12_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBFS_DIEPTSIZ12 register */ +#define USBFS_DIEPTSIZ12_XFERSIZE_POS (0U) +#define USBFS_DIEPTSIZ12_XFERSIZE (0x0007FFFFUL) +#define USBFS_DIEPTSIZ12_PKTCNT_POS (19U) +#define USBFS_DIEPTSIZ12_PKTCNT (0x1FF80000UL) +#define USBFS_DIEPTSIZ12_MC_POS (29U) +#define USBFS_DIEPTSIZ12_MC (0x60000000UL) + +/* Bit definition for USBFS_DIEPDMA12 register */ +#define USBFS_DIEPDMA12 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DTXFSTS12 register */ +#define USBFS_DTXFSTS12_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBFS_DIEPCTL13 register */ +#define USBFS_DIEPCTL13_MPS_POS (0U) +#define USBFS_DIEPCTL13_MPS (0x000007FFUL) +#define USBFS_DIEPCTL13_USBACTEP_POS (15U) +#define USBFS_DIEPCTL13_USBACTEP (0x00008000UL) +#define USBFS_DIEPCTL13_DPID_POS (16U) +#define USBFS_DIEPCTL13_DPID (0x00010000UL) +#define USBFS_DIEPCTL13_NAKSTS_POS (17U) +#define USBFS_DIEPCTL13_NAKSTS (0x00020000UL) +#define USBFS_DIEPCTL13_EPTYPE_POS (18U) +#define USBFS_DIEPCTL13_EPTYPE (0x000C0000UL) +#define USBFS_DIEPCTL13_EPTYPE_0 (0x00040000UL) +#define USBFS_DIEPCTL13_EPTYPE_1 (0x00080000UL) +#define USBFS_DIEPCTL13_STALL_POS (21U) +#define USBFS_DIEPCTL13_STALL (0x00200000UL) +#define USBFS_DIEPCTL13_TXFNUM_POS (22U) +#define USBFS_DIEPCTL13_TXFNUM (0x03C00000UL) +#define USBFS_DIEPCTL13_CNAK_POS (26U) +#define USBFS_DIEPCTL13_CNAK (0x04000000UL) +#define USBFS_DIEPCTL13_SNAK_POS (27U) +#define USBFS_DIEPCTL13_SNAK (0x08000000UL) +#define USBFS_DIEPCTL13_SETD0PID_POS (28U) +#define USBFS_DIEPCTL13_SETD0PID (0x10000000UL) +#define USBFS_DIEPCTL13_SETD1PID_POS (29U) +#define USBFS_DIEPCTL13_SETD1PID (0x20000000UL) +#define USBFS_DIEPCTL13_EPDIS_POS (30U) +#define USBFS_DIEPCTL13_EPDIS (0x40000000UL) +#define USBFS_DIEPCTL13_EPENA_POS (31U) +#define USBFS_DIEPCTL13_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DIEPINT13 register */ +#define USBFS_DIEPINT13_XFERCOMPL_POS (0U) +#define USBFS_DIEPINT13_XFERCOMPL (0x00000001UL) +#define USBFS_DIEPINT13_EPDISBLD_POS (1U) +#define USBFS_DIEPINT13_EPDISBLD (0x00000002UL) +#define USBFS_DIEPINT13_AHBERR_POS (2U) +#define USBFS_DIEPINT13_AHBERR (0x00000004UL) +#define USBFS_DIEPINT13_TIMEOUT_POS (3U) +#define USBFS_DIEPINT13_TIMEOUT (0x00000008UL) +#define USBFS_DIEPINT13_INTKNTXFEMP_POS (4U) +#define USBFS_DIEPINT13_INTKNTXFEMP (0x00000010UL) +#define USBFS_DIEPINT13_INTKNEPMIS_POS (5U) +#define USBFS_DIEPINT13_INTKNEPMIS (0x00000020UL) +#define USBFS_DIEPINT13_INEPNAKEFF_POS (6U) +#define USBFS_DIEPINT13_INEPNAKEFF (0x00000040UL) +#define USBFS_DIEPINT13_TXFEMP_POS (7U) +#define USBFS_DIEPINT13_TXFEMP (0x00000080UL) +#define USBFS_DIEPINT13_TXFIFOUNDRN_POS (8U) +#define USBFS_DIEPINT13_TXFIFOUNDRN (0x00000100UL) +#define USBFS_DIEPINT13_BNAINTR_POS (9U) +#define USBFS_DIEPINT13_BNAINTR (0x00000200UL) +#define USBFS_DIEPINT13_PKTDRPSTS_POS (11U) +#define USBFS_DIEPINT13_PKTDRPSTS (0x00000800UL) +#define USBFS_DIEPINT13_BBLEERR_POS (12U) +#define USBFS_DIEPINT13_BBLEERR (0x00001000UL) +#define USBFS_DIEPINT13_NAKINTRPT_POS (13U) +#define USBFS_DIEPINT13_NAKINTRPT (0x00002000UL) +#define USBFS_DIEPINT13_NYETINTRPT_POS (14U) +#define USBFS_DIEPINT13_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBFS_DIEPTSIZ13 register */ +#define USBFS_DIEPTSIZ13_XFERSIZE_POS (0U) +#define USBFS_DIEPTSIZ13_XFERSIZE (0x0007FFFFUL) +#define USBFS_DIEPTSIZ13_PKTCNT_POS (19U) +#define USBFS_DIEPTSIZ13_PKTCNT (0x1FF80000UL) +#define USBFS_DIEPTSIZ13_MC_POS (29U) +#define USBFS_DIEPTSIZ13_MC (0x60000000UL) + +/* Bit definition for USBFS_DIEPDMA13 register */ +#define USBFS_DIEPDMA13 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DTXFSTS13 register */ +#define USBFS_DTXFSTS13_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBFS_DIEPCTL14 register */ +#define USBFS_DIEPCTL14_MPS_POS (0U) +#define USBFS_DIEPCTL14_MPS (0x000007FFUL) +#define USBFS_DIEPCTL14_USBACTEP_POS (15U) +#define USBFS_DIEPCTL14_USBACTEP (0x00008000UL) +#define USBFS_DIEPCTL14_DPID_POS (16U) +#define USBFS_DIEPCTL14_DPID (0x00010000UL) +#define USBFS_DIEPCTL14_NAKSTS_POS (17U) +#define USBFS_DIEPCTL14_NAKSTS (0x00020000UL) +#define USBFS_DIEPCTL14_EPTYPE_POS (18U) +#define USBFS_DIEPCTL14_EPTYPE (0x000C0000UL) +#define USBFS_DIEPCTL14_EPTYPE_0 (0x00040000UL) +#define USBFS_DIEPCTL14_EPTYPE_1 (0x00080000UL) +#define USBFS_DIEPCTL14_STALL_POS (21U) +#define USBFS_DIEPCTL14_STALL (0x00200000UL) +#define USBFS_DIEPCTL14_TXFNUM_POS (22U) +#define USBFS_DIEPCTL14_TXFNUM (0x03C00000UL) +#define USBFS_DIEPCTL14_CNAK_POS (26U) +#define USBFS_DIEPCTL14_CNAK (0x04000000UL) +#define USBFS_DIEPCTL14_SNAK_POS (27U) +#define USBFS_DIEPCTL14_SNAK (0x08000000UL) +#define USBFS_DIEPCTL14_SETD0PID_POS (28U) +#define USBFS_DIEPCTL14_SETD0PID (0x10000000UL) +#define USBFS_DIEPCTL14_SETD1PID_POS (29U) +#define USBFS_DIEPCTL14_SETD1PID (0x20000000UL) +#define USBFS_DIEPCTL14_EPDIS_POS (30U) +#define USBFS_DIEPCTL14_EPDIS (0x40000000UL) +#define USBFS_DIEPCTL14_EPENA_POS (31U) +#define USBFS_DIEPCTL14_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DIEPINT14 register */ +#define USBFS_DIEPINT14_XFERCOMPL_POS (0U) +#define USBFS_DIEPINT14_XFERCOMPL (0x00000001UL) +#define USBFS_DIEPINT14_EPDISBLD_POS (1U) +#define USBFS_DIEPINT14_EPDISBLD (0x00000002UL) +#define USBFS_DIEPINT14_AHBERR_POS (2U) +#define USBFS_DIEPINT14_AHBERR (0x00000004UL) +#define USBFS_DIEPINT14_TIMEOUT_POS (3U) +#define USBFS_DIEPINT14_TIMEOUT (0x00000008UL) +#define USBFS_DIEPINT14_INTKNTXFEMP_POS (4U) +#define USBFS_DIEPINT14_INTKNTXFEMP (0x00000010UL) +#define USBFS_DIEPINT14_INTKNEPMIS_POS (5U) +#define USBFS_DIEPINT14_INTKNEPMIS (0x00000020UL) +#define USBFS_DIEPINT14_INEPNAKEFF_POS (6U) +#define USBFS_DIEPINT14_INEPNAKEFF (0x00000040UL) +#define USBFS_DIEPINT14_TXFEMP_POS (7U) +#define USBFS_DIEPINT14_TXFEMP (0x00000080UL) +#define USBFS_DIEPINT14_TXFIFOUNDRN_POS (8U) +#define USBFS_DIEPINT14_TXFIFOUNDRN (0x00000100UL) +#define USBFS_DIEPINT14_BNAINTR_POS (9U) +#define USBFS_DIEPINT14_BNAINTR (0x00000200UL) +#define USBFS_DIEPINT14_PKTDRPSTS_POS (11U) +#define USBFS_DIEPINT14_PKTDRPSTS (0x00000800UL) +#define USBFS_DIEPINT14_BBLEERR_POS (12U) +#define USBFS_DIEPINT14_BBLEERR (0x00001000UL) +#define USBFS_DIEPINT14_NAKINTRPT_POS (13U) +#define USBFS_DIEPINT14_NAKINTRPT (0x00002000UL) +#define USBFS_DIEPINT14_NYETINTRPT_POS (14U) +#define USBFS_DIEPINT14_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBFS_DIEPTSIZ14 register */ +#define USBFS_DIEPTSIZ14_XFERSIZE_POS (0U) +#define USBFS_DIEPTSIZ14_XFERSIZE (0x0007FFFFUL) +#define USBFS_DIEPTSIZ14_PKTCNT_POS (19U) +#define USBFS_DIEPTSIZ14_PKTCNT (0x1FF80000UL) +#define USBFS_DIEPTSIZ14_MC_POS (29U) +#define USBFS_DIEPTSIZ14_MC (0x60000000UL) + +/* Bit definition for USBFS_DIEPDMA14 register */ +#define USBFS_DIEPDMA14 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DTXFSTS14 register */ +#define USBFS_DTXFSTS14_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBFS_DIEPCTL15 register */ +#define USBFS_DIEPCTL15_MPS_POS (0U) +#define USBFS_DIEPCTL15_MPS (0x000007FFUL) +#define USBFS_DIEPCTL15_USBACTEP_POS (15U) +#define USBFS_DIEPCTL15_USBACTEP (0x00008000UL) +#define USBFS_DIEPCTL15_DPID_POS (16U) +#define USBFS_DIEPCTL15_DPID (0x00010000UL) +#define USBFS_DIEPCTL15_NAKSTS_POS (17U) +#define USBFS_DIEPCTL15_NAKSTS (0x00020000UL) +#define USBFS_DIEPCTL15_EPTYPE_POS (18U) +#define USBFS_DIEPCTL15_EPTYPE (0x000C0000UL) +#define USBFS_DIEPCTL15_EPTYPE_0 (0x00040000UL) +#define USBFS_DIEPCTL15_EPTYPE_1 (0x00080000UL) +#define USBFS_DIEPCTL15_STALL_POS (21U) +#define USBFS_DIEPCTL15_STALL (0x00200000UL) +#define USBFS_DIEPCTL15_TXFNUM_POS (22U) +#define USBFS_DIEPCTL15_TXFNUM (0x03C00000UL) +#define USBFS_DIEPCTL15_CNAK_POS (26U) +#define USBFS_DIEPCTL15_CNAK (0x04000000UL) +#define USBFS_DIEPCTL15_SNAK_POS (27U) +#define USBFS_DIEPCTL15_SNAK (0x08000000UL) +#define USBFS_DIEPCTL15_SETD0PID_POS (28U) +#define USBFS_DIEPCTL15_SETD0PID (0x10000000UL) +#define USBFS_DIEPCTL15_SETD1PID_POS (29U) +#define USBFS_DIEPCTL15_SETD1PID (0x20000000UL) +#define USBFS_DIEPCTL15_EPDIS_POS (30U) +#define USBFS_DIEPCTL15_EPDIS (0x40000000UL) +#define USBFS_DIEPCTL15_EPENA_POS (31U) +#define USBFS_DIEPCTL15_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DIEPINT15 register */ +#define USBFS_DIEPINT15_XFERCOMPL_POS (0U) +#define USBFS_DIEPINT15_XFERCOMPL (0x00000001UL) +#define USBFS_DIEPINT15_EPDISBLD_POS (1U) +#define USBFS_DIEPINT15_EPDISBLD (0x00000002UL) +#define USBFS_DIEPINT15_AHBERR_POS (2U) +#define USBFS_DIEPINT15_AHBERR (0x00000004UL) +#define USBFS_DIEPINT15_TIMEOUT_POS (3U) +#define USBFS_DIEPINT15_TIMEOUT (0x00000008UL) +#define USBFS_DIEPINT15_INTKNTXFEMP_POS (4U) +#define USBFS_DIEPINT15_INTKNTXFEMP (0x00000010UL) +#define USBFS_DIEPINT15_INTKNEPMIS_POS (5U) +#define USBFS_DIEPINT15_INTKNEPMIS (0x00000020UL) +#define USBFS_DIEPINT15_INEPNAKEFF_POS (6U) +#define USBFS_DIEPINT15_INEPNAKEFF (0x00000040UL) +#define USBFS_DIEPINT15_TXFEMP_POS (7U) +#define USBFS_DIEPINT15_TXFEMP (0x00000080UL) +#define USBFS_DIEPINT15_TXFIFOUNDRN_POS (8U) +#define USBFS_DIEPINT15_TXFIFOUNDRN (0x00000100UL) +#define USBFS_DIEPINT15_BNAINTR_POS (9U) +#define USBFS_DIEPINT15_BNAINTR (0x00000200UL) +#define USBFS_DIEPINT15_PKTDRPSTS_POS (11U) +#define USBFS_DIEPINT15_PKTDRPSTS (0x00000800UL) +#define USBFS_DIEPINT15_BBLEERR_POS (12U) +#define USBFS_DIEPINT15_BBLEERR (0x00001000UL) +#define USBFS_DIEPINT15_NAKINTRPT_POS (13U) +#define USBFS_DIEPINT15_NAKINTRPT (0x00002000UL) +#define USBFS_DIEPINT15_NYETINTRPT_POS (14U) +#define USBFS_DIEPINT15_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBFS_DIEPTSIZ15 register */ +#define USBFS_DIEPTSIZ15_XFERSIZE_POS (0U) +#define USBFS_DIEPTSIZ15_XFERSIZE (0x0007FFFFUL) +#define USBFS_DIEPTSIZ15_PKTCNT_POS (19U) +#define USBFS_DIEPTSIZ15_PKTCNT (0x1FF80000UL) +#define USBFS_DIEPTSIZ15_MC_POS (29U) +#define USBFS_DIEPTSIZ15_MC (0x60000000UL) + +/* Bit definition for USBFS_DIEPDMA15 register */ +#define USBFS_DIEPDMA15 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DTXFSTS15 register */ +#define USBFS_DTXFSTS15_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBFS_DOEPCTL0 register */ +#define USBFS_DOEPCTL0_MPS_POS (0U) +#define USBFS_DOEPCTL0_MPS (0x00000003UL) +#define USBFS_DOEPCTL0_USBACTEP_POS (15U) +#define USBFS_DOEPCTL0_USBACTEP (0x00008000UL) +#define USBFS_DOEPCTL0_NAKSTS_POS (17U) +#define USBFS_DOEPCTL0_NAKSTS (0x00020000UL) +#define USBFS_DOEPCTL0_EPTYPE_POS (18U) +#define USBFS_DOEPCTL0_EPTYPE (0x000C0000UL) +#define USBFS_DOEPCTL0_EPTYPE_0 (0x00040000UL) +#define USBFS_DOEPCTL0_EPTYPE_1 (0x00080000UL) +#define USBFS_DOEPCTL0_SNP_POS (20U) +#define USBFS_DOEPCTL0_SNP (0x00100000UL) +#define USBFS_DOEPCTL0_STALL_POS (21U) +#define USBFS_DOEPCTL0_STALL (0x00200000UL) +#define USBFS_DOEPCTL0_CNAK_POS (26U) +#define USBFS_DOEPCTL0_CNAK (0x04000000UL) +#define USBFS_DOEPCTL0_SNAK_POS (27U) +#define USBFS_DOEPCTL0_SNAK (0x08000000UL) +#define USBFS_DOEPCTL0_EPDIS_POS (30U) +#define USBFS_DOEPCTL0_EPDIS (0x40000000UL) +#define USBFS_DOEPCTL0_EPENA_POS (31U) +#define USBFS_DOEPCTL0_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DOEPINT0 register */ +#define USBFS_DOEPINT0_XFERCOMPL_POS (0U) +#define USBFS_DOEPINT0_XFERCOMPL (0x00000001UL) +#define USBFS_DOEPINT0_EPDISBLD_POS (1U) +#define USBFS_DOEPINT0_EPDISBLD (0x00000002UL) +#define USBFS_DOEPINT0_AHBERR_POS (2U) +#define USBFS_DOEPINT0_AHBERR (0x00000004UL) +#define USBFS_DOEPINT0_SETUP_POS (3U) +#define USBFS_DOEPINT0_SETUP (0x00000008UL) +#define USBFS_DOEPINT0_OUTTKNEPDIS_POS (4U) +#define USBFS_DOEPINT0_OUTTKNEPDIS (0x00000010UL) +#define USBFS_DOEPINT0_STSPHSERCVD_POS (5U) +#define USBFS_DOEPINT0_STSPHSERCVD (0x00000020UL) +#define USBFS_DOEPINT0_BACK2BACKSETUP_POS (6U) +#define USBFS_DOEPINT0_BACK2BACKSETUP (0x00000040UL) +#define USBFS_DOEPINT0_OUTPKTERR_POS (8U) +#define USBFS_DOEPINT0_OUTPKTERR (0x00000100UL) +#define USBFS_DOEPINT0_BNAINTR_POS (9U) +#define USBFS_DOEPINT0_BNAINTR (0x00000200UL) +#define USBFS_DOEPINT0_PKTDRPSTS_POS (11U) +#define USBFS_DOEPINT0_PKTDRPSTS (0x00000800UL) +#define USBFS_DOEPINT0_BBLEERR_POS (12U) +#define USBFS_DOEPINT0_BBLEERR (0x00001000UL) +#define USBFS_DOEPINT0_NAKINTRPT_POS (13U) +#define USBFS_DOEPINT0_NAKINTRPT (0x00002000UL) +#define USBFS_DOEPINT0_NYETINTRPT_POS (14U) +#define USBFS_DOEPINT0_NYETINTRPT (0x00004000UL) +#define USBFS_DOEPINT0_STUPPKTRCVD_POS (15U) +#define USBFS_DOEPINT0_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBFS_DOEPTSIZ0 register */ +#define USBFS_DOEPTSIZ0_XFERSIZE_POS (0U) +#define USBFS_DOEPTSIZ0_XFERSIZE (0x0000007FUL) +#define USBFS_DOEPTSIZ0_PKTCNT_POS (19U) +#define USBFS_DOEPTSIZ0_SUPCNT_POS (29U) +#define USBFS_DOEPTSIZ0_SUPCNT (0x60000000UL) + +/* Bit definition for USBFS_DOEPDMA0 register */ +#define USBFS_DOEPDMA0 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DOEPCTL1 register */ +#define USBFS_DOEPCTL1_MPS_POS (0U) +#define USBFS_DOEPCTL1_MPS (0x000007FFUL) +#define USBFS_DOEPCTL1_USBACTEP_POS (15U) +#define USBFS_DOEPCTL1_USBACTEP (0x00008000UL) +#define USBFS_DOEPCTL1_DPID_POS (16U) +#define USBFS_DOEPCTL1_DPID (0x00010000UL) +#define USBFS_DOEPCTL1_NAKSTS_POS (17U) +#define USBFS_DOEPCTL1_NAKSTS (0x00020000UL) +#define USBFS_DOEPCTL1_EPTYPE_POS (18U) +#define USBFS_DOEPCTL1_EPTYPE (0x000C0000UL) +#define USBFS_DOEPCTL1_EPTYPE_0 (0x00040000UL) +#define USBFS_DOEPCTL1_EPTYPE_1 (0x00080000UL) +#define USBFS_DOEPCTL1_SNP_POS (20U) +#define USBFS_DOEPCTL1_SNP (0x00100000UL) +#define USBFS_DOEPCTL1_STALL_POS (21U) +#define USBFS_DOEPCTL1_STALL (0x00200000UL) +#define USBFS_DOEPCTL1_CNAK_POS (26U) +#define USBFS_DOEPCTL1_CNAK (0x04000000UL) +#define USBFS_DOEPCTL1_SNAK_POS (27U) +#define USBFS_DOEPCTL1_SNAK (0x08000000UL) +#define USBFS_DOEPCTL1_SETD0PID_POS (28U) +#define USBFS_DOEPCTL1_SETD0PID (0x10000000UL) +#define USBFS_DOEPCTL1_SETD1PID_POS (29U) +#define USBFS_DOEPCTL1_SETD1PID (0x20000000UL) +#define USBFS_DOEPCTL1_EPDIS_POS (30U) +#define USBFS_DOEPCTL1_EPDIS (0x40000000UL) +#define USBFS_DOEPCTL1_EPENA_POS (31U) +#define USBFS_DOEPCTL1_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DOEPINT1 register */ +#define USBFS_DOEPINT1_XFERCOMPL_POS (0U) +#define USBFS_DOEPINT1_XFERCOMPL (0x00000001UL) +#define USBFS_DOEPINT1_EPDISBLD_POS (1U) +#define USBFS_DOEPINT1_EPDISBLD (0x00000002UL) +#define USBFS_DOEPINT1_AHBERR_POS (2U) +#define USBFS_DOEPINT1_AHBERR (0x00000004UL) +#define USBFS_DOEPINT1_SETUP_POS (3U) +#define USBFS_DOEPINT1_SETUP (0x00000008UL) +#define USBFS_DOEPINT1_OUTTKNEPDIS_POS (4U) +#define USBFS_DOEPINT1_OUTTKNEPDIS (0x00000010UL) +#define USBFS_DOEPINT1_STSPHSERCVD_POS (5U) +#define USBFS_DOEPINT1_STSPHSERCVD (0x00000020UL) +#define USBFS_DOEPINT1_BACK2BACKSETUP_POS (6U) +#define USBFS_DOEPINT1_BACK2BACKSETUP (0x00000040UL) +#define USBFS_DOEPINT1_OUTPKTERR_POS (8U) +#define USBFS_DOEPINT1_OUTPKTERR (0x00000100UL) +#define USBFS_DOEPINT1_BNAINTR_POS (9U) +#define USBFS_DOEPINT1_BNAINTR (0x00000200UL) +#define USBFS_DOEPINT1_PKTDRPSTS_POS (11U) +#define USBFS_DOEPINT1_PKTDRPSTS (0x00000800UL) +#define USBFS_DOEPINT1_BBLEERR_POS (12U) +#define USBFS_DOEPINT1_BBLEERR (0x00001000UL) +#define USBFS_DOEPINT1_NAKINTRPT_POS (13U) +#define USBFS_DOEPINT1_NAKINTRPT (0x00002000UL) +#define USBFS_DOEPINT1_NYETINTRPT_POS (14U) +#define USBFS_DOEPINT1_NYETINTRPT (0x00004000UL) +#define USBFS_DOEPINT1_STUPPKTRCVD_POS (15U) +#define USBFS_DOEPINT1_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBFS_DOEPTSIZ1 register */ +#define USBFS_DOEPTSIZ1_XFERSIZE_POS (0U) +#define USBFS_DOEPTSIZ1_XFERSIZE (0x0007FFFFUL) +#define USBFS_DOEPTSIZ1_PKTCNT_POS (19U) +#define USBFS_DOEPTSIZ1_PKTCNT (0x1FF80000UL) +#define USBFS_DOEPTSIZ1_RXDPID_POS (29U) +#define USBFS_DOEPTSIZ1_RXDPID (0x60000000UL) +#define USBFS_DOEPTSIZ1_RXDPID_0 (0x20000000UL) +#define USBFS_DOEPTSIZ1_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBFS_DOEPDMA1 register */ +#define USBFS_DOEPDMA1 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DOEPCTL2 register */ +#define USBFS_DOEPCTL2_MPS_POS (0U) +#define USBFS_DOEPCTL2_MPS (0x000007FFUL) +#define USBFS_DOEPCTL2_USBACTEP_POS (15U) +#define USBFS_DOEPCTL2_USBACTEP (0x00008000UL) +#define USBFS_DOEPCTL2_DPID_POS (16U) +#define USBFS_DOEPCTL2_DPID (0x00010000UL) +#define USBFS_DOEPCTL2_NAKSTS_POS (17U) +#define USBFS_DOEPCTL2_NAKSTS (0x00020000UL) +#define USBFS_DOEPCTL2_EPTYPE_POS (18U) +#define USBFS_DOEPCTL2_EPTYPE (0x000C0000UL) +#define USBFS_DOEPCTL2_EPTYPE_0 (0x00040000UL) +#define USBFS_DOEPCTL2_EPTYPE_1 (0x00080000UL) +#define USBFS_DOEPCTL2_SNP_POS (20U) +#define USBFS_DOEPCTL2_SNP (0x00100000UL) +#define USBFS_DOEPCTL2_STALL_POS (21U) +#define USBFS_DOEPCTL2_STALL (0x00200000UL) +#define USBFS_DOEPCTL2_CNAK_POS (26U) +#define USBFS_DOEPCTL2_CNAK (0x04000000UL) +#define USBFS_DOEPCTL2_SNAK_POS (27U) +#define USBFS_DOEPCTL2_SNAK (0x08000000UL) +#define USBFS_DOEPCTL2_SETD0PID_POS (28U) +#define USBFS_DOEPCTL2_SETD0PID (0x10000000UL) +#define USBFS_DOEPCTL2_SETD1PID_POS (29U) +#define USBFS_DOEPCTL2_SETD1PID (0x20000000UL) +#define USBFS_DOEPCTL2_EPDIS_POS (30U) +#define USBFS_DOEPCTL2_EPDIS (0x40000000UL) +#define USBFS_DOEPCTL2_EPENA_POS (31U) +#define USBFS_DOEPCTL2_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DOEPINT2 register */ +#define USBFS_DOEPINT2_XFERCOMPL_POS (0U) +#define USBFS_DOEPINT2_XFERCOMPL (0x00000001UL) +#define USBFS_DOEPINT2_EPDISBLD_POS (1U) +#define USBFS_DOEPINT2_EPDISBLD (0x00000002UL) +#define USBFS_DOEPINT2_AHBERR_POS (2U) +#define USBFS_DOEPINT2_AHBERR (0x00000004UL) +#define USBFS_DOEPINT2_SETUP_POS (3U) +#define USBFS_DOEPINT2_SETUP (0x00000008UL) +#define USBFS_DOEPINT2_OUTTKNEPDIS_POS (4U) +#define USBFS_DOEPINT2_OUTTKNEPDIS (0x00000010UL) +#define USBFS_DOEPINT2_STSPHSERCVD_POS (5U) +#define USBFS_DOEPINT2_STSPHSERCVD (0x00000020UL) +#define USBFS_DOEPINT2_BACK2BACKSETUP_POS (6U) +#define USBFS_DOEPINT2_BACK2BACKSETUP (0x00000040UL) +#define USBFS_DOEPINT2_OUTPKTERR_POS (8U) +#define USBFS_DOEPINT2_OUTPKTERR (0x00000100UL) +#define USBFS_DOEPINT2_BNAINTR_POS (9U) +#define USBFS_DOEPINT2_BNAINTR (0x00000200UL) +#define USBFS_DOEPINT2_PKTDRPSTS_POS (11U) +#define USBFS_DOEPINT2_PKTDRPSTS (0x00000800UL) +#define USBFS_DOEPINT2_BBLEERR_POS (12U) +#define USBFS_DOEPINT2_BBLEERR (0x00001000UL) +#define USBFS_DOEPINT2_NAKINTRPT_POS (13U) +#define USBFS_DOEPINT2_NAKINTRPT (0x00002000UL) +#define USBFS_DOEPINT2_NYETINTRPT_POS (14U) +#define USBFS_DOEPINT2_NYETINTRPT (0x00004000UL) +#define USBFS_DOEPINT2_STUPPKTRCVD_POS (15U) +#define USBFS_DOEPINT2_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBFS_DOEPTSIZ2 register */ +#define USBFS_DOEPTSIZ2_XFERSIZE_POS (0U) +#define USBFS_DOEPTSIZ2_XFERSIZE (0x0007FFFFUL) +#define USBFS_DOEPTSIZ2_PKTCNT_POS (19U) +#define USBFS_DOEPTSIZ2_PKTCNT (0x1FF80000UL) +#define USBFS_DOEPTSIZ2_RXDPID_POS (29U) +#define USBFS_DOEPTSIZ2_RXDPID (0x60000000UL) +#define USBFS_DOEPTSIZ2_RXDPID_0 (0x20000000UL) +#define USBFS_DOEPTSIZ2_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBFS_DOEPDMA2 register */ +#define USBFS_DOEPDMA2 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DOEPCTL3 register */ +#define USBFS_DOEPCTL3_MPS_POS (0U) +#define USBFS_DOEPCTL3_MPS (0x000007FFUL) +#define USBFS_DOEPCTL3_USBACTEP_POS (15U) +#define USBFS_DOEPCTL3_USBACTEP (0x00008000UL) +#define USBFS_DOEPCTL3_DPID_POS (16U) +#define USBFS_DOEPCTL3_DPID (0x00010000UL) +#define USBFS_DOEPCTL3_NAKSTS_POS (17U) +#define USBFS_DOEPCTL3_NAKSTS (0x00020000UL) +#define USBFS_DOEPCTL3_EPTYPE_POS (18U) +#define USBFS_DOEPCTL3_EPTYPE (0x000C0000UL) +#define USBFS_DOEPCTL3_EPTYPE_0 (0x00040000UL) +#define USBFS_DOEPCTL3_EPTYPE_1 (0x00080000UL) +#define USBFS_DOEPCTL3_SNP_POS (20U) +#define USBFS_DOEPCTL3_SNP (0x00100000UL) +#define USBFS_DOEPCTL3_STALL_POS (21U) +#define USBFS_DOEPCTL3_STALL (0x00200000UL) +#define USBFS_DOEPCTL3_CNAK_POS (26U) +#define USBFS_DOEPCTL3_CNAK (0x04000000UL) +#define USBFS_DOEPCTL3_SNAK_POS (27U) +#define USBFS_DOEPCTL3_SNAK (0x08000000UL) +#define USBFS_DOEPCTL3_SETD0PID_POS (28U) +#define USBFS_DOEPCTL3_SETD0PID (0x10000000UL) +#define USBFS_DOEPCTL3_SETD1PID_POS (29U) +#define USBFS_DOEPCTL3_SETD1PID (0x20000000UL) +#define USBFS_DOEPCTL3_EPDIS_POS (30U) +#define USBFS_DOEPCTL3_EPDIS (0x40000000UL) +#define USBFS_DOEPCTL3_EPENA_POS (31U) +#define USBFS_DOEPCTL3_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DOEPINT3 register */ +#define USBFS_DOEPINT3_XFERCOMPL_POS (0U) +#define USBFS_DOEPINT3_XFERCOMPL (0x00000001UL) +#define USBFS_DOEPINT3_EPDISBLD_POS (1U) +#define USBFS_DOEPINT3_EPDISBLD (0x00000002UL) +#define USBFS_DOEPINT3_AHBERR_POS (2U) +#define USBFS_DOEPINT3_AHBERR (0x00000004UL) +#define USBFS_DOEPINT3_SETUP_POS (3U) +#define USBFS_DOEPINT3_SETUP (0x00000008UL) +#define USBFS_DOEPINT3_OUTTKNEPDIS_POS (4U) +#define USBFS_DOEPINT3_OUTTKNEPDIS (0x00000010UL) +#define USBFS_DOEPINT3_STSPHSERCVD_POS (5U) +#define USBFS_DOEPINT3_STSPHSERCVD (0x00000020UL) +#define USBFS_DOEPINT3_BACK2BACKSETUP_POS (6U) +#define USBFS_DOEPINT3_BACK2BACKSETUP (0x00000040UL) +#define USBFS_DOEPINT3_OUTPKTERR_POS (8U) +#define USBFS_DOEPINT3_OUTPKTERR (0x00000100UL) +#define USBFS_DOEPINT3_BNAINTR_POS (9U) +#define USBFS_DOEPINT3_BNAINTR (0x00000200UL) +#define USBFS_DOEPINT3_PKTDRPSTS_POS (11U) +#define USBFS_DOEPINT3_PKTDRPSTS (0x00000800UL) +#define USBFS_DOEPINT3_BBLEERR_POS (12U) +#define USBFS_DOEPINT3_BBLEERR (0x00001000UL) +#define USBFS_DOEPINT3_NAKINTRPT_POS (13U) +#define USBFS_DOEPINT3_NAKINTRPT (0x00002000UL) +#define USBFS_DOEPINT3_NYETINTRPT_POS (14U) +#define USBFS_DOEPINT3_NYETINTRPT (0x00004000UL) +#define USBFS_DOEPINT3_STUPPKTRCVD_POS (15U) +#define USBFS_DOEPINT3_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBFS_DOEPTSIZ3 register */ +#define USBFS_DOEPTSIZ3_XFERSIZE_POS (0U) +#define USBFS_DOEPTSIZ3_XFERSIZE (0x0007FFFFUL) +#define USBFS_DOEPTSIZ3_PKTCNT_POS (19U) +#define USBFS_DOEPTSIZ3_PKTCNT (0x1FF80000UL) +#define USBFS_DOEPTSIZ3_RXDPID_POS (29U) +#define USBFS_DOEPTSIZ3_RXDPID (0x60000000UL) +#define USBFS_DOEPTSIZ3_RXDPID_0 (0x20000000UL) +#define USBFS_DOEPTSIZ3_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBFS_DOEPDMA3 register */ +#define USBFS_DOEPDMA3 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DOEPCTL4 register */ +#define USBFS_DOEPCTL4_MPS_POS (0U) +#define USBFS_DOEPCTL4_MPS (0x000007FFUL) +#define USBFS_DOEPCTL4_USBACTEP_POS (15U) +#define USBFS_DOEPCTL4_USBACTEP (0x00008000UL) +#define USBFS_DOEPCTL4_DPID_POS (16U) +#define USBFS_DOEPCTL4_DPID (0x00010000UL) +#define USBFS_DOEPCTL4_NAKSTS_POS (17U) +#define USBFS_DOEPCTL4_NAKSTS (0x00020000UL) +#define USBFS_DOEPCTL4_EPTYPE_POS (18U) +#define USBFS_DOEPCTL4_EPTYPE (0x000C0000UL) +#define USBFS_DOEPCTL4_EPTYPE_0 (0x00040000UL) +#define USBFS_DOEPCTL4_EPTYPE_1 (0x00080000UL) +#define USBFS_DOEPCTL4_SNP_POS (20U) +#define USBFS_DOEPCTL4_SNP (0x00100000UL) +#define USBFS_DOEPCTL4_STALL_POS (21U) +#define USBFS_DOEPCTL4_STALL (0x00200000UL) +#define USBFS_DOEPCTL4_CNAK_POS (26U) +#define USBFS_DOEPCTL4_CNAK (0x04000000UL) +#define USBFS_DOEPCTL4_SNAK_POS (27U) +#define USBFS_DOEPCTL4_SNAK (0x08000000UL) +#define USBFS_DOEPCTL4_SETD0PID_POS (28U) +#define USBFS_DOEPCTL4_SETD0PID (0x10000000UL) +#define USBFS_DOEPCTL4_SETD1PID_POS (29U) +#define USBFS_DOEPCTL4_SETD1PID (0x20000000UL) +#define USBFS_DOEPCTL4_EPDIS_POS (30U) +#define USBFS_DOEPCTL4_EPDIS (0x40000000UL) +#define USBFS_DOEPCTL4_EPENA_POS (31U) +#define USBFS_DOEPCTL4_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DOEPINT4 register */ +#define USBFS_DOEPINT4_XFERCOMPL_POS (0U) +#define USBFS_DOEPINT4_XFERCOMPL (0x00000001UL) +#define USBFS_DOEPINT4_EPDISBLD_POS (1U) +#define USBFS_DOEPINT4_EPDISBLD (0x00000002UL) +#define USBFS_DOEPINT4_AHBERR_POS (2U) +#define USBFS_DOEPINT4_AHBERR (0x00000004UL) +#define USBFS_DOEPINT4_SETUP_POS (3U) +#define USBFS_DOEPINT4_SETUP (0x00000008UL) +#define USBFS_DOEPINT4_OUTTKNEPDIS_POS (4U) +#define USBFS_DOEPINT4_OUTTKNEPDIS (0x00000010UL) +#define USBFS_DOEPINT4_STSPHSERCVD_POS (5U) +#define USBFS_DOEPINT4_STSPHSERCVD (0x00000020UL) +#define USBFS_DOEPINT4_BACK2BACKSETUP_POS (6U) +#define USBFS_DOEPINT4_BACK2BACKSETUP (0x00000040UL) +#define USBFS_DOEPINT4_OUTPKTERR_POS (8U) +#define USBFS_DOEPINT4_OUTPKTERR (0x00000100UL) +#define USBFS_DOEPINT4_BNAINTR_POS (9U) +#define USBFS_DOEPINT4_BNAINTR (0x00000200UL) +#define USBFS_DOEPINT4_PKTDRPSTS_POS (11U) +#define USBFS_DOEPINT4_PKTDRPSTS (0x00000800UL) +#define USBFS_DOEPINT4_BBLEERR_POS (12U) +#define USBFS_DOEPINT4_BBLEERR (0x00001000UL) +#define USBFS_DOEPINT4_NAKINTRPT_POS (13U) +#define USBFS_DOEPINT4_NAKINTRPT (0x00002000UL) +#define USBFS_DOEPINT4_NYETINTRPT_POS (14U) +#define USBFS_DOEPINT4_NYETINTRPT (0x00004000UL) +#define USBFS_DOEPINT4_STUPPKTRCVD_POS (15U) +#define USBFS_DOEPINT4_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBFS_DOEPTSIZ4 register */ +#define USBFS_DOEPTSIZ4_XFERSIZE_POS (0U) +#define USBFS_DOEPTSIZ4_XFERSIZE (0x0007FFFFUL) +#define USBFS_DOEPTSIZ4_PKTCNT_POS (19U) +#define USBFS_DOEPTSIZ4_PKTCNT (0x1FF80000UL) +#define USBFS_DOEPTSIZ4_RXDPID_POS (29U) +#define USBFS_DOEPTSIZ4_RXDPID (0x60000000UL) +#define USBFS_DOEPTSIZ4_RXDPID_0 (0x20000000UL) +#define USBFS_DOEPTSIZ4_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBFS_DOEPDMA4 register */ +#define USBFS_DOEPDMA4 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DOEPCTL5 register */ +#define USBFS_DOEPCTL5_MPS_POS (0U) +#define USBFS_DOEPCTL5_MPS (0x000007FFUL) +#define USBFS_DOEPCTL5_USBACTEP_POS (15U) +#define USBFS_DOEPCTL5_USBACTEP (0x00008000UL) +#define USBFS_DOEPCTL5_DPID_POS (16U) +#define USBFS_DOEPCTL5_DPID (0x00010000UL) +#define USBFS_DOEPCTL5_NAKSTS_POS (17U) +#define USBFS_DOEPCTL5_NAKSTS (0x00020000UL) +#define USBFS_DOEPCTL5_EPTYPE_POS (18U) +#define USBFS_DOEPCTL5_EPTYPE (0x000C0000UL) +#define USBFS_DOEPCTL5_EPTYPE_0 (0x00040000UL) +#define USBFS_DOEPCTL5_EPTYPE_1 (0x00080000UL) +#define USBFS_DOEPCTL5_SNP_POS (20U) +#define USBFS_DOEPCTL5_SNP (0x00100000UL) +#define USBFS_DOEPCTL5_STALL_POS (21U) +#define USBFS_DOEPCTL5_STALL (0x00200000UL) +#define USBFS_DOEPCTL5_CNAK_POS (26U) +#define USBFS_DOEPCTL5_CNAK (0x04000000UL) +#define USBFS_DOEPCTL5_SNAK_POS (27U) +#define USBFS_DOEPCTL5_SNAK (0x08000000UL) +#define USBFS_DOEPCTL5_SETD0PID_POS (28U) +#define USBFS_DOEPCTL5_SETD0PID (0x10000000UL) +#define USBFS_DOEPCTL5_SETD1PID_POS (29U) +#define USBFS_DOEPCTL5_SETD1PID (0x20000000UL) +#define USBFS_DOEPCTL5_EPDIS_POS (30U) +#define USBFS_DOEPCTL5_EPDIS (0x40000000UL) +#define USBFS_DOEPCTL5_EPENA_POS (31U) +#define USBFS_DOEPCTL5_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DOEPINT5 register */ +#define USBFS_DOEPINT5_XFERCOMPL_POS (0U) +#define USBFS_DOEPINT5_XFERCOMPL (0x00000001UL) +#define USBFS_DOEPINT5_EPDISBLD_POS (1U) +#define USBFS_DOEPINT5_EPDISBLD (0x00000002UL) +#define USBFS_DOEPINT5_AHBERR_POS (2U) +#define USBFS_DOEPINT5_AHBERR (0x00000004UL) +#define USBFS_DOEPINT5_SETUP_POS (3U) +#define USBFS_DOEPINT5_SETUP (0x00000008UL) +#define USBFS_DOEPINT5_OUTTKNEPDIS_POS (4U) +#define USBFS_DOEPINT5_OUTTKNEPDIS (0x00000010UL) +#define USBFS_DOEPINT5_STSPHSERCVD_POS (5U) +#define USBFS_DOEPINT5_STSPHSERCVD (0x00000020UL) +#define USBFS_DOEPINT5_BACK2BACKSETUP_POS (6U) +#define USBFS_DOEPINT5_BACK2BACKSETUP (0x00000040UL) +#define USBFS_DOEPINT5_OUTPKTERR_POS (8U) +#define USBFS_DOEPINT5_OUTPKTERR (0x00000100UL) +#define USBFS_DOEPINT5_BNAINTR_POS (9U) +#define USBFS_DOEPINT5_BNAINTR (0x00000200UL) +#define USBFS_DOEPINT5_PKTDRPSTS_POS (11U) +#define USBFS_DOEPINT5_PKTDRPSTS (0x00000800UL) +#define USBFS_DOEPINT5_BBLEERR_POS (12U) +#define USBFS_DOEPINT5_BBLEERR (0x00001000UL) +#define USBFS_DOEPINT5_NAKINTRPT_POS (13U) +#define USBFS_DOEPINT5_NAKINTRPT (0x00002000UL) +#define USBFS_DOEPINT5_NYETINTRPT_POS (14U) +#define USBFS_DOEPINT5_NYETINTRPT (0x00004000UL) +#define USBFS_DOEPINT5_STUPPKTRCVD_POS (15U) +#define USBFS_DOEPINT5_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBFS_DOEPTSIZ5 register */ +#define USBFS_DOEPTSIZ5_XFERSIZE_POS (0U) +#define USBFS_DOEPTSIZ5_XFERSIZE (0x0007FFFFUL) +#define USBFS_DOEPTSIZ5_PKTCNT_POS (19U) +#define USBFS_DOEPTSIZ5_PKTCNT (0x1FF80000UL) +#define USBFS_DOEPTSIZ5_RXDPID_POS (29U) +#define USBFS_DOEPTSIZ5_RXDPID (0x60000000UL) +#define USBFS_DOEPTSIZ5_RXDPID_0 (0x20000000UL) +#define USBFS_DOEPTSIZ5_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBFS_DOEPDMA5 register */ +#define USBFS_DOEPDMA5 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DOEPCTL6 register */ +#define USBFS_DOEPCTL6_MPS_POS (0U) +#define USBFS_DOEPCTL6_MPS (0x000007FFUL) +#define USBFS_DOEPCTL6_USBACTEP_POS (15U) +#define USBFS_DOEPCTL6_USBACTEP (0x00008000UL) +#define USBFS_DOEPCTL6_DPID_POS (16U) +#define USBFS_DOEPCTL6_DPID (0x00010000UL) +#define USBFS_DOEPCTL6_NAKSTS_POS (17U) +#define USBFS_DOEPCTL6_NAKSTS (0x00020000UL) +#define USBFS_DOEPCTL6_EPTYPE_POS (18U) +#define USBFS_DOEPCTL6_EPTYPE (0x000C0000UL) +#define USBFS_DOEPCTL6_EPTYPE_0 (0x00040000UL) +#define USBFS_DOEPCTL6_EPTYPE_1 (0x00080000UL) +#define USBFS_DOEPCTL6_SNP_POS (20U) +#define USBFS_DOEPCTL6_SNP (0x00100000UL) +#define USBFS_DOEPCTL6_STALL_POS (21U) +#define USBFS_DOEPCTL6_STALL (0x00200000UL) +#define USBFS_DOEPCTL6_CNAK_POS (26U) +#define USBFS_DOEPCTL6_CNAK (0x04000000UL) +#define USBFS_DOEPCTL6_SNAK_POS (27U) +#define USBFS_DOEPCTL6_SNAK (0x08000000UL) +#define USBFS_DOEPCTL6_SETD0PID_POS (28U) +#define USBFS_DOEPCTL6_SETD0PID (0x10000000UL) +#define USBFS_DOEPCTL6_SETD1PID_POS (29U) +#define USBFS_DOEPCTL6_SETD1PID (0x20000000UL) +#define USBFS_DOEPCTL6_EPDIS_POS (30U) +#define USBFS_DOEPCTL6_EPDIS (0x40000000UL) +#define USBFS_DOEPCTL6_EPENA_POS (31U) +#define USBFS_DOEPCTL6_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DOEPINT6 register */ +#define USBFS_DOEPINT6_XFERCOMPL_POS (0U) +#define USBFS_DOEPINT6_XFERCOMPL (0x00000001UL) +#define USBFS_DOEPINT6_EPDISBLD_POS (1U) +#define USBFS_DOEPINT6_EPDISBLD (0x00000002UL) +#define USBFS_DOEPINT6_AHBERR_POS (2U) +#define USBFS_DOEPINT6_AHBERR (0x00000004UL) +#define USBFS_DOEPINT6_SETUP_POS (3U) +#define USBFS_DOEPINT6_SETUP (0x00000008UL) +#define USBFS_DOEPINT6_OUTTKNEPDIS_POS (4U) +#define USBFS_DOEPINT6_OUTTKNEPDIS (0x00000010UL) +#define USBFS_DOEPINT6_STSPHSERCVD_POS (5U) +#define USBFS_DOEPINT6_STSPHSERCVD (0x00000020UL) +#define USBFS_DOEPINT6_BACK2BACKSETUP_POS (6U) +#define USBFS_DOEPINT6_BACK2BACKSETUP (0x00000040UL) +#define USBFS_DOEPINT6_OUTPKTERR_POS (8U) +#define USBFS_DOEPINT6_OUTPKTERR (0x00000100UL) +#define USBFS_DOEPINT6_BNAINTR_POS (9U) +#define USBFS_DOEPINT6_BNAINTR (0x00000200UL) +#define USBFS_DOEPINT6_PKTDRPSTS_POS (11U) +#define USBFS_DOEPINT6_PKTDRPSTS (0x00000800UL) +#define USBFS_DOEPINT6_BBLEERR_POS (12U) +#define USBFS_DOEPINT6_BBLEERR (0x00001000UL) +#define USBFS_DOEPINT6_NAKINTRPT_POS (13U) +#define USBFS_DOEPINT6_NAKINTRPT (0x00002000UL) +#define USBFS_DOEPINT6_NYETINTRPT_POS (14U) +#define USBFS_DOEPINT6_NYETINTRPT (0x00004000UL) +#define USBFS_DOEPINT6_STUPPKTRCVD_POS (15U) +#define USBFS_DOEPINT6_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBFS_DOEPTSIZ6 register */ +#define USBFS_DOEPTSIZ6_XFERSIZE_POS (0U) +#define USBFS_DOEPTSIZ6_XFERSIZE (0x0007FFFFUL) +#define USBFS_DOEPTSIZ6_PKTCNT_POS (19U) +#define USBFS_DOEPTSIZ6_PKTCNT (0x1FF80000UL) +#define USBFS_DOEPTSIZ6_RXDPID_POS (29U) +#define USBFS_DOEPTSIZ6_RXDPID (0x60000000UL) +#define USBFS_DOEPTSIZ6_RXDPID_0 (0x20000000UL) +#define USBFS_DOEPTSIZ6_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBFS_DOEPDMA6 register */ +#define USBFS_DOEPDMA6 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DOEPCTL7 register */ +#define USBFS_DOEPCTL7_MPS_POS (0U) +#define USBFS_DOEPCTL7_MPS (0x000007FFUL) +#define USBFS_DOEPCTL7_USBACTEP_POS (15U) +#define USBFS_DOEPCTL7_USBACTEP (0x00008000UL) +#define USBFS_DOEPCTL7_DPID_POS (16U) +#define USBFS_DOEPCTL7_DPID (0x00010000UL) +#define USBFS_DOEPCTL7_NAKSTS_POS (17U) +#define USBFS_DOEPCTL7_NAKSTS (0x00020000UL) +#define USBFS_DOEPCTL7_EPTYPE_POS (18U) +#define USBFS_DOEPCTL7_EPTYPE (0x000C0000UL) +#define USBFS_DOEPCTL7_EPTYPE_0 (0x00040000UL) +#define USBFS_DOEPCTL7_EPTYPE_1 (0x00080000UL) +#define USBFS_DOEPCTL7_SNP_POS (20U) +#define USBFS_DOEPCTL7_SNP (0x00100000UL) +#define USBFS_DOEPCTL7_STALL_POS (21U) +#define USBFS_DOEPCTL7_STALL (0x00200000UL) +#define USBFS_DOEPCTL7_CNAK_POS (26U) +#define USBFS_DOEPCTL7_CNAK (0x04000000UL) +#define USBFS_DOEPCTL7_SNAK_POS (27U) +#define USBFS_DOEPCTL7_SNAK (0x08000000UL) +#define USBFS_DOEPCTL7_SETD0PID_POS (28U) +#define USBFS_DOEPCTL7_SETD0PID (0x10000000UL) +#define USBFS_DOEPCTL7_SETD1PID_POS (29U) +#define USBFS_DOEPCTL7_SETD1PID (0x20000000UL) +#define USBFS_DOEPCTL7_EPDIS_POS (30U) +#define USBFS_DOEPCTL7_EPDIS (0x40000000UL) +#define USBFS_DOEPCTL7_EPENA_POS (31U) +#define USBFS_DOEPCTL7_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DOEPINT7 register */ +#define USBFS_DOEPINT7_XFERCOMPL_POS (0U) +#define USBFS_DOEPINT7_XFERCOMPL (0x00000001UL) +#define USBFS_DOEPINT7_EPDISBLD_POS (1U) +#define USBFS_DOEPINT7_EPDISBLD (0x00000002UL) +#define USBFS_DOEPINT7_AHBERR_POS (2U) +#define USBFS_DOEPINT7_AHBERR (0x00000004UL) +#define USBFS_DOEPINT7_SETUP_POS (3U) +#define USBFS_DOEPINT7_SETUP (0x00000008UL) +#define USBFS_DOEPINT7_OUTTKNEPDIS_POS (4U) +#define USBFS_DOEPINT7_OUTTKNEPDIS (0x00000010UL) +#define USBFS_DOEPINT7_STSPHSERCVD_POS (5U) +#define USBFS_DOEPINT7_STSPHSERCVD (0x00000020UL) +#define USBFS_DOEPINT7_BACK2BACKSETUP_POS (6U) +#define USBFS_DOEPINT7_BACK2BACKSETUP (0x00000040UL) +#define USBFS_DOEPINT7_OUTPKTERR_POS (8U) +#define USBFS_DOEPINT7_OUTPKTERR (0x00000100UL) +#define USBFS_DOEPINT7_BNAINTR_POS (9U) +#define USBFS_DOEPINT7_BNAINTR (0x00000200UL) +#define USBFS_DOEPINT7_PKTDRPSTS_POS (11U) +#define USBFS_DOEPINT7_PKTDRPSTS (0x00000800UL) +#define USBFS_DOEPINT7_BBLEERR_POS (12U) +#define USBFS_DOEPINT7_BBLEERR (0x00001000UL) +#define USBFS_DOEPINT7_NAKINTRPT_POS (13U) +#define USBFS_DOEPINT7_NAKINTRPT (0x00002000UL) +#define USBFS_DOEPINT7_NYETINTRPT_POS (14U) +#define USBFS_DOEPINT7_NYETINTRPT (0x00004000UL) +#define USBFS_DOEPINT7_STUPPKTRCVD_POS (15U) +#define USBFS_DOEPINT7_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBFS_DOEPTSIZ7 register */ +#define USBFS_DOEPTSIZ7_XFERSIZE_POS (0U) +#define USBFS_DOEPTSIZ7_XFERSIZE (0x0007FFFFUL) +#define USBFS_DOEPTSIZ7_PKTCNT_POS (19U) +#define USBFS_DOEPTSIZ7_PKTCNT (0x1FF80000UL) +#define USBFS_DOEPTSIZ7_RXDPID_POS (29U) +#define USBFS_DOEPTSIZ7_RXDPID (0x60000000UL) +#define USBFS_DOEPTSIZ7_RXDPID_0 (0x20000000UL) +#define USBFS_DOEPTSIZ7_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBFS_DOEPDMA7 register */ +#define USBFS_DOEPDMA7 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DOEPCTL8 register */ +#define USBFS_DOEPCTL8_MPS_POS (0U) +#define USBFS_DOEPCTL8_MPS (0x000007FFUL) +#define USBFS_DOEPCTL8_USBACTEP_POS (15U) +#define USBFS_DOEPCTL8_USBACTEP (0x00008000UL) +#define USBFS_DOEPCTL8_DPID_POS (16U) +#define USBFS_DOEPCTL8_DPID (0x00010000UL) +#define USBFS_DOEPCTL8_NAKSTS_POS (17U) +#define USBFS_DOEPCTL8_NAKSTS (0x00020000UL) +#define USBFS_DOEPCTL8_EPTYPE_POS (18U) +#define USBFS_DOEPCTL8_EPTYPE (0x000C0000UL) +#define USBFS_DOEPCTL8_EPTYPE_0 (0x00040000UL) +#define USBFS_DOEPCTL8_EPTYPE_1 (0x00080000UL) +#define USBFS_DOEPCTL8_SNP_POS (20U) +#define USBFS_DOEPCTL8_SNP (0x00100000UL) +#define USBFS_DOEPCTL8_STALL_POS (21U) +#define USBFS_DOEPCTL8_STALL (0x00200000UL) +#define USBFS_DOEPCTL8_CNAK_POS (26U) +#define USBFS_DOEPCTL8_CNAK (0x04000000UL) +#define USBFS_DOEPCTL8_SNAK_POS (27U) +#define USBFS_DOEPCTL8_SNAK (0x08000000UL) +#define USBFS_DOEPCTL8_SETD0PID_POS (28U) +#define USBFS_DOEPCTL8_SETD0PID (0x10000000UL) +#define USBFS_DOEPCTL8_SETD1PID_POS (29U) +#define USBFS_DOEPCTL8_SETD1PID (0x20000000UL) +#define USBFS_DOEPCTL8_EPDIS_POS (30U) +#define USBFS_DOEPCTL8_EPDIS (0x40000000UL) +#define USBFS_DOEPCTL8_EPENA_POS (31U) +#define USBFS_DOEPCTL8_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DOEPINT8 register */ +#define USBFS_DOEPINT8_XFERCOMPL_POS (0U) +#define USBFS_DOEPINT8_XFERCOMPL (0x00000001UL) +#define USBFS_DOEPINT8_EPDISBLD_POS (1U) +#define USBFS_DOEPINT8_EPDISBLD (0x00000002UL) +#define USBFS_DOEPINT8_AHBERR_POS (2U) +#define USBFS_DOEPINT8_AHBERR (0x00000004UL) +#define USBFS_DOEPINT8_SETUP_POS (3U) +#define USBFS_DOEPINT8_SETUP (0x00000008UL) +#define USBFS_DOEPINT8_OUTTKNEPDIS_POS (4U) +#define USBFS_DOEPINT8_OUTTKNEPDIS (0x00000010UL) +#define USBFS_DOEPINT8_STSPHSERCVD_POS (5U) +#define USBFS_DOEPINT8_STSPHSERCVD (0x00000020UL) +#define USBFS_DOEPINT8_BACK2BACKSETUP_POS (6U) +#define USBFS_DOEPINT8_BACK2BACKSETUP (0x00000040UL) +#define USBFS_DOEPINT8_OUTPKTERR_POS (8U) +#define USBFS_DOEPINT8_OUTPKTERR (0x00000100UL) +#define USBFS_DOEPINT8_BNAINTR_POS (9U) +#define USBFS_DOEPINT8_BNAINTR (0x00000200UL) +#define USBFS_DOEPINT8_PKTDRPSTS_POS (11U) +#define USBFS_DOEPINT8_PKTDRPSTS (0x00000800UL) +#define USBFS_DOEPINT8_BBLEERR_POS (12U) +#define USBFS_DOEPINT8_BBLEERR (0x00001000UL) +#define USBFS_DOEPINT8_NAKINTRPT_POS (13U) +#define USBFS_DOEPINT8_NAKINTRPT (0x00002000UL) +#define USBFS_DOEPINT8_NYETINTRPT_POS (14U) +#define USBFS_DOEPINT8_NYETINTRPT (0x00004000UL) +#define USBFS_DOEPINT8_STUPPKTRCVD_POS (15U) +#define USBFS_DOEPINT8_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBFS_DOEPTSIZ8 register */ +#define USBFS_DOEPTSIZ8_XFERSIZE_POS (0U) +#define USBFS_DOEPTSIZ8_XFERSIZE (0x0007FFFFUL) +#define USBFS_DOEPTSIZ8_PKTCNT_POS (19U) +#define USBFS_DOEPTSIZ8_PKTCNT (0x1FF80000UL) +#define USBFS_DOEPTSIZ8_RXDPID_POS (29U) +#define USBFS_DOEPTSIZ8_RXDPID (0x60000000UL) +#define USBFS_DOEPTSIZ8_RXDPID_0 (0x20000000UL) +#define USBFS_DOEPTSIZ8_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBFS_DOEPDMA8 register */ +#define USBFS_DOEPDMA8 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DOEPCTL9 register */ +#define USBFS_DOEPCTL9_MPS_POS (0U) +#define USBFS_DOEPCTL9_MPS (0x000007FFUL) +#define USBFS_DOEPCTL9_USBACTEP_POS (15U) +#define USBFS_DOEPCTL9_USBACTEP (0x00008000UL) +#define USBFS_DOEPCTL9_DPID_POS (16U) +#define USBFS_DOEPCTL9_DPID (0x00010000UL) +#define USBFS_DOEPCTL9_NAKSTS_POS (17U) +#define USBFS_DOEPCTL9_NAKSTS (0x00020000UL) +#define USBFS_DOEPCTL9_EPTYPE_POS (18U) +#define USBFS_DOEPCTL9_EPTYPE (0x000C0000UL) +#define USBFS_DOEPCTL9_EPTYPE_0 (0x00040000UL) +#define USBFS_DOEPCTL9_EPTYPE_1 (0x00080000UL) +#define USBFS_DOEPCTL9_SNP_POS (20U) +#define USBFS_DOEPCTL9_SNP (0x00100000UL) +#define USBFS_DOEPCTL9_STALL_POS (21U) +#define USBFS_DOEPCTL9_STALL (0x00200000UL) +#define USBFS_DOEPCTL9_CNAK_POS (26U) +#define USBFS_DOEPCTL9_CNAK (0x04000000UL) +#define USBFS_DOEPCTL9_SNAK_POS (27U) +#define USBFS_DOEPCTL9_SNAK (0x08000000UL) +#define USBFS_DOEPCTL9_SETD0PID_POS (28U) +#define USBFS_DOEPCTL9_SETD0PID (0x10000000UL) +#define USBFS_DOEPCTL9_SETD1PID_POS (29U) +#define USBFS_DOEPCTL9_SETD1PID (0x20000000UL) +#define USBFS_DOEPCTL9_EPDIS_POS (30U) +#define USBFS_DOEPCTL9_EPDIS (0x40000000UL) +#define USBFS_DOEPCTL9_EPENA_POS (31U) +#define USBFS_DOEPCTL9_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DOEPINT9 register */ +#define USBFS_DOEPINT9_XFERCOMPL_POS (0U) +#define USBFS_DOEPINT9_XFERCOMPL (0x00000001UL) +#define USBFS_DOEPINT9_EPDISBLD_POS (1U) +#define USBFS_DOEPINT9_EPDISBLD (0x00000002UL) +#define USBFS_DOEPINT9_AHBERR_POS (2U) +#define USBFS_DOEPINT9_AHBERR (0x00000004UL) +#define USBFS_DOEPINT9_SETUP_POS (3U) +#define USBFS_DOEPINT9_SETUP (0x00000008UL) +#define USBFS_DOEPINT9_OUTTKNEPDIS_POS (4U) +#define USBFS_DOEPINT9_OUTTKNEPDIS (0x00000010UL) +#define USBFS_DOEPINT9_STSPHSERCVD_POS (5U) +#define USBFS_DOEPINT9_STSPHSERCVD (0x00000020UL) +#define USBFS_DOEPINT9_BACK2BACKSETUP_POS (6U) +#define USBFS_DOEPINT9_BACK2BACKSETUP (0x00000040UL) +#define USBFS_DOEPINT9_OUTPKTERR_POS (8U) +#define USBFS_DOEPINT9_OUTPKTERR (0x00000100UL) +#define USBFS_DOEPINT9_BNAINTR_POS (9U) +#define USBFS_DOEPINT9_BNAINTR (0x00000200UL) +#define USBFS_DOEPINT9_PKTDRPSTS_POS (11U) +#define USBFS_DOEPINT9_PKTDRPSTS (0x00000800UL) +#define USBFS_DOEPINT9_BBLEERR_POS (12U) +#define USBFS_DOEPINT9_BBLEERR (0x00001000UL) +#define USBFS_DOEPINT9_NAKINTRPT_POS (13U) +#define USBFS_DOEPINT9_NAKINTRPT (0x00002000UL) +#define USBFS_DOEPINT9_NYETINTRPT_POS (14U) +#define USBFS_DOEPINT9_NYETINTRPT (0x00004000UL) +#define USBFS_DOEPINT9_STUPPKTRCVD_POS (15U) +#define USBFS_DOEPINT9_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBFS_DOEPTSIZ9 register */ +#define USBFS_DOEPTSIZ9_XFERSIZE_POS (0U) +#define USBFS_DOEPTSIZ9_XFERSIZE (0x0007FFFFUL) +#define USBFS_DOEPTSIZ9_PKTCNT_POS (19U) +#define USBFS_DOEPTSIZ9_PKTCNT (0x1FF80000UL) +#define USBFS_DOEPTSIZ9_RXDPID_POS (29U) +#define USBFS_DOEPTSIZ9_RXDPID (0x60000000UL) +#define USBFS_DOEPTSIZ9_RXDPID_0 (0x20000000UL) +#define USBFS_DOEPTSIZ9_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBFS_DOEPDMA9 register */ +#define USBFS_DOEPDMA9 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DOEPCTL10 register */ +#define USBFS_DOEPCTL10_MPS_POS (0U) +#define USBFS_DOEPCTL10_MPS (0x000007FFUL) +#define USBFS_DOEPCTL10_USBACTEP_POS (15U) +#define USBFS_DOEPCTL10_USBACTEP (0x00008000UL) +#define USBFS_DOEPCTL10_DPID_POS (16U) +#define USBFS_DOEPCTL10_DPID (0x00010000UL) +#define USBFS_DOEPCTL10_NAKSTS_POS (17U) +#define USBFS_DOEPCTL10_NAKSTS (0x00020000UL) +#define USBFS_DOEPCTL10_EPTYPE_POS (18U) +#define USBFS_DOEPCTL10_EPTYPE (0x000C0000UL) +#define USBFS_DOEPCTL10_EPTYPE_0 (0x00040000UL) +#define USBFS_DOEPCTL10_EPTYPE_1 (0x00080000UL) +#define USBFS_DOEPCTL10_SNP_POS (20U) +#define USBFS_DOEPCTL10_SNP (0x00100000UL) +#define USBFS_DOEPCTL10_STALL_POS (21U) +#define USBFS_DOEPCTL10_STALL (0x00200000UL) +#define USBFS_DOEPCTL10_CNAK_POS (26U) +#define USBFS_DOEPCTL10_CNAK (0x04000000UL) +#define USBFS_DOEPCTL10_SNAK_POS (27U) +#define USBFS_DOEPCTL10_SNAK (0x08000000UL) +#define USBFS_DOEPCTL10_SETD0PID_POS (28U) +#define USBFS_DOEPCTL10_SETD0PID (0x10000000UL) +#define USBFS_DOEPCTL10_SETD1PID_POS (29U) +#define USBFS_DOEPCTL10_SETD1PID (0x20000000UL) +#define USBFS_DOEPCTL10_EPDIS_POS (30U) +#define USBFS_DOEPCTL10_EPDIS (0x40000000UL) +#define USBFS_DOEPCTL10_EPENA_POS (31U) +#define USBFS_DOEPCTL10_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DOEPINT10 register */ +#define USBFS_DOEPINT10_XFERCOMPL_POS (0U) +#define USBFS_DOEPINT10_XFERCOMPL (0x00000001UL) +#define USBFS_DOEPINT10_EPDISBLD_POS (1U) +#define USBFS_DOEPINT10_EPDISBLD (0x00000002UL) +#define USBFS_DOEPINT10_AHBERR_POS (2U) +#define USBFS_DOEPINT10_AHBERR (0x00000004UL) +#define USBFS_DOEPINT10_SETUP_POS (3U) +#define USBFS_DOEPINT10_SETUP (0x00000008UL) +#define USBFS_DOEPINT10_OUTTKNEPDIS_POS (4U) +#define USBFS_DOEPINT10_OUTTKNEPDIS (0x00000010UL) +#define USBFS_DOEPINT10_STSPHSERCVD_POS (5U) +#define USBFS_DOEPINT10_STSPHSERCVD (0x00000020UL) +#define USBFS_DOEPINT10_BACK2BACKSETUP_POS (6U) +#define USBFS_DOEPINT10_BACK2BACKSETUP (0x00000040UL) +#define USBFS_DOEPINT10_OUTPKTERR_POS (8U) +#define USBFS_DOEPINT10_OUTPKTERR (0x00000100UL) +#define USBFS_DOEPINT10_BNAINTR_POS (9U) +#define USBFS_DOEPINT10_BNAINTR (0x00000200UL) +#define USBFS_DOEPINT10_PKTDRPSTS_POS (11U) +#define USBFS_DOEPINT10_PKTDRPSTS (0x00000800UL) +#define USBFS_DOEPINT10_BBLEERR_POS (12U) +#define USBFS_DOEPINT10_BBLEERR (0x00001000UL) +#define USBFS_DOEPINT10_NAKINTRPT_POS (13U) +#define USBFS_DOEPINT10_NAKINTRPT (0x00002000UL) +#define USBFS_DOEPINT10_NYETINTRPT_POS (14U) +#define USBFS_DOEPINT10_NYETINTRPT (0x00004000UL) +#define USBFS_DOEPINT10_STUPPKTRCVD_POS (15U) +#define USBFS_DOEPINT10_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBFS_DOEPTSIZ10 register */ +#define USBFS_DOEPTSIZ10_XFERSIZE_POS (0U) +#define USBFS_DOEPTSIZ10_XFERSIZE (0x0007FFFFUL) +#define USBFS_DOEPTSIZ10_PKTCNT_POS (19U) +#define USBFS_DOEPTSIZ10_PKTCNT (0x1FF80000UL) +#define USBFS_DOEPTSIZ10_RXDPID_POS (29U) +#define USBFS_DOEPTSIZ10_RXDPID (0x60000000UL) +#define USBFS_DOEPTSIZ10_RXDPID_0 (0x20000000UL) +#define USBFS_DOEPTSIZ10_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBFS_DOEPDMA10 register */ +#define USBFS_DOEPDMA10 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DOEPCTL11 register */ +#define USBFS_DOEPCTL11_MPS_POS (0U) +#define USBFS_DOEPCTL11_MPS (0x000007FFUL) +#define USBFS_DOEPCTL11_USBACTEP_POS (15U) +#define USBFS_DOEPCTL11_USBACTEP (0x00008000UL) +#define USBFS_DOEPCTL11_DPID_POS (16U) +#define USBFS_DOEPCTL11_DPID (0x00010000UL) +#define USBFS_DOEPCTL11_NAKSTS_POS (17U) +#define USBFS_DOEPCTL11_NAKSTS (0x00020000UL) +#define USBFS_DOEPCTL11_EPTYPE_POS (18U) +#define USBFS_DOEPCTL11_EPTYPE (0x000C0000UL) +#define USBFS_DOEPCTL11_EPTYPE_0 (0x00040000UL) +#define USBFS_DOEPCTL11_EPTYPE_1 (0x00080000UL) +#define USBFS_DOEPCTL11_SNP_POS (20U) +#define USBFS_DOEPCTL11_SNP (0x00100000UL) +#define USBFS_DOEPCTL11_STALL_POS (21U) +#define USBFS_DOEPCTL11_STALL (0x00200000UL) +#define USBFS_DOEPCTL11_CNAK_POS (26U) +#define USBFS_DOEPCTL11_CNAK (0x04000000UL) +#define USBFS_DOEPCTL11_SNAK_POS (27U) +#define USBFS_DOEPCTL11_SNAK (0x08000000UL) +#define USBFS_DOEPCTL11_SETD0PID_POS (28U) +#define USBFS_DOEPCTL11_SETD0PID (0x10000000UL) +#define USBFS_DOEPCTL11_SETD1PID_POS (29U) +#define USBFS_DOEPCTL11_SETD1PID (0x20000000UL) +#define USBFS_DOEPCTL11_EPDIS_POS (30U) +#define USBFS_DOEPCTL11_EPDIS (0x40000000UL) +#define USBFS_DOEPCTL11_EPENA_POS (31U) +#define USBFS_DOEPCTL11_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DOEPINT11 register */ +#define USBFS_DOEPINT11_XFERCOMPL_POS (0U) +#define USBFS_DOEPINT11_XFERCOMPL (0x00000001UL) +#define USBFS_DOEPINT11_EPDISBLD_POS (1U) +#define USBFS_DOEPINT11_EPDISBLD (0x00000002UL) +#define USBFS_DOEPINT11_AHBERR_POS (2U) +#define USBFS_DOEPINT11_AHBERR (0x00000004UL) +#define USBFS_DOEPINT11_SETUP_POS (3U) +#define USBFS_DOEPINT11_SETUP (0x00000008UL) +#define USBFS_DOEPINT11_OUTTKNEPDIS_POS (4U) +#define USBFS_DOEPINT11_OUTTKNEPDIS (0x00000010UL) +#define USBFS_DOEPINT11_STSPHSERCVD_POS (5U) +#define USBFS_DOEPINT11_STSPHSERCVD (0x00000020UL) +#define USBFS_DOEPINT11_BACK2BACKSETUP_POS (6U) +#define USBFS_DOEPINT11_BACK2BACKSETUP (0x00000040UL) +#define USBFS_DOEPINT11_OUTPKTERR_POS (8U) +#define USBFS_DOEPINT11_OUTPKTERR (0x00000100UL) +#define USBFS_DOEPINT11_BNAINTR_POS (9U) +#define USBFS_DOEPINT11_BNAINTR (0x00000200UL) +#define USBFS_DOEPINT11_PKTDRPSTS_POS (11U) +#define USBFS_DOEPINT11_PKTDRPSTS (0x00000800UL) +#define USBFS_DOEPINT11_BBLEERR_POS (12U) +#define USBFS_DOEPINT11_BBLEERR (0x00001000UL) +#define USBFS_DOEPINT11_NAKINTRPT_POS (13U) +#define USBFS_DOEPINT11_NAKINTRPT (0x00002000UL) +#define USBFS_DOEPINT11_NYETINTRPT_POS (14U) +#define USBFS_DOEPINT11_NYETINTRPT (0x00004000UL) +#define USBFS_DOEPINT11_STUPPKTRCVD_POS (15U) +#define USBFS_DOEPINT11_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBFS_DOEPTSIZ11 register */ +#define USBFS_DOEPTSIZ11_XFERSIZE_POS (0U) +#define USBFS_DOEPTSIZ11_XFERSIZE (0x0007FFFFUL) +#define USBFS_DOEPTSIZ11_PKTCNT_POS (19U) +#define USBFS_DOEPTSIZ11_PKTCNT (0x1FF80000UL) +#define USBFS_DOEPTSIZ11_RXDPID_POS (29U) +#define USBFS_DOEPTSIZ11_RXDPID (0x60000000UL) +#define USBFS_DOEPTSIZ11_RXDPID_0 (0x20000000UL) +#define USBFS_DOEPTSIZ11_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBFS_DOEPDMA11 register */ +#define USBFS_DOEPDMA11 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DOEPCTL12 register */ +#define USBFS_DOEPCTL12_MPS_POS (0U) +#define USBFS_DOEPCTL12_MPS (0x000007FFUL) +#define USBFS_DOEPCTL12_USBACTEP_POS (15U) +#define USBFS_DOEPCTL12_USBACTEP (0x00008000UL) +#define USBFS_DOEPCTL12_DPID_POS (16U) +#define USBFS_DOEPCTL12_DPID (0x00010000UL) +#define USBFS_DOEPCTL12_NAKSTS_POS (17U) +#define USBFS_DOEPCTL12_NAKSTS (0x00020000UL) +#define USBFS_DOEPCTL12_EPTYPE_POS (18U) +#define USBFS_DOEPCTL12_EPTYPE (0x000C0000UL) +#define USBFS_DOEPCTL12_EPTYPE_0 (0x00040000UL) +#define USBFS_DOEPCTL12_EPTYPE_1 (0x00080000UL) +#define USBFS_DOEPCTL12_SNP_POS (20U) +#define USBFS_DOEPCTL12_SNP (0x00100000UL) +#define USBFS_DOEPCTL12_STALL_POS (21U) +#define USBFS_DOEPCTL12_STALL (0x00200000UL) +#define USBFS_DOEPCTL12_CNAK_POS (26U) +#define USBFS_DOEPCTL12_CNAK (0x04000000UL) +#define USBFS_DOEPCTL12_SNAK_POS (27U) +#define USBFS_DOEPCTL12_SNAK (0x08000000UL) +#define USBFS_DOEPCTL12_SETD0PID_POS (28U) +#define USBFS_DOEPCTL12_SETD0PID (0x10000000UL) +#define USBFS_DOEPCTL12_SETD1PID_POS (29U) +#define USBFS_DOEPCTL12_SETD1PID (0x20000000UL) +#define USBFS_DOEPCTL12_EPDIS_POS (30U) +#define USBFS_DOEPCTL12_EPDIS (0x40000000UL) +#define USBFS_DOEPCTL12_EPENA_POS (31U) +#define USBFS_DOEPCTL12_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DOEPINT12 register */ +#define USBFS_DOEPINT12_XFERCOMPL_POS (0U) +#define USBFS_DOEPINT12_XFERCOMPL (0x00000001UL) +#define USBFS_DOEPINT12_EPDISBLD_POS (1U) +#define USBFS_DOEPINT12_EPDISBLD (0x00000002UL) +#define USBFS_DOEPINT12_AHBERR_POS (2U) +#define USBFS_DOEPINT12_AHBERR (0x00000004UL) +#define USBFS_DOEPINT12_SETUP_POS (3U) +#define USBFS_DOEPINT12_SETUP (0x00000008UL) +#define USBFS_DOEPINT12_OUTTKNEPDIS_POS (4U) +#define USBFS_DOEPINT12_OUTTKNEPDIS (0x00000010UL) +#define USBFS_DOEPINT12_STSPHSERCVD_POS (5U) +#define USBFS_DOEPINT12_STSPHSERCVD (0x00000020UL) +#define USBFS_DOEPINT12_BACK2BACKSETUP_POS (6U) +#define USBFS_DOEPINT12_BACK2BACKSETUP (0x00000040UL) +#define USBFS_DOEPINT12_OUTPKTERR_POS (8U) +#define USBFS_DOEPINT12_OUTPKTERR (0x00000100UL) +#define USBFS_DOEPINT12_BNAINTR_POS (9U) +#define USBFS_DOEPINT12_BNAINTR (0x00000200UL) +#define USBFS_DOEPINT12_PKTDRPSTS_POS (11U) +#define USBFS_DOEPINT12_PKTDRPSTS (0x00000800UL) +#define USBFS_DOEPINT12_BBLEERR_POS (12U) +#define USBFS_DOEPINT12_BBLEERR (0x00001000UL) +#define USBFS_DOEPINT12_NAKINTRPT_POS (13U) +#define USBFS_DOEPINT12_NAKINTRPT (0x00002000UL) +#define USBFS_DOEPINT12_NYETINTRPT_POS (14U) +#define USBFS_DOEPINT12_NYETINTRPT (0x00004000UL) +#define USBFS_DOEPINT12_STUPPKTRCVD_POS (15U) +#define USBFS_DOEPINT12_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBFS_DOEPTSIZ12 register */ +#define USBFS_DOEPTSIZ12_XFERSIZE_POS (0U) +#define USBFS_DOEPTSIZ12_XFERSIZE (0x0007FFFFUL) +#define USBFS_DOEPTSIZ12_PKTCNT_POS (19U) +#define USBFS_DOEPTSIZ12_PKTCNT (0x1FF80000UL) +#define USBFS_DOEPTSIZ12_RXDPID_POS (29U) +#define USBFS_DOEPTSIZ12_RXDPID (0x60000000UL) +#define USBFS_DOEPTSIZ12_RXDPID_0 (0x20000000UL) +#define USBFS_DOEPTSIZ12_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBFS_DOEPDMA12 register */ +#define USBFS_DOEPDMA12 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DOEPCTL13 register */ +#define USBFS_DOEPCTL13_MPS_POS (0U) +#define USBFS_DOEPCTL13_MPS (0x000007FFUL) +#define USBFS_DOEPCTL13_USBACTEP_POS (15U) +#define USBFS_DOEPCTL13_USBACTEP (0x00008000UL) +#define USBFS_DOEPCTL13_DPID_POS (16U) +#define USBFS_DOEPCTL13_DPID (0x00010000UL) +#define USBFS_DOEPCTL13_NAKSTS_POS (17U) +#define USBFS_DOEPCTL13_NAKSTS (0x00020000UL) +#define USBFS_DOEPCTL13_EPTYPE_POS (18U) +#define USBFS_DOEPCTL13_EPTYPE (0x000C0000UL) +#define USBFS_DOEPCTL13_EPTYPE_0 (0x00040000UL) +#define USBFS_DOEPCTL13_EPTYPE_1 (0x00080000UL) +#define USBFS_DOEPCTL13_SNP_POS (20U) +#define USBFS_DOEPCTL13_SNP (0x00100000UL) +#define USBFS_DOEPCTL13_STALL_POS (21U) +#define USBFS_DOEPCTL13_STALL (0x00200000UL) +#define USBFS_DOEPCTL13_CNAK_POS (26U) +#define USBFS_DOEPCTL13_CNAK (0x04000000UL) +#define USBFS_DOEPCTL13_SNAK_POS (27U) +#define USBFS_DOEPCTL13_SNAK (0x08000000UL) +#define USBFS_DOEPCTL13_SETD0PID_POS (28U) +#define USBFS_DOEPCTL13_SETD0PID (0x10000000UL) +#define USBFS_DOEPCTL13_SETD1PID_POS (29U) +#define USBFS_DOEPCTL13_SETD1PID (0x20000000UL) +#define USBFS_DOEPCTL13_EPDIS_POS (30U) +#define USBFS_DOEPCTL13_EPDIS (0x40000000UL) +#define USBFS_DOEPCTL13_EPENA_POS (31U) +#define USBFS_DOEPCTL13_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DOEPINT13 register */ +#define USBFS_DOEPINT13_XFERCOMPL_POS (0U) +#define USBFS_DOEPINT13_XFERCOMPL (0x00000001UL) +#define USBFS_DOEPINT13_EPDISBLD_POS (1U) +#define USBFS_DOEPINT13_EPDISBLD (0x00000002UL) +#define USBFS_DOEPINT13_AHBERR_POS (2U) +#define USBFS_DOEPINT13_AHBERR (0x00000004UL) +#define USBFS_DOEPINT13_SETUP_POS (3U) +#define USBFS_DOEPINT13_SETUP (0x00000008UL) +#define USBFS_DOEPINT13_OUTTKNEPDIS_POS (4U) +#define USBFS_DOEPINT13_OUTTKNEPDIS (0x00000010UL) +#define USBFS_DOEPINT13_STSPHSERCVD_POS (5U) +#define USBFS_DOEPINT13_STSPHSERCVD (0x00000020UL) +#define USBFS_DOEPINT13_BACK2BACKSETUP_POS (6U) +#define USBFS_DOEPINT13_BACK2BACKSETUP (0x00000040UL) +#define USBFS_DOEPINT13_OUTPKTERR_POS (8U) +#define USBFS_DOEPINT13_OUTPKTERR (0x00000100UL) +#define USBFS_DOEPINT13_BNAINTR_POS (9U) +#define USBFS_DOEPINT13_BNAINTR (0x00000200UL) +#define USBFS_DOEPINT13_PKTDRPSTS_POS (11U) +#define USBFS_DOEPINT13_PKTDRPSTS (0x00000800UL) +#define USBFS_DOEPINT13_BBLEERR_POS (12U) +#define USBFS_DOEPINT13_BBLEERR (0x00001000UL) +#define USBFS_DOEPINT13_NAKINTRPT_POS (13U) +#define USBFS_DOEPINT13_NAKINTRPT (0x00002000UL) +#define USBFS_DOEPINT13_NYETINTRPT_POS (14U) +#define USBFS_DOEPINT13_NYETINTRPT (0x00004000UL) +#define USBFS_DOEPINT13_STUPPKTRCVD_POS (15U) +#define USBFS_DOEPINT13_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBFS_DOEPTSIZ13 register */ +#define USBFS_DOEPTSIZ13_XFERSIZE_POS (0U) +#define USBFS_DOEPTSIZ13_XFERSIZE (0x0007FFFFUL) +#define USBFS_DOEPTSIZ13_PKTCNT_POS (19U) +#define USBFS_DOEPTSIZ13_PKTCNT (0x1FF80000UL) +#define USBFS_DOEPTSIZ13_RXDPID_POS (29U) +#define USBFS_DOEPTSIZ13_RXDPID (0x60000000UL) +#define USBFS_DOEPTSIZ13_RXDPID_0 (0x20000000UL) +#define USBFS_DOEPTSIZ13_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBFS_DOEPDMA13 register */ +#define USBFS_DOEPDMA13 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DOEPCTL14 register */ +#define USBFS_DOEPCTL14_MPS_POS (0U) +#define USBFS_DOEPCTL14_MPS (0x000007FFUL) +#define USBFS_DOEPCTL14_USBACTEP_POS (15U) +#define USBFS_DOEPCTL14_USBACTEP (0x00008000UL) +#define USBFS_DOEPCTL14_DPID_POS (16U) +#define USBFS_DOEPCTL14_DPID (0x00010000UL) +#define USBFS_DOEPCTL14_NAKSTS_POS (17U) +#define USBFS_DOEPCTL14_NAKSTS (0x00020000UL) +#define USBFS_DOEPCTL14_EPTYPE_POS (18U) +#define USBFS_DOEPCTL14_EPTYPE (0x000C0000UL) +#define USBFS_DOEPCTL14_EPTYPE_0 (0x00040000UL) +#define USBFS_DOEPCTL14_EPTYPE_1 (0x00080000UL) +#define USBFS_DOEPCTL14_SNP_POS (20U) +#define USBFS_DOEPCTL14_SNP (0x00100000UL) +#define USBFS_DOEPCTL14_STALL_POS (21U) +#define USBFS_DOEPCTL14_STALL (0x00200000UL) +#define USBFS_DOEPCTL14_CNAK_POS (26U) +#define USBFS_DOEPCTL14_CNAK (0x04000000UL) +#define USBFS_DOEPCTL14_SNAK_POS (27U) +#define USBFS_DOEPCTL14_SNAK (0x08000000UL) +#define USBFS_DOEPCTL14_SETD0PID_POS (28U) +#define USBFS_DOEPCTL14_SETD0PID (0x10000000UL) +#define USBFS_DOEPCTL14_SETD1PID_POS (29U) +#define USBFS_DOEPCTL14_SETD1PID (0x20000000UL) +#define USBFS_DOEPCTL14_EPDIS_POS (30U) +#define USBFS_DOEPCTL14_EPDIS (0x40000000UL) +#define USBFS_DOEPCTL14_EPENA_POS (31U) +#define USBFS_DOEPCTL14_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DOEPINT14 register */ +#define USBFS_DOEPINT14_XFERCOMPL_POS (0U) +#define USBFS_DOEPINT14_XFERCOMPL (0x00000001UL) +#define USBFS_DOEPINT14_EPDISBLD_POS (1U) +#define USBFS_DOEPINT14_EPDISBLD (0x00000002UL) +#define USBFS_DOEPINT14_AHBERR_POS (2U) +#define USBFS_DOEPINT14_AHBERR (0x00000004UL) +#define USBFS_DOEPINT14_SETUP_POS (3U) +#define USBFS_DOEPINT14_SETUP (0x00000008UL) +#define USBFS_DOEPINT14_OUTTKNEPDIS_POS (4U) +#define USBFS_DOEPINT14_OUTTKNEPDIS (0x00000010UL) +#define USBFS_DOEPINT14_STSPHSERCVD_POS (5U) +#define USBFS_DOEPINT14_STSPHSERCVD (0x00000020UL) +#define USBFS_DOEPINT14_BACK2BACKSETUP_POS (6U) +#define USBFS_DOEPINT14_BACK2BACKSETUP (0x00000040UL) +#define USBFS_DOEPINT14_OUTPKTERR_POS (8U) +#define USBFS_DOEPINT14_OUTPKTERR (0x00000100UL) +#define USBFS_DOEPINT14_BNAINTR_POS (9U) +#define USBFS_DOEPINT14_BNAINTR (0x00000200UL) +#define USBFS_DOEPINT14_PKTDRPSTS_POS (11U) +#define USBFS_DOEPINT14_PKTDRPSTS (0x00000800UL) +#define USBFS_DOEPINT14_BBLEERR_POS (12U) +#define USBFS_DOEPINT14_BBLEERR (0x00001000UL) +#define USBFS_DOEPINT14_NAKINTRPT_POS (13U) +#define USBFS_DOEPINT14_NAKINTRPT (0x00002000UL) +#define USBFS_DOEPINT14_NYETINTRPT_POS (14U) +#define USBFS_DOEPINT14_NYETINTRPT (0x00004000UL) +#define USBFS_DOEPINT14_STUPPKTRCVD_POS (15U) +#define USBFS_DOEPINT14_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBFS_DOEPTSIZ14 register */ +#define USBFS_DOEPTSIZ14_XFERSIZE_POS (0U) +#define USBFS_DOEPTSIZ14_XFERSIZE (0x0007FFFFUL) +#define USBFS_DOEPTSIZ14_PKTCNT_POS (19U) +#define USBFS_DOEPTSIZ14_PKTCNT (0x1FF80000UL) +#define USBFS_DOEPTSIZ14_RXDPID_POS (29U) +#define USBFS_DOEPTSIZ14_RXDPID (0x60000000UL) +#define USBFS_DOEPTSIZ14_RXDPID_0 (0x20000000UL) +#define USBFS_DOEPTSIZ14_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBFS_DOEPDMA14 register */ +#define USBFS_DOEPDMA14 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_DOEPCTL15 register */ +#define USBFS_DOEPCTL15_MPS_POS (0U) +#define USBFS_DOEPCTL15_MPS (0x000007FFUL) +#define USBFS_DOEPCTL15_USBACTEP_POS (15U) +#define USBFS_DOEPCTL15_USBACTEP (0x00008000UL) +#define USBFS_DOEPCTL15_DPID_POS (16U) +#define USBFS_DOEPCTL15_DPID (0x00010000UL) +#define USBFS_DOEPCTL15_NAKSTS_POS (17U) +#define USBFS_DOEPCTL15_NAKSTS (0x00020000UL) +#define USBFS_DOEPCTL15_EPTYPE_POS (18U) +#define USBFS_DOEPCTL15_EPTYPE (0x000C0000UL) +#define USBFS_DOEPCTL15_EPTYPE_0 (0x00040000UL) +#define USBFS_DOEPCTL15_EPTYPE_1 (0x00080000UL) +#define USBFS_DOEPCTL15_SNP_POS (20U) +#define USBFS_DOEPCTL15_SNP (0x00100000UL) +#define USBFS_DOEPCTL15_STALL_POS (21U) +#define USBFS_DOEPCTL15_STALL (0x00200000UL) +#define USBFS_DOEPCTL15_CNAK_POS (26U) +#define USBFS_DOEPCTL15_CNAK (0x04000000UL) +#define USBFS_DOEPCTL15_SNAK_POS (27U) +#define USBFS_DOEPCTL15_SNAK (0x08000000UL) +#define USBFS_DOEPCTL15_SETD0PID_POS (28U) +#define USBFS_DOEPCTL15_SETD0PID (0x10000000UL) +#define USBFS_DOEPCTL15_SETD1PID_POS (29U) +#define USBFS_DOEPCTL15_SETD1PID (0x20000000UL) +#define USBFS_DOEPCTL15_EPDIS_POS (30U) +#define USBFS_DOEPCTL15_EPDIS (0x40000000UL) +#define USBFS_DOEPCTL15_EPENA_POS (31U) +#define USBFS_DOEPCTL15_EPENA (0x80000000UL) + +/* Bit definition for USBFS_DOEPINT15 register */ +#define USBFS_DOEPINT15_XFERCOMPL_POS (0U) +#define USBFS_DOEPINT15_XFERCOMPL (0x00000001UL) +#define USBFS_DOEPINT15_EPDISBLD_POS (1U) +#define USBFS_DOEPINT15_EPDISBLD (0x00000002UL) +#define USBFS_DOEPINT15_AHBERR_POS (2U) +#define USBFS_DOEPINT15_AHBERR (0x00000004UL) +#define USBFS_DOEPINT15_SETUP_POS (3U) +#define USBFS_DOEPINT15_SETUP (0x00000008UL) +#define USBFS_DOEPINT15_OUTTKNEPDIS_POS (4U) +#define USBFS_DOEPINT15_OUTTKNEPDIS (0x00000010UL) +#define USBFS_DOEPINT15_STSPHSERCVD_POS (5U) +#define USBFS_DOEPINT15_STSPHSERCVD (0x00000020UL) +#define USBFS_DOEPINT15_BACK2BACKSETUP_POS (6U) +#define USBFS_DOEPINT15_BACK2BACKSETUP (0x00000040UL) +#define USBFS_DOEPINT15_OUTPKTERR_POS (8U) +#define USBFS_DOEPINT15_OUTPKTERR (0x00000100UL) +#define USBFS_DOEPINT15_BNAINTR_POS (9U) +#define USBFS_DOEPINT15_BNAINTR (0x00000200UL) +#define USBFS_DOEPINT15_PKTDRPSTS_POS (11U) +#define USBFS_DOEPINT15_PKTDRPSTS (0x00000800UL) +#define USBFS_DOEPINT15_BBLEERR_POS (12U) +#define USBFS_DOEPINT15_BBLEERR (0x00001000UL) +#define USBFS_DOEPINT15_NAKINTRPT_POS (13U) +#define USBFS_DOEPINT15_NAKINTRPT (0x00002000UL) +#define USBFS_DOEPINT15_NYETINTRPT_POS (14U) +#define USBFS_DOEPINT15_NYETINTRPT (0x00004000UL) +#define USBFS_DOEPINT15_STUPPKTRCVD_POS (15U) +#define USBFS_DOEPINT15_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBFS_DOEPTSIZ15 register */ +#define USBFS_DOEPTSIZ15_XFERSIZE_POS (0U) +#define USBFS_DOEPTSIZ15_XFERSIZE (0x0007FFFFUL) +#define USBFS_DOEPTSIZ15_PKTCNT_POS (19U) +#define USBFS_DOEPTSIZ15_PKTCNT (0x1FF80000UL) +#define USBFS_DOEPTSIZ15_RXDPID_POS (29U) +#define USBFS_DOEPTSIZ15_RXDPID (0x60000000UL) +#define USBFS_DOEPTSIZ15_RXDPID_0 (0x20000000UL) +#define USBFS_DOEPTSIZ15_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBFS_DOEPDMA15 register */ +#define USBFS_DOEPDMA15 (0xFFFFFFFFUL) + +/* Bit definition for USBFS_PCGCCTL register */ +#define USBFS_PCGCCTL_STOPPCLK_POS (0U) +#define USBFS_PCGCCTL_STOPPCLK (0x00000001UL) +#define USBFS_PCGCCTL_GATEHCLK_POS (1U) +#define USBFS_PCGCCTL_GATEHCLK (0x00000002UL) +#define USBFS_PCGCCTL_PWRCLMP_POS (2U) +#define USBFS_PCGCCTL_PWRCLMP (0x00000004UL) +#define USBFS_PCGCCTL_RSTPDWNMODULE_POS (3U) +#define USBFS_PCGCCTL_RSTPDWNMODULE (0x00000008UL) +#define USBFS_PCGCCTL_ENBL_L1GATING_POS (5U) +#define USBFS_PCGCCTL_ENBL_L1GATING (0x00000020UL) +#define USBFS_PCGCCTL_PHYSLEEP_POS (6U) +#define USBFS_PCGCCTL_PHYSLEEP (0x00000040UL) +#define USBFS_PCGCCTL_L1SUSPENDED_POS (7U) +#define USBFS_PCGCCTL_L1SUSPENDED (0x00000080UL) +#define USBFS_PCGCCTL_RESETAFTERSUSP_POS (8U) +#define USBFS_PCGCCTL_RESETAFTERSUSP (0x00000100UL) + +/******************************************************************************* + Bit definition for Peripheral USBHS +*******************************************************************************/ +/* Bit definition for USBHS_GOTGCTL register */ +#define USBHS_GOTGCTL_SESREQSCS_POS (0U) +#define USBHS_GOTGCTL_SESREQSCS (0x00000001UL) +#define USBHS_GOTGCTL_SESREQ_POS (1U) +#define USBHS_GOTGCTL_SESREQ (0x00000002UL) +#define USBHS_GOTGCTL_VBVALIDOVEN_POS (2U) +#define USBHS_GOTGCTL_VBVALIDOVEN (0x00000004UL) +#define USBHS_GOTGCTL_VBVALIDOVVAL_POS (3U) +#define USBHS_GOTGCTL_VBVALIDOVVAL (0x00000008UL) +#define USBHS_GOTGCTL_AVALIDOVEN_POS (4U) +#define USBHS_GOTGCTL_AVALIDOVEN (0x00000010UL) +#define USBHS_GOTGCTL_AVALIDOVVAL_POS (5U) +#define USBHS_GOTGCTL_AVALIDOVVAL (0x00000020UL) +#define USBHS_GOTGCTL_BVALIDOVEN_POS (6U) +#define USBHS_GOTGCTL_BVALIDOVEN (0x00000040UL) +#define USBHS_GOTGCTL_BVALIDOVVAL_POS (7U) +#define USBHS_GOTGCTL_BVALIDOVVAL (0x00000080UL) +#define USBHS_GOTGCTL_HSTNEGSCS_POS (8U) +#define USBHS_GOTGCTL_HSTNEGSCS (0x00000100UL) +#define USBHS_GOTGCTL_HNPREQ_POS (9U) +#define USBHS_GOTGCTL_HNPREQ (0x00000200UL) +#define USBHS_GOTGCTL_HSTSETHNPEN_POS (10U) +#define USBHS_GOTGCTL_HSTSETHNPEN (0x00000400UL) +#define USBHS_GOTGCTL_DEVHNPEN_POS (11U) +#define USBHS_GOTGCTL_DEVHNPEN (0x00000800UL) +#define USBHS_GOTGCTL_EHEN_POS (12U) +#define USBHS_GOTGCTL_EHEN (0x00001000UL) +#define USBHS_GOTGCTL_DBNCEFLTRBYPASS_POS (15U) +#define USBHS_GOTGCTL_DBNCEFLTRBYPASS (0x00008000UL) +#define USBHS_GOTGCTL_CONIDSTS_POS (16U) +#define USBHS_GOTGCTL_CONIDSTS (0x00010000UL) +#define USBHS_GOTGCTL_DBNCTIME_POS (17U) +#define USBHS_GOTGCTL_DBNCTIME (0x00020000UL) +#define USBHS_GOTGCTL_ASESVLD_POS (18U) +#define USBHS_GOTGCTL_ASESVLD (0x00040000UL) +#define USBHS_GOTGCTL_BSESVLD_POS (19U) +#define USBHS_GOTGCTL_BSESVLD (0x00080000UL) +#define USBHS_GOTGCTL_OTGVER_POS (20U) +#define USBHS_GOTGCTL_OTGVER (0x00100000UL) +#define USBHS_GOTGCTL_CURMOD_POS (21U) +#define USBHS_GOTGCTL_CURMOD (0x00200000UL) +#define USBHS_GOTGCTL_TESTMODE_CORR_EUSB2_POS (31U) +#define USBHS_GOTGCTL_TESTMODE_CORR_EUSB2 (0x80000000UL) + +/* Bit definition for USBHS_GOTGINT register */ +#define USBHS_GOTGINT_SESENDDET_POS (2U) +#define USBHS_GOTGINT_SESENDDET (0x00000004UL) +#define USBHS_GOTGINT_SESREQSUCSTSCHNG_POS (8U) +#define USBHS_GOTGINT_SESREQSUCSTSCHNG (0x00000100UL) +#define USBHS_GOTGINT_HSTNEGSUCSTSCHNG_POS (9U) +#define USBHS_GOTGINT_HSTNEGSUCSTSCHNG (0x00000200UL) +#define USBHS_GOTGINT_HSTNEGDET_POS (17U) +#define USBHS_GOTGINT_HSTNEGDET (0x00020000UL) +#define USBHS_GOTGINT_ADEVTOUTCHG_POS (18U) +#define USBHS_GOTGINT_ADEVTOUTCHG (0x00040000UL) +#define USBHS_GOTGINT_DBNCEDONE_POS (19U) +#define USBHS_GOTGINT_DBNCEDONE (0x00080000UL) + +/* Bit definition for USBHS_GAHBCFG register */ +#define USBHS_GAHBCFG_GLBLINTRMSK_POS (0U) +#define USBHS_GAHBCFG_GLBLINTRMSK (0x00000001UL) +#define USBHS_GAHBCFG_HBSTLEN_POS (1U) +#define USBHS_GAHBCFG_HBSTLEN (0x0000001EUL) +#define USBHS_GAHBCFG_HBSTLEN_0 (0x00000002UL) +#define USBHS_GAHBCFG_HBSTLEN_1 (0x00000004UL) +#define USBHS_GAHBCFG_HBSTLEN_2 (0x00000008UL) +#define USBHS_GAHBCFG_HBSTLEN_3 (0x00000010UL) +#define USBHS_GAHBCFG_DMAEN_POS (5U) +#define USBHS_GAHBCFG_DMAEN (0x00000020UL) +#define USBHS_GAHBCFG_NPTXFEMPLVL_POS (7U) +#define USBHS_GAHBCFG_NPTXFEMPLVL (0x00000080UL) +#define USBHS_GAHBCFG_PTXFEMPLVL_POS (8U) +#define USBHS_GAHBCFG_PTXFEMPLVL (0x00000100UL) +#define USBHS_GAHBCFG_REMMEMSUPP_POS (21U) +#define USBHS_GAHBCFG_REMMEMSUPP (0x00200000UL) +#define USBHS_GAHBCFG_NOTIALLDMAWRIT_POS (22U) +#define USBHS_GAHBCFG_NOTIALLDMAWRIT (0x00400000UL) +#define USBHS_GAHBCFG_AHBSINGLE_POS (23U) +#define USBHS_GAHBCFG_AHBSINGLE (0x00800000UL) + +/* Bit definition for USBHS_GUSBCFG register */ +#define USBHS_GUSBCFG_TOUTCAL_POS (0U) +#define USBHS_GUSBCFG_TOUTCAL (0x00000007UL) +#define USBHS_GUSBCFG_TOUTCAL_0 (0x00000001UL) +#define USBHS_GUSBCFG_TOUTCAL_1 (0x00000002UL) +#define USBHS_GUSBCFG_TOUTCAL_2 (0x00000004UL) +#define USBHS_GUSBCFG_PHYIF_POS (3U) +#define USBHS_GUSBCFG_PHYIF (0x00000008UL) +#define USBHS_GUSBCFG_ULPI_UTMI_SEL_POS (4U) +#define USBHS_GUSBCFG_ULPI_UTMI_SEL (0x00000010UL) +#define USBHS_GUSBCFG_FSINTF_POS (5U) +#define USBHS_GUSBCFG_FSINTF (0x00000020UL) +#define USBHS_GUSBCFG_PHYSEL_POS (6U) +#define USBHS_GUSBCFG_PHYSEL (0x00000040UL) +#define USBHS_GUSBCFG_DDRSEL_POS (7U) +#define USBHS_GUSBCFG_DDRSEL (0x00000080UL) +#define USBHS_GUSBCFG_SRPCAP_POS (8U) +#define USBHS_GUSBCFG_SRPCAP (0x00000100UL) +#define USBHS_GUSBCFG_HNPCAP_POS (9U) +#define USBHS_GUSBCFG_HNPCAP (0x00000200UL) +#define USBHS_GUSBCFG_USBTRDTIM_POS (10U) +#define USBHS_GUSBCFG_USBTRDTIM (0x00003C00UL) +#define USBHS_GUSBCFG_USBTRDTIM_0 (0x00000400UL) +#define USBHS_GUSBCFG_USBTRDTIM_1 (0x00000800UL) +#define USBHS_GUSBCFG_USBTRDTIM_2 (0x00001000UL) +#define USBHS_GUSBCFG_USBTRDTIM_3 (0x00002000UL) +#define USBHS_GUSBCFG_ULPIFSLS_POS (17U) +#define USBHS_GUSBCFG_ULPIFSLS (0x00020000UL) +#define USBHS_GUSBCFG_ULPIAUTORES_POS (18U) +#define USBHS_GUSBCFG_ULPIAUTORES (0x00040000UL) +#define USBHS_GUSBCFG_ULPICLKSUSM_POS (19U) +#define USBHS_GUSBCFG_ULPICLKSUSM (0x00080000UL) +#define USBHS_GUSBCFG_ULPIEXTVBUSDRV_POS (20U) +#define USBHS_GUSBCFG_ULPIEXTVBUSDRV (0x00100000UL) +#define USBHS_GUSBCFG_ULPIEXTVBUSINDICATOR_POS (21U) +#define USBHS_GUSBCFG_ULPIEXTVBUSINDICATOR (0x00200000UL) +#define USBHS_GUSBCFG_TERMSELDLPULSE_POS (22U) +#define USBHS_GUSBCFG_TERMSELDLPULSE (0x00400000UL) +#define USBHS_GUSBCFG_COMPLEMENT_POS (23U) +#define USBHS_GUSBCFG_COMPLEMENT (0x00800000UL) +#define USBHS_GUSBCFG_INDICATOR_POS (24U) +#define USBHS_GUSBCFG_INDICATOR (0x01000000UL) +#define USBHS_GUSBCFG_ULPI_POS (25U) +#define USBHS_GUSBCFG_ULPI (0x02000000UL) +#define USBHS_GUSBCFG_IC_USBCAP_POS (26U) +#define USBHS_GUSBCFG_IC_USBCAP (0x04000000UL) +#define USBHS_GUSBCFG_TXENDDELAY_POS (28U) +#define USBHS_GUSBCFG_TXENDDELAY (0x10000000UL) +#define USBHS_GUSBCFG_FORCEHSTMODE_POS (29U) +#define USBHS_GUSBCFG_FORCEHSTMODE (0x20000000UL) +#define USBHS_GUSBCFG_FORCEDEVMODE_POS (30U) +#define USBHS_GUSBCFG_FORCEDEVMODE (0x40000000UL) +#define USBHS_GUSBCFG_CORRUPTTXPKT_POS (31U) +#define USBHS_GUSBCFG_CORRUPTTXPKT (0x80000000UL) + +/* Bit definition for USBHS_GRSTCTL register */ +#define USBHS_GRSTCTL_CSFTRST_POS (0U) +#define USBHS_GRSTCTL_CSFTRST (0x00000001UL) +#define USBHS_GRSTCTL_PIUFSSFTRST_POS (1U) +#define USBHS_GRSTCTL_PIUFSSFTRST (0x00000002UL) +#define USBHS_GRSTCTL_FRMCNTRRST_POS (2U) +#define USBHS_GRSTCTL_FRMCNTRRST (0x00000004UL) +#define USBHS_GRSTCTL_RXFFLSH_POS (4U) +#define USBHS_GRSTCTL_RXFFLSH (0x00000010UL) +#define USBHS_GRSTCTL_TXFFLSH_POS (5U) +#define USBHS_GRSTCTL_TXFFLSH (0x00000020UL) +#define USBHS_GRSTCTL_TXFNUM_POS (6U) +#define USBHS_GRSTCTL_TXFNUM (0x000007C0UL) +#define USBHS_GRSTCTL_TXFNUM_0 (0x00000040UL) +#define USBHS_GRSTCTL_TXFNUM_1 (0x00000080UL) +#define USBHS_GRSTCTL_TXFNUM_2 (0x00000100UL) +#define USBHS_GRSTCTL_TXFNUM_3 (0x00000200UL) +#define USBHS_GRSTCTL_TXFNUM_4 (0x00000400UL) +#define USBHS_GRSTCTL_DMAREQ_POS (30U) +#define USBHS_GRSTCTL_DMAREQ (0x40000000UL) +#define USBHS_GRSTCTL_AHBIDLE_POS (31U) +#define USBHS_GRSTCTL_AHBIDLE (0x80000000UL) + +/* Bit definition for USBHS_GINTSTS register */ +#define USBHS_GINTSTS_CURMOD_POS (0U) +#define USBHS_GINTSTS_CURMOD (0x00000001UL) +#define USBHS_GINTSTS_MODEMIS_POS (1U) +#define USBHS_GINTSTS_MODEMIS (0x00000002UL) +#define USBHS_GINTSTS_OTGINT_POS (2U) +#define USBHS_GINTSTS_OTGINT (0x00000004UL) +#define USBHS_GINTSTS_SOF_POS (3U) +#define USBHS_GINTSTS_SOF (0x00000008UL) +#define USBHS_GINTSTS_RXFLVL_POS (4U) +#define USBHS_GINTSTS_RXFLVL (0x00000010UL) +#define USBHS_GINTSTS_NPTXFEMP_POS (5U) +#define USBHS_GINTSTS_NPTXFEMP (0x00000020UL) +#define USBHS_GINTSTS_GINNAKEFF_POS (6U) +#define USBHS_GINTSTS_GINNAKEFF (0x00000040UL) +#define USBHS_GINTSTS_GOUTNAKEFF_POS (7U) +#define USBHS_GINTSTS_GOUTNAKEFF (0x00000080UL) +#define USBHS_GINTSTS_ERLYSUSP_POS (10U) +#define USBHS_GINTSTS_ERLYSUSP (0x00000400UL) +#define USBHS_GINTSTS_USBSUSP_POS (11U) +#define USBHS_GINTSTS_USBSUSP (0x00000800UL) +#define USBHS_GINTSTS_USBRST_POS (12U) +#define USBHS_GINTSTS_USBRST (0x00001000UL) +#define USBHS_GINTSTS_ENUMDONE_POS (13U) +#define USBHS_GINTSTS_ENUMDONE (0x00002000UL) +#define USBHS_GINTSTS_ISOOUTDROP_POS (14U) +#define USBHS_GINTSTS_ISOOUTDROP (0x00004000UL) +#define USBHS_GINTSTS_EOPF_POS (15U) +#define USBHS_GINTSTS_EOPF (0x00008000UL) +#define USBHS_GINTSTS_EPMIS_POS (17U) +#define USBHS_GINTSTS_EPMIS (0x00020000UL) +#define USBHS_GINTSTS_IEPINT_POS (18U) +#define USBHS_GINTSTS_IEPINT (0x00040000UL) +#define USBHS_GINTSTS_OEPINT_POS (19U) +#define USBHS_GINTSTS_OEPINT (0x00080000UL) +#define USBHS_GINTSTS_INCOMPISOIN_POS (20U) +#define USBHS_GINTSTS_INCOMPISOIN (0x00100000UL) +#define USBHS_GINTSTS_INCOMPLP_POS (21U) +#define USBHS_GINTSTS_INCOMPLP (0x00200000UL) +#define USBHS_GINTSTS_FETSUSP_POS (22U) +#define USBHS_GINTSTS_FETSUSP (0x00400000UL) +#define USBHS_GINTSTS_RESETDET_POS (23U) +#define USBHS_GINTSTS_RESETDET (0x00800000UL) +#define USBHS_GINTSTS_PRTINT_POS (24U) +#define USBHS_GINTSTS_PRTINT (0x01000000UL) +#define USBHS_GINTSTS_HCHINT_POS (25U) +#define USBHS_GINTSTS_HCHINT (0x02000000UL) +#define USBHS_GINTSTS_PTXFEMP_POS (26U) +#define USBHS_GINTSTS_PTXFEMP (0x04000000UL) +#define USBHS_GINTSTS_LPM_INT_POS (27U) +#define USBHS_GINTSTS_LPM_INT (0x08000000UL) +#define USBHS_GINTSTS_CONIDSTSCHNG_POS (28U) +#define USBHS_GINTSTS_CONIDSTSCHNG (0x10000000UL) +#define USBHS_GINTSTS_DISCONNINT_POS (29U) +#define USBHS_GINTSTS_DISCONNINT (0x20000000UL) +#define USBHS_GINTSTS_SESSREQINT_POS (30U) +#define USBHS_GINTSTS_SESSREQINT (0x40000000UL) +#define USBHS_GINTSTS_WKUPINT_POS (31U) +#define USBHS_GINTSTS_WKUPINT (0x80000000UL) + +/* Bit definition for USBHS_GINTMSK register */ +#define USBHS_GINTMSK_MODEMISMSK_POS (1U) +#define USBHS_GINTMSK_MODEMISMSK (0x00000002UL) +#define USBHS_GINTMSK_OTGINTMSK_POS (2U) +#define USBHS_GINTMSK_OTGINTMSK (0x00000004UL) +#define USBHS_GINTMSK_SOFMSK_POS (3U) +#define USBHS_GINTMSK_SOFMSK (0x00000008UL) +#define USBHS_GINTMSK_RXFLVLMSK_POS (4U) +#define USBHS_GINTMSK_RXFLVLMSK (0x00000010UL) +#define USBHS_GINTMSK_NPTXFEMPMSK_POS (5U) +#define USBHS_GINTMSK_NPTXFEMPMSK (0x00000020UL) +#define USBHS_GINTMSK_GINNAKEFFMSK_POS (6U) +#define USBHS_GINTMSK_GINNAKEFFMSK (0x00000040UL) +#define USBHS_GINTMSK_GOUTNAKEFFMSK_POS (7U) +#define USBHS_GINTMSK_GOUTNAKEFFMSK (0x00000080UL) +#define USBHS_GINTMSK_ERLYSUSPMSK_POS (10U) +#define USBHS_GINTMSK_ERLYSUSPMSK (0x00000400UL) +#define USBHS_GINTMSK_USBSUSPMSK_POS (11U) +#define USBHS_GINTMSK_USBSUSPMSK (0x00000800UL) +#define USBHS_GINTMSK_USBRSTMSK_POS (12U) +#define USBHS_GINTMSK_USBRSTMSK (0x00001000UL) +#define USBHS_GINTMSK_ENUMDONEMSK_POS (13U) +#define USBHS_GINTMSK_ENUMDONEMSK (0x00002000UL) +#define USBHS_GINTMSK_ISOOUTDROPMSK_POS (14U) +#define USBHS_GINTMSK_ISOOUTDROPMSK (0x00004000UL) +#define USBHS_GINTMSK_EOPFMSK_POS (15U) +#define USBHS_GINTMSK_EOPFMSK (0x00008000UL) +#define USBHS_GINTMSK_EPMISMSK_POS (17U) +#define USBHS_GINTMSK_EPMISMSK (0x00020000UL) +#define USBHS_GINTMSK_IEPINTMSK_POS (18U) +#define USBHS_GINTMSK_IEPINTMSK (0x00040000UL) +#define USBHS_GINTMSK_OEPINTMSK_POS (19U) +#define USBHS_GINTMSK_OEPINTMSK (0x00080000UL) +#define USBHS_GINTMSK_INCOMPLPMSK_POS (21U) +#define USBHS_GINTMSK_INCOMPLPMSK (0x00200000UL) +#define USBHS_GINTMSK_FETSUSPMSK_POS (22U) +#define USBHS_GINTMSK_FETSUSPMSK (0x00400000UL) +#define USBHS_GINTMSK_RESETDETMSK_POS (23U) +#define USBHS_GINTMSK_RESETDETMSK (0x00800000UL) +#define USBHS_GINTMSK_PRTINTMSK_POS (24U) +#define USBHS_GINTMSK_PRTINTMSK (0x01000000UL) +#define USBHS_GINTMSK_HCHINTMSK_POS (25U) +#define USBHS_GINTMSK_HCHINTMSK (0x02000000UL) +#define USBHS_GINTMSK_PTXFEMPMSK_POS (26U) +#define USBHS_GINTMSK_PTXFEMPMSK (0x04000000UL) +#define USBHS_GINTMSK_LPM_INTMSK_POS (27U) +#define USBHS_GINTMSK_LPM_INTMSK (0x08000000UL) +#define USBHS_GINTMSK_CONIDSTSCHNGMSK_POS (28U) +#define USBHS_GINTMSK_CONIDSTSCHNGMSK (0x10000000UL) +#define USBHS_GINTMSK_DISCONNINTMSK_POS (29U) +#define USBHS_GINTMSK_DISCONNINTMSK (0x20000000UL) +#define USBHS_GINTMSK_SESSREQINTMSK_POS (30U) +#define USBHS_GINTMSK_SESSREQINTMSK (0x40000000UL) +#define USBHS_GINTMSK_WKUPINTMSK_POS (31U) +#define USBHS_GINTMSK_WKUPINTMSK (0x80000000UL) + +/* Bit definition for USBHS_GRXSTSR register */ +#define USBHS_GRXSTSR_CHNUM_POS (0U) +#define USBHS_GRXSTSR_CHNUM (0x0000000FUL) +#define USBHS_GRXSTSR_CHNUM_0 (0x00000001UL) +#define USBHS_GRXSTSR_CHNUM_1 (0x00000002UL) +#define USBHS_GRXSTSR_CHNUM_2 (0x00000004UL) +#define USBHS_GRXSTSR_CHNUM_3 (0x00000008UL) +#define USBHS_GRXSTSR_BCNT_POS (4U) +#define USBHS_GRXSTSR_BCNT (0x00007FF0UL) +#define USBHS_GRXSTSR_BCNT_0 (0x00000010UL) +#define USBHS_GRXSTSR_BCNT_1 (0x00000020UL) +#define USBHS_GRXSTSR_BCNT_2 (0x00000040UL) +#define USBHS_GRXSTSR_BCNT_3 (0x00000080UL) +#define USBHS_GRXSTSR_BCNT_4 (0x00000100UL) +#define USBHS_GRXSTSR_BCNT_5 (0x00000200UL) +#define USBHS_GRXSTSR_BCNT_6 (0x00000400UL) +#define USBHS_GRXSTSR_BCNT_7 (0x00000800UL) +#define USBHS_GRXSTSR_BCNT_8 (0x00001000UL) +#define USBHS_GRXSTSR_BCNT_9 (0x00002000UL) +#define USBHS_GRXSTSR_BCNT_10 (0x00004000UL) +#define USBHS_GRXSTSR_DPID_POS (15U) +#define USBHS_GRXSTSR_DPID (0x00018000UL) +#define USBHS_GRXSTSR_DPID_0 (0x00008000UL) +#define USBHS_GRXSTSR_DPID_1 (0x00010000UL) +#define USBHS_GRXSTSR_PKTSTS_POS (17U) +#define USBHS_GRXSTSR_PKTSTS (0x001E0000UL) +#define USBHS_GRXSTSR_PKTSTS_0 (0x00020000UL) +#define USBHS_GRXSTSR_PKTSTS_1 (0x00040000UL) +#define USBHS_GRXSTSR_PKTSTS_2 (0x00080000UL) +#define USBHS_GRXSTSR_PKTSTS_3 (0x00100000UL) +#define USBHS_GRXSTSR_FN_POS (21U) +#define USBHS_GRXSTSR_FN (0x01E00000UL) +#define USBHS_GRXSTSR_FN_0 (0x00200000UL) +#define USBHS_GRXSTSR_FN_1 (0x00400000UL) +#define USBHS_GRXSTSR_FN_2 (0x00800000UL) +#define USBHS_GRXSTSR_FN_3 (0x01000000UL) + +/* Bit definition for USBHS_GRXSTSP register */ +#define USBHS_GRXSTSP_CHNUM_POS (0U) +#define USBHS_GRXSTSP_CHNUM (0x0000000FUL) +#define USBHS_GRXSTSP_CHNUM_0 (0x00000001UL) +#define USBHS_GRXSTSP_CHNUM_1 (0x00000002UL) +#define USBHS_GRXSTSP_CHNUM_2 (0x00000004UL) +#define USBHS_GRXSTSP_CHNUM_3 (0x00000008UL) +#define USBHS_GRXSTSP_BCNT_POS (4U) +#define USBHS_GRXSTSP_BCNT (0x00007FF0UL) +#define USBHS_GRXSTSP_BCNT_0 (0x00000010UL) +#define USBHS_GRXSTSP_BCNT_1 (0x00000020UL) +#define USBHS_GRXSTSP_BCNT_2 (0x00000040UL) +#define USBHS_GRXSTSP_BCNT_3 (0x00000080UL) +#define USBHS_GRXSTSP_BCNT_4 (0x00000100UL) +#define USBHS_GRXSTSP_BCNT_5 (0x00000200UL) +#define USBHS_GRXSTSP_BCNT_6 (0x00000400UL) +#define USBHS_GRXSTSP_BCNT_7 (0x00000800UL) +#define USBHS_GRXSTSP_BCNT_8 (0x00001000UL) +#define USBHS_GRXSTSP_BCNT_9 (0x00002000UL) +#define USBHS_GRXSTSP_BCNT_10 (0x00004000UL) +#define USBHS_GRXSTSP_DPID_POS (15U) +#define USBHS_GRXSTSP_DPID (0x00018000UL) +#define USBHS_GRXSTSP_DPID_0 (0x00008000UL) +#define USBHS_GRXSTSP_DPID_1 (0x00010000UL) +#define USBHS_GRXSTSP_PKTSTS_POS (17U) +#define USBHS_GRXSTSP_PKTSTS (0x001E0000UL) +#define USBHS_GRXSTSP_PKTSTS_0 (0x00020000UL) +#define USBHS_GRXSTSP_PKTSTS_1 (0x00040000UL) +#define USBHS_GRXSTSP_PKTSTS_2 (0x00080000UL) +#define USBHS_GRXSTSP_PKTSTS_3 (0x00100000UL) +#define USBHS_GRXSTSP_FN_POS (21U) +#define USBHS_GRXSTSP_FN (0x01E00000UL) +#define USBHS_GRXSTSP_FN_0 (0x00200000UL) +#define USBHS_GRXSTSP_FN_1 (0x00400000UL) +#define USBHS_GRXSTSP_FN_2 (0x00800000UL) +#define USBHS_GRXSTSP_FN_3 (0x01000000UL) + +/* Bit definition for USBHS_GRXFSIZ register */ +#define USBHS_GRXFSIZ_RXFDEP (0x00000FFFUL) + +/* Bit definition for USBHS_GNPTXFSIZ register */ +#define USBHS_GNPTXFSIZ_NPTXFSTADDR_POS (0U) +#define USBHS_GNPTXFSIZ_NPTXFSTADDR (0x00000FFFUL) +#define USBHS_GNPTXFSIZ_NPTXFSTADDR_0 (0x00000001UL) +#define USBHS_GNPTXFSIZ_NPTXFSTADDR_1 (0x00000002UL) +#define USBHS_GNPTXFSIZ_NPTXFSTADDR_2 (0x00000004UL) +#define USBHS_GNPTXFSIZ_NPTXFSTADDR_3 (0x00000008UL) +#define USBHS_GNPTXFSIZ_NPTXFSTADDR_4 (0x00000010UL) +#define USBHS_GNPTXFSIZ_NPTXFSTADDR_5 (0x00000020UL) +#define USBHS_GNPTXFSIZ_NPTXFSTADDR_6 (0x00000040UL) +#define USBHS_GNPTXFSIZ_NPTXFSTADDR_7 (0x00000080UL) +#define USBHS_GNPTXFSIZ_NPTXFSTADDR_8 (0x00000100UL) +#define USBHS_GNPTXFSIZ_NPTXFSTADDR_9 (0x00000200UL) +#define USBHS_GNPTXFSIZ_NPTXFSTADDR_10 (0x00000400UL) +#define USBHS_GNPTXFSIZ_NPTXFSTADDR_11 (0x00000800UL) +#define USBHS_GNPTXFSIZ_NPTXFDEP_POS (16U) +#define USBHS_GNPTXFSIZ_NPTXFDEP (0x0FFF0000UL) +#define USBHS_GNPTXFSIZ_NPTXFDEP_0 (0x00010000UL) +#define USBHS_GNPTXFSIZ_NPTXFDEP_1 (0x00020000UL) +#define USBHS_GNPTXFSIZ_NPTXFDEP_2 (0x00040000UL) +#define USBHS_GNPTXFSIZ_NPTXFDEP_3 (0x00080000UL) +#define USBHS_GNPTXFSIZ_NPTXFDEP_4 (0x00100000UL) +#define USBHS_GNPTXFSIZ_NPTXFDEP_5 (0x00200000UL) +#define USBHS_GNPTXFSIZ_NPTXFDEP_6 (0x00400000UL) +#define USBHS_GNPTXFSIZ_NPTXFDEP_7 (0x00800000UL) +#define USBHS_GNPTXFSIZ_NPTXFDEP_8 (0x01000000UL) +#define USBHS_GNPTXFSIZ_NPTXFDEP_9 (0x02000000UL) +#define USBHS_GNPTXFSIZ_NPTXFDEP_10 (0x04000000UL) +#define USBHS_GNPTXFSIZ_NPTXFDEP_11 (0x08000000UL) + +/* Bit definition for USBHS_GNPTXSTS register */ +#define USBHS_GNPTXSTS_NPTXFSPCAVAIL_POS (0U) +#define USBHS_GNPTXSTS_NPTXFSPCAVAIL (0x0000FFFFUL) +#define USBHS_GNPTXSTS_NPTXFSPCAVAIL_0 (0x00000001UL) +#define USBHS_GNPTXSTS_NPTXFSPCAVAIL_1 (0x00000002UL) +#define USBHS_GNPTXSTS_NPTXFSPCAVAIL_2 (0x00000004UL) +#define USBHS_GNPTXSTS_NPTXFSPCAVAIL_3 (0x00000008UL) +#define USBHS_GNPTXSTS_NPTXFSPCAVAIL_4 (0x00000010UL) +#define USBHS_GNPTXSTS_NPTXFSPCAVAIL_5 (0x00000020UL) +#define USBHS_GNPTXSTS_NPTXFSPCAVAIL_6 (0x00000040UL) +#define USBHS_GNPTXSTS_NPTXFSPCAVAIL_7 (0x00000080UL) +#define USBHS_GNPTXSTS_NPTXFSPCAVAIL_8 (0x00000100UL) +#define USBHS_GNPTXSTS_NPTXFSPCAVAIL_9 (0x00000200UL) +#define USBHS_GNPTXSTS_NPTXFSPCAVAIL_10 (0x00000400UL) +#define USBHS_GNPTXSTS_NPTXFSPCAVAIL_11 (0x00000800UL) +#define USBHS_GNPTXSTS_NPTXFSPCAVAIL_12 (0x00001000UL) +#define USBHS_GNPTXSTS_NPTXFSPCAVAIL_13 (0x00002000UL) +#define USBHS_GNPTXSTS_NPTXFSPCAVAIL_14 (0x00004000UL) +#define USBHS_GNPTXSTS_NPTXFSPCAVAIL_15 (0x00008000UL) +#define USBHS_GNPTXSTS_NPTXQSPCAVAIL_POS (16U) +#define USBHS_GNPTXSTS_NPTXQSPCAVAIL (0x00FF0000UL) +#define USBHS_GNPTXSTS_NPTXQSPCAVAIL_0 (0x00010000UL) +#define USBHS_GNPTXSTS_NPTXQSPCAVAIL_1 (0x00020000UL) +#define USBHS_GNPTXSTS_NPTXQSPCAVAIL_2 (0x00040000UL) +#define USBHS_GNPTXSTS_NPTXQSPCAVAIL_3 (0x00080000UL) +#define USBHS_GNPTXSTS_NPTXQSPCAVAIL_4 (0x00100000UL) +#define USBHS_GNPTXSTS_NPTXQSPCAVAIL_5 (0x00200000UL) +#define USBHS_GNPTXSTS_NPTXQSPCAVAIL_6 (0x00400000UL) +#define USBHS_GNPTXSTS_NPTXQSPCAVAIL_7 (0x00800000UL) +#define USBHS_GNPTXSTS_NPTXQTOP_POS (24U) +#define USBHS_GNPTXSTS_NPTXQTOP (0x7F000000UL) +#define USBHS_GNPTXSTS_NPTXQTOP_0 (0x01000000UL) +#define USBHS_GNPTXSTS_NPTXQTOP_1 (0x02000000UL) +#define USBHS_GNPTXSTS_NPTXQTOP_2 (0x04000000UL) +#define USBHS_GNPTXSTS_NPTXQTOP_3 (0x08000000UL) +#define USBHS_GNPTXSTS_NPTXQTOP_4 (0x10000000UL) +#define USBHS_GNPTXSTS_NPTXQTOP_5 (0x20000000UL) +#define USBHS_GNPTXSTS_NPTXQTOP_6 (0x40000000UL) + +/* Bit definition for USBHS_GPVNDCTL register */ +#define USBHS_GPVNDCTL_REGDATA_POS (0U) +#define USBHS_GPVNDCTL_REGDATA (0x000000FFUL) +#define USBHS_GPVNDCTL_REGDATA_0 (0x00000001UL) +#define USBHS_GPVNDCTL_REGDATA_1 (0x00000002UL) +#define USBHS_GPVNDCTL_REGDATA_2 (0x00000004UL) +#define USBHS_GPVNDCTL_REGDATA_3 (0x00000008UL) +#define USBHS_GPVNDCTL_REGDATA_4 (0x00000010UL) +#define USBHS_GPVNDCTL_REGDATA_5 (0x00000020UL) +#define USBHS_GPVNDCTL_REGDATA_6 (0x00000040UL) +#define USBHS_GPVNDCTL_REGDATA_7 (0x00000080UL) +#define USBHS_GPVNDCTL_VCTRL_POS (8U) +#define USBHS_GPVNDCTL_VCTRL (0x0000FF00UL) +#define USBHS_GPVNDCTL_VCTRL_0 (0x00000100UL) +#define USBHS_GPVNDCTL_VCTRL_1 (0x00000200UL) +#define USBHS_GPVNDCTL_VCTRL_2 (0x00000400UL) +#define USBHS_GPVNDCTL_VCTRL_3 (0x00000800UL) +#define USBHS_GPVNDCTL_VCTRL_4 (0x00001000UL) +#define USBHS_GPVNDCTL_VCTRL_5 (0x00002000UL) +#define USBHS_GPVNDCTL_VCTRL_6 (0x00004000UL) +#define USBHS_GPVNDCTL_VCTRL_7 (0x00008000UL) +#define USBHS_GPVNDCTL_REGADDR_POS (16U) +#define USBHS_GPVNDCTL_REGADDR (0x003F0000UL) +#define USBHS_GPVNDCTL_REGADDR_0 (0x00010000UL) +#define USBHS_GPVNDCTL_REGADDR_1 (0x00020000UL) +#define USBHS_GPVNDCTL_REGADDR_2 (0x00040000UL) +#define USBHS_GPVNDCTL_REGADDR_3 (0x00080000UL) +#define USBHS_GPVNDCTL_REGADDR_4 (0x00100000UL) +#define USBHS_GPVNDCTL_REGADDR_5 (0x00200000UL) +#define USBHS_GPVNDCTL_REGWR_POS (22U) +#define USBHS_GPVNDCTL_REGWR (0x00400000UL) +#define USBHS_GPVNDCTL_NEWREGREQ_POS (25U) +#define USBHS_GPVNDCTL_NEWREGREQ (0x02000000UL) +#define USBHS_GPVNDCTL_VSTSBSY_POS (26U) +#define USBHS_GPVNDCTL_VSTSBSY (0x04000000UL) +#define USBHS_GPVNDCTL_VSTSDONE_POS (27U) +#define USBHS_GPVNDCTL_VSTSDONE (0x08000000UL) + +/* Bit definition for USBHS_GUID register */ +#define USBHS_GUID (0xFFFFFFFFUL) + +/* Bit definition for USBHS_GLPMCFG register */ +#define USBHS_GLPMCFG_LPMCAP_POS (0U) +#define USBHS_GLPMCFG_LPMCAP (0x00000001UL) +#define USBHS_GLPMCFG_APPL1RES_POS (1U) +#define USBHS_GLPMCFG_APPL1RES (0x00000002UL) +#define USBHS_GLPMCFG_HIRD_POS (2U) +#define USBHS_GLPMCFG_HIRD (0x0000003CUL) +#define USBHS_GLPMCFG_HIRD_0 (0x00000004UL) +#define USBHS_GLPMCFG_HIRD_1 (0x00000008UL) +#define USBHS_GLPMCFG_HIRD_2 (0x00000010UL) +#define USBHS_GLPMCFG_HIRD_3 (0x00000020UL) +#define USBHS_GLPMCFG_BREMOTEWAKE_POS (6U) +#define USBHS_GLPMCFG_BREMOTEWAKE (0x00000040UL) +#define USBHS_GLPMCFG_ENBLSLPM_POS (7U) +#define USBHS_GLPMCFG_ENBLSLPM (0x00000080UL) +#define USBHS_GLPMCFG_HIRD_THRES_POS (8U) +#define USBHS_GLPMCFG_HIRD_THRES (0x00001F00UL) +#define USBHS_GLPMCFG_HIRD_THRES_0 (0x00000100UL) +#define USBHS_GLPMCFG_HIRD_THRES_1 (0x00000200UL) +#define USBHS_GLPMCFG_HIRD_THRES_2 (0x00000400UL) +#define USBHS_GLPMCFG_HIRD_THRES_3 (0x00000800UL) +#define USBHS_GLPMCFG_HIRD_THRES_4 (0x00001000UL) +#define USBHS_GLPMCFG_COREL1RES_POS (13U) +#define USBHS_GLPMCFG_COREL1RES (0x00006000UL) +#define USBHS_GLPMCFG_COREL1RES_0 (0x00002000UL) +#define USBHS_GLPMCFG_COREL1RES_1 (0x00004000UL) +#define USBHS_GLPMCFG_SLPSTS_POS (15U) +#define USBHS_GLPMCFG_SLPSTS (0x00008000UL) +#define USBHS_GLPMCFG_L1RESUMEOK_POS (16U) +#define USBHS_GLPMCFG_L1RESUMEOK (0x00010000UL) +#define USBHS_GLPMCFG_LPM_CHNL_INDX_POS (17U) +#define USBHS_GLPMCFG_LPM_CHNL_INDX (0x001E0000UL) +#define USBHS_GLPMCFG_LPM_CHNL_INDX_0 (0x00020000UL) +#define USBHS_GLPMCFG_LPM_CHNL_INDX_1 (0x00040000UL) +#define USBHS_GLPMCFG_LPM_CHNL_INDX_2 (0x00080000UL) +#define USBHS_GLPMCFG_LPM_CHNL_INDX_3 (0x00100000UL) +#define USBHS_GLPMCFG_LPM_RETRY_CNT_POS (21U) +#define USBHS_GLPMCFG_LPM_RETRY_CNT (0x00E00000UL) +#define USBHS_GLPMCFG_LPM_RETRY_CNT_0 (0x00200000UL) +#define USBHS_GLPMCFG_LPM_RETRY_CNT_1 (0x00400000UL) +#define USBHS_GLPMCFG_LPM_RETRY_CNT_2 (0x00800000UL) +#define USBHS_GLPMCFG_SNDLPM_POS (24U) +#define USBHS_GLPMCFG_SNDLPM (0x01000000UL) +#define USBHS_GLPMCFG_LPM_RETRYCNT_STS_POS (25U) +#define USBHS_GLPMCFG_LPM_RETRYCNT_STS (0x0E000000UL) +#define USBHS_GLPMCFG_LPM_RETRYCNT_STS_0 (0x02000000UL) +#define USBHS_GLPMCFG_LPM_RETRYCNT_STS_1 (0x04000000UL) +#define USBHS_GLPMCFG_LPM_RETRYCNT_STS_2 (0x08000000UL) +#define USBHS_GLPMCFG_LPM_ENBESL_POS (28U) +#define USBHS_GLPMCFG_LPM_ENBESL (0x10000000UL) +#define USBHS_GLPMCFG_LPM_RESTORESLPSTS_POS (29U) +#define USBHS_GLPMCFG_LPM_RESTORESLPSTS (0x20000000UL) + +/* Bit definition for USBHS_GDFIFOCFG register */ +#define USBHS_GDFIFOCFG_GDFIFOCFG_POS (0U) +#define USBHS_GDFIFOCFG_GDFIFOCFG (0x0000FFFFUL) +#define USBHS_GDFIFOCFG_GDFIFOCFG_0 (0x00000001UL) +#define USBHS_GDFIFOCFG_GDFIFOCFG_1 (0x00000002UL) +#define USBHS_GDFIFOCFG_GDFIFOCFG_2 (0x00000004UL) +#define USBHS_GDFIFOCFG_GDFIFOCFG_3 (0x00000008UL) +#define USBHS_GDFIFOCFG_GDFIFOCFG_4 (0x00000010UL) +#define USBHS_GDFIFOCFG_GDFIFOCFG_5 (0x00000020UL) +#define USBHS_GDFIFOCFG_GDFIFOCFG_6 (0x00000040UL) +#define USBHS_GDFIFOCFG_GDFIFOCFG_7 (0x00000080UL) +#define USBHS_GDFIFOCFG_GDFIFOCFG_8 (0x00000100UL) +#define USBHS_GDFIFOCFG_GDFIFOCFG_9 (0x00000200UL) +#define USBHS_GDFIFOCFG_GDFIFOCFG_10 (0x00000400UL) +#define USBHS_GDFIFOCFG_GDFIFOCFG_11 (0x00000800UL) +#define USBHS_GDFIFOCFG_GDFIFOCFG_12 (0x00001000UL) +#define USBHS_GDFIFOCFG_GDFIFOCFG_13 (0x00002000UL) +#define USBHS_GDFIFOCFG_GDFIFOCFG_14 (0x00004000UL) +#define USBHS_GDFIFOCFG_GDFIFOCFG_15 (0x00008000UL) +#define USBHS_GDFIFOCFG_EPINFOBASEADDR_POS (16U) +#define USBHS_GDFIFOCFG_EPINFOBASEADDR (0xFFFF0000UL) +#define USBHS_GDFIFOCFG_EPINFOBASEADDR_0 (0x00010000UL) +#define USBHS_GDFIFOCFG_EPINFOBASEADDR_1 (0x00020000UL) +#define USBHS_GDFIFOCFG_EPINFOBASEADDR_2 (0x00040000UL) +#define USBHS_GDFIFOCFG_EPINFOBASEADDR_3 (0x00080000UL) +#define USBHS_GDFIFOCFG_EPINFOBASEADDR_4 (0x00100000UL) +#define USBHS_GDFIFOCFG_EPINFOBASEADDR_5 (0x00200000UL) +#define USBHS_GDFIFOCFG_EPINFOBASEADDR_6 (0x00400000UL) +#define USBHS_GDFIFOCFG_EPINFOBASEADDR_7 (0x00800000UL) +#define USBHS_GDFIFOCFG_EPINFOBASEADDR_8 (0x01000000UL) +#define USBHS_GDFIFOCFG_EPINFOBASEADDR_9 (0x02000000UL) +#define USBHS_GDFIFOCFG_EPINFOBASEADDR_10 (0x04000000UL) +#define USBHS_GDFIFOCFG_EPINFOBASEADDR_11 (0x08000000UL) +#define USBHS_GDFIFOCFG_EPINFOBASEADDR_12 (0x10000000UL) +#define USBHS_GDFIFOCFG_EPINFOBASEADDR_13 (0x20000000UL) +#define USBHS_GDFIFOCFG_EPINFOBASEADDR_14 (0x40000000UL) +#define USBHS_GDFIFOCFG_EPINFOBASEADDR_15 (0x80000000UL) + +/* Bit definition for USBHS_HPTXFSIZ register */ +#define USBHS_HPTXFSIZ_PTXFSTADDR_POS (0U) +#define USBHS_HPTXFSIZ_PTXFSTADDR (0x00001FFFUL) +#define USBHS_HPTXFSIZ_PTXFSTADDR_0 (0x00000001UL) +#define USBHS_HPTXFSIZ_PTXFSTADDR_1 (0x00000002UL) +#define USBHS_HPTXFSIZ_PTXFSTADDR_2 (0x00000004UL) +#define USBHS_HPTXFSIZ_PTXFSTADDR_3 (0x00000008UL) +#define USBHS_HPTXFSIZ_PTXFSTADDR_4 (0x00000010UL) +#define USBHS_HPTXFSIZ_PTXFSTADDR_5 (0x00000020UL) +#define USBHS_HPTXFSIZ_PTXFSTADDR_6 (0x00000040UL) +#define USBHS_HPTXFSIZ_PTXFSTADDR_7 (0x00000080UL) +#define USBHS_HPTXFSIZ_PTXFSTADDR_8 (0x00000100UL) +#define USBHS_HPTXFSIZ_PTXFSTADDR_9 (0x00000200UL) +#define USBHS_HPTXFSIZ_PTXFSTADDR_10 (0x00000400UL) +#define USBHS_HPTXFSIZ_PTXFSTADDR_11 (0x00000800UL) +#define USBHS_HPTXFSIZ_PTXFSTADDR_12 (0x00001000UL) +#define USBHS_HPTXFSIZ_PTXFSIZE_POS (16U) +#define USBHS_HPTXFSIZ_PTXFSIZE (0x0FFF0000UL) +#define USBHS_HPTXFSIZ_PTXFSIZE_0 (0x00010000UL) +#define USBHS_HPTXFSIZ_PTXFSIZE_1 (0x00020000UL) +#define USBHS_HPTXFSIZ_PTXFSIZE_2 (0x00040000UL) +#define USBHS_HPTXFSIZ_PTXFSIZE_3 (0x00080000UL) +#define USBHS_HPTXFSIZ_PTXFSIZE_4 (0x00100000UL) +#define USBHS_HPTXFSIZ_PTXFSIZE_5 (0x00200000UL) +#define USBHS_HPTXFSIZ_PTXFSIZE_6 (0x00400000UL) +#define USBHS_HPTXFSIZ_PTXFSIZE_7 (0x00800000UL) +#define USBHS_HPTXFSIZ_PTXFSIZE_8 (0x01000000UL) +#define USBHS_HPTXFSIZ_PTXFSIZE_9 (0x02000000UL) +#define USBHS_HPTXFSIZ_PTXFSIZE_10 (0x04000000UL) +#define USBHS_HPTXFSIZ_PTXFSIZE_11 (0x08000000UL) + +/* Bit definition for USBHS_DIEPTXF1 register */ +#define USBHS_DIEPTXF1_INEPNTXFSTADDR_POS (0U) +#define USBHS_DIEPTXF1_INEPNTXFSTADDR (0x00001FFFUL) +#define USBHS_DIEPTXF1_INEPNTXFSTADDR_0 (0x00000001UL) +#define USBHS_DIEPTXF1_INEPNTXFSTADDR_1 (0x00000002UL) +#define USBHS_DIEPTXF1_INEPNTXFSTADDR_2 (0x00000004UL) +#define USBHS_DIEPTXF1_INEPNTXFSTADDR_3 (0x00000008UL) +#define USBHS_DIEPTXF1_INEPNTXFSTADDR_4 (0x00000010UL) +#define USBHS_DIEPTXF1_INEPNTXFSTADDR_5 (0x00000020UL) +#define USBHS_DIEPTXF1_INEPNTXFSTADDR_6 (0x00000040UL) +#define USBHS_DIEPTXF1_INEPNTXFSTADDR_7 (0x00000080UL) +#define USBHS_DIEPTXF1_INEPNTXFSTADDR_8 (0x00000100UL) +#define USBHS_DIEPTXF1_INEPNTXFSTADDR_9 (0x00000200UL) +#define USBHS_DIEPTXF1_INEPNTXFSTADDR_10 (0x00000400UL) +#define USBHS_DIEPTXF1_INEPNTXFSTADDR_11 (0x00000800UL) +#define USBHS_DIEPTXF1_INEPNTXFSTADDR_12 (0x00001000UL) +#define USBHS_DIEPTXF1_INEPNTXFDEP_POS (16U) +#define USBHS_DIEPTXF1_INEPNTXFDEP (0x0FFF0000UL) +#define USBHS_DIEPTXF1_INEPNTXFDEP_0 (0x00010000UL) +#define USBHS_DIEPTXF1_INEPNTXFDEP_1 (0x00020000UL) +#define USBHS_DIEPTXF1_INEPNTXFDEP_2 (0x00040000UL) +#define USBHS_DIEPTXF1_INEPNTXFDEP_3 (0x00080000UL) +#define USBHS_DIEPTXF1_INEPNTXFDEP_4 (0x00100000UL) +#define USBHS_DIEPTXF1_INEPNTXFDEP_5 (0x00200000UL) +#define USBHS_DIEPTXF1_INEPNTXFDEP_6 (0x00400000UL) +#define USBHS_DIEPTXF1_INEPNTXFDEP_7 (0x00800000UL) +#define USBHS_DIEPTXF1_INEPNTXFDEP_8 (0x01000000UL) +#define USBHS_DIEPTXF1_INEPNTXFDEP_9 (0x02000000UL) +#define USBHS_DIEPTXF1_INEPNTXFDEP_10 (0x04000000UL) +#define USBHS_DIEPTXF1_INEPNTXFDEP_11 (0x08000000UL) + +/* Bit definition for USBHS_DIEPTXF2 register */ +#define USBHS_DIEPTXF2_INEPNTXFSTADDR_POS (0U) +#define USBHS_DIEPTXF2_INEPNTXFSTADDR (0x00001FFFUL) +#define USBHS_DIEPTXF2_INEPNTXFSTADDR_0 (0x00000001UL) +#define USBHS_DIEPTXF2_INEPNTXFSTADDR_1 (0x00000002UL) +#define USBHS_DIEPTXF2_INEPNTXFSTADDR_2 (0x00000004UL) +#define USBHS_DIEPTXF2_INEPNTXFSTADDR_3 (0x00000008UL) +#define USBHS_DIEPTXF2_INEPNTXFSTADDR_4 (0x00000010UL) +#define USBHS_DIEPTXF2_INEPNTXFSTADDR_5 (0x00000020UL) +#define USBHS_DIEPTXF2_INEPNTXFSTADDR_6 (0x00000040UL) +#define USBHS_DIEPTXF2_INEPNTXFSTADDR_7 (0x00000080UL) +#define USBHS_DIEPTXF2_INEPNTXFSTADDR_8 (0x00000100UL) +#define USBHS_DIEPTXF2_INEPNTXFSTADDR_9 (0x00000200UL) +#define USBHS_DIEPTXF2_INEPNTXFSTADDR_10 (0x00000400UL) +#define USBHS_DIEPTXF2_INEPNTXFSTADDR_11 (0x00000800UL) +#define USBHS_DIEPTXF2_INEPNTXFSTADDR_12 (0x00001000UL) +#define USBHS_DIEPTXF2_INEPNTXFDEP_POS (16U) +#define USBHS_DIEPTXF2_INEPNTXFDEP (0x0FFF0000UL) +#define USBHS_DIEPTXF2_INEPNTXFDEP_0 (0x00010000UL) +#define USBHS_DIEPTXF2_INEPNTXFDEP_1 (0x00020000UL) +#define USBHS_DIEPTXF2_INEPNTXFDEP_2 (0x00040000UL) +#define USBHS_DIEPTXF2_INEPNTXFDEP_3 (0x00080000UL) +#define USBHS_DIEPTXF2_INEPNTXFDEP_4 (0x00100000UL) +#define USBHS_DIEPTXF2_INEPNTXFDEP_5 (0x00200000UL) +#define USBHS_DIEPTXF2_INEPNTXFDEP_6 (0x00400000UL) +#define USBHS_DIEPTXF2_INEPNTXFDEP_7 (0x00800000UL) +#define USBHS_DIEPTXF2_INEPNTXFDEP_8 (0x01000000UL) +#define USBHS_DIEPTXF2_INEPNTXFDEP_9 (0x02000000UL) +#define USBHS_DIEPTXF2_INEPNTXFDEP_10 (0x04000000UL) +#define USBHS_DIEPTXF2_INEPNTXFDEP_11 (0x08000000UL) + +/* Bit definition for USBHS_DIEPTXF3 register */ +#define USBHS_DIEPTXF3_INEPNTXFSTADDR_POS (0U) +#define USBHS_DIEPTXF3_INEPNTXFSTADDR (0x00003FFFUL) +#define USBHS_DIEPTXF3_INEPNTXFSTADDR_0 (0x00000001UL) +#define USBHS_DIEPTXF3_INEPNTXFSTADDR_1 (0x00000002UL) +#define USBHS_DIEPTXF3_INEPNTXFSTADDR_2 (0x00000004UL) +#define USBHS_DIEPTXF3_INEPNTXFSTADDR_3 (0x00000008UL) +#define USBHS_DIEPTXF3_INEPNTXFSTADDR_4 (0x00000010UL) +#define USBHS_DIEPTXF3_INEPNTXFSTADDR_5 (0x00000020UL) +#define USBHS_DIEPTXF3_INEPNTXFSTADDR_6 (0x00000040UL) +#define USBHS_DIEPTXF3_INEPNTXFSTADDR_7 (0x00000080UL) +#define USBHS_DIEPTXF3_INEPNTXFSTADDR_8 (0x00000100UL) +#define USBHS_DIEPTXF3_INEPNTXFSTADDR_9 (0x00000200UL) +#define USBHS_DIEPTXF3_INEPNTXFSTADDR_10 (0x00000400UL) +#define USBHS_DIEPTXF3_INEPNTXFSTADDR_11 (0x00000800UL) +#define USBHS_DIEPTXF3_INEPNTXFSTADDR_12 (0x00001000UL) +#define USBHS_DIEPTXF3_INEPNTXFSTADDR_13 (0x00002000UL) +#define USBHS_DIEPTXF3_INEPNTXFDEP_POS (16U) +#define USBHS_DIEPTXF3_INEPNTXFDEP (0x0FFF0000UL) +#define USBHS_DIEPTXF3_INEPNTXFDEP_0 (0x00010000UL) +#define USBHS_DIEPTXF3_INEPNTXFDEP_1 (0x00020000UL) +#define USBHS_DIEPTXF3_INEPNTXFDEP_2 (0x00040000UL) +#define USBHS_DIEPTXF3_INEPNTXFDEP_3 (0x00080000UL) +#define USBHS_DIEPTXF3_INEPNTXFDEP_4 (0x00100000UL) +#define USBHS_DIEPTXF3_INEPNTXFDEP_5 (0x00200000UL) +#define USBHS_DIEPTXF3_INEPNTXFDEP_6 (0x00400000UL) +#define USBHS_DIEPTXF3_INEPNTXFDEP_7 (0x00800000UL) +#define USBHS_DIEPTXF3_INEPNTXFDEP_8 (0x01000000UL) +#define USBHS_DIEPTXF3_INEPNTXFDEP_9 (0x02000000UL) +#define USBHS_DIEPTXF3_INEPNTXFDEP_10 (0x04000000UL) +#define USBHS_DIEPTXF3_INEPNTXFDEP_11 (0x08000000UL) + +/* Bit definition for USBHS_DIEPTXF4 register */ +#define USBHS_DIEPTXF4_INEPNTXFSTADDR_POS (0U) +#define USBHS_DIEPTXF4_INEPNTXFSTADDR (0x00003FFFUL) +#define USBHS_DIEPTXF4_INEPNTXFSTADDR_0 (0x00000001UL) +#define USBHS_DIEPTXF4_INEPNTXFSTADDR_1 (0x00000002UL) +#define USBHS_DIEPTXF4_INEPNTXFSTADDR_2 (0x00000004UL) +#define USBHS_DIEPTXF4_INEPNTXFSTADDR_3 (0x00000008UL) +#define USBHS_DIEPTXF4_INEPNTXFSTADDR_4 (0x00000010UL) +#define USBHS_DIEPTXF4_INEPNTXFSTADDR_5 (0x00000020UL) +#define USBHS_DIEPTXF4_INEPNTXFSTADDR_6 (0x00000040UL) +#define USBHS_DIEPTXF4_INEPNTXFSTADDR_7 (0x00000080UL) +#define USBHS_DIEPTXF4_INEPNTXFSTADDR_8 (0x00000100UL) +#define USBHS_DIEPTXF4_INEPNTXFSTADDR_9 (0x00000200UL) +#define USBHS_DIEPTXF4_INEPNTXFSTADDR_10 (0x00000400UL) +#define USBHS_DIEPTXF4_INEPNTXFSTADDR_11 (0x00000800UL) +#define USBHS_DIEPTXF4_INEPNTXFSTADDR_12 (0x00001000UL) +#define USBHS_DIEPTXF4_INEPNTXFSTADDR_13 (0x00002000UL) +#define USBHS_DIEPTXF4_INEPNTXFDEP_POS (16U) +#define USBHS_DIEPTXF4_INEPNTXFDEP (0x0FFF0000UL) +#define USBHS_DIEPTXF4_INEPNTXFDEP_0 (0x00010000UL) +#define USBHS_DIEPTXF4_INEPNTXFDEP_1 (0x00020000UL) +#define USBHS_DIEPTXF4_INEPNTXFDEP_2 (0x00040000UL) +#define USBHS_DIEPTXF4_INEPNTXFDEP_3 (0x00080000UL) +#define USBHS_DIEPTXF4_INEPNTXFDEP_4 (0x00100000UL) +#define USBHS_DIEPTXF4_INEPNTXFDEP_5 (0x00200000UL) +#define USBHS_DIEPTXF4_INEPNTXFDEP_6 (0x00400000UL) +#define USBHS_DIEPTXF4_INEPNTXFDEP_7 (0x00800000UL) +#define USBHS_DIEPTXF4_INEPNTXFDEP_8 (0x01000000UL) +#define USBHS_DIEPTXF4_INEPNTXFDEP_9 (0x02000000UL) +#define USBHS_DIEPTXF4_INEPNTXFDEP_10 (0x04000000UL) +#define USBHS_DIEPTXF4_INEPNTXFDEP_11 (0x08000000UL) + +/* Bit definition for USBHS_DIEPTXF5 register */ +#define USBHS_DIEPTXF5_INEPNTXFSTADDR_POS (0U) +#define USBHS_DIEPTXF5_INEPNTXFSTADDR (0x00003FFFUL) +#define USBHS_DIEPTXF5_INEPNTXFSTADDR_0 (0x00000001UL) +#define USBHS_DIEPTXF5_INEPNTXFSTADDR_1 (0x00000002UL) +#define USBHS_DIEPTXF5_INEPNTXFSTADDR_2 (0x00000004UL) +#define USBHS_DIEPTXF5_INEPNTXFSTADDR_3 (0x00000008UL) +#define USBHS_DIEPTXF5_INEPNTXFSTADDR_4 (0x00000010UL) +#define USBHS_DIEPTXF5_INEPNTXFSTADDR_5 (0x00000020UL) +#define USBHS_DIEPTXF5_INEPNTXFSTADDR_6 (0x00000040UL) +#define USBHS_DIEPTXF5_INEPNTXFSTADDR_7 (0x00000080UL) +#define USBHS_DIEPTXF5_INEPNTXFSTADDR_8 (0x00000100UL) +#define USBHS_DIEPTXF5_INEPNTXFSTADDR_9 (0x00000200UL) +#define USBHS_DIEPTXF5_INEPNTXFSTADDR_10 (0x00000400UL) +#define USBHS_DIEPTXF5_INEPNTXFSTADDR_11 (0x00000800UL) +#define USBHS_DIEPTXF5_INEPNTXFSTADDR_12 (0x00001000UL) +#define USBHS_DIEPTXF5_INEPNTXFSTADDR_13 (0x00002000UL) +#define USBHS_DIEPTXF5_INEPNTXFDEP_POS (16U) +#define USBHS_DIEPTXF5_INEPNTXFDEP (0x0FFF0000UL) +#define USBHS_DIEPTXF5_INEPNTXFDEP_0 (0x00010000UL) +#define USBHS_DIEPTXF5_INEPNTXFDEP_1 (0x00020000UL) +#define USBHS_DIEPTXF5_INEPNTXFDEP_2 (0x00040000UL) +#define USBHS_DIEPTXF5_INEPNTXFDEP_3 (0x00080000UL) +#define USBHS_DIEPTXF5_INEPNTXFDEP_4 (0x00100000UL) +#define USBHS_DIEPTXF5_INEPNTXFDEP_5 (0x00200000UL) +#define USBHS_DIEPTXF5_INEPNTXFDEP_6 (0x00400000UL) +#define USBHS_DIEPTXF5_INEPNTXFDEP_7 (0x00800000UL) +#define USBHS_DIEPTXF5_INEPNTXFDEP_8 (0x01000000UL) +#define USBHS_DIEPTXF5_INEPNTXFDEP_9 (0x02000000UL) +#define USBHS_DIEPTXF5_INEPNTXFDEP_10 (0x04000000UL) +#define USBHS_DIEPTXF5_INEPNTXFDEP_11 (0x08000000UL) + +/* Bit definition for USBHS_DIEPTXF6 register */ +#define USBHS_DIEPTXF6_INEPNTXFSTADDR_POS (0U) +#define USBHS_DIEPTXF6_INEPNTXFSTADDR (0x00003FFFUL) +#define USBHS_DIEPTXF6_INEPNTXFSTADDR_0 (0x00000001UL) +#define USBHS_DIEPTXF6_INEPNTXFSTADDR_1 (0x00000002UL) +#define USBHS_DIEPTXF6_INEPNTXFSTADDR_2 (0x00000004UL) +#define USBHS_DIEPTXF6_INEPNTXFSTADDR_3 (0x00000008UL) +#define USBHS_DIEPTXF6_INEPNTXFSTADDR_4 (0x00000010UL) +#define USBHS_DIEPTXF6_INEPNTXFSTADDR_5 (0x00000020UL) +#define USBHS_DIEPTXF6_INEPNTXFSTADDR_6 (0x00000040UL) +#define USBHS_DIEPTXF6_INEPNTXFSTADDR_7 (0x00000080UL) +#define USBHS_DIEPTXF6_INEPNTXFSTADDR_8 (0x00000100UL) +#define USBHS_DIEPTXF6_INEPNTXFSTADDR_9 (0x00000200UL) +#define USBHS_DIEPTXF6_INEPNTXFSTADDR_10 (0x00000400UL) +#define USBHS_DIEPTXF6_INEPNTXFSTADDR_11 (0x00000800UL) +#define USBHS_DIEPTXF6_INEPNTXFSTADDR_12 (0x00001000UL) +#define USBHS_DIEPTXF6_INEPNTXFSTADDR_13 (0x00002000UL) +#define USBHS_DIEPTXF6_INEPNTXFDEP_POS (16U) +#define USBHS_DIEPTXF6_INEPNTXFDEP (0x0FFF0000UL) +#define USBHS_DIEPTXF6_INEPNTXFDEP_0 (0x00010000UL) +#define USBHS_DIEPTXF6_INEPNTXFDEP_1 (0x00020000UL) +#define USBHS_DIEPTXF6_INEPNTXFDEP_2 (0x00040000UL) +#define USBHS_DIEPTXF6_INEPNTXFDEP_3 (0x00080000UL) +#define USBHS_DIEPTXF6_INEPNTXFDEP_4 (0x00100000UL) +#define USBHS_DIEPTXF6_INEPNTXFDEP_5 (0x00200000UL) +#define USBHS_DIEPTXF6_INEPNTXFDEP_6 (0x00400000UL) +#define USBHS_DIEPTXF6_INEPNTXFDEP_7 (0x00800000UL) +#define USBHS_DIEPTXF6_INEPNTXFDEP_8 (0x01000000UL) +#define USBHS_DIEPTXF6_INEPNTXFDEP_9 (0x02000000UL) +#define USBHS_DIEPTXF6_INEPNTXFDEP_10 (0x04000000UL) +#define USBHS_DIEPTXF6_INEPNTXFDEP_11 (0x08000000UL) + +/* Bit definition for USBHS_DIEPTXF7 register */ +#define USBHS_DIEPTXF7_INEPNTXFSTADDR_POS (0U) +#define USBHS_DIEPTXF7_INEPNTXFSTADDR (0x00007FFFUL) +#define USBHS_DIEPTXF7_INEPNTXFSTADDR_0 (0x00000001UL) +#define USBHS_DIEPTXF7_INEPNTXFSTADDR_1 (0x00000002UL) +#define USBHS_DIEPTXF7_INEPNTXFSTADDR_2 (0x00000004UL) +#define USBHS_DIEPTXF7_INEPNTXFSTADDR_3 (0x00000008UL) +#define USBHS_DIEPTXF7_INEPNTXFSTADDR_4 (0x00000010UL) +#define USBHS_DIEPTXF7_INEPNTXFSTADDR_5 (0x00000020UL) +#define USBHS_DIEPTXF7_INEPNTXFSTADDR_6 (0x00000040UL) +#define USBHS_DIEPTXF7_INEPNTXFSTADDR_7 (0x00000080UL) +#define USBHS_DIEPTXF7_INEPNTXFSTADDR_8 (0x00000100UL) +#define USBHS_DIEPTXF7_INEPNTXFSTADDR_9 (0x00000200UL) +#define USBHS_DIEPTXF7_INEPNTXFSTADDR_10 (0x00000400UL) +#define USBHS_DIEPTXF7_INEPNTXFSTADDR_11 (0x00000800UL) +#define USBHS_DIEPTXF7_INEPNTXFSTADDR_12 (0x00001000UL) +#define USBHS_DIEPTXF7_INEPNTXFSTADDR_13 (0x00002000UL) +#define USBHS_DIEPTXF7_INEPNTXFSTADDR_14 (0x00004000UL) +#define USBHS_DIEPTXF7_INEPNTXFDEP_POS (16U) +#define USBHS_DIEPTXF7_INEPNTXFDEP (0x0FFF0000UL) +#define USBHS_DIEPTXF7_INEPNTXFDEP_0 (0x00010000UL) +#define USBHS_DIEPTXF7_INEPNTXFDEP_1 (0x00020000UL) +#define USBHS_DIEPTXF7_INEPNTXFDEP_2 (0x00040000UL) +#define USBHS_DIEPTXF7_INEPNTXFDEP_3 (0x00080000UL) +#define USBHS_DIEPTXF7_INEPNTXFDEP_4 (0x00100000UL) +#define USBHS_DIEPTXF7_INEPNTXFDEP_5 (0x00200000UL) +#define USBHS_DIEPTXF7_INEPNTXFDEP_6 (0x00400000UL) +#define USBHS_DIEPTXF7_INEPNTXFDEP_7 (0x00800000UL) +#define USBHS_DIEPTXF7_INEPNTXFDEP_8 (0x01000000UL) +#define USBHS_DIEPTXF7_INEPNTXFDEP_9 (0x02000000UL) +#define USBHS_DIEPTXF7_INEPNTXFDEP_10 (0x04000000UL) +#define USBHS_DIEPTXF7_INEPNTXFDEP_11 (0x08000000UL) + +/* Bit definition for USBHS_DIEPTXF8 register */ +#define USBHS_DIEPTXF8_INEPNTXFSTADDR_POS (0U) +#define USBHS_DIEPTXF8_INEPNTXFSTADDR (0x00007FFFUL) +#define USBHS_DIEPTXF8_INEPNTXFSTADDR_0 (0x00000001UL) +#define USBHS_DIEPTXF8_INEPNTXFSTADDR_1 (0x00000002UL) +#define USBHS_DIEPTXF8_INEPNTXFSTADDR_2 (0x00000004UL) +#define USBHS_DIEPTXF8_INEPNTXFSTADDR_3 (0x00000008UL) +#define USBHS_DIEPTXF8_INEPNTXFSTADDR_4 (0x00000010UL) +#define USBHS_DIEPTXF8_INEPNTXFSTADDR_5 (0x00000020UL) +#define USBHS_DIEPTXF8_INEPNTXFSTADDR_6 (0x00000040UL) +#define USBHS_DIEPTXF8_INEPNTXFSTADDR_7 (0x00000080UL) +#define USBHS_DIEPTXF8_INEPNTXFSTADDR_8 (0x00000100UL) +#define USBHS_DIEPTXF8_INEPNTXFSTADDR_9 (0x00000200UL) +#define USBHS_DIEPTXF8_INEPNTXFSTADDR_10 (0x00000400UL) +#define USBHS_DIEPTXF8_INEPNTXFSTADDR_11 (0x00000800UL) +#define USBHS_DIEPTXF8_INEPNTXFSTADDR_12 (0x00001000UL) +#define USBHS_DIEPTXF8_INEPNTXFSTADDR_13 (0x00002000UL) +#define USBHS_DIEPTXF8_INEPNTXFSTADDR_14 (0x00004000UL) +#define USBHS_DIEPTXF8_INEPNTXFDEP_POS (16U) +#define USBHS_DIEPTXF8_INEPNTXFDEP (0x0FFF0000UL) +#define USBHS_DIEPTXF8_INEPNTXFDEP_0 (0x00010000UL) +#define USBHS_DIEPTXF8_INEPNTXFDEP_1 (0x00020000UL) +#define USBHS_DIEPTXF8_INEPNTXFDEP_2 (0x00040000UL) +#define USBHS_DIEPTXF8_INEPNTXFDEP_3 (0x00080000UL) +#define USBHS_DIEPTXF8_INEPNTXFDEP_4 (0x00100000UL) +#define USBHS_DIEPTXF8_INEPNTXFDEP_5 (0x00200000UL) +#define USBHS_DIEPTXF8_INEPNTXFDEP_6 (0x00400000UL) +#define USBHS_DIEPTXF8_INEPNTXFDEP_7 (0x00800000UL) +#define USBHS_DIEPTXF8_INEPNTXFDEP_8 (0x01000000UL) +#define USBHS_DIEPTXF8_INEPNTXFDEP_9 (0x02000000UL) +#define USBHS_DIEPTXF8_INEPNTXFDEP_10 (0x04000000UL) +#define USBHS_DIEPTXF8_INEPNTXFDEP_11 (0x08000000UL) + +/* Bit definition for USBHS_DIEPTXF9 register */ +#define USBHS_DIEPTXF9_INEPNTXFSTADDR_POS (0U) +#define USBHS_DIEPTXF9_INEPNTXFSTADDR (0x00007FFFUL) +#define USBHS_DIEPTXF9_INEPNTXFSTADDR_0 (0x00000001UL) +#define USBHS_DIEPTXF9_INEPNTXFSTADDR_1 (0x00000002UL) +#define USBHS_DIEPTXF9_INEPNTXFSTADDR_2 (0x00000004UL) +#define USBHS_DIEPTXF9_INEPNTXFSTADDR_3 (0x00000008UL) +#define USBHS_DIEPTXF9_INEPNTXFSTADDR_4 (0x00000010UL) +#define USBHS_DIEPTXF9_INEPNTXFSTADDR_5 (0x00000020UL) +#define USBHS_DIEPTXF9_INEPNTXFSTADDR_6 (0x00000040UL) +#define USBHS_DIEPTXF9_INEPNTXFSTADDR_7 (0x00000080UL) +#define USBHS_DIEPTXF9_INEPNTXFSTADDR_8 (0x00000100UL) +#define USBHS_DIEPTXF9_INEPNTXFSTADDR_9 (0x00000200UL) +#define USBHS_DIEPTXF9_INEPNTXFSTADDR_10 (0x00000400UL) +#define USBHS_DIEPTXF9_INEPNTXFSTADDR_11 (0x00000800UL) +#define USBHS_DIEPTXF9_INEPNTXFSTADDR_12 (0x00001000UL) +#define USBHS_DIEPTXF9_INEPNTXFSTADDR_13 (0x00002000UL) +#define USBHS_DIEPTXF9_INEPNTXFSTADDR_14 (0x00004000UL) +#define USBHS_DIEPTXF9_INEPNTXFDEP_POS (16U) +#define USBHS_DIEPTXF9_INEPNTXFDEP (0x0FFF0000UL) +#define USBHS_DIEPTXF9_INEPNTXFDEP_0 (0x00010000UL) +#define USBHS_DIEPTXF9_INEPNTXFDEP_1 (0x00020000UL) +#define USBHS_DIEPTXF9_INEPNTXFDEP_2 (0x00040000UL) +#define USBHS_DIEPTXF9_INEPNTXFDEP_3 (0x00080000UL) +#define USBHS_DIEPTXF9_INEPNTXFDEP_4 (0x00100000UL) +#define USBHS_DIEPTXF9_INEPNTXFDEP_5 (0x00200000UL) +#define USBHS_DIEPTXF9_INEPNTXFDEP_6 (0x00400000UL) +#define USBHS_DIEPTXF9_INEPNTXFDEP_7 (0x00800000UL) +#define USBHS_DIEPTXF9_INEPNTXFDEP_8 (0x01000000UL) +#define USBHS_DIEPTXF9_INEPNTXFDEP_9 (0x02000000UL) +#define USBHS_DIEPTXF9_INEPNTXFDEP_10 (0x04000000UL) +#define USBHS_DIEPTXF9_INEPNTXFDEP_11 (0x08000000UL) + +/* Bit definition for USBHS_DIEPTXF10 register */ +#define USBHS_DIEPTXF10_INEPNTXFSTADDR_POS (0U) +#define USBHS_DIEPTXF10_INEPNTXFSTADDR (0x00007FFFUL) +#define USBHS_DIEPTXF10_INEPNTXFSTADDR_0 (0x00000001UL) +#define USBHS_DIEPTXF10_INEPNTXFSTADDR_1 (0x00000002UL) +#define USBHS_DIEPTXF10_INEPNTXFSTADDR_2 (0x00000004UL) +#define USBHS_DIEPTXF10_INEPNTXFSTADDR_3 (0x00000008UL) +#define USBHS_DIEPTXF10_INEPNTXFSTADDR_4 (0x00000010UL) +#define USBHS_DIEPTXF10_INEPNTXFSTADDR_5 (0x00000020UL) +#define USBHS_DIEPTXF10_INEPNTXFSTADDR_6 (0x00000040UL) +#define USBHS_DIEPTXF10_INEPNTXFSTADDR_7 (0x00000080UL) +#define USBHS_DIEPTXF10_INEPNTXFSTADDR_8 (0x00000100UL) +#define USBHS_DIEPTXF10_INEPNTXFSTADDR_9 (0x00000200UL) +#define USBHS_DIEPTXF10_INEPNTXFSTADDR_10 (0x00000400UL) +#define USBHS_DIEPTXF10_INEPNTXFSTADDR_11 (0x00000800UL) +#define USBHS_DIEPTXF10_INEPNTXFSTADDR_12 (0x00001000UL) +#define USBHS_DIEPTXF10_INEPNTXFSTADDR_13 (0x00002000UL) +#define USBHS_DIEPTXF10_INEPNTXFSTADDR_14 (0x00004000UL) +#define USBHS_DIEPTXF10_INEPNTXFDEP_POS (16U) +#define USBHS_DIEPTXF10_INEPNTXFDEP (0x0FFF0000UL) +#define USBHS_DIEPTXF10_INEPNTXFDEP_0 (0x00010000UL) +#define USBHS_DIEPTXF10_INEPNTXFDEP_1 (0x00020000UL) +#define USBHS_DIEPTXF10_INEPNTXFDEP_2 (0x00040000UL) +#define USBHS_DIEPTXF10_INEPNTXFDEP_3 (0x00080000UL) +#define USBHS_DIEPTXF10_INEPNTXFDEP_4 (0x00100000UL) +#define USBHS_DIEPTXF10_INEPNTXFDEP_5 (0x00200000UL) +#define USBHS_DIEPTXF10_INEPNTXFDEP_6 (0x00400000UL) +#define USBHS_DIEPTXF10_INEPNTXFDEP_7 (0x00800000UL) +#define USBHS_DIEPTXF10_INEPNTXFDEP_8 (0x01000000UL) +#define USBHS_DIEPTXF10_INEPNTXFDEP_9 (0x02000000UL) +#define USBHS_DIEPTXF10_INEPNTXFDEP_10 (0x04000000UL) +#define USBHS_DIEPTXF10_INEPNTXFDEP_11 (0x08000000UL) + +/* Bit definition for USBHS_DIEPTXF11 register */ +#define USBHS_DIEPTXF11_INEPNTXFSTADDR_POS (0U) +#define USBHS_DIEPTXF11_INEPNTXFSTADDR (0x00007FFFUL) +#define USBHS_DIEPTXF11_INEPNTXFSTADDR_0 (0x00000001UL) +#define USBHS_DIEPTXF11_INEPNTXFSTADDR_1 (0x00000002UL) +#define USBHS_DIEPTXF11_INEPNTXFSTADDR_2 (0x00000004UL) +#define USBHS_DIEPTXF11_INEPNTXFSTADDR_3 (0x00000008UL) +#define USBHS_DIEPTXF11_INEPNTXFSTADDR_4 (0x00000010UL) +#define USBHS_DIEPTXF11_INEPNTXFSTADDR_5 (0x00000020UL) +#define USBHS_DIEPTXF11_INEPNTXFSTADDR_6 (0x00000040UL) +#define USBHS_DIEPTXF11_INEPNTXFSTADDR_7 (0x00000080UL) +#define USBHS_DIEPTXF11_INEPNTXFSTADDR_8 (0x00000100UL) +#define USBHS_DIEPTXF11_INEPNTXFSTADDR_9 (0x00000200UL) +#define USBHS_DIEPTXF11_INEPNTXFSTADDR_10 (0x00000400UL) +#define USBHS_DIEPTXF11_INEPNTXFSTADDR_11 (0x00000800UL) +#define USBHS_DIEPTXF11_INEPNTXFSTADDR_12 (0x00001000UL) +#define USBHS_DIEPTXF11_INEPNTXFSTADDR_13 (0x00002000UL) +#define USBHS_DIEPTXF11_INEPNTXFSTADDR_14 (0x00004000UL) +#define USBHS_DIEPTXF11_INEPNTXFDEP_POS (16U) +#define USBHS_DIEPTXF11_INEPNTXFDEP (0x0FFF0000UL) +#define USBHS_DIEPTXF11_INEPNTXFDEP_0 (0x00010000UL) +#define USBHS_DIEPTXF11_INEPNTXFDEP_1 (0x00020000UL) +#define USBHS_DIEPTXF11_INEPNTXFDEP_2 (0x00040000UL) +#define USBHS_DIEPTXF11_INEPNTXFDEP_3 (0x00080000UL) +#define USBHS_DIEPTXF11_INEPNTXFDEP_4 (0x00100000UL) +#define USBHS_DIEPTXF11_INEPNTXFDEP_5 (0x00200000UL) +#define USBHS_DIEPTXF11_INEPNTXFDEP_6 (0x00400000UL) +#define USBHS_DIEPTXF11_INEPNTXFDEP_7 (0x00800000UL) +#define USBHS_DIEPTXF11_INEPNTXFDEP_8 (0x01000000UL) +#define USBHS_DIEPTXF11_INEPNTXFDEP_9 (0x02000000UL) +#define USBHS_DIEPTXF11_INEPNTXFDEP_10 (0x04000000UL) +#define USBHS_DIEPTXF11_INEPNTXFDEP_11 (0x08000000UL) + +/* Bit definition for USBHS_DIEPTXF12 register */ +#define USBHS_DIEPTXF12_INEPNTXFSTADDR_POS (0U) +#define USBHS_DIEPTXF12_INEPNTXFSTADDR (0x00007FFFUL) +#define USBHS_DIEPTXF12_INEPNTXFSTADDR_0 (0x00000001UL) +#define USBHS_DIEPTXF12_INEPNTXFSTADDR_1 (0x00000002UL) +#define USBHS_DIEPTXF12_INEPNTXFSTADDR_2 (0x00000004UL) +#define USBHS_DIEPTXF12_INEPNTXFSTADDR_3 (0x00000008UL) +#define USBHS_DIEPTXF12_INEPNTXFSTADDR_4 (0x00000010UL) +#define USBHS_DIEPTXF12_INEPNTXFSTADDR_5 (0x00000020UL) +#define USBHS_DIEPTXF12_INEPNTXFSTADDR_6 (0x00000040UL) +#define USBHS_DIEPTXF12_INEPNTXFSTADDR_7 (0x00000080UL) +#define USBHS_DIEPTXF12_INEPNTXFSTADDR_8 (0x00000100UL) +#define USBHS_DIEPTXF12_INEPNTXFSTADDR_9 (0x00000200UL) +#define USBHS_DIEPTXF12_INEPNTXFSTADDR_10 (0x00000400UL) +#define USBHS_DIEPTXF12_INEPNTXFSTADDR_11 (0x00000800UL) +#define USBHS_DIEPTXF12_INEPNTXFSTADDR_12 (0x00001000UL) +#define USBHS_DIEPTXF12_INEPNTXFSTADDR_13 (0x00002000UL) +#define USBHS_DIEPTXF12_INEPNTXFSTADDR_14 (0x00004000UL) +#define USBHS_DIEPTXF12_INEPNTXFDEP_POS (16U) +#define USBHS_DIEPTXF12_INEPNTXFDEP (0x0FFF0000UL) +#define USBHS_DIEPTXF12_INEPNTXFDEP_0 (0x00010000UL) +#define USBHS_DIEPTXF12_INEPNTXFDEP_1 (0x00020000UL) +#define USBHS_DIEPTXF12_INEPNTXFDEP_2 (0x00040000UL) +#define USBHS_DIEPTXF12_INEPNTXFDEP_3 (0x00080000UL) +#define USBHS_DIEPTXF12_INEPNTXFDEP_4 (0x00100000UL) +#define USBHS_DIEPTXF12_INEPNTXFDEP_5 (0x00200000UL) +#define USBHS_DIEPTXF12_INEPNTXFDEP_6 (0x00400000UL) +#define USBHS_DIEPTXF12_INEPNTXFDEP_7 (0x00800000UL) +#define USBHS_DIEPTXF12_INEPNTXFDEP_8 (0x01000000UL) +#define USBHS_DIEPTXF12_INEPNTXFDEP_9 (0x02000000UL) +#define USBHS_DIEPTXF12_INEPNTXFDEP_10 (0x04000000UL) +#define USBHS_DIEPTXF12_INEPNTXFDEP_11 (0x08000000UL) + +/* Bit definition for USBHS_DIEPTXF13 register */ +#define USBHS_DIEPTXF13_INEPNTXFSTADDR_POS (0U) +#define USBHS_DIEPTXF13_INEPNTXFSTADDR (0x00007FFFUL) +#define USBHS_DIEPTXF13_INEPNTXFSTADDR_0 (0x00000001UL) +#define USBHS_DIEPTXF13_INEPNTXFSTADDR_1 (0x00000002UL) +#define USBHS_DIEPTXF13_INEPNTXFSTADDR_2 (0x00000004UL) +#define USBHS_DIEPTXF13_INEPNTXFSTADDR_3 (0x00000008UL) +#define USBHS_DIEPTXF13_INEPNTXFSTADDR_4 (0x00000010UL) +#define USBHS_DIEPTXF13_INEPNTXFSTADDR_5 (0x00000020UL) +#define USBHS_DIEPTXF13_INEPNTXFSTADDR_6 (0x00000040UL) +#define USBHS_DIEPTXF13_INEPNTXFSTADDR_7 (0x00000080UL) +#define USBHS_DIEPTXF13_INEPNTXFSTADDR_8 (0x00000100UL) +#define USBHS_DIEPTXF13_INEPNTXFSTADDR_9 (0x00000200UL) +#define USBHS_DIEPTXF13_INEPNTXFSTADDR_10 (0x00000400UL) +#define USBHS_DIEPTXF13_INEPNTXFSTADDR_11 (0x00000800UL) +#define USBHS_DIEPTXF13_INEPNTXFSTADDR_12 (0x00001000UL) +#define USBHS_DIEPTXF13_INEPNTXFSTADDR_13 (0x00002000UL) +#define USBHS_DIEPTXF13_INEPNTXFSTADDR_14 (0x00004000UL) +#define USBHS_DIEPTXF13_INEPNTXFDEP_POS (16U) +#define USBHS_DIEPTXF13_INEPNTXFDEP (0x0FFF0000UL) +#define USBHS_DIEPTXF13_INEPNTXFDEP_0 (0x00010000UL) +#define USBHS_DIEPTXF13_INEPNTXFDEP_1 (0x00020000UL) +#define USBHS_DIEPTXF13_INEPNTXFDEP_2 (0x00040000UL) +#define USBHS_DIEPTXF13_INEPNTXFDEP_3 (0x00080000UL) +#define USBHS_DIEPTXF13_INEPNTXFDEP_4 (0x00100000UL) +#define USBHS_DIEPTXF13_INEPNTXFDEP_5 (0x00200000UL) +#define USBHS_DIEPTXF13_INEPNTXFDEP_6 (0x00400000UL) +#define USBHS_DIEPTXF13_INEPNTXFDEP_7 (0x00800000UL) +#define USBHS_DIEPTXF13_INEPNTXFDEP_8 (0x01000000UL) +#define USBHS_DIEPTXF13_INEPNTXFDEP_9 (0x02000000UL) +#define USBHS_DIEPTXF13_INEPNTXFDEP_10 (0x04000000UL) +#define USBHS_DIEPTXF13_INEPNTXFDEP_11 (0x08000000UL) + +/* Bit definition for USBHS_DIEPTXF14 register */ +#define USBHS_DIEPTXF14_INEPNTXFSTADDR_POS (0U) +#define USBHS_DIEPTXF14_INEPNTXFSTADDR (0x00007FFFUL) +#define USBHS_DIEPTXF14_INEPNTXFSTADDR_0 (0x00000001UL) +#define USBHS_DIEPTXF14_INEPNTXFSTADDR_1 (0x00000002UL) +#define USBHS_DIEPTXF14_INEPNTXFSTADDR_2 (0x00000004UL) +#define USBHS_DIEPTXF14_INEPNTXFSTADDR_3 (0x00000008UL) +#define USBHS_DIEPTXF14_INEPNTXFSTADDR_4 (0x00000010UL) +#define USBHS_DIEPTXF14_INEPNTXFSTADDR_5 (0x00000020UL) +#define USBHS_DIEPTXF14_INEPNTXFSTADDR_6 (0x00000040UL) +#define USBHS_DIEPTXF14_INEPNTXFSTADDR_7 (0x00000080UL) +#define USBHS_DIEPTXF14_INEPNTXFSTADDR_8 (0x00000100UL) +#define USBHS_DIEPTXF14_INEPNTXFSTADDR_9 (0x00000200UL) +#define USBHS_DIEPTXF14_INEPNTXFSTADDR_10 (0x00000400UL) +#define USBHS_DIEPTXF14_INEPNTXFSTADDR_11 (0x00000800UL) +#define USBHS_DIEPTXF14_INEPNTXFSTADDR_12 (0x00001000UL) +#define USBHS_DIEPTXF14_INEPNTXFSTADDR_13 (0x00002000UL) +#define USBHS_DIEPTXF14_INEPNTXFSTADDR_14 (0x00004000UL) +#define USBHS_DIEPTXF14_INEPNTXFDEP_POS (16U) +#define USBHS_DIEPTXF14_INEPNTXFDEP (0x0FFF0000UL) +#define USBHS_DIEPTXF14_INEPNTXFDEP_0 (0x00010000UL) +#define USBHS_DIEPTXF14_INEPNTXFDEP_1 (0x00020000UL) +#define USBHS_DIEPTXF14_INEPNTXFDEP_2 (0x00040000UL) +#define USBHS_DIEPTXF14_INEPNTXFDEP_3 (0x00080000UL) +#define USBHS_DIEPTXF14_INEPNTXFDEP_4 (0x00100000UL) +#define USBHS_DIEPTXF14_INEPNTXFDEP_5 (0x00200000UL) +#define USBHS_DIEPTXF14_INEPNTXFDEP_6 (0x00400000UL) +#define USBHS_DIEPTXF14_INEPNTXFDEP_7 (0x00800000UL) +#define USBHS_DIEPTXF14_INEPNTXFDEP_8 (0x01000000UL) +#define USBHS_DIEPTXF14_INEPNTXFDEP_9 (0x02000000UL) +#define USBHS_DIEPTXF14_INEPNTXFDEP_10 (0x04000000UL) +#define USBHS_DIEPTXF14_INEPNTXFDEP_11 (0x08000000UL) + +/* Bit definition for USBHS_DIEPTXF15 register */ +#define USBHS_DIEPTXF15_INEPNTXFSTADDR_POS (0U) +#define USBHS_DIEPTXF15_INEPNTXFSTADDR (0x0000FFFFUL) +#define USBHS_DIEPTXF15_INEPNTXFSTADDR_0 (0x00000001UL) +#define USBHS_DIEPTXF15_INEPNTXFSTADDR_1 (0x00000002UL) +#define USBHS_DIEPTXF15_INEPNTXFSTADDR_2 (0x00000004UL) +#define USBHS_DIEPTXF15_INEPNTXFSTADDR_3 (0x00000008UL) +#define USBHS_DIEPTXF15_INEPNTXFSTADDR_4 (0x00000010UL) +#define USBHS_DIEPTXF15_INEPNTXFSTADDR_5 (0x00000020UL) +#define USBHS_DIEPTXF15_INEPNTXFSTADDR_6 (0x00000040UL) +#define USBHS_DIEPTXF15_INEPNTXFSTADDR_7 (0x00000080UL) +#define USBHS_DIEPTXF15_INEPNTXFSTADDR_8 (0x00000100UL) +#define USBHS_DIEPTXF15_INEPNTXFSTADDR_9 (0x00000200UL) +#define USBHS_DIEPTXF15_INEPNTXFSTADDR_10 (0x00000400UL) +#define USBHS_DIEPTXF15_INEPNTXFSTADDR_11 (0x00000800UL) +#define USBHS_DIEPTXF15_INEPNTXFSTADDR_12 (0x00001000UL) +#define USBHS_DIEPTXF15_INEPNTXFSTADDR_13 (0x00002000UL) +#define USBHS_DIEPTXF15_INEPNTXFSTADDR_14 (0x00004000UL) +#define USBHS_DIEPTXF15_INEPNTXFSTADDR_15 (0x00008000UL) +#define USBHS_DIEPTXF15_INEPNTXFDEP_POS (16U) +#define USBHS_DIEPTXF15_INEPNTXFDEP (0x0FFF0000UL) +#define USBHS_DIEPTXF15_INEPNTXFDEP_0 (0x00010000UL) +#define USBHS_DIEPTXF15_INEPNTXFDEP_1 (0x00020000UL) +#define USBHS_DIEPTXF15_INEPNTXFDEP_2 (0x00040000UL) +#define USBHS_DIEPTXF15_INEPNTXFDEP_3 (0x00080000UL) +#define USBHS_DIEPTXF15_INEPNTXFDEP_4 (0x00100000UL) +#define USBHS_DIEPTXF15_INEPNTXFDEP_5 (0x00200000UL) +#define USBHS_DIEPTXF15_INEPNTXFDEP_6 (0x00400000UL) +#define USBHS_DIEPTXF15_INEPNTXFDEP_7 (0x00800000UL) +#define USBHS_DIEPTXF15_INEPNTXFDEP_8 (0x01000000UL) +#define USBHS_DIEPTXF15_INEPNTXFDEP_9 (0x02000000UL) +#define USBHS_DIEPTXF15_INEPNTXFDEP_10 (0x04000000UL) +#define USBHS_DIEPTXF15_INEPNTXFDEP_11 (0x08000000UL) + +/* Bit definition for USBHS_HCFG register */ +#define USBHS_HCFG_FSLSPCLKSEL_POS (0U) +#define USBHS_HCFG_FSLSPCLKSEL (0x00000003UL) +#define USBHS_HCFG_FSLSPCLKSEL_0 (0x00000001UL) +#define USBHS_HCFG_FSLSPCLKSEL_1 (0x00000002UL) +#define USBHS_HCFG_FSLSSUPP_POS (2U) +#define USBHS_HCFG_FSLSSUPP (0x00000004UL) +#define USBHS_HCFG_ENA32KHZS_POS (7U) +#define USBHS_HCFG_ENA32KHZS (0x00000080UL) +#define USBHS_HCFG_RESVALID_POS (8U) +#define USBHS_HCFG_RESVALID (0x0000FF00UL) +#define USBHS_HCFG_RESVALID_0 (0x00000100UL) +#define USBHS_HCFG_RESVALID_1 (0x00000200UL) +#define USBHS_HCFG_RESVALID_2 (0x00000400UL) +#define USBHS_HCFG_RESVALID_3 (0x00000800UL) +#define USBHS_HCFG_RESVALID_4 (0x00001000UL) +#define USBHS_HCFG_RESVALID_5 (0x00002000UL) +#define USBHS_HCFG_RESVALID_6 (0x00004000UL) +#define USBHS_HCFG_RESVALID_7 (0x00008000UL) +#define USBHS_HCFG_MODECHTIMEN_POS (31U) +#define USBHS_HCFG_MODECHTIMEN (0x80000000UL) + +/* Bit definition for USBHS_HFIR register */ +#define USBHS_HFIR_FRINT_POS (0U) +#define USBHS_HFIR_FRINT (0x0000FFFFUL) +#define USBHS_HFIR_FRINT_0 (0x00000001UL) +#define USBHS_HFIR_FRINT_1 (0x00000002UL) +#define USBHS_HFIR_FRINT_2 (0x00000004UL) +#define USBHS_HFIR_FRINT_3 (0x00000008UL) +#define USBHS_HFIR_FRINT_4 (0x00000010UL) +#define USBHS_HFIR_FRINT_5 (0x00000020UL) +#define USBHS_HFIR_FRINT_6 (0x00000040UL) +#define USBHS_HFIR_FRINT_7 (0x00000080UL) +#define USBHS_HFIR_FRINT_8 (0x00000100UL) +#define USBHS_HFIR_FRINT_9 (0x00000200UL) +#define USBHS_HFIR_FRINT_10 (0x00000400UL) +#define USBHS_HFIR_FRINT_11 (0x00000800UL) +#define USBHS_HFIR_FRINT_12 (0x00001000UL) +#define USBHS_HFIR_FRINT_13 (0x00002000UL) +#define USBHS_HFIR_FRINT_14 (0x00004000UL) +#define USBHS_HFIR_FRINT_15 (0x00008000UL) +#define USBHS_HFIR_HFIRRLDCTRL_POS (16U) +#define USBHS_HFIR_HFIRRLDCTRL (0x00010000UL) + +/* Bit definition for USBHS_HFNUM register */ +#define USBHS_HFNUM_FRNUM_POS (0U) +#define USBHS_HFNUM_FRNUM (0x0000FFFFUL) +#define USBHS_HFNUM_FRNUM_0 (0x00000001UL) +#define USBHS_HFNUM_FRNUM_1 (0x00000002UL) +#define USBHS_HFNUM_FRNUM_2 (0x00000004UL) +#define USBHS_HFNUM_FRNUM_3 (0x00000008UL) +#define USBHS_HFNUM_FRNUM_4 (0x00000010UL) +#define USBHS_HFNUM_FRNUM_5 (0x00000020UL) +#define USBHS_HFNUM_FRNUM_6 (0x00000040UL) +#define USBHS_HFNUM_FRNUM_7 (0x00000080UL) +#define USBHS_HFNUM_FRNUM_8 (0x00000100UL) +#define USBHS_HFNUM_FRNUM_9 (0x00000200UL) +#define USBHS_HFNUM_FRNUM_10 (0x00000400UL) +#define USBHS_HFNUM_FRNUM_11 (0x00000800UL) +#define USBHS_HFNUM_FRNUM_12 (0x00001000UL) +#define USBHS_HFNUM_FRNUM_13 (0x00002000UL) +#define USBHS_HFNUM_FRNUM_14 (0x00004000UL) +#define USBHS_HFNUM_FRNUM_15 (0x00008000UL) +#define USBHS_HFNUM_FRREM_POS (16U) +#define USBHS_HFNUM_FRREM (0xFFFF0000UL) +#define USBHS_HFNUM_FRREM_0 (0x00010000UL) +#define USBHS_HFNUM_FRREM_1 (0x00020000UL) +#define USBHS_HFNUM_FRREM_2 (0x00040000UL) +#define USBHS_HFNUM_FRREM_3 (0x00080000UL) +#define USBHS_HFNUM_FRREM_4 (0x00100000UL) +#define USBHS_HFNUM_FRREM_5 (0x00200000UL) +#define USBHS_HFNUM_FRREM_6 (0x00400000UL) +#define USBHS_HFNUM_FRREM_7 (0x00800000UL) +#define USBHS_HFNUM_FRREM_8 (0x01000000UL) +#define USBHS_HFNUM_FRREM_9 (0x02000000UL) +#define USBHS_HFNUM_FRREM_10 (0x04000000UL) +#define USBHS_HFNUM_FRREM_11 (0x08000000UL) +#define USBHS_HFNUM_FRREM_12 (0x10000000UL) +#define USBHS_HFNUM_FRREM_13 (0x20000000UL) +#define USBHS_HFNUM_FRREM_14 (0x40000000UL) +#define USBHS_HFNUM_FRREM_15 (0x80000000UL) + +/* Bit definition for USBHS_HPTXSTS register */ +#define USBHS_HPTXSTS_PTXFSPCAVAIL_POS (0U) +#define USBHS_HPTXSTS_PTXFSPCAVAIL (0x0000FFFFUL) +#define USBHS_HPTXSTS_PTXFSPCAVAIL_0 (0x00000001UL) +#define USBHS_HPTXSTS_PTXFSPCAVAIL_1 (0x00000002UL) +#define USBHS_HPTXSTS_PTXFSPCAVAIL_2 (0x00000004UL) +#define USBHS_HPTXSTS_PTXFSPCAVAIL_3 (0x00000008UL) +#define USBHS_HPTXSTS_PTXFSPCAVAIL_4 (0x00000010UL) +#define USBHS_HPTXSTS_PTXFSPCAVAIL_5 (0x00000020UL) +#define USBHS_HPTXSTS_PTXFSPCAVAIL_6 (0x00000040UL) +#define USBHS_HPTXSTS_PTXFSPCAVAIL_7 (0x00000080UL) +#define USBHS_HPTXSTS_PTXFSPCAVAIL_8 (0x00000100UL) +#define USBHS_HPTXSTS_PTXFSPCAVAIL_9 (0x00000200UL) +#define USBHS_HPTXSTS_PTXFSPCAVAIL_10 (0x00000400UL) +#define USBHS_HPTXSTS_PTXFSPCAVAIL_11 (0x00000800UL) +#define USBHS_HPTXSTS_PTXFSPCAVAIL_12 (0x00001000UL) +#define USBHS_HPTXSTS_PTXFSPCAVAIL_13 (0x00002000UL) +#define USBHS_HPTXSTS_PTXFSPCAVAIL_14 (0x00004000UL) +#define USBHS_HPTXSTS_PTXFSPCAVAIL_15 (0x00008000UL) +#define USBHS_HPTXSTS_PTXQSPCAVAIL_POS (16U) +#define USBHS_HPTXSTS_PTXQSPCAVAIL (0x00FF0000UL) +#define USBHS_HPTXSTS_PTXQSPCAVAIL_0 (0x00010000UL) +#define USBHS_HPTXSTS_PTXQSPCAVAIL_1 (0x00020000UL) +#define USBHS_HPTXSTS_PTXQSPCAVAIL_2 (0x00040000UL) +#define USBHS_HPTXSTS_PTXQSPCAVAIL_3 (0x00080000UL) +#define USBHS_HPTXSTS_PTXQSPCAVAIL_4 (0x00100000UL) +#define USBHS_HPTXSTS_PTXQSPCAVAIL_5 (0x00200000UL) +#define USBHS_HPTXSTS_PTXQSPCAVAIL_6 (0x00400000UL) +#define USBHS_HPTXSTS_PTXQSPCAVAIL_7 (0x00800000UL) +#define USBHS_HPTXSTS_PTXQTOP_POS (24U) +#define USBHS_HPTXSTS_PTXQTOP (0xFF000000UL) +#define USBHS_HPTXSTS_PTXQTOP_0 (0x01000000UL) +#define USBHS_HPTXSTS_PTXQTOP_1 (0x02000000UL) +#define USBHS_HPTXSTS_PTXQTOP_2 (0x04000000UL) +#define USBHS_HPTXSTS_PTXQTOP_3 (0x08000000UL) +#define USBHS_HPTXSTS_PTXQTOP_4 (0x10000000UL) +#define USBHS_HPTXSTS_PTXQTOP_5 (0x20000000UL) +#define USBHS_HPTXSTS_PTXQTOP_6 (0x40000000UL) +#define USBHS_HPTXSTS_PTXQTOP_7 (0x80000000UL) + +/* Bit definition for USBHS_HAINT register */ +#define USBHS_HAINT_HAINT (0x0000FFFFUL) + +/* Bit definition for USBHS_HAINTMSK register */ +#define USBHS_HAINTMSK_HAINTMSK (0x0000FFFFUL) + +/* Bit definition for USBHS_HPRT register */ +#define USBHS_HPRT_PRTCONNSTS_POS (0U) +#define USBHS_HPRT_PRTCONNSTS (0x00000001UL) +#define USBHS_HPRT_PRTCONNDET_POS (1U) +#define USBHS_HPRT_PRTCONNDET (0x00000002UL) +#define USBHS_HPRT_PRTENA_POS (2U) +#define USBHS_HPRT_PRTENA (0x00000004UL) +#define USBHS_HPRT_PRTENCHNG_POS (3U) +#define USBHS_HPRT_PRTENCHNG (0x00000008UL) +#define USBHS_HPRT_PRTOVRCURRACT_POS (4U) +#define USBHS_HPRT_PRTOVRCURRACT (0x00000010UL) +#define USBHS_HPRT_PRTOVRCURRCHNG_POS (5U) +#define USBHS_HPRT_PRTOVRCURRCHNG (0x00000020UL) +#define USBHS_HPRT_PRTRES_POS (6U) +#define USBHS_HPRT_PRTRES (0x00000040UL) +#define USBHS_HPRT_PRTSUSP_POS (7U) +#define USBHS_HPRT_PRTSUSP (0x00000080UL) +#define USBHS_HPRT_PRTRST_POS (8U) +#define USBHS_HPRT_PRTRST (0x00000100UL) +#define USBHS_HPRT_PRTLNSTS_POS (10U) +#define USBHS_HPRT_PRTLNSTS (0x00000C00UL) +#define USBHS_HPRT_PRTLNSTS_0 (0x00000400UL) +#define USBHS_HPRT_PRTLNSTS_1 (0x00000800UL) +#define USBHS_HPRT_PRTPWR_POS (12U) +#define USBHS_HPRT_PRTPWR (0x00001000UL) +#define USBHS_HPRT_PRTTSTCTL_POS (13U) +#define USBHS_HPRT_PRTTSTCTL (0x0001E000UL) +#define USBHS_HPRT_PRTTSTCTL_0 (0x00002000UL) +#define USBHS_HPRT_PRTTSTCTL_1 (0x00004000UL) +#define USBHS_HPRT_PRTTSTCTL_2 (0x00008000UL) +#define USBHS_HPRT_PRTTSTCTL_3 (0x00010000UL) +#define USBHS_HPRT_PRTSPD_POS (17U) +#define USBHS_HPRT_PRTSPD (0x00060000UL) +#define USBHS_HPRT_PRTSPD_0 (0x00020000UL) +#define USBHS_HPRT_PRTSPD_1 (0x00040000UL) + +/* Bit definition for USBHS_HCCHAR0 register */ +#define USBHS_HCCHAR0_MPS_POS (0U) +#define USBHS_HCCHAR0_MPS (0x000007FFUL) +#define USBHS_HCCHAR0_MPS_0 (0x00000001UL) +#define USBHS_HCCHAR0_MPS_1 (0x00000002UL) +#define USBHS_HCCHAR0_MPS_2 (0x00000004UL) +#define USBHS_HCCHAR0_MPS_3 (0x00000008UL) +#define USBHS_HCCHAR0_MPS_4 (0x00000010UL) +#define USBHS_HCCHAR0_MPS_5 (0x00000020UL) +#define USBHS_HCCHAR0_MPS_6 (0x00000040UL) +#define USBHS_HCCHAR0_MPS_7 (0x00000080UL) +#define USBHS_HCCHAR0_MPS_8 (0x00000100UL) +#define USBHS_HCCHAR0_MPS_9 (0x00000200UL) +#define USBHS_HCCHAR0_MPS_10 (0x00000400UL) +#define USBHS_HCCHAR0_EPNUM_POS (11U) +#define USBHS_HCCHAR0_EPNUM (0x00007800UL) +#define USBHS_HCCHAR0_EPNUM_0 (0x00000800UL) +#define USBHS_HCCHAR0_EPNUM_1 (0x00001000UL) +#define USBHS_HCCHAR0_EPNUM_2 (0x00002000UL) +#define USBHS_HCCHAR0_EPNUM_3 (0x00004000UL) +#define USBHS_HCCHAR0_EPDIR_POS (15U) +#define USBHS_HCCHAR0_EPDIR (0x00008000UL) +#define USBHS_HCCHAR0_LSPDDEV_POS (17U) +#define USBHS_HCCHAR0_LSPDDEV (0x00020000UL) +#define USBHS_HCCHAR0_EPTYPE_POS (18U) +#define USBHS_HCCHAR0_EPTYPE (0x000C0000UL) +#define USBHS_HCCHAR0_EPTYPE_0 (0x00040000UL) +#define USBHS_HCCHAR0_EPTYPE_1 (0x00080000UL) +#define USBHS_HCCHAR0_EC_POS (20U) +#define USBHS_HCCHAR0_EC (0x00300000UL) +#define USBHS_HCCHAR0_EC_0 (0x00100000UL) +#define USBHS_HCCHAR0_EC_1 (0x00200000UL) +#define USBHS_HCCHAR0_DEVADDR_POS (22U) +#define USBHS_HCCHAR0_DEVADDR (0x1FC00000UL) +#define USBHS_HCCHAR0_DEVADDR_0 (0x00400000UL) +#define USBHS_HCCHAR0_DEVADDR_1 (0x00800000UL) +#define USBHS_HCCHAR0_DEVADDR_2 (0x01000000UL) +#define USBHS_HCCHAR0_DEVADDR_3 (0x02000000UL) +#define USBHS_HCCHAR0_DEVADDR_4 (0x04000000UL) +#define USBHS_HCCHAR0_DEVADDR_5 (0x08000000UL) +#define USBHS_HCCHAR0_DEVADDR_6 (0x10000000UL) +#define USBHS_HCCHAR0_ODDFRM_POS (29U) +#define USBHS_HCCHAR0_ODDFRM (0x20000000UL) +#define USBHS_HCCHAR0_CHDIS_POS (30U) +#define USBHS_HCCHAR0_CHDIS (0x40000000UL) +#define USBHS_HCCHAR0_CHENA_POS (31U) +#define USBHS_HCCHAR0_CHENA (0x80000000UL) + +/* Bit definition for USBHS_HCSPLT0 register */ +#define USBHS_HCSPLT0_PRTADDR_POS (0U) +#define USBHS_HCSPLT0_PRTADDR (0x0000007FUL) +#define USBHS_HCSPLT0_PRTADDR_0 (0x00000001UL) +#define USBHS_HCSPLT0_PRTADDR_1 (0x00000002UL) +#define USBHS_HCSPLT0_PRTADDR_2 (0x00000004UL) +#define USBHS_HCSPLT0_PRTADDR_3 (0x00000008UL) +#define USBHS_HCSPLT0_PRTADDR_4 (0x00000010UL) +#define USBHS_HCSPLT0_PRTADDR_5 (0x00000020UL) +#define USBHS_HCSPLT0_PRTADDR_6 (0x00000040UL) +#define USBHS_HCSPLT0_HUBADDR_POS (7U) +#define USBHS_HCSPLT0_HUBADDR (0x00003F80UL) +#define USBHS_HCSPLT0_HUBADDR_0 (0x00000080UL) +#define USBHS_HCSPLT0_HUBADDR_1 (0x00000100UL) +#define USBHS_HCSPLT0_HUBADDR_2 (0x00000200UL) +#define USBHS_HCSPLT0_HUBADDR_3 (0x00000400UL) +#define USBHS_HCSPLT0_HUBADDR_4 (0x00000800UL) +#define USBHS_HCSPLT0_HUBADDR_5 (0x00001000UL) +#define USBHS_HCSPLT0_HUBADDR_6 (0x00002000UL) +#define USBHS_HCSPLT0_XACTPOS_POS (14U) +#define USBHS_HCSPLT0_XACTPOS (0x0000C000UL) +#define USBHS_HCSPLT0_XACTPOS_0 (0x00004000UL) +#define USBHS_HCSPLT0_XACTPOS_1 (0x00008000UL) +#define USBHS_HCSPLT0_COMPSPLT_POS (16U) +#define USBHS_HCSPLT0_COMPSPLT (0x00010000UL) +#define USBHS_HCSPLT0_SPLTENA_POS (31U) +#define USBHS_HCSPLT0_SPLTENA (0x80000000UL) + +/* Bit definition for USBHS_HCINT0 register */ +#define USBHS_HCINT0_XFERCOMPL_POS (0U) +#define USBHS_HCINT0_XFERCOMPL (0x00000001UL) +#define USBHS_HCINT0_CHHLTD_POS (1U) +#define USBHS_HCINT0_CHHLTD (0x00000002UL) +#define USBHS_HCINT0_AHBERR_POS (2U) +#define USBHS_HCINT0_AHBERR (0x00000004UL) +#define USBHS_HCINT0_STALL_POS (3U) +#define USBHS_HCINT0_STALL (0x00000008UL) +#define USBHS_HCINT0_NAK_POS (4U) +#define USBHS_HCINT0_NAK (0x00000010UL) +#define USBHS_HCINT0_ACK_POS (5U) +#define USBHS_HCINT0_ACK (0x00000020UL) +#define USBHS_HCINT0_NYET_POS (6U) +#define USBHS_HCINT0_NYET (0x00000040UL) +#define USBHS_HCINT0_XACTERR_POS (7U) +#define USBHS_HCINT0_XACTERR (0x00000080UL) +#define USBHS_HCINT0_BBLERR_POS (8U) +#define USBHS_HCINT0_BBLERR (0x00000100UL) +#define USBHS_HCINT0_FRMOVRUN_POS (9U) +#define USBHS_HCINT0_FRMOVRUN (0x00000200UL) +#define USBHS_HCINT0_DATATGLERR_POS (10U) +#define USBHS_HCINT0_DATATGLERR (0x00000400UL) + +/* Bit definition for USBHS_HCINTMSK0 register */ +#define USBHS_HCINTMSK0_XFERCOMPLMSK_POS (0U) +#define USBHS_HCINTMSK0_XFERCOMPLMSK (0x00000001UL) +#define USBHS_HCINTMSK0_CHHLTDMSK_POS (1U) +#define USBHS_HCINTMSK0_CHHLTDMSK (0x00000002UL) +#define USBHS_HCINTMSK0_AHBERRMSK_POS (2U) +#define USBHS_HCINTMSK0_AHBERRMSK (0x00000004UL) +#define USBHS_HCINTMSK0_STALLMSK_POS (3U) +#define USBHS_HCINTMSK0_STALLMSK (0x00000008UL) +#define USBHS_HCINTMSK0_NAKMSK_POS (4U) +#define USBHS_HCINTMSK0_NAKMSK (0x00000010UL) +#define USBHS_HCINTMSK0_ACKMSK_POS (5U) +#define USBHS_HCINTMSK0_ACKMSK (0x00000020UL) +#define USBHS_HCINTMSK0_NYETMSK_POS (6U) +#define USBHS_HCINTMSK0_NYETMSK (0x00000040UL) +#define USBHS_HCINTMSK0_XACTERRMSK_POS (7U) +#define USBHS_HCINTMSK0_XACTERRMSK (0x00000080UL) +#define USBHS_HCINTMSK0_BBLERRMSK_POS (8U) +#define USBHS_HCINTMSK0_BBLERRMSK (0x00000100UL) +#define USBHS_HCINTMSK0_FRMOVRUNMSK_POS (9U) +#define USBHS_HCINTMSK0_FRMOVRUNMSK (0x00000200UL) +#define USBHS_HCINTMSK0_DATATGLERRMSK_POS (10U) +#define USBHS_HCINTMSK0_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBHS_HCTSIZ0 register */ +#define USBHS_HCTSIZ0_XFERSIZE_POS (0U) +#define USBHS_HCTSIZ0_XFERSIZE (0x0007FFFFUL) +#define USBHS_HCTSIZ0_XFERSIZE_0 (0x00000001UL) +#define USBHS_HCTSIZ0_XFERSIZE_1 (0x00000002UL) +#define USBHS_HCTSIZ0_XFERSIZE_2 (0x00000004UL) +#define USBHS_HCTSIZ0_XFERSIZE_3 (0x00000008UL) +#define USBHS_HCTSIZ0_XFERSIZE_4 (0x00000010UL) +#define USBHS_HCTSIZ0_XFERSIZE_5 (0x00000020UL) +#define USBHS_HCTSIZ0_XFERSIZE_6 (0x00000040UL) +#define USBHS_HCTSIZ0_XFERSIZE_7 (0x00000080UL) +#define USBHS_HCTSIZ0_XFERSIZE_8 (0x00000100UL) +#define USBHS_HCTSIZ0_XFERSIZE_9 (0x00000200UL) +#define USBHS_HCTSIZ0_XFERSIZE_10 (0x00000400UL) +#define USBHS_HCTSIZ0_XFERSIZE_11 (0x00000800UL) +#define USBHS_HCTSIZ0_XFERSIZE_12 (0x00001000UL) +#define USBHS_HCTSIZ0_XFERSIZE_13 (0x00002000UL) +#define USBHS_HCTSIZ0_XFERSIZE_14 (0x00004000UL) +#define USBHS_HCTSIZ0_XFERSIZE_15 (0x00008000UL) +#define USBHS_HCTSIZ0_XFERSIZE_16 (0x00010000UL) +#define USBHS_HCTSIZ0_XFERSIZE_17 (0x00020000UL) +#define USBHS_HCTSIZ0_XFERSIZE_18 (0x00040000UL) +#define USBHS_HCTSIZ0_PKTCNT_POS (19U) +#define USBHS_HCTSIZ0_PKTCNT (0x1FF80000UL) +#define USBHS_HCTSIZ0_PKTCNT_0 (0x00080000UL) +#define USBHS_HCTSIZ0_PKTCNT_1 (0x00100000UL) +#define USBHS_HCTSIZ0_PKTCNT_2 (0x00200000UL) +#define USBHS_HCTSIZ0_PKTCNT_3 (0x00400000UL) +#define USBHS_HCTSIZ0_PKTCNT_4 (0x00800000UL) +#define USBHS_HCTSIZ0_PKTCNT_5 (0x01000000UL) +#define USBHS_HCTSIZ0_PKTCNT_6 (0x02000000UL) +#define USBHS_HCTSIZ0_PKTCNT_7 (0x04000000UL) +#define USBHS_HCTSIZ0_PKTCNT_8 (0x08000000UL) +#define USBHS_HCTSIZ0_PKTCNT_9 (0x10000000UL) +#define USBHS_HCTSIZ0_PID_POS (29U) +#define USBHS_HCTSIZ0_PID (0x60000000UL) +#define USBHS_HCTSIZ0_PID_0 (0x20000000UL) +#define USBHS_HCTSIZ0_PID_1 (0x40000000UL) +#define USBHS_HCTSIZ0_DOPNG_POS (31U) +#define USBHS_HCTSIZ0_DOPNG (0x80000000UL) + +/* Bit definition for USBHS_HCDMA0 register */ +#define USBHS_HCDMA0 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_HCCHAR1 register */ +#define USBHS_HCCHAR1_MPS_POS (0U) +#define USBHS_HCCHAR1_MPS (0x000007FFUL) +#define USBHS_HCCHAR1_MPS_0 (0x00000001UL) +#define USBHS_HCCHAR1_MPS_1 (0x00000002UL) +#define USBHS_HCCHAR1_MPS_2 (0x00000004UL) +#define USBHS_HCCHAR1_MPS_3 (0x00000008UL) +#define USBHS_HCCHAR1_MPS_4 (0x00000010UL) +#define USBHS_HCCHAR1_MPS_5 (0x00000020UL) +#define USBHS_HCCHAR1_MPS_6 (0x00000040UL) +#define USBHS_HCCHAR1_MPS_7 (0x00000080UL) +#define USBHS_HCCHAR1_MPS_8 (0x00000100UL) +#define USBHS_HCCHAR1_MPS_9 (0x00000200UL) +#define USBHS_HCCHAR1_MPS_10 (0x00000400UL) +#define USBHS_HCCHAR1_EPNUM_POS (11U) +#define USBHS_HCCHAR1_EPNUM (0x00007800UL) +#define USBHS_HCCHAR1_EPNUM_0 (0x00000800UL) +#define USBHS_HCCHAR1_EPNUM_1 (0x00001000UL) +#define USBHS_HCCHAR1_EPNUM_2 (0x00002000UL) +#define USBHS_HCCHAR1_EPNUM_3 (0x00004000UL) +#define USBHS_HCCHAR1_EPDIR_POS (15U) +#define USBHS_HCCHAR1_EPDIR (0x00008000UL) +#define USBHS_HCCHAR1_LSPDDEV_POS (17U) +#define USBHS_HCCHAR1_LSPDDEV (0x00020000UL) +#define USBHS_HCCHAR1_EPTYPE_POS (18U) +#define USBHS_HCCHAR1_EPTYPE (0x000C0000UL) +#define USBHS_HCCHAR1_EPTYPE_0 (0x00040000UL) +#define USBHS_HCCHAR1_EPTYPE_1 (0x00080000UL) +#define USBHS_HCCHAR1_EC_POS (20U) +#define USBHS_HCCHAR1_EC (0x00300000UL) +#define USBHS_HCCHAR1_EC_0 (0x00100000UL) +#define USBHS_HCCHAR1_EC_1 (0x00200000UL) +#define USBHS_HCCHAR1_DEVADDR_POS (22U) +#define USBHS_HCCHAR1_DEVADDR (0x1FC00000UL) +#define USBHS_HCCHAR1_DEVADDR_0 (0x00400000UL) +#define USBHS_HCCHAR1_DEVADDR_1 (0x00800000UL) +#define USBHS_HCCHAR1_DEVADDR_2 (0x01000000UL) +#define USBHS_HCCHAR1_DEVADDR_3 (0x02000000UL) +#define USBHS_HCCHAR1_DEVADDR_4 (0x04000000UL) +#define USBHS_HCCHAR1_DEVADDR_5 (0x08000000UL) +#define USBHS_HCCHAR1_DEVADDR_6 (0x10000000UL) +#define USBHS_HCCHAR1_ODDFRM_POS (29U) +#define USBHS_HCCHAR1_ODDFRM (0x20000000UL) +#define USBHS_HCCHAR1_CHDIS_POS (30U) +#define USBHS_HCCHAR1_CHDIS (0x40000000UL) +#define USBHS_HCCHAR1_CHENA_POS (31U) +#define USBHS_HCCHAR1_CHENA (0x80000000UL) + +/* Bit definition for USBHS_HCSPLT1 register */ +#define USBHS_HCSPLT1_PRTADDR_POS (0U) +#define USBHS_HCSPLT1_PRTADDR (0x0000007FUL) +#define USBHS_HCSPLT1_PRTADDR_0 (0x00000001UL) +#define USBHS_HCSPLT1_PRTADDR_1 (0x00000002UL) +#define USBHS_HCSPLT1_PRTADDR_2 (0x00000004UL) +#define USBHS_HCSPLT1_PRTADDR_3 (0x00000008UL) +#define USBHS_HCSPLT1_PRTADDR_4 (0x00000010UL) +#define USBHS_HCSPLT1_PRTADDR_5 (0x00000020UL) +#define USBHS_HCSPLT1_PRTADDR_6 (0x00000040UL) +#define USBHS_HCSPLT1_HUBADDR_POS (7U) +#define USBHS_HCSPLT1_HUBADDR (0x00003F80UL) +#define USBHS_HCSPLT1_HUBADDR_0 (0x00000080UL) +#define USBHS_HCSPLT1_HUBADDR_1 (0x00000100UL) +#define USBHS_HCSPLT1_HUBADDR_2 (0x00000200UL) +#define USBHS_HCSPLT1_HUBADDR_3 (0x00000400UL) +#define USBHS_HCSPLT1_HUBADDR_4 (0x00000800UL) +#define USBHS_HCSPLT1_HUBADDR_5 (0x00001000UL) +#define USBHS_HCSPLT1_HUBADDR_6 (0x00002000UL) +#define USBHS_HCSPLT1_XACTPOS_POS (14U) +#define USBHS_HCSPLT1_XACTPOS (0x0000C000UL) +#define USBHS_HCSPLT1_XACTPOS_0 (0x00004000UL) +#define USBHS_HCSPLT1_XACTPOS_1 (0x00008000UL) +#define USBHS_HCSPLT1_COMPSPLT_POS (16U) +#define USBHS_HCSPLT1_COMPSPLT (0x00010000UL) +#define USBHS_HCSPLT1_SPLTENA_POS (31U) +#define USBHS_HCSPLT1_SPLTENA (0x80000000UL) + +/* Bit definition for USBHS_HCINT1 register */ +#define USBHS_HCINT1_XFERCOMPL_POS (0U) +#define USBHS_HCINT1_XFERCOMPL (0x00000001UL) +#define USBHS_HCINT1_CHHLTD_POS (1U) +#define USBHS_HCINT1_CHHLTD (0x00000002UL) +#define USBHS_HCINT1_AHBERR_POS (2U) +#define USBHS_HCINT1_AHBERR (0x00000004UL) +#define USBHS_HCINT1_STALL_POS (3U) +#define USBHS_HCINT1_STALL (0x00000008UL) +#define USBHS_HCINT1_NAK_POS (4U) +#define USBHS_HCINT1_NAK (0x00000010UL) +#define USBHS_HCINT1_ACK_POS (5U) +#define USBHS_HCINT1_ACK (0x00000020UL) +#define USBHS_HCINT1_NYET_POS (6U) +#define USBHS_HCINT1_NYET (0x00000040UL) +#define USBHS_HCINT1_XACTERR_POS (7U) +#define USBHS_HCINT1_XACTERR (0x00000080UL) +#define USBHS_HCINT1_BBLERR_POS (8U) +#define USBHS_HCINT1_BBLERR (0x00000100UL) +#define USBHS_HCINT1_FRMOVRUN_POS (9U) +#define USBHS_HCINT1_FRMOVRUN (0x00000200UL) +#define USBHS_HCINT1_DATATGLERR_POS (10U) +#define USBHS_HCINT1_DATATGLERR (0x00000400UL) + +/* Bit definition for USBHS_HCINTMSK1 register */ +#define USBHS_HCINTMSK1_XFERCOMPLMSK_POS (0U) +#define USBHS_HCINTMSK1_XFERCOMPLMSK (0x00000001UL) +#define USBHS_HCINTMSK1_CHHLTDMSK_POS (1U) +#define USBHS_HCINTMSK1_CHHLTDMSK (0x00000002UL) +#define USBHS_HCINTMSK1_AHBERRMSK_POS (2U) +#define USBHS_HCINTMSK1_AHBERRMSK (0x00000004UL) +#define USBHS_HCINTMSK1_STALLMSK_POS (3U) +#define USBHS_HCINTMSK1_STALLMSK (0x00000008UL) +#define USBHS_HCINTMSK1_NAKMSK_POS (4U) +#define USBHS_HCINTMSK1_NAKMSK (0x00000010UL) +#define USBHS_HCINTMSK1_ACKMSK_POS (5U) +#define USBHS_HCINTMSK1_ACKMSK (0x00000020UL) +#define USBHS_HCINTMSK1_NYETMSK_POS (6U) +#define USBHS_HCINTMSK1_NYETMSK (0x00000040UL) +#define USBHS_HCINTMSK1_XACTERRMSK_POS (7U) +#define USBHS_HCINTMSK1_XACTERRMSK (0x00000080UL) +#define USBHS_HCINTMSK1_BBLERRMSK_POS (8U) +#define USBHS_HCINTMSK1_BBLERRMSK (0x00000100UL) +#define USBHS_HCINTMSK1_FRMOVRUNMSK_POS (9U) +#define USBHS_HCINTMSK1_FRMOVRUNMSK (0x00000200UL) +#define USBHS_HCINTMSK1_DATATGLERRMSK_POS (10U) +#define USBHS_HCINTMSK1_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBHS_HCTSIZ1 register */ +#define USBHS_HCTSIZ1_XFERSIZE_POS (0U) +#define USBHS_HCTSIZ1_XFERSIZE (0x0007FFFFUL) +#define USBHS_HCTSIZ1_XFERSIZE_0 (0x00000001UL) +#define USBHS_HCTSIZ1_XFERSIZE_1 (0x00000002UL) +#define USBHS_HCTSIZ1_XFERSIZE_2 (0x00000004UL) +#define USBHS_HCTSIZ1_XFERSIZE_3 (0x00000008UL) +#define USBHS_HCTSIZ1_XFERSIZE_4 (0x00000010UL) +#define USBHS_HCTSIZ1_XFERSIZE_5 (0x00000020UL) +#define USBHS_HCTSIZ1_XFERSIZE_6 (0x00000040UL) +#define USBHS_HCTSIZ1_XFERSIZE_7 (0x00000080UL) +#define USBHS_HCTSIZ1_XFERSIZE_8 (0x00000100UL) +#define USBHS_HCTSIZ1_XFERSIZE_9 (0x00000200UL) +#define USBHS_HCTSIZ1_XFERSIZE_10 (0x00000400UL) +#define USBHS_HCTSIZ1_XFERSIZE_11 (0x00000800UL) +#define USBHS_HCTSIZ1_XFERSIZE_12 (0x00001000UL) +#define USBHS_HCTSIZ1_XFERSIZE_13 (0x00002000UL) +#define USBHS_HCTSIZ1_XFERSIZE_14 (0x00004000UL) +#define USBHS_HCTSIZ1_XFERSIZE_15 (0x00008000UL) +#define USBHS_HCTSIZ1_XFERSIZE_16 (0x00010000UL) +#define USBHS_HCTSIZ1_XFERSIZE_17 (0x00020000UL) +#define USBHS_HCTSIZ1_XFERSIZE_18 (0x00040000UL) +#define USBHS_HCTSIZ1_PKTCNT_POS (19U) +#define USBHS_HCTSIZ1_PKTCNT (0x1FF80000UL) +#define USBHS_HCTSIZ1_PKTCNT_0 (0x00080000UL) +#define USBHS_HCTSIZ1_PKTCNT_1 (0x00100000UL) +#define USBHS_HCTSIZ1_PKTCNT_2 (0x00200000UL) +#define USBHS_HCTSIZ1_PKTCNT_3 (0x00400000UL) +#define USBHS_HCTSIZ1_PKTCNT_4 (0x00800000UL) +#define USBHS_HCTSIZ1_PKTCNT_5 (0x01000000UL) +#define USBHS_HCTSIZ1_PKTCNT_6 (0x02000000UL) +#define USBHS_HCTSIZ1_PKTCNT_7 (0x04000000UL) +#define USBHS_HCTSIZ1_PKTCNT_8 (0x08000000UL) +#define USBHS_HCTSIZ1_PKTCNT_9 (0x10000000UL) +#define USBHS_HCTSIZ1_PID_POS (29U) +#define USBHS_HCTSIZ1_PID (0x60000000UL) +#define USBHS_HCTSIZ1_PID_0 (0x20000000UL) +#define USBHS_HCTSIZ1_PID_1 (0x40000000UL) +#define USBHS_HCTSIZ1_DOPNG_POS (31U) +#define USBHS_HCTSIZ1_DOPNG (0x80000000UL) + +/* Bit definition for USBHS_HCDMA1 register */ +#define USBHS_HCDMA1 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_HCCHAR2 register */ +#define USBHS_HCCHAR2_MPS_POS (0U) +#define USBHS_HCCHAR2_MPS (0x000007FFUL) +#define USBHS_HCCHAR2_MPS_0 (0x00000001UL) +#define USBHS_HCCHAR2_MPS_1 (0x00000002UL) +#define USBHS_HCCHAR2_MPS_2 (0x00000004UL) +#define USBHS_HCCHAR2_MPS_3 (0x00000008UL) +#define USBHS_HCCHAR2_MPS_4 (0x00000010UL) +#define USBHS_HCCHAR2_MPS_5 (0x00000020UL) +#define USBHS_HCCHAR2_MPS_6 (0x00000040UL) +#define USBHS_HCCHAR2_MPS_7 (0x00000080UL) +#define USBHS_HCCHAR2_MPS_8 (0x00000100UL) +#define USBHS_HCCHAR2_MPS_9 (0x00000200UL) +#define USBHS_HCCHAR2_MPS_10 (0x00000400UL) +#define USBHS_HCCHAR2_EPNUM_POS (11U) +#define USBHS_HCCHAR2_EPNUM (0x00007800UL) +#define USBHS_HCCHAR2_EPNUM_0 (0x00000800UL) +#define USBHS_HCCHAR2_EPNUM_1 (0x00001000UL) +#define USBHS_HCCHAR2_EPNUM_2 (0x00002000UL) +#define USBHS_HCCHAR2_EPNUM_3 (0x00004000UL) +#define USBHS_HCCHAR2_EPDIR_POS (15U) +#define USBHS_HCCHAR2_EPDIR (0x00008000UL) +#define USBHS_HCCHAR2_LSPDDEV_POS (17U) +#define USBHS_HCCHAR2_LSPDDEV (0x00020000UL) +#define USBHS_HCCHAR2_EPTYPE_POS (18U) +#define USBHS_HCCHAR2_EPTYPE (0x000C0000UL) +#define USBHS_HCCHAR2_EPTYPE_0 (0x00040000UL) +#define USBHS_HCCHAR2_EPTYPE_1 (0x00080000UL) +#define USBHS_HCCHAR2_EC_POS (20U) +#define USBHS_HCCHAR2_EC (0x00300000UL) +#define USBHS_HCCHAR2_EC_0 (0x00100000UL) +#define USBHS_HCCHAR2_EC_1 (0x00200000UL) +#define USBHS_HCCHAR2_DEVADDR_POS (22U) +#define USBHS_HCCHAR2_DEVADDR (0x1FC00000UL) +#define USBHS_HCCHAR2_DEVADDR_0 (0x00400000UL) +#define USBHS_HCCHAR2_DEVADDR_1 (0x00800000UL) +#define USBHS_HCCHAR2_DEVADDR_2 (0x01000000UL) +#define USBHS_HCCHAR2_DEVADDR_3 (0x02000000UL) +#define USBHS_HCCHAR2_DEVADDR_4 (0x04000000UL) +#define USBHS_HCCHAR2_DEVADDR_5 (0x08000000UL) +#define USBHS_HCCHAR2_DEVADDR_6 (0x10000000UL) +#define USBHS_HCCHAR2_ODDFRM_POS (29U) +#define USBHS_HCCHAR2_ODDFRM (0x20000000UL) +#define USBHS_HCCHAR2_CHDIS_POS (30U) +#define USBHS_HCCHAR2_CHDIS (0x40000000UL) +#define USBHS_HCCHAR2_CHENA_POS (31U) +#define USBHS_HCCHAR2_CHENA (0x80000000UL) + +/* Bit definition for USBHS_HCSPLT2 register */ +#define USBHS_HCSPLT2_PRTADDR_POS (0U) +#define USBHS_HCSPLT2_PRTADDR (0x0000007FUL) +#define USBHS_HCSPLT2_PRTADDR_0 (0x00000001UL) +#define USBHS_HCSPLT2_PRTADDR_1 (0x00000002UL) +#define USBHS_HCSPLT2_PRTADDR_2 (0x00000004UL) +#define USBHS_HCSPLT2_PRTADDR_3 (0x00000008UL) +#define USBHS_HCSPLT2_PRTADDR_4 (0x00000010UL) +#define USBHS_HCSPLT2_PRTADDR_5 (0x00000020UL) +#define USBHS_HCSPLT2_PRTADDR_6 (0x00000040UL) +#define USBHS_HCSPLT2_HUBADDR_POS (7U) +#define USBHS_HCSPLT2_HUBADDR (0x00003F80UL) +#define USBHS_HCSPLT2_HUBADDR_0 (0x00000080UL) +#define USBHS_HCSPLT2_HUBADDR_1 (0x00000100UL) +#define USBHS_HCSPLT2_HUBADDR_2 (0x00000200UL) +#define USBHS_HCSPLT2_HUBADDR_3 (0x00000400UL) +#define USBHS_HCSPLT2_HUBADDR_4 (0x00000800UL) +#define USBHS_HCSPLT2_HUBADDR_5 (0x00001000UL) +#define USBHS_HCSPLT2_HUBADDR_6 (0x00002000UL) +#define USBHS_HCSPLT2_XACTPOS_POS (14U) +#define USBHS_HCSPLT2_XACTPOS (0x0000C000UL) +#define USBHS_HCSPLT2_XACTPOS_0 (0x00004000UL) +#define USBHS_HCSPLT2_XACTPOS_1 (0x00008000UL) +#define USBHS_HCSPLT2_COMPSPLT_POS (16U) +#define USBHS_HCSPLT2_COMPSPLT (0x00010000UL) +#define USBHS_HCSPLT2_SPLTENA_POS (31U) +#define USBHS_HCSPLT2_SPLTENA (0x80000000UL) + +/* Bit definition for USBHS_HCINT2 register */ +#define USBHS_HCINT2_XFERCOMPL_POS (0U) +#define USBHS_HCINT2_XFERCOMPL (0x00000001UL) +#define USBHS_HCINT2_CHHLTD_POS (1U) +#define USBHS_HCINT2_CHHLTD (0x00000002UL) +#define USBHS_HCINT2_AHBERR_POS (2U) +#define USBHS_HCINT2_AHBERR (0x00000004UL) +#define USBHS_HCINT2_STALL_POS (3U) +#define USBHS_HCINT2_STALL (0x00000008UL) +#define USBHS_HCINT2_NAK_POS (4U) +#define USBHS_HCINT2_NAK (0x00000010UL) +#define USBHS_HCINT2_ACK_POS (5U) +#define USBHS_HCINT2_ACK (0x00000020UL) +#define USBHS_HCINT2_NYET_POS (6U) +#define USBHS_HCINT2_NYET (0x00000040UL) +#define USBHS_HCINT2_XACTERR_POS (7U) +#define USBHS_HCINT2_XACTERR (0x00000080UL) +#define USBHS_HCINT2_BBLERR_POS (8U) +#define USBHS_HCINT2_BBLERR (0x00000100UL) +#define USBHS_HCINT2_FRMOVRUN_POS (9U) +#define USBHS_HCINT2_FRMOVRUN (0x00000200UL) +#define USBHS_HCINT2_DATATGLERR_POS (10U) +#define USBHS_HCINT2_DATATGLERR (0x00000400UL) + +/* Bit definition for USBHS_HCINTMSK2 register */ +#define USBHS_HCINTMSK2_XFERCOMPLMSK_POS (0U) +#define USBHS_HCINTMSK2_XFERCOMPLMSK (0x00000001UL) +#define USBHS_HCINTMSK2_CHHLTDMSK_POS (1U) +#define USBHS_HCINTMSK2_CHHLTDMSK (0x00000002UL) +#define USBHS_HCINTMSK2_AHBERRMSK_POS (2U) +#define USBHS_HCINTMSK2_AHBERRMSK (0x00000004UL) +#define USBHS_HCINTMSK2_STALLMSK_POS (3U) +#define USBHS_HCINTMSK2_STALLMSK (0x00000008UL) +#define USBHS_HCINTMSK2_NAKMSK_POS (4U) +#define USBHS_HCINTMSK2_NAKMSK (0x00000010UL) +#define USBHS_HCINTMSK2_ACKMSK_POS (5U) +#define USBHS_HCINTMSK2_ACKMSK (0x00000020UL) +#define USBHS_HCINTMSK2_NYETMSK_POS (6U) +#define USBHS_HCINTMSK2_NYETMSK (0x00000040UL) +#define USBHS_HCINTMSK2_XACTERRMSK_POS (7U) +#define USBHS_HCINTMSK2_XACTERRMSK (0x00000080UL) +#define USBHS_HCINTMSK2_BBLERRMSK_POS (8U) +#define USBHS_HCINTMSK2_BBLERRMSK (0x00000100UL) +#define USBHS_HCINTMSK2_FRMOVRUNMSK_POS (9U) +#define USBHS_HCINTMSK2_FRMOVRUNMSK (0x00000200UL) +#define USBHS_HCINTMSK2_DATATGLERRMSK_POS (10U) +#define USBHS_HCINTMSK2_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBHS_HCTSIZ2 register */ +#define USBHS_HCTSIZ2_XFERSIZE_POS (0U) +#define USBHS_HCTSIZ2_XFERSIZE (0x0007FFFFUL) +#define USBHS_HCTSIZ2_XFERSIZE_0 (0x00000001UL) +#define USBHS_HCTSIZ2_XFERSIZE_1 (0x00000002UL) +#define USBHS_HCTSIZ2_XFERSIZE_2 (0x00000004UL) +#define USBHS_HCTSIZ2_XFERSIZE_3 (0x00000008UL) +#define USBHS_HCTSIZ2_XFERSIZE_4 (0x00000010UL) +#define USBHS_HCTSIZ2_XFERSIZE_5 (0x00000020UL) +#define USBHS_HCTSIZ2_XFERSIZE_6 (0x00000040UL) +#define USBHS_HCTSIZ2_XFERSIZE_7 (0x00000080UL) +#define USBHS_HCTSIZ2_XFERSIZE_8 (0x00000100UL) +#define USBHS_HCTSIZ2_XFERSIZE_9 (0x00000200UL) +#define USBHS_HCTSIZ2_XFERSIZE_10 (0x00000400UL) +#define USBHS_HCTSIZ2_XFERSIZE_11 (0x00000800UL) +#define USBHS_HCTSIZ2_XFERSIZE_12 (0x00001000UL) +#define USBHS_HCTSIZ2_XFERSIZE_13 (0x00002000UL) +#define USBHS_HCTSIZ2_XFERSIZE_14 (0x00004000UL) +#define USBHS_HCTSIZ2_XFERSIZE_15 (0x00008000UL) +#define USBHS_HCTSIZ2_XFERSIZE_16 (0x00010000UL) +#define USBHS_HCTSIZ2_XFERSIZE_17 (0x00020000UL) +#define USBHS_HCTSIZ2_XFERSIZE_18 (0x00040000UL) +#define USBHS_HCTSIZ2_PKTCNT_POS (19U) +#define USBHS_HCTSIZ2_PKTCNT (0x1FF80000UL) +#define USBHS_HCTSIZ2_PKTCNT_0 (0x00080000UL) +#define USBHS_HCTSIZ2_PKTCNT_1 (0x00100000UL) +#define USBHS_HCTSIZ2_PKTCNT_2 (0x00200000UL) +#define USBHS_HCTSIZ2_PKTCNT_3 (0x00400000UL) +#define USBHS_HCTSIZ2_PKTCNT_4 (0x00800000UL) +#define USBHS_HCTSIZ2_PKTCNT_5 (0x01000000UL) +#define USBHS_HCTSIZ2_PKTCNT_6 (0x02000000UL) +#define USBHS_HCTSIZ2_PKTCNT_7 (0x04000000UL) +#define USBHS_HCTSIZ2_PKTCNT_8 (0x08000000UL) +#define USBHS_HCTSIZ2_PKTCNT_9 (0x10000000UL) +#define USBHS_HCTSIZ2_PID_POS (29U) +#define USBHS_HCTSIZ2_PID (0x60000000UL) +#define USBHS_HCTSIZ2_PID_0 (0x20000000UL) +#define USBHS_HCTSIZ2_PID_1 (0x40000000UL) +#define USBHS_HCTSIZ2_DOPNG_POS (31U) +#define USBHS_HCTSIZ2_DOPNG (0x80000000UL) + +/* Bit definition for USBHS_HCDMA2 register */ +#define USBHS_HCDMA2 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_HCCHAR3 register */ +#define USBHS_HCCHAR3_MPS_POS (0U) +#define USBHS_HCCHAR3_MPS (0x000007FFUL) +#define USBHS_HCCHAR3_MPS_0 (0x00000001UL) +#define USBHS_HCCHAR3_MPS_1 (0x00000002UL) +#define USBHS_HCCHAR3_MPS_2 (0x00000004UL) +#define USBHS_HCCHAR3_MPS_3 (0x00000008UL) +#define USBHS_HCCHAR3_MPS_4 (0x00000010UL) +#define USBHS_HCCHAR3_MPS_5 (0x00000020UL) +#define USBHS_HCCHAR3_MPS_6 (0x00000040UL) +#define USBHS_HCCHAR3_MPS_7 (0x00000080UL) +#define USBHS_HCCHAR3_MPS_8 (0x00000100UL) +#define USBHS_HCCHAR3_MPS_9 (0x00000200UL) +#define USBHS_HCCHAR3_MPS_10 (0x00000400UL) +#define USBHS_HCCHAR3_EPNUM_POS (11U) +#define USBHS_HCCHAR3_EPNUM (0x00007800UL) +#define USBHS_HCCHAR3_EPNUM_0 (0x00000800UL) +#define USBHS_HCCHAR3_EPNUM_1 (0x00001000UL) +#define USBHS_HCCHAR3_EPNUM_2 (0x00002000UL) +#define USBHS_HCCHAR3_EPNUM_3 (0x00004000UL) +#define USBHS_HCCHAR3_EPDIR_POS (15U) +#define USBHS_HCCHAR3_EPDIR (0x00008000UL) +#define USBHS_HCCHAR3_LSPDDEV_POS (17U) +#define USBHS_HCCHAR3_LSPDDEV (0x00020000UL) +#define USBHS_HCCHAR3_EPTYPE_POS (18U) +#define USBHS_HCCHAR3_EPTYPE (0x000C0000UL) +#define USBHS_HCCHAR3_EPTYPE_0 (0x00040000UL) +#define USBHS_HCCHAR3_EPTYPE_1 (0x00080000UL) +#define USBHS_HCCHAR3_EC_POS (20U) +#define USBHS_HCCHAR3_EC (0x00300000UL) +#define USBHS_HCCHAR3_EC_0 (0x00100000UL) +#define USBHS_HCCHAR3_EC_1 (0x00200000UL) +#define USBHS_HCCHAR3_DEVADDR_POS (22U) +#define USBHS_HCCHAR3_DEVADDR (0x1FC00000UL) +#define USBHS_HCCHAR3_DEVADDR_0 (0x00400000UL) +#define USBHS_HCCHAR3_DEVADDR_1 (0x00800000UL) +#define USBHS_HCCHAR3_DEVADDR_2 (0x01000000UL) +#define USBHS_HCCHAR3_DEVADDR_3 (0x02000000UL) +#define USBHS_HCCHAR3_DEVADDR_4 (0x04000000UL) +#define USBHS_HCCHAR3_DEVADDR_5 (0x08000000UL) +#define USBHS_HCCHAR3_DEVADDR_6 (0x10000000UL) +#define USBHS_HCCHAR3_ODDFRM_POS (29U) +#define USBHS_HCCHAR3_ODDFRM (0x20000000UL) +#define USBHS_HCCHAR3_CHDIS_POS (30U) +#define USBHS_HCCHAR3_CHDIS (0x40000000UL) +#define USBHS_HCCHAR3_CHENA_POS (31U) +#define USBHS_HCCHAR3_CHENA (0x80000000UL) + +/* Bit definition for USBHS_HCSPLT3 register */ +#define USBHS_HCSPLT3_PRTADDR_POS (0U) +#define USBHS_HCSPLT3_PRTADDR (0x0000007FUL) +#define USBHS_HCSPLT3_PRTADDR_0 (0x00000001UL) +#define USBHS_HCSPLT3_PRTADDR_1 (0x00000002UL) +#define USBHS_HCSPLT3_PRTADDR_2 (0x00000004UL) +#define USBHS_HCSPLT3_PRTADDR_3 (0x00000008UL) +#define USBHS_HCSPLT3_PRTADDR_4 (0x00000010UL) +#define USBHS_HCSPLT3_PRTADDR_5 (0x00000020UL) +#define USBHS_HCSPLT3_PRTADDR_6 (0x00000040UL) +#define USBHS_HCSPLT3_HUBADDR_POS (7U) +#define USBHS_HCSPLT3_HUBADDR (0x00003F80UL) +#define USBHS_HCSPLT3_HUBADDR_0 (0x00000080UL) +#define USBHS_HCSPLT3_HUBADDR_1 (0x00000100UL) +#define USBHS_HCSPLT3_HUBADDR_2 (0x00000200UL) +#define USBHS_HCSPLT3_HUBADDR_3 (0x00000400UL) +#define USBHS_HCSPLT3_HUBADDR_4 (0x00000800UL) +#define USBHS_HCSPLT3_HUBADDR_5 (0x00001000UL) +#define USBHS_HCSPLT3_HUBADDR_6 (0x00002000UL) +#define USBHS_HCSPLT3_XACTPOS_POS (14U) +#define USBHS_HCSPLT3_XACTPOS (0x0000C000UL) +#define USBHS_HCSPLT3_XACTPOS_0 (0x00004000UL) +#define USBHS_HCSPLT3_XACTPOS_1 (0x00008000UL) +#define USBHS_HCSPLT3_COMPSPLT_POS (16U) +#define USBHS_HCSPLT3_COMPSPLT (0x00010000UL) +#define USBHS_HCSPLT3_SPLTENA_POS (31U) +#define USBHS_HCSPLT3_SPLTENA (0x80000000UL) + +/* Bit definition for USBHS_HCINT3 register */ +#define USBHS_HCINT3_XFERCOMPL_POS (0U) +#define USBHS_HCINT3_XFERCOMPL (0x00000001UL) +#define USBHS_HCINT3_CHHLTD_POS (1U) +#define USBHS_HCINT3_CHHLTD (0x00000002UL) +#define USBHS_HCINT3_AHBERR_POS (2U) +#define USBHS_HCINT3_AHBERR (0x00000004UL) +#define USBHS_HCINT3_STALL_POS (3U) +#define USBHS_HCINT3_STALL (0x00000008UL) +#define USBHS_HCINT3_NAK_POS (4U) +#define USBHS_HCINT3_NAK (0x00000010UL) +#define USBHS_HCINT3_ACK_POS (5U) +#define USBHS_HCINT3_ACK (0x00000020UL) +#define USBHS_HCINT3_NYET_POS (6U) +#define USBHS_HCINT3_NYET (0x00000040UL) +#define USBHS_HCINT3_XACTERR_POS (7U) +#define USBHS_HCINT3_XACTERR (0x00000080UL) +#define USBHS_HCINT3_BBLERR_POS (8U) +#define USBHS_HCINT3_BBLERR (0x00000100UL) +#define USBHS_HCINT3_FRMOVRUN_POS (9U) +#define USBHS_HCINT3_FRMOVRUN (0x00000200UL) +#define USBHS_HCINT3_DATATGLERR_POS (10U) +#define USBHS_HCINT3_DATATGLERR (0x00000400UL) + +/* Bit definition for USBHS_HCINTMSK3 register */ +#define USBHS_HCINTMSK3_XFERCOMPLMSK_POS (0U) +#define USBHS_HCINTMSK3_XFERCOMPLMSK (0x00000001UL) +#define USBHS_HCINTMSK3_CHHLTDMSK_POS (1U) +#define USBHS_HCINTMSK3_CHHLTDMSK (0x00000002UL) +#define USBHS_HCINTMSK3_AHBERRMSK_POS (2U) +#define USBHS_HCINTMSK3_AHBERRMSK (0x00000004UL) +#define USBHS_HCINTMSK3_STALLMSK_POS (3U) +#define USBHS_HCINTMSK3_STALLMSK (0x00000008UL) +#define USBHS_HCINTMSK3_NAKMSK_POS (4U) +#define USBHS_HCINTMSK3_NAKMSK (0x00000010UL) +#define USBHS_HCINTMSK3_ACKMSK_POS (5U) +#define USBHS_HCINTMSK3_ACKMSK (0x00000020UL) +#define USBHS_HCINTMSK3_NYETMSK_POS (6U) +#define USBHS_HCINTMSK3_NYETMSK (0x00000040UL) +#define USBHS_HCINTMSK3_XACTERRMSK_POS (7U) +#define USBHS_HCINTMSK3_XACTERRMSK (0x00000080UL) +#define USBHS_HCINTMSK3_BBLERRMSK_POS (8U) +#define USBHS_HCINTMSK3_BBLERRMSK (0x00000100UL) +#define USBHS_HCINTMSK3_FRMOVRUNMSK_POS (9U) +#define USBHS_HCINTMSK3_FRMOVRUNMSK (0x00000200UL) +#define USBHS_HCINTMSK3_DATATGLERRMSK_POS (10U) +#define USBHS_HCINTMSK3_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBHS_HCTSIZ3 register */ +#define USBHS_HCTSIZ3_XFERSIZE_POS (0U) +#define USBHS_HCTSIZ3_XFERSIZE (0x0007FFFFUL) +#define USBHS_HCTSIZ3_XFERSIZE_0 (0x00000001UL) +#define USBHS_HCTSIZ3_XFERSIZE_1 (0x00000002UL) +#define USBHS_HCTSIZ3_XFERSIZE_2 (0x00000004UL) +#define USBHS_HCTSIZ3_XFERSIZE_3 (0x00000008UL) +#define USBHS_HCTSIZ3_XFERSIZE_4 (0x00000010UL) +#define USBHS_HCTSIZ3_XFERSIZE_5 (0x00000020UL) +#define USBHS_HCTSIZ3_XFERSIZE_6 (0x00000040UL) +#define USBHS_HCTSIZ3_XFERSIZE_7 (0x00000080UL) +#define USBHS_HCTSIZ3_XFERSIZE_8 (0x00000100UL) +#define USBHS_HCTSIZ3_XFERSIZE_9 (0x00000200UL) +#define USBHS_HCTSIZ3_XFERSIZE_10 (0x00000400UL) +#define USBHS_HCTSIZ3_XFERSIZE_11 (0x00000800UL) +#define USBHS_HCTSIZ3_XFERSIZE_12 (0x00001000UL) +#define USBHS_HCTSIZ3_XFERSIZE_13 (0x00002000UL) +#define USBHS_HCTSIZ3_XFERSIZE_14 (0x00004000UL) +#define USBHS_HCTSIZ3_XFERSIZE_15 (0x00008000UL) +#define USBHS_HCTSIZ3_XFERSIZE_16 (0x00010000UL) +#define USBHS_HCTSIZ3_XFERSIZE_17 (0x00020000UL) +#define USBHS_HCTSIZ3_XFERSIZE_18 (0x00040000UL) +#define USBHS_HCTSIZ3_PKTCNT_POS (19U) +#define USBHS_HCTSIZ3_PKTCNT (0x1FF80000UL) +#define USBHS_HCTSIZ3_PKTCNT_0 (0x00080000UL) +#define USBHS_HCTSIZ3_PKTCNT_1 (0x00100000UL) +#define USBHS_HCTSIZ3_PKTCNT_2 (0x00200000UL) +#define USBHS_HCTSIZ3_PKTCNT_3 (0x00400000UL) +#define USBHS_HCTSIZ3_PKTCNT_4 (0x00800000UL) +#define USBHS_HCTSIZ3_PKTCNT_5 (0x01000000UL) +#define USBHS_HCTSIZ3_PKTCNT_6 (0x02000000UL) +#define USBHS_HCTSIZ3_PKTCNT_7 (0x04000000UL) +#define USBHS_HCTSIZ3_PKTCNT_8 (0x08000000UL) +#define USBHS_HCTSIZ3_PKTCNT_9 (0x10000000UL) +#define USBHS_HCTSIZ3_PID_POS (29U) +#define USBHS_HCTSIZ3_PID (0x60000000UL) +#define USBHS_HCTSIZ3_PID_0 (0x20000000UL) +#define USBHS_HCTSIZ3_PID_1 (0x40000000UL) +#define USBHS_HCTSIZ3_DOPNG_POS (31U) +#define USBHS_HCTSIZ3_DOPNG (0x80000000UL) + +/* Bit definition for USBHS_HCDMA3 register */ +#define USBHS_HCDMA3 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_HCCHAR4 register */ +#define USBHS_HCCHAR4_MPS_POS (0U) +#define USBHS_HCCHAR4_MPS (0x000007FFUL) +#define USBHS_HCCHAR4_MPS_0 (0x00000001UL) +#define USBHS_HCCHAR4_MPS_1 (0x00000002UL) +#define USBHS_HCCHAR4_MPS_2 (0x00000004UL) +#define USBHS_HCCHAR4_MPS_3 (0x00000008UL) +#define USBHS_HCCHAR4_MPS_4 (0x00000010UL) +#define USBHS_HCCHAR4_MPS_5 (0x00000020UL) +#define USBHS_HCCHAR4_MPS_6 (0x00000040UL) +#define USBHS_HCCHAR4_MPS_7 (0x00000080UL) +#define USBHS_HCCHAR4_MPS_8 (0x00000100UL) +#define USBHS_HCCHAR4_MPS_9 (0x00000200UL) +#define USBHS_HCCHAR4_MPS_10 (0x00000400UL) +#define USBHS_HCCHAR4_EPNUM_POS (11U) +#define USBHS_HCCHAR4_EPNUM (0x00007800UL) +#define USBHS_HCCHAR4_EPNUM_0 (0x00000800UL) +#define USBHS_HCCHAR4_EPNUM_1 (0x00001000UL) +#define USBHS_HCCHAR4_EPNUM_2 (0x00002000UL) +#define USBHS_HCCHAR4_EPNUM_3 (0x00004000UL) +#define USBHS_HCCHAR4_EPDIR_POS (15U) +#define USBHS_HCCHAR4_EPDIR (0x00008000UL) +#define USBHS_HCCHAR4_LSPDDEV_POS (17U) +#define USBHS_HCCHAR4_LSPDDEV (0x00020000UL) +#define USBHS_HCCHAR4_EPTYPE_POS (18U) +#define USBHS_HCCHAR4_EPTYPE (0x000C0000UL) +#define USBHS_HCCHAR4_EPTYPE_0 (0x00040000UL) +#define USBHS_HCCHAR4_EPTYPE_1 (0x00080000UL) +#define USBHS_HCCHAR4_EC_POS (20U) +#define USBHS_HCCHAR4_EC (0x00300000UL) +#define USBHS_HCCHAR4_EC_0 (0x00100000UL) +#define USBHS_HCCHAR4_EC_1 (0x00200000UL) +#define USBHS_HCCHAR4_DEVADDR_POS (22U) +#define USBHS_HCCHAR4_DEVADDR (0x1FC00000UL) +#define USBHS_HCCHAR4_DEVADDR_0 (0x00400000UL) +#define USBHS_HCCHAR4_DEVADDR_1 (0x00800000UL) +#define USBHS_HCCHAR4_DEVADDR_2 (0x01000000UL) +#define USBHS_HCCHAR4_DEVADDR_3 (0x02000000UL) +#define USBHS_HCCHAR4_DEVADDR_4 (0x04000000UL) +#define USBHS_HCCHAR4_DEVADDR_5 (0x08000000UL) +#define USBHS_HCCHAR4_DEVADDR_6 (0x10000000UL) +#define USBHS_HCCHAR4_ODDFRM_POS (29U) +#define USBHS_HCCHAR4_ODDFRM (0x20000000UL) +#define USBHS_HCCHAR4_CHDIS_POS (30U) +#define USBHS_HCCHAR4_CHDIS (0x40000000UL) +#define USBHS_HCCHAR4_CHENA_POS (31U) +#define USBHS_HCCHAR4_CHENA (0x80000000UL) + +/* Bit definition for USBHS_HCSPLT4 register */ +#define USBHS_HCSPLT4_PRTADDR_POS (0U) +#define USBHS_HCSPLT4_PRTADDR (0x0000007FUL) +#define USBHS_HCSPLT4_PRTADDR_0 (0x00000001UL) +#define USBHS_HCSPLT4_PRTADDR_1 (0x00000002UL) +#define USBHS_HCSPLT4_PRTADDR_2 (0x00000004UL) +#define USBHS_HCSPLT4_PRTADDR_3 (0x00000008UL) +#define USBHS_HCSPLT4_PRTADDR_4 (0x00000010UL) +#define USBHS_HCSPLT4_PRTADDR_5 (0x00000020UL) +#define USBHS_HCSPLT4_PRTADDR_6 (0x00000040UL) +#define USBHS_HCSPLT4_HUBADDR_POS (7U) +#define USBHS_HCSPLT4_HUBADDR (0x00003F80UL) +#define USBHS_HCSPLT4_HUBADDR_0 (0x00000080UL) +#define USBHS_HCSPLT4_HUBADDR_1 (0x00000100UL) +#define USBHS_HCSPLT4_HUBADDR_2 (0x00000200UL) +#define USBHS_HCSPLT4_HUBADDR_3 (0x00000400UL) +#define USBHS_HCSPLT4_HUBADDR_4 (0x00000800UL) +#define USBHS_HCSPLT4_HUBADDR_5 (0x00001000UL) +#define USBHS_HCSPLT4_HUBADDR_6 (0x00002000UL) +#define USBHS_HCSPLT4_XACTPOS_POS (14U) +#define USBHS_HCSPLT4_XACTPOS (0x0000C000UL) +#define USBHS_HCSPLT4_XACTPOS_0 (0x00004000UL) +#define USBHS_HCSPLT4_XACTPOS_1 (0x00008000UL) +#define USBHS_HCSPLT4_COMPSPLT_POS (16U) +#define USBHS_HCSPLT4_COMPSPLT (0x00010000UL) +#define USBHS_HCSPLT4_SPLTENA_POS (31U) +#define USBHS_HCSPLT4_SPLTENA (0x80000000UL) + +/* Bit definition for USBHS_HCINT4 register */ +#define USBHS_HCINT4_XFERCOMPL_POS (0U) +#define USBHS_HCINT4_XFERCOMPL (0x00000001UL) +#define USBHS_HCINT4_CHHLTD_POS (1U) +#define USBHS_HCINT4_CHHLTD (0x00000002UL) +#define USBHS_HCINT4_AHBERR_POS (2U) +#define USBHS_HCINT4_AHBERR (0x00000004UL) +#define USBHS_HCINT4_STALL_POS (3U) +#define USBHS_HCINT4_STALL (0x00000008UL) +#define USBHS_HCINT4_NAK_POS (4U) +#define USBHS_HCINT4_NAK (0x00000010UL) +#define USBHS_HCINT4_ACK_POS (5U) +#define USBHS_HCINT4_ACK (0x00000020UL) +#define USBHS_HCINT4_NYET_POS (6U) +#define USBHS_HCINT4_NYET (0x00000040UL) +#define USBHS_HCINT4_XACTERR_POS (7U) +#define USBHS_HCINT4_XACTERR (0x00000080UL) +#define USBHS_HCINT4_BBLERR_POS (8U) +#define USBHS_HCINT4_BBLERR (0x00000100UL) +#define USBHS_HCINT4_FRMOVRUN_POS (9U) +#define USBHS_HCINT4_FRMOVRUN (0x00000200UL) +#define USBHS_HCINT4_DATATGLERR_POS (10U) +#define USBHS_HCINT4_DATATGLERR (0x00000400UL) + +/* Bit definition for USBHS_HCINTMSK4 register */ +#define USBHS_HCINTMSK4_XFERCOMPLMSK_POS (0U) +#define USBHS_HCINTMSK4_XFERCOMPLMSK (0x00000001UL) +#define USBHS_HCINTMSK4_CHHLTDMSK_POS (1U) +#define USBHS_HCINTMSK4_CHHLTDMSK (0x00000002UL) +#define USBHS_HCINTMSK4_AHBERRMSK_POS (2U) +#define USBHS_HCINTMSK4_AHBERRMSK (0x00000004UL) +#define USBHS_HCINTMSK4_STALLMSK_POS (3U) +#define USBHS_HCINTMSK4_STALLMSK (0x00000008UL) +#define USBHS_HCINTMSK4_NAKMSK_POS (4U) +#define USBHS_HCINTMSK4_NAKMSK (0x00000010UL) +#define USBHS_HCINTMSK4_ACKMSK_POS (5U) +#define USBHS_HCINTMSK4_ACKMSK (0x00000020UL) +#define USBHS_HCINTMSK4_NYETMSK_POS (6U) +#define USBHS_HCINTMSK4_NYETMSK (0x00000040UL) +#define USBHS_HCINTMSK4_XACTERRMSK_POS (7U) +#define USBHS_HCINTMSK4_XACTERRMSK (0x00000080UL) +#define USBHS_HCINTMSK4_BBLERRMSK_POS (8U) +#define USBHS_HCINTMSK4_BBLERRMSK (0x00000100UL) +#define USBHS_HCINTMSK4_FRMOVRUNMSK_POS (9U) +#define USBHS_HCINTMSK4_FRMOVRUNMSK (0x00000200UL) +#define USBHS_HCINTMSK4_DATATGLERRMSK_POS (10U) +#define USBHS_HCINTMSK4_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBHS_HCTSIZ4 register */ +#define USBHS_HCTSIZ4_XFERSIZE_POS (0U) +#define USBHS_HCTSIZ4_XFERSIZE (0x0007FFFFUL) +#define USBHS_HCTSIZ4_XFERSIZE_0 (0x00000001UL) +#define USBHS_HCTSIZ4_XFERSIZE_1 (0x00000002UL) +#define USBHS_HCTSIZ4_XFERSIZE_2 (0x00000004UL) +#define USBHS_HCTSIZ4_XFERSIZE_3 (0x00000008UL) +#define USBHS_HCTSIZ4_XFERSIZE_4 (0x00000010UL) +#define USBHS_HCTSIZ4_XFERSIZE_5 (0x00000020UL) +#define USBHS_HCTSIZ4_XFERSIZE_6 (0x00000040UL) +#define USBHS_HCTSIZ4_XFERSIZE_7 (0x00000080UL) +#define USBHS_HCTSIZ4_XFERSIZE_8 (0x00000100UL) +#define USBHS_HCTSIZ4_XFERSIZE_9 (0x00000200UL) +#define USBHS_HCTSIZ4_XFERSIZE_10 (0x00000400UL) +#define USBHS_HCTSIZ4_XFERSIZE_11 (0x00000800UL) +#define USBHS_HCTSIZ4_XFERSIZE_12 (0x00001000UL) +#define USBHS_HCTSIZ4_XFERSIZE_13 (0x00002000UL) +#define USBHS_HCTSIZ4_XFERSIZE_14 (0x00004000UL) +#define USBHS_HCTSIZ4_XFERSIZE_15 (0x00008000UL) +#define USBHS_HCTSIZ4_XFERSIZE_16 (0x00010000UL) +#define USBHS_HCTSIZ4_XFERSIZE_17 (0x00020000UL) +#define USBHS_HCTSIZ4_XFERSIZE_18 (0x00040000UL) +#define USBHS_HCTSIZ4_PKTCNT_POS (19U) +#define USBHS_HCTSIZ4_PKTCNT (0x1FF80000UL) +#define USBHS_HCTSIZ4_PKTCNT_0 (0x00080000UL) +#define USBHS_HCTSIZ4_PKTCNT_1 (0x00100000UL) +#define USBHS_HCTSIZ4_PKTCNT_2 (0x00200000UL) +#define USBHS_HCTSIZ4_PKTCNT_3 (0x00400000UL) +#define USBHS_HCTSIZ4_PKTCNT_4 (0x00800000UL) +#define USBHS_HCTSIZ4_PKTCNT_5 (0x01000000UL) +#define USBHS_HCTSIZ4_PKTCNT_6 (0x02000000UL) +#define USBHS_HCTSIZ4_PKTCNT_7 (0x04000000UL) +#define USBHS_HCTSIZ4_PKTCNT_8 (0x08000000UL) +#define USBHS_HCTSIZ4_PKTCNT_9 (0x10000000UL) +#define USBHS_HCTSIZ4_PID_POS (29U) +#define USBHS_HCTSIZ4_PID (0x60000000UL) +#define USBHS_HCTSIZ4_PID_0 (0x20000000UL) +#define USBHS_HCTSIZ4_PID_1 (0x40000000UL) +#define USBHS_HCTSIZ4_DOPNG_POS (31U) +#define USBHS_HCTSIZ4_DOPNG (0x80000000UL) + +/* Bit definition for USBHS_HCDMA4 register */ +#define USBHS_HCDMA4 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_HCCHAR5 register */ +#define USBHS_HCCHAR5_MPS_POS (0U) +#define USBHS_HCCHAR5_MPS (0x000007FFUL) +#define USBHS_HCCHAR5_MPS_0 (0x00000001UL) +#define USBHS_HCCHAR5_MPS_1 (0x00000002UL) +#define USBHS_HCCHAR5_MPS_2 (0x00000004UL) +#define USBHS_HCCHAR5_MPS_3 (0x00000008UL) +#define USBHS_HCCHAR5_MPS_4 (0x00000010UL) +#define USBHS_HCCHAR5_MPS_5 (0x00000020UL) +#define USBHS_HCCHAR5_MPS_6 (0x00000040UL) +#define USBHS_HCCHAR5_MPS_7 (0x00000080UL) +#define USBHS_HCCHAR5_MPS_8 (0x00000100UL) +#define USBHS_HCCHAR5_MPS_9 (0x00000200UL) +#define USBHS_HCCHAR5_MPS_10 (0x00000400UL) +#define USBHS_HCCHAR5_EPNUM_POS (11U) +#define USBHS_HCCHAR5_EPNUM (0x00007800UL) +#define USBHS_HCCHAR5_EPNUM_0 (0x00000800UL) +#define USBHS_HCCHAR5_EPNUM_1 (0x00001000UL) +#define USBHS_HCCHAR5_EPNUM_2 (0x00002000UL) +#define USBHS_HCCHAR5_EPNUM_3 (0x00004000UL) +#define USBHS_HCCHAR5_EPDIR_POS (15U) +#define USBHS_HCCHAR5_EPDIR (0x00008000UL) +#define USBHS_HCCHAR5_LSPDDEV_POS (17U) +#define USBHS_HCCHAR5_LSPDDEV (0x00020000UL) +#define USBHS_HCCHAR5_EPTYPE_POS (18U) +#define USBHS_HCCHAR5_EPTYPE (0x000C0000UL) +#define USBHS_HCCHAR5_EPTYPE_0 (0x00040000UL) +#define USBHS_HCCHAR5_EPTYPE_1 (0x00080000UL) +#define USBHS_HCCHAR5_EC_POS (20U) +#define USBHS_HCCHAR5_EC (0x00300000UL) +#define USBHS_HCCHAR5_EC_0 (0x00100000UL) +#define USBHS_HCCHAR5_EC_1 (0x00200000UL) +#define USBHS_HCCHAR5_DEVADDR_POS (22U) +#define USBHS_HCCHAR5_DEVADDR (0x1FC00000UL) +#define USBHS_HCCHAR5_DEVADDR_0 (0x00400000UL) +#define USBHS_HCCHAR5_DEVADDR_1 (0x00800000UL) +#define USBHS_HCCHAR5_DEVADDR_2 (0x01000000UL) +#define USBHS_HCCHAR5_DEVADDR_3 (0x02000000UL) +#define USBHS_HCCHAR5_DEVADDR_4 (0x04000000UL) +#define USBHS_HCCHAR5_DEVADDR_5 (0x08000000UL) +#define USBHS_HCCHAR5_DEVADDR_6 (0x10000000UL) +#define USBHS_HCCHAR5_ODDFRM_POS (29U) +#define USBHS_HCCHAR5_ODDFRM (0x20000000UL) +#define USBHS_HCCHAR5_CHDIS_POS (30U) +#define USBHS_HCCHAR5_CHDIS (0x40000000UL) +#define USBHS_HCCHAR5_CHENA_POS (31U) +#define USBHS_HCCHAR5_CHENA (0x80000000UL) + +/* Bit definition for USBHS_HCSPLT5 register */ +#define USBHS_HCSPLT5_PRTADDR_POS (0U) +#define USBHS_HCSPLT5_PRTADDR (0x0000007FUL) +#define USBHS_HCSPLT5_PRTADDR_0 (0x00000001UL) +#define USBHS_HCSPLT5_PRTADDR_1 (0x00000002UL) +#define USBHS_HCSPLT5_PRTADDR_2 (0x00000004UL) +#define USBHS_HCSPLT5_PRTADDR_3 (0x00000008UL) +#define USBHS_HCSPLT5_PRTADDR_4 (0x00000010UL) +#define USBHS_HCSPLT5_PRTADDR_5 (0x00000020UL) +#define USBHS_HCSPLT5_PRTADDR_6 (0x00000040UL) +#define USBHS_HCSPLT5_HUBADDR_POS (7U) +#define USBHS_HCSPLT5_HUBADDR (0x00003F80UL) +#define USBHS_HCSPLT5_HUBADDR_0 (0x00000080UL) +#define USBHS_HCSPLT5_HUBADDR_1 (0x00000100UL) +#define USBHS_HCSPLT5_HUBADDR_2 (0x00000200UL) +#define USBHS_HCSPLT5_HUBADDR_3 (0x00000400UL) +#define USBHS_HCSPLT5_HUBADDR_4 (0x00000800UL) +#define USBHS_HCSPLT5_HUBADDR_5 (0x00001000UL) +#define USBHS_HCSPLT5_HUBADDR_6 (0x00002000UL) +#define USBHS_HCSPLT5_XACTPOS_POS (14U) +#define USBHS_HCSPLT5_XACTPOS (0x0000C000UL) +#define USBHS_HCSPLT5_XACTPOS_0 (0x00004000UL) +#define USBHS_HCSPLT5_XACTPOS_1 (0x00008000UL) +#define USBHS_HCSPLT5_COMPSPLT_POS (16U) +#define USBHS_HCSPLT5_COMPSPLT (0x00010000UL) +#define USBHS_HCSPLT5_SPLTENA_POS (31U) +#define USBHS_HCSPLT5_SPLTENA (0x80000000UL) + +/* Bit definition for USBHS_HCINT5 register */ +#define USBHS_HCINT5_XFERCOMPL_POS (0U) +#define USBHS_HCINT5_XFERCOMPL (0x00000001UL) +#define USBHS_HCINT5_CHHLTD_POS (1U) +#define USBHS_HCINT5_CHHLTD (0x00000002UL) +#define USBHS_HCINT5_AHBERR_POS (2U) +#define USBHS_HCINT5_AHBERR (0x00000004UL) +#define USBHS_HCINT5_STALL_POS (3U) +#define USBHS_HCINT5_STALL (0x00000008UL) +#define USBHS_HCINT5_NAK_POS (4U) +#define USBHS_HCINT5_NAK (0x00000010UL) +#define USBHS_HCINT5_ACK_POS (5U) +#define USBHS_HCINT5_ACK (0x00000020UL) +#define USBHS_HCINT5_NYET_POS (6U) +#define USBHS_HCINT5_NYET (0x00000040UL) +#define USBHS_HCINT5_XACTERR_POS (7U) +#define USBHS_HCINT5_XACTERR (0x00000080UL) +#define USBHS_HCINT5_BBLERR_POS (8U) +#define USBHS_HCINT5_BBLERR (0x00000100UL) +#define USBHS_HCINT5_FRMOVRUN_POS (9U) +#define USBHS_HCINT5_FRMOVRUN (0x00000200UL) +#define USBHS_HCINT5_DATATGLERR_POS (10U) +#define USBHS_HCINT5_DATATGLERR (0x00000400UL) + +/* Bit definition for USBHS_HCINTMSK5 register */ +#define USBHS_HCINTMSK5_XFERCOMPLMSK_POS (0U) +#define USBHS_HCINTMSK5_XFERCOMPLMSK (0x00000001UL) +#define USBHS_HCINTMSK5_CHHLTDMSK_POS (1U) +#define USBHS_HCINTMSK5_CHHLTDMSK (0x00000002UL) +#define USBHS_HCINTMSK5_AHBERRMSK_POS (2U) +#define USBHS_HCINTMSK5_AHBERRMSK (0x00000004UL) +#define USBHS_HCINTMSK5_STALLMSK_POS (3U) +#define USBHS_HCINTMSK5_STALLMSK (0x00000008UL) +#define USBHS_HCINTMSK5_NAKMSK_POS (4U) +#define USBHS_HCINTMSK5_NAKMSK (0x00000010UL) +#define USBHS_HCINTMSK5_ACKMSK_POS (5U) +#define USBHS_HCINTMSK5_ACKMSK (0x00000020UL) +#define USBHS_HCINTMSK5_NYETMSK_POS (6U) +#define USBHS_HCINTMSK5_NYETMSK (0x00000040UL) +#define USBHS_HCINTMSK5_XACTERRMSK_POS (7U) +#define USBHS_HCINTMSK5_XACTERRMSK (0x00000080UL) +#define USBHS_HCINTMSK5_BBLERRMSK_POS (8U) +#define USBHS_HCINTMSK5_BBLERRMSK (0x00000100UL) +#define USBHS_HCINTMSK5_FRMOVRUNMSK_POS (9U) +#define USBHS_HCINTMSK5_FRMOVRUNMSK (0x00000200UL) +#define USBHS_HCINTMSK5_DATATGLERRMSK_POS (10U) +#define USBHS_HCINTMSK5_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBHS_HCTSIZ5 register */ +#define USBHS_HCTSIZ5_XFERSIZE_POS (0U) +#define USBHS_HCTSIZ5_XFERSIZE (0x0007FFFFUL) +#define USBHS_HCTSIZ5_XFERSIZE_0 (0x00000001UL) +#define USBHS_HCTSIZ5_XFERSIZE_1 (0x00000002UL) +#define USBHS_HCTSIZ5_XFERSIZE_2 (0x00000004UL) +#define USBHS_HCTSIZ5_XFERSIZE_3 (0x00000008UL) +#define USBHS_HCTSIZ5_XFERSIZE_4 (0x00000010UL) +#define USBHS_HCTSIZ5_XFERSIZE_5 (0x00000020UL) +#define USBHS_HCTSIZ5_XFERSIZE_6 (0x00000040UL) +#define USBHS_HCTSIZ5_XFERSIZE_7 (0x00000080UL) +#define USBHS_HCTSIZ5_XFERSIZE_8 (0x00000100UL) +#define USBHS_HCTSIZ5_XFERSIZE_9 (0x00000200UL) +#define USBHS_HCTSIZ5_XFERSIZE_10 (0x00000400UL) +#define USBHS_HCTSIZ5_XFERSIZE_11 (0x00000800UL) +#define USBHS_HCTSIZ5_XFERSIZE_12 (0x00001000UL) +#define USBHS_HCTSIZ5_XFERSIZE_13 (0x00002000UL) +#define USBHS_HCTSIZ5_XFERSIZE_14 (0x00004000UL) +#define USBHS_HCTSIZ5_XFERSIZE_15 (0x00008000UL) +#define USBHS_HCTSIZ5_XFERSIZE_16 (0x00010000UL) +#define USBHS_HCTSIZ5_XFERSIZE_17 (0x00020000UL) +#define USBHS_HCTSIZ5_XFERSIZE_18 (0x00040000UL) +#define USBHS_HCTSIZ5_PKTCNT_POS (19U) +#define USBHS_HCTSIZ5_PKTCNT (0x1FF80000UL) +#define USBHS_HCTSIZ5_PKTCNT_0 (0x00080000UL) +#define USBHS_HCTSIZ5_PKTCNT_1 (0x00100000UL) +#define USBHS_HCTSIZ5_PKTCNT_2 (0x00200000UL) +#define USBHS_HCTSIZ5_PKTCNT_3 (0x00400000UL) +#define USBHS_HCTSIZ5_PKTCNT_4 (0x00800000UL) +#define USBHS_HCTSIZ5_PKTCNT_5 (0x01000000UL) +#define USBHS_HCTSIZ5_PKTCNT_6 (0x02000000UL) +#define USBHS_HCTSIZ5_PKTCNT_7 (0x04000000UL) +#define USBHS_HCTSIZ5_PKTCNT_8 (0x08000000UL) +#define USBHS_HCTSIZ5_PKTCNT_9 (0x10000000UL) +#define USBHS_HCTSIZ5_PID_POS (29U) +#define USBHS_HCTSIZ5_PID (0x60000000UL) +#define USBHS_HCTSIZ5_PID_0 (0x20000000UL) +#define USBHS_HCTSIZ5_PID_1 (0x40000000UL) +#define USBHS_HCTSIZ5_DOPNG_POS (31U) +#define USBHS_HCTSIZ5_DOPNG (0x80000000UL) + +/* Bit definition for USBHS_HCDMA5 register */ +#define USBHS_HCDMA5 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_HCCHAR6 register */ +#define USBHS_HCCHAR6_MPS_POS (0U) +#define USBHS_HCCHAR6_MPS (0x000007FFUL) +#define USBHS_HCCHAR6_MPS_0 (0x00000001UL) +#define USBHS_HCCHAR6_MPS_1 (0x00000002UL) +#define USBHS_HCCHAR6_MPS_2 (0x00000004UL) +#define USBHS_HCCHAR6_MPS_3 (0x00000008UL) +#define USBHS_HCCHAR6_MPS_4 (0x00000010UL) +#define USBHS_HCCHAR6_MPS_5 (0x00000020UL) +#define USBHS_HCCHAR6_MPS_6 (0x00000040UL) +#define USBHS_HCCHAR6_MPS_7 (0x00000080UL) +#define USBHS_HCCHAR6_MPS_8 (0x00000100UL) +#define USBHS_HCCHAR6_MPS_9 (0x00000200UL) +#define USBHS_HCCHAR6_MPS_10 (0x00000400UL) +#define USBHS_HCCHAR6_EPNUM_POS (11U) +#define USBHS_HCCHAR6_EPNUM (0x00007800UL) +#define USBHS_HCCHAR6_EPNUM_0 (0x00000800UL) +#define USBHS_HCCHAR6_EPNUM_1 (0x00001000UL) +#define USBHS_HCCHAR6_EPNUM_2 (0x00002000UL) +#define USBHS_HCCHAR6_EPNUM_3 (0x00004000UL) +#define USBHS_HCCHAR6_EPDIR_POS (15U) +#define USBHS_HCCHAR6_EPDIR (0x00008000UL) +#define USBHS_HCCHAR6_LSPDDEV_POS (17U) +#define USBHS_HCCHAR6_LSPDDEV (0x00020000UL) +#define USBHS_HCCHAR6_EPTYPE_POS (18U) +#define USBHS_HCCHAR6_EPTYPE (0x000C0000UL) +#define USBHS_HCCHAR6_EPTYPE_0 (0x00040000UL) +#define USBHS_HCCHAR6_EPTYPE_1 (0x00080000UL) +#define USBHS_HCCHAR6_EC_POS (20U) +#define USBHS_HCCHAR6_EC (0x00300000UL) +#define USBHS_HCCHAR6_EC_0 (0x00100000UL) +#define USBHS_HCCHAR6_EC_1 (0x00200000UL) +#define USBHS_HCCHAR6_DEVADDR_POS (22U) +#define USBHS_HCCHAR6_DEVADDR (0x1FC00000UL) +#define USBHS_HCCHAR6_DEVADDR_0 (0x00400000UL) +#define USBHS_HCCHAR6_DEVADDR_1 (0x00800000UL) +#define USBHS_HCCHAR6_DEVADDR_2 (0x01000000UL) +#define USBHS_HCCHAR6_DEVADDR_3 (0x02000000UL) +#define USBHS_HCCHAR6_DEVADDR_4 (0x04000000UL) +#define USBHS_HCCHAR6_DEVADDR_5 (0x08000000UL) +#define USBHS_HCCHAR6_DEVADDR_6 (0x10000000UL) +#define USBHS_HCCHAR6_ODDFRM_POS (29U) +#define USBHS_HCCHAR6_ODDFRM (0x20000000UL) +#define USBHS_HCCHAR6_CHDIS_POS (30U) +#define USBHS_HCCHAR6_CHDIS (0x40000000UL) +#define USBHS_HCCHAR6_CHENA_POS (31U) +#define USBHS_HCCHAR6_CHENA (0x80000000UL) + +/* Bit definition for USBHS_HCSPLT6 register */ +#define USBHS_HCSPLT6_PRTADDR_POS (0U) +#define USBHS_HCSPLT6_PRTADDR (0x0000007FUL) +#define USBHS_HCSPLT6_PRTADDR_0 (0x00000001UL) +#define USBHS_HCSPLT6_PRTADDR_1 (0x00000002UL) +#define USBHS_HCSPLT6_PRTADDR_2 (0x00000004UL) +#define USBHS_HCSPLT6_PRTADDR_3 (0x00000008UL) +#define USBHS_HCSPLT6_PRTADDR_4 (0x00000010UL) +#define USBHS_HCSPLT6_PRTADDR_5 (0x00000020UL) +#define USBHS_HCSPLT6_PRTADDR_6 (0x00000040UL) +#define USBHS_HCSPLT6_HUBADDR_POS (7U) +#define USBHS_HCSPLT6_HUBADDR (0x00003F80UL) +#define USBHS_HCSPLT6_HUBADDR_0 (0x00000080UL) +#define USBHS_HCSPLT6_HUBADDR_1 (0x00000100UL) +#define USBHS_HCSPLT6_HUBADDR_2 (0x00000200UL) +#define USBHS_HCSPLT6_HUBADDR_3 (0x00000400UL) +#define USBHS_HCSPLT6_HUBADDR_4 (0x00000800UL) +#define USBHS_HCSPLT6_HUBADDR_5 (0x00001000UL) +#define USBHS_HCSPLT6_HUBADDR_6 (0x00002000UL) +#define USBHS_HCSPLT6_XACTPOS_POS (14U) +#define USBHS_HCSPLT6_XACTPOS (0x0000C000UL) +#define USBHS_HCSPLT6_XACTPOS_0 (0x00004000UL) +#define USBHS_HCSPLT6_XACTPOS_1 (0x00008000UL) +#define USBHS_HCSPLT6_COMPSPLT_POS (16U) +#define USBHS_HCSPLT6_COMPSPLT (0x00010000UL) +#define USBHS_HCSPLT6_SPLTENA_POS (31U) +#define USBHS_HCSPLT6_SPLTENA (0x80000000UL) + +/* Bit definition for USBHS_HCINT6 register */ +#define USBHS_HCINT6_XFERCOMPL_POS (0U) +#define USBHS_HCINT6_XFERCOMPL (0x00000001UL) +#define USBHS_HCINT6_CHHLTD_POS (1U) +#define USBHS_HCINT6_CHHLTD (0x00000002UL) +#define USBHS_HCINT6_AHBERR_POS (2U) +#define USBHS_HCINT6_AHBERR (0x00000004UL) +#define USBHS_HCINT6_STALL_POS (3U) +#define USBHS_HCINT6_STALL (0x00000008UL) +#define USBHS_HCINT6_NAK_POS (4U) +#define USBHS_HCINT6_NAK (0x00000010UL) +#define USBHS_HCINT6_ACK_POS (5U) +#define USBHS_HCINT6_ACK (0x00000020UL) +#define USBHS_HCINT6_NYET_POS (6U) +#define USBHS_HCINT6_NYET (0x00000040UL) +#define USBHS_HCINT6_XACTERR_POS (7U) +#define USBHS_HCINT6_XACTERR (0x00000080UL) +#define USBHS_HCINT6_BBLERR_POS (8U) +#define USBHS_HCINT6_BBLERR (0x00000100UL) +#define USBHS_HCINT6_FRMOVRUN_POS (9U) +#define USBHS_HCINT6_FRMOVRUN (0x00000200UL) +#define USBHS_HCINT6_DATATGLERR_POS (10U) +#define USBHS_HCINT6_DATATGLERR (0x00000400UL) + +/* Bit definition for USBHS_HCINTMSK6 register */ +#define USBHS_HCINTMSK6_XFERCOMPLMSK_POS (0U) +#define USBHS_HCINTMSK6_XFERCOMPLMSK (0x00000001UL) +#define USBHS_HCINTMSK6_CHHLTDMSK_POS (1U) +#define USBHS_HCINTMSK6_CHHLTDMSK (0x00000002UL) +#define USBHS_HCINTMSK6_AHBERRMSK_POS (2U) +#define USBHS_HCINTMSK6_AHBERRMSK (0x00000004UL) +#define USBHS_HCINTMSK6_STALLMSK_POS (3U) +#define USBHS_HCINTMSK6_STALLMSK (0x00000008UL) +#define USBHS_HCINTMSK6_NAKMSK_POS (4U) +#define USBHS_HCINTMSK6_NAKMSK (0x00000010UL) +#define USBHS_HCINTMSK6_ACKMSK_POS (5U) +#define USBHS_HCINTMSK6_ACKMSK (0x00000020UL) +#define USBHS_HCINTMSK6_NYETMSK_POS (6U) +#define USBHS_HCINTMSK6_NYETMSK (0x00000040UL) +#define USBHS_HCINTMSK6_XACTERRMSK_POS (7U) +#define USBHS_HCINTMSK6_XACTERRMSK (0x00000080UL) +#define USBHS_HCINTMSK6_BBLERRMSK_POS (8U) +#define USBHS_HCINTMSK6_BBLERRMSK (0x00000100UL) +#define USBHS_HCINTMSK6_FRMOVRUNMSK_POS (9U) +#define USBHS_HCINTMSK6_FRMOVRUNMSK (0x00000200UL) +#define USBHS_HCINTMSK6_DATATGLERRMSK_POS (10U) +#define USBHS_HCINTMSK6_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBHS_HCTSIZ6 register */ +#define USBHS_HCTSIZ6_XFERSIZE_POS (0U) +#define USBHS_HCTSIZ6_XFERSIZE (0x0007FFFFUL) +#define USBHS_HCTSIZ6_XFERSIZE_0 (0x00000001UL) +#define USBHS_HCTSIZ6_XFERSIZE_1 (0x00000002UL) +#define USBHS_HCTSIZ6_XFERSIZE_2 (0x00000004UL) +#define USBHS_HCTSIZ6_XFERSIZE_3 (0x00000008UL) +#define USBHS_HCTSIZ6_XFERSIZE_4 (0x00000010UL) +#define USBHS_HCTSIZ6_XFERSIZE_5 (0x00000020UL) +#define USBHS_HCTSIZ6_XFERSIZE_6 (0x00000040UL) +#define USBHS_HCTSIZ6_XFERSIZE_7 (0x00000080UL) +#define USBHS_HCTSIZ6_XFERSIZE_8 (0x00000100UL) +#define USBHS_HCTSIZ6_XFERSIZE_9 (0x00000200UL) +#define USBHS_HCTSIZ6_XFERSIZE_10 (0x00000400UL) +#define USBHS_HCTSIZ6_XFERSIZE_11 (0x00000800UL) +#define USBHS_HCTSIZ6_XFERSIZE_12 (0x00001000UL) +#define USBHS_HCTSIZ6_XFERSIZE_13 (0x00002000UL) +#define USBHS_HCTSIZ6_XFERSIZE_14 (0x00004000UL) +#define USBHS_HCTSIZ6_XFERSIZE_15 (0x00008000UL) +#define USBHS_HCTSIZ6_XFERSIZE_16 (0x00010000UL) +#define USBHS_HCTSIZ6_XFERSIZE_17 (0x00020000UL) +#define USBHS_HCTSIZ6_XFERSIZE_18 (0x00040000UL) +#define USBHS_HCTSIZ6_PKTCNT_POS (19U) +#define USBHS_HCTSIZ6_PKTCNT (0x1FF80000UL) +#define USBHS_HCTSIZ6_PKTCNT_0 (0x00080000UL) +#define USBHS_HCTSIZ6_PKTCNT_1 (0x00100000UL) +#define USBHS_HCTSIZ6_PKTCNT_2 (0x00200000UL) +#define USBHS_HCTSIZ6_PKTCNT_3 (0x00400000UL) +#define USBHS_HCTSIZ6_PKTCNT_4 (0x00800000UL) +#define USBHS_HCTSIZ6_PKTCNT_5 (0x01000000UL) +#define USBHS_HCTSIZ6_PKTCNT_6 (0x02000000UL) +#define USBHS_HCTSIZ6_PKTCNT_7 (0x04000000UL) +#define USBHS_HCTSIZ6_PKTCNT_8 (0x08000000UL) +#define USBHS_HCTSIZ6_PKTCNT_9 (0x10000000UL) +#define USBHS_HCTSIZ6_PID_POS (29U) +#define USBHS_HCTSIZ6_PID (0x60000000UL) +#define USBHS_HCTSIZ6_PID_0 (0x20000000UL) +#define USBHS_HCTSIZ6_PID_1 (0x40000000UL) +#define USBHS_HCTSIZ6_DOPNG_POS (31U) +#define USBHS_HCTSIZ6_DOPNG (0x80000000UL) + +/* Bit definition for USBHS_HCDMA6 register */ +#define USBHS_HCDMA6 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_HCCHAR7 register */ +#define USBHS_HCCHAR7_MPS_POS (0U) +#define USBHS_HCCHAR7_MPS (0x000007FFUL) +#define USBHS_HCCHAR7_MPS_0 (0x00000001UL) +#define USBHS_HCCHAR7_MPS_1 (0x00000002UL) +#define USBHS_HCCHAR7_MPS_2 (0x00000004UL) +#define USBHS_HCCHAR7_MPS_3 (0x00000008UL) +#define USBHS_HCCHAR7_MPS_4 (0x00000010UL) +#define USBHS_HCCHAR7_MPS_5 (0x00000020UL) +#define USBHS_HCCHAR7_MPS_6 (0x00000040UL) +#define USBHS_HCCHAR7_MPS_7 (0x00000080UL) +#define USBHS_HCCHAR7_MPS_8 (0x00000100UL) +#define USBHS_HCCHAR7_MPS_9 (0x00000200UL) +#define USBHS_HCCHAR7_MPS_10 (0x00000400UL) +#define USBHS_HCCHAR7_EPNUM_POS (11U) +#define USBHS_HCCHAR7_EPNUM (0x00007800UL) +#define USBHS_HCCHAR7_EPNUM_0 (0x00000800UL) +#define USBHS_HCCHAR7_EPNUM_1 (0x00001000UL) +#define USBHS_HCCHAR7_EPNUM_2 (0x00002000UL) +#define USBHS_HCCHAR7_EPNUM_3 (0x00004000UL) +#define USBHS_HCCHAR7_EPDIR_POS (15U) +#define USBHS_HCCHAR7_EPDIR (0x00008000UL) +#define USBHS_HCCHAR7_LSPDDEV_POS (17U) +#define USBHS_HCCHAR7_LSPDDEV (0x00020000UL) +#define USBHS_HCCHAR7_EPTYPE_POS (18U) +#define USBHS_HCCHAR7_EPTYPE (0x000C0000UL) +#define USBHS_HCCHAR7_EPTYPE_0 (0x00040000UL) +#define USBHS_HCCHAR7_EPTYPE_1 (0x00080000UL) +#define USBHS_HCCHAR7_EC_POS (20U) +#define USBHS_HCCHAR7_EC (0x00300000UL) +#define USBHS_HCCHAR7_EC_0 (0x00100000UL) +#define USBHS_HCCHAR7_EC_1 (0x00200000UL) +#define USBHS_HCCHAR7_DEVADDR_POS (22U) +#define USBHS_HCCHAR7_DEVADDR (0x1FC00000UL) +#define USBHS_HCCHAR7_DEVADDR_0 (0x00400000UL) +#define USBHS_HCCHAR7_DEVADDR_1 (0x00800000UL) +#define USBHS_HCCHAR7_DEVADDR_2 (0x01000000UL) +#define USBHS_HCCHAR7_DEVADDR_3 (0x02000000UL) +#define USBHS_HCCHAR7_DEVADDR_4 (0x04000000UL) +#define USBHS_HCCHAR7_DEVADDR_5 (0x08000000UL) +#define USBHS_HCCHAR7_DEVADDR_6 (0x10000000UL) +#define USBHS_HCCHAR7_ODDFRM_POS (29U) +#define USBHS_HCCHAR7_ODDFRM (0x20000000UL) +#define USBHS_HCCHAR7_CHDIS_POS (30U) +#define USBHS_HCCHAR7_CHDIS (0x40000000UL) +#define USBHS_HCCHAR7_CHENA_POS (31U) +#define USBHS_HCCHAR7_CHENA (0x80000000UL) + +/* Bit definition for USBHS_HCSPLT7 register */ +#define USBHS_HCSPLT7_PRTADDR_POS (0U) +#define USBHS_HCSPLT7_PRTADDR (0x0000007FUL) +#define USBHS_HCSPLT7_PRTADDR_0 (0x00000001UL) +#define USBHS_HCSPLT7_PRTADDR_1 (0x00000002UL) +#define USBHS_HCSPLT7_PRTADDR_2 (0x00000004UL) +#define USBHS_HCSPLT7_PRTADDR_3 (0x00000008UL) +#define USBHS_HCSPLT7_PRTADDR_4 (0x00000010UL) +#define USBHS_HCSPLT7_PRTADDR_5 (0x00000020UL) +#define USBHS_HCSPLT7_PRTADDR_6 (0x00000040UL) +#define USBHS_HCSPLT7_HUBADDR_POS (7U) +#define USBHS_HCSPLT7_HUBADDR (0x00003F80UL) +#define USBHS_HCSPLT7_HUBADDR_0 (0x00000080UL) +#define USBHS_HCSPLT7_HUBADDR_1 (0x00000100UL) +#define USBHS_HCSPLT7_HUBADDR_2 (0x00000200UL) +#define USBHS_HCSPLT7_HUBADDR_3 (0x00000400UL) +#define USBHS_HCSPLT7_HUBADDR_4 (0x00000800UL) +#define USBHS_HCSPLT7_HUBADDR_5 (0x00001000UL) +#define USBHS_HCSPLT7_HUBADDR_6 (0x00002000UL) +#define USBHS_HCSPLT7_XACTPOS_POS (14U) +#define USBHS_HCSPLT7_XACTPOS (0x0000C000UL) +#define USBHS_HCSPLT7_XACTPOS_0 (0x00004000UL) +#define USBHS_HCSPLT7_XACTPOS_1 (0x00008000UL) +#define USBHS_HCSPLT7_COMPSPLT_POS (16U) +#define USBHS_HCSPLT7_COMPSPLT (0x00010000UL) +#define USBHS_HCSPLT7_SPLTENA_POS (31U) +#define USBHS_HCSPLT7_SPLTENA (0x80000000UL) + +/* Bit definition for USBHS_HCINT7 register */ +#define USBHS_HCINT7_XFERCOMPL_POS (0U) +#define USBHS_HCINT7_XFERCOMPL (0x00000001UL) +#define USBHS_HCINT7_CHHLTD_POS (1U) +#define USBHS_HCINT7_CHHLTD (0x00000002UL) +#define USBHS_HCINT7_AHBERR_POS (2U) +#define USBHS_HCINT7_AHBERR (0x00000004UL) +#define USBHS_HCINT7_STALL_POS (3U) +#define USBHS_HCINT7_STALL (0x00000008UL) +#define USBHS_HCINT7_NAK_POS (4U) +#define USBHS_HCINT7_NAK (0x00000010UL) +#define USBHS_HCINT7_ACK_POS (5U) +#define USBHS_HCINT7_ACK (0x00000020UL) +#define USBHS_HCINT7_NYET_POS (6U) +#define USBHS_HCINT7_NYET (0x00000040UL) +#define USBHS_HCINT7_XACTERR_POS (7U) +#define USBHS_HCINT7_XACTERR (0x00000080UL) +#define USBHS_HCINT7_BBLERR_POS (8U) +#define USBHS_HCINT7_BBLERR (0x00000100UL) +#define USBHS_HCINT7_FRMOVRUN_POS (9U) +#define USBHS_HCINT7_FRMOVRUN (0x00000200UL) +#define USBHS_HCINT7_DATATGLERR_POS (10U) +#define USBHS_HCINT7_DATATGLERR (0x00000400UL) + +/* Bit definition for USBHS_HCINTMSK7 register */ +#define USBHS_HCINTMSK7_XFERCOMPLMSK_POS (0U) +#define USBHS_HCINTMSK7_XFERCOMPLMSK (0x00000001UL) +#define USBHS_HCINTMSK7_CHHLTDMSK_POS (1U) +#define USBHS_HCINTMSK7_CHHLTDMSK (0x00000002UL) +#define USBHS_HCINTMSK7_AHBERRMSK_POS (2U) +#define USBHS_HCINTMSK7_AHBERRMSK (0x00000004UL) +#define USBHS_HCINTMSK7_STALLMSK_POS (3U) +#define USBHS_HCINTMSK7_STALLMSK (0x00000008UL) +#define USBHS_HCINTMSK7_NAKMSK_POS (4U) +#define USBHS_HCINTMSK7_NAKMSK (0x00000010UL) +#define USBHS_HCINTMSK7_ACKMSK_POS (5U) +#define USBHS_HCINTMSK7_ACKMSK (0x00000020UL) +#define USBHS_HCINTMSK7_NYETMSK_POS (6U) +#define USBHS_HCINTMSK7_NYETMSK (0x00000040UL) +#define USBHS_HCINTMSK7_XACTERRMSK_POS (7U) +#define USBHS_HCINTMSK7_XACTERRMSK (0x00000080UL) +#define USBHS_HCINTMSK7_BBLERRMSK_POS (8U) +#define USBHS_HCINTMSK7_BBLERRMSK (0x00000100UL) +#define USBHS_HCINTMSK7_FRMOVRUNMSK_POS (9U) +#define USBHS_HCINTMSK7_FRMOVRUNMSK (0x00000200UL) +#define USBHS_HCINTMSK7_DATATGLERRMSK_POS (10U) +#define USBHS_HCINTMSK7_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBHS_HCTSIZ7 register */ +#define USBHS_HCTSIZ7_XFERSIZE_POS (0U) +#define USBHS_HCTSIZ7_XFERSIZE (0x0007FFFFUL) +#define USBHS_HCTSIZ7_XFERSIZE_0 (0x00000001UL) +#define USBHS_HCTSIZ7_XFERSIZE_1 (0x00000002UL) +#define USBHS_HCTSIZ7_XFERSIZE_2 (0x00000004UL) +#define USBHS_HCTSIZ7_XFERSIZE_3 (0x00000008UL) +#define USBHS_HCTSIZ7_XFERSIZE_4 (0x00000010UL) +#define USBHS_HCTSIZ7_XFERSIZE_5 (0x00000020UL) +#define USBHS_HCTSIZ7_XFERSIZE_6 (0x00000040UL) +#define USBHS_HCTSIZ7_XFERSIZE_7 (0x00000080UL) +#define USBHS_HCTSIZ7_XFERSIZE_8 (0x00000100UL) +#define USBHS_HCTSIZ7_XFERSIZE_9 (0x00000200UL) +#define USBHS_HCTSIZ7_XFERSIZE_10 (0x00000400UL) +#define USBHS_HCTSIZ7_XFERSIZE_11 (0x00000800UL) +#define USBHS_HCTSIZ7_XFERSIZE_12 (0x00001000UL) +#define USBHS_HCTSIZ7_XFERSIZE_13 (0x00002000UL) +#define USBHS_HCTSIZ7_XFERSIZE_14 (0x00004000UL) +#define USBHS_HCTSIZ7_XFERSIZE_15 (0x00008000UL) +#define USBHS_HCTSIZ7_XFERSIZE_16 (0x00010000UL) +#define USBHS_HCTSIZ7_XFERSIZE_17 (0x00020000UL) +#define USBHS_HCTSIZ7_XFERSIZE_18 (0x00040000UL) +#define USBHS_HCTSIZ7_PKTCNT_POS (19U) +#define USBHS_HCTSIZ7_PKTCNT (0x1FF80000UL) +#define USBHS_HCTSIZ7_PKTCNT_0 (0x00080000UL) +#define USBHS_HCTSIZ7_PKTCNT_1 (0x00100000UL) +#define USBHS_HCTSIZ7_PKTCNT_2 (0x00200000UL) +#define USBHS_HCTSIZ7_PKTCNT_3 (0x00400000UL) +#define USBHS_HCTSIZ7_PKTCNT_4 (0x00800000UL) +#define USBHS_HCTSIZ7_PKTCNT_5 (0x01000000UL) +#define USBHS_HCTSIZ7_PKTCNT_6 (0x02000000UL) +#define USBHS_HCTSIZ7_PKTCNT_7 (0x04000000UL) +#define USBHS_HCTSIZ7_PKTCNT_8 (0x08000000UL) +#define USBHS_HCTSIZ7_PKTCNT_9 (0x10000000UL) +#define USBHS_HCTSIZ7_PID_POS (29U) +#define USBHS_HCTSIZ7_PID (0x60000000UL) +#define USBHS_HCTSIZ7_PID_0 (0x20000000UL) +#define USBHS_HCTSIZ7_PID_1 (0x40000000UL) +#define USBHS_HCTSIZ7_DOPNG_POS (31U) +#define USBHS_HCTSIZ7_DOPNG (0x80000000UL) + +/* Bit definition for USBHS_HCDMA7 register */ +#define USBHS_HCDMA7 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_HCCHAR8 register */ +#define USBHS_HCCHAR8_MPS_POS (0U) +#define USBHS_HCCHAR8_MPS (0x000007FFUL) +#define USBHS_HCCHAR8_MPS_0 (0x00000001UL) +#define USBHS_HCCHAR8_MPS_1 (0x00000002UL) +#define USBHS_HCCHAR8_MPS_2 (0x00000004UL) +#define USBHS_HCCHAR8_MPS_3 (0x00000008UL) +#define USBHS_HCCHAR8_MPS_4 (0x00000010UL) +#define USBHS_HCCHAR8_MPS_5 (0x00000020UL) +#define USBHS_HCCHAR8_MPS_6 (0x00000040UL) +#define USBHS_HCCHAR8_MPS_7 (0x00000080UL) +#define USBHS_HCCHAR8_MPS_8 (0x00000100UL) +#define USBHS_HCCHAR8_MPS_9 (0x00000200UL) +#define USBHS_HCCHAR8_MPS_10 (0x00000400UL) +#define USBHS_HCCHAR8_EPNUM_POS (11U) +#define USBHS_HCCHAR8_EPNUM (0x00007800UL) +#define USBHS_HCCHAR8_EPNUM_0 (0x00000800UL) +#define USBHS_HCCHAR8_EPNUM_1 (0x00001000UL) +#define USBHS_HCCHAR8_EPNUM_2 (0x00002000UL) +#define USBHS_HCCHAR8_EPNUM_3 (0x00004000UL) +#define USBHS_HCCHAR8_EPDIR_POS (15U) +#define USBHS_HCCHAR8_EPDIR (0x00008000UL) +#define USBHS_HCCHAR8_LSPDDEV_POS (17U) +#define USBHS_HCCHAR8_LSPDDEV (0x00020000UL) +#define USBHS_HCCHAR8_EPTYPE_POS (18U) +#define USBHS_HCCHAR8_EPTYPE (0x000C0000UL) +#define USBHS_HCCHAR8_EPTYPE_0 (0x00040000UL) +#define USBHS_HCCHAR8_EPTYPE_1 (0x00080000UL) +#define USBHS_HCCHAR8_EC_POS (20U) +#define USBHS_HCCHAR8_EC (0x00300000UL) +#define USBHS_HCCHAR8_EC_0 (0x00100000UL) +#define USBHS_HCCHAR8_EC_1 (0x00200000UL) +#define USBHS_HCCHAR8_DEVADDR_POS (22U) +#define USBHS_HCCHAR8_DEVADDR (0x1FC00000UL) +#define USBHS_HCCHAR8_DEVADDR_0 (0x00400000UL) +#define USBHS_HCCHAR8_DEVADDR_1 (0x00800000UL) +#define USBHS_HCCHAR8_DEVADDR_2 (0x01000000UL) +#define USBHS_HCCHAR8_DEVADDR_3 (0x02000000UL) +#define USBHS_HCCHAR8_DEVADDR_4 (0x04000000UL) +#define USBHS_HCCHAR8_DEVADDR_5 (0x08000000UL) +#define USBHS_HCCHAR8_DEVADDR_6 (0x10000000UL) +#define USBHS_HCCHAR8_ODDFRM_POS (29U) +#define USBHS_HCCHAR8_ODDFRM (0x20000000UL) +#define USBHS_HCCHAR8_CHDIS_POS (30U) +#define USBHS_HCCHAR8_CHDIS (0x40000000UL) +#define USBHS_HCCHAR8_CHENA_POS (31U) +#define USBHS_HCCHAR8_CHENA (0x80000000UL) + +/* Bit definition for USBHS_HCSPLT8 register */ +#define USBHS_HCSPLT8_PRTADDR_POS (0U) +#define USBHS_HCSPLT8_PRTADDR (0x0000007FUL) +#define USBHS_HCSPLT8_PRTADDR_0 (0x00000001UL) +#define USBHS_HCSPLT8_PRTADDR_1 (0x00000002UL) +#define USBHS_HCSPLT8_PRTADDR_2 (0x00000004UL) +#define USBHS_HCSPLT8_PRTADDR_3 (0x00000008UL) +#define USBHS_HCSPLT8_PRTADDR_4 (0x00000010UL) +#define USBHS_HCSPLT8_PRTADDR_5 (0x00000020UL) +#define USBHS_HCSPLT8_PRTADDR_6 (0x00000040UL) +#define USBHS_HCSPLT8_HUBADDR_POS (7U) +#define USBHS_HCSPLT8_HUBADDR (0x00003F80UL) +#define USBHS_HCSPLT8_HUBADDR_0 (0x00000080UL) +#define USBHS_HCSPLT8_HUBADDR_1 (0x00000100UL) +#define USBHS_HCSPLT8_HUBADDR_2 (0x00000200UL) +#define USBHS_HCSPLT8_HUBADDR_3 (0x00000400UL) +#define USBHS_HCSPLT8_HUBADDR_4 (0x00000800UL) +#define USBHS_HCSPLT8_HUBADDR_5 (0x00001000UL) +#define USBHS_HCSPLT8_HUBADDR_6 (0x00002000UL) +#define USBHS_HCSPLT8_XACTPOS_POS (14U) +#define USBHS_HCSPLT8_XACTPOS (0x0000C000UL) +#define USBHS_HCSPLT8_XACTPOS_0 (0x00004000UL) +#define USBHS_HCSPLT8_XACTPOS_1 (0x00008000UL) +#define USBHS_HCSPLT8_COMPSPLT_POS (16U) +#define USBHS_HCSPLT8_COMPSPLT (0x00010000UL) +#define USBHS_HCSPLT8_SPLTENA_POS (31U) +#define USBHS_HCSPLT8_SPLTENA (0x80000000UL) + +/* Bit definition for USBHS_HCINT8 register */ +#define USBHS_HCINT8_XFERCOMPL_POS (0U) +#define USBHS_HCINT8_XFERCOMPL (0x00000001UL) +#define USBHS_HCINT8_CHHLTD_POS (1U) +#define USBHS_HCINT8_CHHLTD (0x00000002UL) +#define USBHS_HCINT8_AHBERR_POS (2U) +#define USBHS_HCINT8_AHBERR (0x00000004UL) +#define USBHS_HCINT8_STALL_POS (3U) +#define USBHS_HCINT8_STALL (0x00000008UL) +#define USBHS_HCINT8_NAK_POS (4U) +#define USBHS_HCINT8_NAK (0x00000010UL) +#define USBHS_HCINT8_ACK_POS (5U) +#define USBHS_HCINT8_ACK (0x00000020UL) +#define USBHS_HCINT8_NYET_POS (6U) +#define USBHS_HCINT8_NYET (0x00000040UL) +#define USBHS_HCINT8_XACTERR_POS (7U) +#define USBHS_HCINT8_XACTERR (0x00000080UL) +#define USBHS_HCINT8_BBLERR_POS (8U) +#define USBHS_HCINT8_BBLERR (0x00000100UL) +#define USBHS_HCINT8_FRMOVRUN_POS (9U) +#define USBHS_HCINT8_FRMOVRUN (0x00000200UL) +#define USBHS_HCINT8_DATATGLERR_POS (10U) +#define USBHS_HCINT8_DATATGLERR (0x00000400UL) + +/* Bit definition for USBHS_HCINTMSK8 register */ +#define USBHS_HCINTMSK8_XFERCOMPLMSK_POS (0U) +#define USBHS_HCINTMSK8_XFERCOMPLMSK (0x00000001UL) +#define USBHS_HCINTMSK8_CHHLTDMSK_POS (1U) +#define USBHS_HCINTMSK8_CHHLTDMSK (0x00000002UL) +#define USBHS_HCINTMSK8_AHBERRMSK_POS (2U) +#define USBHS_HCINTMSK8_AHBERRMSK (0x00000004UL) +#define USBHS_HCINTMSK8_STALLMSK_POS (3U) +#define USBHS_HCINTMSK8_STALLMSK (0x00000008UL) +#define USBHS_HCINTMSK8_NAKMSK_POS (4U) +#define USBHS_HCINTMSK8_NAKMSK (0x00000010UL) +#define USBHS_HCINTMSK8_ACKMSK_POS (5U) +#define USBHS_HCINTMSK8_ACKMSK (0x00000020UL) +#define USBHS_HCINTMSK8_NYETMSK_POS (6U) +#define USBHS_HCINTMSK8_NYETMSK (0x00000040UL) +#define USBHS_HCINTMSK8_XACTERRMSK_POS (7U) +#define USBHS_HCINTMSK8_XACTERRMSK (0x00000080UL) +#define USBHS_HCINTMSK8_BBLERRMSK_POS (8U) +#define USBHS_HCINTMSK8_BBLERRMSK (0x00000100UL) +#define USBHS_HCINTMSK8_FRMOVRUNMSK_POS (9U) +#define USBHS_HCINTMSK8_FRMOVRUNMSK (0x00000200UL) +#define USBHS_HCINTMSK8_DATATGLERRMSK_POS (10U) +#define USBHS_HCINTMSK8_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBHS_HCTSIZ8 register */ +#define USBHS_HCTSIZ8_XFERSIZE_POS (0U) +#define USBHS_HCTSIZ8_XFERSIZE (0x0007FFFFUL) +#define USBHS_HCTSIZ8_XFERSIZE_0 (0x00000001UL) +#define USBHS_HCTSIZ8_XFERSIZE_1 (0x00000002UL) +#define USBHS_HCTSIZ8_XFERSIZE_2 (0x00000004UL) +#define USBHS_HCTSIZ8_XFERSIZE_3 (0x00000008UL) +#define USBHS_HCTSIZ8_XFERSIZE_4 (0x00000010UL) +#define USBHS_HCTSIZ8_XFERSIZE_5 (0x00000020UL) +#define USBHS_HCTSIZ8_XFERSIZE_6 (0x00000040UL) +#define USBHS_HCTSIZ8_XFERSIZE_7 (0x00000080UL) +#define USBHS_HCTSIZ8_XFERSIZE_8 (0x00000100UL) +#define USBHS_HCTSIZ8_XFERSIZE_9 (0x00000200UL) +#define USBHS_HCTSIZ8_XFERSIZE_10 (0x00000400UL) +#define USBHS_HCTSIZ8_XFERSIZE_11 (0x00000800UL) +#define USBHS_HCTSIZ8_XFERSIZE_12 (0x00001000UL) +#define USBHS_HCTSIZ8_XFERSIZE_13 (0x00002000UL) +#define USBHS_HCTSIZ8_XFERSIZE_14 (0x00004000UL) +#define USBHS_HCTSIZ8_XFERSIZE_15 (0x00008000UL) +#define USBHS_HCTSIZ8_XFERSIZE_16 (0x00010000UL) +#define USBHS_HCTSIZ8_XFERSIZE_17 (0x00020000UL) +#define USBHS_HCTSIZ8_XFERSIZE_18 (0x00040000UL) +#define USBHS_HCTSIZ8_PKTCNT_POS (19U) +#define USBHS_HCTSIZ8_PKTCNT (0x1FF80000UL) +#define USBHS_HCTSIZ8_PKTCNT_0 (0x00080000UL) +#define USBHS_HCTSIZ8_PKTCNT_1 (0x00100000UL) +#define USBHS_HCTSIZ8_PKTCNT_2 (0x00200000UL) +#define USBHS_HCTSIZ8_PKTCNT_3 (0x00400000UL) +#define USBHS_HCTSIZ8_PKTCNT_4 (0x00800000UL) +#define USBHS_HCTSIZ8_PKTCNT_5 (0x01000000UL) +#define USBHS_HCTSIZ8_PKTCNT_6 (0x02000000UL) +#define USBHS_HCTSIZ8_PKTCNT_7 (0x04000000UL) +#define USBHS_HCTSIZ8_PKTCNT_8 (0x08000000UL) +#define USBHS_HCTSIZ8_PKTCNT_9 (0x10000000UL) +#define USBHS_HCTSIZ8_PID_POS (29U) +#define USBHS_HCTSIZ8_PID (0x60000000UL) +#define USBHS_HCTSIZ8_PID_0 (0x20000000UL) +#define USBHS_HCTSIZ8_PID_1 (0x40000000UL) +#define USBHS_HCTSIZ8_DOPNG_POS (31U) +#define USBHS_HCTSIZ8_DOPNG (0x80000000UL) + +/* Bit definition for USBHS_HCDMA8 register */ +#define USBHS_HCDMA8 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_HCCHAR9 register */ +#define USBHS_HCCHAR9_MPS_POS (0U) +#define USBHS_HCCHAR9_MPS (0x000007FFUL) +#define USBHS_HCCHAR9_MPS_0 (0x00000001UL) +#define USBHS_HCCHAR9_MPS_1 (0x00000002UL) +#define USBHS_HCCHAR9_MPS_2 (0x00000004UL) +#define USBHS_HCCHAR9_MPS_3 (0x00000008UL) +#define USBHS_HCCHAR9_MPS_4 (0x00000010UL) +#define USBHS_HCCHAR9_MPS_5 (0x00000020UL) +#define USBHS_HCCHAR9_MPS_6 (0x00000040UL) +#define USBHS_HCCHAR9_MPS_7 (0x00000080UL) +#define USBHS_HCCHAR9_MPS_8 (0x00000100UL) +#define USBHS_HCCHAR9_MPS_9 (0x00000200UL) +#define USBHS_HCCHAR9_MPS_10 (0x00000400UL) +#define USBHS_HCCHAR9_EPNUM_POS (11U) +#define USBHS_HCCHAR9_EPNUM (0x00007800UL) +#define USBHS_HCCHAR9_EPNUM_0 (0x00000800UL) +#define USBHS_HCCHAR9_EPNUM_1 (0x00001000UL) +#define USBHS_HCCHAR9_EPNUM_2 (0x00002000UL) +#define USBHS_HCCHAR9_EPNUM_3 (0x00004000UL) +#define USBHS_HCCHAR9_EPDIR_POS (15U) +#define USBHS_HCCHAR9_EPDIR (0x00008000UL) +#define USBHS_HCCHAR9_LSPDDEV_POS (17U) +#define USBHS_HCCHAR9_LSPDDEV (0x00020000UL) +#define USBHS_HCCHAR9_EPTYPE_POS (18U) +#define USBHS_HCCHAR9_EPTYPE (0x000C0000UL) +#define USBHS_HCCHAR9_EPTYPE_0 (0x00040000UL) +#define USBHS_HCCHAR9_EPTYPE_1 (0x00080000UL) +#define USBHS_HCCHAR9_EC_POS (20U) +#define USBHS_HCCHAR9_EC (0x00300000UL) +#define USBHS_HCCHAR9_EC_0 (0x00100000UL) +#define USBHS_HCCHAR9_EC_1 (0x00200000UL) +#define USBHS_HCCHAR9_DEVADDR_POS (22U) +#define USBHS_HCCHAR9_DEVADDR (0x1FC00000UL) +#define USBHS_HCCHAR9_DEVADDR_0 (0x00400000UL) +#define USBHS_HCCHAR9_DEVADDR_1 (0x00800000UL) +#define USBHS_HCCHAR9_DEVADDR_2 (0x01000000UL) +#define USBHS_HCCHAR9_DEVADDR_3 (0x02000000UL) +#define USBHS_HCCHAR9_DEVADDR_4 (0x04000000UL) +#define USBHS_HCCHAR9_DEVADDR_5 (0x08000000UL) +#define USBHS_HCCHAR9_DEVADDR_6 (0x10000000UL) +#define USBHS_HCCHAR9_ODDFRM_POS (29U) +#define USBHS_HCCHAR9_ODDFRM (0x20000000UL) +#define USBHS_HCCHAR9_CHDIS_POS (30U) +#define USBHS_HCCHAR9_CHDIS (0x40000000UL) +#define USBHS_HCCHAR9_CHENA_POS (31U) +#define USBHS_HCCHAR9_CHENA (0x80000000UL) + +/* Bit definition for USBHS_HCSPLT9 register */ +#define USBHS_HCSPLT9_PRTADDR_POS (0U) +#define USBHS_HCSPLT9_PRTADDR (0x0000007FUL) +#define USBHS_HCSPLT9_PRTADDR_0 (0x00000001UL) +#define USBHS_HCSPLT9_PRTADDR_1 (0x00000002UL) +#define USBHS_HCSPLT9_PRTADDR_2 (0x00000004UL) +#define USBHS_HCSPLT9_PRTADDR_3 (0x00000008UL) +#define USBHS_HCSPLT9_PRTADDR_4 (0x00000010UL) +#define USBHS_HCSPLT9_PRTADDR_5 (0x00000020UL) +#define USBHS_HCSPLT9_PRTADDR_6 (0x00000040UL) +#define USBHS_HCSPLT9_HUBADDR_POS (7U) +#define USBHS_HCSPLT9_HUBADDR (0x00003F80UL) +#define USBHS_HCSPLT9_HUBADDR_0 (0x00000080UL) +#define USBHS_HCSPLT9_HUBADDR_1 (0x00000100UL) +#define USBHS_HCSPLT9_HUBADDR_2 (0x00000200UL) +#define USBHS_HCSPLT9_HUBADDR_3 (0x00000400UL) +#define USBHS_HCSPLT9_HUBADDR_4 (0x00000800UL) +#define USBHS_HCSPLT9_HUBADDR_5 (0x00001000UL) +#define USBHS_HCSPLT9_HUBADDR_6 (0x00002000UL) +#define USBHS_HCSPLT9_XACTPOS_POS (14U) +#define USBHS_HCSPLT9_XACTPOS (0x0000C000UL) +#define USBHS_HCSPLT9_XACTPOS_0 (0x00004000UL) +#define USBHS_HCSPLT9_XACTPOS_1 (0x00008000UL) +#define USBHS_HCSPLT9_COMPSPLT_POS (16U) +#define USBHS_HCSPLT9_COMPSPLT (0x00010000UL) +#define USBHS_HCSPLT9_SPLTENA_POS (31U) +#define USBHS_HCSPLT9_SPLTENA (0x80000000UL) + +/* Bit definition for USBHS_HCINT9 register */ +#define USBHS_HCINT9_XFERCOMPL_POS (0U) +#define USBHS_HCINT9_XFERCOMPL (0x00000001UL) +#define USBHS_HCINT9_CHHLTD_POS (1U) +#define USBHS_HCINT9_CHHLTD (0x00000002UL) +#define USBHS_HCINT9_AHBERR_POS (2U) +#define USBHS_HCINT9_AHBERR (0x00000004UL) +#define USBHS_HCINT9_STALL_POS (3U) +#define USBHS_HCINT9_STALL (0x00000008UL) +#define USBHS_HCINT9_NAK_POS (4U) +#define USBHS_HCINT9_NAK (0x00000010UL) +#define USBHS_HCINT9_ACK_POS (5U) +#define USBHS_HCINT9_ACK (0x00000020UL) +#define USBHS_HCINT9_NYET_POS (6U) +#define USBHS_HCINT9_NYET (0x00000040UL) +#define USBHS_HCINT9_XACTERR_POS (7U) +#define USBHS_HCINT9_XACTERR (0x00000080UL) +#define USBHS_HCINT9_BBLERR_POS (8U) +#define USBHS_HCINT9_BBLERR (0x00000100UL) +#define USBHS_HCINT9_FRMOVRUN_POS (9U) +#define USBHS_HCINT9_FRMOVRUN (0x00000200UL) +#define USBHS_HCINT9_DATATGLERR_POS (10U) +#define USBHS_HCINT9_DATATGLERR (0x00000400UL) + +/* Bit definition for USBHS_HCINTMSK9 register */ +#define USBHS_HCINTMSK9_XFERCOMPLMSK_POS (0U) +#define USBHS_HCINTMSK9_XFERCOMPLMSK (0x00000001UL) +#define USBHS_HCINTMSK9_CHHLTDMSK_POS (1U) +#define USBHS_HCINTMSK9_CHHLTDMSK (0x00000002UL) +#define USBHS_HCINTMSK9_AHBERRMSK_POS (2U) +#define USBHS_HCINTMSK9_AHBERRMSK (0x00000004UL) +#define USBHS_HCINTMSK9_STALLMSK_POS (3U) +#define USBHS_HCINTMSK9_STALLMSK (0x00000008UL) +#define USBHS_HCINTMSK9_NAKMSK_POS (4U) +#define USBHS_HCINTMSK9_NAKMSK (0x00000010UL) +#define USBHS_HCINTMSK9_ACKMSK_POS (5U) +#define USBHS_HCINTMSK9_ACKMSK (0x00000020UL) +#define USBHS_HCINTMSK9_NYETMSK_POS (6U) +#define USBHS_HCINTMSK9_NYETMSK (0x00000040UL) +#define USBHS_HCINTMSK9_XACTERRMSK_POS (7U) +#define USBHS_HCINTMSK9_XACTERRMSK (0x00000080UL) +#define USBHS_HCINTMSK9_BBLERRMSK_POS (8U) +#define USBHS_HCINTMSK9_BBLERRMSK (0x00000100UL) +#define USBHS_HCINTMSK9_FRMOVRUNMSK_POS (9U) +#define USBHS_HCINTMSK9_FRMOVRUNMSK (0x00000200UL) +#define USBHS_HCINTMSK9_DATATGLERRMSK_POS (10U) +#define USBHS_HCINTMSK9_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBHS_HCTSIZ9 register */ +#define USBHS_HCTSIZ9_XFERSIZE_POS (0U) +#define USBHS_HCTSIZ9_XFERSIZE (0x0007FFFFUL) +#define USBHS_HCTSIZ9_XFERSIZE_0 (0x00000001UL) +#define USBHS_HCTSIZ9_XFERSIZE_1 (0x00000002UL) +#define USBHS_HCTSIZ9_XFERSIZE_2 (0x00000004UL) +#define USBHS_HCTSIZ9_XFERSIZE_3 (0x00000008UL) +#define USBHS_HCTSIZ9_XFERSIZE_4 (0x00000010UL) +#define USBHS_HCTSIZ9_XFERSIZE_5 (0x00000020UL) +#define USBHS_HCTSIZ9_XFERSIZE_6 (0x00000040UL) +#define USBHS_HCTSIZ9_XFERSIZE_7 (0x00000080UL) +#define USBHS_HCTSIZ9_XFERSIZE_8 (0x00000100UL) +#define USBHS_HCTSIZ9_XFERSIZE_9 (0x00000200UL) +#define USBHS_HCTSIZ9_XFERSIZE_10 (0x00000400UL) +#define USBHS_HCTSIZ9_XFERSIZE_11 (0x00000800UL) +#define USBHS_HCTSIZ9_XFERSIZE_12 (0x00001000UL) +#define USBHS_HCTSIZ9_XFERSIZE_13 (0x00002000UL) +#define USBHS_HCTSIZ9_XFERSIZE_14 (0x00004000UL) +#define USBHS_HCTSIZ9_XFERSIZE_15 (0x00008000UL) +#define USBHS_HCTSIZ9_XFERSIZE_16 (0x00010000UL) +#define USBHS_HCTSIZ9_XFERSIZE_17 (0x00020000UL) +#define USBHS_HCTSIZ9_XFERSIZE_18 (0x00040000UL) +#define USBHS_HCTSIZ9_PKTCNT_POS (19U) +#define USBHS_HCTSIZ9_PKTCNT (0x1FF80000UL) +#define USBHS_HCTSIZ9_PKTCNT_0 (0x00080000UL) +#define USBHS_HCTSIZ9_PKTCNT_1 (0x00100000UL) +#define USBHS_HCTSIZ9_PKTCNT_2 (0x00200000UL) +#define USBHS_HCTSIZ9_PKTCNT_3 (0x00400000UL) +#define USBHS_HCTSIZ9_PKTCNT_4 (0x00800000UL) +#define USBHS_HCTSIZ9_PKTCNT_5 (0x01000000UL) +#define USBHS_HCTSIZ9_PKTCNT_6 (0x02000000UL) +#define USBHS_HCTSIZ9_PKTCNT_7 (0x04000000UL) +#define USBHS_HCTSIZ9_PKTCNT_8 (0x08000000UL) +#define USBHS_HCTSIZ9_PKTCNT_9 (0x10000000UL) +#define USBHS_HCTSIZ9_PID_POS (29U) +#define USBHS_HCTSIZ9_PID (0x60000000UL) +#define USBHS_HCTSIZ9_PID_0 (0x20000000UL) +#define USBHS_HCTSIZ9_PID_1 (0x40000000UL) +#define USBHS_HCTSIZ9_DOPNG_POS (31U) +#define USBHS_HCTSIZ9_DOPNG (0x80000000UL) + +/* Bit definition for USBHS_HCDMA9 register */ +#define USBHS_HCDMA9 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_HCCHAR10 register */ +#define USBHS_HCCHAR10_MPS_POS (0U) +#define USBHS_HCCHAR10_MPS (0x000007FFUL) +#define USBHS_HCCHAR10_MPS_0 (0x00000001UL) +#define USBHS_HCCHAR10_MPS_1 (0x00000002UL) +#define USBHS_HCCHAR10_MPS_2 (0x00000004UL) +#define USBHS_HCCHAR10_MPS_3 (0x00000008UL) +#define USBHS_HCCHAR10_MPS_4 (0x00000010UL) +#define USBHS_HCCHAR10_MPS_5 (0x00000020UL) +#define USBHS_HCCHAR10_MPS_6 (0x00000040UL) +#define USBHS_HCCHAR10_MPS_7 (0x00000080UL) +#define USBHS_HCCHAR10_MPS_8 (0x00000100UL) +#define USBHS_HCCHAR10_MPS_9 (0x00000200UL) +#define USBHS_HCCHAR10_MPS_10 (0x00000400UL) +#define USBHS_HCCHAR10_EPNUM_POS (11U) +#define USBHS_HCCHAR10_EPNUM (0x00007800UL) +#define USBHS_HCCHAR10_EPNUM_0 (0x00000800UL) +#define USBHS_HCCHAR10_EPNUM_1 (0x00001000UL) +#define USBHS_HCCHAR10_EPNUM_2 (0x00002000UL) +#define USBHS_HCCHAR10_EPNUM_3 (0x00004000UL) +#define USBHS_HCCHAR10_EPDIR_POS (15U) +#define USBHS_HCCHAR10_EPDIR (0x00008000UL) +#define USBHS_HCCHAR10_LSPDDEV_POS (17U) +#define USBHS_HCCHAR10_LSPDDEV (0x00020000UL) +#define USBHS_HCCHAR10_EPTYPE_POS (18U) +#define USBHS_HCCHAR10_EPTYPE (0x000C0000UL) +#define USBHS_HCCHAR10_EPTYPE_0 (0x00040000UL) +#define USBHS_HCCHAR10_EPTYPE_1 (0x00080000UL) +#define USBHS_HCCHAR10_EC_POS (20U) +#define USBHS_HCCHAR10_EC (0x00300000UL) +#define USBHS_HCCHAR10_EC_0 (0x00100000UL) +#define USBHS_HCCHAR10_EC_1 (0x00200000UL) +#define USBHS_HCCHAR10_DEVADDR_POS (22U) +#define USBHS_HCCHAR10_DEVADDR (0x1FC00000UL) +#define USBHS_HCCHAR10_DEVADDR_0 (0x00400000UL) +#define USBHS_HCCHAR10_DEVADDR_1 (0x00800000UL) +#define USBHS_HCCHAR10_DEVADDR_2 (0x01000000UL) +#define USBHS_HCCHAR10_DEVADDR_3 (0x02000000UL) +#define USBHS_HCCHAR10_DEVADDR_4 (0x04000000UL) +#define USBHS_HCCHAR10_DEVADDR_5 (0x08000000UL) +#define USBHS_HCCHAR10_DEVADDR_6 (0x10000000UL) +#define USBHS_HCCHAR10_ODDFRM_POS (29U) +#define USBHS_HCCHAR10_ODDFRM (0x20000000UL) +#define USBHS_HCCHAR10_CHDIS_POS (30U) +#define USBHS_HCCHAR10_CHDIS (0x40000000UL) +#define USBHS_HCCHAR10_CHENA_POS (31U) +#define USBHS_HCCHAR10_CHENA (0x80000000UL) + +/* Bit definition for USBHS_HCSPLT10 register */ +#define USBHS_HCSPLT10_PRTADDR_POS (0U) +#define USBHS_HCSPLT10_PRTADDR (0x0000007FUL) +#define USBHS_HCSPLT10_PRTADDR_0 (0x00000001UL) +#define USBHS_HCSPLT10_PRTADDR_1 (0x00000002UL) +#define USBHS_HCSPLT10_PRTADDR_2 (0x00000004UL) +#define USBHS_HCSPLT10_PRTADDR_3 (0x00000008UL) +#define USBHS_HCSPLT10_PRTADDR_4 (0x00000010UL) +#define USBHS_HCSPLT10_PRTADDR_5 (0x00000020UL) +#define USBHS_HCSPLT10_PRTADDR_6 (0x00000040UL) +#define USBHS_HCSPLT10_HUBADDR_POS (7U) +#define USBHS_HCSPLT10_HUBADDR (0x00003F80UL) +#define USBHS_HCSPLT10_HUBADDR_0 (0x00000080UL) +#define USBHS_HCSPLT10_HUBADDR_1 (0x00000100UL) +#define USBHS_HCSPLT10_HUBADDR_2 (0x00000200UL) +#define USBHS_HCSPLT10_HUBADDR_3 (0x00000400UL) +#define USBHS_HCSPLT10_HUBADDR_4 (0x00000800UL) +#define USBHS_HCSPLT10_HUBADDR_5 (0x00001000UL) +#define USBHS_HCSPLT10_HUBADDR_6 (0x00002000UL) +#define USBHS_HCSPLT10_XACTPOS_POS (14U) +#define USBHS_HCSPLT10_XACTPOS (0x0000C000UL) +#define USBHS_HCSPLT10_XACTPOS_0 (0x00004000UL) +#define USBHS_HCSPLT10_XACTPOS_1 (0x00008000UL) +#define USBHS_HCSPLT10_COMPSPLT_POS (16U) +#define USBHS_HCSPLT10_COMPSPLT (0x00010000UL) +#define USBHS_HCSPLT10_SPLTENA_POS (31U) +#define USBHS_HCSPLT10_SPLTENA (0x80000000UL) + +/* Bit definition for USBHS_HCINT10 register */ +#define USBHS_HCINT10_XFERCOMPL_POS (0U) +#define USBHS_HCINT10_XFERCOMPL (0x00000001UL) +#define USBHS_HCINT10_CHHLTD_POS (1U) +#define USBHS_HCINT10_CHHLTD (0x00000002UL) +#define USBHS_HCINT10_AHBERR_POS (2U) +#define USBHS_HCINT10_AHBERR (0x00000004UL) +#define USBHS_HCINT10_STALL_POS (3U) +#define USBHS_HCINT10_STALL (0x00000008UL) +#define USBHS_HCINT10_NAK_POS (4U) +#define USBHS_HCINT10_NAK (0x00000010UL) +#define USBHS_HCINT10_ACK_POS (5U) +#define USBHS_HCINT10_ACK (0x00000020UL) +#define USBHS_HCINT10_NYET_POS (6U) +#define USBHS_HCINT10_NYET (0x00000040UL) +#define USBHS_HCINT10_XACTERR_POS (7U) +#define USBHS_HCINT10_XACTERR (0x00000080UL) +#define USBHS_HCINT10_BBLERR_POS (8U) +#define USBHS_HCINT10_BBLERR (0x00000100UL) +#define USBHS_HCINT10_FRMOVRUN_POS (9U) +#define USBHS_HCINT10_FRMOVRUN (0x00000200UL) +#define USBHS_HCINT10_DATATGLERR_POS (10U) +#define USBHS_HCINT10_DATATGLERR (0x00000400UL) + +/* Bit definition for USBHS_HCINTMSK10 register */ +#define USBHS_HCINTMSK10_XFERCOMPLMSK_POS (0U) +#define USBHS_HCINTMSK10_XFERCOMPLMSK (0x00000001UL) +#define USBHS_HCINTMSK10_CHHLTDMSK_POS (1U) +#define USBHS_HCINTMSK10_CHHLTDMSK (0x00000002UL) +#define USBHS_HCINTMSK10_AHBERRMSK_POS (2U) +#define USBHS_HCINTMSK10_AHBERRMSK (0x00000004UL) +#define USBHS_HCINTMSK10_STALLMSK_POS (3U) +#define USBHS_HCINTMSK10_STALLMSK (0x00000008UL) +#define USBHS_HCINTMSK10_NAKMSK_POS (4U) +#define USBHS_HCINTMSK10_NAKMSK (0x00000010UL) +#define USBHS_HCINTMSK10_ACKMSK_POS (5U) +#define USBHS_HCINTMSK10_ACKMSK (0x00000020UL) +#define USBHS_HCINTMSK10_NYETMSK_POS (6U) +#define USBHS_HCINTMSK10_NYETMSK (0x00000040UL) +#define USBHS_HCINTMSK10_XACTERRMSK_POS (7U) +#define USBHS_HCINTMSK10_XACTERRMSK (0x00000080UL) +#define USBHS_HCINTMSK10_BBLERRMSK_POS (8U) +#define USBHS_HCINTMSK10_BBLERRMSK (0x00000100UL) +#define USBHS_HCINTMSK10_FRMOVRUNMSK_POS (9U) +#define USBHS_HCINTMSK10_FRMOVRUNMSK (0x00000200UL) +#define USBHS_HCINTMSK10_DATATGLERRMSK_POS (10U) +#define USBHS_HCINTMSK10_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBHS_HCTSIZ10 register */ +#define USBHS_HCTSIZ10_XFERSIZE_POS (0U) +#define USBHS_HCTSIZ10_XFERSIZE (0x0007FFFFUL) +#define USBHS_HCTSIZ10_XFERSIZE_0 (0x00000001UL) +#define USBHS_HCTSIZ10_XFERSIZE_1 (0x00000002UL) +#define USBHS_HCTSIZ10_XFERSIZE_2 (0x00000004UL) +#define USBHS_HCTSIZ10_XFERSIZE_3 (0x00000008UL) +#define USBHS_HCTSIZ10_XFERSIZE_4 (0x00000010UL) +#define USBHS_HCTSIZ10_XFERSIZE_5 (0x00000020UL) +#define USBHS_HCTSIZ10_XFERSIZE_6 (0x00000040UL) +#define USBHS_HCTSIZ10_XFERSIZE_7 (0x00000080UL) +#define USBHS_HCTSIZ10_XFERSIZE_8 (0x00000100UL) +#define USBHS_HCTSIZ10_XFERSIZE_9 (0x00000200UL) +#define USBHS_HCTSIZ10_XFERSIZE_10 (0x00000400UL) +#define USBHS_HCTSIZ10_XFERSIZE_11 (0x00000800UL) +#define USBHS_HCTSIZ10_XFERSIZE_12 (0x00001000UL) +#define USBHS_HCTSIZ10_XFERSIZE_13 (0x00002000UL) +#define USBHS_HCTSIZ10_XFERSIZE_14 (0x00004000UL) +#define USBHS_HCTSIZ10_XFERSIZE_15 (0x00008000UL) +#define USBHS_HCTSIZ10_XFERSIZE_16 (0x00010000UL) +#define USBHS_HCTSIZ10_XFERSIZE_17 (0x00020000UL) +#define USBHS_HCTSIZ10_XFERSIZE_18 (0x00040000UL) +#define USBHS_HCTSIZ10_PKTCNT_POS (19U) +#define USBHS_HCTSIZ10_PKTCNT (0x1FF80000UL) +#define USBHS_HCTSIZ10_PKTCNT_0 (0x00080000UL) +#define USBHS_HCTSIZ10_PKTCNT_1 (0x00100000UL) +#define USBHS_HCTSIZ10_PKTCNT_2 (0x00200000UL) +#define USBHS_HCTSIZ10_PKTCNT_3 (0x00400000UL) +#define USBHS_HCTSIZ10_PKTCNT_4 (0x00800000UL) +#define USBHS_HCTSIZ10_PKTCNT_5 (0x01000000UL) +#define USBHS_HCTSIZ10_PKTCNT_6 (0x02000000UL) +#define USBHS_HCTSIZ10_PKTCNT_7 (0x04000000UL) +#define USBHS_HCTSIZ10_PKTCNT_8 (0x08000000UL) +#define USBHS_HCTSIZ10_PKTCNT_9 (0x10000000UL) +#define USBHS_HCTSIZ10_PID_POS (29U) +#define USBHS_HCTSIZ10_PID (0x60000000UL) +#define USBHS_HCTSIZ10_PID_0 (0x20000000UL) +#define USBHS_HCTSIZ10_PID_1 (0x40000000UL) +#define USBHS_HCTSIZ10_DOPNG_POS (31U) +#define USBHS_HCTSIZ10_DOPNG (0x80000000UL) + +/* Bit definition for USBHS_HCDMA10 register */ +#define USBHS_HCDMA10 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_HCCHAR11 register */ +#define USBHS_HCCHAR11_MPS_POS (0U) +#define USBHS_HCCHAR11_MPS (0x000007FFUL) +#define USBHS_HCCHAR11_MPS_0 (0x00000001UL) +#define USBHS_HCCHAR11_MPS_1 (0x00000002UL) +#define USBHS_HCCHAR11_MPS_2 (0x00000004UL) +#define USBHS_HCCHAR11_MPS_3 (0x00000008UL) +#define USBHS_HCCHAR11_MPS_4 (0x00000010UL) +#define USBHS_HCCHAR11_MPS_5 (0x00000020UL) +#define USBHS_HCCHAR11_MPS_6 (0x00000040UL) +#define USBHS_HCCHAR11_MPS_7 (0x00000080UL) +#define USBHS_HCCHAR11_MPS_8 (0x00000100UL) +#define USBHS_HCCHAR11_MPS_9 (0x00000200UL) +#define USBHS_HCCHAR11_MPS_10 (0x00000400UL) +#define USBHS_HCCHAR11_EPNUM_POS (11U) +#define USBHS_HCCHAR11_EPNUM (0x00007800UL) +#define USBHS_HCCHAR11_EPNUM_0 (0x00000800UL) +#define USBHS_HCCHAR11_EPNUM_1 (0x00001000UL) +#define USBHS_HCCHAR11_EPNUM_2 (0x00002000UL) +#define USBHS_HCCHAR11_EPNUM_3 (0x00004000UL) +#define USBHS_HCCHAR11_EPDIR_POS (15U) +#define USBHS_HCCHAR11_EPDIR (0x00008000UL) +#define USBHS_HCCHAR11_LSPDDEV_POS (17U) +#define USBHS_HCCHAR11_LSPDDEV (0x00020000UL) +#define USBHS_HCCHAR11_EPTYPE_POS (18U) +#define USBHS_HCCHAR11_EPTYPE (0x000C0000UL) +#define USBHS_HCCHAR11_EPTYPE_0 (0x00040000UL) +#define USBHS_HCCHAR11_EPTYPE_1 (0x00080000UL) +#define USBHS_HCCHAR11_EC_POS (20U) +#define USBHS_HCCHAR11_EC (0x00300000UL) +#define USBHS_HCCHAR11_EC_0 (0x00100000UL) +#define USBHS_HCCHAR11_EC_1 (0x00200000UL) +#define USBHS_HCCHAR11_DEVADDR_POS (22U) +#define USBHS_HCCHAR11_DEVADDR (0x1FC00000UL) +#define USBHS_HCCHAR11_DEVADDR_0 (0x00400000UL) +#define USBHS_HCCHAR11_DEVADDR_1 (0x00800000UL) +#define USBHS_HCCHAR11_DEVADDR_2 (0x01000000UL) +#define USBHS_HCCHAR11_DEVADDR_3 (0x02000000UL) +#define USBHS_HCCHAR11_DEVADDR_4 (0x04000000UL) +#define USBHS_HCCHAR11_DEVADDR_5 (0x08000000UL) +#define USBHS_HCCHAR11_DEVADDR_6 (0x10000000UL) +#define USBHS_HCCHAR11_ODDFRM_POS (29U) +#define USBHS_HCCHAR11_ODDFRM (0x20000000UL) +#define USBHS_HCCHAR11_CHDIS_POS (30U) +#define USBHS_HCCHAR11_CHDIS (0x40000000UL) +#define USBHS_HCCHAR11_CHENA_POS (31U) +#define USBHS_HCCHAR11_CHENA (0x80000000UL) + +/* Bit definition for USBHS_HCSPLT11 register */ +#define USBHS_HCSPLT11_PRTADDR_POS (0U) +#define USBHS_HCSPLT11_PRTADDR (0x0000007FUL) +#define USBHS_HCSPLT11_PRTADDR_0 (0x00000001UL) +#define USBHS_HCSPLT11_PRTADDR_1 (0x00000002UL) +#define USBHS_HCSPLT11_PRTADDR_2 (0x00000004UL) +#define USBHS_HCSPLT11_PRTADDR_3 (0x00000008UL) +#define USBHS_HCSPLT11_PRTADDR_4 (0x00000010UL) +#define USBHS_HCSPLT11_PRTADDR_5 (0x00000020UL) +#define USBHS_HCSPLT11_PRTADDR_6 (0x00000040UL) +#define USBHS_HCSPLT11_HUBADDR_POS (7U) +#define USBHS_HCSPLT11_HUBADDR (0x00003F80UL) +#define USBHS_HCSPLT11_HUBADDR_0 (0x00000080UL) +#define USBHS_HCSPLT11_HUBADDR_1 (0x00000100UL) +#define USBHS_HCSPLT11_HUBADDR_2 (0x00000200UL) +#define USBHS_HCSPLT11_HUBADDR_3 (0x00000400UL) +#define USBHS_HCSPLT11_HUBADDR_4 (0x00000800UL) +#define USBHS_HCSPLT11_HUBADDR_5 (0x00001000UL) +#define USBHS_HCSPLT11_HUBADDR_6 (0x00002000UL) +#define USBHS_HCSPLT11_XACTPOS_POS (14U) +#define USBHS_HCSPLT11_XACTPOS (0x0000C000UL) +#define USBHS_HCSPLT11_XACTPOS_0 (0x00004000UL) +#define USBHS_HCSPLT11_XACTPOS_1 (0x00008000UL) +#define USBHS_HCSPLT11_COMPSPLT_POS (16U) +#define USBHS_HCSPLT11_COMPSPLT (0x00010000UL) +#define USBHS_HCSPLT11_SPLTENA_POS (31U) +#define USBHS_HCSPLT11_SPLTENA (0x80000000UL) + +/* Bit definition for USBHS_HCINT11 register */ +#define USBHS_HCINT11_XFERCOMPL_POS (0U) +#define USBHS_HCINT11_XFERCOMPL (0x00000001UL) +#define USBHS_HCINT11_CHHLTD_POS (1U) +#define USBHS_HCINT11_CHHLTD (0x00000002UL) +#define USBHS_HCINT11_AHBERR_POS (2U) +#define USBHS_HCINT11_AHBERR (0x00000004UL) +#define USBHS_HCINT11_STALL_POS (3U) +#define USBHS_HCINT11_STALL (0x00000008UL) +#define USBHS_HCINT11_NAK_POS (4U) +#define USBHS_HCINT11_NAK (0x00000010UL) +#define USBHS_HCINT11_ACK_POS (5U) +#define USBHS_HCINT11_ACK (0x00000020UL) +#define USBHS_HCINT11_NYET_POS (6U) +#define USBHS_HCINT11_NYET (0x00000040UL) +#define USBHS_HCINT11_XACTERR_POS (7U) +#define USBHS_HCINT11_XACTERR (0x00000080UL) +#define USBHS_HCINT11_BBLERR_POS (8U) +#define USBHS_HCINT11_BBLERR (0x00000100UL) +#define USBHS_HCINT11_FRMOVRUN_POS (9U) +#define USBHS_HCINT11_FRMOVRUN (0x00000200UL) +#define USBHS_HCINT11_DATATGLERR_POS (10U) +#define USBHS_HCINT11_DATATGLERR (0x00000400UL) + +/* Bit definition for USBHS_HCINTMSK11 register */ +#define USBHS_HCINTMSK11_XFERCOMPLMSK_POS (0U) +#define USBHS_HCINTMSK11_XFERCOMPLMSK (0x00000001UL) +#define USBHS_HCINTMSK11_CHHLTDMSK_POS (1U) +#define USBHS_HCINTMSK11_CHHLTDMSK (0x00000002UL) +#define USBHS_HCINTMSK11_AHBERRMSK_POS (2U) +#define USBHS_HCINTMSK11_AHBERRMSK (0x00000004UL) +#define USBHS_HCINTMSK11_STALLMSK_POS (3U) +#define USBHS_HCINTMSK11_STALLMSK (0x00000008UL) +#define USBHS_HCINTMSK11_NAKMSK_POS (4U) +#define USBHS_HCINTMSK11_NAKMSK (0x00000010UL) +#define USBHS_HCINTMSK11_ACKMSK_POS (5U) +#define USBHS_HCINTMSK11_ACKMSK (0x00000020UL) +#define USBHS_HCINTMSK11_NYETMSK_POS (6U) +#define USBHS_HCINTMSK11_NYETMSK (0x00000040UL) +#define USBHS_HCINTMSK11_XACTERRMSK_POS (7U) +#define USBHS_HCINTMSK11_XACTERRMSK (0x00000080UL) +#define USBHS_HCINTMSK11_BBLERRMSK_POS (8U) +#define USBHS_HCINTMSK11_BBLERRMSK (0x00000100UL) +#define USBHS_HCINTMSK11_FRMOVRUNMSK_POS (9U) +#define USBHS_HCINTMSK11_FRMOVRUNMSK (0x00000200UL) +#define USBHS_HCINTMSK11_DATATGLERRMSK_POS (10U) +#define USBHS_HCINTMSK11_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBHS_HCTSIZ11 register */ +#define USBHS_HCTSIZ11_XFERSIZE_POS (0U) +#define USBHS_HCTSIZ11_XFERSIZE (0x0007FFFFUL) +#define USBHS_HCTSIZ11_XFERSIZE_0 (0x00000001UL) +#define USBHS_HCTSIZ11_XFERSIZE_1 (0x00000002UL) +#define USBHS_HCTSIZ11_XFERSIZE_2 (0x00000004UL) +#define USBHS_HCTSIZ11_XFERSIZE_3 (0x00000008UL) +#define USBHS_HCTSIZ11_XFERSIZE_4 (0x00000010UL) +#define USBHS_HCTSIZ11_XFERSIZE_5 (0x00000020UL) +#define USBHS_HCTSIZ11_XFERSIZE_6 (0x00000040UL) +#define USBHS_HCTSIZ11_XFERSIZE_7 (0x00000080UL) +#define USBHS_HCTSIZ11_XFERSIZE_8 (0x00000100UL) +#define USBHS_HCTSIZ11_XFERSIZE_9 (0x00000200UL) +#define USBHS_HCTSIZ11_XFERSIZE_10 (0x00000400UL) +#define USBHS_HCTSIZ11_XFERSIZE_11 (0x00000800UL) +#define USBHS_HCTSIZ11_XFERSIZE_12 (0x00001000UL) +#define USBHS_HCTSIZ11_XFERSIZE_13 (0x00002000UL) +#define USBHS_HCTSIZ11_XFERSIZE_14 (0x00004000UL) +#define USBHS_HCTSIZ11_XFERSIZE_15 (0x00008000UL) +#define USBHS_HCTSIZ11_XFERSIZE_16 (0x00010000UL) +#define USBHS_HCTSIZ11_XFERSIZE_17 (0x00020000UL) +#define USBHS_HCTSIZ11_XFERSIZE_18 (0x00040000UL) +#define USBHS_HCTSIZ11_PKTCNT_POS (19U) +#define USBHS_HCTSIZ11_PKTCNT (0x1FF80000UL) +#define USBHS_HCTSIZ11_PKTCNT_0 (0x00080000UL) +#define USBHS_HCTSIZ11_PKTCNT_1 (0x00100000UL) +#define USBHS_HCTSIZ11_PKTCNT_2 (0x00200000UL) +#define USBHS_HCTSIZ11_PKTCNT_3 (0x00400000UL) +#define USBHS_HCTSIZ11_PKTCNT_4 (0x00800000UL) +#define USBHS_HCTSIZ11_PKTCNT_5 (0x01000000UL) +#define USBHS_HCTSIZ11_PKTCNT_6 (0x02000000UL) +#define USBHS_HCTSIZ11_PKTCNT_7 (0x04000000UL) +#define USBHS_HCTSIZ11_PKTCNT_8 (0x08000000UL) +#define USBHS_HCTSIZ11_PKTCNT_9 (0x10000000UL) +#define USBHS_HCTSIZ11_PID_POS (29U) +#define USBHS_HCTSIZ11_PID (0x60000000UL) +#define USBHS_HCTSIZ11_PID_0 (0x20000000UL) +#define USBHS_HCTSIZ11_PID_1 (0x40000000UL) +#define USBHS_HCTSIZ11_DOPNG_POS (31U) +#define USBHS_HCTSIZ11_DOPNG (0x80000000UL) + +/* Bit definition for USBHS_HCDMA11 register */ +#define USBHS_HCDMA11 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_HCCHAR12 register */ +#define USBHS_HCCHAR12_MPS_POS (0U) +#define USBHS_HCCHAR12_MPS (0x000007FFUL) +#define USBHS_HCCHAR12_MPS_0 (0x00000001UL) +#define USBHS_HCCHAR12_MPS_1 (0x00000002UL) +#define USBHS_HCCHAR12_MPS_2 (0x00000004UL) +#define USBHS_HCCHAR12_MPS_3 (0x00000008UL) +#define USBHS_HCCHAR12_MPS_4 (0x00000010UL) +#define USBHS_HCCHAR12_MPS_5 (0x00000020UL) +#define USBHS_HCCHAR12_MPS_6 (0x00000040UL) +#define USBHS_HCCHAR12_MPS_7 (0x00000080UL) +#define USBHS_HCCHAR12_MPS_8 (0x00000100UL) +#define USBHS_HCCHAR12_MPS_9 (0x00000200UL) +#define USBHS_HCCHAR12_MPS_10 (0x00000400UL) +#define USBHS_HCCHAR12_EPNUM_POS (11U) +#define USBHS_HCCHAR12_EPNUM (0x00007800UL) +#define USBHS_HCCHAR12_EPNUM_0 (0x00000800UL) +#define USBHS_HCCHAR12_EPNUM_1 (0x00001000UL) +#define USBHS_HCCHAR12_EPNUM_2 (0x00002000UL) +#define USBHS_HCCHAR12_EPNUM_3 (0x00004000UL) +#define USBHS_HCCHAR12_EPDIR_POS (15U) +#define USBHS_HCCHAR12_EPDIR (0x00008000UL) +#define USBHS_HCCHAR12_LSPDDEV_POS (17U) +#define USBHS_HCCHAR12_LSPDDEV (0x00020000UL) +#define USBHS_HCCHAR12_EPTYPE_POS (18U) +#define USBHS_HCCHAR12_EPTYPE (0x000C0000UL) +#define USBHS_HCCHAR12_EPTYPE_0 (0x00040000UL) +#define USBHS_HCCHAR12_EPTYPE_1 (0x00080000UL) +#define USBHS_HCCHAR12_EC_POS (20U) +#define USBHS_HCCHAR12_EC (0x00300000UL) +#define USBHS_HCCHAR12_EC_0 (0x00100000UL) +#define USBHS_HCCHAR12_EC_1 (0x00200000UL) +#define USBHS_HCCHAR12_DEVADDR_POS (22U) +#define USBHS_HCCHAR12_DEVADDR (0x1FC00000UL) +#define USBHS_HCCHAR12_DEVADDR_0 (0x00400000UL) +#define USBHS_HCCHAR12_DEVADDR_1 (0x00800000UL) +#define USBHS_HCCHAR12_DEVADDR_2 (0x01000000UL) +#define USBHS_HCCHAR12_DEVADDR_3 (0x02000000UL) +#define USBHS_HCCHAR12_DEVADDR_4 (0x04000000UL) +#define USBHS_HCCHAR12_DEVADDR_5 (0x08000000UL) +#define USBHS_HCCHAR12_DEVADDR_6 (0x10000000UL) +#define USBHS_HCCHAR12_ODDFRM_POS (29U) +#define USBHS_HCCHAR12_ODDFRM (0x20000000UL) +#define USBHS_HCCHAR12_CHDIS_POS (30U) +#define USBHS_HCCHAR12_CHDIS (0x40000000UL) +#define USBHS_HCCHAR12_CHENA_POS (31U) +#define USBHS_HCCHAR12_CHENA (0x80000000UL) + +/* Bit definition for USBHS_HCSPLT12 register */ +#define USBHS_HCSPLT12_PRTADDR_POS (0U) +#define USBHS_HCSPLT12_PRTADDR (0x0000007FUL) +#define USBHS_HCSPLT12_PRTADDR_0 (0x00000001UL) +#define USBHS_HCSPLT12_PRTADDR_1 (0x00000002UL) +#define USBHS_HCSPLT12_PRTADDR_2 (0x00000004UL) +#define USBHS_HCSPLT12_PRTADDR_3 (0x00000008UL) +#define USBHS_HCSPLT12_PRTADDR_4 (0x00000010UL) +#define USBHS_HCSPLT12_PRTADDR_5 (0x00000020UL) +#define USBHS_HCSPLT12_PRTADDR_6 (0x00000040UL) +#define USBHS_HCSPLT12_HUBADDR_POS (7U) +#define USBHS_HCSPLT12_HUBADDR (0x00003F80UL) +#define USBHS_HCSPLT12_HUBADDR_0 (0x00000080UL) +#define USBHS_HCSPLT12_HUBADDR_1 (0x00000100UL) +#define USBHS_HCSPLT12_HUBADDR_2 (0x00000200UL) +#define USBHS_HCSPLT12_HUBADDR_3 (0x00000400UL) +#define USBHS_HCSPLT12_HUBADDR_4 (0x00000800UL) +#define USBHS_HCSPLT12_HUBADDR_5 (0x00001000UL) +#define USBHS_HCSPLT12_HUBADDR_6 (0x00002000UL) +#define USBHS_HCSPLT12_XACTPOS_POS (14U) +#define USBHS_HCSPLT12_XACTPOS (0x0000C000UL) +#define USBHS_HCSPLT12_XACTPOS_0 (0x00004000UL) +#define USBHS_HCSPLT12_XACTPOS_1 (0x00008000UL) +#define USBHS_HCSPLT12_COMPSPLT_POS (16U) +#define USBHS_HCSPLT12_COMPSPLT (0x00010000UL) +#define USBHS_HCSPLT12_SPLTENA_POS (31U) +#define USBHS_HCSPLT12_SPLTENA (0x80000000UL) + +/* Bit definition for USBHS_HCINT12 register */ +#define USBHS_HCINT12_XFERCOMPL_POS (0U) +#define USBHS_HCINT12_XFERCOMPL (0x00000001UL) +#define USBHS_HCINT12_CHHLTD_POS (1U) +#define USBHS_HCINT12_CHHLTD (0x00000002UL) +#define USBHS_HCINT12_AHBERR_POS (2U) +#define USBHS_HCINT12_AHBERR (0x00000004UL) +#define USBHS_HCINT12_STALL_POS (3U) +#define USBHS_HCINT12_STALL (0x00000008UL) +#define USBHS_HCINT12_NAK_POS (4U) +#define USBHS_HCINT12_NAK (0x00000010UL) +#define USBHS_HCINT12_ACK_POS (5U) +#define USBHS_HCINT12_ACK (0x00000020UL) +#define USBHS_HCINT12_NYET_POS (6U) +#define USBHS_HCINT12_NYET (0x00000040UL) +#define USBHS_HCINT12_XACTERR_POS (7U) +#define USBHS_HCINT12_XACTERR (0x00000080UL) +#define USBHS_HCINT12_BBLERR_POS (8U) +#define USBHS_HCINT12_BBLERR (0x00000100UL) +#define USBHS_HCINT12_FRMOVRUN_POS (9U) +#define USBHS_HCINT12_FRMOVRUN (0x00000200UL) +#define USBHS_HCINT12_DATATGLERR_POS (10U) +#define USBHS_HCINT12_DATATGLERR (0x00000400UL) + +/* Bit definition for USBHS_HCINTMSK12 register */ +#define USBHS_HCINTMSK12_XFERCOMPLMSK_POS (0U) +#define USBHS_HCINTMSK12_XFERCOMPLMSK (0x00000001UL) +#define USBHS_HCINTMSK12_CHHLTDMSK_POS (1U) +#define USBHS_HCINTMSK12_CHHLTDMSK (0x00000002UL) +#define USBHS_HCINTMSK12_AHBERRMSK_POS (2U) +#define USBHS_HCINTMSK12_AHBERRMSK (0x00000004UL) +#define USBHS_HCINTMSK12_STALLMSK_POS (3U) +#define USBHS_HCINTMSK12_STALLMSK (0x00000008UL) +#define USBHS_HCINTMSK12_NAKMSK_POS (4U) +#define USBHS_HCINTMSK12_NAKMSK (0x00000010UL) +#define USBHS_HCINTMSK12_ACKMSK_POS (5U) +#define USBHS_HCINTMSK12_ACKMSK (0x00000020UL) +#define USBHS_HCINTMSK12_NYETMSK_POS (6U) +#define USBHS_HCINTMSK12_NYETMSK (0x00000040UL) +#define USBHS_HCINTMSK12_XACTERRMSK_POS (7U) +#define USBHS_HCINTMSK12_XACTERRMSK (0x00000080UL) +#define USBHS_HCINTMSK12_BBLERRMSK_POS (8U) +#define USBHS_HCINTMSK12_BBLERRMSK (0x00000100UL) +#define USBHS_HCINTMSK12_FRMOVRUNMSK_POS (9U) +#define USBHS_HCINTMSK12_FRMOVRUNMSK (0x00000200UL) +#define USBHS_HCINTMSK12_DATATGLERRMSK_POS (10U) +#define USBHS_HCINTMSK12_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBHS_HCTSIZ12 register */ +#define USBHS_HCTSIZ12_XFERSIZE_POS (0U) +#define USBHS_HCTSIZ12_XFERSIZE (0x0007FFFFUL) +#define USBHS_HCTSIZ12_XFERSIZE_0 (0x00000001UL) +#define USBHS_HCTSIZ12_XFERSIZE_1 (0x00000002UL) +#define USBHS_HCTSIZ12_XFERSIZE_2 (0x00000004UL) +#define USBHS_HCTSIZ12_XFERSIZE_3 (0x00000008UL) +#define USBHS_HCTSIZ12_XFERSIZE_4 (0x00000010UL) +#define USBHS_HCTSIZ12_XFERSIZE_5 (0x00000020UL) +#define USBHS_HCTSIZ12_XFERSIZE_6 (0x00000040UL) +#define USBHS_HCTSIZ12_XFERSIZE_7 (0x00000080UL) +#define USBHS_HCTSIZ12_XFERSIZE_8 (0x00000100UL) +#define USBHS_HCTSIZ12_XFERSIZE_9 (0x00000200UL) +#define USBHS_HCTSIZ12_XFERSIZE_10 (0x00000400UL) +#define USBHS_HCTSIZ12_XFERSIZE_11 (0x00000800UL) +#define USBHS_HCTSIZ12_XFERSIZE_12 (0x00001000UL) +#define USBHS_HCTSIZ12_XFERSIZE_13 (0x00002000UL) +#define USBHS_HCTSIZ12_XFERSIZE_14 (0x00004000UL) +#define USBHS_HCTSIZ12_XFERSIZE_15 (0x00008000UL) +#define USBHS_HCTSIZ12_XFERSIZE_16 (0x00010000UL) +#define USBHS_HCTSIZ12_XFERSIZE_17 (0x00020000UL) +#define USBHS_HCTSIZ12_XFERSIZE_18 (0x00040000UL) +#define USBHS_HCTSIZ12_PKTCNT_POS (19U) +#define USBHS_HCTSIZ12_PKTCNT (0x1FF80000UL) +#define USBHS_HCTSIZ12_PKTCNT_0 (0x00080000UL) +#define USBHS_HCTSIZ12_PKTCNT_1 (0x00100000UL) +#define USBHS_HCTSIZ12_PKTCNT_2 (0x00200000UL) +#define USBHS_HCTSIZ12_PKTCNT_3 (0x00400000UL) +#define USBHS_HCTSIZ12_PKTCNT_4 (0x00800000UL) +#define USBHS_HCTSIZ12_PKTCNT_5 (0x01000000UL) +#define USBHS_HCTSIZ12_PKTCNT_6 (0x02000000UL) +#define USBHS_HCTSIZ12_PKTCNT_7 (0x04000000UL) +#define USBHS_HCTSIZ12_PKTCNT_8 (0x08000000UL) +#define USBHS_HCTSIZ12_PKTCNT_9 (0x10000000UL) +#define USBHS_HCTSIZ12_PID_POS (29U) +#define USBHS_HCTSIZ12_PID (0x60000000UL) +#define USBHS_HCTSIZ12_PID_0 (0x20000000UL) +#define USBHS_HCTSIZ12_PID_1 (0x40000000UL) +#define USBHS_HCTSIZ12_DOPNG_POS (31U) +#define USBHS_HCTSIZ12_DOPNG (0x80000000UL) + +/* Bit definition for USBHS_HCDMA12 register */ +#define USBHS_HCDMA12 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_HCCHAR13 register */ +#define USBHS_HCCHAR13_MPS_POS (0U) +#define USBHS_HCCHAR13_MPS (0x000007FFUL) +#define USBHS_HCCHAR13_MPS_0 (0x00000001UL) +#define USBHS_HCCHAR13_MPS_1 (0x00000002UL) +#define USBHS_HCCHAR13_MPS_2 (0x00000004UL) +#define USBHS_HCCHAR13_MPS_3 (0x00000008UL) +#define USBHS_HCCHAR13_MPS_4 (0x00000010UL) +#define USBHS_HCCHAR13_MPS_5 (0x00000020UL) +#define USBHS_HCCHAR13_MPS_6 (0x00000040UL) +#define USBHS_HCCHAR13_MPS_7 (0x00000080UL) +#define USBHS_HCCHAR13_MPS_8 (0x00000100UL) +#define USBHS_HCCHAR13_MPS_9 (0x00000200UL) +#define USBHS_HCCHAR13_MPS_10 (0x00000400UL) +#define USBHS_HCCHAR13_EPNUM_POS (11U) +#define USBHS_HCCHAR13_EPNUM (0x00007800UL) +#define USBHS_HCCHAR13_EPNUM_0 (0x00000800UL) +#define USBHS_HCCHAR13_EPNUM_1 (0x00001000UL) +#define USBHS_HCCHAR13_EPNUM_2 (0x00002000UL) +#define USBHS_HCCHAR13_EPNUM_3 (0x00004000UL) +#define USBHS_HCCHAR13_EPDIR_POS (15U) +#define USBHS_HCCHAR13_EPDIR (0x00008000UL) +#define USBHS_HCCHAR13_LSPDDEV_POS (17U) +#define USBHS_HCCHAR13_LSPDDEV (0x00020000UL) +#define USBHS_HCCHAR13_EPTYPE_POS (18U) +#define USBHS_HCCHAR13_EPTYPE (0x000C0000UL) +#define USBHS_HCCHAR13_EPTYPE_0 (0x00040000UL) +#define USBHS_HCCHAR13_EPTYPE_1 (0x00080000UL) +#define USBHS_HCCHAR13_EC_POS (20U) +#define USBHS_HCCHAR13_EC (0x00300000UL) +#define USBHS_HCCHAR13_EC_0 (0x00100000UL) +#define USBHS_HCCHAR13_EC_1 (0x00200000UL) +#define USBHS_HCCHAR13_DEVADDR_POS (22U) +#define USBHS_HCCHAR13_DEVADDR (0x1FC00000UL) +#define USBHS_HCCHAR13_DEVADDR_0 (0x00400000UL) +#define USBHS_HCCHAR13_DEVADDR_1 (0x00800000UL) +#define USBHS_HCCHAR13_DEVADDR_2 (0x01000000UL) +#define USBHS_HCCHAR13_DEVADDR_3 (0x02000000UL) +#define USBHS_HCCHAR13_DEVADDR_4 (0x04000000UL) +#define USBHS_HCCHAR13_DEVADDR_5 (0x08000000UL) +#define USBHS_HCCHAR13_DEVADDR_6 (0x10000000UL) +#define USBHS_HCCHAR13_ODDFRM_POS (29U) +#define USBHS_HCCHAR13_ODDFRM (0x20000000UL) +#define USBHS_HCCHAR13_CHDIS_POS (30U) +#define USBHS_HCCHAR13_CHDIS (0x40000000UL) +#define USBHS_HCCHAR13_CHENA_POS (31U) +#define USBHS_HCCHAR13_CHENA (0x80000000UL) + +/* Bit definition for USBHS_HCSPLT13 register */ +#define USBHS_HCSPLT13_PRTADDR_POS (0U) +#define USBHS_HCSPLT13_PRTADDR (0x0000007FUL) +#define USBHS_HCSPLT13_PRTADDR_0 (0x00000001UL) +#define USBHS_HCSPLT13_PRTADDR_1 (0x00000002UL) +#define USBHS_HCSPLT13_PRTADDR_2 (0x00000004UL) +#define USBHS_HCSPLT13_PRTADDR_3 (0x00000008UL) +#define USBHS_HCSPLT13_PRTADDR_4 (0x00000010UL) +#define USBHS_HCSPLT13_PRTADDR_5 (0x00000020UL) +#define USBHS_HCSPLT13_PRTADDR_6 (0x00000040UL) +#define USBHS_HCSPLT13_HUBADDR_POS (7U) +#define USBHS_HCSPLT13_HUBADDR (0x00003F80UL) +#define USBHS_HCSPLT13_HUBADDR_0 (0x00000080UL) +#define USBHS_HCSPLT13_HUBADDR_1 (0x00000100UL) +#define USBHS_HCSPLT13_HUBADDR_2 (0x00000200UL) +#define USBHS_HCSPLT13_HUBADDR_3 (0x00000400UL) +#define USBHS_HCSPLT13_HUBADDR_4 (0x00000800UL) +#define USBHS_HCSPLT13_HUBADDR_5 (0x00001000UL) +#define USBHS_HCSPLT13_HUBADDR_6 (0x00002000UL) +#define USBHS_HCSPLT13_XACTPOS_POS (14U) +#define USBHS_HCSPLT13_XACTPOS (0x0000C000UL) +#define USBHS_HCSPLT13_XACTPOS_0 (0x00004000UL) +#define USBHS_HCSPLT13_XACTPOS_1 (0x00008000UL) +#define USBHS_HCSPLT13_COMPSPLT_POS (16U) +#define USBHS_HCSPLT13_COMPSPLT (0x00010000UL) +#define USBHS_HCSPLT13_SPLTENA_POS (31U) +#define USBHS_HCSPLT13_SPLTENA (0x80000000UL) + +/* Bit definition for USBHS_HCINT13 register */ +#define USBHS_HCINT13_XFERCOMPL_POS (0U) +#define USBHS_HCINT13_XFERCOMPL (0x00000001UL) +#define USBHS_HCINT13_CHHLTD_POS (1U) +#define USBHS_HCINT13_CHHLTD (0x00000002UL) +#define USBHS_HCINT13_AHBERR_POS (2U) +#define USBHS_HCINT13_AHBERR (0x00000004UL) +#define USBHS_HCINT13_STALL_POS (3U) +#define USBHS_HCINT13_STALL (0x00000008UL) +#define USBHS_HCINT13_NAK_POS (4U) +#define USBHS_HCINT13_NAK (0x00000010UL) +#define USBHS_HCINT13_ACK_POS (5U) +#define USBHS_HCINT13_ACK (0x00000020UL) +#define USBHS_HCINT13_NYET_POS (6U) +#define USBHS_HCINT13_NYET (0x00000040UL) +#define USBHS_HCINT13_XACTERR_POS (7U) +#define USBHS_HCINT13_XACTERR (0x00000080UL) +#define USBHS_HCINT13_BBLERR_POS (8U) +#define USBHS_HCINT13_BBLERR (0x00000100UL) +#define USBHS_HCINT13_FRMOVRUN_POS (9U) +#define USBHS_HCINT13_FRMOVRUN (0x00000200UL) +#define USBHS_HCINT13_DATATGLERR_POS (10U) +#define USBHS_HCINT13_DATATGLERR (0x00000400UL) + +/* Bit definition for USBHS_HCINTMSK13 register */ +#define USBHS_HCINTMSK13_XFERCOMPLMSK_POS (0U) +#define USBHS_HCINTMSK13_XFERCOMPLMSK (0x00000001UL) +#define USBHS_HCINTMSK13_CHHLTDMSK_POS (1U) +#define USBHS_HCINTMSK13_CHHLTDMSK (0x00000002UL) +#define USBHS_HCINTMSK13_AHBERRMSK_POS (2U) +#define USBHS_HCINTMSK13_AHBERRMSK (0x00000004UL) +#define USBHS_HCINTMSK13_STALLMSK_POS (3U) +#define USBHS_HCINTMSK13_STALLMSK (0x00000008UL) +#define USBHS_HCINTMSK13_NAKMSK_POS (4U) +#define USBHS_HCINTMSK13_NAKMSK (0x00000010UL) +#define USBHS_HCINTMSK13_ACKMSK_POS (5U) +#define USBHS_HCINTMSK13_ACKMSK (0x00000020UL) +#define USBHS_HCINTMSK13_NYETMSK_POS (6U) +#define USBHS_HCINTMSK13_NYETMSK (0x00000040UL) +#define USBHS_HCINTMSK13_XACTERRMSK_POS (7U) +#define USBHS_HCINTMSK13_XACTERRMSK (0x00000080UL) +#define USBHS_HCINTMSK13_BBLERRMSK_POS (8U) +#define USBHS_HCINTMSK13_BBLERRMSK (0x00000100UL) +#define USBHS_HCINTMSK13_FRMOVRUNMSK_POS (9U) +#define USBHS_HCINTMSK13_FRMOVRUNMSK (0x00000200UL) +#define USBHS_HCINTMSK13_DATATGLERRMSK_POS (10U) +#define USBHS_HCINTMSK13_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBHS_HCTSIZ13 register */ +#define USBHS_HCTSIZ13_XFERSIZE_POS (0U) +#define USBHS_HCTSIZ13_XFERSIZE (0x0007FFFFUL) +#define USBHS_HCTSIZ13_XFERSIZE_0 (0x00000001UL) +#define USBHS_HCTSIZ13_XFERSIZE_1 (0x00000002UL) +#define USBHS_HCTSIZ13_XFERSIZE_2 (0x00000004UL) +#define USBHS_HCTSIZ13_XFERSIZE_3 (0x00000008UL) +#define USBHS_HCTSIZ13_XFERSIZE_4 (0x00000010UL) +#define USBHS_HCTSIZ13_XFERSIZE_5 (0x00000020UL) +#define USBHS_HCTSIZ13_XFERSIZE_6 (0x00000040UL) +#define USBHS_HCTSIZ13_XFERSIZE_7 (0x00000080UL) +#define USBHS_HCTSIZ13_XFERSIZE_8 (0x00000100UL) +#define USBHS_HCTSIZ13_XFERSIZE_9 (0x00000200UL) +#define USBHS_HCTSIZ13_XFERSIZE_10 (0x00000400UL) +#define USBHS_HCTSIZ13_XFERSIZE_11 (0x00000800UL) +#define USBHS_HCTSIZ13_XFERSIZE_12 (0x00001000UL) +#define USBHS_HCTSIZ13_XFERSIZE_13 (0x00002000UL) +#define USBHS_HCTSIZ13_XFERSIZE_14 (0x00004000UL) +#define USBHS_HCTSIZ13_XFERSIZE_15 (0x00008000UL) +#define USBHS_HCTSIZ13_XFERSIZE_16 (0x00010000UL) +#define USBHS_HCTSIZ13_XFERSIZE_17 (0x00020000UL) +#define USBHS_HCTSIZ13_XFERSIZE_18 (0x00040000UL) +#define USBHS_HCTSIZ13_PKTCNT_POS (19U) +#define USBHS_HCTSIZ13_PKTCNT (0x1FF80000UL) +#define USBHS_HCTSIZ13_PKTCNT_0 (0x00080000UL) +#define USBHS_HCTSIZ13_PKTCNT_1 (0x00100000UL) +#define USBHS_HCTSIZ13_PKTCNT_2 (0x00200000UL) +#define USBHS_HCTSIZ13_PKTCNT_3 (0x00400000UL) +#define USBHS_HCTSIZ13_PKTCNT_4 (0x00800000UL) +#define USBHS_HCTSIZ13_PKTCNT_5 (0x01000000UL) +#define USBHS_HCTSIZ13_PKTCNT_6 (0x02000000UL) +#define USBHS_HCTSIZ13_PKTCNT_7 (0x04000000UL) +#define USBHS_HCTSIZ13_PKTCNT_8 (0x08000000UL) +#define USBHS_HCTSIZ13_PKTCNT_9 (0x10000000UL) +#define USBHS_HCTSIZ13_PID_POS (29U) +#define USBHS_HCTSIZ13_PID (0x60000000UL) +#define USBHS_HCTSIZ13_PID_0 (0x20000000UL) +#define USBHS_HCTSIZ13_PID_1 (0x40000000UL) +#define USBHS_HCTSIZ13_DOPNG_POS (31U) +#define USBHS_HCTSIZ13_DOPNG (0x80000000UL) + +/* Bit definition for USBHS_HCDMA13 register */ +#define USBHS_HCDMA13 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_HCCHAR14 register */ +#define USBHS_HCCHAR14_MPS_POS (0U) +#define USBHS_HCCHAR14_MPS (0x000007FFUL) +#define USBHS_HCCHAR14_MPS_0 (0x00000001UL) +#define USBHS_HCCHAR14_MPS_1 (0x00000002UL) +#define USBHS_HCCHAR14_MPS_2 (0x00000004UL) +#define USBHS_HCCHAR14_MPS_3 (0x00000008UL) +#define USBHS_HCCHAR14_MPS_4 (0x00000010UL) +#define USBHS_HCCHAR14_MPS_5 (0x00000020UL) +#define USBHS_HCCHAR14_MPS_6 (0x00000040UL) +#define USBHS_HCCHAR14_MPS_7 (0x00000080UL) +#define USBHS_HCCHAR14_MPS_8 (0x00000100UL) +#define USBHS_HCCHAR14_MPS_9 (0x00000200UL) +#define USBHS_HCCHAR14_MPS_10 (0x00000400UL) +#define USBHS_HCCHAR14_EPNUM_POS (11U) +#define USBHS_HCCHAR14_EPNUM (0x00007800UL) +#define USBHS_HCCHAR14_EPNUM_0 (0x00000800UL) +#define USBHS_HCCHAR14_EPNUM_1 (0x00001000UL) +#define USBHS_HCCHAR14_EPNUM_2 (0x00002000UL) +#define USBHS_HCCHAR14_EPNUM_3 (0x00004000UL) +#define USBHS_HCCHAR14_EPDIR_POS (15U) +#define USBHS_HCCHAR14_EPDIR (0x00008000UL) +#define USBHS_HCCHAR14_LSPDDEV_POS (17U) +#define USBHS_HCCHAR14_LSPDDEV (0x00020000UL) +#define USBHS_HCCHAR14_EPTYPE_POS (18U) +#define USBHS_HCCHAR14_EPTYPE (0x000C0000UL) +#define USBHS_HCCHAR14_EPTYPE_0 (0x00040000UL) +#define USBHS_HCCHAR14_EPTYPE_1 (0x00080000UL) +#define USBHS_HCCHAR14_EC_POS (20U) +#define USBHS_HCCHAR14_EC (0x00300000UL) +#define USBHS_HCCHAR14_EC_0 (0x00100000UL) +#define USBHS_HCCHAR14_EC_1 (0x00200000UL) +#define USBHS_HCCHAR14_DEVADDR_POS (22U) +#define USBHS_HCCHAR14_DEVADDR (0x1FC00000UL) +#define USBHS_HCCHAR14_DEVADDR_0 (0x00400000UL) +#define USBHS_HCCHAR14_DEVADDR_1 (0x00800000UL) +#define USBHS_HCCHAR14_DEVADDR_2 (0x01000000UL) +#define USBHS_HCCHAR14_DEVADDR_3 (0x02000000UL) +#define USBHS_HCCHAR14_DEVADDR_4 (0x04000000UL) +#define USBHS_HCCHAR14_DEVADDR_5 (0x08000000UL) +#define USBHS_HCCHAR14_DEVADDR_6 (0x10000000UL) +#define USBHS_HCCHAR14_ODDFRM_POS (29U) +#define USBHS_HCCHAR14_ODDFRM (0x20000000UL) +#define USBHS_HCCHAR14_CHDIS_POS (30U) +#define USBHS_HCCHAR14_CHDIS (0x40000000UL) +#define USBHS_HCCHAR14_CHENA_POS (31U) +#define USBHS_HCCHAR14_CHENA (0x80000000UL) + +/* Bit definition for USBHS_HCSPLT14 register */ +#define USBHS_HCSPLT14_PRTADDR_POS (0U) +#define USBHS_HCSPLT14_PRTADDR (0x0000007FUL) +#define USBHS_HCSPLT14_PRTADDR_0 (0x00000001UL) +#define USBHS_HCSPLT14_PRTADDR_1 (0x00000002UL) +#define USBHS_HCSPLT14_PRTADDR_2 (0x00000004UL) +#define USBHS_HCSPLT14_PRTADDR_3 (0x00000008UL) +#define USBHS_HCSPLT14_PRTADDR_4 (0x00000010UL) +#define USBHS_HCSPLT14_PRTADDR_5 (0x00000020UL) +#define USBHS_HCSPLT14_PRTADDR_6 (0x00000040UL) +#define USBHS_HCSPLT14_HUBADDR_POS (7U) +#define USBHS_HCSPLT14_HUBADDR (0x00003F80UL) +#define USBHS_HCSPLT14_HUBADDR_0 (0x00000080UL) +#define USBHS_HCSPLT14_HUBADDR_1 (0x00000100UL) +#define USBHS_HCSPLT14_HUBADDR_2 (0x00000200UL) +#define USBHS_HCSPLT14_HUBADDR_3 (0x00000400UL) +#define USBHS_HCSPLT14_HUBADDR_4 (0x00000800UL) +#define USBHS_HCSPLT14_HUBADDR_5 (0x00001000UL) +#define USBHS_HCSPLT14_HUBADDR_6 (0x00002000UL) +#define USBHS_HCSPLT14_XACTPOS_POS (14U) +#define USBHS_HCSPLT14_XACTPOS (0x0000C000UL) +#define USBHS_HCSPLT14_XACTPOS_0 (0x00004000UL) +#define USBHS_HCSPLT14_XACTPOS_1 (0x00008000UL) +#define USBHS_HCSPLT14_COMPSPLT_POS (16U) +#define USBHS_HCSPLT14_COMPSPLT (0x00010000UL) +#define USBHS_HCSPLT14_SPLTENA_POS (31U) +#define USBHS_HCSPLT14_SPLTENA (0x80000000UL) + +/* Bit definition for USBHS_HCINT14 register */ +#define USBHS_HCINT14_XFERCOMPL_POS (0U) +#define USBHS_HCINT14_XFERCOMPL (0x00000001UL) +#define USBHS_HCINT14_CHHLTD_POS (1U) +#define USBHS_HCINT14_CHHLTD (0x00000002UL) +#define USBHS_HCINT14_AHBERR_POS (2U) +#define USBHS_HCINT14_AHBERR (0x00000004UL) +#define USBHS_HCINT14_STALL_POS (3U) +#define USBHS_HCINT14_STALL (0x00000008UL) +#define USBHS_HCINT14_NAK_POS (4U) +#define USBHS_HCINT14_NAK (0x00000010UL) +#define USBHS_HCINT14_ACK_POS (5U) +#define USBHS_HCINT14_ACK (0x00000020UL) +#define USBHS_HCINT14_NYET_POS (6U) +#define USBHS_HCINT14_NYET (0x00000040UL) +#define USBHS_HCINT14_XACTERR_POS (7U) +#define USBHS_HCINT14_XACTERR (0x00000080UL) +#define USBHS_HCINT14_BBLERR_POS (8U) +#define USBHS_HCINT14_BBLERR (0x00000100UL) +#define USBHS_HCINT14_FRMOVRUN_POS (9U) +#define USBHS_HCINT14_FRMOVRUN (0x00000200UL) +#define USBHS_HCINT14_DATATGLERR_POS (10U) +#define USBHS_HCINT14_DATATGLERR (0x00000400UL) + +/* Bit definition for USBHS_HCINTMSK14 register */ +#define USBHS_HCINTMSK14_XFERCOMPLMSK_POS (0U) +#define USBHS_HCINTMSK14_XFERCOMPLMSK (0x00000001UL) +#define USBHS_HCINTMSK14_CHHLTDMSK_POS (1U) +#define USBHS_HCINTMSK14_CHHLTDMSK (0x00000002UL) +#define USBHS_HCINTMSK14_AHBERRMSK_POS (2U) +#define USBHS_HCINTMSK14_AHBERRMSK (0x00000004UL) +#define USBHS_HCINTMSK14_STALLMSK_POS (3U) +#define USBHS_HCINTMSK14_STALLMSK (0x00000008UL) +#define USBHS_HCINTMSK14_NAKMSK_POS (4U) +#define USBHS_HCINTMSK14_NAKMSK (0x00000010UL) +#define USBHS_HCINTMSK14_ACKMSK_POS (5U) +#define USBHS_HCINTMSK14_ACKMSK (0x00000020UL) +#define USBHS_HCINTMSK14_NYETMSK_POS (6U) +#define USBHS_HCINTMSK14_NYETMSK (0x00000040UL) +#define USBHS_HCINTMSK14_XACTERRMSK_POS (7U) +#define USBHS_HCINTMSK14_XACTERRMSK (0x00000080UL) +#define USBHS_HCINTMSK14_BBLERRMSK_POS (8U) +#define USBHS_HCINTMSK14_BBLERRMSK (0x00000100UL) +#define USBHS_HCINTMSK14_FRMOVRUNMSK_POS (9U) +#define USBHS_HCINTMSK14_FRMOVRUNMSK (0x00000200UL) +#define USBHS_HCINTMSK14_DATATGLERRMSK_POS (10U) +#define USBHS_HCINTMSK14_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBHS_HCTSIZ14 register */ +#define USBHS_HCTSIZ14_XFERSIZE_POS (0U) +#define USBHS_HCTSIZ14_XFERSIZE (0x0007FFFFUL) +#define USBHS_HCTSIZ14_XFERSIZE_0 (0x00000001UL) +#define USBHS_HCTSIZ14_XFERSIZE_1 (0x00000002UL) +#define USBHS_HCTSIZ14_XFERSIZE_2 (0x00000004UL) +#define USBHS_HCTSIZ14_XFERSIZE_3 (0x00000008UL) +#define USBHS_HCTSIZ14_XFERSIZE_4 (0x00000010UL) +#define USBHS_HCTSIZ14_XFERSIZE_5 (0x00000020UL) +#define USBHS_HCTSIZ14_XFERSIZE_6 (0x00000040UL) +#define USBHS_HCTSIZ14_XFERSIZE_7 (0x00000080UL) +#define USBHS_HCTSIZ14_XFERSIZE_8 (0x00000100UL) +#define USBHS_HCTSIZ14_XFERSIZE_9 (0x00000200UL) +#define USBHS_HCTSIZ14_XFERSIZE_10 (0x00000400UL) +#define USBHS_HCTSIZ14_XFERSIZE_11 (0x00000800UL) +#define USBHS_HCTSIZ14_XFERSIZE_12 (0x00001000UL) +#define USBHS_HCTSIZ14_XFERSIZE_13 (0x00002000UL) +#define USBHS_HCTSIZ14_XFERSIZE_14 (0x00004000UL) +#define USBHS_HCTSIZ14_XFERSIZE_15 (0x00008000UL) +#define USBHS_HCTSIZ14_XFERSIZE_16 (0x00010000UL) +#define USBHS_HCTSIZ14_XFERSIZE_17 (0x00020000UL) +#define USBHS_HCTSIZ14_XFERSIZE_18 (0x00040000UL) +#define USBHS_HCTSIZ14_PKTCNT_POS (19U) +#define USBHS_HCTSIZ14_PKTCNT (0x1FF80000UL) +#define USBHS_HCTSIZ14_PKTCNT_0 (0x00080000UL) +#define USBHS_HCTSIZ14_PKTCNT_1 (0x00100000UL) +#define USBHS_HCTSIZ14_PKTCNT_2 (0x00200000UL) +#define USBHS_HCTSIZ14_PKTCNT_3 (0x00400000UL) +#define USBHS_HCTSIZ14_PKTCNT_4 (0x00800000UL) +#define USBHS_HCTSIZ14_PKTCNT_5 (0x01000000UL) +#define USBHS_HCTSIZ14_PKTCNT_6 (0x02000000UL) +#define USBHS_HCTSIZ14_PKTCNT_7 (0x04000000UL) +#define USBHS_HCTSIZ14_PKTCNT_8 (0x08000000UL) +#define USBHS_HCTSIZ14_PKTCNT_9 (0x10000000UL) +#define USBHS_HCTSIZ14_PID_POS (29U) +#define USBHS_HCTSIZ14_PID (0x60000000UL) +#define USBHS_HCTSIZ14_PID_0 (0x20000000UL) +#define USBHS_HCTSIZ14_PID_1 (0x40000000UL) +#define USBHS_HCTSIZ14_DOPNG_POS (31U) +#define USBHS_HCTSIZ14_DOPNG (0x80000000UL) + +/* Bit definition for USBHS_HCDMA14 register */ +#define USBHS_HCDMA14 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_HCCHAR15 register */ +#define USBHS_HCCHAR15_MPS_POS (0U) +#define USBHS_HCCHAR15_MPS (0x000007FFUL) +#define USBHS_HCCHAR15_MPS_0 (0x00000001UL) +#define USBHS_HCCHAR15_MPS_1 (0x00000002UL) +#define USBHS_HCCHAR15_MPS_2 (0x00000004UL) +#define USBHS_HCCHAR15_MPS_3 (0x00000008UL) +#define USBHS_HCCHAR15_MPS_4 (0x00000010UL) +#define USBHS_HCCHAR15_MPS_5 (0x00000020UL) +#define USBHS_HCCHAR15_MPS_6 (0x00000040UL) +#define USBHS_HCCHAR15_MPS_7 (0x00000080UL) +#define USBHS_HCCHAR15_MPS_8 (0x00000100UL) +#define USBHS_HCCHAR15_MPS_9 (0x00000200UL) +#define USBHS_HCCHAR15_MPS_10 (0x00000400UL) +#define USBHS_HCCHAR15_EPNUM_POS (11U) +#define USBHS_HCCHAR15_EPNUM (0x00007800UL) +#define USBHS_HCCHAR15_EPNUM_0 (0x00000800UL) +#define USBHS_HCCHAR15_EPNUM_1 (0x00001000UL) +#define USBHS_HCCHAR15_EPNUM_2 (0x00002000UL) +#define USBHS_HCCHAR15_EPNUM_3 (0x00004000UL) +#define USBHS_HCCHAR15_EPDIR_POS (15U) +#define USBHS_HCCHAR15_EPDIR (0x00008000UL) +#define USBHS_HCCHAR15_LSPDDEV_POS (17U) +#define USBHS_HCCHAR15_LSPDDEV (0x00020000UL) +#define USBHS_HCCHAR15_EPTYPE_POS (18U) +#define USBHS_HCCHAR15_EPTYPE (0x000C0000UL) +#define USBHS_HCCHAR15_EPTYPE_0 (0x00040000UL) +#define USBHS_HCCHAR15_EPTYPE_1 (0x00080000UL) +#define USBHS_HCCHAR15_EC_POS (20U) +#define USBHS_HCCHAR15_EC (0x00300000UL) +#define USBHS_HCCHAR15_EC_0 (0x00100000UL) +#define USBHS_HCCHAR15_EC_1 (0x00200000UL) +#define USBHS_HCCHAR15_DEVADDR_POS (22U) +#define USBHS_HCCHAR15_DEVADDR (0x1FC00000UL) +#define USBHS_HCCHAR15_DEVADDR_0 (0x00400000UL) +#define USBHS_HCCHAR15_DEVADDR_1 (0x00800000UL) +#define USBHS_HCCHAR15_DEVADDR_2 (0x01000000UL) +#define USBHS_HCCHAR15_DEVADDR_3 (0x02000000UL) +#define USBHS_HCCHAR15_DEVADDR_4 (0x04000000UL) +#define USBHS_HCCHAR15_DEVADDR_5 (0x08000000UL) +#define USBHS_HCCHAR15_DEVADDR_6 (0x10000000UL) +#define USBHS_HCCHAR15_ODDFRM_POS (29U) +#define USBHS_HCCHAR15_ODDFRM (0x20000000UL) +#define USBHS_HCCHAR15_CHDIS_POS (30U) +#define USBHS_HCCHAR15_CHDIS (0x40000000UL) +#define USBHS_HCCHAR15_CHENA_POS (31U) +#define USBHS_HCCHAR15_CHENA (0x80000000UL) + +/* Bit definition for USBHS_HCSPLT15 register */ +#define USBHS_HCSPLT15_PRTADDR_POS (0U) +#define USBHS_HCSPLT15_PRTADDR (0x0000007FUL) +#define USBHS_HCSPLT15_PRTADDR_0 (0x00000001UL) +#define USBHS_HCSPLT15_PRTADDR_1 (0x00000002UL) +#define USBHS_HCSPLT15_PRTADDR_2 (0x00000004UL) +#define USBHS_HCSPLT15_PRTADDR_3 (0x00000008UL) +#define USBHS_HCSPLT15_PRTADDR_4 (0x00000010UL) +#define USBHS_HCSPLT15_PRTADDR_5 (0x00000020UL) +#define USBHS_HCSPLT15_PRTADDR_6 (0x00000040UL) +#define USBHS_HCSPLT15_HUBADDR_POS (7U) +#define USBHS_HCSPLT15_HUBADDR (0x00003F80UL) +#define USBHS_HCSPLT15_HUBADDR_0 (0x00000080UL) +#define USBHS_HCSPLT15_HUBADDR_1 (0x00000100UL) +#define USBHS_HCSPLT15_HUBADDR_2 (0x00000200UL) +#define USBHS_HCSPLT15_HUBADDR_3 (0x00000400UL) +#define USBHS_HCSPLT15_HUBADDR_4 (0x00000800UL) +#define USBHS_HCSPLT15_HUBADDR_5 (0x00001000UL) +#define USBHS_HCSPLT15_HUBADDR_6 (0x00002000UL) +#define USBHS_HCSPLT15_XACTPOS_POS (14U) +#define USBHS_HCSPLT15_XACTPOS (0x0000C000UL) +#define USBHS_HCSPLT15_XACTPOS_0 (0x00004000UL) +#define USBHS_HCSPLT15_XACTPOS_1 (0x00008000UL) +#define USBHS_HCSPLT15_COMPSPLT_POS (16U) +#define USBHS_HCSPLT15_COMPSPLT (0x00010000UL) +#define USBHS_HCSPLT15_SPLTENA_POS (31U) +#define USBHS_HCSPLT15_SPLTENA (0x80000000UL) + +/* Bit definition for USBHS_HCINT15 register */ +#define USBHS_HCINT15_XFERCOMPL_POS (0U) +#define USBHS_HCINT15_XFERCOMPL (0x00000001UL) +#define USBHS_HCINT15_CHHLTD_POS (1U) +#define USBHS_HCINT15_CHHLTD (0x00000002UL) +#define USBHS_HCINT15_AHBERR_POS (2U) +#define USBHS_HCINT15_AHBERR (0x00000004UL) +#define USBHS_HCINT15_STALL_POS (3U) +#define USBHS_HCINT15_STALL (0x00000008UL) +#define USBHS_HCINT15_NAK_POS (4U) +#define USBHS_HCINT15_NAK (0x00000010UL) +#define USBHS_HCINT15_ACK_POS (5U) +#define USBHS_HCINT15_ACK (0x00000020UL) +#define USBHS_HCINT15_NYET_POS (6U) +#define USBHS_HCINT15_NYET (0x00000040UL) +#define USBHS_HCINT15_XACTERR_POS (7U) +#define USBHS_HCINT15_XACTERR (0x00000080UL) +#define USBHS_HCINT15_BBLERR_POS (8U) +#define USBHS_HCINT15_BBLERR (0x00000100UL) +#define USBHS_HCINT15_FRMOVRUN_POS (9U) +#define USBHS_HCINT15_FRMOVRUN (0x00000200UL) +#define USBHS_HCINT15_DATATGLERR_POS (10U) +#define USBHS_HCINT15_DATATGLERR (0x00000400UL) + +/* Bit definition for USBHS_HCINTMSK15 register */ +#define USBHS_HCINTMSK15_XFERCOMPLMSK_POS (0U) +#define USBHS_HCINTMSK15_XFERCOMPLMSK (0x00000001UL) +#define USBHS_HCINTMSK15_CHHLTDMSK_POS (1U) +#define USBHS_HCINTMSK15_CHHLTDMSK (0x00000002UL) +#define USBHS_HCINTMSK15_AHBERRMSK_POS (2U) +#define USBHS_HCINTMSK15_AHBERRMSK (0x00000004UL) +#define USBHS_HCINTMSK15_STALLMSK_POS (3U) +#define USBHS_HCINTMSK15_STALLMSK (0x00000008UL) +#define USBHS_HCINTMSK15_NAKMSK_POS (4U) +#define USBHS_HCINTMSK15_NAKMSK (0x00000010UL) +#define USBHS_HCINTMSK15_ACKMSK_POS (5U) +#define USBHS_HCINTMSK15_ACKMSK (0x00000020UL) +#define USBHS_HCINTMSK15_NYETMSK_POS (6U) +#define USBHS_HCINTMSK15_NYETMSK (0x00000040UL) +#define USBHS_HCINTMSK15_XACTERRMSK_POS (7U) +#define USBHS_HCINTMSK15_XACTERRMSK (0x00000080UL) +#define USBHS_HCINTMSK15_BBLERRMSK_POS (8U) +#define USBHS_HCINTMSK15_BBLERRMSK (0x00000100UL) +#define USBHS_HCINTMSK15_FRMOVRUNMSK_POS (9U) +#define USBHS_HCINTMSK15_FRMOVRUNMSK (0x00000200UL) +#define USBHS_HCINTMSK15_DATATGLERRMSK_POS (10U) +#define USBHS_HCINTMSK15_DATATGLERRMSK (0x00000400UL) + +/* Bit definition for USBHS_HCTSIZ15 register */ +#define USBHS_HCTSIZ15_XFERSIZE_POS (0U) +#define USBHS_HCTSIZ15_XFERSIZE (0x0007FFFFUL) +#define USBHS_HCTSIZ15_XFERSIZE_0 (0x00000001UL) +#define USBHS_HCTSIZ15_XFERSIZE_1 (0x00000002UL) +#define USBHS_HCTSIZ15_XFERSIZE_2 (0x00000004UL) +#define USBHS_HCTSIZ15_XFERSIZE_3 (0x00000008UL) +#define USBHS_HCTSIZ15_XFERSIZE_4 (0x00000010UL) +#define USBHS_HCTSIZ15_XFERSIZE_5 (0x00000020UL) +#define USBHS_HCTSIZ15_XFERSIZE_6 (0x00000040UL) +#define USBHS_HCTSIZ15_XFERSIZE_7 (0x00000080UL) +#define USBHS_HCTSIZ15_XFERSIZE_8 (0x00000100UL) +#define USBHS_HCTSIZ15_XFERSIZE_9 (0x00000200UL) +#define USBHS_HCTSIZ15_XFERSIZE_10 (0x00000400UL) +#define USBHS_HCTSIZ15_XFERSIZE_11 (0x00000800UL) +#define USBHS_HCTSIZ15_XFERSIZE_12 (0x00001000UL) +#define USBHS_HCTSIZ15_XFERSIZE_13 (0x00002000UL) +#define USBHS_HCTSIZ15_XFERSIZE_14 (0x00004000UL) +#define USBHS_HCTSIZ15_XFERSIZE_15 (0x00008000UL) +#define USBHS_HCTSIZ15_XFERSIZE_16 (0x00010000UL) +#define USBHS_HCTSIZ15_XFERSIZE_17 (0x00020000UL) +#define USBHS_HCTSIZ15_XFERSIZE_18 (0x00040000UL) +#define USBHS_HCTSIZ15_PKTCNT_POS (19U) +#define USBHS_HCTSIZ15_PKTCNT (0x1FF80000UL) +#define USBHS_HCTSIZ15_PKTCNT_0 (0x00080000UL) +#define USBHS_HCTSIZ15_PKTCNT_1 (0x00100000UL) +#define USBHS_HCTSIZ15_PKTCNT_2 (0x00200000UL) +#define USBHS_HCTSIZ15_PKTCNT_3 (0x00400000UL) +#define USBHS_HCTSIZ15_PKTCNT_4 (0x00800000UL) +#define USBHS_HCTSIZ15_PKTCNT_5 (0x01000000UL) +#define USBHS_HCTSIZ15_PKTCNT_6 (0x02000000UL) +#define USBHS_HCTSIZ15_PKTCNT_7 (0x04000000UL) +#define USBHS_HCTSIZ15_PKTCNT_8 (0x08000000UL) +#define USBHS_HCTSIZ15_PKTCNT_9 (0x10000000UL) +#define USBHS_HCTSIZ15_PID_POS (29U) +#define USBHS_HCTSIZ15_PID (0x60000000UL) +#define USBHS_HCTSIZ15_PID_0 (0x20000000UL) +#define USBHS_HCTSIZ15_PID_1 (0x40000000UL) +#define USBHS_HCTSIZ15_DOPNG_POS (31U) +#define USBHS_HCTSIZ15_DOPNG (0x80000000UL) + +/* Bit definition for USBHS_HCDMA15 register */ +#define USBHS_HCDMA15 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DCFG register */ +#define USBHS_DCFG_DEVSPD_POS (0U) +#define USBHS_DCFG_DEVSPD (0x00000003UL) +#define USBHS_DCFG_DEVSPD_0 (0x00000001UL) +#define USBHS_DCFG_DEVSPD_1 (0x00000002UL) +#define USBHS_DCFG_NZSTSOUTHSHK_POS (2U) +#define USBHS_DCFG_NZSTSOUTHSHK (0x00000004UL) +#define USBHS_DCFG_ENA32KHZSUSP_POS (3U) +#define USBHS_DCFG_ENA32KHZSUSP (0x00000008UL) +#define USBHS_DCFG_DEVADDR_POS (4U) +#define USBHS_DCFG_DEVADDR (0x000007F0UL) +#define USBHS_DCFG_DEVADDR_0 (0x00000010UL) +#define USBHS_DCFG_DEVADDR_1 (0x00000020UL) +#define USBHS_DCFG_DEVADDR_2 (0x00000040UL) +#define USBHS_DCFG_DEVADDR_3 (0x00000080UL) +#define USBHS_DCFG_DEVADDR_4 (0x00000100UL) +#define USBHS_DCFG_DEVADDR_5 (0x00000200UL) +#define USBHS_DCFG_DEVADDR_6 (0x00000400UL) +#define USBHS_DCFG_PERFRINT_POS (11U) +#define USBHS_DCFG_PERFRINT (0x00001800UL) +#define USBHS_DCFG_PERFRINT_0 (0x00000800UL) +#define USBHS_DCFG_PERFRINT_1 (0x00001000UL) +#define USBHS_DCFG_XCVRDLY_POS (14U) +#define USBHS_DCFG_XCVRDLY (0x00004000UL) +#define USBHS_DCFG_ERRATICINTMSK_POS (15U) +#define USBHS_DCFG_ERRATICINTMSK (0x00008000UL) +#define USBHS_DCFG_IPGISOCSUPT_POS (17U) +#define USBHS_DCFG_IPGISOCSUPT (0x00020000UL) +#define USBHS_DCFG_PERSCHINTVL_POS (24U) +#define USBHS_DCFG_PERSCHINTVL (0x03000000UL) +#define USBHS_DCFG_PERSCHINTVL_0 (0x01000000UL) +#define USBHS_DCFG_PERSCHINTVL_1 (0x02000000UL) +#define USBHS_DCFG_RESVALID_POS (26U) +#define USBHS_DCFG_RESVALID (0xFC000000UL) +#define USBHS_DCFG_RESVALID_0 (0x04000000UL) +#define USBHS_DCFG_RESVALID_1 (0x08000000UL) +#define USBHS_DCFG_RESVALID_2 (0x10000000UL) +#define USBHS_DCFG_RESVALID_3 (0x20000000UL) +#define USBHS_DCFG_RESVALID_4 (0x40000000UL) +#define USBHS_DCFG_RESVALID_5 (0x80000000UL) + +/* Bit definition for USBHS_DCTL register */ +#define USBHS_DCTL_RMTWKUPSIG_POS (0U) +#define USBHS_DCTL_RMTWKUPSIG (0x00000001UL) +#define USBHS_DCTL_SFTDISCON_POS (1U) +#define USBHS_DCTL_SFTDISCON (0x00000002UL) +#define USBHS_DCTL_GNPINNAKSTS_POS (2U) +#define USBHS_DCTL_GNPINNAKSTS (0x00000004UL) +#define USBHS_DCTL_GOUTNAKSTS_POS (3U) +#define USBHS_DCTL_GOUTNAKSTS (0x00000008UL) +#define USBHS_DCTL_TSTCTL_POS (4U) +#define USBHS_DCTL_TSTCTL (0x00000070UL) +#define USBHS_DCTL_TSTCTL_0 (0x00000010UL) +#define USBHS_DCTL_TSTCTL_1 (0x00000020UL) +#define USBHS_DCTL_TSTCTL_2 (0x00000040UL) +#define USBHS_DCTL_SGNPINNAK_POS (7U) +#define USBHS_DCTL_SGNPINNAK (0x00000080UL) +#define USBHS_DCTL_CGNPINNAK_POS (8U) +#define USBHS_DCTL_CGNPINNAK (0x00000100UL) +#define USBHS_DCTL_SGOUTNAK_POS (9U) +#define USBHS_DCTL_SGOUTNAK (0x00000200UL) +#define USBHS_DCTL_CGOUTNAK_POS (10U) +#define USBHS_DCTL_CGOUTNAK (0x00000400UL) +#define USBHS_DCTL_PWRONPRGDONE_POS (11U) +#define USBHS_DCTL_PWRONPRGDONE (0x00000800UL) +#define USBHS_DCTL_IGNRFRMNUM_POS (15U) +#define USBHS_DCTL_IGNRFRMNUM (0x00008000UL) +#define USBHS_DCTL_NAKONBBLE_POS (16U) +#define USBHS_DCTL_NAKONBBLE (0x00010000UL) +#define USBHS_DCTL_DEEPSLEEPBESLREJECT_POS (18U) +#define USBHS_DCTL_DEEPSLEEPBESLREJECT (0x00040000UL) +#define USBHS_DCTL_SERVINT_POS (19U) +#define USBHS_DCTL_SERVINT (0x00080000UL) + +/* Bit definition for USBHS_DSTS register */ +#define USBHS_DSTS_SUSPSTS_POS (0U) +#define USBHS_DSTS_SUSPSTS (0x00000001UL) +#define USBHS_DSTS_ENUMSPD_POS (1U) +#define USBHS_DSTS_ENUMSPD (0x00000006UL) +#define USBHS_DSTS_ENUMSPD_0 (0x00000002UL) +#define USBHS_DSTS_ENUMSPD_1 (0x00000004UL) +#define USBHS_DSTS_ERRTICERR_POS (3U) +#define USBHS_DSTS_ERRTICERR (0x00000008UL) +#define USBHS_DSTS_SOFFN_POS (8U) +#define USBHS_DSTS_SOFFN (0x003FFF00UL) +#define USBHS_DSTS_SOFFN_0 (0x00000100UL) +#define USBHS_DSTS_SOFFN_1 (0x00000200UL) +#define USBHS_DSTS_SOFFN_2 (0x00000400UL) +#define USBHS_DSTS_SOFFN_3 (0x00000800UL) +#define USBHS_DSTS_SOFFN_4 (0x00001000UL) +#define USBHS_DSTS_SOFFN_5 (0x00002000UL) +#define USBHS_DSTS_SOFFN_6 (0x00004000UL) +#define USBHS_DSTS_SOFFN_7 (0x00008000UL) +#define USBHS_DSTS_SOFFN_8 (0x00010000UL) +#define USBHS_DSTS_SOFFN_9 (0x00020000UL) +#define USBHS_DSTS_SOFFN_10 (0x00040000UL) +#define USBHS_DSTS_SOFFN_11 (0x00080000UL) +#define USBHS_DSTS_SOFFN_12 (0x00100000UL) +#define USBHS_DSTS_SOFFN_13 (0x00200000UL) +#define USBHS_DSTS_DEVLNSTS_POS (22U) +#define USBHS_DSTS_DEVLNSTS (0x00C00000UL) +#define USBHS_DSTS_DEVLNSTS_0 (0x00400000UL) +#define USBHS_DSTS_DEVLNSTS_1 (0x00800000UL) + +/* Bit definition for USBHS_DIEPMSK register */ +#define USBHS_DIEPMSK_XFERCOMPLMSK_POS (0U) +#define USBHS_DIEPMSK_XFERCOMPLMSK (0x00000001UL) +#define USBHS_DIEPMSK_EPDISBLDMSK_POS (1U) +#define USBHS_DIEPMSK_EPDISBLDMSK (0x00000002UL) +#define USBHS_DIEPMSK_AHBERRMSK_POS (2U) +#define USBHS_DIEPMSK_AHBERRMSK (0x00000004UL) +#define USBHS_DIEPMSK_TIMEOUTMSK_POS (3U) +#define USBHS_DIEPMSK_TIMEOUTMSK (0x00000008UL) +#define USBHS_DIEPMSK_INTKNTXFEMPMSK_POS (4U) +#define USBHS_DIEPMSK_INTKNTXFEMPMSK (0x00000010UL) +#define USBHS_DIEPMSK_INTKNEPMISMSK_POS (5U) +#define USBHS_DIEPMSK_INTKNEPMISMSK (0x00000020UL) +#define USBHS_DIEPMSK_INEPNAKEFFMSK_POS (6U) +#define USBHS_DIEPMSK_INEPNAKEFFMSK (0x00000040UL) +#define USBHS_DIEPMSK_TXFIFOUNDRNMSK_POS (8U) +#define USBHS_DIEPMSK_TXFIFOUNDRNMSK (0x00000100UL) +#define USBHS_DIEPMSK_NAKMSK_POS (13U) +#define USBHS_DIEPMSK_NAKMSK (0x00002000UL) + +/* Bit definition for USBHS_DOEPMSK register */ +#define USBHS_DOEPMSK_XFERCOMPLMSK_POS (0U) +#define USBHS_DOEPMSK_XFERCOMPLMSK (0x00000001UL) +#define USBHS_DOEPMSK_EPDISBLDMSK_POS (1U) +#define USBHS_DOEPMSK_EPDISBLDMSK (0x00000002UL) +#define USBHS_DOEPMSK_AHBERRMSK_POS (2U) +#define USBHS_DOEPMSK_AHBERRMSK (0x00000004UL) +#define USBHS_DOEPMSK_SETUPMSK_POS (3U) +#define USBHS_DOEPMSK_SETUPMSK (0x00000008UL) +#define USBHS_DOEPMSK_OUTTKNEPDISMSK_POS (4U) +#define USBHS_DOEPMSK_OUTTKNEPDISMSK (0x00000010UL) +#define USBHS_DOEPMSK_STSPHSERCVDMSK_POS (5U) +#define USBHS_DOEPMSK_STSPHSERCVDMSK (0x00000020UL) +#define USBHS_DOEPMSK_BACK2BACKSETUP_POS (6U) +#define USBHS_DOEPMSK_BACK2BACKSETUP (0x00000040UL) +#define USBHS_DOEPMSK_OUTPKTERRMSK_POS (8U) +#define USBHS_DOEPMSK_OUTPKTERRMSK (0x00000100UL) +#define USBHS_DOEPMSK_BBLEERRMSK_POS (12U) +#define USBHS_DOEPMSK_BBLEERRMSK (0x00001000UL) +#define USBHS_DOEPMSK_NAKMSK_POS (13U) +#define USBHS_DOEPMSK_NAKMSK (0x00002000UL) +#define USBHS_DOEPMSK_NYETMSK_POS (14U) +#define USBHS_DOEPMSK_NYETMSK (0x00004000UL) + +/* Bit definition for USBHS_DAINT register */ +#define USBHS_DAINT_INEPINT0_POS (0U) +#define USBHS_DAINT_INEPINT0 (0x00000001UL) +#define USBHS_DAINT_INEPINT1_POS (1U) +#define USBHS_DAINT_INEPINT1 (0x00000002UL) +#define USBHS_DAINT_INEPINT2_POS (2U) +#define USBHS_DAINT_INEPINT2 (0x00000004UL) +#define USBHS_DAINT_INEPINT3_POS (3U) +#define USBHS_DAINT_INEPINT3 (0x00000008UL) +#define USBHS_DAINT_INEPINT4_POS (4U) +#define USBHS_DAINT_INEPINT4 (0x00000010UL) +#define USBHS_DAINT_INEPINT5_POS (5U) +#define USBHS_DAINT_INEPINT5 (0x00000020UL) +#define USBHS_DAINT_INEPINT6_POS (6U) +#define USBHS_DAINT_INEPINT6 (0x00000040UL) +#define USBHS_DAINT_INEPINT7_POS (7U) +#define USBHS_DAINT_INEPINT7 (0x00000080UL) +#define USBHS_DAINT_INEPINT8_POS (8U) +#define USBHS_DAINT_INEPINT8 (0x00000100UL) +#define USBHS_DAINT_INEPINT9_POS (9U) +#define USBHS_DAINT_INEPINT9 (0x00000200UL) +#define USBHS_DAINT_INEPINT10_POS (10U) +#define USBHS_DAINT_INEPINT10 (0x00000400UL) +#define USBHS_DAINT_INEPINT11_POS (11U) +#define USBHS_DAINT_INEPINT11 (0x00000800UL) +#define USBHS_DAINT_INEPINT12_POS (12U) +#define USBHS_DAINT_INEPINT12 (0x00001000UL) +#define USBHS_DAINT_INEPINT13_POS (13U) +#define USBHS_DAINT_INEPINT13 (0x00002000UL) +#define USBHS_DAINT_INEPINT14_POS (14U) +#define USBHS_DAINT_INEPINT14 (0x00004000UL) +#define USBHS_DAINT_INEPINT15_POS (15U) +#define USBHS_DAINT_INEPINT15 (0x00008000UL) +#define USBHS_DAINT_OUTEPINT0_POS (16U) +#define USBHS_DAINT_OUTEPINT0 (0x00010000UL) +#define USBHS_DAINT_OUTEPINT1_POS (17U) +#define USBHS_DAINT_OUTEPINT1 (0x00020000UL) +#define USBHS_DAINT_OUTEPINT2_POS (18U) +#define USBHS_DAINT_OUTEPINT2 (0x00040000UL) +#define USBHS_DAINT_OUTEPINT3_POS (19U) +#define USBHS_DAINT_OUTEPINT3 (0x00080000UL) +#define USBHS_DAINT_OUTEPINT4_POS (20U) +#define USBHS_DAINT_OUTEPINT4 (0x00100000UL) +#define USBHS_DAINT_OUTEPINT5_POS (21U) +#define USBHS_DAINT_OUTEPINT5 (0x00200000UL) +#define USBHS_DAINT_OUTEPINT6_POS (22U) +#define USBHS_DAINT_OUTEPINT6 (0x00400000UL) +#define USBHS_DAINT_OUTEPINT7_POS (23U) +#define USBHS_DAINT_OUTEPINT7 (0x00800000UL) +#define USBHS_DAINT_OUTEPINT8_POS (24U) +#define USBHS_DAINT_OUTEPINT8 (0x01000000UL) +#define USBHS_DAINT_OUTEPINT9_POS (25U) +#define USBHS_DAINT_OUTEPINT9 (0x02000000UL) +#define USBHS_DAINT_OUTEPINT10_POS (26U) +#define USBHS_DAINT_OUTEPINT10 (0x04000000UL) +#define USBHS_DAINT_OUTEPINT11_POS (27U) +#define USBHS_DAINT_OUTEPINT11 (0x08000000UL) +#define USBHS_DAINT_OUTEPINT12_POS (28U) +#define USBHS_DAINT_OUTEPINT12 (0x10000000UL) +#define USBHS_DAINT_OUTEPINT13_POS (29U) +#define USBHS_DAINT_OUTEPINT13 (0x20000000UL) +#define USBHS_DAINT_OUTEPINT14_POS (30U) +#define USBHS_DAINT_OUTEPINT14 (0x40000000UL) +#define USBHS_DAINT_OUTEPINT15_POS (31U) +#define USBHS_DAINT_OUTEPINT15 (0x80000000UL) + +/* Bit definition for USBHS_DAINTMSK register */ +#define USBHS_DAINTMSK_INEPMSK0_POS (0U) +#define USBHS_DAINTMSK_INEPMSK0 (0x00000001UL) +#define USBHS_DAINTMSK_INEPMSK1_POS (1U) +#define USBHS_DAINTMSK_INEPMSK1 (0x00000002UL) +#define USBHS_DAINTMSK_INEPMSK2_POS (2U) +#define USBHS_DAINTMSK_INEPMSK2 (0x00000004UL) +#define USBHS_DAINTMSK_INEPMSK3_POS (3U) +#define USBHS_DAINTMSK_INEPMSK3 (0x00000008UL) +#define USBHS_DAINTMSK_INEPMSK4_POS (4U) +#define USBHS_DAINTMSK_INEPMSK4 (0x00000010UL) +#define USBHS_DAINTMSK_INEPMSK5_POS (5U) +#define USBHS_DAINTMSK_INEPMSK5 (0x00000020UL) +#define USBHS_DAINTMSK_INEPMSK6_POS (6U) +#define USBHS_DAINTMSK_INEPMSK6 (0x00000040UL) +#define USBHS_DAINTMSK_INEPMSK7_POS (7U) +#define USBHS_DAINTMSK_INEPMSK7 (0x00000080UL) +#define USBHS_DAINTMSK_INEPMSK8_POS (8U) +#define USBHS_DAINTMSK_INEPMSK8 (0x00000100UL) +#define USBHS_DAINTMSK_INEPMSK9_POS (9U) +#define USBHS_DAINTMSK_INEPMSK9 (0x00000200UL) +#define USBHS_DAINTMSK_INEPMSK10_POS (10U) +#define USBHS_DAINTMSK_INEPMSK10 (0x00000400UL) +#define USBHS_DAINTMSK_INEPMSK11_POS (11U) +#define USBHS_DAINTMSK_INEPMSK11 (0x00000800UL) +#define USBHS_DAINTMSK_INEPMSK12_POS (12U) +#define USBHS_DAINTMSK_INEPMSK12 (0x00001000UL) +#define USBHS_DAINTMSK_INEPMSK13_POS (13U) +#define USBHS_DAINTMSK_INEPMSK13 (0x00002000UL) +#define USBHS_DAINTMSK_INEPMSK14_POS (14U) +#define USBHS_DAINTMSK_INEPMSK14 (0x00004000UL) +#define USBHS_DAINTMSK_INEPMSK15_POS (15U) +#define USBHS_DAINTMSK_INEPMSK15 (0x00008000UL) +#define USBHS_DAINTMSK_OUTEPMSK0_POS (16U) +#define USBHS_DAINTMSK_OUTEPMSK0 (0x00010000UL) +#define USBHS_DAINTMSK_OUTEPMSK1_POS (17U) +#define USBHS_DAINTMSK_OUTEPMSK1 (0x00020000UL) +#define USBHS_DAINTMSK_OUTEPMSK2_POS (18U) +#define USBHS_DAINTMSK_OUTEPMSK2 (0x00040000UL) +#define USBHS_DAINTMSK_OUTEPMSK3_POS (19U) +#define USBHS_DAINTMSK_OUTEPMSK3 (0x00080000UL) +#define USBHS_DAINTMSK_OUTEPMSK4_POS (20U) +#define USBHS_DAINTMSK_OUTEPMSK4 (0x00100000UL) +#define USBHS_DAINTMSK_OUTEPMSK5_POS (21U) +#define USBHS_DAINTMSK_OUTEPMSK5 (0x00200000UL) +#define USBHS_DAINTMSK_OUTEPMSK6_POS (22U) +#define USBHS_DAINTMSK_OUTEPMSK6 (0x00400000UL) +#define USBHS_DAINTMSK_OUTEPMSK7_POS (23U) +#define USBHS_DAINTMSK_OUTEPMSK7 (0x00800000UL) +#define USBHS_DAINTMSK_OUTEPMSK8_POS (24U) +#define USBHS_DAINTMSK_OUTEPMSK8 (0x01000000UL) +#define USBHS_DAINTMSK_OUTEPMSK9_POS (25U) +#define USBHS_DAINTMSK_OUTEPMSK9 (0x02000000UL) +#define USBHS_DAINTMSK_OUTEPMSK10_POS (26U) +#define USBHS_DAINTMSK_OUTEPMSK10 (0x04000000UL) +#define USBHS_DAINTMSK_OUTEPMSK11_POS (27U) +#define USBHS_DAINTMSK_OUTEPMSK11 (0x08000000UL) +#define USBHS_DAINTMSK_OUTEPMSK12_POS (28U) +#define USBHS_DAINTMSK_OUTEPMSK12 (0x10000000UL) +#define USBHS_DAINTMSK_OUTEPMSK13_POS (29U) +#define USBHS_DAINTMSK_OUTEPMSK13 (0x20000000UL) +#define USBHS_DAINTMSK_OUTEPMSK14_POS (30U) +#define USBHS_DAINTMSK_OUTEPMSK14 (0x40000000UL) +#define USBHS_DAINTMSK_OUTEPMSK15_POS (31U) +#define USBHS_DAINTMSK_OUTEPMSK15 (0x80000000UL) + +/* Bit definition for USBHS_DTHRCTL register */ +#define USBHS_DTHRCTL_NONISOTHREN_POS (0U) +#define USBHS_DTHRCTL_NONISOTHREN (0x00000001UL) +#define USBHS_DTHRCTL_ISOTHREN_POS (1U) +#define USBHS_DTHRCTL_ISOTHREN (0x00000002UL) +#define USBHS_DTHRCTL_TXTHRLEN_POS (2U) +#define USBHS_DTHRCTL_TXTHRLEN (0x000007FCUL) +#define USBHS_DTHRCTL_TXTHRLEN_0 (0x00000004UL) +#define USBHS_DTHRCTL_TXTHRLEN_1 (0x00000008UL) +#define USBHS_DTHRCTL_TXTHRLEN_2 (0x00000010UL) +#define USBHS_DTHRCTL_TXTHRLEN_3 (0x00000020UL) +#define USBHS_DTHRCTL_TXTHRLEN_4 (0x00000040UL) +#define USBHS_DTHRCTL_TXTHRLEN_5 (0x00000080UL) +#define USBHS_DTHRCTL_TXTHRLEN_6 (0x00000100UL) +#define USBHS_DTHRCTL_TXTHRLEN_7 (0x00000200UL) +#define USBHS_DTHRCTL_TXTHRLEN_8 (0x00000400UL) +#define USBHS_DTHRCTL_AHBTHRRATIO_POS (11U) +#define USBHS_DTHRCTL_AHBTHRRATIO (0x00001800UL) +#define USBHS_DTHRCTL_AHBTHRRATIO_0 (0x00000800UL) +#define USBHS_DTHRCTL_AHBTHRRATIO_1 (0x00001000UL) +#define USBHS_DTHRCTL_RXTHREN_POS (16U) +#define USBHS_DTHRCTL_RXTHREN (0x00010000UL) +#define USBHS_DTHRCTL_RXTHRLEN_POS (17U) +#define USBHS_DTHRCTL_RXTHRLEN (0x03FE0000UL) +#define USBHS_DTHRCTL_RXTHRLEN_0 (0x00020000UL) +#define USBHS_DTHRCTL_RXTHRLEN_1 (0x00040000UL) +#define USBHS_DTHRCTL_RXTHRLEN_2 (0x00080000UL) +#define USBHS_DTHRCTL_RXTHRLEN_3 (0x00100000UL) +#define USBHS_DTHRCTL_RXTHRLEN_4 (0x00200000UL) +#define USBHS_DTHRCTL_RXTHRLEN_5 (0x00400000UL) +#define USBHS_DTHRCTL_RXTHRLEN_6 (0x00800000UL) +#define USBHS_DTHRCTL_RXTHRLEN_7 (0x01000000UL) +#define USBHS_DTHRCTL_RXTHRLEN_8 (0x02000000UL) +#define USBHS_DTHRCTL_ARBPRKEN_POS (27U) +#define USBHS_DTHRCTL_ARBPRKEN (0x08000000UL) + +/* Bit definition for USBHS_DIEPEMPMSK register */ +#define USBHS_DIEPEMPMSK_INEPTXFEMPMSK (0x0000FFFFUL) + +/* Bit definition for USBHS_DEACHINT register */ +#define USBHS_DEACHINT_ECHINEPINT_POS (0U) +#define USBHS_DEACHINT_ECHINEPINT (0x0000FFFFUL) +#define USBHS_DEACHINT_ECHINEPINT_0 (0x00000001UL) +#define USBHS_DEACHINT_ECHINEPINT_1 (0x00000002UL) +#define USBHS_DEACHINT_ECHINEPINT_2 (0x00000004UL) +#define USBHS_DEACHINT_ECHINEPINT_3 (0x00000008UL) +#define USBHS_DEACHINT_ECHINEPINT_4 (0x00000010UL) +#define USBHS_DEACHINT_ECHINEPINT_5 (0x00000020UL) +#define USBHS_DEACHINT_ECHINEPINT_6 (0x00000040UL) +#define USBHS_DEACHINT_ECHINEPINT_7 (0x00000080UL) +#define USBHS_DEACHINT_ECHINEPINT_8 (0x00000100UL) +#define USBHS_DEACHINT_ECHINEPINT_9 (0x00000200UL) +#define USBHS_DEACHINT_ECHINEPINT_10 (0x00000400UL) +#define USBHS_DEACHINT_ECHINEPINT_11 (0x00000800UL) +#define USBHS_DEACHINT_ECHINEPINT_12 (0x00001000UL) +#define USBHS_DEACHINT_ECHINEPINT_13 (0x00002000UL) +#define USBHS_DEACHINT_ECHINEPINT_14 (0x00004000UL) +#define USBHS_DEACHINT_ECHINEPINT_15 (0x00008000UL) +#define USBHS_DEACHINT_ECHOUTEPINT_POS (16U) +#define USBHS_DEACHINT_ECHOUTEPINT (0xFFFF0000UL) +#define USBHS_DEACHINT_ECHOUTEPINT_0 (0x00010000UL) +#define USBHS_DEACHINT_ECHOUTEPINT_1 (0x00020000UL) +#define USBHS_DEACHINT_ECHOUTEPINT_2 (0x00040000UL) +#define USBHS_DEACHINT_ECHOUTEPINT_3 (0x00080000UL) +#define USBHS_DEACHINT_ECHOUTEPINT_4 (0x00100000UL) +#define USBHS_DEACHINT_ECHOUTEPINT_5 (0x00200000UL) +#define USBHS_DEACHINT_ECHOUTEPINT_6 (0x00400000UL) +#define USBHS_DEACHINT_ECHOUTEPINT_7 (0x00800000UL) +#define USBHS_DEACHINT_ECHOUTEPINT_8 (0x01000000UL) +#define USBHS_DEACHINT_ECHOUTEPINT_9 (0x02000000UL) +#define USBHS_DEACHINT_ECHOUTEPINT_10 (0x04000000UL) +#define USBHS_DEACHINT_ECHOUTEPINT_11 (0x08000000UL) +#define USBHS_DEACHINT_ECHOUTEPINT_12 (0x10000000UL) +#define USBHS_DEACHINT_ECHOUTEPINT_13 (0x20000000UL) +#define USBHS_DEACHINT_ECHOUTEPINT_14 (0x40000000UL) +#define USBHS_DEACHINT_ECHOUTEPINT_15 (0x80000000UL) + +/* Bit definition for USBHS_DEACHINTMSK register */ +#define USBHS_DEACHINTMSK_ECHINEPMSK0_POS (0U) +#define USBHS_DEACHINTMSK_ECHINEPMSK0 (0x00000001UL) +#define USBHS_DEACHINTMSK_ECHINEPMSK1_POS (1U) +#define USBHS_DEACHINTMSK_ECHINEPMSK1 (0x00000002UL) +#define USBHS_DEACHINTMSK_ECHINEPMSK2_POS (2U) +#define USBHS_DEACHINTMSK_ECHINEPMSK2 (0x00000004UL) +#define USBHS_DEACHINTMSK_ECHINEPMSK3_POS (3U) +#define USBHS_DEACHINTMSK_ECHINEPMSK3 (0x00000008UL) +#define USBHS_DEACHINTMSK_ECHINEPMSK4_POS (4U) +#define USBHS_DEACHINTMSK_ECHINEPMSK4 (0x00000010UL) +#define USBHS_DEACHINTMSK_ECHINEPMSK5_POS (5U) +#define USBHS_DEACHINTMSK_ECHINEPMSK5 (0x00000020UL) +#define USBHS_DEACHINTMSK_ECHINEPMSK6_POS (6U) +#define USBHS_DEACHINTMSK_ECHINEPMSK6 (0x00000040UL) +#define USBHS_DEACHINTMSK_ECHINEPMSK7_POS (7U) +#define USBHS_DEACHINTMSK_ECHINEPMSK7 (0x00000080UL) +#define USBHS_DEACHINTMSK_ECHINEPMSK8_POS (8U) +#define USBHS_DEACHINTMSK_ECHINEPMSK8 (0x00000100UL) +#define USBHS_DEACHINTMSK_ECHINEPMSK9_POS (9U) +#define USBHS_DEACHINTMSK_ECHINEPMSK9 (0x00000200UL) +#define USBHS_DEACHINTMSK_ECHINEPMSK10_POS (10U) +#define USBHS_DEACHINTMSK_ECHINEPMSK10 (0x00000400UL) +#define USBHS_DEACHINTMSK_ECHINEPMSK11_POS (11U) +#define USBHS_DEACHINTMSK_ECHINEPMSK11 (0x00000800UL) +#define USBHS_DEACHINTMSK_ECHINEPMSK12_POS (12U) +#define USBHS_DEACHINTMSK_ECHINEPMSK12 (0x00001000UL) +#define USBHS_DEACHINTMSK_ECHINEPMSK13_POS (13U) +#define USBHS_DEACHINTMSK_ECHINEPMSK13 (0x00002000UL) +#define USBHS_DEACHINTMSK_ECHINEPMSK14_POS (14U) +#define USBHS_DEACHINTMSK_ECHINEPMSK14 (0x00004000UL) +#define USBHS_DEACHINTMSK_ECHINEPMSK15_POS (15U) +#define USBHS_DEACHINTMSK_ECHINEPMSK15 (0x00008000UL) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK0_POS (16U) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK0 (0x00010000UL) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK1_POS (17U) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK1 (0x00020000UL) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK2_POS (18U) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK2 (0x00040000UL) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK3_POS (19U) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK3 (0x00080000UL) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK4_POS (20U) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK4 (0x00100000UL) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK5_POS (21U) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK5 (0x00200000UL) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK6_POS (22U) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK6 (0x00400000UL) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK7_POS (23U) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK7 (0x00800000UL) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK8_POS (24U) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK8 (0x01000000UL) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK9_POS (25U) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK9 (0x02000000UL) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK10_POS (26U) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK10 (0x04000000UL) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK11_POS (27U) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK11 (0x08000000UL) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK12_POS (28U) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK12 (0x10000000UL) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK13_POS (29U) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK13 (0x20000000UL) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK14_POS (30U) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK14 (0x40000000UL) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK15_POS (31U) +#define USBHS_DEACHINTMSK_ECHOUTEPMSK15 (0x80000000UL) + +/* Bit definition for USBHS_DIEPEACHMSK1 register */ +#define USBHS_DIEPEACHMSK1_XFERCOMPLMSK_POS (0U) +#define USBHS_DIEPEACHMSK1_XFERCOMPLMSK (0x00000001UL) +#define USBHS_DIEPEACHMSK1_EPDISBLDMSK_POS (1U) +#define USBHS_DIEPEACHMSK1_EPDISBLDMSK (0x00000002UL) +#define USBHS_DIEPEACHMSK1_AHBERRMSK_POS (2U) +#define USBHS_DIEPEACHMSK1_AHBERRMSK (0x00000004UL) +#define USBHS_DIEPEACHMSK1_TIMEOUTMSK_POS (3U) +#define USBHS_DIEPEACHMSK1_TIMEOUTMSK (0x00000008UL) +#define USBHS_DIEPEACHMSK1_INTKNTXFEMPMSK_POS (4U) +#define USBHS_DIEPEACHMSK1_INTKNTXFEMPMSK (0x00000010UL) +#define USBHS_DIEPEACHMSK1_INTKNEPMISMSK_POS (5U) +#define USBHS_DIEPEACHMSK1_INTKNEPMISMSK (0x00000020UL) +#define USBHS_DIEPEACHMSK1_INEPNAKEFFMSK_POS (6U) +#define USBHS_DIEPEACHMSK1_INEPNAKEFFMSK (0x00000040UL) +#define USBHS_DIEPEACHMSK1_TXFIFOUNDRNMSK_POS (8U) +#define USBHS_DIEPEACHMSK1_TXFIFOUNDRNMSK (0x00000100UL) +#define USBHS_DIEPEACHMSK1_NAKMSK_POS (13U) +#define USBHS_DIEPEACHMSK1_NAKMSK (0x00002000UL) + +/* Bit definition for USBHS_DOEPEACHMSK1 register */ +#define USBHS_DOEPEACHMSK1_XFERCOMPLMSK_POS (0U) +#define USBHS_DOEPEACHMSK1_XFERCOMPLMSK (0x00000001UL) +#define USBHS_DOEPEACHMSK1_EPDISBLDMSK_POS (1U) +#define USBHS_DOEPEACHMSK1_EPDISBLDMSK (0x00000002UL) +#define USBHS_DOEPEACHMSK1_AHBERRMSK_POS (2U) +#define USBHS_DOEPEACHMSK1_AHBERRMSK (0x00000004UL) +#define USBHS_DOEPEACHMSK1_SETUPMSK_POS (3U) +#define USBHS_DOEPEACHMSK1_SETUPMSK (0x00000008UL) +#define USBHS_DOEPEACHMSK1_OUTTKNEPDISMSK_POS (4U) +#define USBHS_DOEPEACHMSK1_OUTTKNEPDISMSK (0x00000010UL) +#define USBHS_DOEPEACHMSK1_STSPHSRCVDMSK_POS (5U) +#define USBHS_DOEPEACHMSK1_STSPHSRCVDMSK (0x00000020UL) +#define USBHS_DOEPEACHMSK1_BACK2BACKSETUP_POS (6U) +#define USBHS_DOEPEACHMSK1_BACK2BACKSETUP (0x00000040UL) +#define USBHS_DOEPEACHMSK1_OUTPKTERRMSK_POS (8U) +#define USBHS_DOEPEACHMSK1_OUTPKTERRMSK (0x00000100UL) +#define USBHS_DOEPEACHMSK1_BBLEERRMSK_POS (12U) +#define USBHS_DOEPEACHMSK1_BBLEERRMSK (0x00001000UL) +#define USBHS_DOEPEACHMSK1_NAKMSK_POS (13U) +#define USBHS_DOEPEACHMSK1_NAKMSK (0x00002000UL) +#define USBHS_DOEPEACHMSK1_NYETMSK_POS (14U) +#define USBHS_DOEPEACHMSK1_NYETMSK (0x00004000UL) + +/* Bit definition for USBHS_DIEPCTL0 register */ +#define USBHS_DIEPCTL0_MPS_POS (0U) +#define USBHS_DIEPCTL0_MPS (0x00000003UL) +#define USBHS_DIEPCTL0_MPS_0 (0x00000001UL) +#define USBHS_DIEPCTL0_MPS_1 (0x00000002UL) +#define USBHS_DIEPCTL0_USBACTEP_POS (15U) +#define USBHS_DIEPCTL0_USBACTEP (0x00008000UL) +#define USBHS_DIEPCTL0_NAKSTS_POS (17U) +#define USBHS_DIEPCTL0_NAKSTS (0x00020000UL) +#define USBHS_DIEPCTL0_EPTYPE_POS (18U) +#define USBHS_DIEPCTL0_EPTYPE (0x000C0000UL) +#define USBHS_DIEPCTL0_EPTYPE_0 (0x00040000UL) +#define USBHS_DIEPCTL0_EPTYPE_1 (0x00080000UL) +#define USBHS_DIEPCTL0_STALL_POS (21U) +#define USBHS_DIEPCTL0_STALL (0x00200000UL) +#define USBHS_DIEPCTL0_TXFNUM_POS (22U) +#define USBHS_DIEPCTL0_TXFNUM (0x03C00000UL) +#define USBHS_DIEPCTL0_TXFNUM_0 (0x00400000UL) +#define USBHS_DIEPCTL0_TXFNUM_1 (0x00800000UL) +#define USBHS_DIEPCTL0_TXFNUM_2 (0x01000000UL) +#define USBHS_DIEPCTL0_TXFNUM_3 (0x02000000UL) +#define USBHS_DIEPCTL0_CNAK_POS (26U) +#define USBHS_DIEPCTL0_CNAK (0x04000000UL) +#define USBHS_DIEPCTL0_SNAK_POS (27U) +#define USBHS_DIEPCTL0_SNAK (0x08000000UL) +#define USBHS_DIEPCTL0_EPDIS_POS (30U) +#define USBHS_DIEPCTL0_EPDIS (0x40000000UL) +#define USBHS_DIEPCTL0_EPENA_POS (31U) +#define USBHS_DIEPCTL0_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DIEPINT0 register */ +#define USBHS_DIEPINT0_XFERCOMPL_POS (0U) +#define USBHS_DIEPINT0_XFERCOMPL (0x00000001UL) +#define USBHS_DIEPINT0_EPDISBLD_POS (1U) +#define USBHS_DIEPINT0_EPDISBLD (0x00000002UL) +#define USBHS_DIEPINT0_AHBERR_POS (2U) +#define USBHS_DIEPINT0_AHBERR (0x00000004UL) +#define USBHS_DIEPINT0_TIMEOUT_POS (3U) +#define USBHS_DIEPINT0_TIMEOUT (0x00000008UL) +#define USBHS_DIEPINT0_INTKNTXFEMP_POS (4U) +#define USBHS_DIEPINT0_INTKNTXFEMP (0x00000010UL) +#define USBHS_DIEPINT0_INTKNEPMIS_POS (5U) +#define USBHS_DIEPINT0_INTKNEPMIS (0x00000020UL) +#define USBHS_DIEPINT0_INEPNAKEFF_POS (6U) +#define USBHS_DIEPINT0_INEPNAKEFF (0x00000040UL) +#define USBHS_DIEPINT0_TXFEMP_POS (7U) +#define USBHS_DIEPINT0_TXFEMP (0x00000080UL) +#define USBHS_DIEPINT0_TXFIFOUNDRN_POS (8U) +#define USBHS_DIEPINT0_TXFIFOUNDRN (0x00000100UL) +#define USBHS_DIEPINT0_BNAINTR_POS (9U) +#define USBHS_DIEPINT0_BNAINTR (0x00000200UL) +#define USBHS_DIEPINT0_PKTDRPSTS_POS (11U) +#define USBHS_DIEPINT0_PKTDRPSTS (0x00000800UL) +#define USBHS_DIEPINT0_BBLEERR_POS (12U) +#define USBHS_DIEPINT0_BBLEERR (0x00001000UL) +#define USBHS_DIEPINT0_NAKINTRPT_POS (13U) +#define USBHS_DIEPINT0_NAKINTRPT (0x00002000UL) +#define USBHS_DIEPINT0_NYETINTRPT_POS (14U) +#define USBHS_DIEPINT0_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBHS_DIEPTSIZ0 register */ +#define USBHS_DIEPTSIZ0_XFERSIZE_POS (0U) +#define USBHS_DIEPTSIZ0_XFERSIZE (0x0000007FUL) +#define USBHS_DIEPTSIZ0_XFERSIZE_0 (0x00000001UL) +#define USBHS_DIEPTSIZ0_XFERSIZE_1 (0x00000002UL) +#define USBHS_DIEPTSIZ0_XFERSIZE_2 (0x00000004UL) +#define USBHS_DIEPTSIZ0_XFERSIZE_3 (0x00000008UL) +#define USBHS_DIEPTSIZ0_XFERSIZE_4 (0x00000010UL) +#define USBHS_DIEPTSIZ0_XFERSIZE_5 (0x00000020UL) +#define USBHS_DIEPTSIZ0_XFERSIZE_6 (0x00000040UL) +#define USBHS_DIEPTSIZ0_PKTCNT_POS (19U) +#define USBHS_DIEPTSIZ0_PKTCNT (0x00180000UL) +#define USBHS_DIEPTSIZ0_PKTCNT_0 (0x00080000UL) +#define USBHS_DIEPTSIZ0_PKTCNT_1 (0x00100000UL) + +/* Bit definition for USBHS_DIEPDMA0 register */ +#define USBHS_DIEPDMA0 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DTXFSTS0 register */ +#define USBHS_DTXFSTS0_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBHS_DIEPCTL1 register */ +#define USBHS_DIEPCTL1_MPS_POS (0U) +#define USBHS_DIEPCTL1_MPS (0x000007FFUL) +#define USBHS_DIEPCTL1_MPS_0 (0x00000001UL) +#define USBHS_DIEPCTL1_MPS_1 (0x00000002UL) +#define USBHS_DIEPCTL1_MPS_2 (0x00000004UL) +#define USBHS_DIEPCTL1_MPS_3 (0x00000008UL) +#define USBHS_DIEPCTL1_MPS_4 (0x00000010UL) +#define USBHS_DIEPCTL1_MPS_5 (0x00000020UL) +#define USBHS_DIEPCTL1_MPS_6 (0x00000040UL) +#define USBHS_DIEPCTL1_MPS_7 (0x00000080UL) +#define USBHS_DIEPCTL1_MPS_8 (0x00000100UL) +#define USBHS_DIEPCTL1_MPS_9 (0x00000200UL) +#define USBHS_DIEPCTL1_MPS_10 (0x00000400UL) +#define USBHS_DIEPCTL1_USBACTEP_POS (15U) +#define USBHS_DIEPCTL1_USBACTEP (0x00008000UL) +#define USBHS_DIEPCTL1_DPID_POS (16U) +#define USBHS_DIEPCTL1_DPID (0x00010000UL) +#define USBHS_DIEPCTL1_NAKSTS_POS (17U) +#define USBHS_DIEPCTL1_NAKSTS (0x00020000UL) +#define USBHS_DIEPCTL1_EPTYPE_POS (18U) +#define USBHS_DIEPCTL1_EPTYPE (0x000C0000UL) +#define USBHS_DIEPCTL1_EPTYPE_0 (0x00040000UL) +#define USBHS_DIEPCTL1_EPTYPE_1 (0x00080000UL) +#define USBHS_DIEPCTL1_STALL_POS (21U) +#define USBHS_DIEPCTL1_STALL (0x00200000UL) +#define USBHS_DIEPCTL1_TXFNUM_POS (22U) +#define USBHS_DIEPCTL1_TXFNUM (0x03C00000UL) +#define USBHS_DIEPCTL1_TXFNUM_0 (0x00400000UL) +#define USBHS_DIEPCTL1_TXFNUM_1 (0x00800000UL) +#define USBHS_DIEPCTL1_TXFNUM_2 (0x01000000UL) +#define USBHS_DIEPCTL1_TXFNUM_3 (0x02000000UL) +#define USBHS_DIEPCTL1_CNAK_POS (26U) +#define USBHS_DIEPCTL1_CNAK (0x04000000UL) +#define USBHS_DIEPCTL1_SNAK_POS (27U) +#define USBHS_DIEPCTL1_SNAK (0x08000000UL) +#define USBHS_DIEPCTL1_SETD0PID_POS (28U) +#define USBHS_DIEPCTL1_SETD0PID (0x10000000UL) +#define USBHS_DIEPCTL1_SETD1PID_POS (29U) +#define USBHS_DIEPCTL1_SETD1PID (0x20000000UL) +#define USBHS_DIEPCTL1_EPDIS_POS (30U) +#define USBHS_DIEPCTL1_EPDIS (0x40000000UL) +#define USBHS_DIEPCTL1_EPENA_POS (31U) +#define USBHS_DIEPCTL1_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DIEPINT1 register */ +#define USBHS_DIEPINT1_XFERCOMPL_POS (0U) +#define USBHS_DIEPINT1_XFERCOMPL (0x00000001UL) +#define USBHS_DIEPINT1_EPDISBLD_POS (1U) +#define USBHS_DIEPINT1_EPDISBLD (0x00000002UL) +#define USBHS_DIEPINT1_AHBERR_POS (2U) +#define USBHS_DIEPINT1_AHBERR (0x00000004UL) +#define USBHS_DIEPINT1_TIMEOUT_POS (3U) +#define USBHS_DIEPINT1_TIMEOUT (0x00000008UL) +#define USBHS_DIEPINT1_INTKNTXFEMP_POS (4U) +#define USBHS_DIEPINT1_INTKNTXFEMP (0x00000010UL) +#define USBHS_DIEPINT1_INTKNEPMIS_POS (5U) +#define USBHS_DIEPINT1_INTKNEPMIS (0x00000020UL) +#define USBHS_DIEPINT1_INEPNAKEFF_POS (6U) +#define USBHS_DIEPINT1_INEPNAKEFF (0x00000040UL) +#define USBHS_DIEPINT1_TXFEMP_POS (7U) +#define USBHS_DIEPINT1_TXFEMP (0x00000080UL) +#define USBHS_DIEPINT1_TXFIFOUNDRN_POS (8U) +#define USBHS_DIEPINT1_TXFIFOUNDRN (0x00000100UL) +#define USBHS_DIEPINT1_BNAINTR_POS (9U) +#define USBHS_DIEPINT1_BNAINTR (0x00000200UL) +#define USBHS_DIEPINT1_PKTDRPSTS_POS (11U) +#define USBHS_DIEPINT1_PKTDRPSTS (0x00000800UL) +#define USBHS_DIEPINT1_BBLEERR_POS (12U) +#define USBHS_DIEPINT1_BBLEERR (0x00001000UL) +#define USBHS_DIEPINT1_NAKINTRPT_POS (13U) +#define USBHS_DIEPINT1_NAKINTRPT (0x00002000UL) +#define USBHS_DIEPINT1_NYETINTRPT_POS (14U) +#define USBHS_DIEPINT1_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBHS_DIEPTSIZ1 register */ +#define USBHS_DIEPTSIZ1_XFERSIZE_POS (0U) +#define USBHS_DIEPTSIZ1_XFERSIZE (0x0007FFFFUL) +#define USBHS_DIEPTSIZ1_XFERSIZE_0 (0x00000001UL) +#define USBHS_DIEPTSIZ1_XFERSIZE_1 (0x00000002UL) +#define USBHS_DIEPTSIZ1_XFERSIZE_2 (0x00000004UL) +#define USBHS_DIEPTSIZ1_XFERSIZE_3 (0x00000008UL) +#define USBHS_DIEPTSIZ1_XFERSIZE_4 (0x00000010UL) +#define USBHS_DIEPTSIZ1_XFERSIZE_5 (0x00000020UL) +#define USBHS_DIEPTSIZ1_XFERSIZE_6 (0x00000040UL) +#define USBHS_DIEPTSIZ1_XFERSIZE_7 (0x00000080UL) +#define USBHS_DIEPTSIZ1_XFERSIZE_8 (0x00000100UL) +#define USBHS_DIEPTSIZ1_XFERSIZE_9 (0x00000200UL) +#define USBHS_DIEPTSIZ1_XFERSIZE_10 (0x00000400UL) +#define USBHS_DIEPTSIZ1_XFERSIZE_11 (0x00000800UL) +#define USBHS_DIEPTSIZ1_XFERSIZE_12 (0x00001000UL) +#define USBHS_DIEPTSIZ1_XFERSIZE_13 (0x00002000UL) +#define USBHS_DIEPTSIZ1_XFERSIZE_14 (0x00004000UL) +#define USBHS_DIEPTSIZ1_XFERSIZE_15 (0x00008000UL) +#define USBHS_DIEPTSIZ1_XFERSIZE_16 (0x00010000UL) +#define USBHS_DIEPTSIZ1_XFERSIZE_17 (0x00020000UL) +#define USBHS_DIEPTSIZ1_XFERSIZE_18 (0x00040000UL) +#define USBHS_DIEPTSIZ1_PKTCNT_POS (19U) +#define USBHS_DIEPTSIZ1_PKTCNT (0x1FF80000UL) +#define USBHS_DIEPTSIZ1_PKTCNT_0 (0x00080000UL) +#define USBHS_DIEPTSIZ1_PKTCNT_1 (0x00100000UL) +#define USBHS_DIEPTSIZ1_PKTCNT_2 (0x00200000UL) +#define USBHS_DIEPTSIZ1_PKTCNT_3 (0x00400000UL) +#define USBHS_DIEPTSIZ1_PKTCNT_4 (0x00800000UL) +#define USBHS_DIEPTSIZ1_PKTCNT_5 (0x01000000UL) +#define USBHS_DIEPTSIZ1_PKTCNT_6 (0x02000000UL) +#define USBHS_DIEPTSIZ1_PKTCNT_7 (0x04000000UL) +#define USBHS_DIEPTSIZ1_PKTCNT_8 (0x08000000UL) +#define USBHS_DIEPTSIZ1_PKTCNT_9 (0x10000000UL) +#define USBHS_DIEPTSIZ1_MC_POS (29U) +#define USBHS_DIEPTSIZ1_MC (0x60000000UL) +#define USBHS_DIEPTSIZ1_MC_0 (0x20000000UL) +#define USBHS_DIEPTSIZ1_MC_1 (0x40000000UL) + +/* Bit definition for USBHS_DIEPDMA1 register */ +#define USBHS_DIEPDMA1 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DTXFSTS1 register */ +#define USBHS_DTXFSTS1_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBHS_DIEPCTL2 register */ +#define USBHS_DIEPCTL2_MPS_POS (0U) +#define USBHS_DIEPCTL2_MPS (0x000007FFUL) +#define USBHS_DIEPCTL2_MPS_0 (0x00000001UL) +#define USBHS_DIEPCTL2_MPS_1 (0x00000002UL) +#define USBHS_DIEPCTL2_MPS_2 (0x00000004UL) +#define USBHS_DIEPCTL2_MPS_3 (0x00000008UL) +#define USBHS_DIEPCTL2_MPS_4 (0x00000010UL) +#define USBHS_DIEPCTL2_MPS_5 (0x00000020UL) +#define USBHS_DIEPCTL2_MPS_6 (0x00000040UL) +#define USBHS_DIEPCTL2_MPS_7 (0x00000080UL) +#define USBHS_DIEPCTL2_MPS_8 (0x00000100UL) +#define USBHS_DIEPCTL2_MPS_9 (0x00000200UL) +#define USBHS_DIEPCTL2_MPS_10 (0x00000400UL) +#define USBHS_DIEPCTL2_USBACTEP_POS (15U) +#define USBHS_DIEPCTL2_USBACTEP (0x00008000UL) +#define USBHS_DIEPCTL2_DPID_POS (16U) +#define USBHS_DIEPCTL2_DPID (0x00010000UL) +#define USBHS_DIEPCTL2_NAKSTS_POS (17U) +#define USBHS_DIEPCTL2_NAKSTS (0x00020000UL) +#define USBHS_DIEPCTL2_EPTYPE_POS (18U) +#define USBHS_DIEPCTL2_EPTYPE (0x000C0000UL) +#define USBHS_DIEPCTL2_EPTYPE_0 (0x00040000UL) +#define USBHS_DIEPCTL2_EPTYPE_1 (0x00080000UL) +#define USBHS_DIEPCTL2_STALL_POS (21U) +#define USBHS_DIEPCTL2_STALL (0x00200000UL) +#define USBHS_DIEPCTL2_TXFNUM_POS (22U) +#define USBHS_DIEPCTL2_TXFNUM (0x03C00000UL) +#define USBHS_DIEPCTL2_TXFNUM_0 (0x00400000UL) +#define USBHS_DIEPCTL2_TXFNUM_1 (0x00800000UL) +#define USBHS_DIEPCTL2_TXFNUM_2 (0x01000000UL) +#define USBHS_DIEPCTL2_TXFNUM_3 (0x02000000UL) +#define USBHS_DIEPCTL2_CNAK_POS (26U) +#define USBHS_DIEPCTL2_CNAK (0x04000000UL) +#define USBHS_DIEPCTL2_SNAK_POS (27U) +#define USBHS_DIEPCTL2_SNAK (0x08000000UL) +#define USBHS_DIEPCTL2_SETD0PID_POS (28U) +#define USBHS_DIEPCTL2_SETD0PID (0x10000000UL) +#define USBHS_DIEPCTL2_SETD1PID_POS (29U) +#define USBHS_DIEPCTL2_SETD1PID (0x20000000UL) +#define USBHS_DIEPCTL2_EPDIS_POS (30U) +#define USBHS_DIEPCTL2_EPDIS (0x40000000UL) +#define USBHS_DIEPCTL2_EPENA_POS (31U) +#define USBHS_DIEPCTL2_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DIEPINT2 register */ +#define USBHS_DIEPINT2_XFERCOMPL_POS (0U) +#define USBHS_DIEPINT2_XFERCOMPL (0x00000001UL) +#define USBHS_DIEPINT2_EPDISBLD_POS (1U) +#define USBHS_DIEPINT2_EPDISBLD (0x00000002UL) +#define USBHS_DIEPINT2_AHBERR_POS (2U) +#define USBHS_DIEPINT2_AHBERR (0x00000004UL) +#define USBHS_DIEPINT2_TIMEOUT_POS (3U) +#define USBHS_DIEPINT2_TIMEOUT (0x00000008UL) +#define USBHS_DIEPINT2_INTKNTXFEMP_POS (4U) +#define USBHS_DIEPINT2_INTKNTXFEMP (0x00000010UL) +#define USBHS_DIEPINT2_INTKNEPMIS_POS (5U) +#define USBHS_DIEPINT2_INTKNEPMIS (0x00000020UL) +#define USBHS_DIEPINT2_INEPNAKEFF_POS (6U) +#define USBHS_DIEPINT2_INEPNAKEFF (0x00000040UL) +#define USBHS_DIEPINT2_TXFEMP_POS (7U) +#define USBHS_DIEPINT2_TXFEMP (0x00000080UL) +#define USBHS_DIEPINT2_TXFIFOUNDRN_POS (8U) +#define USBHS_DIEPINT2_TXFIFOUNDRN (0x00000100UL) +#define USBHS_DIEPINT2_BNAINTR_POS (9U) +#define USBHS_DIEPINT2_BNAINTR (0x00000200UL) +#define USBHS_DIEPINT2_PKTDRPSTS_POS (11U) +#define USBHS_DIEPINT2_PKTDRPSTS (0x00000800UL) +#define USBHS_DIEPINT2_BBLEERR_POS (12U) +#define USBHS_DIEPINT2_BBLEERR (0x00001000UL) +#define USBHS_DIEPINT2_NAKINTRPT_POS (13U) +#define USBHS_DIEPINT2_NAKINTRPT (0x00002000UL) +#define USBHS_DIEPINT2_NYETINTRPT_POS (14U) +#define USBHS_DIEPINT2_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBHS_DIEPTSIZ2 register */ +#define USBHS_DIEPTSIZ2_XFERSIZE_POS (0U) +#define USBHS_DIEPTSIZ2_XFERSIZE (0x0007FFFFUL) +#define USBHS_DIEPTSIZ2_XFERSIZE_0 (0x00000001UL) +#define USBHS_DIEPTSIZ2_XFERSIZE_1 (0x00000002UL) +#define USBHS_DIEPTSIZ2_XFERSIZE_2 (0x00000004UL) +#define USBHS_DIEPTSIZ2_XFERSIZE_3 (0x00000008UL) +#define USBHS_DIEPTSIZ2_XFERSIZE_4 (0x00000010UL) +#define USBHS_DIEPTSIZ2_XFERSIZE_5 (0x00000020UL) +#define USBHS_DIEPTSIZ2_XFERSIZE_6 (0x00000040UL) +#define USBHS_DIEPTSIZ2_XFERSIZE_7 (0x00000080UL) +#define USBHS_DIEPTSIZ2_XFERSIZE_8 (0x00000100UL) +#define USBHS_DIEPTSIZ2_XFERSIZE_9 (0x00000200UL) +#define USBHS_DIEPTSIZ2_XFERSIZE_10 (0x00000400UL) +#define USBHS_DIEPTSIZ2_XFERSIZE_11 (0x00000800UL) +#define USBHS_DIEPTSIZ2_XFERSIZE_12 (0x00001000UL) +#define USBHS_DIEPTSIZ2_XFERSIZE_13 (0x00002000UL) +#define USBHS_DIEPTSIZ2_XFERSIZE_14 (0x00004000UL) +#define USBHS_DIEPTSIZ2_XFERSIZE_15 (0x00008000UL) +#define USBHS_DIEPTSIZ2_XFERSIZE_16 (0x00010000UL) +#define USBHS_DIEPTSIZ2_XFERSIZE_17 (0x00020000UL) +#define USBHS_DIEPTSIZ2_XFERSIZE_18 (0x00040000UL) +#define USBHS_DIEPTSIZ2_PKTCNT_POS (19U) +#define USBHS_DIEPTSIZ2_PKTCNT (0x1FF80000UL) +#define USBHS_DIEPTSIZ2_PKTCNT_0 (0x00080000UL) +#define USBHS_DIEPTSIZ2_PKTCNT_1 (0x00100000UL) +#define USBHS_DIEPTSIZ2_PKTCNT_2 (0x00200000UL) +#define USBHS_DIEPTSIZ2_PKTCNT_3 (0x00400000UL) +#define USBHS_DIEPTSIZ2_PKTCNT_4 (0x00800000UL) +#define USBHS_DIEPTSIZ2_PKTCNT_5 (0x01000000UL) +#define USBHS_DIEPTSIZ2_PKTCNT_6 (0x02000000UL) +#define USBHS_DIEPTSIZ2_PKTCNT_7 (0x04000000UL) +#define USBHS_DIEPTSIZ2_PKTCNT_8 (0x08000000UL) +#define USBHS_DIEPTSIZ2_PKTCNT_9 (0x10000000UL) +#define USBHS_DIEPTSIZ2_MC_POS (29U) +#define USBHS_DIEPTSIZ2_MC (0x60000000UL) +#define USBHS_DIEPTSIZ2_MC_0 (0x20000000UL) +#define USBHS_DIEPTSIZ2_MC_1 (0x40000000UL) + +/* Bit definition for USBHS_DIEPDMA2 register */ +#define USBHS_DIEPDMA2 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DTXFSTS2 register */ +#define USBHS_DTXFSTS2_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBHS_DIEPCTL3 register */ +#define USBHS_DIEPCTL3_MPS_POS (0U) +#define USBHS_DIEPCTL3_MPS (0x000007FFUL) +#define USBHS_DIEPCTL3_MPS_0 (0x00000001UL) +#define USBHS_DIEPCTL3_MPS_1 (0x00000002UL) +#define USBHS_DIEPCTL3_MPS_2 (0x00000004UL) +#define USBHS_DIEPCTL3_MPS_3 (0x00000008UL) +#define USBHS_DIEPCTL3_MPS_4 (0x00000010UL) +#define USBHS_DIEPCTL3_MPS_5 (0x00000020UL) +#define USBHS_DIEPCTL3_MPS_6 (0x00000040UL) +#define USBHS_DIEPCTL3_MPS_7 (0x00000080UL) +#define USBHS_DIEPCTL3_MPS_8 (0x00000100UL) +#define USBHS_DIEPCTL3_MPS_9 (0x00000200UL) +#define USBHS_DIEPCTL3_MPS_10 (0x00000400UL) +#define USBHS_DIEPCTL3_USBACTEP_POS (15U) +#define USBHS_DIEPCTL3_USBACTEP (0x00008000UL) +#define USBHS_DIEPCTL3_DPID_POS (16U) +#define USBHS_DIEPCTL3_DPID (0x00010000UL) +#define USBHS_DIEPCTL3_NAKSTS_POS (17U) +#define USBHS_DIEPCTL3_NAKSTS (0x00020000UL) +#define USBHS_DIEPCTL3_EPTYPE_POS (18U) +#define USBHS_DIEPCTL3_EPTYPE (0x000C0000UL) +#define USBHS_DIEPCTL3_EPTYPE_0 (0x00040000UL) +#define USBHS_DIEPCTL3_EPTYPE_1 (0x00080000UL) +#define USBHS_DIEPCTL3_STALL_POS (21U) +#define USBHS_DIEPCTL3_STALL (0x00200000UL) +#define USBHS_DIEPCTL3_TXFNUM_POS (22U) +#define USBHS_DIEPCTL3_TXFNUM (0x03C00000UL) +#define USBHS_DIEPCTL3_TXFNUM_0 (0x00400000UL) +#define USBHS_DIEPCTL3_TXFNUM_1 (0x00800000UL) +#define USBHS_DIEPCTL3_TXFNUM_2 (0x01000000UL) +#define USBHS_DIEPCTL3_TXFNUM_3 (0x02000000UL) +#define USBHS_DIEPCTL3_CNAK_POS (26U) +#define USBHS_DIEPCTL3_CNAK (0x04000000UL) +#define USBHS_DIEPCTL3_SNAK_POS (27U) +#define USBHS_DIEPCTL3_SNAK (0x08000000UL) +#define USBHS_DIEPCTL3_SETD0PID_POS (28U) +#define USBHS_DIEPCTL3_SETD0PID (0x10000000UL) +#define USBHS_DIEPCTL3_SETD1PID_POS (29U) +#define USBHS_DIEPCTL3_SETD1PID (0x20000000UL) +#define USBHS_DIEPCTL3_EPDIS_POS (30U) +#define USBHS_DIEPCTL3_EPDIS (0x40000000UL) +#define USBHS_DIEPCTL3_EPENA_POS (31U) +#define USBHS_DIEPCTL3_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DIEPINT3 register */ +#define USBHS_DIEPINT3_XFERCOMPL_POS (0U) +#define USBHS_DIEPINT3_XFERCOMPL (0x00000001UL) +#define USBHS_DIEPINT3_EPDISBLD_POS (1U) +#define USBHS_DIEPINT3_EPDISBLD (0x00000002UL) +#define USBHS_DIEPINT3_AHBERR_POS (2U) +#define USBHS_DIEPINT3_AHBERR (0x00000004UL) +#define USBHS_DIEPINT3_TIMEOUT_POS (3U) +#define USBHS_DIEPINT3_TIMEOUT (0x00000008UL) +#define USBHS_DIEPINT3_INTKNTXFEMP_POS (4U) +#define USBHS_DIEPINT3_INTKNTXFEMP (0x00000010UL) +#define USBHS_DIEPINT3_INTKNEPMIS_POS (5U) +#define USBHS_DIEPINT3_INTKNEPMIS (0x00000020UL) +#define USBHS_DIEPINT3_INEPNAKEFF_POS (6U) +#define USBHS_DIEPINT3_INEPNAKEFF (0x00000040UL) +#define USBHS_DIEPINT3_TXFEMP_POS (7U) +#define USBHS_DIEPINT3_TXFEMP (0x00000080UL) +#define USBHS_DIEPINT3_TXFIFOUNDRN_POS (8U) +#define USBHS_DIEPINT3_TXFIFOUNDRN (0x00000100UL) +#define USBHS_DIEPINT3_BNAINTR_POS (9U) +#define USBHS_DIEPINT3_BNAINTR (0x00000200UL) +#define USBHS_DIEPINT3_PKTDRPSTS_POS (11U) +#define USBHS_DIEPINT3_PKTDRPSTS (0x00000800UL) +#define USBHS_DIEPINT3_BBLEERR_POS (12U) +#define USBHS_DIEPINT3_BBLEERR (0x00001000UL) +#define USBHS_DIEPINT3_NAKINTRPT_POS (13U) +#define USBHS_DIEPINT3_NAKINTRPT (0x00002000UL) +#define USBHS_DIEPINT3_NYETINTRPT_POS (14U) +#define USBHS_DIEPINT3_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBHS_DIEPTSIZ3 register */ +#define USBHS_DIEPTSIZ3_XFERSIZE_POS (0U) +#define USBHS_DIEPTSIZ3_XFERSIZE (0x0007FFFFUL) +#define USBHS_DIEPTSIZ3_XFERSIZE_0 (0x00000001UL) +#define USBHS_DIEPTSIZ3_XFERSIZE_1 (0x00000002UL) +#define USBHS_DIEPTSIZ3_XFERSIZE_2 (0x00000004UL) +#define USBHS_DIEPTSIZ3_XFERSIZE_3 (0x00000008UL) +#define USBHS_DIEPTSIZ3_XFERSIZE_4 (0x00000010UL) +#define USBHS_DIEPTSIZ3_XFERSIZE_5 (0x00000020UL) +#define USBHS_DIEPTSIZ3_XFERSIZE_6 (0x00000040UL) +#define USBHS_DIEPTSIZ3_XFERSIZE_7 (0x00000080UL) +#define USBHS_DIEPTSIZ3_XFERSIZE_8 (0x00000100UL) +#define USBHS_DIEPTSIZ3_XFERSIZE_9 (0x00000200UL) +#define USBHS_DIEPTSIZ3_XFERSIZE_10 (0x00000400UL) +#define USBHS_DIEPTSIZ3_XFERSIZE_11 (0x00000800UL) +#define USBHS_DIEPTSIZ3_XFERSIZE_12 (0x00001000UL) +#define USBHS_DIEPTSIZ3_XFERSIZE_13 (0x00002000UL) +#define USBHS_DIEPTSIZ3_XFERSIZE_14 (0x00004000UL) +#define USBHS_DIEPTSIZ3_XFERSIZE_15 (0x00008000UL) +#define USBHS_DIEPTSIZ3_XFERSIZE_16 (0x00010000UL) +#define USBHS_DIEPTSIZ3_XFERSIZE_17 (0x00020000UL) +#define USBHS_DIEPTSIZ3_XFERSIZE_18 (0x00040000UL) +#define USBHS_DIEPTSIZ3_PKTCNT_POS (19U) +#define USBHS_DIEPTSIZ3_PKTCNT (0x1FF80000UL) +#define USBHS_DIEPTSIZ3_PKTCNT_0 (0x00080000UL) +#define USBHS_DIEPTSIZ3_PKTCNT_1 (0x00100000UL) +#define USBHS_DIEPTSIZ3_PKTCNT_2 (0x00200000UL) +#define USBHS_DIEPTSIZ3_PKTCNT_3 (0x00400000UL) +#define USBHS_DIEPTSIZ3_PKTCNT_4 (0x00800000UL) +#define USBHS_DIEPTSIZ3_PKTCNT_5 (0x01000000UL) +#define USBHS_DIEPTSIZ3_PKTCNT_6 (0x02000000UL) +#define USBHS_DIEPTSIZ3_PKTCNT_7 (0x04000000UL) +#define USBHS_DIEPTSIZ3_PKTCNT_8 (0x08000000UL) +#define USBHS_DIEPTSIZ3_PKTCNT_9 (0x10000000UL) +#define USBHS_DIEPTSIZ3_MC_POS (29U) +#define USBHS_DIEPTSIZ3_MC (0x60000000UL) +#define USBHS_DIEPTSIZ3_MC_0 (0x20000000UL) +#define USBHS_DIEPTSIZ3_MC_1 (0x40000000UL) + +/* Bit definition for USBHS_DIEPDMA3 register */ +#define USBHS_DIEPDMA3 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DTXFSTS3 register */ +#define USBHS_DTXFSTS3_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBHS_DIEPCTL4 register */ +#define USBHS_DIEPCTL4_MPS_POS (0U) +#define USBHS_DIEPCTL4_MPS (0x000007FFUL) +#define USBHS_DIEPCTL4_MPS_0 (0x00000001UL) +#define USBHS_DIEPCTL4_MPS_1 (0x00000002UL) +#define USBHS_DIEPCTL4_MPS_2 (0x00000004UL) +#define USBHS_DIEPCTL4_MPS_3 (0x00000008UL) +#define USBHS_DIEPCTL4_MPS_4 (0x00000010UL) +#define USBHS_DIEPCTL4_MPS_5 (0x00000020UL) +#define USBHS_DIEPCTL4_MPS_6 (0x00000040UL) +#define USBHS_DIEPCTL4_MPS_7 (0x00000080UL) +#define USBHS_DIEPCTL4_MPS_8 (0x00000100UL) +#define USBHS_DIEPCTL4_MPS_9 (0x00000200UL) +#define USBHS_DIEPCTL4_MPS_10 (0x00000400UL) +#define USBHS_DIEPCTL4_USBACTEP_POS (15U) +#define USBHS_DIEPCTL4_USBACTEP (0x00008000UL) +#define USBHS_DIEPCTL4_DPID_POS (16U) +#define USBHS_DIEPCTL4_DPID (0x00010000UL) +#define USBHS_DIEPCTL4_NAKSTS_POS (17U) +#define USBHS_DIEPCTL4_NAKSTS (0x00020000UL) +#define USBHS_DIEPCTL4_EPTYPE_POS (18U) +#define USBHS_DIEPCTL4_EPTYPE (0x000C0000UL) +#define USBHS_DIEPCTL4_EPTYPE_0 (0x00040000UL) +#define USBHS_DIEPCTL4_EPTYPE_1 (0x00080000UL) +#define USBHS_DIEPCTL4_STALL_POS (21U) +#define USBHS_DIEPCTL4_STALL (0x00200000UL) +#define USBHS_DIEPCTL4_TXFNUM_POS (22U) +#define USBHS_DIEPCTL4_TXFNUM (0x03C00000UL) +#define USBHS_DIEPCTL4_TXFNUM_0 (0x00400000UL) +#define USBHS_DIEPCTL4_TXFNUM_1 (0x00800000UL) +#define USBHS_DIEPCTL4_TXFNUM_2 (0x01000000UL) +#define USBHS_DIEPCTL4_TXFNUM_3 (0x02000000UL) +#define USBHS_DIEPCTL4_CNAK_POS (26U) +#define USBHS_DIEPCTL4_CNAK (0x04000000UL) +#define USBHS_DIEPCTL4_SNAK_POS (27U) +#define USBHS_DIEPCTL4_SNAK (0x08000000UL) +#define USBHS_DIEPCTL4_SETD0PID_POS (28U) +#define USBHS_DIEPCTL4_SETD0PID (0x10000000UL) +#define USBHS_DIEPCTL4_SETD1PID_POS (29U) +#define USBHS_DIEPCTL4_SETD1PID (0x20000000UL) +#define USBHS_DIEPCTL4_EPDIS_POS (30U) +#define USBHS_DIEPCTL4_EPDIS (0x40000000UL) +#define USBHS_DIEPCTL4_EPENA_POS (31U) +#define USBHS_DIEPCTL4_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DIEPINT4 register */ +#define USBHS_DIEPINT4_XFERCOMPL_POS (0U) +#define USBHS_DIEPINT4_XFERCOMPL (0x00000001UL) +#define USBHS_DIEPINT4_EPDISBLD_POS (1U) +#define USBHS_DIEPINT4_EPDISBLD (0x00000002UL) +#define USBHS_DIEPINT4_AHBERR_POS (2U) +#define USBHS_DIEPINT4_AHBERR (0x00000004UL) +#define USBHS_DIEPINT4_TIMEOUT_POS (3U) +#define USBHS_DIEPINT4_TIMEOUT (0x00000008UL) +#define USBHS_DIEPINT4_INTKNTXFEMP_POS (4U) +#define USBHS_DIEPINT4_INTKNTXFEMP (0x00000010UL) +#define USBHS_DIEPINT4_INTKNEPMIS_POS (5U) +#define USBHS_DIEPINT4_INTKNEPMIS (0x00000020UL) +#define USBHS_DIEPINT4_INEPNAKEFF_POS (6U) +#define USBHS_DIEPINT4_INEPNAKEFF (0x00000040UL) +#define USBHS_DIEPINT4_TXFEMP_POS (7U) +#define USBHS_DIEPINT4_TXFEMP (0x00000080UL) +#define USBHS_DIEPINT4_TXFIFOUNDRN_POS (8U) +#define USBHS_DIEPINT4_TXFIFOUNDRN (0x00000100UL) +#define USBHS_DIEPINT4_BNAINTR_POS (9U) +#define USBHS_DIEPINT4_BNAINTR (0x00000200UL) +#define USBHS_DIEPINT4_PKTDRPSTS_POS (11U) +#define USBHS_DIEPINT4_PKTDRPSTS (0x00000800UL) +#define USBHS_DIEPINT4_BBLEERR_POS (12U) +#define USBHS_DIEPINT4_BBLEERR (0x00001000UL) +#define USBHS_DIEPINT4_NAKINTRPT_POS (13U) +#define USBHS_DIEPINT4_NAKINTRPT (0x00002000UL) +#define USBHS_DIEPINT4_NYETINTRPT_POS (14U) +#define USBHS_DIEPINT4_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBHS_DIEPTSIZ4 register */ +#define USBHS_DIEPTSIZ4_XFERSIZE_POS (0U) +#define USBHS_DIEPTSIZ4_XFERSIZE (0x0007FFFFUL) +#define USBHS_DIEPTSIZ4_XFERSIZE_0 (0x00000001UL) +#define USBHS_DIEPTSIZ4_XFERSIZE_1 (0x00000002UL) +#define USBHS_DIEPTSIZ4_XFERSIZE_2 (0x00000004UL) +#define USBHS_DIEPTSIZ4_XFERSIZE_3 (0x00000008UL) +#define USBHS_DIEPTSIZ4_XFERSIZE_4 (0x00000010UL) +#define USBHS_DIEPTSIZ4_XFERSIZE_5 (0x00000020UL) +#define USBHS_DIEPTSIZ4_XFERSIZE_6 (0x00000040UL) +#define USBHS_DIEPTSIZ4_XFERSIZE_7 (0x00000080UL) +#define USBHS_DIEPTSIZ4_XFERSIZE_8 (0x00000100UL) +#define USBHS_DIEPTSIZ4_XFERSIZE_9 (0x00000200UL) +#define USBHS_DIEPTSIZ4_XFERSIZE_10 (0x00000400UL) +#define USBHS_DIEPTSIZ4_XFERSIZE_11 (0x00000800UL) +#define USBHS_DIEPTSIZ4_XFERSIZE_12 (0x00001000UL) +#define USBHS_DIEPTSIZ4_XFERSIZE_13 (0x00002000UL) +#define USBHS_DIEPTSIZ4_XFERSIZE_14 (0x00004000UL) +#define USBHS_DIEPTSIZ4_XFERSIZE_15 (0x00008000UL) +#define USBHS_DIEPTSIZ4_XFERSIZE_16 (0x00010000UL) +#define USBHS_DIEPTSIZ4_XFERSIZE_17 (0x00020000UL) +#define USBHS_DIEPTSIZ4_XFERSIZE_18 (0x00040000UL) +#define USBHS_DIEPTSIZ4_PKTCNT_POS (19U) +#define USBHS_DIEPTSIZ4_PKTCNT (0x1FF80000UL) +#define USBHS_DIEPTSIZ4_PKTCNT_0 (0x00080000UL) +#define USBHS_DIEPTSIZ4_PKTCNT_1 (0x00100000UL) +#define USBHS_DIEPTSIZ4_PKTCNT_2 (0x00200000UL) +#define USBHS_DIEPTSIZ4_PKTCNT_3 (0x00400000UL) +#define USBHS_DIEPTSIZ4_PKTCNT_4 (0x00800000UL) +#define USBHS_DIEPTSIZ4_PKTCNT_5 (0x01000000UL) +#define USBHS_DIEPTSIZ4_PKTCNT_6 (0x02000000UL) +#define USBHS_DIEPTSIZ4_PKTCNT_7 (0x04000000UL) +#define USBHS_DIEPTSIZ4_PKTCNT_8 (0x08000000UL) +#define USBHS_DIEPTSIZ4_PKTCNT_9 (0x10000000UL) +#define USBHS_DIEPTSIZ4_MC_POS (29U) +#define USBHS_DIEPTSIZ4_MC (0x60000000UL) +#define USBHS_DIEPTSIZ4_MC_0 (0x20000000UL) +#define USBHS_DIEPTSIZ4_MC_1 (0x40000000UL) + +/* Bit definition for USBHS_DIEPDMA4 register */ +#define USBHS_DIEPDMA4 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DTXFSTS4 register */ +#define USBHS_DTXFSTS4_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBHS_DIEPCTL5 register */ +#define USBHS_DIEPCTL5_MPS_POS (0U) +#define USBHS_DIEPCTL5_MPS (0x000007FFUL) +#define USBHS_DIEPCTL5_MPS_0 (0x00000001UL) +#define USBHS_DIEPCTL5_MPS_1 (0x00000002UL) +#define USBHS_DIEPCTL5_MPS_2 (0x00000004UL) +#define USBHS_DIEPCTL5_MPS_3 (0x00000008UL) +#define USBHS_DIEPCTL5_MPS_4 (0x00000010UL) +#define USBHS_DIEPCTL5_MPS_5 (0x00000020UL) +#define USBHS_DIEPCTL5_MPS_6 (0x00000040UL) +#define USBHS_DIEPCTL5_MPS_7 (0x00000080UL) +#define USBHS_DIEPCTL5_MPS_8 (0x00000100UL) +#define USBHS_DIEPCTL5_MPS_9 (0x00000200UL) +#define USBHS_DIEPCTL5_MPS_10 (0x00000400UL) +#define USBHS_DIEPCTL5_USBACTEP_POS (15U) +#define USBHS_DIEPCTL5_USBACTEP (0x00008000UL) +#define USBHS_DIEPCTL5_DPID_POS (16U) +#define USBHS_DIEPCTL5_DPID (0x00010000UL) +#define USBHS_DIEPCTL5_NAKSTS_POS (17U) +#define USBHS_DIEPCTL5_NAKSTS (0x00020000UL) +#define USBHS_DIEPCTL5_EPTYPE_POS (18U) +#define USBHS_DIEPCTL5_EPTYPE (0x000C0000UL) +#define USBHS_DIEPCTL5_EPTYPE_0 (0x00040000UL) +#define USBHS_DIEPCTL5_EPTYPE_1 (0x00080000UL) +#define USBHS_DIEPCTL5_STALL_POS (21U) +#define USBHS_DIEPCTL5_STALL (0x00200000UL) +#define USBHS_DIEPCTL5_TXFNUM_POS (22U) +#define USBHS_DIEPCTL5_TXFNUM (0x03C00000UL) +#define USBHS_DIEPCTL5_TXFNUM_0 (0x00400000UL) +#define USBHS_DIEPCTL5_TXFNUM_1 (0x00800000UL) +#define USBHS_DIEPCTL5_TXFNUM_2 (0x01000000UL) +#define USBHS_DIEPCTL5_TXFNUM_3 (0x02000000UL) +#define USBHS_DIEPCTL5_CNAK_POS (26U) +#define USBHS_DIEPCTL5_CNAK (0x04000000UL) +#define USBHS_DIEPCTL5_SNAK_POS (27U) +#define USBHS_DIEPCTL5_SNAK (0x08000000UL) +#define USBHS_DIEPCTL5_SETD0PID_POS (28U) +#define USBHS_DIEPCTL5_SETD0PID (0x10000000UL) +#define USBHS_DIEPCTL5_SETD1PID_POS (29U) +#define USBHS_DIEPCTL5_SETD1PID (0x20000000UL) +#define USBHS_DIEPCTL5_EPDIS_POS (30U) +#define USBHS_DIEPCTL5_EPDIS (0x40000000UL) +#define USBHS_DIEPCTL5_EPENA_POS (31U) +#define USBHS_DIEPCTL5_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DIEPINT5 register */ +#define USBHS_DIEPINT5_XFERCOMPL_POS (0U) +#define USBHS_DIEPINT5_XFERCOMPL (0x00000001UL) +#define USBHS_DIEPINT5_EPDISBLD_POS (1U) +#define USBHS_DIEPINT5_EPDISBLD (0x00000002UL) +#define USBHS_DIEPINT5_AHBERR_POS (2U) +#define USBHS_DIEPINT5_AHBERR (0x00000004UL) +#define USBHS_DIEPINT5_TIMEOUT_POS (3U) +#define USBHS_DIEPINT5_TIMEOUT (0x00000008UL) +#define USBHS_DIEPINT5_INTKNTXFEMP_POS (4U) +#define USBHS_DIEPINT5_INTKNTXFEMP (0x00000010UL) +#define USBHS_DIEPINT5_INTKNEPMIS_POS (5U) +#define USBHS_DIEPINT5_INTKNEPMIS (0x00000020UL) +#define USBHS_DIEPINT5_INEPNAKEFF_POS (6U) +#define USBHS_DIEPINT5_INEPNAKEFF (0x00000040UL) +#define USBHS_DIEPINT5_TXFEMP_POS (7U) +#define USBHS_DIEPINT5_TXFEMP (0x00000080UL) +#define USBHS_DIEPINT5_TXFIFOUNDRN_POS (8U) +#define USBHS_DIEPINT5_TXFIFOUNDRN (0x00000100UL) +#define USBHS_DIEPINT5_BNAINTR_POS (9U) +#define USBHS_DIEPINT5_BNAINTR (0x00000200UL) +#define USBHS_DIEPINT5_PKTDRPSTS_POS (11U) +#define USBHS_DIEPINT5_PKTDRPSTS (0x00000800UL) +#define USBHS_DIEPINT5_BBLEERR_POS (12U) +#define USBHS_DIEPINT5_BBLEERR (0x00001000UL) +#define USBHS_DIEPINT5_NAKINTRPT_POS (13U) +#define USBHS_DIEPINT5_NAKINTRPT (0x00002000UL) +#define USBHS_DIEPINT5_NYETINTRPT_POS (14U) +#define USBHS_DIEPINT5_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBHS_DIEPTSIZ5 register */ +#define USBHS_DIEPTSIZ5_XFERSIZE_POS (0U) +#define USBHS_DIEPTSIZ5_XFERSIZE (0x0007FFFFUL) +#define USBHS_DIEPTSIZ5_XFERSIZE_0 (0x00000001UL) +#define USBHS_DIEPTSIZ5_XFERSIZE_1 (0x00000002UL) +#define USBHS_DIEPTSIZ5_XFERSIZE_2 (0x00000004UL) +#define USBHS_DIEPTSIZ5_XFERSIZE_3 (0x00000008UL) +#define USBHS_DIEPTSIZ5_XFERSIZE_4 (0x00000010UL) +#define USBHS_DIEPTSIZ5_XFERSIZE_5 (0x00000020UL) +#define USBHS_DIEPTSIZ5_XFERSIZE_6 (0x00000040UL) +#define USBHS_DIEPTSIZ5_XFERSIZE_7 (0x00000080UL) +#define USBHS_DIEPTSIZ5_XFERSIZE_8 (0x00000100UL) +#define USBHS_DIEPTSIZ5_XFERSIZE_9 (0x00000200UL) +#define USBHS_DIEPTSIZ5_XFERSIZE_10 (0x00000400UL) +#define USBHS_DIEPTSIZ5_XFERSIZE_11 (0x00000800UL) +#define USBHS_DIEPTSIZ5_XFERSIZE_12 (0x00001000UL) +#define USBHS_DIEPTSIZ5_XFERSIZE_13 (0x00002000UL) +#define USBHS_DIEPTSIZ5_XFERSIZE_14 (0x00004000UL) +#define USBHS_DIEPTSIZ5_XFERSIZE_15 (0x00008000UL) +#define USBHS_DIEPTSIZ5_XFERSIZE_16 (0x00010000UL) +#define USBHS_DIEPTSIZ5_XFERSIZE_17 (0x00020000UL) +#define USBHS_DIEPTSIZ5_XFERSIZE_18 (0x00040000UL) +#define USBHS_DIEPTSIZ5_PKTCNT_POS (19U) +#define USBHS_DIEPTSIZ5_PKTCNT (0x1FF80000UL) +#define USBHS_DIEPTSIZ5_PKTCNT_0 (0x00080000UL) +#define USBHS_DIEPTSIZ5_PKTCNT_1 (0x00100000UL) +#define USBHS_DIEPTSIZ5_PKTCNT_2 (0x00200000UL) +#define USBHS_DIEPTSIZ5_PKTCNT_3 (0x00400000UL) +#define USBHS_DIEPTSIZ5_PKTCNT_4 (0x00800000UL) +#define USBHS_DIEPTSIZ5_PKTCNT_5 (0x01000000UL) +#define USBHS_DIEPTSIZ5_PKTCNT_6 (0x02000000UL) +#define USBHS_DIEPTSIZ5_PKTCNT_7 (0x04000000UL) +#define USBHS_DIEPTSIZ5_PKTCNT_8 (0x08000000UL) +#define USBHS_DIEPTSIZ5_PKTCNT_9 (0x10000000UL) +#define USBHS_DIEPTSIZ5_MC_POS (29U) +#define USBHS_DIEPTSIZ5_MC (0x60000000UL) +#define USBHS_DIEPTSIZ5_MC_0 (0x20000000UL) +#define USBHS_DIEPTSIZ5_MC_1 (0x40000000UL) + +/* Bit definition for USBHS_DIEPDMA5 register */ +#define USBHS_DIEPDMA5 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DTXFSTS5 register */ +#define USBHS_DTXFSTS5_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBHS_DIEPCTL6 register */ +#define USBHS_DIEPCTL6_MPS_POS (0U) +#define USBHS_DIEPCTL6_MPS (0x000007FFUL) +#define USBHS_DIEPCTL6_MPS_0 (0x00000001UL) +#define USBHS_DIEPCTL6_MPS_1 (0x00000002UL) +#define USBHS_DIEPCTL6_MPS_2 (0x00000004UL) +#define USBHS_DIEPCTL6_MPS_3 (0x00000008UL) +#define USBHS_DIEPCTL6_MPS_4 (0x00000010UL) +#define USBHS_DIEPCTL6_MPS_5 (0x00000020UL) +#define USBHS_DIEPCTL6_MPS_6 (0x00000040UL) +#define USBHS_DIEPCTL6_MPS_7 (0x00000080UL) +#define USBHS_DIEPCTL6_MPS_8 (0x00000100UL) +#define USBHS_DIEPCTL6_MPS_9 (0x00000200UL) +#define USBHS_DIEPCTL6_MPS_10 (0x00000400UL) +#define USBHS_DIEPCTL6_USBACTEP_POS (15U) +#define USBHS_DIEPCTL6_USBACTEP (0x00008000UL) +#define USBHS_DIEPCTL6_DPID_POS (16U) +#define USBHS_DIEPCTL6_DPID (0x00010000UL) +#define USBHS_DIEPCTL6_NAKSTS_POS (17U) +#define USBHS_DIEPCTL6_NAKSTS (0x00020000UL) +#define USBHS_DIEPCTL6_EPTYPE_POS (18U) +#define USBHS_DIEPCTL6_EPTYPE (0x000C0000UL) +#define USBHS_DIEPCTL6_EPTYPE_0 (0x00040000UL) +#define USBHS_DIEPCTL6_EPTYPE_1 (0x00080000UL) +#define USBHS_DIEPCTL6_STALL_POS (21U) +#define USBHS_DIEPCTL6_STALL (0x00200000UL) +#define USBHS_DIEPCTL6_TXFNUM_POS (22U) +#define USBHS_DIEPCTL6_TXFNUM (0x03C00000UL) +#define USBHS_DIEPCTL6_TXFNUM_0 (0x00400000UL) +#define USBHS_DIEPCTL6_TXFNUM_1 (0x00800000UL) +#define USBHS_DIEPCTL6_TXFNUM_2 (0x01000000UL) +#define USBHS_DIEPCTL6_TXFNUM_3 (0x02000000UL) +#define USBHS_DIEPCTL6_CNAK_POS (26U) +#define USBHS_DIEPCTL6_CNAK (0x04000000UL) +#define USBHS_DIEPCTL6_SNAK_POS (27U) +#define USBHS_DIEPCTL6_SNAK (0x08000000UL) +#define USBHS_DIEPCTL6_SETD0PID_POS (28U) +#define USBHS_DIEPCTL6_SETD0PID (0x10000000UL) +#define USBHS_DIEPCTL6_SETD1PID_POS (29U) +#define USBHS_DIEPCTL6_SETD1PID (0x20000000UL) +#define USBHS_DIEPCTL6_EPDIS_POS (30U) +#define USBHS_DIEPCTL6_EPDIS (0x40000000UL) +#define USBHS_DIEPCTL6_EPENA_POS (31U) +#define USBHS_DIEPCTL6_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DIEPINT6 register */ +#define USBHS_DIEPINT6_XFERCOMPL_POS (0U) +#define USBHS_DIEPINT6_XFERCOMPL (0x00000001UL) +#define USBHS_DIEPINT6_EPDISBLD_POS (1U) +#define USBHS_DIEPINT6_EPDISBLD (0x00000002UL) +#define USBHS_DIEPINT6_AHBERR_POS (2U) +#define USBHS_DIEPINT6_AHBERR (0x00000004UL) +#define USBHS_DIEPINT6_TIMEOUT_POS (3U) +#define USBHS_DIEPINT6_TIMEOUT (0x00000008UL) +#define USBHS_DIEPINT6_INTKNTXFEMP_POS (4U) +#define USBHS_DIEPINT6_INTKNTXFEMP (0x00000010UL) +#define USBHS_DIEPINT6_INTKNEPMIS_POS (5U) +#define USBHS_DIEPINT6_INTKNEPMIS (0x00000020UL) +#define USBHS_DIEPINT6_INEPNAKEFF_POS (6U) +#define USBHS_DIEPINT6_INEPNAKEFF (0x00000040UL) +#define USBHS_DIEPINT6_TXFEMP_POS (7U) +#define USBHS_DIEPINT6_TXFEMP (0x00000080UL) +#define USBHS_DIEPINT6_TXFIFOUNDRN_POS (8U) +#define USBHS_DIEPINT6_TXFIFOUNDRN (0x00000100UL) +#define USBHS_DIEPINT6_BNAINTR_POS (9U) +#define USBHS_DIEPINT6_BNAINTR (0x00000200UL) +#define USBHS_DIEPINT6_PKTDRPSTS_POS (11U) +#define USBHS_DIEPINT6_PKTDRPSTS (0x00000800UL) +#define USBHS_DIEPINT6_BBLEERR_POS (12U) +#define USBHS_DIEPINT6_BBLEERR (0x00001000UL) +#define USBHS_DIEPINT6_NAKINTRPT_POS (13U) +#define USBHS_DIEPINT6_NAKINTRPT (0x00002000UL) +#define USBHS_DIEPINT6_NYETINTRPT_POS (14U) +#define USBHS_DIEPINT6_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBHS_DIEPTSIZ6 register */ +#define USBHS_DIEPTSIZ6_XFERSIZE_POS (0U) +#define USBHS_DIEPTSIZ6_XFERSIZE (0x0007FFFFUL) +#define USBHS_DIEPTSIZ6_XFERSIZE_0 (0x00000001UL) +#define USBHS_DIEPTSIZ6_XFERSIZE_1 (0x00000002UL) +#define USBHS_DIEPTSIZ6_XFERSIZE_2 (0x00000004UL) +#define USBHS_DIEPTSIZ6_XFERSIZE_3 (0x00000008UL) +#define USBHS_DIEPTSIZ6_XFERSIZE_4 (0x00000010UL) +#define USBHS_DIEPTSIZ6_XFERSIZE_5 (0x00000020UL) +#define USBHS_DIEPTSIZ6_XFERSIZE_6 (0x00000040UL) +#define USBHS_DIEPTSIZ6_XFERSIZE_7 (0x00000080UL) +#define USBHS_DIEPTSIZ6_XFERSIZE_8 (0x00000100UL) +#define USBHS_DIEPTSIZ6_XFERSIZE_9 (0x00000200UL) +#define USBHS_DIEPTSIZ6_XFERSIZE_10 (0x00000400UL) +#define USBHS_DIEPTSIZ6_XFERSIZE_11 (0x00000800UL) +#define USBHS_DIEPTSIZ6_XFERSIZE_12 (0x00001000UL) +#define USBHS_DIEPTSIZ6_XFERSIZE_13 (0x00002000UL) +#define USBHS_DIEPTSIZ6_XFERSIZE_14 (0x00004000UL) +#define USBHS_DIEPTSIZ6_XFERSIZE_15 (0x00008000UL) +#define USBHS_DIEPTSIZ6_XFERSIZE_16 (0x00010000UL) +#define USBHS_DIEPTSIZ6_XFERSIZE_17 (0x00020000UL) +#define USBHS_DIEPTSIZ6_XFERSIZE_18 (0x00040000UL) +#define USBHS_DIEPTSIZ6_PKTCNT_POS (19U) +#define USBHS_DIEPTSIZ6_PKTCNT (0x1FF80000UL) +#define USBHS_DIEPTSIZ6_PKTCNT_0 (0x00080000UL) +#define USBHS_DIEPTSIZ6_PKTCNT_1 (0x00100000UL) +#define USBHS_DIEPTSIZ6_PKTCNT_2 (0x00200000UL) +#define USBHS_DIEPTSIZ6_PKTCNT_3 (0x00400000UL) +#define USBHS_DIEPTSIZ6_PKTCNT_4 (0x00800000UL) +#define USBHS_DIEPTSIZ6_PKTCNT_5 (0x01000000UL) +#define USBHS_DIEPTSIZ6_PKTCNT_6 (0x02000000UL) +#define USBHS_DIEPTSIZ6_PKTCNT_7 (0x04000000UL) +#define USBHS_DIEPTSIZ6_PKTCNT_8 (0x08000000UL) +#define USBHS_DIEPTSIZ6_PKTCNT_9 (0x10000000UL) +#define USBHS_DIEPTSIZ6_MC_POS (29U) +#define USBHS_DIEPTSIZ6_MC (0x60000000UL) +#define USBHS_DIEPTSIZ6_MC_0 (0x20000000UL) +#define USBHS_DIEPTSIZ6_MC_1 (0x40000000UL) + +/* Bit definition for USBHS_DIEPDMA6 register */ +#define USBHS_DIEPDMA6 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DTXFSTS6 register */ +#define USBHS_DTXFSTS6_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBHS_DIEPCTL7 register */ +#define USBHS_DIEPCTL7_MPS_POS (0U) +#define USBHS_DIEPCTL7_MPS (0x000007FFUL) +#define USBHS_DIEPCTL7_MPS_0 (0x00000001UL) +#define USBHS_DIEPCTL7_MPS_1 (0x00000002UL) +#define USBHS_DIEPCTL7_MPS_2 (0x00000004UL) +#define USBHS_DIEPCTL7_MPS_3 (0x00000008UL) +#define USBHS_DIEPCTL7_MPS_4 (0x00000010UL) +#define USBHS_DIEPCTL7_MPS_5 (0x00000020UL) +#define USBHS_DIEPCTL7_MPS_6 (0x00000040UL) +#define USBHS_DIEPCTL7_MPS_7 (0x00000080UL) +#define USBHS_DIEPCTL7_MPS_8 (0x00000100UL) +#define USBHS_DIEPCTL7_MPS_9 (0x00000200UL) +#define USBHS_DIEPCTL7_MPS_10 (0x00000400UL) +#define USBHS_DIEPCTL7_USBACTEP_POS (15U) +#define USBHS_DIEPCTL7_USBACTEP (0x00008000UL) +#define USBHS_DIEPCTL7_DPID_POS (16U) +#define USBHS_DIEPCTL7_DPID (0x00010000UL) +#define USBHS_DIEPCTL7_NAKSTS_POS (17U) +#define USBHS_DIEPCTL7_NAKSTS (0x00020000UL) +#define USBHS_DIEPCTL7_EPTYPE_POS (18U) +#define USBHS_DIEPCTL7_EPTYPE (0x000C0000UL) +#define USBHS_DIEPCTL7_EPTYPE_0 (0x00040000UL) +#define USBHS_DIEPCTL7_EPTYPE_1 (0x00080000UL) +#define USBHS_DIEPCTL7_STALL_POS (21U) +#define USBHS_DIEPCTL7_STALL (0x00200000UL) +#define USBHS_DIEPCTL7_TXFNUM_POS (22U) +#define USBHS_DIEPCTL7_TXFNUM (0x03C00000UL) +#define USBHS_DIEPCTL7_TXFNUM_0 (0x00400000UL) +#define USBHS_DIEPCTL7_TXFNUM_1 (0x00800000UL) +#define USBHS_DIEPCTL7_TXFNUM_2 (0x01000000UL) +#define USBHS_DIEPCTL7_TXFNUM_3 (0x02000000UL) +#define USBHS_DIEPCTL7_CNAK_POS (26U) +#define USBHS_DIEPCTL7_CNAK (0x04000000UL) +#define USBHS_DIEPCTL7_SNAK_POS (27U) +#define USBHS_DIEPCTL7_SNAK (0x08000000UL) +#define USBHS_DIEPCTL7_SETD0PID_POS (28U) +#define USBHS_DIEPCTL7_SETD0PID (0x10000000UL) +#define USBHS_DIEPCTL7_SETD1PID_POS (29U) +#define USBHS_DIEPCTL7_SETD1PID (0x20000000UL) +#define USBHS_DIEPCTL7_EPDIS_POS (30U) +#define USBHS_DIEPCTL7_EPDIS (0x40000000UL) +#define USBHS_DIEPCTL7_EPENA_POS (31U) +#define USBHS_DIEPCTL7_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DIEPINT7 register */ +#define USBHS_DIEPINT7_XFERCOMPL_POS (0U) +#define USBHS_DIEPINT7_XFERCOMPL (0x00000001UL) +#define USBHS_DIEPINT7_EPDISBLD_POS (1U) +#define USBHS_DIEPINT7_EPDISBLD (0x00000002UL) +#define USBHS_DIEPINT7_AHBERR_POS (2U) +#define USBHS_DIEPINT7_AHBERR (0x00000004UL) +#define USBHS_DIEPINT7_TIMEOUT_POS (3U) +#define USBHS_DIEPINT7_TIMEOUT (0x00000008UL) +#define USBHS_DIEPINT7_INTKNTXFEMP_POS (4U) +#define USBHS_DIEPINT7_INTKNTXFEMP (0x00000010UL) +#define USBHS_DIEPINT7_INTKNEPMIS_POS (5U) +#define USBHS_DIEPINT7_INTKNEPMIS (0x00000020UL) +#define USBHS_DIEPINT7_INEPNAKEFF_POS (6U) +#define USBHS_DIEPINT7_INEPNAKEFF (0x00000040UL) +#define USBHS_DIEPINT7_TXFEMP_POS (7U) +#define USBHS_DIEPINT7_TXFEMP (0x00000080UL) +#define USBHS_DIEPINT7_TXFIFOUNDRN_POS (8U) +#define USBHS_DIEPINT7_TXFIFOUNDRN (0x00000100UL) +#define USBHS_DIEPINT7_BNAINTR_POS (9U) +#define USBHS_DIEPINT7_BNAINTR (0x00000200UL) +#define USBHS_DIEPINT7_PKTDRPSTS_POS (11U) +#define USBHS_DIEPINT7_PKTDRPSTS (0x00000800UL) +#define USBHS_DIEPINT7_BBLEERR_POS (12U) +#define USBHS_DIEPINT7_BBLEERR (0x00001000UL) +#define USBHS_DIEPINT7_NAKINTRPT_POS (13U) +#define USBHS_DIEPINT7_NAKINTRPT (0x00002000UL) +#define USBHS_DIEPINT7_NYETINTRPT_POS (14U) +#define USBHS_DIEPINT7_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBHS_DIEPTSIZ7 register */ +#define USBHS_DIEPTSIZ7_XFERSIZE_POS (0U) +#define USBHS_DIEPTSIZ7_XFERSIZE (0x0007FFFFUL) +#define USBHS_DIEPTSIZ7_XFERSIZE_0 (0x00000001UL) +#define USBHS_DIEPTSIZ7_XFERSIZE_1 (0x00000002UL) +#define USBHS_DIEPTSIZ7_XFERSIZE_2 (0x00000004UL) +#define USBHS_DIEPTSIZ7_XFERSIZE_3 (0x00000008UL) +#define USBHS_DIEPTSIZ7_XFERSIZE_4 (0x00000010UL) +#define USBHS_DIEPTSIZ7_XFERSIZE_5 (0x00000020UL) +#define USBHS_DIEPTSIZ7_XFERSIZE_6 (0x00000040UL) +#define USBHS_DIEPTSIZ7_XFERSIZE_7 (0x00000080UL) +#define USBHS_DIEPTSIZ7_XFERSIZE_8 (0x00000100UL) +#define USBHS_DIEPTSIZ7_XFERSIZE_9 (0x00000200UL) +#define USBHS_DIEPTSIZ7_XFERSIZE_10 (0x00000400UL) +#define USBHS_DIEPTSIZ7_XFERSIZE_11 (0x00000800UL) +#define USBHS_DIEPTSIZ7_XFERSIZE_12 (0x00001000UL) +#define USBHS_DIEPTSIZ7_XFERSIZE_13 (0x00002000UL) +#define USBHS_DIEPTSIZ7_XFERSIZE_14 (0x00004000UL) +#define USBHS_DIEPTSIZ7_XFERSIZE_15 (0x00008000UL) +#define USBHS_DIEPTSIZ7_XFERSIZE_16 (0x00010000UL) +#define USBHS_DIEPTSIZ7_XFERSIZE_17 (0x00020000UL) +#define USBHS_DIEPTSIZ7_XFERSIZE_18 (0x00040000UL) +#define USBHS_DIEPTSIZ7_PKTCNT_POS (19U) +#define USBHS_DIEPTSIZ7_PKTCNT (0x1FF80000UL) +#define USBHS_DIEPTSIZ7_PKTCNT_0 (0x00080000UL) +#define USBHS_DIEPTSIZ7_PKTCNT_1 (0x00100000UL) +#define USBHS_DIEPTSIZ7_PKTCNT_2 (0x00200000UL) +#define USBHS_DIEPTSIZ7_PKTCNT_3 (0x00400000UL) +#define USBHS_DIEPTSIZ7_PKTCNT_4 (0x00800000UL) +#define USBHS_DIEPTSIZ7_PKTCNT_5 (0x01000000UL) +#define USBHS_DIEPTSIZ7_PKTCNT_6 (0x02000000UL) +#define USBHS_DIEPTSIZ7_PKTCNT_7 (0x04000000UL) +#define USBHS_DIEPTSIZ7_PKTCNT_8 (0x08000000UL) +#define USBHS_DIEPTSIZ7_PKTCNT_9 (0x10000000UL) +#define USBHS_DIEPTSIZ7_MC_POS (29U) +#define USBHS_DIEPTSIZ7_MC (0x60000000UL) +#define USBHS_DIEPTSIZ7_MC_0 (0x20000000UL) +#define USBHS_DIEPTSIZ7_MC_1 (0x40000000UL) + +/* Bit definition for USBHS_DIEPDMA7 register */ +#define USBHS_DIEPDMA7 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DTXFSTS7 register */ +#define USBHS_DTXFSTS7_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBHS_DIEPCTL8 register */ +#define USBHS_DIEPCTL8_MPS_POS (0U) +#define USBHS_DIEPCTL8_MPS (0x000007FFUL) +#define USBHS_DIEPCTL8_MPS_0 (0x00000001UL) +#define USBHS_DIEPCTL8_MPS_1 (0x00000002UL) +#define USBHS_DIEPCTL8_MPS_2 (0x00000004UL) +#define USBHS_DIEPCTL8_MPS_3 (0x00000008UL) +#define USBHS_DIEPCTL8_MPS_4 (0x00000010UL) +#define USBHS_DIEPCTL8_MPS_5 (0x00000020UL) +#define USBHS_DIEPCTL8_MPS_6 (0x00000040UL) +#define USBHS_DIEPCTL8_MPS_7 (0x00000080UL) +#define USBHS_DIEPCTL8_MPS_8 (0x00000100UL) +#define USBHS_DIEPCTL8_MPS_9 (0x00000200UL) +#define USBHS_DIEPCTL8_MPS_10 (0x00000400UL) +#define USBHS_DIEPCTL8_USBACTEP_POS (15U) +#define USBHS_DIEPCTL8_USBACTEP (0x00008000UL) +#define USBHS_DIEPCTL8_DPID_POS (16U) +#define USBHS_DIEPCTL8_DPID (0x00010000UL) +#define USBHS_DIEPCTL8_NAKSTS_POS (17U) +#define USBHS_DIEPCTL8_NAKSTS (0x00020000UL) +#define USBHS_DIEPCTL8_EPTYPE_POS (18U) +#define USBHS_DIEPCTL8_EPTYPE (0x000C0000UL) +#define USBHS_DIEPCTL8_EPTYPE_0 (0x00040000UL) +#define USBHS_DIEPCTL8_EPTYPE_1 (0x00080000UL) +#define USBHS_DIEPCTL8_STALL_POS (21U) +#define USBHS_DIEPCTL8_STALL (0x00200000UL) +#define USBHS_DIEPCTL8_TXFNUM_POS (22U) +#define USBHS_DIEPCTL8_TXFNUM (0x03C00000UL) +#define USBHS_DIEPCTL8_TXFNUM_0 (0x00400000UL) +#define USBHS_DIEPCTL8_TXFNUM_1 (0x00800000UL) +#define USBHS_DIEPCTL8_TXFNUM_2 (0x01000000UL) +#define USBHS_DIEPCTL8_TXFNUM_3 (0x02000000UL) +#define USBHS_DIEPCTL8_CNAK_POS (26U) +#define USBHS_DIEPCTL8_CNAK (0x04000000UL) +#define USBHS_DIEPCTL8_SNAK_POS (27U) +#define USBHS_DIEPCTL8_SNAK (0x08000000UL) +#define USBHS_DIEPCTL8_SETD0PID_POS (28U) +#define USBHS_DIEPCTL8_SETD0PID (0x10000000UL) +#define USBHS_DIEPCTL8_SETD1PID_POS (29U) +#define USBHS_DIEPCTL8_SETD1PID (0x20000000UL) +#define USBHS_DIEPCTL8_EPDIS_POS (30U) +#define USBHS_DIEPCTL8_EPDIS (0x40000000UL) +#define USBHS_DIEPCTL8_EPENA_POS (31U) +#define USBHS_DIEPCTL8_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DIEPINT8 register */ +#define USBHS_DIEPINT8_XFERCOMPL_POS (0U) +#define USBHS_DIEPINT8_XFERCOMPL (0x00000001UL) +#define USBHS_DIEPINT8_EPDISBLD_POS (1U) +#define USBHS_DIEPINT8_EPDISBLD (0x00000002UL) +#define USBHS_DIEPINT8_AHBERR_POS (2U) +#define USBHS_DIEPINT8_AHBERR (0x00000004UL) +#define USBHS_DIEPINT8_TIMEOUT_POS (3U) +#define USBHS_DIEPINT8_TIMEOUT (0x00000008UL) +#define USBHS_DIEPINT8_INTKNTXFEMP_POS (4U) +#define USBHS_DIEPINT8_INTKNTXFEMP (0x00000010UL) +#define USBHS_DIEPINT8_INTKNEPMIS_POS (5U) +#define USBHS_DIEPINT8_INTKNEPMIS (0x00000020UL) +#define USBHS_DIEPINT8_INEPNAKEFF_POS (6U) +#define USBHS_DIEPINT8_INEPNAKEFF (0x00000040UL) +#define USBHS_DIEPINT8_TXFEMP_POS (7U) +#define USBHS_DIEPINT8_TXFEMP (0x00000080UL) +#define USBHS_DIEPINT8_TXFIFOUNDRN_POS (8U) +#define USBHS_DIEPINT8_TXFIFOUNDRN (0x00000100UL) +#define USBHS_DIEPINT8_BNAINTR_POS (9U) +#define USBHS_DIEPINT8_BNAINTR (0x00000200UL) +#define USBHS_DIEPINT8_PKTDRPSTS_POS (11U) +#define USBHS_DIEPINT8_PKTDRPSTS (0x00000800UL) +#define USBHS_DIEPINT8_BBLEERR_POS (12U) +#define USBHS_DIEPINT8_BBLEERR (0x00001000UL) +#define USBHS_DIEPINT8_NAKINTRPT_POS (13U) +#define USBHS_DIEPINT8_NAKINTRPT (0x00002000UL) +#define USBHS_DIEPINT8_NYETINTRPT_POS (14U) +#define USBHS_DIEPINT8_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBHS_DIEPTSIZ8 register */ +#define USBHS_DIEPTSIZ8_XFERSIZE_POS (0U) +#define USBHS_DIEPTSIZ8_XFERSIZE (0x0007FFFFUL) +#define USBHS_DIEPTSIZ8_XFERSIZE_0 (0x00000001UL) +#define USBHS_DIEPTSIZ8_XFERSIZE_1 (0x00000002UL) +#define USBHS_DIEPTSIZ8_XFERSIZE_2 (0x00000004UL) +#define USBHS_DIEPTSIZ8_XFERSIZE_3 (0x00000008UL) +#define USBHS_DIEPTSIZ8_XFERSIZE_4 (0x00000010UL) +#define USBHS_DIEPTSIZ8_XFERSIZE_5 (0x00000020UL) +#define USBHS_DIEPTSIZ8_XFERSIZE_6 (0x00000040UL) +#define USBHS_DIEPTSIZ8_XFERSIZE_7 (0x00000080UL) +#define USBHS_DIEPTSIZ8_XFERSIZE_8 (0x00000100UL) +#define USBHS_DIEPTSIZ8_XFERSIZE_9 (0x00000200UL) +#define USBHS_DIEPTSIZ8_XFERSIZE_10 (0x00000400UL) +#define USBHS_DIEPTSIZ8_XFERSIZE_11 (0x00000800UL) +#define USBHS_DIEPTSIZ8_XFERSIZE_12 (0x00001000UL) +#define USBHS_DIEPTSIZ8_XFERSIZE_13 (0x00002000UL) +#define USBHS_DIEPTSIZ8_XFERSIZE_14 (0x00004000UL) +#define USBHS_DIEPTSIZ8_XFERSIZE_15 (0x00008000UL) +#define USBHS_DIEPTSIZ8_XFERSIZE_16 (0x00010000UL) +#define USBHS_DIEPTSIZ8_XFERSIZE_17 (0x00020000UL) +#define USBHS_DIEPTSIZ8_XFERSIZE_18 (0x00040000UL) +#define USBHS_DIEPTSIZ8_PKTCNT_POS (19U) +#define USBHS_DIEPTSIZ8_PKTCNT (0x1FF80000UL) +#define USBHS_DIEPTSIZ8_PKTCNT_0 (0x00080000UL) +#define USBHS_DIEPTSIZ8_PKTCNT_1 (0x00100000UL) +#define USBHS_DIEPTSIZ8_PKTCNT_2 (0x00200000UL) +#define USBHS_DIEPTSIZ8_PKTCNT_3 (0x00400000UL) +#define USBHS_DIEPTSIZ8_PKTCNT_4 (0x00800000UL) +#define USBHS_DIEPTSIZ8_PKTCNT_5 (0x01000000UL) +#define USBHS_DIEPTSIZ8_PKTCNT_6 (0x02000000UL) +#define USBHS_DIEPTSIZ8_PKTCNT_7 (0x04000000UL) +#define USBHS_DIEPTSIZ8_PKTCNT_8 (0x08000000UL) +#define USBHS_DIEPTSIZ8_PKTCNT_9 (0x10000000UL) +#define USBHS_DIEPTSIZ8_MC_POS (29U) +#define USBHS_DIEPTSIZ8_MC (0x60000000UL) +#define USBHS_DIEPTSIZ8_MC_0 (0x20000000UL) +#define USBHS_DIEPTSIZ8_MC_1 (0x40000000UL) + +/* Bit definition for USBHS_DIEPDMA8 register */ +#define USBHS_DIEPDMA8 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DTXFSTS8 register */ +#define USBHS_DTXFSTS8_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBHS_DIEPCTL9 register */ +#define USBHS_DIEPCTL9_MPS_POS (0U) +#define USBHS_DIEPCTL9_MPS (0x000007FFUL) +#define USBHS_DIEPCTL9_MPS_0 (0x00000001UL) +#define USBHS_DIEPCTL9_MPS_1 (0x00000002UL) +#define USBHS_DIEPCTL9_MPS_2 (0x00000004UL) +#define USBHS_DIEPCTL9_MPS_3 (0x00000008UL) +#define USBHS_DIEPCTL9_MPS_4 (0x00000010UL) +#define USBHS_DIEPCTL9_MPS_5 (0x00000020UL) +#define USBHS_DIEPCTL9_MPS_6 (0x00000040UL) +#define USBHS_DIEPCTL9_MPS_7 (0x00000080UL) +#define USBHS_DIEPCTL9_MPS_8 (0x00000100UL) +#define USBHS_DIEPCTL9_MPS_9 (0x00000200UL) +#define USBHS_DIEPCTL9_MPS_10 (0x00000400UL) +#define USBHS_DIEPCTL9_USBACTEP_POS (15U) +#define USBHS_DIEPCTL9_USBACTEP (0x00008000UL) +#define USBHS_DIEPCTL9_DPID_POS (16U) +#define USBHS_DIEPCTL9_DPID (0x00010000UL) +#define USBHS_DIEPCTL9_NAKSTS_POS (17U) +#define USBHS_DIEPCTL9_NAKSTS (0x00020000UL) +#define USBHS_DIEPCTL9_EPTYPE_POS (18U) +#define USBHS_DIEPCTL9_EPTYPE (0x000C0000UL) +#define USBHS_DIEPCTL9_EPTYPE_0 (0x00040000UL) +#define USBHS_DIEPCTL9_EPTYPE_1 (0x00080000UL) +#define USBHS_DIEPCTL9_STALL_POS (21U) +#define USBHS_DIEPCTL9_STALL (0x00200000UL) +#define USBHS_DIEPCTL9_TXFNUM_POS (22U) +#define USBHS_DIEPCTL9_TXFNUM (0x03C00000UL) +#define USBHS_DIEPCTL9_TXFNUM_0 (0x00400000UL) +#define USBHS_DIEPCTL9_TXFNUM_1 (0x00800000UL) +#define USBHS_DIEPCTL9_TXFNUM_2 (0x01000000UL) +#define USBHS_DIEPCTL9_TXFNUM_3 (0x02000000UL) +#define USBHS_DIEPCTL9_CNAK_POS (26U) +#define USBHS_DIEPCTL9_CNAK (0x04000000UL) +#define USBHS_DIEPCTL9_SNAK_POS (27U) +#define USBHS_DIEPCTL9_SNAK (0x08000000UL) +#define USBHS_DIEPCTL9_SETD0PID_POS (28U) +#define USBHS_DIEPCTL9_SETD0PID (0x10000000UL) +#define USBHS_DIEPCTL9_SETD1PID_POS (29U) +#define USBHS_DIEPCTL9_SETD1PID (0x20000000UL) +#define USBHS_DIEPCTL9_EPDIS_POS (30U) +#define USBHS_DIEPCTL9_EPDIS (0x40000000UL) +#define USBHS_DIEPCTL9_EPENA_POS (31U) +#define USBHS_DIEPCTL9_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DIEPINT9 register */ +#define USBHS_DIEPINT9_XFERCOMPL_POS (0U) +#define USBHS_DIEPINT9_XFERCOMPL (0x00000001UL) +#define USBHS_DIEPINT9_EPDISBLD_POS (1U) +#define USBHS_DIEPINT9_EPDISBLD (0x00000002UL) +#define USBHS_DIEPINT9_AHBERR_POS (2U) +#define USBHS_DIEPINT9_AHBERR (0x00000004UL) +#define USBHS_DIEPINT9_TIMEOUT_POS (3U) +#define USBHS_DIEPINT9_TIMEOUT (0x00000008UL) +#define USBHS_DIEPINT9_INTKNTXFEMP_POS (4U) +#define USBHS_DIEPINT9_INTKNTXFEMP (0x00000010UL) +#define USBHS_DIEPINT9_INTKNEPMIS_POS (5U) +#define USBHS_DIEPINT9_INTKNEPMIS (0x00000020UL) +#define USBHS_DIEPINT9_INEPNAKEFF_POS (6U) +#define USBHS_DIEPINT9_INEPNAKEFF (0x00000040UL) +#define USBHS_DIEPINT9_TXFEMP_POS (7U) +#define USBHS_DIEPINT9_TXFEMP (0x00000080UL) +#define USBHS_DIEPINT9_TXFIFOUNDRN_POS (8U) +#define USBHS_DIEPINT9_TXFIFOUNDRN (0x00000100UL) +#define USBHS_DIEPINT9_BNAINTR_POS (9U) +#define USBHS_DIEPINT9_BNAINTR (0x00000200UL) +#define USBHS_DIEPINT9_PKTDRPSTS_POS (11U) +#define USBHS_DIEPINT9_PKTDRPSTS (0x00000800UL) +#define USBHS_DIEPINT9_BBLEERR_POS (12U) +#define USBHS_DIEPINT9_BBLEERR (0x00001000UL) +#define USBHS_DIEPINT9_NAKINTRPT_POS (13U) +#define USBHS_DIEPINT9_NAKINTRPT (0x00002000UL) +#define USBHS_DIEPINT9_NYETINTRPT_POS (14U) +#define USBHS_DIEPINT9_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBHS_DIEPTSIZ9 register */ +#define USBHS_DIEPTSIZ9_XFERSIZE_POS (0U) +#define USBHS_DIEPTSIZ9_XFERSIZE (0x0007FFFFUL) +#define USBHS_DIEPTSIZ9_XFERSIZE_0 (0x00000001UL) +#define USBHS_DIEPTSIZ9_XFERSIZE_1 (0x00000002UL) +#define USBHS_DIEPTSIZ9_XFERSIZE_2 (0x00000004UL) +#define USBHS_DIEPTSIZ9_XFERSIZE_3 (0x00000008UL) +#define USBHS_DIEPTSIZ9_XFERSIZE_4 (0x00000010UL) +#define USBHS_DIEPTSIZ9_XFERSIZE_5 (0x00000020UL) +#define USBHS_DIEPTSIZ9_XFERSIZE_6 (0x00000040UL) +#define USBHS_DIEPTSIZ9_XFERSIZE_7 (0x00000080UL) +#define USBHS_DIEPTSIZ9_XFERSIZE_8 (0x00000100UL) +#define USBHS_DIEPTSIZ9_XFERSIZE_9 (0x00000200UL) +#define USBHS_DIEPTSIZ9_XFERSIZE_10 (0x00000400UL) +#define USBHS_DIEPTSIZ9_XFERSIZE_11 (0x00000800UL) +#define USBHS_DIEPTSIZ9_XFERSIZE_12 (0x00001000UL) +#define USBHS_DIEPTSIZ9_XFERSIZE_13 (0x00002000UL) +#define USBHS_DIEPTSIZ9_XFERSIZE_14 (0x00004000UL) +#define USBHS_DIEPTSIZ9_XFERSIZE_15 (0x00008000UL) +#define USBHS_DIEPTSIZ9_XFERSIZE_16 (0x00010000UL) +#define USBHS_DIEPTSIZ9_XFERSIZE_17 (0x00020000UL) +#define USBHS_DIEPTSIZ9_XFERSIZE_18 (0x00040000UL) +#define USBHS_DIEPTSIZ9_PKTCNT_POS (19U) +#define USBHS_DIEPTSIZ9_PKTCNT (0x1FF80000UL) +#define USBHS_DIEPTSIZ9_PKTCNT_0 (0x00080000UL) +#define USBHS_DIEPTSIZ9_PKTCNT_1 (0x00100000UL) +#define USBHS_DIEPTSIZ9_PKTCNT_2 (0x00200000UL) +#define USBHS_DIEPTSIZ9_PKTCNT_3 (0x00400000UL) +#define USBHS_DIEPTSIZ9_PKTCNT_4 (0x00800000UL) +#define USBHS_DIEPTSIZ9_PKTCNT_5 (0x01000000UL) +#define USBHS_DIEPTSIZ9_PKTCNT_6 (0x02000000UL) +#define USBHS_DIEPTSIZ9_PKTCNT_7 (0x04000000UL) +#define USBHS_DIEPTSIZ9_PKTCNT_8 (0x08000000UL) +#define USBHS_DIEPTSIZ9_PKTCNT_9 (0x10000000UL) +#define USBHS_DIEPTSIZ9_MC_POS (29U) +#define USBHS_DIEPTSIZ9_MC (0x60000000UL) +#define USBHS_DIEPTSIZ9_MC_0 (0x20000000UL) +#define USBHS_DIEPTSIZ9_MC_1 (0x40000000UL) + +/* Bit definition for USBHS_DIEPDMA9 register */ +#define USBHS_DIEPDMA9 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DTXFSTS9 register */ +#define USBHS_DTXFSTS9_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBHS_DIEPCTL10 register */ +#define USBHS_DIEPCTL10_MPS_POS (0U) +#define USBHS_DIEPCTL10_MPS (0x000007FFUL) +#define USBHS_DIEPCTL10_MPS_0 (0x00000001UL) +#define USBHS_DIEPCTL10_MPS_1 (0x00000002UL) +#define USBHS_DIEPCTL10_MPS_2 (0x00000004UL) +#define USBHS_DIEPCTL10_MPS_3 (0x00000008UL) +#define USBHS_DIEPCTL10_MPS_4 (0x00000010UL) +#define USBHS_DIEPCTL10_MPS_5 (0x00000020UL) +#define USBHS_DIEPCTL10_MPS_6 (0x00000040UL) +#define USBHS_DIEPCTL10_MPS_7 (0x00000080UL) +#define USBHS_DIEPCTL10_MPS_8 (0x00000100UL) +#define USBHS_DIEPCTL10_MPS_9 (0x00000200UL) +#define USBHS_DIEPCTL10_MPS_10 (0x00000400UL) +#define USBHS_DIEPCTL10_USBACTEP_POS (15U) +#define USBHS_DIEPCTL10_USBACTEP (0x00008000UL) +#define USBHS_DIEPCTL10_DPID_POS (16U) +#define USBHS_DIEPCTL10_DPID (0x00010000UL) +#define USBHS_DIEPCTL10_NAKSTS_POS (17U) +#define USBHS_DIEPCTL10_NAKSTS (0x00020000UL) +#define USBHS_DIEPCTL10_EPTYPE_POS (18U) +#define USBHS_DIEPCTL10_EPTYPE (0x000C0000UL) +#define USBHS_DIEPCTL10_EPTYPE_0 (0x00040000UL) +#define USBHS_DIEPCTL10_EPTYPE_1 (0x00080000UL) +#define USBHS_DIEPCTL10_STALL_POS (21U) +#define USBHS_DIEPCTL10_STALL (0x00200000UL) +#define USBHS_DIEPCTL10_TXFNUM_POS (22U) +#define USBHS_DIEPCTL10_TXFNUM (0x03C00000UL) +#define USBHS_DIEPCTL10_TXFNUM_0 (0x00400000UL) +#define USBHS_DIEPCTL10_TXFNUM_1 (0x00800000UL) +#define USBHS_DIEPCTL10_TXFNUM_2 (0x01000000UL) +#define USBHS_DIEPCTL10_TXFNUM_3 (0x02000000UL) +#define USBHS_DIEPCTL10_CNAK_POS (26U) +#define USBHS_DIEPCTL10_CNAK (0x04000000UL) +#define USBHS_DIEPCTL10_SNAK_POS (27U) +#define USBHS_DIEPCTL10_SNAK (0x08000000UL) +#define USBHS_DIEPCTL10_SETD0PID_POS (28U) +#define USBHS_DIEPCTL10_SETD0PID (0x10000000UL) +#define USBHS_DIEPCTL10_SETD1PID_POS (29U) +#define USBHS_DIEPCTL10_SETD1PID (0x20000000UL) +#define USBHS_DIEPCTL10_EPDIS_POS (30U) +#define USBHS_DIEPCTL10_EPDIS (0x40000000UL) +#define USBHS_DIEPCTL10_EPENA_POS (31U) +#define USBHS_DIEPCTL10_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DIEPINT10 register */ +#define USBHS_DIEPINT10_XFERCOMPL_POS (0U) +#define USBHS_DIEPINT10_XFERCOMPL (0x00000001UL) +#define USBHS_DIEPINT10_EPDISBLD_POS (1U) +#define USBHS_DIEPINT10_EPDISBLD (0x00000002UL) +#define USBHS_DIEPINT10_AHBERR_POS (2U) +#define USBHS_DIEPINT10_AHBERR (0x00000004UL) +#define USBHS_DIEPINT10_TIMEOUT_POS (3U) +#define USBHS_DIEPINT10_TIMEOUT (0x00000008UL) +#define USBHS_DIEPINT10_INTKNTXFEMP_POS (4U) +#define USBHS_DIEPINT10_INTKNTXFEMP (0x00000010UL) +#define USBHS_DIEPINT10_INTKNEPMIS_POS (5U) +#define USBHS_DIEPINT10_INTKNEPMIS (0x00000020UL) +#define USBHS_DIEPINT10_INEPNAKEFF_POS (6U) +#define USBHS_DIEPINT10_INEPNAKEFF (0x00000040UL) +#define USBHS_DIEPINT10_TXFEMP_POS (7U) +#define USBHS_DIEPINT10_TXFEMP (0x00000080UL) +#define USBHS_DIEPINT10_TXFIFOUNDRN_POS (8U) +#define USBHS_DIEPINT10_TXFIFOUNDRN (0x00000100UL) +#define USBHS_DIEPINT10_BNAINTR_POS (9U) +#define USBHS_DIEPINT10_BNAINTR (0x00000200UL) +#define USBHS_DIEPINT10_PKTDRPSTS_POS (11U) +#define USBHS_DIEPINT10_PKTDRPSTS (0x00000800UL) +#define USBHS_DIEPINT10_BBLEERR_POS (12U) +#define USBHS_DIEPINT10_BBLEERR (0x00001000UL) +#define USBHS_DIEPINT10_NAKINTRPT_POS (13U) +#define USBHS_DIEPINT10_NAKINTRPT (0x00002000UL) +#define USBHS_DIEPINT10_NYETINTRPT_POS (14U) +#define USBHS_DIEPINT10_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBHS_DIEPTSIZ10 register */ +#define USBHS_DIEPTSIZ10_XFERSIZE_POS (0U) +#define USBHS_DIEPTSIZ10_XFERSIZE (0x0007FFFFUL) +#define USBHS_DIEPTSIZ10_XFERSIZE_0 (0x00000001UL) +#define USBHS_DIEPTSIZ10_XFERSIZE_1 (0x00000002UL) +#define USBHS_DIEPTSIZ10_XFERSIZE_2 (0x00000004UL) +#define USBHS_DIEPTSIZ10_XFERSIZE_3 (0x00000008UL) +#define USBHS_DIEPTSIZ10_XFERSIZE_4 (0x00000010UL) +#define USBHS_DIEPTSIZ10_XFERSIZE_5 (0x00000020UL) +#define USBHS_DIEPTSIZ10_XFERSIZE_6 (0x00000040UL) +#define USBHS_DIEPTSIZ10_XFERSIZE_7 (0x00000080UL) +#define USBHS_DIEPTSIZ10_XFERSIZE_8 (0x00000100UL) +#define USBHS_DIEPTSIZ10_XFERSIZE_9 (0x00000200UL) +#define USBHS_DIEPTSIZ10_XFERSIZE_10 (0x00000400UL) +#define USBHS_DIEPTSIZ10_XFERSIZE_11 (0x00000800UL) +#define USBHS_DIEPTSIZ10_XFERSIZE_12 (0x00001000UL) +#define USBHS_DIEPTSIZ10_XFERSIZE_13 (0x00002000UL) +#define USBHS_DIEPTSIZ10_XFERSIZE_14 (0x00004000UL) +#define USBHS_DIEPTSIZ10_XFERSIZE_15 (0x00008000UL) +#define USBHS_DIEPTSIZ10_XFERSIZE_16 (0x00010000UL) +#define USBHS_DIEPTSIZ10_XFERSIZE_17 (0x00020000UL) +#define USBHS_DIEPTSIZ10_XFERSIZE_18 (0x00040000UL) +#define USBHS_DIEPTSIZ10_PKTCNT_POS (19U) +#define USBHS_DIEPTSIZ10_PKTCNT (0x1FF80000UL) +#define USBHS_DIEPTSIZ10_PKTCNT_0 (0x00080000UL) +#define USBHS_DIEPTSIZ10_PKTCNT_1 (0x00100000UL) +#define USBHS_DIEPTSIZ10_PKTCNT_2 (0x00200000UL) +#define USBHS_DIEPTSIZ10_PKTCNT_3 (0x00400000UL) +#define USBHS_DIEPTSIZ10_PKTCNT_4 (0x00800000UL) +#define USBHS_DIEPTSIZ10_PKTCNT_5 (0x01000000UL) +#define USBHS_DIEPTSIZ10_PKTCNT_6 (0x02000000UL) +#define USBHS_DIEPTSIZ10_PKTCNT_7 (0x04000000UL) +#define USBHS_DIEPTSIZ10_PKTCNT_8 (0x08000000UL) +#define USBHS_DIEPTSIZ10_PKTCNT_9 (0x10000000UL) +#define USBHS_DIEPTSIZ10_MC_POS (29U) +#define USBHS_DIEPTSIZ10_MC (0x60000000UL) +#define USBHS_DIEPTSIZ10_MC_0 (0x20000000UL) +#define USBHS_DIEPTSIZ10_MC_1 (0x40000000UL) + +/* Bit definition for USBHS_DIEPDMA10 register */ +#define USBHS_DIEPDMA10 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DTXFSTS10 register */ +#define USBHS_DTXFSTS10_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBHS_DIEPCTL11 register */ +#define USBHS_DIEPCTL11_MPS_POS (0U) +#define USBHS_DIEPCTL11_MPS (0x000007FFUL) +#define USBHS_DIEPCTL11_MPS_0 (0x00000001UL) +#define USBHS_DIEPCTL11_MPS_1 (0x00000002UL) +#define USBHS_DIEPCTL11_MPS_2 (0x00000004UL) +#define USBHS_DIEPCTL11_MPS_3 (0x00000008UL) +#define USBHS_DIEPCTL11_MPS_4 (0x00000010UL) +#define USBHS_DIEPCTL11_MPS_5 (0x00000020UL) +#define USBHS_DIEPCTL11_MPS_6 (0x00000040UL) +#define USBHS_DIEPCTL11_MPS_7 (0x00000080UL) +#define USBHS_DIEPCTL11_MPS_8 (0x00000100UL) +#define USBHS_DIEPCTL11_MPS_9 (0x00000200UL) +#define USBHS_DIEPCTL11_MPS_10 (0x00000400UL) +#define USBHS_DIEPCTL11_USBACTEP_POS (15U) +#define USBHS_DIEPCTL11_USBACTEP (0x00008000UL) +#define USBHS_DIEPCTL11_DPID_POS (16U) +#define USBHS_DIEPCTL11_DPID (0x00010000UL) +#define USBHS_DIEPCTL11_NAKSTS_POS (17U) +#define USBHS_DIEPCTL11_NAKSTS (0x00020000UL) +#define USBHS_DIEPCTL11_EPTYPE_POS (18U) +#define USBHS_DIEPCTL11_EPTYPE (0x000C0000UL) +#define USBHS_DIEPCTL11_EPTYPE_0 (0x00040000UL) +#define USBHS_DIEPCTL11_EPTYPE_1 (0x00080000UL) +#define USBHS_DIEPCTL11_STALL_POS (21U) +#define USBHS_DIEPCTL11_STALL (0x00200000UL) +#define USBHS_DIEPCTL11_TXFNUM_POS (22U) +#define USBHS_DIEPCTL11_TXFNUM (0x03C00000UL) +#define USBHS_DIEPCTL11_TXFNUM_0 (0x00400000UL) +#define USBHS_DIEPCTL11_TXFNUM_1 (0x00800000UL) +#define USBHS_DIEPCTL11_TXFNUM_2 (0x01000000UL) +#define USBHS_DIEPCTL11_TXFNUM_3 (0x02000000UL) +#define USBHS_DIEPCTL11_CNAK_POS (26U) +#define USBHS_DIEPCTL11_CNAK (0x04000000UL) +#define USBHS_DIEPCTL11_SNAK_POS (27U) +#define USBHS_DIEPCTL11_SNAK (0x08000000UL) +#define USBHS_DIEPCTL11_SETD0PID_POS (28U) +#define USBHS_DIEPCTL11_SETD0PID (0x10000000UL) +#define USBHS_DIEPCTL11_SETD1PID_POS (29U) +#define USBHS_DIEPCTL11_SETD1PID (0x20000000UL) +#define USBHS_DIEPCTL11_EPDIS_POS (30U) +#define USBHS_DIEPCTL11_EPDIS (0x40000000UL) +#define USBHS_DIEPCTL11_EPENA_POS (31U) +#define USBHS_DIEPCTL11_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DIEPINT11 register */ +#define USBHS_DIEPINT11_XFERCOMPL_POS (0U) +#define USBHS_DIEPINT11_XFERCOMPL (0x00000001UL) +#define USBHS_DIEPINT11_EPDISBLD_POS (1U) +#define USBHS_DIEPINT11_EPDISBLD (0x00000002UL) +#define USBHS_DIEPINT11_AHBERR_POS (2U) +#define USBHS_DIEPINT11_AHBERR (0x00000004UL) +#define USBHS_DIEPINT11_TIMEOUT_POS (3U) +#define USBHS_DIEPINT11_TIMEOUT (0x00000008UL) +#define USBHS_DIEPINT11_INTKNTXFEMP_POS (4U) +#define USBHS_DIEPINT11_INTKNTXFEMP (0x00000010UL) +#define USBHS_DIEPINT11_INTKNEPMIS_POS (5U) +#define USBHS_DIEPINT11_INTKNEPMIS (0x00000020UL) +#define USBHS_DIEPINT11_INEPNAKEFF_POS (6U) +#define USBHS_DIEPINT11_INEPNAKEFF (0x00000040UL) +#define USBHS_DIEPINT11_TXFEMP_POS (7U) +#define USBHS_DIEPINT11_TXFEMP (0x00000080UL) +#define USBHS_DIEPINT11_TXFIFOUNDRN_POS (8U) +#define USBHS_DIEPINT11_TXFIFOUNDRN (0x00000100UL) +#define USBHS_DIEPINT11_BNAINTR_POS (9U) +#define USBHS_DIEPINT11_BNAINTR (0x00000200UL) +#define USBHS_DIEPINT11_PKTDRPSTS_POS (11U) +#define USBHS_DIEPINT11_PKTDRPSTS (0x00000800UL) +#define USBHS_DIEPINT11_BBLEERR_POS (12U) +#define USBHS_DIEPINT11_BBLEERR (0x00001000UL) +#define USBHS_DIEPINT11_NAKINTRPT_POS (13U) +#define USBHS_DIEPINT11_NAKINTRPT (0x00002000UL) +#define USBHS_DIEPINT11_NYETINTRPT_POS (14U) +#define USBHS_DIEPINT11_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBHS_DIEPTSIZ11 register */ +#define USBHS_DIEPTSIZ11_XFERSIZE_POS (0U) +#define USBHS_DIEPTSIZ11_XFERSIZE (0x0007FFFFUL) +#define USBHS_DIEPTSIZ11_XFERSIZE_0 (0x00000001UL) +#define USBHS_DIEPTSIZ11_XFERSIZE_1 (0x00000002UL) +#define USBHS_DIEPTSIZ11_XFERSIZE_2 (0x00000004UL) +#define USBHS_DIEPTSIZ11_XFERSIZE_3 (0x00000008UL) +#define USBHS_DIEPTSIZ11_XFERSIZE_4 (0x00000010UL) +#define USBHS_DIEPTSIZ11_XFERSIZE_5 (0x00000020UL) +#define USBHS_DIEPTSIZ11_XFERSIZE_6 (0x00000040UL) +#define USBHS_DIEPTSIZ11_XFERSIZE_7 (0x00000080UL) +#define USBHS_DIEPTSIZ11_XFERSIZE_8 (0x00000100UL) +#define USBHS_DIEPTSIZ11_XFERSIZE_9 (0x00000200UL) +#define USBHS_DIEPTSIZ11_XFERSIZE_10 (0x00000400UL) +#define USBHS_DIEPTSIZ11_XFERSIZE_11 (0x00000800UL) +#define USBHS_DIEPTSIZ11_XFERSIZE_12 (0x00001000UL) +#define USBHS_DIEPTSIZ11_XFERSIZE_13 (0x00002000UL) +#define USBHS_DIEPTSIZ11_XFERSIZE_14 (0x00004000UL) +#define USBHS_DIEPTSIZ11_XFERSIZE_15 (0x00008000UL) +#define USBHS_DIEPTSIZ11_XFERSIZE_16 (0x00010000UL) +#define USBHS_DIEPTSIZ11_XFERSIZE_17 (0x00020000UL) +#define USBHS_DIEPTSIZ11_XFERSIZE_18 (0x00040000UL) +#define USBHS_DIEPTSIZ11_PKTCNT_POS (19U) +#define USBHS_DIEPTSIZ11_PKTCNT (0x1FF80000UL) +#define USBHS_DIEPTSIZ11_PKTCNT_0 (0x00080000UL) +#define USBHS_DIEPTSIZ11_PKTCNT_1 (0x00100000UL) +#define USBHS_DIEPTSIZ11_PKTCNT_2 (0x00200000UL) +#define USBHS_DIEPTSIZ11_PKTCNT_3 (0x00400000UL) +#define USBHS_DIEPTSIZ11_PKTCNT_4 (0x00800000UL) +#define USBHS_DIEPTSIZ11_PKTCNT_5 (0x01000000UL) +#define USBHS_DIEPTSIZ11_PKTCNT_6 (0x02000000UL) +#define USBHS_DIEPTSIZ11_PKTCNT_7 (0x04000000UL) +#define USBHS_DIEPTSIZ11_PKTCNT_8 (0x08000000UL) +#define USBHS_DIEPTSIZ11_PKTCNT_9 (0x10000000UL) +#define USBHS_DIEPTSIZ11_MC_POS (29U) +#define USBHS_DIEPTSIZ11_MC (0x60000000UL) +#define USBHS_DIEPTSIZ11_MC_0 (0x20000000UL) +#define USBHS_DIEPTSIZ11_MC_1 (0x40000000UL) + +/* Bit definition for USBHS_DIEPDMA11 register */ +#define USBHS_DIEPDMA11 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DTXFSTS11 register */ +#define USBHS_DTXFSTS11_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBHS_DIEPCTL12 register */ +#define USBHS_DIEPCTL12_MPS_POS (0U) +#define USBHS_DIEPCTL12_MPS (0x000007FFUL) +#define USBHS_DIEPCTL12_MPS_0 (0x00000001UL) +#define USBHS_DIEPCTL12_MPS_1 (0x00000002UL) +#define USBHS_DIEPCTL12_MPS_2 (0x00000004UL) +#define USBHS_DIEPCTL12_MPS_3 (0x00000008UL) +#define USBHS_DIEPCTL12_MPS_4 (0x00000010UL) +#define USBHS_DIEPCTL12_MPS_5 (0x00000020UL) +#define USBHS_DIEPCTL12_MPS_6 (0x00000040UL) +#define USBHS_DIEPCTL12_MPS_7 (0x00000080UL) +#define USBHS_DIEPCTL12_MPS_8 (0x00000100UL) +#define USBHS_DIEPCTL12_MPS_9 (0x00000200UL) +#define USBHS_DIEPCTL12_MPS_10 (0x00000400UL) +#define USBHS_DIEPCTL12_USBACTEP_POS (15U) +#define USBHS_DIEPCTL12_USBACTEP (0x00008000UL) +#define USBHS_DIEPCTL12_DPID_POS (16U) +#define USBHS_DIEPCTL12_DPID (0x00010000UL) +#define USBHS_DIEPCTL12_NAKSTS_POS (17U) +#define USBHS_DIEPCTL12_NAKSTS (0x00020000UL) +#define USBHS_DIEPCTL12_EPTYPE_POS (18U) +#define USBHS_DIEPCTL12_EPTYPE (0x000C0000UL) +#define USBHS_DIEPCTL12_EPTYPE_0 (0x00040000UL) +#define USBHS_DIEPCTL12_EPTYPE_1 (0x00080000UL) +#define USBHS_DIEPCTL12_STALL_POS (21U) +#define USBHS_DIEPCTL12_STALL (0x00200000UL) +#define USBHS_DIEPCTL12_TXFNUM_POS (22U) +#define USBHS_DIEPCTL12_TXFNUM (0x03C00000UL) +#define USBHS_DIEPCTL12_TXFNUM_0 (0x00400000UL) +#define USBHS_DIEPCTL12_TXFNUM_1 (0x00800000UL) +#define USBHS_DIEPCTL12_TXFNUM_2 (0x01000000UL) +#define USBHS_DIEPCTL12_TXFNUM_3 (0x02000000UL) +#define USBHS_DIEPCTL12_CNAK_POS (26U) +#define USBHS_DIEPCTL12_CNAK (0x04000000UL) +#define USBHS_DIEPCTL12_SNAK_POS (27U) +#define USBHS_DIEPCTL12_SNAK (0x08000000UL) +#define USBHS_DIEPCTL12_SETD0PID_POS (28U) +#define USBHS_DIEPCTL12_SETD0PID (0x10000000UL) +#define USBHS_DIEPCTL12_SETD1PID_POS (29U) +#define USBHS_DIEPCTL12_SETD1PID (0x20000000UL) +#define USBHS_DIEPCTL12_EPDIS_POS (30U) +#define USBHS_DIEPCTL12_EPDIS (0x40000000UL) +#define USBHS_DIEPCTL12_EPENA_POS (31U) +#define USBHS_DIEPCTL12_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DIEPINT12 register */ +#define USBHS_DIEPINT12_XFERCOMPL_POS (0U) +#define USBHS_DIEPINT12_XFERCOMPL (0x00000001UL) +#define USBHS_DIEPINT12_EPDISBLD_POS (1U) +#define USBHS_DIEPINT12_EPDISBLD (0x00000002UL) +#define USBHS_DIEPINT12_AHBERR_POS (2U) +#define USBHS_DIEPINT12_AHBERR (0x00000004UL) +#define USBHS_DIEPINT12_TIMEOUT_POS (3U) +#define USBHS_DIEPINT12_TIMEOUT (0x00000008UL) +#define USBHS_DIEPINT12_INTKNTXFEMP_POS (4U) +#define USBHS_DIEPINT12_INTKNTXFEMP (0x00000010UL) +#define USBHS_DIEPINT12_INTKNEPMIS_POS (5U) +#define USBHS_DIEPINT12_INTKNEPMIS (0x00000020UL) +#define USBHS_DIEPINT12_INEPNAKEFF_POS (6U) +#define USBHS_DIEPINT12_INEPNAKEFF (0x00000040UL) +#define USBHS_DIEPINT12_TXFEMP_POS (7U) +#define USBHS_DIEPINT12_TXFEMP (0x00000080UL) +#define USBHS_DIEPINT12_TXFIFOUNDRN_POS (8U) +#define USBHS_DIEPINT12_TXFIFOUNDRN (0x00000100UL) +#define USBHS_DIEPINT12_BNAINTR_POS (9U) +#define USBHS_DIEPINT12_BNAINTR (0x00000200UL) +#define USBHS_DIEPINT12_PKTDRPSTS_POS (11U) +#define USBHS_DIEPINT12_PKTDRPSTS (0x00000800UL) +#define USBHS_DIEPINT12_BBLEERR_POS (12U) +#define USBHS_DIEPINT12_BBLEERR (0x00001000UL) +#define USBHS_DIEPINT12_NAKINTRPT_POS (13U) +#define USBHS_DIEPINT12_NAKINTRPT (0x00002000UL) +#define USBHS_DIEPINT12_NYETINTRPT_POS (14U) +#define USBHS_DIEPINT12_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBHS_DIEPTSIZ12 register */ +#define USBHS_DIEPTSIZ12_XFERSIZE_POS (0U) +#define USBHS_DIEPTSIZ12_XFERSIZE (0x0007FFFFUL) +#define USBHS_DIEPTSIZ12_XFERSIZE_0 (0x00000001UL) +#define USBHS_DIEPTSIZ12_XFERSIZE_1 (0x00000002UL) +#define USBHS_DIEPTSIZ12_XFERSIZE_2 (0x00000004UL) +#define USBHS_DIEPTSIZ12_XFERSIZE_3 (0x00000008UL) +#define USBHS_DIEPTSIZ12_XFERSIZE_4 (0x00000010UL) +#define USBHS_DIEPTSIZ12_XFERSIZE_5 (0x00000020UL) +#define USBHS_DIEPTSIZ12_XFERSIZE_6 (0x00000040UL) +#define USBHS_DIEPTSIZ12_XFERSIZE_7 (0x00000080UL) +#define USBHS_DIEPTSIZ12_XFERSIZE_8 (0x00000100UL) +#define USBHS_DIEPTSIZ12_XFERSIZE_9 (0x00000200UL) +#define USBHS_DIEPTSIZ12_XFERSIZE_10 (0x00000400UL) +#define USBHS_DIEPTSIZ12_XFERSIZE_11 (0x00000800UL) +#define USBHS_DIEPTSIZ12_XFERSIZE_12 (0x00001000UL) +#define USBHS_DIEPTSIZ12_XFERSIZE_13 (0x00002000UL) +#define USBHS_DIEPTSIZ12_XFERSIZE_14 (0x00004000UL) +#define USBHS_DIEPTSIZ12_XFERSIZE_15 (0x00008000UL) +#define USBHS_DIEPTSIZ12_XFERSIZE_16 (0x00010000UL) +#define USBHS_DIEPTSIZ12_XFERSIZE_17 (0x00020000UL) +#define USBHS_DIEPTSIZ12_XFERSIZE_18 (0x00040000UL) +#define USBHS_DIEPTSIZ12_PKTCNT_POS (19U) +#define USBHS_DIEPTSIZ12_PKTCNT (0x1FF80000UL) +#define USBHS_DIEPTSIZ12_PKTCNT_0 (0x00080000UL) +#define USBHS_DIEPTSIZ12_PKTCNT_1 (0x00100000UL) +#define USBHS_DIEPTSIZ12_PKTCNT_2 (0x00200000UL) +#define USBHS_DIEPTSIZ12_PKTCNT_3 (0x00400000UL) +#define USBHS_DIEPTSIZ12_PKTCNT_4 (0x00800000UL) +#define USBHS_DIEPTSIZ12_PKTCNT_5 (0x01000000UL) +#define USBHS_DIEPTSIZ12_PKTCNT_6 (0x02000000UL) +#define USBHS_DIEPTSIZ12_PKTCNT_7 (0x04000000UL) +#define USBHS_DIEPTSIZ12_PKTCNT_8 (0x08000000UL) +#define USBHS_DIEPTSIZ12_PKTCNT_9 (0x10000000UL) +#define USBHS_DIEPTSIZ12_MC_POS (29U) +#define USBHS_DIEPTSIZ12_MC (0x60000000UL) +#define USBHS_DIEPTSIZ12_MC_0 (0x20000000UL) +#define USBHS_DIEPTSIZ12_MC_1 (0x40000000UL) + +/* Bit definition for USBHS_DIEPDMA12 register */ +#define USBHS_DIEPDMA12 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DTXFSTS12 register */ +#define USBHS_DTXFSTS12_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBHS_DIEPCTL13 register */ +#define USBHS_DIEPCTL13_MPS_POS (0U) +#define USBHS_DIEPCTL13_MPS (0x000007FFUL) +#define USBHS_DIEPCTL13_MPS_0 (0x00000001UL) +#define USBHS_DIEPCTL13_MPS_1 (0x00000002UL) +#define USBHS_DIEPCTL13_MPS_2 (0x00000004UL) +#define USBHS_DIEPCTL13_MPS_3 (0x00000008UL) +#define USBHS_DIEPCTL13_MPS_4 (0x00000010UL) +#define USBHS_DIEPCTL13_MPS_5 (0x00000020UL) +#define USBHS_DIEPCTL13_MPS_6 (0x00000040UL) +#define USBHS_DIEPCTL13_MPS_7 (0x00000080UL) +#define USBHS_DIEPCTL13_MPS_8 (0x00000100UL) +#define USBHS_DIEPCTL13_MPS_9 (0x00000200UL) +#define USBHS_DIEPCTL13_MPS_10 (0x00000400UL) +#define USBHS_DIEPCTL13_USBACTEP_POS (15U) +#define USBHS_DIEPCTL13_USBACTEP (0x00008000UL) +#define USBHS_DIEPCTL13_DPID_POS (16U) +#define USBHS_DIEPCTL13_DPID (0x00010000UL) +#define USBHS_DIEPCTL13_NAKSTS_POS (17U) +#define USBHS_DIEPCTL13_NAKSTS (0x00020000UL) +#define USBHS_DIEPCTL13_EPTYPE_POS (18U) +#define USBHS_DIEPCTL13_EPTYPE (0x000C0000UL) +#define USBHS_DIEPCTL13_EPTYPE_0 (0x00040000UL) +#define USBHS_DIEPCTL13_EPTYPE_1 (0x00080000UL) +#define USBHS_DIEPCTL13_STALL_POS (21U) +#define USBHS_DIEPCTL13_STALL (0x00200000UL) +#define USBHS_DIEPCTL13_TXFNUM_POS (22U) +#define USBHS_DIEPCTL13_TXFNUM (0x03C00000UL) +#define USBHS_DIEPCTL13_TXFNUM_0 (0x00400000UL) +#define USBHS_DIEPCTL13_TXFNUM_1 (0x00800000UL) +#define USBHS_DIEPCTL13_TXFNUM_2 (0x01000000UL) +#define USBHS_DIEPCTL13_TXFNUM_3 (0x02000000UL) +#define USBHS_DIEPCTL13_CNAK_POS (26U) +#define USBHS_DIEPCTL13_CNAK (0x04000000UL) +#define USBHS_DIEPCTL13_SNAK_POS (27U) +#define USBHS_DIEPCTL13_SNAK (0x08000000UL) +#define USBHS_DIEPCTL13_SETD0PID_POS (28U) +#define USBHS_DIEPCTL13_SETD0PID (0x10000000UL) +#define USBHS_DIEPCTL13_SETD1PID_POS (29U) +#define USBHS_DIEPCTL13_SETD1PID (0x20000000UL) +#define USBHS_DIEPCTL13_EPDIS_POS (30U) +#define USBHS_DIEPCTL13_EPDIS (0x40000000UL) +#define USBHS_DIEPCTL13_EPENA_POS (31U) +#define USBHS_DIEPCTL13_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DIEPINT13 register */ +#define USBHS_DIEPINT13_XFERCOMPL_POS (0U) +#define USBHS_DIEPINT13_XFERCOMPL (0x00000001UL) +#define USBHS_DIEPINT13_EPDISBLD_POS (1U) +#define USBHS_DIEPINT13_EPDISBLD (0x00000002UL) +#define USBHS_DIEPINT13_AHBERR_POS (2U) +#define USBHS_DIEPINT13_AHBERR (0x00000004UL) +#define USBHS_DIEPINT13_TIMEOUT_POS (3U) +#define USBHS_DIEPINT13_TIMEOUT (0x00000008UL) +#define USBHS_DIEPINT13_INTKNTXFEMP_POS (4U) +#define USBHS_DIEPINT13_INTKNTXFEMP (0x00000010UL) +#define USBHS_DIEPINT13_INTKNEPMIS_POS (5U) +#define USBHS_DIEPINT13_INTKNEPMIS (0x00000020UL) +#define USBHS_DIEPINT13_INEPNAKEFF_POS (6U) +#define USBHS_DIEPINT13_INEPNAKEFF (0x00000040UL) +#define USBHS_DIEPINT13_TXFEMP_POS (7U) +#define USBHS_DIEPINT13_TXFEMP (0x00000080UL) +#define USBHS_DIEPINT13_TXFIFOUNDRN_POS (8U) +#define USBHS_DIEPINT13_TXFIFOUNDRN (0x00000100UL) +#define USBHS_DIEPINT13_BNAINTR_POS (9U) +#define USBHS_DIEPINT13_BNAINTR (0x00000200UL) +#define USBHS_DIEPINT13_PKTDRPSTS_POS (11U) +#define USBHS_DIEPINT13_PKTDRPSTS (0x00000800UL) +#define USBHS_DIEPINT13_BBLEERR_POS (12U) +#define USBHS_DIEPINT13_BBLEERR (0x00001000UL) +#define USBHS_DIEPINT13_NAKINTRPT_POS (13U) +#define USBHS_DIEPINT13_NAKINTRPT (0x00002000UL) +#define USBHS_DIEPINT13_NYETINTRPT_POS (14U) +#define USBHS_DIEPINT13_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBHS_DIEPTSIZ13 register */ +#define USBHS_DIEPTSIZ13_XFERSIZE_POS (0U) +#define USBHS_DIEPTSIZ13_XFERSIZE (0x0007FFFFUL) +#define USBHS_DIEPTSIZ13_XFERSIZE_0 (0x00000001UL) +#define USBHS_DIEPTSIZ13_XFERSIZE_1 (0x00000002UL) +#define USBHS_DIEPTSIZ13_XFERSIZE_2 (0x00000004UL) +#define USBHS_DIEPTSIZ13_XFERSIZE_3 (0x00000008UL) +#define USBHS_DIEPTSIZ13_XFERSIZE_4 (0x00000010UL) +#define USBHS_DIEPTSIZ13_XFERSIZE_5 (0x00000020UL) +#define USBHS_DIEPTSIZ13_XFERSIZE_6 (0x00000040UL) +#define USBHS_DIEPTSIZ13_XFERSIZE_7 (0x00000080UL) +#define USBHS_DIEPTSIZ13_XFERSIZE_8 (0x00000100UL) +#define USBHS_DIEPTSIZ13_XFERSIZE_9 (0x00000200UL) +#define USBHS_DIEPTSIZ13_XFERSIZE_10 (0x00000400UL) +#define USBHS_DIEPTSIZ13_XFERSIZE_11 (0x00000800UL) +#define USBHS_DIEPTSIZ13_XFERSIZE_12 (0x00001000UL) +#define USBHS_DIEPTSIZ13_XFERSIZE_13 (0x00002000UL) +#define USBHS_DIEPTSIZ13_XFERSIZE_14 (0x00004000UL) +#define USBHS_DIEPTSIZ13_XFERSIZE_15 (0x00008000UL) +#define USBHS_DIEPTSIZ13_XFERSIZE_16 (0x00010000UL) +#define USBHS_DIEPTSIZ13_XFERSIZE_17 (0x00020000UL) +#define USBHS_DIEPTSIZ13_XFERSIZE_18 (0x00040000UL) +#define USBHS_DIEPTSIZ13_PKTCNT_POS (19U) +#define USBHS_DIEPTSIZ13_PKTCNT (0x1FF80000UL) +#define USBHS_DIEPTSIZ13_PKTCNT_0 (0x00080000UL) +#define USBHS_DIEPTSIZ13_PKTCNT_1 (0x00100000UL) +#define USBHS_DIEPTSIZ13_PKTCNT_2 (0x00200000UL) +#define USBHS_DIEPTSIZ13_PKTCNT_3 (0x00400000UL) +#define USBHS_DIEPTSIZ13_PKTCNT_4 (0x00800000UL) +#define USBHS_DIEPTSIZ13_PKTCNT_5 (0x01000000UL) +#define USBHS_DIEPTSIZ13_PKTCNT_6 (0x02000000UL) +#define USBHS_DIEPTSIZ13_PKTCNT_7 (0x04000000UL) +#define USBHS_DIEPTSIZ13_PKTCNT_8 (0x08000000UL) +#define USBHS_DIEPTSIZ13_PKTCNT_9 (0x10000000UL) +#define USBHS_DIEPTSIZ13_MC_POS (29U) +#define USBHS_DIEPTSIZ13_MC (0x60000000UL) +#define USBHS_DIEPTSIZ13_MC_0 (0x20000000UL) +#define USBHS_DIEPTSIZ13_MC_1 (0x40000000UL) + +/* Bit definition for USBHS_DIEPDMA13 register */ +#define USBHS_DIEPDMA13 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DTXFSTS13 register */ +#define USBHS_DTXFSTS13_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBHS_DIEPCTL14 register */ +#define USBHS_DIEPCTL14_MPS_POS (0U) +#define USBHS_DIEPCTL14_MPS (0x000007FFUL) +#define USBHS_DIEPCTL14_MPS_0 (0x00000001UL) +#define USBHS_DIEPCTL14_MPS_1 (0x00000002UL) +#define USBHS_DIEPCTL14_MPS_2 (0x00000004UL) +#define USBHS_DIEPCTL14_MPS_3 (0x00000008UL) +#define USBHS_DIEPCTL14_MPS_4 (0x00000010UL) +#define USBHS_DIEPCTL14_MPS_5 (0x00000020UL) +#define USBHS_DIEPCTL14_MPS_6 (0x00000040UL) +#define USBHS_DIEPCTL14_MPS_7 (0x00000080UL) +#define USBHS_DIEPCTL14_MPS_8 (0x00000100UL) +#define USBHS_DIEPCTL14_MPS_9 (0x00000200UL) +#define USBHS_DIEPCTL14_MPS_10 (0x00000400UL) +#define USBHS_DIEPCTL14_USBACTEP_POS (15U) +#define USBHS_DIEPCTL14_USBACTEP (0x00008000UL) +#define USBHS_DIEPCTL14_DPID_POS (16U) +#define USBHS_DIEPCTL14_DPID (0x00010000UL) +#define USBHS_DIEPCTL14_NAKSTS_POS (17U) +#define USBHS_DIEPCTL14_NAKSTS (0x00020000UL) +#define USBHS_DIEPCTL14_EPTYPE_POS (18U) +#define USBHS_DIEPCTL14_EPTYPE (0x000C0000UL) +#define USBHS_DIEPCTL14_EPTYPE_0 (0x00040000UL) +#define USBHS_DIEPCTL14_EPTYPE_1 (0x00080000UL) +#define USBHS_DIEPCTL14_STALL_POS (21U) +#define USBHS_DIEPCTL14_STALL (0x00200000UL) +#define USBHS_DIEPCTL14_TXFNUM_POS (22U) +#define USBHS_DIEPCTL14_TXFNUM (0x03C00000UL) +#define USBHS_DIEPCTL14_TXFNUM_0 (0x00400000UL) +#define USBHS_DIEPCTL14_TXFNUM_1 (0x00800000UL) +#define USBHS_DIEPCTL14_TXFNUM_2 (0x01000000UL) +#define USBHS_DIEPCTL14_TXFNUM_3 (0x02000000UL) +#define USBHS_DIEPCTL14_CNAK_POS (26U) +#define USBHS_DIEPCTL14_CNAK (0x04000000UL) +#define USBHS_DIEPCTL14_SNAK_POS (27U) +#define USBHS_DIEPCTL14_SNAK (0x08000000UL) +#define USBHS_DIEPCTL14_SETD0PID_POS (28U) +#define USBHS_DIEPCTL14_SETD0PID (0x10000000UL) +#define USBHS_DIEPCTL14_SETD1PID_POS (29U) +#define USBHS_DIEPCTL14_SETD1PID (0x20000000UL) +#define USBHS_DIEPCTL14_EPDIS_POS (30U) +#define USBHS_DIEPCTL14_EPDIS (0x40000000UL) +#define USBHS_DIEPCTL14_EPENA_POS (31U) +#define USBHS_DIEPCTL14_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DIEPINT14 register */ +#define USBHS_DIEPINT14_XFERCOMPL_POS (0U) +#define USBHS_DIEPINT14_XFERCOMPL (0x00000001UL) +#define USBHS_DIEPINT14_EPDISBLD_POS (1U) +#define USBHS_DIEPINT14_EPDISBLD (0x00000002UL) +#define USBHS_DIEPINT14_AHBERR_POS (2U) +#define USBHS_DIEPINT14_AHBERR (0x00000004UL) +#define USBHS_DIEPINT14_TIMEOUT_POS (3U) +#define USBHS_DIEPINT14_TIMEOUT (0x00000008UL) +#define USBHS_DIEPINT14_INTKNTXFEMP_POS (4U) +#define USBHS_DIEPINT14_INTKNTXFEMP (0x00000010UL) +#define USBHS_DIEPINT14_INTKNEPMIS_POS (5U) +#define USBHS_DIEPINT14_INTKNEPMIS (0x00000020UL) +#define USBHS_DIEPINT14_INEPNAKEFF_POS (6U) +#define USBHS_DIEPINT14_INEPNAKEFF (0x00000040UL) +#define USBHS_DIEPINT14_TXFEMP_POS (7U) +#define USBHS_DIEPINT14_TXFEMP (0x00000080UL) +#define USBHS_DIEPINT14_TXFIFOUNDRN_POS (8U) +#define USBHS_DIEPINT14_TXFIFOUNDRN (0x00000100UL) +#define USBHS_DIEPINT14_BNAINTR_POS (9U) +#define USBHS_DIEPINT14_BNAINTR (0x00000200UL) +#define USBHS_DIEPINT14_PKTDRPSTS_POS (11U) +#define USBHS_DIEPINT14_PKTDRPSTS (0x00000800UL) +#define USBHS_DIEPINT14_BBLEERR_POS (12U) +#define USBHS_DIEPINT14_BBLEERR (0x00001000UL) +#define USBHS_DIEPINT14_NAKINTRPT_POS (13U) +#define USBHS_DIEPINT14_NAKINTRPT (0x00002000UL) +#define USBHS_DIEPINT14_NYETINTRPT_POS (14U) +#define USBHS_DIEPINT14_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBHS_DIEPTSIZ14 register */ +#define USBHS_DIEPTSIZ14_XFERSIZE_POS (0U) +#define USBHS_DIEPTSIZ14_XFERSIZE (0x0007FFFFUL) +#define USBHS_DIEPTSIZ14_XFERSIZE_0 (0x00000001UL) +#define USBHS_DIEPTSIZ14_XFERSIZE_1 (0x00000002UL) +#define USBHS_DIEPTSIZ14_XFERSIZE_2 (0x00000004UL) +#define USBHS_DIEPTSIZ14_XFERSIZE_3 (0x00000008UL) +#define USBHS_DIEPTSIZ14_XFERSIZE_4 (0x00000010UL) +#define USBHS_DIEPTSIZ14_XFERSIZE_5 (0x00000020UL) +#define USBHS_DIEPTSIZ14_XFERSIZE_6 (0x00000040UL) +#define USBHS_DIEPTSIZ14_XFERSIZE_7 (0x00000080UL) +#define USBHS_DIEPTSIZ14_XFERSIZE_8 (0x00000100UL) +#define USBHS_DIEPTSIZ14_XFERSIZE_9 (0x00000200UL) +#define USBHS_DIEPTSIZ14_XFERSIZE_10 (0x00000400UL) +#define USBHS_DIEPTSIZ14_XFERSIZE_11 (0x00000800UL) +#define USBHS_DIEPTSIZ14_XFERSIZE_12 (0x00001000UL) +#define USBHS_DIEPTSIZ14_XFERSIZE_13 (0x00002000UL) +#define USBHS_DIEPTSIZ14_XFERSIZE_14 (0x00004000UL) +#define USBHS_DIEPTSIZ14_XFERSIZE_15 (0x00008000UL) +#define USBHS_DIEPTSIZ14_XFERSIZE_16 (0x00010000UL) +#define USBHS_DIEPTSIZ14_XFERSIZE_17 (0x00020000UL) +#define USBHS_DIEPTSIZ14_XFERSIZE_18 (0x00040000UL) +#define USBHS_DIEPTSIZ14_PKTCNT_POS (19U) +#define USBHS_DIEPTSIZ14_PKTCNT (0x1FF80000UL) +#define USBHS_DIEPTSIZ14_PKTCNT_0 (0x00080000UL) +#define USBHS_DIEPTSIZ14_PKTCNT_1 (0x00100000UL) +#define USBHS_DIEPTSIZ14_PKTCNT_2 (0x00200000UL) +#define USBHS_DIEPTSIZ14_PKTCNT_3 (0x00400000UL) +#define USBHS_DIEPTSIZ14_PKTCNT_4 (0x00800000UL) +#define USBHS_DIEPTSIZ14_PKTCNT_5 (0x01000000UL) +#define USBHS_DIEPTSIZ14_PKTCNT_6 (0x02000000UL) +#define USBHS_DIEPTSIZ14_PKTCNT_7 (0x04000000UL) +#define USBHS_DIEPTSIZ14_PKTCNT_8 (0x08000000UL) +#define USBHS_DIEPTSIZ14_PKTCNT_9 (0x10000000UL) +#define USBHS_DIEPTSIZ14_MC_POS (29U) +#define USBHS_DIEPTSIZ14_MC (0x60000000UL) +#define USBHS_DIEPTSIZ14_MC_0 (0x20000000UL) +#define USBHS_DIEPTSIZ14_MC_1 (0x40000000UL) + +/* Bit definition for USBHS_DIEPDMA14 register */ +#define USBHS_DIEPDMA14 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DTXFSTS14 register */ +#define USBHS_DTXFSTS14_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBHS_DIEPCTL15 register */ +#define USBHS_DIEPCTL15_MPS_POS (0U) +#define USBHS_DIEPCTL15_MPS (0x000007FFUL) +#define USBHS_DIEPCTL15_MPS_0 (0x00000001UL) +#define USBHS_DIEPCTL15_MPS_1 (0x00000002UL) +#define USBHS_DIEPCTL15_MPS_2 (0x00000004UL) +#define USBHS_DIEPCTL15_MPS_3 (0x00000008UL) +#define USBHS_DIEPCTL15_MPS_4 (0x00000010UL) +#define USBHS_DIEPCTL15_MPS_5 (0x00000020UL) +#define USBHS_DIEPCTL15_MPS_6 (0x00000040UL) +#define USBHS_DIEPCTL15_MPS_7 (0x00000080UL) +#define USBHS_DIEPCTL15_MPS_8 (0x00000100UL) +#define USBHS_DIEPCTL15_MPS_9 (0x00000200UL) +#define USBHS_DIEPCTL15_MPS_10 (0x00000400UL) +#define USBHS_DIEPCTL15_USBACTEP_POS (15U) +#define USBHS_DIEPCTL15_USBACTEP (0x00008000UL) +#define USBHS_DIEPCTL15_DPID_POS (16U) +#define USBHS_DIEPCTL15_DPID (0x00010000UL) +#define USBHS_DIEPCTL15_NAKSTS_POS (17U) +#define USBHS_DIEPCTL15_NAKSTS (0x00020000UL) +#define USBHS_DIEPCTL15_EPTYPE_POS (18U) +#define USBHS_DIEPCTL15_EPTYPE (0x000C0000UL) +#define USBHS_DIEPCTL15_EPTYPE_0 (0x00040000UL) +#define USBHS_DIEPCTL15_EPTYPE_1 (0x00080000UL) +#define USBHS_DIEPCTL15_STALL_POS (21U) +#define USBHS_DIEPCTL15_STALL (0x00200000UL) +#define USBHS_DIEPCTL15_TXFNUM_POS (22U) +#define USBHS_DIEPCTL15_TXFNUM (0x03C00000UL) +#define USBHS_DIEPCTL15_TXFNUM_0 (0x00400000UL) +#define USBHS_DIEPCTL15_TXFNUM_1 (0x00800000UL) +#define USBHS_DIEPCTL15_TXFNUM_2 (0x01000000UL) +#define USBHS_DIEPCTL15_TXFNUM_3 (0x02000000UL) +#define USBHS_DIEPCTL15_CNAK_POS (26U) +#define USBHS_DIEPCTL15_CNAK (0x04000000UL) +#define USBHS_DIEPCTL15_SNAK_POS (27U) +#define USBHS_DIEPCTL15_SNAK (0x08000000UL) +#define USBHS_DIEPCTL15_SETD0PID_POS (28U) +#define USBHS_DIEPCTL15_SETD0PID (0x10000000UL) +#define USBHS_DIEPCTL15_SETD1PID_POS (29U) +#define USBHS_DIEPCTL15_SETD1PID (0x20000000UL) +#define USBHS_DIEPCTL15_EPDIS_POS (30U) +#define USBHS_DIEPCTL15_EPDIS (0x40000000UL) +#define USBHS_DIEPCTL15_EPENA_POS (31U) +#define USBHS_DIEPCTL15_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DIEPINT15 register */ +#define USBHS_DIEPINT15_XFERCOMPL_POS (0U) +#define USBHS_DIEPINT15_XFERCOMPL (0x00000001UL) +#define USBHS_DIEPINT15_EPDISBLD_POS (1U) +#define USBHS_DIEPINT15_EPDISBLD (0x00000002UL) +#define USBHS_DIEPINT15_AHBERR_POS (2U) +#define USBHS_DIEPINT15_AHBERR (0x00000004UL) +#define USBHS_DIEPINT15_TIMEOUT_POS (3U) +#define USBHS_DIEPINT15_TIMEOUT (0x00000008UL) +#define USBHS_DIEPINT15_INTKNTXFEMP_POS (4U) +#define USBHS_DIEPINT15_INTKNTXFEMP (0x00000010UL) +#define USBHS_DIEPINT15_INTKNEPMIS_POS (5U) +#define USBHS_DIEPINT15_INTKNEPMIS (0x00000020UL) +#define USBHS_DIEPINT15_INEPNAKEFF_POS (6U) +#define USBHS_DIEPINT15_INEPNAKEFF (0x00000040UL) +#define USBHS_DIEPINT15_TXFEMP_POS (7U) +#define USBHS_DIEPINT15_TXFEMP (0x00000080UL) +#define USBHS_DIEPINT15_TXFIFOUNDRN_POS (8U) +#define USBHS_DIEPINT15_TXFIFOUNDRN (0x00000100UL) +#define USBHS_DIEPINT15_BNAINTR_POS (9U) +#define USBHS_DIEPINT15_BNAINTR (0x00000200UL) +#define USBHS_DIEPINT15_PKTDRPSTS_POS (11U) +#define USBHS_DIEPINT15_PKTDRPSTS (0x00000800UL) +#define USBHS_DIEPINT15_BBLEERR_POS (12U) +#define USBHS_DIEPINT15_BBLEERR (0x00001000UL) +#define USBHS_DIEPINT15_NAKINTRPT_POS (13U) +#define USBHS_DIEPINT15_NAKINTRPT (0x00002000UL) +#define USBHS_DIEPINT15_NYETINTRPT_POS (14U) +#define USBHS_DIEPINT15_NYETINTRPT (0x00004000UL) + +/* Bit definition for USBHS_DIEPTSIZ15 register */ +#define USBHS_DIEPTSIZ15_XFERSIZE_POS (0U) +#define USBHS_DIEPTSIZ15_XFERSIZE (0x0007FFFFUL) +#define USBHS_DIEPTSIZ15_XFERSIZE_0 (0x00000001UL) +#define USBHS_DIEPTSIZ15_XFERSIZE_1 (0x00000002UL) +#define USBHS_DIEPTSIZ15_XFERSIZE_2 (0x00000004UL) +#define USBHS_DIEPTSIZ15_XFERSIZE_3 (0x00000008UL) +#define USBHS_DIEPTSIZ15_XFERSIZE_4 (0x00000010UL) +#define USBHS_DIEPTSIZ15_XFERSIZE_5 (0x00000020UL) +#define USBHS_DIEPTSIZ15_XFERSIZE_6 (0x00000040UL) +#define USBHS_DIEPTSIZ15_XFERSIZE_7 (0x00000080UL) +#define USBHS_DIEPTSIZ15_XFERSIZE_8 (0x00000100UL) +#define USBHS_DIEPTSIZ15_XFERSIZE_9 (0x00000200UL) +#define USBHS_DIEPTSIZ15_XFERSIZE_10 (0x00000400UL) +#define USBHS_DIEPTSIZ15_XFERSIZE_11 (0x00000800UL) +#define USBHS_DIEPTSIZ15_XFERSIZE_12 (0x00001000UL) +#define USBHS_DIEPTSIZ15_XFERSIZE_13 (0x00002000UL) +#define USBHS_DIEPTSIZ15_XFERSIZE_14 (0x00004000UL) +#define USBHS_DIEPTSIZ15_XFERSIZE_15 (0x00008000UL) +#define USBHS_DIEPTSIZ15_XFERSIZE_16 (0x00010000UL) +#define USBHS_DIEPTSIZ15_XFERSIZE_17 (0x00020000UL) +#define USBHS_DIEPTSIZ15_XFERSIZE_18 (0x00040000UL) +#define USBHS_DIEPTSIZ15_PKTCNT_POS (19U) +#define USBHS_DIEPTSIZ15_PKTCNT (0x1FF80000UL) +#define USBHS_DIEPTSIZ15_PKTCNT_0 (0x00080000UL) +#define USBHS_DIEPTSIZ15_PKTCNT_1 (0x00100000UL) +#define USBHS_DIEPTSIZ15_PKTCNT_2 (0x00200000UL) +#define USBHS_DIEPTSIZ15_PKTCNT_3 (0x00400000UL) +#define USBHS_DIEPTSIZ15_PKTCNT_4 (0x00800000UL) +#define USBHS_DIEPTSIZ15_PKTCNT_5 (0x01000000UL) +#define USBHS_DIEPTSIZ15_PKTCNT_6 (0x02000000UL) +#define USBHS_DIEPTSIZ15_PKTCNT_7 (0x04000000UL) +#define USBHS_DIEPTSIZ15_PKTCNT_8 (0x08000000UL) +#define USBHS_DIEPTSIZ15_PKTCNT_9 (0x10000000UL) +#define USBHS_DIEPTSIZ15_MC_POS (29U) +#define USBHS_DIEPTSIZ15_MC (0x60000000UL) +#define USBHS_DIEPTSIZ15_MC_0 (0x20000000UL) +#define USBHS_DIEPTSIZ15_MC_1 (0x40000000UL) + +/* Bit definition for USBHS_DIEPDMA15 register */ +#define USBHS_DIEPDMA15 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DTXFSTS15 register */ +#define USBHS_DTXFSTS15_INEPTXFSPCAVAIL (0x0000FFFFUL) + +/* Bit definition for USBHS_DOEPCTL0 register */ +#define USBHS_DOEPCTL0_MPS_POS (0U) +#define USBHS_DOEPCTL0_MPS (0x00000003UL) +#define USBHS_DOEPCTL0_MPS_0 (0x00000001UL) +#define USBHS_DOEPCTL0_MPS_1 (0x00000002UL) +#define USBHS_DOEPCTL0_USBACTEP_POS (15U) +#define USBHS_DOEPCTL0_USBACTEP (0x00008000UL) +#define USBHS_DOEPCTL0_NAKSTS_POS (17U) +#define USBHS_DOEPCTL0_NAKSTS (0x00020000UL) +#define USBHS_DOEPCTL0_EPTYPE_POS (18U) +#define USBHS_DOEPCTL0_EPTYPE (0x000C0000UL) +#define USBHS_DOEPCTL0_EPTYPE_0 (0x00040000UL) +#define USBHS_DOEPCTL0_EPTYPE_1 (0x00080000UL) +#define USBHS_DOEPCTL0_SNP_POS (20U) +#define USBHS_DOEPCTL0_SNP (0x00100000UL) +#define USBHS_DOEPCTL0_STALL_POS (21U) +#define USBHS_DOEPCTL0_STALL (0x00200000UL) +#define USBHS_DOEPCTL0_CNAK_POS (26U) +#define USBHS_DOEPCTL0_CNAK (0x04000000UL) +#define USBHS_DOEPCTL0_SNAK_POS (27U) +#define USBHS_DOEPCTL0_SNAK (0x08000000UL) +#define USBHS_DOEPCTL0_EPDIS_POS (30U) +#define USBHS_DOEPCTL0_EPDIS (0x40000000UL) +#define USBHS_DOEPCTL0_EPENA_POS (31U) +#define USBHS_DOEPCTL0_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DOEPINT0 register */ +#define USBHS_DOEPINT0_XFERCOMPL_POS (0U) +#define USBHS_DOEPINT0_XFERCOMPL (0x00000001UL) +#define USBHS_DOEPINT0_EPDISBLD_POS (1U) +#define USBHS_DOEPINT0_EPDISBLD (0x00000002UL) +#define USBHS_DOEPINT0_AHBERR_POS (2U) +#define USBHS_DOEPINT0_AHBERR (0x00000004UL) +#define USBHS_DOEPINT0_SETUP_POS (3U) +#define USBHS_DOEPINT0_SETUP (0x00000008UL) +#define USBHS_DOEPINT0_OUTTKNEPDIS_POS (4U) +#define USBHS_DOEPINT0_OUTTKNEPDIS (0x00000010UL) +#define USBHS_DOEPINT0_STSPHSERCVD_POS (5U) +#define USBHS_DOEPINT0_STSPHSERCVD (0x00000020UL) +#define USBHS_DOEPINT0_BACK2BACKSETUP_POS (6U) +#define USBHS_DOEPINT0_BACK2BACKSETUP (0x00000040UL) +#define USBHS_DOEPINT0_OUTPKTERR_POS (8U) +#define USBHS_DOEPINT0_OUTPKTERR (0x00000100UL) +#define USBHS_DOEPINT0_BNAINTR_POS (9U) +#define USBHS_DOEPINT0_BNAINTR (0x00000200UL) +#define USBHS_DOEPINT0_PKTDRPSTS_POS (11U) +#define USBHS_DOEPINT0_PKTDRPSTS (0x00000800UL) +#define USBHS_DOEPINT0_BBLEERR_POS (12U) +#define USBHS_DOEPINT0_BBLEERR (0x00001000UL) +#define USBHS_DOEPINT0_NAKINTRPT_POS (13U) +#define USBHS_DOEPINT0_NAKINTRPT (0x00002000UL) +#define USBHS_DOEPINT0_NYETINTRPT_POS (14U) +#define USBHS_DOEPINT0_NYETINTRPT (0x00004000UL) +#define USBHS_DOEPINT0_STUPPKTRCVD_POS (15U) +#define USBHS_DOEPINT0_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBHS_DOEPTSIZ0 register */ +#define USBHS_DOEPTSIZ0_XFERSIZE_POS (0U) +#define USBHS_DOEPTSIZ0_XFERSIZE (0x0000007FUL) +#define USBHS_DOEPTSIZ0_XFERSIZE_0 (0x00000001UL) +#define USBHS_DOEPTSIZ0_XFERSIZE_1 (0x00000002UL) +#define USBHS_DOEPTSIZ0_XFERSIZE_2 (0x00000004UL) +#define USBHS_DOEPTSIZ0_XFERSIZE_3 (0x00000008UL) +#define USBHS_DOEPTSIZ0_XFERSIZE_4 (0x00000010UL) +#define USBHS_DOEPTSIZ0_XFERSIZE_5 (0x00000020UL) +#define USBHS_DOEPTSIZ0_XFERSIZE_6 (0x00000040UL) +#define USBHS_DOEPTSIZ0_PKTCNT_POS (19U) +#define USBHS_DOEPTSIZ0_PKTCNT (0x00080000UL) +#define USBHS_DOEPTSIZ0_SUPCNT_POS (29U) +#define USBHS_DOEPTSIZ0_SUPCNT (0x60000000UL) +#define USBHS_DOEPTSIZ0_SUPCNT_0 (0x20000000UL) +#define USBHS_DOEPTSIZ0_SUPCNT_1 (0x40000000UL) + +/* Bit definition for USBHS_DOEPDMA0 register */ +#define USBHS_DOEPDMA0 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DOEPCTL1 register */ +#define USBHS_DOEPCTL1_MPS_POS (0U) +#define USBHS_DOEPCTL1_MPS (0x000007FFUL) +#define USBHS_DOEPCTL1_MPS_0 (0x00000001UL) +#define USBHS_DOEPCTL1_MPS_1 (0x00000002UL) +#define USBHS_DOEPCTL1_MPS_2 (0x00000004UL) +#define USBHS_DOEPCTL1_MPS_3 (0x00000008UL) +#define USBHS_DOEPCTL1_MPS_4 (0x00000010UL) +#define USBHS_DOEPCTL1_MPS_5 (0x00000020UL) +#define USBHS_DOEPCTL1_MPS_6 (0x00000040UL) +#define USBHS_DOEPCTL1_MPS_7 (0x00000080UL) +#define USBHS_DOEPCTL1_MPS_8 (0x00000100UL) +#define USBHS_DOEPCTL1_MPS_9 (0x00000200UL) +#define USBHS_DOEPCTL1_MPS_10 (0x00000400UL) +#define USBHS_DOEPCTL1_USBACTEP_POS (15U) +#define USBHS_DOEPCTL1_USBACTEP (0x00008000UL) +#define USBHS_DOEPCTL1_DPID_POS (16U) +#define USBHS_DOEPCTL1_DPID (0x00010000UL) +#define USBHS_DOEPCTL1_NAKSTS_POS (17U) +#define USBHS_DOEPCTL1_NAKSTS (0x00020000UL) +#define USBHS_DOEPCTL1_EPTYPE_POS (18U) +#define USBHS_DOEPCTL1_EPTYPE (0x000C0000UL) +#define USBHS_DOEPCTL1_EPTYPE_0 (0x00040000UL) +#define USBHS_DOEPCTL1_EPTYPE_1 (0x00080000UL) +#define USBHS_DOEPCTL1_SNP_POS (20U) +#define USBHS_DOEPCTL1_SNP (0x00100000UL) +#define USBHS_DOEPCTL1_STALL_POS (21U) +#define USBHS_DOEPCTL1_STALL (0x00200000UL) +#define USBHS_DOEPCTL1_CNAK_POS (26U) +#define USBHS_DOEPCTL1_CNAK (0x04000000UL) +#define USBHS_DOEPCTL1_SNAK_POS (27U) +#define USBHS_DOEPCTL1_SNAK (0x08000000UL) +#define USBHS_DOEPCTL1_SETD0PID_POS (28U) +#define USBHS_DOEPCTL1_SETD0PID (0x10000000UL) +#define USBHS_DOEPCTL1_SETD1PID_POS (29U) +#define USBHS_DOEPCTL1_SETD1PID (0x20000000UL) +#define USBHS_DOEPCTL1_EPDIS_POS (30U) +#define USBHS_DOEPCTL1_EPDIS (0x40000000UL) +#define USBHS_DOEPCTL1_EPENA_POS (31U) +#define USBHS_DOEPCTL1_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DOEPINT1 register */ +#define USBHS_DOEPINT1_XFERCOMPL_POS (0U) +#define USBHS_DOEPINT1_XFERCOMPL (0x00000001UL) +#define USBHS_DOEPINT1_EPDISBLD_POS (1U) +#define USBHS_DOEPINT1_EPDISBLD (0x00000002UL) +#define USBHS_DOEPINT1_AHBERR_POS (2U) +#define USBHS_DOEPINT1_AHBERR (0x00000004UL) +#define USBHS_DOEPINT1_SETUP_POS (3U) +#define USBHS_DOEPINT1_SETUP (0x00000008UL) +#define USBHS_DOEPINT1_OUTTKNEPDIS_POS (4U) +#define USBHS_DOEPINT1_OUTTKNEPDIS (0x00000010UL) +#define USBHS_DOEPINT1_STSPHSERCVD_POS (5U) +#define USBHS_DOEPINT1_STSPHSERCVD (0x00000020UL) +#define USBHS_DOEPINT1_BACK2BACKSETUP_POS (6U) +#define USBHS_DOEPINT1_BACK2BACKSETUP (0x00000040UL) +#define USBHS_DOEPINT1_OUTPKTERR_POS (8U) +#define USBHS_DOEPINT1_OUTPKTERR (0x00000100UL) +#define USBHS_DOEPINT1_BNAINTR_POS (9U) +#define USBHS_DOEPINT1_BNAINTR (0x00000200UL) +#define USBHS_DOEPINT1_PKTDRPSTS_POS (11U) +#define USBHS_DOEPINT1_PKTDRPSTS (0x00000800UL) +#define USBHS_DOEPINT1_BBLEERR_POS (12U) +#define USBHS_DOEPINT1_BBLEERR (0x00001000UL) +#define USBHS_DOEPINT1_NAKINTRPT_POS (13U) +#define USBHS_DOEPINT1_NAKINTRPT (0x00002000UL) +#define USBHS_DOEPINT1_NYETINTRPT_POS (14U) +#define USBHS_DOEPINT1_NYETINTRPT (0x00004000UL) +#define USBHS_DOEPINT1_STUPPKTRCVD_POS (15U) +#define USBHS_DOEPINT1_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBHS_DOEPTSIZ1 register */ +#define USBHS_DOEPTSIZ1_XFERSIZE_POS (0U) +#define USBHS_DOEPTSIZ1_XFERSIZE (0x0007FFFFUL) +#define USBHS_DOEPTSIZ1_XFERSIZE_0 (0x00000001UL) +#define USBHS_DOEPTSIZ1_XFERSIZE_1 (0x00000002UL) +#define USBHS_DOEPTSIZ1_XFERSIZE_2 (0x00000004UL) +#define USBHS_DOEPTSIZ1_XFERSIZE_3 (0x00000008UL) +#define USBHS_DOEPTSIZ1_XFERSIZE_4 (0x00000010UL) +#define USBHS_DOEPTSIZ1_XFERSIZE_5 (0x00000020UL) +#define USBHS_DOEPTSIZ1_XFERSIZE_6 (0x00000040UL) +#define USBHS_DOEPTSIZ1_XFERSIZE_7 (0x00000080UL) +#define USBHS_DOEPTSIZ1_XFERSIZE_8 (0x00000100UL) +#define USBHS_DOEPTSIZ1_XFERSIZE_9 (0x00000200UL) +#define USBHS_DOEPTSIZ1_XFERSIZE_10 (0x00000400UL) +#define USBHS_DOEPTSIZ1_XFERSIZE_11 (0x00000800UL) +#define USBHS_DOEPTSIZ1_XFERSIZE_12 (0x00001000UL) +#define USBHS_DOEPTSIZ1_XFERSIZE_13 (0x00002000UL) +#define USBHS_DOEPTSIZ1_XFERSIZE_14 (0x00004000UL) +#define USBHS_DOEPTSIZ1_XFERSIZE_15 (0x00008000UL) +#define USBHS_DOEPTSIZ1_XFERSIZE_16 (0x00010000UL) +#define USBHS_DOEPTSIZ1_XFERSIZE_17 (0x00020000UL) +#define USBHS_DOEPTSIZ1_XFERSIZE_18 (0x00040000UL) +#define USBHS_DOEPTSIZ1_PKTCNT_POS (19U) +#define USBHS_DOEPTSIZ1_PKTCNT (0x1FF80000UL) +#define USBHS_DOEPTSIZ1_PKTCNT_0 (0x00080000UL) +#define USBHS_DOEPTSIZ1_PKTCNT_1 (0x00100000UL) +#define USBHS_DOEPTSIZ1_PKTCNT_2 (0x00200000UL) +#define USBHS_DOEPTSIZ1_PKTCNT_3 (0x00400000UL) +#define USBHS_DOEPTSIZ1_PKTCNT_4 (0x00800000UL) +#define USBHS_DOEPTSIZ1_PKTCNT_5 (0x01000000UL) +#define USBHS_DOEPTSIZ1_PKTCNT_6 (0x02000000UL) +#define USBHS_DOEPTSIZ1_PKTCNT_7 (0x04000000UL) +#define USBHS_DOEPTSIZ1_PKTCNT_8 (0x08000000UL) +#define USBHS_DOEPTSIZ1_PKTCNT_9 (0x10000000UL) +#define USBHS_DOEPTSIZ1_RXDPID_POS (29U) +#define USBHS_DOEPTSIZ1_RXDPID (0x60000000UL) +#define USBHS_DOEPTSIZ1_RXDPID_0 (0x20000000UL) +#define USBHS_DOEPTSIZ1_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBHS_DOEPDMA1 register */ +#define USBHS_DOEPDMA1 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DOEPCTL2 register */ +#define USBHS_DOEPCTL2_MPS_POS (0U) +#define USBHS_DOEPCTL2_MPS (0x000007FFUL) +#define USBHS_DOEPCTL2_MPS_0 (0x00000001UL) +#define USBHS_DOEPCTL2_MPS_1 (0x00000002UL) +#define USBHS_DOEPCTL2_MPS_2 (0x00000004UL) +#define USBHS_DOEPCTL2_MPS_3 (0x00000008UL) +#define USBHS_DOEPCTL2_MPS_4 (0x00000010UL) +#define USBHS_DOEPCTL2_MPS_5 (0x00000020UL) +#define USBHS_DOEPCTL2_MPS_6 (0x00000040UL) +#define USBHS_DOEPCTL2_MPS_7 (0x00000080UL) +#define USBHS_DOEPCTL2_MPS_8 (0x00000100UL) +#define USBHS_DOEPCTL2_MPS_9 (0x00000200UL) +#define USBHS_DOEPCTL2_MPS_10 (0x00000400UL) +#define USBHS_DOEPCTL2_USBACTEP_POS (15U) +#define USBHS_DOEPCTL2_USBACTEP (0x00008000UL) +#define USBHS_DOEPCTL2_DPID_POS (16U) +#define USBHS_DOEPCTL2_DPID (0x00010000UL) +#define USBHS_DOEPCTL2_NAKSTS_POS (17U) +#define USBHS_DOEPCTL2_NAKSTS (0x00020000UL) +#define USBHS_DOEPCTL2_EPTYPE_POS (18U) +#define USBHS_DOEPCTL2_EPTYPE (0x000C0000UL) +#define USBHS_DOEPCTL2_EPTYPE_0 (0x00040000UL) +#define USBHS_DOEPCTL2_EPTYPE_1 (0x00080000UL) +#define USBHS_DOEPCTL2_SNP_POS (20U) +#define USBHS_DOEPCTL2_SNP (0x00100000UL) +#define USBHS_DOEPCTL2_STALL_POS (21U) +#define USBHS_DOEPCTL2_STALL (0x00200000UL) +#define USBHS_DOEPCTL2_CNAK_POS (26U) +#define USBHS_DOEPCTL2_CNAK (0x04000000UL) +#define USBHS_DOEPCTL2_SNAK_POS (27U) +#define USBHS_DOEPCTL2_SNAK (0x08000000UL) +#define USBHS_DOEPCTL2_SETD0PID_POS (28U) +#define USBHS_DOEPCTL2_SETD0PID (0x10000000UL) +#define USBHS_DOEPCTL2_SETD1PID_POS (29U) +#define USBHS_DOEPCTL2_SETD1PID (0x20000000UL) +#define USBHS_DOEPCTL2_EPDIS_POS (30U) +#define USBHS_DOEPCTL2_EPDIS (0x40000000UL) +#define USBHS_DOEPCTL2_EPENA_POS (31U) +#define USBHS_DOEPCTL2_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DOEPINT2 register */ +#define USBHS_DOEPINT2_XFERCOMPL_POS (0U) +#define USBHS_DOEPINT2_XFERCOMPL (0x00000001UL) +#define USBHS_DOEPINT2_EPDISBLD_POS (1U) +#define USBHS_DOEPINT2_EPDISBLD (0x00000002UL) +#define USBHS_DOEPINT2_AHBERR_POS (2U) +#define USBHS_DOEPINT2_AHBERR (0x00000004UL) +#define USBHS_DOEPINT2_SETUP_POS (3U) +#define USBHS_DOEPINT2_SETUP (0x00000008UL) +#define USBHS_DOEPINT2_OUTTKNEPDIS_POS (4U) +#define USBHS_DOEPINT2_OUTTKNEPDIS (0x00000010UL) +#define USBHS_DOEPINT2_STSPHSERCVD_POS (5U) +#define USBHS_DOEPINT2_STSPHSERCVD (0x00000020UL) +#define USBHS_DOEPINT2_BACK2BACKSETUP_POS (6U) +#define USBHS_DOEPINT2_BACK2BACKSETUP (0x00000040UL) +#define USBHS_DOEPINT2_OUTPKTERR_POS (8U) +#define USBHS_DOEPINT2_OUTPKTERR (0x00000100UL) +#define USBHS_DOEPINT2_BNAINTR_POS (9U) +#define USBHS_DOEPINT2_BNAINTR (0x00000200UL) +#define USBHS_DOEPINT2_PKTDRPSTS_POS (11U) +#define USBHS_DOEPINT2_PKTDRPSTS (0x00000800UL) +#define USBHS_DOEPINT2_BBLEERR_POS (12U) +#define USBHS_DOEPINT2_BBLEERR (0x00001000UL) +#define USBHS_DOEPINT2_NAKINTRPT_POS (13U) +#define USBHS_DOEPINT2_NAKINTRPT (0x00002000UL) +#define USBHS_DOEPINT2_NYETINTRPT_POS (14U) +#define USBHS_DOEPINT2_NYETINTRPT (0x00004000UL) +#define USBHS_DOEPINT2_STUPPKTRCVD_POS (15U) +#define USBHS_DOEPINT2_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBHS_DOEPTSIZ2 register */ +#define USBHS_DOEPTSIZ2_XFERSIZE_POS (0U) +#define USBHS_DOEPTSIZ2_XFERSIZE (0x0007FFFFUL) +#define USBHS_DOEPTSIZ2_XFERSIZE_0 (0x00000001UL) +#define USBHS_DOEPTSIZ2_XFERSIZE_1 (0x00000002UL) +#define USBHS_DOEPTSIZ2_XFERSIZE_2 (0x00000004UL) +#define USBHS_DOEPTSIZ2_XFERSIZE_3 (0x00000008UL) +#define USBHS_DOEPTSIZ2_XFERSIZE_4 (0x00000010UL) +#define USBHS_DOEPTSIZ2_XFERSIZE_5 (0x00000020UL) +#define USBHS_DOEPTSIZ2_XFERSIZE_6 (0x00000040UL) +#define USBHS_DOEPTSIZ2_XFERSIZE_7 (0x00000080UL) +#define USBHS_DOEPTSIZ2_XFERSIZE_8 (0x00000100UL) +#define USBHS_DOEPTSIZ2_XFERSIZE_9 (0x00000200UL) +#define USBHS_DOEPTSIZ2_XFERSIZE_10 (0x00000400UL) +#define USBHS_DOEPTSIZ2_XFERSIZE_11 (0x00000800UL) +#define USBHS_DOEPTSIZ2_XFERSIZE_12 (0x00001000UL) +#define USBHS_DOEPTSIZ2_XFERSIZE_13 (0x00002000UL) +#define USBHS_DOEPTSIZ2_XFERSIZE_14 (0x00004000UL) +#define USBHS_DOEPTSIZ2_XFERSIZE_15 (0x00008000UL) +#define USBHS_DOEPTSIZ2_XFERSIZE_16 (0x00010000UL) +#define USBHS_DOEPTSIZ2_XFERSIZE_17 (0x00020000UL) +#define USBHS_DOEPTSIZ2_XFERSIZE_18 (0x00040000UL) +#define USBHS_DOEPTSIZ2_PKTCNT_POS (19U) +#define USBHS_DOEPTSIZ2_PKTCNT (0x1FF80000UL) +#define USBHS_DOEPTSIZ2_PKTCNT_0 (0x00080000UL) +#define USBHS_DOEPTSIZ2_PKTCNT_1 (0x00100000UL) +#define USBHS_DOEPTSIZ2_PKTCNT_2 (0x00200000UL) +#define USBHS_DOEPTSIZ2_PKTCNT_3 (0x00400000UL) +#define USBHS_DOEPTSIZ2_PKTCNT_4 (0x00800000UL) +#define USBHS_DOEPTSIZ2_PKTCNT_5 (0x01000000UL) +#define USBHS_DOEPTSIZ2_PKTCNT_6 (0x02000000UL) +#define USBHS_DOEPTSIZ2_PKTCNT_7 (0x04000000UL) +#define USBHS_DOEPTSIZ2_PKTCNT_8 (0x08000000UL) +#define USBHS_DOEPTSIZ2_PKTCNT_9 (0x10000000UL) +#define USBHS_DOEPTSIZ2_RXDPID_POS (29U) +#define USBHS_DOEPTSIZ2_RXDPID (0x60000000UL) +#define USBHS_DOEPTSIZ2_RXDPID_0 (0x20000000UL) +#define USBHS_DOEPTSIZ2_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBHS_DOEPDMA2 register */ +#define USBHS_DOEPDMA2 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DOEPCTL3 register */ +#define USBHS_DOEPCTL3_MPS_POS (0U) +#define USBHS_DOEPCTL3_MPS (0x000007FFUL) +#define USBHS_DOEPCTL3_MPS_0 (0x00000001UL) +#define USBHS_DOEPCTL3_MPS_1 (0x00000002UL) +#define USBHS_DOEPCTL3_MPS_2 (0x00000004UL) +#define USBHS_DOEPCTL3_MPS_3 (0x00000008UL) +#define USBHS_DOEPCTL3_MPS_4 (0x00000010UL) +#define USBHS_DOEPCTL3_MPS_5 (0x00000020UL) +#define USBHS_DOEPCTL3_MPS_6 (0x00000040UL) +#define USBHS_DOEPCTL3_MPS_7 (0x00000080UL) +#define USBHS_DOEPCTL3_MPS_8 (0x00000100UL) +#define USBHS_DOEPCTL3_MPS_9 (0x00000200UL) +#define USBHS_DOEPCTL3_MPS_10 (0x00000400UL) +#define USBHS_DOEPCTL3_USBACTEP_POS (15U) +#define USBHS_DOEPCTL3_USBACTEP (0x00008000UL) +#define USBHS_DOEPCTL3_DPID_POS (16U) +#define USBHS_DOEPCTL3_DPID (0x00010000UL) +#define USBHS_DOEPCTL3_NAKSTS_POS (17U) +#define USBHS_DOEPCTL3_NAKSTS (0x00020000UL) +#define USBHS_DOEPCTL3_EPTYPE_POS (18U) +#define USBHS_DOEPCTL3_EPTYPE (0x000C0000UL) +#define USBHS_DOEPCTL3_EPTYPE_0 (0x00040000UL) +#define USBHS_DOEPCTL3_EPTYPE_1 (0x00080000UL) +#define USBHS_DOEPCTL3_SNP_POS (20U) +#define USBHS_DOEPCTL3_SNP (0x00100000UL) +#define USBHS_DOEPCTL3_STALL_POS (21U) +#define USBHS_DOEPCTL3_STALL (0x00200000UL) +#define USBHS_DOEPCTL3_CNAK_POS (26U) +#define USBHS_DOEPCTL3_CNAK (0x04000000UL) +#define USBHS_DOEPCTL3_SNAK_POS (27U) +#define USBHS_DOEPCTL3_SNAK (0x08000000UL) +#define USBHS_DOEPCTL3_SETD0PID_POS (28U) +#define USBHS_DOEPCTL3_SETD0PID (0x10000000UL) +#define USBHS_DOEPCTL3_SETD1PID_POS (29U) +#define USBHS_DOEPCTL3_SETD1PID (0x20000000UL) +#define USBHS_DOEPCTL3_EPDIS_POS (30U) +#define USBHS_DOEPCTL3_EPDIS (0x40000000UL) +#define USBHS_DOEPCTL3_EPENA_POS (31U) +#define USBHS_DOEPCTL3_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DOEPINT3 register */ +#define USBHS_DOEPINT3_XFERCOMPL_POS (0U) +#define USBHS_DOEPINT3_XFERCOMPL (0x00000001UL) +#define USBHS_DOEPINT3_EPDISBLD_POS (1U) +#define USBHS_DOEPINT3_EPDISBLD (0x00000002UL) +#define USBHS_DOEPINT3_AHBERR_POS (2U) +#define USBHS_DOEPINT3_AHBERR (0x00000004UL) +#define USBHS_DOEPINT3_SETUP_POS (3U) +#define USBHS_DOEPINT3_SETUP (0x00000008UL) +#define USBHS_DOEPINT3_OUTTKNEPDIS_POS (4U) +#define USBHS_DOEPINT3_OUTTKNEPDIS (0x00000010UL) +#define USBHS_DOEPINT3_STSPHSERCVD_POS (5U) +#define USBHS_DOEPINT3_STSPHSERCVD (0x00000020UL) +#define USBHS_DOEPINT3_BACK2BACKSETUP_POS (6U) +#define USBHS_DOEPINT3_BACK2BACKSETUP (0x00000040UL) +#define USBHS_DOEPINT3_OUTPKTERR_POS (8U) +#define USBHS_DOEPINT3_OUTPKTERR (0x00000100UL) +#define USBHS_DOEPINT3_BNAINTR_POS (9U) +#define USBHS_DOEPINT3_BNAINTR (0x00000200UL) +#define USBHS_DOEPINT3_PKTDRPSTS_POS (11U) +#define USBHS_DOEPINT3_PKTDRPSTS (0x00000800UL) +#define USBHS_DOEPINT3_BBLEERR_POS (12U) +#define USBHS_DOEPINT3_BBLEERR (0x00001000UL) +#define USBHS_DOEPINT3_NAKINTRPT_POS (13U) +#define USBHS_DOEPINT3_NAKINTRPT (0x00002000UL) +#define USBHS_DOEPINT3_NYETINTRPT_POS (14U) +#define USBHS_DOEPINT3_NYETINTRPT (0x00004000UL) +#define USBHS_DOEPINT3_STUPPKTRCVD_POS (15U) +#define USBHS_DOEPINT3_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBHS_DOEPTSIZ3 register */ +#define USBHS_DOEPTSIZ3_XFERSIZE_POS (0U) +#define USBHS_DOEPTSIZ3_XFERSIZE (0x0007FFFFUL) +#define USBHS_DOEPTSIZ3_XFERSIZE_0 (0x00000001UL) +#define USBHS_DOEPTSIZ3_XFERSIZE_1 (0x00000002UL) +#define USBHS_DOEPTSIZ3_XFERSIZE_2 (0x00000004UL) +#define USBHS_DOEPTSIZ3_XFERSIZE_3 (0x00000008UL) +#define USBHS_DOEPTSIZ3_XFERSIZE_4 (0x00000010UL) +#define USBHS_DOEPTSIZ3_XFERSIZE_5 (0x00000020UL) +#define USBHS_DOEPTSIZ3_XFERSIZE_6 (0x00000040UL) +#define USBHS_DOEPTSIZ3_XFERSIZE_7 (0x00000080UL) +#define USBHS_DOEPTSIZ3_XFERSIZE_8 (0x00000100UL) +#define USBHS_DOEPTSIZ3_XFERSIZE_9 (0x00000200UL) +#define USBHS_DOEPTSIZ3_XFERSIZE_10 (0x00000400UL) +#define USBHS_DOEPTSIZ3_XFERSIZE_11 (0x00000800UL) +#define USBHS_DOEPTSIZ3_XFERSIZE_12 (0x00001000UL) +#define USBHS_DOEPTSIZ3_XFERSIZE_13 (0x00002000UL) +#define USBHS_DOEPTSIZ3_XFERSIZE_14 (0x00004000UL) +#define USBHS_DOEPTSIZ3_XFERSIZE_15 (0x00008000UL) +#define USBHS_DOEPTSIZ3_XFERSIZE_16 (0x00010000UL) +#define USBHS_DOEPTSIZ3_XFERSIZE_17 (0x00020000UL) +#define USBHS_DOEPTSIZ3_XFERSIZE_18 (0x00040000UL) +#define USBHS_DOEPTSIZ3_PKTCNT_POS (19U) +#define USBHS_DOEPTSIZ3_PKTCNT (0x1FF80000UL) +#define USBHS_DOEPTSIZ3_PKTCNT_0 (0x00080000UL) +#define USBHS_DOEPTSIZ3_PKTCNT_1 (0x00100000UL) +#define USBHS_DOEPTSIZ3_PKTCNT_2 (0x00200000UL) +#define USBHS_DOEPTSIZ3_PKTCNT_3 (0x00400000UL) +#define USBHS_DOEPTSIZ3_PKTCNT_4 (0x00800000UL) +#define USBHS_DOEPTSIZ3_PKTCNT_5 (0x01000000UL) +#define USBHS_DOEPTSIZ3_PKTCNT_6 (0x02000000UL) +#define USBHS_DOEPTSIZ3_PKTCNT_7 (0x04000000UL) +#define USBHS_DOEPTSIZ3_PKTCNT_8 (0x08000000UL) +#define USBHS_DOEPTSIZ3_PKTCNT_9 (0x10000000UL) +#define USBHS_DOEPTSIZ3_RXDPID_POS (29U) +#define USBHS_DOEPTSIZ3_RXDPID (0x60000000UL) +#define USBHS_DOEPTSIZ3_RXDPID_0 (0x20000000UL) +#define USBHS_DOEPTSIZ3_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBHS_DOEPDMA3 register */ +#define USBHS_DOEPDMA3 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DOEPCTL4 register */ +#define USBHS_DOEPCTL4_MPS_POS (0U) +#define USBHS_DOEPCTL4_MPS (0x000007FFUL) +#define USBHS_DOEPCTL4_MPS_0 (0x00000001UL) +#define USBHS_DOEPCTL4_MPS_1 (0x00000002UL) +#define USBHS_DOEPCTL4_MPS_2 (0x00000004UL) +#define USBHS_DOEPCTL4_MPS_3 (0x00000008UL) +#define USBHS_DOEPCTL4_MPS_4 (0x00000010UL) +#define USBHS_DOEPCTL4_MPS_5 (0x00000020UL) +#define USBHS_DOEPCTL4_MPS_6 (0x00000040UL) +#define USBHS_DOEPCTL4_MPS_7 (0x00000080UL) +#define USBHS_DOEPCTL4_MPS_8 (0x00000100UL) +#define USBHS_DOEPCTL4_MPS_9 (0x00000200UL) +#define USBHS_DOEPCTL4_MPS_10 (0x00000400UL) +#define USBHS_DOEPCTL4_USBACTEP_POS (15U) +#define USBHS_DOEPCTL4_USBACTEP (0x00008000UL) +#define USBHS_DOEPCTL4_DPID_POS (16U) +#define USBHS_DOEPCTL4_DPID (0x00010000UL) +#define USBHS_DOEPCTL4_NAKSTS_POS (17U) +#define USBHS_DOEPCTL4_NAKSTS (0x00020000UL) +#define USBHS_DOEPCTL4_EPTYPE_POS (18U) +#define USBHS_DOEPCTL4_EPTYPE (0x000C0000UL) +#define USBHS_DOEPCTL4_EPTYPE_0 (0x00040000UL) +#define USBHS_DOEPCTL4_EPTYPE_1 (0x00080000UL) +#define USBHS_DOEPCTL4_SNP_POS (20U) +#define USBHS_DOEPCTL4_SNP (0x00100000UL) +#define USBHS_DOEPCTL4_STALL_POS (21U) +#define USBHS_DOEPCTL4_STALL (0x00200000UL) +#define USBHS_DOEPCTL4_CNAK_POS (26U) +#define USBHS_DOEPCTL4_CNAK (0x04000000UL) +#define USBHS_DOEPCTL4_SNAK_POS (27U) +#define USBHS_DOEPCTL4_SNAK (0x08000000UL) +#define USBHS_DOEPCTL4_SETD0PID_POS (28U) +#define USBHS_DOEPCTL4_SETD0PID (0x10000000UL) +#define USBHS_DOEPCTL4_SETD1PID_POS (29U) +#define USBHS_DOEPCTL4_SETD1PID (0x20000000UL) +#define USBHS_DOEPCTL4_EPDIS_POS (30U) +#define USBHS_DOEPCTL4_EPDIS (0x40000000UL) +#define USBHS_DOEPCTL4_EPENA_POS (31U) +#define USBHS_DOEPCTL4_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DOEPINT4 register */ +#define USBHS_DOEPINT4_XFERCOMPL_POS (0U) +#define USBHS_DOEPINT4_XFERCOMPL (0x00000001UL) +#define USBHS_DOEPINT4_EPDISBLD_POS (1U) +#define USBHS_DOEPINT4_EPDISBLD (0x00000002UL) +#define USBHS_DOEPINT4_AHBERR_POS (2U) +#define USBHS_DOEPINT4_AHBERR (0x00000004UL) +#define USBHS_DOEPINT4_SETUP_POS (3U) +#define USBHS_DOEPINT4_SETUP (0x00000008UL) +#define USBHS_DOEPINT4_OUTTKNEPDIS_POS (4U) +#define USBHS_DOEPINT4_OUTTKNEPDIS (0x00000010UL) +#define USBHS_DOEPINT4_STSPHSERCVD_POS (5U) +#define USBHS_DOEPINT4_STSPHSERCVD (0x00000020UL) +#define USBHS_DOEPINT4_BACK2BACKSETUP_POS (6U) +#define USBHS_DOEPINT4_BACK2BACKSETUP (0x00000040UL) +#define USBHS_DOEPINT4_OUTPKTERR_POS (8U) +#define USBHS_DOEPINT4_OUTPKTERR (0x00000100UL) +#define USBHS_DOEPINT4_BNAINTR_POS (9U) +#define USBHS_DOEPINT4_BNAINTR (0x00000200UL) +#define USBHS_DOEPINT4_PKTDRPSTS_POS (11U) +#define USBHS_DOEPINT4_PKTDRPSTS (0x00000800UL) +#define USBHS_DOEPINT4_BBLEERR_POS (12U) +#define USBHS_DOEPINT4_BBLEERR (0x00001000UL) +#define USBHS_DOEPINT4_NAKINTRPT_POS (13U) +#define USBHS_DOEPINT4_NAKINTRPT (0x00002000UL) +#define USBHS_DOEPINT4_NYETINTRPT_POS (14U) +#define USBHS_DOEPINT4_NYETINTRPT (0x00004000UL) +#define USBHS_DOEPINT4_STUPPKTRCVD_POS (15U) +#define USBHS_DOEPINT4_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBHS_DOEPTSIZ4 register */ +#define USBHS_DOEPTSIZ4_XFERSIZE_POS (0U) +#define USBHS_DOEPTSIZ4_XFERSIZE (0x0007FFFFUL) +#define USBHS_DOEPTSIZ4_XFERSIZE_0 (0x00000001UL) +#define USBHS_DOEPTSIZ4_XFERSIZE_1 (0x00000002UL) +#define USBHS_DOEPTSIZ4_XFERSIZE_2 (0x00000004UL) +#define USBHS_DOEPTSIZ4_XFERSIZE_3 (0x00000008UL) +#define USBHS_DOEPTSIZ4_XFERSIZE_4 (0x00000010UL) +#define USBHS_DOEPTSIZ4_XFERSIZE_5 (0x00000020UL) +#define USBHS_DOEPTSIZ4_XFERSIZE_6 (0x00000040UL) +#define USBHS_DOEPTSIZ4_XFERSIZE_7 (0x00000080UL) +#define USBHS_DOEPTSIZ4_XFERSIZE_8 (0x00000100UL) +#define USBHS_DOEPTSIZ4_XFERSIZE_9 (0x00000200UL) +#define USBHS_DOEPTSIZ4_XFERSIZE_10 (0x00000400UL) +#define USBHS_DOEPTSIZ4_XFERSIZE_11 (0x00000800UL) +#define USBHS_DOEPTSIZ4_XFERSIZE_12 (0x00001000UL) +#define USBHS_DOEPTSIZ4_XFERSIZE_13 (0x00002000UL) +#define USBHS_DOEPTSIZ4_XFERSIZE_14 (0x00004000UL) +#define USBHS_DOEPTSIZ4_XFERSIZE_15 (0x00008000UL) +#define USBHS_DOEPTSIZ4_XFERSIZE_16 (0x00010000UL) +#define USBHS_DOEPTSIZ4_XFERSIZE_17 (0x00020000UL) +#define USBHS_DOEPTSIZ4_XFERSIZE_18 (0x00040000UL) +#define USBHS_DOEPTSIZ4_PKTCNT_POS (19U) +#define USBHS_DOEPTSIZ4_PKTCNT (0x1FF80000UL) +#define USBHS_DOEPTSIZ4_PKTCNT_0 (0x00080000UL) +#define USBHS_DOEPTSIZ4_PKTCNT_1 (0x00100000UL) +#define USBHS_DOEPTSIZ4_PKTCNT_2 (0x00200000UL) +#define USBHS_DOEPTSIZ4_PKTCNT_3 (0x00400000UL) +#define USBHS_DOEPTSIZ4_PKTCNT_4 (0x00800000UL) +#define USBHS_DOEPTSIZ4_PKTCNT_5 (0x01000000UL) +#define USBHS_DOEPTSIZ4_PKTCNT_6 (0x02000000UL) +#define USBHS_DOEPTSIZ4_PKTCNT_7 (0x04000000UL) +#define USBHS_DOEPTSIZ4_PKTCNT_8 (0x08000000UL) +#define USBHS_DOEPTSIZ4_PKTCNT_9 (0x10000000UL) +#define USBHS_DOEPTSIZ4_RXDPID_POS (29U) +#define USBHS_DOEPTSIZ4_RXDPID (0x60000000UL) +#define USBHS_DOEPTSIZ4_RXDPID_0 (0x20000000UL) +#define USBHS_DOEPTSIZ4_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBHS_DOEPDMA4 register */ +#define USBHS_DOEPDMA4 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DOEPCTL5 register */ +#define USBHS_DOEPCTL5_MPS_POS (0U) +#define USBHS_DOEPCTL5_MPS (0x000007FFUL) +#define USBHS_DOEPCTL5_MPS_0 (0x00000001UL) +#define USBHS_DOEPCTL5_MPS_1 (0x00000002UL) +#define USBHS_DOEPCTL5_MPS_2 (0x00000004UL) +#define USBHS_DOEPCTL5_MPS_3 (0x00000008UL) +#define USBHS_DOEPCTL5_MPS_4 (0x00000010UL) +#define USBHS_DOEPCTL5_MPS_5 (0x00000020UL) +#define USBHS_DOEPCTL5_MPS_6 (0x00000040UL) +#define USBHS_DOEPCTL5_MPS_7 (0x00000080UL) +#define USBHS_DOEPCTL5_MPS_8 (0x00000100UL) +#define USBHS_DOEPCTL5_MPS_9 (0x00000200UL) +#define USBHS_DOEPCTL5_MPS_10 (0x00000400UL) +#define USBHS_DOEPCTL5_USBACTEP_POS (15U) +#define USBHS_DOEPCTL5_USBACTEP (0x00008000UL) +#define USBHS_DOEPCTL5_DPID_POS (16U) +#define USBHS_DOEPCTL5_DPID (0x00010000UL) +#define USBHS_DOEPCTL5_NAKSTS_POS (17U) +#define USBHS_DOEPCTL5_NAKSTS (0x00020000UL) +#define USBHS_DOEPCTL5_EPTYPE_POS (18U) +#define USBHS_DOEPCTL5_EPTYPE (0x000C0000UL) +#define USBHS_DOEPCTL5_EPTYPE_0 (0x00040000UL) +#define USBHS_DOEPCTL5_EPTYPE_1 (0x00080000UL) +#define USBHS_DOEPCTL5_SNP_POS (20U) +#define USBHS_DOEPCTL5_SNP (0x00100000UL) +#define USBHS_DOEPCTL5_STALL_POS (21U) +#define USBHS_DOEPCTL5_STALL (0x00200000UL) +#define USBHS_DOEPCTL5_CNAK_POS (26U) +#define USBHS_DOEPCTL5_CNAK (0x04000000UL) +#define USBHS_DOEPCTL5_SNAK_POS (27U) +#define USBHS_DOEPCTL5_SNAK (0x08000000UL) +#define USBHS_DOEPCTL5_SETD0PID_POS (28U) +#define USBHS_DOEPCTL5_SETD0PID (0x10000000UL) +#define USBHS_DOEPCTL5_SETD1PID_POS (29U) +#define USBHS_DOEPCTL5_SETD1PID (0x20000000UL) +#define USBHS_DOEPCTL5_EPDIS_POS (30U) +#define USBHS_DOEPCTL5_EPDIS (0x40000000UL) +#define USBHS_DOEPCTL5_EPENA_POS (31U) +#define USBHS_DOEPCTL5_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DOEPINT5 register */ +#define USBHS_DOEPINT5_XFERCOMPL_POS (0U) +#define USBHS_DOEPINT5_XFERCOMPL (0x00000001UL) +#define USBHS_DOEPINT5_EPDISBLD_POS (1U) +#define USBHS_DOEPINT5_EPDISBLD (0x00000002UL) +#define USBHS_DOEPINT5_AHBERR_POS (2U) +#define USBHS_DOEPINT5_AHBERR (0x00000004UL) +#define USBHS_DOEPINT5_SETUP_POS (3U) +#define USBHS_DOEPINT5_SETUP (0x00000008UL) +#define USBHS_DOEPINT5_OUTTKNEPDIS_POS (4U) +#define USBHS_DOEPINT5_OUTTKNEPDIS (0x00000010UL) +#define USBHS_DOEPINT5_STSPHSERCVD_POS (5U) +#define USBHS_DOEPINT5_STSPHSERCVD (0x00000020UL) +#define USBHS_DOEPINT5_BACK2BACKSETUP_POS (6U) +#define USBHS_DOEPINT5_BACK2BACKSETUP (0x00000040UL) +#define USBHS_DOEPINT5_OUTPKTERR_POS (8U) +#define USBHS_DOEPINT5_OUTPKTERR (0x00000100UL) +#define USBHS_DOEPINT5_BNAINTR_POS (9U) +#define USBHS_DOEPINT5_BNAINTR (0x00000200UL) +#define USBHS_DOEPINT5_PKTDRPSTS_POS (11U) +#define USBHS_DOEPINT5_PKTDRPSTS (0x00000800UL) +#define USBHS_DOEPINT5_BBLEERR_POS (12U) +#define USBHS_DOEPINT5_BBLEERR (0x00001000UL) +#define USBHS_DOEPINT5_NAKINTRPT_POS (13U) +#define USBHS_DOEPINT5_NAKINTRPT (0x00002000UL) +#define USBHS_DOEPINT5_NYETINTRPT_POS (14U) +#define USBHS_DOEPINT5_NYETINTRPT (0x00004000UL) +#define USBHS_DOEPINT5_STUPPKTRCVD_POS (15U) +#define USBHS_DOEPINT5_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBHS_DOEPTSIZ5 register */ +#define USBHS_DOEPTSIZ5_XFERSIZE_POS (0U) +#define USBHS_DOEPTSIZ5_XFERSIZE (0x0007FFFFUL) +#define USBHS_DOEPTSIZ5_XFERSIZE_0 (0x00000001UL) +#define USBHS_DOEPTSIZ5_XFERSIZE_1 (0x00000002UL) +#define USBHS_DOEPTSIZ5_XFERSIZE_2 (0x00000004UL) +#define USBHS_DOEPTSIZ5_XFERSIZE_3 (0x00000008UL) +#define USBHS_DOEPTSIZ5_XFERSIZE_4 (0x00000010UL) +#define USBHS_DOEPTSIZ5_XFERSIZE_5 (0x00000020UL) +#define USBHS_DOEPTSIZ5_XFERSIZE_6 (0x00000040UL) +#define USBHS_DOEPTSIZ5_XFERSIZE_7 (0x00000080UL) +#define USBHS_DOEPTSIZ5_XFERSIZE_8 (0x00000100UL) +#define USBHS_DOEPTSIZ5_XFERSIZE_9 (0x00000200UL) +#define USBHS_DOEPTSIZ5_XFERSIZE_10 (0x00000400UL) +#define USBHS_DOEPTSIZ5_XFERSIZE_11 (0x00000800UL) +#define USBHS_DOEPTSIZ5_XFERSIZE_12 (0x00001000UL) +#define USBHS_DOEPTSIZ5_XFERSIZE_13 (0x00002000UL) +#define USBHS_DOEPTSIZ5_XFERSIZE_14 (0x00004000UL) +#define USBHS_DOEPTSIZ5_XFERSIZE_15 (0x00008000UL) +#define USBHS_DOEPTSIZ5_XFERSIZE_16 (0x00010000UL) +#define USBHS_DOEPTSIZ5_XFERSIZE_17 (0x00020000UL) +#define USBHS_DOEPTSIZ5_XFERSIZE_18 (0x00040000UL) +#define USBHS_DOEPTSIZ5_PKTCNT_POS (19U) +#define USBHS_DOEPTSIZ5_PKTCNT (0x1FF80000UL) +#define USBHS_DOEPTSIZ5_PKTCNT_0 (0x00080000UL) +#define USBHS_DOEPTSIZ5_PKTCNT_1 (0x00100000UL) +#define USBHS_DOEPTSIZ5_PKTCNT_2 (0x00200000UL) +#define USBHS_DOEPTSIZ5_PKTCNT_3 (0x00400000UL) +#define USBHS_DOEPTSIZ5_PKTCNT_4 (0x00800000UL) +#define USBHS_DOEPTSIZ5_PKTCNT_5 (0x01000000UL) +#define USBHS_DOEPTSIZ5_PKTCNT_6 (0x02000000UL) +#define USBHS_DOEPTSIZ5_PKTCNT_7 (0x04000000UL) +#define USBHS_DOEPTSIZ5_PKTCNT_8 (0x08000000UL) +#define USBHS_DOEPTSIZ5_PKTCNT_9 (0x10000000UL) +#define USBHS_DOEPTSIZ5_RXDPID_POS (29U) +#define USBHS_DOEPTSIZ5_RXDPID (0x60000000UL) +#define USBHS_DOEPTSIZ5_RXDPID_0 (0x20000000UL) +#define USBHS_DOEPTSIZ5_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBHS_DOEPDMA5 register */ +#define USBHS_DOEPDMA5 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DOEPCTL6 register */ +#define USBHS_DOEPCTL6_MPS_POS (0U) +#define USBHS_DOEPCTL6_MPS (0x000007FFUL) +#define USBHS_DOEPCTL6_MPS_0 (0x00000001UL) +#define USBHS_DOEPCTL6_MPS_1 (0x00000002UL) +#define USBHS_DOEPCTL6_MPS_2 (0x00000004UL) +#define USBHS_DOEPCTL6_MPS_3 (0x00000008UL) +#define USBHS_DOEPCTL6_MPS_4 (0x00000010UL) +#define USBHS_DOEPCTL6_MPS_5 (0x00000020UL) +#define USBHS_DOEPCTL6_MPS_6 (0x00000040UL) +#define USBHS_DOEPCTL6_MPS_7 (0x00000080UL) +#define USBHS_DOEPCTL6_MPS_8 (0x00000100UL) +#define USBHS_DOEPCTL6_MPS_9 (0x00000200UL) +#define USBHS_DOEPCTL6_MPS_10 (0x00000400UL) +#define USBHS_DOEPCTL6_USBACTEP_POS (15U) +#define USBHS_DOEPCTL6_USBACTEP (0x00008000UL) +#define USBHS_DOEPCTL6_DPID_POS (16U) +#define USBHS_DOEPCTL6_DPID (0x00010000UL) +#define USBHS_DOEPCTL6_NAKSTS_POS (17U) +#define USBHS_DOEPCTL6_NAKSTS (0x00020000UL) +#define USBHS_DOEPCTL6_EPTYPE_POS (18U) +#define USBHS_DOEPCTL6_EPTYPE (0x000C0000UL) +#define USBHS_DOEPCTL6_EPTYPE_0 (0x00040000UL) +#define USBHS_DOEPCTL6_EPTYPE_1 (0x00080000UL) +#define USBHS_DOEPCTL6_SNP_POS (20U) +#define USBHS_DOEPCTL6_SNP (0x00100000UL) +#define USBHS_DOEPCTL6_STALL_POS (21U) +#define USBHS_DOEPCTL6_STALL (0x00200000UL) +#define USBHS_DOEPCTL6_CNAK_POS (26U) +#define USBHS_DOEPCTL6_CNAK (0x04000000UL) +#define USBHS_DOEPCTL6_SNAK_POS (27U) +#define USBHS_DOEPCTL6_SNAK (0x08000000UL) +#define USBHS_DOEPCTL6_SETD0PID_POS (28U) +#define USBHS_DOEPCTL6_SETD0PID (0x10000000UL) +#define USBHS_DOEPCTL6_SETD1PID_POS (29U) +#define USBHS_DOEPCTL6_SETD1PID (0x20000000UL) +#define USBHS_DOEPCTL6_EPDIS_POS (30U) +#define USBHS_DOEPCTL6_EPDIS (0x40000000UL) +#define USBHS_DOEPCTL6_EPENA_POS (31U) +#define USBHS_DOEPCTL6_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DOEPINT6 register */ +#define USBHS_DOEPINT6_XFERCOMPL_POS (0U) +#define USBHS_DOEPINT6_XFERCOMPL (0x00000001UL) +#define USBHS_DOEPINT6_EPDISBLD_POS (1U) +#define USBHS_DOEPINT6_EPDISBLD (0x00000002UL) +#define USBHS_DOEPINT6_AHBERR_POS (2U) +#define USBHS_DOEPINT6_AHBERR (0x00000004UL) +#define USBHS_DOEPINT6_SETUP_POS (3U) +#define USBHS_DOEPINT6_SETUP (0x00000008UL) +#define USBHS_DOEPINT6_OUTTKNEPDIS_POS (4U) +#define USBHS_DOEPINT6_OUTTKNEPDIS (0x00000010UL) +#define USBHS_DOEPINT6_STSPHSERCVD_POS (5U) +#define USBHS_DOEPINT6_STSPHSERCVD (0x00000020UL) +#define USBHS_DOEPINT6_BACK2BACKSETUP_POS (6U) +#define USBHS_DOEPINT6_BACK2BACKSETUP (0x00000040UL) +#define USBHS_DOEPINT6_OUTPKTERR_POS (8U) +#define USBHS_DOEPINT6_OUTPKTERR (0x00000100UL) +#define USBHS_DOEPINT6_BNAINTR_POS (9U) +#define USBHS_DOEPINT6_BNAINTR (0x00000200UL) +#define USBHS_DOEPINT6_PKTDRPSTS_POS (11U) +#define USBHS_DOEPINT6_PKTDRPSTS (0x00000800UL) +#define USBHS_DOEPINT6_BBLEERR_POS (12U) +#define USBHS_DOEPINT6_BBLEERR (0x00001000UL) +#define USBHS_DOEPINT6_NAKINTRPT_POS (13U) +#define USBHS_DOEPINT6_NAKINTRPT (0x00002000UL) +#define USBHS_DOEPINT6_NYETINTRPT_POS (14U) +#define USBHS_DOEPINT6_NYETINTRPT (0x00004000UL) +#define USBHS_DOEPINT6_STUPPKTRCVD_POS (15U) +#define USBHS_DOEPINT6_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBHS_DOEPTSIZ6 register */ +#define USBHS_DOEPTSIZ6_XFERSIZE_POS (0U) +#define USBHS_DOEPTSIZ6_XFERSIZE (0x0007FFFFUL) +#define USBHS_DOEPTSIZ6_XFERSIZE_0 (0x00000001UL) +#define USBHS_DOEPTSIZ6_XFERSIZE_1 (0x00000002UL) +#define USBHS_DOEPTSIZ6_XFERSIZE_2 (0x00000004UL) +#define USBHS_DOEPTSIZ6_XFERSIZE_3 (0x00000008UL) +#define USBHS_DOEPTSIZ6_XFERSIZE_4 (0x00000010UL) +#define USBHS_DOEPTSIZ6_XFERSIZE_5 (0x00000020UL) +#define USBHS_DOEPTSIZ6_XFERSIZE_6 (0x00000040UL) +#define USBHS_DOEPTSIZ6_XFERSIZE_7 (0x00000080UL) +#define USBHS_DOEPTSIZ6_XFERSIZE_8 (0x00000100UL) +#define USBHS_DOEPTSIZ6_XFERSIZE_9 (0x00000200UL) +#define USBHS_DOEPTSIZ6_XFERSIZE_10 (0x00000400UL) +#define USBHS_DOEPTSIZ6_XFERSIZE_11 (0x00000800UL) +#define USBHS_DOEPTSIZ6_XFERSIZE_12 (0x00001000UL) +#define USBHS_DOEPTSIZ6_XFERSIZE_13 (0x00002000UL) +#define USBHS_DOEPTSIZ6_XFERSIZE_14 (0x00004000UL) +#define USBHS_DOEPTSIZ6_XFERSIZE_15 (0x00008000UL) +#define USBHS_DOEPTSIZ6_XFERSIZE_16 (0x00010000UL) +#define USBHS_DOEPTSIZ6_XFERSIZE_17 (0x00020000UL) +#define USBHS_DOEPTSIZ6_XFERSIZE_18 (0x00040000UL) +#define USBHS_DOEPTSIZ6_PKTCNT_POS (19U) +#define USBHS_DOEPTSIZ6_PKTCNT (0x1FF80000UL) +#define USBHS_DOEPTSIZ6_PKTCNT_0 (0x00080000UL) +#define USBHS_DOEPTSIZ6_PKTCNT_1 (0x00100000UL) +#define USBHS_DOEPTSIZ6_PKTCNT_2 (0x00200000UL) +#define USBHS_DOEPTSIZ6_PKTCNT_3 (0x00400000UL) +#define USBHS_DOEPTSIZ6_PKTCNT_4 (0x00800000UL) +#define USBHS_DOEPTSIZ6_PKTCNT_5 (0x01000000UL) +#define USBHS_DOEPTSIZ6_PKTCNT_6 (0x02000000UL) +#define USBHS_DOEPTSIZ6_PKTCNT_7 (0x04000000UL) +#define USBHS_DOEPTSIZ6_PKTCNT_8 (0x08000000UL) +#define USBHS_DOEPTSIZ6_PKTCNT_9 (0x10000000UL) +#define USBHS_DOEPTSIZ6_RXDPID_POS (29U) +#define USBHS_DOEPTSIZ6_RXDPID (0x60000000UL) +#define USBHS_DOEPTSIZ6_RXDPID_0 (0x20000000UL) +#define USBHS_DOEPTSIZ6_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBHS_DOEPDMA6 register */ +#define USBHS_DOEPDMA6 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DOEPCTL7 register */ +#define USBHS_DOEPCTL7_MPS_POS (0U) +#define USBHS_DOEPCTL7_MPS (0x000007FFUL) +#define USBHS_DOEPCTL7_MPS_0 (0x00000001UL) +#define USBHS_DOEPCTL7_MPS_1 (0x00000002UL) +#define USBHS_DOEPCTL7_MPS_2 (0x00000004UL) +#define USBHS_DOEPCTL7_MPS_3 (0x00000008UL) +#define USBHS_DOEPCTL7_MPS_4 (0x00000010UL) +#define USBHS_DOEPCTL7_MPS_5 (0x00000020UL) +#define USBHS_DOEPCTL7_MPS_6 (0x00000040UL) +#define USBHS_DOEPCTL7_MPS_7 (0x00000080UL) +#define USBHS_DOEPCTL7_MPS_8 (0x00000100UL) +#define USBHS_DOEPCTL7_MPS_9 (0x00000200UL) +#define USBHS_DOEPCTL7_MPS_10 (0x00000400UL) +#define USBHS_DOEPCTL7_USBACTEP_POS (15U) +#define USBHS_DOEPCTL7_USBACTEP (0x00008000UL) +#define USBHS_DOEPCTL7_DPID_POS (16U) +#define USBHS_DOEPCTL7_DPID (0x00010000UL) +#define USBHS_DOEPCTL7_NAKSTS_POS (17U) +#define USBHS_DOEPCTL7_NAKSTS (0x00020000UL) +#define USBHS_DOEPCTL7_EPTYPE_POS (18U) +#define USBHS_DOEPCTL7_EPTYPE (0x000C0000UL) +#define USBHS_DOEPCTL7_EPTYPE_0 (0x00040000UL) +#define USBHS_DOEPCTL7_EPTYPE_1 (0x00080000UL) +#define USBHS_DOEPCTL7_SNP_POS (20U) +#define USBHS_DOEPCTL7_SNP (0x00100000UL) +#define USBHS_DOEPCTL7_STALL_POS (21U) +#define USBHS_DOEPCTL7_STALL (0x00200000UL) +#define USBHS_DOEPCTL7_CNAK_POS (26U) +#define USBHS_DOEPCTL7_CNAK (0x04000000UL) +#define USBHS_DOEPCTL7_SNAK_POS (27U) +#define USBHS_DOEPCTL7_SNAK (0x08000000UL) +#define USBHS_DOEPCTL7_SETD0PID_POS (28U) +#define USBHS_DOEPCTL7_SETD0PID (0x10000000UL) +#define USBHS_DOEPCTL7_SETD1PID_POS (29U) +#define USBHS_DOEPCTL7_SETD1PID (0x20000000UL) +#define USBHS_DOEPCTL7_EPDIS_POS (30U) +#define USBHS_DOEPCTL7_EPDIS (0x40000000UL) +#define USBHS_DOEPCTL7_EPENA_POS (31U) +#define USBHS_DOEPCTL7_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DOEPINT7 register */ +#define USBHS_DOEPINT7_XFERCOMPL_POS (0U) +#define USBHS_DOEPINT7_XFERCOMPL (0x00000001UL) +#define USBHS_DOEPINT7_EPDISBLD_POS (1U) +#define USBHS_DOEPINT7_EPDISBLD (0x00000002UL) +#define USBHS_DOEPINT7_AHBERR_POS (2U) +#define USBHS_DOEPINT7_AHBERR (0x00000004UL) +#define USBHS_DOEPINT7_SETUP_POS (3U) +#define USBHS_DOEPINT7_SETUP (0x00000008UL) +#define USBHS_DOEPINT7_OUTTKNEPDIS_POS (4U) +#define USBHS_DOEPINT7_OUTTKNEPDIS (0x00000010UL) +#define USBHS_DOEPINT7_STSPHSERCVD_POS (5U) +#define USBHS_DOEPINT7_STSPHSERCVD (0x00000020UL) +#define USBHS_DOEPINT7_BACK2BACKSETUP_POS (6U) +#define USBHS_DOEPINT7_BACK2BACKSETUP (0x00000040UL) +#define USBHS_DOEPINT7_OUTPKTERR_POS (8U) +#define USBHS_DOEPINT7_OUTPKTERR (0x00000100UL) +#define USBHS_DOEPINT7_BNAINTR_POS (9U) +#define USBHS_DOEPINT7_BNAINTR (0x00000200UL) +#define USBHS_DOEPINT7_PKTDRPSTS_POS (11U) +#define USBHS_DOEPINT7_PKTDRPSTS (0x00000800UL) +#define USBHS_DOEPINT7_BBLEERR_POS (12U) +#define USBHS_DOEPINT7_BBLEERR (0x00001000UL) +#define USBHS_DOEPINT7_NAKINTRPT_POS (13U) +#define USBHS_DOEPINT7_NAKINTRPT (0x00002000UL) +#define USBHS_DOEPINT7_NYETINTRPT_POS (14U) +#define USBHS_DOEPINT7_NYETINTRPT (0x00004000UL) +#define USBHS_DOEPINT7_STUPPKTRCVD_POS (15U) +#define USBHS_DOEPINT7_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBHS_DOEPTSIZ7 register */ +#define USBHS_DOEPTSIZ7_XFERSIZE_POS (0U) +#define USBHS_DOEPTSIZ7_XFERSIZE (0x0007FFFFUL) +#define USBHS_DOEPTSIZ7_XFERSIZE_0 (0x00000001UL) +#define USBHS_DOEPTSIZ7_XFERSIZE_1 (0x00000002UL) +#define USBHS_DOEPTSIZ7_XFERSIZE_2 (0x00000004UL) +#define USBHS_DOEPTSIZ7_XFERSIZE_3 (0x00000008UL) +#define USBHS_DOEPTSIZ7_XFERSIZE_4 (0x00000010UL) +#define USBHS_DOEPTSIZ7_XFERSIZE_5 (0x00000020UL) +#define USBHS_DOEPTSIZ7_XFERSIZE_6 (0x00000040UL) +#define USBHS_DOEPTSIZ7_XFERSIZE_7 (0x00000080UL) +#define USBHS_DOEPTSIZ7_XFERSIZE_8 (0x00000100UL) +#define USBHS_DOEPTSIZ7_XFERSIZE_9 (0x00000200UL) +#define USBHS_DOEPTSIZ7_XFERSIZE_10 (0x00000400UL) +#define USBHS_DOEPTSIZ7_XFERSIZE_11 (0x00000800UL) +#define USBHS_DOEPTSIZ7_XFERSIZE_12 (0x00001000UL) +#define USBHS_DOEPTSIZ7_XFERSIZE_13 (0x00002000UL) +#define USBHS_DOEPTSIZ7_XFERSIZE_14 (0x00004000UL) +#define USBHS_DOEPTSIZ7_XFERSIZE_15 (0x00008000UL) +#define USBHS_DOEPTSIZ7_XFERSIZE_16 (0x00010000UL) +#define USBHS_DOEPTSIZ7_XFERSIZE_17 (0x00020000UL) +#define USBHS_DOEPTSIZ7_XFERSIZE_18 (0x00040000UL) +#define USBHS_DOEPTSIZ7_PKTCNT_POS (19U) +#define USBHS_DOEPTSIZ7_PKTCNT (0x1FF80000UL) +#define USBHS_DOEPTSIZ7_PKTCNT_0 (0x00080000UL) +#define USBHS_DOEPTSIZ7_PKTCNT_1 (0x00100000UL) +#define USBHS_DOEPTSIZ7_PKTCNT_2 (0x00200000UL) +#define USBHS_DOEPTSIZ7_PKTCNT_3 (0x00400000UL) +#define USBHS_DOEPTSIZ7_PKTCNT_4 (0x00800000UL) +#define USBHS_DOEPTSIZ7_PKTCNT_5 (0x01000000UL) +#define USBHS_DOEPTSIZ7_PKTCNT_6 (0x02000000UL) +#define USBHS_DOEPTSIZ7_PKTCNT_7 (0x04000000UL) +#define USBHS_DOEPTSIZ7_PKTCNT_8 (0x08000000UL) +#define USBHS_DOEPTSIZ7_PKTCNT_9 (0x10000000UL) +#define USBHS_DOEPTSIZ7_RXDPID_POS (29U) +#define USBHS_DOEPTSIZ7_RXDPID (0x60000000UL) +#define USBHS_DOEPTSIZ7_RXDPID_0 (0x20000000UL) +#define USBHS_DOEPTSIZ7_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBHS_DOEPDMA7 register */ +#define USBHS_DOEPDMA7 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DOEPCTL8 register */ +#define USBHS_DOEPCTL8_MPS_POS (0U) +#define USBHS_DOEPCTL8_MPS (0x000007FFUL) +#define USBHS_DOEPCTL8_MPS_0 (0x00000001UL) +#define USBHS_DOEPCTL8_MPS_1 (0x00000002UL) +#define USBHS_DOEPCTL8_MPS_2 (0x00000004UL) +#define USBHS_DOEPCTL8_MPS_3 (0x00000008UL) +#define USBHS_DOEPCTL8_MPS_4 (0x00000010UL) +#define USBHS_DOEPCTL8_MPS_5 (0x00000020UL) +#define USBHS_DOEPCTL8_MPS_6 (0x00000040UL) +#define USBHS_DOEPCTL8_MPS_7 (0x00000080UL) +#define USBHS_DOEPCTL8_MPS_8 (0x00000100UL) +#define USBHS_DOEPCTL8_MPS_9 (0x00000200UL) +#define USBHS_DOEPCTL8_MPS_10 (0x00000400UL) +#define USBHS_DOEPCTL8_USBACTEP_POS (15U) +#define USBHS_DOEPCTL8_USBACTEP (0x00008000UL) +#define USBHS_DOEPCTL8_DPID_POS (16U) +#define USBHS_DOEPCTL8_DPID (0x00010000UL) +#define USBHS_DOEPCTL8_NAKSTS_POS (17U) +#define USBHS_DOEPCTL8_NAKSTS (0x00020000UL) +#define USBHS_DOEPCTL8_EPTYPE_POS (18U) +#define USBHS_DOEPCTL8_EPTYPE (0x000C0000UL) +#define USBHS_DOEPCTL8_EPTYPE_0 (0x00040000UL) +#define USBHS_DOEPCTL8_EPTYPE_1 (0x00080000UL) +#define USBHS_DOEPCTL8_SNP_POS (20U) +#define USBHS_DOEPCTL8_SNP (0x00100000UL) +#define USBHS_DOEPCTL8_STALL_POS (21U) +#define USBHS_DOEPCTL8_STALL (0x00200000UL) +#define USBHS_DOEPCTL8_CNAK_POS (26U) +#define USBHS_DOEPCTL8_CNAK (0x04000000UL) +#define USBHS_DOEPCTL8_SNAK_POS (27U) +#define USBHS_DOEPCTL8_SNAK (0x08000000UL) +#define USBHS_DOEPCTL8_SETD0PID_POS (28U) +#define USBHS_DOEPCTL8_SETD0PID (0x10000000UL) +#define USBHS_DOEPCTL8_SETD1PID_POS (29U) +#define USBHS_DOEPCTL8_SETD1PID (0x20000000UL) +#define USBHS_DOEPCTL8_EPDIS_POS (30U) +#define USBHS_DOEPCTL8_EPDIS (0x40000000UL) +#define USBHS_DOEPCTL8_EPENA_POS (31U) +#define USBHS_DOEPCTL8_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DOEPINT8 register */ +#define USBHS_DOEPINT8_XFERCOMPL_POS (0U) +#define USBHS_DOEPINT8_XFERCOMPL (0x00000001UL) +#define USBHS_DOEPINT8_EPDISBLD_POS (1U) +#define USBHS_DOEPINT8_EPDISBLD (0x00000002UL) +#define USBHS_DOEPINT8_AHBERR_POS (2U) +#define USBHS_DOEPINT8_AHBERR (0x00000004UL) +#define USBHS_DOEPINT8_SETUP_POS (3U) +#define USBHS_DOEPINT8_SETUP (0x00000008UL) +#define USBHS_DOEPINT8_OUTTKNEPDIS_POS (4U) +#define USBHS_DOEPINT8_OUTTKNEPDIS (0x00000010UL) +#define USBHS_DOEPINT8_STSPHSERCVD_POS (5U) +#define USBHS_DOEPINT8_STSPHSERCVD (0x00000020UL) +#define USBHS_DOEPINT8_BACK2BACKSETUP_POS (6U) +#define USBHS_DOEPINT8_BACK2BACKSETUP (0x00000040UL) +#define USBHS_DOEPINT8_OUTPKTERR_POS (8U) +#define USBHS_DOEPINT8_OUTPKTERR (0x00000100UL) +#define USBHS_DOEPINT8_BNAINTR_POS (9U) +#define USBHS_DOEPINT8_BNAINTR (0x00000200UL) +#define USBHS_DOEPINT8_PKTDRPSTS_POS (11U) +#define USBHS_DOEPINT8_PKTDRPSTS (0x00000800UL) +#define USBHS_DOEPINT8_BBLEERR_POS (12U) +#define USBHS_DOEPINT8_BBLEERR (0x00001000UL) +#define USBHS_DOEPINT8_NAKINTRPT_POS (13U) +#define USBHS_DOEPINT8_NAKINTRPT (0x00002000UL) +#define USBHS_DOEPINT8_NYETINTRPT_POS (14U) +#define USBHS_DOEPINT8_NYETINTRPT (0x00004000UL) +#define USBHS_DOEPINT8_STUPPKTRCVD_POS (15U) +#define USBHS_DOEPINT8_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBHS_DOEPTSIZ8 register */ +#define USBHS_DOEPTSIZ8_XFERSIZE_POS (0U) +#define USBHS_DOEPTSIZ8_XFERSIZE (0x0007FFFFUL) +#define USBHS_DOEPTSIZ8_XFERSIZE_0 (0x00000001UL) +#define USBHS_DOEPTSIZ8_XFERSIZE_1 (0x00000002UL) +#define USBHS_DOEPTSIZ8_XFERSIZE_2 (0x00000004UL) +#define USBHS_DOEPTSIZ8_XFERSIZE_3 (0x00000008UL) +#define USBHS_DOEPTSIZ8_XFERSIZE_4 (0x00000010UL) +#define USBHS_DOEPTSIZ8_XFERSIZE_5 (0x00000020UL) +#define USBHS_DOEPTSIZ8_XFERSIZE_6 (0x00000040UL) +#define USBHS_DOEPTSIZ8_XFERSIZE_7 (0x00000080UL) +#define USBHS_DOEPTSIZ8_XFERSIZE_8 (0x00000100UL) +#define USBHS_DOEPTSIZ8_XFERSIZE_9 (0x00000200UL) +#define USBHS_DOEPTSIZ8_XFERSIZE_10 (0x00000400UL) +#define USBHS_DOEPTSIZ8_XFERSIZE_11 (0x00000800UL) +#define USBHS_DOEPTSIZ8_XFERSIZE_12 (0x00001000UL) +#define USBHS_DOEPTSIZ8_XFERSIZE_13 (0x00002000UL) +#define USBHS_DOEPTSIZ8_XFERSIZE_14 (0x00004000UL) +#define USBHS_DOEPTSIZ8_XFERSIZE_15 (0x00008000UL) +#define USBHS_DOEPTSIZ8_XFERSIZE_16 (0x00010000UL) +#define USBHS_DOEPTSIZ8_XFERSIZE_17 (0x00020000UL) +#define USBHS_DOEPTSIZ8_XFERSIZE_18 (0x00040000UL) +#define USBHS_DOEPTSIZ8_PKTCNT_POS (19U) +#define USBHS_DOEPTSIZ8_PKTCNT (0x1FF80000UL) +#define USBHS_DOEPTSIZ8_PKTCNT_0 (0x00080000UL) +#define USBHS_DOEPTSIZ8_PKTCNT_1 (0x00100000UL) +#define USBHS_DOEPTSIZ8_PKTCNT_2 (0x00200000UL) +#define USBHS_DOEPTSIZ8_PKTCNT_3 (0x00400000UL) +#define USBHS_DOEPTSIZ8_PKTCNT_4 (0x00800000UL) +#define USBHS_DOEPTSIZ8_PKTCNT_5 (0x01000000UL) +#define USBHS_DOEPTSIZ8_PKTCNT_6 (0x02000000UL) +#define USBHS_DOEPTSIZ8_PKTCNT_7 (0x04000000UL) +#define USBHS_DOEPTSIZ8_PKTCNT_8 (0x08000000UL) +#define USBHS_DOEPTSIZ8_PKTCNT_9 (0x10000000UL) +#define USBHS_DOEPTSIZ8_RXDPID_POS (29U) +#define USBHS_DOEPTSIZ8_RXDPID (0x60000000UL) +#define USBHS_DOEPTSIZ8_RXDPID_0 (0x20000000UL) +#define USBHS_DOEPTSIZ8_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBHS_DOEPDMA8 register */ +#define USBHS_DOEPDMA8 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DOEPCTL9 register */ +#define USBHS_DOEPCTL9_MPS_POS (0U) +#define USBHS_DOEPCTL9_MPS (0x000007FFUL) +#define USBHS_DOEPCTL9_MPS_0 (0x00000001UL) +#define USBHS_DOEPCTL9_MPS_1 (0x00000002UL) +#define USBHS_DOEPCTL9_MPS_2 (0x00000004UL) +#define USBHS_DOEPCTL9_MPS_3 (0x00000008UL) +#define USBHS_DOEPCTL9_MPS_4 (0x00000010UL) +#define USBHS_DOEPCTL9_MPS_5 (0x00000020UL) +#define USBHS_DOEPCTL9_MPS_6 (0x00000040UL) +#define USBHS_DOEPCTL9_MPS_7 (0x00000080UL) +#define USBHS_DOEPCTL9_MPS_8 (0x00000100UL) +#define USBHS_DOEPCTL9_MPS_9 (0x00000200UL) +#define USBHS_DOEPCTL9_MPS_10 (0x00000400UL) +#define USBHS_DOEPCTL9_USBACTEP_POS (15U) +#define USBHS_DOEPCTL9_USBACTEP (0x00008000UL) +#define USBHS_DOEPCTL9_DPID_POS (16U) +#define USBHS_DOEPCTL9_DPID (0x00010000UL) +#define USBHS_DOEPCTL9_NAKSTS_POS (17U) +#define USBHS_DOEPCTL9_NAKSTS (0x00020000UL) +#define USBHS_DOEPCTL9_EPTYPE_POS (18U) +#define USBHS_DOEPCTL9_EPTYPE (0x000C0000UL) +#define USBHS_DOEPCTL9_EPTYPE_0 (0x00040000UL) +#define USBHS_DOEPCTL9_EPTYPE_1 (0x00080000UL) +#define USBHS_DOEPCTL9_SNP_POS (20U) +#define USBHS_DOEPCTL9_SNP (0x00100000UL) +#define USBHS_DOEPCTL9_STALL_POS (21U) +#define USBHS_DOEPCTL9_STALL (0x00200000UL) +#define USBHS_DOEPCTL9_CNAK_POS (26U) +#define USBHS_DOEPCTL9_CNAK (0x04000000UL) +#define USBHS_DOEPCTL9_SNAK_POS (27U) +#define USBHS_DOEPCTL9_SNAK (0x08000000UL) +#define USBHS_DOEPCTL9_SETD0PID_POS (28U) +#define USBHS_DOEPCTL9_SETD0PID (0x10000000UL) +#define USBHS_DOEPCTL9_SETD1PID_POS (29U) +#define USBHS_DOEPCTL9_SETD1PID (0x20000000UL) +#define USBHS_DOEPCTL9_EPDIS_POS (30U) +#define USBHS_DOEPCTL9_EPDIS (0x40000000UL) +#define USBHS_DOEPCTL9_EPENA_POS (31U) +#define USBHS_DOEPCTL9_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DOEPINT9 register */ +#define USBHS_DOEPINT9_XFERCOMPL_POS (0U) +#define USBHS_DOEPINT9_XFERCOMPL (0x00000001UL) +#define USBHS_DOEPINT9_EPDISBLD_POS (1U) +#define USBHS_DOEPINT9_EPDISBLD (0x00000002UL) +#define USBHS_DOEPINT9_AHBERR_POS (2U) +#define USBHS_DOEPINT9_AHBERR (0x00000004UL) +#define USBHS_DOEPINT9_SETUP_POS (3U) +#define USBHS_DOEPINT9_SETUP (0x00000008UL) +#define USBHS_DOEPINT9_OUTTKNEPDIS_POS (4U) +#define USBHS_DOEPINT9_OUTTKNEPDIS (0x00000010UL) +#define USBHS_DOEPINT9_STSPHSERCVD_POS (5U) +#define USBHS_DOEPINT9_STSPHSERCVD (0x00000020UL) +#define USBHS_DOEPINT9_BACK2BACKSETUP_POS (6U) +#define USBHS_DOEPINT9_BACK2BACKSETUP (0x00000040UL) +#define USBHS_DOEPINT9_OUTPKTERR_POS (8U) +#define USBHS_DOEPINT9_OUTPKTERR (0x00000100UL) +#define USBHS_DOEPINT9_BNAINTR_POS (9U) +#define USBHS_DOEPINT9_BNAINTR (0x00000200UL) +#define USBHS_DOEPINT9_PKTDRPSTS_POS (11U) +#define USBHS_DOEPINT9_PKTDRPSTS (0x00000800UL) +#define USBHS_DOEPINT9_BBLEERR_POS (12U) +#define USBHS_DOEPINT9_BBLEERR (0x00001000UL) +#define USBHS_DOEPINT9_NAKINTRPT_POS (13U) +#define USBHS_DOEPINT9_NAKINTRPT (0x00002000UL) +#define USBHS_DOEPINT9_NYETINTRPT_POS (14U) +#define USBHS_DOEPINT9_NYETINTRPT (0x00004000UL) +#define USBHS_DOEPINT9_STUPPKTRCVD_POS (15U) +#define USBHS_DOEPINT9_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBHS_DOEPTSIZ9 register */ +#define USBHS_DOEPTSIZ9_XFERSIZE_POS (0U) +#define USBHS_DOEPTSIZ9_XFERSIZE (0x0007FFFFUL) +#define USBHS_DOEPTSIZ9_XFERSIZE_0 (0x00000001UL) +#define USBHS_DOEPTSIZ9_XFERSIZE_1 (0x00000002UL) +#define USBHS_DOEPTSIZ9_XFERSIZE_2 (0x00000004UL) +#define USBHS_DOEPTSIZ9_XFERSIZE_3 (0x00000008UL) +#define USBHS_DOEPTSIZ9_XFERSIZE_4 (0x00000010UL) +#define USBHS_DOEPTSIZ9_XFERSIZE_5 (0x00000020UL) +#define USBHS_DOEPTSIZ9_XFERSIZE_6 (0x00000040UL) +#define USBHS_DOEPTSIZ9_XFERSIZE_7 (0x00000080UL) +#define USBHS_DOEPTSIZ9_XFERSIZE_8 (0x00000100UL) +#define USBHS_DOEPTSIZ9_XFERSIZE_9 (0x00000200UL) +#define USBHS_DOEPTSIZ9_XFERSIZE_10 (0x00000400UL) +#define USBHS_DOEPTSIZ9_XFERSIZE_11 (0x00000800UL) +#define USBHS_DOEPTSIZ9_XFERSIZE_12 (0x00001000UL) +#define USBHS_DOEPTSIZ9_XFERSIZE_13 (0x00002000UL) +#define USBHS_DOEPTSIZ9_XFERSIZE_14 (0x00004000UL) +#define USBHS_DOEPTSIZ9_XFERSIZE_15 (0x00008000UL) +#define USBHS_DOEPTSIZ9_XFERSIZE_16 (0x00010000UL) +#define USBHS_DOEPTSIZ9_XFERSIZE_17 (0x00020000UL) +#define USBHS_DOEPTSIZ9_XFERSIZE_18 (0x00040000UL) +#define USBHS_DOEPTSIZ9_PKTCNT_POS (19U) +#define USBHS_DOEPTSIZ9_PKTCNT (0x1FF80000UL) +#define USBHS_DOEPTSIZ9_PKTCNT_0 (0x00080000UL) +#define USBHS_DOEPTSIZ9_PKTCNT_1 (0x00100000UL) +#define USBHS_DOEPTSIZ9_PKTCNT_2 (0x00200000UL) +#define USBHS_DOEPTSIZ9_PKTCNT_3 (0x00400000UL) +#define USBHS_DOEPTSIZ9_PKTCNT_4 (0x00800000UL) +#define USBHS_DOEPTSIZ9_PKTCNT_5 (0x01000000UL) +#define USBHS_DOEPTSIZ9_PKTCNT_6 (0x02000000UL) +#define USBHS_DOEPTSIZ9_PKTCNT_7 (0x04000000UL) +#define USBHS_DOEPTSIZ9_PKTCNT_8 (0x08000000UL) +#define USBHS_DOEPTSIZ9_PKTCNT_9 (0x10000000UL) +#define USBHS_DOEPTSIZ9_RXDPID_POS (29U) +#define USBHS_DOEPTSIZ9_RXDPID (0x60000000UL) +#define USBHS_DOEPTSIZ9_RXDPID_0 (0x20000000UL) +#define USBHS_DOEPTSIZ9_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBHS_DOEPDMA9 register */ +#define USBHS_DOEPDMA9 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DOEPCTL10 register */ +#define USBHS_DOEPCTL10_MPS_POS (0U) +#define USBHS_DOEPCTL10_MPS (0x000007FFUL) +#define USBHS_DOEPCTL10_MPS_0 (0x00000001UL) +#define USBHS_DOEPCTL10_MPS_1 (0x00000002UL) +#define USBHS_DOEPCTL10_MPS_2 (0x00000004UL) +#define USBHS_DOEPCTL10_MPS_3 (0x00000008UL) +#define USBHS_DOEPCTL10_MPS_4 (0x00000010UL) +#define USBHS_DOEPCTL10_MPS_5 (0x00000020UL) +#define USBHS_DOEPCTL10_MPS_6 (0x00000040UL) +#define USBHS_DOEPCTL10_MPS_7 (0x00000080UL) +#define USBHS_DOEPCTL10_MPS_8 (0x00000100UL) +#define USBHS_DOEPCTL10_MPS_9 (0x00000200UL) +#define USBHS_DOEPCTL10_MPS_10 (0x00000400UL) +#define USBHS_DOEPCTL10_USBACTEP_POS (15U) +#define USBHS_DOEPCTL10_USBACTEP (0x00008000UL) +#define USBHS_DOEPCTL10_DPID_POS (16U) +#define USBHS_DOEPCTL10_DPID (0x00010000UL) +#define USBHS_DOEPCTL10_NAKSTS_POS (17U) +#define USBHS_DOEPCTL10_NAKSTS (0x00020000UL) +#define USBHS_DOEPCTL10_EPTYPE_POS (18U) +#define USBHS_DOEPCTL10_EPTYPE (0x000C0000UL) +#define USBHS_DOEPCTL10_EPTYPE_0 (0x00040000UL) +#define USBHS_DOEPCTL10_EPTYPE_1 (0x00080000UL) +#define USBHS_DOEPCTL10_SNP_POS (20U) +#define USBHS_DOEPCTL10_SNP (0x00100000UL) +#define USBHS_DOEPCTL10_STALL_POS (21U) +#define USBHS_DOEPCTL10_STALL (0x00200000UL) +#define USBHS_DOEPCTL10_CNAK_POS (26U) +#define USBHS_DOEPCTL10_CNAK (0x04000000UL) +#define USBHS_DOEPCTL10_SNAK_POS (27U) +#define USBHS_DOEPCTL10_SNAK (0x08000000UL) +#define USBHS_DOEPCTL10_SETD0PID_POS (28U) +#define USBHS_DOEPCTL10_SETD0PID (0x10000000UL) +#define USBHS_DOEPCTL10_SETD1PID_POS (29U) +#define USBHS_DOEPCTL10_SETD1PID (0x20000000UL) +#define USBHS_DOEPCTL10_EPDIS_POS (30U) +#define USBHS_DOEPCTL10_EPDIS (0x40000000UL) +#define USBHS_DOEPCTL10_EPENA_POS (31U) +#define USBHS_DOEPCTL10_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DOEPINT10 register */ +#define USBHS_DOEPINT10_XFERCOMPL_POS (0U) +#define USBHS_DOEPINT10_XFERCOMPL (0x00000001UL) +#define USBHS_DOEPINT10_EPDISBLD_POS (1U) +#define USBHS_DOEPINT10_EPDISBLD (0x00000002UL) +#define USBHS_DOEPINT10_AHBERR_POS (2U) +#define USBHS_DOEPINT10_AHBERR (0x00000004UL) +#define USBHS_DOEPINT10_SETUP_POS (3U) +#define USBHS_DOEPINT10_SETUP (0x00000008UL) +#define USBHS_DOEPINT10_OUTTKNEPDIS_POS (4U) +#define USBHS_DOEPINT10_OUTTKNEPDIS (0x00000010UL) +#define USBHS_DOEPINT10_STSPHSERCVD_POS (5U) +#define USBHS_DOEPINT10_STSPHSERCVD (0x00000020UL) +#define USBHS_DOEPINT10_BACK2BACKSETUP_POS (6U) +#define USBHS_DOEPINT10_BACK2BACKSETUP (0x00000040UL) +#define USBHS_DOEPINT10_OUTPKTERR_POS (8U) +#define USBHS_DOEPINT10_OUTPKTERR (0x00000100UL) +#define USBHS_DOEPINT10_BNAINTR_POS (9U) +#define USBHS_DOEPINT10_BNAINTR (0x00000200UL) +#define USBHS_DOEPINT10_PKTDRPSTS_POS (11U) +#define USBHS_DOEPINT10_PKTDRPSTS (0x00000800UL) +#define USBHS_DOEPINT10_BBLEERR_POS (12U) +#define USBHS_DOEPINT10_BBLEERR (0x00001000UL) +#define USBHS_DOEPINT10_NAKINTRPT_POS (13U) +#define USBHS_DOEPINT10_NAKINTRPT (0x00002000UL) +#define USBHS_DOEPINT10_NYETINTRPT_POS (14U) +#define USBHS_DOEPINT10_NYETINTRPT (0x00004000UL) +#define USBHS_DOEPINT10_STUPPKTRCVD_POS (15U) +#define USBHS_DOEPINT10_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBHS_DOEPTSIZ10 register */ +#define USBHS_DOEPTSIZ10_XFERSIZE_POS (0U) +#define USBHS_DOEPTSIZ10_XFERSIZE (0x0007FFFFUL) +#define USBHS_DOEPTSIZ10_XFERSIZE_0 (0x00000001UL) +#define USBHS_DOEPTSIZ10_XFERSIZE_1 (0x00000002UL) +#define USBHS_DOEPTSIZ10_XFERSIZE_2 (0x00000004UL) +#define USBHS_DOEPTSIZ10_XFERSIZE_3 (0x00000008UL) +#define USBHS_DOEPTSIZ10_XFERSIZE_4 (0x00000010UL) +#define USBHS_DOEPTSIZ10_XFERSIZE_5 (0x00000020UL) +#define USBHS_DOEPTSIZ10_XFERSIZE_6 (0x00000040UL) +#define USBHS_DOEPTSIZ10_XFERSIZE_7 (0x00000080UL) +#define USBHS_DOEPTSIZ10_XFERSIZE_8 (0x00000100UL) +#define USBHS_DOEPTSIZ10_XFERSIZE_9 (0x00000200UL) +#define USBHS_DOEPTSIZ10_XFERSIZE_10 (0x00000400UL) +#define USBHS_DOEPTSIZ10_XFERSIZE_11 (0x00000800UL) +#define USBHS_DOEPTSIZ10_XFERSIZE_12 (0x00001000UL) +#define USBHS_DOEPTSIZ10_XFERSIZE_13 (0x00002000UL) +#define USBHS_DOEPTSIZ10_XFERSIZE_14 (0x00004000UL) +#define USBHS_DOEPTSIZ10_XFERSIZE_15 (0x00008000UL) +#define USBHS_DOEPTSIZ10_XFERSIZE_16 (0x00010000UL) +#define USBHS_DOEPTSIZ10_XFERSIZE_17 (0x00020000UL) +#define USBHS_DOEPTSIZ10_XFERSIZE_18 (0x00040000UL) +#define USBHS_DOEPTSIZ10_PKTCNT_POS (19U) +#define USBHS_DOEPTSIZ10_PKTCNT (0x1FF80000UL) +#define USBHS_DOEPTSIZ10_PKTCNT_0 (0x00080000UL) +#define USBHS_DOEPTSIZ10_PKTCNT_1 (0x00100000UL) +#define USBHS_DOEPTSIZ10_PKTCNT_2 (0x00200000UL) +#define USBHS_DOEPTSIZ10_PKTCNT_3 (0x00400000UL) +#define USBHS_DOEPTSIZ10_PKTCNT_4 (0x00800000UL) +#define USBHS_DOEPTSIZ10_PKTCNT_5 (0x01000000UL) +#define USBHS_DOEPTSIZ10_PKTCNT_6 (0x02000000UL) +#define USBHS_DOEPTSIZ10_PKTCNT_7 (0x04000000UL) +#define USBHS_DOEPTSIZ10_PKTCNT_8 (0x08000000UL) +#define USBHS_DOEPTSIZ10_PKTCNT_9 (0x10000000UL) +#define USBHS_DOEPTSIZ10_RXDPID_POS (29U) +#define USBHS_DOEPTSIZ10_RXDPID (0x60000000UL) +#define USBHS_DOEPTSIZ10_RXDPID_0 (0x20000000UL) +#define USBHS_DOEPTSIZ10_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBHS_DOEPDMA10 register */ +#define USBHS_DOEPDMA10 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DOEPCTL11 register */ +#define USBHS_DOEPCTL11_MPS_POS (0U) +#define USBHS_DOEPCTL11_MPS (0x000007FFUL) +#define USBHS_DOEPCTL11_MPS_0 (0x00000001UL) +#define USBHS_DOEPCTL11_MPS_1 (0x00000002UL) +#define USBHS_DOEPCTL11_MPS_2 (0x00000004UL) +#define USBHS_DOEPCTL11_MPS_3 (0x00000008UL) +#define USBHS_DOEPCTL11_MPS_4 (0x00000010UL) +#define USBHS_DOEPCTL11_MPS_5 (0x00000020UL) +#define USBHS_DOEPCTL11_MPS_6 (0x00000040UL) +#define USBHS_DOEPCTL11_MPS_7 (0x00000080UL) +#define USBHS_DOEPCTL11_MPS_8 (0x00000100UL) +#define USBHS_DOEPCTL11_MPS_9 (0x00000200UL) +#define USBHS_DOEPCTL11_MPS_10 (0x00000400UL) +#define USBHS_DOEPCTL11_USBACTEP_POS (15U) +#define USBHS_DOEPCTL11_USBACTEP (0x00008000UL) +#define USBHS_DOEPCTL11_DPID_POS (16U) +#define USBHS_DOEPCTL11_DPID (0x00010000UL) +#define USBHS_DOEPCTL11_NAKSTS_POS (17U) +#define USBHS_DOEPCTL11_NAKSTS (0x00020000UL) +#define USBHS_DOEPCTL11_EPTYPE_POS (18U) +#define USBHS_DOEPCTL11_EPTYPE (0x000C0000UL) +#define USBHS_DOEPCTL11_EPTYPE_0 (0x00040000UL) +#define USBHS_DOEPCTL11_EPTYPE_1 (0x00080000UL) +#define USBHS_DOEPCTL11_SNP_POS (20U) +#define USBHS_DOEPCTL11_SNP (0x00100000UL) +#define USBHS_DOEPCTL11_STALL_POS (21U) +#define USBHS_DOEPCTL11_STALL (0x00200000UL) +#define USBHS_DOEPCTL11_CNAK_POS (26U) +#define USBHS_DOEPCTL11_CNAK (0x04000000UL) +#define USBHS_DOEPCTL11_SNAK_POS (27U) +#define USBHS_DOEPCTL11_SNAK (0x08000000UL) +#define USBHS_DOEPCTL11_SETD0PID_POS (28U) +#define USBHS_DOEPCTL11_SETD0PID (0x10000000UL) +#define USBHS_DOEPCTL11_SETD1PID_POS (29U) +#define USBHS_DOEPCTL11_SETD1PID (0x20000000UL) +#define USBHS_DOEPCTL11_EPDIS_POS (30U) +#define USBHS_DOEPCTL11_EPDIS (0x40000000UL) +#define USBHS_DOEPCTL11_EPENA_POS (31U) +#define USBHS_DOEPCTL11_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DOEPINT11 register */ +#define USBHS_DOEPINT11_XFERCOMPL_POS (0U) +#define USBHS_DOEPINT11_XFERCOMPL (0x00000001UL) +#define USBHS_DOEPINT11_EPDISBLD_POS (1U) +#define USBHS_DOEPINT11_EPDISBLD (0x00000002UL) +#define USBHS_DOEPINT11_AHBERR_POS (2U) +#define USBHS_DOEPINT11_AHBERR (0x00000004UL) +#define USBHS_DOEPINT11_SETUP_POS (3U) +#define USBHS_DOEPINT11_SETUP (0x00000008UL) +#define USBHS_DOEPINT11_OUTTKNEPDIS_POS (4U) +#define USBHS_DOEPINT11_OUTTKNEPDIS (0x00000010UL) +#define USBHS_DOEPINT11_STSPHSERCVD_POS (5U) +#define USBHS_DOEPINT11_STSPHSERCVD (0x00000020UL) +#define USBHS_DOEPINT11_BACK2BACKSETUP_POS (6U) +#define USBHS_DOEPINT11_BACK2BACKSETUP (0x00000040UL) +#define USBHS_DOEPINT11_OUTPKTERR_POS (8U) +#define USBHS_DOEPINT11_OUTPKTERR (0x00000100UL) +#define USBHS_DOEPINT11_BNAINTR_POS (9U) +#define USBHS_DOEPINT11_BNAINTR (0x00000200UL) +#define USBHS_DOEPINT11_PKTDRPSTS_POS (11U) +#define USBHS_DOEPINT11_PKTDRPSTS (0x00000800UL) +#define USBHS_DOEPINT11_BBLEERR_POS (12U) +#define USBHS_DOEPINT11_BBLEERR (0x00001000UL) +#define USBHS_DOEPINT11_NAKINTRPT_POS (13U) +#define USBHS_DOEPINT11_NAKINTRPT (0x00002000UL) +#define USBHS_DOEPINT11_NYETINTRPT_POS (14U) +#define USBHS_DOEPINT11_NYETINTRPT (0x00004000UL) +#define USBHS_DOEPINT11_STUPPKTRCVD_POS (15U) +#define USBHS_DOEPINT11_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBHS_DOEPTSIZ11 register */ +#define USBHS_DOEPTSIZ11_XFERSIZE_POS (0U) +#define USBHS_DOEPTSIZ11_XFERSIZE (0x0007FFFFUL) +#define USBHS_DOEPTSIZ11_XFERSIZE_0 (0x00000001UL) +#define USBHS_DOEPTSIZ11_XFERSIZE_1 (0x00000002UL) +#define USBHS_DOEPTSIZ11_XFERSIZE_2 (0x00000004UL) +#define USBHS_DOEPTSIZ11_XFERSIZE_3 (0x00000008UL) +#define USBHS_DOEPTSIZ11_XFERSIZE_4 (0x00000010UL) +#define USBHS_DOEPTSIZ11_XFERSIZE_5 (0x00000020UL) +#define USBHS_DOEPTSIZ11_XFERSIZE_6 (0x00000040UL) +#define USBHS_DOEPTSIZ11_XFERSIZE_7 (0x00000080UL) +#define USBHS_DOEPTSIZ11_XFERSIZE_8 (0x00000100UL) +#define USBHS_DOEPTSIZ11_XFERSIZE_9 (0x00000200UL) +#define USBHS_DOEPTSIZ11_XFERSIZE_10 (0x00000400UL) +#define USBHS_DOEPTSIZ11_XFERSIZE_11 (0x00000800UL) +#define USBHS_DOEPTSIZ11_XFERSIZE_12 (0x00001000UL) +#define USBHS_DOEPTSIZ11_XFERSIZE_13 (0x00002000UL) +#define USBHS_DOEPTSIZ11_XFERSIZE_14 (0x00004000UL) +#define USBHS_DOEPTSIZ11_XFERSIZE_15 (0x00008000UL) +#define USBHS_DOEPTSIZ11_XFERSIZE_16 (0x00010000UL) +#define USBHS_DOEPTSIZ11_XFERSIZE_17 (0x00020000UL) +#define USBHS_DOEPTSIZ11_XFERSIZE_18 (0x00040000UL) +#define USBHS_DOEPTSIZ11_PKTCNT_POS (19U) +#define USBHS_DOEPTSIZ11_PKTCNT (0x1FF80000UL) +#define USBHS_DOEPTSIZ11_PKTCNT_0 (0x00080000UL) +#define USBHS_DOEPTSIZ11_PKTCNT_1 (0x00100000UL) +#define USBHS_DOEPTSIZ11_PKTCNT_2 (0x00200000UL) +#define USBHS_DOEPTSIZ11_PKTCNT_3 (0x00400000UL) +#define USBHS_DOEPTSIZ11_PKTCNT_4 (0x00800000UL) +#define USBHS_DOEPTSIZ11_PKTCNT_5 (0x01000000UL) +#define USBHS_DOEPTSIZ11_PKTCNT_6 (0x02000000UL) +#define USBHS_DOEPTSIZ11_PKTCNT_7 (0x04000000UL) +#define USBHS_DOEPTSIZ11_PKTCNT_8 (0x08000000UL) +#define USBHS_DOEPTSIZ11_PKTCNT_9 (0x10000000UL) +#define USBHS_DOEPTSIZ11_RXDPID_POS (29U) +#define USBHS_DOEPTSIZ11_RXDPID (0x60000000UL) +#define USBHS_DOEPTSIZ11_RXDPID_0 (0x20000000UL) +#define USBHS_DOEPTSIZ11_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBHS_DOEPDMA11 register */ +#define USBHS_DOEPDMA11 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DOEPCTL12 register */ +#define USBHS_DOEPCTL12_MPS_POS (0U) +#define USBHS_DOEPCTL12_MPS (0x000007FFUL) +#define USBHS_DOEPCTL12_MPS_0 (0x00000001UL) +#define USBHS_DOEPCTL12_MPS_1 (0x00000002UL) +#define USBHS_DOEPCTL12_MPS_2 (0x00000004UL) +#define USBHS_DOEPCTL12_MPS_3 (0x00000008UL) +#define USBHS_DOEPCTL12_MPS_4 (0x00000010UL) +#define USBHS_DOEPCTL12_MPS_5 (0x00000020UL) +#define USBHS_DOEPCTL12_MPS_6 (0x00000040UL) +#define USBHS_DOEPCTL12_MPS_7 (0x00000080UL) +#define USBHS_DOEPCTL12_MPS_8 (0x00000100UL) +#define USBHS_DOEPCTL12_MPS_9 (0x00000200UL) +#define USBHS_DOEPCTL12_MPS_10 (0x00000400UL) +#define USBHS_DOEPCTL12_USBACTEP_POS (15U) +#define USBHS_DOEPCTL12_USBACTEP (0x00008000UL) +#define USBHS_DOEPCTL12_DPID_POS (16U) +#define USBHS_DOEPCTL12_DPID (0x00010000UL) +#define USBHS_DOEPCTL12_NAKSTS_POS (17U) +#define USBHS_DOEPCTL12_NAKSTS (0x00020000UL) +#define USBHS_DOEPCTL12_EPTYPE_POS (18U) +#define USBHS_DOEPCTL12_EPTYPE (0x000C0000UL) +#define USBHS_DOEPCTL12_EPTYPE_0 (0x00040000UL) +#define USBHS_DOEPCTL12_EPTYPE_1 (0x00080000UL) +#define USBHS_DOEPCTL12_SNP_POS (20U) +#define USBHS_DOEPCTL12_SNP (0x00100000UL) +#define USBHS_DOEPCTL12_STALL_POS (21U) +#define USBHS_DOEPCTL12_STALL (0x00200000UL) +#define USBHS_DOEPCTL12_CNAK_POS (26U) +#define USBHS_DOEPCTL12_CNAK (0x04000000UL) +#define USBHS_DOEPCTL12_SNAK_POS (27U) +#define USBHS_DOEPCTL12_SNAK (0x08000000UL) +#define USBHS_DOEPCTL12_SETD0PID_POS (28U) +#define USBHS_DOEPCTL12_SETD0PID (0x10000000UL) +#define USBHS_DOEPCTL12_SETD1PID_POS (29U) +#define USBHS_DOEPCTL12_SETD1PID (0x20000000UL) +#define USBHS_DOEPCTL12_EPDIS_POS (30U) +#define USBHS_DOEPCTL12_EPDIS (0x40000000UL) +#define USBHS_DOEPCTL12_EPENA_POS (31U) +#define USBHS_DOEPCTL12_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DOEPINT12 register */ +#define USBHS_DOEPINT12_XFERCOMPL_POS (0U) +#define USBHS_DOEPINT12_XFERCOMPL (0x00000001UL) +#define USBHS_DOEPINT12_EPDISBLD_POS (1U) +#define USBHS_DOEPINT12_EPDISBLD (0x00000002UL) +#define USBHS_DOEPINT12_AHBERR_POS (2U) +#define USBHS_DOEPINT12_AHBERR (0x00000004UL) +#define USBHS_DOEPINT12_SETUP_POS (3U) +#define USBHS_DOEPINT12_SETUP (0x00000008UL) +#define USBHS_DOEPINT12_OUTTKNEPDIS_POS (4U) +#define USBHS_DOEPINT12_OUTTKNEPDIS (0x00000010UL) +#define USBHS_DOEPINT12_STSPHSERCVD_POS (5U) +#define USBHS_DOEPINT12_STSPHSERCVD (0x00000020UL) +#define USBHS_DOEPINT12_BACK2BACKSETUP_POS (6U) +#define USBHS_DOEPINT12_BACK2BACKSETUP (0x00000040UL) +#define USBHS_DOEPINT12_OUTPKTERR_POS (8U) +#define USBHS_DOEPINT12_OUTPKTERR (0x00000100UL) +#define USBHS_DOEPINT12_BNAINTR_POS (9U) +#define USBHS_DOEPINT12_BNAINTR (0x00000200UL) +#define USBHS_DOEPINT12_PKTDRPSTS_POS (11U) +#define USBHS_DOEPINT12_PKTDRPSTS (0x00000800UL) +#define USBHS_DOEPINT12_BBLEERR_POS (12U) +#define USBHS_DOEPINT12_BBLEERR (0x00001000UL) +#define USBHS_DOEPINT12_NAKINTRPT_POS (13U) +#define USBHS_DOEPINT12_NAKINTRPT (0x00002000UL) +#define USBHS_DOEPINT12_NYETINTRPT_POS (14U) +#define USBHS_DOEPINT12_NYETINTRPT (0x00004000UL) +#define USBHS_DOEPINT12_STUPPKTRCVD_POS (15U) +#define USBHS_DOEPINT12_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBHS_DOEPTSIZ12 register */ +#define USBHS_DOEPTSIZ12_XFERSIZE_POS (0U) +#define USBHS_DOEPTSIZ12_XFERSIZE (0x0007FFFFUL) +#define USBHS_DOEPTSIZ12_XFERSIZE_0 (0x00000001UL) +#define USBHS_DOEPTSIZ12_XFERSIZE_1 (0x00000002UL) +#define USBHS_DOEPTSIZ12_XFERSIZE_2 (0x00000004UL) +#define USBHS_DOEPTSIZ12_XFERSIZE_3 (0x00000008UL) +#define USBHS_DOEPTSIZ12_XFERSIZE_4 (0x00000010UL) +#define USBHS_DOEPTSIZ12_XFERSIZE_5 (0x00000020UL) +#define USBHS_DOEPTSIZ12_XFERSIZE_6 (0x00000040UL) +#define USBHS_DOEPTSIZ12_XFERSIZE_7 (0x00000080UL) +#define USBHS_DOEPTSIZ12_XFERSIZE_8 (0x00000100UL) +#define USBHS_DOEPTSIZ12_XFERSIZE_9 (0x00000200UL) +#define USBHS_DOEPTSIZ12_XFERSIZE_10 (0x00000400UL) +#define USBHS_DOEPTSIZ12_XFERSIZE_11 (0x00000800UL) +#define USBHS_DOEPTSIZ12_XFERSIZE_12 (0x00001000UL) +#define USBHS_DOEPTSIZ12_XFERSIZE_13 (0x00002000UL) +#define USBHS_DOEPTSIZ12_XFERSIZE_14 (0x00004000UL) +#define USBHS_DOEPTSIZ12_XFERSIZE_15 (0x00008000UL) +#define USBHS_DOEPTSIZ12_XFERSIZE_16 (0x00010000UL) +#define USBHS_DOEPTSIZ12_XFERSIZE_17 (0x00020000UL) +#define USBHS_DOEPTSIZ12_XFERSIZE_18 (0x00040000UL) +#define USBHS_DOEPTSIZ12_PKTCNT_POS (19U) +#define USBHS_DOEPTSIZ12_PKTCNT (0x1FF80000UL) +#define USBHS_DOEPTSIZ12_PKTCNT_0 (0x00080000UL) +#define USBHS_DOEPTSIZ12_PKTCNT_1 (0x00100000UL) +#define USBHS_DOEPTSIZ12_PKTCNT_2 (0x00200000UL) +#define USBHS_DOEPTSIZ12_PKTCNT_3 (0x00400000UL) +#define USBHS_DOEPTSIZ12_PKTCNT_4 (0x00800000UL) +#define USBHS_DOEPTSIZ12_PKTCNT_5 (0x01000000UL) +#define USBHS_DOEPTSIZ12_PKTCNT_6 (0x02000000UL) +#define USBHS_DOEPTSIZ12_PKTCNT_7 (0x04000000UL) +#define USBHS_DOEPTSIZ12_PKTCNT_8 (0x08000000UL) +#define USBHS_DOEPTSIZ12_PKTCNT_9 (0x10000000UL) +#define USBHS_DOEPTSIZ12_RXDPID_POS (29U) +#define USBHS_DOEPTSIZ12_RXDPID (0x60000000UL) +#define USBHS_DOEPTSIZ12_RXDPID_0 (0x20000000UL) +#define USBHS_DOEPTSIZ12_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBHS_DOEPDMA12 register */ +#define USBHS_DOEPDMA12 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DOEPCTL13 register */ +#define USBHS_DOEPCTL13_MPS_POS (0U) +#define USBHS_DOEPCTL13_MPS (0x000007FFUL) +#define USBHS_DOEPCTL13_MPS_0 (0x00000001UL) +#define USBHS_DOEPCTL13_MPS_1 (0x00000002UL) +#define USBHS_DOEPCTL13_MPS_2 (0x00000004UL) +#define USBHS_DOEPCTL13_MPS_3 (0x00000008UL) +#define USBHS_DOEPCTL13_MPS_4 (0x00000010UL) +#define USBHS_DOEPCTL13_MPS_5 (0x00000020UL) +#define USBHS_DOEPCTL13_MPS_6 (0x00000040UL) +#define USBHS_DOEPCTL13_MPS_7 (0x00000080UL) +#define USBHS_DOEPCTL13_MPS_8 (0x00000100UL) +#define USBHS_DOEPCTL13_MPS_9 (0x00000200UL) +#define USBHS_DOEPCTL13_MPS_10 (0x00000400UL) +#define USBHS_DOEPCTL13_USBACTEP_POS (15U) +#define USBHS_DOEPCTL13_USBACTEP (0x00008000UL) +#define USBHS_DOEPCTL13_DPID_POS (16U) +#define USBHS_DOEPCTL13_DPID (0x00010000UL) +#define USBHS_DOEPCTL13_NAKSTS_POS (17U) +#define USBHS_DOEPCTL13_NAKSTS (0x00020000UL) +#define USBHS_DOEPCTL13_EPTYPE_POS (18U) +#define USBHS_DOEPCTL13_EPTYPE (0x000C0000UL) +#define USBHS_DOEPCTL13_EPTYPE_0 (0x00040000UL) +#define USBHS_DOEPCTL13_EPTYPE_1 (0x00080000UL) +#define USBHS_DOEPCTL13_SNP_POS (20U) +#define USBHS_DOEPCTL13_SNP (0x00100000UL) +#define USBHS_DOEPCTL13_STALL_POS (21U) +#define USBHS_DOEPCTL13_STALL (0x00200000UL) +#define USBHS_DOEPCTL13_CNAK_POS (26U) +#define USBHS_DOEPCTL13_CNAK (0x04000000UL) +#define USBHS_DOEPCTL13_SNAK_POS (27U) +#define USBHS_DOEPCTL13_SNAK (0x08000000UL) +#define USBHS_DOEPCTL13_SETD0PID_POS (28U) +#define USBHS_DOEPCTL13_SETD0PID (0x10000000UL) +#define USBHS_DOEPCTL13_SETD1PID_POS (29U) +#define USBHS_DOEPCTL13_SETD1PID (0x20000000UL) +#define USBHS_DOEPCTL13_EPDIS_POS (30U) +#define USBHS_DOEPCTL13_EPDIS (0x40000000UL) +#define USBHS_DOEPCTL13_EPENA_POS (31U) +#define USBHS_DOEPCTL13_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DOEPINT13 register */ +#define USBHS_DOEPINT13_XFERCOMPL_POS (0U) +#define USBHS_DOEPINT13_XFERCOMPL (0x00000001UL) +#define USBHS_DOEPINT13_EPDISBLD_POS (1U) +#define USBHS_DOEPINT13_EPDISBLD (0x00000002UL) +#define USBHS_DOEPINT13_AHBERR_POS (2U) +#define USBHS_DOEPINT13_AHBERR (0x00000004UL) +#define USBHS_DOEPINT13_SETUP_POS (3U) +#define USBHS_DOEPINT13_SETUP (0x00000008UL) +#define USBHS_DOEPINT13_OUTTKNEPDIS_POS (4U) +#define USBHS_DOEPINT13_OUTTKNEPDIS (0x00000010UL) +#define USBHS_DOEPINT13_STSPHSERCVD_POS (5U) +#define USBHS_DOEPINT13_STSPHSERCVD (0x00000020UL) +#define USBHS_DOEPINT13_BACK2BACKSETUP_POS (6U) +#define USBHS_DOEPINT13_BACK2BACKSETUP (0x00000040UL) +#define USBHS_DOEPINT13_OUTPKTERR_POS (8U) +#define USBHS_DOEPINT13_OUTPKTERR (0x00000100UL) +#define USBHS_DOEPINT13_BNAINTR_POS (9U) +#define USBHS_DOEPINT13_BNAINTR (0x00000200UL) +#define USBHS_DOEPINT13_PKTDRPSTS_POS (11U) +#define USBHS_DOEPINT13_PKTDRPSTS (0x00000800UL) +#define USBHS_DOEPINT13_BBLEERR_POS (12U) +#define USBHS_DOEPINT13_BBLEERR (0x00001000UL) +#define USBHS_DOEPINT13_NAKINTRPT_POS (13U) +#define USBHS_DOEPINT13_NAKINTRPT (0x00002000UL) +#define USBHS_DOEPINT13_NYETINTRPT_POS (14U) +#define USBHS_DOEPINT13_NYETINTRPT (0x00004000UL) +#define USBHS_DOEPINT13_STUPPKTRCVD_POS (15U) +#define USBHS_DOEPINT13_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBHS_DOEPTSIZ13 register */ +#define USBHS_DOEPTSIZ13_XFERSIZE_POS (0U) +#define USBHS_DOEPTSIZ13_XFERSIZE (0x0007FFFFUL) +#define USBHS_DOEPTSIZ13_XFERSIZE_0 (0x00000001UL) +#define USBHS_DOEPTSIZ13_XFERSIZE_1 (0x00000002UL) +#define USBHS_DOEPTSIZ13_XFERSIZE_2 (0x00000004UL) +#define USBHS_DOEPTSIZ13_XFERSIZE_3 (0x00000008UL) +#define USBHS_DOEPTSIZ13_XFERSIZE_4 (0x00000010UL) +#define USBHS_DOEPTSIZ13_XFERSIZE_5 (0x00000020UL) +#define USBHS_DOEPTSIZ13_XFERSIZE_6 (0x00000040UL) +#define USBHS_DOEPTSIZ13_XFERSIZE_7 (0x00000080UL) +#define USBHS_DOEPTSIZ13_XFERSIZE_8 (0x00000100UL) +#define USBHS_DOEPTSIZ13_XFERSIZE_9 (0x00000200UL) +#define USBHS_DOEPTSIZ13_XFERSIZE_10 (0x00000400UL) +#define USBHS_DOEPTSIZ13_XFERSIZE_11 (0x00000800UL) +#define USBHS_DOEPTSIZ13_XFERSIZE_12 (0x00001000UL) +#define USBHS_DOEPTSIZ13_XFERSIZE_13 (0x00002000UL) +#define USBHS_DOEPTSIZ13_XFERSIZE_14 (0x00004000UL) +#define USBHS_DOEPTSIZ13_XFERSIZE_15 (0x00008000UL) +#define USBHS_DOEPTSIZ13_XFERSIZE_16 (0x00010000UL) +#define USBHS_DOEPTSIZ13_XFERSIZE_17 (0x00020000UL) +#define USBHS_DOEPTSIZ13_XFERSIZE_18 (0x00040000UL) +#define USBHS_DOEPTSIZ13_PKTCNT_POS (19U) +#define USBHS_DOEPTSIZ13_PKTCNT (0x1FF80000UL) +#define USBHS_DOEPTSIZ13_PKTCNT_0 (0x00080000UL) +#define USBHS_DOEPTSIZ13_PKTCNT_1 (0x00100000UL) +#define USBHS_DOEPTSIZ13_PKTCNT_2 (0x00200000UL) +#define USBHS_DOEPTSIZ13_PKTCNT_3 (0x00400000UL) +#define USBHS_DOEPTSIZ13_PKTCNT_4 (0x00800000UL) +#define USBHS_DOEPTSIZ13_PKTCNT_5 (0x01000000UL) +#define USBHS_DOEPTSIZ13_PKTCNT_6 (0x02000000UL) +#define USBHS_DOEPTSIZ13_PKTCNT_7 (0x04000000UL) +#define USBHS_DOEPTSIZ13_PKTCNT_8 (0x08000000UL) +#define USBHS_DOEPTSIZ13_PKTCNT_9 (0x10000000UL) +#define USBHS_DOEPTSIZ13_RXDPID_POS (29U) +#define USBHS_DOEPTSIZ13_RXDPID (0x60000000UL) +#define USBHS_DOEPTSIZ13_RXDPID_0 (0x20000000UL) +#define USBHS_DOEPTSIZ13_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBHS_DOEPDMA13 register */ +#define USBHS_DOEPDMA13 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DOEPCTL14 register */ +#define USBHS_DOEPCTL14_MPS_POS (0U) +#define USBHS_DOEPCTL14_MPS (0x000007FFUL) +#define USBHS_DOEPCTL14_MPS_0 (0x00000001UL) +#define USBHS_DOEPCTL14_MPS_1 (0x00000002UL) +#define USBHS_DOEPCTL14_MPS_2 (0x00000004UL) +#define USBHS_DOEPCTL14_MPS_3 (0x00000008UL) +#define USBHS_DOEPCTL14_MPS_4 (0x00000010UL) +#define USBHS_DOEPCTL14_MPS_5 (0x00000020UL) +#define USBHS_DOEPCTL14_MPS_6 (0x00000040UL) +#define USBHS_DOEPCTL14_MPS_7 (0x00000080UL) +#define USBHS_DOEPCTL14_MPS_8 (0x00000100UL) +#define USBHS_DOEPCTL14_MPS_9 (0x00000200UL) +#define USBHS_DOEPCTL14_MPS_10 (0x00000400UL) +#define USBHS_DOEPCTL14_USBACTEP_POS (15U) +#define USBHS_DOEPCTL14_USBACTEP (0x00008000UL) +#define USBHS_DOEPCTL14_DPID_POS (16U) +#define USBHS_DOEPCTL14_DPID (0x00010000UL) +#define USBHS_DOEPCTL14_NAKSTS_POS (17U) +#define USBHS_DOEPCTL14_NAKSTS (0x00020000UL) +#define USBHS_DOEPCTL14_EPTYPE_POS (18U) +#define USBHS_DOEPCTL14_EPTYPE (0x000C0000UL) +#define USBHS_DOEPCTL14_EPTYPE_0 (0x00040000UL) +#define USBHS_DOEPCTL14_EPTYPE_1 (0x00080000UL) +#define USBHS_DOEPCTL14_SNP_POS (20U) +#define USBHS_DOEPCTL14_SNP (0x00100000UL) +#define USBHS_DOEPCTL14_STALL_POS (21U) +#define USBHS_DOEPCTL14_STALL (0x00200000UL) +#define USBHS_DOEPCTL14_CNAK_POS (26U) +#define USBHS_DOEPCTL14_CNAK (0x04000000UL) +#define USBHS_DOEPCTL14_SNAK_POS (27U) +#define USBHS_DOEPCTL14_SNAK (0x08000000UL) +#define USBHS_DOEPCTL14_SETD0PID_POS (28U) +#define USBHS_DOEPCTL14_SETD0PID (0x10000000UL) +#define USBHS_DOEPCTL14_SETD1PID_POS (29U) +#define USBHS_DOEPCTL14_SETD1PID (0x20000000UL) +#define USBHS_DOEPCTL14_EPDIS_POS (30U) +#define USBHS_DOEPCTL14_EPDIS (0x40000000UL) +#define USBHS_DOEPCTL14_EPENA_POS (31U) +#define USBHS_DOEPCTL14_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DOEPINT14 register */ +#define USBHS_DOEPINT14_XFERCOMPL_POS (0U) +#define USBHS_DOEPINT14_XFERCOMPL (0x00000001UL) +#define USBHS_DOEPINT14_EPDISBLD_POS (1U) +#define USBHS_DOEPINT14_EPDISBLD (0x00000002UL) +#define USBHS_DOEPINT14_AHBERR_POS (2U) +#define USBHS_DOEPINT14_AHBERR (0x00000004UL) +#define USBHS_DOEPINT14_SETUP_POS (3U) +#define USBHS_DOEPINT14_SETUP (0x00000008UL) +#define USBHS_DOEPINT14_OUTTKNEPDIS_POS (4U) +#define USBHS_DOEPINT14_OUTTKNEPDIS (0x00000010UL) +#define USBHS_DOEPINT14_STSPHSERCVD_POS (5U) +#define USBHS_DOEPINT14_STSPHSERCVD (0x00000020UL) +#define USBHS_DOEPINT14_BACK2BACKSETUP_POS (6U) +#define USBHS_DOEPINT14_BACK2BACKSETUP (0x00000040UL) +#define USBHS_DOEPINT14_OUTPKTERR_POS (8U) +#define USBHS_DOEPINT14_OUTPKTERR (0x00000100UL) +#define USBHS_DOEPINT14_BNAINTR_POS (9U) +#define USBHS_DOEPINT14_BNAINTR (0x00000200UL) +#define USBHS_DOEPINT14_PKTDRPSTS_POS (11U) +#define USBHS_DOEPINT14_PKTDRPSTS (0x00000800UL) +#define USBHS_DOEPINT14_BBLEERR_POS (12U) +#define USBHS_DOEPINT14_BBLEERR (0x00001000UL) +#define USBHS_DOEPINT14_NAKINTRPT_POS (13U) +#define USBHS_DOEPINT14_NAKINTRPT (0x00002000UL) +#define USBHS_DOEPINT14_NYETINTRPT_POS (14U) +#define USBHS_DOEPINT14_NYETINTRPT (0x00004000UL) +#define USBHS_DOEPINT14_STUPPKTRCVD_POS (15U) +#define USBHS_DOEPINT14_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBHS_DOEPTSIZ14 register */ +#define USBHS_DOEPTSIZ14_XFERSIZE_POS (0U) +#define USBHS_DOEPTSIZ14_XFERSIZE (0x0007FFFFUL) +#define USBHS_DOEPTSIZ14_XFERSIZE_0 (0x00000001UL) +#define USBHS_DOEPTSIZ14_XFERSIZE_1 (0x00000002UL) +#define USBHS_DOEPTSIZ14_XFERSIZE_2 (0x00000004UL) +#define USBHS_DOEPTSIZ14_XFERSIZE_3 (0x00000008UL) +#define USBHS_DOEPTSIZ14_XFERSIZE_4 (0x00000010UL) +#define USBHS_DOEPTSIZ14_XFERSIZE_5 (0x00000020UL) +#define USBHS_DOEPTSIZ14_XFERSIZE_6 (0x00000040UL) +#define USBHS_DOEPTSIZ14_XFERSIZE_7 (0x00000080UL) +#define USBHS_DOEPTSIZ14_XFERSIZE_8 (0x00000100UL) +#define USBHS_DOEPTSIZ14_XFERSIZE_9 (0x00000200UL) +#define USBHS_DOEPTSIZ14_XFERSIZE_10 (0x00000400UL) +#define USBHS_DOEPTSIZ14_XFERSIZE_11 (0x00000800UL) +#define USBHS_DOEPTSIZ14_XFERSIZE_12 (0x00001000UL) +#define USBHS_DOEPTSIZ14_XFERSIZE_13 (0x00002000UL) +#define USBHS_DOEPTSIZ14_XFERSIZE_14 (0x00004000UL) +#define USBHS_DOEPTSIZ14_XFERSIZE_15 (0x00008000UL) +#define USBHS_DOEPTSIZ14_XFERSIZE_16 (0x00010000UL) +#define USBHS_DOEPTSIZ14_XFERSIZE_17 (0x00020000UL) +#define USBHS_DOEPTSIZ14_XFERSIZE_18 (0x00040000UL) +#define USBHS_DOEPTSIZ14_PKTCNT_POS (19U) +#define USBHS_DOEPTSIZ14_PKTCNT (0x1FF80000UL) +#define USBHS_DOEPTSIZ14_PKTCNT_0 (0x00080000UL) +#define USBHS_DOEPTSIZ14_PKTCNT_1 (0x00100000UL) +#define USBHS_DOEPTSIZ14_PKTCNT_2 (0x00200000UL) +#define USBHS_DOEPTSIZ14_PKTCNT_3 (0x00400000UL) +#define USBHS_DOEPTSIZ14_PKTCNT_4 (0x00800000UL) +#define USBHS_DOEPTSIZ14_PKTCNT_5 (0x01000000UL) +#define USBHS_DOEPTSIZ14_PKTCNT_6 (0x02000000UL) +#define USBHS_DOEPTSIZ14_PKTCNT_7 (0x04000000UL) +#define USBHS_DOEPTSIZ14_PKTCNT_8 (0x08000000UL) +#define USBHS_DOEPTSIZ14_PKTCNT_9 (0x10000000UL) +#define USBHS_DOEPTSIZ14_RXDPID_POS (29U) +#define USBHS_DOEPTSIZ14_RXDPID (0x60000000UL) +#define USBHS_DOEPTSIZ14_RXDPID_0 (0x20000000UL) +#define USBHS_DOEPTSIZ14_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBHS_DOEPDMA14 register */ +#define USBHS_DOEPDMA14 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_DOEPCTL15 register */ +#define USBHS_DOEPCTL15_MPS_POS (0U) +#define USBHS_DOEPCTL15_MPS (0x000007FFUL) +#define USBHS_DOEPCTL15_MPS_0 (0x00000001UL) +#define USBHS_DOEPCTL15_MPS_1 (0x00000002UL) +#define USBHS_DOEPCTL15_MPS_2 (0x00000004UL) +#define USBHS_DOEPCTL15_MPS_3 (0x00000008UL) +#define USBHS_DOEPCTL15_MPS_4 (0x00000010UL) +#define USBHS_DOEPCTL15_MPS_5 (0x00000020UL) +#define USBHS_DOEPCTL15_MPS_6 (0x00000040UL) +#define USBHS_DOEPCTL15_MPS_7 (0x00000080UL) +#define USBHS_DOEPCTL15_MPS_8 (0x00000100UL) +#define USBHS_DOEPCTL15_MPS_9 (0x00000200UL) +#define USBHS_DOEPCTL15_MPS_10 (0x00000400UL) +#define USBHS_DOEPCTL15_USBACTEP_POS (15U) +#define USBHS_DOEPCTL15_USBACTEP (0x00008000UL) +#define USBHS_DOEPCTL15_DPID_POS (16U) +#define USBHS_DOEPCTL15_DPID (0x00010000UL) +#define USBHS_DOEPCTL15_NAKSTS_POS (17U) +#define USBHS_DOEPCTL15_NAKSTS (0x00020000UL) +#define USBHS_DOEPCTL15_EPTYPE_POS (18U) +#define USBHS_DOEPCTL15_EPTYPE (0x000C0000UL) +#define USBHS_DOEPCTL15_EPTYPE_0 (0x00040000UL) +#define USBHS_DOEPCTL15_EPTYPE_1 (0x00080000UL) +#define USBHS_DOEPCTL15_SNP_POS (20U) +#define USBHS_DOEPCTL15_SNP (0x00100000UL) +#define USBHS_DOEPCTL15_STALL_POS (21U) +#define USBHS_DOEPCTL15_STALL (0x00200000UL) +#define USBHS_DOEPCTL15_CNAK_POS (26U) +#define USBHS_DOEPCTL15_CNAK (0x04000000UL) +#define USBHS_DOEPCTL15_SNAK_POS (27U) +#define USBHS_DOEPCTL15_SNAK (0x08000000UL) +#define USBHS_DOEPCTL15_SETD0PID_POS (28U) +#define USBHS_DOEPCTL15_SETD0PID (0x10000000UL) +#define USBHS_DOEPCTL15_SETD1PID_POS (29U) +#define USBHS_DOEPCTL15_SETD1PID (0x20000000UL) +#define USBHS_DOEPCTL15_EPDIS_POS (30U) +#define USBHS_DOEPCTL15_EPDIS (0x40000000UL) +#define USBHS_DOEPCTL15_EPENA_POS (31U) +#define USBHS_DOEPCTL15_EPENA (0x80000000UL) + +/* Bit definition for USBHS_DOEPINT15 register */ +#define USBHS_DOEPINT15_XFERCOMPL_POS (0U) +#define USBHS_DOEPINT15_XFERCOMPL (0x00000001UL) +#define USBHS_DOEPINT15_EPDISBLD_POS (1U) +#define USBHS_DOEPINT15_EPDISBLD (0x00000002UL) +#define USBHS_DOEPINT15_AHBERR_POS (2U) +#define USBHS_DOEPINT15_AHBERR (0x00000004UL) +#define USBHS_DOEPINT15_SETUP_POS (3U) +#define USBHS_DOEPINT15_SETUP (0x00000008UL) +#define USBHS_DOEPINT15_OUTTKNEPDIS_POS (4U) +#define USBHS_DOEPINT15_OUTTKNEPDIS (0x00000010UL) +#define USBHS_DOEPINT15_STSPHSERCVD_POS (5U) +#define USBHS_DOEPINT15_STSPHSERCVD (0x00000020UL) +#define USBHS_DOEPINT15_BACK2BACKSETUP_POS (6U) +#define USBHS_DOEPINT15_BACK2BACKSETUP (0x00000040UL) +#define USBHS_DOEPINT15_OUTPKTERR_POS (8U) +#define USBHS_DOEPINT15_OUTPKTERR (0x00000100UL) +#define USBHS_DOEPINT15_BNAINTR_POS (9U) +#define USBHS_DOEPINT15_BNAINTR (0x00000200UL) +#define USBHS_DOEPINT15_PKTDRPSTS_POS (11U) +#define USBHS_DOEPINT15_PKTDRPSTS (0x00000800UL) +#define USBHS_DOEPINT15_BBLEERR_POS (12U) +#define USBHS_DOEPINT15_BBLEERR (0x00001000UL) +#define USBHS_DOEPINT15_NAKINTRPT_POS (13U) +#define USBHS_DOEPINT15_NAKINTRPT (0x00002000UL) +#define USBHS_DOEPINT15_NYETINTRPT_POS (14U) +#define USBHS_DOEPINT15_NYETINTRPT (0x00004000UL) +#define USBHS_DOEPINT15_STUPPKTRCVD_POS (15U) +#define USBHS_DOEPINT15_STUPPKTRCVD (0x00008000UL) + +/* Bit definition for USBHS_DOEPTSIZ15 register */ +#define USBHS_DOEPTSIZ15_XFERSIZE_POS (0U) +#define USBHS_DOEPTSIZ15_XFERSIZE (0x0007FFFFUL) +#define USBHS_DOEPTSIZ15_XFERSIZE_0 (0x00000001UL) +#define USBHS_DOEPTSIZ15_XFERSIZE_1 (0x00000002UL) +#define USBHS_DOEPTSIZ15_XFERSIZE_2 (0x00000004UL) +#define USBHS_DOEPTSIZ15_XFERSIZE_3 (0x00000008UL) +#define USBHS_DOEPTSIZ15_XFERSIZE_4 (0x00000010UL) +#define USBHS_DOEPTSIZ15_XFERSIZE_5 (0x00000020UL) +#define USBHS_DOEPTSIZ15_XFERSIZE_6 (0x00000040UL) +#define USBHS_DOEPTSIZ15_XFERSIZE_7 (0x00000080UL) +#define USBHS_DOEPTSIZ15_XFERSIZE_8 (0x00000100UL) +#define USBHS_DOEPTSIZ15_XFERSIZE_9 (0x00000200UL) +#define USBHS_DOEPTSIZ15_XFERSIZE_10 (0x00000400UL) +#define USBHS_DOEPTSIZ15_XFERSIZE_11 (0x00000800UL) +#define USBHS_DOEPTSIZ15_XFERSIZE_12 (0x00001000UL) +#define USBHS_DOEPTSIZ15_XFERSIZE_13 (0x00002000UL) +#define USBHS_DOEPTSIZ15_XFERSIZE_14 (0x00004000UL) +#define USBHS_DOEPTSIZ15_XFERSIZE_15 (0x00008000UL) +#define USBHS_DOEPTSIZ15_XFERSIZE_16 (0x00010000UL) +#define USBHS_DOEPTSIZ15_XFERSIZE_17 (0x00020000UL) +#define USBHS_DOEPTSIZ15_XFERSIZE_18 (0x00040000UL) +#define USBHS_DOEPTSIZ15_PKTCNT_POS (19U) +#define USBHS_DOEPTSIZ15_PKTCNT (0x1FF80000UL) +#define USBHS_DOEPTSIZ15_PKTCNT_0 (0x00080000UL) +#define USBHS_DOEPTSIZ15_PKTCNT_1 (0x00100000UL) +#define USBHS_DOEPTSIZ15_PKTCNT_2 (0x00200000UL) +#define USBHS_DOEPTSIZ15_PKTCNT_3 (0x00400000UL) +#define USBHS_DOEPTSIZ15_PKTCNT_4 (0x00800000UL) +#define USBHS_DOEPTSIZ15_PKTCNT_5 (0x01000000UL) +#define USBHS_DOEPTSIZ15_PKTCNT_6 (0x02000000UL) +#define USBHS_DOEPTSIZ15_PKTCNT_7 (0x04000000UL) +#define USBHS_DOEPTSIZ15_PKTCNT_8 (0x08000000UL) +#define USBHS_DOEPTSIZ15_PKTCNT_9 (0x10000000UL) +#define USBHS_DOEPTSIZ15_RXDPID_POS (29U) +#define USBHS_DOEPTSIZ15_RXDPID (0x60000000UL) +#define USBHS_DOEPTSIZ15_RXDPID_0 (0x20000000UL) +#define USBHS_DOEPTSIZ15_RXDPID_1 (0x40000000UL) + +/* Bit definition for USBHS_DOEPDMA15 register */ +#define USBHS_DOEPDMA15 (0xFFFFFFFFUL) + +/* Bit definition for USBHS_PCGCCTL register */ +#define USBHS_PCGCCTL_STOPPCLK_POS (0U) +#define USBHS_PCGCCTL_STOPPCLK (0x00000001UL) +#define USBHS_PCGCCTL_GATEHCLK_POS (1U) +#define USBHS_PCGCCTL_GATEHCLK (0x00000002UL) +#define USBHS_PCGCCTL_PWRCLMP_POS (2U) +#define USBHS_PCGCCTL_PWRCLMP (0x00000004UL) +#define USBHS_PCGCCTL_RSTPDWNMODULE_POS (3U) +#define USBHS_PCGCCTL_RSTPDWNMODULE (0x00000008UL) +#define USBHS_PCGCCTL_ENBL_L1GATING_POS (5U) +#define USBHS_PCGCCTL_ENBL_L1GATING (0x00000020UL) +#define USBHS_PCGCCTL_PHYSLEEP_POS (6U) +#define USBHS_PCGCCTL_PHYSLEEP (0x00000040UL) +#define USBHS_PCGCCTL_L1SUSPENDED_POS (7U) +#define USBHS_PCGCCTL_L1SUSPENDED (0x00000080UL) +#define USBHS_PCGCCTL_RESETAFTERSUSP_POS (8U) +#define USBHS_PCGCCTL_RESETAFTERSUSP (0x00000100UL) + +/******************************************************************************* + Bit definition for Peripheral WDT +*******************************************************************************/ +/* Bit definition for WDT_CR register */ +#define WDT_CR_PERI_POS (0U) +#define WDT_CR_PERI (0x00000003UL) +#define WDT_CR_PERI_0 (0x00000001UL) +#define WDT_CR_PERI_1 (0x00000002UL) +#define WDT_CR_CKS_POS (4U) +#define WDT_CR_CKS (0x000000F0UL) +#define WDT_CR_CKS_0 (0x00000010UL) +#define WDT_CR_CKS_1 (0x00000020UL) +#define WDT_CR_CKS_2 (0x00000040UL) +#define WDT_CR_CKS_3 (0x00000080UL) +#define WDT_CR_WDPT_POS (8U) +#define WDT_CR_WDPT (0x00000F00UL) +#define WDT_CR_WDPT_0 (0x00000100UL) +#define WDT_CR_WDPT_1 (0x00000200UL) +#define WDT_CR_WDPT_2 (0x00000400UL) +#define WDT_CR_WDPT_3 (0x00000800UL) +#define WDT_CR_SLPOFF_POS (16U) +#define WDT_CR_SLPOFF (0x00010000UL) +#define WDT_CR_ITS_POS (31U) +#define WDT_CR_ITS (0x80000000UL) + +/* Bit definition for WDT_SR register */ +#define WDT_SR_CNT_POS (0U) +#define WDT_SR_CNT (0x0000FFFFUL) +#define WDT_SR_UDF_POS (16U) +#define WDT_SR_UDF (0x00010000UL) +#define WDT_SR_REF_POS (17U) +#define WDT_SR_REF (0x00020000UL) + +/* Bit definition for WDT_RR register */ +#define WDT_RR_RF (0x0000FFFFUL) + + +/******************************************************************************/ +/* Device Specific Registers bit_band structure */ +/******************************************************************************/ + +typedef struct +{ + __IO uint32_t STRT; + uint32_t RESERVED0[7]; +} stc_adc_str_bit_t; + +typedef struct +{ + __IO uint32_t MS0; + __IO uint32_t MS1; + uint32_t RESERVED0[2]; + __IO uint32_t ACCSEL0; + __IO uint32_t ACCSEL1; + __IO uint32_t CLREN; + __IO uint32_t DFMT; + __IO uint32_t AVCNT0; + __IO uint32_t AVCNT1; + __IO uint32_t AVCNT2; + uint32_t RESERVED1[5]; +} stc_adc_cr0_bit_t; + +typedef struct +{ + uint32_t RESERVED0[2]; + __IO uint32_t RSCHSEL; + uint32_t RESERVED1[13]; +} stc_adc_cr1_bit_t; + +typedef struct +{ + __IO uint32_t TRGSELA0; + __IO uint32_t TRGSELA1; + uint32_t RESERVED0[5]; + __IO uint32_t TRGENA; + __IO uint32_t TRGSELB0; + __IO uint32_t TRGSELB1; + uint32_t RESERVED1[5]; + __IO uint32_t TRGENB; +} stc_adc_trgsr_bit_t; + +typedef struct +{ + __IO uint32_t CHSELA0; + __IO uint32_t CHSELA1; + __IO uint32_t CHSELA2; + __IO uint32_t CHSELA3; + __IO uint32_t CHSELA4; + __IO uint32_t CHSELA5; + __IO uint32_t CHSELA6; + __IO uint32_t CHSELA7; + __IO uint32_t CHSELA8; + __IO uint32_t CHSELA9; + __IO uint32_t CHSELA10; + __IO uint32_t CHSELA11; + __IO uint32_t CHSELA12; + __IO uint32_t CHSELA13; + __IO uint32_t CHSELA14; + __IO uint32_t CHSELA15; + __IO uint32_t CHSELA16; + __IO uint32_t CHSELA17; + __IO uint32_t CHSELA18; + __IO uint32_t CHSELA19; + uint32_t RESERVED0[12]; +} stc_adc_chselra_bit_t; + +typedef struct +{ + __IO uint32_t CHSELB0; + __IO uint32_t CHSELB1; + __IO uint32_t CHSELB2; + __IO uint32_t CHSELB3; + __IO uint32_t CHSELB4; + __IO uint32_t CHSELB5; + __IO uint32_t CHSELB6; + __IO uint32_t CHSELB7; + __IO uint32_t CHSELB8; + __IO uint32_t CHSELB9; + __IO uint32_t CHSELB10; + __IO uint32_t CHSELB11; + __IO uint32_t CHSELB12; + __IO uint32_t CHSELB13; + __IO uint32_t CHSELB14; + __IO uint32_t CHSELB15; + __IO uint32_t CHSELB16; + __IO uint32_t CHSELB17; + __IO uint32_t CHSELB18; + __IO uint32_t CHSELB19; + uint32_t RESERVED0[12]; +} stc_adc_chselrb_bit_t; + +typedef struct +{ + __IO uint32_t AVCHSEL0; + __IO uint32_t AVCHSEL1; + __IO uint32_t AVCHSEL2; + __IO uint32_t AVCHSEL3; + __IO uint32_t AVCHSEL4; + __IO uint32_t AVCHSEL5; + __IO uint32_t AVCHSEL6; + __IO uint32_t AVCHSEL7; + __IO uint32_t AVCHSEL8; + __IO uint32_t AVCHSEL9; + __IO uint32_t AVCHSEL10; + __IO uint32_t AVCHSEL11; + __IO uint32_t AVCHSEL12; + __IO uint32_t AVCHSEL13; + __IO uint32_t AVCHSEL14; + __IO uint32_t AVCHSEL15; + __IO uint32_t AVCHSEL16; + __IO uint32_t AVCHSEL17; + __IO uint32_t AVCHSEL18; + __IO uint32_t AVCHSEL19; + uint32_t RESERVED0[12]; +} stc_adc_avchselr_bit_t; + +typedef struct +{ + __IO uint32_t EXCHSEL; + uint32_t RESERVED0[7]; +} stc_adc_exchselr_bit_t; + +typedef struct +{ + __IO uint32_t SHSST0; + __IO uint32_t SHSST1; + __IO uint32_t SHSST2; + __IO uint32_t SHSST3; + __IO uint32_t SHSST4; + __IO uint32_t SHSST5; + __IO uint32_t SHSST6; + __IO uint32_t SHSST7; + __IO uint32_t SHSEL0; + __IO uint32_t SHSEL1; + __IO uint32_t SHSEL2; + uint32_t RESERVED0[5]; +} stc_adc_shcr_bit_t; + +typedef struct +{ + __IO uint32_t CH00MUX0; + __IO uint32_t CH00MUX1; + __IO uint32_t CH00MUX2; + __IO uint32_t CH00MUX3; + __IO uint32_t CH01MUX0; + __IO uint32_t CH01MUX1; + __IO uint32_t CH01MUX2; + __IO uint32_t CH01MUX3; + __IO uint32_t CH02MUX0; + __IO uint32_t CH02MUX1; + __IO uint32_t CH02MUX2; + __IO uint32_t CH02MUX3; + __IO uint32_t CH03MUX0; + __IO uint32_t CH03MUX1; + __IO uint32_t CH03MUX2; + __IO uint32_t CH03MUX3; +} stc_adc_chmuxr0_bit_t; + +typedef struct +{ + __IO uint32_t CH04MUX0; + __IO uint32_t CH04MUX1; + __IO uint32_t CH04MUX2; + __IO uint32_t CH04MUX3; + __IO uint32_t CH05MUX0; + __IO uint32_t CH05MUX1; + __IO uint32_t CH05MUX2; + __IO uint32_t CH05MUX3; + __IO uint32_t CH06MUX0; + __IO uint32_t CH06MUX1; + __IO uint32_t CH06MUX2; + __IO uint32_t CH06MUX3; + __IO uint32_t CH07MUX0; + __IO uint32_t CH07MUX1; + __IO uint32_t CH07MUX2; + __IO uint32_t CH07MUX3; +} stc_adc_chmuxr1_bit_t; + +typedef struct +{ + __IO uint32_t CH08MUX0; + __IO uint32_t CH08MUX1; + __IO uint32_t CH08MUX2; + __IO uint32_t CH08MUX3; + __IO uint32_t CH09MUX0; + __IO uint32_t CH09MUX1; + __IO uint32_t CH09MUX2; + __IO uint32_t CH09MUX3; + __IO uint32_t CH10MUX0; + __IO uint32_t CH10MUX1; + __IO uint32_t CH10MUX2; + __IO uint32_t CH10MUX3; + __IO uint32_t CH11MUX0; + __IO uint32_t CH11MUX1; + __IO uint32_t CH11MUX2; + __IO uint32_t CH11MUX3; +} stc_adc_chmuxr2_bit_t; + +typedef struct +{ + __IO uint32_t CH12MUX0; + __IO uint32_t CH12MUX1; + __IO uint32_t CH12MUX2; + __IO uint32_t CH12MUX3; + __IO uint32_t CH13MUX0; + __IO uint32_t CH13MUX1; + __IO uint32_t CH13MUX2; + __IO uint32_t CH13MUX3; + __IO uint32_t CH14MUX0; + __IO uint32_t CH14MUX1; + __IO uint32_t CH14MUX2; + __IO uint32_t CH14MUX3; + __IO uint32_t CH15MUX0; + __IO uint32_t CH15MUX1; + __IO uint32_t CH15MUX2; + __IO uint32_t CH15MUX3; +} stc_adc_chmuxr3_bit_t; + +typedef struct +{ + __IO uint32_t EOCAF; + __IO uint32_t EOCBF; + uint32_t RESERVED0[2]; + __IO uint32_t SASTPDF; + uint32_t RESERVED1[3]; +} stc_adc_isr_bit_t; + +typedef struct +{ + __IO uint32_t EOCAIEN; + __IO uint32_t EOCBIEN; + uint32_t RESERVED0[6]; +} stc_adc_icr_bit_t; + +typedef struct +{ + __IO uint32_t CLREOCAF; + __IO uint32_t CLREOCBF; + uint32_t RESERVED0[2]; + __IO uint32_t CLRSASTPDF; + uint32_t RESERVED1[3]; +} stc_adc_isclrr_bit_t; + +typedef struct +{ + __IO uint32_t SYNCEN; + uint32_t RESERVED0[3]; + __IO uint32_t SYNCMD0; + __IO uint32_t SYNCMD1; + __IO uint32_t SYNCMD2; + uint32_t RESERVED1[1]; + __IO uint32_t SYNCDLY0; + __IO uint32_t SYNCDLY1; + __IO uint32_t SYNCDLY2; + __IO uint32_t SYNCDLY3; + __IO uint32_t SYNCDLY4; + __IO uint32_t SYNCDLY5; + __IO uint32_t SYNCDLY6; + __IO uint32_t SYNCDLY7; +} stc_adc_synccr_bit_t; + +typedef struct +{ + __IO uint32_t AWD0EN; + __IO uint32_t AWD0IEN; + __IO uint32_t AWD0MD; + uint32_t RESERVED0[1]; + __IO uint32_t AWD1EN; + __IO uint32_t AWD1IEN; + __IO uint32_t AWD1MD; + uint32_t RESERVED1[1]; + __IO uint32_t AWDCM0; + __IO uint32_t AWDCM1; + uint32_t RESERVED2[6]; +} stc_adc_awdcr_bit_t; + +typedef struct +{ + __IO uint32_t AWD0F; + __IO uint32_t AWD1F; + uint32_t RESERVED0[2]; + __IO uint32_t AWDCMF; + uint32_t RESERVED1[3]; +} stc_adc_awdsr_bit_t; + +typedef struct +{ + __IO uint32_t CLRAWD0F; + __IO uint32_t CLRAWD1F; + uint32_t RESERVED0[2]; + __IO uint32_t CLRAWDCMF; + uint32_t RESERVED1[3]; +} stc_adc_awdsclrr_bit_t; + +typedef struct +{ + __IO uint32_t AWDCH0; + __IO uint32_t AWDCH1; + __IO uint32_t AWDCH2; + __IO uint32_t AWDCH3; + __IO uint32_t AWDCH4; + uint32_t RESERVED0[11]; +} stc_adc_awd0chsr_bit_t; + +typedef struct +{ + __IO uint32_t AWDCH0; + __IO uint32_t AWDCH1; + __IO uint32_t AWDCH2; + __IO uint32_t AWDCH3; + __IO uint32_t AWDCH4; + uint32_t RESERVED0[11]; +} stc_adc_awd1chsr_bit_t; + +typedef struct +{ + __IO uint32_t PGACTL0; + __IO uint32_t PGACTL1; + __IO uint32_t PGACTL2; + __IO uint32_t PGACTL3; + __IO uint32_t PGAGAIN0; + __IO uint32_t PGAGAIN1; + __IO uint32_t PGAGAIN2; + __IO uint32_t PGAGAIN3; +} stc_adc_pgacr1_bit_t; + +typedef struct +{ + __IO uint32_t PGACTL0; + __IO uint32_t PGACTL1; + __IO uint32_t PGACTL2; + __IO uint32_t PGACTL3; + __IO uint32_t PGAGAIN0; + __IO uint32_t PGAGAIN1; + __IO uint32_t PGAGAIN2; + __IO uint32_t PGAGAIN3; +} stc_adc_pgacr2_bit_t; + +typedef struct +{ + __IO uint32_t PGACTL0; + __IO uint32_t PGACTL1; + __IO uint32_t PGACTL2; + __IO uint32_t PGACTL3; + __IO uint32_t PGAGAIN0; + __IO uint32_t PGAGAIN1; + __IO uint32_t PGAGAIN2; + __IO uint32_t PGAGAIN3; +} stc_adc_pgacr3_bit_t; + +typedef struct +{ + __IO uint32_t PGAVSSEN0; + __IO uint32_t PGAVSSEN1; + __IO uint32_t PGAVSSEN2; + uint32_t RESERVED0[5]; +} stc_adc_pgavssenr_bit_t; + +typedef struct +{ + __IO uint32_t START; + __IO uint32_t MODE; + uint32_t RESERVED0[30]; +} stc_aes_cr_bit_t; + +typedef struct +{ + __IO uint32_t STRG; + uint32_t RESERVED0[31]; +} stc_aos_int_sfttrg_bit_t; + +typedef struct +{ + uint32_t RESERVED0[30]; + __IO uint32_t COMTRG_EN0; + __IO uint32_t COMTRG_EN1; +} stc_aos_dcu_1_trgsel_bit_t; + +typedef struct +{ + uint32_t RESERVED0[30]; + __IO uint32_t COMTRG_EN0; + __IO uint32_t COMTRG_EN1; +} stc_aos_dcu_2_trgsel_bit_t; + +typedef struct +{ + uint32_t RESERVED0[30]; + __IO uint32_t COMTRG_EN0; + __IO uint32_t COMTRG_EN1; +} stc_aos_dcu_3_trgsel_bit_t; + +typedef struct +{ + uint32_t RESERVED0[30]; + __IO uint32_t COMTRG_EN0; + __IO uint32_t COMTRG_EN1; +} stc_aos_dcu_4_trgsel_bit_t; + +typedef struct +{ + uint32_t RESERVED0[30]; + __IO uint32_t COMTRG_EN0; + __IO uint32_t COMTRG_EN1; +} stc_aos_dma_1_trgsel_bit_t; + +typedef struct +{ + uint32_t RESERVED0[30]; + __IO uint32_t COMTRG_EN0; + __IO uint32_t COMTRG_EN1; +} stc_aos_dma_2_trgsel_bit_t; + +typedef struct +{ + uint32_t RESERVED0[30]; + __IO uint32_t COMTRG_EN0; + __IO uint32_t COMTRG_EN1; +} stc_aos_dma_trgselrc_bit_t; + +typedef struct +{ + uint32_t RESERVED0[30]; + __IO uint32_t COMTRG_EN0; + __IO uint32_t COMTRG_EN1; +} stc_aos_tmr6_htssr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[30]; + __IO uint32_t COMTRG_EN0; + __IO uint32_t COMTRG_EN1; +} stc_aos_port_pevnttrgsr12_bit_t; + +typedef struct +{ + uint32_t RESERVED0[30]; + __IO uint32_t COMTRG_EN0; + __IO uint32_t COMTRG_EN1; +} stc_aos_port_pevnttrgsr34_bit_t; + +typedef struct +{ + uint32_t RESERVED0[30]; + __IO uint32_t COMTRG_EN0; + __IO uint32_t COMTRG_EN1; +} stc_aos_tmr0_htssr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[30]; + __IO uint32_t COMTRG_EN0; + __IO uint32_t COMTRG_EN1; +} stc_aos_tmr2_htssr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[30]; + __IO uint32_t COMTRG_EN0; + __IO uint32_t COMTRG_EN1; +} stc_aos_hash_itrgsela_bit_t; + +typedef struct +{ + uint32_t RESERVED0[30]; + __IO uint32_t COMTRG_EN0; + __IO uint32_t COMTRG_EN1; +} stc_aos_hash_itrgselb_bit_t; + +typedef struct +{ + uint32_t RESERVED0[30]; + __IO uint32_t COMTRG_EN0; + __IO uint32_t COMTRG_EN1; +} stc_aos_tmra_htssr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[30]; + __IO uint32_t COMTRG_EN0; + __IO uint32_t COMTRG_EN1; +} stc_aos_ots_trg_bit_t; + +typedef struct +{ + uint32_t RESERVED0[30]; + __IO uint32_t COMTRG_EN0; + __IO uint32_t COMTRG_EN1; +} stc_aos_adc_1_itrgselr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[30]; + __IO uint32_t COMTRG_EN0; + __IO uint32_t COMTRG_EN1; +} stc_aos_adc_2_itrgselr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[30]; + __IO uint32_t COMTRG_EN0; + __IO uint32_t COMTRG_EN1; +} stc_aos_adc_3_itrgselr_bit_t; + +typedef struct +{ + __IO uint32_t PDIR0; + __IO uint32_t PDIR1; + __IO uint32_t PDIR2; + __IO uint32_t PDIR3; + __IO uint32_t PDIR4; + __IO uint32_t PDIR5; + __IO uint32_t PDIR6; + __IO uint32_t PDIR7; + __IO uint32_t PDIR8; + __IO uint32_t PDIR9; + __IO uint32_t PDIR10; + __IO uint32_t PDIR11; + __IO uint32_t PDIR12; + __IO uint32_t PDIR13; + __IO uint32_t PDIR14; + __IO uint32_t PDIR15; + uint32_t RESERVED0[16]; +} stc_aos_gpio_pevntdirr_bit_t; + +typedef struct +{ + __IO uint32_t PIN0; + __IO uint32_t PIN1; + __IO uint32_t PIN2; + __IO uint32_t PIN3; + __IO uint32_t PIN4; + __IO uint32_t PIN5; + __IO uint32_t PIN6; + __IO uint32_t PIN7; + __IO uint32_t PIN8; + __IO uint32_t PIN9; + __IO uint32_t PIN10; + __IO uint32_t PIN11; + __IO uint32_t PIN12; + __IO uint32_t PIN13; + __IO uint32_t PIN14; + __IO uint32_t PIN15; + uint32_t RESERVED0[16]; +} stc_aos_gpio_pevntidr_bit_t; + +typedef struct +{ + __IO uint32_t POUT0; + __IO uint32_t POUT1; + __IO uint32_t POUT2; + __IO uint32_t POUT3; + __IO uint32_t POUT4; + __IO uint32_t POUT5; + __IO uint32_t POUT6; + __IO uint32_t POUT7; + __IO uint32_t POUT8; + __IO uint32_t POUT9; + __IO uint32_t POUT10; + __IO uint32_t POUT11; + __IO uint32_t POUT12; + __IO uint32_t POUT13; + __IO uint32_t POUT14; + __IO uint32_t POUT15; + uint32_t RESERVED0[16]; +} stc_aos_gpio_pevntodr_bit_t; + +typedef struct +{ + __IO uint32_t POR0; + __IO uint32_t POR1; + __IO uint32_t POR2; + __IO uint32_t POR3; + __IO uint32_t POR4; + __IO uint32_t POR5; + __IO uint32_t POR6; + __IO uint32_t POR7; + __IO uint32_t POR8; + __IO uint32_t POR9; + __IO uint32_t POR10; + __IO uint32_t POR11; + __IO uint32_t POR12; + __IO uint32_t POR13; + __IO uint32_t POR14; + __IO uint32_t POR15; + uint32_t RESERVED0[16]; +} stc_aos_gpio_pevntorr_bit_t; + +typedef struct +{ + __IO uint32_t POS0; + __IO uint32_t POS1; + __IO uint32_t POS2; + __IO uint32_t POS3; + __IO uint32_t POS4; + __IO uint32_t POS5; + __IO uint32_t POS6; + __IO uint32_t POS7; + __IO uint32_t POS8; + __IO uint32_t POS9; + __IO uint32_t POS10; + __IO uint32_t POS11; + __IO uint32_t POS12; + __IO uint32_t POS13; + __IO uint32_t POS14; + __IO uint32_t POS15; + uint32_t RESERVED0[16]; +} stc_aos_gpio_pevntosr_bit_t; + +typedef struct +{ + __IO uint32_t RIS0; + __IO uint32_t RIS1; + __IO uint32_t RIS2; + __IO uint32_t RIS3; + __IO uint32_t RIS4; + __IO uint32_t RIS5; + __IO uint32_t RIS6; + __IO uint32_t RIS7; + __IO uint32_t RIS8; + __IO uint32_t RIS9; + __IO uint32_t RIS10; + __IO uint32_t RIS11; + __IO uint32_t RIS12; + __IO uint32_t RIS13; + __IO uint32_t RIS14; + __IO uint32_t RIS15; + uint32_t RESERVED0[16]; +} stc_aos_gpio_pevntrisr_bit_t; + +typedef struct +{ + __IO uint32_t FAL0; + __IO uint32_t FAL1; + __IO uint32_t FAL2; + __IO uint32_t FAL3; + __IO uint32_t FAL4; + __IO uint32_t FAL5; + __IO uint32_t FAL6; + __IO uint32_t FAL7; + __IO uint32_t FAL8; + __IO uint32_t FAL9; + __IO uint32_t FAL10; + __IO uint32_t FAL11; + __IO uint32_t FAL12; + __IO uint32_t FAL13; + __IO uint32_t FAL14; + __IO uint32_t FAL15; + uint32_t RESERVED0[16]; +} stc_aos_gpio_pevntfal_bit_t; + +typedef struct +{ + __IO uint32_t NFEN1; + uint32_t RESERVED0[7]; + __IO uint32_t NFEN2; + uint32_t RESERVED1[7]; + __IO uint32_t NFEN3; + uint32_t RESERVED2[7]; + __IO uint32_t NFEN4; + uint32_t RESERVED3[7]; +} stc_aos_gpio_pevntnfcr_bit_t; + +typedef struct +{ + __IO uint32_t BUSOFF; + __IO uint32_t TACTIVE; + __IO uint32_t RACTIVE; + __IO uint32_t TSSS; + __IO uint32_t TPSS; + __IO uint32_t LBMI; + __IO uint32_t LBME; + __IO uint32_t RESET; +} stc_can_cfg_stat_bit_t; + +typedef struct +{ + __IO uint32_t TSA; + __IO uint32_t TSALL; + __IO uint32_t TSONE; + __IO uint32_t TPA; + __IO uint32_t TPE; + uint32_t RESERVED0[1]; + __IO uint32_t LOM; + __IO uint32_t TBSEL; +} stc_can_tcmd_bit_t; + +typedef struct +{ + __IO uint32_t TSSTAT0; + __IO uint32_t TSSTAT1; + uint32_t RESERVED0[2]; + __IO uint32_t TTTBM; + __IO uint32_t TSMODE; + __IO uint32_t TSNEXT; + __IO uint32_t FD_ISO; +} stc_can_tctrl_bit_t; + +typedef struct +{ + __IO uint32_t RSTAT0; + __IO uint32_t RSTAT1; + uint32_t RESERVED0[1]; + __IO uint32_t RBALL; + __IO uint32_t RREL; + __IO uint32_t ROV; + __IO uint32_t ROM; + __IO uint32_t SACK; +} stc_can_rctrl_bit_t; + +typedef struct +{ + __IO uint32_t TSFF; + __IO uint32_t EIE; + __IO uint32_t TSIE; + __IO uint32_t TPIE; + __IO uint32_t RAFIE; + __IO uint32_t RFIE; + __IO uint32_t ROIE; + __IO uint32_t RIE; +} stc_can_rtie_bit_t; + +typedef struct +{ + __IO uint32_t AIF; + __IO uint32_t EIF; + __IO uint32_t TSIF; + __IO uint32_t TPIF; + __IO uint32_t RAFIF; + __IO uint32_t RFIF; + __IO uint32_t ROIF; + __IO uint32_t RIF; +} stc_can_rtif_bit_t; + +typedef struct +{ + __IO uint32_t BEIF; + __IO uint32_t BEIE; + __IO uint32_t ALIF; + __IO uint32_t ALIE; + __IO uint32_t EPIF; + __IO uint32_t EPIE; + __IO uint32_t EPASS; + __IO uint32_t EWARN; +} stc_can_errint_bit_t; + +typedef struct +{ + __IO uint32_t EWL0; + __IO uint32_t EWL1; + __IO uint32_t EWL2; + __IO uint32_t EWL3; + __IO uint32_t AFWL0; + __IO uint32_t AFWL1; + __IO uint32_t AFWL2; + __IO uint32_t AFWL3; +} stc_can_limit_bit_t; + +typedef struct +{ + __IO uint32_t S_SEG_10; + __IO uint32_t S_SEG_11; + __IO uint32_t S_SEG_12; + __IO uint32_t S_SEG_13; + __IO uint32_t S_SEG_14; + __IO uint32_t S_SEG_15; + __IO uint32_t S_SEG_16; + __IO uint32_t S_SEG_17; + __IO uint32_t S_SEG_20; + __IO uint32_t S_SEG_21; + __IO uint32_t S_SEG_22; + __IO uint32_t S_SEG_23; + __IO uint32_t S_SEG_24; + __IO uint32_t S_SEG_25; + __IO uint32_t S_SEG_26; + uint32_t RESERVED0[1]; + __IO uint32_t S_SJW0; + __IO uint32_t S_SJW1; + __IO uint32_t S_SJW2; + __IO uint32_t S_SJW3; + __IO uint32_t S_SJW4; + __IO uint32_t S_SJW5; + __IO uint32_t S_SJW6; + uint32_t RESERVED1[1]; + __IO uint32_t S_PRESC0; + __IO uint32_t S_PRESC1; + __IO uint32_t S_PRESC2; + __IO uint32_t S_PRESC3; + __IO uint32_t S_PRESC4; + __IO uint32_t S_PRESC5; + __IO uint32_t S_PRESC6; + __IO uint32_t S_PRESC7; +} stc_can_sbt_bit_t; + +typedef struct +{ + __IO uint32_t F_SEG_10; + __IO uint32_t F_SEG_11; + __IO uint32_t F_SEG_12; + __IO uint32_t F_SEG_13; + __IO uint32_t F_SEG_14; + uint32_t RESERVED0[3]; + __IO uint32_t F_SEG_20; + __IO uint32_t F_SEG_21; + __IO uint32_t F_SEG_22; + __IO uint32_t F_SEG_23; + uint32_t RESERVED1[4]; + __IO uint32_t F_SJW0; + __IO uint32_t F_SJW1; + __IO uint32_t F_SJW2; + __IO uint32_t F_SJW3; + uint32_t RESERVED2[4]; + __IO uint32_t F_PRESC0; + __IO uint32_t F_PRESC1; + __IO uint32_t F_PRESC2; + __IO uint32_t F_PRESC3; + __IO uint32_t F_PRESC4; + __IO uint32_t F_PRESC5; + __IO uint32_t F_PRESC6; + __IO uint32_t F_PRESC7; +} stc_can_fbt_bit_t; + +typedef struct +{ + __IO uint32_t ALC0; + __IO uint32_t ALC1; + __IO uint32_t ALC2; + __IO uint32_t ALC3; + __IO uint32_t ALC4; + __IO uint32_t KOER0; + __IO uint32_t KOER1; + __IO uint32_t KOER2; +} stc_can_ealcap_bit_t; + +typedef struct +{ + __IO uint32_t SSPOFF0; + __IO uint32_t SSPOFF1; + __IO uint32_t SSPOFF2; + __IO uint32_t SSPOFF3; + __IO uint32_t SSPOFF4; + __IO uint32_t SSPOFF5; + __IO uint32_t SSPOFF6; + __IO uint32_t TDCEN; +} stc_can_tdc_bit_t; + +typedef struct +{ + __IO uint32_t ACFADR0; + __IO uint32_t ACFADR1; + __IO uint32_t ACFADR2; + __IO uint32_t ACFADR3; + uint32_t RESERVED0[1]; + __IO uint32_t SELMASK; + uint32_t RESERVED1[2]; +} stc_can_acfctrl_bit_t; + +typedef struct +{ + __IO uint32_t AE_1; + __IO uint32_t AE_2; + __IO uint32_t AE_3; + __IO uint32_t AE_4; + __IO uint32_t AE_5; + __IO uint32_t AE_6; + __IO uint32_t AE_7; + __IO uint32_t AE_8; + __IO uint32_t AE_9; + __IO uint32_t AE_10; + __IO uint32_t AE_11; + __IO uint32_t AE_12; + __IO uint32_t AE_13; + __IO uint32_t AE_14; + __IO uint32_t AE_15; + __IO uint32_t AE_16; +} stc_can_acfen_bit_t; + +typedef struct +{ + __IO uint32_t ACODEORAMASK0; + __IO uint32_t ACODEORAMASK1; + __IO uint32_t ACODEORAMASK2; + __IO uint32_t ACODEORAMASK3; + __IO uint32_t ACODEORAMASK4; + __IO uint32_t ACODEORAMASK5; + __IO uint32_t ACODEORAMASK6; + __IO uint32_t ACODEORAMASK7; + __IO uint32_t ACODEORAMASK8; + __IO uint32_t ACODEORAMASK9; + __IO uint32_t ACODEORAMASK10; + __IO uint32_t ACODEORAMASK11; + __IO uint32_t ACODEORAMASK12; + __IO uint32_t ACODEORAMASK13; + __IO uint32_t ACODEORAMASK14; + __IO uint32_t ACODEORAMASK15; + __IO uint32_t ACODEORAMASK16; + __IO uint32_t ACODEORAMASK17; + __IO uint32_t ACODEORAMASK18; + __IO uint32_t ACODEORAMASK19; + __IO uint32_t ACODEORAMASK20; + __IO uint32_t ACODEORAMASK21; + __IO uint32_t ACODEORAMASK22; + __IO uint32_t ACODEORAMASK23; + __IO uint32_t ACODEORAMASK24; + __IO uint32_t ACODEORAMASK25; + __IO uint32_t ACODEORAMASK26; + __IO uint32_t ACODEORAMASK27; + __IO uint32_t ACODEORAMASK28; + __IO uint32_t AIDE; + __IO uint32_t AIDEE; + uint32_t RESERVED0[1]; +} stc_can_acf_bit_t; + +typedef struct +{ + __IO uint32_t TBPTR0; + __IO uint32_t TBPTR1; + __IO uint32_t TBPTR2; + __IO uint32_t TBPTR3; + __IO uint32_t TBPTR4; + __IO uint32_t TBPTR5; + __IO uint32_t TBF; + __IO uint32_t TBE; +} stc_can_tbslot_bit_t; + +typedef struct +{ + __IO uint32_t TTEN; + __IO uint32_t T_PRESC0; + __IO uint32_t T_PRESC1; + __IO uint32_t TTIF; + __IO uint32_t TTIE; + __IO uint32_t TEIF; + __IO uint32_t WTIF; + __IO uint32_t WTIE; +} stc_can_ttcfg_bit_t; + +typedef struct +{ + __IO uint32_t REF_ID0; + __IO uint32_t REF_ID1; + __IO uint32_t REF_ID2; + __IO uint32_t REF_ID3; + __IO uint32_t REF_ID4; + __IO uint32_t REF_ID5; + __IO uint32_t REF_ID6; + __IO uint32_t REF_ID7; + __IO uint32_t REF_ID8; + __IO uint32_t REF_ID9; + __IO uint32_t REF_ID10; + __IO uint32_t REF_ID11; + __IO uint32_t REF_ID12; + __IO uint32_t REF_ID13; + __IO uint32_t REF_ID14; + __IO uint32_t REF_ID15; + __IO uint32_t REF_ID16; + __IO uint32_t REF_ID17; + __IO uint32_t REF_ID18; + __IO uint32_t REF_ID19; + __IO uint32_t REF_ID20; + __IO uint32_t REF_ID21; + __IO uint32_t REF_ID22; + __IO uint32_t REF_ID23; + __IO uint32_t REF_ID24; + __IO uint32_t REF_ID25; + __IO uint32_t REF_ID26; + __IO uint32_t REF_ID27; + __IO uint32_t REF_ID28; + uint32_t RESERVED0[2]; + __IO uint32_t REF_IDE; +} stc_can_ref_msg_bit_t; + +typedef struct +{ + __IO uint32_t TTPTR0; + __IO uint32_t TTPTR1; + __IO uint32_t TTPTR2; + __IO uint32_t TTPTR3; + __IO uint32_t TTPTR4; + __IO uint32_t TTPTR5; + uint32_t RESERVED0[2]; + __IO uint32_t TTYPE0; + __IO uint32_t TTYPE1; + __IO uint32_t TTYPE2; + uint32_t RESERVED1[1]; + __IO uint32_t TEW0; + __IO uint32_t TEW1; + __IO uint32_t TEW2; + __IO uint32_t TEW3; +} stc_can_trg_cfg_bit_t; + +typedef struct +{ + __IO uint32_t CENB; + __IO uint32_t CWDE; + uint32_t RESERVED0[5]; + __IO uint32_t CMON; +} stc_cmp_mdr_bit_t; + +typedef struct +{ + __IO uint32_t FCKS0; + __IO uint32_t FCKS1; + uint32_t RESERVED0[2]; + __IO uint32_t EDGS0; + __IO uint32_t EDGS1; + __IO uint32_t CIEN; + uint32_t RESERVED1[1]; +} stc_cmp_fir_bit_t; + +typedef struct +{ + __IO uint32_t COEN; + __IO uint32_t COPS; + __IO uint32_t CPOE; + __IO uint32_t TWOE; + __IO uint32_t TWOL; + uint32_t RESERVED0[3]; +} stc_cmp_ocr_bit_t; + +typedef struct +{ + __IO uint32_t RVSL0; + __IO uint32_t RVSL1; + __IO uint32_t RVSL2; + __IO uint32_t RVSL3; + __IO uint32_t CVSL0; + __IO uint32_t CVSL1; + __IO uint32_t CVSL2; + __IO uint32_t CVSL3; +} stc_cmp_pmsr_bit_t; + +typedef struct +{ + __IO uint32_t CTWS0; + __IO uint32_t CTWS1; + __IO uint32_t CTWS2; + __IO uint32_t CTWS3; + __IO uint32_t CTWS4; + __IO uint32_t CTWS5; + __IO uint32_t CTWS6; + __IO uint32_t CTWS7; + __IO uint32_t CTWS8; + __IO uint32_t CTWS9; + __IO uint32_t CTWS10; + __IO uint32_t CTWS11; + __IO uint32_t CTWS12; + __IO uint32_t CTWS13; + __IO uint32_t CTWS14; + __IO uint32_t CTWS15; +} stc_cmp_twsr_bit_t; + +typedef struct +{ + __IO uint32_t CTWP0; + __IO uint32_t CTWP1; + __IO uint32_t CTWP2; + __IO uint32_t CTWP3; + __IO uint32_t CTWP4; + __IO uint32_t CTWP5; + __IO uint32_t CTWP6; + __IO uint32_t CTWP7; + __IO uint32_t CTWP8; + __IO uint32_t CTWP9; + __IO uint32_t CTWP10; + __IO uint32_t CTWP11; + __IO uint32_t CTWP12; + __IO uint32_t CTWP13; + __IO uint32_t CTWP14; + __IO uint32_t CTWP15; +} stc_cmp_twpr_bit_t; + +typedef struct +{ + __IO uint32_t P2SL0; + __IO uint32_t P2SL1; + __IO uint32_t P2SL2; + uint32_t RESERVED0[1]; + __IO uint32_t P3SL0; + __IO uint32_t P3SL1; + uint32_t RESERVED1[10]; +} stc_cmp_visr_bit_t; + +typedef struct +{ + __IO uint32_t XTAL32STP; + uint32_t RESERVED0[7]; +} stc_cmu_xtal32cr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; +} stc_cmu_xtal32cfgr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; +} stc_cmu_xtal32nfr_bit_t; + +typedef struct +{ + __IO uint32_t LRCSTP; + uint32_t RESERVED0[7]; +} stc_cmu_lrccr_bit_t; + +typedef struct +{ + __IO uint32_t RTCLRCSTP; + uint32_t RESERVED0[7]; +} stc_cmu_rtclrccr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[6]; + __IO uint32_t XTALMS; + uint32_t RESERVED1[1]; +} stc_cmu_xtalcfgr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[16]; +} stc_cmu_pericksel_bit_t; + +typedef struct +{ + uint32_t RESERVED0[16]; +} stc_cmu_i2scksel_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; +} stc_cmu_canckcfgr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; +} stc_cmu_usbckcfgr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; +} stc_cmu_ckswr_bit_t; + +typedef struct +{ + __IO uint32_t PLLHOFF; + uint32_t RESERVED0[7]; +} stc_cmu_pllhcr_bit_t; + +typedef struct +{ + __IO uint32_t PLLAOFF; + uint32_t RESERVED0[7]; +} stc_cmu_pllacr_bit_t; + +typedef struct +{ + __IO uint32_t XTALSTP; + uint32_t RESERVED0[7]; +} stc_cmu_xtalcr_bit_t; + +typedef struct +{ + __IO uint32_t HRCSTP; + uint32_t RESERVED0[7]; +} stc_cmu_hrccr_bit_t; + +typedef struct +{ + __IO uint32_t MRCSTP; + uint32_t RESERVED0[7]; +} stc_cmu_mrccr_bit_t; + +typedef struct +{ + __IO uint32_t HRCSTBF; + uint32_t RESERVED0[2]; + __IO uint32_t XTALSTBF; + uint32_t RESERVED1[1]; + __IO uint32_t PLLHSTBF; + __IO uint32_t PLLASTBF; + __IO uint32_t PLLBSTBF; +} stc_cmu_oscstbsr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[7]; + __IO uint32_t MCO1EN; +} stc_cmu_mco1cfgr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[7]; + __IO uint32_t MCO2EN; +} stc_cmu_mco2cfgr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[7]; + __IO uint32_t TPIUCKOE; +} stc_cmu_tpiuckcfgr_bit_t; + +typedef struct +{ + __IO uint32_t XTALSTDIE; + __IO uint32_t XTALSTDRE; + __IO uint32_t XTALSTDRIS; + uint32_t RESERVED0[4]; + __IO uint32_t XTALSTDE; +} stc_cmu_xtalstdcr_bit_t; + +typedef struct +{ + __IO uint32_t XTALSTDF; + uint32_t RESERVED0[7]; +} stc_cmu_xtalstdsr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; +} stc_cmu_xtalstbcr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[7]; + __IO uint32_t PLLSRC; + uint32_t RESERVED1[24]; +} stc_cmu_pllhcfgr_bit_t; + +typedef struct +{ + __IO uint32_t CR; + __IO uint32_t FLAG; + uint32_t RESERVED0[30]; +} stc_crc_cr_bit_t; + +typedef struct +{ + __IO uint32_t REFPSC0; + __IO uint32_t REFPSC1; + __IO uint32_t REFPSC2; + uint32_t RESERVED0[1]; + __IO uint32_t REFCKS0; + __IO uint32_t REFCKS1; + __IO uint32_t ERRIE; + __IO uint32_t CTCEN; + uint32_t RESERVED1[24]; +} stc_ctc_cr1_bit_t; + +typedef struct +{ + __IO uint32_t OFSVAL0; + __IO uint32_t OFSVAL1; + __IO uint32_t OFSVAL2; + __IO uint32_t OFSVAL3; + __IO uint32_t OFSVAL4; + __IO uint32_t OFSVAL5; + __IO uint32_t OFSVAL6; + __IO uint32_t OFSVAL7; + uint32_t RESERVED0[24]; +} stc_ctc_cr2_bit_t; + +typedef struct +{ + __IO uint32_t TRIMOK; + __IO uint32_t TRMOVF; + __IO uint32_t TRMUDF; + __IO uint32_t CTCBSY; + uint32_t RESERVED0[28]; +} stc_ctc_str_bit_t; + +typedef struct +{ + __IO uint32_t DR0; + __IO uint32_t DR1; + __IO uint32_t DR2; + __IO uint32_t DR3; + __IO uint32_t DL0R4; + __IO uint32_t DL1R5; + __IO uint32_t DL2R6; + __IO uint32_t DL3R7; + __IO uint32_t DL4R8; + __IO uint32_t DL5R9; + __IO uint32_t DL6R10; + __IO uint32_t DL7R11; + __IO uint32_t DL8; + __IO uint32_t DL9; + __IO uint32_t DL10; + __IO uint32_t DL11; +} stc_dac_dadr1_bit_t; + +typedef struct +{ + __IO uint32_t DR0; + __IO uint32_t DR1; + __IO uint32_t DR2; + __IO uint32_t DR3; + __IO uint32_t DL0R4; + __IO uint32_t DL1R5; + __IO uint32_t DL2R6; + __IO uint32_t DL3R7; + __IO uint32_t DL4R8; + __IO uint32_t DL5R9; + __IO uint32_t DL6R10; + __IO uint32_t DL7R11; + __IO uint32_t DL8; + __IO uint32_t DL9; + __IO uint32_t DL10; + __IO uint32_t DL11; +} stc_dac_dadr2_bit_t; + +typedef struct +{ + __IO uint32_t DAE; + __IO uint32_t DA1E; + __IO uint32_t DA2E; + uint32_t RESERVED0[5]; + __IO uint32_t DPSEL; + __IO uint32_t DAAMP1; + __IO uint32_t DAAMP2; + __IO uint32_t EXTDSL1; + __IO uint32_t EXTDSL2; + uint32_t RESERVED1[3]; +} stc_dac_dacr_bit_t; + +typedef struct +{ + __IO uint32_t ADPSL1; + __IO uint32_t ADPSL2; + __IO uint32_t ADPSL3; + uint32_t RESERVED0[5]; + __IO uint32_t DA1SF; + __IO uint32_t DA2SF; + uint32_t RESERVED1[5]; + __IO uint32_t ADPEN; +} stc_dac_daadpcr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[14]; + __IO uint32_t DAODIS1; + __IO uint32_t DAODIS2; +} stc_dac_daocr_bit_t; + +typedef struct +{ + __IO uint32_t MODE0; + __IO uint32_t MODE1; + __IO uint32_t MODE2; + __IO uint32_t MODE3; + __IO uint32_t DATASIZE0; + __IO uint32_t DATASIZE1; + uint32_t RESERVED0[2]; + __IO uint32_t COMP_TRG; + uint32_t RESERVED1[22]; + __IO uint32_t INTEN; +} stc_dcu_ctl_bit_t; + +typedef struct +{ + __IO uint32_t FLAG_OP; + __IO uint32_t FLAG_LS2; + __IO uint32_t FLAG_EQ2; + __IO uint32_t FLAG_GT2; + __IO uint32_t FLAG_LS1; + __IO uint32_t FLAG_EQ1; + __IO uint32_t FLAG_GT1; + uint32_t RESERVED0[2]; + __IO uint32_t FLAG_RLD; + __IO uint32_t FLAG_BTM; + __IO uint32_t FLAG_TOP; + uint32_t RESERVED1[20]; +} stc_dcu_flag_bit_t; + +typedef struct +{ + __IO uint32_t CLR_OP; + __IO uint32_t CLR_LS2; + __IO uint32_t CLR_EQ2; + __IO uint32_t CLR_GT2; + __IO uint32_t CLR_LS1; + __IO uint32_t CLR_EQ1; + __IO uint32_t CLR_GT1; + uint32_t RESERVED0[2]; + __IO uint32_t CLR_RLD; + __IO uint32_t CLR_BTM; + __IO uint32_t CLR_TOP; + uint32_t RESERVED1[20]; +} stc_dcu_flagclr_bit_t; + +typedef struct +{ + __IO uint32_t SEL_OP; + __IO uint32_t SEL_LS2; + __IO uint32_t SEL_EQ2; + __IO uint32_t SEL_GT2; + __IO uint32_t SEL_LS1; + __IO uint32_t SEL_EQ1; + __IO uint32_t SEL_GT1; + __IO uint32_t SEL_WIN0; + __IO uint32_t SEL_WIN1; + __IO uint32_t SEL_RLD; + __IO uint32_t SEL_BTM; + __IO uint32_t SEL_TOP; + uint32_t RESERVED0[20]; +} stc_dcu_intevtsel_bit_t; + +typedef struct +{ + __IO uint32_t EN; + uint32_t RESERVED0[31]; +} stc_dma_en_bit_t; + +typedef struct +{ + __IO uint32_t TRNERR0; + __IO uint32_t TRNERR1; + __IO uint32_t TRNERR2; + __IO uint32_t TRNERR3; + __IO uint32_t TRNERR4; + __IO uint32_t TRNERR5; + __IO uint32_t TRNERR6; + __IO uint32_t TRNERR7; + uint32_t RESERVED0[8]; + __IO uint32_t REQERR0; + __IO uint32_t REQERR1; + __IO uint32_t REQERR2; + __IO uint32_t REQERR3; + __IO uint32_t REQERR4; + __IO uint32_t REQERR5; + __IO uint32_t REQERR6; + __IO uint32_t REQERR7; + uint32_t RESERVED1[8]; +} stc_dma_intstat0_bit_t; + +typedef struct +{ + __IO uint32_t TC0; + __IO uint32_t TC1; + __IO uint32_t TC2; + __IO uint32_t TC3; + __IO uint32_t TC4; + __IO uint32_t TC5; + __IO uint32_t TC6; + __IO uint32_t TC7; + uint32_t RESERVED0[8]; + __IO uint32_t BTC0; + __IO uint32_t BTC1; + __IO uint32_t BTC2; + __IO uint32_t BTC3; + __IO uint32_t BTC4; + __IO uint32_t BTC5; + __IO uint32_t BTC6; + __IO uint32_t BTC7; + uint32_t RESERVED1[8]; +} stc_dma_intstat1_bit_t; + +typedef struct +{ + __IO uint32_t MSKTRNERR0; + __IO uint32_t MSKTRNERR1; + __IO uint32_t MSKTRNERR2; + __IO uint32_t MSKTRNERR3; + __IO uint32_t MSKTRNERR4; + __IO uint32_t MSKTRNERR5; + __IO uint32_t MSKTRNERR6; + __IO uint32_t MSKTRNERR7; + uint32_t RESERVED0[8]; + __IO uint32_t MSKREQERR0; + __IO uint32_t MSKREQERR1; + __IO uint32_t MSKREQERR2; + __IO uint32_t MSKREQERR3; + __IO uint32_t MSKREQERR4; + __IO uint32_t MSKREQERR5; + __IO uint32_t MSKREQERR6; + __IO uint32_t MSKREQERR7; + uint32_t RESERVED1[8]; +} stc_dma_intmask0_bit_t; + +typedef struct +{ + __IO uint32_t MSKTC0; + __IO uint32_t MSKTC1; + __IO uint32_t MSKTC2; + __IO uint32_t MSKTC3; + __IO uint32_t MSKTC4; + __IO uint32_t MSKTC5; + __IO uint32_t MSKTC6; + __IO uint32_t MSKTC7; + uint32_t RESERVED0[8]; + __IO uint32_t MSKBTC0; + __IO uint32_t MSKBTC1; + __IO uint32_t MSKBTC2; + __IO uint32_t MSKBTC3; + __IO uint32_t MSKBTC4; + __IO uint32_t MSKBTC5; + __IO uint32_t MSKBTC6; + __IO uint32_t MSKBTC7; + uint32_t RESERVED1[8]; +} stc_dma_intmask1_bit_t; + +typedef struct +{ + __IO uint32_t CLRTRNERR0; + __IO uint32_t CLRTRNERR1; + __IO uint32_t CLRTRNERR2; + __IO uint32_t CLRTRNERR3; + __IO uint32_t CLRTRNERR4; + __IO uint32_t CLRTRNERR5; + __IO uint32_t CLRTRNERR6; + __IO uint32_t CLRTRNERR7; + uint32_t RESERVED0[8]; + __IO uint32_t CLRREQERR0; + __IO uint32_t CLRREQERR1; + __IO uint32_t CLRREQERR2; + __IO uint32_t CLRREQERR3; + __IO uint32_t CLRREQERR4; + __IO uint32_t CLRREQERR5; + __IO uint32_t CLRREQERR6; + __IO uint32_t CLRREQERR7; + uint32_t RESERVED1[8]; +} stc_dma_intclr0_bit_t; + +typedef struct +{ + __IO uint32_t CLRTC0; + __IO uint32_t CLRTC1; + __IO uint32_t CLRTC2; + __IO uint32_t CLRTC3; + __IO uint32_t CLRTC4; + __IO uint32_t CLRTC5; + __IO uint32_t CLRTC6; + __IO uint32_t CLRTC7; + uint32_t RESERVED0[8]; + __IO uint32_t CLRBTC0; + __IO uint32_t CLRBTC1; + __IO uint32_t CLRBTC2; + __IO uint32_t CLRBTC3; + __IO uint32_t CLRBTC4; + __IO uint32_t CLRBTC5; + __IO uint32_t CLRBTC6; + __IO uint32_t CLRBTC7; + uint32_t RESERVED1[8]; +} stc_dma_intclr1_bit_t; + +typedef struct +{ + __IO uint32_t CHEN0; + __IO uint32_t CHEN1; + __IO uint32_t CHEN2; + __IO uint32_t CHEN3; + __IO uint32_t CHEN4; + __IO uint32_t CHEN5; + __IO uint32_t CHEN6; + __IO uint32_t CHEN7; + uint32_t RESERVED0[24]; +} stc_dma_chen_bit_t; + +typedef struct +{ + __IO uint32_t CHREQ0; + __IO uint32_t CHREQ1; + __IO uint32_t CHREQ2; + __IO uint32_t CHREQ3; + __IO uint32_t CHREQ4; + __IO uint32_t CHREQ5; + __IO uint32_t CHREQ6; + __IO uint32_t CHREQ7; + uint32_t RESERVED0[7]; + __IO uint32_t RCFGREQ; + uint32_t RESERVED1[16]; +} stc_dma_reqstat_bit_t; + +typedef struct +{ + __IO uint32_t DMAACT; + __IO uint32_t RCFGACT; + uint32_t RESERVED0[14]; + __IO uint32_t CHACT0; + __IO uint32_t CHACT1; + __IO uint32_t CHACT2; + __IO uint32_t CHACT3; + __IO uint32_t CHACT4; + __IO uint32_t CHACT5; + __IO uint32_t CHACT6; + __IO uint32_t CHACT7; + uint32_t RESERVED1[8]; +} stc_dma_chstat_bit_t; + +typedef struct +{ + __IO uint32_t RCFGEN; + __IO uint32_t RCFGLLP; + uint32_t RESERVED0[14]; + __IO uint32_t SARMD0; + __IO uint32_t SARMD1; + __IO uint32_t DARMD0; + __IO uint32_t DARMD1; + __IO uint32_t CNTMD0; + __IO uint32_t CNTMD1; + uint32_t RESERVED1[10]; +} stc_dma_rcfgctl_bit_t; + +typedef struct +{ + __IO uint32_t CHENCLR0; + __IO uint32_t CHENCLR1; + __IO uint32_t CHENCLR2; + __IO uint32_t CHENCLR3; + __IO uint32_t CHENCLR4; + __IO uint32_t CHENCLR5; + __IO uint32_t CHENCLR6; + __IO uint32_t CHENCLR7; + uint32_t RESERVED0[24]; +} stc_dma_chenclr_bit_t; + +typedef struct +{ + __IO uint32_t SINC0; + __IO uint32_t SINC1; + __IO uint32_t DINC0; + __IO uint32_t DINC1; + __IO uint32_t SRTPEN; + __IO uint32_t DRPTEN; + __IO uint32_t SNSEQEN; + __IO uint32_t DNSEQEN; + __IO uint32_t HSIZE0; + __IO uint32_t HSIZE1; + __IO uint32_t LLPEN; + __IO uint32_t LLPRUN; + __IO uint32_t IE; + uint32_t RESERVED0[19]; +} stc_dma_chctl_bit_t; + +typedef struct +{ + __IO uint32_t CAPEN; + __IO uint32_t CAPMD; + __IO uint32_t CROPEN; + __IO uint32_t JPEGEN; + __IO uint32_t SWSYNC; + __IO uint32_t PIXCKSEL; + __IO uint32_t HSYNCSEL; + __IO uint32_t VSYNCSEL; + __IO uint32_t CAPFRC0; + __IO uint32_t CAPFRC1; + __IO uint32_t BITSEL0; + __IO uint32_t BITSEL1; + uint32_t RESERVED0[2]; + __IO uint32_t DVPEN; + uint32_t RESERVED1[17]; +} stc_dvp_ctr_bit_t; + +typedef struct +{ + __IO uint32_t FSF; + __IO uint32_t LSF; + __IO uint32_t LEF; + __IO uint32_t FEF; + __IO uint32_t SQUERF; + __IO uint32_t FIFOERF; + uint32_t RESERVED0[26]; +} stc_dvp_str_bit_t; + +typedef struct +{ + __IO uint32_t FSIEN; + __IO uint32_t LSIEN; + __IO uint32_t LEIEN; + __IO uint32_t FEIEN; + __IO uint32_t SQUERIEN; + __IO uint32_t FIFOERIEN; + uint32_t RESERVED0[26]; +} stc_dvp_ier_bit_t; + +typedef struct +{ + __IO uint32_t FAPRT0; + __IO uint32_t FAPRT1; + __IO uint32_t FAPRT2; + __IO uint32_t FAPRT3; + __IO uint32_t FAPRT4; + __IO uint32_t FAPRT5; + __IO uint32_t FAPRT6; + __IO uint32_t FAPRT7; + __IO uint32_t FAPRT8; + __IO uint32_t FAPRT9; + __IO uint32_t FAPRT10; + __IO uint32_t FAPRT11; + __IO uint32_t FAPRT12; + __IO uint32_t FAPRT13; + __IO uint32_t FAPRT14; + __IO uint32_t FAPRT15; + uint32_t RESERVED0[16]; +} stc_efm_faprt_bit_t; + +typedef struct +{ + __IO uint32_t F0STP; + __IO uint32_t F1STP; + uint32_t RESERVED0[30]; +} stc_efm_fstp_bit_t; + +typedef struct +{ + __IO uint32_t FLWT0; + __IO uint32_t FLWT1; + __IO uint32_t FLWT2; + __IO uint32_t FLWT3; + uint32_t RESERVED0[4]; + __IO uint32_t LVM; + uint32_t RESERVED1[7]; + __IO uint32_t ICACHE; + __IO uint32_t DCACHE; + __IO uint32_t PREFE; + __IO uint32_t CRST; + uint32_t RESERVED2[12]; +} stc_efm_frmc_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; + __IO uint32_t BUSHLDCTL; + uint32_t RESERVED1[7]; + __IO uint32_t KEY1LOCK; + __IO uint32_t KEY2LOCK; + uint32_t RESERVED2[14]; +} stc_efm_fwmc_bit_t; + +typedef struct +{ + __IO uint32_t OTPWERR0; + __IO uint32_t PRTWERR0; + __IO uint32_t PGSZERR0; + __IO uint32_t MISMTCH0; + __IO uint32_t OPTEND0; + __IO uint32_t COLERR0; + uint32_t RESERVED0[2]; + __IO uint32_t RDY0; + uint32_t RESERVED1[8]; + __IO uint32_t PRTWERR1; + __IO uint32_t PGSZERR1; + __IO uint32_t MISMTCH1; + __IO uint32_t OPTEND1; + __IO uint32_t COLERR1; + uint32_t RESERVED2[2]; + __IO uint32_t RDY1; + uint32_t RESERVED3[7]; +} stc_efm_fsr_bit_t; + +typedef struct +{ + __IO uint32_t OTPWERRCLR0; + __IO uint32_t PRTWERRCLR0; + __IO uint32_t PGSZERRCLR0; + __IO uint32_t MISMTCHCLR0; + __IO uint32_t OPTENDCLR0; + __IO uint32_t COLERRCLR0; + uint32_t RESERVED0[11]; + __IO uint32_t PRTWERRCLR1; + __IO uint32_t PGSZERRCLR1; + __IO uint32_t MISMTCHCLR1; + __IO uint32_t OPTENDCLR1; + __IO uint32_t COLERRCLR1; + uint32_t RESERVED1[10]; +} stc_efm_fsclr_bit_t; + +typedef struct +{ + __IO uint32_t PEERRITE; + __IO uint32_t OPTENDITE; + __IO uint32_t COLERRITE; + uint32_t RESERVED0[29]; +} stc_efm_fite_bit_t; + +typedef struct +{ + __IO uint32_t FSWP; + uint32_t RESERVED0[31]; +} stc_efm_fswp_bit_t; + +typedef struct +{ + uint32_t RESERVED0[31]; + __IO uint32_t EN0; +} stc_mmf_remcr0_bit_t; + +typedef struct +{ + uint32_t RESERVED0[31]; + __IO uint32_t EN1; +} stc_mmf_remcr1_bit_t; + +typedef struct +{ + __IO uint32_t WLOCK0; + __IO uint32_t WLOCK1; + __IO uint32_t WLOCK2; + __IO uint32_t WLOCK3; + __IO uint32_t WLOCK4; + __IO uint32_t WLOCK5; + __IO uint32_t WLOCK6; + __IO uint32_t WLOCK7; + uint32_t RESERVED0[24]; +} stc_efm_wlock_bit_t; + +typedef struct +{ + __IO uint32_t CMPEN0; + __IO uint32_t CMPEN1; + __IO uint32_t CMPEN2; + __IO uint32_t CMPEN3; + __IO uint32_t OSCSTPEN; + __IO uint32_t PWMSEN0; + __IO uint32_t PWMSEN1; + __IO uint32_t PWMSEN2; + __IO uint32_t PWMSEN3; + __IO uint32_t PWMSEN4; + __IO uint32_t PWMSEN5; + __IO uint32_t PWMSEN6; + __IO uint32_t PWMSEN7; + uint32_t RESERVED0[3]; + __IO uint32_t PORTINEN1; + __IO uint32_t PORTINEN2; + __IO uint32_t PORTINEN3; + __IO uint32_t PORTINEN4; + uint32_t RESERVED1[2]; + __IO uint32_t INVSEL1; + __IO uint32_t INVSEL2; + __IO uint32_t INVSEL3; + __IO uint32_t INVSEL4; + uint32_t RESERVED2[6]; +} stc_emb_ctl1_bit_t; + +typedef struct +{ + __IO uint32_t PWMLV0; + __IO uint32_t PWMLV1; + __IO uint32_t PWMLV2; + __IO uint32_t PWMLV3; + __IO uint32_t PWMLV4; + __IO uint32_t PWMLV5; + __IO uint32_t PWMLV6; + __IO uint32_t PWMLV7; + uint32_t RESERVED0[8]; + __IO uint32_t NFSEL10; + __IO uint32_t NFSEL11; + __IO uint32_t NFEN1; + __IO uint32_t NFSEL20; + __IO uint32_t NFSEL21; + __IO uint32_t NFEN2; + __IO uint32_t NFSEL30; + __IO uint32_t NFSEL31; + __IO uint32_t NFEN3; + __IO uint32_t NFSEL40; + __IO uint32_t NFSEL41; + __IO uint32_t NFEN4; + uint32_t RESERVED1[4]; +} stc_emb_ctl2_bit_t; + +typedef struct +{ + __IO uint32_t SOE; + uint32_t RESERVED0[31]; +} stc_emb_soe_bit_t; + +typedef struct +{ + uint32_t RESERVED0[1]; + __IO uint32_t PWMSF; + __IO uint32_t CMPF; + __IO uint32_t OSF; + uint32_t RESERVED1[1]; + __IO uint32_t PWMST; + __IO uint32_t CMPST; + __IO uint32_t OSST; + __IO uint32_t PORTINF1; + __IO uint32_t PORTINF2; + __IO uint32_t PORTINF3; + __IO uint32_t PORTINF4; + uint32_t RESERVED2[2]; + __IO uint32_t PORTINST1; + __IO uint32_t PORTINST2; + __IO uint32_t PORTINST3; + __IO uint32_t PORTINST4; + uint32_t RESERVED3[14]; +} stc_emb_stat_bit_t; + +typedef struct +{ + uint32_t RESERVED0[1]; + __IO uint32_t PWMSFCLR; + __IO uint32_t CMPFCLR; + __IO uint32_t OSFCLR; + uint32_t RESERVED1[4]; + __IO uint32_t PORTINFCLR1; + __IO uint32_t PORTINFCLR2; + __IO uint32_t PORTINFCLR3; + __IO uint32_t PORTINFCLR4; + uint32_t RESERVED2[20]; +} stc_emb_statclr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[1]; + __IO uint32_t PWMSINTEN; + __IO uint32_t CMPINTEN; + __IO uint32_t OSINTEN; + uint32_t RESERVED1[4]; + __IO uint32_t PORTINTEN1; + __IO uint32_t PORTINTEN2; + __IO uint32_t PORTINTEN3; + __IO uint32_t PORTINTEN4; + uint32_t RESERVED2[20]; +} stc_emb_inten_bit_t; + +typedef struct +{ + uint32_t RESERVED0[1]; + __IO uint32_t PWMRSEL; + __IO uint32_t CMPRSEL; + __IO uint32_t OSRSEL; + uint32_t RESERVED1[4]; + __IO uint32_t PORTINRSEL1; + __IO uint32_t PORTINRSEL2; + __IO uint32_t PORTINRSEL3; + __IO uint32_t PORTINRSEL4; + uint32_t RESERVED2[20]; +} stc_emb_rlssel_bit_t; + +typedef struct +{ + __IO uint32_t IFSEL; + uint32_t RESERVED0[3]; + __IO uint32_t RCKINV; + __IO uint32_t TCKINV; + uint32_t RESERVED1[26]; +} stc_eth_mac_ifconfr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[2]; + __IO uint32_t RE; + __IO uint32_t TE; + __IO uint32_t DC; + __IO uint32_t BL0; + __IO uint32_t BL1; + __IO uint32_t ACS; + uint32_t RESERVED1[1]; + __IO uint32_t DRTY; + __IO uint32_t IPCO; + __IO uint32_t DM; + __IO uint32_t LM; + __IO uint32_t DO; + __IO uint32_t FES; + uint32_t RESERVED2[1]; + __IO uint32_t DCRS; + __IO uint32_t IFG0; + __IO uint32_t IFG1; + __IO uint32_t IFG2; + uint32_t RESERVED3[2]; + __IO uint32_t MJB; + __IO uint32_t MWD; + uint32_t RESERVED4[1]; + __IO uint32_t CST; + uint32_t RESERVED5[2]; + __IO uint32_t SAIRC0; + __IO uint32_t SAIRC1; + __IO uint32_t SAIRC2; + uint32_t RESERVED6[1]; +} stc_eth_mac_configr_bit_t; + +typedef struct +{ + __IO uint32_t PR; + __IO uint32_t HUC; + __IO uint32_t HMC; + __IO uint32_t DAIF; + __IO uint32_t PMF; + __IO uint32_t DBF; + __IO uint32_t PCF0; + __IO uint32_t PCF1; + __IO uint32_t SAIF; + __IO uint32_t SAF; + __IO uint32_t HPF; + uint32_t RESERVED0[5]; + __IO uint32_t VTFE; + uint32_t RESERVED1[3]; + __IO uint32_t IPFE; + __IO uint32_t DNTU; + uint32_t RESERVED2[9]; + __IO uint32_t RA; +} stc_eth_mac_fltctlr_bit_t; + +typedef struct +{ + __IO uint32_t SMIB; + __IO uint32_t SMIW; + __IO uint32_t SMIC0; + __IO uint32_t SMIC1; + __IO uint32_t SMIC2; + __IO uint32_t SMIC3; + __IO uint32_t SMIR0; + __IO uint32_t SMIR1; + __IO uint32_t SMIR2; + __IO uint32_t SMIR3; + __IO uint32_t SMIR4; + __IO uint32_t SMIA0; + __IO uint32_t SMIA1; + __IO uint32_t SMIA2; + __IO uint32_t SMIA3; + __IO uint32_t SMIA4; + uint32_t RESERVED0[16]; +} stc_eth_mac_smiaddr_bit_t; + +typedef struct +{ + __IO uint32_t FCA_BPA; + __IO uint32_t TFE; + __IO uint32_t RFE; + __IO uint32_t UNP; + __IO uint32_t PLT0; + __IO uint32_t PLT1; + uint32_t RESERVED0[1]; + __IO uint32_t DZPQ; + uint32_t RESERVED1[24]; +} stc_eth_mac_floctlr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[16]; + __IO uint32_t VTAL; + __IO uint32_t VTIM; + uint32_t RESERVED1[1]; + __IO uint32_t VTHM; + uint32_t RESERVED2[12]; +} stc_eth_mac_vtafltr_bit_t; + +typedef struct +{ + __IO uint32_t MREA; + __IO uint32_t MRS0; + __IO uint32_t MRS1; + uint32_t RESERVED0[1]; + __IO uint32_t RFWA; + __IO uint32_t RFRS0; + __IO uint32_t RFRS1; + uint32_t RESERVED1[1]; + __IO uint32_t RFFL0; + __IO uint32_t RFFL1; + uint32_t RESERVED2[6]; + __IO uint32_t MTEA; + __IO uint32_t MTS0; + __IO uint32_t MTS1; + __IO uint32_t MTP; + __IO uint32_t TFRS0; + __IO uint32_t TFRS1; + __IO uint32_t TFWA; + uint32_t RESERVED3[1]; + __IO uint32_t TFNE; + __IO uint32_t TFF; + uint32_t RESERVED4[6]; +} stc_eth_mac_macstsr_bit_t; + +typedef struct +{ + __IO uint32_t PWDN; + __IO uint32_t MPEN; + __IO uint32_t WKEN; + uint32_t RESERVED0[2]; + __IO uint32_t MPFR; + __IO uint32_t WKFR; + uint32_t RESERVED1[2]; + __IO uint32_t GLUB; + __IO uint32_t RTWKTR; + uint32_t RESERVED2[13]; + __IO uint32_t RTWKPT0; + __IO uint32_t RTWKPT1; + __IO uint32_t RTWKPT2; + uint32_t RESERVED3[4]; + __IO uint32_t RTWKFR; +} stc_eth_mac_pmtctlr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[3]; + __IO uint32_t PMTIS; + __IO uint32_t MMCIS; + __IO uint32_t MMCRXIS; + __IO uint32_t MMCTXIS; + uint32_t RESERVED1[2]; + __IO uint32_t TSPIS; + uint32_t RESERVED2[22]; +} stc_eth_mac_intstsr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[3]; + __IO uint32_t PMTIM; + uint32_t RESERVED1[5]; + __IO uint32_t TSPIM; + uint32_t RESERVED2[22]; +} stc_eth_mac_intmskr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[31]; + __IO uint32_t AE0; +} stc_eth_mac_macadhr0_bit_t; + +typedef struct +{ + uint32_t RESERVED0[24]; + __IO uint32_t MBC10; + __IO uint32_t MBC11; + __IO uint32_t MBC12; + __IO uint32_t MBC13; + __IO uint32_t MBC14; + __IO uint32_t MBC15; + __IO uint32_t SA1; + __IO uint32_t AE1; +} stc_eth_mac_macadhr1_bit_t; + +typedef struct +{ + uint32_t RESERVED0[24]; + __IO uint32_t MBC20; + __IO uint32_t MBC21; + __IO uint32_t MBC22; + __IO uint32_t MBC23; + __IO uint32_t MBC24; + __IO uint32_t MBC25; + __IO uint32_t SA2; + __IO uint32_t AE2; +} stc_eth_mac_macadhr2_bit_t; + +typedef struct +{ + uint32_t RESERVED0[24]; + __IO uint32_t MBC30; + __IO uint32_t MBC31; + __IO uint32_t MBC32; + __IO uint32_t MBC33; + __IO uint32_t MBC34; + __IO uint32_t MBC35; + __IO uint32_t SA3; + __IO uint32_t AE3; +} stc_eth_mac_macadhr3_bit_t; + +typedef struct +{ + uint32_t RESERVED0[24]; + __IO uint32_t MBC40; + __IO uint32_t MBC41; + __IO uint32_t MBC42; + __IO uint32_t MBC43; + __IO uint32_t MBC44; + __IO uint32_t MBC45; + __IO uint32_t SA4; + __IO uint32_t AE4; +} stc_eth_mac_macadhr4_bit_t; + +typedef struct +{ + __IO uint32_t CRST; + __IO uint32_t COS; + __IO uint32_t ROR; + __IO uint32_t MCF; + __IO uint32_t MCPSET; + __IO uint32_t MCPSEL; + uint32_t RESERVED0[26]; +} stc_eth_mmc_mmcctlr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[3]; + __IO uint32_t RXBGIS; + __IO uint32_t RXMGIS; + __IO uint32_t RXCEIS; + __IO uint32_t RXAEIS; + __IO uint32_t RXREIS; + uint32_t RESERVED1[9]; + __IO uint32_t RXUGIS; + __IO uint32_t RXLEIS; + __IO uint32_t RXOEIS; + uint32_t RESERVED2[12]; +} stc_eth_mmc_revstsr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[2]; + __IO uint32_t TXBGIS; + __IO uint32_t TXMGIS; + uint32_t RESERVED1[12]; + __IO uint32_t TXDEEIS; + __IO uint32_t TXLCEIS; + __IO uint32_t TXECEIS; + __IO uint32_t TXCAEIS; + uint32_t RESERVED2[1]; + __IO uint32_t TXUGIS; + __IO uint32_t TXEDEIS; + uint32_t RESERVED3[9]; +} stc_eth_mmc_trsstsr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[3]; + __IO uint32_t RXBGIM; + __IO uint32_t RXMGIM; + __IO uint32_t RXCEIM; + __IO uint32_t RXAEIM; + __IO uint32_t RXREIM; + uint32_t RESERVED1[9]; + __IO uint32_t RXUGIM; + __IO uint32_t RXLEIM; + __IO uint32_t RXOEIM; + uint32_t RESERVED2[12]; +} stc_eth_mmc_ritctlr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[2]; + __IO uint32_t TXBGIM; + __IO uint32_t TXMGIM; + uint32_t RESERVED1[12]; + __IO uint32_t TXDEEIM; + __IO uint32_t TXLCEIM; + __IO uint32_t TXECEIM; + __IO uint32_t TXCAEIM; + uint32_t RESERVED2[1]; + __IO uint32_t TXUGIM; + __IO uint32_t TXEDEIM; + uint32_t RESERVED3[9]; +} stc_eth_mmc_titctlr_bit_t; + +typedef struct +{ + __IO uint32_t L3PEN; + uint32_t RESERVED0[1]; + __IO uint32_t L3SAM; + __IO uint32_t L3SAIM; + __IO uint32_t L3DAM; + __IO uint32_t L3DAIM; + __IO uint32_t L3HSBM0; + __IO uint32_t L3HSBM1; + __IO uint32_t L3HSBM2; + __IO uint32_t L3HSBM3; + __IO uint32_t L3HSBM4; + __IO uint32_t L3HDBM0; + __IO uint32_t L3HDBM1; + __IO uint32_t L3HDBM2; + __IO uint32_t L3HDBM3; + __IO uint32_t L3HDBM4; + __IO uint32_t L4PEN; + uint32_t RESERVED1[1]; + __IO uint32_t L4SPM; + __IO uint32_t L4SPIM; + __IO uint32_t L4DPM; + __IO uint32_t L4DPIM; + uint32_t RESERVED2[10]; +} stc_eth_mac_l34ctlr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[16]; + __IO uint32_t VLANC0; + __IO uint32_t VLANC1; + __IO uint32_t VLANS; + uint32_t RESERVED1[13]; +} stc_eth_mac_vtactlr_bit_t; + +typedef struct +{ + __IO uint32_t TSPEN; + __IO uint32_t TSPUPSEL; + __IO uint32_t TSPINI; + __IO uint32_t TSPUP; + __IO uint32_t TSPINT; + __IO uint32_t TSPADUP; + uint32_t RESERVED0[2]; + __IO uint32_t TSPEALL; + __IO uint32_t TSPSSR; + __IO uint32_t TSPVER; + __IO uint32_t TSPOVETH; + __IO uint32_t TSPOVIPV6; + __IO uint32_t TSPOVIPV4; + __IO uint32_t TSPMTSEL0; + __IO uint32_t TSPMTSEL1; + __IO uint32_t TSPMTSEL2; + __IO uint32_t TSPMTSEL3; + __IO uint32_t TSPADF; + uint32_t RESERVED1[13]; +} stc_eth_ptp_tspctlr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[31]; + __IO uint32_t TSPUPNS; +} stc_eth_ptp_tmunser_bit_t; + +typedef struct +{ + __IO uint32_t TSOVF; + __IO uint32_t TSTAR0; + uint32_t RESERVED0[1]; + __IO uint32_t TSERR0; + __IO uint32_t TSTAR1; + __IO uint32_t TSERR1; + uint32_t RESERVED1[26]; +} stc_eth_ptp_tspstsr_bit_t; + +typedef struct +{ + __IO uint32_t PPSFRE00; + __IO uint32_t PPSFRE01; + __IO uint32_t PPSFRE02; + __IO uint32_t PPSFRE03; + __IO uint32_t PPSOMD; + __IO uint32_t TT0SEL0; + __IO uint32_t TT0SEL1; + uint32_t RESERVED0[1]; + __IO uint32_t PPSFRE10; + __IO uint32_t PPSFRE11; + __IO uint32_t PPSFRE12; + uint32_t RESERVED1[2]; + __IO uint32_t TT1SEL0; + __IO uint32_t TT1SEL1; + uint32_t RESERVED2[17]; +} stc_eth_ptp_ppsctlr_bit_t; + +typedef struct +{ + __IO uint32_t SWR; + __IO uint32_t DMAA; + __IO uint32_t DSL0; + __IO uint32_t DSL1; + __IO uint32_t DSL2; + __IO uint32_t DSL3; + __IO uint32_t DSL4; + __IO uint32_t DSEN; + __IO uint32_t TPBL0; + __IO uint32_t TPBL1; + __IO uint32_t TPBL2; + __IO uint32_t TPBL3; + __IO uint32_t TPBL4; + __IO uint32_t TPBL5; + __IO uint32_t PRAT0; + __IO uint32_t PRAT1; + __IO uint32_t FBST; + __IO uint32_t RPBL0; + __IO uint32_t RPBL1; + __IO uint32_t RPBL2; + __IO uint32_t RPBL3; + __IO uint32_t RPBL4; + __IO uint32_t RPBL5; + __IO uint32_t SPBL; + __IO uint32_t M8PBL; + __IO uint32_t AAL; + __IO uint32_t MBST; + __IO uint32_t TXPR; + uint32_t RESERVED0[4]; +} stc_eth_dma_busmodr_bit_t; + +typedef struct +{ + __IO uint32_t TIS; + __IO uint32_t TSS; + __IO uint32_t TUS; + __IO uint32_t TJS; + __IO uint32_t OVS; + __IO uint32_t UNS; + __IO uint32_t RIS; + __IO uint32_t RUS; + __IO uint32_t RSS; + __IO uint32_t RWS; + __IO uint32_t ETS; + uint32_t RESERVED0[2]; + __IO uint32_t FBS; + __IO uint32_t ERS; + __IO uint32_t AIS; + __IO uint32_t NIS; + __IO uint32_t RSTS0; + __IO uint32_t RSTS1; + __IO uint32_t RSTS2; + __IO uint32_t TSTS0; + __IO uint32_t TSTS1; + __IO uint32_t TSTS2; + __IO uint32_t EBUS0; + __IO uint32_t EBUS1; + __IO uint32_t EBUS2; + uint32_t RESERVED1[1]; + __IO uint32_t MMCS; + __IO uint32_t PMTS; + __IO uint32_t PTPS; + uint32_t RESERVED2[2]; +} stc_eth_dma_dmastsr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[1]; + __IO uint32_t STR; + __IO uint32_t OSF; + __IO uint32_t RTC0; + __IO uint32_t RTC1; + __IO uint32_t DGF; + __IO uint32_t FUF; + __IO uint32_t FEF; + uint32_t RESERVED1[5]; + __IO uint32_t STT; + __IO uint32_t TTC0; + __IO uint32_t TTC1; + __IO uint32_t TTC2; + uint32_t RESERVED2[3]; + __IO uint32_t FTF; + __IO uint32_t TSF; + uint32_t RESERVED3[2]; + __IO uint32_t DFRF; + __IO uint32_t RSF; + __IO uint32_t DTCOE; + uint32_t RESERVED4[5]; +} stc_eth_dma_oprmodr_bit_t; + +typedef struct +{ + __IO uint32_t TIE; + __IO uint32_t TSE; + __IO uint32_t TUE; + __IO uint32_t TJE; + __IO uint32_t OVE; + __IO uint32_t UNE; + __IO uint32_t RIE; + __IO uint32_t RUE; + __IO uint32_t RSE; + __IO uint32_t RWE; + __IO uint32_t ETE; + uint32_t RESERVED0[2]; + __IO uint32_t FBE; + __IO uint32_t ERE; + __IO uint32_t AIE; + __IO uint32_t NIE; + uint32_t RESERVED1[15]; +} stc_eth_dma_intenar_bit_t; + +typedef struct +{ + uint32_t RESERVED0[16]; + __IO uint32_t UNAOVF; + uint32_t RESERVED1[11]; + __IO uint32_t OVFOVF; + uint32_t RESERVED2[3]; +} stc_eth_dma_rfrcntr_bit_t; + +typedef struct +{ + __IO uint32_t START; + uint32_t RESERVED0[31]; +} stc_fcm_str_bit_t; + +typedef struct +{ + uint32_t RESERVED0[7]; + __IO uint32_t INEXS; + __IO uint32_t DNFS0; + __IO uint32_t DNFS1; + uint32_t RESERVED1[2]; + __IO uint32_t EDGES0; + __IO uint32_t EDGES1; + uint32_t RESERVED2[1]; + __IO uint32_t EXREFE; + uint32_t RESERVED3[16]; +} stc_fcm_rccr_bit_t; + +typedef struct +{ + __IO uint32_t ERRIE; + __IO uint32_t MENDIE; + __IO uint32_t OVFIE; + uint32_t RESERVED0[1]; + __IO uint32_t ERRINTRS; + uint32_t RESERVED1[2]; + __IO uint32_t ERRE; + uint32_t RESERVED2[24]; +} stc_fcm_rier_bit_t; + +typedef struct +{ + __IO uint32_t ERRF; + __IO uint32_t MENDF; + __IO uint32_t OVF; + uint32_t RESERVED0[29]; +} stc_fcm_sr_bit_t; + +typedef struct +{ + __IO uint32_t ERRFCLR; + __IO uint32_t MENDFCLR; + __IO uint32_t OVFCLR; + uint32_t RESERVED0[29]; +} stc_fcm_clr_bit_t; + +typedef struct +{ + __IO uint32_t FMACEN; + uint32_t RESERVED0[31]; +} stc_fmac_enr_bit_t; + +typedef struct +{ + __IO uint32_t INTEN; + uint32_t RESERVED0[31]; +} stc_fmac_ier_bit_t; + +typedef struct +{ + uint32_t RESERVED0[31]; + __IO uint32_t READY; +} stc_fmac_str_bit_t; + +typedef struct +{ + __IO uint32_t PIN00; + __IO uint32_t PIN01; + __IO uint32_t PIN02; + __IO uint32_t PIN03; + __IO uint32_t PIN04; + __IO uint32_t PIN05; + __IO uint32_t PIN06; + __IO uint32_t PIN07; + __IO uint32_t PIN08; + __IO uint32_t PIN09; + __IO uint32_t PIN10; + __IO uint32_t PIN11; + __IO uint32_t PIN12; + __IO uint32_t PIN13; + __IO uint32_t PIN14; + __IO uint32_t PIN15; +} stc_gpio_pidra_bit_t; + +typedef struct +{ + __IO uint32_t POUT00; + __IO uint32_t POUT01; + __IO uint32_t POUT02; + __IO uint32_t POUT03; + __IO uint32_t POUT04; + __IO uint32_t POUT05; + __IO uint32_t POUT06; + __IO uint32_t POUT07; + __IO uint32_t POUT08; + __IO uint32_t POUT09; + __IO uint32_t POUT10; + __IO uint32_t POUT11; + __IO uint32_t POUT12; + __IO uint32_t POUT13; + __IO uint32_t POUT14; + __IO uint32_t POUT15; +} stc_gpio_podra_bit_t; + +typedef struct +{ + __IO uint32_t POUTE00; + __IO uint32_t POUTE01; + __IO uint32_t POUTE02; + __IO uint32_t POUTE03; + __IO uint32_t POUTE04; + __IO uint32_t POUTE05; + __IO uint32_t POUTE06; + __IO uint32_t POUTE07; + __IO uint32_t POUTE08; + __IO uint32_t POUTE09; + __IO uint32_t POUTE10; + __IO uint32_t POUTE11; + __IO uint32_t POUTE12; + __IO uint32_t POUTE13; + __IO uint32_t POUTE14; + __IO uint32_t POUTE15; +} stc_gpio_poera_bit_t; + +typedef struct +{ + __IO uint32_t POS00; + __IO uint32_t POS01; + __IO uint32_t POS02; + __IO uint32_t POS03; + __IO uint32_t POS04; + __IO uint32_t POS05; + __IO uint32_t POS06; + __IO uint32_t POS07; + __IO uint32_t POS08; + __IO uint32_t POS09; + __IO uint32_t POS10; + __IO uint32_t POS11; + __IO uint32_t POS12; + __IO uint32_t POS13; + __IO uint32_t POS14; + __IO uint32_t POS15; +} stc_gpio_posra_bit_t; + +typedef struct +{ + __IO uint32_t POR00; + __IO uint32_t POR01; + __IO uint32_t POR02; + __IO uint32_t POR03; + __IO uint32_t POR04; + __IO uint32_t POR05; + __IO uint32_t POR06; + __IO uint32_t POR07; + __IO uint32_t POR08; + __IO uint32_t POR09; + __IO uint32_t POR10; + __IO uint32_t POR11; + __IO uint32_t POR12; + __IO uint32_t POR13; + __IO uint32_t POR14; + __IO uint32_t POR15; +} stc_gpio_porra_bit_t; + +typedef struct +{ + __IO uint32_t POT00; + __IO uint32_t POT01; + __IO uint32_t POT02; + __IO uint32_t POT03; + __IO uint32_t POT04; + __IO uint32_t POT05; + __IO uint32_t POT06; + __IO uint32_t POT07; + __IO uint32_t POT08; + __IO uint32_t POT09; + __IO uint32_t POT10; + __IO uint32_t POT11; + __IO uint32_t POT12; + __IO uint32_t POT13; + __IO uint32_t POT14; + __IO uint32_t POT15; +} stc_gpio_potra_bit_t; + +typedef struct +{ + __IO uint32_t PIN00; + __IO uint32_t PIN01; + __IO uint32_t PIN02; + __IO uint32_t PIN03; + __IO uint32_t PIN04; + __IO uint32_t PIN05; + __IO uint32_t PIN06; + __IO uint32_t PIN07; + __IO uint32_t PIN08; + __IO uint32_t PIN09; + __IO uint32_t PIN10; + __IO uint32_t PIN11; + __IO uint32_t PIN12; + __IO uint32_t PIN13; + __IO uint32_t PIN14; + __IO uint32_t PIN15; +} stc_gpio_pidrb_bit_t; + +typedef struct +{ + __IO uint32_t POUT00; + __IO uint32_t POUT01; + __IO uint32_t POUT02; + __IO uint32_t POUT03; + __IO uint32_t POUT04; + __IO uint32_t POUT05; + __IO uint32_t POUT06; + __IO uint32_t POUT07; + __IO uint32_t POUT08; + __IO uint32_t POUT09; + __IO uint32_t POUT10; + __IO uint32_t POUT11; + __IO uint32_t POUT12; + __IO uint32_t POUT13; + __IO uint32_t POUT14; + __IO uint32_t POUT15; +} stc_gpio_podrb_bit_t; + +typedef struct +{ + __IO uint32_t POUTE00; + __IO uint32_t POUTE01; + __IO uint32_t POUTE02; + __IO uint32_t POUTE03; + __IO uint32_t POUTE04; + __IO uint32_t POUTE05; + __IO uint32_t POUTE06; + __IO uint32_t POUTE07; + __IO uint32_t POUTE08; + __IO uint32_t POUTE09; + __IO uint32_t POUTE10; + __IO uint32_t POUTE11; + __IO uint32_t POUTE12; + __IO uint32_t POUTE13; + __IO uint32_t POUTE14; + __IO uint32_t POUTE15; +} stc_gpio_poerb_bit_t; + +typedef struct +{ + __IO uint32_t POS00; + __IO uint32_t POS01; + __IO uint32_t POS02; + __IO uint32_t POS03; + __IO uint32_t POS04; + __IO uint32_t POS05; + __IO uint32_t POS06; + __IO uint32_t POS07; + __IO uint32_t POS08; + __IO uint32_t POS09; + __IO uint32_t POS10; + __IO uint32_t POS11; + __IO uint32_t POS12; + __IO uint32_t POS13; + __IO uint32_t POS14; + __IO uint32_t POS15; +} stc_gpio_posrb_bit_t; + +typedef struct +{ + __IO uint32_t POR00; + __IO uint32_t POR01; + __IO uint32_t POR02; + __IO uint32_t POR03; + __IO uint32_t POR04; + __IO uint32_t POR05; + __IO uint32_t POR06; + __IO uint32_t POR07; + __IO uint32_t POR08; + __IO uint32_t POR09; + __IO uint32_t POR10; + __IO uint32_t POR11; + __IO uint32_t POR12; + __IO uint32_t POR13; + __IO uint32_t POR14; + __IO uint32_t POR15; +} stc_gpio_porrb_bit_t; + +typedef struct +{ + __IO uint32_t POT00; + __IO uint32_t POT01; + __IO uint32_t POT02; + __IO uint32_t POT03; + __IO uint32_t POT04; + __IO uint32_t POT05; + __IO uint32_t POT06; + __IO uint32_t POT07; + __IO uint32_t POT08; + __IO uint32_t POT09; + __IO uint32_t POT10; + __IO uint32_t POT11; + __IO uint32_t POT12; + __IO uint32_t POT13; + __IO uint32_t POT14; + __IO uint32_t POT15; +} stc_gpio_potrb_bit_t; + +typedef struct +{ + __IO uint32_t PIN00; + __IO uint32_t PIN01; + __IO uint32_t PIN02; + __IO uint32_t PIN03; + __IO uint32_t PIN04; + __IO uint32_t PIN05; + __IO uint32_t PIN06; + __IO uint32_t PIN07; + __IO uint32_t PIN08; + __IO uint32_t PIN09; + __IO uint32_t PIN10; + __IO uint32_t PIN11; + __IO uint32_t PIN12; + __IO uint32_t PIN13; + __IO uint32_t PIN14; + __IO uint32_t PIN15; +} stc_gpio_pidrc_bit_t; + +typedef struct +{ + __IO uint32_t POUT00; + __IO uint32_t POUT01; + __IO uint32_t POUT02; + __IO uint32_t POUT03; + __IO uint32_t POUT04; + __IO uint32_t POUT05; + __IO uint32_t POUT06; + __IO uint32_t POUT07; + __IO uint32_t POUT08; + __IO uint32_t POUT09; + __IO uint32_t POUT10; + __IO uint32_t POUT11; + __IO uint32_t POUT12; + __IO uint32_t POUT13; + __IO uint32_t POUT14; + __IO uint32_t POUT15; +} stc_gpio_podrc_bit_t; + +typedef struct +{ + __IO uint32_t POUTE00; + __IO uint32_t POUTE01; + __IO uint32_t POUTE02; + __IO uint32_t POUTE03; + __IO uint32_t POUTE04; + __IO uint32_t POUTE05; + __IO uint32_t POUTE06; + __IO uint32_t POUTE07; + __IO uint32_t POUTE08; + __IO uint32_t POUTE09; + __IO uint32_t POUTE10; + __IO uint32_t POUTE11; + __IO uint32_t POUTE12; + __IO uint32_t POUTE13; + __IO uint32_t POUTE14; + __IO uint32_t POUTE15; +} stc_gpio_poerc_bit_t; + +typedef struct +{ + __IO uint32_t POS00; + __IO uint32_t POS01; + __IO uint32_t POS02; + __IO uint32_t POS03; + __IO uint32_t POS04; + __IO uint32_t POS05; + __IO uint32_t POS06; + __IO uint32_t POS07; + __IO uint32_t POS08; + __IO uint32_t POS09; + __IO uint32_t POS10; + __IO uint32_t POS11; + __IO uint32_t POS12; + __IO uint32_t POS13; + __IO uint32_t POS14; + __IO uint32_t POS15; +} stc_gpio_posrc_bit_t; + +typedef struct +{ + __IO uint32_t POR00; + __IO uint32_t POR01; + __IO uint32_t POR02; + __IO uint32_t POR03; + __IO uint32_t POR04; + __IO uint32_t POR05; + __IO uint32_t POR06; + __IO uint32_t POR07; + __IO uint32_t POR08; + __IO uint32_t POR09; + __IO uint32_t POR10; + __IO uint32_t POR11; + __IO uint32_t POR12; + __IO uint32_t POR13; + __IO uint32_t POR14; + __IO uint32_t POR15; +} stc_gpio_porrc_bit_t; + +typedef struct +{ + __IO uint32_t POT00; + __IO uint32_t POT01; + __IO uint32_t POT02; + __IO uint32_t POT03; + __IO uint32_t POT04; + __IO uint32_t POT05; + __IO uint32_t POT06; + __IO uint32_t POT07; + __IO uint32_t POT08; + __IO uint32_t POT09; + __IO uint32_t POT10; + __IO uint32_t POT11; + __IO uint32_t POT12; + __IO uint32_t POT13; + __IO uint32_t POT14; + __IO uint32_t POT15; +} stc_gpio_potrc_bit_t; + +typedef struct +{ + __IO uint32_t PIN00; + __IO uint32_t PIN01; + __IO uint32_t PIN02; + __IO uint32_t PIN03; + __IO uint32_t PIN04; + __IO uint32_t PIN05; + __IO uint32_t PIN06; + __IO uint32_t PIN07; + __IO uint32_t PIN08; + __IO uint32_t PIN09; + __IO uint32_t PIN10; + __IO uint32_t PIN11; + __IO uint32_t PIN12; + __IO uint32_t PIN13; + __IO uint32_t PIN14; + __IO uint32_t PIN15; +} stc_gpio_pidrd_bit_t; + +typedef struct +{ + __IO uint32_t POUT00; + __IO uint32_t POUT01; + __IO uint32_t POUT02; + __IO uint32_t POUT03; + __IO uint32_t POUT04; + __IO uint32_t POUT05; + __IO uint32_t POUT06; + __IO uint32_t POUT07; + __IO uint32_t POUT08; + __IO uint32_t POUT09; + __IO uint32_t POUT10; + __IO uint32_t POUT11; + __IO uint32_t POUT12; + __IO uint32_t POUT13; + __IO uint32_t POUT14; + __IO uint32_t POUT15; +} stc_gpio_podrd_bit_t; + +typedef struct +{ + __IO uint32_t POUTE00; + __IO uint32_t POUTE01; + __IO uint32_t POUTE02; + __IO uint32_t POUTE03; + __IO uint32_t POUTE04; + __IO uint32_t POUTE05; + __IO uint32_t POUTE06; + __IO uint32_t POUTE07; + __IO uint32_t POUTE08; + __IO uint32_t POUTE09; + __IO uint32_t POUTE10; + __IO uint32_t POUTE11; + __IO uint32_t POUTE12; + __IO uint32_t POUTE13; + __IO uint32_t POUTE14; + __IO uint32_t POUTE15; +} stc_gpio_poerd_bit_t; + +typedef struct +{ + __IO uint32_t POS00; + __IO uint32_t POS01; + __IO uint32_t POS02; + __IO uint32_t POS03; + __IO uint32_t POS04; + __IO uint32_t POS05; + __IO uint32_t POS06; + __IO uint32_t POS07; + __IO uint32_t POS08; + __IO uint32_t POS09; + __IO uint32_t POS10; + __IO uint32_t POS11; + __IO uint32_t POS12; + __IO uint32_t POS13; + __IO uint32_t POS14; + __IO uint32_t POS15; +} stc_gpio_posrd_bit_t; + +typedef struct +{ + __IO uint32_t POR00; + __IO uint32_t POR01; + __IO uint32_t POR02; + __IO uint32_t POR03; + __IO uint32_t POR04; + __IO uint32_t POR05; + __IO uint32_t POR06; + __IO uint32_t POR07; + __IO uint32_t POR08; + __IO uint32_t POR09; + __IO uint32_t POR10; + __IO uint32_t POR11; + __IO uint32_t POR12; + __IO uint32_t POR13; + __IO uint32_t POR14; + __IO uint32_t POR15; +} stc_gpio_porrd_bit_t; + +typedef struct +{ + __IO uint32_t POT00; + __IO uint32_t POT01; + __IO uint32_t POT02; + __IO uint32_t POT03; + __IO uint32_t POT04; + __IO uint32_t POT05; + __IO uint32_t POT06; + __IO uint32_t POT07; + __IO uint32_t POT08; + __IO uint32_t POT09; + __IO uint32_t POT10; + __IO uint32_t POT11; + __IO uint32_t POT12; + __IO uint32_t POT13; + __IO uint32_t POT14; + __IO uint32_t POT15; +} stc_gpio_potrd_bit_t; + +typedef struct +{ + __IO uint32_t PIN00; + __IO uint32_t PIN01; + __IO uint32_t PIN02; + __IO uint32_t PIN03; + __IO uint32_t PIN04; + __IO uint32_t PIN05; + __IO uint32_t PIN06; + __IO uint32_t PIN07; + __IO uint32_t PIN08; + __IO uint32_t PIN09; + __IO uint32_t PIN10; + __IO uint32_t PIN11; + __IO uint32_t PIN12; + __IO uint32_t PIN13; + __IO uint32_t PIN14; + __IO uint32_t PIN15; +} stc_gpio_pidre_bit_t; + +typedef struct +{ + __IO uint32_t POUT00; + __IO uint32_t POUT01; + __IO uint32_t POUT02; + __IO uint32_t POUT03; + __IO uint32_t POUT04; + __IO uint32_t POUT05; + __IO uint32_t POUT06; + __IO uint32_t POUT07; + __IO uint32_t POUT08; + __IO uint32_t POUT09; + __IO uint32_t POUT10; + __IO uint32_t POUT11; + __IO uint32_t POUT12; + __IO uint32_t POUT13; + __IO uint32_t POUT14; + __IO uint32_t POUT15; +} stc_gpio_podre_bit_t; + +typedef struct +{ + __IO uint32_t POUTE00; + __IO uint32_t POUTE01; + __IO uint32_t POUTE02; + __IO uint32_t POUTE03; + __IO uint32_t POUTE04; + __IO uint32_t POUTE05; + __IO uint32_t POUTE06; + __IO uint32_t POUTE07; + __IO uint32_t POUTE08; + __IO uint32_t POUTE09; + __IO uint32_t POUTE10; + __IO uint32_t POUTE11; + __IO uint32_t POUTE12; + __IO uint32_t POUTE13; + __IO uint32_t POUTE14; + __IO uint32_t POUTE15; +} stc_gpio_poere_bit_t; + +typedef struct +{ + __IO uint32_t POS00; + __IO uint32_t POS01; + __IO uint32_t POS02; + __IO uint32_t POS03; + __IO uint32_t POS04; + __IO uint32_t POS05; + __IO uint32_t POS06; + __IO uint32_t POS07; + __IO uint32_t POS08; + __IO uint32_t POS09; + __IO uint32_t POS10; + __IO uint32_t POS11; + __IO uint32_t POS12; + __IO uint32_t POS13; + __IO uint32_t POS14; + __IO uint32_t POS15; +} stc_gpio_posre_bit_t; + +typedef struct +{ + __IO uint32_t POR00; + __IO uint32_t POR01; + __IO uint32_t POR02; + __IO uint32_t POR03; + __IO uint32_t POR04; + __IO uint32_t POR05; + __IO uint32_t POR06; + __IO uint32_t POR07; + __IO uint32_t POR08; + __IO uint32_t POR09; + __IO uint32_t POR10; + __IO uint32_t POR11; + __IO uint32_t POR12; + __IO uint32_t POR13; + __IO uint32_t POR14; + __IO uint32_t POR15; +} stc_gpio_porre_bit_t; + +typedef struct +{ + __IO uint32_t POT00; + __IO uint32_t POT01; + __IO uint32_t POT02; + __IO uint32_t POT03; + __IO uint32_t POT04; + __IO uint32_t POT05; + __IO uint32_t POT06; + __IO uint32_t POT07; + __IO uint32_t POT08; + __IO uint32_t POT09; + __IO uint32_t POT10; + __IO uint32_t POT11; + __IO uint32_t POT12; + __IO uint32_t POT13; + __IO uint32_t POT14; + __IO uint32_t POT15; +} stc_gpio_potre_bit_t; + +typedef struct +{ + __IO uint32_t PIN00; + __IO uint32_t PIN01; + __IO uint32_t PIN02; + __IO uint32_t PIN03; + __IO uint32_t PIN04; + __IO uint32_t PIN05; + __IO uint32_t PIN06; + __IO uint32_t PIN07; + __IO uint32_t PIN08; + __IO uint32_t PIN09; + __IO uint32_t PIN10; + __IO uint32_t PIN11; + __IO uint32_t PIN12; + __IO uint32_t PIN13; + __IO uint32_t PIN14; + __IO uint32_t PIN15; +} stc_gpio_pidrf_bit_t; + +typedef struct +{ + __IO uint32_t POUT00; + __IO uint32_t POUT01; + __IO uint32_t POUT02; + __IO uint32_t POUT03; + __IO uint32_t POUT04; + __IO uint32_t POUT05; + __IO uint32_t POUT06; + __IO uint32_t POUT07; + __IO uint32_t POUT08; + __IO uint32_t POUT09; + __IO uint32_t POUT10; + __IO uint32_t POUT11; + __IO uint32_t POUT12; + __IO uint32_t POUT13; + __IO uint32_t POUT14; + __IO uint32_t POUT15; +} stc_gpio_podrf_bit_t; + +typedef struct +{ + __IO uint32_t POUTE00; + __IO uint32_t POUTE01; + __IO uint32_t POUTE02; + __IO uint32_t POUTE03; + __IO uint32_t POUTE04; + __IO uint32_t POUTE05; + __IO uint32_t POUTE06; + __IO uint32_t POUTE07; + __IO uint32_t POUTE08; + __IO uint32_t POUTE09; + __IO uint32_t POUTE10; + __IO uint32_t POUTE11; + __IO uint32_t POUTE12; + __IO uint32_t POUTE13; + __IO uint32_t POUTE14; + __IO uint32_t POUTE15; +} stc_gpio_poerf_bit_t; + +typedef struct +{ + __IO uint32_t POS00; + __IO uint32_t POS01; + __IO uint32_t POS02; + __IO uint32_t POS03; + __IO uint32_t POS04; + __IO uint32_t POS05; + __IO uint32_t POS06; + __IO uint32_t POS07; + __IO uint32_t POS08; + __IO uint32_t POS09; + __IO uint32_t POS10; + __IO uint32_t POS11; + __IO uint32_t POS12; + __IO uint32_t POS13; + __IO uint32_t POS14; + __IO uint32_t POS15; +} stc_gpio_posrf_bit_t; + +typedef struct +{ + __IO uint32_t POR00; + __IO uint32_t POR01; + __IO uint32_t POR02; + __IO uint32_t POR03; + __IO uint32_t POR04; + __IO uint32_t POR05; + __IO uint32_t POR06; + __IO uint32_t POR07; + __IO uint32_t POR08; + __IO uint32_t POR09; + __IO uint32_t POR10; + __IO uint32_t POR11; + __IO uint32_t POR12; + __IO uint32_t POR13; + __IO uint32_t POR14; + __IO uint32_t POR15; +} stc_gpio_porrf_bit_t; + +typedef struct +{ + __IO uint32_t POT00; + __IO uint32_t POT01; + __IO uint32_t POT02; + __IO uint32_t POT03; + __IO uint32_t POT04; + __IO uint32_t POT05; + __IO uint32_t POT06; + __IO uint32_t POT07; + __IO uint32_t POT08; + __IO uint32_t POT09; + __IO uint32_t POT10; + __IO uint32_t POT11; + __IO uint32_t POT12; + __IO uint32_t POT13; + __IO uint32_t POT14; + __IO uint32_t POT15; +} stc_gpio_potrf_bit_t; + +typedef struct +{ + __IO uint32_t PIN00; + __IO uint32_t PIN01; + __IO uint32_t PIN02; + __IO uint32_t PIN03; + __IO uint32_t PIN04; + __IO uint32_t PIN05; + __IO uint32_t PIN06; + __IO uint32_t PIN07; + __IO uint32_t PIN08; + __IO uint32_t PIN09; + __IO uint32_t PIN10; + __IO uint32_t PIN11; + __IO uint32_t PIN12; + __IO uint32_t PIN13; + __IO uint32_t PIN14; + __IO uint32_t PIN15; +} stc_gpio_pidrg_bit_t; + +typedef struct +{ + __IO uint32_t POUT00; + __IO uint32_t POUT01; + __IO uint32_t POUT02; + __IO uint32_t POUT03; + __IO uint32_t POUT04; + __IO uint32_t POUT05; + __IO uint32_t POUT06; + __IO uint32_t POUT07; + __IO uint32_t POUT08; + __IO uint32_t POUT09; + __IO uint32_t POUT10; + __IO uint32_t POUT11; + __IO uint32_t POUT12; + __IO uint32_t POUT13; + __IO uint32_t POUT14; + __IO uint32_t POUT15; +} stc_gpio_podrg_bit_t; + +typedef struct +{ + __IO uint32_t POUTE00; + __IO uint32_t POUTE01; + __IO uint32_t POUTE02; + __IO uint32_t POUTE03; + __IO uint32_t POUTE04; + __IO uint32_t POUTE05; + __IO uint32_t POUTE06; + __IO uint32_t POUTE07; + __IO uint32_t POUTE08; + __IO uint32_t POUTE09; + __IO uint32_t POUTE10; + __IO uint32_t POUTE11; + __IO uint32_t POUTE12; + __IO uint32_t POUTE13; + __IO uint32_t POUTE14; + __IO uint32_t POUTE15; +} stc_gpio_poerg_bit_t; + +typedef struct +{ + __IO uint32_t POS00; + __IO uint32_t POS01; + __IO uint32_t POS02; + __IO uint32_t POS03; + __IO uint32_t POS04; + __IO uint32_t POS05; + __IO uint32_t POS06; + __IO uint32_t POS07; + __IO uint32_t POS08; + __IO uint32_t POS09; + __IO uint32_t POS10; + __IO uint32_t POS11; + __IO uint32_t POS12; + __IO uint32_t POS13; + __IO uint32_t POS14; + __IO uint32_t POS15; +} stc_gpio_posrg_bit_t; + +typedef struct +{ + __IO uint32_t POR00; + __IO uint32_t POR01; + __IO uint32_t POR02; + __IO uint32_t POR03; + __IO uint32_t POR04; + __IO uint32_t POR05; + __IO uint32_t POR06; + __IO uint32_t POR07; + __IO uint32_t POR08; + __IO uint32_t POR09; + __IO uint32_t POR10; + __IO uint32_t POR11; + __IO uint32_t POR12; + __IO uint32_t POR13; + __IO uint32_t POR14; + __IO uint32_t POR15; +} stc_gpio_porrg_bit_t; + +typedef struct +{ + __IO uint32_t POT00; + __IO uint32_t POT01; + __IO uint32_t POT02; + __IO uint32_t POT03; + __IO uint32_t POT04; + __IO uint32_t POT05; + __IO uint32_t POT06; + __IO uint32_t POT07; + __IO uint32_t POT08; + __IO uint32_t POT09; + __IO uint32_t POT10; + __IO uint32_t POT11; + __IO uint32_t POT12; + __IO uint32_t POT13; + __IO uint32_t POT14; + __IO uint32_t POT15; +} stc_gpio_potrg_bit_t; + +typedef struct +{ + __IO uint32_t PIN00; + __IO uint32_t PIN01; + __IO uint32_t PIN02; + __IO uint32_t PIN03; + __IO uint32_t PIN04; + __IO uint32_t PIN05; + __IO uint32_t PIN06; + __IO uint32_t PIN07; + __IO uint32_t PIN08; + __IO uint32_t PIN09; + __IO uint32_t PIN10; + __IO uint32_t PIN11; + __IO uint32_t PIN12; + __IO uint32_t PIN13; + __IO uint32_t PIN14; + __IO uint32_t PIN15; +} stc_gpio_pidrh_bit_t; + +typedef struct +{ + __IO uint32_t POUT00; + __IO uint32_t POUT01; + __IO uint32_t POUT02; + __IO uint32_t POUT03; + __IO uint32_t POUT04; + __IO uint32_t POUT05; + __IO uint32_t POUT06; + __IO uint32_t POUT07; + __IO uint32_t POUT08; + __IO uint32_t POUT09; + __IO uint32_t POUT10; + __IO uint32_t POUT11; + __IO uint32_t POUT12; + __IO uint32_t POUT13; + __IO uint32_t POUT14; + __IO uint32_t POUT15; +} stc_gpio_podrh_bit_t; + +typedef struct +{ + __IO uint32_t POUTE00; + __IO uint32_t POUTE01; + __IO uint32_t POUTE02; + __IO uint32_t POUTE03; + __IO uint32_t POUTE04; + __IO uint32_t POUTE05; + __IO uint32_t POUTE06; + __IO uint32_t POUTE07; + __IO uint32_t POUTE08; + __IO uint32_t POUTE09; + __IO uint32_t POUTE10; + __IO uint32_t POUTE11; + __IO uint32_t POUTE12; + __IO uint32_t POUTE13; + __IO uint32_t POUTE14; + __IO uint32_t POUTE15; +} stc_gpio_poerh_bit_t; + +typedef struct +{ + __IO uint32_t POS00; + __IO uint32_t POS01; + __IO uint32_t POS02; + __IO uint32_t POS03; + __IO uint32_t POS04; + __IO uint32_t POS05; + __IO uint32_t POS06; + __IO uint32_t POS07; + __IO uint32_t POS08; + __IO uint32_t POS09; + __IO uint32_t POS10; + __IO uint32_t POS11; + __IO uint32_t POS12; + __IO uint32_t POS13; + __IO uint32_t POS14; + __IO uint32_t POS15; +} stc_gpio_posrh_bit_t; + +typedef struct +{ + __IO uint32_t POR00; + __IO uint32_t POR01; + __IO uint32_t POR02; + __IO uint32_t POR03; + __IO uint32_t POR04; + __IO uint32_t POR05; + __IO uint32_t POR06; + __IO uint32_t POR07; + __IO uint32_t POR08; + __IO uint32_t POR09; + __IO uint32_t POR10; + __IO uint32_t POR11; + __IO uint32_t POR12; + __IO uint32_t POR13; + __IO uint32_t POR14; + __IO uint32_t POR15; +} stc_gpio_porrh_bit_t; + +typedef struct +{ + __IO uint32_t POT00; + __IO uint32_t POT01; + __IO uint32_t POT02; + __IO uint32_t POT03; + __IO uint32_t POT04; + __IO uint32_t POT05; + __IO uint32_t POT06; + __IO uint32_t POT07; + __IO uint32_t POT08; + __IO uint32_t POT09; + __IO uint32_t POT10; + __IO uint32_t POT11; + __IO uint32_t POT12; + __IO uint32_t POT13; + __IO uint32_t POT14; + __IO uint32_t POT15; +} stc_gpio_potrh_bit_t; + +typedef struct +{ + __IO uint32_t PIN00; + __IO uint32_t PIN01; + __IO uint32_t PIN02; + __IO uint32_t PIN03; + __IO uint32_t PIN04; + __IO uint32_t PIN05; + __IO uint32_t PIN06; + __IO uint32_t PIN07; + __IO uint32_t PIN08; + __IO uint32_t PIN09; + __IO uint32_t PIN10; + __IO uint32_t PIN11; + __IO uint32_t PIN12; + __IO uint32_t PIN13; + uint32_t RESERVED0[2]; +} stc_gpio_pidri_bit_t; + +typedef struct +{ + __IO uint32_t POUT00; + __IO uint32_t POUT01; + __IO uint32_t POUT02; + __IO uint32_t POUT03; + __IO uint32_t POUT04; + __IO uint32_t POUT05; + __IO uint32_t POUT06; + __IO uint32_t POUT07; + __IO uint32_t POUT08; + __IO uint32_t POUT09; + __IO uint32_t POUT10; + __IO uint32_t POUT11; + __IO uint32_t POUT12; + __IO uint32_t POUT13; + uint32_t RESERVED0[2]; +} stc_gpio_podri_bit_t; + +typedef struct +{ + __IO uint32_t POUTE00; + __IO uint32_t POUTE01; + __IO uint32_t POUTE02; + __IO uint32_t POUTE03; + __IO uint32_t POUTE04; + __IO uint32_t POUTE05; + __IO uint32_t POUTE06; + __IO uint32_t POUTE07; + __IO uint32_t POUTE08; + __IO uint32_t POUTE09; + __IO uint32_t POUTE10; + __IO uint32_t POUTE11; + __IO uint32_t POUTE12; + __IO uint32_t POUTE13; + uint32_t RESERVED0[2]; +} stc_gpio_poeri_bit_t; + +typedef struct +{ + __IO uint32_t POS00; + __IO uint32_t POS01; + __IO uint32_t POS02; + __IO uint32_t POS03; + __IO uint32_t POS04; + __IO uint32_t POS05; + __IO uint32_t POS06; + __IO uint32_t POS07; + __IO uint32_t POS08; + __IO uint32_t POS09; + __IO uint32_t POS10; + __IO uint32_t POS11; + __IO uint32_t POS12; + __IO uint32_t POS13; + uint32_t RESERVED0[2]; +} stc_gpio_posri_bit_t; + +typedef struct +{ + __IO uint32_t POR00; + __IO uint32_t POR01; + __IO uint32_t POR02; + __IO uint32_t POR03; + __IO uint32_t POR04; + __IO uint32_t POR05; + __IO uint32_t POR06; + __IO uint32_t POR07; + __IO uint32_t POR08; + __IO uint32_t POR09; + __IO uint32_t POR10; + __IO uint32_t POR11; + __IO uint32_t POR12; + __IO uint32_t POR13; + uint32_t RESERVED0[2]; +} stc_gpio_porri_bit_t; + +typedef struct +{ + __IO uint32_t POT00; + __IO uint32_t POT01; + __IO uint32_t POT02; + __IO uint32_t POT03; + __IO uint32_t POT04; + __IO uint32_t POT05; + __IO uint32_t POT06; + __IO uint32_t POT07; + __IO uint32_t POT08; + __IO uint32_t POT09; + __IO uint32_t POT10; + __IO uint32_t POT11; + __IO uint32_t POT12; + __IO uint32_t POT13; + uint32_t RESERVED0[2]; +} stc_gpio_potri_bit_t; + +typedef struct +{ + __IO uint32_t SPFE0; + __IO uint32_t SPFE1; + __IO uint32_t SPFE2; + __IO uint32_t SPFE3; + __IO uint32_t SPFE4; + uint32_t RESERVED0[11]; +} stc_gpio_pspcr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[16]; +} stc_gpio_pccr_bit_t; + +typedef struct +{ + __IO uint32_t PINAE0; + __IO uint32_t PINAE1; + __IO uint32_t PINAE2; + __IO uint32_t PINAE3; + __IO uint32_t PINAE4; + __IO uint32_t PINAE5; + __IO uint32_t PINAE6; + __IO uint32_t PINAE7; + __IO uint32_t PINAE8; + uint32_t RESERVED0[7]; +} stc_gpio_pinaer_bit_t; + +typedef struct +{ + __IO uint32_t WE; + uint32_t RESERVED0[15]; +} stc_gpio_pwpr_bit_t; + +typedef struct +{ + __IO uint32_t POUT; + __IO uint32_t POUTE; + __IO uint32_t NOD; + uint32_t RESERVED0[1]; + __IO uint32_t DRV0; + __IO uint32_t DRV1; + __IO uint32_t PUU; + uint32_t RESERVED1[1]; + __IO uint32_t PIN; + __IO uint32_t INVE; + __IO uint32_t CINSEL; + uint32_t RESERVED2[1]; + __IO uint32_t INTE; + uint32_t RESERVED3[1]; + __IO uint32_t LTE; + __IO uint32_t DDIS; +} stc_gpio_pcr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; + __IO uint32_t BFE; + uint32_t RESERVED1[7]; +} stc_gpio_pfsr_bit_t; + +typedef struct +{ + __IO uint32_t START; + __IO uint32_t FST_GRP; + __IO uint32_t KMSG_END; + uint32_t RESERVED0[1]; + __IO uint32_t MODE0; + __IO uint32_t MODE1; + __IO uint32_t LKEY; + uint32_t RESERVED1[1]; + __IO uint32_t BUSY; + __IO uint32_t CYC_END; + __IO uint32_t HMAC_END; + uint32_t RESERVED2[3]; + __IO uint32_t HCIE; + __IO uint32_t HEIE; + uint32_t RESERVED3[16]; +} stc_hash_cr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t NE; + __IO uint32_t PE; + __IO uint32_t EN; +} stc_hrpwm_cr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[12]; + __IO uint32_t ENDF; + uint32_t RESERVED1[2]; + __IO uint32_t CALEN; + uint32_t RESERVED2[16]; +} stc_hrpwm_calcr_bit_t; + +typedef struct +{ + __IO uint32_t PE; + __IO uint32_t SMBUS; + __IO uint32_t SMBALRTEN; + __IO uint32_t SMBDEFAULTEN; + __IO uint32_t SMBHOSTEN; + uint32_t RESERVED0[1]; + __IO uint32_t ENGC; + __IO uint32_t RESTART; + __IO uint32_t START; + __IO uint32_t STOP; + __IO uint32_t ACK; + uint32_t RESERVED1[4]; + __IO uint32_t SWRST; + uint32_t RESERVED2[16]; +} stc_i2c_cr1_bit_t; + +typedef struct +{ + __IO uint32_t STARTIE; + __IO uint32_t SLADDR0IE; + __IO uint32_t SLADDR1IE; + __IO uint32_t TENDIE; + __IO uint32_t STOPIE; + uint32_t RESERVED0[1]; + __IO uint32_t RFULLIE; + __IO uint32_t TEMPTYIE; + uint32_t RESERVED1[1]; + __IO uint32_t ARLOIE; + uint32_t RESERVED2[2]; + __IO uint32_t NACKIE; + uint32_t RESERVED3[1]; + __IO uint32_t TMOUTIE; + uint32_t RESERVED4[5]; + __IO uint32_t GENCALLIE; + __IO uint32_t SMBDEFAULTIE; + __IO uint32_t SMHOSTIE; + __IO uint32_t SMBALRTIE; + uint32_t RESERVED5[8]; +} stc_i2c_cr2_bit_t; + +typedef struct +{ + __IO uint32_t TMOUTEN; + __IO uint32_t LTMOUT; + __IO uint32_t HTMOUT; + uint32_t RESERVED0[4]; + __IO uint32_t FACKEN; + uint32_t RESERVED1[24]; +} stc_i2c_cr3_bit_t; + +typedef struct +{ + uint32_t RESERVED0[12]; + __IO uint32_t SLADDR0EN; + uint32_t RESERVED1[2]; + __IO uint32_t ADDRMOD0; + uint32_t RESERVED2[16]; +} stc_i2c_slr0_bit_t; + +typedef struct +{ + uint32_t RESERVED0[12]; + __IO uint32_t SLADDR1EN; + uint32_t RESERVED1[2]; + __IO uint32_t ADDRMOD1; + uint32_t RESERVED2[16]; +} stc_i2c_slr1_bit_t; + +typedef struct +{ + __IO uint32_t STARTF; + __IO uint32_t SLADDR0F; + __IO uint32_t SLADDR1F; + __IO uint32_t TENDF; + __IO uint32_t STOPF; + uint32_t RESERVED0[1]; + __IO uint32_t RFULLF; + __IO uint32_t TEMPTYF; + uint32_t RESERVED1[1]; + __IO uint32_t ARLOF; + __IO uint32_t ACKRF; + uint32_t RESERVED2[1]; + __IO uint32_t NACKF; + uint32_t RESERVED3[1]; + __IO uint32_t TMOUTF; + uint32_t RESERVED4[1]; + __IO uint32_t MSL; + __IO uint32_t BUSY; + __IO uint32_t TRA; + uint32_t RESERVED5[1]; + __IO uint32_t GENCALLF; + __IO uint32_t SMBDEFAULTF; + __IO uint32_t SMBHOSTF; + __IO uint32_t SMBALRTF; + uint32_t RESERVED6[8]; +} stc_i2c_sr_bit_t; + +typedef struct +{ + __IO uint32_t STARTFCLR; + __IO uint32_t SLADDR0FCLR; + __IO uint32_t SLADDR1FCLR; + __IO uint32_t TENDFCLR; + __IO uint32_t STOPFCLR; + uint32_t RESERVED0[1]; + __IO uint32_t RFULLFCLR; + __IO uint32_t TEMPTYFCLR; + uint32_t RESERVED1[1]; + __IO uint32_t ARLOFCLR; + uint32_t RESERVED2[2]; + __IO uint32_t NACKFCLR; + uint32_t RESERVED3[1]; + __IO uint32_t TMOUTFCLR; + uint32_t RESERVED4[5]; + __IO uint32_t GENCALLFCLR; + __IO uint32_t SMBDEFAULTFCLR; + __IO uint32_t SMBHOSTFCLR; + __IO uint32_t SMBALRTFCLR; + uint32_t RESERVED5[8]; +} stc_i2c_clr_bit_t; + +typedef struct +{ + __IO uint32_t DT0; + __IO uint32_t DT1; + __IO uint32_t DT2; + __IO uint32_t DT3; + __IO uint32_t DT4; + __IO uint32_t DT5; + __IO uint32_t DT6; + __IO uint32_t DT7; +} stc_i2c_dtr_bit_t; + +typedef struct +{ + __IO uint32_t DR0; + __IO uint32_t DR1; + __IO uint32_t DR2; + __IO uint32_t DR3; + __IO uint32_t DR4; + __IO uint32_t DR5; + __IO uint32_t DR6; + __IO uint32_t DR7; +} stc_i2c_drr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[4]; + __IO uint32_t DNFEN; + __IO uint32_t ANFEN; + uint32_t RESERVED1[26]; +} stc_i2c_fltr_bit_t; + +typedef struct +{ + __IO uint32_t TXE; + __IO uint32_t TXIE; + __IO uint32_t RXE; + __IO uint32_t RXIE; + __IO uint32_t EIE; + __IO uint32_t WMS; + __IO uint32_t ODD; + __IO uint32_t MCKOE; + __IO uint32_t TXBIRQWL0; + __IO uint32_t TXBIRQWL1; + __IO uint32_t TXBIRQWL2; + uint32_t RESERVED0[1]; + __IO uint32_t RXBIRQWL0; + __IO uint32_t RXBIRQWL1; + __IO uint32_t RXBIRQWL2; + uint32_t RESERVED1[1]; + __IO uint32_t FIFOR; + __IO uint32_t CODECRC; + __IO uint32_t I2SPLLSEL; + __IO uint32_t SDOE; + __IO uint32_t LRCKOE; + __IO uint32_t CKOE; + __IO uint32_t DUPLEX; + __IO uint32_t CLKSEL; + __IO uint32_t SRST; + uint32_t RESERVED2[7]; +} stc_i2s_ctrl_bit_t; + +typedef struct +{ + __IO uint32_t TXBA; + __IO uint32_t RXBA; + __IO uint32_t TXBE; + __IO uint32_t TXBF; + __IO uint32_t RXBE; + __IO uint32_t RXBF; + uint32_t RESERVED0[26]; +} stc_i2s_sr_bit_t; + +typedef struct +{ + __IO uint32_t TXERR; + __IO uint32_t RXERR; + uint32_t RESERVED0[30]; +} stc_i2s_er_bit_t; + +typedef struct +{ + __IO uint32_t I2SSTD0; + __IO uint32_t I2SSTD1; + __IO uint32_t DATLEN0; + __IO uint32_t DATLEN1; + __IO uint32_t CHLEN; + __IO uint32_t PCMSYNC; + uint32_t RESERVED0[26]; +} stc_i2s_cfgr_bit_t; + +typedef struct +{ + __IO uint32_t I2SDIV0; + __IO uint32_t I2SDIV1; + __IO uint32_t I2SDIV2; + __IO uint32_t I2SDIV3; + __IO uint32_t I2SDIV4; + __IO uint32_t I2SDIV5; + __IO uint32_t I2SDIV6; + __IO uint32_t I2SDIV7; + uint32_t RESERVED0[24]; +} stc_i2s_pr_bit_t; + +typedef struct +{ + __IO uint32_t SWDTAUTS; + __IO uint32_t SWDTITS; + __IO uint32_t SWDTPERI0; + __IO uint32_t SWDTPERI1; + __IO uint32_t SWDTCKS0; + __IO uint32_t SWDTCKS1; + __IO uint32_t SWDTCKS2; + __IO uint32_t SWDTCKS3; + __IO uint32_t SWDTWDPT0; + __IO uint32_t SWDTWDPT1; + __IO uint32_t SWDTWDPT2; + __IO uint32_t SWDTWDPT3; + __IO uint32_t SWDTSLPOFF; + uint32_t RESERVED0[3]; + __IO uint32_t WDTAUTS; + __IO uint32_t WDTITS; + __IO uint32_t WDTPERI0; + __IO uint32_t WDTPERI1; + __IO uint32_t WDTCKS0; + __IO uint32_t WDTCKS1; + __IO uint32_t WDTCKS2; + __IO uint32_t WDTCKS3; + __IO uint32_t WDTWDPT0; + __IO uint32_t WDTWDPT1; + __IO uint32_t WDTWDPT2; + __IO uint32_t WDTWDPT3; + __IO uint32_t WDTSLPOFF; + uint32_t RESERVED1[3]; +} stc_icg_icg0_bit_t; + +typedef struct +{ + __IO uint32_t HRCFREQSEL; + uint32_t RESERVED0[7]; + __IO uint32_t HRCSTOP; + uint32_t RESERVED1[7]; + __IO uint32_t BOR_LEV0; + __IO uint32_t BOR_LEV1; + __IO uint32_t BORDIS; + uint32_t RESERVED2[13]; +} stc_icg_icg1_bit_t; + +typedef struct +{ + uint32_t RESERVED0[1]; + __IO uint32_t SWDTENR; + __IO uint32_t PVD1ENR; + __IO uint32_t PVD2ENR; + __IO uint32_t XTAL32STPENR; + __IO uint32_t XTALSTPENR; + uint32_t RESERVED1[2]; + __IO uint32_t REPENR; + __IO uint32_t RECCENR; + __IO uint32_t BUSMENR; + __IO uint32_t WDTENR; + uint32_t RESERVED2[20]; +} stc_intc_nmienr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[1]; + __IO uint32_t SWDTFR; + __IO uint32_t PVD1FR; + __IO uint32_t PVD2FR; + __IO uint32_t XTAL32STPFR; + __IO uint32_t XTALSTPFR; + uint32_t RESERVED1[2]; + __IO uint32_t REPFR; + __IO uint32_t RECCFR; + __IO uint32_t BUSMFR; + __IO uint32_t WDTFR; + uint32_t RESERVED2[20]; +} stc_intc_nmifr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[1]; + __IO uint32_t SWDTCFR; + __IO uint32_t PVD1CFR; + __IO uint32_t PVD2CFR; + __IO uint32_t XTAL32STPCFR; + __IO uint32_t XTALSTPCFR; + uint32_t RESERVED1[2]; + __IO uint32_t REPCFR; + __IO uint32_t RECCCFR; + __IO uint32_t BUSMCFR; + __IO uint32_t WDTCFR; + uint32_t RESERVED2[20]; +} stc_intc_nmicfr_bit_t; + +typedef struct +{ + __IO uint32_t EIRQTRG0; + __IO uint32_t EIRQTRG1; + uint32_t RESERVED0[2]; + __IO uint32_t EISMPCLK0; + __IO uint32_t EISMPCLK1; + uint32_t RESERVED1[1]; + __IO uint32_t EFEN; + uint32_t RESERVED2[7]; + __IO uint32_t NOCEN; + uint32_t RESERVED3[16]; +} stc_intc_eirqcr_bit_t; + +typedef struct +{ + __IO uint32_t EIRQWUEN0; + __IO uint32_t EIRQWUEN1; + __IO uint32_t EIRQWUEN2; + __IO uint32_t EIRQWUEN3; + __IO uint32_t EIRQWUEN4; + __IO uint32_t EIRQWUEN5; + __IO uint32_t EIRQWUEN6; + __IO uint32_t EIRQWUEN7; + __IO uint32_t EIRQWUEN8; + __IO uint32_t EIRQWUEN9; + __IO uint32_t EIRQWUEN10; + __IO uint32_t EIRQWUEN11; + __IO uint32_t EIRQWUEN12; + __IO uint32_t EIRQWUEN13; + __IO uint32_t EIRQWUEN14; + __IO uint32_t EIRQWUEN15; + __IO uint32_t SWDTWUEN; + __IO uint32_t PVD1WUEN; + __IO uint32_t PVD2WUEN; + __IO uint32_t CMPWUEN; + __IO uint32_t WKTMWUEN; + __IO uint32_t RTCALMWUEN; + __IO uint32_t RTCPRDWUEN; + __IO uint32_t TMR0GCMWUEN; + __IO uint32_t TMR2GCMWUEN; + __IO uint32_t TMR2OVFWUEN; + __IO uint32_t RXWUEN; + __IO uint32_t USHWUEN; + __IO uint32_t USFWUEN; + __IO uint32_t ETHWUEN; + uint32_t RESERVED0[2]; +} stc_intc_wupen_bit_t; + +typedef struct +{ + __IO uint32_t EIFR0; + __IO uint32_t EIFR1; + __IO uint32_t EIFR2; + __IO uint32_t EIFR3; + __IO uint32_t EIFR4; + __IO uint32_t EIFR5; + __IO uint32_t EIFR6; + __IO uint32_t EIFR7; + __IO uint32_t EIFR8; + __IO uint32_t EIFR9; + __IO uint32_t EIFR10; + __IO uint32_t EIFR11; + __IO uint32_t EIFR12; + __IO uint32_t EIFR13; + __IO uint32_t EIFR14; + __IO uint32_t EIFR15; + uint32_t RESERVED0[16]; +} stc_intc_eifr_bit_t; + +typedef struct +{ + __IO uint32_t EICFR0; + __IO uint32_t EICFR1; + __IO uint32_t EICFR2; + __IO uint32_t EICFR3; + __IO uint32_t EICFR4; + __IO uint32_t EICFR5; + __IO uint32_t EICFR6; + __IO uint32_t EICFR7; + __IO uint32_t EICFR8; + __IO uint32_t EICFR9; + __IO uint32_t EICFR10; + __IO uint32_t EICFR11; + __IO uint32_t EICFR12; + __IO uint32_t EICFR13; + __IO uint32_t EICFR14; + __IO uint32_t EICFR15; + uint32_t RESERVED0[16]; +} stc_intc_eicfr_bit_t; + +typedef struct +{ + __IO uint32_t VSEL0; + __IO uint32_t VSEL1; + __IO uint32_t VSEL2; + __IO uint32_t VSEL3; + __IO uint32_t VSEL4; + __IO uint32_t VSEL5; + __IO uint32_t VSEL6; + __IO uint32_t VSEL7; + __IO uint32_t VSEL8; + __IO uint32_t VSEL9; + __IO uint32_t VSEL10; + __IO uint32_t VSEL11; + __IO uint32_t VSEL12; + __IO uint32_t VSEL13; + __IO uint32_t VSEL14; + __IO uint32_t VSEL15; + __IO uint32_t VSEL16; + __IO uint32_t VSEL17; + __IO uint32_t VSEL18; + __IO uint32_t VSEL19; + __IO uint32_t VSEL20; + __IO uint32_t VSEL21; + __IO uint32_t VSEL22; + __IO uint32_t VSEL23; + __IO uint32_t VSEL24; + __IO uint32_t VSEL25; + __IO uint32_t VSEL26; + __IO uint32_t VSEL27; + __IO uint32_t VSEL28; + __IO uint32_t VSEL29; + __IO uint32_t VSEL30; + __IO uint32_t VSEL31; +} stc_intc_vssel_bit_t; + +typedef struct +{ + __IO uint32_t SWIE0; + __IO uint32_t SWIE1; + __IO uint32_t SWIE2; + __IO uint32_t SWIE3; + __IO uint32_t SWIE4; + __IO uint32_t SWIE5; + __IO uint32_t SWIE6; + __IO uint32_t SWIE7; + __IO uint32_t SWIE8; + __IO uint32_t SWIE9; + __IO uint32_t SWIE10; + __IO uint32_t SWIE11; + __IO uint32_t SWIE12; + __IO uint32_t SWIE13; + __IO uint32_t SWIE14; + __IO uint32_t SWIE15; + __IO uint32_t SWIE16; + __IO uint32_t SWIE17; + __IO uint32_t SWIE18; + __IO uint32_t SWIE19; + __IO uint32_t SWIE20; + __IO uint32_t SWIE21; + __IO uint32_t SWIE22; + __IO uint32_t SWIE23; + __IO uint32_t SWIE24; + __IO uint32_t SWIE25; + __IO uint32_t SWIE26; + __IO uint32_t SWIE27; + __IO uint32_t SWIE28; + __IO uint32_t SWIE29; + __IO uint32_t SWIE30; + __IO uint32_t SWIE31; +} stc_intc_swier_bit_t; + +typedef struct +{ + __IO uint32_t EVTE0; + __IO uint32_t EVTE1; + __IO uint32_t EVTE2; + __IO uint32_t EVTE3; + __IO uint32_t EVTE4; + __IO uint32_t EVTE5; + __IO uint32_t EVTE6; + __IO uint32_t EVTE7; + __IO uint32_t EVTE8; + __IO uint32_t EVTE9; + __IO uint32_t EVTE10; + __IO uint32_t EVTE11; + __IO uint32_t EVTE12; + __IO uint32_t EVTE13; + __IO uint32_t EVTE14; + __IO uint32_t EVTE15; + __IO uint32_t EVTE16; + __IO uint32_t EVTE17; + __IO uint32_t EVTE18; + __IO uint32_t EVTE19; + __IO uint32_t EVTE20; + __IO uint32_t EVTE21; + __IO uint32_t EVTE22; + __IO uint32_t EVTE23; + __IO uint32_t EVTE24; + __IO uint32_t EVTE25; + __IO uint32_t EVTE26; + __IO uint32_t EVTE27; + __IO uint32_t EVTE28; + __IO uint32_t EVTE29; + __IO uint32_t EVTE30; + __IO uint32_t EVTE31; +} stc_intc_evter_bit_t; + +typedef struct +{ + __IO uint32_t IER0; + __IO uint32_t IER1; + __IO uint32_t IER2; + __IO uint32_t IER3; + __IO uint32_t IER4; + __IO uint32_t IER5; + __IO uint32_t IER6; + __IO uint32_t IER7; + __IO uint32_t IER8; + __IO uint32_t IER9; + __IO uint32_t IER10; + __IO uint32_t IER11; + __IO uint32_t IER12; + __IO uint32_t IER13; + __IO uint32_t IER14; + __IO uint32_t IER15; + __IO uint32_t IER16; + __IO uint32_t IER17; + __IO uint32_t IER18; + __IO uint32_t IER19; + __IO uint32_t IER20; + __IO uint32_t IER21; + __IO uint32_t IER22; + __IO uint32_t IER23; + __IO uint32_t IER24; + __IO uint32_t IER25; + __IO uint32_t IER26; + __IO uint32_t IER27; + __IO uint32_t IER28; + __IO uint32_t IER29; + __IO uint32_t IER30; + __IO uint32_t IER31; +} stc_intc_ier_bit_t; + +typedef struct +{ + __IO uint32_t KEYINSEL0; + __IO uint32_t KEYINSEL1; + __IO uint32_t KEYINSEL2; + __IO uint32_t KEYINSEL3; + __IO uint32_t KEYINSEL4; + __IO uint32_t KEYINSEL5; + __IO uint32_t KEYINSEL6; + __IO uint32_t KEYINSEL7; + __IO uint32_t KEYINSEL8; + __IO uint32_t KEYINSEL9; + __IO uint32_t KEYINSEL10; + __IO uint32_t KEYINSEL11; + __IO uint32_t KEYINSEL12; + __IO uint32_t KEYINSEL13; + __IO uint32_t KEYINSEL14; + __IO uint32_t KEYINSEL15; + uint32_t RESERVED0[4]; + __IO uint32_t CKSEL0; + __IO uint32_t CKSEL1; + uint32_t RESERVED1[10]; +} stc_keyscan_scr_bit_t; + +typedef struct +{ + __IO uint32_t SEN; + uint32_t RESERVED0[31]; +} stc_keyscan_ser_bit_t; + +typedef struct +{ + __IO uint32_t START; + __IO uint32_t INTEN; + uint32_t RESERVED0[1]; + __IO uint32_t BUSY; + uint32_t RESERVED1[28]; +} stc_mau_csr_bit_t; + +typedef struct +{ + __IO uint32_t SQRT_DOUT0; + __IO uint32_t SQRT_DOUT1; + __IO uint32_t SQRT_DOUT2; + __IO uint32_t SQRT_DOUT3; + __IO uint32_t SQRT_DOUT4; + __IO uint32_t SQRT_DOUT5; + __IO uint32_t SQRT_DOUT6; + __IO uint32_t SQRT_DOUT7; + __IO uint32_t SQRT_DOUT8; + __IO uint32_t SQRT_DOUT9; + __IO uint32_t SQRT_DOUT10; + __IO uint32_t SQRT_DOUT11; + __IO uint32_t SQRT_DOUT12; + __IO uint32_t SQRT_DOUT13; + __IO uint32_t SQRT_DOUT14; + __IO uint32_t SQRT_DOUT15; + __IO uint32_t SQRT_DOUT16; + uint32_t RESERVED0[15]; +} stc_mau_rtr0_bit_t; + +typedef struct +{ + __IO uint32_t SIN_DIN0; + __IO uint32_t SIN_DIN1; + __IO uint32_t SIN_DIN2; + __IO uint32_t SIN_DIN3; + __IO uint32_t SIN_DIN4; + __IO uint32_t SIN_DIN5; + __IO uint32_t SIN_DIN6; + __IO uint32_t SIN_DIN7; + __IO uint32_t SIN_DIN8; + __IO uint32_t SIN_DIN9; + __IO uint32_t SIN_DIN10; + __IO uint32_t SIN_DIN11; + uint32_t RESERVED0[20]; +} stc_mau_dtr1_bit_t; + +typedef struct +{ + __IO uint32_t SIN_DOUT0; + __IO uint32_t SIN_DOUT1; + __IO uint32_t SIN_DOUT2; + __IO uint32_t SIN_DOUT3; + __IO uint32_t SIN_DOUT4; + __IO uint32_t SIN_DOUT5; + __IO uint32_t SIN_DOUT6; + __IO uint32_t SIN_DOUT7; + __IO uint32_t SIN_DOUT8; + __IO uint32_t SIN_DOUT9; + __IO uint32_t SIN_DOUT10; + __IO uint32_t SIN_DOUT11; + __IO uint32_t SIN_DOUT12; + __IO uint32_t SIN_DOUT13; + __IO uint32_t SIN_DOUT14; + __IO uint32_t SIN_DOUT15; + uint32_t RESERVED0[16]; +} stc_mau_rtr1_bit_t; + +typedef struct +{ + __IO uint32_t MPURGSIZE0; + __IO uint32_t MPURGSIZE1; + __IO uint32_t MPURGSIZE2; + __IO uint32_t MPURGSIZE3; + __IO uint32_t MPURGSIZE4; + uint32_t RESERVED0[27]; +} stc_mpu_rgd_bit_t; + +typedef struct +{ + __IO uint32_t SMPU1EAF; + __IO uint32_t SMPU2EAF; + __IO uint32_t FMPUEAF; + __IO uint32_t HMPUEAF; + __IO uint32_t EMPUEAF; + uint32_t RESERVED0[27]; +} stc_mpu_sr_bit_t; + +typedef struct +{ + __IO uint32_t SMPU1ECLR; + __IO uint32_t SMPU2ECLR; + __IO uint32_t FMPUECLR; + __IO uint32_t HMPUECLR; + __IO uint32_t EMPUECLR; + uint32_t RESERVED0[27]; +} stc_mpu_eclr_bit_t; + +typedef struct +{ + __IO uint32_t MPUWE; + uint32_t RESERVED0[31]; +} stc_mpu_wp_bit_t; + +typedef struct +{ + __IO uint32_t AESRDP; + __IO uint32_t AESWRP; + __IO uint32_t HASHRDP; + __IO uint32_t HASHWRP; + __IO uint32_t TRNGRDP; + __IO uint32_t TRNGWRP; + __IO uint32_t CRCRDP; + __IO uint32_t CRCWRP; + __IO uint32_t FMCRDP; + __IO uint32_t FMCWRP; + uint32_t RESERVED0[2]; + __IO uint32_t WDTRDP; + __IO uint32_t WDTWRP; + __IO uint32_t SWDTRDP; + __IO uint32_t SWDTWRP; + __IO uint32_t BKSRAMRDP; + __IO uint32_t BKSRAMWRP; + __IO uint32_t RTCRDP; + __IO uint32_t RTCWRP; + __IO uint32_t DMPURDP; + __IO uint32_t DMPUWRP; + __IO uint32_t SRAMCRDP; + __IO uint32_t SRAMCWRP; + __IO uint32_t INTCRDP; + __IO uint32_t INTCWRP; + __IO uint32_t SYSCRDP; + __IO uint32_t SYSCWRP; + __IO uint32_t MSTPRDP; + __IO uint32_t MSPTWRP; + uint32_t RESERVED1[1]; + __IO uint32_t BUSERRE; +} stc_mpu_ippr_bit_t; + +typedef struct +{ + __IO uint32_t S1RG0E; + __IO uint32_t S1RG1E; + __IO uint32_t S1RG2E; + __IO uint32_t S1RG3E; + __IO uint32_t S1RG4E; + __IO uint32_t S1RG5E; + __IO uint32_t S1RG6E; + __IO uint32_t S1RG7E; + __IO uint32_t S1RG8E; + __IO uint32_t S1RG9E; + __IO uint32_t S1RG10E; + __IO uint32_t S1RG11E; + __IO uint32_t S1RG12E; + __IO uint32_t S1RG13E; + __IO uint32_t S1RG14E; + __IO uint32_t S1RG15E; + uint32_t RESERVED0[16]; +} stc_mpu_s1rge_bit_t; + +typedef struct +{ + __IO uint32_t S1RG0WP; + __IO uint32_t S1RG1WP; + __IO uint32_t S1RG2WP; + __IO uint32_t S1RG3WP; + __IO uint32_t S1RG4WP; + __IO uint32_t S1RG5WP; + __IO uint32_t S1RG6WP; + __IO uint32_t S1RG7WP; + __IO uint32_t S1RG8WP; + __IO uint32_t S1RG9WP; + __IO uint32_t S1RG10WP; + __IO uint32_t S1RG11WP; + __IO uint32_t S1RG12WP; + __IO uint32_t S1RG13WP; + __IO uint32_t S1RG14WP; + __IO uint32_t S1RG15WP; + uint32_t RESERVED0[16]; +} stc_mpu_s1rgwp_bit_t; + +typedef struct +{ + __IO uint32_t S1RG0RP; + __IO uint32_t S1RG1RP; + __IO uint32_t S1RG2RP; + __IO uint32_t S1RG3RP; + __IO uint32_t S1RG4RP; + __IO uint32_t S1RG5RP; + __IO uint32_t S1RG6RP; + __IO uint32_t S1RG7RP; + __IO uint32_t S1RG8RP; + __IO uint32_t S1RG9RP; + __IO uint32_t S1RG10RP; + __IO uint32_t S1RG11RP; + __IO uint32_t S1RG12RP; + __IO uint32_t S1RG13RP; + __IO uint32_t S1RG14RP; + __IO uint32_t S1RG15RP; + uint32_t RESERVED0[16]; +} stc_mpu_s1rgrp_bit_t; + +typedef struct +{ + __IO uint32_t SMPU1BRP; + __IO uint32_t SMPU1BWP; + __IO uint32_t SMPU1ACT0; + __IO uint32_t SMPU1ACT1; + uint32_t RESERVED0[3]; + __IO uint32_t SMPU1E; + uint32_t RESERVED1[24]; +} stc_mpu_s1cr_bit_t; + +typedef struct +{ + __IO uint32_t S2RG0E; + __IO uint32_t S2RG1E; + __IO uint32_t S2RG2E; + __IO uint32_t S2RG3E; + __IO uint32_t S2RG4E; + __IO uint32_t S2RG5E; + __IO uint32_t S2RG6E; + __IO uint32_t S2RG7E; + __IO uint32_t S2RG8E; + __IO uint32_t S2RG9E; + __IO uint32_t S2RG10E; + __IO uint32_t S2RG11E; + __IO uint32_t S2RG12E; + __IO uint32_t S2RG13E; + __IO uint32_t S2RG14E; + __IO uint32_t S2RG15E; + uint32_t RESERVED0[16]; +} stc_mpu_s2rge_bit_t; + +typedef struct +{ + __IO uint32_t S2RG0WP; + __IO uint32_t S2RG1WP; + __IO uint32_t S2RG2WP; + __IO uint32_t S2RG3WP; + __IO uint32_t S2RG4WP; + __IO uint32_t S2RG5WP; + __IO uint32_t S2RG6WP; + __IO uint32_t S2RG7WP; + __IO uint32_t S2RG8WP; + __IO uint32_t S2RG9WP; + __IO uint32_t S2RG10WP; + __IO uint32_t S2RG11WP; + __IO uint32_t S2RG12WP; + __IO uint32_t S2RG13WP; + __IO uint32_t S2RG14WP; + __IO uint32_t S2RG15WP; + uint32_t RESERVED0[16]; +} stc_mpu_s2rgwp_bit_t; + +typedef struct +{ + __IO uint32_t S2RG0RP; + __IO uint32_t S2RG1RP; + __IO uint32_t S2RG2RP; + __IO uint32_t S2RG3RP; + __IO uint32_t S2RG4RP; + __IO uint32_t S2RG5RP; + __IO uint32_t S2RG6RP; + __IO uint32_t S2RG7RP; + __IO uint32_t S2RG8RP; + __IO uint32_t S2RG9RP; + __IO uint32_t S2RG10RP; + __IO uint32_t S2RG11RP; + __IO uint32_t S2RG12RP; + __IO uint32_t S2RG13RP; + __IO uint32_t S2RG14RP; + __IO uint32_t S2RG15RP; + uint32_t RESERVED0[16]; +} stc_mpu_s2rgrp_bit_t; + +typedef struct +{ + __IO uint32_t SMPU2BRP; + __IO uint32_t SMPU2BWP; + __IO uint32_t SMPU2ACT0; + __IO uint32_t SMPU2ACT1; + uint32_t RESERVED0[3]; + __IO uint32_t SMPU2E; + uint32_t RESERVED1[24]; +} stc_mpu_s2cr_bit_t; + +typedef struct +{ + __IO uint32_t FMPU0E; + __IO uint32_t FMPU1E; + __IO uint32_t FMPU2E; + __IO uint32_t FMPU3E; + __IO uint32_t FMPU4E; + __IO uint32_t FMPU5E; + __IO uint32_t FMPU6E; + __IO uint32_t FMPU7E; + uint32_t RESERVED0[24]; +} stc_mpu_frge_bit_t; + +typedef struct +{ + __IO uint32_t FMPU0WP; + __IO uint32_t FMPU1WP; + __IO uint32_t FMPU2WP; + __IO uint32_t FMPU3WP; + __IO uint32_t FMPU4WP; + __IO uint32_t FMPU5WP; + __IO uint32_t FMPU6WP; + __IO uint32_t FMPU7WP; + uint32_t RESERVED0[24]; +} stc_mpu_frgwp_bit_t; + +typedef struct +{ + __IO uint32_t FMPU0RP; + __IO uint32_t FMPU1RP; + __IO uint32_t FMPU2RP; + __IO uint32_t FMPU3RP; + __IO uint32_t FMPU4RP; + __IO uint32_t FMPU5RP; + __IO uint32_t FMPU6RP; + __IO uint32_t FMPU7RP; + uint32_t RESERVED0[24]; +} stc_mpu_frgrp_bit_t; + +typedef struct +{ + __IO uint32_t FMPUBRP; + __IO uint32_t FMPUBWP; + __IO uint32_t FMPUACT0; + __IO uint32_t FMPUACT1; + uint32_t RESERVED0[3]; + __IO uint32_t FMPUE; + uint32_t RESERVED1[24]; +} stc_mpu_fcr_bit_t; + +typedef struct +{ + __IO uint32_t HMPU0E; + __IO uint32_t HMPU1E; + __IO uint32_t HMPU2E; + __IO uint32_t HMPU3E; + __IO uint32_t HMPU4E; + __IO uint32_t HMPU5E; + __IO uint32_t HMPU6E; + __IO uint32_t HMPU7E; + uint32_t RESERVED0[24]; +} stc_mpu_hrge_bit_t; + +typedef struct +{ + __IO uint32_t HMPU0WP; + __IO uint32_t HMPU1WP; + __IO uint32_t HMPU2WP; + __IO uint32_t HMPU3WP; + __IO uint32_t HMPU4WP; + __IO uint32_t HMPU5WP; + __IO uint32_t HMPU6WP; + __IO uint32_t HMPU7WP; + uint32_t RESERVED0[24]; +} stc_mpu_hrgwp_bit_t; + +typedef struct +{ + __IO uint32_t HMPU0RP; + __IO uint32_t HMPU1RP; + __IO uint32_t HMPU2RP; + __IO uint32_t HMPU3RP; + __IO uint32_t HMPU4RP; + __IO uint32_t HMPU5RP; + __IO uint32_t HMPU6RP; + __IO uint32_t HMPU7RP; + uint32_t RESERVED0[24]; +} stc_mpu_hrgrp_bit_t; + +typedef struct +{ + __IO uint32_t HMPUBRP; + __IO uint32_t HMPUBWP; + __IO uint32_t HMPUACT0; + __IO uint32_t HMPUACT1; + uint32_t RESERVED0[3]; + __IO uint32_t HMPUE; + uint32_t RESERVED1[24]; +} stc_mpu_hcr_bit_t; + +typedef struct +{ + __IO uint32_t EMPU0E; + __IO uint32_t EMPU1E; + __IO uint32_t EMPU2E; + __IO uint32_t EMPU3E; + __IO uint32_t EMPU4E; + __IO uint32_t EMPU5E; + __IO uint32_t EMPU6E; + __IO uint32_t EMPU7E; + uint32_t RESERVED0[24]; +} stc_mpu_erge_bit_t; + +typedef struct +{ + __IO uint32_t EMPU0WP; + __IO uint32_t EMPU1WP; + __IO uint32_t EMPU2WP; + __IO uint32_t EMPU3WP; + __IO uint32_t EMPU4WP; + __IO uint32_t EMPU5WP; + __IO uint32_t EMPU6WP; + __IO uint32_t EMPU7WP; + uint32_t RESERVED0[24]; +} stc_mpu_ergwp_bit_t; + +typedef struct +{ + __IO uint32_t EMPU0RP; + __IO uint32_t EMPU1RP; + __IO uint32_t EMPU2RP; + __IO uint32_t EMPU3RP; + __IO uint32_t EMPU4RP; + __IO uint32_t EMPU5RP; + __IO uint32_t EMPU6RP; + __IO uint32_t EMPU7RP; + uint32_t RESERVED0[24]; +} stc_mpu_ergrp_bit_t; + +typedef struct +{ + __IO uint32_t EMPUBRP; + __IO uint32_t EMPUBWP; + __IO uint32_t EMPUACT0; + __IO uint32_t EMPUACT1; + uint32_t RESERVED0[3]; + __IO uint32_t EMPUE; + uint32_t RESERVED1[24]; +} stc_mpu_ecr_bit_t; + +typedef struct +{ + __IO uint32_t OTSST; + __IO uint32_t OTSCK; + __IO uint32_t OTSIE; + __IO uint32_t TSSTP; + uint32_t RESERVED0[12]; +} stc_ots_ctl_bit_t; + +typedef struct +{ + __IO uint32_t TSOFS0; + __IO uint32_t TSOFS1; + __IO uint32_t TSOFS2; + __IO uint32_t TSOFS3; + __IO uint32_t TSOFS4; + __IO uint32_t TSOFS5; + __IO uint32_t TSOFS6; + __IO uint32_t TSOFS7; + __IO uint32_t TSSLP0; + __IO uint32_t TSSLP1; + __IO uint32_t TSSLP2; + __IO uint32_t TSSLP3; + __IO uint32_t TSSLP4; + __IO uint32_t TSSLP5; + __IO uint32_t TSSLP6; + __IO uint32_t TSSLP7; + __IO uint32_t TSSLP8; + __IO uint32_t TSSLP9; + __IO uint32_t TSSLP10; + __IO uint32_t TSSLP11; + __IO uint32_t TSSLP12; + __IO uint32_t TSSLP13; + __IO uint32_t TSSLP14; + __IO uint32_t TSSLP15; + __IO uint32_t TSSLP16; + __IO uint32_t TSSLP17; + __IO uint32_t TSSLP18; + __IO uint32_t TSSLP19; + __IO uint32_t TSSLP20; + __IO uint32_t TSSLP21; + __IO uint32_t TSSLP22; + __IO uint32_t TSSLP23; +} stc_ots_lpr_bit_t; + +typedef struct +{ + __IO uint32_t USBFS_DFB; + __IO uint32_t USBFS_SOFEN; + uint32_t RESERVED0[6]; + __IO uint32_t USBHS_DFB; + __IO uint32_t USBHS_SOFEN; + __IO uint32_t USBHS_FSPHYE; + uint32_t RESERVED1[5]; + __IO uint32_t USBFS_NFS0; + __IO uint32_t USBFS_NFS1; + __IO uint32_t USBFS_NFE; + uint32_t RESERVED2[5]; + __IO uint32_t USBHS_NFS0; + __IO uint32_t USBHS_NFS1; + __IO uint32_t USBHS_NFE; + uint32_t RESERVED3[5]; +} stc_peric_usb_syctlreg_bit_t; + +typedef struct +{ + uint32_t RESERVED0[1]; + __IO uint32_t SELMMC1; + uint32_t RESERVED1[1]; + __IO uint32_t SELMMC2; + uint32_t RESERVED2[28]; +} stc_peric_sdioc_syctlreg_bit_t; + +typedef struct +{ + __IO uint32_t OPO; + uint32_t RESERVED0[31]; +} stc_peric_nfc_syctlreg_bit_t; + +typedef struct +{ + __IO uint32_t DMCEN; + __IO uint32_t SMCEN; + __IO uint32_t NFCEN; + uint32_t RESERVED0[29]; +} stc_peric_exmc_enar_bit_t; + +typedef struct +{ + __IO uint32_t CAN1FDE; + __IO uint32_t CAN2FDE; + uint32_t RESERVED0[30]; +} stc_peric_can_syctlreg_bit_t; + +typedef struct +{ + __IO uint32_t NFS0; + __IO uint32_t NFS1; + __IO uint32_t NFE; + uint32_t RESERVED0[29]; +} stc_peric_usart1_nfc_bit_t; + +typedef struct +{ + __IO uint32_t CHIPBUSY0; + __IO uint32_t CHIPBUSY1; + __IO uint32_t CHIPBUSY2; + __IO uint32_t CHIPBUSY3; + __IO uint32_t CHIPBUSY4; + __IO uint32_t CHIPBUSY5; + __IO uint32_t CHIPBUSY6; + __IO uint32_t CHIPBUSY7; + __IO uint32_t PECC; + uint32_t RESERVED0[23]; +} stc_peric_nfc_systatreg_bit_t; + +typedef struct +{ + __IO uint32_t SRAMH; + uint32_t RESERVED0[3]; + __IO uint32_t SRAM1; + __IO uint32_t SRAM2; + __IO uint32_t SRAM3; + __IO uint32_t SRAM4; + uint32_t RESERVED1[2]; + __IO uint32_t SRAMB; + uint32_t RESERVED2[2]; + __IO uint32_t KEY; + __IO uint32_t DMA1; + __IO uint32_t DMA2; + __IO uint32_t FCM; + __IO uint32_t AOS; + __IO uint32_t CTC; + __IO uint32_t CORDIC; + __IO uint32_t AES; + __IO uint32_t HASH; + __IO uint32_t TRNG; + __IO uint32_t CRC; + __IO uint32_t DCU1; + __IO uint32_t DCU2; + __IO uint32_t DCU3; + __IO uint32_t DCU4; + __IO uint32_t DCU5; + __IO uint32_t DCU6; + __IO uint32_t DCU7; + __IO uint32_t DCU8; +} stc_pwc_fcg0_bit_t; + +typedef struct +{ + __IO uint32_t CAN1; + __IO uint32_t CAN2; + __IO uint32_t ETHER; + __IO uint32_t QSPI; + __IO uint32_t IIC1; + __IO uint32_t IIC2; + __IO uint32_t IIC3; + __IO uint32_t IIC4; + __IO uint32_t IIC5; + __IO uint32_t IIC6; + __IO uint32_t SDIOC1; + __IO uint32_t SDIOC2; + __IO uint32_t I2S1; + __IO uint32_t I2S2; + __IO uint32_t I2S3; + __IO uint32_t I2S4; + __IO uint32_t SPI1; + __IO uint32_t SPI2; + __IO uint32_t SPI3; + __IO uint32_t SPI4; + __IO uint32_t SPI5; + __IO uint32_t SPI6; + __IO uint32_t USBFS; + __IO uint32_t USBHS; + __IO uint32_t FMAC1; + __IO uint32_t FMAC2; + __IO uint32_t FMAC3; + __IO uint32_t FMAC4; + uint32_t RESERVED0[4]; +} stc_pwc_fcg1_bit_t; + +typedef struct +{ + __IO uint32_t TMR6_1; + __IO uint32_t TMR6_2; + __IO uint32_t TMR6_3; + __IO uint32_t TMR6_4; + __IO uint32_t TMR6_5; + __IO uint32_t TMR6_6; + __IO uint32_t TMR6_7; + __IO uint32_t TMR6_8; + __IO uint32_t TMR4_1; + __IO uint32_t TMR4_2; + __IO uint32_t TMR4_3; + __IO uint32_t HRPWM; + __IO uint32_t TMR0_1; + __IO uint32_t TMR0_2; + uint32_t RESERVED0[1]; + __IO uint32_t EMB; + __IO uint32_t TMR2_1; + __IO uint32_t TMR2_2; + __IO uint32_t TMR2_3; + __IO uint32_t TMR2_4; + __IO uint32_t TMRA_1; + __IO uint32_t TMRA_2; + __IO uint32_t TMRA_3; + __IO uint32_t TMRA_4; + __IO uint32_t TMRA_5; + __IO uint32_t TMRA_6; + __IO uint32_t TMRA_7; + __IO uint32_t TMRA_8; + __IO uint32_t TMRA_9; + __IO uint32_t TMRA_10; + __IO uint32_t TMRA_11; + __IO uint32_t TMRA_12; +} stc_pwc_fcg2_bit_t; + +typedef struct +{ + __IO uint32_t ADC1; + __IO uint32_t ADC2; + __IO uint32_t ADC3; + __IO uint32_t CMBIAS; + __IO uint32_t DAC1; + __IO uint32_t DAC2; + uint32_t RESERVED0[2]; + __IO uint32_t CMP1; + __IO uint32_t CMP2; + uint32_t RESERVED1[2]; + __IO uint32_t OTS; + uint32_t RESERVED2[2]; + __IO uint32_t DVP; + __IO uint32_t SMC; + __IO uint32_t DMC; + __IO uint32_t NFC; + uint32_t RESERVED3[1]; + __IO uint32_t USART1; + __IO uint32_t USART2; + __IO uint32_t USART3; + __IO uint32_t USART4; + __IO uint32_t USART5; + __IO uint32_t USART6; + __IO uint32_t USART7; + __IO uint32_t USART8; + __IO uint32_t USART9; + __IO uint32_t USART10; + uint32_t RESERVED4[2]; +} stc_pwc_fcg3_bit_t; + +typedef struct +{ + __IO uint32_t PRT0; + uint32_t RESERVED0[31]; +} stc_pwc_fcg0pc_bit_t; + +typedef struct +{ + __IO uint32_t VBTRSD; + __IO uint32_t RAMVALID; + __IO uint32_t RAMPDF; + __IO uint32_t VBATDIVMONE; + uint32_t RESERVED0[3]; + __IO uint32_t CSDIS; +} stc_pwc_vbatcr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; +} stc_pwc_wktc0_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; +} stc_pwc_wktc1_bit_t; + +typedef struct +{ + uint32_t RESERVED0[4]; + __IO uint32_t WKOVF; + __IO uint32_t WKCKS0; + __IO uint32_t WKCKS1; + __IO uint32_t WKTCE; +} stc_pwc_wktc2_bit_t; + +typedef struct +{ + __IO uint32_t PDMDS0; + __IO uint32_t PDMDS1; + uint32_t RESERVED0[2]; + __IO uint32_t IORTN0; + __IO uint32_t IORTN1; + uint32_t RESERVED1[1]; + __IO uint32_t PWDN; +} stc_pwc_pwrc0_bit_t; + +typedef struct +{ + __IO uint32_t VPLLSD0; + __IO uint32_t VPLLSD1; + __IO uint32_t VHRCSD; + __IO uint32_t PDTS; + uint32_t RESERVED0[2]; + __IO uint32_t STPDAS0; + __IO uint32_t STPDAS1; +} stc_pwc_pwrc1_bit_t; + +typedef struct +{ + uint32_t RESERVED0[4]; + __IO uint32_t DVS0; + __IO uint32_t DVS1; + uint32_t RESERVED1[2]; +} stc_pwc_pwrc2_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; +} stc_pwc_pwrc3_bit_t; + +typedef struct +{ + __IO uint32_t VBATREFSEL; + __IO uint32_t VBATME; + uint32_t RESERVED0[2]; + __IO uint32_t VBATMON; + uint32_t RESERVED1[1]; + __IO uint32_t ADBUFS; + __IO uint32_t ADBUFE; +} stc_pwc_pwrc4_bit_t; + +typedef struct +{ + __IO uint32_t EXVCCINEN; + uint32_t RESERVED0[4]; + __IO uint32_t PVD1EN; + __IO uint32_t PVD2EN; + uint32_t RESERVED1[1]; +} stc_pwc_pvdcr0_bit_t; + +typedef struct +{ + __IO uint32_t PVD1IRE; + __IO uint32_t PVD1IRS; + __IO uint32_t PVD1CMPOE; + uint32_t RESERVED0[1]; + __IO uint32_t PVD2IRE; + __IO uint32_t PVD2IRS; + __IO uint32_t PVD2CMPOE; + uint32_t RESERVED1[1]; +} stc_pwc_pvdcr1_bit_t; + +typedef struct +{ + __IO uint32_t PVD1NFDIS; + __IO uint32_t PVD1NFCKS0; + __IO uint32_t PVD1NFCKS1; + uint32_t RESERVED0[1]; + __IO uint32_t PVD2NFDIS; + __IO uint32_t PVD2NFCKS0; + __IO uint32_t PVD2NFCKS1; + uint32_t RESERVED1[1]; +} stc_pwc_pvdfcr_bit_t; + +typedef struct +{ + __IO uint32_t PVD1LVL0; + __IO uint32_t PVD1LVL1; + __IO uint32_t PVD1LVL2; + uint32_t RESERVED0[1]; + __IO uint32_t PVD2LVL0; + __IO uint32_t PVD2LVL1; + __IO uint32_t PVD2LVL2; + uint32_t RESERVED1[1]; +} stc_pwc_pvdlcr_bit_t; + +typedef struct +{ + __IO uint32_t WKE0_0; + __IO uint32_t WKE0_1; + __IO uint32_t WKE0_2; + __IO uint32_t WKE0_3; + __IO uint32_t WKE1_0; + __IO uint32_t WKE1_1; + __IO uint32_t WKE1_2; + __IO uint32_t WKE1_3; +} stc_pwc_pdwke0_bit_t; + +typedef struct +{ + __IO uint32_t WKE2_0; + __IO uint32_t WKE2_1; + __IO uint32_t WKE2_2; + __IO uint32_t WKE2_3; + __IO uint32_t WKE3_0; + __IO uint32_t WKE3_1; + __IO uint32_t WKE3_2; + __IO uint32_t WKE3_3; +} stc_pwc_pdwke1_bit_t; + +typedef struct +{ + __IO uint32_t VD1WKE; + __IO uint32_t VD2WKE; + uint32_t RESERVED0[2]; + __IO uint32_t RTCPRDWKE; + __IO uint32_t RTCALMWKE; + __IO uint32_t XTAL32ERWKE; + __IO uint32_t WKTMWKE; +} stc_pwc_pdwke2_bit_t; + +typedef struct +{ + __IO uint32_t WK0EGS; + __IO uint32_t WK1EGS; + __IO uint32_t WK2EGS; + __IO uint32_t WK3EGS; + __IO uint32_t VD1EGS; + __IO uint32_t VD2EGS; + uint32_t RESERVED0[2]; +} stc_pwc_pdwkes_bit_t; + +typedef struct +{ + __IO uint32_t PTWK0F; + __IO uint32_t PTWK1F; + __IO uint32_t PTWK2F; + __IO uint32_t PTWK3F; + __IO uint32_t VD1WKF; + __IO uint32_t VD2WKF; + uint32_t RESERVED0[2]; +} stc_pwc_pdwkf0_bit_t; + +typedef struct +{ + uint32_t RESERVED0[3]; + __IO uint32_t RXD0WKF; + __IO uint32_t RTCPRDWKF; + __IO uint32_t RTCALMWKF; + __IO uint32_t XTAL32ERWKF; + __IO uint32_t WKTMWKF; +} stc_pwc_pdwkf1_bit_t; + +typedef struct +{ + __IO uint32_t RAMPDC0; + __IO uint32_t RAMPDC1; + __IO uint32_t RAMPDC2; + __IO uint32_t RAMPDC3; + __IO uint32_t RAMPDC4; + __IO uint32_t RAMPDC5; + __IO uint32_t RAMPDC6; + __IO uint32_t RAMPDC7; + __IO uint32_t RAMPDC8; + __IO uint32_t RAMPDC9; + __IO uint32_t RAMPDC10; + uint32_t RESERVED0[21]; +} stc_pwc_rampc0_bit_t; + +typedef struct +{ + __IO uint32_t RAMOPM0; + __IO uint32_t RAMOPM1; + __IO uint32_t RAMOPM2; + __IO uint32_t RAMOPM3; + __IO uint32_t RAMOPM4; + __IO uint32_t RAMOPM5; + __IO uint32_t RAMOPM6; + __IO uint32_t RAMOPM7; + __IO uint32_t RAMOPM8; + __IO uint32_t RAMOPM9; + __IO uint32_t RAMOPM10; + __IO uint32_t RAMOPM11; + __IO uint32_t RAMOPM12; + __IO uint32_t RAMOPM13; + __IO uint32_t RAMOPM14; + __IO uint32_t RAMOPM15; + uint32_t RESERVED0[16]; +} stc_pwc_ramopm_bit_t; + +typedef struct +{ + __IO uint32_t PRAMPDC0; + __IO uint32_t PRAMPDC1; + __IO uint32_t PRAMPDC2; + __IO uint32_t PRAMPDC3; + __IO uint32_t PRAMPDC4; + __IO uint32_t PRAMPDC5; + __IO uint32_t PRAMPDC6; + __IO uint32_t PRAMPDC7; + __IO uint32_t PRAMPDC8; + __IO uint32_t PRAMPDC9; + uint32_t RESERVED0[22]; +} stc_pwc_pramlpc_bit_t; + +typedef struct +{ + __IO uint32_t PVD1NMIS; + __IO uint32_t PVD1EDGS0; + __IO uint32_t PVD1EDGS1; + uint32_t RESERVED0[1]; + __IO uint32_t PVD2NMIS; + __IO uint32_t PVD2EDGS0; + __IO uint32_t PVD2EDGS1; + uint32_t RESERVED1[1]; +} stc_pwc_pvdicr_bit_t; + +typedef struct +{ + __IO uint32_t PVD1MON; + __IO uint32_t PVD1DETFLG; + uint32_t RESERVED0[2]; + __IO uint32_t PVD2MON; + __IO uint32_t PVD2DETFLG; + uint32_t RESERVED1[2]; +} stc_pwc_pvddsr_bit_t; + +typedef struct +{ + __IO uint32_t FLNWT; + __IO uint32_t CKSMRC; + uint32_t RESERVED0[12]; + __IO uint32_t EXBUSOE; + __IO uint32_t STOP; +} stc_pwc_stpmcr_bit_t; + +typedef struct +{ + __IO uint32_t FPRCB0; + __IO uint32_t FPRCB1; + __IO uint32_t FPRCB2; + __IO uint32_t FPRCB3; + uint32_t RESERVED0[12]; +} stc_pwc_fprc_bit_t; + +typedef struct +{ + uint32_t RESERVED0[5]; + __IO uint32_t LKUPREN; + uint32_t RESERVED1[2]; +} stc_rmu_prstcr0_bit_t; + +typedef struct +{ + __IO uint32_t PORF; + __IO uint32_t PINRF; + __IO uint32_t BORF; + __IO uint32_t PVD1RF; + __IO uint32_t PVD2RF; + __IO uint32_t WDRF; + __IO uint32_t SWDRF; + __IO uint32_t PDRF; + __IO uint32_t SWRF; + __IO uint32_t MPUERF; + __IO uint32_t RAPERF; + __IO uint32_t RAECRF; + __IO uint32_t CKFERF; + __IO uint32_t XTALERF; + __IO uint32_t LKUPRF; + uint32_t RESERVED0[15]; + __IO uint32_t MULTIRF; + __IO uint32_t CLRF; +} stc_rmu_rstf0_bit_t; + +typedef struct +{ + __IO uint32_t RESET; + uint32_t RESERVED0[7]; +} stc_rtc_cr0_bit_t; + +typedef struct +{ + __IO uint32_t PRDS0; + __IO uint32_t PRDS1; + __IO uint32_t PRDS2; + __IO uint32_t AMPM; + uint32_t RESERVED0[1]; + __IO uint32_t ONEHZOE; + __IO uint32_t ONEHZSEL; + __IO uint32_t START; +} stc_rtc_cr1_bit_t; + +typedef struct +{ + __IO uint32_t RWREQ; + __IO uint32_t RWEN; + __IO uint32_t PRDF; + __IO uint32_t ALMF; + uint32_t RESERVED0[1]; + __IO uint32_t PRDIE; + __IO uint32_t ALMIE; + __IO uint32_t ALME; +} stc_rtc_cr2_bit_t; + +typedef struct +{ + uint32_t RESERVED0[4]; + __IO uint32_t LRCEN; + uint32_t RESERVED1[2]; + __IO uint32_t RCKSEL; +} stc_rtc_cr3_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; +} stc_rtc_sec_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; +} stc_rtc_min_bit_t; + +typedef struct +{ + __IO uint32_t HOURU0; + __IO uint32_t HOURU1; + __IO uint32_t HOURU2; + __IO uint32_t HOURU3; + __IO uint32_t HOURD0; + __IO uint32_t HOURD1; + uint32_t RESERVED0[2]; +} stc_rtc_hour_bit_t; + +typedef struct +{ + __IO uint32_t WEEK0; + __IO uint32_t WEEK1; + __IO uint32_t WEEK2; + uint32_t RESERVED0[5]; +} stc_rtc_week_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; +} stc_rtc_day_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; +} stc_rtc_mon_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; +} stc_rtc_year_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; +} stc_rtc_almmin_bit_t; + +typedef struct +{ + __IO uint32_t ALMHOURU0; + __IO uint32_t ALMHOURU1; + __IO uint32_t ALMHOURU2; + __IO uint32_t ALMHOURU3; + __IO uint32_t ALMHOURD0; + __IO uint32_t ALMHOURD1; + uint32_t RESERVED0[2]; +} stc_rtc_almhour_bit_t; + +typedef struct +{ + __IO uint32_t ALMWEEK0; + __IO uint32_t ALMWEEK1; + __IO uint32_t ALMWEEK2; + __IO uint32_t ALMWEEK3; + __IO uint32_t ALMWEEK4; + __IO uint32_t ALMWEEK5; + __IO uint32_t ALMWEEK6; + uint32_t RESERVED0[1]; +} stc_rtc_almweek_bit_t; + +typedef struct +{ + __IO uint32_t COMP8; + uint32_t RESERVED0[6]; + __IO uint32_t COMPEN; +} stc_rtc_errcrh_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; +} stc_rtc_errcrl_bit_t; + +typedef struct +{ + __IO uint32_t TPCT00; + __IO uint32_t TPCT01; + __IO uint32_t TPNF00; + __IO uint32_t TPNF01; + __IO uint32_t TPRSTE0; + __IO uint32_t TPIE0; + __IO uint32_t TSTPE0; + __IO uint32_t TPEN0; +} stc_rtc_tpcr0_bit_t; + +typedef struct +{ + __IO uint32_t TPCT10; + __IO uint32_t TPCT11; + __IO uint32_t TPNF10; + __IO uint32_t TPNF11; + __IO uint32_t TPRSTE1; + __IO uint32_t TPIE1; + __IO uint32_t TSTPE1; + __IO uint32_t TPEN1; +} stc_rtc_tpcr1_bit_t; + +typedef struct +{ + __IO uint32_t TPF0; + __IO uint32_t TPF1; + __IO uint32_t TPOVF; + uint32_t RESERVED0[5]; +} stc_rtc_tpsr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; +} stc_rtc_sectp_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; +} stc_rtc_mintp_bit_t; + +typedef struct +{ + __IO uint32_t HOURTPU0; + __IO uint32_t HOURTPU1; + __IO uint32_t HOURTPU2; + __IO uint32_t HOURTPU3; + __IO uint32_t HOURTPD0; + __IO uint32_t HOURTPD1; + uint32_t RESERVED0[2]; +} stc_rtc_hourtp_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; +} stc_rtc_daytp_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; +} stc_rtc_montp_bit_t; + +typedef struct +{ + uint32_t RESERVED0[16]; +} stc_sdioc_blksize_bit_t; + +typedef struct +{ + uint32_t RESERVED0[1]; + __IO uint32_t BCE; + __IO uint32_t ATCEN0; + __IO uint32_t ATCEN1; + __IO uint32_t DDIR; + __IO uint32_t MULB; + uint32_t RESERVED1[10]; +} stc_sdioc_transmode_bit_t; + +typedef struct +{ + __IO uint32_t RESTYP0; + __IO uint32_t RESTYP1; + uint32_t RESERVED0[1]; + __IO uint32_t CCE; + __IO uint32_t ICE; + __IO uint32_t DAT; + __IO uint32_t TYP0; + __IO uint32_t TYP1; + __IO uint32_t IDX0; + __IO uint32_t IDX1; + __IO uint32_t IDX2; + __IO uint32_t IDX3; + __IO uint32_t IDX4; + __IO uint32_t IDX5; + uint32_t RESERVED1[2]; +} stc_sdioc_cmd_bit_t; + +typedef struct +{ + __IO uint32_t CIC; + __IO uint32_t CID; + __IO uint32_t DA; + uint32_t RESERVED0[5]; + __IO uint32_t WTA; + __IO uint32_t RTA; + __IO uint32_t BWE; + __IO uint32_t BRE; + uint32_t RESERVED1[4]; + __IO uint32_t CIN; + __IO uint32_t CSS; + __IO uint32_t CDL; + __IO uint32_t WPL; + __IO uint32_t DATL0; + __IO uint32_t DATL1; + __IO uint32_t DATL2; + __IO uint32_t DATL3; + __IO uint32_t CMDL; + uint32_t RESERVED2[7]; +} stc_sdioc_pstat_bit_t; + +typedef struct +{ + uint32_t RESERVED0[1]; + __IO uint32_t DW; + __IO uint32_t HSEN; + uint32_t RESERVED1[2]; + __IO uint32_t EXDW; + __IO uint32_t CDTL; + __IO uint32_t CDSS; +} stc_sdioc_hostcon_bit_t; + +typedef struct +{ + __IO uint32_t PWON; + uint32_t RESERVED0[7]; +} stc_sdioc_pwrcon_bit_t; + +typedef struct +{ + __IO uint32_t SABGR; + __IO uint32_t CR; + __IO uint32_t RWC; + __IO uint32_t IABG; + uint32_t RESERVED0[4]; +} stc_sdioc_blkgpcon_bit_t; + +typedef struct +{ + __IO uint32_t ICE; + uint32_t RESERVED0[1]; + __IO uint32_t CE; + uint32_t RESERVED1[5]; + __IO uint32_t FS0; + __IO uint32_t FS1; + __IO uint32_t FS2; + __IO uint32_t FS3; + __IO uint32_t FS4; + __IO uint32_t FS5; + __IO uint32_t FS6; + __IO uint32_t FS7; +} stc_sdioc_clkcon_bit_t; + +typedef struct +{ + __IO uint32_t DTO0; + __IO uint32_t DTO1; + __IO uint32_t DTO2; + __IO uint32_t DTO3; + uint32_t RESERVED0[4]; +} stc_sdioc_toutcon_bit_t; + +typedef struct +{ + __IO uint32_t RSTA; + __IO uint32_t RSTC; + __IO uint32_t RSTD; + uint32_t RESERVED0[5]; +} stc_sdioc_sftrst_bit_t; + +typedef struct +{ + __IO uint32_t CC; + __IO uint32_t TC; + __IO uint32_t BGE; + uint32_t RESERVED0[1]; + __IO uint32_t BWR; + __IO uint32_t BRR; + __IO uint32_t CIST; + __IO uint32_t CRM; + __IO uint32_t CINT; + uint32_t RESERVED1[6]; + __IO uint32_t EI; +} stc_sdioc_norintst_bit_t; + +typedef struct +{ + __IO uint32_t CTOE; + __IO uint32_t CCE; + __IO uint32_t CEBE; + __IO uint32_t CIE; + __IO uint32_t DTOE; + __IO uint32_t DCE; + __IO uint32_t DEBE; + uint32_t RESERVED0[1]; + __IO uint32_t ACE; + uint32_t RESERVED1[7]; +} stc_sdioc_errintst_bit_t; + +typedef struct +{ + __IO uint32_t CCEN; + __IO uint32_t TCEN; + __IO uint32_t BGEEN; + uint32_t RESERVED0[1]; + __IO uint32_t BWREN; + __IO uint32_t BRREN; + __IO uint32_t CISTEN; + __IO uint32_t CRMEN; + __IO uint32_t CINTEN; + uint32_t RESERVED1[7]; +} stc_sdioc_norintsten_bit_t; + +typedef struct +{ + __IO uint32_t CTOEEN; + __IO uint32_t CCEEN; + __IO uint32_t CEBEEN; + __IO uint32_t CIEEN; + __IO uint32_t DTOEEN; + __IO uint32_t DCEEN; + __IO uint32_t DEBEEN; + uint32_t RESERVED0[1]; + __IO uint32_t ACEEN; + uint32_t RESERVED1[7]; +} stc_sdioc_errintsten_bit_t; + +typedef struct +{ + __IO uint32_t CCSEN; + __IO uint32_t TCSEN; + __IO uint32_t BGESEN; + uint32_t RESERVED0[1]; + __IO uint32_t BWRSEN; + __IO uint32_t BRRSEN; + __IO uint32_t CISTSEN; + __IO uint32_t CRMSEN; + __IO uint32_t CINTSEN; + uint32_t RESERVED1[7]; +} stc_sdioc_norintsgen_bit_t; + +typedef struct +{ + __IO uint32_t CTOESEN; + __IO uint32_t CCESEN; + __IO uint32_t CEBESEN; + __IO uint32_t CIESEN; + __IO uint32_t DTOESEN; + __IO uint32_t DCESEN; + __IO uint32_t DEBESEN; + uint32_t RESERVED0[1]; + __IO uint32_t ACESEN; + uint32_t RESERVED1[7]; +} stc_sdioc_errintsgen_bit_t; + +typedef struct +{ + __IO uint32_t NE; + __IO uint32_t TOE; + __IO uint32_t CE; + __IO uint32_t EBE; + __IO uint32_t IE; + uint32_t RESERVED0[2]; + __IO uint32_t CMDE; + uint32_t RESERVED1[8]; +} stc_sdioc_atcerrst_bit_t; + +typedef struct +{ + __IO uint32_t FNE; + __IO uint32_t FTOE; + __IO uint32_t FCE; + __IO uint32_t FEBE; + __IO uint32_t FIE; + uint32_t RESERVED0[2]; + __IO uint32_t FCMDE; + uint32_t RESERVED1[8]; +} stc_sdioc_fea_bit_t; + +typedef struct +{ + __IO uint32_t FCTOE; + __IO uint32_t FCCE; + __IO uint32_t FCEBE; + __IO uint32_t FCIE; + __IO uint32_t FDTOE; + __IO uint32_t FDCE; + __IO uint32_t FDEBE; + uint32_t RESERVED0[1]; + __IO uint32_t FACE; + uint32_t RESERVED1[7]; +} stc_sdioc_fee_bit_t; + +typedef struct +{ + __IO uint32_t SPIMDS; + __IO uint32_t TXMDS; + uint32_t RESERVED0[1]; + __IO uint32_t MSTR; + __IO uint32_t SPLPBK; + __IO uint32_t SPLPBK2; + __IO uint32_t SPE; + __IO uint32_t CSUSPE; + __IO uint32_t EIE; + __IO uint32_t TXIE; + __IO uint32_t RXIE; + __IO uint32_t IDIE; + __IO uint32_t MODFE; + __IO uint32_t PATE; + __IO uint32_t PAOE; + __IO uint32_t PAE; + uint32_t RESERVED1[16]; +} stc_spi_cr1_bit_t; + +typedef struct +{ + __IO uint32_t FTHLV0; + __IO uint32_t FTHLV1; + uint32_t RESERVED0[4]; + __IO uint32_t SPRDTD; + uint32_t RESERVED1[1]; + __IO uint32_t SS0PV; + __IO uint32_t SS1PV; + __IO uint32_t SS2PV; + __IO uint32_t SS3PV; + uint32_t RESERVED2[8]; + __IO uint32_t MSSI0; + __IO uint32_t MSSI1; + __IO uint32_t MSSI2; + uint32_t RESERVED3[1]; + __IO uint32_t MSSDL0; + __IO uint32_t MSSDL1; + __IO uint32_t MSSDL2; + uint32_t RESERVED4[1]; + __IO uint32_t MIDI0; + __IO uint32_t MIDI1; + __IO uint32_t MIDI2; + uint32_t RESERVED5[1]; +} stc_spi_cfg1_bit_t; + +typedef struct +{ + __IO uint32_t OVRERF; + __IO uint32_t IDLNF; + __IO uint32_t MODFERF; + __IO uint32_t PERF; + __IO uint32_t UDRERF; + __IO uint32_t TDEF; + uint32_t RESERVED0[1]; + __IO uint32_t RDFF; + uint32_t RESERVED1[24]; +} stc_spi_sr_bit_t; + +typedef struct +{ + __IO uint32_t CPHA; + __IO uint32_t CPOL; + __IO uint32_t MBR0; + __IO uint32_t MBR1; + __IO uint32_t MBR2; + __IO uint32_t SSA0; + __IO uint32_t SSA1; + __IO uint32_t SSA2; + __IO uint32_t DSIZE0; + __IO uint32_t DSIZE1; + __IO uint32_t DSIZE2; + __IO uint32_t DSIZE3; + __IO uint32_t LSBF; + __IO uint32_t MIDIE; + __IO uint32_t MSSDLE; + __IO uint32_t MSSIE; + uint32_t RESERVED0[16]; +} stc_spi_cfg2_bit_t; + +typedef struct +{ + __IO uint32_t SRAM123RWT0; + __IO uint32_t SRAM123RWT1; + __IO uint32_t SRAM123RWT2; + uint32_t RESERVED0[1]; + __IO uint32_t SRAM123WWT0; + __IO uint32_t SRAM123WWT1; + __IO uint32_t SRAM123WWT2; + uint32_t RESERVED1[1]; + __IO uint32_t SRAM4RWT0; + __IO uint32_t SRAM4RWT1; + __IO uint32_t SRAM4RWT2; + uint32_t RESERVED2[1]; + __IO uint32_t SRAM4WWT0; + __IO uint32_t SRAM4WWT1; + __IO uint32_t SRAM4WWT2; + uint32_t RESERVED3[1]; + __IO uint32_t SRAMHRWT0; + __IO uint32_t SRAMHRWT1; + __IO uint32_t SRAMHRWT2; + uint32_t RESERVED4[1]; + __IO uint32_t SRAMHWWT0; + __IO uint32_t SRAMHWWT1; + __IO uint32_t SRAMHWWT2; + uint32_t RESERVED5[1]; + __IO uint32_t SRAMBRWT0; + __IO uint32_t SRAMBRWT1; + __IO uint32_t SRAMBRWT2; + uint32_t RESERVED6[1]; + __IO uint32_t SRAMBWWT0; + __IO uint32_t SRAMBWWT1; + __IO uint32_t SRAMBWWT2; + uint32_t RESERVED7[1]; +} stc_sramc_wtcr_bit_t; + +typedef struct +{ + __IO uint32_t WTPRC; + __IO uint32_t WTPRKW0; + __IO uint32_t WTPRKW1; + __IO uint32_t WTPRKW2; + __IO uint32_t WTPRKW3; + __IO uint32_t WTPRKW4; + __IO uint32_t WTPRKW5; + __IO uint32_t WTPRKW6; + uint32_t RESERVED0[24]; +} stc_sramc_wtpr_bit_t; + +typedef struct +{ + __IO uint32_t PYOAD; + uint32_t RESERVED0[15]; + __IO uint32_t ECCOAD; + __IO uint32_t BECCOAD; + uint32_t RESERVED1[6]; + __IO uint32_t ECCMOD0; + __IO uint32_t ECCMOD1; + __IO uint32_t BECCMOD0; + __IO uint32_t BECCMOD1; + uint32_t RESERVED2[4]; +} stc_sramc_ckcr_bit_t; + +typedef struct +{ + __IO uint32_t CKPRC; + __IO uint32_t CKPRKW0; + __IO uint32_t CKPRKW1; + __IO uint32_t CKPRKW2; + __IO uint32_t CKPRKW3; + __IO uint32_t CKPRKW4; + __IO uint32_t CKPRKW5; + __IO uint32_t CKPRKW6; + uint32_t RESERVED0[24]; +} stc_sramc_ckpr_bit_t; + +typedef struct +{ + __IO uint32_t SRAM1_PYERR; + __IO uint32_t SRAM2_PYERR; + __IO uint32_t SRAM3_PYERR; + __IO uint32_t SRAMH_PYERR; + __IO uint32_t SRAM4_1ERR; + __IO uint32_t SRAM4_2ERR; + __IO uint32_t SRAMB_1ERR; + __IO uint32_t SRAMB_2ERR; + __IO uint32_t CACHE_PYERR; + uint32_t RESERVED0[23]; +} stc_sramc_cksr_bit_t; + +typedef struct +{ + __IO uint32_t PERI0; + __IO uint32_t PERI1; + uint32_t RESERVED0[2]; + __IO uint32_t CKS0; + __IO uint32_t CKS1; + __IO uint32_t CKS2; + __IO uint32_t CKS3; + __IO uint32_t WDPT0; + __IO uint32_t WDPT1; + __IO uint32_t WDPT2; + __IO uint32_t WDPT3; + uint32_t RESERVED1[4]; + __IO uint32_t SLPOFF; + uint32_t RESERVED2[14]; + __IO uint32_t ITS; +} stc_swdt_cr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[16]; + __IO uint32_t UDF; + __IO uint32_t REF; + uint32_t RESERVED1[14]; +} stc_swdt_sr_bit_t; + +typedef struct +{ + __IO uint32_t CSTA; + __IO uint32_t CAPMDA; + __IO uint32_t INTENA; + uint32_t RESERVED0[5]; + __IO uint32_t SYNSA; + __IO uint32_t SYNCLKA; + __IO uint32_t ASYNCLKA; + uint32_t RESERVED1[1]; + __IO uint32_t HSTAA; + __IO uint32_t HSTPA; + __IO uint32_t HCLEA; + __IO uint32_t HICPA; + __IO uint32_t CSTB; + __IO uint32_t CAPMDB; + __IO uint32_t INTENB; + uint32_t RESERVED2[5]; + __IO uint32_t SYNSB; + __IO uint32_t SYNCLKB; + __IO uint32_t ASYNCLKB; + uint32_t RESERVED3[1]; + __IO uint32_t HSTAB; + __IO uint32_t HSTPB; + __IO uint32_t HCLEB; + __IO uint32_t HICPB; +} stc_tmr0_bconr_bit_t; + +typedef struct +{ + __IO uint32_t CMFA; + uint32_t RESERVED0[15]; + __IO uint32_t CMFB; + uint32_t RESERVED1[15]; +} stc_tmr0_stflr_bit_t; + +typedef struct +{ + __IO uint32_t CNTA0; + __IO uint32_t CNTA1; + __IO uint32_t CNTA2; + __IO uint32_t CNTA3; + __IO uint32_t CNTA4; + __IO uint32_t CNTA5; + __IO uint32_t CNTA6; + __IO uint32_t CNTA7; + __IO uint32_t CNTA8; + __IO uint32_t CNTA9; + __IO uint32_t CNTA10; + __IO uint32_t CNTA11; + __IO uint32_t CNTA12; + __IO uint32_t CNTA13; + __IO uint32_t CNTA14; + __IO uint32_t CNTA15; + uint32_t RESERVED0[16]; +} stc_tmr2_cntar_bit_t; + +typedef struct +{ + __IO uint32_t CNTB0; + __IO uint32_t CNTB1; + __IO uint32_t CNTB2; + __IO uint32_t CNTB3; + __IO uint32_t CNTB4; + __IO uint32_t CNTB5; + __IO uint32_t CNTB6; + __IO uint32_t CNTB7; + __IO uint32_t CNTB8; + __IO uint32_t CNTB9; + __IO uint32_t CNTB10; + __IO uint32_t CNTB11; + __IO uint32_t CNTB12; + __IO uint32_t CNTB13; + __IO uint32_t CNTB14; + __IO uint32_t CNTB15; + uint32_t RESERVED0[16]; +} stc_tmr2_cntbr_bit_t; + +typedef struct +{ + __IO uint32_t CMPA0; + __IO uint32_t CMPA1; + __IO uint32_t CMPA2; + __IO uint32_t CMPA3; + __IO uint32_t CMPA4; + __IO uint32_t CMPA5; + __IO uint32_t CMPA6; + __IO uint32_t CMPA7; + __IO uint32_t CMPA8; + __IO uint32_t CMPA9; + __IO uint32_t CMPA10; + __IO uint32_t CMPA11; + __IO uint32_t CMPA12; + __IO uint32_t CMPA13; + __IO uint32_t CMPA14; + __IO uint32_t CMPA15; + uint32_t RESERVED0[16]; +} stc_tmr2_cmpar_bit_t; + +typedef struct +{ + __IO uint32_t CMPB0; + __IO uint32_t CMPB1; + __IO uint32_t CMPB2; + __IO uint32_t CMPB3; + __IO uint32_t CMPB4; + __IO uint32_t CMPB5; + __IO uint32_t CMPB6; + __IO uint32_t CMPB7; + __IO uint32_t CMPB8; + __IO uint32_t CMPB9; + __IO uint32_t CMPB10; + __IO uint32_t CMPB11; + __IO uint32_t CMPB12; + __IO uint32_t CMPB13; + __IO uint32_t CMPB14; + __IO uint32_t CMPB15; + uint32_t RESERVED0[16]; +} stc_tmr2_cmpbr_bit_t; + +typedef struct +{ + __IO uint32_t CSTA; + __IO uint32_t CAPMDA; + uint32_t RESERVED0[1]; + __IO uint32_t SYNSA; + __IO uint32_t CKDIVA0; + __IO uint32_t CKDIVA1; + __IO uint32_t CKDIVA2; + __IO uint32_t CKDIVA3; + __IO uint32_t SYNCLKA0; + __IO uint32_t SYNCLKA1; + __IO uint32_t ASYNCLKA0; + __IO uint32_t ASYNCLKA1; + __IO uint32_t SYNCLKAT0; + __IO uint32_t SYNCLKAT1; + uint32_t RESERVED1[2]; + __IO uint32_t CSTB; + __IO uint32_t CAPMDB; + uint32_t RESERVED2[1]; + __IO uint32_t SYNSB; + __IO uint32_t CKDIVB0; + __IO uint32_t CKDIVB1; + __IO uint32_t CKDIVB2; + __IO uint32_t CKDIVB3; + __IO uint32_t SYNCLKB0; + __IO uint32_t SYNCLKB1; + __IO uint32_t ASYNCLKB0; + __IO uint32_t ASYNCLKB1; + __IO uint32_t SYNCLKBT0; + __IO uint32_t SYNCLKBT1; + uint32_t RESERVED3[2]; +} stc_tmr2_bconr_bit_t; + +typedef struct +{ + __IO uint32_t CMENA; + __IO uint32_t OVENA; + uint32_t RESERVED0[14]; + __IO uint32_t CMENB; + __IO uint32_t OVENB; + uint32_t RESERVED1[6]; + __IO uint32_t RESV; + uint32_t RESERVED2[7]; +} stc_tmr2_iconr_bit_t; + +typedef struct +{ + __IO uint32_t STACA0; + __IO uint32_t STACA1; + __IO uint32_t STPCA0; + __IO uint32_t STPCA1; + __IO uint32_t CMPCA0; + __IO uint32_t CMPCA1; + uint32_t RESERVED0[2]; + __IO uint32_t OUTENA; + uint32_t RESERVED1[3]; + __IO uint32_t NOFIENA; + __IO uint32_t NOFICKA0; + __IO uint32_t NOFICKA1; + uint32_t RESERVED2[1]; + __IO uint32_t STACB0; + __IO uint32_t STACB1; + __IO uint32_t STPCB0; + __IO uint32_t STPCB1; + __IO uint32_t CMPCB0; + __IO uint32_t CMPCB1; + uint32_t RESERVED3[2]; + __IO uint32_t OUTENB; + uint32_t RESERVED4[3]; + __IO uint32_t NOFIENB; + __IO uint32_t NOFICKB0; + __IO uint32_t NOFICKB1; + uint32_t RESERVED5[1]; +} stc_tmr2_pconr_bit_t; + +typedef struct +{ + __IO uint32_t HSTAA0; + __IO uint32_t HSTAA1; + __IO uint32_t HSTAA2; + uint32_t RESERVED0[1]; + __IO uint32_t HSTPA0; + __IO uint32_t HSTPA1; + __IO uint32_t HSTPA2; + uint32_t RESERVED1[1]; + __IO uint32_t HCLEA0; + __IO uint32_t HCLEA1; + __IO uint32_t HCLEA2; + uint32_t RESERVED2[1]; + __IO uint32_t HICPA0; + __IO uint32_t HICPA1; + __IO uint32_t HICPA2; + uint32_t RESERVED3[1]; + __IO uint32_t HSTAB0; + __IO uint32_t HSTAB1; + __IO uint32_t HSTAB2; + uint32_t RESERVED4[1]; + __IO uint32_t HSTPB0; + __IO uint32_t HSTPB1; + __IO uint32_t HSTPB2; + uint32_t RESERVED5[1]; + __IO uint32_t HCLEB0; + __IO uint32_t HCLEB1; + __IO uint32_t HCLEB2; + uint32_t RESERVED6[1]; + __IO uint32_t HICPB0; + __IO uint32_t HICPB1; + __IO uint32_t HICPB2; + uint32_t RESERVED7[1]; +} stc_tmr2_hconr_bit_t; + +typedef struct +{ + __IO uint32_t CMFA; + __IO uint32_t OVFA; + uint32_t RESERVED0[14]; + __IO uint32_t CMFB; + __IO uint32_t OVFB; + uint32_t RESERVED1[6]; + __IO uint32_t RESV; + uint32_t RESERVED2[7]; +} stc_tmr2_stflr_bit_t; + +typedef struct +{ + __IO uint32_t OCEH; + __IO uint32_t OCEL; + __IO uint32_t OCPH; + __IO uint32_t OCPL; + __IO uint32_t OCIEH; + __IO uint32_t OCIEL; + __IO uint32_t OCFH; + __IO uint32_t OCFL; + uint32_t RESERVED0[8]; +} stc_tmr4_ocsr_bit_t; + +typedef struct +{ + __IO uint32_t CHBUFEN0; + __IO uint32_t CHBUFEN1; + __IO uint32_t CLBUFEN0; + __IO uint32_t CLBUFEN1; + __IO uint32_t MHBUFEN0; + __IO uint32_t MHBUFEN1; + __IO uint32_t MLBUFEN0; + __IO uint32_t MLBUFEN1; + __IO uint32_t LMCH; + __IO uint32_t LMCL; + __IO uint32_t LMMH; + __IO uint32_t LMML; + __IO uint32_t MCECH; + __IO uint32_t MCECL; + uint32_t RESERVED0[2]; +} stc_tmr4_ocer_bit_t; + +typedef struct +{ + __IO uint32_t OCFDCH; + __IO uint32_t OCFPKH; + __IO uint32_t OCFUCH; + __IO uint32_t OCFZRH; + __IO uint32_t OPDCH0; + __IO uint32_t OPDCH1; + __IO uint32_t OPPKH0; + __IO uint32_t OPPKH1; + __IO uint32_t OPUCH0; + __IO uint32_t OPUCH1; + __IO uint32_t OPZRH0; + __IO uint32_t OPZRH1; + __IO uint32_t OPNPKH0; + __IO uint32_t OPNPKH1; + __IO uint32_t OPNZRH0; + __IO uint32_t OPNZRH1; +} stc_tmr4_ocmrh_bit_t; + +typedef struct +{ + __IO uint32_t OCFDCL; + __IO uint32_t OCFPKL; + __IO uint32_t OCFUCL; + __IO uint32_t OCFZRL; + __IO uint32_t OPDCL0; + __IO uint32_t OPDCL1; + __IO uint32_t OPPKL0; + __IO uint32_t OPPKL1; + __IO uint32_t OPUCL0; + __IO uint32_t OPUCL1; + __IO uint32_t OPZRL0; + __IO uint32_t OPZRL1; + __IO uint32_t OPNPKL0; + __IO uint32_t OPNPKL1; + __IO uint32_t OPNZRL0; + __IO uint32_t OPNZRL1; + __IO uint32_t EOPNDCL0; + __IO uint32_t EOPNDCL1; + __IO uint32_t EOPNUCL0; + __IO uint32_t EOPNUCL1; + __IO uint32_t EOPDCL0; + __IO uint32_t EOPDCL1; + __IO uint32_t EOPPKL0; + __IO uint32_t EOPPKL1; + __IO uint32_t EOPUCL0; + __IO uint32_t EOPUCL1; + __IO uint32_t EOPZRL0; + __IO uint32_t EOPZRL1; + __IO uint32_t EOPNPKL0; + __IO uint32_t EOPNPKL1; + __IO uint32_t EOPNZRL0; + __IO uint32_t EOPNZRL1; +} stc_tmr4_ocmrl_bit_t; + +typedef struct +{ + __IO uint32_t CKDIV0; + __IO uint32_t CKDIV1; + __IO uint32_t CKDIV2; + __IO uint32_t CKDIV3; + __IO uint32_t CLEAR; + __IO uint32_t MODE; + __IO uint32_t STOP; + __IO uint32_t BUFEN; + __IO uint32_t IRQPEN; + __IO uint32_t IRQPF; + uint32_t RESERVED0[3]; + __IO uint32_t IRQZEN; + __IO uint32_t IRQZF; + __IO uint32_t ECKEN; +} stc_tmr4_ccsr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[16]; +} stc_tmr4_cvpr_bit_t; + +typedef struct +{ + __IO uint32_t DIVCK0; + __IO uint32_t DIVCK1; + __IO uint32_t DIVCK2; + uint32_t RESERVED0[1]; + __IO uint32_t PWMMD0; + __IO uint32_t PWMMD1; + __IO uint32_t LVLS0; + __IO uint32_t LVLS1; + uint32_t RESERVED1[8]; +} stc_tmr4_pocr_bit_t; + +typedef struct +{ + __IO uint32_t RTIDU; + __IO uint32_t RTIDV; + __IO uint32_t RTIDW; + uint32_t RESERVED0[1]; + __IO uint32_t RTIFU; + __IO uint32_t RTICU; + __IO uint32_t RTEU; + __IO uint32_t RTSU; + __IO uint32_t RTIFV; + __IO uint32_t RTICV; + __IO uint32_t RTEV; + __IO uint32_t RTSV; + __IO uint32_t RTIFW; + __IO uint32_t RTICW; + __IO uint32_t RTEW; + __IO uint32_t RTSW; +} stc_tmr4_rcsr_bit_t; + +typedef struct +{ + __IO uint32_t BUFEN0; + __IO uint32_t BUFEN1; + __IO uint32_t EVTOS0; + __IO uint32_t EVTOS1; + __IO uint32_t EVTOS2; + __IO uint32_t LMC; + uint32_t RESERVED0[2]; + __IO uint32_t EVTMS; + __IO uint32_t EVTDS; + uint32_t RESERVED1[2]; + __IO uint32_t DEN; + __IO uint32_t PEN; + __IO uint32_t UEN; + __IO uint32_t ZEN; +} stc_tmr4_scsr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[6]; + __IO uint32_t MZCE; + __IO uint32_t MPCE; + uint32_t RESERVED1[8]; +} stc_tmr4_scmr_bit_t; + +typedef struct +{ + __IO uint32_t OEUH; + __IO uint32_t OEUL; + __IO uint32_t OEVH; + __IO uint32_t OEVL; + __IO uint32_t OEWH; + __IO uint32_t OEWL; + __IO uint32_t ODT0; + __IO uint32_t ODT1; + __IO uint32_t MOE; + __IO uint32_t AOE; + uint32_t RESERVED0[6]; + __IO uint32_t OSUH0; + __IO uint32_t OSUH1; + __IO uint32_t OSUL0; + __IO uint32_t OSUL1; + __IO uint32_t OSVH0; + __IO uint32_t OSVH1; + __IO uint32_t OSVL0; + __IO uint32_t OSVL1; + __IO uint32_t OSWH0; + __IO uint32_t OSWH1; + __IO uint32_t OSWL0; + __IO uint32_t OSWL1; + uint32_t RESERVED1[4]; +} stc_tmr4_pscr_bit_t; + +typedef struct +{ + __IO uint32_t EVTRS0; + __IO uint32_t EVTRS1; + __IO uint32_t EVTRS2; + __IO uint32_t PCTS; + uint32_t RESERVED0[12]; +} stc_tmr4_scer_bit_t; + +typedef struct +{ + __IO uint32_t START; + __IO uint32_t DIR; + __IO uint32_t MODE; + uint32_t RESERVED0[1]; + __IO uint32_t CKDIV0; + __IO uint32_t CKDIV1; + __IO uint32_t CKDIV2; + __IO uint32_t CKDIV3; + __IO uint32_t OVSTP; + uint32_t RESERVED1[7]; + __IO uint32_t ZMSKREV; + __IO uint32_t ZMSKPOS; + __IO uint32_t ZMSKVAL0; + __IO uint32_t ZMSKVAL1; + uint32_t RESERVED2[12]; +} stc_tmr6_gconr_bit_t; + +typedef struct +{ + __IO uint32_t INTENA; + __IO uint32_t INTENB; + __IO uint32_t INTENC; + __IO uint32_t INTEND; + __IO uint32_t INTENE; + __IO uint32_t INTENF; + __IO uint32_t INTENOVF; + __IO uint32_t INTENUDF; + __IO uint32_t INTENDTE; + uint32_t RESERVED0[7]; + __IO uint32_t INTENSAU; + __IO uint32_t INTENSAD; + __IO uint32_t INTENSBU; + __IO uint32_t INTENSBD; + uint32_t RESERVED1[12]; +} stc_tmr6_iconr_bit_t; + +typedef struct +{ + __IO uint32_t BENA; + __IO uint32_t BSEA; + __IO uint32_t BTRUA; + __IO uint32_t BTRDA; + __IO uint32_t BENB; + __IO uint32_t BSEB; + __IO uint32_t BTRUB; + __IO uint32_t BTRDB; + __IO uint32_t BENP; + __IO uint32_t BSEP; + __IO uint32_t BTRUP; + __IO uint32_t BTRDP; + uint32_t RESERVED0[4]; + __IO uint32_t BENSPA; + __IO uint32_t BSESPA; + __IO uint32_t BTRUSPA; + __IO uint32_t BTRDSPA; + __IO uint32_t BENSPB; + __IO uint32_t BSESPB; + __IO uint32_t BTRUSPB; + __IO uint32_t BTRDSPB; + uint32_t RESERVED1[8]; +} stc_tmr6_bconr_bit_t; + +typedef struct +{ + __IO uint32_t DTCEN; + __IO uint32_t SEPA; + uint32_t RESERVED0[2]; + __IO uint32_t DTBENU; + __IO uint32_t DTBEND; + __IO uint32_t DTBTRU; + __IO uint32_t DTBTRD; + uint32_t RESERVED1[24]; +} stc_tmr6_dconr_bit_t; + +typedef struct +{ + __IO uint32_t STACA0; + __IO uint32_t STACA1; + __IO uint32_t STPCA0; + __IO uint32_t STPCA1; + __IO uint32_t OVFCA0; + __IO uint32_t OVFCA1; + __IO uint32_t UDFCA0; + __IO uint32_t UDFCA1; + __IO uint32_t CMAUCA0; + __IO uint32_t CMAUCA1; + __IO uint32_t CMADCA0; + __IO uint32_t CMADCA1; + __IO uint32_t CMBUCA0; + __IO uint32_t CMBUCA1; + __IO uint32_t CMBDCA0; + __IO uint32_t CMBDCA1; + __IO uint32_t FORCA0; + __IO uint32_t FORCA1; + uint32_t RESERVED0[2]; + __IO uint32_t EMBCA0; + __IO uint32_t EMBCA1; + __IO uint32_t EMBRA0; + __IO uint32_t EMBRA1; + __IO uint32_t EMBSA0; + __IO uint32_t EMBSA1; + uint32_t RESERVED1[2]; + __IO uint32_t OUTENA; + uint32_t RESERVED2[2]; + __IO uint32_t CAPMDA; +} stc_tmr6_pcnar_bit_t; + +typedef struct +{ + __IO uint32_t STACB0; + __IO uint32_t STACB1; + __IO uint32_t STPCB0; + __IO uint32_t STPCB1; + __IO uint32_t OVFCB0; + __IO uint32_t OVFCB1; + __IO uint32_t UDFCB0; + __IO uint32_t UDFCB1; + __IO uint32_t CMAUCB0; + __IO uint32_t CMAUCB1; + __IO uint32_t CMADCB0; + __IO uint32_t CMADCB1; + __IO uint32_t CMBUCB0; + __IO uint32_t CMBUCB1; + __IO uint32_t CMBDCB0; + __IO uint32_t CMBDCB1; + __IO uint32_t FORCB0; + __IO uint32_t FORCB1; + uint32_t RESERVED0[2]; + __IO uint32_t EMBCB0; + __IO uint32_t EMBCB1; + __IO uint32_t EMBRB0; + __IO uint32_t EMBRB1; + __IO uint32_t EMBSB0; + __IO uint32_t EMBSB1; + uint32_t RESERVED1[2]; + __IO uint32_t OUTENB; + uint32_t RESERVED2[2]; + __IO uint32_t CAPMDB; +} stc_tmr6_pcnbr_bit_t; + +typedef struct +{ + __IO uint32_t NOFIENGA; + __IO uint32_t NOFICKGA0; + __IO uint32_t NOFICKGA1; + uint32_t RESERVED0[1]; + __IO uint32_t NOFIENGB; + __IO uint32_t NOFICKGB0; + __IO uint32_t NOFICKGB1; + uint32_t RESERVED1[25]; +} stc_tmr6_fcngr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[8]; + __IO uint32_t SPPERIA; + __IO uint32_t SPPERIB; + uint32_t RESERVED1[6]; + __IO uint32_t PCNTE0; + __IO uint32_t PCNTE1; + __IO uint32_t PCNTS0; + __IO uint32_t PCNTS1; + __IO uint32_t PCNTS2; + uint32_t RESERVED2[11]; +} stc_tmr6_vperr_bit_t; + +typedef struct +{ + __IO uint32_t CMAF; + __IO uint32_t CMBF; + __IO uint32_t CMCF; + __IO uint32_t CMDF; + __IO uint32_t CMEF; + __IO uint32_t CMFF; + __IO uint32_t OVFF; + __IO uint32_t UDFF; + __IO uint32_t DTEF; + __IO uint32_t CMSAUF; + __IO uint32_t CMSADF; + __IO uint32_t CMSBUF; + __IO uint32_t CMSBDF; + uint32_t RESERVED0[8]; + __IO uint32_t VPERNUM0; + __IO uint32_t VPERNUM1; + __IO uint32_t VPERNUM2; + uint32_t RESERVED1[7]; + __IO uint32_t DIRF; +} stc_tmr6_stflr_bit_t; + +typedef struct +{ + __IO uint32_t HSTA0; + __IO uint32_t HSTA1; + __IO uint32_t HSTA2; + __IO uint32_t HSTA3; + uint32_t RESERVED0[3]; + __IO uint32_t STAS; + __IO uint32_t HSTA8; + __IO uint32_t HSTA9; + __IO uint32_t HSTA10; + __IO uint32_t HSTA11; + uint32_t RESERVED1[4]; + __IO uint32_t HSTA16; + __IO uint32_t HSTA17; + __IO uint32_t HSTA18; + __IO uint32_t HSTA19; + __IO uint32_t HSTA20; + __IO uint32_t HSTA21; + __IO uint32_t HSTA22; + __IO uint32_t HSTA23; + uint32_t RESERVED2[8]; +} stc_tmr6_hstar_bit_t; + +typedef struct +{ + __IO uint32_t HSTP0; + __IO uint32_t HSTP1; + __IO uint32_t HSTP2; + __IO uint32_t HSTP3; + uint32_t RESERVED0[3]; + __IO uint32_t STPS; + __IO uint32_t HSTP8; + __IO uint32_t HSTP9; + __IO uint32_t HSTP10; + __IO uint32_t HSTP11; + uint32_t RESERVED1[4]; + __IO uint32_t HSTP16; + __IO uint32_t HSTP17; + __IO uint32_t HSTP18; + __IO uint32_t HSTP19; + __IO uint32_t HSTP20; + __IO uint32_t HSTP21; + __IO uint32_t HSTP22; + __IO uint32_t HSTP23; + uint32_t RESERVED2[8]; +} stc_tmr6_hstpr_bit_t; + +typedef struct +{ + __IO uint32_t HCLE0; + __IO uint32_t HCLE1; + __IO uint32_t HCLE2; + __IO uint32_t HCLE3; + uint32_t RESERVED0[3]; + __IO uint32_t CLES; + __IO uint32_t HCLE8; + __IO uint32_t HCLE9; + __IO uint32_t HCLE10; + __IO uint32_t HCLE11; + uint32_t RESERVED1[4]; + __IO uint32_t HCLE16; + __IO uint32_t HCLE17; + __IO uint32_t HCLE18; + __IO uint32_t HCLE19; + __IO uint32_t HCLE20; + __IO uint32_t HCLE21; + __IO uint32_t HCLE22; + __IO uint32_t HCLE23; + uint32_t RESERVED2[8]; +} stc_tmr6_hclrr_bit_t; + +typedef struct +{ + __IO uint32_t HUPD0; + __IO uint32_t HUPD1; + __IO uint32_t HUPD2; + __IO uint32_t HUPD3; + uint32_t RESERVED0[3]; + __IO uint32_t UPDS; + __IO uint32_t HUPD8; + __IO uint32_t HUPD9; + __IO uint32_t HUPD10; + __IO uint32_t HUPD11; + uint32_t RESERVED1[4]; + __IO uint32_t HUPD16; + __IO uint32_t HUPD17; + __IO uint32_t HUPD18; + __IO uint32_t HUPD19; + __IO uint32_t HUPD20; + __IO uint32_t HUPD21; + __IO uint32_t HUPD22; + __IO uint32_t HUPD23; + uint32_t RESERVED2[8]; +} stc_tmr6_hupdr_bit_t; + +typedef struct +{ + __IO uint32_t HCPA0; + __IO uint32_t HCPA1; + __IO uint32_t HCPA2; + __IO uint32_t HCPA3; + uint32_t RESERVED0[4]; + __IO uint32_t HCPA8; + __IO uint32_t HCPA9; + __IO uint32_t HCPA10; + __IO uint32_t HCPA11; + uint32_t RESERVED1[4]; + __IO uint32_t HCPA16; + __IO uint32_t HCPA17; + __IO uint32_t HCPA18; + __IO uint32_t HCPA19; + __IO uint32_t HCPA20; + __IO uint32_t HCPA21; + __IO uint32_t HCPA22; + __IO uint32_t HCPA23; + uint32_t RESERVED2[8]; +} stc_tmr6_hcpar_bit_t; + +typedef struct +{ + __IO uint32_t HCPB0; + __IO uint32_t HCPB1; + __IO uint32_t HCPB2; + __IO uint32_t HCPB3; + uint32_t RESERVED0[4]; + __IO uint32_t HCPB8; + __IO uint32_t HCPB9; + __IO uint32_t HCPB10; + __IO uint32_t HCPB11; + uint32_t RESERVED1[4]; + __IO uint32_t HCPB16; + __IO uint32_t HCPB17; + __IO uint32_t HCPB18; + __IO uint32_t HCPB19; + __IO uint32_t HCPB20; + __IO uint32_t HCPB21; + __IO uint32_t HCPB22; + __IO uint32_t HCPB23; + uint32_t RESERVED2[8]; +} stc_tmr6_hcpbr_bit_t; + +typedef struct +{ + __IO uint32_t HCUP0; + __IO uint32_t HCUP1; + __IO uint32_t HCUP2; + __IO uint32_t HCUP3; + __IO uint32_t HCUP4; + __IO uint32_t HCUP5; + __IO uint32_t HCUP6; + __IO uint32_t HCUP7; + __IO uint32_t HCUP8; + __IO uint32_t HCUP9; + __IO uint32_t HCUP10; + __IO uint32_t HCUP11; + uint32_t RESERVED0[4]; + __IO uint32_t HCUP16; + __IO uint32_t HCUP17; + __IO uint32_t HCUP18; + __IO uint32_t HCUP19; + __IO uint32_t HCUP20; + __IO uint32_t HCUP21; + __IO uint32_t HCUP22; + __IO uint32_t HCUP23; + uint32_t RESERVED1[8]; +} stc_tmr6_hcupr_bit_t; + +typedef struct +{ + __IO uint32_t HCDO0; + __IO uint32_t HCDO1; + __IO uint32_t HCDO2; + __IO uint32_t HCDO3; + __IO uint32_t HCDO4; + __IO uint32_t HCDO5; + __IO uint32_t HCDO6; + __IO uint32_t HCDO7; + __IO uint32_t HCDO8; + __IO uint32_t HCDO9; + __IO uint32_t HCDO10; + __IO uint32_t HCDO11; + uint32_t RESERVED0[4]; + __IO uint32_t HCDO16; + __IO uint32_t HCDO17; + __IO uint32_t HCDO18; + __IO uint32_t HCDO19; + __IO uint32_t HCDO20; + __IO uint32_t HCDO21; + __IO uint32_t HCDO22; + __IO uint32_t HCDO23; + uint32_t RESERVED1[8]; +} stc_tmr6_hcdor_bit_t; + +typedef struct +{ + __IO uint32_t NOFIENTA; + __IO uint32_t NOFICKTA0; + __IO uint32_t NOFICKTA1; + uint32_t RESERVED0[1]; + __IO uint32_t NOFIENTB; + __IO uint32_t NOFICKTB0; + __IO uint32_t NOFICKTB1; + uint32_t RESERVED1[1]; + __IO uint32_t NOFIENTC; + __IO uint32_t NOFICKTC0; + __IO uint32_t NOFICKTC1; + uint32_t RESERVED2[1]; + __IO uint32_t NOFIENTD; + __IO uint32_t NOFICKTD0; + __IO uint32_t NOFICKTD1; + uint32_t RESERVED3[17]; +} stc_tmr6_fcntr_bit_t; + +typedef struct +{ + __IO uint32_t SSTA1; + __IO uint32_t SSTA2; + __IO uint32_t SSTA3; + __IO uint32_t SSTA4; + __IO uint32_t SSTA5; + __IO uint32_t SSTA6; + __IO uint32_t SSTA7; + __IO uint32_t SSTA8; + uint32_t RESERVED0[24]; +} stc_tmr6_sstar_bit_t; + +typedef struct +{ + __IO uint32_t SSTP1; + __IO uint32_t SSTP2; + __IO uint32_t SSTP3; + __IO uint32_t SSTP4; + __IO uint32_t SSTP5; + __IO uint32_t SSTP6; + __IO uint32_t SSTP7; + __IO uint32_t SSTP8; + uint32_t RESERVED0[24]; +} stc_tmr6_sstpr_bit_t; + +typedef struct +{ + __IO uint32_t SCLE1; + __IO uint32_t SCLE2; + __IO uint32_t SCLE3; + __IO uint32_t SCLE4; + __IO uint32_t SCLE5; + __IO uint32_t SCLE6; + __IO uint32_t SCLE7; + __IO uint32_t SCLE8; + uint32_t RESERVED0[24]; +} stc_tmr6_sclrr_bit_t; + +typedef struct +{ + __IO uint32_t SUPD1; + __IO uint32_t SUPD2; + __IO uint32_t SUPD3; + __IO uint32_t SUPD4; + __IO uint32_t SUPD5; + __IO uint32_t SUPD6; + __IO uint32_t SUPD7; + __IO uint32_t SUPD8; + uint32_t RESERVED0[24]; +} stc_tmr6_supdr_bit_t; + +typedef struct +{ + __IO uint32_t CNT0; + __IO uint32_t CNT1; + __IO uint32_t CNT2; + __IO uint32_t CNT3; + __IO uint32_t CNT4; + __IO uint32_t CNT5; + __IO uint32_t CNT6; + __IO uint32_t CNT7; + __IO uint32_t CNT8; + __IO uint32_t CNT9; + __IO uint32_t CNT10; + __IO uint32_t CNT11; + __IO uint32_t CNT12; + __IO uint32_t CNT13; + __IO uint32_t CNT14; + __IO uint32_t CNT15; + uint32_t RESERVED0[16]; +} stc_tmra_cnter_bit_t; + +typedef struct +{ + __IO uint32_t PER0; + __IO uint32_t PER1; + __IO uint32_t PER2; + __IO uint32_t PER3; + __IO uint32_t PER4; + __IO uint32_t PER5; + __IO uint32_t PER6; + __IO uint32_t PER7; + __IO uint32_t PER8; + __IO uint32_t PER9; + __IO uint32_t PER10; + __IO uint32_t PER11; + __IO uint32_t PER12; + __IO uint32_t PER13; + __IO uint32_t PER14; + __IO uint32_t PER15; + uint32_t RESERVED0[16]; +} stc_tmra_perar_bit_t; + +typedef struct +{ + __IO uint32_t CMP0; + __IO uint32_t CMP1; + __IO uint32_t CMP2; + __IO uint32_t CMP3; + __IO uint32_t CMP4; + __IO uint32_t CMP5; + __IO uint32_t CMP6; + __IO uint32_t CMP7; + __IO uint32_t CMP8; + __IO uint32_t CMP9; + __IO uint32_t CMP10; + __IO uint32_t CMP11; + __IO uint32_t CMP12; + __IO uint32_t CMP13; + __IO uint32_t CMP14; + __IO uint32_t CMP15; + uint32_t RESERVED0[16]; +} stc_tmra_cmpar1_bit_t; + +typedef struct +{ + __IO uint32_t CMP0; + __IO uint32_t CMP1; + __IO uint32_t CMP2; + __IO uint32_t CMP3; + __IO uint32_t CMP4; + __IO uint32_t CMP5; + __IO uint32_t CMP6; + __IO uint32_t CMP7; + __IO uint32_t CMP8; + __IO uint32_t CMP9; + __IO uint32_t CMP10; + __IO uint32_t CMP11; + __IO uint32_t CMP12; + __IO uint32_t CMP13; + __IO uint32_t CMP14; + __IO uint32_t CMP15; + uint32_t RESERVED0[16]; +} stc_tmra_cmpar2_bit_t; + +typedef struct +{ + __IO uint32_t CMP0; + __IO uint32_t CMP1; + __IO uint32_t CMP2; + __IO uint32_t CMP3; + __IO uint32_t CMP4; + __IO uint32_t CMP5; + __IO uint32_t CMP6; + __IO uint32_t CMP7; + __IO uint32_t CMP8; + __IO uint32_t CMP9; + __IO uint32_t CMP10; + __IO uint32_t CMP11; + __IO uint32_t CMP12; + __IO uint32_t CMP13; + __IO uint32_t CMP14; + __IO uint32_t CMP15; + uint32_t RESERVED0[16]; +} stc_tmra_cmpar3_bit_t; + +typedef struct +{ + __IO uint32_t CMP0; + __IO uint32_t CMP1; + __IO uint32_t CMP2; + __IO uint32_t CMP3; + __IO uint32_t CMP4; + __IO uint32_t CMP5; + __IO uint32_t CMP6; + __IO uint32_t CMP7; + __IO uint32_t CMP8; + __IO uint32_t CMP9; + __IO uint32_t CMP10; + __IO uint32_t CMP11; + __IO uint32_t CMP12; + __IO uint32_t CMP13; + __IO uint32_t CMP14; + __IO uint32_t CMP15; + uint32_t RESERVED0[16]; +} stc_tmra_cmpar4_bit_t; + +typedef struct +{ + __IO uint32_t START; + __IO uint32_t DIR; + __IO uint32_t MODE; + __IO uint32_t SYNST; + __IO uint32_t CKDIV0; + __IO uint32_t CKDIV1; + __IO uint32_t CKDIV2; + __IO uint32_t CKDIV3; + __IO uint32_t OVSTP; + uint32_t RESERVED0[3]; + __IO uint32_t ITENOVF; + __IO uint32_t ITENUDF; + __IO uint32_t OVFF; + __IO uint32_t UDFF; + uint32_t RESERVED1[16]; +} stc_tmra_bcstr_bit_t; + +typedef struct +{ + __IO uint32_t HSTA0; + __IO uint32_t HSTA1; + __IO uint32_t HSTA2; + uint32_t RESERVED0[1]; + __IO uint32_t HSTP0; + __IO uint32_t HSTP1; + __IO uint32_t HSTP2; + uint32_t RESERVED1[1]; + __IO uint32_t HCLE0; + __IO uint32_t HCLE1; + __IO uint32_t HCLE2; + uint32_t RESERVED2[1]; + __IO uint32_t HCLE3; + __IO uint32_t HCLE4; + __IO uint32_t HCLE5; + __IO uint32_t HCLE6; + uint32_t RESERVED3[16]; +} stc_tmra_hconr_bit_t; + +typedef struct +{ + __IO uint32_t HCUP0; + __IO uint32_t HCUP1; + __IO uint32_t HCUP2; + __IO uint32_t HCUP3; + __IO uint32_t HCUP4; + __IO uint32_t HCUP5; + __IO uint32_t HCUP6; + __IO uint32_t HCUP7; + __IO uint32_t HCUP8; + __IO uint32_t HCUP9; + __IO uint32_t HCUP10; + __IO uint32_t HCUP11; + __IO uint32_t HCUP12; + uint32_t RESERVED0[19]; +} stc_tmra_hcupr_bit_t; + +typedef struct +{ + __IO uint32_t HCDO0; + __IO uint32_t HCDO1; + __IO uint32_t HCDO2; + __IO uint32_t HCDO3; + __IO uint32_t HCDO4; + __IO uint32_t HCDO5; + __IO uint32_t HCDO6; + __IO uint32_t HCDO7; + __IO uint32_t HCDO8; + __IO uint32_t HCDO9; + __IO uint32_t HCDO10; + __IO uint32_t HCDO11; + __IO uint32_t HCDO12; + uint32_t RESERVED0[19]; +} stc_tmra_hcdor_bit_t; + +typedef struct +{ + __IO uint32_t ITEN1; + __IO uint32_t ITEN2; + __IO uint32_t ITEN3; + __IO uint32_t ITEN4; + uint32_t RESERVED0[28]; +} stc_tmra_iconr_bit_t; + +typedef struct +{ + __IO uint32_t ETEN1; + __IO uint32_t ETEN2; + __IO uint32_t ETEN3; + __IO uint32_t ETEN4; + uint32_t RESERVED0[28]; +} stc_tmra_econr_bit_t; + +typedef struct +{ + __IO uint32_t NOFIENTG; + __IO uint32_t NOFICKTG0; + __IO uint32_t NOFICKTG1; + uint32_t RESERVED0[5]; + __IO uint32_t NOFIENCA; + __IO uint32_t NOFICKCA0; + __IO uint32_t NOFICKCA1; + uint32_t RESERVED1[1]; + __IO uint32_t NOFIENCB; + __IO uint32_t NOFICKCB0; + __IO uint32_t NOFICKCB1; + uint32_t RESERVED2[17]; +} stc_tmra_fconr_bit_t; + +typedef struct +{ + __IO uint32_t CMPF1; + __IO uint32_t CMPF2; + __IO uint32_t CMPF3; + __IO uint32_t CMPF4; + uint32_t RESERVED0[28]; +} stc_tmra_stflr_bit_t; + +typedef struct +{ + __IO uint32_t BEN; + __IO uint32_t BSE0; + __IO uint32_t BSE1; + uint32_t RESERVED0[29]; +} stc_tmra_bconr_bit_t; + +typedef struct +{ + __IO uint32_t CAPMD; + uint32_t RESERVED0[3]; + __IO uint32_t HICP0; + __IO uint32_t HICP1; + __IO uint32_t HICP2; + uint32_t RESERVED1[1]; + __IO uint32_t HICP3; + __IO uint32_t HICP4; + uint32_t RESERVED2[2]; + __IO uint32_t NOFIENCP; + __IO uint32_t NOFICKCP0; + __IO uint32_t NOFICKCP1; + uint32_t RESERVED3[17]; +} stc_tmra_cconr_bit_t; + +typedef struct +{ + __IO uint32_t STAC0; + __IO uint32_t STAC1; + __IO uint32_t STPC0; + __IO uint32_t STPC1; + __IO uint32_t CMPC0; + __IO uint32_t CMPC1; + __IO uint32_t PERC0; + __IO uint32_t PERC1; + __IO uint32_t FORC0; + __IO uint32_t FORC1; + uint32_t RESERVED0[2]; + __IO uint32_t OUTEN; + uint32_t RESERVED1[19]; +} stc_tmra_pconr_bit_t; + +typedef struct +{ + __IO uint32_t EN; + __IO uint32_t RUN; + uint32_t RESERVED0[30]; +} stc_trng_cr_bit_t; + +typedef struct +{ + __IO uint32_t LOAD; + uint32_t RESERVED0[31]; +} stc_trng_mr_bit_t; + +typedef struct +{ + __IO uint32_t PE; + __IO uint32_t FE; + uint32_t RESERVED0[1]; + __IO uint32_t ORE; + __IO uint32_t BE; + __IO uint32_t RXNE; + __IO uint32_t TC; + __IO uint32_t TXE; + __IO uint32_t RTOF; + __IO uint32_t WKUP; + __IO uint32_t LBD; + uint32_t RESERVED1[5]; + __IO uint32_t MPB; + uint32_t RESERVED2[15]; +} stc_usart_sr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[9]; + __IO uint32_t MPID; + uint32_t RESERVED1[22]; +} stc_usart_dr_bit_t; + +typedef struct +{ + __IO uint32_t RTOE; + __IO uint32_t RTOIE; + __IO uint32_t RE; + __IO uint32_t TE; + __IO uint32_t SLME; + __IO uint32_t RIE; + __IO uint32_t TCIE; + __IO uint32_t TXEIE; + uint32_t RESERVED0[1]; + __IO uint32_t PS; + __IO uint32_t PCE; + uint32_t RESERVED1[1]; + __IO uint32_t M; + uint32_t RESERVED2[2]; + __IO uint32_t OVER8; + __IO uint32_t CPE; + __IO uint32_t CFE; + __IO uint32_t CNF; + __IO uint32_t CORE; + __IO uint32_t CRTOF; + __IO uint32_t CBE; + __IO uint32_t CWKUP; + __IO uint32_t CLBD; + __IO uint32_t MS; + uint32_t RESERVED3[3]; + __IO uint32_t ML; + __IO uint32_t FBME; + __IO uint32_t NFE; + __IO uint32_t SBS; +} stc_usart_cr1_bit_t; + +typedef struct +{ + __IO uint32_t MPE; + __IO uint32_t WKUPIE; + __IO uint32_t BEIE; + __IO uint32_t BEE; + __IO uint32_t LBDIE; + __IO uint32_t LBDL; + __IO uint32_t SBKL0; + __IO uint32_t SBKL1; + __IO uint32_t WKUPE; + uint32_t RESERVED0[2]; + __IO uint32_t CLKC0; + __IO uint32_t CLKC1; + __IO uint32_t STOP; + __IO uint32_t LINEN; + uint32_t RESERVED1[1]; + __IO uint32_t SBK; + __IO uint32_t SBKM; + uint32_t RESERVED2[14]; +} stc_usart_cr2_bit_t; + +typedef struct +{ + uint32_t RESERVED0[3]; + __IO uint32_t HDSEL; + __IO uint32_t LOOP; + __IO uint32_t SCEN; + uint32_t RESERVED1[2]; + __IO uint32_t RTSE; + __IO uint32_t CTSE; + uint32_t RESERVED2[11]; + __IO uint32_t BCN0; + __IO uint32_t BCN1; + __IO uint32_t BCN2; + uint32_t RESERVED3[8]; +} stc_usart_cr3_bit_t; + +typedef struct +{ + __IO uint32_t PSC0; + __IO uint32_t PSC1; + __IO uint32_t LBMPSC0; + __IO uint32_t LBMPSC1; + uint32_t RESERVED0[28]; +} stc_usart_pr_bit_t; + +typedef struct +{ + __IO uint32_t SESREQSCS; + __IO uint32_t SESREQ; + __IO uint32_t VBVALIDOVEN; + __IO uint32_t VBVALIDOVVAL; + __IO uint32_t AVALIDOVEN; + __IO uint32_t AVALIDOVVAL; + __IO uint32_t BVALIDOVEN; + __IO uint32_t BVALIDOVVAL; + __IO uint32_t HSTNEGSCS; + __IO uint32_t HNPREQ; + __IO uint32_t HSTSETHNPEN; + __IO uint32_t DEVHNPEN; + __IO uint32_t EHEN; + uint32_t RESERVED0[2]; + __IO uint32_t DBNCEFLTRBYPASS; + __IO uint32_t CONIDSTS; + __IO uint32_t DBNCTIME; + __IO uint32_t ASESVLD; + __IO uint32_t BSESVLD; + __IO uint32_t OTGVER; + __IO uint32_t CURMOD; + uint32_t RESERVED1[10]; +} stc_usbfs_gotgctl_bit_t; + +typedef struct +{ + uint32_t RESERVED0[2]; + __IO uint32_t SESENDDET; + uint32_t RESERVED1[5]; + __IO uint32_t SESREQSUCSTSCHNG; + __IO uint32_t HSTNEGSUCSTSCHNG; + uint32_t RESERVED2[7]; + __IO uint32_t HSTNEGDET; + __IO uint32_t ADEVTOUTCHG; + __IO uint32_t DBNCEDONE; + uint32_t RESERVED3[12]; +} stc_usbfs_gotgint_bit_t; + +typedef struct +{ + __IO uint32_t GLBLINTRMSK; + __IO uint32_t HBSTLEN0; + __IO uint32_t HBSTLEN1; + __IO uint32_t HBSTLEN2; + __IO uint32_t HBSTLEN3; + __IO uint32_t DMAEN; + uint32_t RESERVED0[1]; + __IO uint32_t NPTXFEMPLVL; + __IO uint32_t PTXFEMPLVL; + uint32_t RESERVED1[12]; + __IO uint32_t REMMEMSUPP; + __IO uint32_t NOTIALLDMAWRIT; + __IO uint32_t AHBSINGLE; + uint32_t RESERVED2[8]; +} stc_usbfs_gahbcfg_bit_t; + +typedef struct +{ + __IO uint32_t TOUTCAL0; + __IO uint32_t TOUTCAL1; + __IO uint32_t TOUTCAL2; + __IO uint32_t PHYIF; + uint32_t RESERVED0[1]; + __IO uint32_t FSINTF; + __IO uint32_t PHYSEL; + uint32_t RESERVED1[1]; + __IO uint32_t SRPCAP; + __IO uint32_t HNPCAP; + __IO uint32_t USBTRDTIM0; + __IO uint32_t USBTRDTIM1; + __IO uint32_t USBTRDTIM2; + __IO uint32_t USBTRDTIM3; + uint32_t RESERVED2[8]; + __IO uint32_t TERMSELDLPULSE; + uint32_t RESERVED3[3]; + __IO uint32_t IC_USBCAP; + uint32_t RESERVED4[1]; + __IO uint32_t TXENDDELAY; + __IO uint32_t FORCEHSTMODE; + __IO uint32_t FORCEDEVMODE; + __IO uint32_t CORRUPTTXPKT; +} stc_usbfs_gusbcfg_bit_t; + +typedef struct +{ + __IO uint32_t CSFTRST; + __IO uint32_t PIUFSSFTRST; + __IO uint32_t FRMCNTRRST; + uint32_t RESERVED0[1]; + __IO uint32_t RXFFLSH; + __IO uint32_t TXFFLSH; + uint32_t RESERVED1[24]; + __IO uint32_t DMAREQ; + __IO uint32_t AHBIDLE; +} stc_usbfs_grstctl_bit_t; + +typedef struct +{ + __IO uint32_t CURMOD; + __IO uint32_t MODEMIS; + __IO uint32_t OTGINT; + __IO uint32_t SOF; + __IO uint32_t RXFLVL; + __IO uint32_t NPTXFEMP; + __IO uint32_t GINNAKEFF; + __IO uint32_t GOUTNAKEFF; + uint32_t RESERVED0[2]; + __IO uint32_t ERLYSUSP; + __IO uint32_t USBSUSP; + __IO uint32_t USBRST; + __IO uint32_t ENUMDONE; + __IO uint32_t ISOOUTDROP; + __IO uint32_t EOPF; + uint32_t RESERVED1[1]; + __IO uint32_t EPMIS; + __IO uint32_t IEPINT; + __IO uint32_t OEPINT; + __IO uint32_t INCOMPISOIN; + __IO uint32_t INCOMPLP; + __IO uint32_t FETSUSP; + __IO uint32_t RESETDET; + __IO uint32_t PRTINT; + __IO uint32_t HCHINT; + __IO uint32_t PTXFEMP; + __IO uint32_t LPM_INT; + __IO uint32_t CONIDSTSCHNG; + __IO uint32_t DISCONNINT; + __IO uint32_t SESSREQINT; + __IO uint32_t WKUPINT; +} stc_usbfs_gintsts_bit_t; + +typedef struct +{ + uint32_t RESERVED0[1]; + __IO uint32_t MODEMISMSK; + __IO uint32_t OTGINTMSK; + __IO uint32_t SOFMSK; + __IO uint32_t RXFLVLMSK; + __IO uint32_t NPTXFEMPMSK; + __IO uint32_t GINNAKEFFMSK; + __IO uint32_t GOUTNAKEFFMSK; + uint32_t RESERVED1[2]; + __IO uint32_t ERLYSUSPMSK; + __IO uint32_t USBSUSPMSK; + __IO uint32_t USBRSTMSK; + __IO uint32_t ENUMDONEMSK; + __IO uint32_t ISOOUTDROPMSK; + __IO uint32_t EOPFMSK; + uint32_t RESERVED2[1]; + __IO uint32_t EPMISMSK; + __IO uint32_t IEPINTMSK; + __IO uint32_t OEPINTMSK; + uint32_t RESERVED3[1]; + __IO uint32_t INCOMPLPMSK; + __IO uint32_t FETSUSPMSK; + __IO uint32_t RESETDETMSK; + __IO uint32_t PRTINTMSK; + __IO uint32_t HCHINTMSK; + __IO uint32_t PTXFEMPMSK; + __IO uint32_t LPM_INTMSK; + __IO uint32_t CONIDSTSCHNGMSK; + __IO uint32_t DISCONNINTMSK; + __IO uint32_t SESSREQINTMSK; + __IO uint32_t WKUPINTMSK; +} stc_usbfs_gintmsk_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t DPID0; + __IO uint32_t DPID1; + __IO uint32_t PKTSTS0; + __IO uint32_t PKTSTS1; + __IO uint32_t PKTSTS2; + __IO uint32_t PKTSTS3; + uint32_t RESERVED1[11]; +} stc_usbfs_grxstsr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t DPID0; + __IO uint32_t DPID1; + __IO uint32_t PKTSTS0; + __IO uint32_t PKTSTS1; + __IO uint32_t PKTSTS2; + __IO uint32_t PKTSTS3; + uint32_t RESERVED1[11]; +} stc_usbfs_grxstsp_bit_t; + +typedef struct +{ + __IO uint32_t RXFDEP0; + __IO uint32_t RXFDEP1; + __IO uint32_t RXFDEP2; + __IO uint32_t RXFDEP3; + __IO uint32_t RXFDEP4; + __IO uint32_t RXFDEP5; + __IO uint32_t RXFDEP6; + __IO uint32_t RXFDEP7; + __IO uint32_t RXFDEP8; + __IO uint32_t RXFDEP9; + uint32_t RESERVED0[22]; +} stc_usbfs_grxfsiz_bit_t; + +typedef struct +{ + uint32_t RESERVED0[24]; + __IO uint32_t NPTXQTOP0; + __IO uint32_t NPTXQTOP1; + __IO uint32_t NPTXQTOP2; + __IO uint32_t NPTXQTOP3; + __IO uint32_t NPTXQTOP4; + __IO uint32_t NPTXQTOP5; + __IO uint32_t NPTXQTOP6; + uint32_t RESERVED1[1]; +} stc_usbfs_gnptxsts_bit_t; + +typedef struct +{ + __IO uint32_t LPMCAP; + __IO uint32_t APPL1RES; + __IO uint32_t HIRD0; + __IO uint32_t HIRD1; + __IO uint32_t HIRD2; + __IO uint32_t HIRD3; + __IO uint32_t BREMOTEWAKE; + __IO uint32_t ENBLSLPM; + __IO uint32_t HIRD_THRES0; + __IO uint32_t HIRD_THRES1; + __IO uint32_t HIRD_THRES2; + __IO uint32_t HIRD_THRES3; + __IO uint32_t HIRD_THRES4; + __IO uint32_t COREL1RES0; + __IO uint32_t COREL1RES1; + __IO uint32_t SLPSTS; + __IO uint32_t L1RESUMEOK; + uint32_t RESERVED0[7]; + __IO uint32_t SNDLPM; + uint32_t RESERVED1[3]; + __IO uint32_t LPM_ENBESL; + __IO uint32_t LPM_RESTORESLPSTS; + uint32_t RESERVED2[2]; +} stc_usbfs_glpmcfg_bit_t; + +typedef struct +{ + __IO uint32_t FSLSPCLKSEL0; + __IO uint32_t FSLSPCLKSEL1; + __IO uint32_t FSLSSUPP; + uint32_t RESERVED0[4]; + __IO uint32_t ENA32KHZS; + uint32_t RESERVED1[23]; + __IO uint32_t MODECHTIMEN; +} stc_usbfs_hcfg_bit_t; + +typedef struct +{ + uint32_t RESERVED0[16]; + __IO uint32_t HFIRRLDCTRL; + uint32_t RESERVED1[15]; +} stc_usbfs_hfir_bit_t; + +typedef struct +{ + uint32_t RESERVED0[24]; + __IO uint32_t PTXQTOP0; + __IO uint32_t PTXQTOP1; + __IO uint32_t PTXQTOP2; + __IO uint32_t PTXQTOP3; + __IO uint32_t PTXQTOP4; + __IO uint32_t PTXQTOP5; + __IO uint32_t PTXQTOP6; + __IO uint32_t PTXQTOP7; +} stc_usbfs_hptxsts_bit_t; + +typedef struct +{ + __IO uint32_t HAINT0; + __IO uint32_t HAINT1; + __IO uint32_t HAINT2; + __IO uint32_t HAINT3; + __IO uint32_t HAINT4; + __IO uint32_t HAINT5; + __IO uint32_t HAINT6; + __IO uint32_t HAINT7; + __IO uint32_t HAINT8; + __IO uint32_t HAINT9; + __IO uint32_t HAINT10; + __IO uint32_t HAINT11; + __IO uint32_t HAINT12; + __IO uint32_t HAINT13; + __IO uint32_t HAINT14; + __IO uint32_t HAINT15; + uint32_t RESERVED0[16]; +} stc_usbfs_haint_bit_t; + +typedef struct +{ + __IO uint32_t HAINTMSK0; + __IO uint32_t HAINTMSK1; + __IO uint32_t HAINTMSK2; + __IO uint32_t HAINTMSK3; + __IO uint32_t HAINTMSK4; + __IO uint32_t HAINTMSK5; + __IO uint32_t HAINTMSK6; + __IO uint32_t HAINTMSK7; + __IO uint32_t HAINTMSK8; + __IO uint32_t HAINTMSK9; + __IO uint32_t HAINTMSK10; + __IO uint32_t HAINTMSK11; + __IO uint32_t HAINTMSK12; + __IO uint32_t HAINTMSK13; + __IO uint32_t HAINTMSK14; + __IO uint32_t HAINTMSK15; + uint32_t RESERVED0[16]; +} stc_usbfs_haintmsk_bit_t; + +typedef struct +{ + __IO uint32_t PRTCONNSTS; + __IO uint32_t PRTCONNDET; + __IO uint32_t PRTENA; + __IO uint32_t PRTENCHNG; + __IO uint32_t PRTOVRCURRACT; + __IO uint32_t PRTOVRCURRCHNG; + __IO uint32_t PRTRES; + __IO uint32_t PRTSUSP; + __IO uint32_t PRTRST; + uint32_t RESERVED0[1]; + __IO uint32_t PRTLNSTS0; + __IO uint32_t PRTLNSTS1; + __IO uint32_t PRTPWR; + __IO uint32_t PRTTSTCTL0; + __IO uint32_t PRTTSTCTL1; + __IO uint32_t PRTTSTCTL2; + __IO uint32_t PRTTSTCTL3; + __IO uint32_t PRTSPD0; + __IO uint32_t PRTSPD1; + uint32_t RESERVED1[13]; +} stc_usbfs_hprt_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t EPDIR; + uint32_t RESERVED1[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t EC0; + __IO uint32_t EC1; + uint32_t RESERVED2[7]; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbfs_hcchar0_bit_t; + +typedef struct +{ + uint32_t RESERVED0[14]; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED1[14]; + __IO uint32_t SPLTENA; +} stc_usbfs_hcsplt0_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbfs_hcint0_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbfs_hcintmsk0_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbfs_hctsiz0_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t EPDIR; + uint32_t RESERVED1[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED2[9]; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbfs_hcchar1_bit_t; + +typedef struct +{ + uint32_t RESERVED0[14]; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED1[14]; + __IO uint32_t SPLTENA; +} stc_usbfs_hcsplt1_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbfs_hcint1_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbfs_hcintmsk1_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbfs_hctsiz1_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t EPDIR; + uint32_t RESERVED1[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED2[9]; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbfs_hcchar2_bit_t; + +typedef struct +{ + uint32_t RESERVED0[14]; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED1[14]; + __IO uint32_t SPLTENA; +} stc_usbfs_hcsplt2_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbfs_hcint2_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbfs_hcintmsk2_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbfs_hctsiz2_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t EPDIR; + uint32_t RESERVED1[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED2[9]; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbfs_hcchar3_bit_t; + +typedef struct +{ + uint32_t RESERVED0[14]; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED1[14]; + __IO uint32_t SPLTENA; +} stc_usbfs_hcsplt3_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbfs_hcint3_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbfs_hcintmsk3_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbfs_hctsiz3_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t EPDIR; + uint32_t RESERVED1[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED2[9]; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbfs_hcchar4_bit_t; + +typedef struct +{ + uint32_t RESERVED0[14]; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED1[14]; + __IO uint32_t SPLTENA; +} stc_usbfs_hcsplt4_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbfs_hcint4_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbfs_hcintmsk4_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbfs_hctsiz4_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t EPDIR; + uint32_t RESERVED1[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED2[9]; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbfs_hcchar5_bit_t; + +typedef struct +{ + uint32_t RESERVED0[14]; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED1[14]; + __IO uint32_t SPLTENA; +} stc_usbfs_hcsplt5_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbfs_hcint5_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbfs_hcintmsk5_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbfs_hctsiz5_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t EPDIR; + uint32_t RESERVED1[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED2[9]; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbfs_hcchar6_bit_t; + +typedef struct +{ + uint32_t RESERVED0[14]; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED1[14]; + __IO uint32_t SPLTENA; +} stc_usbfs_hcsplt6_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbfs_hcint6_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbfs_hcintmsk6_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbfs_hctsiz6_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t EPDIR; + uint32_t RESERVED1[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED2[9]; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbfs_hcchar7_bit_t; + +typedef struct +{ + uint32_t RESERVED0[14]; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED1[14]; + __IO uint32_t SPLTENA; +} stc_usbfs_hcsplt7_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbfs_hcint7_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbfs_hcintmsk7_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbfs_hctsiz7_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t EPDIR; + uint32_t RESERVED1[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED2[9]; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbfs_hcchar8_bit_t; + +typedef struct +{ + uint32_t RESERVED0[14]; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED1[14]; + __IO uint32_t SPLTENA; +} stc_usbfs_hcsplt8_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbfs_hcint8_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbfs_hcintmsk8_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbfs_hctsiz8_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t EPDIR; + uint32_t RESERVED1[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED2[9]; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbfs_hcchar9_bit_t; + +typedef struct +{ + uint32_t RESERVED0[14]; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED1[14]; + __IO uint32_t SPLTENA; +} stc_usbfs_hcsplt9_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbfs_hcint9_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbfs_hcintmsk9_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbfs_hctsiz9_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t EPDIR; + uint32_t RESERVED1[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED2[9]; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbfs_hcchar10_bit_t; + +typedef struct +{ + uint32_t RESERVED0[14]; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED1[14]; + __IO uint32_t SPLTENA; +} stc_usbfs_hcsplt10_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbfs_hcint10_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbfs_hcintmsk10_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbfs_hctsiz10_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t EPDIR; + uint32_t RESERVED1[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED2[9]; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbfs_hcchar11_bit_t; + +typedef struct +{ + uint32_t RESERVED0[14]; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED1[14]; + __IO uint32_t SPLTENA; +} stc_usbfs_hcsplt11_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbfs_hcint11_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbfs_hcintmsk11_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbfs_hctsiz11_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t EPDIR; + uint32_t RESERVED1[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED2[9]; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbfs_hcchar12_bit_t; + +typedef struct +{ + uint32_t RESERVED0[14]; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED1[14]; + __IO uint32_t SPLTENA; +} stc_usbfs_hcsplt12_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbfs_hcint12_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbfs_hcintmsk12_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbfs_hctsiz12_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t EPDIR; + uint32_t RESERVED1[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED2[9]; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbfs_hcchar13_bit_t; + +typedef struct +{ + uint32_t RESERVED0[14]; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED1[14]; + __IO uint32_t SPLTENA; +} stc_usbfs_hcsplt13_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbfs_hcint13_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbfs_hcintmsk13_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbfs_hctsiz13_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t EPDIR; + uint32_t RESERVED1[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED2[9]; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbfs_hcchar14_bit_t; + +typedef struct +{ + uint32_t RESERVED0[14]; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED1[14]; + __IO uint32_t SPLTENA; +} stc_usbfs_hcsplt14_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbfs_hcint14_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbfs_hcintmsk14_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbfs_hctsiz14_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t EPDIR; + uint32_t RESERVED1[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED2[9]; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbfs_hcchar15_bit_t; + +typedef struct +{ + uint32_t RESERVED0[14]; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED1[14]; + __IO uint32_t SPLTENA; +} stc_usbfs_hcsplt15_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbfs_hcint15_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbfs_hcintmsk15_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbfs_hctsiz15_bit_t; + +typedef struct +{ + __IO uint32_t DEVSPD0; + __IO uint32_t DEVSPD1; + __IO uint32_t NZSTSOUTHSHK; + __IO uint32_t ENA32KHZSUSP; + uint32_t RESERVED0[7]; + __IO uint32_t PERFRINT0; + __IO uint32_t PERFRINT1; + uint32_t RESERVED1[1]; + __IO uint32_t XCVRDLY; + __IO uint32_t ERRATICINTMSK; + uint32_t RESERVED2[8]; + __IO uint32_t PERSCHINTVL0; + __IO uint32_t PERSCHINTVL1; + uint32_t RESERVED3[6]; +} stc_usbfs_dcfg_bit_t; + +typedef struct +{ + __IO uint32_t RMTWKUPSIG; + __IO uint32_t SFTDISCON; + __IO uint32_t GNPINNAKSTS; + __IO uint32_t GOUTNAKSTS; + __IO uint32_t TSTCTL0; + __IO uint32_t TSTCTL1; + __IO uint32_t TSTCTL2; + __IO uint32_t SGNPINNAK; + __IO uint32_t CGNPINNAK; + __IO uint32_t SGOUTNAK; + __IO uint32_t CGOUTNAK; + __IO uint32_t PWRONPRGDONE; + uint32_t RESERVED0[3]; + __IO uint32_t IGNRFRMNUM; + __IO uint32_t NAKONBBLE; + uint32_t RESERVED1[1]; + __IO uint32_t DEEPSLEEPBESLREJECT; + __IO uint32_t SERVINT; + uint32_t RESERVED2[12]; +} stc_usbfs_dctl_bit_t; + +typedef struct +{ + __IO uint32_t SUSPSTS; + __IO uint32_t ENUMSPD0; + __IO uint32_t ENUMSPD1; + __IO uint32_t ERRTICERR; + uint32_t RESERVED0[18]; + __IO uint32_t DEVLNSTS0; + __IO uint32_t DEVLNSTS1; + uint32_t RESERVED1[8]; +} stc_usbfs_dsts_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t EPDISBLDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t TIMEOUTMSK; + __IO uint32_t INTKNTXFEMPMSK; + __IO uint32_t INTKNEPMISMSK; + __IO uint32_t INEPNAKEFFMSK; + uint32_t RESERVED0[1]; + __IO uint32_t TXFIFOUNDRNMSK; + uint32_t RESERVED1[4]; + __IO uint32_t NAKMSK; + uint32_t RESERVED2[18]; +} stc_usbfs_diepmsk_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t EPDISBLDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t SETUPMSK; + __IO uint32_t OUTTKNEPDISMSK; + __IO uint32_t STSPHSERCVDMSK; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERRMSK; + uint32_t RESERVED1[3]; + __IO uint32_t BBLEERRMSK; + __IO uint32_t NAKMSK; + __IO uint32_t NYETMSK; + uint32_t RESERVED2[17]; +} stc_usbfs_doepmsk_bit_t; + +typedef struct +{ + __IO uint32_t INEPINT0; + __IO uint32_t INEPINT1; + __IO uint32_t INEPINT2; + __IO uint32_t INEPINT3; + __IO uint32_t INEPINT4; + __IO uint32_t INEPINT5; + __IO uint32_t INEPINT6; + __IO uint32_t INEPINT7; + __IO uint32_t INEPINT8; + __IO uint32_t INEPINT9; + __IO uint32_t INEPINT10; + __IO uint32_t INEPINT11; + __IO uint32_t INEPINT12; + __IO uint32_t INEPINT13; + __IO uint32_t INEPINT14; + __IO uint32_t INEPINT15; + __IO uint32_t OUTEPINT0; + __IO uint32_t OUTEPINT1; + __IO uint32_t OUTEPINT2; + __IO uint32_t OUTEPINT3; + __IO uint32_t OUTEPINT4; + __IO uint32_t OUTEPINT5; + __IO uint32_t OUTEPINT6; + __IO uint32_t OUTEPINT7; + __IO uint32_t OUTEPINT8; + __IO uint32_t OUTEPINT9; + __IO uint32_t OUTEPINT10; + __IO uint32_t OUTEPINT11; + __IO uint32_t OUTEPINT12; + __IO uint32_t OUTEPINT13; + __IO uint32_t OUTEPINT14; + __IO uint32_t OUTEPINT15; +} stc_usbfs_daint_bit_t; + +typedef struct +{ + __IO uint32_t INEPMSK0; + __IO uint32_t INEPMSK1; + __IO uint32_t INEPMSK2; + __IO uint32_t INEPMSK3; + __IO uint32_t INEPMSK4; + __IO uint32_t INEPMSK5; + __IO uint32_t INEPMSK6; + __IO uint32_t INEPMSK7; + __IO uint32_t INEPMSK8; + __IO uint32_t INEPMSK9; + __IO uint32_t INEPMSK10; + __IO uint32_t INEPMSK11; + __IO uint32_t INEPMSK12; + __IO uint32_t INEPMSK13; + __IO uint32_t INEPMSK14; + __IO uint32_t INEPMSK15; + __IO uint32_t OUTEPMSK0; + __IO uint32_t OUTEPMSK1; + __IO uint32_t OUTEPMSK2; + __IO uint32_t OUTEPMSK3; + __IO uint32_t OUTEPMSK4; + __IO uint32_t OUTEPMSK5; + __IO uint32_t OUTEPMSK6; + __IO uint32_t OUTEPMSK7; + __IO uint32_t OUTEPMSK8; + __IO uint32_t OUTEPMSK9; + __IO uint32_t OUTEPMSK10; + __IO uint32_t OUTEPMSK11; + __IO uint32_t OUTEPMSK12; + __IO uint32_t OUTEPMSK13; + __IO uint32_t OUTEPMSK14; + __IO uint32_t OUTEPMSK15; +} stc_usbfs_daintmsk_bit_t; + +typedef struct +{ + __IO uint32_t INEPTXFEMPMSK0; + __IO uint32_t INEPTXFEMPMSK1; + __IO uint32_t INEPTXFEMPMSK2; + __IO uint32_t INEPTXFEMPMSK3; + __IO uint32_t INEPTXFEMPMSK4; + __IO uint32_t INEPTXFEMPMSK5; + __IO uint32_t INEPTXFEMPMSK6; + __IO uint32_t INEPTXFEMPMSK7; + __IO uint32_t INEPTXFEMPMSK8; + __IO uint32_t INEPTXFEMPMSK9; + __IO uint32_t INEPTXFEMPMSK10; + __IO uint32_t INEPTXFEMPMSK11; + __IO uint32_t INEPTXFEMPMSK12; + __IO uint32_t INEPTXFEMPMSK13; + __IO uint32_t INEPTXFEMPMSK14; + __IO uint32_t INEPTXFEMPMSK15; + uint32_t RESERVED0[16]; +} stc_usbfs_diepempmsk_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + uint32_t RESERVED1[1]; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED2[1]; + __IO uint32_t STALL; + uint32_t RESERVED3[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + uint32_t RESERVED4[2]; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_diepctl0_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbfs_diepint0_bit_t; + +typedef struct +{ + __IO uint32_t INEPTXFSPCAVAIL0; + __IO uint32_t INEPTXFSPCAVAIL1; + __IO uint32_t INEPTXFSPCAVAIL2; + __IO uint32_t INEPTXFSPCAVAIL3; + __IO uint32_t INEPTXFSPCAVAIL4; + __IO uint32_t INEPTXFSPCAVAIL5; + __IO uint32_t INEPTXFSPCAVAIL6; + __IO uint32_t INEPTXFSPCAVAIL7; + __IO uint32_t INEPTXFSPCAVAIL8; + __IO uint32_t INEPTXFSPCAVAIL9; + __IO uint32_t INEPTXFSPCAVAIL10; + __IO uint32_t INEPTXFSPCAVAIL11; + __IO uint32_t INEPTXFSPCAVAIL12; + __IO uint32_t INEPTXFSPCAVAIL13; + __IO uint32_t INEPTXFSPCAVAIL14; + __IO uint32_t INEPTXFSPCAVAIL15; + uint32_t RESERVED0[16]; +} stc_usbfs_dtxfsts0_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + uint32_t RESERVED2[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_diepctl1_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbfs_diepint1_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + uint32_t RESERVED2[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_diepctl2_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbfs_diepint2_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + uint32_t RESERVED2[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_diepctl3_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbfs_diepint3_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + uint32_t RESERVED2[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_diepctl4_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbfs_diepint4_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + uint32_t RESERVED2[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_diepctl5_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbfs_diepint5_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + uint32_t RESERVED2[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_diepctl6_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbfs_diepint6_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + uint32_t RESERVED2[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_diepctl7_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbfs_diepint7_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + uint32_t RESERVED2[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_diepctl8_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbfs_diepint8_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + uint32_t RESERVED2[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_diepctl9_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbfs_diepint9_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + uint32_t RESERVED2[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_diepctl10_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbfs_diepint10_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + uint32_t RESERVED2[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_diepctl11_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbfs_diepint11_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + uint32_t RESERVED2[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_diepctl12_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbfs_diepint12_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + uint32_t RESERVED2[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_diepctl13_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbfs_diepint13_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + uint32_t RESERVED2[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_diepctl14_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbfs_diepint14_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + uint32_t RESERVED2[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_diepctl15_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbfs_diepint15_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + uint32_t RESERVED1[1]; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED2[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + uint32_t RESERVED3[2]; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_doepctl0_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbfs_doepint0_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_doepctl1_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbfs_doepint1_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED1[1]; +} stc_usbfs_doeptsiz1_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_doepctl2_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbfs_doepint2_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED1[1]; +} stc_usbfs_doeptsiz2_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_doepctl3_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbfs_doepint3_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED1[1]; +} stc_usbfs_doeptsiz3_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_doepctl4_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbfs_doepint4_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED1[1]; +} stc_usbfs_doeptsiz4_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_doepctl5_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbfs_doepint5_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED1[1]; +} stc_usbfs_doeptsiz5_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_doepctl6_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbfs_doepint6_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED1[1]; +} stc_usbfs_doeptsiz6_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_doepctl7_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbfs_doepint7_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED1[1]; +} stc_usbfs_doeptsiz7_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_doepctl8_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbfs_doepint8_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED1[1]; +} stc_usbfs_doeptsiz8_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_doepctl9_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbfs_doepint9_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED1[1]; +} stc_usbfs_doeptsiz9_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_doepctl10_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbfs_doepint10_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED1[1]; +} stc_usbfs_doeptsiz10_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_doepctl11_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbfs_doepint11_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED1[1]; +} stc_usbfs_doeptsiz11_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_doepctl12_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbfs_doepint12_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED1[1]; +} stc_usbfs_doeptsiz12_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_doepctl13_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbfs_doepint13_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED1[1]; +} stc_usbfs_doeptsiz13_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_doepctl14_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbfs_doepint14_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED1[1]; +} stc_usbfs_doeptsiz14_bit_t; + +typedef struct +{ + uint32_t RESERVED0[15]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbfs_doepctl15_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbfs_doepint15_bit_t; + +typedef struct +{ + uint32_t RESERVED0[29]; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED1[1]; +} stc_usbfs_doeptsiz15_bit_t; + +typedef struct +{ + __IO uint32_t STOPPCLK; + __IO uint32_t GATEHCLK; + __IO uint32_t PWRCLMP; + __IO uint32_t RSTPDWNMODULE; + uint32_t RESERVED0[1]; + __IO uint32_t ENBL_L1GATING; + __IO uint32_t PHYSLEEP; + __IO uint32_t L1SUSPENDED; + __IO uint32_t RESETAFTERSUSP; + uint32_t RESERVED1[23]; +} stc_usbfs_pcgcctl_bit_t; + +typedef struct +{ + __IO uint32_t SESREQSCS; + __IO uint32_t SESREQ; + __IO uint32_t VBVALIDOVEN; + __IO uint32_t VBVALIDOVVAL; + __IO uint32_t AVALIDOVEN; + __IO uint32_t AVALIDOVVAL; + __IO uint32_t BVALIDOVEN; + __IO uint32_t BVALIDOVVAL; + __IO uint32_t HSTNEGSCS; + __IO uint32_t HNPREQ; + __IO uint32_t HSTSETHNPEN; + __IO uint32_t DEVHNPEN; + __IO uint32_t EHEN; + uint32_t RESERVED0[2]; + __IO uint32_t DBNCEFLTRBYPASS; + __IO uint32_t CONIDSTS; + __IO uint32_t DBNCTIME; + __IO uint32_t ASESVLD; + __IO uint32_t BSESVLD; + __IO uint32_t OTGVER; + __IO uint32_t CURMOD; + uint32_t RESERVED1[9]; + __IO uint32_t TESTMODE_CORR_EUSB2; +} stc_usbhs_gotgctl_bit_t; + +typedef struct +{ + uint32_t RESERVED0[2]; + __IO uint32_t SESENDDET; + uint32_t RESERVED1[5]; + __IO uint32_t SESREQSUCSTSCHNG; + __IO uint32_t HSTNEGSUCSTSCHNG; + uint32_t RESERVED2[7]; + __IO uint32_t HSTNEGDET; + __IO uint32_t ADEVTOUTCHG; + __IO uint32_t DBNCEDONE; + uint32_t RESERVED3[12]; +} stc_usbhs_gotgint_bit_t; + +typedef struct +{ + __IO uint32_t GLBLINTRMSK; + __IO uint32_t HBSTLEN0; + __IO uint32_t HBSTLEN1; + __IO uint32_t HBSTLEN2; + __IO uint32_t HBSTLEN3; + __IO uint32_t DMAEN; + uint32_t RESERVED0[1]; + __IO uint32_t NPTXFEMPLVL; + __IO uint32_t PTXFEMPLVL; + uint32_t RESERVED1[12]; + __IO uint32_t REMMEMSUPP; + __IO uint32_t NOTIALLDMAWRIT; + __IO uint32_t AHBSINGLE; + uint32_t RESERVED2[8]; +} stc_usbhs_gahbcfg_bit_t; + +typedef struct +{ + __IO uint32_t TOUTCAL0; + __IO uint32_t TOUTCAL1; + __IO uint32_t TOUTCAL2; + __IO uint32_t PHYIF; + __IO uint32_t ULPI_UTMI_SEL; + __IO uint32_t FSINTF; + __IO uint32_t PHYSEL; + __IO uint32_t DDRSEL; + __IO uint32_t SRPCAP; + __IO uint32_t HNPCAP; + __IO uint32_t USBTRDTIM0; + __IO uint32_t USBTRDTIM1; + __IO uint32_t USBTRDTIM2; + __IO uint32_t USBTRDTIM3; + uint32_t RESERVED0[3]; + __IO uint32_t ULPIFSLS; + __IO uint32_t ULPIAUTORES; + __IO uint32_t ULPICLKSUSM; + __IO uint32_t ULPIEXTVBUSDRV; + __IO uint32_t ULPIEXTVBUSINDICATOR; + __IO uint32_t TERMSELDLPULSE; + __IO uint32_t COMPLEMENT; + __IO uint32_t INDICATOR; + __IO uint32_t ULPI; + __IO uint32_t IC_USBCAP; + uint32_t RESERVED1[1]; + __IO uint32_t TXENDDELAY; + __IO uint32_t FORCEHSTMODE; + __IO uint32_t FORCEDEVMODE; + __IO uint32_t CORRUPTTXPKT; +} stc_usbhs_gusbcfg_bit_t; + +typedef struct +{ + __IO uint32_t CSFTRST; + __IO uint32_t PIUFSSFTRST; + __IO uint32_t FRMCNTRRST; + uint32_t RESERVED0[1]; + __IO uint32_t RXFFLSH; + __IO uint32_t TXFFLSH; + __IO uint32_t TXFNUM0; + __IO uint32_t TXFNUM1; + __IO uint32_t TXFNUM2; + __IO uint32_t TXFNUM3; + __IO uint32_t TXFNUM4; + uint32_t RESERVED1[19]; + __IO uint32_t DMAREQ; + __IO uint32_t AHBIDLE; +} stc_usbhs_grstctl_bit_t; + +typedef struct +{ + __IO uint32_t CURMOD; + __IO uint32_t MODEMIS; + __IO uint32_t OTGINT; + __IO uint32_t SOF; + __IO uint32_t RXFLVL; + __IO uint32_t NPTXFEMP; + __IO uint32_t GINNAKEFF; + __IO uint32_t GOUTNAKEFF; + uint32_t RESERVED0[2]; + __IO uint32_t ERLYSUSP; + __IO uint32_t USBSUSP; + __IO uint32_t USBRST; + __IO uint32_t ENUMDONE; + __IO uint32_t ISOOUTDROP; + __IO uint32_t EOPF; + uint32_t RESERVED1[1]; + __IO uint32_t EPMIS; + __IO uint32_t IEPINT; + __IO uint32_t OEPINT; + __IO uint32_t INCOMPISOIN; + __IO uint32_t INCOMPLP; + __IO uint32_t FETSUSP; + __IO uint32_t RESETDET; + __IO uint32_t PRTINT; + __IO uint32_t HCHINT; + __IO uint32_t PTXFEMP; + __IO uint32_t LPM_INT; + __IO uint32_t CONIDSTSCHNG; + __IO uint32_t DISCONNINT; + __IO uint32_t SESSREQINT; + __IO uint32_t WKUPINT; +} stc_usbhs_gintsts_bit_t; + +typedef struct +{ + uint32_t RESERVED0[1]; + __IO uint32_t MODEMISMSK; + __IO uint32_t OTGINTMSK; + __IO uint32_t SOFMSK; + __IO uint32_t RXFLVLMSK; + __IO uint32_t NPTXFEMPMSK; + __IO uint32_t GINNAKEFFMSK; + __IO uint32_t GOUTNAKEFFMSK; + uint32_t RESERVED1[2]; + __IO uint32_t ERLYSUSPMSK; + __IO uint32_t USBSUSPMSK; + __IO uint32_t USBRSTMSK; + __IO uint32_t ENUMDONEMSK; + __IO uint32_t ISOOUTDROPMSK; + __IO uint32_t EOPFMSK; + uint32_t RESERVED2[1]; + __IO uint32_t EPMISMSK; + __IO uint32_t IEPINTMSK; + __IO uint32_t OEPINTMSK; + uint32_t RESERVED3[1]; + __IO uint32_t INCOMPLPMSK; + __IO uint32_t FETSUSPMSK; + __IO uint32_t RESETDETMSK; + __IO uint32_t PRTINTMSK; + __IO uint32_t HCHINTMSK; + __IO uint32_t PTXFEMPMSK; + __IO uint32_t LPM_INTMSK; + __IO uint32_t CONIDSTSCHNGMSK; + __IO uint32_t DISCONNINTMSK; + __IO uint32_t SESSREQINTMSK; + __IO uint32_t WKUPINTMSK; +} stc_usbhs_gintmsk_bit_t; + +typedef struct +{ + __IO uint32_t CHNUM0; + __IO uint32_t CHNUM1; + __IO uint32_t CHNUM2; + __IO uint32_t CHNUM3; + __IO uint32_t BCNT0; + __IO uint32_t BCNT1; + __IO uint32_t BCNT2; + __IO uint32_t BCNT3; + __IO uint32_t BCNT4; + __IO uint32_t BCNT5; + __IO uint32_t BCNT6; + __IO uint32_t BCNT7; + __IO uint32_t BCNT8; + __IO uint32_t BCNT9; + __IO uint32_t BCNT10; + __IO uint32_t DPID0; + __IO uint32_t DPID1; + __IO uint32_t PKTSTS0; + __IO uint32_t PKTSTS1; + __IO uint32_t PKTSTS2; + __IO uint32_t PKTSTS3; + __IO uint32_t FN0; + __IO uint32_t FN1; + __IO uint32_t FN2; + __IO uint32_t FN3; + uint32_t RESERVED0[7]; +} stc_usbhs_grxstsr_bit_t; + +typedef struct +{ + __IO uint32_t CHNUM0; + __IO uint32_t CHNUM1; + __IO uint32_t CHNUM2; + __IO uint32_t CHNUM3; + __IO uint32_t BCNT0; + __IO uint32_t BCNT1; + __IO uint32_t BCNT2; + __IO uint32_t BCNT3; + __IO uint32_t BCNT4; + __IO uint32_t BCNT5; + __IO uint32_t BCNT6; + __IO uint32_t BCNT7; + __IO uint32_t BCNT8; + __IO uint32_t BCNT9; + __IO uint32_t BCNT10; + __IO uint32_t DPID0; + __IO uint32_t DPID1; + __IO uint32_t PKTSTS0; + __IO uint32_t PKTSTS1; + __IO uint32_t PKTSTS2; + __IO uint32_t PKTSTS3; + __IO uint32_t FN0; + __IO uint32_t FN1; + __IO uint32_t FN2; + __IO uint32_t FN3; + uint32_t RESERVED0[7]; +} stc_usbhs_grxstsp_bit_t; + +typedef struct +{ + __IO uint32_t RXFDEP0; + __IO uint32_t RXFDEP1; + __IO uint32_t RXFDEP2; + __IO uint32_t RXFDEP3; + __IO uint32_t RXFDEP4; + __IO uint32_t RXFDEP5; + __IO uint32_t RXFDEP6; + __IO uint32_t RXFDEP7; + __IO uint32_t RXFDEP8; + __IO uint32_t RXFDEP9; + __IO uint32_t RXFDEP10; + __IO uint32_t RXFDEP11; + uint32_t RESERVED0[20]; +} stc_usbhs_grxfsiz_bit_t; + +typedef struct +{ + __IO uint32_t NPTXFSTADDR0; + __IO uint32_t NPTXFSTADDR1; + __IO uint32_t NPTXFSTADDR2; + __IO uint32_t NPTXFSTADDR3; + __IO uint32_t NPTXFSTADDR4; + __IO uint32_t NPTXFSTADDR5; + __IO uint32_t NPTXFSTADDR6; + __IO uint32_t NPTXFSTADDR7; + __IO uint32_t NPTXFSTADDR8; + __IO uint32_t NPTXFSTADDR9; + __IO uint32_t NPTXFSTADDR10; + __IO uint32_t NPTXFSTADDR11; + uint32_t RESERVED0[4]; + __IO uint32_t NPTXFDEP0; + __IO uint32_t NPTXFDEP1; + __IO uint32_t NPTXFDEP2; + __IO uint32_t NPTXFDEP3; + __IO uint32_t NPTXFDEP4; + __IO uint32_t NPTXFDEP5; + __IO uint32_t NPTXFDEP6; + __IO uint32_t NPTXFDEP7; + __IO uint32_t NPTXFDEP8; + __IO uint32_t NPTXFDEP9; + __IO uint32_t NPTXFDEP10; + __IO uint32_t NPTXFDEP11; + uint32_t RESERVED1[4]; +} stc_usbhs_gnptxfsiz_bit_t; + +typedef struct +{ + __IO uint32_t NPTXFSPCAVAIL0; + __IO uint32_t NPTXFSPCAVAIL1; + __IO uint32_t NPTXFSPCAVAIL2; + __IO uint32_t NPTXFSPCAVAIL3; + __IO uint32_t NPTXFSPCAVAIL4; + __IO uint32_t NPTXFSPCAVAIL5; + __IO uint32_t NPTXFSPCAVAIL6; + __IO uint32_t NPTXFSPCAVAIL7; + __IO uint32_t NPTXFSPCAVAIL8; + __IO uint32_t NPTXFSPCAVAIL9; + __IO uint32_t NPTXFSPCAVAIL10; + __IO uint32_t NPTXFSPCAVAIL11; + __IO uint32_t NPTXFSPCAVAIL12; + __IO uint32_t NPTXFSPCAVAIL13; + __IO uint32_t NPTXFSPCAVAIL14; + __IO uint32_t NPTXFSPCAVAIL15; + __IO uint32_t NPTXQSPCAVAIL0; + __IO uint32_t NPTXQSPCAVAIL1; + __IO uint32_t NPTXQSPCAVAIL2; + __IO uint32_t NPTXQSPCAVAIL3; + __IO uint32_t NPTXQSPCAVAIL4; + __IO uint32_t NPTXQSPCAVAIL5; + __IO uint32_t NPTXQSPCAVAIL6; + __IO uint32_t NPTXQSPCAVAIL7; + __IO uint32_t NPTXQTOP0; + __IO uint32_t NPTXQTOP1; + __IO uint32_t NPTXQTOP2; + __IO uint32_t NPTXQTOP3; + __IO uint32_t NPTXQTOP4; + __IO uint32_t NPTXQTOP5; + __IO uint32_t NPTXQTOP6; + uint32_t RESERVED0[1]; +} stc_usbhs_gnptxsts_bit_t; + +typedef struct +{ + __IO uint32_t REGDATA0; + __IO uint32_t REGDATA1; + __IO uint32_t REGDATA2; + __IO uint32_t REGDATA3; + __IO uint32_t REGDATA4; + __IO uint32_t REGDATA5; + __IO uint32_t REGDATA6; + __IO uint32_t REGDATA7; + __IO uint32_t VCTRL0; + __IO uint32_t VCTRL1; + __IO uint32_t VCTRL2; + __IO uint32_t VCTRL3; + __IO uint32_t VCTRL4; + __IO uint32_t VCTRL5; + __IO uint32_t VCTRL6; + __IO uint32_t VCTRL7; + __IO uint32_t REGADDR0; + __IO uint32_t REGADDR1; + __IO uint32_t REGADDR2; + __IO uint32_t REGADDR3; + __IO uint32_t REGADDR4; + __IO uint32_t REGADDR5; + __IO uint32_t REGWR; + uint32_t RESERVED0[2]; + __IO uint32_t NEWREGREQ; + __IO uint32_t VSTSBSY; + __IO uint32_t VSTSDONE; + uint32_t RESERVED1[4]; +} stc_usbhs_gpvndctl_bit_t; + +typedef struct +{ + __IO uint32_t LPMCAP; + __IO uint32_t APPL1RES; + __IO uint32_t HIRD0; + __IO uint32_t HIRD1; + __IO uint32_t HIRD2; + __IO uint32_t HIRD3; + __IO uint32_t BREMOTEWAKE; + __IO uint32_t ENBLSLPM; + __IO uint32_t HIRD_THRES0; + __IO uint32_t HIRD_THRES1; + __IO uint32_t HIRD_THRES2; + __IO uint32_t HIRD_THRES3; + __IO uint32_t HIRD_THRES4; + __IO uint32_t COREL1RES0; + __IO uint32_t COREL1RES1; + __IO uint32_t SLPSTS; + __IO uint32_t L1RESUMEOK; + __IO uint32_t LPM_CHNL_INDX0; + __IO uint32_t LPM_CHNL_INDX1; + __IO uint32_t LPM_CHNL_INDX2; + __IO uint32_t LPM_CHNL_INDX3; + __IO uint32_t LPM_RETRY_CNT0; + __IO uint32_t LPM_RETRY_CNT1; + __IO uint32_t LPM_RETRY_CNT2; + __IO uint32_t SNDLPM; + __IO uint32_t LPM_RETRYCNT_STS0; + __IO uint32_t LPM_RETRYCNT_STS1; + __IO uint32_t LPM_RETRYCNT_STS2; + __IO uint32_t LPM_ENBESL; + __IO uint32_t LPM_RESTORESLPSTS; + uint32_t RESERVED0[2]; +} stc_usbhs_glpmcfg_bit_t; + +typedef struct +{ + __IO uint32_t GDFIFOCFG0; + __IO uint32_t GDFIFOCFG1; + __IO uint32_t GDFIFOCFG2; + __IO uint32_t GDFIFOCFG3; + __IO uint32_t GDFIFOCFG4; + __IO uint32_t GDFIFOCFG5; + __IO uint32_t GDFIFOCFG6; + __IO uint32_t GDFIFOCFG7; + __IO uint32_t GDFIFOCFG8; + __IO uint32_t GDFIFOCFG9; + __IO uint32_t GDFIFOCFG10; + __IO uint32_t GDFIFOCFG11; + __IO uint32_t GDFIFOCFG12; + __IO uint32_t GDFIFOCFG13; + __IO uint32_t GDFIFOCFG14; + __IO uint32_t GDFIFOCFG15; + __IO uint32_t EPINFOBASEADDR0; + __IO uint32_t EPINFOBASEADDR1; + __IO uint32_t EPINFOBASEADDR2; + __IO uint32_t EPINFOBASEADDR3; + __IO uint32_t EPINFOBASEADDR4; + __IO uint32_t EPINFOBASEADDR5; + __IO uint32_t EPINFOBASEADDR6; + __IO uint32_t EPINFOBASEADDR7; + __IO uint32_t EPINFOBASEADDR8; + __IO uint32_t EPINFOBASEADDR9; + __IO uint32_t EPINFOBASEADDR10; + __IO uint32_t EPINFOBASEADDR11; + __IO uint32_t EPINFOBASEADDR12; + __IO uint32_t EPINFOBASEADDR13; + __IO uint32_t EPINFOBASEADDR14; + __IO uint32_t EPINFOBASEADDR15; +} stc_usbhs_gdfifocfg_bit_t; + +typedef struct +{ + __IO uint32_t PTXFSTADDR0; + __IO uint32_t PTXFSTADDR1; + __IO uint32_t PTXFSTADDR2; + __IO uint32_t PTXFSTADDR3; + __IO uint32_t PTXFSTADDR4; + __IO uint32_t PTXFSTADDR5; + __IO uint32_t PTXFSTADDR6; + __IO uint32_t PTXFSTADDR7; + __IO uint32_t PTXFSTADDR8; + __IO uint32_t PTXFSTADDR9; + __IO uint32_t PTXFSTADDR10; + __IO uint32_t PTXFSTADDR11; + __IO uint32_t PTXFSTADDR12; + uint32_t RESERVED0[3]; + __IO uint32_t PTXFSIZE0; + __IO uint32_t PTXFSIZE1; + __IO uint32_t PTXFSIZE2; + __IO uint32_t PTXFSIZE3; + __IO uint32_t PTXFSIZE4; + __IO uint32_t PTXFSIZE5; + __IO uint32_t PTXFSIZE6; + __IO uint32_t PTXFSIZE7; + __IO uint32_t PTXFSIZE8; + __IO uint32_t PTXFSIZE9; + __IO uint32_t PTXFSIZE10; + __IO uint32_t PTXFSIZE11; + uint32_t RESERVED1[4]; +} stc_usbhs_hptxfsiz_bit_t; + +typedef struct +{ + __IO uint32_t INEPNTXFSTADDR0; + __IO uint32_t INEPNTXFSTADDR1; + __IO uint32_t INEPNTXFSTADDR2; + __IO uint32_t INEPNTXFSTADDR3; + __IO uint32_t INEPNTXFSTADDR4; + __IO uint32_t INEPNTXFSTADDR5; + __IO uint32_t INEPNTXFSTADDR6; + __IO uint32_t INEPNTXFSTADDR7; + __IO uint32_t INEPNTXFSTADDR8; + __IO uint32_t INEPNTXFSTADDR9; + __IO uint32_t INEPNTXFSTADDR10; + __IO uint32_t INEPNTXFSTADDR11; + __IO uint32_t INEPNTXFSTADDR12; + uint32_t RESERVED0[3]; + __IO uint32_t INEPNTXFDEP0; + __IO uint32_t INEPNTXFDEP1; + __IO uint32_t INEPNTXFDEP2; + __IO uint32_t INEPNTXFDEP3; + __IO uint32_t INEPNTXFDEP4; + __IO uint32_t INEPNTXFDEP5; + __IO uint32_t INEPNTXFDEP6; + __IO uint32_t INEPNTXFDEP7; + __IO uint32_t INEPNTXFDEP8; + __IO uint32_t INEPNTXFDEP9; + __IO uint32_t INEPNTXFDEP10; + __IO uint32_t INEPNTXFDEP11; + uint32_t RESERVED1[4]; +} stc_usbhs_dieptxf1_bit_t; + +typedef struct +{ + __IO uint32_t INEPNTXFSTADDR0; + __IO uint32_t INEPNTXFSTADDR1; + __IO uint32_t INEPNTXFSTADDR2; + __IO uint32_t INEPNTXFSTADDR3; + __IO uint32_t INEPNTXFSTADDR4; + __IO uint32_t INEPNTXFSTADDR5; + __IO uint32_t INEPNTXFSTADDR6; + __IO uint32_t INEPNTXFSTADDR7; + __IO uint32_t INEPNTXFSTADDR8; + __IO uint32_t INEPNTXFSTADDR9; + __IO uint32_t INEPNTXFSTADDR10; + __IO uint32_t INEPNTXFSTADDR11; + __IO uint32_t INEPNTXFSTADDR12; + uint32_t RESERVED0[3]; + __IO uint32_t INEPNTXFDEP0; + __IO uint32_t INEPNTXFDEP1; + __IO uint32_t INEPNTXFDEP2; + __IO uint32_t INEPNTXFDEP3; + __IO uint32_t INEPNTXFDEP4; + __IO uint32_t INEPNTXFDEP5; + __IO uint32_t INEPNTXFDEP6; + __IO uint32_t INEPNTXFDEP7; + __IO uint32_t INEPNTXFDEP8; + __IO uint32_t INEPNTXFDEP9; + __IO uint32_t INEPNTXFDEP10; + __IO uint32_t INEPNTXFDEP11; + uint32_t RESERVED1[4]; +} stc_usbhs_dieptxf2_bit_t; + +typedef struct +{ + __IO uint32_t INEPNTXFSTADDR0; + __IO uint32_t INEPNTXFSTADDR1; + __IO uint32_t INEPNTXFSTADDR2; + __IO uint32_t INEPNTXFSTADDR3; + __IO uint32_t INEPNTXFSTADDR4; + __IO uint32_t INEPNTXFSTADDR5; + __IO uint32_t INEPNTXFSTADDR6; + __IO uint32_t INEPNTXFSTADDR7; + __IO uint32_t INEPNTXFSTADDR8; + __IO uint32_t INEPNTXFSTADDR9; + __IO uint32_t INEPNTXFSTADDR10; + __IO uint32_t INEPNTXFSTADDR11; + __IO uint32_t INEPNTXFSTADDR12; + __IO uint32_t INEPNTXFSTADDR13; + uint32_t RESERVED0[2]; + __IO uint32_t INEPNTXFDEP0; + __IO uint32_t INEPNTXFDEP1; + __IO uint32_t INEPNTXFDEP2; + __IO uint32_t INEPNTXFDEP3; + __IO uint32_t INEPNTXFDEP4; + __IO uint32_t INEPNTXFDEP5; + __IO uint32_t INEPNTXFDEP6; + __IO uint32_t INEPNTXFDEP7; + __IO uint32_t INEPNTXFDEP8; + __IO uint32_t INEPNTXFDEP9; + __IO uint32_t INEPNTXFDEP10; + __IO uint32_t INEPNTXFDEP11; + uint32_t RESERVED1[4]; +} stc_usbhs_dieptxf3_bit_t; + +typedef struct +{ + __IO uint32_t INEPNTXFSTADDR0; + __IO uint32_t INEPNTXFSTADDR1; + __IO uint32_t INEPNTXFSTADDR2; + __IO uint32_t INEPNTXFSTADDR3; + __IO uint32_t INEPNTXFSTADDR4; + __IO uint32_t INEPNTXFSTADDR5; + __IO uint32_t INEPNTXFSTADDR6; + __IO uint32_t INEPNTXFSTADDR7; + __IO uint32_t INEPNTXFSTADDR8; + __IO uint32_t INEPNTXFSTADDR9; + __IO uint32_t INEPNTXFSTADDR10; + __IO uint32_t INEPNTXFSTADDR11; + __IO uint32_t INEPNTXFSTADDR12; + __IO uint32_t INEPNTXFSTADDR13; + uint32_t RESERVED0[2]; + __IO uint32_t INEPNTXFDEP0; + __IO uint32_t INEPNTXFDEP1; + __IO uint32_t INEPNTXFDEP2; + __IO uint32_t INEPNTXFDEP3; + __IO uint32_t INEPNTXFDEP4; + __IO uint32_t INEPNTXFDEP5; + __IO uint32_t INEPNTXFDEP6; + __IO uint32_t INEPNTXFDEP7; + __IO uint32_t INEPNTXFDEP8; + __IO uint32_t INEPNTXFDEP9; + __IO uint32_t INEPNTXFDEP10; + __IO uint32_t INEPNTXFDEP11; + uint32_t RESERVED1[4]; +} stc_usbhs_dieptxf4_bit_t; + +typedef struct +{ + __IO uint32_t INEPNTXFSTADDR0; + __IO uint32_t INEPNTXFSTADDR1; + __IO uint32_t INEPNTXFSTADDR2; + __IO uint32_t INEPNTXFSTADDR3; + __IO uint32_t INEPNTXFSTADDR4; + __IO uint32_t INEPNTXFSTADDR5; + __IO uint32_t INEPNTXFSTADDR6; + __IO uint32_t INEPNTXFSTADDR7; + __IO uint32_t INEPNTXFSTADDR8; + __IO uint32_t INEPNTXFSTADDR9; + __IO uint32_t INEPNTXFSTADDR10; + __IO uint32_t INEPNTXFSTADDR11; + __IO uint32_t INEPNTXFSTADDR12; + __IO uint32_t INEPNTXFSTADDR13; + uint32_t RESERVED0[2]; + __IO uint32_t INEPNTXFDEP0; + __IO uint32_t INEPNTXFDEP1; + __IO uint32_t INEPNTXFDEP2; + __IO uint32_t INEPNTXFDEP3; + __IO uint32_t INEPNTXFDEP4; + __IO uint32_t INEPNTXFDEP5; + __IO uint32_t INEPNTXFDEP6; + __IO uint32_t INEPNTXFDEP7; + __IO uint32_t INEPNTXFDEP8; + __IO uint32_t INEPNTXFDEP9; + __IO uint32_t INEPNTXFDEP10; + __IO uint32_t INEPNTXFDEP11; + uint32_t RESERVED1[4]; +} stc_usbhs_dieptxf5_bit_t; + +typedef struct +{ + __IO uint32_t INEPNTXFSTADDR0; + __IO uint32_t INEPNTXFSTADDR1; + __IO uint32_t INEPNTXFSTADDR2; + __IO uint32_t INEPNTXFSTADDR3; + __IO uint32_t INEPNTXFSTADDR4; + __IO uint32_t INEPNTXFSTADDR5; + __IO uint32_t INEPNTXFSTADDR6; + __IO uint32_t INEPNTXFSTADDR7; + __IO uint32_t INEPNTXFSTADDR8; + __IO uint32_t INEPNTXFSTADDR9; + __IO uint32_t INEPNTXFSTADDR10; + __IO uint32_t INEPNTXFSTADDR11; + __IO uint32_t INEPNTXFSTADDR12; + __IO uint32_t INEPNTXFSTADDR13; + uint32_t RESERVED0[2]; + __IO uint32_t INEPNTXFDEP0; + __IO uint32_t INEPNTXFDEP1; + __IO uint32_t INEPNTXFDEP2; + __IO uint32_t INEPNTXFDEP3; + __IO uint32_t INEPNTXFDEP4; + __IO uint32_t INEPNTXFDEP5; + __IO uint32_t INEPNTXFDEP6; + __IO uint32_t INEPNTXFDEP7; + __IO uint32_t INEPNTXFDEP8; + __IO uint32_t INEPNTXFDEP9; + __IO uint32_t INEPNTXFDEP10; + __IO uint32_t INEPNTXFDEP11; + uint32_t RESERVED1[4]; +} stc_usbhs_dieptxf6_bit_t; + +typedef struct +{ + __IO uint32_t INEPNTXFSTADDR0; + __IO uint32_t INEPNTXFSTADDR1; + __IO uint32_t INEPNTXFSTADDR2; + __IO uint32_t INEPNTXFSTADDR3; + __IO uint32_t INEPNTXFSTADDR4; + __IO uint32_t INEPNTXFSTADDR5; + __IO uint32_t INEPNTXFSTADDR6; + __IO uint32_t INEPNTXFSTADDR7; + __IO uint32_t INEPNTXFSTADDR8; + __IO uint32_t INEPNTXFSTADDR9; + __IO uint32_t INEPNTXFSTADDR10; + __IO uint32_t INEPNTXFSTADDR11; + __IO uint32_t INEPNTXFSTADDR12; + __IO uint32_t INEPNTXFSTADDR13; + __IO uint32_t INEPNTXFSTADDR14; + uint32_t RESERVED0[1]; + __IO uint32_t INEPNTXFDEP0; + __IO uint32_t INEPNTXFDEP1; + __IO uint32_t INEPNTXFDEP2; + __IO uint32_t INEPNTXFDEP3; + __IO uint32_t INEPNTXFDEP4; + __IO uint32_t INEPNTXFDEP5; + __IO uint32_t INEPNTXFDEP6; + __IO uint32_t INEPNTXFDEP7; + __IO uint32_t INEPNTXFDEP8; + __IO uint32_t INEPNTXFDEP9; + __IO uint32_t INEPNTXFDEP10; + __IO uint32_t INEPNTXFDEP11; + uint32_t RESERVED1[4]; +} stc_usbhs_dieptxf7_bit_t; + +typedef struct +{ + __IO uint32_t INEPNTXFSTADDR0; + __IO uint32_t INEPNTXFSTADDR1; + __IO uint32_t INEPNTXFSTADDR2; + __IO uint32_t INEPNTXFSTADDR3; + __IO uint32_t INEPNTXFSTADDR4; + __IO uint32_t INEPNTXFSTADDR5; + __IO uint32_t INEPNTXFSTADDR6; + __IO uint32_t INEPNTXFSTADDR7; + __IO uint32_t INEPNTXFSTADDR8; + __IO uint32_t INEPNTXFSTADDR9; + __IO uint32_t INEPNTXFSTADDR10; + __IO uint32_t INEPNTXFSTADDR11; + __IO uint32_t INEPNTXFSTADDR12; + __IO uint32_t INEPNTXFSTADDR13; + __IO uint32_t INEPNTXFSTADDR14; + uint32_t RESERVED0[1]; + __IO uint32_t INEPNTXFDEP0; + __IO uint32_t INEPNTXFDEP1; + __IO uint32_t INEPNTXFDEP2; + __IO uint32_t INEPNTXFDEP3; + __IO uint32_t INEPNTXFDEP4; + __IO uint32_t INEPNTXFDEP5; + __IO uint32_t INEPNTXFDEP6; + __IO uint32_t INEPNTXFDEP7; + __IO uint32_t INEPNTXFDEP8; + __IO uint32_t INEPNTXFDEP9; + __IO uint32_t INEPNTXFDEP10; + __IO uint32_t INEPNTXFDEP11; + uint32_t RESERVED1[4]; +} stc_usbhs_dieptxf8_bit_t; + +typedef struct +{ + __IO uint32_t INEPNTXFSTADDR0; + __IO uint32_t INEPNTXFSTADDR1; + __IO uint32_t INEPNTXFSTADDR2; + __IO uint32_t INEPNTXFSTADDR3; + __IO uint32_t INEPNTXFSTADDR4; + __IO uint32_t INEPNTXFSTADDR5; + __IO uint32_t INEPNTXFSTADDR6; + __IO uint32_t INEPNTXFSTADDR7; + __IO uint32_t INEPNTXFSTADDR8; + __IO uint32_t INEPNTXFSTADDR9; + __IO uint32_t INEPNTXFSTADDR10; + __IO uint32_t INEPNTXFSTADDR11; + __IO uint32_t INEPNTXFSTADDR12; + __IO uint32_t INEPNTXFSTADDR13; + __IO uint32_t INEPNTXFSTADDR14; + uint32_t RESERVED0[1]; + __IO uint32_t INEPNTXFDEP0; + __IO uint32_t INEPNTXFDEP1; + __IO uint32_t INEPNTXFDEP2; + __IO uint32_t INEPNTXFDEP3; + __IO uint32_t INEPNTXFDEP4; + __IO uint32_t INEPNTXFDEP5; + __IO uint32_t INEPNTXFDEP6; + __IO uint32_t INEPNTXFDEP7; + __IO uint32_t INEPNTXFDEP8; + __IO uint32_t INEPNTXFDEP9; + __IO uint32_t INEPNTXFDEP10; + __IO uint32_t INEPNTXFDEP11; + uint32_t RESERVED1[4]; +} stc_usbhs_dieptxf9_bit_t; + +typedef struct +{ + __IO uint32_t INEPNTXFSTADDR0; + __IO uint32_t INEPNTXFSTADDR1; + __IO uint32_t INEPNTXFSTADDR2; + __IO uint32_t INEPNTXFSTADDR3; + __IO uint32_t INEPNTXFSTADDR4; + __IO uint32_t INEPNTXFSTADDR5; + __IO uint32_t INEPNTXFSTADDR6; + __IO uint32_t INEPNTXFSTADDR7; + __IO uint32_t INEPNTXFSTADDR8; + __IO uint32_t INEPNTXFSTADDR9; + __IO uint32_t INEPNTXFSTADDR10; + __IO uint32_t INEPNTXFSTADDR11; + __IO uint32_t INEPNTXFSTADDR12; + __IO uint32_t INEPNTXFSTADDR13; + __IO uint32_t INEPNTXFSTADDR14; + uint32_t RESERVED0[1]; + __IO uint32_t INEPNTXFDEP0; + __IO uint32_t INEPNTXFDEP1; + __IO uint32_t INEPNTXFDEP2; + __IO uint32_t INEPNTXFDEP3; + __IO uint32_t INEPNTXFDEP4; + __IO uint32_t INEPNTXFDEP5; + __IO uint32_t INEPNTXFDEP6; + __IO uint32_t INEPNTXFDEP7; + __IO uint32_t INEPNTXFDEP8; + __IO uint32_t INEPNTXFDEP9; + __IO uint32_t INEPNTXFDEP10; + __IO uint32_t INEPNTXFDEP11; + uint32_t RESERVED1[4]; +} stc_usbhs_dieptxf10_bit_t; + +typedef struct +{ + __IO uint32_t INEPNTXFSTADDR0; + __IO uint32_t INEPNTXFSTADDR1; + __IO uint32_t INEPNTXFSTADDR2; + __IO uint32_t INEPNTXFSTADDR3; + __IO uint32_t INEPNTXFSTADDR4; + __IO uint32_t INEPNTXFSTADDR5; + __IO uint32_t INEPNTXFSTADDR6; + __IO uint32_t INEPNTXFSTADDR7; + __IO uint32_t INEPNTXFSTADDR8; + __IO uint32_t INEPNTXFSTADDR9; + __IO uint32_t INEPNTXFSTADDR10; + __IO uint32_t INEPNTXFSTADDR11; + __IO uint32_t INEPNTXFSTADDR12; + __IO uint32_t INEPNTXFSTADDR13; + __IO uint32_t INEPNTXFSTADDR14; + uint32_t RESERVED0[1]; + __IO uint32_t INEPNTXFDEP0; + __IO uint32_t INEPNTXFDEP1; + __IO uint32_t INEPNTXFDEP2; + __IO uint32_t INEPNTXFDEP3; + __IO uint32_t INEPNTXFDEP4; + __IO uint32_t INEPNTXFDEP5; + __IO uint32_t INEPNTXFDEP6; + __IO uint32_t INEPNTXFDEP7; + __IO uint32_t INEPNTXFDEP8; + __IO uint32_t INEPNTXFDEP9; + __IO uint32_t INEPNTXFDEP10; + __IO uint32_t INEPNTXFDEP11; + uint32_t RESERVED1[4]; +} stc_usbhs_dieptxf11_bit_t; + +typedef struct +{ + __IO uint32_t INEPNTXFSTADDR0; + __IO uint32_t INEPNTXFSTADDR1; + __IO uint32_t INEPNTXFSTADDR2; + __IO uint32_t INEPNTXFSTADDR3; + __IO uint32_t INEPNTXFSTADDR4; + __IO uint32_t INEPNTXFSTADDR5; + __IO uint32_t INEPNTXFSTADDR6; + __IO uint32_t INEPNTXFSTADDR7; + __IO uint32_t INEPNTXFSTADDR8; + __IO uint32_t INEPNTXFSTADDR9; + __IO uint32_t INEPNTXFSTADDR10; + __IO uint32_t INEPNTXFSTADDR11; + __IO uint32_t INEPNTXFSTADDR12; + __IO uint32_t INEPNTXFSTADDR13; + __IO uint32_t INEPNTXFSTADDR14; + uint32_t RESERVED0[1]; + __IO uint32_t INEPNTXFDEP0; + __IO uint32_t INEPNTXFDEP1; + __IO uint32_t INEPNTXFDEP2; + __IO uint32_t INEPNTXFDEP3; + __IO uint32_t INEPNTXFDEP4; + __IO uint32_t INEPNTXFDEP5; + __IO uint32_t INEPNTXFDEP6; + __IO uint32_t INEPNTXFDEP7; + __IO uint32_t INEPNTXFDEP8; + __IO uint32_t INEPNTXFDEP9; + __IO uint32_t INEPNTXFDEP10; + __IO uint32_t INEPNTXFDEP11; + uint32_t RESERVED1[4]; +} stc_usbhs_dieptxf12_bit_t; + +typedef struct +{ + __IO uint32_t INEPNTXFSTADDR0; + __IO uint32_t INEPNTXFSTADDR1; + __IO uint32_t INEPNTXFSTADDR2; + __IO uint32_t INEPNTXFSTADDR3; + __IO uint32_t INEPNTXFSTADDR4; + __IO uint32_t INEPNTXFSTADDR5; + __IO uint32_t INEPNTXFSTADDR6; + __IO uint32_t INEPNTXFSTADDR7; + __IO uint32_t INEPNTXFSTADDR8; + __IO uint32_t INEPNTXFSTADDR9; + __IO uint32_t INEPNTXFSTADDR10; + __IO uint32_t INEPNTXFSTADDR11; + __IO uint32_t INEPNTXFSTADDR12; + __IO uint32_t INEPNTXFSTADDR13; + __IO uint32_t INEPNTXFSTADDR14; + uint32_t RESERVED0[1]; + __IO uint32_t INEPNTXFDEP0; + __IO uint32_t INEPNTXFDEP1; + __IO uint32_t INEPNTXFDEP2; + __IO uint32_t INEPNTXFDEP3; + __IO uint32_t INEPNTXFDEP4; + __IO uint32_t INEPNTXFDEP5; + __IO uint32_t INEPNTXFDEP6; + __IO uint32_t INEPNTXFDEP7; + __IO uint32_t INEPNTXFDEP8; + __IO uint32_t INEPNTXFDEP9; + __IO uint32_t INEPNTXFDEP10; + __IO uint32_t INEPNTXFDEP11; + uint32_t RESERVED1[4]; +} stc_usbhs_dieptxf13_bit_t; + +typedef struct +{ + __IO uint32_t INEPNTXFSTADDR0; + __IO uint32_t INEPNTXFSTADDR1; + __IO uint32_t INEPNTXFSTADDR2; + __IO uint32_t INEPNTXFSTADDR3; + __IO uint32_t INEPNTXFSTADDR4; + __IO uint32_t INEPNTXFSTADDR5; + __IO uint32_t INEPNTXFSTADDR6; + __IO uint32_t INEPNTXFSTADDR7; + __IO uint32_t INEPNTXFSTADDR8; + __IO uint32_t INEPNTXFSTADDR9; + __IO uint32_t INEPNTXFSTADDR10; + __IO uint32_t INEPNTXFSTADDR11; + __IO uint32_t INEPNTXFSTADDR12; + __IO uint32_t INEPNTXFSTADDR13; + __IO uint32_t INEPNTXFSTADDR14; + uint32_t RESERVED0[1]; + __IO uint32_t INEPNTXFDEP0; + __IO uint32_t INEPNTXFDEP1; + __IO uint32_t INEPNTXFDEP2; + __IO uint32_t INEPNTXFDEP3; + __IO uint32_t INEPNTXFDEP4; + __IO uint32_t INEPNTXFDEP5; + __IO uint32_t INEPNTXFDEP6; + __IO uint32_t INEPNTXFDEP7; + __IO uint32_t INEPNTXFDEP8; + __IO uint32_t INEPNTXFDEP9; + __IO uint32_t INEPNTXFDEP10; + __IO uint32_t INEPNTXFDEP11; + uint32_t RESERVED1[4]; +} stc_usbhs_dieptxf14_bit_t; + +typedef struct +{ + __IO uint32_t INEPNTXFSTADDR0; + __IO uint32_t INEPNTXFSTADDR1; + __IO uint32_t INEPNTXFSTADDR2; + __IO uint32_t INEPNTXFSTADDR3; + __IO uint32_t INEPNTXFSTADDR4; + __IO uint32_t INEPNTXFSTADDR5; + __IO uint32_t INEPNTXFSTADDR6; + __IO uint32_t INEPNTXFSTADDR7; + __IO uint32_t INEPNTXFSTADDR8; + __IO uint32_t INEPNTXFSTADDR9; + __IO uint32_t INEPNTXFSTADDR10; + __IO uint32_t INEPNTXFSTADDR11; + __IO uint32_t INEPNTXFSTADDR12; + __IO uint32_t INEPNTXFSTADDR13; + __IO uint32_t INEPNTXFSTADDR14; + __IO uint32_t INEPNTXFSTADDR15; + __IO uint32_t INEPNTXFDEP0; + __IO uint32_t INEPNTXFDEP1; + __IO uint32_t INEPNTXFDEP2; + __IO uint32_t INEPNTXFDEP3; + __IO uint32_t INEPNTXFDEP4; + __IO uint32_t INEPNTXFDEP5; + __IO uint32_t INEPNTXFDEP6; + __IO uint32_t INEPNTXFDEP7; + __IO uint32_t INEPNTXFDEP8; + __IO uint32_t INEPNTXFDEP9; + __IO uint32_t INEPNTXFDEP10; + __IO uint32_t INEPNTXFDEP11; + uint32_t RESERVED0[4]; +} stc_usbhs_dieptxf15_bit_t; + +typedef struct +{ + __IO uint32_t FSLSPCLKSEL0; + __IO uint32_t FSLSPCLKSEL1; + __IO uint32_t FSLSSUPP; + uint32_t RESERVED0[4]; + __IO uint32_t ENA32KHZS; + __IO uint32_t RESVALID0; + __IO uint32_t RESVALID1; + __IO uint32_t RESVALID2; + __IO uint32_t RESVALID3; + __IO uint32_t RESVALID4; + __IO uint32_t RESVALID5; + __IO uint32_t RESVALID6; + __IO uint32_t RESVALID7; + uint32_t RESERVED1[15]; + __IO uint32_t MODECHTIMEN; +} stc_usbhs_hcfg_bit_t; + +typedef struct +{ + __IO uint32_t FRINT0; + __IO uint32_t FRINT1; + __IO uint32_t FRINT2; + __IO uint32_t FRINT3; + __IO uint32_t FRINT4; + __IO uint32_t FRINT5; + __IO uint32_t FRINT6; + __IO uint32_t FRINT7; + __IO uint32_t FRINT8; + __IO uint32_t FRINT9; + __IO uint32_t FRINT10; + __IO uint32_t FRINT11; + __IO uint32_t FRINT12; + __IO uint32_t FRINT13; + __IO uint32_t FRINT14; + __IO uint32_t FRINT15; + __IO uint32_t HFIRRLDCTRL; + uint32_t RESERVED0[15]; +} stc_usbhs_hfir_bit_t; + +typedef struct +{ + __IO uint32_t FRNUM0; + __IO uint32_t FRNUM1; + __IO uint32_t FRNUM2; + __IO uint32_t FRNUM3; + __IO uint32_t FRNUM4; + __IO uint32_t FRNUM5; + __IO uint32_t FRNUM6; + __IO uint32_t FRNUM7; + __IO uint32_t FRNUM8; + __IO uint32_t FRNUM9; + __IO uint32_t FRNUM10; + __IO uint32_t FRNUM11; + __IO uint32_t FRNUM12; + __IO uint32_t FRNUM13; + __IO uint32_t FRNUM14; + __IO uint32_t FRNUM15; + __IO uint32_t FRREM0; + __IO uint32_t FRREM1; + __IO uint32_t FRREM2; + __IO uint32_t FRREM3; + __IO uint32_t FRREM4; + __IO uint32_t FRREM5; + __IO uint32_t FRREM6; + __IO uint32_t FRREM7; + __IO uint32_t FRREM8; + __IO uint32_t FRREM9; + __IO uint32_t FRREM10; + __IO uint32_t FRREM11; + __IO uint32_t FRREM12; + __IO uint32_t FRREM13; + __IO uint32_t FRREM14; + __IO uint32_t FRREM15; +} stc_usbhs_hfnum_bit_t; + +typedef struct +{ + __IO uint32_t PTXFSPCAVAIL0; + __IO uint32_t PTXFSPCAVAIL1; + __IO uint32_t PTXFSPCAVAIL2; + __IO uint32_t PTXFSPCAVAIL3; + __IO uint32_t PTXFSPCAVAIL4; + __IO uint32_t PTXFSPCAVAIL5; + __IO uint32_t PTXFSPCAVAIL6; + __IO uint32_t PTXFSPCAVAIL7; + __IO uint32_t PTXFSPCAVAIL8; + __IO uint32_t PTXFSPCAVAIL9; + __IO uint32_t PTXFSPCAVAIL10; + __IO uint32_t PTXFSPCAVAIL11; + __IO uint32_t PTXFSPCAVAIL12; + __IO uint32_t PTXFSPCAVAIL13; + __IO uint32_t PTXFSPCAVAIL14; + __IO uint32_t PTXFSPCAVAIL15; + __IO uint32_t PTXQSPCAVAIL0; + __IO uint32_t PTXQSPCAVAIL1; + __IO uint32_t PTXQSPCAVAIL2; + __IO uint32_t PTXQSPCAVAIL3; + __IO uint32_t PTXQSPCAVAIL4; + __IO uint32_t PTXQSPCAVAIL5; + __IO uint32_t PTXQSPCAVAIL6; + __IO uint32_t PTXQSPCAVAIL7; + __IO uint32_t PTXQTOP0; + __IO uint32_t PTXQTOP1; + __IO uint32_t PTXQTOP2; + __IO uint32_t PTXQTOP3; + __IO uint32_t PTXQTOP4; + __IO uint32_t PTXQTOP5; + __IO uint32_t PTXQTOP6; + __IO uint32_t PTXQTOP7; +} stc_usbhs_hptxsts_bit_t; + +typedef struct +{ + __IO uint32_t HAINT0; + __IO uint32_t HAINT1; + __IO uint32_t HAINT2; + __IO uint32_t HAINT3; + __IO uint32_t HAINT4; + __IO uint32_t HAINT5; + __IO uint32_t HAINT6; + __IO uint32_t HAINT7; + __IO uint32_t HAINT8; + __IO uint32_t HAINT9; + __IO uint32_t HAINT10; + __IO uint32_t HAINT11; + __IO uint32_t HAINT12; + __IO uint32_t HAINT13; + __IO uint32_t HAINT14; + __IO uint32_t HAINT15; + uint32_t RESERVED0[16]; +} stc_usbhs_haint_bit_t; + +typedef struct +{ + __IO uint32_t HAINTMSK0; + __IO uint32_t HAINTMSK1; + __IO uint32_t HAINTMSK2; + __IO uint32_t HAINTMSK3; + __IO uint32_t HAINTMSK4; + __IO uint32_t HAINTMSK5; + __IO uint32_t HAINTMSK6; + __IO uint32_t HAINTMSK7; + __IO uint32_t HAINTMSK8; + __IO uint32_t HAINTMSK9; + __IO uint32_t HAINTMSK10; + __IO uint32_t HAINTMSK11; + __IO uint32_t HAINTMSK12; + __IO uint32_t HAINTMSK13; + __IO uint32_t HAINTMSK14; + __IO uint32_t HAINTMSK15; + uint32_t RESERVED0[16]; +} stc_usbhs_haintmsk_bit_t; + +typedef struct +{ + __IO uint32_t PRTCONNSTS; + __IO uint32_t PRTCONNDET; + __IO uint32_t PRTENA; + __IO uint32_t PRTENCHNG; + __IO uint32_t PRTOVRCURRACT; + __IO uint32_t PRTOVRCURRCHNG; + __IO uint32_t PRTRES; + __IO uint32_t PRTSUSP; + __IO uint32_t PRTRST; + uint32_t RESERVED0[1]; + __IO uint32_t PRTLNSTS0; + __IO uint32_t PRTLNSTS1; + __IO uint32_t PRTPWR; + __IO uint32_t PRTTSTCTL0; + __IO uint32_t PRTTSTCTL1; + __IO uint32_t PRTTSTCTL2; + __IO uint32_t PRTTSTCTL3; + __IO uint32_t PRTSPD0; + __IO uint32_t PRTSPD1; + uint32_t RESERVED1[13]; +} stc_usbhs_hprt_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + __IO uint32_t EPNUM0; + __IO uint32_t EPNUM1; + __IO uint32_t EPNUM2; + __IO uint32_t EPNUM3; + __IO uint32_t EPDIR; + uint32_t RESERVED0[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t EC0; + __IO uint32_t EC1; + __IO uint32_t DEVADDR0; + __IO uint32_t DEVADDR1; + __IO uint32_t DEVADDR2; + __IO uint32_t DEVADDR3; + __IO uint32_t DEVADDR4; + __IO uint32_t DEVADDR5; + __IO uint32_t DEVADDR6; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbhs_hcchar0_bit_t; + +typedef struct +{ + __IO uint32_t PRTADDR0; + __IO uint32_t PRTADDR1; + __IO uint32_t PRTADDR2; + __IO uint32_t PRTADDR3; + __IO uint32_t PRTADDR4; + __IO uint32_t PRTADDR5; + __IO uint32_t PRTADDR6; + __IO uint32_t HUBADDR0; + __IO uint32_t HUBADDR1; + __IO uint32_t HUBADDR2; + __IO uint32_t HUBADDR3; + __IO uint32_t HUBADDR4; + __IO uint32_t HUBADDR5; + __IO uint32_t HUBADDR6; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED0[14]; + __IO uint32_t SPLTENA; +} stc_usbhs_hcsplt0_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbhs_hcint0_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbhs_hcintmsk0_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbhs_hctsiz0_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + __IO uint32_t EPNUM0; + __IO uint32_t EPNUM1; + __IO uint32_t EPNUM2; + __IO uint32_t EPNUM3; + __IO uint32_t EPDIR; + uint32_t RESERVED0[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t EC0; + __IO uint32_t EC1; + __IO uint32_t DEVADDR0; + __IO uint32_t DEVADDR1; + __IO uint32_t DEVADDR2; + __IO uint32_t DEVADDR3; + __IO uint32_t DEVADDR4; + __IO uint32_t DEVADDR5; + __IO uint32_t DEVADDR6; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbhs_hcchar1_bit_t; + +typedef struct +{ + __IO uint32_t PRTADDR0; + __IO uint32_t PRTADDR1; + __IO uint32_t PRTADDR2; + __IO uint32_t PRTADDR3; + __IO uint32_t PRTADDR4; + __IO uint32_t PRTADDR5; + __IO uint32_t PRTADDR6; + __IO uint32_t HUBADDR0; + __IO uint32_t HUBADDR1; + __IO uint32_t HUBADDR2; + __IO uint32_t HUBADDR3; + __IO uint32_t HUBADDR4; + __IO uint32_t HUBADDR5; + __IO uint32_t HUBADDR6; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED0[14]; + __IO uint32_t SPLTENA; +} stc_usbhs_hcsplt1_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbhs_hcint1_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbhs_hcintmsk1_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbhs_hctsiz1_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + __IO uint32_t EPNUM0; + __IO uint32_t EPNUM1; + __IO uint32_t EPNUM2; + __IO uint32_t EPNUM3; + __IO uint32_t EPDIR; + uint32_t RESERVED0[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t EC0; + __IO uint32_t EC1; + __IO uint32_t DEVADDR0; + __IO uint32_t DEVADDR1; + __IO uint32_t DEVADDR2; + __IO uint32_t DEVADDR3; + __IO uint32_t DEVADDR4; + __IO uint32_t DEVADDR5; + __IO uint32_t DEVADDR6; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbhs_hcchar2_bit_t; + +typedef struct +{ + __IO uint32_t PRTADDR0; + __IO uint32_t PRTADDR1; + __IO uint32_t PRTADDR2; + __IO uint32_t PRTADDR3; + __IO uint32_t PRTADDR4; + __IO uint32_t PRTADDR5; + __IO uint32_t PRTADDR6; + __IO uint32_t HUBADDR0; + __IO uint32_t HUBADDR1; + __IO uint32_t HUBADDR2; + __IO uint32_t HUBADDR3; + __IO uint32_t HUBADDR4; + __IO uint32_t HUBADDR5; + __IO uint32_t HUBADDR6; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED0[14]; + __IO uint32_t SPLTENA; +} stc_usbhs_hcsplt2_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbhs_hcint2_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbhs_hcintmsk2_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbhs_hctsiz2_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + __IO uint32_t EPNUM0; + __IO uint32_t EPNUM1; + __IO uint32_t EPNUM2; + __IO uint32_t EPNUM3; + __IO uint32_t EPDIR; + uint32_t RESERVED0[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t EC0; + __IO uint32_t EC1; + __IO uint32_t DEVADDR0; + __IO uint32_t DEVADDR1; + __IO uint32_t DEVADDR2; + __IO uint32_t DEVADDR3; + __IO uint32_t DEVADDR4; + __IO uint32_t DEVADDR5; + __IO uint32_t DEVADDR6; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbhs_hcchar3_bit_t; + +typedef struct +{ + __IO uint32_t PRTADDR0; + __IO uint32_t PRTADDR1; + __IO uint32_t PRTADDR2; + __IO uint32_t PRTADDR3; + __IO uint32_t PRTADDR4; + __IO uint32_t PRTADDR5; + __IO uint32_t PRTADDR6; + __IO uint32_t HUBADDR0; + __IO uint32_t HUBADDR1; + __IO uint32_t HUBADDR2; + __IO uint32_t HUBADDR3; + __IO uint32_t HUBADDR4; + __IO uint32_t HUBADDR5; + __IO uint32_t HUBADDR6; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED0[14]; + __IO uint32_t SPLTENA; +} stc_usbhs_hcsplt3_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbhs_hcint3_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbhs_hcintmsk3_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbhs_hctsiz3_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + __IO uint32_t EPNUM0; + __IO uint32_t EPNUM1; + __IO uint32_t EPNUM2; + __IO uint32_t EPNUM3; + __IO uint32_t EPDIR; + uint32_t RESERVED0[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t EC0; + __IO uint32_t EC1; + __IO uint32_t DEVADDR0; + __IO uint32_t DEVADDR1; + __IO uint32_t DEVADDR2; + __IO uint32_t DEVADDR3; + __IO uint32_t DEVADDR4; + __IO uint32_t DEVADDR5; + __IO uint32_t DEVADDR6; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbhs_hcchar4_bit_t; + +typedef struct +{ + __IO uint32_t PRTADDR0; + __IO uint32_t PRTADDR1; + __IO uint32_t PRTADDR2; + __IO uint32_t PRTADDR3; + __IO uint32_t PRTADDR4; + __IO uint32_t PRTADDR5; + __IO uint32_t PRTADDR6; + __IO uint32_t HUBADDR0; + __IO uint32_t HUBADDR1; + __IO uint32_t HUBADDR2; + __IO uint32_t HUBADDR3; + __IO uint32_t HUBADDR4; + __IO uint32_t HUBADDR5; + __IO uint32_t HUBADDR6; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED0[14]; + __IO uint32_t SPLTENA; +} stc_usbhs_hcsplt4_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbhs_hcint4_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbhs_hcintmsk4_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbhs_hctsiz4_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + __IO uint32_t EPNUM0; + __IO uint32_t EPNUM1; + __IO uint32_t EPNUM2; + __IO uint32_t EPNUM3; + __IO uint32_t EPDIR; + uint32_t RESERVED0[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t EC0; + __IO uint32_t EC1; + __IO uint32_t DEVADDR0; + __IO uint32_t DEVADDR1; + __IO uint32_t DEVADDR2; + __IO uint32_t DEVADDR3; + __IO uint32_t DEVADDR4; + __IO uint32_t DEVADDR5; + __IO uint32_t DEVADDR6; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbhs_hcchar5_bit_t; + +typedef struct +{ + __IO uint32_t PRTADDR0; + __IO uint32_t PRTADDR1; + __IO uint32_t PRTADDR2; + __IO uint32_t PRTADDR3; + __IO uint32_t PRTADDR4; + __IO uint32_t PRTADDR5; + __IO uint32_t PRTADDR6; + __IO uint32_t HUBADDR0; + __IO uint32_t HUBADDR1; + __IO uint32_t HUBADDR2; + __IO uint32_t HUBADDR3; + __IO uint32_t HUBADDR4; + __IO uint32_t HUBADDR5; + __IO uint32_t HUBADDR6; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED0[14]; + __IO uint32_t SPLTENA; +} stc_usbhs_hcsplt5_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbhs_hcint5_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbhs_hcintmsk5_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbhs_hctsiz5_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + __IO uint32_t EPNUM0; + __IO uint32_t EPNUM1; + __IO uint32_t EPNUM2; + __IO uint32_t EPNUM3; + __IO uint32_t EPDIR; + uint32_t RESERVED0[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t EC0; + __IO uint32_t EC1; + __IO uint32_t DEVADDR0; + __IO uint32_t DEVADDR1; + __IO uint32_t DEVADDR2; + __IO uint32_t DEVADDR3; + __IO uint32_t DEVADDR4; + __IO uint32_t DEVADDR5; + __IO uint32_t DEVADDR6; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbhs_hcchar6_bit_t; + +typedef struct +{ + __IO uint32_t PRTADDR0; + __IO uint32_t PRTADDR1; + __IO uint32_t PRTADDR2; + __IO uint32_t PRTADDR3; + __IO uint32_t PRTADDR4; + __IO uint32_t PRTADDR5; + __IO uint32_t PRTADDR6; + __IO uint32_t HUBADDR0; + __IO uint32_t HUBADDR1; + __IO uint32_t HUBADDR2; + __IO uint32_t HUBADDR3; + __IO uint32_t HUBADDR4; + __IO uint32_t HUBADDR5; + __IO uint32_t HUBADDR6; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED0[14]; + __IO uint32_t SPLTENA; +} stc_usbhs_hcsplt6_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbhs_hcint6_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbhs_hcintmsk6_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbhs_hctsiz6_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + __IO uint32_t EPNUM0; + __IO uint32_t EPNUM1; + __IO uint32_t EPNUM2; + __IO uint32_t EPNUM3; + __IO uint32_t EPDIR; + uint32_t RESERVED0[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t EC0; + __IO uint32_t EC1; + __IO uint32_t DEVADDR0; + __IO uint32_t DEVADDR1; + __IO uint32_t DEVADDR2; + __IO uint32_t DEVADDR3; + __IO uint32_t DEVADDR4; + __IO uint32_t DEVADDR5; + __IO uint32_t DEVADDR6; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbhs_hcchar7_bit_t; + +typedef struct +{ + __IO uint32_t PRTADDR0; + __IO uint32_t PRTADDR1; + __IO uint32_t PRTADDR2; + __IO uint32_t PRTADDR3; + __IO uint32_t PRTADDR4; + __IO uint32_t PRTADDR5; + __IO uint32_t PRTADDR6; + __IO uint32_t HUBADDR0; + __IO uint32_t HUBADDR1; + __IO uint32_t HUBADDR2; + __IO uint32_t HUBADDR3; + __IO uint32_t HUBADDR4; + __IO uint32_t HUBADDR5; + __IO uint32_t HUBADDR6; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED0[14]; + __IO uint32_t SPLTENA; +} stc_usbhs_hcsplt7_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbhs_hcint7_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbhs_hcintmsk7_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbhs_hctsiz7_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + __IO uint32_t EPNUM0; + __IO uint32_t EPNUM1; + __IO uint32_t EPNUM2; + __IO uint32_t EPNUM3; + __IO uint32_t EPDIR; + uint32_t RESERVED0[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t EC0; + __IO uint32_t EC1; + __IO uint32_t DEVADDR0; + __IO uint32_t DEVADDR1; + __IO uint32_t DEVADDR2; + __IO uint32_t DEVADDR3; + __IO uint32_t DEVADDR4; + __IO uint32_t DEVADDR5; + __IO uint32_t DEVADDR6; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbhs_hcchar8_bit_t; + +typedef struct +{ + __IO uint32_t PRTADDR0; + __IO uint32_t PRTADDR1; + __IO uint32_t PRTADDR2; + __IO uint32_t PRTADDR3; + __IO uint32_t PRTADDR4; + __IO uint32_t PRTADDR5; + __IO uint32_t PRTADDR6; + __IO uint32_t HUBADDR0; + __IO uint32_t HUBADDR1; + __IO uint32_t HUBADDR2; + __IO uint32_t HUBADDR3; + __IO uint32_t HUBADDR4; + __IO uint32_t HUBADDR5; + __IO uint32_t HUBADDR6; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED0[14]; + __IO uint32_t SPLTENA; +} stc_usbhs_hcsplt8_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbhs_hcint8_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbhs_hcintmsk8_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbhs_hctsiz8_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + __IO uint32_t EPNUM0; + __IO uint32_t EPNUM1; + __IO uint32_t EPNUM2; + __IO uint32_t EPNUM3; + __IO uint32_t EPDIR; + uint32_t RESERVED0[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t EC0; + __IO uint32_t EC1; + __IO uint32_t DEVADDR0; + __IO uint32_t DEVADDR1; + __IO uint32_t DEVADDR2; + __IO uint32_t DEVADDR3; + __IO uint32_t DEVADDR4; + __IO uint32_t DEVADDR5; + __IO uint32_t DEVADDR6; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbhs_hcchar9_bit_t; + +typedef struct +{ + __IO uint32_t PRTADDR0; + __IO uint32_t PRTADDR1; + __IO uint32_t PRTADDR2; + __IO uint32_t PRTADDR3; + __IO uint32_t PRTADDR4; + __IO uint32_t PRTADDR5; + __IO uint32_t PRTADDR6; + __IO uint32_t HUBADDR0; + __IO uint32_t HUBADDR1; + __IO uint32_t HUBADDR2; + __IO uint32_t HUBADDR3; + __IO uint32_t HUBADDR4; + __IO uint32_t HUBADDR5; + __IO uint32_t HUBADDR6; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED0[14]; + __IO uint32_t SPLTENA; +} stc_usbhs_hcsplt9_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbhs_hcint9_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbhs_hcintmsk9_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbhs_hctsiz9_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + __IO uint32_t EPNUM0; + __IO uint32_t EPNUM1; + __IO uint32_t EPNUM2; + __IO uint32_t EPNUM3; + __IO uint32_t EPDIR; + uint32_t RESERVED0[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t EC0; + __IO uint32_t EC1; + __IO uint32_t DEVADDR0; + __IO uint32_t DEVADDR1; + __IO uint32_t DEVADDR2; + __IO uint32_t DEVADDR3; + __IO uint32_t DEVADDR4; + __IO uint32_t DEVADDR5; + __IO uint32_t DEVADDR6; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbhs_hcchar10_bit_t; + +typedef struct +{ + __IO uint32_t PRTADDR0; + __IO uint32_t PRTADDR1; + __IO uint32_t PRTADDR2; + __IO uint32_t PRTADDR3; + __IO uint32_t PRTADDR4; + __IO uint32_t PRTADDR5; + __IO uint32_t PRTADDR6; + __IO uint32_t HUBADDR0; + __IO uint32_t HUBADDR1; + __IO uint32_t HUBADDR2; + __IO uint32_t HUBADDR3; + __IO uint32_t HUBADDR4; + __IO uint32_t HUBADDR5; + __IO uint32_t HUBADDR6; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED0[14]; + __IO uint32_t SPLTENA; +} stc_usbhs_hcsplt10_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbhs_hcint10_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbhs_hcintmsk10_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbhs_hctsiz10_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + __IO uint32_t EPNUM0; + __IO uint32_t EPNUM1; + __IO uint32_t EPNUM2; + __IO uint32_t EPNUM3; + __IO uint32_t EPDIR; + uint32_t RESERVED0[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t EC0; + __IO uint32_t EC1; + __IO uint32_t DEVADDR0; + __IO uint32_t DEVADDR1; + __IO uint32_t DEVADDR2; + __IO uint32_t DEVADDR3; + __IO uint32_t DEVADDR4; + __IO uint32_t DEVADDR5; + __IO uint32_t DEVADDR6; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbhs_hcchar11_bit_t; + +typedef struct +{ + __IO uint32_t PRTADDR0; + __IO uint32_t PRTADDR1; + __IO uint32_t PRTADDR2; + __IO uint32_t PRTADDR3; + __IO uint32_t PRTADDR4; + __IO uint32_t PRTADDR5; + __IO uint32_t PRTADDR6; + __IO uint32_t HUBADDR0; + __IO uint32_t HUBADDR1; + __IO uint32_t HUBADDR2; + __IO uint32_t HUBADDR3; + __IO uint32_t HUBADDR4; + __IO uint32_t HUBADDR5; + __IO uint32_t HUBADDR6; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED0[14]; + __IO uint32_t SPLTENA; +} stc_usbhs_hcsplt11_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbhs_hcint11_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbhs_hcintmsk11_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbhs_hctsiz11_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + __IO uint32_t EPNUM0; + __IO uint32_t EPNUM1; + __IO uint32_t EPNUM2; + __IO uint32_t EPNUM3; + __IO uint32_t EPDIR; + uint32_t RESERVED0[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t EC0; + __IO uint32_t EC1; + __IO uint32_t DEVADDR0; + __IO uint32_t DEVADDR1; + __IO uint32_t DEVADDR2; + __IO uint32_t DEVADDR3; + __IO uint32_t DEVADDR4; + __IO uint32_t DEVADDR5; + __IO uint32_t DEVADDR6; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbhs_hcchar12_bit_t; + +typedef struct +{ + __IO uint32_t PRTADDR0; + __IO uint32_t PRTADDR1; + __IO uint32_t PRTADDR2; + __IO uint32_t PRTADDR3; + __IO uint32_t PRTADDR4; + __IO uint32_t PRTADDR5; + __IO uint32_t PRTADDR6; + __IO uint32_t HUBADDR0; + __IO uint32_t HUBADDR1; + __IO uint32_t HUBADDR2; + __IO uint32_t HUBADDR3; + __IO uint32_t HUBADDR4; + __IO uint32_t HUBADDR5; + __IO uint32_t HUBADDR6; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED0[14]; + __IO uint32_t SPLTENA; +} stc_usbhs_hcsplt12_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbhs_hcint12_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbhs_hcintmsk12_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbhs_hctsiz12_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + __IO uint32_t EPNUM0; + __IO uint32_t EPNUM1; + __IO uint32_t EPNUM2; + __IO uint32_t EPNUM3; + __IO uint32_t EPDIR; + uint32_t RESERVED0[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t EC0; + __IO uint32_t EC1; + __IO uint32_t DEVADDR0; + __IO uint32_t DEVADDR1; + __IO uint32_t DEVADDR2; + __IO uint32_t DEVADDR3; + __IO uint32_t DEVADDR4; + __IO uint32_t DEVADDR5; + __IO uint32_t DEVADDR6; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbhs_hcchar13_bit_t; + +typedef struct +{ + __IO uint32_t PRTADDR0; + __IO uint32_t PRTADDR1; + __IO uint32_t PRTADDR2; + __IO uint32_t PRTADDR3; + __IO uint32_t PRTADDR4; + __IO uint32_t PRTADDR5; + __IO uint32_t PRTADDR6; + __IO uint32_t HUBADDR0; + __IO uint32_t HUBADDR1; + __IO uint32_t HUBADDR2; + __IO uint32_t HUBADDR3; + __IO uint32_t HUBADDR4; + __IO uint32_t HUBADDR5; + __IO uint32_t HUBADDR6; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED0[14]; + __IO uint32_t SPLTENA; +} stc_usbhs_hcsplt13_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbhs_hcint13_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbhs_hcintmsk13_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbhs_hctsiz13_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + __IO uint32_t EPNUM0; + __IO uint32_t EPNUM1; + __IO uint32_t EPNUM2; + __IO uint32_t EPNUM3; + __IO uint32_t EPDIR; + uint32_t RESERVED0[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t EC0; + __IO uint32_t EC1; + __IO uint32_t DEVADDR0; + __IO uint32_t DEVADDR1; + __IO uint32_t DEVADDR2; + __IO uint32_t DEVADDR3; + __IO uint32_t DEVADDR4; + __IO uint32_t DEVADDR5; + __IO uint32_t DEVADDR6; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbhs_hcchar14_bit_t; + +typedef struct +{ + __IO uint32_t PRTADDR0; + __IO uint32_t PRTADDR1; + __IO uint32_t PRTADDR2; + __IO uint32_t PRTADDR3; + __IO uint32_t PRTADDR4; + __IO uint32_t PRTADDR5; + __IO uint32_t PRTADDR6; + __IO uint32_t HUBADDR0; + __IO uint32_t HUBADDR1; + __IO uint32_t HUBADDR2; + __IO uint32_t HUBADDR3; + __IO uint32_t HUBADDR4; + __IO uint32_t HUBADDR5; + __IO uint32_t HUBADDR6; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED0[14]; + __IO uint32_t SPLTENA; +} stc_usbhs_hcsplt14_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbhs_hcint14_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbhs_hcintmsk14_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbhs_hctsiz14_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + __IO uint32_t EPNUM0; + __IO uint32_t EPNUM1; + __IO uint32_t EPNUM2; + __IO uint32_t EPNUM3; + __IO uint32_t EPDIR; + uint32_t RESERVED0[1]; + __IO uint32_t LSPDDEV; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t EC0; + __IO uint32_t EC1; + __IO uint32_t DEVADDR0; + __IO uint32_t DEVADDR1; + __IO uint32_t DEVADDR2; + __IO uint32_t DEVADDR3; + __IO uint32_t DEVADDR4; + __IO uint32_t DEVADDR5; + __IO uint32_t DEVADDR6; + __IO uint32_t ODDFRM; + __IO uint32_t CHDIS; + __IO uint32_t CHENA; +} stc_usbhs_hcchar15_bit_t; + +typedef struct +{ + __IO uint32_t PRTADDR0; + __IO uint32_t PRTADDR1; + __IO uint32_t PRTADDR2; + __IO uint32_t PRTADDR3; + __IO uint32_t PRTADDR4; + __IO uint32_t PRTADDR5; + __IO uint32_t PRTADDR6; + __IO uint32_t HUBADDR0; + __IO uint32_t HUBADDR1; + __IO uint32_t HUBADDR2; + __IO uint32_t HUBADDR3; + __IO uint32_t HUBADDR4; + __IO uint32_t HUBADDR5; + __IO uint32_t HUBADDR6; + __IO uint32_t XACTPOS0; + __IO uint32_t XACTPOS1; + __IO uint32_t COMPSPLT; + uint32_t RESERVED0[14]; + __IO uint32_t SPLTENA; +} stc_usbhs_hcsplt15_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t CHHLTD; + __IO uint32_t AHBERR; + __IO uint32_t STALL; + __IO uint32_t NAK; + __IO uint32_t ACK; + __IO uint32_t NYET; + __IO uint32_t XACTERR; + __IO uint32_t BBLERR; + __IO uint32_t FRMOVRUN; + __IO uint32_t DATATGLERR; + uint32_t RESERVED0[21]; +} stc_usbhs_hcint15_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t CHHLTDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t STALLMSK; + __IO uint32_t NAKMSK; + __IO uint32_t ACKMSK; + __IO uint32_t NYETMSK; + __IO uint32_t XACTERRMSK; + __IO uint32_t BBLERRMSK; + __IO uint32_t FRMOVRUNMSK; + __IO uint32_t DATATGLERRMSK; + uint32_t RESERVED0[21]; +} stc_usbhs_hcintmsk15_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t PID0; + __IO uint32_t PID1; + __IO uint32_t DOPNG; +} stc_usbhs_hctsiz15_bit_t; + +typedef struct +{ + __IO uint32_t DEVSPD0; + __IO uint32_t DEVSPD1; + __IO uint32_t NZSTSOUTHSHK; + __IO uint32_t ENA32KHZSUSP; + __IO uint32_t DEVADDR0; + __IO uint32_t DEVADDR1; + __IO uint32_t DEVADDR2; + __IO uint32_t DEVADDR3; + __IO uint32_t DEVADDR4; + __IO uint32_t DEVADDR5; + __IO uint32_t DEVADDR6; + __IO uint32_t PERFRINT0; + __IO uint32_t PERFRINT1; + uint32_t RESERVED0[1]; + __IO uint32_t XCVRDLY; + __IO uint32_t ERRATICINTMSK; + uint32_t RESERVED1[1]; + __IO uint32_t IPGISOCSUPT; + uint32_t RESERVED2[6]; + __IO uint32_t PERSCHINTVL0; + __IO uint32_t PERSCHINTVL1; + __IO uint32_t RESVALID0; + __IO uint32_t RESVALID1; + __IO uint32_t RESVALID2; + __IO uint32_t RESVALID3; + __IO uint32_t RESVALID4; + __IO uint32_t RESVALID5; +} stc_usbhs_dcfg_bit_t; + +typedef struct +{ + __IO uint32_t RMTWKUPSIG; + __IO uint32_t SFTDISCON; + __IO uint32_t GNPINNAKSTS; + __IO uint32_t GOUTNAKSTS; + __IO uint32_t TSTCTL0; + __IO uint32_t TSTCTL1; + __IO uint32_t TSTCTL2; + __IO uint32_t SGNPINNAK; + __IO uint32_t CGNPINNAK; + __IO uint32_t SGOUTNAK; + __IO uint32_t CGOUTNAK; + __IO uint32_t PWRONPRGDONE; + uint32_t RESERVED0[3]; + __IO uint32_t IGNRFRMNUM; + __IO uint32_t NAKONBBLE; + uint32_t RESERVED1[1]; + __IO uint32_t DEEPSLEEPBESLREJECT; + __IO uint32_t SERVINT; + uint32_t RESERVED2[12]; +} stc_usbhs_dctl_bit_t; + +typedef struct +{ + __IO uint32_t SUSPSTS; + __IO uint32_t ENUMSPD0; + __IO uint32_t ENUMSPD1; + __IO uint32_t ERRTICERR; + uint32_t RESERVED0[4]; + __IO uint32_t SOFFN0; + __IO uint32_t SOFFN1; + __IO uint32_t SOFFN2; + __IO uint32_t SOFFN3; + __IO uint32_t SOFFN4; + __IO uint32_t SOFFN5; + __IO uint32_t SOFFN6; + __IO uint32_t SOFFN7; + __IO uint32_t SOFFN8; + __IO uint32_t SOFFN9; + __IO uint32_t SOFFN10; + __IO uint32_t SOFFN11; + __IO uint32_t SOFFN12; + __IO uint32_t SOFFN13; + __IO uint32_t DEVLNSTS0; + __IO uint32_t DEVLNSTS1; + uint32_t RESERVED1[8]; +} stc_usbhs_dsts_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t EPDISBLDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t TIMEOUTMSK; + __IO uint32_t INTKNTXFEMPMSK; + __IO uint32_t INTKNEPMISMSK; + __IO uint32_t INEPNAKEFFMSK; + uint32_t RESERVED0[1]; + __IO uint32_t TXFIFOUNDRNMSK; + uint32_t RESERVED1[4]; + __IO uint32_t NAKMSK; + uint32_t RESERVED2[18]; +} stc_usbhs_diepmsk_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t EPDISBLDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t SETUPMSK; + __IO uint32_t OUTTKNEPDISMSK; + __IO uint32_t STSPHSERCVDMSK; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERRMSK; + uint32_t RESERVED1[3]; + __IO uint32_t BBLEERRMSK; + __IO uint32_t NAKMSK; + __IO uint32_t NYETMSK; + uint32_t RESERVED2[17]; +} stc_usbhs_doepmsk_bit_t; + +typedef struct +{ + __IO uint32_t INEPINT0; + __IO uint32_t INEPINT1; + __IO uint32_t INEPINT2; + __IO uint32_t INEPINT3; + __IO uint32_t INEPINT4; + __IO uint32_t INEPINT5; + __IO uint32_t INEPINT6; + __IO uint32_t INEPINT7; + __IO uint32_t INEPINT8; + __IO uint32_t INEPINT9; + __IO uint32_t INEPINT10; + __IO uint32_t INEPINT11; + __IO uint32_t INEPINT12; + __IO uint32_t INEPINT13; + __IO uint32_t INEPINT14; + __IO uint32_t INEPINT15; + __IO uint32_t OUTEPINT0; + __IO uint32_t OUTEPINT1; + __IO uint32_t OUTEPINT2; + __IO uint32_t OUTEPINT3; + __IO uint32_t OUTEPINT4; + __IO uint32_t OUTEPINT5; + __IO uint32_t OUTEPINT6; + __IO uint32_t OUTEPINT7; + __IO uint32_t OUTEPINT8; + __IO uint32_t OUTEPINT9; + __IO uint32_t OUTEPINT10; + __IO uint32_t OUTEPINT11; + __IO uint32_t OUTEPINT12; + __IO uint32_t OUTEPINT13; + __IO uint32_t OUTEPINT14; + __IO uint32_t OUTEPINT15; +} stc_usbhs_daint_bit_t; + +typedef struct +{ + __IO uint32_t INEPMSK0; + __IO uint32_t INEPMSK1; + __IO uint32_t INEPMSK2; + __IO uint32_t INEPMSK3; + __IO uint32_t INEPMSK4; + __IO uint32_t INEPMSK5; + __IO uint32_t INEPMSK6; + __IO uint32_t INEPMSK7; + __IO uint32_t INEPMSK8; + __IO uint32_t INEPMSK9; + __IO uint32_t INEPMSK10; + __IO uint32_t INEPMSK11; + __IO uint32_t INEPMSK12; + __IO uint32_t INEPMSK13; + __IO uint32_t INEPMSK14; + __IO uint32_t INEPMSK15; + __IO uint32_t OUTEPMSK0; + __IO uint32_t OUTEPMSK1; + __IO uint32_t OUTEPMSK2; + __IO uint32_t OUTEPMSK3; + __IO uint32_t OUTEPMSK4; + __IO uint32_t OUTEPMSK5; + __IO uint32_t OUTEPMSK6; + __IO uint32_t OUTEPMSK7; + __IO uint32_t OUTEPMSK8; + __IO uint32_t OUTEPMSK9; + __IO uint32_t OUTEPMSK10; + __IO uint32_t OUTEPMSK11; + __IO uint32_t OUTEPMSK12; + __IO uint32_t OUTEPMSK13; + __IO uint32_t OUTEPMSK14; + __IO uint32_t OUTEPMSK15; +} stc_usbhs_daintmsk_bit_t; + +typedef struct +{ + __IO uint32_t NONISOTHREN; + __IO uint32_t ISOTHREN; + __IO uint32_t TXTHRLEN0; + __IO uint32_t TXTHRLEN1; + __IO uint32_t TXTHRLEN2; + __IO uint32_t TXTHRLEN3; + __IO uint32_t TXTHRLEN4; + __IO uint32_t TXTHRLEN5; + __IO uint32_t TXTHRLEN6; + __IO uint32_t TXTHRLEN7; + __IO uint32_t TXTHRLEN8; + __IO uint32_t AHBTHRRATIO0; + __IO uint32_t AHBTHRRATIO1; + uint32_t RESERVED0[3]; + __IO uint32_t RXTHREN; + __IO uint32_t RXTHRLEN0; + __IO uint32_t RXTHRLEN1; + __IO uint32_t RXTHRLEN2; + __IO uint32_t RXTHRLEN3; + __IO uint32_t RXTHRLEN4; + __IO uint32_t RXTHRLEN5; + __IO uint32_t RXTHRLEN6; + __IO uint32_t RXTHRLEN7; + __IO uint32_t RXTHRLEN8; + uint32_t RESERVED1[1]; + __IO uint32_t ARBPRKEN; + uint32_t RESERVED2[4]; +} stc_usbhs_dthrctl_bit_t; + +typedef struct +{ + __IO uint32_t INEPTXFEMPMSK0; + __IO uint32_t INEPTXFEMPMSK1; + __IO uint32_t INEPTXFEMPMSK2; + __IO uint32_t INEPTXFEMPMSK3; + __IO uint32_t INEPTXFEMPMSK4; + __IO uint32_t INEPTXFEMPMSK5; + __IO uint32_t INEPTXFEMPMSK6; + __IO uint32_t INEPTXFEMPMSK7; + __IO uint32_t INEPTXFEMPMSK8; + __IO uint32_t INEPTXFEMPMSK9; + __IO uint32_t INEPTXFEMPMSK10; + __IO uint32_t INEPTXFEMPMSK11; + __IO uint32_t INEPTXFEMPMSK12; + __IO uint32_t INEPTXFEMPMSK13; + __IO uint32_t INEPTXFEMPMSK14; + __IO uint32_t INEPTXFEMPMSK15; + uint32_t RESERVED0[16]; +} stc_usbhs_diepempmsk_bit_t; + +typedef struct +{ + __IO uint32_t ECHINEPINT0; + __IO uint32_t ECHINEPINT1; + __IO uint32_t ECHINEPINT2; + __IO uint32_t ECHINEPINT3; + __IO uint32_t ECHINEPINT4; + __IO uint32_t ECHINEPINT5; + __IO uint32_t ECHINEPINT6; + __IO uint32_t ECHINEPINT7; + __IO uint32_t ECHINEPINT8; + __IO uint32_t ECHINEPINT9; + __IO uint32_t ECHINEPINT10; + __IO uint32_t ECHINEPINT11; + __IO uint32_t ECHINEPINT12; + __IO uint32_t ECHINEPINT13; + __IO uint32_t ECHINEPINT14; + __IO uint32_t ECHINEPINT15; + __IO uint32_t ECHOUTEPINT0; + __IO uint32_t ECHOUTEPINT1; + __IO uint32_t ECHOUTEPINT2; + __IO uint32_t ECHOUTEPINT3; + __IO uint32_t ECHOUTEPINT4; + __IO uint32_t ECHOUTEPINT5; + __IO uint32_t ECHOUTEPINT6; + __IO uint32_t ECHOUTEPINT7; + __IO uint32_t ECHOUTEPINT8; + __IO uint32_t ECHOUTEPINT9; + __IO uint32_t ECHOUTEPINT10; + __IO uint32_t ECHOUTEPINT11; + __IO uint32_t ECHOUTEPINT12; + __IO uint32_t ECHOUTEPINT13; + __IO uint32_t ECHOUTEPINT14; + __IO uint32_t ECHOUTEPINT15; +} stc_usbhs_deachint_bit_t; + +typedef struct +{ + __IO uint32_t ECHINEPMSK0; + __IO uint32_t ECHINEPMSK1; + __IO uint32_t ECHINEPMSK2; + __IO uint32_t ECHINEPMSK3; + __IO uint32_t ECHINEPMSK4; + __IO uint32_t ECHINEPMSK5; + __IO uint32_t ECHINEPMSK6; + __IO uint32_t ECHINEPMSK7; + __IO uint32_t ECHINEPMSK8; + __IO uint32_t ECHINEPMSK9; + __IO uint32_t ECHINEPMSK10; + __IO uint32_t ECHINEPMSK11; + __IO uint32_t ECHINEPMSK12; + __IO uint32_t ECHINEPMSK13; + __IO uint32_t ECHINEPMSK14; + __IO uint32_t ECHINEPMSK15; + __IO uint32_t ECHOUTEPMSK0; + __IO uint32_t ECHOUTEPMSK1; + __IO uint32_t ECHOUTEPMSK2; + __IO uint32_t ECHOUTEPMSK3; + __IO uint32_t ECHOUTEPMSK4; + __IO uint32_t ECHOUTEPMSK5; + __IO uint32_t ECHOUTEPMSK6; + __IO uint32_t ECHOUTEPMSK7; + __IO uint32_t ECHOUTEPMSK8; + __IO uint32_t ECHOUTEPMSK9; + __IO uint32_t ECHOUTEPMSK10; + __IO uint32_t ECHOUTEPMSK11; + __IO uint32_t ECHOUTEPMSK12; + __IO uint32_t ECHOUTEPMSK13; + __IO uint32_t ECHOUTEPMSK14; + __IO uint32_t ECHOUTEPMSK15; +} stc_usbhs_deachintmsk_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t EPDISBLDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t TIMEOUTMSK; + __IO uint32_t INTKNTXFEMPMSK; + __IO uint32_t INTKNEPMISMSK; + __IO uint32_t INEPNAKEFFMSK; + uint32_t RESERVED0[1]; + __IO uint32_t TXFIFOUNDRNMSK; + uint32_t RESERVED1[4]; + __IO uint32_t NAKMSK; + uint32_t RESERVED2[18]; +} stc_usbhs_diepeachmsk1_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPLMSK; + __IO uint32_t EPDISBLDMSK; + __IO uint32_t AHBERRMSK; + __IO uint32_t SETUPMSK; + __IO uint32_t OUTTKNEPDISMSK; + __IO uint32_t STSPHSRCVDMSK; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERRMSK; + uint32_t RESERVED1[3]; + __IO uint32_t BBLEERRMSK; + __IO uint32_t NAKMSK; + __IO uint32_t NYETMSK; + uint32_t RESERVED2[17]; +} stc_usbhs_doepeachmsk1_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + uint32_t RESERVED0[13]; + __IO uint32_t USBACTEP; + uint32_t RESERVED1[1]; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED2[1]; + __IO uint32_t STALL; + __IO uint32_t TXFNUM0; + __IO uint32_t TXFNUM1; + __IO uint32_t TXFNUM2; + __IO uint32_t TXFNUM3; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + uint32_t RESERVED3[2]; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_diepctl0_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbhs_diepint0_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + uint32_t RESERVED0[12]; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + uint32_t RESERVED1[11]; +} stc_usbhs_dieptsiz0_bit_t; + +typedef struct +{ + __IO uint32_t INEPTXFSPCAVAIL0; + __IO uint32_t INEPTXFSPCAVAIL1; + __IO uint32_t INEPTXFSPCAVAIL2; + __IO uint32_t INEPTXFSPCAVAIL3; + __IO uint32_t INEPTXFSPCAVAIL4; + __IO uint32_t INEPTXFSPCAVAIL5; + __IO uint32_t INEPTXFSPCAVAIL6; + __IO uint32_t INEPTXFSPCAVAIL7; + __IO uint32_t INEPTXFSPCAVAIL8; + __IO uint32_t INEPTXFSPCAVAIL9; + __IO uint32_t INEPTXFSPCAVAIL10; + __IO uint32_t INEPTXFSPCAVAIL11; + __IO uint32_t INEPTXFSPCAVAIL12; + __IO uint32_t INEPTXFSPCAVAIL13; + __IO uint32_t INEPTXFSPCAVAIL14; + __IO uint32_t INEPTXFSPCAVAIL15; + uint32_t RESERVED0[16]; +} stc_usbhs_dtxfsts0_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + __IO uint32_t TXFNUM0; + __IO uint32_t TXFNUM1; + __IO uint32_t TXFNUM2; + __IO uint32_t TXFNUM3; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_diepctl1_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbhs_diepint1_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t MC0; + __IO uint32_t MC1; + uint32_t RESERVED0[1]; +} stc_usbhs_dieptsiz1_bit_t; + +typedef struct +{ + __IO uint32_t INEPTXFSPCAVAIL0; + __IO uint32_t INEPTXFSPCAVAIL1; + __IO uint32_t INEPTXFSPCAVAIL2; + __IO uint32_t INEPTXFSPCAVAIL3; + __IO uint32_t INEPTXFSPCAVAIL4; + __IO uint32_t INEPTXFSPCAVAIL5; + __IO uint32_t INEPTXFSPCAVAIL6; + __IO uint32_t INEPTXFSPCAVAIL7; + __IO uint32_t INEPTXFSPCAVAIL8; + __IO uint32_t INEPTXFSPCAVAIL9; + __IO uint32_t INEPTXFSPCAVAIL10; + __IO uint32_t INEPTXFSPCAVAIL11; + __IO uint32_t INEPTXFSPCAVAIL12; + __IO uint32_t INEPTXFSPCAVAIL13; + __IO uint32_t INEPTXFSPCAVAIL14; + __IO uint32_t INEPTXFSPCAVAIL15; + uint32_t RESERVED0[16]; +} stc_usbhs_dtxfsts1_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + __IO uint32_t TXFNUM0; + __IO uint32_t TXFNUM1; + __IO uint32_t TXFNUM2; + __IO uint32_t TXFNUM3; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_diepctl2_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbhs_diepint2_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t MC0; + __IO uint32_t MC1; + uint32_t RESERVED0[1]; +} stc_usbhs_dieptsiz2_bit_t; + +typedef struct +{ + __IO uint32_t INEPTXFSPCAVAIL0; + __IO uint32_t INEPTXFSPCAVAIL1; + __IO uint32_t INEPTXFSPCAVAIL2; + __IO uint32_t INEPTXFSPCAVAIL3; + __IO uint32_t INEPTXFSPCAVAIL4; + __IO uint32_t INEPTXFSPCAVAIL5; + __IO uint32_t INEPTXFSPCAVAIL6; + __IO uint32_t INEPTXFSPCAVAIL7; + __IO uint32_t INEPTXFSPCAVAIL8; + __IO uint32_t INEPTXFSPCAVAIL9; + __IO uint32_t INEPTXFSPCAVAIL10; + __IO uint32_t INEPTXFSPCAVAIL11; + __IO uint32_t INEPTXFSPCAVAIL12; + __IO uint32_t INEPTXFSPCAVAIL13; + __IO uint32_t INEPTXFSPCAVAIL14; + __IO uint32_t INEPTXFSPCAVAIL15; + uint32_t RESERVED0[16]; +} stc_usbhs_dtxfsts2_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + __IO uint32_t TXFNUM0; + __IO uint32_t TXFNUM1; + __IO uint32_t TXFNUM2; + __IO uint32_t TXFNUM3; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_diepctl3_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbhs_diepint3_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t MC0; + __IO uint32_t MC1; + uint32_t RESERVED0[1]; +} stc_usbhs_dieptsiz3_bit_t; + +typedef struct +{ + __IO uint32_t INEPTXFSPCAVAIL0; + __IO uint32_t INEPTXFSPCAVAIL1; + __IO uint32_t INEPTXFSPCAVAIL2; + __IO uint32_t INEPTXFSPCAVAIL3; + __IO uint32_t INEPTXFSPCAVAIL4; + __IO uint32_t INEPTXFSPCAVAIL5; + __IO uint32_t INEPTXFSPCAVAIL6; + __IO uint32_t INEPTXFSPCAVAIL7; + __IO uint32_t INEPTXFSPCAVAIL8; + __IO uint32_t INEPTXFSPCAVAIL9; + __IO uint32_t INEPTXFSPCAVAIL10; + __IO uint32_t INEPTXFSPCAVAIL11; + __IO uint32_t INEPTXFSPCAVAIL12; + __IO uint32_t INEPTXFSPCAVAIL13; + __IO uint32_t INEPTXFSPCAVAIL14; + __IO uint32_t INEPTXFSPCAVAIL15; + uint32_t RESERVED0[16]; +} stc_usbhs_dtxfsts3_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + __IO uint32_t TXFNUM0; + __IO uint32_t TXFNUM1; + __IO uint32_t TXFNUM2; + __IO uint32_t TXFNUM3; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_diepctl4_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbhs_diepint4_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t MC0; + __IO uint32_t MC1; + uint32_t RESERVED0[1]; +} stc_usbhs_dieptsiz4_bit_t; + +typedef struct +{ + __IO uint32_t INEPTXFSPCAVAIL0; + __IO uint32_t INEPTXFSPCAVAIL1; + __IO uint32_t INEPTXFSPCAVAIL2; + __IO uint32_t INEPTXFSPCAVAIL3; + __IO uint32_t INEPTXFSPCAVAIL4; + __IO uint32_t INEPTXFSPCAVAIL5; + __IO uint32_t INEPTXFSPCAVAIL6; + __IO uint32_t INEPTXFSPCAVAIL7; + __IO uint32_t INEPTXFSPCAVAIL8; + __IO uint32_t INEPTXFSPCAVAIL9; + __IO uint32_t INEPTXFSPCAVAIL10; + __IO uint32_t INEPTXFSPCAVAIL11; + __IO uint32_t INEPTXFSPCAVAIL12; + __IO uint32_t INEPTXFSPCAVAIL13; + __IO uint32_t INEPTXFSPCAVAIL14; + __IO uint32_t INEPTXFSPCAVAIL15; + uint32_t RESERVED0[16]; +} stc_usbhs_dtxfsts4_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + __IO uint32_t TXFNUM0; + __IO uint32_t TXFNUM1; + __IO uint32_t TXFNUM2; + __IO uint32_t TXFNUM3; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_diepctl5_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbhs_diepint5_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t MC0; + __IO uint32_t MC1; + uint32_t RESERVED0[1]; +} stc_usbhs_dieptsiz5_bit_t; + +typedef struct +{ + __IO uint32_t INEPTXFSPCAVAIL0; + __IO uint32_t INEPTXFSPCAVAIL1; + __IO uint32_t INEPTXFSPCAVAIL2; + __IO uint32_t INEPTXFSPCAVAIL3; + __IO uint32_t INEPTXFSPCAVAIL4; + __IO uint32_t INEPTXFSPCAVAIL5; + __IO uint32_t INEPTXFSPCAVAIL6; + __IO uint32_t INEPTXFSPCAVAIL7; + __IO uint32_t INEPTXFSPCAVAIL8; + __IO uint32_t INEPTXFSPCAVAIL9; + __IO uint32_t INEPTXFSPCAVAIL10; + __IO uint32_t INEPTXFSPCAVAIL11; + __IO uint32_t INEPTXFSPCAVAIL12; + __IO uint32_t INEPTXFSPCAVAIL13; + __IO uint32_t INEPTXFSPCAVAIL14; + __IO uint32_t INEPTXFSPCAVAIL15; + uint32_t RESERVED0[16]; +} stc_usbhs_dtxfsts5_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + __IO uint32_t TXFNUM0; + __IO uint32_t TXFNUM1; + __IO uint32_t TXFNUM2; + __IO uint32_t TXFNUM3; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_diepctl6_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbhs_diepint6_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t MC0; + __IO uint32_t MC1; + uint32_t RESERVED0[1]; +} stc_usbhs_dieptsiz6_bit_t; + +typedef struct +{ + __IO uint32_t INEPTXFSPCAVAIL0; + __IO uint32_t INEPTXFSPCAVAIL1; + __IO uint32_t INEPTXFSPCAVAIL2; + __IO uint32_t INEPTXFSPCAVAIL3; + __IO uint32_t INEPTXFSPCAVAIL4; + __IO uint32_t INEPTXFSPCAVAIL5; + __IO uint32_t INEPTXFSPCAVAIL6; + __IO uint32_t INEPTXFSPCAVAIL7; + __IO uint32_t INEPTXFSPCAVAIL8; + __IO uint32_t INEPTXFSPCAVAIL9; + __IO uint32_t INEPTXFSPCAVAIL10; + __IO uint32_t INEPTXFSPCAVAIL11; + __IO uint32_t INEPTXFSPCAVAIL12; + __IO uint32_t INEPTXFSPCAVAIL13; + __IO uint32_t INEPTXFSPCAVAIL14; + __IO uint32_t INEPTXFSPCAVAIL15; + uint32_t RESERVED0[16]; +} stc_usbhs_dtxfsts6_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + __IO uint32_t TXFNUM0; + __IO uint32_t TXFNUM1; + __IO uint32_t TXFNUM2; + __IO uint32_t TXFNUM3; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_diepctl7_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbhs_diepint7_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t MC0; + __IO uint32_t MC1; + uint32_t RESERVED0[1]; +} stc_usbhs_dieptsiz7_bit_t; + +typedef struct +{ + __IO uint32_t INEPTXFSPCAVAIL0; + __IO uint32_t INEPTXFSPCAVAIL1; + __IO uint32_t INEPTXFSPCAVAIL2; + __IO uint32_t INEPTXFSPCAVAIL3; + __IO uint32_t INEPTXFSPCAVAIL4; + __IO uint32_t INEPTXFSPCAVAIL5; + __IO uint32_t INEPTXFSPCAVAIL6; + __IO uint32_t INEPTXFSPCAVAIL7; + __IO uint32_t INEPTXFSPCAVAIL8; + __IO uint32_t INEPTXFSPCAVAIL9; + __IO uint32_t INEPTXFSPCAVAIL10; + __IO uint32_t INEPTXFSPCAVAIL11; + __IO uint32_t INEPTXFSPCAVAIL12; + __IO uint32_t INEPTXFSPCAVAIL13; + __IO uint32_t INEPTXFSPCAVAIL14; + __IO uint32_t INEPTXFSPCAVAIL15; + uint32_t RESERVED0[16]; +} stc_usbhs_dtxfsts7_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + __IO uint32_t TXFNUM0; + __IO uint32_t TXFNUM1; + __IO uint32_t TXFNUM2; + __IO uint32_t TXFNUM3; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_diepctl8_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbhs_diepint8_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t MC0; + __IO uint32_t MC1; + uint32_t RESERVED0[1]; +} stc_usbhs_dieptsiz8_bit_t; + +typedef struct +{ + __IO uint32_t INEPTXFSPCAVAIL0; + __IO uint32_t INEPTXFSPCAVAIL1; + __IO uint32_t INEPTXFSPCAVAIL2; + __IO uint32_t INEPTXFSPCAVAIL3; + __IO uint32_t INEPTXFSPCAVAIL4; + __IO uint32_t INEPTXFSPCAVAIL5; + __IO uint32_t INEPTXFSPCAVAIL6; + __IO uint32_t INEPTXFSPCAVAIL7; + __IO uint32_t INEPTXFSPCAVAIL8; + __IO uint32_t INEPTXFSPCAVAIL9; + __IO uint32_t INEPTXFSPCAVAIL10; + __IO uint32_t INEPTXFSPCAVAIL11; + __IO uint32_t INEPTXFSPCAVAIL12; + __IO uint32_t INEPTXFSPCAVAIL13; + __IO uint32_t INEPTXFSPCAVAIL14; + __IO uint32_t INEPTXFSPCAVAIL15; + uint32_t RESERVED0[16]; +} stc_usbhs_dtxfsts8_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + __IO uint32_t TXFNUM0; + __IO uint32_t TXFNUM1; + __IO uint32_t TXFNUM2; + __IO uint32_t TXFNUM3; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_diepctl9_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbhs_diepint9_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t MC0; + __IO uint32_t MC1; + uint32_t RESERVED0[1]; +} stc_usbhs_dieptsiz9_bit_t; + +typedef struct +{ + __IO uint32_t INEPTXFSPCAVAIL0; + __IO uint32_t INEPTXFSPCAVAIL1; + __IO uint32_t INEPTXFSPCAVAIL2; + __IO uint32_t INEPTXFSPCAVAIL3; + __IO uint32_t INEPTXFSPCAVAIL4; + __IO uint32_t INEPTXFSPCAVAIL5; + __IO uint32_t INEPTXFSPCAVAIL6; + __IO uint32_t INEPTXFSPCAVAIL7; + __IO uint32_t INEPTXFSPCAVAIL8; + __IO uint32_t INEPTXFSPCAVAIL9; + __IO uint32_t INEPTXFSPCAVAIL10; + __IO uint32_t INEPTXFSPCAVAIL11; + __IO uint32_t INEPTXFSPCAVAIL12; + __IO uint32_t INEPTXFSPCAVAIL13; + __IO uint32_t INEPTXFSPCAVAIL14; + __IO uint32_t INEPTXFSPCAVAIL15; + uint32_t RESERVED0[16]; +} stc_usbhs_dtxfsts9_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + __IO uint32_t TXFNUM0; + __IO uint32_t TXFNUM1; + __IO uint32_t TXFNUM2; + __IO uint32_t TXFNUM3; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_diepctl10_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbhs_diepint10_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t MC0; + __IO uint32_t MC1; + uint32_t RESERVED0[1]; +} stc_usbhs_dieptsiz10_bit_t; + +typedef struct +{ + __IO uint32_t INEPTXFSPCAVAIL0; + __IO uint32_t INEPTXFSPCAVAIL1; + __IO uint32_t INEPTXFSPCAVAIL2; + __IO uint32_t INEPTXFSPCAVAIL3; + __IO uint32_t INEPTXFSPCAVAIL4; + __IO uint32_t INEPTXFSPCAVAIL5; + __IO uint32_t INEPTXFSPCAVAIL6; + __IO uint32_t INEPTXFSPCAVAIL7; + __IO uint32_t INEPTXFSPCAVAIL8; + __IO uint32_t INEPTXFSPCAVAIL9; + __IO uint32_t INEPTXFSPCAVAIL10; + __IO uint32_t INEPTXFSPCAVAIL11; + __IO uint32_t INEPTXFSPCAVAIL12; + __IO uint32_t INEPTXFSPCAVAIL13; + __IO uint32_t INEPTXFSPCAVAIL14; + __IO uint32_t INEPTXFSPCAVAIL15; + uint32_t RESERVED0[16]; +} stc_usbhs_dtxfsts10_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + __IO uint32_t TXFNUM0; + __IO uint32_t TXFNUM1; + __IO uint32_t TXFNUM2; + __IO uint32_t TXFNUM3; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_diepctl11_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbhs_diepint11_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t MC0; + __IO uint32_t MC1; + uint32_t RESERVED0[1]; +} stc_usbhs_dieptsiz11_bit_t; + +typedef struct +{ + __IO uint32_t INEPTXFSPCAVAIL0; + __IO uint32_t INEPTXFSPCAVAIL1; + __IO uint32_t INEPTXFSPCAVAIL2; + __IO uint32_t INEPTXFSPCAVAIL3; + __IO uint32_t INEPTXFSPCAVAIL4; + __IO uint32_t INEPTXFSPCAVAIL5; + __IO uint32_t INEPTXFSPCAVAIL6; + __IO uint32_t INEPTXFSPCAVAIL7; + __IO uint32_t INEPTXFSPCAVAIL8; + __IO uint32_t INEPTXFSPCAVAIL9; + __IO uint32_t INEPTXFSPCAVAIL10; + __IO uint32_t INEPTXFSPCAVAIL11; + __IO uint32_t INEPTXFSPCAVAIL12; + __IO uint32_t INEPTXFSPCAVAIL13; + __IO uint32_t INEPTXFSPCAVAIL14; + __IO uint32_t INEPTXFSPCAVAIL15; + uint32_t RESERVED0[16]; +} stc_usbhs_dtxfsts11_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + __IO uint32_t TXFNUM0; + __IO uint32_t TXFNUM1; + __IO uint32_t TXFNUM2; + __IO uint32_t TXFNUM3; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_diepctl12_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbhs_diepint12_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t MC0; + __IO uint32_t MC1; + uint32_t RESERVED0[1]; +} stc_usbhs_dieptsiz12_bit_t; + +typedef struct +{ + __IO uint32_t INEPTXFSPCAVAIL0; + __IO uint32_t INEPTXFSPCAVAIL1; + __IO uint32_t INEPTXFSPCAVAIL2; + __IO uint32_t INEPTXFSPCAVAIL3; + __IO uint32_t INEPTXFSPCAVAIL4; + __IO uint32_t INEPTXFSPCAVAIL5; + __IO uint32_t INEPTXFSPCAVAIL6; + __IO uint32_t INEPTXFSPCAVAIL7; + __IO uint32_t INEPTXFSPCAVAIL8; + __IO uint32_t INEPTXFSPCAVAIL9; + __IO uint32_t INEPTXFSPCAVAIL10; + __IO uint32_t INEPTXFSPCAVAIL11; + __IO uint32_t INEPTXFSPCAVAIL12; + __IO uint32_t INEPTXFSPCAVAIL13; + __IO uint32_t INEPTXFSPCAVAIL14; + __IO uint32_t INEPTXFSPCAVAIL15; + uint32_t RESERVED0[16]; +} stc_usbhs_dtxfsts12_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + __IO uint32_t TXFNUM0; + __IO uint32_t TXFNUM1; + __IO uint32_t TXFNUM2; + __IO uint32_t TXFNUM3; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_diepctl13_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbhs_diepint13_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t MC0; + __IO uint32_t MC1; + uint32_t RESERVED0[1]; +} stc_usbhs_dieptsiz13_bit_t; + +typedef struct +{ + __IO uint32_t INEPTXFSPCAVAIL0; + __IO uint32_t INEPTXFSPCAVAIL1; + __IO uint32_t INEPTXFSPCAVAIL2; + __IO uint32_t INEPTXFSPCAVAIL3; + __IO uint32_t INEPTXFSPCAVAIL4; + __IO uint32_t INEPTXFSPCAVAIL5; + __IO uint32_t INEPTXFSPCAVAIL6; + __IO uint32_t INEPTXFSPCAVAIL7; + __IO uint32_t INEPTXFSPCAVAIL8; + __IO uint32_t INEPTXFSPCAVAIL9; + __IO uint32_t INEPTXFSPCAVAIL10; + __IO uint32_t INEPTXFSPCAVAIL11; + __IO uint32_t INEPTXFSPCAVAIL12; + __IO uint32_t INEPTXFSPCAVAIL13; + __IO uint32_t INEPTXFSPCAVAIL14; + __IO uint32_t INEPTXFSPCAVAIL15; + uint32_t RESERVED0[16]; +} stc_usbhs_dtxfsts13_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + __IO uint32_t TXFNUM0; + __IO uint32_t TXFNUM1; + __IO uint32_t TXFNUM2; + __IO uint32_t TXFNUM3; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_diepctl14_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbhs_diepint14_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t MC0; + __IO uint32_t MC1; + uint32_t RESERVED0[1]; +} stc_usbhs_dieptsiz14_bit_t; + +typedef struct +{ + __IO uint32_t INEPTXFSPCAVAIL0; + __IO uint32_t INEPTXFSPCAVAIL1; + __IO uint32_t INEPTXFSPCAVAIL2; + __IO uint32_t INEPTXFSPCAVAIL3; + __IO uint32_t INEPTXFSPCAVAIL4; + __IO uint32_t INEPTXFSPCAVAIL5; + __IO uint32_t INEPTXFSPCAVAIL6; + __IO uint32_t INEPTXFSPCAVAIL7; + __IO uint32_t INEPTXFSPCAVAIL8; + __IO uint32_t INEPTXFSPCAVAIL9; + __IO uint32_t INEPTXFSPCAVAIL10; + __IO uint32_t INEPTXFSPCAVAIL11; + __IO uint32_t INEPTXFSPCAVAIL12; + __IO uint32_t INEPTXFSPCAVAIL13; + __IO uint32_t INEPTXFSPCAVAIL14; + __IO uint32_t INEPTXFSPCAVAIL15; + uint32_t RESERVED0[16]; +} stc_usbhs_dtxfsts14_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + uint32_t RESERVED1[1]; + __IO uint32_t STALL; + __IO uint32_t TXFNUM0; + __IO uint32_t TXFNUM1; + __IO uint32_t TXFNUM2; + __IO uint32_t TXFNUM3; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_diepctl15_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t TIMEOUT; + __IO uint32_t INTKNTXFEMP; + __IO uint32_t INTKNEPMIS; + __IO uint32_t INEPNAKEFF; + __IO uint32_t TXFEMP; + __IO uint32_t TXFIFOUNDRN; + __IO uint32_t BNAINTR; + uint32_t RESERVED0[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + uint32_t RESERVED1[17]; +} stc_usbhs_diepint15_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t MC0; + __IO uint32_t MC1; + uint32_t RESERVED0[1]; +} stc_usbhs_dieptsiz15_bit_t; + +typedef struct +{ + __IO uint32_t INEPTXFSPCAVAIL0; + __IO uint32_t INEPTXFSPCAVAIL1; + __IO uint32_t INEPTXFSPCAVAIL2; + __IO uint32_t INEPTXFSPCAVAIL3; + __IO uint32_t INEPTXFSPCAVAIL4; + __IO uint32_t INEPTXFSPCAVAIL5; + __IO uint32_t INEPTXFSPCAVAIL6; + __IO uint32_t INEPTXFSPCAVAIL7; + __IO uint32_t INEPTXFSPCAVAIL8; + __IO uint32_t INEPTXFSPCAVAIL9; + __IO uint32_t INEPTXFSPCAVAIL10; + __IO uint32_t INEPTXFSPCAVAIL11; + __IO uint32_t INEPTXFSPCAVAIL12; + __IO uint32_t INEPTXFSPCAVAIL13; + __IO uint32_t INEPTXFSPCAVAIL14; + __IO uint32_t INEPTXFSPCAVAIL15; + uint32_t RESERVED0[16]; +} stc_usbhs_dtxfsts15_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + uint32_t RESERVED0[13]; + __IO uint32_t USBACTEP; + uint32_t RESERVED1[1]; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED2[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + uint32_t RESERVED3[2]; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_doepctl0_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbhs_doepint0_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + uint32_t RESERVED0[12]; + __IO uint32_t PKTCNT; + uint32_t RESERVED1[9]; + __IO uint32_t SUPCNT0; + __IO uint32_t SUPCNT1; + uint32_t RESERVED2[1]; +} stc_usbhs_doeptsiz0_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_doepctl1_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbhs_doepint1_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED0[1]; +} stc_usbhs_doeptsiz1_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_doepctl2_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbhs_doepint2_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED0[1]; +} stc_usbhs_doeptsiz2_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_doepctl3_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbhs_doepint3_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED0[1]; +} stc_usbhs_doeptsiz3_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_doepctl4_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbhs_doepint4_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED0[1]; +} stc_usbhs_doeptsiz4_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_doepctl5_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbhs_doepint5_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED0[1]; +} stc_usbhs_doeptsiz5_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_doepctl6_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbhs_doepint6_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED0[1]; +} stc_usbhs_doeptsiz6_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_doepctl7_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbhs_doepint7_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED0[1]; +} stc_usbhs_doeptsiz7_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_doepctl8_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbhs_doepint8_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED0[1]; +} stc_usbhs_doeptsiz8_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_doepctl9_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbhs_doepint9_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED0[1]; +} stc_usbhs_doeptsiz9_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_doepctl10_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbhs_doepint10_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED0[1]; +} stc_usbhs_doeptsiz10_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_doepctl11_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbhs_doepint11_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED0[1]; +} stc_usbhs_doeptsiz11_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_doepctl12_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbhs_doepint12_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED0[1]; +} stc_usbhs_doeptsiz12_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_doepctl13_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbhs_doepint13_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED0[1]; +} stc_usbhs_doeptsiz13_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_doepctl14_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbhs_doepint14_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED0[1]; +} stc_usbhs_doeptsiz14_bit_t; + +typedef struct +{ + __IO uint32_t MPS0; + __IO uint32_t MPS1; + __IO uint32_t MPS2; + __IO uint32_t MPS3; + __IO uint32_t MPS4; + __IO uint32_t MPS5; + __IO uint32_t MPS6; + __IO uint32_t MPS7; + __IO uint32_t MPS8; + __IO uint32_t MPS9; + __IO uint32_t MPS10; + uint32_t RESERVED0[4]; + __IO uint32_t USBACTEP; + __IO uint32_t DPID; + __IO uint32_t NAKSTS; + __IO uint32_t EPTYPE0; + __IO uint32_t EPTYPE1; + __IO uint32_t SNP; + __IO uint32_t STALL; + uint32_t RESERVED1[4]; + __IO uint32_t CNAK; + __IO uint32_t SNAK; + __IO uint32_t SETD0PID; + __IO uint32_t SETD1PID; + __IO uint32_t EPDIS; + __IO uint32_t EPENA; +} stc_usbhs_doepctl15_bit_t; + +typedef struct +{ + __IO uint32_t XFERCOMPL; + __IO uint32_t EPDISBLD; + __IO uint32_t AHBERR; + __IO uint32_t SETUP; + __IO uint32_t OUTTKNEPDIS; + __IO uint32_t STSPHSERCVD; + __IO uint32_t BACK2BACKSETUP; + uint32_t RESERVED0[1]; + __IO uint32_t OUTPKTERR; + __IO uint32_t BNAINTR; + uint32_t RESERVED1[1]; + __IO uint32_t PKTDRPSTS; + __IO uint32_t BBLEERR; + __IO uint32_t NAKINTRPT; + __IO uint32_t NYETINTRPT; + __IO uint32_t STUPPKTRCVD; + uint32_t RESERVED2[16]; +} stc_usbhs_doepint15_bit_t; + +typedef struct +{ + __IO uint32_t XFERSIZE0; + __IO uint32_t XFERSIZE1; + __IO uint32_t XFERSIZE2; + __IO uint32_t XFERSIZE3; + __IO uint32_t XFERSIZE4; + __IO uint32_t XFERSIZE5; + __IO uint32_t XFERSIZE6; + __IO uint32_t XFERSIZE7; + __IO uint32_t XFERSIZE8; + __IO uint32_t XFERSIZE9; + __IO uint32_t XFERSIZE10; + __IO uint32_t XFERSIZE11; + __IO uint32_t XFERSIZE12; + __IO uint32_t XFERSIZE13; + __IO uint32_t XFERSIZE14; + __IO uint32_t XFERSIZE15; + __IO uint32_t XFERSIZE16; + __IO uint32_t XFERSIZE17; + __IO uint32_t XFERSIZE18; + __IO uint32_t PKTCNT0; + __IO uint32_t PKTCNT1; + __IO uint32_t PKTCNT2; + __IO uint32_t PKTCNT3; + __IO uint32_t PKTCNT4; + __IO uint32_t PKTCNT5; + __IO uint32_t PKTCNT6; + __IO uint32_t PKTCNT7; + __IO uint32_t PKTCNT8; + __IO uint32_t PKTCNT9; + __IO uint32_t RXDPID0; + __IO uint32_t RXDPID1; + uint32_t RESERVED0[1]; +} stc_usbhs_doeptsiz15_bit_t; + +typedef struct +{ + __IO uint32_t STOPPCLK; + __IO uint32_t GATEHCLK; + __IO uint32_t PWRCLMP; + __IO uint32_t RSTPDWNMODULE; + uint32_t RESERVED0[1]; + __IO uint32_t ENBL_L1GATING; + __IO uint32_t PHYSLEEP; + __IO uint32_t L1SUSPENDED; + __IO uint32_t RESETAFTERSUSP; + uint32_t RESERVED1[23]; +} stc_usbhs_pcgcctl_bit_t; + +typedef struct +{ + __IO uint32_t PERI0; + __IO uint32_t PERI1; + uint32_t RESERVED0[2]; + __IO uint32_t CKS0; + __IO uint32_t CKS1; + __IO uint32_t CKS2; + __IO uint32_t CKS3; + __IO uint32_t WDPT0; + __IO uint32_t WDPT1; + __IO uint32_t WDPT2; + __IO uint32_t WDPT3; + uint32_t RESERVED1[4]; + __IO uint32_t SLPOFF; + uint32_t RESERVED2[14]; + __IO uint32_t ITS; +} stc_wdt_cr_bit_t; + +typedef struct +{ + uint32_t RESERVED0[16]; + __IO uint32_t UDF; + __IO uint32_t REF; + uint32_t RESERVED1[14]; +} stc_wdt_sr_bit_t; + + +typedef struct +{ + stc_adc_str_bit_t STR_b; + uint32_t RESERVED0[8]; + stc_adc_cr0_bit_t CR0_b; + stc_adc_cr1_bit_t CR1_b; + uint32_t RESERVED1[32]; + stc_adc_trgsr_bit_t TRGSR_b; + stc_adc_chselra_bit_t CHSELRA_b; + stc_adc_chselrb_bit_t CHSELRB_b; + stc_adc_avchselr_bit_t AVCHSELR_b; + stc_adc_exchselr_bit_t EXCHSELR_b; + uint32_t RESERVED2[8]; + stc_adc_shcr_bit_t SHCR_b; + uint32_t RESERVED3[224]; + stc_adc_chmuxr0_bit_t CHMUXR0_b; + stc_adc_chmuxr1_bit_t CHMUXR1_b; + stc_adc_chmuxr2_bit_t CHMUXR2_b; + stc_adc_chmuxr3_bit_t CHMUXR3_b; + uint32_t RESERVED4[32]; + stc_adc_isr_bit_t ISR_b; + stc_adc_icr_bit_t ICR_b; + stc_adc_isclrr_bit_t ISCLRR_b; + uint32_t RESERVED5[40]; + stc_adc_synccr_bit_t SYNCCR_b; + uint32_t RESERVED6[656]; + stc_adc_awdcr_bit_t AWDCR_b; + stc_adc_awdsr_bit_t AWDSR_b; + stc_adc_awdsclrr_bit_t AWDSCLRR_b; + uint32_t RESERVED7[32]; + stc_adc_awd0chsr_bit_t AWD0CHSR_b; + uint32_t RESERVED8[48]; + stc_adc_awd1chsr_bit_t AWD1CHSR_b; + uint32_t RESERVED9[112]; + stc_adc_pgacr1_bit_t PGACR1_b; + stc_adc_pgacr2_bit_t PGACR2_b; + stc_adc_pgacr3_bit_t PGACR3_b; + uint32_t RESERVED10[8]; + stc_adc_pgavssenr_bit_t PGAVSSENR_b; +} bM4_ADC_TypeDef; + +typedef struct +{ + stc_aes_cr_bit_t CR_b; +} bM4_AES_TypeDef; + +typedef struct +{ + stc_aos_int_sfttrg_bit_t INT_SFTTRG_b; + stc_aos_dcu_1_trgsel_bit_t DCU_1_TRGSEL_b; + stc_aos_dcu_2_trgsel_bit_t DCU_2_TRGSEL_b; + stc_aos_dcu_3_trgsel_bit_t DCU_3_TRGSEL_b; + stc_aos_dcu_4_trgsel_bit_t DCU_4_TRGSEL_b; + stc_aos_dma_1_trgsel_bit_t DMA_1_TRGSEL0_b; + stc_aos_dma_1_trgsel_bit_t DMA_1_TRGSEL1_b; + stc_aos_dma_1_trgsel_bit_t DMA_1_TRGSEL2_b; + stc_aos_dma_1_trgsel_bit_t DMA_1_TRGSEL3_b; + stc_aos_dma_1_trgsel_bit_t DMA_1_TRGSEL4_b; + stc_aos_dma_1_trgsel_bit_t DMA_1_TRGSEL5_b; + stc_aos_dma_1_trgsel_bit_t DMA_1_TRGSEL6_b; + stc_aos_dma_1_trgsel_bit_t DMA_1_TRGSEL7_b; + stc_aos_dma_2_trgsel_bit_t DMA_2_TRGSEL0_b; + stc_aos_dma_2_trgsel_bit_t DMA_2_TRGSEL1_b; + stc_aos_dma_2_trgsel_bit_t DMA_2_TRGSEL2_b; + stc_aos_dma_2_trgsel_bit_t DMA_2_TRGSEL3_b; + stc_aos_dma_2_trgsel_bit_t DMA_2_TRGSEL4_b; + stc_aos_dma_2_trgsel_bit_t DMA_2_TRGSEL5_b; + stc_aos_dma_2_trgsel_bit_t DMA_2_TRGSEL6_b; + stc_aos_dma_2_trgsel_bit_t DMA_2_TRGSEL7_b; + stc_aos_dma_trgselrc_bit_t DMA_TRGSELRC_b; + stc_aos_tmr6_htssr_bit_t TMR6_HTSSR1_b; + stc_aos_tmr6_htssr_bit_t TMR6_HTSSR2_b; + stc_aos_tmr6_htssr_bit_t TMR6_HTSSR3_b; + stc_aos_tmr6_htssr_bit_t TMR6_HTSSR4_b; + stc_aos_port_pevnttrgsr12_bit_t PORT_PEVNTTRGSR12_b; + stc_aos_port_pevnttrgsr34_bit_t PORT_PEVNTTRGSR34_b; + stc_aos_tmr0_htssr_bit_t TMR0_HTSSR_b; + stc_aos_tmr2_htssr_bit_t TMR2_HTSSR_b; + stc_aos_hash_itrgsela_bit_t HASH_ITRGSELA_b; + stc_aos_hash_itrgselb_bit_t HASH_ITRGSELB_b; + stc_aos_tmra_htssr_bit_t TMRA_HTSSR0_b; + stc_aos_tmra_htssr_bit_t TMRA_HTSSR1_b; + stc_aos_tmra_htssr_bit_t TMRA_HTSSR2_b; + stc_aos_tmra_htssr_bit_t TMRA_HTSSR3_b; + stc_aos_ots_trg_bit_t OTS_TRG_b; + stc_aos_adc_1_itrgselr_bit_t ADC_1_ITRGSELR0_b; + stc_aos_adc_1_itrgselr_bit_t ADC_1_ITRGSELR1_b; + stc_aos_adc_2_itrgselr_bit_t ADC_2_ITRGSELR0_b; + stc_aos_adc_2_itrgselr_bit_t ADC_2_ITRGSELR1_b; + stc_aos_adc_3_itrgselr_bit_t ADC_3_ITRGSELR0_b; + stc_aos_adc_3_itrgselr_bit_t ADC_3_ITRGSELR1_b; + uint32_t RESERVED0[672]; + stc_aos_gpio_pevntdirr_bit_t GPIO_PEVNTDIRR1_b; + stc_aos_gpio_pevntidr_bit_t GPIO_PEVNTIDR1_b; + stc_aos_gpio_pevntodr_bit_t GPIO_PEVNTODR1_b; + stc_aos_gpio_pevntorr_bit_t GPIO_PEVNTORR1_b; + stc_aos_gpio_pevntosr_bit_t GPIO_PEVNTOSR1_b; + stc_aos_gpio_pevntrisr_bit_t GPIO_PEVNTRISR1_b; + stc_aos_gpio_pevntfal_bit_t GPIO_PEVNTFAL1_b; + stc_aos_gpio_pevntdirr_bit_t GPIO_PEVNTDIRR2_b; + stc_aos_gpio_pevntidr_bit_t GPIO_PEVNTIDR2_b; + stc_aos_gpio_pevntodr_bit_t GPIO_PEVNTODR2_b; + stc_aos_gpio_pevntorr_bit_t GPIO_PEVNTORR2_b; + stc_aos_gpio_pevntosr_bit_t GPIO_PEVNTOSR2_b; + stc_aos_gpio_pevntrisr_bit_t GPIO_PEVNTRISR2_b; + stc_aos_gpio_pevntfal_bit_t GPIO_PEVNTFAL2_b; + stc_aos_gpio_pevntdirr_bit_t GPIO_PEVNTDIRR3_b; + stc_aos_gpio_pevntidr_bit_t GPIO_PEVNTIDR3_b; + stc_aos_gpio_pevntodr_bit_t GPIO_PEVNTODR3_b; + stc_aos_gpio_pevntorr_bit_t GPIO_PEVNTORR3_b; + stc_aos_gpio_pevntosr_bit_t GPIO_PEVNTOSR3_b; + stc_aos_gpio_pevntrisr_bit_t GPIO_PEVNTRISR3_b; + stc_aos_gpio_pevntfal_bit_t GPIO_PEVNTFAL3_b; + stc_aos_gpio_pevntdirr_bit_t GPIO_PEVNTDIRR4_b; + stc_aos_gpio_pevntidr_bit_t GPIO_PEVNTIDR4_b; + stc_aos_gpio_pevntodr_bit_t GPIO_PEVNTODR4_b; + stc_aos_gpio_pevntorr_bit_t GPIO_PEVNTORR4_b; + stc_aos_gpio_pevntosr_bit_t GPIO_PEVNTOSR4_b; + stc_aos_gpio_pevntrisr_bit_t GPIO_PEVNTRISR4_b; + stc_aos_gpio_pevntfal_bit_t GPIO_PEVNTFAL4_b; + stc_aos_gpio_pevntnfcr_bit_t GPIO_PEVNTNFCR_b; +} bM4_AOS_TypeDef; + +typedef struct +{ + uint32_t RESERVED0[1280]; + stc_can_cfg_stat_bit_t CFG_STAT_b; + stc_can_tcmd_bit_t TCMD_b; + stc_can_tctrl_bit_t TCTRL_b; + stc_can_rctrl_bit_t RCTRL_b; + stc_can_rtie_bit_t RTIE_b; + stc_can_rtif_bit_t RTIF_b; + stc_can_errint_bit_t ERRINT_b; + stc_can_limit_bit_t LIMIT_b; + stc_can_sbt_bit_t SBT_b; + stc_can_fbt_bit_t FBT_b; + stc_can_ealcap_bit_t EALCAP_b; + stc_can_tdc_bit_t TDC_b; + uint32_t RESERVED1[16]; + stc_can_acfctrl_bit_t ACFCTRL_b; + uint32_t RESERVED2[8]; + stc_can_acfen_bit_t ACFEN_b; + stc_can_acf_bit_t ACF_b; + uint32_t RESERVED3[16]; + stc_can_tbslot_bit_t TBSLOT_b; + stc_can_ttcfg_bit_t TTCFG_b; + stc_can_ref_msg_bit_t REF_MSG_b; + stc_can_trg_cfg_bit_t TRG_CFG_b; +} bM4_CAN_TypeDef; + +typedef struct +{ + stc_cmp_mdr_bit_t MDR_b; + stc_cmp_fir_bit_t FIR_b; + stc_cmp_ocr_bit_t OCR_b; + stc_cmp_pmsr_bit_t PMSR_b; + stc_cmp_twsr_bit_t TWSR_b; + stc_cmp_twpr_bit_t TWPR_b; + stc_cmp_visr_bit_t VISR_b; +} bM4_CMP_TypeDef; + +typedef struct +{ + stc_cmu_xtal32cr_bit_t XTAL32CR_b; + uint32_t RESERVED0[216]; + stc_cmu_lrccr_bit_t LRCCR_b; + uint32_t RESERVED1[24]; + stc_cmu_rtclrccr_bit_t RTCLRCCR_b; + uint32_t RESERVED2[17080]; + stc_cmu_xtalcfgr_bit_t XTALCFGR_b; + uint32_t RESERVED3[236936]; + stc_cmu_pllhcr_bit_t PLLHCR_b; + uint32_t RESERVED4[24]; + stc_cmu_pllacr_bit_t PLLACR_b; + uint32_t RESERVED5[24]; + stc_cmu_xtalcr_bit_t XTALCR_b; + uint32_t RESERVED6[24]; + stc_cmu_hrccr_bit_t HRCCR_b; + uint32_t RESERVED7[8]; + stc_cmu_mrccr_bit_t MRCCR_b; + uint32_t RESERVED8[24]; + stc_cmu_oscstbsr_bit_t OSCSTBSR_b; + stc_cmu_mco1cfgr_bit_t MCO1CFGR_b; + stc_cmu_mco2cfgr_bit_t MCO2CFGR_b; + stc_cmu_tpiuckcfgr_bit_t TPIUCKCFGR_b; + stc_cmu_xtalstdcr_bit_t XTALSTDCR_b; + stc_cmu_xtalstdsr_bit_t XTALSTDSR_b; + uint32_t RESERVED9[1520]; + stc_cmu_pllhcfgr_bit_t PLLHCFGR_b; +} bM4_CMU_TypeDef; + +typedef struct +{ + stc_crc_cr_bit_t CR_b; +} bM4_CRC_TypeDef; + +typedef struct +{ + stc_ctc_cr1_bit_t CR1_b; + stc_ctc_cr2_bit_t CR2_b; + stc_ctc_str_bit_t STR_b; +} bM4_CTC_TypeDef; + +typedef struct +{ + stc_dac_dadr1_bit_t DADR1_b; + stc_dac_dadr2_bit_t DADR2_b; + stc_dac_dacr_bit_t DACR_b; + stc_dac_daadpcr_bit_t DAADPCR_b; + uint32_t RESERVED0[160]; + stc_dac_daocr_bit_t DAOCR_b; +} bM4_DAC_TypeDef; + +typedef struct +{ + stc_dcu_ctl_bit_t CTL_b; + stc_dcu_flag_bit_t FLAG_b; + uint32_t RESERVED0[96]; + stc_dcu_flagclr_bit_t FLAGCLR_b; + stc_dcu_intevtsel_bit_t INTEVTSEL_b; +} bM4_DCU_TypeDef; + +typedef struct +{ + stc_dma_en_bit_t EN_b; + stc_dma_intstat0_bit_t INTSTAT0_b; + stc_dma_intstat1_bit_t INTSTAT1_b; + stc_dma_intmask0_bit_t INTMASK0_b; + stc_dma_intmask1_bit_t INTMASK1_b; + stc_dma_intclr0_bit_t INTCLR0_b; + stc_dma_intclr1_bit_t INTCLR1_b; + stc_dma_chen_bit_t CHEN_b; + stc_dma_reqstat_bit_t REQSTAT_b; + stc_dma_chstat_bit_t CHSTAT_b; + uint32_t RESERVED0[32]; + stc_dma_rcfgctl_bit_t RCFGCTL_b; + uint32_t RESERVED1[32]; + stc_dma_chenclr_bit_t CHENCLR_b; + uint32_t RESERVED2[384]; + stc_dma_chctl_bit_t CHCTL0_b; + uint32_t RESERVED3[512]; + stc_dma_chctl_bit_t CHCTL1_b; + uint32_t RESERVED4[512]; + stc_dma_chctl_bit_t CHCTL2_b; + uint32_t RESERVED5[512]; + stc_dma_chctl_bit_t CHCTL3_b; + uint32_t RESERVED6[512]; + stc_dma_chctl_bit_t CHCTL4_b; + uint32_t RESERVED7[512]; + stc_dma_chctl_bit_t CHCTL5_b; + uint32_t RESERVED8[512]; + stc_dma_chctl_bit_t CHCTL6_b; + uint32_t RESERVED9[512]; + stc_dma_chctl_bit_t CHCTL7_b; +} bM4_DMA_TypeDef; + +typedef struct +{ + stc_dvp_ctr_bit_t CTR_b; + uint32_t RESERVED0[32]; + stc_dvp_str_bit_t STR_b; + stc_dvp_ier_bit_t IER_b; +} bM4_DVP_TypeDef; + +typedef struct +{ + stc_efm_faprt_bit_t FAPRT_b; + uint32_t RESERVED0[128]; + stc_efm_fstp_bit_t FSTP_b; + stc_efm_frmc_bit_t FRMC_b; + stc_efm_fwmc_bit_t FWMC_b; + stc_efm_fsr_bit_t FSR_b; + stc_efm_fsclr_bit_t FSCLR_b; + stc_efm_fite_bit_t FITE_b; + stc_efm_fswp_bit_t FSWP_b; + uint32_t RESERVED1[1696]; + stc_mmf_remcr0_bit_t REMCR0_b; + stc_mmf_remcr1_bit_t REMCR1_b; + uint32_t RESERVED2[928]; + stc_efm_wlock_bit_t WLOCK_b; +} bM4_EFM_TypeDef; + +typedef struct +{ + stc_emb_ctl1_bit_t CTL1_b; + stc_emb_ctl2_bit_t CTL2_b; + stc_emb_soe_bit_t SOE_b; + stc_emb_stat_bit_t STAT_b; + stc_emb_statclr_bit_t STATCLR_b; + stc_emb_inten_bit_t INTEN_b; + stc_emb_rlssel_bit_t RLSSEL_b; +} bM4_EMB_TypeDef; + +typedef struct +{ + uint32_t RESERVED0[172160]; + stc_eth_mac_ifconfr_bit_t MAC_IFCONFR_b; + uint32_t RESERVED1[352096]; + stc_eth_mac_configr_bit_t MAC_CONFIGR_b; + stc_eth_mac_fltctlr_bit_t MAC_FLTCTLR_b; + uint32_t RESERVED2[64]; + stc_eth_mac_smiaddr_bit_t MAC_SMIADDR_b; + uint32_t RESERVED3[32]; + stc_eth_mac_floctlr_bit_t MAC_FLOCTLR_b; + stc_eth_mac_vtafltr_bit_t MAC_VTAFLTR_b; + uint32_t RESERVED4[32]; + stc_eth_mac_macstsr_bit_t MAC_MACSTSR_b; + uint32_t RESERVED5[32]; + stc_eth_mac_pmtctlr_bit_t MAC_PMTCTLR_b; + uint32_t RESERVED6[64]; + stc_eth_mac_intstsr_bit_t MAC_INTSTSR_b; + stc_eth_mac_intmskr_bit_t MAC_INTMSKR_b; + stc_eth_mac_macadhr0_bit_t MAC_MACADHR0_b; + uint32_t RESERVED7[32]; + stc_eth_mac_macadhr1_bit_t MAC_MACADHR1_b; + uint32_t RESERVED8[32]; + stc_eth_mac_macadhr2_bit_t MAC_MACADHR2_b; + uint32_t RESERVED9[32]; + stc_eth_mac_macadhr3_bit_t MAC_MACADHR3_b; + uint32_t RESERVED10[32]; + stc_eth_mac_macadhr4_bit_t MAC_MACADHR4_b; + uint32_t RESERVED11[1248]; + stc_eth_mmc_mmcctlr_bit_t MMC_MMCCTLR_b; + stc_eth_mmc_revstsr_bit_t MMC_REVSTSR_b; + stc_eth_mmc_trsstsr_bit_t MMC_TRSSTSR_b; + stc_eth_mmc_ritctlr_bit_t MMC_RITCTLR_b; + stc_eth_mmc_titctlr_bit_t MMC_TITCTLR_b; + uint32_t RESERVED12[5984]; + stc_eth_mac_l34ctlr_bit_t MAC_L34CTLR_b; + uint32_t RESERVED13[3072]; + stc_eth_mac_vtactlr_bit_t MAC_VTACTLR_b; + uint32_t RESERVED14[3008]; + stc_eth_ptp_tspctlr_bit_t PTP_TSPCTLR_b; + uint32_t RESERVED15[128]; + stc_eth_ptp_tmunser_bit_t PTP_TMUNSER_b; + uint32_t RESERVED16[128]; + stc_eth_ptp_tspstsr_bit_t PTP_TSPSTSR_b; + stc_eth_ptp_ppsctlr_bit_t PTP_PPSCTLR_b; + uint32_t RESERVED17[18048]; + stc_eth_dma_busmodr_bit_t DMA_BUSMODR_b; + uint32_t RESERVED18[128]; + stc_eth_dma_dmastsr_bit_t DMA_DMASTSR_b; + stc_eth_dma_oprmodr_bit_t DMA_OPRMODR_b; + stc_eth_dma_intenar_bit_t DMA_INTENAR_b; + stc_eth_dma_rfrcntr_bit_t DMA_RFRCNTR_b; +} bM4_ETH_TypeDef; + +typedef struct +{ + uint32_t RESERVED0[96]; + stc_fcm_str_bit_t STR_b; + uint32_t RESERVED1[32]; + stc_fcm_rccr_bit_t RCCR_b; + stc_fcm_rier_bit_t RIER_b; + stc_fcm_sr_bit_t SR_b; + stc_fcm_clr_bit_t CLR_b; +} bM4_FCM_TypeDef; + +typedef struct +{ + stc_fmac_enr_bit_t ENR_b; + uint32_t RESERVED0[32]; + stc_fmac_ier_bit_t IER_b; + uint32_t RESERVED1[96]; + stc_fmac_str_bit_t STR_b; +} bM4_FMAC_TypeDef; + +typedef struct +{ + stc_gpio_pidra_bit_t PIDRA_b; + uint32_t RESERVED0[16]; + stc_gpio_podra_bit_t PODRA_b; + stc_gpio_poera_bit_t POERA_b; + stc_gpio_posra_bit_t POSRA_b; + stc_gpio_porra_bit_t PORRA_b; + stc_gpio_potra_bit_t POTRA_b; + uint32_t RESERVED1[16]; + stc_gpio_pidrb_bit_t PIDRB_b; + uint32_t RESERVED2[16]; + stc_gpio_podrb_bit_t PODRB_b; + stc_gpio_poerb_bit_t POERB_b; + stc_gpio_posrb_bit_t POSRB_b; + stc_gpio_porrb_bit_t PORRB_b; + stc_gpio_potrb_bit_t POTRB_b; + uint32_t RESERVED3[16]; + stc_gpio_pidrc_bit_t PIDRC_b; + uint32_t RESERVED4[16]; + stc_gpio_podrc_bit_t PODRC_b; + stc_gpio_poerc_bit_t POERC_b; + stc_gpio_posrc_bit_t POSRC_b; + stc_gpio_porrc_bit_t PORRC_b; + stc_gpio_potrc_bit_t POTRC_b; + uint32_t RESERVED5[16]; + stc_gpio_pidrd_bit_t PIDRD_b; + uint32_t RESERVED6[16]; + stc_gpio_podrd_bit_t PODRD_b; + stc_gpio_poerd_bit_t POERD_b; + stc_gpio_posrd_bit_t POSRD_b; + stc_gpio_porrd_bit_t PORRD_b; + stc_gpio_potrd_bit_t POTRD_b; + uint32_t RESERVED7[16]; + stc_gpio_pidre_bit_t PIDRE_b; + uint32_t RESERVED8[16]; + stc_gpio_podre_bit_t PODRE_b; + stc_gpio_poere_bit_t POERE_b; + stc_gpio_posre_bit_t POSRE_b; + stc_gpio_porre_bit_t PORRE_b; + stc_gpio_potre_bit_t POTRE_b; + uint32_t RESERVED9[16]; + stc_gpio_pidrf_bit_t PIDRF_b; + uint32_t RESERVED10[16]; + stc_gpio_podrf_bit_t PODRF_b; + stc_gpio_poerf_bit_t POERF_b; + stc_gpio_posrf_bit_t POSRF_b; + stc_gpio_porrf_bit_t PORRF_b; + stc_gpio_potrf_bit_t POTRF_b; + uint32_t RESERVED11[16]; + stc_gpio_pidrg_bit_t PIDRG_b; + uint32_t RESERVED12[16]; + stc_gpio_podrg_bit_t PODRG_b; + stc_gpio_poerg_bit_t POERG_b; + stc_gpio_posrg_bit_t POSRG_b; + stc_gpio_porrg_bit_t PORRG_b; + stc_gpio_potrg_bit_t POTRG_b; + uint32_t RESERVED13[16]; + stc_gpio_pidrh_bit_t PIDRH_b; + uint32_t RESERVED14[16]; + stc_gpio_podrh_bit_t PODRH_b; + stc_gpio_poerh_bit_t POERH_b; + stc_gpio_posrh_bit_t POSRH_b; + stc_gpio_porrh_bit_t PORRH_b; + stc_gpio_potrh_bit_t POTRH_b; + uint32_t RESERVED15[16]; + stc_gpio_pidri_bit_t PIDRI_b; + uint32_t RESERVED16[16]; + stc_gpio_podri_bit_t PODRI_b; + stc_gpio_poeri_bit_t POERI_b; + stc_gpio_posri_bit_t POSRI_b; + stc_gpio_porri_bit_t PORRI_b; + stc_gpio_potri_bit_t POTRI_b; + uint32_t RESERVED17[6960]; + stc_gpio_pspcr_bit_t PSPCR_b; + uint32_t RESERVED18[32]; + stc_gpio_pinaer_bit_t PINAER_b; + stc_gpio_pwpr_bit_t PWPR_b; + uint32_t RESERVED19[16]; + stc_gpio_pcr_bit_t PCRA0_b; + stc_gpio_pfsr_bit_t PFSRA0_b; + stc_gpio_pcr_bit_t PCRA1_b; + stc_gpio_pfsr_bit_t PFSRA1_b; + stc_gpio_pcr_bit_t PCRA2_b; + stc_gpio_pfsr_bit_t PFSRA2_b; + stc_gpio_pcr_bit_t PCRA3_b; + stc_gpio_pfsr_bit_t PFSRA3_b; + stc_gpio_pcr_bit_t PCRA4_b; + stc_gpio_pfsr_bit_t PFSRA4_b; + stc_gpio_pcr_bit_t PCRA5_b; + stc_gpio_pfsr_bit_t PFSRA5_b; + stc_gpio_pcr_bit_t PCRA6_b; + stc_gpio_pfsr_bit_t PFSRA6_b; + stc_gpio_pcr_bit_t PCRA7_b; + stc_gpio_pfsr_bit_t PFSRA7_b; + stc_gpio_pcr_bit_t PCRA8_b; + stc_gpio_pfsr_bit_t PFSRA8_b; + stc_gpio_pcr_bit_t PCRA9_b; + stc_gpio_pfsr_bit_t PFSRA9_b; + stc_gpio_pcr_bit_t PCRA10_b; + stc_gpio_pfsr_bit_t PFSRA10_b; + stc_gpio_pcr_bit_t PCRA11_b; + stc_gpio_pfsr_bit_t PFSRA11_b; + stc_gpio_pcr_bit_t PCRA12_b; + stc_gpio_pfsr_bit_t PFSRA12_b; + stc_gpio_pcr_bit_t PCRA13_b; + stc_gpio_pfsr_bit_t PFSRA13_b; + stc_gpio_pcr_bit_t PCRA14_b; + stc_gpio_pfsr_bit_t PFSRA14_b; + stc_gpio_pcr_bit_t PCRA15_b; + stc_gpio_pfsr_bit_t PFSRA15_b; + stc_gpio_pcr_bit_t PCRB0_b; + stc_gpio_pfsr_bit_t PFSRB0_b; + stc_gpio_pcr_bit_t PCRB1_b; + stc_gpio_pfsr_bit_t PFSRB1_b; + stc_gpio_pcr_bit_t PCRB2_b; + stc_gpio_pfsr_bit_t PFSRB2_b; + stc_gpio_pcr_bit_t PCRB3_b; + stc_gpio_pfsr_bit_t PFSRB3_b; + stc_gpio_pcr_bit_t PCRB4_b; + stc_gpio_pfsr_bit_t PFSRB4_b; + stc_gpio_pcr_bit_t PCRB5_b; + stc_gpio_pfsr_bit_t PFSRB5_b; + stc_gpio_pcr_bit_t PCRB6_b; + stc_gpio_pfsr_bit_t PFSRB6_b; + stc_gpio_pcr_bit_t PCRB7_b; + stc_gpio_pfsr_bit_t PFSRB7_b; + stc_gpio_pcr_bit_t PCRB8_b; + stc_gpio_pfsr_bit_t PFSRB8_b; + stc_gpio_pcr_bit_t PCRB9_b; + stc_gpio_pfsr_bit_t PFSRB9_b; + stc_gpio_pcr_bit_t PCRB10_b; + stc_gpio_pfsr_bit_t PFSRB10_b; + stc_gpio_pcr_bit_t PCRB11_b; + stc_gpio_pfsr_bit_t PFSRB11_b; + stc_gpio_pcr_bit_t PCRB12_b; + stc_gpio_pfsr_bit_t PFSRB12_b; + stc_gpio_pcr_bit_t PCRB13_b; + stc_gpio_pfsr_bit_t PFSRB13_b; + stc_gpio_pcr_bit_t PCRB14_b; + stc_gpio_pfsr_bit_t PFSRB14_b; + stc_gpio_pcr_bit_t PCRB15_b; + stc_gpio_pfsr_bit_t PFSRB15_b; + stc_gpio_pcr_bit_t PCRC0_b; + stc_gpio_pfsr_bit_t PFSRC0_b; + stc_gpio_pcr_bit_t PCRC1_b; + stc_gpio_pfsr_bit_t PFSRC1_b; + stc_gpio_pcr_bit_t PCRC2_b; + stc_gpio_pfsr_bit_t PFSRC2_b; + stc_gpio_pcr_bit_t PCRC3_b; + stc_gpio_pfsr_bit_t PFSRC3_b; + stc_gpio_pcr_bit_t PCRC4_b; + stc_gpio_pfsr_bit_t PFSRC4_b; + stc_gpio_pcr_bit_t PCRC5_b; + stc_gpio_pfsr_bit_t PFSRC5_b; + stc_gpio_pcr_bit_t PCRC6_b; + stc_gpio_pfsr_bit_t PFSRC6_b; + stc_gpio_pcr_bit_t PCRC7_b; + stc_gpio_pfsr_bit_t PFSRC7_b; + stc_gpio_pcr_bit_t PCRC8_b; + stc_gpio_pfsr_bit_t PFSRC8_b; + stc_gpio_pcr_bit_t PCRC9_b; + stc_gpio_pfsr_bit_t PFSRC9_b; + stc_gpio_pcr_bit_t PCRC10_b; + stc_gpio_pfsr_bit_t PFSRC10_b; + stc_gpio_pcr_bit_t PCRC11_b; + stc_gpio_pfsr_bit_t PFSRC11_b; + stc_gpio_pcr_bit_t PCRC12_b; + stc_gpio_pfsr_bit_t PFSRC12_b; + stc_gpio_pcr_bit_t PCRC13_b; + stc_gpio_pfsr_bit_t PFSRC13_b; + stc_gpio_pcr_bit_t PCRC14_b; + stc_gpio_pfsr_bit_t PFSRC14_b; + stc_gpio_pcr_bit_t PCRC15_b; + stc_gpio_pfsr_bit_t PFSRC15_b; + stc_gpio_pcr_bit_t PCRD0_b; + stc_gpio_pfsr_bit_t PFSRD0_b; + stc_gpio_pcr_bit_t PCRD1_b; + stc_gpio_pfsr_bit_t PFSRD1_b; + stc_gpio_pcr_bit_t PCRD2_b; + stc_gpio_pfsr_bit_t PFSRD2_b; + stc_gpio_pcr_bit_t PCRD3_b; + stc_gpio_pfsr_bit_t PFSRD3_b; + stc_gpio_pcr_bit_t PCRD4_b; + stc_gpio_pfsr_bit_t PFSRD4_b; + stc_gpio_pcr_bit_t PCRD5_b; + stc_gpio_pfsr_bit_t PFSRD5_b; + stc_gpio_pcr_bit_t PCRD6_b; + stc_gpio_pfsr_bit_t PFSRD6_b; + stc_gpio_pcr_bit_t PCRD7_b; + stc_gpio_pfsr_bit_t PFSRD7_b; + stc_gpio_pcr_bit_t PCRD8_b; + stc_gpio_pfsr_bit_t PFSRD8_b; + stc_gpio_pcr_bit_t PCRD9_b; + stc_gpio_pfsr_bit_t PFSRD9_b; + stc_gpio_pcr_bit_t PCRD10_b; + stc_gpio_pfsr_bit_t PFSRD10_b; + stc_gpio_pcr_bit_t PCRD11_b; + stc_gpio_pfsr_bit_t PFSRD11_b; + stc_gpio_pcr_bit_t PCRD12_b; + stc_gpio_pfsr_bit_t PFSRD12_b; + stc_gpio_pcr_bit_t PCRD13_b; + stc_gpio_pfsr_bit_t PFSRD13_b; + stc_gpio_pcr_bit_t PCRD14_b; + stc_gpio_pfsr_bit_t PFSRD14_b; + stc_gpio_pcr_bit_t PCRD15_b; + stc_gpio_pfsr_bit_t PFSRD15_b; + stc_gpio_pcr_bit_t PCRE0_b; + stc_gpio_pfsr_bit_t PFSRE0_b; + stc_gpio_pcr_bit_t PCRE1_b; + stc_gpio_pfsr_bit_t PFSRE1_b; + stc_gpio_pcr_bit_t PCRE2_b; + stc_gpio_pfsr_bit_t PFSRE2_b; + stc_gpio_pcr_bit_t PCRE3_b; + stc_gpio_pfsr_bit_t PFSRE3_b; + stc_gpio_pcr_bit_t PCRE4_b; + stc_gpio_pfsr_bit_t PFSRE4_b; + stc_gpio_pcr_bit_t PCRE5_b; + stc_gpio_pfsr_bit_t PFSRE5_b; + stc_gpio_pcr_bit_t PCRE6_b; + stc_gpio_pfsr_bit_t PFSRE6_b; + stc_gpio_pcr_bit_t PCRE7_b; + stc_gpio_pfsr_bit_t PFSRE7_b; + stc_gpio_pcr_bit_t PCRE8_b; + stc_gpio_pfsr_bit_t PFSRE8_b; + stc_gpio_pcr_bit_t PCRE9_b; + stc_gpio_pfsr_bit_t PFSRE9_b; + stc_gpio_pcr_bit_t PCRE10_b; + stc_gpio_pfsr_bit_t PFSRE10_b; + stc_gpio_pcr_bit_t PCRE11_b; + stc_gpio_pfsr_bit_t PFSRE11_b; + stc_gpio_pcr_bit_t PCRE12_b; + stc_gpio_pfsr_bit_t PFSRE12_b; + stc_gpio_pcr_bit_t PCRE13_b; + stc_gpio_pfsr_bit_t PFSRE13_b; + stc_gpio_pcr_bit_t PCRE14_b; + stc_gpio_pfsr_bit_t PFSRE14_b; + stc_gpio_pcr_bit_t PCRE15_b; + stc_gpio_pfsr_bit_t PFSRE15_b; + stc_gpio_pcr_bit_t PCRF0_b; + stc_gpio_pfsr_bit_t PFSRF0_b; + stc_gpio_pcr_bit_t PCRF1_b; + stc_gpio_pfsr_bit_t PFSRF1_b; + stc_gpio_pcr_bit_t PCRF2_b; + stc_gpio_pfsr_bit_t PFSRF2_b; + stc_gpio_pcr_bit_t PCRF3_b; + stc_gpio_pfsr_bit_t PFSRF3_b; + stc_gpio_pcr_bit_t PCRF4_b; + stc_gpio_pfsr_bit_t PFSRF4_b; + stc_gpio_pcr_bit_t PCRF5_b; + stc_gpio_pfsr_bit_t PFSRF5_b; + stc_gpio_pcr_bit_t PCRF6_b; + stc_gpio_pfsr_bit_t PFSRF6_b; + stc_gpio_pcr_bit_t PCRF7_b; + stc_gpio_pfsr_bit_t PFSRF7_b; + stc_gpio_pcr_bit_t PCRF8_b; + stc_gpio_pfsr_bit_t PFSRF8_b; + stc_gpio_pcr_bit_t PCRF9_b; + stc_gpio_pfsr_bit_t PFSRF9_b; + stc_gpio_pcr_bit_t PCRF10_b; + stc_gpio_pfsr_bit_t PFSRF10_b; + stc_gpio_pcr_bit_t PCRF11_b; + stc_gpio_pfsr_bit_t PFSRF11_b; + stc_gpio_pcr_bit_t PCRF12_b; + stc_gpio_pfsr_bit_t PFSRF12_b; + stc_gpio_pcr_bit_t PCRF13_b; + stc_gpio_pfsr_bit_t PFSRF13_b; + stc_gpio_pcr_bit_t PCRF14_b; + stc_gpio_pfsr_bit_t PFSRF14_b; + stc_gpio_pcr_bit_t PCRF15_b; + stc_gpio_pfsr_bit_t PFSRF15_b; + stc_gpio_pcr_bit_t PCRG0_b; + stc_gpio_pfsr_bit_t PFSRG0_b; + stc_gpio_pcr_bit_t PCRG1_b; + stc_gpio_pfsr_bit_t PFSRG1_b; + stc_gpio_pcr_bit_t PCRG2_b; + stc_gpio_pfsr_bit_t PFSRG2_b; + stc_gpio_pcr_bit_t PCRG3_b; + stc_gpio_pfsr_bit_t PFSRG3_b; + stc_gpio_pcr_bit_t PCRG4_b; + stc_gpio_pfsr_bit_t PFSRG4_b; + stc_gpio_pcr_bit_t PCRG5_b; + stc_gpio_pfsr_bit_t PFSRG5_b; + stc_gpio_pcr_bit_t PCRG6_b; + stc_gpio_pfsr_bit_t PFSRG6_b; + stc_gpio_pcr_bit_t PCRG7_b; + stc_gpio_pfsr_bit_t PFSRG7_b; + stc_gpio_pcr_bit_t PCRG8_b; + stc_gpio_pfsr_bit_t PFSRG8_b; + stc_gpio_pcr_bit_t PCRG9_b; + stc_gpio_pfsr_bit_t PFSRG9_b; + stc_gpio_pcr_bit_t PCRG10_b; + stc_gpio_pfsr_bit_t PFSRG10_b; + stc_gpio_pcr_bit_t PCRG11_b; + stc_gpio_pfsr_bit_t PFSRG11_b; + stc_gpio_pcr_bit_t PCRG12_b; + stc_gpio_pfsr_bit_t PFSRG12_b; + stc_gpio_pcr_bit_t PCRG13_b; + stc_gpio_pfsr_bit_t PFSRG13_b; + stc_gpio_pcr_bit_t PCRG14_b; + stc_gpio_pfsr_bit_t PFSRG14_b; + stc_gpio_pcr_bit_t PCRG15_b; + stc_gpio_pfsr_bit_t PFSRG15_b; + stc_gpio_pcr_bit_t PCRH0_b; + stc_gpio_pfsr_bit_t PFSRH0_b; + stc_gpio_pcr_bit_t PCRH1_b; + stc_gpio_pfsr_bit_t PFSRH1_b; + stc_gpio_pcr_bit_t PCRH2_b; + stc_gpio_pfsr_bit_t PFSRH2_b; + stc_gpio_pcr_bit_t PCRH3_b; + stc_gpio_pfsr_bit_t PFSRH3_b; + stc_gpio_pcr_bit_t PCRH4_b; + stc_gpio_pfsr_bit_t PFSRH4_b; + stc_gpio_pcr_bit_t PCRH5_b; + stc_gpio_pfsr_bit_t PFSRH5_b; + stc_gpio_pcr_bit_t PCRH6_b; + stc_gpio_pfsr_bit_t PFSRH6_b; + stc_gpio_pcr_bit_t PCRH7_b; + stc_gpio_pfsr_bit_t PFSRH7_b; + stc_gpio_pcr_bit_t PCRH8_b; + stc_gpio_pfsr_bit_t PFSRH8_b; + stc_gpio_pcr_bit_t PCRH9_b; + stc_gpio_pfsr_bit_t PFSRH9_b; + stc_gpio_pcr_bit_t PCRH10_b; + stc_gpio_pfsr_bit_t PFSRH10_b; + stc_gpio_pcr_bit_t PCRH11_b; + stc_gpio_pfsr_bit_t PFSRH11_b; + stc_gpio_pcr_bit_t PCRH12_b; + stc_gpio_pfsr_bit_t PFSRH12_b; + stc_gpio_pcr_bit_t PCRH13_b; + stc_gpio_pfsr_bit_t PFSRH13_b; + stc_gpio_pcr_bit_t PCRH14_b; + stc_gpio_pfsr_bit_t PFSRH14_b; + stc_gpio_pcr_bit_t PCRH15_b; + stc_gpio_pfsr_bit_t PFSRH15_b; + stc_gpio_pcr_bit_t PCRI0_b; + stc_gpio_pfsr_bit_t PFSRI0_b; + stc_gpio_pcr_bit_t PCRI1_b; + stc_gpio_pfsr_bit_t PFSRI1_b; + stc_gpio_pcr_bit_t PCRI2_b; + stc_gpio_pfsr_bit_t PFSRI2_b; + stc_gpio_pcr_bit_t PCRI3_b; + stc_gpio_pfsr_bit_t PFSRI3_b; + stc_gpio_pcr_bit_t PCRI4_b; + stc_gpio_pfsr_bit_t PFSRI4_b; + stc_gpio_pcr_bit_t PCRI5_b; + stc_gpio_pfsr_bit_t PFSRI5_b; + stc_gpio_pcr_bit_t PCRI6_b; + stc_gpio_pfsr_bit_t PFSRI6_b; + stc_gpio_pcr_bit_t PCRI7_b; + stc_gpio_pfsr_bit_t PFSRI7_b; + stc_gpio_pcr_bit_t PCRI8_b; + stc_gpio_pfsr_bit_t PFSRI8_b; + stc_gpio_pcr_bit_t PCRI9_b; + stc_gpio_pfsr_bit_t PFSRI9_b; + stc_gpio_pcr_bit_t PCRI10_b; + stc_gpio_pfsr_bit_t PFSRI10_b; + stc_gpio_pcr_bit_t PCRI11_b; + stc_gpio_pfsr_bit_t PFSRI11_b; + stc_gpio_pcr_bit_t PCRI12_b; + stc_gpio_pfsr_bit_t PFSRI12_b; + stc_gpio_pcr_bit_t PCRI13_b; + stc_gpio_pfsr_bit_t PFSRI13_b; +} bM4_GPIO_TypeDef; + +typedef struct +{ + stc_hash_cr_bit_t CR_b; +} bM4_HASH_TypeDef; + +typedef struct +{ + stc_hrpwm_cr_bit_t CR1_b; + stc_hrpwm_cr_bit_t CR2_b; + stc_hrpwm_cr_bit_t CR3_b; + stc_hrpwm_cr_bit_t CR4_b; + stc_hrpwm_cr_bit_t CR5_b; + stc_hrpwm_cr_bit_t CR6_b; + stc_hrpwm_cr_bit_t CR7_b; + stc_hrpwm_cr_bit_t CR8_b; + stc_hrpwm_cr_bit_t CR9_b; + stc_hrpwm_cr_bit_t CR10_b; + stc_hrpwm_cr_bit_t CR11_b; + stc_hrpwm_cr_bit_t CR12_b; + stc_hrpwm_cr_bit_t CR13_b; + stc_hrpwm_cr_bit_t CR14_b; + stc_hrpwm_cr_bit_t CR15_b; + stc_hrpwm_cr_bit_t CR16_b; + uint32_t RESERVED0[128]; + stc_hrpwm_calcr_bit_t CALCR0_b; + stc_hrpwm_calcr_bit_t CALCR1_b; +} bM4_HRPWM_TypeDef; + +typedef struct +{ + stc_i2c_cr1_bit_t CR1_b; + stc_i2c_cr2_bit_t CR2_b; + stc_i2c_cr3_bit_t CR3_b; + uint32_t RESERVED0[32]; + stc_i2c_slr0_bit_t SLR0_b; + stc_i2c_slr1_bit_t SLR1_b; + uint32_t RESERVED1[32]; + stc_i2c_sr_bit_t SR_b; + stc_i2c_clr_bit_t CLR_b; + stc_i2c_dtr_bit_t DTR_b; + uint32_t RESERVED2[24]; + stc_i2c_drr_bit_t DRR_b; + uint32_t RESERVED3[56]; + stc_i2c_fltr_bit_t FLTR_b; +} bM4_I2C_TypeDef; + +typedef struct +{ + stc_i2s_ctrl_bit_t CTRL_b; + stc_i2s_sr_bit_t SR_b; + stc_i2s_er_bit_t ER_b; + stc_i2s_cfgr_bit_t CFGR_b; + uint32_t RESERVED0[64]; + stc_i2s_pr_bit_t PR_b; +} bM4_I2S_TypeDef; + +typedef struct +{ + stc_icg_icg0_bit_t ICG0_b; + stc_icg_icg1_bit_t ICG1_b; +} bM4_ICG_TypeDef; + +typedef struct +{ + uint32_t RESERVED0[32]; + stc_intc_nmienr_bit_t NMIENR_b; + stc_intc_nmifr_bit_t NMIFR_b; + stc_intc_nmicfr_bit_t NMICFR_b; + stc_intc_eirqcr_bit_t EIRQCR0_b; + stc_intc_eirqcr_bit_t EIRQCR1_b; + stc_intc_eirqcr_bit_t EIRQCR2_b; + stc_intc_eirqcr_bit_t EIRQCR3_b; + stc_intc_eirqcr_bit_t EIRQCR4_b; + stc_intc_eirqcr_bit_t EIRQCR5_b; + stc_intc_eirqcr_bit_t EIRQCR6_b; + stc_intc_eirqcr_bit_t EIRQCR7_b; + stc_intc_eirqcr_bit_t EIRQCR8_b; + stc_intc_eirqcr_bit_t EIRQCR9_b; + stc_intc_eirqcr_bit_t EIRQCR10_b; + stc_intc_eirqcr_bit_t EIRQCR11_b; + stc_intc_eirqcr_bit_t EIRQCR12_b; + stc_intc_eirqcr_bit_t EIRQCR13_b; + stc_intc_eirqcr_bit_t EIRQCR14_b; + stc_intc_eirqcr_bit_t EIRQCR15_b; + stc_intc_wupen_bit_t WUPEN_b; + stc_intc_eifr_bit_t EIFR_b; + stc_intc_eicfr_bit_t EICFR_b; + uint32_t RESERVED1[4096]; + stc_intc_vssel_bit_t VSSEL128_b; + stc_intc_vssel_bit_t VSSEL129_b; + stc_intc_vssel_bit_t VSSEL130_b; + stc_intc_vssel_bit_t VSSEL131_b; + stc_intc_vssel_bit_t VSSEL132_b; + stc_intc_vssel_bit_t VSSEL133_b; + stc_intc_vssel_bit_t VSSEL134_b; + stc_intc_vssel_bit_t VSSEL135_b; + stc_intc_vssel_bit_t VSSEL136_b; + stc_intc_vssel_bit_t VSSEL137_b; + stc_intc_vssel_bit_t VSSEL138_b; + stc_intc_vssel_bit_t VSSEL139_b; + stc_intc_vssel_bit_t VSSEL140_b; + stc_intc_vssel_bit_t VSSEL141_b; + stc_intc_vssel_bit_t VSSEL142_b; + stc_intc_vssel_bit_t VSSEL143_b; + stc_intc_swier_bit_t SWIER_b; + stc_intc_evter_bit_t EVTER_b; + stc_intc_ier_bit_t IER_b; +} bM4_INTC_TypeDef; + +typedef struct +{ + stc_keyscan_scr_bit_t SCR_b; + stc_keyscan_ser_bit_t SER_b; +} bM4_KEYSCAN_TypeDef; + +typedef struct +{ + stc_mau_csr_bit_t CSR_b; + uint32_t RESERVED0[64]; + stc_mau_rtr0_bit_t RTR0_b; + stc_mau_dtr1_bit_t DTR1_b; + stc_mau_rtr1_bit_t RTR1_b; +} bM4_MAU_TypeDef; + +typedef struct +{ + stc_mpu_rgd_bit_t RGD0_b; + stc_mpu_rgd_bit_t RGD1_b; + stc_mpu_rgd_bit_t RGD2_b; + stc_mpu_rgd_bit_t RGD3_b; + stc_mpu_rgd_bit_t RGD4_b; + stc_mpu_rgd_bit_t RGD5_b; + stc_mpu_rgd_bit_t RGD6_b; + stc_mpu_rgd_bit_t RGD7_b; + stc_mpu_rgd_bit_t RGD8_b; + stc_mpu_rgd_bit_t RGD9_b; + stc_mpu_rgd_bit_t RGD10_b; + stc_mpu_rgd_bit_t RGD11_b; + stc_mpu_rgd_bit_t RGD12_b; + stc_mpu_rgd_bit_t RGD13_b; + stc_mpu_rgd_bit_t RGD14_b; + stc_mpu_rgd_bit_t RGD15_b; + stc_mpu_sr_bit_t SR_b; + stc_mpu_eclr_bit_t ECLR_b; + stc_mpu_wp_bit_t WP_b; + stc_mpu_ippr_bit_t IPPR_b; + stc_mpu_s1rge_bit_t S1RGE_b; + stc_mpu_s1rgwp_bit_t S1RGWP_b; + stc_mpu_s1rgrp_bit_t S1RGRP_b; + stc_mpu_s1cr_bit_t S1CR_b; + stc_mpu_s2rge_bit_t S2RGE_b; + stc_mpu_s2rgwp_bit_t S2RGWP_b; + stc_mpu_s2rgrp_bit_t S2RGRP_b; + stc_mpu_s2cr_bit_t S2CR_b; + stc_mpu_frge_bit_t FRGE_b; + stc_mpu_frgwp_bit_t FRGWP_b; + stc_mpu_frgrp_bit_t FRGRP_b; + stc_mpu_fcr_bit_t FCR_b; + stc_mpu_hrge_bit_t HRGE_b; + stc_mpu_hrgwp_bit_t HRGWP_b; + stc_mpu_hrgrp_bit_t HRGRP_b; + stc_mpu_hcr_bit_t HCR_b; + stc_mpu_erge_bit_t ERGE_b; + stc_mpu_ergwp_bit_t ERGWP_b; + stc_mpu_ergrp_bit_t ERGRP_b; + stc_mpu_ecr_bit_t ECR_b; +} bM4_MPU_TypeDef; + +typedef struct +{ + stc_ots_ctl_bit_t CTL_b; + uint32_t RESERVED0[48]; + stc_ots_lpr_bit_t LPR_b; +} bM4_OTS_TypeDef; + +typedef struct +{ + stc_peric_usb_syctlreg_bit_t USB_SYCTLREG_b; + stc_peric_sdioc_syctlreg_bit_t SDIOC_SYCTLREG_b; + stc_peric_nfc_syctlreg_bit_t NFC_SYCTLREG_b; + stc_peric_exmc_enar_bit_t EXMC_ENAR_b; + uint32_t RESERVED0[64]; + stc_peric_can_syctlreg_bit_t CAN_SYCTLREG_b; + stc_peric_usart1_nfc_bit_t USART1_NFC_b; + uint32_t RESERVED1[64]; + stc_peric_nfc_systatreg_bit_t NFC_SYSTATREG_b; +} bM4_PERIC_TypeDef; + +typedef struct +{ + stc_pwc_fcg0_bit_t FCG0_b; + stc_pwc_fcg1_bit_t FCG1_b; + stc_pwc_fcg2_bit_t FCG2_b; + stc_pwc_fcg3_bit_t FCG3_b; + stc_pwc_fcg0pc_bit_t FCG0PC_b; + uint32_t RESERVED0[139616]; + stc_pwc_vbatcr_bit_t VBATCR_b; + uint32_t RESERVED1[184]; + stc_pwc_wktc2_bit_t WKTC2_b; + uint32_t RESERVED2[15672]; + stc_pwc_pwrc0_bit_t PWRC0_b; + uint32_t RESERVED3[24]; + stc_pwc_pwrc1_bit_t PWRC1_b; + uint32_t RESERVED4[24]; + stc_pwc_pwrc2_bit_t PWRC2_b; + uint32_t RESERVED5[56]; + stc_pwc_pwrc4_bit_t PWRC4_b; + uint32_t RESERVED6[24]; + stc_pwc_pvdcr0_bit_t PVDCR0_b; + uint32_t RESERVED7[24]; + stc_pwc_pvdcr1_bit_t PVDCR1_b; + uint32_t RESERVED8[24]; + stc_pwc_pvdfcr_bit_t PVDFCR_b; + uint32_t RESERVED9[24]; + stc_pwc_pvdlcr_bit_t PVDLCR_b; + uint32_t RESERVED10[56]; + stc_pwc_pdwke0_bit_t PDWKE0_b; + uint32_t RESERVED11[24]; + stc_pwc_pdwke1_bit_t PDWKE1_b; + uint32_t RESERVED12[24]; + stc_pwc_pdwke2_bit_t PDWKE2_b; + uint32_t RESERVED13[24]; + stc_pwc_pdwkes_bit_t PDWKES_b; + uint32_t RESERVED14[24]; + stc_pwc_pdwkf0_bit_t PDWKF0_b; + uint32_t RESERVED15[24]; + stc_pwc_pdwkf1_bit_t PDWKF1_b; + uint32_t RESERVED16[1304]; + stc_pwc_rampc0_bit_t RAMPC0_b; + stc_pwc_ramopm_bit_t RAMOPM_b; + stc_pwc_pramlpc_bit_t PRAMLPC_b; + uint32_t RESERVED17[32]; + stc_pwc_pvdicr_bit_t PVDICR_b; + uint32_t RESERVED18[24]; + stc_pwc_pvddsr_bit_t PVDDSR_b; + uint32_t RESERVED19[235704]; + stc_pwc_stpmcr_bit_t STPMCR_b; + uint32_t RESERVED20[8064]; + stc_pwc_fprc_bit_t FPRC_b; +} bM4_PWC_TypeDef; + +typedef struct +{ + uint32_t RESERVED0[1984]; + stc_rmu_prstcr0_bit_t PRSTCR0_b; + uint32_t RESERVED1[24]; + stc_rmu_rstf0_bit_t RSTF0_b; +} bM4_RMU_TypeDef; + +typedef struct +{ + stc_rtc_cr0_bit_t CR0_b; + uint32_t RESERVED0[24]; + stc_rtc_cr1_bit_t CR1_b; + uint32_t RESERVED1[24]; + stc_rtc_cr2_bit_t CR2_b; + uint32_t RESERVED2[24]; + stc_rtc_cr3_bit_t CR3_b; + uint32_t RESERVED3[88]; + stc_rtc_hour_bit_t HOUR_b; + uint32_t RESERVED4[24]; + stc_rtc_week_bit_t WEEK_b; + uint32_t RESERVED5[152]; + stc_rtc_almhour_bit_t ALMHOUR_b; + uint32_t RESERVED6[24]; + stc_rtc_almweek_bit_t ALMWEEK_b; + uint32_t RESERVED7[24]; + stc_rtc_errcrh_bit_t ERRCRH_b; + uint32_t RESERVED8[56]; + stc_rtc_tpcr0_bit_t TPCR0_b; + uint32_t RESERVED9[24]; + stc_rtc_tpcr1_bit_t TPCR1_b; + uint32_t RESERVED10[24]; + stc_rtc_tpsr_bit_t TPSR_b; + uint32_t RESERVED11[88]; + stc_rtc_hourtp_bit_t HOURTP_b; +} bM4_RTC_TypeDef; + +typedef struct +{ + uint32_t RESERVED0[96]; + stc_sdioc_transmode_bit_t TRANSMODE_b; + stc_sdioc_cmd_bit_t CMD_b; + uint32_t RESERVED1[160]; + stc_sdioc_pstat_bit_t PSTAT_b; + stc_sdioc_hostcon_bit_t HOSTCON_b; + stc_sdioc_pwrcon_bit_t PWRCON_b; + stc_sdioc_blkgpcon_bit_t BLKGPCON_b; + uint32_t RESERVED2[8]; + stc_sdioc_clkcon_bit_t CLKCON_b; + stc_sdioc_toutcon_bit_t TOUTCON_b; + stc_sdioc_sftrst_bit_t SFTRST_b; + stc_sdioc_norintst_bit_t NORINTST_b; + stc_sdioc_errintst_bit_t ERRINTST_b; + stc_sdioc_norintsten_bit_t NORINTSTEN_b; + stc_sdioc_errintsten_bit_t ERRINTSTEN_b; + stc_sdioc_norintsgen_bit_t NORINTSGEN_b; + stc_sdioc_errintsgen_bit_t ERRINTSGEN_b; + stc_sdioc_atcerrst_bit_t ATCERRST_b; + uint32_t RESERVED3[144]; + stc_sdioc_fea_bit_t FEA_b; + stc_sdioc_fee_bit_t FEE_b; +} bM4_SDIOC_TypeDef; + +typedef struct +{ + uint32_t RESERVED0[32]; + stc_spi_cr1_bit_t CR1_b; + uint32_t RESERVED1[32]; + stc_spi_cfg1_bit_t CFG1_b; + uint32_t RESERVED2[32]; + stc_spi_sr_bit_t SR_b; + stc_spi_cfg2_bit_t CFG2_b; +} bM4_SPI_TypeDef; + +typedef struct +{ + stc_sramc_wtcr_bit_t WTCR_b; + stc_sramc_wtpr_bit_t WTPR_b; + stc_sramc_ckcr_bit_t CKCR_b; + stc_sramc_ckpr_bit_t CKPR_b; + stc_sramc_cksr_bit_t CKSR_b; +} bM4_SRAMC_TypeDef; + +typedef struct +{ + stc_swdt_cr_bit_t CR_b; + stc_swdt_sr_bit_t SR_b; +} bM4_SWDT_TypeDef; + +typedef struct +{ + uint32_t RESERVED0[128]; + stc_tmr0_bconr_bit_t BCONR_b; + stc_tmr0_stflr_bit_t STFLR_b; +} bM4_TMR0_TypeDef; + +typedef struct +{ + stc_tmr2_cntar_bit_t CNTAR_b; + stc_tmr2_cntbr_bit_t CNTBR_b; + stc_tmr2_cmpar_bit_t CMPAR_b; + stc_tmr2_cmpbr_bit_t CMPBR_b; + stc_tmr2_bconr_bit_t BCONR_b; + stc_tmr2_iconr_bit_t ICONR_b; + stc_tmr2_pconr_bit_t PCONR_b; + stc_tmr2_hconr_bit_t HCONR_b; + stc_tmr2_stflr_bit_t STFLR_b; +} bM4_TMR2_TypeDef; + +typedef struct +{ + uint32_t RESERVED0[192]; + stc_tmr4_ocsr_bit_t OCSRU_b; + stc_tmr4_ocer_bit_t OCERU_b; + stc_tmr4_ocsr_bit_t OCSRV_b; + stc_tmr4_ocer_bit_t OCERV_b; + stc_tmr4_ocsr_bit_t OCSRW_b; + stc_tmr4_ocer_bit_t OCERW_b; + stc_tmr4_ocmrh_bit_t OCMRHUH_b; + uint32_t RESERVED1[16]; + stc_tmr4_ocmrl_bit_t OCMRLUL_b; + stc_tmr4_ocmrh_bit_t OCMRHVH_b; + uint32_t RESERVED2[16]; + stc_tmr4_ocmrl_bit_t OCMRLVL_b; + stc_tmr4_ocmrh_bit_t OCMRHWH_b; + uint32_t RESERVED3[16]; + stc_tmr4_ocmrl_bit_t OCMRLWL_b; + uint32_t RESERVED4[96]; + stc_tmr4_ccsr_bit_t CCSR_b; + uint32_t RESERVED5[624]; + stc_tmr4_pocr_bit_t POCRU_b; + uint32_t RESERVED6[16]; + stc_tmr4_pocr_bit_t POCRV_b; + uint32_t RESERVED7[16]; + stc_tmr4_pocr_bit_t POCRW_b; + uint32_t RESERVED8[16]; + stc_tmr4_rcsr_bit_t RCSR_b; + uint32_t RESERVED9[272]; + stc_tmr4_scsr_bit_t SCSRUH_b; + stc_tmr4_scmr_bit_t SCMRUH_b; + stc_tmr4_scsr_bit_t SCSRUL_b; + stc_tmr4_scmr_bit_t SCMRUL_b; + stc_tmr4_scsr_bit_t SCSRVH_b; + stc_tmr4_scmr_bit_t SCMRVH_b; + stc_tmr4_scsr_bit_t SCSRVL_b; + stc_tmr4_scmr_bit_t SCMRVL_b; + stc_tmr4_scsr_bit_t SCSRWH_b; + stc_tmr4_scmr_bit_t SCMRWH_b; + stc_tmr4_scsr_bit_t SCSRWL_b; + stc_tmr4_scmr_bit_t SCMRWL_b; + stc_tmr4_pscr_bit_t PSCR_b; + stc_tmr4_scer_bit_t SCER_b; +} bM4_TMR4_TypeDef; + +typedef struct +{ + uint32_t RESERVED0[2560]; + stc_tmr6_gconr_bit_t GCONR_b; + stc_tmr6_iconr_bit_t ICONR_b; + stc_tmr6_bconr_bit_t BCONR_b; + stc_tmr6_dconr_bit_t DCONR_b; + uint32_t RESERVED1[32]; + stc_tmr6_pcnar_bit_t PCNAR_b; + stc_tmr6_pcnbr_bit_t PCNBR_b; + stc_tmr6_fcngr_bit_t FCNGR_b; + stc_tmr6_vperr_bit_t VPERR_b; + stc_tmr6_stflr_bit_t STFLR_b; + uint32_t RESERVED2[192]; + stc_tmr6_hstar_bit_t HSTAR_b; + stc_tmr6_hstpr_bit_t HSTPR_b; + stc_tmr6_hclrr_bit_t HCLRR_b; + stc_tmr6_hupdr_bit_t HUPDR_b; + stc_tmr6_hcpar_bit_t HCPAR_b; + stc_tmr6_hcpbr_bit_t HCPBR_b; + stc_tmr6_hcupr_bit_t HCUPR_b; + stc_tmr6_hcdor_bit_t HCDOR_b; + uint32_t RESERVED3[4704]; + stc_tmr6_fcntr_bit_t FCNTR_b; + stc_tmr6_sstar_bit_t SSTAR_b; + stc_tmr6_sstpr_bit_t SSTPR_b; + stc_tmr6_sclrr_bit_t SCLRR_b; + stc_tmr6_supdr_bit_t SUPDR_b; +} bM4_TMR6_TypeDef; + +typedef struct +{ + stc_tmra_cnter_bit_t CNTER_b; + stc_tmra_perar_bit_t PERAR_b; + uint32_t RESERVED0[448]; + stc_tmra_cmpar1_bit_t CMPAR1_b; + stc_tmra_cmpar2_bit_t CMPAR2_b; + stc_tmra_cmpar3_bit_t CMPAR3_b; + stc_tmra_cmpar4_bit_t CMPAR4_b; + uint32_t RESERVED1[384]; + stc_tmra_bcstr_bit_t BCSTR_b; + stc_tmra_hconr_bit_t HCONR_b; + stc_tmra_hcupr_bit_t HCUPR_b; + stc_tmra_hcdor_bit_t HCDOR_b; + stc_tmra_iconr_bit_t ICONR_b; + stc_tmra_econr_bit_t ECONR_b; + stc_tmra_fconr_bit_t FCONR_b; + stc_tmra_stflr_bit_t STFLR_b; + uint32_t RESERVED2[256]; + stc_tmra_bconr_bit_t BCONR1_b; + uint32_t RESERVED3[32]; + stc_tmra_bconr_bit_t BCONR2_b; + uint32_t RESERVED4[416]; + stc_tmra_cconr_bit_t CCONR1_b; + stc_tmra_cconr_bit_t CCONR2_b; + stc_tmra_cconr_bit_t CCONR3_b; + stc_tmra_cconr_bit_t CCONR4_b; + uint32_t RESERVED5[384]; + stc_tmra_pconr_bit_t PCONR1_b; + stc_tmra_pconr_bit_t PCONR2_b; + stc_tmra_pconr_bit_t PCONR3_b; + stc_tmra_pconr_bit_t PCONR4_b; +} bM4_TMRA_TypeDef; + +typedef struct +{ + stc_trng_cr_bit_t CR_b; + stc_trng_mr_bit_t MR_b; +} bM4_TRNG_TypeDef; + +typedef struct +{ + stc_usart_sr_bit_t SR_b; + stc_usart_dr_bit_t DR_b; + uint32_t RESERVED0[32]; + stc_usart_cr1_bit_t CR1_b; + stc_usart_cr2_bit_t CR2_b; + stc_usart_cr3_bit_t CR3_b; + stc_usart_pr_bit_t PR_b; +} bM4_USART_TypeDef; + +typedef struct +{ + stc_usbfs_gotgctl_bit_t GOTGCTL_b; + stc_usbfs_gotgint_bit_t GOTGINT_b; + stc_usbfs_gahbcfg_bit_t GAHBCFG_b; + stc_usbfs_gusbcfg_bit_t GUSBCFG_b; + stc_usbfs_grstctl_bit_t GRSTCTL_b; + stc_usbfs_gintsts_bit_t GINTSTS_b; + stc_usbfs_gintmsk_bit_t GINTMSK_b; + stc_usbfs_grxstsr_bit_t GRXSTSR_b; + stc_usbfs_grxstsp_bit_t GRXSTSP_b; + stc_usbfs_grxfsiz_bit_t GRXFSIZ_b; + uint32_t RESERVED0[32]; + stc_usbfs_gnptxsts_bit_t GNPTXSTS_b; + uint32_t RESERVED1[288]; + stc_usbfs_glpmcfg_bit_t GLPMCFG_b; + uint32_t RESERVED2[7488]; + stc_usbfs_hcfg_bit_t HCFG_b; + stc_usbfs_hfir_bit_t HFIR_b; + uint32_t RESERVED3[64]; + stc_usbfs_hptxsts_bit_t HPTXSTS_b; + stc_usbfs_haint_bit_t HAINT_b; + stc_usbfs_haintmsk_bit_t HAINTMSK_b; + uint32_t RESERVED4[288]; + stc_usbfs_hprt_bit_t HPRT_b; + uint32_t RESERVED5[1504]; + stc_usbfs_hcchar0_bit_t HCCHAR0_b; + stc_usbfs_hcsplt0_bit_t HCSPLT0_b; + stc_usbfs_hcint0_bit_t HCINT0_b; + stc_usbfs_hcintmsk0_bit_t HCINTMSK0_b; + stc_usbfs_hctsiz0_bit_t HCTSIZ0_b; + uint32_t RESERVED6[96]; + stc_usbfs_hcchar1_bit_t HCCHAR1_b; + stc_usbfs_hcsplt1_bit_t HCSPLT1_b; + stc_usbfs_hcint1_bit_t HCINT1_b; + stc_usbfs_hcintmsk1_bit_t HCINTMSK1_b; + stc_usbfs_hctsiz1_bit_t HCTSIZ1_b; + uint32_t RESERVED7[96]; + stc_usbfs_hcchar2_bit_t HCCHAR2_b; + stc_usbfs_hcsplt2_bit_t HCSPLT2_b; + stc_usbfs_hcint2_bit_t HCINT2_b; + stc_usbfs_hcintmsk2_bit_t HCINTMSK2_b; + stc_usbfs_hctsiz2_bit_t HCTSIZ2_b; + uint32_t RESERVED8[96]; + stc_usbfs_hcchar3_bit_t HCCHAR3_b; + stc_usbfs_hcsplt3_bit_t HCSPLT3_b; + stc_usbfs_hcint3_bit_t HCINT3_b; + stc_usbfs_hcintmsk3_bit_t HCINTMSK3_b; + stc_usbfs_hctsiz3_bit_t HCTSIZ3_b; + uint32_t RESERVED9[96]; + stc_usbfs_hcchar4_bit_t HCCHAR4_b; + stc_usbfs_hcsplt4_bit_t HCSPLT4_b; + stc_usbfs_hcint4_bit_t HCINT4_b; + stc_usbfs_hcintmsk4_bit_t HCINTMSK4_b; + stc_usbfs_hctsiz4_bit_t HCTSIZ4_b; + uint32_t RESERVED10[96]; + stc_usbfs_hcchar5_bit_t HCCHAR5_b; + stc_usbfs_hcsplt5_bit_t HCSPLT5_b; + stc_usbfs_hcint5_bit_t HCINT5_b; + stc_usbfs_hcintmsk5_bit_t HCINTMSK5_b; + stc_usbfs_hctsiz5_bit_t HCTSIZ5_b; + uint32_t RESERVED11[96]; + stc_usbfs_hcchar6_bit_t HCCHAR6_b; + stc_usbfs_hcsplt6_bit_t HCSPLT6_b; + stc_usbfs_hcint6_bit_t HCINT6_b; + stc_usbfs_hcintmsk6_bit_t HCINTMSK6_b; + stc_usbfs_hctsiz6_bit_t HCTSIZ6_b; + uint32_t RESERVED12[96]; + stc_usbfs_hcchar7_bit_t HCCHAR7_b; + stc_usbfs_hcsplt7_bit_t HCSPLT7_b; + stc_usbfs_hcint7_bit_t HCINT7_b; + stc_usbfs_hcintmsk7_bit_t HCINTMSK7_b; + stc_usbfs_hctsiz7_bit_t HCTSIZ7_b; + uint32_t RESERVED13[96]; + stc_usbfs_hcchar8_bit_t HCCHAR8_b; + stc_usbfs_hcsplt8_bit_t HCSPLT8_b; + stc_usbfs_hcint8_bit_t HCINT8_b; + stc_usbfs_hcintmsk8_bit_t HCINTMSK8_b; + stc_usbfs_hctsiz8_bit_t HCTSIZ8_b; + uint32_t RESERVED14[96]; + stc_usbfs_hcchar9_bit_t HCCHAR9_b; + stc_usbfs_hcsplt9_bit_t HCSPLT9_b; + stc_usbfs_hcint9_bit_t HCINT9_b; + stc_usbfs_hcintmsk9_bit_t HCINTMSK9_b; + stc_usbfs_hctsiz9_bit_t HCTSIZ9_b; + uint32_t RESERVED15[96]; + stc_usbfs_hcchar10_bit_t HCCHAR10_b; + stc_usbfs_hcsplt10_bit_t HCSPLT10_b; + stc_usbfs_hcint10_bit_t HCINT10_b; + stc_usbfs_hcintmsk10_bit_t HCINTMSK10_b; + stc_usbfs_hctsiz10_bit_t HCTSIZ10_b; + uint32_t RESERVED16[96]; + stc_usbfs_hcchar11_bit_t HCCHAR11_b; + stc_usbfs_hcsplt11_bit_t HCSPLT11_b; + stc_usbfs_hcint11_bit_t HCINT11_b; + stc_usbfs_hcintmsk11_bit_t HCINTMSK11_b; + stc_usbfs_hctsiz11_bit_t HCTSIZ11_b; + uint32_t RESERVED17[96]; + stc_usbfs_hcchar12_bit_t HCCHAR12_b; + stc_usbfs_hcsplt12_bit_t HCSPLT12_b; + stc_usbfs_hcint12_bit_t HCINT12_b; + stc_usbfs_hcintmsk12_bit_t HCINTMSK12_b; + stc_usbfs_hctsiz12_bit_t HCTSIZ12_b; + uint32_t RESERVED18[96]; + stc_usbfs_hcchar13_bit_t HCCHAR13_b; + stc_usbfs_hcsplt13_bit_t HCSPLT13_b; + stc_usbfs_hcint13_bit_t HCINT13_b; + stc_usbfs_hcintmsk13_bit_t HCINTMSK13_b; + stc_usbfs_hctsiz13_bit_t HCTSIZ13_b; + uint32_t RESERVED19[96]; + stc_usbfs_hcchar14_bit_t HCCHAR14_b; + stc_usbfs_hcsplt14_bit_t HCSPLT14_b; + stc_usbfs_hcint14_bit_t HCINT14_b; + stc_usbfs_hcintmsk14_bit_t HCINTMSK14_b; + stc_usbfs_hctsiz14_bit_t HCTSIZ14_b; + uint32_t RESERVED20[96]; + stc_usbfs_hcchar15_bit_t HCCHAR15_b; + stc_usbfs_hcsplt15_bit_t HCSPLT15_b; + stc_usbfs_hcint15_bit_t HCINT15_b; + stc_usbfs_hcintmsk15_bit_t HCINTMSK15_b; + stc_usbfs_hctsiz15_bit_t HCTSIZ15_b; + uint32_t RESERVED21[2144]; + stc_usbfs_dcfg_bit_t DCFG_b; + stc_usbfs_dctl_bit_t DCTL_b; + stc_usbfs_dsts_bit_t DSTS_b; + uint32_t RESERVED22[32]; + stc_usbfs_diepmsk_bit_t DIEPMSK_b; + stc_usbfs_doepmsk_bit_t DOEPMSK_b; + stc_usbfs_daint_bit_t DAINT_b; + stc_usbfs_daintmsk_bit_t DAINTMSK_b; + uint32_t RESERVED23[160]; + stc_usbfs_diepempmsk_bit_t DIEPEMPMSK_b; + uint32_t RESERVED24[1600]; + stc_usbfs_diepctl0_bit_t DIEPCTL0_b; + uint32_t RESERVED25[32]; + stc_usbfs_diepint0_bit_t DIEPINT0_b; + uint32_t RESERVED26[96]; + stc_usbfs_dtxfsts0_bit_t DTXFSTS0_b; + uint32_t RESERVED27[32]; + stc_usbfs_diepctl1_bit_t DIEPCTL1_b; + uint32_t RESERVED28[32]; + stc_usbfs_diepint1_bit_t DIEPINT1_b; + uint32_t RESERVED29[160]; + stc_usbfs_diepctl2_bit_t DIEPCTL2_b; + uint32_t RESERVED30[32]; + stc_usbfs_diepint2_bit_t DIEPINT2_b; + uint32_t RESERVED31[160]; + stc_usbfs_diepctl3_bit_t DIEPCTL3_b; + uint32_t RESERVED32[32]; + stc_usbfs_diepint3_bit_t DIEPINT3_b; + uint32_t RESERVED33[160]; + stc_usbfs_diepctl4_bit_t DIEPCTL4_b; + uint32_t RESERVED34[32]; + stc_usbfs_diepint4_bit_t DIEPINT4_b; + uint32_t RESERVED35[160]; + stc_usbfs_diepctl5_bit_t DIEPCTL5_b; + uint32_t RESERVED36[32]; + stc_usbfs_diepint5_bit_t DIEPINT5_b; + uint32_t RESERVED37[160]; + stc_usbfs_diepctl6_bit_t DIEPCTL6_b; + uint32_t RESERVED38[32]; + stc_usbfs_diepint6_bit_t DIEPINT6_b; + uint32_t RESERVED39[160]; + stc_usbfs_diepctl7_bit_t DIEPCTL7_b; + uint32_t RESERVED40[32]; + stc_usbfs_diepint7_bit_t DIEPINT7_b; + uint32_t RESERVED41[160]; + stc_usbfs_diepctl8_bit_t DIEPCTL8_b; + uint32_t RESERVED42[32]; + stc_usbfs_diepint8_bit_t DIEPINT8_b; + uint32_t RESERVED43[160]; + stc_usbfs_diepctl9_bit_t DIEPCTL9_b; + uint32_t RESERVED44[32]; + stc_usbfs_diepint9_bit_t DIEPINT9_b; + uint32_t RESERVED45[160]; + stc_usbfs_diepctl10_bit_t DIEPCTL10_b; + uint32_t RESERVED46[32]; + stc_usbfs_diepint10_bit_t DIEPINT10_b; + uint32_t RESERVED47[160]; + stc_usbfs_diepctl11_bit_t DIEPCTL11_b; + uint32_t RESERVED48[32]; + stc_usbfs_diepint11_bit_t DIEPINT11_b; + uint32_t RESERVED49[160]; + stc_usbfs_diepctl12_bit_t DIEPCTL12_b; + uint32_t RESERVED50[32]; + stc_usbfs_diepint12_bit_t DIEPINT12_b; + uint32_t RESERVED51[160]; + stc_usbfs_diepctl13_bit_t DIEPCTL13_b; + uint32_t RESERVED52[32]; + stc_usbfs_diepint13_bit_t DIEPINT13_b; + uint32_t RESERVED53[160]; + stc_usbfs_diepctl14_bit_t DIEPCTL14_b; + uint32_t RESERVED54[32]; + stc_usbfs_diepint14_bit_t DIEPINT14_b; + uint32_t RESERVED55[160]; + stc_usbfs_diepctl15_bit_t DIEPCTL15_b; + uint32_t RESERVED56[32]; + stc_usbfs_diepint15_bit_t DIEPINT15_b; + uint32_t RESERVED57[160]; + stc_usbfs_doepctl0_bit_t DOEPCTL0_b; + uint32_t RESERVED58[32]; + stc_usbfs_doepint0_bit_t DOEPINT0_b; + uint32_t RESERVED59[160]; + stc_usbfs_doepctl1_bit_t DOEPCTL1_b; + uint32_t RESERVED60[32]; + stc_usbfs_doepint1_bit_t DOEPINT1_b; + uint32_t RESERVED61[32]; + stc_usbfs_doeptsiz1_bit_t DOEPTSIZ1_b; + uint32_t RESERVED62[96]; + stc_usbfs_doepctl2_bit_t DOEPCTL2_b; + uint32_t RESERVED63[32]; + stc_usbfs_doepint2_bit_t DOEPINT2_b; + uint32_t RESERVED64[32]; + stc_usbfs_doeptsiz2_bit_t DOEPTSIZ2_b; + uint32_t RESERVED65[96]; + stc_usbfs_doepctl3_bit_t DOEPCTL3_b; + uint32_t RESERVED66[32]; + stc_usbfs_doepint3_bit_t DOEPINT3_b; + uint32_t RESERVED67[32]; + stc_usbfs_doeptsiz3_bit_t DOEPTSIZ3_b; + uint32_t RESERVED68[96]; + stc_usbfs_doepctl4_bit_t DOEPCTL4_b; + uint32_t RESERVED69[32]; + stc_usbfs_doepint4_bit_t DOEPINT4_b; + uint32_t RESERVED70[32]; + stc_usbfs_doeptsiz4_bit_t DOEPTSIZ4_b; + uint32_t RESERVED71[96]; + stc_usbfs_doepctl5_bit_t DOEPCTL5_b; + uint32_t RESERVED72[32]; + stc_usbfs_doepint5_bit_t DOEPINT5_b; + uint32_t RESERVED73[32]; + stc_usbfs_doeptsiz5_bit_t DOEPTSIZ5_b; + uint32_t RESERVED74[96]; + stc_usbfs_doepctl6_bit_t DOEPCTL6_b; + uint32_t RESERVED75[32]; + stc_usbfs_doepint6_bit_t DOEPINT6_b; + uint32_t RESERVED76[32]; + stc_usbfs_doeptsiz6_bit_t DOEPTSIZ6_b; + uint32_t RESERVED77[96]; + stc_usbfs_doepctl7_bit_t DOEPCTL7_b; + uint32_t RESERVED78[32]; + stc_usbfs_doepint7_bit_t DOEPINT7_b; + uint32_t RESERVED79[32]; + stc_usbfs_doeptsiz7_bit_t DOEPTSIZ7_b; + uint32_t RESERVED80[96]; + stc_usbfs_doepctl8_bit_t DOEPCTL8_b; + uint32_t RESERVED81[32]; + stc_usbfs_doepint8_bit_t DOEPINT8_b; + uint32_t RESERVED82[32]; + stc_usbfs_doeptsiz8_bit_t DOEPTSIZ8_b; + uint32_t RESERVED83[96]; + stc_usbfs_doepctl9_bit_t DOEPCTL9_b; + uint32_t RESERVED84[32]; + stc_usbfs_doepint9_bit_t DOEPINT9_b; + uint32_t RESERVED85[32]; + stc_usbfs_doeptsiz9_bit_t DOEPTSIZ9_b; + uint32_t RESERVED86[96]; + stc_usbfs_doepctl10_bit_t DOEPCTL10_b; + uint32_t RESERVED87[32]; + stc_usbfs_doepint10_bit_t DOEPINT10_b; + uint32_t RESERVED88[32]; + stc_usbfs_doeptsiz10_bit_t DOEPTSIZ10_b; + uint32_t RESERVED89[96]; + stc_usbfs_doepctl11_bit_t DOEPCTL11_b; + uint32_t RESERVED90[32]; + stc_usbfs_doepint11_bit_t DOEPINT11_b; + uint32_t RESERVED91[32]; + stc_usbfs_doeptsiz11_bit_t DOEPTSIZ11_b; + uint32_t RESERVED92[96]; + stc_usbfs_doepctl12_bit_t DOEPCTL12_b; + uint32_t RESERVED93[32]; + stc_usbfs_doepint12_bit_t DOEPINT12_b; + uint32_t RESERVED94[32]; + stc_usbfs_doeptsiz12_bit_t DOEPTSIZ12_b; + uint32_t RESERVED95[96]; + stc_usbfs_doepctl13_bit_t DOEPCTL13_b; + uint32_t RESERVED96[32]; + stc_usbfs_doepint13_bit_t DOEPINT13_b; + uint32_t RESERVED97[32]; + stc_usbfs_doeptsiz13_bit_t DOEPTSIZ13_b; + uint32_t RESERVED98[96]; + stc_usbfs_doepctl14_bit_t DOEPCTL14_b; + uint32_t RESERVED99[32]; + stc_usbfs_doepint14_bit_t DOEPINT14_b; + uint32_t RESERVED100[32]; + stc_usbfs_doeptsiz14_bit_t DOEPTSIZ14_b; + uint32_t RESERVED101[96]; + stc_usbfs_doepctl15_bit_t DOEPCTL15_b; + uint32_t RESERVED102[32]; + stc_usbfs_doepint15_bit_t DOEPINT15_b; + uint32_t RESERVED103[32]; + stc_usbfs_doeptsiz15_bit_t DOEPTSIZ15_b; + uint32_t RESERVED104[2144]; + stc_usbfs_pcgcctl_bit_t PCGCCTL_b; +} bM4_USBFS_TypeDef; + +typedef struct +{ + stc_usbhs_gotgctl_bit_t GOTGCTL_b; + stc_usbhs_gotgint_bit_t GOTGINT_b; + stc_usbhs_gahbcfg_bit_t GAHBCFG_b; + stc_usbhs_gusbcfg_bit_t GUSBCFG_b; + stc_usbhs_grstctl_bit_t GRSTCTL_b; + stc_usbhs_gintsts_bit_t GINTSTS_b; + stc_usbhs_gintmsk_bit_t GINTMSK_b; + stc_usbhs_grxstsr_bit_t GRXSTSR_b; + stc_usbhs_grxstsp_bit_t GRXSTSP_b; + stc_usbhs_grxfsiz_bit_t GRXFSIZ_b; + stc_usbhs_gnptxfsiz_bit_t GNPTXFSIZ_b; + stc_usbhs_gnptxsts_bit_t GNPTXSTS_b; + uint32_t RESERVED0[32]; + stc_usbhs_gpvndctl_bit_t GPVNDCTL_b; + uint32_t RESERVED1[224]; + stc_usbhs_glpmcfg_bit_t GLPMCFG_b; + uint32_t RESERVED2[32]; + stc_usbhs_gdfifocfg_bit_t GDFIFOCFG_b; + uint32_t RESERVED3[1280]; + stc_usbhs_hptxfsiz_bit_t HPTXFSIZ_b; + stc_usbhs_dieptxf1_bit_t DIEPTXF1_b; + stc_usbhs_dieptxf2_bit_t DIEPTXF2_b; + stc_usbhs_dieptxf3_bit_t DIEPTXF3_b; + stc_usbhs_dieptxf4_bit_t DIEPTXF4_b; + stc_usbhs_dieptxf5_bit_t DIEPTXF5_b; + stc_usbhs_dieptxf6_bit_t DIEPTXF6_b; + stc_usbhs_dieptxf7_bit_t DIEPTXF7_b; + stc_usbhs_dieptxf8_bit_t DIEPTXF8_b; + stc_usbhs_dieptxf9_bit_t DIEPTXF9_b; + stc_usbhs_dieptxf10_bit_t DIEPTXF10_b; + stc_usbhs_dieptxf11_bit_t DIEPTXF11_b; + stc_usbhs_dieptxf12_bit_t DIEPTXF12_b; + stc_usbhs_dieptxf13_bit_t DIEPTXF13_b; + stc_usbhs_dieptxf14_bit_t DIEPTXF14_b; + stc_usbhs_dieptxf15_bit_t DIEPTXF15_b; + uint32_t RESERVED4[5632]; + stc_usbhs_hcfg_bit_t HCFG_b; + stc_usbhs_hfir_bit_t HFIR_b; + stc_usbhs_hfnum_bit_t HFNUM_b; + uint32_t RESERVED5[32]; + stc_usbhs_hptxsts_bit_t HPTXSTS_b; + stc_usbhs_haint_bit_t HAINT_b; + stc_usbhs_haintmsk_bit_t HAINTMSK_b; + uint32_t RESERVED6[288]; + stc_usbhs_hprt_bit_t HPRT_b; + uint32_t RESERVED7[1504]; + stc_usbhs_hcchar0_bit_t HCCHAR0_b; + stc_usbhs_hcsplt0_bit_t HCSPLT0_b; + stc_usbhs_hcint0_bit_t HCINT0_b; + stc_usbhs_hcintmsk0_bit_t HCINTMSK0_b; + stc_usbhs_hctsiz0_bit_t HCTSIZ0_b; + uint32_t RESERVED8[96]; + stc_usbhs_hcchar1_bit_t HCCHAR1_b; + stc_usbhs_hcsplt1_bit_t HCSPLT1_b; + stc_usbhs_hcint1_bit_t HCINT1_b; + stc_usbhs_hcintmsk1_bit_t HCINTMSK1_b; + stc_usbhs_hctsiz1_bit_t HCTSIZ1_b; + uint32_t RESERVED9[96]; + stc_usbhs_hcchar2_bit_t HCCHAR2_b; + stc_usbhs_hcsplt2_bit_t HCSPLT2_b; + stc_usbhs_hcint2_bit_t HCINT2_b; + stc_usbhs_hcintmsk2_bit_t HCINTMSK2_b; + stc_usbhs_hctsiz2_bit_t HCTSIZ2_b; + uint32_t RESERVED10[96]; + stc_usbhs_hcchar3_bit_t HCCHAR3_b; + stc_usbhs_hcsplt3_bit_t HCSPLT3_b; + stc_usbhs_hcint3_bit_t HCINT3_b; + stc_usbhs_hcintmsk3_bit_t HCINTMSK3_b; + stc_usbhs_hctsiz3_bit_t HCTSIZ3_b; + uint32_t RESERVED11[96]; + stc_usbhs_hcchar4_bit_t HCCHAR4_b; + stc_usbhs_hcsplt4_bit_t HCSPLT4_b; + stc_usbhs_hcint4_bit_t HCINT4_b; + stc_usbhs_hcintmsk4_bit_t HCINTMSK4_b; + stc_usbhs_hctsiz4_bit_t HCTSIZ4_b; + uint32_t RESERVED12[96]; + stc_usbhs_hcchar5_bit_t HCCHAR5_b; + stc_usbhs_hcsplt5_bit_t HCSPLT5_b; + stc_usbhs_hcint5_bit_t HCINT5_b; + stc_usbhs_hcintmsk5_bit_t HCINTMSK5_b; + stc_usbhs_hctsiz5_bit_t HCTSIZ5_b; + uint32_t RESERVED13[96]; + stc_usbhs_hcchar6_bit_t HCCHAR6_b; + stc_usbhs_hcsplt6_bit_t HCSPLT6_b; + stc_usbhs_hcint6_bit_t HCINT6_b; + stc_usbhs_hcintmsk6_bit_t HCINTMSK6_b; + stc_usbhs_hctsiz6_bit_t HCTSIZ6_b; + uint32_t RESERVED14[96]; + stc_usbhs_hcchar7_bit_t HCCHAR7_b; + stc_usbhs_hcsplt7_bit_t HCSPLT7_b; + stc_usbhs_hcint7_bit_t HCINT7_b; + stc_usbhs_hcintmsk7_bit_t HCINTMSK7_b; + stc_usbhs_hctsiz7_bit_t HCTSIZ7_b; + uint32_t RESERVED15[96]; + stc_usbhs_hcchar8_bit_t HCCHAR8_b; + stc_usbhs_hcsplt8_bit_t HCSPLT8_b; + stc_usbhs_hcint8_bit_t HCINT8_b; + stc_usbhs_hcintmsk8_bit_t HCINTMSK8_b; + stc_usbhs_hctsiz8_bit_t HCTSIZ8_b; + uint32_t RESERVED16[96]; + stc_usbhs_hcchar9_bit_t HCCHAR9_b; + stc_usbhs_hcsplt9_bit_t HCSPLT9_b; + stc_usbhs_hcint9_bit_t HCINT9_b; + stc_usbhs_hcintmsk9_bit_t HCINTMSK9_b; + stc_usbhs_hctsiz9_bit_t HCTSIZ9_b; + uint32_t RESERVED17[96]; + stc_usbhs_hcchar10_bit_t HCCHAR10_b; + stc_usbhs_hcsplt10_bit_t HCSPLT10_b; + stc_usbhs_hcint10_bit_t HCINT10_b; + stc_usbhs_hcintmsk10_bit_t HCINTMSK10_b; + stc_usbhs_hctsiz10_bit_t HCTSIZ10_b; + uint32_t RESERVED18[96]; + stc_usbhs_hcchar11_bit_t HCCHAR11_b; + stc_usbhs_hcsplt11_bit_t HCSPLT11_b; + stc_usbhs_hcint11_bit_t HCINT11_b; + stc_usbhs_hcintmsk11_bit_t HCINTMSK11_b; + stc_usbhs_hctsiz11_bit_t HCTSIZ11_b; + uint32_t RESERVED19[96]; + stc_usbhs_hcchar12_bit_t HCCHAR12_b; + stc_usbhs_hcsplt12_bit_t HCSPLT12_b; + stc_usbhs_hcint12_bit_t HCINT12_b; + stc_usbhs_hcintmsk12_bit_t HCINTMSK12_b; + stc_usbhs_hctsiz12_bit_t HCTSIZ12_b; + uint32_t RESERVED20[96]; + stc_usbhs_hcchar13_bit_t HCCHAR13_b; + stc_usbhs_hcsplt13_bit_t HCSPLT13_b; + stc_usbhs_hcint13_bit_t HCINT13_b; + stc_usbhs_hcintmsk13_bit_t HCINTMSK13_b; + stc_usbhs_hctsiz13_bit_t HCTSIZ13_b; + uint32_t RESERVED21[96]; + stc_usbhs_hcchar14_bit_t HCCHAR14_b; + stc_usbhs_hcsplt14_bit_t HCSPLT14_b; + stc_usbhs_hcint14_bit_t HCINT14_b; + stc_usbhs_hcintmsk14_bit_t HCINTMSK14_b; + stc_usbhs_hctsiz14_bit_t HCTSIZ14_b; + uint32_t RESERVED22[96]; + stc_usbhs_hcchar15_bit_t HCCHAR15_b; + stc_usbhs_hcsplt15_bit_t HCSPLT15_b; + stc_usbhs_hcint15_bit_t HCINT15_b; + stc_usbhs_hcintmsk15_bit_t HCINTMSK15_b; + stc_usbhs_hctsiz15_bit_t HCTSIZ15_b; + uint32_t RESERVED23[2144]; + stc_usbhs_dcfg_bit_t DCFG_b; + stc_usbhs_dctl_bit_t DCTL_b; + stc_usbhs_dsts_bit_t DSTS_b; + uint32_t RESERVED24[32]; + stc_usbhs_diepmsk_bit_t DIEPMSK_b; + stc_usbhs_doepmsk_bit_t DOEPMSK_b; + stc_usbhs_daint_bit_t DAINT_b; + stc_usbhs_daintmsk_bit_t DAINTMSK_b; + uint32_t RESERVED25[128]; + stc_usbhs_dthrctl_bit_t DTHRCTL_b; + stc_usbhs_diepempmsk_bit_t DIEPEMPMSK_b; + stc_usbhs_deachint_bit_t DEACHINT_b; + stc_usbhs_deachintmsk_bit_t DEACHINTMSK_b; + uint32_t RESERVED26[32]; + stc_usbhs_diepeachmsk1_bit_t DIEPEACHMSK1_b; + uint32_t RESERVED27[480]; + stc_usbhs_doepeachmsk1_bit_t DOEPEACHMSK1_b; + uint32_t RESERVED28[960]; + stc_usbhs_diepctl0_bit_t DIEPCTL0_b; + uint32_t RESERVED29[32]; + stc_usbhs_diepint0_bit_t DIEPINT0_b; + uint32_t RESERVED30[32]; + stc_usbhs_dieptsiz0_bit_t DIEPTSIZ0_b; + uint32_t RESERVED31[32]; + stc_usbhs_dtxfsts0_bit_t DTXFSTS0_b; + uint32_t RESERVED32[32]; + stc_usbhs_diepctl1_bit_t DIEPCTL1_b; + uint32_t RESERVED33[32]; + stc_usbhs_diepint1_bit_t DIEPINT1_b; + uint32_t RESERVED34[32]; + stc_usbhs_dieptsiz1_bit_t DIEPTSIZ1_b; + uint32_t RESERVED35[32]; + stc_usbhs_dtxfsts1_bit_t DTXFSTS1_b; + uint32_t RESERVED36[32]; + stc_usbhs_diepctl2_bit_t DIEPCTL2_b; + uint32_t RESERVED37[32]; + stc_usbhs_diepint2_bit_t DIEPINT2_b; + uint32_t RESERVED38[32]; + stc_usbhs_dieptsiz2_bit_t DIEPTSIZ2_b; + uint32_t RESERVED39[32]; + stc_usbhs_dtxfsts2_bit_t DTXFSTS2_b; + uint32_t RESERVED40[32]; + stc_usbhs_diepctl3_bit_t DIEPCTL3_b; + uint32_t RESERVED41[32]; + stc_usbhs_diepint3_bit_t DIEPINT3_b; + uint32_t RESERVED42[32]; + stc_usbhs_dieptsiz3_bit_t DIEPTSIZ3_b; + uint32_t RESERVED43[32]; + stc_usbhs_dtxfsts3_bit_t DTXFSTS3_b; + uint32_t RESERVED44[32]; + stc_usbhs_diepctl4_bit_t DIEPCTL4_b; + uint32_t RESERVED45[32]; + stc_usbhs_diepint4_bit_t DIEPINT4_b; + uint32_t RESERVED46[32]; + stc_usbhs_dieptsiz4_bit_t DIEPTSIZ4_b; + uint32_t RESERVED47[32]; + stc_usbhs_dtxfsts4_bit_t DTXFSTS4_b; + uint32_t RESERVED48[32]; + stc_usbhs_diepctl5_bit_t DIEPCTL5_b; + uint32_t RESERVED49[32]; + stc_usbhs_diepint5_bit_t DIEPINT5_b; + uint32_t RESERVED50[32]; + stc_usbhs_dieptsiz5_bit_t DIEPTSIZ5_b; + uint32_t RESERVED51[32]; + stc_usbhs_dtxfsts5_bit_t DTXFSTS5_b; + uint32_t RESERVED52[32]; + stc_usbhs_diepctl6_bit_t DIEPCTL6_b; + uint32_t RESERVED53[32]; + stc_usbhs_diepint6_bit_t DIEPINT6_b; + uint32_t RESERVED54[32]; + stc_usbhs_dieptsiz6_bit_t DIEPTSIZ6_b; + uint32_t RESERVED55[32]; + stc_usbhs_dtxfsts6_bit_t DTXFSTS6_b; + uint32_t RESERVED56[32]; + stc_usbhs_diepctl7_bit_t DIEPCTL7_b; + uint32_t RESERVED57[32]; + stc_usbhs_diepint7_bit_t DIEPINT7_b; + uint32_t RESERVED58[32]; + stc_usbhs_dieptsiz7_bit_t DIEPTSIZ7_b; + uint32_t RESERVED59[32]; + stc_usbhs_dtxfsts7_bit_t DTXFSTS7_b; + uint32_t RESERVED60[32]; + stc_usbhs_diepctl8_bit_t DIEPCTL8_b; + uint32_t RESERVED61[32]; + stc_usbhs_diepint8_bit_t DIEPINT8_b; + uint32_t RESERVED62[32]; + stc_usbhs_dieptsiz8_bit_t DIEPTSIZ8_b; + uint32_t RESERVED63[32]; + stc_usbhs_dtxfsts8_bit_t DTXFSTS8_b; + uint32_t RESERVED64[32]; + stc_usbhs_diepctl9_bit_t DIEPCTL9_b; + uint32_t RESERVED65[32]; + stc_usbhs_diepint9_bit_t DIEPINT9_b; + uint32_t RESERVED66[32]; + stc_usbhs_dieptsiz9_bit_t DIEPTSIZ9_b; + uint32_t RESERVED67[32]; + stc_usbhs_dtxfsts9_bit_t DTXFSTS9_b; + uint32_t RESERVED68[32]; + stc_usbhs_diepctl10_bit_t DIEPCTL10_b; + uint32_t RESERVED69[32]; + stc_usbhs_diepint10_bit_t DIEPINT10_b; + uint32_t RESERVED70[32]; + stc_usbhs_dieptsiz10_bit_t DIEPTSIZ10_b; + uint32_t RESERVED71[32]; + stc_usbhs_dtxfsts10_bit_t DTXFSTS10_b; + uint32_t RESERVED72[32]; + stc_usbhs_diepctl11_bit_t DIEPCTL11_b; + uint32_t RESERVED73[32]; + stc_usbhs_diepint11_bit_t DIEPINT11_b; + uint32_t RESERVED74[32]; + stc_usbhs_dieptsiz11_bit_t DIEPTSIZ11_b; + uint32_t RESERVED75[32]; + stc_usbhs_dtxfsts11_bit_t DTXFSTS11_b; + uint32_t RESERVED76[32]; + stc_usbhs_diepctl12_bit_t DIEPCTL12_b; + uint32_t RESERVED77[32]; + stc_usbhs_diepint12_bit_t DIEPINT12_b; + uint32_t RESERVED78[32]; + stc_usbhs_dieptsiz12_bit_t DIEPTSIZ12_b; + uint32_t RESERVED79[32]; + stc_usbhs_dtxfsts12_bit_t DTXFSTS12_b; + uint32_t RESERVED80[32]; + stc_usbhs_diepctl13_bit_t DIEPCTL13_b; + uint32_t RESERVED81[32]; + stc_usbhs_diepint13_bit_t DIEPINT13_b; + uint32_t RESERVED82[32]; + stc_usbhs_dieptsiz13_bit_t DIEPTSIZ13_b; + uint32_t RESERVED83[32]; + stc_usbhs_dtxfsts13_bit_t DTXFSTS13_b; + uint32_t RESERVED84[32]; + stc_usbhs_diepctl14_bit_t DIEPCTL14_b; + uint32_t RESERVED85[32]; + stc_usbhs_diepint14_bit_t DIEPINT14_b; + uint32_t RESERVED86[32]; + stc_usbhs_dieptsiz14_bit_t DIEPTSIZ14_b; + uint32_t RESERVED87[32]; + stc_usbhs_dtxfsts14_bit_t DTXFSTS14_b; + uint32_t RESERVED88[32]; + stc_usbhs_diepctl15_bit_t DIEPCTL15_b; + uint32_t RESERVED89[32]; + stc_usbhs_diepint15_bit_t DIEPINT15_b; + uint32_t RESERVED90[32]; + stc_usbhs_dieptsiz15_bit_t DIEPTSIZ15_b; + uint32_t RESERVED91[32]; + stc_usbhs_dtxfsts15_bit_t DTXFSTS15_b; + uint32_t RESERVED92[32]; + stc_usbhs_doepctl0_bit_t DOEPCTL0_b; + uint32_t RESERVED93[32]; + stc_usbhs_doepint0_bit_t DOEPINT0_b; + uint32_t RESERVED94[32]; + stc_usbhs_doeptsiz0_bit_t DOEPTSIZ0_b; + uint32_t RESERVED95[96]; + stc_usbhs_doepctl1_bit_t DOEPCTL1_b; + uint32_t RESERVED96[32]; + stc_usbhs_doepint1_bit_t DOEPINT1_b; + uint32_t RESERVED97[32]; + stc_usbhs_doeptsiz1_bit_t DOEPTSIZ1_b; + uint32_t RESERVED98[96]; + stc_usbhs_doepctl2_bit_t DOEPCTL2_b; + uint32_t RESERVED99[32]; + stc_usbhs_doepint2_bit_t DOEPINT2_b; + uint32_t RESERVED100[32]; + stc_usbhs_doeptsiz2_bit_t DOEPTSIZ2_b; + uint32_t RESERVED101[96]; + stc_usbhs_doepctl3_bit_t DOEPCTL3_b; + uint32_t RESERVED102[32]; + stc_usbhs_doepint3_bit_t DOEPINT3_b; + uint32_t RESERVED103[32]; + stc_usbhs_doeptsiz3_bit_t DOEPTSIZ3_b; + uint32_t RESERVED104[96]; + stc_usbhs_doepctl4_bit_t DOEPCTL4_b; + uint32_t RESERVED105[32]; + stc_usbhs_doepint4_bit_t DOEPINT4_b; + uint32_t RESERVED106[32]; + stc_usbhs_doeptsiz4_bit_t DOEPTSIZ4_b; + uint32_t RESERVED107[96]; + stc_usbhs_doepctl5_bit_t DOEPCTL5_b; + uint32_t RESERVED108[32]; + stc_usbhs_doepint5_bit_t DOEPINT5_b; + uint32_t RESERVED109[32]; + stc_usbhs_doeptsiz5_bit_t DOEPTSIZ5_b; + uint32_t RESERVED110[96]; + stc_usbhs_doepctl6_bit_t DOEPCTL6_b; + uint32_t RESERVED111[32]; + stc_usbhs_doepint6_bit_t DOEPINT6_b; + uint32_t RESERVED112[32]; + stc_usbhs_doeptsiz6_bit_t DOEPTSIZ6_b; + uint32_t RESERVED113[96]; + stc_usbhs_doepctl7_bit_t DOEPCTL7_b; + uint32_t RESERVED114[32]; + stc_usbhs_doepint7_bit_t DOEPINT7_b; + uint32_t RESERVED115[32]; + stc_usbhs_doeptsiz7_bit_t DOEPTSIZ7_b; + uint32_t RESERVED116[96]; + stc_usbhs_doepctl8_bit_t DOEPCTL8_b; + uint32_t RESERVED117[32]; + stc_usbhs_doepint8_bit_t DOEPINT8_b; + uint32_t RESERVED118[32]; + stc_usbhs_doeptsiz8_bit_t DOEPTSIZ8_b; + uint32_t RESERVED119[96]; + stc_usbhs_doepctl9_bit_t DOEPCTL9_b; + uint32_t RESERVED120[32]; + stc_usbhs_doepint9_bit_t DOEPINT9_b; + uint32_t RESERVED121[32]; + stc_usbhs_doeptsiz9_bit_t DOEPTSIZ9_b; + uint32_t RESERVED122[96]; + stc_usbhs_doepctl10_bit_t DOEPCTL10_b; + uint32_t RESERVED123[32]; + stc_usbhs_doepint10_bit_t DOEPINT10_b; + uint32_t RESERVED124[32]; + stc_usbhs_doeptsiz10_bit_t DOEPTSIZ10_b; + uint32_t RESERVED125[96]; + stc_usbhs_doepctl11_bit_t DOEPCTL11_b; + uint32_t RESERVED126[32]; + stc_usbhs_doepint11_bit_t DOEPINT11_b; + uint32_t RESERVED127[32]; + stc_usbhs_doeptsiz11_bit_t DOEPTSIZ11_b; + uint32_t RESERVED128[96]; + stc_usbhs_doepctl12_bit_t DOEPCTL12_b; + uint32_t RESERVED129[32]; + stc_usbhs_doepint12_bit_t DOEPINT12_b; + uint32_t RESERVED130[32]; + stc_usbhs_doeptsiz12_bit_t DOEPTSIZ12_b; + uint32_t RESERVED131[96]; + stc_usbhs_doepctl13_bit_t DOEPCTL13_b; + uint32_t RESERVED132[32]; + stc_usbhs_doepint13_bit_t DOEPINT13_b; + uint32_t RESERVED133[32]; + stc_usbhs_doeptsiz13_bit_t DOEPTSIZ13_b; + uint32_t RESERVED134[96]; + stc_usbhs_doepctl14_bit_t DOEPCTL14_b; + uint32_t RESERVED135[32]; + stc_usbhs_doepint14_bit_t DOEPINT14_b; + uint32_t RESERVED136[32]; + stc_usbhs_doeptsiz14_bit_t DOEPTSIZ14_b; + uint32_t RESERVED137[96]; + stc_usbhs_doepctl15_bit_t DOEPCTL15_b; + uint32_t RESERVED138[32]; + stc_usbhs_doepint15_bit_t DOEPINT15_b; + uint32_t RESERVED139[32]; + stc_usbhs_doeptsiz15_bit_t DOEPTSIZ15_b; + uint32_t RESERVED140[2144]; + stc_usbhs_pcgcctl_bit_t PCGCCTL_b; +} bM4_USBHS_TypeDef; + +typedef struct +{ + stc_wdt_cr_bit_t CR_b; + stc_wdt_sr_bit_t SR_b; +} bM4_WDT_TypeDef; + + + +/******************************************************************************/ +/* Device Specific Peripheral bit_band declaration & memory map */ +/******************************************************************************/ + +#define bM4_ADC1 ((bM4_ADC_TypeDef *)0x42800000UL) +#define bM4_ADC2 ((bM4_ADC_TypeDef *)0x42808000UL) +#define bM4_ADC3 ((bM4_ADC_TypeDef *)0x42810000UL) +#define bM4_AES ((bM4_AES_TypeDef *)0x42100000UL) +#define bM4_AOS ((bM4_AOS_TypeDef *)0x42210000UL) +#define bM4_CAN1 ((bM4_CAN_TypeDef *)0x42120000UL) +#define bM4_CAN2 ((bM4_CAN_TypeDef *)0x42F00000UL) +#define bM4_CMP1 ((bM4_CMP_TypeDef *)0x42940000UL) +#define bM4_CMP2 ((bM4_CMP_TypeDef *)0x42940200UL) +#define bM4_CMP3 ((bM4_CMP_TypeDef *)0x42948000UL) +#define bM4_CMP4 ((bM4_CMP_TypeDef *)0x42948200UL) +#define bM4_CMU ((bM4_CMU_TypeDef *)0x42988000UL) +#define bM4_CRC ((bM4_CRC_TypeDef *)0x42118000UL) +#define bM4_CTC ((bM4_CTC_TypeDef *)0x42938000UL) +#define bM4_DAC1 ((bM4_DAC_TypeDef *)0x42820000UL) +#define bM4_DAC2 ((bM4_DAC_TypeDef *)0x42828000UL) +#define bM4_DCU1 ((bM4_DCU_TypeDef *)0x42AC0000UL) +#define bM4_DCU2 ((bM4_DCU_TypeDef *)0x42AC8000UL) +#define bM4_DCU3 ((bM4_DCU_TypeDef *)0x42AD0000UL) +#define bM4_DCU4 ((bM4_DCU_TypeDef *)0x42AD8000UL) +#define bM4_DCU5 ((bM4_DCU_TypeDef *)0x42AE0000UL) +#define bM4_DCU6 ((bM4_DCU_TypeDef *)0x42AE8000UL) +#define bM4_DCU7 ((bM4_DCU_TypeDef *)0x42AF0000UL) +#define bM4_DCU8 ((bM4_DCU_TypeDef *)0x42AF8000UL) +#define bM4_DMA1 ((bM4_DMA_TypeDef *)0x42A60000UL) +#define bM4_DMA2 ((bM4_DMA_TypeDef *)0x42A68000UL) +#define bM4_DVP ((bM4_DVP_TypeDef *)0x42AB0000UL) +#define bM4_EFM ((bM4_EFM_TypeDef *)0x42208000UL) +#define bM4_EMB0 ((bM4_EMB_TypeDef *)0x422F8000UL) +#define bM4_EMB1 ((bM4_EMB_TypeDef *)0x422F8400UL) +#define bM4_EMB2 ((bM4_EMB_TypeDef *)0x422F8800UL) +#define bM4_EMB3 ((bM4_EMB_TypeDef *)0x422F8C00UL) +#define bM4_EMB4 ((bM4_EMB_TypeDef *)0x422F9000UL) +#define bM4_EMB5 ((bM4_EMB_TypeDef *)0x422F9400UL) +#define bM4_EMB6 ((bM4_EMB_TypeDef *)0x422F9800UL) +#define bM4_ETH ((bM4_ETH_TypeDef *)0x42A00000UL) +#define bM4_FCM ((bM4_FCM_TypeDef *)0x42908000UL) +#define bM4_FMAC1 ((bM4_FMAC_TypeDef *)0x42B00000UL) +#define bM4_FMAC2 ((bM4_FMAC_TypeDef *)0x42B08000UL) +#define bM4_FMAC3 ((bM4_FMAC_TypeDef *)0x42B10000UL) +#define bM4_FMAC4 ((bM4_FMAC_TypeDef *)0x42B18000UL) +#define bM4_GPIO ((bM4_GPIO_TypeDef *)0x42A70000UL) +#define bM4_HASH ((bM4_HASH_TypeDef *)0x42108000UL) +#define bM4_HRPWM ((bM4_HRPWM_TypeDef *)0x42780000UL) +#define bM4_I2C1 ((bM4_I2C_TypeDef *)0x429C0000UL) +#define bM4_I2C2 ((bM4_I2C_TypeDef *)0x429C8000UL) +#define bM4_I2C3 ((bM4_I2C_TypeDef *)0x429D0000UL) +#define bM4_I2C4 ((bM4_I2C_TypeDef *)0x429D8000UL) +#define bM4_I2C5 ((bM4_I2C_TypeDef *)0x429E0000UL) +#define bM4_I2C6 ((bM4_I2C_TypeDef *)0x429F0000UL) +#define bM4_I2S1 ((bM4_I2S_TypeDef *)0x423C0000UL) +#define bM4_I2S2 ((bM4_I2S_TypeDef *)0x423C8000UL) +#define bM4_I2S3 ((bM4_I2S_TypeDef *)0x42440000UL) +#define bM4_I2S4 ((bM4_I2S_TypeDef *)0x42448000UL) +#define bM4_INTC ((bM4_INTC_TypeDef *)0x42A20000UL) +#define bM4_KEYSCAN ((bM4_KEYSCAN_TypeDef *)0x42A18000UL) +#define bM4_MAU ((bM4_MAU_TypeDef *)0x42AA0000UL) +#define bM4_MPU ((bM4_MPU_TypeDef *)0x42A00000UL) +#define bM4_OTS ((bM4_OTS_TypeDef *)0x42950000UL) +#define bM4_PERIC ((bM4_PERIC_TypeDef *)0x42AA8000UL) +#define bM4_PWC ((bM4_PWC_TypeDef *)0x42900000UL) +#define bM4_RMU ((bM4_RMU_TypeDef *)0x42998000UL) +#define bM4_RTC ((bM4_RTC_TypeDef *)0x42980000UL) +#define bM4_SDIOC1 ((bM4_SDIOC_TypeDef *)0x42E00000UL) +#define bM4_SDIOC2 ((bM4_SDIOC_TypeDef *)0x42F08000UL) +#define bM4_SPI1 ((bM4_SPI_TypeDef *)0x42380000UL) +#define bM4_SPI2 ((bM4_SPI_TypeDef *)0x42388000UL) +#define bM4_SPI3 ((bM4_SPI_TypeDef *)0x42390000UL) +#define bM4_SPI4 ((bM4_SPI_TypeDef *)0x42400000UL) +#define bM4_SPI5 ((bM4_SPI_TypeDef *)0x42408000UL) +#define bM4_SPI6 ((bM4_SPI_TypeDef *)0x42410000UL) +#define bM4_SRAMC ((bM4_SRAMC_TypeDef *)0x42A10000UL) +#define bM4_SWDT ((bM4_SWDT_TypeDef *)0x42928000UL) +#define bM4_TMR0_1 ((bM4_TMR0_TypeDef *)0x42480000UL) +#define bM4_TMR0_2 ((bM4_TMR0_TypeDef *)0x42488000UL) +#define bM4_TMR2_1 ((bM4_TMR2_TypeDef *)0x42490000UL) +#define bM4_TMR2_2 ((bM4_TMR2_TypeDef *)0x42498000UL) +#define bM4_TMR2_3 ((bM4_TMR2_TypeDef *)0x424A0000UL) +#define bM4_TMR2_4 ((bM4_TMR2_TypeDef *)0x424A8000UL) +#define bM4_TMR4_1 ((bM4_TMR4_TypeDef *)0x42700000UL) +#define bM4_TMR4_2 ((bM4_TMR4_TypeDef *)0x42708000UL) +#define bM4_TMR4_3 ((bM4_TMR4_TypeDef *)0x42710000UL) +#define bM4_TMR6_1 ((bM4_TMR6_TypeDef *)0x42300000UL) +#define bM4_TMR6_2 ((bM4_TMR6_TypeDef *)0x42308000UL) +#define bM4_TMR6_3 ((bM4_TMR6_TypeDef *)0x42310000UL) +#define bM4_TMR6_4 ((bM4_TMR6_TypeDef *)0x42318000UL) +#define bM4_TMR6_5 ((bM4_TMR6_TypeDef *)0x42320000UL) +#define bM4_TMR6_6 ((bM4_TMR6_TypeDef *)0x42328000UL) +#define bM4_TMR6_7 ((bM4_TMR6_TypeDef *)0x42330000UL) +#define bM4_TMR6_8 ((bM4_TMR6_TypeDef *)0x42338000UL) +#define bM4_TMRA_1 ((bM4_TMRA_TypeDef *)0x42740000UL) +#define bM4_TMRA_10 ((bM4_TMRA_TypeDef *)0x424E8000UL) +#define bM4_TMRA_11 ((bM4_TMRA_TypeDef *)0x424F0000UL) +#define bM4_TMRA_12 ((bM4_TMRA_TypeDef *)0x424F8000UL) +#define bM4_TMRA_2 ((bM4_TMRA_TypeDef *)0x42748000UL) +#define bM4_TMRA_3 ((bM4_TMRA_TypeDef *)0x42750000UL) +#define bM4_TMRA_4 ((bM4_TMRA_TypeDef *)0x42758000UL) +#define bM4_TMRA_5 ((bM4_TMRA_TypeDef *)0x424C0000UL) +#define bM4_TMRA_6 ((bM4_TMRA_TypeDef *)0x424C8000UL) +#define bM4_TMRA_7 ((bM4_TMRA_TypeDef *)0x424D0000UL) +#define bM4_TMRA_8 ((bM4_TMRA_TypeDef *)0x424D8000UL) +#define bM4_TMRA_9 ((bM4_TMRA_TypeDef *)0x424E0000UL) +#define bM4_TRNG ((bM4_TRNG_TypeDef *)0x42840000UL) +#define bM4_USART1 ((bM4_USART_TypeDef *)0x42398000UL) +#define bM4_USART10 ((bM4_USART_TypeDef *)0x42438000UL) +#define bM4_USART2 ((bM4_USART_TypeDef *)0x423A0000UL) +#define bM4_USART3 ((bM4_USART_TypeDef *)0x423A8000UL) +#define bM4_USART4 ((bM4_USART_TypeDef *)0x423B0000UL) +#define bM4_USART5 ((bM4_USART_TypeDef *)0x423B8000UL) +#define bM4_USART6 ((bM4_USART_TypeDef *)0x42418000UL) +#define bM4_USART7 ((bM4_USART_TypeDef *)0x42420000UL) +#define bM4_USART8 ((bM4_USART_TypeDef *)0x42428000UL) +#define bM4_USART9 ((bM4_USART_TypeDef *)0x42430000UL) +#define bM4_USBFS ((bM4_USBFS_TypeDef *)0x43000000UL) +#define bM4_USBHS ((bM4_USBHS_TypeDef *)0x43800000UL) +#define bM4_WDT ((bM4_WDT_TypeDef *)0x42920000UL) + + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_H__ */ + diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Include/system_hc32f4a0.h b/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Include/system_hc32f4a0.h new file mode 100644 index 0000000000..985807c347 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Include/system_hc32f4a0.h @@ -0,0 +1,154 @@ +/** + ******************************************************************************* + * @file system_hc32f4a0.h + * @brief This file contains all the functions prototypes of the HC32 System. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Zhangxl First version + 2020-07-03 Zhangxl Modify for 16MHz & 20MHz HRC + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __SYSTEM_HC32F4A0_H__ +#define __SYSTEM_HC32F4A0_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include + +/** + * @addtogroup CMSIS + * @{ + */ + +/** + * @addtogroup HC32F4A0_System + * @{ + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('define') + ******************************************************************************/ +/** + * @addtogroup HC32F4A0_System_Global_Macros + * @{ + */ + +/** + * @brief Clock setup macro definition + */ +#define CLOCK_SETTING_NONE 0U /*!< User provides own clock setting in application */ +#define CLOCK_SETTING_CMSIS 1U + +#define HRC_FREQ_MON() (*((volatile unsigned int*)(0x40010684UL))) + +/** + * @addtogroup HC32F4A0_System_Clock_Source + * @{ + */ +#if !defined (HRC_16MHz_VALUE) + #define HRC_16MHz_VALUE ((uint32_t)16000000UL) /*!< Internal high speed RC freq.(16MHz) */ +#endif + +#if !defined (HRC_20MHz_VALUE) + #define HRC_20MHz_VALUE ((uint32_t)20000000UL) /*!< Internal high speed RC freq.(20MHz) */ +#endif + +#if !defined (MRC_VALUE) +#define MRC_VALUE ((uint32_t)8000000UL) /*!< Internal middle speed RC freq.(8MHz) */ +#endif + +#if !defined (LRC_VALUE) + #define LRC_VALUE ((uint32_t)32768UL) /*!< Internal low speed RC freq.(32.768KHz) */ +#endif + +#if !defined (RTCLRC_VALUE) + #define RTCLRC_VALUE ((uint32_t)32768UL) /*!< Internal RTC low speed RC freq.(32.768KHz) */ +#endif + +#if !defined (SWDTLRC_VALUE) + #define SWDTLRC_VALUE ((uint32_t)10000UL) /*!< External low speed OSC freq.(10KHz) */ +#endif + +#if !defined (XTAL_VALUE) + #define XTAL_VALUE ((uint32_t)8000000UL) /*!< External high speed OSC freq.(8MHz) */ +#endif + +#if !defined (XTAL32_VALUE) + #define XTAL32_VALUE ((uint32_t)32768UL) /*!< External low speed OSC freq.(32.768KHz) */ +#endif + +#if !defined (HCLK_VALUE) +#define HCLK_VALUE (SystemCoreClock >> ((M4_CMU->SCFGR & CMU_SCFGR_HCLKS) >> CMU_SCFGR_HCLKS_POS)) +#endif + + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ +/** + * @addtogroup HC32F4A0_System_Exported_Variable + * @{ + */ +extern uint32_t SystemCoreClock; /*!< System clock frequency (Core clock) */ +extern uint32_t HRC_VALUE; /*!< HRC frequency */ + +/** + * @} + */ + +/******************************************************************************* + * Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup HC32F4A0_System_Global_Functions + * @{ + */ +extern void SystemInit(void); /*!< Initialize the system */ +extern void SystemCoreClockUpdate(void); /*!< Update SystemCoreClock variable */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __SYSTEM_HC32F4A0_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/ARM/HDSC_HC32F4A0.SFR b/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/ARM/HDSC_HC32F4A0.SFR new file mode 100644 index 0000000000000000000000000000000000000000..348f86cca39c79c8238a3d1f5ad2155579a49e93 GIT binary patch literal 3317993 zcmc$H37B0)mH)fjyWL4T2?&u2x6SlC=Gr#Sx8;jQhf%4oe+8n1oJZkzCbk9ULISv%868n5XE0vgx&;hGei za6$W(@c*|hIoaAM8m$R_xYMh0Hn6@mDlqS0Vrb8~aYb#8;d&xv5VBVxa6>8j<+z4%KT2c<lbTefV$rY{>Tnnjvt;P_}SMmM%(?Z?^A)e_WES?||o?ORXERSvShOx4r|$70|Gf8aFvJ z+(-@o%`cOr1h0}m%gQtx%5q|@|CeS0*Q{MHQ*)IQAH@RjWm!-#K;O1KAN#X8vDf4VglFA3GQ52GxKjraj_l3> ztvgHhU(3q=cITGIS^nB0S|}9}on*XOW_Pwazknv@*e_YS6H8_Y?&?^@gBwKISmjU6 zgBFD%GYJXM&|RS0T8go%97xJPGh>&PFjf`wAyO9%l|vAz3yUl-n&oTT|B2x`Fw>db zohC3DkC%>CI=jV2D<-ML)JUVujp3?DQwa%SHPiVSb>m3Lja<#-%!uj6k%p-TMn&C? zRuR>WHUa9!zv&}@?nXWcRo$2jzP0^0*tTR~c4jy5-~<@>0?(j7!Q9BC!A3Ij&nHtS z{^d+#p5aXQ*dO=`4fl)mJpS+BejUb72`!)6fVPtfZ)tTrQtSpnh#s|JrD<|emI4yO zXH$C{9F>@hS4$V~VjGqeRnQ@;`M{(qH1(m2#Tek3X#yCr4&MSZF1W3+%r-n#CtTSy zb9g$MrZ4ps`h{li$cjq(Do&Z&06q!$f6*d=3I2b2=Wb|ilZL096s+T*qNp>&Q#jx^ zn#2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m|-Ac9`Ri$HFMxFvm4C zxM7ZK%tz!|VU9Z@al;&UL~>S`<0gncnBy86d@#o~*854CMk-iXfTti(U z=C}z#A?COVK_TY2M*2d`aSe5anByh{g_z?e1cjL68tDr$!8OzsVuG6x6k>v#5ENp9 zYoss41lLekhzV{&P>2a`LQseau93bF6I?@GAtty9K_Mo%2|*zyxJLRyOmGc#g_z(b z1cjL3CIp3;;2P-*F~K#|6=H&G#1BFtuBRD7C9bEAZWSYM0@Zh}~h32uT|j0vuxp%@cfV|_6uxCvr0Cb$V=F($Z%hGI-`jrGNt z;3kO0nBXRe#hBn48j3N&HP#nnf}0=~V}hF?7Gr{IXeh=6*H~YS39g~`9o-XL1K;`C h@makw!#%q(LzQsjf{j7CjsF7|=|3kAU|aI<{{yT3+i3s* literal 0 HcmV?d00001 diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/ARM/startup_hc32f4a0.s b/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/ARM/startup_hc32f4a0.s new file mode 100644 index 0000000000..a56f2ef00c --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/ARM/startup_hc32f4a0.s @@ -0,0 +1,638 @@ +;/****************************************************************************** +;* Copyright (C) 2016, Huada Semiconductor Co.,Ltd All rights reserved. +;* +;* This software is owned and published by: +;* Huada Semiconductor Co.,Ltd ("HDSC"). +;* +;* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND +;* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT. +;* +;* This software contains source code for use with HDSC +;* components. This software is licensed by HDSC to be adapted only +;* for use in systems utilizing HDSC components. HDSC shall not be +;* responsible for misuse or illegal use of this software for devices not +;* supported herein. HDSC is providing this software "AS IS" and will +;* not be responsible for issues arising from incorrect user implementation +;* of the software. +;* +;* Disclaimer: +;* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE, +;* REGARDING THE SOFTWARE (INCLUDING ANY ACCOMPANYING WRITTEN MATERIALS), +;* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING, +;* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED +;* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED +;* WARRANTY OF NONINFRINGEMENT. +;* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT, +;* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT +;* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, +;* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR +;* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT, +;* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA, +;* SAVINGS OR PROFITS, +;* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +;* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR +;* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED +;* FROM, THE SOFTWARE. +;* +;* This software may be replicated in part or whole for the licensed use, +;* with the restriction that this Disclaimer and Copyright notice must be +;* included with each copy of this software, whether used in part or whole, +;* at all times. +;*/ +;/*****************************************************************************/ + +;/*****************************************************************************/ +;/* Startup for ARM */ +;/* Version V1.0 */ +;/* Date 2020-06-12 */ +;/* Target-mcu HC32F4A0 */ +;/*****************************************************************************/ + +; Stack Configuration +; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> + +Stack_Size EQU 0x00002000 + + AREA STACK, NOINIT, READWRITE, ALIGN=3 +Stack_Mem SPACE Stack_Size +__initial_sp + + +; Heap Configuration +; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> + +Heap_Size EQU 0x00002000 + + AREA HEAP, NOINIT, READWRITE, ALIGN=3 +__heap_base +Heap_Mem SPACE Heap_Size +__heap_limit + + + PRESERVE8 + THUMB + + +; Vector Table Mapped to Address 0 at Reset + + AREA RESET, DATA, READONLY + EXPORT __Vectors + EXPORT __Vectors_End + EXPORT __Vectors_Size + +__Vectors DCD __initial_sp ; Top of Stack + DCD Reset_Handler ; Reset Handler + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD MemManage_Handler ; MPU Fault Handler + DCD BusFault_Handler ; Bus Fault Handler + DCD UsageFault_Handler ; Usage Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD DebugMon_Handler ; Debug Monitor Handler + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler + + DCD IRQ000_Handler + DCD IRQ001_Handler + DCD IRQ002_Handler + DCD IRQ003_Handler + DCD IRQ004_Handler + DCD IRQ005_Handler + DCD IRQ006_Handler + DCD IRQ007_Handler + DCD IRQ008_Handler + DCD IRQ009_Handler + DCD IRQ010_Handler + DCD IRQ011_Handler + DCD IRQ012_Handler + DCD IRQ013_Handler + DCD IRQ014_Handler + DCD IRQ015_Handler + DCD IRQ016_Handler + DCD IRQ017_Handler + DCD IRQ018_Handler + DCD IRQ019_Handler + DCD IRQ020_Handler + DCD IRQ021_Handler + DCD IRQ022_Handler + DCD IRQ023_Handler + DCD IRQ024_Handler + DCD IRQ025_Handler + DCD IRQ026_Handler + DCD IRQ027_Handler + DCD IRQ028_Handler + DCD IRQ029_Handler + DCD IRQ030_Handler + DCD IRQ031_Handler + DCD IRQ032_Handler + DCD IRQ033_Handler + DCD IRQ034_Handler + DCD IRQ035_Handler + DCD IRQ036_Handler + DCD IRQ037_Handler + DCD IRQ038_Handler + DCD IRQ039_Handler + DCD IRQ040_Handler + DCD IRQ041_Handler + DCD IRQ042_Handler + DCD IRQ043_Handler + DCD IRQ044_Handler + DCD IRQ045_Handler + DCD IRQ046_Handler + DCD IRQ047_Handler + DCD IRQ048_Handler + DCD IRQ049_Handler + DCD IRQ050_Handler + DCD IRQ051_Handler + DCD IRQ052_Handler + DCD IRQ053_Handler + DCD IRQ054_Handler + DCD IRQ055_Handler + DCD IRQ056_Handler + DCD IRQ057_Handler + DCD IRQ058_Handler + DCD IRQ059_Handler + DCD IRQ060_Handler + DCD IRQ061_Handler + DCD IRQ062_Handler + DCD IRQ063_Handler + DCD IRQ064_Handler + DCD IRQ065_Handler + DCD IRQ066_Handler + DCD IRQ067_Handler + DCD IRQ068_Handler + DCD IRQ069_Handler + DCD IRQ070_Handler + DCD IRQ071_Handler + DCD IRQ072_Handler + DCD IRQ073_Handler + DCD IRQ074_Handler + DCD IRQ075_Handler + DCD IRQ076_Handler + DCD IRQ077_Handler + DCD IRQ078_Handler + DCD IRQ079_Handler + DCD IRQ080_Handler + DCD IRQ081_Handler + DCD IRQ082_Handler + DCD IRQ083_Handler + DCD IRQ084_Handler + DCD IRQ085_Handler + DCD IRQ086_Handler + DCD IRQ087_Handler + DCD IRQ088_Handler + DCD IRQ089_Handler + DCD IRQ090_Handler + DCD IRQ091_Handler + DCD IRQ092_Handler + DCD IRQ093_Handler + DCD IRQ094_Handler + DCD IRQ095_Handler + DCD IRQ096_Handler + DCD IRQ097_Handler + DCD IRQ098_Handler + DCD IRQ099_Handler + DCD IRQ100_Handler + DCD IRQ101_Handler + DCD IRQ102_Handler + DCD IRQ103_Handler + DCD IRQ104_Handler + DCD IRQ105_Handler + DCD IRQ106_Handler + DCD IRQ107_Handler + DCD IRQ108_Handler + DCD IRQ109_Handler + DCD IRQ110_Handler + DCD IRQ111_Handler + DCD IRQ112_Handler + DCD IRQ113_Handler + DCD IRQ114_Handler + DCD IRQ115_Handler + DCD IRQ116_Handler + DCD IRQ117_Handler + DCD IRQ118_Handler + DCD IRQ119_Handler + DCD IRQ120_Handler + DCD IRQ121_Handler + DCD IRQ122_Handler + DCD IRQ123_Handler + DCD IRQ124_Handler + DCD IRQ125_Handler + DCD IRQ126_Handler + DCD IRQ127_Handler + DCD IRQ128_Handler + DCD IRQ129_Handler + DCD IRQ130_Handler + DCD IRQ131_Handler + DCD IRQ132_Handler + DCD IRQ133_Handler + DCD IRQ134_Handler + DCD IRQ135_Handler + DCD IRQ136_Handler + DCD IRQ137_Handler + DCD IRQ138_Handler + DCD IRQ139_Handler + DCD IRQ140_Handler + DCD IRQ141_Handler + DCD IRQ142_Handler + DCD IRQ143_Handler + + + + +__Vectors_End + +__Vectors_Size EQU __Vectors_End - __Vectors + + AREA |.text|, CODE, READONLY + + +; Reset Handler + +Reset_Handler PROC + EXPORT Reset_Handler [WEAK] + IMPORT SystemInit + IMPORT __main + + LDR R0, =SystemInit + BLX R0 + LDR R0, =__main + BX R0 + ENDP + + +; Dummy Exception Handlers (infinite loops which can be modified) + +NMI_Handler PROC + EXPORT NMI_Handler [WEAK] + B . + ENDP +HardFault_Handler\ + PROC + EXPORT HardFault_Handler [WEAK] + B . + ENDP +MemManage_Handler\ + PROC + EXPORT MemManage_Handler [WEAK] + B . + ENDP +BusFault_Handler\ + PROC + EXPORT BusFault_Handler [WEAK] + B . + ENDP +UsageFault_Handler\ + PROC + EXPORT UsageFault_Handler [WEAK] + B . + ENDP +SVC_Handler PROC + EXPORT SVC_Handler [WEAK] + B . + ENDP +DebugMon_Handler\ + PROC + EXPORT DebugMon_Handler [WEAK] + B . + ENDP +PendSV_Handler\ + PROC + EXPORT PendSV_Handler [WEAK] + B . + ENDP +SysTick_Handler\ + PROC + EXPORT SysTick_Handler [WEAK] + B . + ENDP + +Default_Handler PROC + EXPORT IRQ000_Handler [WEAK] + EXPORT IRQ001_Handler [WEAK] + EXPORT IRQ002_Handler [WEAK] + EXPORT IRQ003_Handler [WEAK] + EXPORT IRQ004_Handler [WEAK] + EXPORT IRQ005_Handler [WEAK] + EXPORT IRQ006_Handler [WEAK] + EXPORT IRQ007_Handler [WEAK] + EXPORT IRQ008_Handler [WEAK] + EXPORT IRQ009_Handler [WEAK] + EXPORT IRQ010_Handler [WEAK] + EXPORT IRQ011_Handler [WEAK] + EXPORT IRQ012_Handler [WEAK] + EXPORT IRQ013_Handler [WEAK] + EXPORT IRQ014_Handler [WEAK] + EXPORT IRQ015_Handler [WEAK] + EXPORT IRQ016_Handler [WEAK] + EXPORT IRQ017_Handler [WEAK] + EXPORT IRQ018_Handler [WEAK] + EXPORT IRQ019_Handler [WEAK] + EXPORT IRQ020_Handler [WEAK] + EXPORT IRQ021_Handler [WEAK] + EXPORT IRQ022_Handler [WEAK] + EXPORT IRQ023_Handler [WEAK] + EXPORT IRQ024_Handler [WEAK] + EXPORT IRQ025_Handler [WEAK] + EXPORT IRQ026_Handler [WEAK] + EXPORT IRQ027_Handler [WEAK] + EXPORT IRQ028_Handler [WEAK] + EXPORT IRQ029_Handler [WEAK] + EXPORT IRQ030_Handler [WEAK] + EXPORT IRQ031_Handler [WEAK] + EXPORT IRQ032_Handler [WEAK] + EXPORT IRQ033_Handler [WEAK] + EXPORT IRQ034_Handler [WEAK] + EXPORT IRQ035_Handler [WEAK] + EXPORT IRQ036_Handler [WEAK] + EXPORT IRQ037_Handler [WEAK] + EXPORT IRQ038_Handler [WEAK] + EXPORT IRQ039_Handler [WEAK] + EXPORT IRQ040_Handler [WEAK] + EXPORT IRQ041_Handler [WEAK] + EXPORT IRQ042_Handler [WEAK] + EXPORT IRQ043_Handler [WEAK] + EXPORT IRQ044_Handler [WEAK] + EXPORT IRQ045_Handler [WEAK] + EXPORT IRQ046_Handler [WEAK] + EXPORT IRQ047_Handler [WEAK] + EXPORT IRQ048_Handler [WEAK] + EXPORT IRQ049_Handler [WEAK] + EXPORT IRQ050_Handler [WEAK] + EXPORT IRQ051_Handler [WEAK] + EXPORT IRQ052_Handler [WEAK] + EXPORT IRQ053_Handler [WEAK] + EXPORT IRQ054_Handler [WEAK] + EXPORT IRQ055_Handler [WEAK] + EXPORT IRQ056_Handler [WEAK] + EXPORT IRQ057_Handler [WEAK] + EXPORT IRQ058_Handler [WEAK] + EXPORT IRQ059_Handler [WEAK] + EXPORT IRQ060_Handler [WEAK] + EXPORT IRQ061_Handler [WEAK] + EXPORT IRQ062_Handler [WEAK] + EXPORT IRQ063_Handler [WEAK] + EXPORT IRQ064_Handler [WEAK] + EXPORT IRQ065_Handler [WEAK] + EXPORT IRQ066_Handler [WEAK] + EXPORT IRQ067_Handler [WEAK] + EXPORT IRQ068_Handler [WEAK] + EXPORT IRQ069_Handler [WEAK] + EXPORT IRQ070_Handler [WEAK] + EXPORT IRQ071_Handler [WEAK] + EXPORT IRQ072_Handler [WEAK] + EXPORT IRQ073_Handler [WEAK] + EXPORT IRQ074_Handler [WEAK] + EXPORT IRQ075_Handler [WEAK] + EXPORT IRQ076_Handler [WEAK] + EXPORT IRQ077_Handler [WEAK] + EXPORT IRQ078_Handler [WEAK] + EXPORT IRQ079_Handler [WEAK] + EXPORT IRQ080_Handler [WEAK] + EXPORT IRQ081_Handler [WEAK] + EXPORT IRQ082_Handler [WEAK] + EXPORT IRQ083_Handler [WEAK] + EXPORT IRQ084_Handler [WEAK] + EXPORT IRQ085_Handler [WEAK] + EXPORT IRQ086_Handler [WEAK] + EXPORT IRQ087_Handler [WEAK] + EXPORT IRQ088_Handler [WEAK] + EXPORT IRQ089_Handler [WEAK] + EXPORT IRQ090_Handler [WEAK] + EXPORT IRQ091_Handler [WEAK] + EXPORT IRQ092_Handler [WEAK] + EXPORT IRQ093_Handler [WEAK] + EXPORT IRQ094_Handler [WEAK] + EXPORT IRQ095_Handler [WEAK] + EXPORT IRQ096_Handler [WEAK] + EXPORT IRQ097_Handler [WEAK] + EXPORT IRQ098_Handler [WEAK] + EXPORT IRQ099_Handler [WEAK] + EXPORT IRQ100_Handler [WEAK] + EXPORT IRQ101_Handler [WEAK] + EXPORT IRQ102_Handler [WEAK] + EXPORT IRQ103_Handler [WEAK] + EXPORT IRQ104_Handler [WEAK] + EXPORT IRQ105_Handler [WEAK] + EXPORT IRQ106_Handler [WEAK] + EXPORT IRQ107_Handler [WEAK] + EXPORT IRQ108_Handler [WEAK] + EXPORT IRQ109_Handler [WEAK] + EXPORT IRQ110_Handler [WEAK] + EXPORT IRQ111_Handler [WEAK] + EXPORT IRQ112_Handler [WEAK] + EXPORT IRQ113_Handler [WEAK] + EXPORT IRQ114_Handler [WEAK] + EXPORT IRQ115_Handler [WEAK] + EXPORT IRQ116_Handler [WEAK] + EXPORT IRQ117_Handler [WEAK] + EXPORT IRQ118_Handler [WEAK] + EXPORT IRQ119_Handler [WEAK] + EXPORT IRQ120_Handler [WEAK] + EXPORT IRQ121_Handler [WEAK] + EXPORT IRQ122_Handler [WEAK] + EXPORT IRQ123_Handler [WEAK] + EXPORT IRQ124_Handler [WEAK] + EXPORT IRQ125_Handler [WEAK] + EXPORT IRQ126_Handler [WEAK] + EXPORT IRQ127_Handler [WEAK] + EXPORT IRQ128_Handler [WEAK] + EXPORT IRQ129_Handler [WEAK] + EXPORT IRQ130_Handler [WEAK] + EXPORT IRQ131_Handler [WEAK] + EXPORT IRQ132_Handler [WEAK] + EXPORT IRQ133_Handler [WEAK] + EXPORT IRQ134_Handler [WEAK] + EXPORT IRQ135_Handler [WEAK] + EXPORT IRQ136_Handler [WEAK] + EXPORT IRQ137_Handler [WEAK] + EXPORT IRQ138_Handler [WEAK] + EXPORT IRQ139_Handler [WEAK] + EXPORT IRQ140_Handler [WEAK] + EXPORT IRQ141_Handler [WEAK] + EXPORT IRQ142_Handler [WEAK] + EXPORT IRQ143_Handler [WEAK] + +IRQ000_Handler +IRQ001_Handler +IRQ002_Handler +IRQ003_Handler +IRQ004_Handler +IRQ005_Handler +IRQ006_Handler +IRQ007_Handler +IRQ008_Handler +IRQ009_Handler +IRQ010_Handler +IRQ011_Handler +IRQ012_Handler +IRQ013_Handler +IRQ014_Handler +IRQ015_Handler +IRQ016_Handler +IRQ017_Handler +IRQ018_Handler +IRQ019_Handler +IRQ020_Handler +IRQ021_Handler +IRQ022_Handler +IRQ023_Handler +IRQ024_Handler +IRQ025_Handler +IRQ026_Handler +IRQ027_Handler +IRQ028_Handler +IRQ029_Handler +IRQ030_Handler +IRQ031_Handler +IRQ032_Handler +IRQ033_Handler +IRQ034_Handler +IRQ035_Handler +IRQ036_Handler +IRQ037_Handler +IRQ038_Handler +IRQ039_Handler +IRQ040_Handler +IRQ041_Handler +IRQ042_Handler +IRQ043_Handler +IRQ044_Handler +IRQ045_Handler +IRQ046_Handler +IRQ047_Handler +IRQ048_Handler +IRQ049_Handler +IRQ050_Handler +IRQ051_Handler +IRQ052_Handler +IRQ053_Handler +IRQ054_Handler +IRQ055_Handler +IRQ056_Handler +IRQ057_Handler +IRQ058_Handler +IRQ059_Handler +IRQ060_Handler +IRQ061_Handler +IRQ062_Handler +IRQ063_Handler +IRQ064_Handler +IRQ065_Handler +IRQ066_Handler +IRQ067_Handler +IRQ068_Handler +IRQ069_Handler +IRQ070_Handler +IRQ071_Handler +IRQ072_Handler +IRQ073_Handler +IRQ074_Handler +IRQ075_Handler +IRQ076_Handler +IRQ077_Handler +IRQ078_Handler +IRQ079_Handler +IRQ080_Handler +IRQ081_Handler +IRQ082_Handler +IRQ083_Handler +IRQ084_Handler +IRQ085_Handler +IRQ086_Handler +IRQ087_Handler +IRQ088_Handler +IRQ089_Handler +IRQ090_Handler +IRQ091_Handler +IRQ092_Handler +IRQ093_Handler +IRQ094_Handler +IRQ095_Handler +IRQ096_Handler +IRQ097_Handler +IRQ098_Handler +IRQ099_Handler +IRQ100_Handler +IRQ101_Handler +IRQ102_Handler +IRQ103_Handler +IRQ104_Handler +IRQ105_Handler +IRQ106_Handler +IRQ107_Handler +IRQ108_Handler +IRQ109_Handler +IRQ110_Handler +IRQ111_Handler +IRQ112_Handler +IRQ113_Handler +IRQ114_Handler +IRQ115_Handler +IRQ116_Handler +IRQ117_Handler +IRQ118_Handler +IRQ119_Handler +IRQ120_Handler +IRQ121_Handler +IRQ122_Handler +IRQ123_Handler +IRQ124_Handler +IRQ125_Handler +IRQ126_Handler +IRQ127_Handler +IRQ128_Handler +IRQ129_Handler +IRQ130_Handler +IRQ131_Handler +IRQ132_Handler +IRQ133_Handler +IRQ134_Handler +IRQ135_Handler +IRQ136_Handler +IRQ137_Handler +IRQ138_Handler +IRQ139_Handler +IRQ140_Handler +IRQ141_Handler +IRQ142_Handler +IRQ143_Handler + + B . + + ENDP + + ALIGN + + +; User Initial Stack & Heap + + IF :DEF:__MICROLIB + + EXPORT __initial_sp + EXPORT __heap_base + EXPORT __heap_limit + + ELSE + + IMPORT __use_two_region_memory + EXPORT __user_initial_stackheap +__user_initial_stackheap + + LDR R0, = Heap_Mem + LDR R1, =(Stack_Mem + Stack_Size) + LDR R2, = (Heap_Mem + Heap_Size) + LDR R3, = Stack_Mem + BX LR + + ALIGN + + ENDIF + + + END diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/GCC/startup_hc32f4a0.S b/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/GCC/startup_hc32f4a0.S new file mode 100644 index 0000000000..16a5a540a7 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/GCC/startup_hc32f4a0.S @@ -0,0 +1,565 @@ +/* +;******************************************************************************* +; Copyright (C) 2016, Huada Semiconductor Co.,Ltd All rights reserved. +; +; This software is owned and published by: +; Huada Semiconductor Co.,Ltd ("HDSC"). +; +; BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND +; BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT. +; +; This software contains source code for use with HDSC +; components. This software is licensed by HDSC to be adapted only +; for use in systems utilizing HDSC components. HDSC shall not be +; responsible for misuse or illegal use of this software for devices not +; supported herein. HDSC is providing this software "AS IS" and will +; not be responsible for issues arising from incorrect user implementation +; of the software. +; +; Disclaimer: +; HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE, +; REGARDING THE SOFTWARE (INCLUDING ANY ACCOMPANYING WRITTEN MATERIALS), +; ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING, +; WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED +; WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED +; WARRANTY OF NONINFRINGEMENT. +; HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT, +; NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT +; LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, +; LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR +; INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT, +; INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA, +; SAVINGS OR PROFITS, +; EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +; YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR +; INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED +; FROM, THE SOFTWARE. +; +; This software may be replicated in part or whole for the licensed use, +; with the restriction that this Disclaimer and Copyright notice must be +; included with each copy of this software, whether used in part or whole, +; at all times. +;/ +*/ +/*****************************************************************************/ +/* Startup for GCC */ +/* Version V1.0 */ +/* Date 2020-06-12 */ +/* Target-mcu HC32F4A0 */ +/*****************************************************************************/ + +/* +;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------ +*/ + + .syntax unified + .arch armv7e-m + .cpu cortex-m4 + .fpu softvfp + .thumb + +/* +; Stack Configuration +; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> +; +*/ + .equ Stack_Size, 0x00002000 + + .section .stack + .align 3 + .globl __StackTop + .globl __StackLimit +__StackLimit: + .space Stack_Size + .size __StackLimit, . - __StackLimit +__StackTop: + .size __StackTop, . - __StackTop + + +/* +; Heap Configuration +; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> +; +*/ + .equ Heap_Size, 0x00002000 + + .if Heap_Size != 0 /* Heap is provided */ + .section .heap + .align 3 + .globl __HeapBase + .globl __HeapLimit +__HeapBase: + .space Heap_Size + .size __HeapBase, . - __HeapBase +__HeapLimit: + .size __HeapLimit, . - __HeapLimit + .endif + +/* +; Interrupt vector table start. +*/ + .section .vectors, "a", %progbits + .align 2 + .type __Vectors, %object + .globl __Vectors + .globl __Vectors_End + .globl __Vectors_Size +__Vectors: + .long __StackTop /* Top of Stack */ + .long Reset_Handler /* Reset Handler */ + .long NMI_Handler /* -14 NMI Handler */ + .long HardFault_Handler /* -13 Hard Fault Handler */ + .long MemManage_Handler /* -12 MPU Fault Handler */ + .long BusFault_Handler /* -11 Bus Fault Handler */ + .long UsageFault_Handler /* -10 Usage Fault Handler */ + .long 0 /* Reserved */ + .long 0 /* Reserved */ + .long 0 /* Reserved */ + .long 0 /* Reserved */ + .long SVC_Handler /* -5 SVCall Handler */ + .long DebugMon_Handler /* -4 Debug Monitor Handler */ + .long 0 /* Reserved */ + .long PendSV_Handler /* -2 PendSV Handler */ + .long SysTick_Handler /* -1 SysTick Handler */ + + /* Interrupts */ + .long IRQ000_Handler + .long IRQ001_Handler + .long IRQ002_Handler + .long IRQ003_Handler + .long IRQ004_Handler + .long IRQ005_Handler + .long IRQ006_Handler + .long IRQ007_Handler + .long IRQ008_Handler + .long IRQ009_Handler + .long IRQ010_Handler + .long IRQ011_Handler + .long IRQ012_Handler + .long IRQ013_Handler + .long IRQ014_Handler + .long IRQ015_Handler + .long IRQ016_Handler + .long IRQ017_Handler + .long IRQ018_Handler + .long IRQ019_Handler + .long IRQ020_Handler + .long IRQ021_Handler + .long IRQ022_Handler + .long IRQ023_Handler + .long IRQ024_Handler + .long IRQ025_Handler + .long IRQ026_Handler + .long IRQ027_Handler + .long IRQ028_Handler + .long IRQ029_Handler + .long IRQ030_Handler + .long IRQ031_Handler + .long IRQ032_Handler + .long IRQ033_Handler + .long IRQ034_Handler + .long IRQ035_Handler + .long IRQ036_Handler + .long IRQ037_Handler + .long IRQ038_Handler + .long IRQ039_Handler + .long IRQ040_Handler + .long IRQ041_Handler + .long IRQ042_Handler + .long IRQ043_Handler + .long IRQ044_Handler + .long IRQ045_Handler + .long IRQ046_Handler + .long IRQ047_Handler + .long IRQ048_Handler + .long IRQ049_Handler + .long IRQ050_Handler + .long IRQ051_Handler + .long IRQ052_Handler + .long IRQ053_Handler + .long IRQ054_Handler + .long IRQ055_Handler + .long IRQ056_Handler + .long IRQ057_Handler + .long IRQ058_Handler + .long IRQ059_Handler + .long IRQ060_Handler + .long IRQ061_Handler + .long IRQ062_Handler + .long IRQ063_Handler + .long IRQ064_Handler + .long IRQ065_Handler + .long IRQ066_Handler + .long IRQ067_Handler + .long IRQ068_Handler + .long IRQ069_Handler + .long IRQ070_Handler + .long IRQ071_Handler + .long IRQ072_Handler + .long IRQ073_Handler + .long IRQ074_Handler + .long IRQ075_Handler + .long IRQ076_Handler + .long IRQ077_Handler + .long IRQ078_Handler + .long IRQ079_Handler + .long IRQ080_Handler + .long IRQ081_Handler + .long IRQ082_Handler + .long IRQ083_Handler + .long IRQ084_Handler + .long IRQ085_Handler + .long IRQ086_Handler + .long IRQ087_Handler + .long IRQ088_Handler + .long IRQ089_Handler + .long IRQ090_Handler + .long IRQ091_Handler + .long IRQ092_Handler + .long IRQ093_Handler + .long IRQ094_Handler + .long IRQ095_Handler + .long IRQ096_Handler + .long IRQ097_Handler + .long IRQ098_Handler + .long IRQ099_Handler + .long IRQ100_Handler + .long IRQ101_Handler + .long IRQ102_Handler + .long IRQ103_Handler + .long IRQ104_Handler + .long IRQ105_Handler + .long IRQ106_Handler + .long IRQ107_Handler + .long IRQ108_Handler + .long IRQ109_Handler + .long IRQ110_Handler + .long IRQ111_Handler + .long IRQ112_Handler + .long IRQ113_Handler + .long IRQ114_Handler + .long IRQ115_Handler + .long IRQ116_Handler + .long IRQ117_Handler + .long IRQ118_Handler + .long IRQ119_Handler + .long IRQ120_Handler + .long IRQ121_Handler + .long IRQ122_Handler + .long IRQ123_Handler + .long IRQ124_Handler + .long IRQ125_Handler + .long IRQ126_Handler + .long IRQ127_Handler + .long IRQ128_Handler + .long IRQ129_Handler + .long IRQ130_Handler + .long IRQ131_Handler + .long IRQ132_Handler + .long IRQ133_Handler + .long IRQ134_Handler + .long IRQ135_Handler + .long IRQ136_Handler + .long IRQ137_Handler + .long IRQ138_Handler + .long IRQ139_Handler + .long IRQ140_Handler + .long IRQ141_Handler + .long IRQ142_Handler + .long IRQ143_Handler +__Vectors_End: + .equ __Vectors_Size, __Vectors_End - __Vectors + .size __Vectors, . - __Vectors +/* +; Interrupt vector table end. +*/ + +/* +; Reset handler start. +*/ + .section .text.Reset_Handler + .align 2 + .weak Reset_Handler + .type Reset_Handler, %function + .globl Reset_Handler +Reset_Handler: + /* Set stack top pointer. */ + ldr sp, =__StackTop +/* Single section scheme. + * + * The ranges of copy from/to are specified by following symbols + * __etext: LMA of start of the section to copy from. Usually end of text + * __data_start__: VMA of start of the section to copy to + * __data_end__: VMA of end of the section to copy to + * + * All addresses must be aligned to 4 bytes boundary. + */ +StackInit: + ldr r1, =__StackLimit + ldr r2, =__StackTop + + movs r0, 0 +StackInitLoop: + cmp r1, r2 + itt lt + strlt r0, [r1], #4 + blt StackInitLoop + +ClrSramSR: + ldr r0, =0x40050810 + ldr r1, =0x1FF + str r1, [r0] + + /* Copy data from read only memory to RAM. */ +CopyData: + ldr r1, =__etext + ldr r2, =__data_start__ + ldr r3, =__data_end__ +CopyLoop: + cmp r2, r3 + ittt lt + ldrlt r0, [r1], #4 + strlt r0, [r2], #4 + blt CopyLoop + +CopyData1: + ldr r1, =__etext_ramb + ldr r2, =__data_start_ramb__ + ldr r3, =__data_end_ramb__ +CopyLoop1: + cmp r2, r3 + ittt lt + ldrlt r0, [r1], #4 + strlt r0, [r2], #4 + blt CopyLoop1 + +/* This part of work usually is done in C library startup code. + * Otherwise, define this macro to enable it in this startup. + * + * There are two schemes too. + * One can clear multiple BSS sections. Another can only clear one section. + * The former is more size expensive than the latter. + * + * Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former. + * Otherwise define macro __STARTUP_CLEAR_BSS to choose the later. + */ +/* Single BSS section scheme. + * + * The BSS section is specified by following symbols + * __bss_start__: start of the BSS section. + * __bss_end__: end of the BSS section. + * + * Both addresses must be aligned to 4 bytes boundary. + */ + /* Clear BSS section. */ +ClearBss: + ldr r1, =__bss_start__ + ldr r2, =__bss_end__ + + movs r0, 0 +ClearLoop: + cmp r1, r2 + itt lt + strlt r0, [r1], #4 + blt ClearLoop + +ClearBss1: + ldr r1, =__bss_start_ramb__ + ldr r2, =__bss_end_ramb__ + + movs r0, 0 +ClearLoop1: + cmp r1, r2 + itt lt + strlt r0, [r1], #4 + blt ClearLoop1 + + /* Call the clock system initialization function. */ + bl SystemInit + /* Call the application's entry point. */ + bl main + bx lr + .size Reset_Handler, . - Reset_Handler +/* +; Reset handler end. +*/ + +/* +; Default handler start. +*/ + .section .text.Default_Handler, "ax", %progbits + .align 2 +Default_Handler: + b . + .size Default_Handler, . - Default_Handler +/* +; Default handler end. +*/ + +/* Macro to define default exception/interrupt handlers. + * Default handler are weak symbols with an endless loop. + * They can be overwritten by real handlers. + */ + .macro Set_Default_Handler Handler_Name + .weak \Handler_Name + .set \Handler_Name, Default_Handler + .endm + +/* Default exception/interrupt handler */ + + Set_Default_Handler NMI_Handler + Set_Default_Handler HardFault_Handler + Set_Default_Handler MemManage_Handler + Set_Default_Handler BusFault_Handler + Set_Default_Handler UsageFault_Handler + Set_Default_Handler SVC_Handler + Set_Default_Handler DebugMon_Handler + Set_Default_Handler PendSV_Handler + Set_Default_Handler SysTick_Handler + + Set_Default_Handler IRQ000_Handler + Set_Default_Handler IRQ001_Handler + Set_Default_Handler IRQ002_Handler + Set_Default_Handler IRQ003_Handler + Set_Default_Handler IRQ004_Handler + Set_Default_Handler IRQ005_Handler + Set_Default_Handler IRQ006_Handler + Set_Default_Handler IRQ007_Handler + Set_Default_Handler IRQ008_Handler + Set_Default_Handler IRQ009_Handler + Set_Default_Handler IRQ010_Handler + Set_Default_Handler IRQ011_Handler + Set_Default_Handler IRQ012_Handler + Set_Default_Handler IRQ013_Handler + Set_Default_Handler IRQ014_Handler + Set_Default_Handler IRQ015_Handler + Set_Default_Handler IRQ016_Handler + Set_Default_Handler IRQ017_Handler + Set_Default_Handler IRQ018_Handler + Set_Default_Handler IRQ019_Handler + Set_Default_Handler IRQ020_Handler + Set_Default_Handler IRQ021_Handler + Set_Default_Handler IRQ022_Handler + Set_Default_Handler IRQ023_Handler + Set_Default_Handler IRQ024_Handler + Set_Default_Handler IRQ025_Handler + Set_Default_Handler IRQ026_Handler + Set_Default_Handler IRQ027_Handler + Set_Default_Handler IRQ028_Handler + Set_Default_Handler IRQ029_Handler + Set_Default_Handler IRQ030_Handler + Set_Default_Handler IRQ031_Handler + Set_Default_Handler IRQ032_Handler + Set_Default_Handler IRQ033_Handler + Set_Default_Handler IRQ034_Handler + Set_Default_Handler IRQ035_Handler + Set_Default_Handler IRQ036_Handler + Set_Default_Handler IRQ037_Handler + Set_Default_Handler IRQ038_Handler + Set_Default_Handler IRQ039_Handler + Set_Default_Handler IRQ040_Handler + Set_Default_Handler IRQ041_Handler + Set_Default_Handler IRQ042_Handler + Set_Default_Handler IRQ043_Handler + Set_Default_Handler IRQ044_Handler + Set_Default_Handler IRQ045_Handler + Set_Default_Handler IRQ046_Handler + Set_Default_Handler IRQ047_Handler + Set_Default_Handler IRQ048_Handler + Set_Default_Handler IRQ049_Handler + Set_Default_Handler IRQ050_Handler + Set_Default_Handler IRQ051_Handler + Set_Default_Handler IRQ052_Handler + Set_Default_Handler IRQ053_Handler + Set_Default_Handler IRQ054_Handler + Set_Default_Handler IRQ055_Handler + Set_Default_Handler IRQ056_Handler + Set_Default_Handler IRQ057_Handler + Set_Default_Handler IRQ058_Handler + Set_Default_Handler IRQ059_Handler + Set_Default_Handler IRQ060_Handler + Set_Default_Handler IRQ061_Handler + Set_Default_Handler IRQ062_Handler + Set_Default_Handler IRQ063_Handler + Set_Default_Handler IRQ064_Handler + Set_Default_Handler IRQ065_Handler + Set_Default_Handler IRQ066_Handler + Set_Default_Handler IRQ067_Handler + Set_Default_Handler IRQ068_Handler + Set_Default_Handler IRQ069_Handler + Set_Default_Handler IRQ070_Handler + Set_Default_Handler IRQ071_Handler + Set_Default_Handler IRQ072_Handler + Set_Default_Handler IRQ073_Handler + Set_Default_Handler IRQ074_Handler + Set_Default_Handler IRQ075_Handler + Set_Default_Handler IRQ076_Handler + Set_Default_Handler IRQ077_Handler + Set_Default_Handler IRQ078_Handler + Set_Default_Handler IRQ079_Handler + Set_Default_Handler IRQ080_Handler + Set_Default_Handler IRQ081_Handler + Set_Default_Handler IRQ082_Handler + Set_Default_Handler IRQ083_Handler + Set_Default_Handler IRQ084_Handler + Set_Default_Handler IRQ085_Handler + Set_Default_Handler IRQ086_Handler + Set_Default_Handler IRQ087_Handler + Set_Default_Handler IRQ088_Handler + Set_Default_Handler IRQ089_Handler + Set_Default_Handler IRQ090_Handler + Set_Default_Handler IRQ091_Handler + Set_Default_Handler IRQ092_Handler + Set_Default_Handler IRQ093_Handler + Set_Default_Handler IRQ094_Handler + Set_Default_Handler IRQ095_Handler + Set_Default_Handler IRQ096_Handler + Set_Default_Handler IRQ097_Handler + Set_Default_Handler IRQ098_Handler + Set_Default_Handler IRQ099_Handler + Set_Default_Handler IRQ100_Handler + Set_Default_Handler IRQ101_Handler + Set_Default_Handler IRQ102_Handler + Set_Default_Handler IRQ103_Handler + Set_Default_Handler IRQ104_Handler + Set_Default_Handler IRQ105_Handler + Set_Default_Handler IRQ106_Handler + Set_Default_Handler IRQ107_Handler + Set_Default_Handler IRQ108_Handler + Set_Default_Handler IRQ109_Handler + Set_Default_Handler IRQ110_Handler + Set_Default_Handler IRQ111_Handler + Set_Default_Handler IRQ112_Handler + Set_Default_Handler IRQ113_Handler + Set_Default_Handler IRQ114_Handler + Set_Default_Handler IRQ115_Handler + Set_Default_Handler IRQ116_Handler + Set_Default_Handler IRQ117_Handler + Set_Default_Handler IRQ118_Handler + Set_Default_Handler IRQ119_Handler + Set_Default_Handler IRQ120_Handler + Set_Default_Handler IRQ121_Handler + Set_Default_Handler IRQ122_Handler + Set_Default_Handler IRQ123_Handler + Set_Default_Handler IRQ124_Handler + Set_Default_Handler IRQ125_Handler + Set_Default_Handler IRQ126_Handler + Set_Default_Handler IRQ127_Handler + Set_Default_Handler IRQ128_Handler + Set_Default_Handler IRQ129_Handler + Set_Default_Handler IRQ130_Handler + Set_Default_Handler IRQ131_Handler + Set_Default_Handler IRQ132_Handler + Set_Default_Handler IRQ133_Handler + Set_Default_Handler IRQ134_Handler + Set_Default_Handler IRQ135_Handler + Set_Default_Handler IRQ136_Handler + Set_Default_Handler IRQ137_Handler + Set_Default_Handler IRQ138_Handler + Set_Default_Handler IRQ139_Handler + Set_Default_Handler IRQ140_Handler + Set_Default_Handler IRQ141_Handler + Set_Default_Handler IRQ142_Handler + Set_Default_Handler IRQ143_Handler + + .end diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/IAR/HDSC_HC32F4A0.svd b/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/IAR/HDSC_HC32F4A0.svd new file mode 100644 index 0000000000..3633a20ab1 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/IAR/HDSC_HC32F4A0.svd @@ -0,0 +1,164956 @@ + + + HDSC Co.,Ltd. + HDSC + HDSC_HC32F4A0 + ARMCM4 + 1.0 + + CM4 + r0p1 + little + true + true + 4 + false + + 8 + 32 + 32 + read-write + 0x0 + 0x0 + + + ADC1 + desc ADC1 + 0x40040000 + + 0x0 + 0xC5 + + + + STR + desc STR + 0x0 + 8 + read-write + 0x0 + 0x1 + + + STRT + desc STRT + 0 + 0 + read-write + + + + + CR0 + desc CR0 + 0x2 + 16 + read-write + 0x0 + 0x7F3 + + + MS + desc MS + 1 + 0 + read-write + + + ACCSEL + desc ACCSEL + 5 + 4 + read-write + + + CLREN + desc CLREN + 6 + 6 + read-write + + + DFMT + desc DFMT + 7 + 7 + read-write + + + AVCNT + desc AVCNT + 10 + 8 + read-write + + + + + CR1 + desc CR1 + 0x4 + 16 + read-write + 0x0 + 0x4 + + + RSCHSEL + desc RSCHSEL + 2 + 2 + read-write + + + + + TRGSR + desc TRGSR + 0xA + 16 + read-write + 0x0 + 0x8383 + + + TRGSELA + desc TRGSELA + 1 + 0 + read-write + + + TRGENA + desc TRGENA + 7 + 7 + read-write + + + TRGSELB + desc TRGSELB + 9 + 8 + read-write + + + TRGENB + desc TRGENB + 15 + 15 + read-write + + + + + CHSELRA + desc CHSELRA + 0xC + 32 + read-write + 0x0 + 0xFFFF + + + CHSELA + desc CHSELA + 15 + 0 + read-write + + + + + CHSELRB + desc CHSELRB + 0x10 + 32 + read-write + 0x0 + 0xFFFF + + + CHSELB + desc CHSELB + 15 + 0 + read-write + + + + + AVCHSELR + desc AVCHSELR + 0x14 + 32 + read-write + 0x0 + 0xFFFF + + + AVCHSEL + desc AVCHSEL + 15 + 0 + read-write + + + + + EXCHSELR + desc EXCHSELR + 0x18 + 8 + read-write + 0x0 + 0x1 + + + EXCHSEL + desc EXCHSEL + 0 + 0 + read-write + + + + + SHCR + desc SHCR + 0x1A + 16 + read-write + 0x18 + 0x7FF + + + SHSST + desc SHSST + 7 + 0 + read-write + + + SHSEL + desc SHSEL + 10 + 8 + read-write + + + + + SSTR0 + desc SSTR0 + 0x20 + 8 + read-write + 0xB + 0xFF + + + SSTR1 + desc SSTR1 + 0x21 + 8 + read-write + 0xB + 0xFF + + + SSTR2 + desc SSTR2 + 0x22 + 8 + read-write + 0xB + 0xFF + + + SSTR3 + desc SSTR3 + 0x23 + 8 + read-write + 0xB + 0xFF + + + SSTR4 + desc SSTR4 + 0x24 + 8 + read-write + 0xB + 0xFF + + + SSTR5 + desc SSTR5 + 0x25 + 8 + read-write + 0xB + 0xFF + + + SSTR6 + desc SSTR6 + 0x26 + 8 + read-write + 0xB + 0xFF + + + SSTR7 + desc SSTR7 + 0x27 + 8 + read-write + 0xB + 0xFF + + + SSTR8 + desc SSTR8 + 0x28 + 8 + read-write + 0xB + 0xFF + + + SSTR9 + desc SSTR9 + 0x29 + 8 + read-write + 0xB + 0xFF + + + SSTR10 + desc SSTR10 + 0x2A + 8 + read-write + 0xB + 0xFF + + + SSTR11 + desc SSTR11 + 0x2B + 8 + read-write + 0xB + 0xFF + + + SSTR12 + desc SSTR12 + 0x2C + 8 + read-write + 0xB + 0xFF + + + SSTR13 + desc SSTR13 + 0x2D + 8 + read-write + 0xB + 0xFF + + + SSTR14 + desc SSTR14 + 0x2E + 8 + read-write + 0xB + 0xFF + + + SSTR15 + desc SSTR15 + 0x2F + 8 + read-write + 0xB + 0xFF + + + SSTRL + desc SSTRL + 0x30 + 8 + read-write + 0xB + 0xFF + + + CHMUXR0 + desc CHMUXR0 + 0x38 + 16 + read-write + 0x3210 + 0xFFFF + + + CH00MUX + desc CH00MUX + 3 + 0 + read-write + + + CH01MUX + desc CH01MUX + 7 + 4 + read-write + + + CH02MUX + desc CH02MUX + 11 + 8 + read-write + + + CH03MUX + desc CH03MUX + 15 + 12 + read-write + + + + + CHMUXR1 + desc CHMUXR1 + 0x3A + 16 + read-write + 0x7654 + 0xFFFF + + + CH04MUX + desc CH04MUX + 3 + 0 + read-write + + + CH05MUX + desc CH05MUX + 7 + 4 + read-write + + + CH06MUX + desc CH06MUX + 11 + 8 + read-write + + + CH07MUX + desc CH07MUX + 15 + 12 + read-write + + + + + CHMUXR2 + desc CHMUXR2 + 0x3C + 16 + read-write + 0xBA98 + 0xFFFF + + + CH08MUX + desc CH08MUX + 3 + 0 + read-write + + + CH09MUX + desc CH09MUX + 7 + 4 + read-write + + + CH10MUX + desc CH10MUX + 11 + 8 + read-write + + + CH11MUX + desc CH11MUX + 15 + 12 + read-write + + + + + CHMUXR3 + desc CHMUXR3 + 0x3E + 16 + read-write + 0xFEDC + 0xFFFF + + + CH12MUX + desc CH12MUX + 3 + 0 + read-write + + + CH13MUX + desc CH13MUX + 7 + 4 + read-write + + + CH14MUX + desc CH14MUX + 11 + 8 + read-write + + + CH15MUX + desc CH15MUX + 15 + 12 + read-write + + + + + ISR + desc ISR + 0x44 + 8 + read-only + 0x0 + 0x13 + + + EOCAF + desc EOCAF + 0 + 0 + read-only + + + EOCBF + desc EOCBF + 1 + 1 + read-only + + + SASTPDF + desc SASTPDF + 4 + 4 + read-only + + + + + ICR + desc ICR + 0x45 + 8 + read-write + 0x3 + 0x3 + + + EOCAIEN + desc EOCAIEN + 0 + 0 + read-write + + + EOCBIEN + desc EOCBIEN + 1 + 1 + read-write + + + + + ISCLRR + desc ISCLRR + 0x46 + 8 + write-only + 0x0 + 0x13 + + + CLREOCAF + desc CLREOCAF + 0 + 0 + write-only + + + CLREOCBF + desc CLREOCBF + 1 + 1 + write-only + + + CLRSASTPDF + desc CLRSASTPDF + 4 + 4 + write-only + + + + + SYNCCR + desc SYNCCR + 0x4C + 16 + read-write + 0xC00 + 0xFF71 + + + SYNCEN + desc SYNCEN + 0 + 0 + read-write + + + SYNCMD + desc SYNCMD + 6 + 4 + read-write + + + SYNCDLY + desc SYNCDLY + 15 + 8 + read-write + + + + + DR0 + desc DR0 + 0x50 + 16 + read-only + 0x0 + 0xFFFF + + + DR1 + desc DR1 + 0x52 + 16 + read-only + 0x0 + 0xFFFF + + + DR2 + desc DR2 + 0x54 + 16 + read-only + 0x0 + 0xFFFF + + + DR3 + desc DR3 + 0x56 + 16 + read-only + 0x0 + 0xFFFF + + + DR4 + desc DR4 + 0x58 + 16 + read-only + 0x0 + 0xFFFF + + + DR5 + desc DR5 + 0x5A + 16 + read-only + 0x0 + 0xFFFF + + + DR6 + desc DR6 + 0x5C + 16 + read-only + 0x0 + 0xFFFF + + + DR7 + desc DR7 + 0x5E + 16 + read-only + 0x0 + 0xFFFF + + + DR8 + desc DR8 + 0x60 + 16 + read-only + 0x0 + 0xFFFF + + + DR9 + desc DR9 + 0x62 + 16 + read-only + 0x0 + 0xFFFF + + + DR10 + desc DR10 + 0x64 + 16 + read-only + 0x0 + 0xFFFF + + + DR11 + desc DR11 + 0x66 + 16 + read-only + 0x0 + 0xFFFF + + + DR12 + desc DR12 + 0x68 + 16 + read-only + 0x0 + 0xFFFF + + + DR13 + desc DR13 + 0x6A + 16 + read-only + 0x0 + 0xFFFF + + + DR14 + desc DR14 + 0x6C + 16 + read-only + 0x0 + 0xFFFF + + + DR15 + desc DR15 + 0x6E + 16 + read-only + 0x0 + 0xFFFF + + + AWDCR + desc AWDCR + 0xA0 + 16 + read-write + 0x0 + 0x377 + + + AWD0EN + desc AWD0EN + 0 + 0 + read-write + + + AWD0IEN + desc AWD0IEN + 1 + 1 + read-write + + + AWD0MD + desc AWD0MD + 2 + 2 + read-write + + + AWD1EN + desc AWD1EN + 4 + 4 + read-write + + + AWD1IEN + desc AWD1IEN + 5 + 5 + read-write + + + AWD1MD + desc AWD1MD + 6 + 6 + read-write + + + AWDCM + desc AWDCM + 9 + 8 + read-write + + + + + AWDSR + desc AWDSR + 0xA2 + 8 + read-only + 0x0 + 0x13 + + + AWD0F + desc AWD0F + 0 + 0 + read-only + + + AWD1F + desc AWD1F + 1 + 1 + read-only + + + AWDCMF + desc AWDCMF + 4 + 4 + read-only + + + + + AWDSCLRR + desc AWDSCLRR + 0xA3 + 8 + write-only + 0x0 + 0x13 + + + CLRAWD0F + desc CLRAWD0F + 0 + 0 + write-only + + + CLRAWD1F + desc CLRAWD1F + 1 + 1 + write-only + + + CLRAWDCMF + desc CLRAWDCMF + 4 + 4 + write-only + + + + + AWD0DR0 + desc AWD0DR0 + 0xA4 + 16 + read-write + 0x0 + 0xFFFF + + + AWD0DR1 + desc AWD0DR1 + 0xA6 + 16 + read-write + 0x0 + 0xFFFF + + + AWD0CHSR + desc AWD0CHSR + 0xA8 + 16 + read-write + 0x0 + 0x1F + + + AWDCH + desc AWDCH + 4 + 0 + read-write + + + + + AWD1DR0 + desc AWD1DR0 + 0xAC + 16 + read-write + 0x0 + 0xFFFF + + + AWD1DR1 + desc AWD1DR1 + 0xAE + 16 + read-write + 0x0 + 0xFFFF + + + AWD1CHSR + desc AWD1CHSR + 0xB0 + 16 + read-write + 0x0 + 0x1F + + + AWDCH + desc AWDCH + 4 + 0 + read-write + + + + + PGACR1 + desc PGACR1 + 0xC0 + 8 + read-write + 0x0 + 0xFF + + + PGACTL + desc PGACTL + 3 + 0 + read-write + + + PGAGAIN + desc PGAGAIN + 7 + 4 + read-write + + + + + PGACR2 + desc PGACR2 + 0xC1 + 8 + read-write + 0x0 + 0xFF + + + PGACTL + desc PGACTL + 3 + 0 + read-write + + + PGAGAIN + desc PGAGAIN + 7 + 4 + read-write + + + + + PGACR3 + desc PGACR3 + 0xC2 + 8 + read-write + 0x0 + 0xFF + + + PGACTL + desc PGACTL + 3 + 0 + read-write + + + PGAGAIN + desc PGAGAIN + 7 + 4 + read-write + + + + + PGAVSSENR + desc PGAVSSENR + 0xC4 + 8 + read-write + 0x0 + 0x7 + + + PGAVSSEN + desc PGAVSSEN + 2 + 0 + read-write + + + + + + + ADC2 + desc ADC2 + 0x40040400 + + 0x0 + 0xC5 + + + + STR + desc STR + 0x0 + 8 + read-write + 0x0 + 0x1 + + + STRT + desc STRT + 0 + 0 + read-write + + + + + CR0 + desc CR0 + 0x2 + 16 + read-write + 0x0 + 0x7F3 + + + MS + desc MS + 1 + 0 + read-write + + + ACCSEL + desc ACCSEL + 5 + 4 + read-write + + + CLREN + desc CLREN + 6 + 6 + read-write + + + DFMT + desc DFMT + 7 + 7 + read-write + + + AVCNT + desc AVCNT + 10 + 8 + read-write + + + + + CR1 + desc CR1 + 0x4 + 16 + read-write + 0x0 + 0x4 + + + RSCHSEL + desc RSCHSEL + 2 + 2 + read-write + + + + + TRGSR + desc TRGSR + 0xA + 16 + read-write + 0x0 + 0x8383 + + + TRGSELA + desc TRGSELA + 1 + 0 + read-write + + + TRGENA + desc TRGENA + 7 + 7 + read-write + + + TRGSELB + desc TRGSELB + 9 + 8 + read-write + + + TRGENB + desc TRGENB + 15 + 15 + read-write + + + + + CHSELRA + desc CHSELRA + 0xC + 32 + read-write + 0x0 + 0xFFFF + + + CHSELA + desc CHSELA + 15 + 0 + read-write + + + + + CHSELRB + desc CHSELRB + 0x10 + 32 + read-write + 0x0 + 0xFFFF + + + CHSELB + desc CHSELB + 15 + 0 + read-write + + + + + AVCHSELR + desc AVCHSELR + 0x14 + 32 + read-write + 0x0 + 0xFFFF + + + AVCHSEL + desc AVCHSEL + 15 + 0 + read-write + + + + + EXCHSELR + desc EXCHSELR + 0x18 + 8 + read-write + 0x0 + 0x1 + + + EXCHSEL + desc EXCHSEL + 0 + 0 + read-write + + + + + SSTR0 + desc SSTR0 + 0x20 + 8 + read-write + 0xB + 0xFF + + + SSTR1 + desc SSTR1 + 0x21 + 8 + read-write + 0xB + 0xFF + + + SSTR2 + desc SSTR2 + 0x22 + 8 + read-write + 0xB + 0xFF + + + SSTR3 + desc SSTR3 + 0x23 + 8 + read-write + 0xB + 0xFF + + + SSTR4 + desc SSTR4 + 0x24 + 8 + read-write + 0xB + 0xFF + + + SSTR5 + desc SSTR5 + 0x25 + 8 + read-write + 0xB + 0xFF + + + SSTR6 + desc SSTR6 + 0x26 + 8 + read-write + 0xB + 0xFF + + + SSTR7 + desc SSTR7 + 0x27 + 8 + read-write + 0xB + 0xFF + + + SSTR8 + desc SSTR8 + 0x28 + 8 + read-write + 0xB + 0xFF + + + SSTR9 + desc SSTR9 + 0x29 + 8 + read-write + 0xB + 0xFF + + + SSTR10 + desc SSTR10 + 0x2A + 8 + read-write + 0xB + 0xFF + + + SSTR11 + desc SSTR11 + 0x2B + 8 + read-write + 0xB + 0xFF + + + SSTR12 + desc SSTR12 + 0x2C + 8 + read-write + 0xB + 0xFF + + + SSTR13 + desc SSTR13 + 0x2D + 8 + read-write + 0xB + 0xFF + + + SSTR14 + desc SSTR14 + 0x2E + 8 + read-write + 0xB + 0xFF + + + SSTR15 + desc SSTR15 + 0x2F + 8 + read-write + 0xB + 0xFF + + + SSTRL + desc SSTRL + 0x30 + 8 + read-write + 0xB + 0xFF + + + CHMUXR0 + desc CHMUXR0 + 0x38 + 16 + read-write + 0x3210 + 0xFFFF + + + CH00MUX + desc CH00MUX + 3 + 0 + read-write + + + CH01MUX + desc CH01MUX + 7 + 4 + read-write + + + CH02MUX + desc CH02MUX + 11 + 8 + read-write + + + CH03MUX + desc CH03MUX + 15 + 12 + read-write + + + + + CHMUXR1 + desc CHMUXR1 + 0x3A + 16 + read-write + 0x7654 + 0xFFFF + + + CH04MUX + desc CH04MUX + 3 + 0 + read-write + + + CH05MUX + desc CH05MUX + 7 + 4 + read-write + + + CH06MUX + desc CH06MUX + 11 + 8 + read-write + + + CH07MUX + desc CH07MUX + 15 + 12 + read-write + + + + + CHMUXR2 + desc CHMUXR2 + 0x3C + 16 + read-write + 0xBA98 + 0xFFFF + + + CH08MUX + desc CH08MUX + 3 + 0 + read-write + + + CH09MUX + desc CH09MUX + 7 + 4 + read-write + + + CH10MUX + desc CH10MUX + 11 + 8 + read-write + + + CH11MUX + desc CH11MUX + 15 + 12 + read-write + + + + + CHMUXR3 + desc CHMUXR3 + 0x3E + 16 + read-write + 0xFEDC + 0xFFFF + + + CH12MUX + desc CH12MUX + 3 + 0 + read-write + + + CH13MUX + desc CH13MUX + 7 + 4 + read-write + + + CH14MUX + desc CH14MUX + 11 + 8 + read-write + + + CH15MUX + desc CH15MUX + 15 + 12 + read-write + + + + + ISR + desc ISR + 0x44 + 8 + read-only + 0x0 + 0x13 + + + EOCAF + desc EOCAF + 0 + 0 + read-only + + + EOCBF + desc EOCBF + 1 + 1 + read-only + + + SASTPDF + desc SASTPDF + 4 + 4 + read-only + + + + + ICR + desc ICR + 0x45 + 8 + read-write + 0x3 + 0x3 + + + EOCAIEN + desc EOCAIEN + 0 + 0 + read-write + + + EOCBIEN + desc EOCBIEN + 1 + 1 + read-write + + + + + ISCLRR + desc ISCLRR + 0x46 + 8 + write-only + 0x0 + 0x13 + + + CLREOCAF + desc CLREOCAF + 0 + 0 + write-only + + + CLREOCBF + desc CLREOCBF + 1 + 1 + write-only + + + CLRSASTPDF + desc CLRSASTPDF + 4 + 4 + write-only + + + + + DR0 + desc DR0 + 0x50 + 16 + read-only + 0x0 + 0xFFFF + + + DR1 + desc DR1 + 0x52 + 16 + read-only + 0x0 + 0xFFFF + + + DR2 + desc DR2 + 0x54 + 16 + read-only + 0x0 + 0xFFFF + + + DR3 + desc DR3 + 0x56 + 16 + read-only + 0x0 + 0xFFFF + + + DR4 + desc DR4 + 0x58 + 16 + read-only + 0x0 + 0xFFFF + + + DR5 + desc DR5 + 0x5A + 16 + read-only + 0x0 + 0xFFFF + + + DR6 + desc DR6 + 0x5C + 16 + read-only + 0x0 + 0xFFFF + + + DR7 + desc DR7 + 0x5E + 16 + read-only + 0x0 + 0xFFFF + + + DR8 + desc DR8 + 0x60 + 16 + read-only + 0x0 + 0xFFFF + + + DR9 + desc DR9 + 0x62 + 16 + read-only + 0x0 + 0xFFFF + + + DR10 + desc DR10 + 0x64 + 16 + read-only + 0x0 + 0xFFFF + + + DR11 + desc DR11 + 0x66 + 16 + read-only + 0x0 + 0xFFFF + + + DR12 + desc DR12 + 0x68 + 16 + read-only + 0x0 + 0xFFFF + + + DR13 + desc DR13 + 0x6A + 16 + read-only + 0x0 + 0xFFFF + + + DR14 + desc DR14 + 0x6C + 16 + read-only + 0x0 + 0xFFFF + + + DR15 + desc DR15 + 0x6E + 16 + read-only + 0x0 + 0xFFFF + + + AWDCR + desc AWDCR + 0xA0 + 16 + read-write + 0x0 + 0x377 + + + AWD0EN + desc AWD0EN + 0 + 0 + read-write + + + AWD0IEN + desc AWD0IEN + 1 + 1 + read-write + + + AWD0MD + desc AWD0MD + 2 + 2 + read-write + + + AWD1EN + desc AWD1EN + 4 + 4 + read-write + + + AWD1IEN + desc AWD1IEN + 5 + 5 + read-write + + + AWD1MD + desc AWD1MD + 6 + 6 + read-write + + + AWDCM + desc AWDCM + 9 + 8 + read-write + + + + + AWDSR + desc AWDSR + 0xA2 + 8 + read-only + 0x0 + 0x13 + + + AWD0F + desc AWD0F + 0 + 0 + read-only + + + AWD1F + desc AWD1F + 1 + 1 + read-only + + + AWDCMF + desc AWDCMF + 4 + 4 + read-only + + + + + AWDSCLRR + desc AWDSCLRR + 0xA3 + 8 + write-only + 0x0 + 0x13 + + + CLRAWD0F + desc CLRAWD0F + 0 + 0 + write-only + + + CLRAWD1F + desc CLRAWD1F + 1 + 1 + write-only + + + CLRAWDCMF + desc CLRAWDCMF + 4 + 4 + write-only + + + + + AWD0DR0 + desc AWD0DR0 + 0xA4 + 16 + read-write + 0x0 + 0xFFFF + + + AWD0DR1 + desc AWD0DR1 + 0xA6 + 16 + read-write + 0x0 + 0xFFFF + + + AWD0CHSR + desc AWD0CHSR + 0xA8 + 16 + read-write + 0x0 + 0x1F + + + AWDCH + desc AWDCH + 4 + 0 + read-write + + + + + AWD1DR0 + desc AWD1DR0 + 0xAC + 16 + read-write + 0x0 + 0xFFFF + + + AWD1DR1 + desc AWD1DR1 + 0xAE + 16 + read-write + 0x0 + 0xFFFF + + + AWD1CHSR + desc AWD1CHSR + 0xB0 + 16 + read-write + 0x0 + 0x1F + + + AWDCH + desc AWDCH + 4 + 0 + read-write + + + + + PGACR1 + desc PGACR1 + 0xC0 + 8 + read-write + 0x0 + 0xFF + + + PGACTL + desc PGACTL + 3 + 0 + read-write + + + PGAGAIN + desc PGAGAIN + 7 + 4 + read-write + + + + + PGAVSSENR + desc PGAVSSENR + 0xC4 + 8 + read-write + 0x0 + 0x1 + + + PGAVSSEN + desc PGAVSSEN + 0 + 0 + read-write + + + + + + + ADC3 + desc ADC3 + 0x40040800 + + 0x0 + 0xB2 + + + + STR + desc STR + 0x0 + 8 + read-write + 0x0 + 0x1 + + + STRT + desc STRT + 0 + 0 + read-write + + + + + CR0 + desc CR0 + 0x2 + 16 + read-write + 0x0 + 0x7F3 + + + MS + desc MS + 1 + 0 + read-write + + + ACCSEL + desc ACCSEL + 5 + 4 + read-write + + + CLREN + desc CLREN + 6 + 6 + read-write + + + DFMT + desc DFMT + 7 + 7 + read-write + + + AVCNT + desc AVCNT + 10 + 8 + read-write + + + + + CR1 + desc CR1 + 0x4 + 16 + read-write + 0x0 + 0x4 + + + RSCHSEL + desc RSCHSEL + 2 + 2 + read-write + + + + + TRGSR + desc TRGSR + 0xA + 16 + read-write + 0x0 + 0x8383 + + + TRGSELA + desc TRGSELA + 1 + 0 + read-write + + + TRGENA + desc TRGENA + 7 + 7 + read-write + + + TRGSELB + desc TRGSELB + 9 + 8 + read-write + + + TRGENB + desc TRGENB + 15 + 15 + read-write + + + + + CHSELRA + desc CHSELRA + 0xC + 32 + read-write + 0x0 + 0xFFFFF + + + CHSELA + desc CHSELA + 19 + 0 + read-write + + + + + CHSELRB + desc CHSELRB + 0x10 + 32 + read-write + 0x0 + 0xFFFFF + + + CHSELB + desc CHSELB + 19 + 0 + read-write + + + + + AVCHSELR + desc AVCHSELR + 0x14 + 32 + read-write + 0x0 + 0xFFFFF + + + AVCHSEL + desc AVCHSEL + 19 + 0 + read-write + + + + + EXCHSELR + desc EXCHSELR + 0x18 + 8 + read-write + 0x0 + 0x1 + + + EXCHSEL + desc EXCHSEL + 0 + 0 + read-write + + + + + SSTR0 + desc SSTR0 + 0x20 + 8 + read-write + 0xB + 0xFF + + + SSTR1 + desc SSTR1 + 0x21 + 8 + read-write + 0xB + 0xFF + + + SSTR2 + desc SSTR2 + 0x22 + 8 + read-write + 0xB + 0xFF + + + SSTR3 + desc SSTR3 + 0x23 + 8 + read-write + 0xB + 0xFF + + + SSTR4 + desc SSTR4 + 0x24 + 8 + read-write + 0xB + 0xFF + + + SSTR5 + desc SSTR5 + 0x25 + 8 + read-write + 0xB + 0xFF + + + SSTR6 + desc SSTR6 + 0x26 + 8 + read-write + 0xB + 0xFF + + + SSTR7 + desc SSTR7 + 0x27 + 8 + read-write + 0xB + 0xFF + + + SSTR8 + desc SSTR8 + 0x28 + 8 + read-write + 0xB + 0xFF + + + SSTR9 + desc SSTR9 + 0x29 + 8 + read-write + 0xB + 0xFF + + + SSTR10 + desc SSTR10 + 0x2A + 8 + read-write + 0xB + 0xFF + + + SSTR11 + desc SSTR11 + 0x2B + 8 + read-write + 0xB + 0xFF + + + SSTR12 + desc SSTR12 + 0x2C + 8 + read-write + 0xB + 0xFF + + + SSTR13 + desc SSTR13 + 0x2D + 8 + read-write + 0xB + 0xFF + + + SSTR14 + desc SSTR14 + 0x2E + 8 + read-write + 0xB + 0xFF + + + SSTR15 + desc SSTR15 + 0x2F + 8 + read-write + 0xB + 0xFF + + + SSTRL + desc SSTRL + 0x30 + 8 + read-write + 0xB + 0xFF + + + CHMUXR0 + desc CHMUXR0 + 0x38 + 16 + read-write + 0x3210 + 0xFFFF + + + CH00MUX + desc CH00MUX + 3 + 0 + read-write + + + CH01MUX + desc CH01MUX + 7 + 4 + read-write + + + CH02MUX + desc CH02MUX + 11 + 8 + read-write + + + CH03MUX + desc CH03MUX + 15 + 12 + read-write + + + + + CHMUXR1 + desc CHMUXR1 + 0x3A + 16 + read-write + 0x7654 + 0xFFFF + + + CH04MUX + desc CH04MUX + 3 + 0 + read-write + + + CH05MUX + desc CH05MUX + 7 + 4 + read-write + + + CH06MUX + desc CH06MUX + 11 + 8 + read-write + + + CH07MUX + desc CH07MUX + 15 + 12 + read-write + + + + + CHMUXR2 + desc CHMUXR2 + 0x3C + 16 + read-write + 0xBA98 + 0xFFFF + + + CH08MUX + desc CH08MUX + 3 + 0 + read-write + + + CH09MUX + desc CH09MUX + 7 + 4 + read-write + + + CH10MUX + desc CH10MUX + 11 + 8 + read-write + + + CH11MUX + desc CH11MUX + 15 + 12 + read-write + + + + + CHMUXR3 + desc CHMUXR3 + 0x3E + 16 + read-write + 0xFEDC + 0xFFFF + + + CH12MUX + desc CH12MUX + 3 + 0 + read-write + + + CH13MUX + desc CH13MUX + 7 + 4 + read-write + + + CH14MUX + desc CH14MUX + 11 + 8 + read-write + + + CH15MUX + desc CH15MUX + 15 + 12 + read-write + + + + + ISR + desc ISR + 0x44 + 8 + read-only + 0x0 + 0x13 + + + EOCAF + desc EOCAF + 0 + 0 + read-only + + + EOCBF + desc EOCBF + 1 + 1 + read-only + + + SASTPDF + desc SASTPDF + 4 + 4 + read-only + + + + + ICR + desc ICR + 0x45 + 8 + read-write + 0x3 + 0x3 + + + EOCAIEN + desc EOCAIEN + 0 + 0 + read-write + + + EOCBIEN + desc EOCBIEN + 1 + 1 + read-write + + + + + ISCLRR + desc ISCLRR + 0x46 + 8 + write-only + 0x0 + 0x13 + + + CLREOCAF + desc CLREOCAF + 0 + 0 + write-only + + + CLREOCBF + desc CLREOCBF + 1 + 1 + write-only + + + CLRSASTPDF + desc CLRSASTPDF + 4 + 4 + write-only + + + + + DR0 + desc DR0 + 0x50 + 16 + read-only + 0x0 + 0xFFFF + + + DR1 + desc DR1 + 0x52 + 16 + read-only + 0x0 + 0xFFFF + + + DR2 + desc DR2 + 0x54 + 16 + read-only + 0x0 + 0xFFFF + + + DR3 + desc DR3 + 0x56 + 16 + read-only + 0x0 + 0xFFFF + + + DR4 + desc DR4 + 0x58 + 16 + read-only + 0x0 + 0xFFFF + + + DR5 + desc DR5 + 0x5A + 16 + read-only + 0x0 + 0xFFFF + + + DR6 + desc DR6 + 0x5C + 16 + read-only + 0x0 + 0xFFFF + + + DR7 + desc DR7 + 0x5E + 16 + read-only + 0x0 + 0xFFFF + + + DR8 + desc DR8 + 0x60 + 16 + read-only + 0x0 + 0xFFFF + + + DR9 + desc DR9 + 0x62 + 16 + read-only + 0x0 + 0xFFFF + + + DR10 + desc DR10 + 0x64 + 16 + read-only + 0x0 + 0xFFFF + + + DR11 + desc DR11 + 0x66 + 16 + read-only + 0x0 + 0xFFFF + + + DR12 + desc DR12 + 0x68 + 16 + read-only + 0x0 + 0xFFFF + + + DR13 + desc DR13 + 0x6A + 16 + read-only + 0x0 + 0xFFFF + + + DR14 + desc DR14 + 0x6C + 16 + read-only + 0x0 + 0xFFFF + + + DR15 + desc DR15 + 0x6E + 16 + read-only + 0x0 + 0xFFFF + + + DR16 + desc DR16 + 0x70 + 16 + read-only + 0x0 + 0xFFFF + + + DR17 + desc DR17 + 0x72 + 16 + read-only + 0x0 + 0xFFFF + + + DR18 + desc DR18 + 0x74 + 16 + read-only + 0x0 + 0xFFFF + + + DR19 + desc DR19 + 0x76 + 16 + read-only + 0x0 + 0xFFFF + + + AWDCR + desc AWDCR + 0xA0 + 16 + read-write + 0x0 + 0x377 + + + AWD0EN + desc AWD0EN + 0 + 0 + read-write + + + AWD0IEN + desc AWD0IEN + 1 + 1 + read-write + + + AWD0MD + desc AWD0MD + 2 + 2 + read-write + + + AWD1EN + desc AWD1EN + 4 + 4 + read-write + + + AWD1IEN + desc AWD1IEN + 5 + 5 + read-write + + + AWD1MD + desc AWD1MD + 6 + 6 + read-write + + + AWDCM + desc AWDCM + 9 + 8 + read-write + + + + + AWDSR + desc AWDSR + 0xA2 + 8 + read-only + 0x0 + 0x13 + + + AWD0F + desc AWD0F + 0 + 0 + read-only + + + AWD1F + desc AWD1F + 1 + 1 + read-only + + + AWDCMF + desc AWDCMF + 4 + 4 + read-only + + + + + AWDSCLRR + desc AWDSCLRR + 0xA3 + 8 + write-only + 0x0 + 0x13 + + + CLRAWD0F + desc CLRAWD0F + 0 + 0 + write-only + + + CLRAWD1F + desc CLRAWD1F + 1 + 1 + write-only + + + CLRAWDCMF + desc CLRAWDCMF + 4 + 4 + write-only + + + + + AWD0DR0 + desc AWD0DR0 + 0xA4 + 16 + read-write + 0x0 + 0xFFFF + + + AWD0DR1 + desc AWD0DR1 + 0xA6 + 16 + read-write + 0x0 + 0xFFFF + + + AWD0CHSR + desc AWD0CHSR + 0xA8 + 16 + read-write + 0x0 + 0x1F + + + AWDCH + desc AWDCH + 4 + 0 + read-write + + + + + AWD1DR0 + desc AWD1DR0 + 0xAC + 16 + read-write + 0x0 + 0xFFFF + + + AWD1DR1 + desc AWD1DR1 + 0xAE + 16 + read-write + 0x0 + 0xFFFF + + + AWD1CHSR + desc AWD1CHSR + 0xB0 + 16 + read-write + 0x0 + 0x1F + + + AWDCH + desc AWDCH + 4 + 0 + read-write + + + + + + + AES + desc AES + 0x40008000 + + 0x0 + 0x40 + + + + CR + desc CR + 0x0 + 32 + read-write + 0x0 + 0x1B + + + START + desc START + 0 + 0 + read-write + + + MODE + desc MODE + 1 + 1 + read-write + + + KEYSIZE + desc KEYSIZE + 4 + 3 + read-write + + + + + DR0 + desc DR0 + 0x10 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DR1 + desc DR1 + 0x14 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DR2 + desc DR2 + 0x18 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DR3 + desc DR3 + 0x1C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + KR0 + desc KR0 + 0x20 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + KR1 + desc KR1 + 0x24 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + KR2 + desc KR2 + 0x28 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + KR3 + desc KR3 + 0x2C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + KR4 + desc KR4 + 0x30 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + KR5 + desc KR5 + 0x34 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + KR6 + desc KR6 + 0x38 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + KR7 + desc KR7 + 0x3C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + + + AOS + desc AOS + 0x40010800 + + 0x0 + 0x174 + + + + INT_SFTTRG + desc INT_SFTTRG + 0x0 + 32 + write-only + 0x0 + 0x1 + + + STRG + desc STRG + 0 + 0 + write-only + + + + + DCU_1_TRGSEL + desc DCU_1_TRGSEL + 0x4 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + DCU_2_TRGSEL + desc DCU_2_TRGSEL + 0x8 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + DCU_3_TRGSEL + desc DCU_3_TRGSEL + 0xC + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + DCU_4_TRGSEL + desc DCU_4_TRGSEL + 0x10 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + DMA_1_TRGSEL0 + desc DMA_1_TRGSEL0 + 0x14 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + DMA_1_TRGSEL1 + desc DMA_1_TRGSEL1 + 0x18 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + DMA_1_TRGSEL2 + desc DMA_1_TRGSEL2 + 0x1C + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + DMA_1_TRGSEL3 + desc DMA_1_TRGSEL3 + 0x20 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + DMA_1_TRGSEL4 + desc DMA_1_TRGSEL4 + 0x24 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + DMA_1_TRGSEL5 + desc DMA_1_TRGSEL5 + 0x28 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + DMA_1_TRGSEL6 + desc DMA_1_TRGSEL6 + 0x2C + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + DMA_1_TRGSEL7 + desc DMA_1_TRGSEL7 + 0x30 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + DMA_2_TRGSEL0 + desc DMA_2_TRGSEL0 + 0x34 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + DMA_2_TRGSEL1 + desc DMA_2_TRGSEL1 + 0x38 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + DMA_2_TRGSEL2 + desc DMA_2_TRGSEL2 + 0x3C + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + DMA_2_TRGSEL3 + desc DMA_2_TRGSEL3 + 0x40 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + DMA_2_TRGSEL4 + desc DMA_2_TRGSEL4 + 0x44 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + DMA_2_TRGSEL5 + desc DMA_2_TRGSEL5 + 0x48 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + DMA_2_TRGSEL6 + desc DMA_2_TRGSEL6 + 0x4C + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + DMA_2_TRGSEL7 + desc DMA_2_TRGSEL7 + 0x50 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + DMA_TRGSELRC + desc DMA_TRGSELRC + 0x54 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + TMR6_HTSSR1 + desc TMR6_HTSSR1 + 0x58 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + TMR6_HTSSR2 + desc TMR6_HTSSR2 + 0x5C + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + TMR6_HTSSR3 + desc TMR6_HTSSR3 + 0x60 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + TMR6_HTSSR4 + desc TMR6_HTSSR4 + 0x64 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + PORT_PEVNTTRGSR12 + desc PORT_PEVNTTRGSR12 + 0x67 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + PORT_PEVNTTRGSR34 + desc PORT_PEVNTTRGSR34 + 0x6C + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + TMR0_HTSSR + desc TMR0_HTSSR + 0x70 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + TMR2_HTSSR + desc TMR2_HTSSR + 0x74 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + HASH_ITRGSELA + desc HASH_ITRGSELA + 0x78 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + HASH_ITRGSELB + desc HASH_ITRGSELB + 0x7C + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + TMRA_HTSSR0 + desc TMRA_HTSSR0 + 0x80 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + TMRA_HTSSR1 + desc TMRA_HTSSR1 + 0x84 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + TMRA_HTSSR2 + desc TMRA_HTSSR2 + 0x88 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + TMRA_HTSSR3 + desc TMRA_HTSSR3 + 0x8C + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + OTS_TRG + desc OTS_TRG + 0x90 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + ADC_1_ITRGSELR0 + desc ADC_1_ITRGSELR0 + 0x94 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + ADC_1_ITRGSELR1 + desc ADC_1_ITRGSELR1 + 0x98 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + ADC_2_ITRGSELR0 + desc ADC_2_ITRGSELR0 + 0x9C + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + ADC_2_ITRGSELR1 + desc ADC_2_ITRGSELR1 + 0xA0 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + ADC_3_ITRGSELR0 + desc ADC_3_ITRGSELR0 + 0xA4 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + ADC_3_ITRGSELR1 + desc ADC_3_ITRGSELR1 + 0xA8 + 32 + read-write + 0x1FF + 0xC00001FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + COMTRG_EN + desc COMTRG_EN + 31 + 30 + read-write + + + + + COMTRG1 + desc COMTRG1 + 0xAC + 32 + read-write + 0x1FF + 0x1FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + + + COMTRG2 + desc COMTRG2 + 0xB0 + 32 + read-write + 0x1FF + 0x1FF + + + TRGSEL + desc TRGSEL + 8 + 0 + read-write + + + + + GPIO_PEVNTDIRR1 + desc GPIO_PEVNTDIRR1 + 0x100 + 32 + read-write + 0x0 + 0xFFFF + + + PDIR + desc PDIR + 15 + 0 + read-write + + + + + GPIO_PEVNTIDR1 + desc GPIO_PEVNTIDR1 + 0x104 + 32 + read-only + 0x0 + 0xFFFF + + + PIN + desc PIN + 15 + 0 + read-only + + + + + GPIO_PEVNTODR1 + desc GPIO_PEVNTODR1 + 0x108 + 32 + read-write + 0x0 + 0xFFFF + + + POUT + desc POUT + 15 + 0 + read-write + + + + + GPIO_PEVNTORR1 + desc GPIO_PEVNTORR1 + 0x10C + 32 + read-write + 0x0 + 0xFFFF + + + POR + desc POR + 15 + 0 + read-write + + + + + GPIO_PEVNTOSR1 + desc GPIO_PEVNTOSR1 + 0x110 + 32 + read-write + 0x0 + 0xFFFF + + + POS + desc POS + 15 + 0 + read-write + + + + + GPIO_PEVNTRISR1 + desc GPIO_PEVNTRISR1 + 0x114 + 32 + read-write + 0x0 + 0xFFFF + + + RIS + desc RIS + 15 + 0 + read-write + + + + + GPIO_PEVNTFAL1 + desc GPIO_PEVNTFAL1 + 0x118 + 32 + read-write + 0x0 + 0xFFFF + + + FAL + desc FAL + 15 + 0 + read-write + + + + + GPIO_PEVNTDIRR2 + desc GPIO_PEVNTDIRR2 + 0x11C + 32 + read-write + 0x0 + 0xFFFF + + + PDIR + desc PDIR + 15 + 0 + read-write + + + + + GPIO_PEVNTIDR2 + desc GPIO_PEVNTIDR2 + 0x120 + 32 + read-only + 0x0 + 0xFFFF + + + PIN + desc PIN + 15 + 0 + read-only + + + + + GPIO_PEVNTODR2 + desc GPIO_PEVNTODR2 + 0x124 + 32 + read-write + 0x0 + 0xFFFF + + + POUT + desc POUT + 15 + 0 + read-write + + + + + GPIO_PEVNTORR2 + desc GPIO_PEVNTORR2 + 0x128 + 32 + read-write + 0x0 + 0xFFFF + + + POR + desc POR + 15 + 0 + read-write + + + + + GPIO_PEVNTOSR2 + desc GPIO_PEVNTOSR2 + 0x12C + 32 + read-write + 0x0 + 0xFFFF + + + POS + desc POS + 15 + 0 + read-write + + + + + GPIO_PEVNTRISR2 + desc GPIO_PEVNTRISR2 + 0x130 + 32 + read-write + 0x0 + 0xFFFF + + + RIS + desc RIS + 15 + 0 + read-write + + + + + GPIO_PEVNTFAL2 + desc GPIO_PEVNTFAL2 + 0x134 + 32 + read-write + 0x0 + 0xFFFF + + + FAL + desc FAL + 15 + 0 + read-write + + + + + GPIO_PEVNTDIRR3 + desc GPIO_PEVNTDIRR3 + 0x138 + 32 + read-write + 0x0 + 0xFFFF + + + PDIR + desc PDIR + 15 + 0 + read-write + + + + + GPIO_PEVNTIDR3 + desc GPIO_PEVNTIDR3 + 0x13C + 32 + read-only + 0x0 + 0xFFFF + + + PIN + desc PIN + 15 + 0 + read-only + + + + + GPIO_PEVNTODR3 + desc GPIO_PEVNTODR3 + 0x140 + 32 + read-write + 0x0 + 0xFFFF + + + POUT + desc POUT + 15 + 0 + read-write + + + + + GPIO_PEVNTORR3 + desc GPIO_PEVNTORR3 + 0x144 + 32 + read-write + 0x0 + 0xFFFF + + + POR + desc POR + 15 + 0 + read-write + + + + + GPIO_PEVNTOSR3 + desc GPIO_PEVNTOSR3 + 0x148 + 32 + read-write + 0x0 + 0xFFFF + + + POS + desc POS + 15 + 0 + read-write + + + + + GPIO_PEVNTRISR3 + desc GPIO_PEVNTRISR3 + 0x14C + 32 + read-write + 0x0 + 0xFFFF + + + RIS + desc RIS + 15 + 0 + read-write + + + + + GPIO_PEVNTFAL3 + desc GPIO_PEVNTFAL3 + 0x150 + 32 + read-write + 0x0 + 0xFFFF + + + FAL + desc FAL + 15 + 0 + read-write + + + + + GPIO_PEVNTDIRR4 + desc GPIO_PEVNTDIRR4 + 0x154 + 32 + read-write + 0x0 + 0xFFFF + + + PDIR + desc PDIR + 15 + 0 + read-write + + + + + GPIO_PEVNTIDR4 + desc GPIO_PEVNTIDR4 + 0x158 + 32 + read-only + 0x0 + 0xFFFF + + + PIN + desc PIN + 15 + 0 + read-only + + + + + GPIO_PEVNTODR4 + desc GPIO_PEVNTODR4 + 0x15C + 32 + read-write + 0x0 + 0xFFFF + + + POUT + desc POUT + 15 + 0 + read-write + + + + + GPIO_PEVNTORR4 + desc GPIO_PEVNTORR4 + 0x160 + 32 + read-write + 0x0 + 0xFFFF + + + POR + desc POR + 15 + 0 + read-write + + + + + GPIO_PEVNTOSR4 + desc GPIO_PEVNTOSR4 + 0x164 + 32 + read-write + 0x0 + 0xFFFF + + + POS + desc POS + 15 + 0 + read-write + + + + + GPIO_PEVNTRISR4 + desc GPIO_PEVNTRISR4 + 0x168 + 32 + read-write + 0x0 + 0xFFFF + + + RIS + desc RIS + 15 + 0 + read-write + + + + + GPIO_PEVNTFAL4 + desc GPIO_PEVNTFAL4 + 0x16C + 32 + read-write + 0x0 + 0xFFFF + + + FAL + desc FAL + 15 + 0 + read-write + + + + + GPIO_PEVNTNFCR + desc GPIO_PEVNTNFCR + 0x170 + 32 + read-write + 0x0 + 0x7070707 + + + NFEN1 + desc NFEN1 + 0 + 0 + read-write + + + DIVS1 + desc DIVS1 + 2 + 1 + read-write + + + NFEN2 + desc NFEN2 + 8 + 8 + read-write + + + DIVS2 + desc DIVS2 + 10 + 9 + read-write + + + NFEN3 + desc NFEN3 + 16 + 16 + read-write + + + DIVS3 + desc DIVS3 + 18 + 17 + read-write + + + NFEN4 + desc NFEN4 + 24 + 24 + read-write + + + DIVS4 + desc DIVS4 + 26 + 25 + read-write + + + + + + + CAN1 + desc CAN1 + 0x40009000 + + 0x0 + 0xCA + + + + RBUF + desc RBUF + 0x0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + TBUF + desc TBUF + 0x50 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + CFG_STAT + desc CFG_STAT + 0xA0 + 8 + read-write + 0x80 + 0xFF + + + BUSOFF + desc BUSOFF + 0 + 0 + read-write + + + TACTIVE + desc TACTIVE + 1 + 1 + read-only + + + RACTIVE + desc RACTIVE + 2 + 2 + read-only + + + TSSS + desc TSSS + 3 + 3 + read-write + + + TPSS + desc TPSS + 4 + 4 + read-write + + + LBMI + desc LBMI + 5 + 5 + read-write + + + LBME + desc LBME + 6 + 6 + read-write + + + RESET + desc RESET + 7 + 7 + read-write + + + + + TCMD + desc TCMD + 0xA1 + 8 + read-write + 0x0 + 0xDF + + + TSA + desc TSA + 0 + 0 + read-write + + + TSALL + desc TSALL + 1 + 1 + read-write + + + TSONE + desc TSONE + 2 + 2 + read-write + + + TPA + desc TPA + 3 + 3 + read-write + + + TPE + desc TPE + 4 + 4 + read-write + + + LOM + desc LOM + 6 + 6 + read-write + + + TBSEL + desc TBSEL + 7 + 7 + read-write + + + + + TCTRL + desc TCTRL + 0xA2 + 8 + read-only + 0x90 + 0xF3 + + + TSSTAT + desc TSSTAT + 1 + 0 + read-only + + + TTTBM + desc TTTBM + 4 + 4 + read-write + + + TSMODE + desc TSMODE + 5 + 5 + read-write + + + TSNEXT + desc TSNEXT + 6 + 6 + read-write + + + FD_ISO + desc FD_ISO + 7 + 7 + read-write + + + + + RCTRL + desc RCTRL + 0xA3 + 8 + read-only + 0x0 + 0xFB + + + RSTAT + desc RSTAT + 1 + 0 + read-only + + + RBALL + desc RBALL + 3 + 3 + read-write + + + RREL + desc RREL + 4 + 4 + read-write + + + ROV + desc ROV + 5 + 5 + read-only + + + ROM + desc ROM + 6 + 6 + read-write + + + SACK + desc SACK + 7 + 7 + read-write + + + + + RTIE + desc RTIE + 0xA4 + 8 + read-only + 0xFE + 0xFF + + + TSFF + desc TSFF + 0 + 0 + read-only + + + EIE + desc EIE + 1 + 1 + read-write + + + TSIE + desc TSIE + 2 + 2 + read-write + + + TPIE + desc TPIE + 3 + 3 + read-write + + + RAFIE + desc RAFIE + 4 + 4 + read-write + + + RFIE + desc RFIE + 5 + 5 + read-write + + + ROIE + desc ROIE + 6 + 6 + read-write + + + RIE + desc RIE + 7 + 7 + read-write + + + + + RTIF + desc RTIF + 0xA5 + 8 + read-write + 0x0 + 0xFF + + + AIF + desc AIF + 0 + 0 + read-write + + + EIF + desc EIF + 1 + 1 + read-write + + + TSIF + desc TSIF + 2 + 2 + read-write + + + TPIF + desc TPIF + 3 + 3 + read-write + + + RAFIF + desc RAFIF + 4 + 4 + read-write + + + RFIF + desc RFIF + 5 + 5 + read-write + + + ROIF + desc ROIF + 6 + 6 + read-write + + + RIF + desc RIF + 7 + 7 + read-write + + + + + ERRINT + desc ERRINT + 0xA6 + 8 + read-write + 0x0 + 0xFF + + + BEIF + desc BEIF + 0 + 0 + read-write + + + BEIE + desc BEIE + 1 + 1 + read-write + + + ALIF + desc ALIF + 2 + 2 + read-write + + + ALIE + desc ALIE + 3 + 3 + read-write + + + EPIF + desc EPIF + 4 + 4 + read-write + + + EPIE + desc EPIE + 5 + 5 + read-write + + + EPASS + desc EPASS + 6 + 6 + read-only + + + EWARN + desc EWARN + 7 + 7 + read-only + + + + + LIMIT + desc LIMIT + 0xA7 + 8 + read-write + 0x1B + 0xFF + + + EWL + desc EWL + 3 + 0 + read-write + + + AFWL + desc AFWL + 7 + 4 + read-write + + + + + SBT + desc SBT + 0xA8 + 32 + read-write + 0x1020203 + 0xFF7F7FFF + + + S_SEG_1 + desc S_SEG_1 + 7 + 0 + read-write + + + S_SEG_2 + desc S_SEG_2 + 14 + 8 + read-write + + + S_SJW + desc S_SJW + 22 + 16 + read-write + + + S_PRESC + desc S_PRESC + 31 + 24 + read-write + + + + + FBT + desc FBT + 0xAC + 32 + read-write + 0x1020203 + 0xFF0F0F1F + + + F_SEG_1 + desc F_SEG_1 + 4 + 0 + read-write + + + F_SEG_2 + desc F_SEG_2 + 11 + 8 + read-write + + + F_SJW + desc F_SJW + 19 + 16 + read-write + + + F_PRESC + desc F_PRESC + 31 + 24 + read-write + + + + + EALCAP + desc EALCAP + 0xB0 + 8 + read-only + 0x0 + 0xFF + + + ALC + desc ALC + 4 + 0 + read-only + + + KOER + desc KOER + 7 + 5 + read-only + + + + + TDC + desc TDC + 0xB1 + 8 + read-write + 0x0 + 0xFF + + + SSPOFF + desc SSPOFF + 6 + 0 + read-write + + + TDCEN + desc TDCEN + 7 + 7 + read-write + + + + + RECNT + desc RECNT + 0xB2 + 8 + read-write + 0x0 + 0xFF + + + TECNT + desc TECNT + 0xB3 + 8 + read-write + 0x0 + 0xFF + + + ACFCTRL + desc ACFCTRL + 0xB4 + 8 + read-write + 0x0 + 0x2F + + + ACFADR + desc ACFADR + 3 + 0 + read-write + + + SELMASK + desc SELMASK + 5 + 5 + read-write + + + + + ACFEN + desc ACFEN + 0xB6 + 16 + read-write + 0x1 + 0xFFFF + + + AE_1 + desc AE_1 + 0 + 0 + read-write + + + AE_2 + desc AE_2 + 1 + 1 + read-write + + + AE_3 + desc AE_3 + 2 + 2 + read-write + + + AE_4 + desc AE_4 + 3 + 3 + read-write + + + AE_5 + desc AE_5 + 4 + 4 + read-write + + + AE_6 + desc AE_6 + 5 + 5 + read-write + + + AE_7 + desc AE_7 + 6 + 6 + read-write + + + AE_8 + desc AE_8 + 7 + 7 + read-write + + + AE_9 + desc AE_9 + 8 + 8 + read-write + + + AE_10 + desc AE_10 + 9 + 9 + read-write + + + AE_11 + desc AE_11 + 10 + 10 + read-write + + + AE_12 + desc AE_12 + 11 + 11 + read-write + + + AE_13 + desc AE_13 + 12 + 12 + read-write + + + AE_14 + desc AE_14 + 13 + 13 + read-write + + + AE_15 + desc AE_15 + 14 + 14 + read-write + + + AE_16 + desc AE_16 + 15 + 15 + read-write + + + + + ACF + desc ACF + 0xB8 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + ACODEORAMASK + desc ACODEORAMASK + 28 + 0 + read-write + + + AIDE + desc AIDE + 29 + 29 + read-write + + + AIDEE + desc AIDEE + 30 + 30 + read-write + + + + + TBSLOT + desc TBSLOT + 0xBE + 8 + read-write + 0x0 + 0xFF + + + TBPTR + desc TBPTR + 5 + 0 + read-write + + + TBF + desc TBF + 6 + 6 + read-write + + + TBE + desc TBE + 7 + 7 + read-write + + + + + TTCFG + desc TTCFG + 0xBF + 8 + read-write + 0x90 + 0xFF + + + TTEN + desc TTEN + 0 + 0 + read-write + + + T_PRESC + desc T_PRESC + 2 + 1 + read-write + + + TTIF + desc TTIF + 3 + 3 + read-write + + + TTIE + desc TTIE + 4 + 4 + read-write + + + TEIF + desc TEIF + 5 + 5 + read-write + + + WTIF + desc WTIF + 6 + 6 + read-write + + + WTIE + desc WTIE + 7 + 7 + read-write + + + + + REF_MSG + desc REF_MSG + 0xC0 + 32 + read-write + 0x0 + 0x9FFFFFFF + + + REF_ID + desc REF_ID + 28 + 0 + read-write + + + REF_IDE + desc REF_IDE + 31 + 31 + read-write + + + + + TRG_CFG + desc TRG_CFG + 0xC4 + 16 + read-write + 0x0 + 0xF73F + + + TTPTR + desc TTPTR + 5 + 0 + read-write + + + TTYPE + desc TTYPE + 10 + 8 + read-write + + + TEW + desc TEW + 15 + 12 + read-write + + + + + TT_TRIG + desc TT_TRIG + 0xC6 + 16 + read-write + 0x0 + 0xFFFF + + + TT_WTRIG + desc TT_WTRIG + 0xC8 + 16 + read-write + 0xFFFF + 0xFFFF + + + + + CAN2 + desc CAN2 + 0x40078000 + + 0x0 + 0xCA + + + + RBUF + desc RBUF + 0x0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + TBUF + desc TBUF + 0x50 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + CFG_STAT + desc CFG_STAT + 0xA0 + 8 + read-write + 0x80 + 0xFF + + + BUSOFF + desc BUSOFF + 0 + 0 + read-write + + + TACTIVE + desc TACTIVE + 1 + 1 + read-only + + + RACTIVE + desc RACTIVE + 2 + 2 + read-only + + + TSSS + desc TSSS + 3 + 3 + read-write + + + TPSS + desc TPSS + 4 + 4 + read-write + + + LBMI + desc LBMI + 5 + 5 + read-write + + + LBME + desc LBME + 6 + 6 + read-write + + + RESET + desc RESET + 7 + 7 + read-write + + + + + TCMD + desc TCMD + 0xA1 + 8 + read-write + 0x0 + 0xDF + + + TSA + desc TSA + 0 + 0 + read-write + + + TSALL + desc TSALL + 1 + 1 + read-write + + + TSONE + desc TSONE + 2 + 2 + read-write + + + TPA + desc TPA + 3 + 3 + read-write + + + TPE + desc TPE + 4 + 4 + read-write + + + LOM + desc LOM + 6 + 6 + read-write + + + TBSEL + desc TBSEL + 7 + 7 + read-write + + + + + TCTRL + desc TCTRL + 0xA2 + 8 + read-only + 0x90 + 0xF3 + + + TSSTAT + desc TSSTAT + 1 + 0 + read-only + + + TTTBM + desc TTTBM + 4 + 4 + read-write + + + TSMODE + desc TSMODE + 5 + 5 + read-write + + + TSNEXT + desc TSNEXT + 6 + 6 + read-write + + + FD_ISO + desc FD_ISO + 7 + 7 + read-write + + + + + RCTRL + desc RCTRL + 0xA3 + 8 + read-only + 0x0 + 0xFB + + + RSTAT + desc RSTAT + 1 + 0 + read-only + + + RBALL + desc RBALL + 3 + 3 + read-write + + + RREL + desc RREL + 4 + 4 + read-write + + + ROV + desc ROV + 5 + 5 + read-only + + + ROM + desc ROM + 6 + 6 + read-write + + + SACK + desc SACK + 7 + 7 + read-write + + + + + RTIE + desc RTIE + 0xA4 + 8 + read-only + 0xFE + 0xFF + + + TSFF + desc TSFF + 0 + 0 + read-only + + + EIE + desc EIE + 1 + 1 + read-write + + + TSIE + desc TSIE + 2 + 2 + read-write + + + TPIE + desc TPIE + 3 + 3 + read-write + + + RAFIE + desc RAFIE + 4 + 4 + read-write + + + RFIE + desc RFIE + 5 + 5 + read-write + + + ROIE + desc ROIE + 6 + 6 + read-write + + + RIE + desc RIE + 7 + 7 + read-write + + + + + RTIF + desc RTIF + 0xA5 + 8 + read-write + 0x0 + 0xFF + + + AIF + desc AIF + 0 + 0 + read-write + + + EIF + desc EIF + 1 + 1 + read-write + + + TSIF + desc TSIF + 2 + 2 + read-write + + + TPIF + desc TPIF + 3 + 3 + read-write + + + RAFIF + desc RAFIF + 4 + 4 + read-write + + + RFIF + desc RFIF + 5 + 5 + read-write + + + ROIF + desc ROIF + 6 + 6 + read-write + + + RIF + desc RIF + 7 + 7 + read-write + + + + + ERRINT + desc ERRINT + 0xA6 + 8 + read-write + 0x0 + 0xFF + + + BEIF + desc BEIF + 0 + 0 + read-write + + + BEIE + desc BEIE + 1 + 1 + read-write + + + ALIF + desc ALIF + 2 + 2 + read-write + + + ALIE + desc ALIE + 3 + 3 + read-write + + + EPIF + desc EPIF + 4 + 4 + read-write + + + EPIE + desc EPIE + 5 + 5 + read-write + + + EPASS + desc EPASS + 6 + 6 + read-only + + + EWARN + desc EWARN + 7 + 7 + read-only + + + + + LIMIT + desc LIMIT + 0xA7 + 8 + read-write + 0x1B + 0xFF + + + EWL + desc EWL + 3 + 0 + read-write + + + AFWL + desc AFWL + 7 + 4 + read-write + + + + + SBT + desc SBT + 0xA8 + 32 + read-write + 0x1020203 + 0xFF7F7FFF + + + S_SEG_1 + desc S_SEG_1 + 7 + 0 + read-write + + + S_SEG_2 + desc S_SEG_2 + 14 + 8 + read-write + + + S_SJW + desc S_SJW + 22 + 16 + read-write + + + S_PRESC + desc S_PRESC + 31 + 24 + read-write + + + + + FBT + desc FBT + 0xAC + 32 + read-write + 0x1020203 + 0xFF0F0F1F + + + F_SEG_1 + desc F_SEG_1 + 4 + 0 + read-write + + + F_SEG_2 + desc F_SEG_2 + 11 + 8 + read-write + + + F_SJW + desc F_SJW + 19 + 16 + read-write + + + F_PRESC + desc F_PRESC + 31 + 24 + read-write + + + + + EALCAP + desc EALCAP + 0xB0 + 8 + read-only + 0x0 + 0xFF + + + ALC + desc ALC + 4 + 0 + read-only + + + KOER + desc KOER + 7 + 5 + read-only + + + + + TDC + desc TDC + 0xB1 + 8 + read-write + 0x0 + 0xFF + + + SSPOFF + desc SSPOFF + 6 + 0 + read-write + + + TDCEN + desc TDCEN + 7 + 7 + read-write + + + + + RECNT + desc RECNT + 0xB2 + 8 + read-write + 0x0 + 0xFF + + + TECNT + desc TECNT + 0xB3 + 8 + read-write + 0x0 + 0xFF + + + ACFCTRL + desc ACFCTRL + 0xB4 + 8 + read-write + 0x0 + 0x2F + + + ACFADR + desc ACFADR + 3 + 0 + read-write + + + SELMASK + desc SELMASK + 5 + 5 + read-write + + + + + ACFEN + desc ACFEN + 0xB6 + 16 + read-write + 0x1 + 0xFFFF + + + AE_1 + desc AE_1 + 0 + 0 + read-write + + + AE_2 + desc AE_2 + 1 + 1 + read-write + + + AE_3 + desc AE_3 + 2 + 2 + read-write + + + AE_4 + desc AE_4 + 3 + 3 + read-write + + + AE_5 + desc AE_5 + 4 + 4 + read-write + + + AE_6 + desc AE_6 + 5 + 5 + read-write + + + AE_7 + desc AE_7 + 6 + 6 + read-write + + + AE_8 + desc AE_8 + 7 + 7 + read-write + + + AE_9 + desc AE_9 + 8 + 8 + read-write + + + AE_10 + desc AE_10 + 9 + 9 + read-write + + + AE_11 + desc AE_11 + 10 + 10 + read-write + + + AE_12 + desc AE_12 + 11 + 11 + read-write + + + AE_13 + desc AE_13 + 12 + 12 + read-write + + + AE_14 + desc AE_14 + 13 + 13 + read-write + + + AE_15 + desc AE_15 + 14 + 14 + read-write + + + AE_16 + desc AE_16 + 15 + 15 + read-write + + + + + ACF + desc ACF + 0xB8 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + ACODEORAMASK + desc ACODEORAMASK + 28 + 0 + read-write + + + AIDE + desc AIDE + 29 + 29 + read-write + + + AIDEE + desc AIDEE + 30 + 30 + read-write + + + + + TBSLOT + desc TBSLOT + 0xBE + 8 + read-write + 0x0 + 0xFF + + + TBPTR + desc TBPTR + 5 + 0 + read-write + + + TBF + desc TBF + 6 + 6 + read-write + + + TBE + desc TBE + 7 + 7 + read-write + + + + + TTCFG + desc TTCFG + 0xBF + 8 + read-write + 0x90 + 0xFF + + + TTEN + desc TTEN + 0 + 0 + read-write + + + T_PRESC + desc T_PRESC + 2 + 1 + read-write + + + TTIF + desc TTIF + 3 + 3 + read-write + + + TTIE + desc TTIE + 4 + 4 + read-write + + + TEIF + desc TEIF + 5 + 5 + read-write + + + WTIF + desc WTIF + 6 + 6 + read-write + + + WTIE + desc WTIE + 7 + 7 + read-write + + + + + REF_MSG + desc REF_MSG + 0xC0 + 32 + read-write + 0x0 + 0x9FFFFFFF + + + REF_ID + desc REF_ID + 28 + 0 + read-write + + + REF_IDE + desc REF_IDE + 31 + 31 + read-write + + + + + TRG_CFG + desc TRG_CFG + 0xC4 + 16 + read-write + 0x0 + 0xF73F + + + TTPTR + desc TTPTR + 5 + 0 + read-write + + + TTYPE + desc TTYPE + 10 + 8 + read-write + + + TEW + desc TEW + 15 + 12 + read-write + + + + + TT_TRIG + desc TT_TRIG + 0xC6 + 16 + read-write + 0x0 + 0xFFFF + + + TT_WTRIG + desc TT_WTRIG + 0xC8 + 16 + read-write + 0xFFFF + 0xFFFF + + + + + CMP1 + desc CMP1 + 0x4004A000 + + 0x0 + 0xA + + + + MDR + desc MDR + 0x0 + 8 + read-write + 0x0 + 0x83 + + + CENB + desc CENB + 0 + 0 + read-write + + + CWDE + desc CWDE + 1 + 1 + read-write + + + CMON + desc CMON + 7 + 7 + read-only + + + + + FIR + desc FIR + 0x1 + 8 + read-write + 0x0 + 0x73 + + + FCKS + desc FCKS + 1 + 0 + read-write + + + EDGS + desc EDGS + 5 + 4 + read-write + + + CIEN + desc CIEN + 6 + 6 + read-write + + + + + OCR + desc OCR + 0x2 + 8 + read-write + 0x0 + 0x1F + + + COEN + desc COEN + 0 + 0 + read-write + + + COPS + desc COPS + 1 + 1 + read-write + + + CPOE + desc CPOE + 2 + 2 + read-write + + + TWOE + desc TWOE + 3 + 3 + read-write + + + TWOL + desc TWOL + 4 + 4 + read-write + + + + + PMSR + desc PMSR + 0x3 + 8 + read-write + 0x0 + 0xFF + + + RVSL + desc RVSL + 3 + 0 + read-write + + + CVSL + desc CVSL + 7 + 4 + read-write + + + + + TWSR + desc TWSR + 0x4 + 16 + read-write + 0x0 + 0xFFFF + + + CTWS0 + desc CTWS0 + 0 + 0 + read-write + + + CTWS1 + desc CTWS1 + 1 + 1 + read-write + + + CTWS2 + desc CTWS2 + 2 + 2 + read-write + + + CTWS3 + desc CTWS3 + 3 + 3 + read-write + + + CTWS4 + desc CTWS4 + 4 + 4 + read-write + + + CTWS5 + desc CTWS5 + 5 + 5 + read-write + + + CTWS6 + desc CTWS6 + 6 + 6 + read-write + + + CTWS7 + desc CTWS7 + 7 + 7 + read-write + + + CTWS8 + desc CTWS8 + 8 + 8 + read-write + + + CTWS9 + desc CTWS9 + 9 + 9 + read-write + + + CTWS10 + desc CTWS10 + 10 + 10 + read-write + + + CTWS11 + desc CTWS11 + 11 + 11 + read-write + + + CTWS12 + desc CTWS12 + 12 + 12 + read-write + + + CTWS13 + desc CTWS13 + 13 + 13 + read-write + + + CTWS14 + desc CTWS14 + 14 + 14 + read-write + + + CTWS15 + desc CTWS15 + 15 + 15 + read-write + + + + + TWPR + desc TWPR + 0x6 + 16 + read-write + 0x0 + 0xFFFF + + + CTWP0 + desc CTWP0 + 0 + 0 + read-write + + + CTWP1 + desc CTWP1 + 1 + 1 + read-write + + + CTWP2 + desc CTWP2 + 2 + 2 + read-write + + + CTWP3 + desc CTWP3 + 3 + 3 + read-write + + + CTWP4 + desc CTWP4 + 4 + 4 + read-write + + + CTWP5 + desc CTWP5 + 5 + 5 + read-write + + + CTWP6 + desc CTWP6 + 6 + 6 + read-write + + + CTWP7 + desc CTWP7 + 7 + 7 + read-write + + + CTWP8 + desc CTWP8 + 8 + 8 + read-write + + + CTWP9 + desc CTWP9 + 9 + 9 + read-write + + + CTWP10 + desc CTWP10 + 10 + 10 + read-write + + + CTWP11 + desc CTWP11 + 11 + 11 + read-write + + + CTWP12 + desc CTWP12 + 12 + 12 + read-write + + + CTWP13 + desc CTWP13 + 13 + 13 + read-write + + + CTWP14 + desc CTWP14 + 14 + 14 + read-write + + + CTWP15 + desc CTWP15 + 15 + 15 + read-write + + + + + VISR + desc VISR + 0x8 + 16 + read-write + 0x0 + 0x37 + + + P2SL + desc P2SL + 2 + 0 + read-write + + + P3SL + desc P3SL + 5 + 4 + read-write + + + + + + + CMP2 + desc CMP2 + 0x4004A010 + + 0x0 + 0x8 + + + + MDR + desc MDR + 0x0 + 8 + read-write + 0x0 + 0x83 + + + CENB + desc CENB + 0 + 0 + read-write + + + CWDE + desc CWDE + 1 + 1 + read-write + + + CMON + desc CMON + 7 + 7 + read-only + + + + + FIR + desc FIR + 0x1 + 8 + read-write + 0x0 + 0x73 + + + FCKS + desc FCKS + 1 + 0 + read-write + + + EDGS + desc EDGS + 5 + 4 + read-write + + + CIEN + desc CIEN + 6 + 6 + read-write + + + + + OCR + desc OCR + 0x2 + 8 + read-write + 0x0 + 0x1F + + + COEN + desc COEN + 0 + 0 + read-write + + + COPS + desc COPS + 1 + 1 + read-write + + + CPOE + desc CPOE + 2 + 2 + read-write + + + TWOE + desc TWOE + 3 + 3 + read-write + + + TWOL + desc TWOL + 4 + 4 + read-write + + + + + PMSR + desc PMSR + 0x3 + 8 + read-write + 0x0 + 0xFF + + + RVSL + desc RVSL + 3 + 0 + read-write + + + CVSL + desc CVSL + 7 + 4 + read-write + + + + + TWSR + desc TWSR + 0x4 + 16 + read-write + 0x0 + 0xFFFF + + + CTWS0 + desc CTWS0 + 0 + 0 + read-write + + + CTWS1 + desc CTWS1 + 1 + 1 + read-write + + + CTWS2 + desc CTWS2 + 2 + 2 + read-write + + + CTWS3 + desc CTWS3 + 3 + 3 + read-write + + + CTWS4 + desc CTWS4 + 4 + 4 + read-write + + + CTWS5 + desc CTWS5 + 5 + 5 + read-write + + + CTWS6 + desc CTWS6 + 6 + 6 + read-write + + + CTWS7 + desc CTWS7 + 7 + 7 + read-write + + + CTWS8 + desc CTWS8 + 8 + 8 + read-write + + + CTWS9 + desc CTWS9 + 9 + 9 + read-write + + + CTWS10 + desc CTWS10 + 10 + 10 + read-write + + + CTWS11 + desc CTWS11 + 11 + 11 + read-write + + + CTWS12 + desc CTWS12 + 12 + 12 + read-write + + + CTWS13 + desc CTWS13 + 13 + 13 + read-write + + + CTWS14 + desc CTWS14 + 14 + 14 + read-write + + + CTWS15 + desc CTWS15 + 15 + 15 + read-write + + + + + TWPR + desc TWPR + 0x6 + 16 + read-write + 0x0 + 0xFFFF + + + CTWP0 + desc CTWP0 + 0 + 0 + read-write + + + CTWP1 + desc CTWP1 + 1 + 1 + read-write + + + CTWP2 + desc CTWP2 + 2 + 2 + read-write + + + CTWP3 + desc CTWP3 + 3 + 3 + read-write + + + CTWP4 + desc CTWP4 + 4 + 4 + read-write + + + CTWP5 + desc CTWP5 + 5 + 5 + read-write + + + CTWP6 + desc CTWP6 + 6 + 6 + read-write + + + CTWP7 + desc CTWP7 + 7 + 7 + read-write + + + CTWP8 + desc CTWP8 + 8 + 8 + read-write + + + CTWP9 + desc CTWP9 + 9 + 9 + read-write + + + CTWP10 + desc CTWP10 + 10 + 10 + read-write + + + CTWP11 + desc CTWP11 + 11 + 11 + read-write + + + CTWP12 + desc CTWP12 + 12 + 12 + read-write + + + CTWP13 + desc CTWP13 + 13 + 13 + read-write + + + CTWP14 + desc CTWP14 + 14 + 14 + read-write + + + CTWP15 + desc CTWP15 + 15 + 15 + read-write + + + + + + + CMP3 + desc CMP3 + 0x4004A400 + + 0x0 + 0xA + + + + MDR + desc MDR + 0x0 + 8 + read-write + 0x0 + 0x81 + + + CENB + desc CENB + 0 + 0 + read-write + + + CMON + desc CMON + 7 + 7 + read-only + + + + + FIR + desc FIR + 0x1 + 8 + read-write + 0x0 + 0x73 + + + FCKS + desc FCKS + 1 + 0 + read-write + + + EDGS + desc EDGS + 5 + 4 + read-write + + + CIEN + desc CIEN + 6 + 6 + read-write + + + + + OCR + desc OCR + 0x2 + 8 + read-write + 0x0 + 0x1F + + + COEN + desc COEN + 0 + 0 + read-write + + + COPS + desc COPS + 1 + 1 + read-write + + + CPOE + desc CPOE + 2 + 2 + read-write + + + TWOE + desc TWOE + 3 + 3 + read-write + + + TWOL + desc TWOL + 4 + 4 + read-write + + + + + PMSR + desc PMSR + 0x3 + 8 + read-write + 0x0 + 0xFF + + + RVSL + desc RVSL + 3 + 0 + read-write + + + CVSL + desc CVSL + 7 + 4 + read-write + + + + + TWSR + desc TWSR + 0x4 + 16 + read-write + 0x0 + 0xFFFF + + + CTWS0 + desc CTWS0 + 0 + 0 + read-write + + + CTWS1 + desc CTWS1 + 1 + 1 + read-write + + + CTWS2 + desc CTWS2 + 2 + 2 + read-write + + + CTWS3 + desc CTWS3 + 3 + 3 + read-write + + + CTWS4 + desc CTWS4 + 4 + 4 + read-write + + + CTWS5 + desc CTWS5 + 5 + 5 + read-write + + + CTWS6 + desc CTWS6 + 6 + 6 + read-write + + + CTWS7 + desc CTWS7 + 7 + 7 + read-write + + + CTWS8 + desc CTWS8 + 8 + 8 + read-write + + + CTWS9 + desc CTWS9 + 9 + 9 + read-write + + + CTWS10 + desc CTWS10 + 10 + 10 + read-write + + + CTWS11 + desc CTWS11 + 11 + 11 + read-write + + + CTWS12 + desc CTWS12 + 12 + 12 + read-write + + + CTWS13 + desc CTWS13 + 13 + 13 + read-write + + + CTWS14 + desc CTWS14 + 14 + 14 + read-write + + + CTWS15 + desc CTWS15 + 15 + 15 + read-write + + + + + TWPR + desc TWPR + 0x6 + 16 + read-write + 0x0 + 0xFFFF + + + CTWP0 + desc CTWP0 + 0 + 0 + read-write + + + CTWP1 + desc CTWP1 + 1 + 1 + read-write + + + CTWP2 + desc CTWP2 + 2 + 2 + read-write + + + CTWP3 + desc CTWP3 + 3 + 3 + read-write + + + CTWP4 + desc CTWP4 + 4 + 4 + read-write + + + CTWP5 + desc CTWP5 + 5 + 5 + read-write + + + CTWP6 + desc CTWP6 + 6 + 6 + read-write + + + CTWP7 + desc CTWP7 + 7 + 7 + read-write + + + CTWP8 + desc CTWP8 + 8 + 8 + read-write + + + CTWP9 + desc CTWP9 + 9 + 9 + read-write + + + CTWP10 + desc CTWP10 + 10 + 10 + read-write + + + CTWP11 + desc CTWP11 + 11 + 11 + read-write + + + CTWP12 + desc CTWP12 + 12 + 12 + read-write + + + CTWP13 + desc CTWP13 + 13 + 13 + read-write + + + CTWP14 + desc CTWP14 + 14 + 14 + read-write + + + CTWP15 + desc CTWP15 + 15 + 15 + read-write + + + + + VISR + desc VISR + 0x8 + 16 + read-write + 0x0 + 0x37 + + + P2SL + desc P2SL + 2 + 0 + read-write + + + P3SL + desc P3SL + 5 + 4 + read-write + + + + + + + CMP4 + desc CMP4 + 0x4004A410 + + 0x0 + 0x8 + + + + MDR + desc MDR + 0x0 + 8 + read-write + 0x0 + 0x83 + + + CENB + desc CENB + 0 + 0 + read-write + + + CWDE + desc CWDE + 1 + 1 + read-write + + + CMON + desc CMON + 7 + 7 + read-only + + + + + FIR + desc FIR + 0x1 + 8 + read-write + 0x0 + 0x73 + + + FCKS + desc FCKS + 1 + 0 + read-write + + + EDGS + desc EDGS + 5 + 4 + read-write + + + CIEN + desc CIEN + 6 + 6 + read-write + + + + + OCR + desc OCR + 0x2 + 8 + read-write + 0x0 + 0x1F + + + COEN + desc COEN + 0 + 0 + read-write + + + COPS + desc COPS + 1 + 1 + read-write + + + CPOE + desc CPOE + 2 + 2 + read-write + + + TWOE + desc TWOE + 3 + 3 + read-write + + + TWOL + desc TWOL + 4 + 4 + read-write + + + + + PMSR + desc PMSR + 0x3 + 8 + read-write + 0x0 + 0xFF + + + RVSL + desc RVSL + 3 + 0 + read-write + + + CVSL + desc CVSL + 7 + 4 + read-write + + + + + TWSR + desc TWSR + 0x4 + 16 + read-write + 0x0 + 0xFFFF + + + CTWS0 + desc CTWS0 + 0 + 0 + read-write + + + CTWS1 + desc CTWS1 + 1 + 1 + read-write + + + CTWS2 + desc CTWS2 + 2 + 2 + read-write + + + CTWS3 + desc CTWS3 + 3 + 3 + read-write + + + CTWS4 + desc CTWS4 + 4 + 4 + read-write + + + CTWS5 + desc CTWS5 + 5 + 5 + read-write + + + CTWS6 + desc CTWS6 + 6 + 6 + read-write + + + CTWS7 + desc CTWS7 + 7 + 7 + read-write + + + CTWS8 + desc CTWS8 + 8 + 8 + read-write + + + CTWS9 + desc CTWS9 + 9 + 9 + read-write + + + CTWS10 + desc CTWS10 + 10 + 10 + read-write + + + CTWS11 + desc CTWS11 + 11 + 11 + read-write + + + CTWS12 + desc CTWS12 + 12 + 12 + read-write + + + CTWS13 + desc CTWS13 + 13 + 13 + read-write + + + CTWS14 + desc CTWS14 + 14 + 14 + read-write + + + CTWS15 + desc CTWS15 + 15 + 15 + read-write + + + + + TWPR + desc TWPR + 0x6 + 16 + read-write + 0x0 + 0xFFFF + + + CTWP0 + desc CTWP0 + 0 + 0 + read-write + + + CTWP1 + desc CTWP1 + 1 + 1 + read-write + + + CTWP2 + desc CTWP2 + 2 + 2 + read-write + + + CTWP3 + desc CTWP3 + 3 + 3 + read-write + + + CTWP4 + desc CTWP4 + 4 + 4 + read-write + + + CTWP5 + desc CTWP5 + 5 + 5 + read-write + + + CTWP6 + desc CTWP6 + 6 + 6 + read-write + + + CTWP7 + desc CTWP7 + 7 + 7 + read-write + + + CTWP8 + desc CTWP8 + 8 + 8 + read-write + + + CTWP9 + desc CTWP9 + 9 + 9 + read-write + + + CTWP10 + desc CTWP10 + 10 + 10 + read-write + + + CTWP11 + desc CTWP11 + 11 + 11 + read-write + + + CTWP12 + desc CTWP12 + 12 + 12 + read-write + + + CTWP13 + desc CTWP13 + 13 + 13 + read-write + + + CTWP14 + desc CTWP14 + 14 + 14 + read-write + + + CTWP15 + desc CTWP15 + 15 + 15 + read-write + + + + + + + CMU + desc CMU + 0x4004C400 + + 0x0 + 0x7CA3 + + + + XTAL32CR + desc XTAL32CR + 0x0 + 8 + read-write + 0x0 + 0x1 + + + XTAL32STP + desc XTAL32STP + 0 + 0 + read-write + + + + + XTAL32CFGR + desc XTAL32CFGR + 0x4 + 8 + read-write + 0x0 + 0x7 + + + XTAL32DRV + desc XTAL32DRV + 2 + 0 + read-write + + + + + XTAL32NFR + desc XTAL32NFR + 0x14 + 8 + read-write + 0x0 + 0x3 + + + XTAL32NF + desc XTAL32NF + 1 + 0 + read-write + + + + + LRCCR + desc LRCCR + 0x1C + 8 + read-write + 0x0 + 0x1 + + + LRCSTP + desc LRCSTP + 0 + 0 + read-write + + + + + RTCLRCCR + desc RTCLRCCR + 0x20 + 8 + read-write + 0x0 + 0x1 + + + RTCLRCSTP + desc RTCLRCSTP + 0 + 0 + read-write + + + + + LRCTRM + desc LRCTRM + 0x24 + 8 + read-write + 0x0 + 0xFF + + + RTCLRCTRM + desc RTCLRCTRM + 0x2C + 8 + read-write + 0x0 + 0xFF + + + XTALCR + desc XTALCR + 0x78 + 8 + read-write + 0x1 + 0x1 + + + XTALSTP + desc XTALSTP + 0 + 0 + read-write + + + + + XTALCFGR + desc XTALCFGR + 0x878 + 8 + read-write + 0x80 + 0x70 + + + XTALDRV + desc XTALDRV + 5 + 4 + read-write + + + XTALMS + desc XTALMS + 6 + 6 + read-write + + + + + PERICKSEL + desc PERICKSEL + 0x7C10 + 16 + read-write + 0x0 + 0xF + + + PERICKSEL + desc PERICKSEL + 3 + 0 + read-write + + + + + I2SCKSEL + desc I2SCKSEL + 0x7C12 + 16 + read-write + 0xBBBB + 0xFFFF + + + I2S1CKSEL + desc I2S1CKSEL + 3 + 0 + read-write + + + I2S2CKSEL + desc I2S2CKSEL + 7 + 4 + read-write + + + I2S3CKSEL + desc I2S3CKSEL + 11 + 8 + read-write + + + I2S4CKSEL + desc I2S4CKSEL + 15 + 12 + read-write + + + + + CANCKCFGR + desc CANCKCFGR + 0x7C18 + 8 + read-write + 0xDD + 0xFF + + + CAN1CKS + desc CAN1CKS + 3 + 0 + read-write + + + CAN2CKS + desc CAN2CKS + 7 + 4 + read-write + + + + + SCFGR + desc SCFGR + 0x7C20 + 32 + read-write + 0x0 + 0x7777777 + + + PCLK0S + desc PCLK0S + 2 + 0 + read-write + + + PCLK1S + desc PCLK1S + 6 + 4 + read-write + + + PCLK2S + desc PCLK2S + 10 + 8 + read-write + + + PCLK3S + desc PCLK3S + 14 + 12 + read-write + + + PCLK4S + desc PCLK4S + 18 + 16 + read-write + + + EXCKS + desc EXCKS + 22 + 20 + read-write + + + HCLKS + desc HCLKS + 26 + 24 + read-write + + + + + USBCKCFGR + desc USBCKCFGR + 0x7C24 + 8 + read-write + 0x40 + 0xF0 + + + USBCKS + desc USBCKS + 7 + 4 + read-write + + + + + CKSWR + desc CKSWR + 0x7C26 + 8 + read-write + 0x1 + 0x7 + + + CKSW + desc CKSW + 2 + 0 + read-write + + + + + PLLHCR + desc PLLHCR + 0x7C2A + 8 + read-write + 0x1 + 0x1 + + + PLLHOFF + desc PLLHOFF + 0 + 0 + read-write + + + + + PLLACR + desc PLLACR + 0x7C2E + 8 + read-write + 0x1 + 0x1 + + + PLLAOFF + desc PLLAOFF + 0 + 0 + read-write + + + + + HRCCR + desc HRCCR + 0x7C36 + 8 + read-write + 0x1 + 0x1 + + + HRCSTP + desc HRCSTP + 0 + 0 + read-write + + + + + MRCCR + desc MRCCR + 0x7C38 + 8 + read-write + 0x80 + 0x1 + + + MRCSTP + desc MRCSTP + 0 + 0 + read-write + + + + + OSCSTBSR + desc OSCSTBSR + 0x7C3C + 8 + read-write + 0x0 + 0xE9 + + + HRCSTBF + desc HRCSTBF + 0 + 0 + read-write + + + XTALSTBF + desc XTALSTBF + 3 + 3 + read-write + + + PLLHSTBF + desc PLLHSTBF + 5 + 5 + read-write + + + PLLASTBF + desc PLLASTBF + 6 + 6 + read-write + + + PLLBSTBF + desc PLLBSTBF + 7 + 7 + read-write + + + + + MCO1CFGR + desc MCO1CFGR + 0x7C3D + 8 + read-write + 0x0 + 0xFF + + + MCO1SEL + desc MCO1SEL + 3 + 0 + read-write + + + MCO1DIV + desc MCO1DIV + 6 + 4 + read-write + + + MCO1EN + desc MCO1EN + 7 + 7 + read-write + + + + + MCO2CFGR + desc MCO2CFGR + 0x7C3E + 8 + read-write + 0x0 + 0xFF + + + MCO2SEL + desc MCO2SEL + 3 + 0 + read-write + + + MCO2DIV + desc MCO2DIV + 6 + 4 + read-write + + + MCO2EN + desc MCO2EN + 7 + 7 + read-write + + + + + TPIUCKCFGR + desc TPIUCKCFGR + 0x7C3F + 8 + read-write + 0x0 + 0x83 + + + TPIUCKS + desc TPIUCKS + 1 + 0 + read-write + + + TPIUCKOE + desc TPIUCKOE + 7 + 7 + read-write + + + + + XTALSTDCR + desc XTALSTDCR + 0x7C40 + 8 + read-write + 0x0 + 0x87 + + + XTALSTDIE + desc XTALSTDIE + 0 + 0 + read-write + + + XTALSTDRE + desc XTALSTDRE + 1 + 1 + read-write + + + XTALSTDRIS + desc XTALSTDRIS + 2 + 2 + read-write + + + XTALSTDE + desc XTALSTDE + 7 + 7 + read-write + + + + + XTALSTDSR + desc XTALSTDSR + 0x7C41 + 8 + read-write + 0x0 + 0x1 + + + XTALSTDF + desc XTALSTDF + 0 + 0 + read-write + + + + + MRCTRM + desc MRCTRM + 0x7C61 + 8 + read-write + 0x0 + 0xFF + + + HRCTRM + desc HRCTRM + 0x7C62 + 8 + read-write + 0x0 + 0xFF + + + XTALSTBCR + desc XTALSTBCR + 0x7CA2 + 8 + read-write + 0x5 + 0xF + + + XTALSTB + desc XTALSTB + 3 + 0 + read-write + + + + + PLLHCFGR + desc PLLHCFGR + 0x7D00 + 32 + read-write + 0x11101300 + 0xFFF1FF9F + + + PLLHM + desc PLLHM + 4 + 0 + read-write + + + PLLSRC + desc PLLSRC + 7 + 7 + read-write + + + PLLHN + desc PLLHN + 16 + 8 + read-write + + + PLLHR + desc PLLHR + 23 + 20 + read-write + + + PLLHQ + desc PLLHQ + 27 + 24 + read-write + + + PLLHP + desc PLLHP + 31 + 28 + read-write + + + + + PLLACFGR + desc PLLACFGR + 0x7D04 + 32 + read-write + 0x11101300 + 0xFFF1FF1F + + + PLLAM + desc PLLAM + 4 + 0 + read-write + + + PLLAN + desc PLLAN + 16 + 8 + read-write + + + PLLAR + desc PLLAR + 23 + 20 + read-write + + + PLLAQ + desc PLLAQ + 27 + 24 + read-write + + + PLLAP + desc PLLAP + 31 + 28 + read-write + + + + + + + CRC + desc CRC + 0x40008C00 + + 0x0 + 0x100 + + + + CR + desc CR + 0x0 + 32 + read-write + 0x1 + 0x3 + + + CR + desc CR + 0 + 0 + read-write + + + FLAG + desc FLAG + 1 + 1 + read-only + + + + + RESLT + desc RESLT + 0x4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DAT0 + desc DAT0 + 0x80 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT1 + desc DAT1 + 0x84 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT2 + desc DAT2 + 0x88 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT3 + desc DAT3 + 0x8C + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT4 + desc DAT4 + 0x90 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT5 + desc DAT5 + 0x94 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT6 + desc DAT6 + 0x98 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT7 + desc DAT7 + 0x9C + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT8 + desc DAT8 + 0xA0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT9 + desc DAT9 + 0xA4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT10 + desc DAT10 + 0xA8 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT11 + desc DAT11 + 0xAC + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT12 + desc DAT12 + 0xB0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT13 + desc DAT13 + 0xB4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT14 + desc DAT14 + 0xB8 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT15 + desc DAT15 + 0xBC + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT16 + desc DAT16 + 0xC0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT17 + desc DAT17 + 0xC4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT18 + desc DAT18 + 0xC8 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT19 + desc DAT19 + 0xCC + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT20 + desc DAT20 + 0xD0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT21 + desc DAT21 + 0xD4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT22 + desc DAT22 + 0xD8 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT23 + desc DAT23 + 0xDC + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT24 + desc DAT24 + 0xE0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT25 + desc DAT25 + 0xE4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT26 + desc DAT26 + 0xE8 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT27 + desc DAT27 + 0xEC + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT28 + desc DAT28 + 0xF0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT29 + desc DAT29 + 0xF4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT30 + desc DAT30 + 0xF8 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DAT31 + desc DAT31 + 0xFC + 32 + read-only + 0x0 + 0xFFFFFFFF + + + + + CTC + desc CTC + 0x40049C00 + + 0x0 + 0xC + + + + CR1 + desc CR1 + 0x0 + 32 + read-write + 0x0 + 0x3F00F7 + + + REFPSC + desc REFPSC + 2 + 0 + read-write + + + REFCKS + desc REFCKS + 5 + 4 + read-write + + + ERRIE + desc ERRIE + 6 + 6 + read-write + + + CTCEN + desc CTCEN + 7 + 7 + read-write + + + TRMVAL + desc TRMVAL + 21 + 16 + read-write + + + + + CR2 + desc CR2 + 0x4 + 32 + read-write + 0x0 + 0xFFFF00FF + + + OFSVAL + desc OFSVAL + 7 + 0 + read-write + + + RLDVAL + desc RLDVAL + 31 + 16 + read-write + + + + + STR + desc STR + 0x8 + 32 + read-only + 0x0 + 0xF + + + TRIMOK + desc TRIMOK + 0 + 0 + read-only + + + TRMOVF + desc TRMOVF + 1 + 1 + read-only + + + TRMUDF + desc TRMUDF + 2 + 2 + read-only + + + CTCBSY + desc CTCBSY + 3 + 3 + read-only + + + + + + + DAC1 + desc DAC1 + 0x40041000 + + 0x0 + 0x1E + + + + DADR1 + desc DADR1 + 0x0 + 16 + read-write + 0x0 + 0xFFFF + + + DR0 + desc DR0 + 0 + 0 + read-write + + + DR1 + desc DR1 + 1 + 1 + read-write + + + DR2 + desc DR2 + 2 + 2 + read-write + + + DR3 + desc DR3 + 3 + 3 + read-write + + + DL0R4 + desc DL0R4 + 4 + 4 + read-write + + + DL1R5 + desc DL1R5 + 5 + 5 + read-write + + + DL2R6 + desc DL2R6 + 6 + 6 + read-write + + + DL3R7 + desc DL3R7 + 7 + 7 + read-write + + + DL4R8 + desc DL4R8 + 8 + 8 + read-write + + + DL5R9 + desc DL5R9 + 9 + 9 + read-write + + + DL6R10 + desc DL6R10 + 10 + 10 + read-write + + + DL7R11 + desc DL7R11 + 11 + 11 + read-write + + + DL8 + desc DL8 + 12 + 12 + read-write + + + DL9 + desc DL9 + 13 + 13 + read-write + + + DL10 + desc DL10 + 14 + 14 + read-write + + + DL11 + desc DL11 + 15 + 15 + read-write + + + + + DADR2 + desc DADR2 + 0x2 + 16 + read-write + 0x0 + 0xFFFF + + + DR0 + desc DR0 + 0 + 0 + read-write + + + DR1 + desc DR1 + 1 + 1 + read-write + + + DR2 + desc DR2 + 2 + 2 + read-write + + + DR3 + desc DR3 + 3 + 3 + read-write + + + DL0R4 + desc DL0R4 + 4 + 4 + read-write + + + DL1R5 + desc DL1R5 + 5 + 5 + read-write + + + DL2R6 + desc DL2R6 + 6 + 6 + read-write + + + DL3R7 + desc DL3R7 + 7 + 7 + read-write + + + DL4R8 + desc DL4R8 + 8 + 8 + read-write + + + DL5R9 + desc DL5R9 + 9 + 9 + read-write + + + DL6R10 + desc DL6R10 + 10 + 10 + read-write + + + DL7R11 + desc DL7R11 + 11 + 11 + read-write + + + DL8 + desc DL8 + 12 + 12 + read-write + + + DL9 + desc DL9 + 13 + 13 + read-write + + + DL10 + desc DL10 + 14 + 14 + read-write + + + DL11 + desc DL11 + 15 + 15 + read-write + + + + + DACR + desc DACR + 0x4 + 16 + read-write + 0x0 + 0x1F07 + + + DAE + desc DAE + 0 + 0 + read-write + + + DA1E + desc DA1E + 1 + 1 + read-write + + + DA2E + desc DA2E + 2 + 2 + read-write + + + DPSEL + desc DPSEL + 8 + 8 + read-write + + + DAAMP1 + desc DAAMP1 + 9 + 9 + read-write + + + DAAMP2 + desc DAAMP2 + 10 + 10 + read-write + + + EXTDSL1 + desc EXTDSL1 + 11 + 11 + read-write + + + EXTDSL2 + desc EXTDSL2 + 12 + 12 + read-write + + + + + DAADPCR + desc DAADPCR + 0x6 + 16 + read-write + 0x0 + 0x830F + + + ADPSL0 + desc ADPSL0 + 0 + 0 + read-write + + + ADPSL1 + desc ADPSL1 + 1 + 1 + read-write + + + ADPSL2 + desc ADPSL2 + 2 + 2 + read-write + + + ADPSL3 + desc ADPSL3 + 3 + 3 + read-write + + + DA1SF + desc DA1SF + 8 + 8 + read-only + + + DA2SF + desc DA2SF + 9 + 9 + read-only + + + ADPEN + desc ADPEN + 15 + 15 + read-write + + + + + DAOCR + desc DAOCR + 0x1C + 16 + read-write + 0x0 + 0xC000 + + + DAODIS1 + desc DAODIS1 + 14 + 14 + read-write + + + DAODIS2 + desc DAODIS2 + 15 + 15 + read-write + + + + + + + DAC2 + desc DAC2 + 0x40041400 + + 0x0 + 0x1E + + + + DADR1 + desc DADR1 + 0x0 + 16 + read-write + 0x0 + 0xFFFF + + + DR0 + desc DR0 + 0 + 0 + read-write + + + DR1 + desc DR1 + 1 + 1 + read-write + + + DR2 + desc DR2 + 2 + 2 + read-write + + + DR3 + desc DR3 + 3 + 3 + read-write + + + DL0R4 + desc DL0R4 + 4 + 4 + read-write + + + DL1R5 + desc DL1R5 + 5 + 5 + read-write + + + DL2R6 + desc DL2R6 + 6 + 6 + read-write + + + DL3R7 + desc DL3R7 + 7 + 7 + read-write + + + DL4R8 + desc DL4R8 + 8 + 8 + read-write + + + DL5R9 + desc DL5R9 + 9 + 9 + read-write + + + DL6R10 + desc DL6R10 + 10 + 10 + read-write + + + DL7R11 + desc DL7R11 + 11 + 11 + read-write + + + DL8 + desc DL8 + 12 + 12 + read-write + + + DL9 + desc DL9 + 13 + 13 + read-write + + + DL10 + desc DL10 + 14 + 14 + read-write + + + DL11 + desc DL11 + 15 + 15 + read-write + + + + + DADR2 + desc DADR2 + 0x2 + 16 + read-write + 0x0 + 0xFFFF + + + DR0 + desc DR0 + 0 + 0 + read-write + + + DR1 + desc DR1 + 1 + 1 + read-write + + + DR2 + desc DR2 + 2 + 2 + read-write + + + DR3 + desc DR3 + 3 + 3 + read-write + + + DL0R4 + desc DL0R4 + 4 + 4 + read-write + + + DL1R5 + desc DL1R5 + 5 + 5 + read-write + + + DL2R6 + desc DL2R6 + 6 + 6 + read-write + + + DL3R7 + desc DL3R7 + 7 + 7 + read-write + + + DL4R8 + desc DL4R8 + 8 + 8 + read-write + + + DL5R9 + desc DL5R9 + 9 + 9 + read-write + + + DL6R10 + desc DL6R10 + 10 + 10 + read-write + + + DL7R11 + desc DL7R11 + 11 + 11 + read-write + + + DL8 + desc DL8 + 12 + 12 + read-write + + + DL9 + desc DL9 + 13 + 13 + read-write + + + DL10 + desc DL10 + 14 + 14 + read-write + + + DL11 + desc DL11 + 15 + 15 + read-write + + + + + DACR + desc DACR + 0x4 + 16 + read-write + 0x0 + 0x1F07 + + + DAE + desc DAE + 0 + 0 + read-write + + + DA1E + desc DA1E + 1 + 1 + read-write + + + DA2E + desc DA2E + 2 + 2 + read-write + + + DPSEL + desc DPSEL + 8 + 8 + read-write + + + DAAMP1 + desc DAAMP1 + 9 + 9 + read-write + + + DAAMP2 + desc DAAMP2 + 10 + 10 + read-write + + + EXTDSL1 + desc EXTDSL1 + 11 + 11 + read-write + + + EXTDSL2 + desc EXTDSL2 + 12 + 12 + read-write + + + + + DAADPCR + desc DAADPCR + 0x6 + 16 + read-write + 0x0 + 0x830F + + + ADPSL0 + desc ADPSL0 + 0 + 0 + read-write + + + ADPSL1 + desc ADPSL1 + 1 + 1 + read-write + + + ADPSL2 + desc ADPSL2 + 2 + 2 + read-write + + + ADPSL3 + desc ADPSL3 + 3 + 3 + read-write + + + DA1SF + desc DA1SF + 8 + 8 + read-only + + + DA2SF + desc DA2SF + 9 + 9 + read-only + + + ADPEN + desc ADPEN + 15 + 15 + read-write + + + + + DAOCR + desc DAOCR + 0x1C + 16 + read-write + 0x0 + 0xC000 + + + DAODIS1 + desc DAODIS1 + 14 + 14 + read-write + + + DAODIS2 + desc DAODIS2 + 15 + 15 + read-write + + + + + + + DBGC + desc DBGC + 0xE0042000 + + 0x0 + 0x2C + + + + AUTHID0 + desc AUTHID0 + 0x0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + AUTHID1 + desc AUTHID1 + 0x4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + AUTHID2 + desc AUTHID2 + 0x8 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + RESV0 + desc RESV0 + 0xC + 32 + read-write + 0x0 + 0xFFFFFFFF + + + MCUSTAT + desc MCUSTAT + 0x10 + 32 + read-write + 0x0 + 0x30F + + + AUTH + desc AUTH + 0 + 0 + read-write + + + REMVLOCK + desc REMVLOCK + 1 + 1 + read-write + + + SAFTYLOCK1 + desc SAFTYLOCK1 + 2 + 2 + read-write + + + SAFTYLOCK2 + desc SAFTYLOCK2 + 3 + 3 + read-write + + + CPUSTOP + desc CPUSTOP + 8 + 8 + read-write + + + CPUSLEEP + desc CPUSLEEP + 9 + 9 + read-write + + + + + MCUCTL + desc MCUCTL + 0x14 + 32 + read-write + 0x0 + 0x103 + + + EDBGRQ + desc EDBGRQ + 0 + 0 + read-write + + + RESTART + desc RESTART + 1 + 1 + read-write + + + DIRQ + desc DIRQ + 8 + 8 + read-write + + + + + FMCCTL + desc FMCCTL + 0x18 + 32 + read-write + 0x0 + 0x7 + + + ERASEREQ + desc ERASEREQ + 0 + 0 + read-write + + + ERASEACK + desc ERASEACK + 1 + 1 + read-write + + + ERASEERR + desc ERASEERR + 2 + 2 + read-write + + + + + MCUDBGCSTAT + desc MCUDBGCSTAT + 0x1C + 32 + read-write + 0x0 + 0x3 + + + CDBGPWRUPREQ + desc CDBGPWRUPREQ + 0 + 0 + read-write + + + CDBGPWRUPACK + desc CDBGPWRUPACK + 1 + 1 + read-write + + + + + MCUSTPCTL + desc MCUSTPCTL + 0x20 + 32 + read-write + 0x3B + 0xFFFFFFFF + + + SWDTSTP + desc SWDTSTP + 0 + 0 + read-write + + + WDTSTP + desc WDTSTP + 1 + 1 + read-write + + + RTCSTP + desc RTCSTP + 2 + 2 + read-write + + + PVD0STP + desc PVD0STP + 3 + 3 + read-write + + + PVD1STP + desc PVD1STP + 4 + 4 + read-write + + + PVD2STP + desc PVD2STP + 5 + 5 + read-write + + + M06STP + desc M06STP + 6 + 6 + read-write + + + M07STP + desc M07STP + 7 + 7 + read-write + + + M08STP + desc M08STP + 8 + 8 + read-write + + + M09STP + desc M09STP + 9 + 9 + read-write + + + M10STP + desc M10STP + 10 + 10 + read-write + + + M11STP + desc M11STP + 11 + 11 + read-write + + + M12STP + desc M12STP + 12 + 12 + read-write + + + M13STP + desc M13STP + 13 + 13 + read-write + + + M14STP + desc M14STP + 14 + 14 + read-write + + + M15STP + desc M15STP + 15 + 15 + read-write + + + M16STP + desc M16STP + 16 + 16 + read-write + + + M17STP + desc M17STP + 17 + 17 + read-write + + + M18STP + desc M18STP + 18 + 18 + read-write + + + M19STP + desc M19STP + 19 + 19 + read-write + + + M20STP + desc M20STP + 20 + 20 + read-write + + + M21STP + desc M21STP + 21 + 21 + read-write + + + M22STP + desc M22STP + 22 + 22 + read-write + + + M23STP + desc M23STP + 23 + 23 + read-write + + + M24STP + desc M24STP + 24 + 24 + read-write + + + M25STP + desc M25STP + 25 + 25 + read-write + + + M26STP + desc M26STP + 26 + 26 + read-write + + + M27STP + desc M27STP + 27 + 27 + read-write + + + M28STP + desc M28STP + 28 + 28 + read-write + + + M29STP + desc M29STP + 29 + 29 + read-write + + + M30STP + desc M30STP + 30 + 30 + read-write + + + M31STP + desc M31STP + 31 + 31 + read-write + + + + + MCUTRACECTL + desc MCUTRACECTL + 0x24 + 32 + read-write + 0x0 + 0x7 + + + TRACEMODE + desc TRACEMODE + 1 + 0 + read-write + + + TRACEIOEN + desc TRACEIOEN + 2 + 2 + read-write + + + + + MCUSTPCTL2 + desc MCUSTPCTL2 + 0x28 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + M32STP + desc M32STP + 0 + 0 + read-write + + + M33STP + desc M33STP + 1 + 1 + read-write + + + M34STP + desc M34STP + 2 + 2 + read-write + + + M35STP + desc M35STP + 3 + 3 + read-write + + + M36STP + desc M36STP + 4 + 4 + read-write + + + M37STP + desc M37STP + 5 + 5 + read-write + + + M38STP + desc M38STP + 6 + 6 + read-write + + + M39STP + desc M39STP + 7 + 7 + read-write + + + M40STP + desc M40STP + 8 + 8 + read-write + + + M41STP + desc M41STP + 9 + 9 + read-write + + + M42STP + desc M42STP + 10 + 10 + read-write + + + M43STP + desc M43STP + 11 + 11 + read-write + + + M44STP + desc M44STP + 12 + 12 + read-write + + + M45STP + desc M45STP + 13 + 13 + read-write + + + M46STP + desc M46STP + 14 + 14 + read-write + + + M47STP + desc M47STP + 15 + 15 + read-write + + + M48STP + desc M48STP + 16 + 16 + read-write + + + M49STP + desc M49STP + 17 + 17 + read-write + + + M50STP + desc M50STP + 18 + 18 + read-write + + + M51STP + desc M51STP + 19 + 19 + read-write + + + M52STP + desc M52STP + 20 + 20 + read-write + + + M53STP + desc M53STP + 21 + 21 + read-write + + + M54STP + desc M54STP + 22 + 22 + read-write + + + M55STP + desc M55STP + 23 + 23 + read-write + + + M56STP + desc M56STP + 24 + 24 + read-write + + + M57STP + desc M57STP + 25 + 25 + read-write + + + M58STP + desc M58STP + 26 + 26 + read-write + + + M59STP + desc M59STP + 27 + 27 + read-write + + + M60STP + desc M60STP + 28 + 28 + read-write + + + M61STP + desc M61STP + 29 + 29 + read-write + + + M62STP + desc M62STP + 30 + 30 + read-write + + + M63STP + desc M63STP + 31 + 31 + read-write + + + + + + + DCU1 + desc DCU1 + 0x40056000 + + 0x0 + 0x1C + + + + CTL + desc CTL + 0x0 + 32 + read-write + 0x80000000 + 0x8000013F + + + MODE + desc MODE + 3 + 0 + read-write + + + DATASIZE + desc DATASIZE + 5 + 4 + read-write + + + COMP_TRG + desc COMP_TRG + 8 + 8 + read-write + + + INTEN + desc INTEN + 31 + 31 + read-write + + + + + FLAG + desc FLAG + 0x4 + 32 + read-only + 0x0 + 0xE7F + + + FLAG_OP + desc FLAG_OP + 0 + 0 + read-only + + + FLAG_LS2 + desc FLAG_LS2 + 1 + 1 + read-only + + + FLAG_EQ2 + desc FLAG_EQ2 + 2 + 2 + read-only + + + FLAG_GT2 + desc FLAG_GT2 + 3 + 3 + read-only + + + FLAG_LS1 + desc FLAG_LS1 + 4 + 4 + read-only + + + FLAG_EQ1 + desc FLAG_EQ1 + 5 + 5 + read-only + + + FLAG_GT1 + desc FLAG_GT1 + 6 + 6 + read-only + + + FLAG_RLD + desc FLAG_RLD + 9 + 9 + read-only + + + FLAG_BTM + desc FLAG_BTM + 10 + 10 + read-only + + + FLAG_TOP + desc FLAG_TOP + 11 + 11 + read-only + + + + + DATA0 + desc DATA0 + 0x8 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DATA1 + desc DATA1 + 0xC + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DATA2 + desc DATA2 + 0x10 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + FLAGCLR + desc FLAGCLR + 0x14 + 32 + write-only + 0x0 + 0xE7F + + + CLR_OP + desc CLR_OP + 0 + 0 + write-only + + + CLR_LS2 + desc CLR_LS2 + 1 + 1 + write-only + + + CLR_EQ2 + desc CLR_EQ2 + 2 + 2 + write-only + + + CLR_GT2 + desc CLR_GT2 + 3 + 3 + write-only + + + CLR_LS1 + desc CLR_LS1 + 4 + 4 + write-only + + + CLR_EQ1 + desc CLR_EQ1 + 5 + 5 + write-only + + + CLR_GT1 + desc CLR_GT1 + 6 + 6 + write-only + + + CLR_RLD + desc CLR_RLD + 9 + 9 + read-write + + + CLR_BTM + desc CLR_BTM + 10 + 10 + read-write + + + CLR_TOP + desc CLR_TOP + 11 + 11 + read-write + + + + + INTEVTSEL + desc INTEVTSEL + 0x18 + 32 + read-write + 0x0 + 0xFFF + + + SEL_OP + desc SEL_OP + 0 + 0 + read-write + + + SEL_LS2 + desc SEL_LS2 + 1 + 1 + read-write + + + SEL_EQ2 + desc SEL_EQ2 + 2 + 2 + read-write + + + SEL_GT2 + desc SEL_GT2 + 3 + 3 + read-write + + + SEL_LS1 + desc SEL_LS1 + 4 + 4 + read-write + + + SEL_EQ1 + desc SEL_EQ1 + 5 + 5 + read-write + + + SEL_GT1 + desc SEL_GT1 + 6 + 6 + read-write + + + SEL_WIN + desc SEL_WIN + 8 + 7 + read-write + + + SEL_RLD + desc SEL_RLD + 9 + 9 + read-write + + + SEL_BTM + desc SEL_BTM + 10 + 10 + read-write + + + SEL_TOP + desc SEL_TOP + 11 + 11 + read-write + + + + + + + DCU2 + desc DCU2 + 0x40056400 + + 0x0 + 0x1C + + + + CTL + desc CTL + 0x0 + 32 + read-write + 0x80000000 + 0x8000013F + + + MODE + desc MODE + 3 + 0 + read-write + + + DATASIZE + desc DATASIZE + 5 + 4 + read-write + + + COMP_TRG + desc COMP_TRG + 8 + 8 + read-write + + + INTEN + desc INTEN + 31 + 31 + read-write + + + + + FLAG + desc FLAG + 0x4 + 32 + read-only + 0x0 + 0xE7F + + + FLAG_OP + desc FLAG_OP + 0 + 0 + read-only + + + FLAG_LS2 + desc FLAG_LS2 + 1 + 1 + read-only + + + FLAG_EQ2 + desc FLAG_EQ2 + 2 + 2 + read-only + + + FLAG_GT2 + desc FLAG_GT2 + 3 + 3 + read-only + + + FLAG_LS1 + desc FLAG_LS1 + 4 + 4 + read-only + + + FLAG_EQ1 + desc FLAG_EQ1 + 5 + 5 + read-only + + + FLAG_GT1 + desc FLAG_GT1 + 6 + 6 + read-only + + + FLAG_RLD + desc FLAG_RLD + 9 + 9 + read-only + + + FLAG_BTM + desc FLAG_BTM + 10 + 10 + read-only + + + FLAG_TOP + desc FLAG_TOP + 11 + 11 + read-only + + + + + DATA0 + desc DATA0 + 0x8 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DATA1 + desc DATA1 + 0xC + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DATA2 + desc DATA2 + 0x10 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + FLAGCLR + desc FLAGCLR + 0x14 + 32 + write-only + 0x0 + 0xE7F + + + CLR_OP + desc CLR_OP + 0 + 0 + write-only + + + CLR_LS2 + desc CLR_LS2 + 1 + 1 + write-only + + + CLR_EQ2 + desc CLR_EQ2 + 2 + 2 + write-only + + + CLR_GT2 + desc CLR_GT2 + 3 + 3 + write-only + + + CLR_LS1 + desc CLR_LS1 + 4 + 4 + write-only + + + CLR_EQ1 + desc CLR_EQ1 + 5 + 5 + write-only + + + CLR_GT1 + desc CLR_GT1 + 6 + 6 + write-only + + + CLR_RLD + desc CLR_RLD + 9 + 9 + read-write + + + CLR_BTM + desc CLR_BTM + 10 + 10 + read-write + + + CLR_TOP + desc CLR_TOP + 11 + 11 + read-write + + + + + INTEVTSEL + desc INTEVTSEL + 0x18 + 32 + read-write + 0x0 + 0xFFF + + + SEL_OP + desc SEL_OP + 0 + 0 + read-write + + + SEL_LS2 + desc SEL_LS2 + 1 + 1 + read-write + + + SEL_EQ2 + desc SEL_EQ2 + 2 + 2 + read-write + + + SEL_GT2 + desc SEL_GT2 + 3 + 3 + read-write + + + SEL_LS1 + desc SEL_LS1 + 4 + 4 + read-write + + + SEL_EQ1 + desc SEL_EQ1 + 5 + 5 + read-write + + + SEL_GT1 + desc SEL_GT1 + 6 + 6 + read-write + + + SEL_WIN + desc SEL_WIN + 8 + 7 + read-write + + + SEL_RLD + desc SEL_RLD + 9 + 9 + read-write + + + SEL_BTM + desc SEL_BTM + 10 + 10 + read-write + + + SEL_TOP + desc SEL_TOP + 11 + 11 + read-write + + + + + + + DCU3 + desc DCU3 + 0x40056800 + + 0x0 + 0x1C + + + + CTL + desc CTL + 0x0 + 32 + read-write + 0x80000000 + 0x8000013F + + + MODE + desc MODE + 3 + 0 + read-write + + + DATASIZE + desc DATASIZE + 5 + 4 + read-write + + + COMP_TRG + desc COMP_TRG + 8 + 8 + read-write + + + INTEN + desc INTEN + 31 + 31 + read-write + + + + + FLAG + desc FLAG + 0x4 + 32 + read-only + 0x0 + 0xE7F + + + FLAG_OP + desc FLAG_OP + 0 + 0 + read-only + + + FLAG_LS2 + desc FLAG_LS2 + 1 + 1 + read-only + + + FLAG_EQ2 + desc FLAG_EQ2 + 2 + 2 + read-only + + + FLAG_GT2 + desc FLAG_GT2 + 3 + 3 + read-only + + + FLAG_LS1 + desc FLAG_LS1 + 4 + 4 + read-only + + + FLAG_EQ1 + desc FLAG_EQ1 + 5 + 5 + read-only + + + FLAG_GT1 + desc FLAG_GT1 + 6 + 6 + read-only + + + FLAG_RLD + desc FLAG_RLD + 9 + 9 + read-only + + + FLAG_BTM + desc FLAG_BTM + 10 + 10 + read-only + + + FLAG_TOP + desc FLAG_TOP + 11 + 11 + read-only + + + + + DATA0 + desc DATA0 + 0x8 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DATA1 + desc DATA1 + 0xC + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DATA2 + desc DATA2 + 0x10 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + FLAGCLR + desc FLAGCLR + 0x14 + 32 + write-only + 0x0 + 0xE7F + + + CLR_OP + desc CLR_OP + 0 + 0 + write-only + + + CLR_LS2 + desc CLR_LS2 + 1 + 1 + write-only + + + CLR_EQ2 + desc CLR_EQ2 + 2 + 2 + write-only + + + CLR_GT2 + desc CLR_GT2 + 3 + 3 + write-only + + + CLR_LS1 + desc CLR_LS1 + 4 + 4 + write-only + + + CLR_EQ1 + desc CLR_EQ1 + 5 + 5 + write-only + + + CLR_GT1 + desc CLR_GT1 + 6 + 6 + write-only + + + CLR_RLD + desc CLR_RLD + 9 + 9 + read-write + + + CLR_BTM + desc CLR_BTM + 10 + 10 + read-write + + + CLR_TOP + desc CLR_TOP + 11 + 11 + read-write + + + + + INTEVTSEL + desc INTEVTSEL + 0x18 + 32 + read-write + 0x0 + 0xFFF + + + SEL_OP + desc SEL_OP + 0 + 0 + read-write + + + SEL_LS2 + desc SEL_LS2 + 1 + 1 + read-write + + + SEL_EQ2 + desc SEL_EQ2 + 2 + 2 + read-write + + + SEL_GT2 + desc SEL_GT2 + 3 + 3 + read-write + + + SEL_LS1 + desc SEL_LS1 + 4 + 4 + read-write + + + SEL_EQ1 + desc SEL_EQ1 + 5 + 5 + read-write + + + SEL_GT1 + desc SEL_GT1 + 6 + 6 + read-write + + + SEL_WIN + desc SEL_WIN + 8 + 7 + read-write + + + SEL_RLD + desc SEL_RLD + 9 + 9 + read-write + + + SEL_BTM + desc SEL_BTM + 10 + 10 + read-write + + + SEL_TOP + desc SEL_TOP + 11 + 11 + read-write + + + + + + + DCU4 + desc DCU4 + 0x40056C00 + + 0x0 + 0x1C + + + + CTL + desc CTL + 0x0 + 32 + read-write + 0x80000000 + 0x8000013F + + + MODE + desc MODE + 3 + 0 + read-write + + + DATASIZE + desc DATASIZE + 5 + 4 + read-write + + + COMP_TRG + desc COMP_TRG + 8 + 8 + read-write + + + INTEN + desc INTEN + 31 + 31 + read-write + + + + + FLAG + desc FLAG + 0x4 + 32 + read-only + 0x0 + 0xE7F + + + FLAG_OP + desc FLAG_OP + 0 + 0 + read-only + + + FLAG_LS2 + desc FLAG_LS2 + 1 + 1 + read-only + + + FLAG_EQ2 + desc FLAG_EQ2 + 2 + 2 + read-only + + + FLAG_GT2 + desc FLAG_GT2 + 3 + 3 + read-only + + + FLAG_LS1 + desc FLAG_LS1 + 4 + 4 + read-only + + + FLAG_EQ1 + desc FLAG_EQ1 + 5 + 5 + read-only + + + FLAG_GT1 + desc FLAG_GT1 + 6 + 6 + read-only + + + FLAG_RLD + desc FLAG_RLD + 9 + 9 + read-only + + + FLAG_BTM + desc FLAG_BTM + 10 + 10 + read-only + + + FLAG_TOP + desc FLAG_TOP + 11 + 11 + read-only + + + + + DATA0 + desc DATA0 + 0x8 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DATA1 + desc DATA1 + 0xC + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DATA2 + desc DATA2 + 0x10 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + FLAGCLR + desc FLAGCLR + 0x14 + 32 + write-only + 0x0 + 0xE7F + + + CLR_OP + desc CLR_OP + 0 + 0 + write-only + + + CLR_LS2 + desc CLR_LS2 + 1 + 1 + write-only + + + CLR_EQ2 + desc CLR_EQ2 + 2 + 2 + write-only + + + CLR_GT2 + desc CLR_GT2 + 3 + 3 + write-only + + + CLR_LS1 + desc CLR_LS1 + 4 + 4 + write-only + + + CLR_EQ1 + desc CLR_EQ1 + 5 + 5 + write-only + + + CLR_GT1 + desc CLR_GT1 + 6 + 6 + write-only + + + CLR_RLD + desc CLR_RLD + 9 + 9 + read-write + + + CLR_BTM + desc CLR_BTM + 10 + 10 + read-write + + + CLR_TOP + desc CLR_TOP + 11 + 11 + read-write + + + + + INTEVTSEL + desc INTEVTSEL + 0x18 + 32 + read-write + 0x0 + 0xFFF + + + SEL_OP + desc SEL_OP + 0 + 0 + read-write + + + SEL_LS2 + desc SEL_LS2 + 1 + 1 + read-write + + + SEL_EQ2 + desc SEL_EQ2 + 2 + 2 + read-write + + + SEL_GT2 + desc SEL_GT2 + 3 + 3 + read-write + + + SEL_LS1 + desc SEL_LS1 + 4 + 4 + read-write + + + SEL_EQ1 + desc SEL_EQ1 + 5 + 5 + read-write + + + SEL_GT1 + desc SEL_GT1 + 6 + 6 + read-write + + + SEL_WIN + desc SEL_WIN + 8 + 7 + read-write + + + SEL_RLD + desc SEL_RLD + 9 + 9 + read-write + + + SEL_BTM + desc SEL_BTM + 10 + 10 + read-write + + + SEL_TOP + desc SEL_TOP + 11 + 11 + read-write + + + + + + + DCU5 + desc DCU5 + 0x40057000 + + 0x0 + 0x1C + + + + CTL + desc CTL + 0x0 + 32 + read-write + 0x80000000 + 0x8000013F + + + MODE + desc MODE + 3 + 0 + read-write + + + DATASIZE + desc DATASIZE + 5 + 4 + read-write + + + COMP_TRG + desc COMP_TRG + 8 + 8 + read-write + + + INTEN + desc INTEN + 31 + 31 + read-write + + + + + FLAG + desc FLAG + 0x4 + 32 + read-only + 0x0 + 0xE7F + + + FLAG_OP + desc FLAG_OP + 0 + 0 + read-only + + + FLAG_LS2 + desc FLAG_LS2 + 1 + 1 + read-only + + + FLAG_EQ2 + desc FLAG_EQ2 + 2 + 2 + read-only + + + FLAG_GT2 + desc FLAG_GT2 + 3 + 3 + read-only + + + FLAG_LS1 + desc FLAG_LS1 + 4 + 4 + read-only + + + FLAG_EQ1 + desc FLAG_EQ1 + 5 + 5 + read-only + + + FLAG_GT1 + desc FLAG_GT1 + 6 + 6 + read-only + + + FLAG_RLD + desc FLAG_RLD + 9 + 9 + read-only + + + FLAG_BTM + desc FLAG_BTM + 10 + 10 + read-only + + + FLAG_TOP + desc FLAG_TOP + 11 + 11 + read-only + + + + + DATA0 + desc DATA0 + 0x8 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DATA1 + desc DATA1 + 0xC + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DATA2 + desc DATA2 + 0x10 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + FLAGCLR + desc FLAGCLR + 0x14 + 32 + write-only + 0x0 + 0xE7F + + + CLR_OP + desc CLR_OP + 0 + 0 + write-only + + + CLR_LS2 + desc CLR_LS2 + 1 + 1 + write-only + + + CLR_EQ2 + desc CLR_EQ2 + 2 + 2 + write-only + + + CLR_GT2 + desc CLR_GT2 + 3 + 3 + write-only + + + CLR_LS1 + desc CLR_LS1 + 4 + 4 + write-only + + + CLR_EQ1 + desc CLR_EQ1 + 5 + 5 + write-only + + + CLR_GT1 + desc CLR_GT1 + 6 + 6 + write-only + + + CLR_RLD + desc CLR_RLD + 9 + 9 + read-write + + + CLR_BTM + desc CLR_BTM + 10 + 10 + read-write + + + CLR_TOP + desc CLR_TOP + 11 + 11 + read-write + + + + + INTEVTSEL + desc INTEVTSEL + 0x18 + 32 + read-write + 0x0 + 0xFFF + + + SEL_OP + desc SEL_OP + 0 + 0 + read-write + + + SEL_LS2 + desc SEL_LS2 + 1 + 1 + read-write + + + SEL_EQ2 + desc SEL_EQ2 + 2 + 2 + read-write + + + SEL_GT2 + desc SEL_GT2 + 3 + 3 + read-write + + + SEL_LS1 + desc SEL_LS1 + 4 + 4 + read-write + + + SEL_EQ1 + desc SEL_EQ1 + 5 + 5 + read-write + + + SEL_GT1 + desc SEL_GT1 + 6 + 6 + read-write + + + SEL_WIN + desc SEL_WIN + 8 + 7 + read-write + + + SEL_RLD + desc SEL_RLD + 9 + 9 + read-write + + + SEL_BTM + desc SEL_BTM + 10 + 10 + read-write + + + SEL_TOP + desc SEL_TOP + 11 + 11 + read-write + + + + + + + DCU6 + desc DCU6 + 0x40057400 + + 0x0 + 0x1C + + + + CTL + desc CTL + 0x0 + 32 + read-write + 0x80000000 + 0x8000013F + + + MODE + desc MODE + 3 + 0 + read-write + + + DATASIZE + desc DATASIZE + 5 + 4 + read-write + + + COMP_TRG + desc COMP_TRG + 8 + 8 + read-write + + + INTEN + desc INTEN + 31 + 31 + read-write + + + + + FLAG + desc FLAG + 0x4 + 32 + read-only + 0x0 + 0xE7F + + + FLAG_OP + desc FLAG_OP + 0 + 0 + read-only + + + FLAG_LS2 + desc FLAG_LS2 + 1 + 1 + read-only + + + FLAG_EQ2 + desc FLAG_EQ2 + 2 + 2 + read-only + + + FLAG_GT2 + desc FLAG_GT2 + 3 + 3 + read-only + + + FLAG_LS1 + desc FLAG_LS1 + 4 + 4 + read-only + + + FLAG_EQ1 + desc FLAG_EQ1 + 5 + 5 + read-only + + + FLAG_GT1 + desc FLAG_GT1 + 6 + 6 + read-only + + + FLAG_RLD + desc FLAG_RLD + 9 + 9 + read-only + + + FLAG_BTM + desc FLAG_BTM + 10 + 10 + read-only + + + FLAG_TOP + desc FLAG_TOP + 11 + 11 + read-only + + + + + DATA0 + desc DATA0 + 0x8 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DATA1 + desc DATA1 + 0xC + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DATA2 + desc DATA2 + 0x10 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + FLAGCLR + desc FLAGCLR + 0x14 + 32 + write-only + 0x0 + 0xE7F + + + CLR_OP + desc CLR_OP + 0 + 0 + write-only + + + CLR_LS2 + desc CLR_LS2 + 1 + 1 + write-only + + + CLR_EQ2 + desc CLR_EQ2 + 2 + 2 + write-only + + + CLR_GT2 + desc CLR_GT2 + 3 + 3 + write-only + + + CLR_LS1 + desc CLR_LS1 + 4 + 4 + write-only + + + CLR_EQ1 + desc CLR_EQ1 + 5 + 5 + write-only + + + CLR_GT1 + desc CLR_GT1 + 6 + 6 + write-only + + + CLR_RLD + desc CLR_RLD + 9 + 9 + read-write + + + CLR_BTM + desc CLR_BTM + 10 + 10 + read-write + + + CLR_TOP + desc CLR_TOP + 11 + 11 + read-write + + + + + INTEVTSEL + desc INTEVTSEL + 0x18 + 32 + read-write + 0x0 + 0xFFF + + + SEL_OP + desc SEL_OP + 0 + 0 + read-write + + + SEL_LS2 + desc SEL_LS2 + 1 + 1 + read-write + + + SEL_EQ2 + desc SEL_EQ2 + 2 + 2 + read-write + + + SEL_GT2 + desc SEL_GT2 + 3 + 3 + read-write + + + SEL_LS1 + desc SEL_LS1 + 4 + 4 + read-write + + + SEL_EQ1 + desc SEL_EQ1 + 5 + 5 + read-write + + + SEL_GT1 + desc SEL_GT1 + 6 + 6 + read-write + + + SEL_WIN + desc SEL_WIN + 8 + 7 + read-write + + + SEL_RLD + desc SEL_RLD + 9 + 9 + read-write + + + SEL_BTM + desc SEL_BTM + 10 + 10 + read-write + + + SEL_TOP + desc SEL_TOP + 11 + 11 + read-write + + + + + + + DCU7 + desc DCU7 + 0x40057800 + + 0x0 + 0x1C + + + + CTL + desc CTL + 0x0 + 32 + read-write + 0x80000000 + 0x8000013F + + + MODE + desc MODE + 3 + 0 + read-write + + + DATASIZE + desc DATASIZE + 5 + 4 + read-write + + + COMP_TRG + desc COMP_TRG + 8 + 8 + read-write + + + INTEN + desc INTEN + 31 + 31 + read-write + + + + + FLAG + desc FLAG + 0x4 + 32 + read-only + 0x0 + 0xE7F + + + FLAG_OP + desc FLAG_OP + 0 + 0 + read-only + + + FLAG_LS2 + desc FLAG_LS2 + 1 + 1 + read-only + + + FLAG_EQ2 + desc FLAG_EQ2 + 2 + 2 + read-only + + + FLAG_GT2 + desc FLAG_GT2 + 3 + 3 + read-only + + + FLAG_LS1 + desc FLAG_LS1 + 4 + 4 + read-only + + + FLAG_EQ1 + desc FLAG_EQ1 + 5 + 5 + read-only + + + FLAG_GT1 + desc FLAG_GT1 + 6 + 6 + read-only + + + FLAG_RLD + desc FLAG_RLD + 9 + 9 + read-only + + + FLAG_BTM + desc FLAG_BTM + 10 + 10 + read-only + + + FLAG_TOP + desc FLAG_TOP + 11 + 11 + read-only + + + + + DATA0 + desc DATA0 + 0x8 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DATA1 + desc DATA1 + 0xC + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DATA2 + desc DATA2 + 0x10 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + FLAGCLR + desc FLAGCLR + 0x14 + 32 + write-only + 0x0 + 0xE7F + + + CLR_OP + desc CLR_OP + 0 + 0 + write-only + + + CLR_LS2 + desc CLR_LS2 + 1 + 1 + write-only + + + CLR_EQ2 + desc CLR_EQ2 + 2 + 2 + write-only + + + CLR_GT2 + desc CLR_GT2 + 3 + 3 + write-only + + + CLR_LS1 + desc CLR_LS1 + 4 + 4 + write-only + + + CLR_EQ1 + desc CLR_EQ1 + 5 + 5 + write-only + + + CLR_GT1 + desc CLR_GT1 + 6 + 6 + write-only + + + CLR_RLD + desc CLR_RLD + 9 + 9 + read-write + + + CLR_BTM + desc CLR_BTM + 10 + 10 + read-write + + + CLR_TOP + desc CLR_TOP + 11 + 11 + read-write + + + + + INTEVTSEL + desc INTEVTSEL + 0x18 + 32 + read-write + 0x0 + 0xFFF + + + SEL_OP + desc SEL_OP + 0 + 0 + read-write + + + SEL_LS2 + desc SEL_LS2 + 1 + 1 + read-write + + + SEL_EQ2 + desc SEL_EQ2 + 2 + 2 + read-write + + + SEL_GT2 + desc SEL_GT2 + 3 + 3 + read-write + + + SEL_LS1 + desc SEL_LS1 + 4 + 4 + read-write + + + SEL_EQ1 + desc SEL_EQ1 + 5 + 5 + read-write + + + SEL_GT1 + desc SEL_GT1 + 6 + 6 + read-write + + + SEL_WIN + desc SEL_WIN + 8 + 7 + read-write + + + SEL_RLD + desc SEL_RLD + 9 + 9 + read-write + + + SEL_BTM + desc SEL_BTM + 10 + 10 + read-write + + + SEL_TOP + desc SEL_TOP + 11 + 11 + read-write + + + + + + + DCU8 + desc DCU8 + 0x40057C00 + + 0x0 + 0x1C + + + + CTL + desc CTL + 0x0 + 32 + read-write + 0x80000000 + 0x8000013F + + + MODE + desc MODE + 3 + 0 + read-write + + + DATASIZE + desc DATASIZE + 5 + 4 + read-write + + + COMP_TRG + desc COMP_TRG + 8 + 8 + read-write + + + INTEN + desc INTEN + 31 + 31 + read-write + + + + + FLAG + desc FLAG + 0x4 + 32 + read-only + 0x0 + 0xE7F + + + FLAG_OP + desc FLAG_OP + 0 + 0 + read-only + + + FLAG_LS2 + desc FLAG_LS2 + 1 + 1 + read-only + + + FLAG_EQ2 + desc FLAG_EQ2 + 2 + 2 + read-only + + + FLAG_GT2 + desc FLAG_GT2 + 3 + 3 + read-only + + + FLAG_LS1 + desc FLAG_LS1 + 4 + 4 + read-only + + + FLAG_EQ1 + desc FLAG_EQ1 + 5 + 5 + read-only + + + FLAG_GT1 + desc FLAG_GT1 + 6 + 6 + read-only + + + FLAG_RLD + desc FLAG_RLD + 9 + 9 + read-only + + + FLAG_BTM + desc FLAG_BTM + 10 + 10 + read-only + + + FLAG_TOP + desc FLAG_TOP + 11 + 11 + read-only + + + + + DATA0 + desc DATA0 + 0x8 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DATA1 + desc DATA1 + 0xC + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DATA2 + desc DATA2 + 0x10 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + FLAGCLR + desc FLAGCLR + 0x14 + 32 + write-only + 0x0 + 0xE7F + + + CLR_OP + desc CLR_OP + 0 + 0 + write-only + + + CLR_LS2 + desc CLR_LS2 + 1 + 1 + write-only + + + CLR_EQ2 + desc CLR_EQ2 + 2 + 2 + write-only + + + CLR_GT2 + desc CLR_GT2 + 3 + 3 + write-only + + + CLR_LS1 + desc CLR_LS1 + 4 + 4 + write-only + + + CLR_EQ1 + desc CLR_EQ1 + 5 + 5 + write-only + + + CLR_GT1 + desc CLR_GT1 + 6 + 6 + write-only + + + CLR_RLD + desc CLR_RLD + 9 + 9 + read-write + + + CLR_BTM + desc CLR_BTM + 10 + 10 + read-write + + + CLR_TOP + desc CLR_TOP + 11 + 11 + read-write + + + + + INTEVTSEL + desc INTEVTSEL + 0x18 + 32 + read-write + 0x0 + 0xFFF + + + SEL_OP + desc SEL_OP + 0 + 0 + read-write + + + SEL_LS2 + desc SEL_LS2 + 1 + 1 + read-write + + + SEL_EQ2 + desc SEL_EQ2 + 2 + 2 + read-write + + + SEL_GT2 + desc SEL_GT2 + 3 + 3 + read-write + + + SEL_LS1 + desc SEL_LS1 + 4 + 4 + read-write + + + SEL_EQ1 + desc SEL_EQ1 + 5 + 5 + read-write + + + SEL_GT1 + desc SEL_GT1 + 6 + 6 + read-write + + + SEL_WIN + desc SEL_WIN + 8 + 7 + read-write + + + SEL_RLD + desc SEL_RLD + 9 + 9 + read-write + + + SEL_BTM + desc SEL_BTM + 10 + 10 + read-write + + + SEL_TOP + desc SEL_TOP + 11 + 11 + read-write + + + + + + + DMA1 + desc DMA1 + 0x40053000 + + 0x0 + 0x238 + + + + EN + desc EN + 0x0 + 32 + read-write + 0x0 + 0x1 + + + EN + desc EN + 0 + 0 + read-write + + + + + INTSTAT0 + desc INTSTAT0 + 0x4 + 32 + read-only + 0x0 + 0xFF00FF + + + TRNERR + desc TRNERR + 7 + 0 + read-only + + + REQERR + desc REQERR + 23 + 16 + read-only + + + + + INTSTAT1 + desc INTSTAT1 + 0x8 + 32 + read-only + 0x0 + 0xFF00FF + + + TC + desc TC + 7 + 0 + read-only + + + BTC + desc BTC + 23 + 16 + read-only + + + + + INTMASK0 + desc INTMASK0 + 0xC + 32 + read-write + 0x0 + 0xFF00FF + + + MSKTRNERR + desc MSKTRNERR + 7 + 0 + read-write + + + MSKREQERR + desc MSKREQERR + 23 + 16 + read-write + + + + + INTMASK1 + desc INTMASK1 + 0x10 + 32 + read-write + 0x0 + 0xFF00FF + + + MSKTC + desc MSKTC + 7 + 0 + read-write + + + MSKBTC + desc MSKBTC + 23 + 16 + read-write + + + + + INTCLR0 + desc INTCLR0 + 0x14 + 32 + write-only + 0x0 + 0xFF00FF + + + CLRTRNERR + desc CLRTRNERR + 7 + 0 + write-only + + + CLRREQERR + desc CLRREQERR + 23 + 16 + write-only + + + + + INTCLR1 + desc INTCLR1 + 0x18 + 32 + write-only + 0x0 + 0xFF00FF + + + CLRTC + desc CLRTC + 7 + 0 + write-only + + + CLRBTC + desc CLRBTC + 23 + 16 + write-only + + + + + CHEN + desc CHEN + 0x1C + 32 + read-write + 0x0 + 0xFF + + + CHEN + desc CHEN + 7 + 0 + read-write + + + + + REQSTAT + desc REQSTAT + 0x20 + 32 + read-only + 0x0 + 0x80FF + + + CHREQ + desc CHREQ + 7 + 0 + read-only + + + RCFGREQ + desc RCFGREQ + 15 + 15 + read-only + + + + + CHSTAT + desc CHSTAT + 0x24 + 32 + read-only + 0x0 + 0xFF0003 + + + DMAACT + desc DMAACT + 0 + 0 + read-only + + + RCFGACT + desc RCFGACT + 1 + 1 + read-only + + + CHACT + desc CHACT + 23 + 16 + read-only + + + + + RCFGCTL + desc RCFGCTL + 0x2C + 32 + read-write + 0x0 + 0x3F0F03 + + + RCFGEN + desc RCFGEN + 0 + 0 + read-write + + + RCFGLLP + desc RCFGLLP + 1 + 1 + read-write + + + RCFGCHS + desc RCFGCHS + 11 + 8 + read-write + + + SARMD + desc SARMD + 17 + 16 + read-write + + + DARMD + desc DARMD + 19 + 18 + read-write + + + CNTMD + desc CNTMD + 21 + 20 + read-write + + + + + CHENCLR + desc CHENCLR + 0x34 + 32 + write-only + 0x0 + 0xFF + + + CHENCLR + desc CHENCLR + 7 + 0 + write-only + + + + + SAR0 + desc SAR0 + 0x40 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DAR0 + desc DAR0 + 0x44 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTCTL0 + desc DTCTL0 + 0x48 + 32 + read-write + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-write + + + CNT + desc CNT + 31 + 16 + read-write + + + + + RPT0 + desc RPT0 + 0x4C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-write + + + DRPT + desc DRPT + 25 + 16 + read-write + + + + + RPTB0 + desc RPTB0 + 0x4C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPTB + desc SRPTB + 9 + 0 + read-write + + + DRPTB + desc DRPTB + 25 + 16 + read-write + + + + + SNSEQCTL0 + desc SNSEQCTL0 + 0x50 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-write + + + SNSCNT + desc SNSCNT + 31 + 20 + read-write + + + + + SNSEQCTLB0 + desc SNSEQCTLB0 + 0x50 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SNSDIST + desc SNSDIST + 19 + 0 + read-write + + + SNSCNTB + desc SNSCNTB + 31 + 20 + read-write + + + + + DNSEQCTL0 + desc DNSEQCTL0 + 0x54 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-write + + + DNSCNT + desc DNSCNT + 31 + 20 + read-write + + + + + DNSEQCTLB0 + desc DNSEQCTLB0 + 0x54 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DNSDIST + desc DNSDIST + 19 + 0 + read-write + + + DNSCNTB + desc DNSCNTB + 31 + 20 + read-write + + + + + LLP0 + desc LLP0 + 0x58 + 32 + read-write + 0x0 + 0xFFFFFFFC + + + LLP + desc LLP + 31 + 2 + read-write + + + + + CHCTL0 + desc CHCTL0 + 0x5C + 32 + read-write + 0x1000 + 0x1FFF + + + SINC + desc SINC + 1 + 0 + read-write + + + DINC + desc DINC + 3 + 2 + read-write + + + SRTPEN + desc SRTPEN + 4 + 4 + read-write + + + DRPTEN + desc DRPTEN + 5 + 5 + read-write + + + SNSEQEN + desc SNSEQEN + 6 + 6 + read-write + + + DNSEQEN + desc DNSEQEN + 7 + 7 + read-write + + + HSIZE + desc HSIZE + 9 + 8 + read-write + + + LLPEN + desc LLPEN + 10 + 10 + read-write + + + LLPRUN + desc LLPRUN + 11 + 11 + read-write + + + IE + desc IE + 12 + 12 + read-write + + + + + MONSAR0 + desc MONSAR0 + 0x60 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDAR0 + desc MONDAR0 + 0x64 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDTCTL0 + desc MONDTCTL0 + 0x68 + 32 + read-only + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-only + + + CNT + desc CNT + 31 + 16 + read-only + + + + + MONRPT0 + desc MONRPT0 + 0x6C + 32 + read-only + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-only + + + DRPT + desc DRPT + 25 + 16 + read-only + + + + + MONSNSEQCTL0 + desc MONSNSEQCTL0 + 0x70 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-only + + + SNSCNT + desc SNSCNT + 31 + 20 + read-only + + + + + MONDNSEQCTL0 + desc MONDNSEQCTL0 + 0x74 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-only + + + DNSCNT + desc DNSCNT + 31 + 20 + read-only + + + + + SAR1 + desc SAR1 + 0x80 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DAR1 + desc DAR1 + 0x84 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTCTL1 + desc DTCTL1 + 0x88 + 32 + read-write + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-write + + + CNT + desc CNT + 31 + 16 + read-write + + + + + RPT1 + desc RPT1 + 0x8C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-write + + + DRPT + desc DRPT + 25 + 16 + read-write + + + + + RPTB1 + desc RPTB1 + 0x8C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPTB + desc SRPTB + 9 + 0 + read-write + + + DRPTB + desc DRPTB + 25 + 16 + read-write + + + + + SNSEQCTL1 + desc SNSEQCTL1 + 0x90 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-write + + + SNSCNT + desc SNSCNT + 31 + 20 + read-write + + + + + SNSEQCTLB1 + desc SNSEQCTLB1 + 0x90 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SNSDIST + desc SNSDIST + 19 + 0 + read-write + + + SNSCNTB + desc SNSCNTB + 31 + 20 + read-write + + + + + DNSEQCTL1 + desc DNSEQCTL1 + 0x94 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-write + + + DNSCNT + desc DNSCNT + 31 + 20 + read-write + + + + + DNSEQCTLB1 + desc DNSEQCTLB1 + 0x94 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DNSDIST + desc DNSDIST + 19 + 0 + read-write + + + DNSCNTB + desc DNSCNTB + 31 + 20 + read-write + + + + + LLP1 + desc LLP1 + 0x98 + 32 + read-write + 0x0 + 0xFFFFFFFC + + + LLP + desc LLP + 31 + 2 + read-write + + + + + CHCTL1 + desc CHCTL1 + 0x9C + 32 + read-write + 0x1000 + 0x1FFF + + + SINC + desc SINC + 1 + 0 + read-write + + + DINC + desc DINC + 3 + 2 + read-write + + + SRTPEN + desc SRTPEN + 4 + 4 + read-write + + + DRPTEN + desc DRPTEN + 5 + 5 + read-write + + + SNSEQEN + desc SNSEQEN + 6 + 6 + read-write + + + DNSEQEN + desc DNSEQEN + 7 + 7 + read-write + + + HSIZE + desc HSIZE + 9 + 8 + read-write + + + LLPEN + desc LLPEN + 10 + 10 + read-write + + + LLPRUN + desc LLPRUN + 11 + 11 + read-write + + + IE + desc IE + 12 + 12 + read-write + + + + + MONSAR1 + desc MONSAR1 + 0xA0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDAR1 + desc MONDAR1 + 0xA4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDTCTL1 + desc MONDTCTL1 + 0xA8 + 32 + read-only + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-only + + + CNT + desc CNT + 31 + 16 + read-only + + + + + MONRPT1 + desc MONRPT1 + 0xAC + 32 + read-only + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-only + + + DRPT + desc DRPT + 25 + 16 + read-only + + + + + MONSNSEQCTL1 + desc MONSNSEQCTL1 + 0xB0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-only + + + SNSCNT + desc SNSCNT + 31 + 20 + read-only + + + + + MONDNSEQCTL1 + desc MONDNSEQCTL1 + 0xB4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-only + + + DNSCNT + desc DNSCNT + 31 + 20 + read-only + + + + + SAR2 + desc SAR2 + 0xC0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DAR2 + desc DAR2 + 0xC4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTCTL2 + desc DTCTL2 + 0xC8 + 32 + read-write + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-write + + + CNT + desc CNT + 31 + 16 + read-write + + + + + RPT2 + desc RPT2 + 0xCC + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-write + + + DRPT + desc DRPT + 25 + 16 + read-write + + + + + RPTB2 + desc RPTB2 + 0xCC + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPTB + desc SRPTB + 9 + 0 + read-write + + + DRPTB + desc DRPTB + 25 + 16 + read-write + + + + + SNSEQCTL2 + desc SNSEQCTL2 + 0xD0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-write + + + SNSCNT + desc SNSCNT + 31 + 20 + read-write + + + + + SNSEQCTLB2 + desc SNSEQCTLB2 + 0xD0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SNSDIST + desc SNSDIST + 19 + 0 + read-write + + + SNSCNTB + desc SNSCNTB + 31 + 20 + read-write + + + + + DNSEQCTL2 + desc DNSEQCTL2 + 0xD4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-write + + + DNSCNT + desc DNSCNT + 31 + 20 + read-write + + + + + DNSEQCTLB2 + desc DNSEQCTLB2 + 0xD4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DNSDIST + desc DNSDIST + 19 + 0 + read-write + + + DNSCNTB + desc DNSCNTB + 31 + 20 + read-write + + + + + LLP2 + desc LLP2 + 0xD8 + 32 + read-write + 0x0 + 0xFFFFFFFC + + + LLP + desc LLP + 31 + 2 + read-write + + + + + CHCTL2 + desc CHCTL2 + 0xDC + 32 + read-write + 0x1000 + 0x1FFF + + + SINC + desc SINC + 1 + 0 + read-write + + + DINC + desc DINC + 3 + 2 + read-write + + + SRTPEN + desc SRTPEN + 4 + 4 + read-write + + + DRPTEN + desc DRPTEN + 5 + 5 + read-write + + + SNSEQEN + desc SNSEQEN + 6 + 6 + read-write + + + DNSEQEN + desc DNSEQEN + 7 + 7 + read-write + + + HSIZE + desc HSIZE + 9 + 8 + read-write + + + LLPEN + desc LLPEN + 10 + 10 + read-write + + + LLPRUN + desc LLPRUN + 11 + 11 + read-write + + + IE + desc IE + 12 + 12 + read-write + + + + + MONSAR2 + desc MONSAR2 + 0xE0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDAR2 + desc MONDAR2 + 0xE4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDTCTL2 + desc MONDTCTL2 + 0xE8 + 32 + read-only + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-only + + + CNT + desc CNT + 31 + 16 + read-only + + + + + MONRPT2 + desc MONRPT2 + 0xEC + 32 + read-only + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-only + + + DRPT + desc DRPT + 25 + 16 + read-only + + + + + MONSNSEQCTL2 + desc MONSNSEQCTL2 + 0xF0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-only + + + SNSCNT + desc SNSCNT + 31 + 20 + read-only + + + + + MONDNSEQCTL2 + desc MONDNSEQCTL2 + 0xF4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-only + + + DNSCNT + desc DNSCNT + 31 + 20 + read-only + + + + + SAR3 + desc SAR3 + 0x100 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DAR3 + desc DAR3 + 0x104 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTCTL3 + desc DTCTL3 + 0x108 + 32 + read-write + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-write + + + CNT + desc CNT + 31 + 16 + read-write + + + + + RPT3 + desc RPT3 + 0x10C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-write + + + DRPT + desc DRPT + 25 + 16 + read-write + + + + + RPTB3 + desc RPTB3 + 0x10C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPTB + desc SRPTB + 9 + 0 + read-write + + + DRPTB + desc DRPTB + 25 + 16 + read-write + + + + + SNSEQCTL3 + desc SNSEQCTL3 + 0x110 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-write + + + SNSCNT + desc SNSCNT + 31 + 20 + read-write + + + + + SNSEQCTLB3 + desc SNSEQCTLB3 + 0x110 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SNSDIST + desc SNSDIST + 19 + 0 + read-write + + + SNSCNTB + desc SNSCNTB + 31 + 20 + read-write + + + + + DNSEQCTL3 + desc DNSEQCTL3 + 0x114 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-write + + + DNSCNT + desc DNSCNT + 31 + 20 + read-write + + + + + DNSEQCTLB3 + desc DNSEQCTLB3 + 0x114 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DNSDIST + desc DNSDIST + 19 + 0 + read-write + + + DNSCNTB + desc DNSCNTB + 31 + 20 + read-write + + + + + LLP3 + desc LLP3 + 0x118 + 32 + read-write + 0x0 + 0xFFFFFFFC + + + LLP + desc LLP + 31 + 2 + read-write + + + + + CHCTL3 + desc CHCTL3 + 0x11C + 32 + read-write + 0x1000 + 0x1FFF + + + SINC + desc SINC + 1 + 0 + read-write + + + DINC + desc DINC + 3 + 2 + read-write + + + SRTPEN + desc SRTPEN + 4 + 4 + read-write + + + DRPTEN + desc DRPTEN + 5 + 5 + read-write + + + SNSEQEN + desc SNSEQEN + 6 + 6 + read-write + + + DNSEQEN + desc DNSEQEN + 7 + 7 + read-write + + + HSIZE + desc HSIZE + 9 + 8 + read-write + + + LLPEN + desc LLPEN + 10 + 10 + read-write + + + LLPRUN + desc LLPRUN + 11 + 11 + read-write + + + IE + desc IE + 12 + 12 + read-write + + + + + MONSAR3 + desc MONSAR3 + 0x120 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDAR3 + desc MONDAR3 + 0x124 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDTCTL3 + desc MONDTCTL3 + 0x128 + 32 + read-only + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-only + + + CNT + desc CNT + 31 + 16 + read-only + + + + + MONRPT3 + desc MONRPT3 + 0x12C + 32 + read-only + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-only + + + DRPT + desc DRPT + 25 + 16 + read-only + + + + + MONSNSEQCTL3 + desc MONSNSEQCTL3 + 0x130 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-only + + + SNSCNT + desc SNSCNT + 31 + 20 + read-only + + + + + MONDNSEQCTL3 + desc MONDNSEQCTL3 + 0x134 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-only + + + DNSCNT + desc DNSCNT + 31 + 20 + read-only + + + + + SAR4 + desc SAR4 + 0x140 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DAR4 + desc DAR4 + 0x144 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTCTL4 + desc DTCTL4 + 0x148 + 32 + read-write + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-write + + + CNT + desc CNT + 31 + 16 + read-write + + + + + RPT4 + desc RPT4 + 0x14C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-write + + + DRPT + desc DRPT + 25 + 16 + read-write + + + + + RPTB4 + desc RPTB4 + 0x14C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPTB + desc SRPTB + 9 + 0 + read-write + + + DRPTB + desc DRPTB + 25 + 16 + read-write + + + + + SNSEQCTL4 + desc SNSEQCTL4 + 0x150 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-write + + + SNSCNT + desc SNSCNT + 31 + 20 + read-write + + + + + SNSEQCTLB4 + desc SNSEQCTLB4 + 0x150 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SNSDIST + desc SNSDIST + 19 + 0 + read-write + + + SNSCNTB + desc SNSCNTB + 31 + 20 + read-write + + + + + DNSEQCTL4 + desc DNSEQCTL4 + 0x154 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-write + + + DNSCNT + desc DNSCNT + 31 + 20 + read-write + + + + + DNSEQCTLB4 + desc DNSEQCTLB4 + 0x154 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DNSDIST + desc DNSDIST + 19 + 0 + read-write + + + DNSCNTB + desc DNSCNTB + 31 + 20 + read-write + + + + + LLP4 + desc LLP4 + 0x158 + 32 + read-write + 0x0 + 0xFFFFFFFC + + + LLP + desc LLP + 31 + 2 + read-write + + + + + CHCTL4 + desc CHCTL4 + 0x15C + 32 + read-write + 0x1000 + 0x1FFF + + + SINC + desc SINC + 1 + 0 + read-write + + + DINC + desc DINC + 3 + 2 + read-write + + + SRTPEN + desc SRTPEN + 4 + 4 + read-write + + + DRPTEN + desc DRPTEN + 5 + 5 + read-write + + + SNSEQEN + desc SNSEQEN + 6 + 6 + read-write + + + DNSEQEN + desc DNSEQEN + 7 + 7 + read-write + + + HSIZE + desc HSIZE + 9 + 8 + read-write + + + LLPEN + desc LLPEN + 10 + 10 + read-write + + + LLPRUN + desc LLPRUN + 11 + 11 + read-write + + + IE + desc IE + 12 + 12 + read-write + + + + + MONSAR4 + desc MONSAR4 + 0x160 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDAR4 + desc MONDAR4 + 0x164 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDTCTL4 + desc MONDTCTL4 + 0x168 + 32 + read-only + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-only + + + CNT + desc CNT + 31 + 16 + read-only + + + + + MONRPT4 + desc MONRPT4 + 0x16C + 32 + read-only + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-only + + + DRPT + desc DRPT + 25 + 16 + read-only + + + + + MONSNSEQCTL4 + desc MONSNSEQCTL4 + 0x170 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-only + + + SNSCNT + desc SNSCNT + 31 + 20 + read-only + + + + + MONDNSEQCTL4 + desc MONDNSEQCTL4 + 0x174 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-only + + + DNSCNT + desc DNSCNT + 31 + 20 + read-only + + + + + SAR5 + desc SAR5 + 0x180 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DAR5 + desc DAR5 + 0x184 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTCTL5 + desc DTCTL5 + 0x188 + 32 + read-write + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-write + + + CNT + desc CNT + 31 + 16 + read-write + + + + + RPT5 + desc RPT5 + 0x18C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-write + + + DRPT + desc DRPT + 25 + 16 + read-write + + + + + RPTB5 + desc RPTB5 + 0x18C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPTB + desc SRPTB + 9 + 0 + read-write + + + DRPTB + desc DRPTB + 25 + 16 + read-write + + + + + SNSEQCTL5 + desc SNSEQCTL5 + 0x190 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-write + + + SNSCNT + desc SNSCNT + 31 + 20 + read-write + + + + + SNSEQCTLB5 + desc SNSEQCTLB5 + 0x190 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SNSDIST + desc SNSDIST + 19 + 0 + read-write + + + SNSCNTB + desc SNSCNTB + 31 + 20 + read-write + + + + + DNSEQCTL5 + desc DNSEQCTL5 + 0x194 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-write + + + DNSCNT + desc DNSCNT + 31 + 20 + read-write + + + + + DNSEQCTLB5 + desc DNSEQCTLB5 + 0x194 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DNSDIST + desc DNSDIST + 19 + 0 + read-write + + + DNSCNTB + desc DNSCNTB + 31 + 20 + read-write + + + + + LLP5 + desc LLP5 + 0x198 + 32 + read-write + 0x0 + 0xFFFFFFFC + + + LLP + desc LLP + 31 + 2 + read-write + + + + + CHCTL5 + desc CHCTL5 + 0x19C + 32 + read-write + 0x1000 + 0x1FFF + + + SINC + desc SINC + 1 + 0 + read-write + + + DINC + desc DINC + 3 + 2 + read-write + + + SRTPEN + desc SRTPEN + 4 + 4 + read-write + + + DRPTEN + desc DRPTEN + 5 + 5 + read-write + + + SNSEQEN + desc SNSEQEN + 6 + 6 + read-write + + + DNSEQEN + desc DNSEQEN + 7 + 7 + read-write + + + HSIZE + desc HSIZE + 9 + 8 + read-write + + + LLPEN + desc LLPEN + 10 + 10 + read-write + + + LLPRUN + desc LLPRUN + 11 + 11 + read-write + + + IE + desc IE + 12 + 12 + read-write + + + + + MONSAR5 + desc MONSAR5 + 0x1A0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDAR5 + desc MONDAR5 + 0x1A4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDTCTL5 + desc MONDTCTL5 + 0x1A8 + 32 + read-only + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-only + + + CNT + desc CNT + 31 + 16 + read-only + + + + + MONRPT5 + desc MONRPT5 + 0x1AC + 32 + read-only + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-only + + + DRPT + desc DRPT + 25 + 16 + read-only + + + + + MONSNSEQCTL5 + desc MONSNSEQCTL5 + 0x1B0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-only + + + SNSCNT + desc SNSCNT + 31 + 20 + read-only + + + + + MONDNSEQCTL5 + desc MONDNSEQCTL5 + 0x1B4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-only + + + DNSCNT + desc DNSCNT + 31 + 20 + read-only + + + + + SAR6 + desc SAR6 + 0x1C0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DAR6 + desc DAR6 + 0x1C4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTCTL6 + desc DTCTL6 + 0x1C8 + 32 + read-write + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-write + + + CNT + desc CNT + 31 + 16 + read-write + + + + + RPT6 + desc RPT6 + 0x1CC + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-write + + + DRPT + desc DRPT + 25 + 16 + read-write + + + + + RPTB6 + desc RPTB6 + 0x1CC + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPTB + desc SRPTB + 9 + 0 + read-write + + + DRPTB + desc DRPTB + 25 + 16 + read-write + + + + + SNSEQCTL6 + desc SNSEQCTL6 + 0x1D0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-write + + + SNSCNT + desc SNSCNT + 31 + 20 + read-write + + + + + SNSEQCTLB6 + desc SNSEQCTLB6 + 0x1D0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SNSDIST + desc SNSDIST + 19 + 0 + read-write + + + SNSCNTB + desc SNSCNTB + 31 + 20 + read-write + + + + + DNSEQCTL6 + desc DNSEQCTL6 + 0x1D4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-write + + + DNSCNT + desc DNSCNT + 31 + 20 + read-write + + + + + DNSEQCTLB6 + desc DNSEQCTLB6 + 0x1D4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DNSDIST + desc DNSDIST + 19 + 0 + read-write + + + DNSCNTB + desc DNSCNTB + 31 + 20 + read-write + + + + + LLP6 + desc LLP6 + 0x1D8 + 32 + read-write + 0x0 + 0xFFFFFFFC + + + LLP + desc LLP + 31 + 2 + read-write + + + + + CHCTL6 + desc CHCTL6 + 0x1DC + 32 + read-write + 0x1000 + 0x1FFF + + + SINC + desc SINC + 1 + 0 + read-write + + + DINC + desc DINC + 3 + 2 + read-write + + + SRTPEN + desc SRTPEN + 4 + 4 + read-write + + + DRPTEN + desc DRPTEN + 5 + 5 + read-write + + + SNSEQEN + desc SNSEQEN + 6 + 6 + read-write + + + DNSEQEN + desc DNSEQEN + 7 + 7 + read-write + + + HSIZE + desc HSIZE + 9 + 8 + read-write + + + LLPEN + desc LLPEN + 10 + 10 + read-write + + + LLPRUN + desc LLPRUN + 11 + 11 + read-write + + + IE + desc IE + 12 + 12 + read-write + + + + + MONSAR6 + desc MONSAR6 + 0x1E0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDAR6 + desc MONDAR6 + 0x1E4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDTCTL6 + desc MONDTCTL6 + 0x1E8 + 32 + read-only + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-only + + + CNT + desc CNT + 31 + 16 + read-only + + + + + MONRPT6 + desc MONRPT6 + 0x1EC + 32 + read-only + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-only + + + DRPT + desc DRPT + 25 + 16 + read-only + + + + + MONSNSEQCTL6 + desc MONSNSEQCTL6 + 0x1F0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-only + + + SNSCNT + desc SNSCNT + 31 + 20 + read-only + + + + + MONDNSEQCTL6 + desc MONDNSEQCTL6 + 0x1F4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-only + + + DNSCNT + desc DNSCNT + 31 + 20 + read-only + + + + + SAR7 + desc SAR7 + 0x200 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DAR7 + desc DAR7 + 0x204 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTCTL7 + desc DTCTL7 + 0x208 + 32 + read-write + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-write + + + CNT + desc CNT + 31 + 16 + read-write + + + + + RPT7 + desc RPT7 + 0x20C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-write + + + DRPT + desc DRPT + 25 + 16 + read-write + + + + + RPTB7 + desc RPTB7 + 0x20C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPTB + desc SRPTB + 9 + 0 + read-write + + + DRPTB + desc DRPTB + 25 + 16 + read-write + + + + + SNSEQCTL7 + desc SNSEQCTL7 + 0x210 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-write + + + SNSCNT + desc SNSCNT + 31 + 20 + read-write + + + + + SNSEQCTLB7 + desc SNSEQCTLB7 + 0x210 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SNSDIST + desc SNSDIST + 19 + 0 + read-write + + + SNSCNTB + desc SNSCNTB + 31 + 20 + read-write + + + + + DNSEQCTL7 + desc DNSEQCTL7 + 0x214 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-write + + + DNSCNT + desc DNSCNT + 31 + 20 + read-write + + + + + DNSEQCTLB7 + desc DNSEQCTLB7 + 0x214 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DNSDIST + desc DNSDIST + 19 + 0 + read-write + + + DNSCNTB + desc DNSCNTB + 31 + 20 + read-write + + + + + LLP7 + desc LLP7 + 0x218 + 32 + read-write + 0x0 + 0xFFFFFFFC + + + LLP + desc LLP + 31 + 2 + read-write + + + + + CHCTL7 + desc CHCTL7 + 0x21C + 32 + read-write + 0x1000 + 0x1FFF + + + SINC + desc SINC + 1 + 0 + read-write + + + DINC + desc DINC + 3 + 2 + read-write + + + SRTPEN + desc SRTPEN + 4 + 4 + read-write + + + DRPTEN + desc DRPTEN + 5 + 5 + read-write + + + SNSEQEN + desc SNSEQEN + 6 + 6 + read-write + + + DNSEQEN + desc DNSEQEN + 7 + 7 + read-write + + + HSIZE + desc HSIZE + 9 + 8 + read-write + + + LLPEN + desc LLPEN + 10 + 10 + read-write + + + LLPRUN + desc LLPRUN + 11 + 11 + read-write + + + IE + desc IE + 12 + 12 + read-write + + + + + MONSAR7 + desc MONSAR7 + 0x220 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDAR7 + desc MONDAR7 + 0x224 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDTCTL7 + desc MONDTCTL7 + 0x228 + 32 + read-only + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-only + + + CNT + desc CNT + 31 + 16 + read-only + + + + + MONRPT7 + desc MONRPT7 + 0x22C + 32 + read-only + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-only + + + DRPT + desc DRPT + 25 + 16 + read-only + + + + + MONSNSEQCTL7 + desc MONSNSEQCTL7 + 0x230 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-only + + + SNSCNT + desc SNSCNT + 31 + 20 + read-only + + + + + MONDNSEQCTL7 + desc MONDNSEQCTL7 + 0x234 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-only + + + DNSCNT + desc DNSCNT + 31 + 20 + read-only + + + + + + + DMA2 + desc DMA2 + 0x40053400 + + 0x0 + 0x238 + + + + EN + desc EN + 0x0 + 32 + read-write + 0x0 + 0x1 + + + EN + desc EN + 0 + 0 + read-write + + + + + INTSTAT0 + desc INTSTAT0 + 0x4 + 32 + read-only + 0x0 + 0xFF00FF + + + TRNERR + desc TRNERR + 7 + 0 + read-only + + + REQERR + desc REQERR + 23 + 16 + read-only + + + + + INTSTAT1 + desc INTSTAT1 + 0x8 + 32 + read-only + 0x0 + 0xFF00FF + + + TC + desc TC + 7 + 0 + read-only + + + BTC + desc BTC + 23 + 16 + read-only + + + + + INTMASK0 + desc INTMASK0 + 0xC + 32 + read-write + 0x0 + 0xFF00FF + + + MSKTRNERR + desc MSKTRNERR + 7 + 0 + read-write + + + MSKREQERR + desc MSKREQERR + 23 + 16 + read-write + + + + + INTMASK1 + desc INTMASK1 + 0x10 + 32 + read-write + 0x0 + 0xFF00FF + + + MSKTC + desc MSKTC + 7 + 0 + read-write + + + MSKBTC + desc MSKBTC + 23 + 16 + read-write + + + + + INTCLR0 + desc INTCLR0 + 0x14 + 32 + write-only + 0x0 + 0xFF00FF + + + CLRTRNERR + desc CLRTRNERR + 7 + 0 + write-only + + + CLRREQERR + desc CLRREQERR + 23 + 16 + write-only + + + + + INTCLR1 + desc INTCLR1 + 0x18 + 32 + write-only + 0x0 + 0xFF00FF + + + CLRTC + desc CLRTC + 7 + 0 + write-only + + + CLRBTC + desc CLRBTC + 23 + 16 + write-only + + + + + CHEN + desc CHEN + 0x1C + 32 + read-write + 0x0 + 0xFF + + + CHEN + desc CHEN + 7 + 0 + read-write + + + + + REQSTAT + desc REQSTAT + 0x20 + 32 + read-only + 0x0 + 0x80FF + + + CHREQ + desc CHREQ + 7 + 0 + read-only + + + RCFGREQ + desc RCFGREQ + 15 + 15 + read-only + + + + + CHSTAT + desc CHSTAT + 0x24 + 32 + read-only + 0x0 + 0xFF0003 + + + DMAACT + desc DMAACT + 0 + 0 + read-only + + + RCFGACT + desc RCFGACT + 1 + 1 + read-only + + + CHACT + desc CHACT + 23 + 16 + read-only + + + + + RCFGCTL + desc RCFGCTL + 0x2C + 32 + read-write + 0x0 + 0x3F0F03 + + + RCFGEN + desc RCFGEN + 0 + 0 + read-write + + + RCFGLLP + desc RCFGLLP + 1 + 1 + read-write + + + RCFGCHS + desc RCFGCHS + 11 + 8 + read-write + + + SARMD + desc SARMD + 17 + 16 + read-write + + + DARMD + desc DARMD + 19 + 18 + read-write + + + CNTMD + desc CNTMD + 21 + 20 + read-write + + + + + CHENCLR + desc CHENCLR + 0x34 + 32 + write-only + 0x0 + 0xFF + + + CHENCLR + desc CHENCLR + 7 + 0 + write-only + + + + + SAR0 + desc SAR0 + 0x40 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DAR0 + desc DAR0 + 0x44 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTCTL0 + desc DTCTL0 + 0x48 + 32 + read-write + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-write + + + CNT + desc CNT + 31 + 16 + read-write + + + + + RPT0 + desc RPT0 + 0x4C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-write + + + DRPT + desc DRPT + 25 + 16 + read-write + + + + + RPTB0 + desc RPTB0 + 0x4C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPTB + desc SRPTB + 9 + 0 + read-write + + + DRPTB + desc DRPTB + 25 + 16 + read-write + + + + + SNSEQCTL0 + desc SNSEQCTL0 + 0x50 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-write + + + SNSCNT + desc SNSCNT + 31 + 20 + read-write + + + + + SNSEQCTLB0 + desc SNSEQCTLB0 + 0x50 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SNSDIST + desc SNSDIST + 19 + 0 + read-write + + + SNSCNTB + desc SNSCNTB + 31 + 20 + read-write + + + + + DNSEQCTL0 + desc DNSEQCTL0 + 0x54 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-write + + + DNSCNT + desc DNSCNT + 31 + 20 + read-write + + + + + DNSEQCTLB0 + desc DNSEQCTLB0 + 0x54 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DNSDIST + desc DNSDIST + 19 + 0 + read-write + + + DNSCNTB + desc DNSCNTB + 31 + 20 + read-write + + + + + LLP0 + desc LLP0 + 0x58 + 32 + read-write + 0x0 + 0xFFFFFFFC + + + LLP + desc LLP + 31 + 2 + read-write + + + + + CHCTL0 + desc CHCTL0 + 0x5C + 32 + read-write + 0x1000 + 0x1FFF + + + SINC + desc SINC + 1 + 0 + read-write + + + DINC + desc DINC + 3 + 2 + read-write + + + SRTPEN + desc SRTPEN + 4 + 4 + read-write + + + DRPTEN + desc DRPTEN + 5 + 5 + read-write + + + SNSEQEN + desc SNSEQEN + 6 + 6 + read-write + + + DNSEQEN + desc DNSEQEN + 7 + 7 + read-write + + + HSIZE + desc HSIZE + 9 + 8 + read-write + + + LLPEN + desc LLPEN + 10 + 10 + read-write + + + LLPRUN + desc LLPRUN + 11 + 11 + read-write + + + IE + desc IE + 12 + 12 + read-write + + + + + MONSAR0 + desc MONSAR0 + 0x60 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDAR0 + desc MONDAR0 + 0x64 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDTCTL0 + desc MONDTCTL0 + 0x68 + 32 + read-only + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-only + + + CNT + desc CNT + 31 + 16 + read-only + + + + + MONRPT0 + desc MONRPT0 + 0x6C + 32 + read-only + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-only + + + DRPT + desc DRPT + 25 + 16 + read-only + + + + + MONSNSEQCTL0 + desc MONSNSEQCTL0 + 0x70 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-only + + + SNSCNT + desc SNSCNT + 31 + 20 + read-only + + + + + MONDNSEQCTL0 + desc MONDNSEQCTL0 + 0x74 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-only + + + DNSCNT + desc DNSCNT + 31 + 20 + read-only + + + + + SAR1 + desc SAR1 + 0x80 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DAR1 + desc DAR1 + 0x84 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTCTL1 + desc DTCTL1 + 0x88 + 32 + read-write + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-write + + + CNT + desc CNT + 31 + 16 + read-write + + + + + RPT1 + desc RPT1 + 0x8C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-write + + + DRPT + desc DRPT + 25 + 16 + read-write + + + + + RPTB1 + desc RPTB1 + 0x8C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPTB + desc SRPTB + 9 + 0 + read-write + + + DRPTB + desc DRPTB + 25 + 16 + read-write + + + + + SNSEQCTL1 + desc SNSEQCTL1 + 0x90 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-write + + + SNSCNT + desc SNSCNT + 31 + 20 + read-write + + + + + SNSEQCTLB1 + desc SNSEQCTLB1 + 0x90 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SNSDIST + desc SNSDIST + 19 + 0 + read-write + + + SNSCNTB + desc SNSCNTB + 31 + 20 + read-write + + + + + DNSEQCTL1 + desc DNSEQCTL1 + 0x94 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-write + + + DNSCNT + desc DNSCNT + 31 + 20 + read-write + + + + + DNSEQCTLB1 + desc DNSEQCTLB1 + 0x94 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DNSDIST + desc DNSDIST + 19 + 0 + read-write + + + DNSCNTB + desc DNSCNTB + 31 + 20 + read-write + + + + + LLP1 + desc LLP1 + 0x98 + 32 + read-write + 0x0 + 0xFFFFFFFC + + + LLP + desc LLP + 31 + 2 + read-write + + + + + CHCTL1 + desc CHCTL1 + 0x9C + 32 + read-write + 0x1000 + 0x1FFF + + + SINC + desc SINC + 1 + 0 + read-write + + + DINC + desc DINC + 3 + 2 + read-write + + + SRTPEN + desc SRTPEN + 4 + 4 + read-write + + + DRPTEN + desc DRPTEN + 5 + 5 + read-write + + + SNSEQEN + desc SNSEQEN + 6 + 6 + read-write + + + DNSEQEN + desc DNSEQEN + 7 + 7 + read-write + + + HSIZE + desc HSIZE + 9 + 8 + read-write + + + LLPEN + desc LLPEN + 10 + 10 + read-write + + + LLPRUN + desc LLPRUN + 11 + 11 + read-write + + + IE + desc IE + 12 + 12 + read-write + + + + + MONSAR1 + desc MONSAR1 + 0xA0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDAR1 + desc MONDAR1 + 0xA4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDTCTL1 + desc MONDTCTL1 + 0xA8 + 32 + read-only + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-only + + + CNT + desc CNT + 31 + 16 + read-only + + + + + MONRPT1 + desc MONRPT1 + 0xAC + 32 + read-only + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-only + + + DRPT + desc DRPT + 25 + 16 + read-only + + + + + MONSNSEQCTL1 + desc MONSNSEQCTL1 + 0xB0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-only + + + SNSCNT + desc SNSCNT + 31 + 20 + read-only + + + + + MONDNSEQCTL1 + desc MONDNSEQCTL1 + 0xB4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-only + + + DNSCNT + desc DNSCNT + 31 + 20 + read-only + + + + + SAR2 + desc SAR2 + 0xC0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DAR2 + desc DAR2 + 0xC4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTCTL2 + desc DTCTL2 + 0xC8 + 32 + read-write + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-write + + + CNT + desc CNT + 31 + 16 + read-write + + + + + RPT2 + desc RPT2 + 0xCC + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-write + + + DRPT + desc DRPT + 25 + 16 + read-write + + + + + RPTB2 + desc RPTB2 + 0xCC + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPTB + desc SRPTB + 9 + 0 + read-write + + + DRPTB + desc DRPTB + 25 + 16 + read-write + + + + + SNSEQCTL2 + desc SNSEQCTL2 + 0xD0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-write + + + SNSCNT + desc SNSCNT + 31 + 20 + read-write + + + + + SNSEQCTLB2 + desc SNSEQCTLB2 + 0xD0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SNSDIST + desc SNSDIST + 19 + 0 + read-write + + + SNSCNTB + desc SNSCNTB + 31 + 20 + read-write + + + + + DNSEQCTL2 + desc DNSEQCTL2 + 0xD4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-write + + + DNSCNT + desc DNSCNT + 31 + 20 + read-write + + + + + DNSEQCTLB2 + desc DNSEQCTLB2 + 0xD4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DNSDIST + desc DNSDIST + 19 + 0 + read-write + + + DNSCNTB + desc DNSCNTB + 31 + 20 + read-write + + + + + LLP2 + desc LLP2 + 0xD8 + 32 + read-write + 0x0 + 0xFFFFFFFC + + + LLP + desc LLP + 31 + 2 + read-write + + + + + CHCTL2 + desc CHCTL2 + 0xDC + 32 + read-write + 0x1000 + 0x1FFF + + + SINC + desc SINC + 1 + 0 + read-write + + + DINC + desc DINC + 3 + 2 + read-write + + + SRTPEN + desc SRTPEN + 4 + 4 + read-write + + + DRPTEN + desc DRPTEN + 5 + 5 + read-write + + + SNSEQEN + desc SNSEQEN + 6 + 6 + read-write + + + DNSEQEN + desc DNSEQEN + 7 + 7 + read-write + + + HSIZE + desc HSIZE + 9 + 8 + read-write + + + LLPEN + desc LLPEN + 10 + 10 + read-write + + + LLPRUN + desc LLPRUN + 11 + 11 + read-write + + + IE + desc IE + 12 + 12 + read-write + + + + + MONSAR2 + desc MONSAR2 + 0xE0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDAR2 + desc MONDAR2 + 0xE4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDTCTL2 + desc MONDTCTL2 + 0xE8 + 32 + read-only + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-only + + + CNT + desc CNT + 31 + 16 + read-only + + + + + MONRPT2 + desc MONRPT2 + 0xEC + 32 + read-only + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-only + + + DRPT + desc DRPT + 25 + 16 + read-only + + + + + MONSNSEQCTL2 + desc MONSNSEQCTL2 + 0xF0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-only + + + SNSCNT + desc SNSCNT + 31 + 20 + read-only + + + + + MONDNSEQCTL2 + desc MONDNSEQCTL2 + 0xF4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-only + + + DNSCNT + desc DNSCNT + 31 + 20 + read-only + + + + + SAR3 + desc SAR3 + 0x100 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DAR3 + desc DAR3 + 0x104 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTCTL3 + desc DTCTL3 + 0x108 + 32 + read-write + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-write + + + CNT + desc CNT + 31 + 16 + read-write + + + + + RPT3 + desc RPT3 + 0x10C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-write + + + DRPT + desc DRPT + 25 + 16 + read-write + + + + + RPTB3 + desc RPTB3 + 0x10C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPTB + desc SRPTB + 9 + 0 + read-write + + + DRPTB + desc DRPTB + 25 + 16 + read-write + + + + + SNSEQCTL3 + desc SNSEQCTL3 + 0x110 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-write + + + SNSCNT + desc SNSCNT + 31 + 20 + read-write + + + + + SNSEQCTLB3 + desc SNSEQCTLB3 + 0x110 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SNSDIST + desc SNSDIST + 19 + 0 + read-write + + + SNSCNTB + desc SNSCNTB + 31 + 20 + read-write + + + + + DNSEQCTL3 + desc DNSEQCTL3 + 0x114 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-write + + + DNSCNT + desc DNSCNT + 31 + 20 + read-write + + + + + DNSEQCTLB3 + desc DNSEQCTLB3 + 0x114 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DNSDIST + desc DNSDIST + 19 + 0 + read-write + + + DNSCNTB + desc DNSCNTB + 31 + 20 + read-write + + + + + LLP3 + desc LLP3 + 0x118 + 32 + read-write + 0x0 + 0xFFFFFFFC + + + LLP + desc LLP + 31 + 2 + read-write + + + + + CHCTL3 + desc CHCTL3 + 0x11C + 32 + read-write + 0x1000 + 0x1FFF + + + SINC + desc SINC + 1 + 0 + read-write + + + DINC + desc DINC + 3 + 2 + read-write + + + SRTPEN + desc SRTPEN + 4 + 4 + read-write + + + DRPTEN + desc DRPTEN + 5 + 5 + read-write + + + SNSEQEN + desc SNSEQEN + 6 + 6 + read-write + + + DNSEQEN + desc DNSEQEN + 7 + 7 + read-write + + + HSIZE + desc HSIZE + 9 + 8 + read-write + + + LLPEN + desc LLPEN + 10 + 10 + read-write + + + LLPRUN + desc LLPRUN + 11 + 11 + read-write + + + IE + desc IE + 12 + 12 + read-write + + + + + MONSAR3 + desc MONSAR3 + 0x120 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDAR3 + desc MONDAR3 + 0x124 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDTCTL3 + desc MONDTCTL3 + 0x128 + 32 + read-only + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-only + + + CNT + desc CNT + 31 + 16 + read-only + + + + + MONRPT3 + desc MONRPT3 + 0x12C + 32 + read-only + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-only + + + DRPT + desc DRPT + 25 + 16 + read-only + + + + + MONSNSEQCTL3 + desc MONSNSEQCTL3 + 0x130 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-only + + + SNSCNT + desc SNSCNT + 31 + 20 + read-only + + + + + MONDNSEQCTL3 + desc MONDNSEQCTL3 + 0x134 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-only + + + DNSCNT + desc DNSCNT + 31 + 20 + read-only + + + + + SAR4 + desc SAR4 + 0x140 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DAR4 + desc DAR4 + 0x144 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTCTL4 + desc DTCTL4 + 0x148 + 32 + read-write + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-write + + + CNT + desc CNT + 31 + 16 + read-write + + + + + RPT4 + desc RPT4 + 0x14C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-write + + + DRPT + desc DRPT + 25 + 16 + read-write + + + + + RPTB4 + desc RPTB4 + 0x14C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPTB + desc SRPTB + 9 + 0 + read-write + + + DRPTB + desc DRPTB + 25 + 16 + read-write + + + + + SNSEQCTL4 + desc SNSEQCTL4 + 0x150 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-write + + + SNSCNT + desc SNSCNT + 31 + 20 + read-write + + + + + SNSEQCTLB4 + desc SNSEQCTLB4 + 0x150 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SNSDIST + desc SNSDIST + 19 + 0 + read-write + + + SNSCNTB + desc SNSCNTB + 31 + 20 + read-write + + + + + DNSEQCTL4 + desc DNSEQCTL4 + 0x154 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-write + + + DNSCNT + desc DNSCNT + 31 + 20 + read-write + + + + + DNSEQCTLB4 + desc DNSEQCTLB4 + 0x154 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DNSDIST + desc DNSDIST + 19 + 0 + read-write + + + DNSCNTB + desc DNSCNTB + 31 + 20 + read-write + + + + + LLP4 + desc LLP4 + 0x158 + 32 + read-write + 0x0 + 0xFFFFFFFC + + + LLP + desc LLP + 31 + 2 + read-write + + + + + CHCTL4 + desc CHCTL4 + 0x15C + 32 + read-write + 0x1000 + 0x1FFF + + + SINC + desc SINC + 1 + 0 + read-write + + + DINC + desc DINC + 3 + 2 + read-write + + + SRTPEN + desc SRTPEN + 4 + 4 + read-write + + + DRPTEN + desc DRPTEN + 5 + 5 + read-write + + + SNSEQEN + desc SNSEQEN + 6 + 6 + read-write + + + DNSEQEN + desc DNSEQEN + 7 + 7 + read-write + + + HSIZE + desc HSIZE + 9 + 8 + read-write + + + LLPEN + desc LLPEN + 10 + 10 + read-write + + + LLPRUN + desc LLPRUN + 11 + 11 + read-write + + + IE + desc IE + 12 + 12 + read-write + + + + + MONSAR4 + desc MONSAR4 + 0x160 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDAR4 + desc MONDAR4 + 0x164 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDTCTL4 + desc MONDTCTL4 + 0x168 + 32 + read-only + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-only + + + CNT + desc CNT + 31 + 16 + read-only + + + + + MONRPT4 + desc MONRPT4 + 0x16C + 32 + read-only + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-only + + + DRPT + desc DRPT + 25 + 16 + read-only + + + + + MONSNSEQCTL4 + desc MONSNSEQCTL4 + 0x170 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-only + + + SNSCNT + desc SNSCNT + 31 + 20 + read-only + + + + + MONDNSEQCTL4 + desc MONDNSEQCTL4 + 0x174 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-only + + + DNSCNT + desc DNSCNT + 31 + 20 + read-only + + + + + SAR5 + desc SAR5 + 0x180 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DAR5 + desc DAR5 + 0x184 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTCTL5 + desc DTCTL5 + 0x188 + 32 + read-write + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-write + + + CNT + desc CNT + 31 + 16 + read-write + + + + + RPT5 + desc RPT5 + 0x18C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-write + + + DRPT + desc DRPT + 25 + 16 + read-write + + + + + RPTB5 + desc RPTB5 + 0x18C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPTB + desc SRPTB + 9 + 0 + read-write + + + DRPTB + desc DRPTB + 25 + 16 + read-write + + + + + SNSEQCTL5 + desc SNSEQCTL5 + 0x190 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-write + + + SNSCNT + desc SNSCNT + 31 + 20 + read-write + + + + + SNSEQCTLB5 + desc SNSEQCTLB5 + 0x190 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SNSDIST + desc SNSDIST + 19 + 0 + read-write + + + SNSCNTB + desc SNSCNTB + 31 + 20 + read-write + + + + + DNSEQCTL5 + desc DNSEQCTL5 + 0x194 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-write + + + DNSCNT + desc DNSCNT + 31 + 20 + read-write + + + + + DNSEQCTLB5 + desc DNSEQCTLB5 + 0x194 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DNSDIST + desc DNSDIST + 19 + 0 + read-write + + + DNSCNTB + desc DNSCNTB + 31 + 20 + read-write + + + + + LLP5 + desc LLP5 + 0x198 + 32 + read-write + 0x0 + 0xFFFFFFFC + + + LLP + desc LLP + 31 + 2 + read-write + + + + + CHCTL5 + desc CHCTL5 + 0x19C + 32 + read-write + 0x1000 + 0x1FFF + + + SINC + desc SINC + 1 + 0 + read-write + + + DINC + desc DINC + 3 + 2 + read-write + + + SRTPEN + desc SRTPEN + 4 + 4 + read-write + + + DRPTEN + desc DRPTEN + 5 + 5 + read-write + + + SNSEQEN + desc SNSEQEN + 6 + 6 + read-write + + + DNSEQEN + desc DNSEQEN + 7 + 7 + read-write + + + HSIZE + desc HSIZE + 9 + 8 + read-write + + + LLPEN + desc LLPEN + 10 + 10 + read-write + + + LLPRUN + desc LLPRUN + 11 + 11 + read-write + + + IE + desc IE + 12 + 12 + read-write + + + + + MONSAR5 + desc MONSAR5 + 0x1A0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDAR5 + desc MONDAR5 + 0x1A4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDTCTL5 + desc MONDTCTL5 + 0x1A8 + 32 + read-only + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-only + + + CNT + desc CNT + 31 + 16 + read-only + + + + + MONRPT5 + desc MONRPT5 + 0x1AC + 32 + read-only + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-only + + + DRPT + desc DRPT + 25 + 16 + read-only + + + + + MONSNSEQCTL5 + desc MONSNSEQCTL5 + 0x1B0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-only + + + SNSCNT + desc SNSCNT + 31 + 20 + read-only + + + + + MONDNSEQCTL5 + desc MONDNSEQCTL5 + 0x1B4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-only + + + DNSCNT + desc DNSCNT + 31 + 20 + read-only + + + + + SAR6 + desc SAR6 + 0x1C0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DAR6 + desc DAR6 + 0x1C4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTCTL6 + desc DTCTL6 + 0x1C8 + 32 + read-write + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-write + + + CNT + desc CNT + 31 + 16 + read-write + + + + + RPT6 + desc RPT6 + 0x1CC + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-write + + + DRPT + desc DRPT + 25 + 16 + read-write + + + + + RPTB6 + desc RPTB6 + 0x1CC + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPTB + desc SRPTB + 9 + 0 + read-write + + + DRPTB + desc DRPTB + 25 + 16 + read-write + + + + + SNSEQCTL6 + desc SNSEQCTL6 + 0x1D0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-write + + + SNSCNT + desc SNSCNT + 31 + 20 + read-write + + + + + SNSEQCTLB6 + desc SNSEQCTLB6 + 0x1D0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SNSDIST + desc SNSDIST + 19 + 0 + read-write + + + SNSCNTB + desc SNSCNTB + 31 + 20 + read-write + + + + + DNSEQCTL6 + desc DNSEQCTL6 + 0x1D4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-write + + + DNSCNT + desc DNSCNT + 31 + 20 + read-write + + + + + DNSEQCTLB6 + desc DNSEQCTLB6 + 0x1D4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DNSDIST + desc DNSDIST + 19 + 0 + read-write + + + DNSCNTB + desc DNSCNTB + 31 + 20 + read-write + + + + + LLP6 + desc LLP6 + 0x1D8 + 32 + read-write + 0x0 + 0xFFFFFFFC + + + LLP + desc LLP + 31 + 2 + read-write + + + + + CHCTL6 + desc CHCTL6 + 0x1DC + 32 + read-write + 0x1000 + 0x1FFF + + + SINC + desc SINC + 1 + 0 + read-write + + + DINC + desc DINC + 3 + 2 + read-write + + + SRTPEN + desc SRTPEN + 4 + 4 + read-write + + + DRPTEN + desc DRPTEN + 5 + 5 + read-write + + + SNSEQEN + desc SNSEQEN + 6 + 6 + read-write + + + DNSEQEN + desc DNSEQEN + 7 + 7 + read-write + + + HSIZE + desc HSIZE + 9 + 8 + read-write + + + LLPEN + desc LLPEN + 10 + 10 + read-write + + + LLPRUN + desc LLPRUN + 11 + 11 + read-write + + + IE + desc IE + 12 + 12 + read-write + + + + + MONSAR6 + desc MONSAR6 + 0x1E0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDAR6 + desc MONDAR6 + 0x1E4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDTCTL6 + desc MONDTCTL6 + 0x1E8 + 32 + read-only + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-only + + + CNT + desc CNT + 31 + 16 + read-only + + + + + MONRPT6 + desc MONRPT6 + 0x1EC + 32 + read-only + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-only + + + DRPT + desc DRPT + 25 + 16 + read-only + + + + + MONSNSEQCTL6 + desc MONSNSEQCTL6 + 0x1F0 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-only + + + SNSCNT + desc SNSCNT + 31 + 20 + read-only + + + + + MONDNSEQCTL6 + desc MONDNSEQCTL6 + 0x1F4 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-only + + + DNSCNT + desc DNSCNT + 31 + 20 + read-only + + + + + SAR7 + desc SAR7 + 0x200 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DAR7 + desc DAR7 + 0x204 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTCTL7 + desc DTCTL7 + 0x208 + 32 + read-write + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-write + + + CNT + desc CNT + 31 + 16 + read-write + + + + + RPT7 + desc RPT7 + 0x20C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-write + + + DRPT + desc DRPT + 25 + 16 + read-write + + + + + RPTB7 + desc RPTB7 + 0x20C + 32 + read-write + 0x0 + 0x3FF03FF + + + SRPTB + desc SRPTB + 9 + 0 + read-write + + + DRPTB + desc DRPTB + 25 + 16 + read-write + + + + + SNSEQCTL7 + desc SNSEQCTL7 + 0x210 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-write + + + SNSCNT + desc SNSCNT + 31 + 20 + read-write + + + + + SNSEQCTLB7 + desc SNSEQCTLB7 + 0x210 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SNSDIST + desc SNSDIST + 19 + 0 + read-write + + + SNSCNTB + desc SNSCNTB + 31 + 20 + read-write + + + + + DNSEQCTL7 + desc DNSEQCTL7 + 0x214 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-write + + + DNSCNT + desc DNSCNT + 31 + 20 + read-write + + + + + DNSEQCTLB7 + desc DNSEQCTLB7 + 0x214 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DNSDIST + desc DNSDIST + 19 + 0 + read-write + + + DNSCNTB + desc DNSCNTB + 31 + 20 + read-write + + + + + LLP7 + desc LLP7 + 0x218 + 32 + read-write + 0x0 + 0xFFFFFFFC + + + LLP + desc LLP + 31 + 2 + read-write + + + + + CHCTL7 + desc CHCTL7 + 0x21C + 32 + read-write + 0x1000 + 0x1FFF + + + SINC + desc SINC + 1 + 0 + read-write + + + DINC + desc DINC + 3 + 2 + read-write + + + SRTPEN + desc SRTPEN + 4 + 4 + read-write + + + DRPTEN + desc DRPTEN + 5 + 5 + read-write + + + SNSEQEN + desc SNSEQEN + 6 + 6 + read-write + + + DNSEQEN + desc DNSEQEN + 7 + 7 + read-write + + + HSIZE + desc HSIZE + 9 + 8 + read-write + + + LLPEN + desc LLPEN + 10 + 10 + read-write + + + LLPRUN + desc LLPRUN + 11 + 11 + read-write + + + IE + desc IE + 12 + 12 + read-write + + + + + MONSAR7 + desc MONSAR7 + 0x220 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDAR7 + desc MONDAR7 + 0x224 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + MONDTCTL7 + desc MONDTCTL7 + 0x228 + 32 + read-only + 0x1 + 0xFFFF03FF + + + BLKSIZE + desc BLKSIZE + 9 + 0 + read-only + + + CNT + desc CNT + 31 + 16 + read-only + + + + + MONRPT7 + desc MONRPT7 + 0x22C + 32 + read-only + 0x0 + 0x3FF03FF + + + SRPT + desc SRPT + 9 + 0 + read-only + + + DRPT + desc DRPT + 25 + 16 + read-only + + + + + MONSNSEQCTL7 + desc MONSNSEQCTL7 + 0x230 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + SOFFSET + desc SOFFSET + 19 + 0 + read-only + + + SNSCNT + desc SNSCNT + 31 + 20 + read-only + + + + + MONDNSEQCTL7 + desc MONDNSEQCTL7 + 0x234 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + DOFFSET + desc DOFFSET + 19 + 0 + read-only + + + DNSCNT + desc DNSCNT + 31 + 20 + read-only + + + + + + + DMC + desc DMC + 0x88000400 + + 0x0 + 0x304 + + + + STSR + desc STSR + 0x0 + 32 + read-only + 0x700 + 0xF + + + STATUS + desc STATUS + 1 + 0 + read-only + + + MEMMW + desc MEMMW + 3 + 2 + read-only + + + + + STCR + desc STCR + 0x4 + 32 + write-only + 0x0 + 0x7 + + + STCTL + desc STCTL + 2 + 0 + write-only + + + + + CMDR + desc CMDR + 0x8 + 32 + write-only + 0x0 + 0x13F3FFF + + + CMDADD + desc CMDADD + 13 + 0 + write-only + + + CMDBA + desc CMDBA + 17 + 16 + write-only + + + CMD + desc CMD + 19 + 18 + write-only + + + CMDCHIP + desc CMDCHIP + 21 + 20 + write-only + + + RESV5 + desc RESV5 + 24 + 24 + read-write + + + + + CPCR + desc CPCR + 0xC + 32 + read-write + 0x20040 + 0x307FFF7 + + + COLBS + desc COLBS + 2 + 0 + read-write + + + ROWBS + desc ROWBS + 6 + 4 + read-write + + + APBS + desc APBS + 7 + 7 + read-write + + + CKEDIS + desc CKEDIS + 8 + 8 + read-write + + + CKSTOP + desc CKSTOP + 9 + 9 + read-write + + + CKEDISPRD + desc CKEDISPRD + 15 + 10 + read-write + + + BURST + desc BURST + 18 + 16 + read-write + + + ACTCP + desc ACTCP + 25 + 24 + read-write + + + + + RFTR + desc RFTR + 0x10 + 32 + read-write + 0xA60 + 0x7FFF + + + REFPRD + desc REFPRD + 14 + 0 + read-write + + + + + TMCR_T_CASL + desc TMCR_T_CASL + 0x14 + 32 + read-write + 0x3 + 0x7 + + + T_CASL + desc T_CASL + 2 + 0 + read-write + + + + + TMCR_T_DQSS + desc TMCR_T_DQSS + 0x18 + 32 + read-write + 0x1 + 0x3 + + + T_DQSS + desc T_DQSS + 1 + 0 + read-write + + + + + TMCR_T_MRD + desc TMCR_T_MRD + 0x1C + 32 + read-write + 0x2 + 0x7F + + + T_MRD + desc T_MRD + 6 + 0 + read-write + + + + + TMCR_T_RAS + desc TMCR_T_RAS + 0x20 + 32 + read-write + 0x7 + 0xF + + + T_RAS + desc T_RAS + 3 + 0 + read-write + + + + + TMCR_T_RC + desc TMCR_T_RC + 0x24 + 32 + read-write + 0xB + 0xF + + + T_RC + desc T_RC + 3 + 0 + read-write + + + + + TMCR_T_RCD + desc TMCR_T_RCD + 0x28 + 32 + read-write + 0x35 + 0x7 + + + T_RCD + desc T_RCD + 2 + 0 + read-write + + + + + TMCR_T_RFC + desc TMCR_T_RFC + 0x2C + 32 + read-write + 0x1012 + 0x1F + + + T_RFC + desc T_RFC + 4 + 0 + read-write + + + + + TMCR_T_RP + desc TMCR_T_RP + 0x30 + 32 + read-write + 0x35 + 0x7 + + + T_RP + desc T_RP + 2 + 0 + read-write + + + + + TMCR_T_RRD + desc TMCR_T_RRD + 0x34 + 32 + read-write + 0x2 + 0xF + + + T_RRD + desc T_RRD + 3 + 0 + read-write + + + + + TMCR_T_WR + desc TMCR_T_WR + 0x38 + 32 + read-write + 0x3 + 0x7 + + + T_WR + desc T_WR + 2 + 0 + read-write + + + + + TMCR_T_WTR + desc TMCR_T_WTR + 0x3C + 32 + read-write + 0x2 + 0x7 + + + T_WTR + desc T_WTR + 2 + 0 + read-write + + + + + TMCR_T_XP + desc TMCR_T_XP + 0x40 + 32 + read-write + 0x1 + 0xFF + + + T_XP + desc T_XP + 7 + 0 + read-write + + + + + TMCR_T_XSR + desc TMCR_T_XSR + 0x44 + 32 + read-write + 0xA + 0xFF + + + T_XSR + desc T_XSR + 7 + 0 + read-write + + + + + TMCR_T_ESR + desc TMCR_T_ESR + 0x48 + 32 + read-write + 0x14 + 0xFF + + + T_ESR + desc T_ESR + 7 + 0 + read-write + + + + + CSCR0 + desc CSCR0 + 0x200 + 32 + read-write + 0xFF00 + 0x101FFFF + + + ADDMSK0 + desc ADDMSK0 + 7 + 0 + read-write + + + ADDMAT0 + desc ADDMAT0 + 15 + 8 + read-write + + + BRC0 + desc BRC0 + 16 + 16 + read-write + + + RESV8 + desc RESV8 + 24 + 24 + read-write + + + + + CSCR1 + desc CSCR1 + 0x204 + 32 + read-write + 0xFF00 + 0x101FFFF + + + ADDMSK1 + desc ADDMSK1 + 7 + 0 + read-write + + + ADDMAT1 + desc ADDMAT1 + 15 + 8 + read-write + + + BRC1 + desc BRC1 + 16 + 16 + read-write + + + RESV9 + desc RESV9 + 24 + 24 + read-write + + + + + CSCR2 + desc CSCR2 + 0x208 + 32 + read-write + 0xFF00 + 0x101FFFF + + + ADDMSK2 + desc ADDMSK2 + 7 + 0 + read-write + + + ADDMAT2 + desc ADDMAT2 + 15 + 8 + read-write + + + BRC2 + desc BRC2 + 16 + 16 + read-write + + + RESV10 + desc RESV10 + 24 + 24 + read-write + + + + + CSCR3 + desc CSCR3 + 0x20C + 32 + read-write + 0xFF00 + 0x101FFFF + + + ADDMSK3 + desc ADDMSK3 + 7 + 0 + read-write + + + ADDMAT3 + desc ADDMAT3 + 15 + 8 + read-write + + + BRC3 + desc BRC3 + 16 + 16 + read-write + + + RESV11 + desc RESV11 + 24 + 24 + read-write + + + + + BACR + desc BACR + 0x300 + 32 + read-write + 0x300 + 0x1000003 + + + DMCMW + desc DMCMW + 1 + 0 + read-write + + + RESV11 + desc RESV11 + 24 + 24 + read-write + + + + + + + DVP + desc DVP + 0x40055800 + + 0x0 + 0x30 + + + + CTR + desc CTR + 0x0 + 32 + read-write + 0x0 + 0x4FFF + + + CAPEN + desc CAPEN + 0 + 0 + read-write + + + CAPMD + desc CAPMD + 1 + 1 + read-write + + + CROPEN + desc CROPEN + 2 + 2 + read-write + + + JPEGEN + desc JPEGEN + 3 + 3 + read-write + + + SWSYNC + desc SWSYNC + 4 + 4 + read-write + + + PIXCKSEL + desc PIXCKSEL + 5 + 5 + read-write + + + HSYNCSEL + desc HSYNCSEL + 6 + 6 + read-write + + + VSYNCSEL + desc VSYNCSEL + 7 + 7 + read-write + + + CAPFRC + desc CAPFRC + 9 + 8 + read-write + + + BITSEL + desc BITSEL + 11 + 10 + read-write + + + DVPEN + desc DVPEN + 14 + 14 + read-write + + + + + DTR + desc DTR + 0x4 + 32 + read-write + 0x10 + 0xFFFFFFFF + + + STR + desc STR + 0x8 + 32 + read-write + 0x0 + 0x3F + + + FSF + desc FSF + 0 + 0 + read-write + + + LSF + desc LSF + 1 + 1 + read-write + + + LEF + desc LEF + 2 + 2 + read-write + + + FEF + desc FEF + 3 + 3 + read-write + + + SQUERF + desc SQUERF + 4 + 4 + read-write + + + FIFOERF + desc FIFOERF + 5 + 5 + read-write + + + + + IER + desc IER + 0xC + 32 + read-write + 0x0 + 0x3F + + + FSIEN + desc FSIEN + 0 + 0 + read-write + + + LSIEN + desc LSIEN + 1 + 1 + read-write + + + LEIEN + desc LEIEN + 2 + 2 + read-write + + + FEIEN + desc FEIEN + 3 + 3 + read-write + + + SQUERIEN + desc SQUERIEN + 4 + 4 + read-write + + + FIFOERIEN + desc FIFOERIEN + 5 + 5 + read-write + + + + + DMR + desc DMR + 0x10 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SSYNDR + desc SSYNDR + 0x20 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + FSDAT + desc FSDAT + 7 + 0 + read-write + + + LSDAT + desc LSDAT + 15 + 8 + read-write + + + LEDAT + desc LEDAT + 23 + 16 + read-write + + + FEDAT + desc FEDAT + 31 + 24 + read-write + + + + + SSYNMR + desc SSYNMR + 0x24 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + FSMSK + desc FSMSK + 7 + 0 + read-write + + + LSMSK + desc LSMSK + 15 + 8 + read-write + + + LEMSK + desc LEMSK + 23 + 16 + read-write + + + FEMSK + desc FEMSK + 31 + 24 + read-write + + + + + CPSFTR + desc CPSFTR + 0x28 + 32 + read-write + 0x0 + 0x3FFF3FFF + + + RSHIFT + desc RSHIFT + 13 + 0 + read-write + + + CSHIFT + desc CSHIFT + 29 + 16 + read-write + + + + + CPSZER + desc CPSZER + 0x2C + 32 + read-write + 0x0 + 0x3FFF3FFF + + + RSIZE + desc RSIZE + 13 + 0 + read-write + + + CSIZE + desc CSIZE + 29 + 16 + read-write + + + + + + + EFM + desc EFM + 0x40010400 + + 0x0 + 0x1B0 + + + + FAPRT + desc FAPRT + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + FAPRT + desc FAPRT + 15 + 0 + read-write + + + + + KEY1 + desc KEY1 + 0x4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + KEY2 + desc KEY2 + 0x8 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + FSTP + desc FSTP + 0x14 + 32 + read-write + 0x0 + 0x3 + + + F0STP + desc F0STP + 0 + 0 + read-write + + + F1STP + desc F1STP + 1 + 1 + read-write + + + + + FRMC + desc FRMC + 0x18 + 32 + read-write + 0x0 + 0xF010F + + + FLWT + desc FLWT + 3 + 0 + read-write + + + LVM + desc LVM + 8 + 8 + read-write + + + ICACHE + desc ICACHE + 16 + 16 + read-write + + + DCACHE + desc DCACHE + 17 + 17 + read-write + + + PREFE + desc PREFE + 18 + 18 + read-write + + + CRST + desc CRST + 19 + 19 + read-write + + + + + FWMC + desc FWMC + 0x1C + 32 + read-write + 0x30000 + 0x30107 + + + PEMOD + desc PEMOD + 2 + 0 + read-write + + + BUSHLDCTL + desc BUSHLDCTL + 8 + 8 + read-write + + + KEY1LOCK + desc KEY1LOCK + 16 + 16 + read-write + + + KEY2LOCK + desc KEY2LOCK + 17 + 17 + read-write + + + + + FSR + desc FSR + 0x20 + 32 + read-only + 0x1000100 + 0x13E013F + + + OTPWERR0 + desc OTPWERR0 + 0 + 0 + read-only + + + PRTWERR0 + desc PRTWERR0 + 1 + 1 + read-only + + + PGSZERR0 + desc PGSZERR0 + 2 + 2 + read-only + + + MISMTCH0 + desc MISMTCH0 + 3 + 3 + read-only + + + OPTEND0 + desc OPTEND0 + 4 + 4 + read-only + + + COLERR0 + desc COLERR0 + 5 + 5 + read-only + + + RDY0 + desc RDY0 + 8 + 8 + read-only + + + PRTWERR1 + desc PRTWERR1 + 17 + 17 + read-only + + + PGSZERR1 + desc PGSZERR1 + 18 + 18 + read-only + + + MISMTCH1 + desc MISMTCH1 + 19 + 19 + read-only + + + OPTEND1 + desc OPTEND1 + 20 + 20 + read-only + + + COLERR1 + desc COLERR1 + 21 + 21 + read-only + + + RDY1 + desc RDY1 + 24 + 24 + read-only + + + + + FSCLR + desc FSCLR + 0x24 + 32 + read-write + 0x0 + 0x3E003F + + + OTPWERRCLR0 + desc OTPWERRCLR0 + 0 + 0 + read-write + + + PRTWERRCLR0 + desc PRTWERRCLR0 + 1 + 1 + read-write + + + PGSZERRCLR0 + desc PGSZERRCLR0 + 2 + 2 + read-write + + + MISMTCHCLR0 + desc MISMTCHCLR0 + 3 + 3 + read-write + + + OPTENDCLR0 + desc OPTENDCLR0 + 4 + 4 + read-write + + + COLERRCLR0 + desc COLERRCLR0 + 5 + 5 + read-write + + + PRTWERRCLR1 + desc PRTWERRCLR1 + 17 + 17 + read-write + + + PGSZERRCLR1 + desc PGSZERRCLR1 + 18 + 18 + read-write + + + MISMTCHCLR1 + desc MISMTCHCLR1 + 19 + 19 + read-write + + + OPTENDCLR1 + desc OPTENDCLR1 + 20 + 20 + read-write + + + COLERRCLR1 + desc COLERRCLR1 + 21 + 21 + read-write + + + + + FITE + desc FITE + 0x28 + 32 + read-write + 0x0 + 0x7 + + + PEERRITE + desc PEERRITE + 0 + 0 + read-write + + + OPTENDITE + desc OPTENDITE + 1 + 1 + read-write + + + COLERRITE + desc COLERRITE + 2 + 2 + read-write + + + + + FSWP + desc FSWP + 0x2C + 32 + read-only + 0x0 + 0x1 + + + FSWP + desc FSWP + 0 + 0 + read-only + + + + + FHDFG + desc FHDFG + 0x40 + 32 + read-only + 0x484404A0 + 0xFFFFFFFF + + + UQID0 + desc UQID0 + 0x50 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + UQID1 + desc UQID1 + 0x54 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + UQID2 + desc UQID2 + 0x58 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + REMPRT + desc REMPRT + 0x100 + 32 + read-write + 0x0 + 0xFFFF + + + REMPRT + desc REMPRT + 15 + 0 + read-write + + + + + REMCR0 + desc REMCR0 + 0x104 + 32 + read-write + 0x0 + 0x9FFFF01F + + + RM0SIZE + desc RM0SIZE + 4 + 0 + read-write + + + RM0TADDR + desc RM0TADDR + 28 + 12 + read-write + + + EN0 + desc EN0 + 31 + 31 + read-write + + + + + REMCR1 + desc REMCR1 + 0x108 + 32 + read-write + 0x0 + 0x9FFFF01F + + + RM1SIZE + desc RM1SIZE + 4 + 0 + read-write + + + RM1TADDR + desc RM1TADDR + 28 + 12 + read-write + + + EN1 + desc EN1 + 31 + 31 + read-write + + + + + WLOCK + desc WLOCK + 0x180 + 32 + read-write + 0x0 + 0xFF + + + WLOCK0 + desc WLOCK0 + 0 + 0 + read-write + + + WLOCK1 + desc WLOCK1 + 1 + 1 + read-write + + + WLOCK2 + desc WLOCK2 + 2 + 2 + read-write + + + WLOCK3 + desc WLOCK3 + 3 + 3 + read-write + + + WLOCK4 + desc WLOCK4 + 4 + 4 + read-write + + + WLOCK5 + desc WLOCK5 + 5 + 5 + read-write + + + WLOCK6 + desc WLOCK6 + 6 + 6 + read-write + + + WLOCK7 + desc WLOCK7 + 7 + 7 + read-write + + + + + F0NWPRT0 + desc F0NWPRT0 + 0x190 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + F0NWPRT0 + desc F0NWPRT0 + 0 + 0 + read-write + + + F0NWPRT1 + desc F0NWPRT1 + 1 + 1 + read-write + + + F0NWPRT2 + desc F0NWPRT2 + 2 + 2 + read-write + + + F0NWPRT3 + desc F0NWPRT3 + 3 + 3 + read-write + + + F0NWPRT4 + desc F0NWPRT4 + 4 + 4 + read-write + + + F0NWPRT5 + desc F0NWPRT5 + 5 + 5 + read-write + + + F0NWPRT6 + desc F0NWPRT6 + 6 + 6 + read-write + + + F0NWPRT7 + desc F0NWPRT7 + 7 + 7 + read-write + + + F0NWPRT8 + desc F0NWPRT8 + 8 + 8 + read-write + + + F0NWPRT9 + desc F0NWPRT9 + 9 + 9 + read-write + + + F0NWPRT10 + desc F0NWPRT10 + 10 + 10 + read-write + + + F0NWPRT11 + desc F0NWPRT11 + 11 + 11 + read-write + + + F0NWPRT12 + desc F0NWPRT12 + 12 + 12 + read-write + + + F0NWPRT13 + desc F0NWPRT13 + 13 + 13 + read-write + + + F0NWPRT14 + desc F0NWPRT14 + 14 + 14 + read-write + + + F0NWPRT15 + desc F0NWPRT15 + 15 + 15 + read-write + + + F0NWPRT16 + desc F0NWPRT16 + 16 + 16 + read-write + + + F0NWPRT17 + desc F0NWPRT17 + 17 + 17 + read-write + + + F0NWPRT18 + desc F0NWPRT18 + 18 + 18 + read-write + + + F0NWPRT19 + desc F0NWPRT19 + 19 + 19 + read-write + + + F0NWPRT20 + desc F0NWPRT20 + 20 + 20 + read-write + + + F0NWPRT21 + desc F0NWPRT21 + 21 + 21 + read-write + + + F0NWPRT22 + desc F0NWPRT22 + 22 + 22 + read-write + + + F0NWPRT23 + desc F0NWPRT23 + 23 + 23 + read-write + + + F0NWPRT24 + desc F0NWPRT24 + 24 + 24 + read-write + + + F0NWPRT25 + desc F0NWPRT25 + 25 + 25 + read-write + + + F0NWPRT26 + desc F0NWPRT26 + 26 + 26 + read-write + + + F0NWPRT27 + desc F0NWPRT27 + 27 + 27 + read-write + + + F0NWPRT28 + desc F0NWPRT28 + 28 + 28 + read-write + + + F0NWPRT29 + desc F0NWPRT29 + 29 + 29 + read-write + + + F0NWPRT30 + desc F0NWPRT30 + 30 + 30 + read-write + + + F0NWPRT31 + desc F0NWPRT31 + 31 + 31 + read-write + + + + + F0NWPRT1 + desc F0NWPRT1 + 0x194 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + F0NWPRT32 + desc F0NWPRT32 + 0 + 0 + read-write + + + F0NWPRT33 + desc F0NWPRT33 + 1 + 1 + read-write + + + F0NWPRT34 + desc F0NWPRT34 + 2 + 2 + read-write + + + F0NWPRT35 + desc F0NWPRT35 + 3 + 3 + read-write + + + F0NWPRT36 + desc F0NWPRT36 + 4 + 4 + read-write + + + F0NWPRT37 + desc F0NWPRT37 + 5 + 5 + read-write + + + F0NWPRT38 + desc F0NWPRT38 + 6 + 6 + read-write + + + F0NWPRT39 + desc F0NWPRT39 + 7 + 7 + read-write + + + F0NWPRT40 + desc F0NWPRT40 + 8 + 8 + read-write + + + F0NWPRT41 + desc F0NWPRT41 + 9 + 9 + read-write + + + F0NWPRT42 + desc F0NWPRT42 + 10 + 10 + read-write + + + F0NWPRT43 + desc F0NWPRT43 + 11 + 11 + read-write + + + F0NWPRT44 + desc F0NWPRT44 + 12 + 12 + read-write + + + F0NWPRT45 + desc F0NWPRT45 + 13 + 13 + read-write + + + F0NWPRT46 + desc F0NWPRT46 + 14 + 14 + read-write + + + F0NWPRT47 + desc F0NWPRT47 + 15 + 15 + read-write + + + F0NWPRT48 + desc F0NWPRT48 + 16 + 16 + read-write + + + F0NWPRT49 + desc F0NWPRT49 + 17 + 17 + read-write + + + F0NWPRT50 + desc F0NWPRT50 + 18 + 18 + read-write + + + F0NWPRT51 + desc F0NWPRT51 + 19 + 19 + read-write + + + F0NWPRT52 + desc F0NWPRT52 + 20 + 20 + read-write + + + F0NWPRT53 + desc F0NWPRT53 + 21 + 21 + read-write + + + F0NWPRT54 + desc F0NWPRT54 + 22 + 22 + read-write + + + F0NWPRT55 + desc F0NWPRT55 + 23 + 23 + read-write + + + F0NWPRT56 + desc F0NWPRT56 + 24 + 24 + read-write + + + F0NWPRT57 + desc F0NWPRT57 + 25 + 25 + read-write + + + F0NWPRT58 + desc F0NWPRT58 + 26 + 26 + read-write + + + F0NWPRT59 + desc F0NWPRT59 + 27 + 27 + read-write + + + F0NWPRT60 + desc F0NWPRT60 + 28 + 28 + read-write + + + F0NWPRT61 + desc F0NWPRT61 + 29 + 29 + read-write + + + F0NWPRT62 + desc F0NWPRT62 + 30 + 30 + read-write + + + F0NWPRT63 + desc F0NWPRT63 + 31 + 31 + read-write + + + + + F0NWPRT2 + desc F0NWPRT2 + 0x198 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + F0NWPRT64 + desc F0NWPRT64 + 0 + 0 + read-write + + + F0NWPRT65 + desc F0NWPRT65 + 1 + 1 + read-write + + + F0NWPRT66 + desc F0NWPRT66 + 2 + 2 + read-write + + + F0NWPRT67 + desc F0NWPRT67 + 3 + 3 + read-write + + + F0NWPRT68 + desc F0NWPRT68 + 4 + 4 + read-write + + + F0NWPRT69 + desc F0NWPRT69 + 5 + 5 + read-write + + + F0NWPRT70 + desc F0NWPRT70 + 6 + 6 + read-write + + + F0NWPRT71 + desc F0NWPRT71 + 7 + 7 + read-write + + + F0NWPRT72 + desc F0NWPRT72 + 8 + 8 + read-write + + + F0NWPRT73 + desc F0NWPRT73 + 9 + 9 + read-write + + + F0NWPRT74 + desc F0NWPRT74 + 10 + 10 + read-write + + + F0NWPRT75 + desc F0NWPRT75 + 11 + 11 + read-write + + + F0NWPRT76 + desc F0NWPRT76 + 12 + 12 + read-write + + + F0NWPRT77 + desc F0NWPRT77 + 13 + 13 + read-write + + + F0NWPRT78 + desc F0NWPRT78 + 14 + 14 + read-write + + + F0NWPRT79 + desc F0NWPRT79 + 15 + 15 + read-write + + + F0NWPRT80 + desc F0NWPRT80 + 16 + 16 + read-write + + + F0NWPRT81 + desc F0NWPRT81 + 17 + 17 + read-write + + + F0NWPRT82 + desc F0NWPRT82 + 18 + 18 + read-write + + + F0NWPRT83 + desc F0NWPRT83 + 19 + 19 + read-write + + + F0NWPRT84 + desc F0NWPRT84 + 20 + 20 + read-write + + + F0NWPRT85 + desc F0NWPRT85 + 21 + 21 + read-write + + + F0NWPRT86 + desc F0NWPRT86 + 22 + 22 + read-write + + + F0NWPRT87 + desc F0NWPRT87 + 23 + 23 + read-write + + + F0NWPRT88 + desc F0NWPRT88 + 24 + 24 + read-write + + + F0NWPRT89 + desc F0NWPRT89 + 25 + 25 + read-write + + + F0NWPRT90 + desc F0NWPRT90 + 26 + 26 + read-write + + + F0NWPRT91 + desc F0NWPRT91 + 27 + 27 + read-write + + + F0NWPRT92 + desc F0NWPRT92 + 28 + 28 + read-write + + + F0NWPRT93 + desc F0NWPRT93 + 29 + 29 + read-write + + + F0NWPRT94 + desc F0NWPRT94 + 30 + 30 + read-write + + + F0NWPRT95 + desc F0NWPRT95 + 31 + 31 + read-write + + + + + F0NWPRT3 + desc F0NWPRT3 + 0x19C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + F0NWPRT96 + desc F0NWPRT96 + 0 + 0 + read-write + + + F0NWPRT97 + desc F0NWPRT97 + 1 + 1 + read-write + + + F0NWPRT98 + desc F0NWPRT98 + 2 + 2 + read-write + + + F0NWPRT99 + desc F0NWPRT99 + 3 + 3 + read-write + + + F0NWPRT100 + desc F0NWPRT100 + 4 + 4 + read-write + + + F0NWPRT101 + desc F0NWPRT101 + 5 + 5 + read-write + + + F0NWPRT102 + desc F0NWPRT102 + 6 + 6 + read-write + + + F0NWPRT103 + desc F0NWPRT103 + 7 + 7 + read-write + + + F0NWPRT104 + desc F0NWPRT104 + 8 + 8 + read-write + + + F0NWPRT105 + desc F0NWPRT105 + 9 + 9 + read-write + + + F0NWPRT106 + desc F0NWPRT106 + 10 + 10 + read-write + + + F0NWPRT107 + desc F0NWPRT107 + 11 + 11 + read-write + + + F0NWPRT108 + desc F0NWPRT108 + 12 + 12 + read-write + + + F0NWPRT109 + desc F0NWPRT109 + 13 + 13 + read-write + + + F0NWPRT110 + desc F0NWPRT110 + 14 + 14 + read-write + + + F0NWPRT111 + desc F0NWPRT111 + 15 + 15 + read-write + + + F0NWPRT112 + desc F0NWPRT112 + 16 + 16 + read-write + + + F0NWPRT113 + desc F0NWPRT113 + 17 + 17 + read-write + + + F0NWPRT114 + desc F0NWPRT114 + 18 + 18 + read-write + + + F0NWPRT115 + desc F0NWPRT115 + 19 + 19 + read-write + + + F0NWPRT116 + desc F0NWPRT116 + 20 + 20 + read-write + + + F0NWPRT117 + desc F0NWPRT117 + 21 + 21 + read-write + + + F0NWPRT118 + desc F0NWPRT118 + 22 + 22 + read-write + + + F0NWPRT119 + desc F0NWPRT119 + 23 + 23 + read-write + + + F0NWPRT120 + desc F0NWPRT120 + 24 + 24 + read-write + + + F0NWPRT121 + desc F0NWPRT121 + 25 + 25 + read-write + + + F0NWPRT122 + desc F0NWPRT122 + 26 + 26 + read-write + + + F0NWPRT123 + desc F0NWPRT123 + 27 + 27 + read-write + + + F0NWPRT124 + desc F0NWPRT124 + 28 + 28 + read-write + + + F0NWPRT125 + desc F0NWPRT125 + 29 + 29 + read-write + + + F0NWPRT126 + desc F0NWPRT126 + 30 + 30 + read-write + + + F0NWPRT127 + desc F0NWPRT127 + 31 + 31 + read-write + + + + + F1NWPRT0 + desc F1NWPRT0 + 0x1A0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + F1NWPRT0 + desc F1NWPRT0 + 0 + 0 + read-write + + + F1NWPRT1 + desc F1NWPRT1 + 1 + 1 + read-write + + + F1NWPRT2 + desc F1NWPRT2 + 2 + 2 + read-write + + + F1NWPRT3 + desc F1NWPRT3 + 3 + 3 + read-write + + + F1NWPRT4 + desc F1NWPRT4 + 4 + 4 + read-write + + + F1NWPRT5 + desc F1NWPRT5 + 5 + 5 + read-write + + + F1NWPRT6 + desc F1NWPRT6 + 6 + 6 + read-write + + + F1NWPRT7 + desc F1NWPRT7 + 7 + 7 + read-write + + + F1NWPRT8 + desc F1NWPRT8 + 8 + 8 + read-write + + + F1NWPRT9 + desc F1NWPRT9 + 9 + 9 + read-write + + + F1NWPRT10 + desc F1NWPRT10 + 10 + 10 + read-write + + + F1NWPRT11 + desc F1NWPRT11 + 11 + 11 + read-write + + + F1NWPRT12 + desc F1NWPRT12 + 12 + 12 + read-write + + + F1NWPRT13 + desc F1NWPRT13 + 13 + 13 + read-write + + + F1NWPRT14 + desc F1NWPRT14 + 14 + 14 + read-write + + + F1NWPRT15 + desc F1NWPRT15 + 15 + 15 + read-write + + + F1NWPRT16 + desc F1NWPRT16 + 16 + 16 + read-write + + + F1NWPRT17 + desc F1NWPRT17 + 17 + 17 + read-write + + + F1NWPRT18 + desc F1NWPRT18 + 18 + 18 + read-write + + + F1NWPRT19 + desc F1NWPRT19 + 19 + 19 + read-write + + + F1NWPRT20 + desc F1NWPRT20 + 20 + 20 + read-write + + + F1NWPRT21 + desc F1NWPRT21 + 21 + 21 + read-write + + + F1NWPRT22 + desc F1NWPRT22 + 22 + 22 + read-write + + + F1NWPRT23 + desc F1NWPRT23 + 23 + 23 + read-write + + + F1NWPRT24 + desc F1NWPRT24 + 24 + 24 + read-write + + + F1NWPRT25 + desc F1NWPRT25 + 25 + 25 + read-write + + + F1NWPRT26 + desc F1NWPRT26 + 26 + 26 + read-write + + + F1NWPRT27 + desc F1NWPRT27 + 27 + 27 + read-write + + + F1NWPRT28 + desc F1NWPRT28 + 28 + 28 + read-write + + + F1NWPRT29 + desc F1NWPRT29 + 29 + 29 + read-write + + + F1NWPRT30 + desc F1NWPRT30 + 30 + 30 + read-write + + + F1NWPRT31 + desc F1NWPRT31 + 31 + 31 + read-write + + + + + F1NWPRT1 + desc F1NWPRT1 + 0x1A4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + F1NWPRT32 + desc F1NWPRT32 + 0 + 0 + read-write + + + F1NWPRT33 + desc F1NWPRT33 + 1 + 1 + read-write + + + F1NWPRT34 + desc F1NWPRT34 + 2 + 2 + read-write + + + F1NWPRT35 + desc F1NWPRT35 + 3 + 3 + read-write + + + F1NWPRT36 + desc F1NWPRT36 + 4 + 4 + read-write + + + F1NWPRT37 + desc F1NWPRT37 + 5 + 5 + read-write + + + F1NWPRT38 + desc F1NWPRT38 + 6 + 6 + read-write + + + F1NWPRT39 + desc F1NWPRT39 + 7 + 7 + read-write + + + F1NWPRT40 + desc F1NWPRT40 + 8 + 8 + read-write + + + F1NWPRT41 + desc F1NWPRT41 + 9 + 9 + read-write + + + F1NWPRT42 + desc F1NWPRT42 + 10 + 10 + read-write + + + F1NWPRT43 + desc F1NWPRT43 + 11 + 11 + read-write + + + F1NWPRT44 + desc F1NWPRT44 + 12 + 12 + read-write + + + F1NWPRT45 + desc F1NWPRT45 + 13 + 13 + read-write + + + F1NWPRT46 + desc F1NWPRT46 + 14 + 14 + read-write + + + F1NWPRT47 + desc F1NWPRT47 + 15 + 15 + read-write + + + F1NWPRT48 + desc F1NWPRT48 + 16 + 16 + read-write + + + F1NWPRT49 + desc F1NWPRT49 + 17 + 17 + read-write + + + F1NWPRT50 + desc F1NWPRT50 + 18 + 18 + read-write + + + F1NWPRT51 + desc F1NWPRT51 + 19 + 19 + read-write + + + F1NWPRT52 + desc F1NWPRT52 + 20 + 20 + read-write + + + F1NWPRT53 + desc F1NWPRT53 + 21 + 21 + read-write + + + F1NWPRT54 + desc F1NWPRT54 + 22 + 22 + read-write + + + F1NWPRT55 + desc F1NWPRT55 + 23 + 23 + read-write + + + F1NWPRT56 + desc F1NWPRT56 + 24 + 24 + read-write + + + F1NWPRT57 + desc F1NWPRT57 + 25 + 25 + read-write + + + F1NWPRT58 + desc F1NWPRT58 + 26 + 26 + read-write + + + F1NWPRT59 + desc F1NWPRT59 + 27 + 27 + read-write + + + F1NWPRT60 + desc F1NWPRT60 + 28 + 28 + read-write + + + F1NWPRT61 + desc F1NWPRT61 + 29 + 29 + read-write + + + F1NWPRT62 + desc F1NWPRT62 + 30 + 30 + read-write + + + F1NWPRT63 + desc F1NWPRT63 + 31 + 31 + read-write + + + + + F1NWPRT2 + desc F1NWPRT2 + 0x1A8 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + F1NWPRT64 + desc F1NWPRT64 + 0 + 0 + read-write + + + F1NWPRT65 + desc F1NWPRT65 + 1 + 1 + read-write + + + F1NWPRT66 + desc F1NWPRT66 + 2 + 2 + read-write + + + F1NWPRT67 + desc F1NWPRT67 + 3 + 3 + read-write + + + F1NWPRT68 + desc F1NWPRT68 + 4 + 4 + read-write + + + F1NWPRT69 + desc F1NWPRT69 + 5 + 5 + read-write + + + F1NWPRT70 + desc F1NWPRT70 + 6 + 6 + read-write + + + F1NWPRT71 + desc F1NWPRT71 + 7 + 7 + read-write + + + F1NWPRT72 + desc F1NWPRT72 + 8 + 8 + read-write + + + F1NWPRT73 + desc F1NWPRT73 + 9 + 9 + read-write + + + F1NWPRT74 + desc F1NWPRT74 + 10 + 10 + read-write + + + F1NWPRT75 + desc F1NWPRT75 + 11 + 11 + read-write + + + F1NWPRT76 + desc F1NWPRT76 + 12 + 12 + read-write + + + F1NWPRT77 + desc F1NWPRT77 + 13 + 13 + read-write + + + F1NWPRT78 + desc F1NWPRT78 + 14 + 14 + read-write + + + F1NWPRT79 + desc F1NWPRT79 + 15 + 15 + read-write + + + F1NWPRT80 + desc F1NWPRT80 + 16 + 16 + read-write + + + F1NWPRT81 + desc F1NWPRT81 + 17 + 17 + read-write + + + F1NWPRT82 + desc F1NWPRT82 + 18 + 18 + read-write + + + F1NWPRT83 + desc F1NWPRT83 + 19 + 19 + read-write + + + F1NWPRT84 + desc F1NWPRT84 + 20 + 20 + read-write + + + F1NWPRT85 + desc F1NWPRT85 + 21 + 21 + read-write + + + F1NWPRT86 + desc F1NWPRT86 + 22 + 22 + read-write + + + F1NWPRT87 + desc F1NWPRT87 + 23 + 23 + read-write + + + F1NWPRT88 + desc F1NWPRT88 + 24 + 24 + read-write + + + F1NWPRT89 + desc F1NWPRT89 + 25 + 25 + read-write + + + F1NWPRT90 + desc F1NWPRT90 + 26 + 26 + read-write + + + F1NWPRT91 + desc F1NWPRT91 + 27 + 27 + read-write + + + F1NWPRT92 + desc F1NWPRT92 + 28 + 28 + read-write + + + F1NWPRT93 + desc F1NWPRT93 + 29 + 29 + read-write + + + F1NWPRT94 + desc F1NWPRT94 + 30 + 30 + read-write + + + F1NWPRT95 + desc F1NWPRT95 + 31 + 31 + read-write + + + + + F1NWPRT3 + desc F1NWPRT3 + 0x1AC + 32 + read-write + 0x0 + 0xFFFFFFFF + + + F1NWPRT96 + desc F1NWPRT96 + 0 + 0 + read-write + + + F1NWPRT97 + desc F1NWPRT97 + 1 + 1 + read-write + + + F1NWPRT98 + desc F1NWPRT98 + 2 + 2 + read-write + + + F1NWPRT99 + desc F1NWPRT99 + 3 + 3 + read-write + + + F1NWPRT100 + desc F1NWPRT100 + 4 + 4 + read-write + + + F1NWPRT101 + desc F1NWPRT101 + 5 + 5 + read-write + + + F1NWPRT102 + desc F1NWPRT102 + 6 + 6 + read-write + + + F1NWPRT103 + desc F1NWPRT103 + 7 + 7 + read-write + + + F1NWPRT104 + desc F1NWPRT104 + 8 + 8 + read-write + + + F1NWPRT105 + desc F1NWPRT105 + 9 + 9 + read-write + + + F1NWPRT106 + desc F1NWPRT106 + 10 + 10 + read-write + + + F1NWPRT107 + desc F1NWPRT107 + 11 + 11 + read-write + + + F1NWPRT108 + desc F1NWPRT108 + 12 + 12 + read-write + + + F1NWPRT109 + desc F1NWPRT109 + 13 + 13 + read-write + + + F1NWPRT110 + desc F1NWPRT110 + 14 + 14 + read-write + + + F1NWPRT111 + desc F1NWPRT111 + 15 + 15 + read-write + + + F1NWPRT112 + desc F1NWPRT112 + 16 + 16 + read-write + + + F1NWPRT113 + desc F1NWPRT113 + 17 + 17 + read-write + + + F1NWPRT114 + desc F1NWPRT114 + 18 + 18 + read-write + + + F1NWPRT115 + desc F1NWPRT115 + 19 + 19 + read-write + + + F1NWPRT116 + desc F1NWPRT116 + 20 + 20 + read-write + + + F1NWPRT117 + desc F1NWPRT117 + 21 + 21 + read-write + + + F1NWPRT118 + desc F1NWPRT118 + 22 + 22 + read-write + + + F1NWPRT119 + desc F1NWPRT119 + 23 + 23 + read-write + + + F1NWPRT120 + desc F1NWPRT120 + 24 + 24 + read-write + + + F1NWPRT121 + desc F1NWPRT121 + 25 + 25 + read-write + + + F1NWPRT122 + desc F1NWPRT122 + 26 + 26 + read-write + + + F1NWPRT123 + desc F1NWPRT123 + 27 + 27 + read-write + + + F1NWPRT124 + desc F1NWPRT124 + 28 + 28 + read-write + + + F1NWPRT125 + desc F1NWPRT125 + 29 + 29 + read-write + + + F1NWPRT126 + desc F1NWPRT126 + 30 + 30 + read-write + + + F1NWPRT127 + desc F1NWPRT127 + 31 + 31 + read-write + + + + + + + EMBG0 + desc EMBG0 + 0x40017C00 + + 0x0 + 0x1C + + + + CTL1 + desc CTL1 + 0x0 + 32 + read-write + 0x0 + 0x3CF1FFF + + + CMPEN + desc CMPEN + 3 + 0 + read-write + + + OSCSTPEN + desc OSCSTPEN + 4 + 4 + read-write + + + PWMSEN + desc PWMSEN + 12 + 5 + read-write + + + PORTINEN1 + desc PORTINEN1 + 16 + 16 + read-write + + + PORTINEN2 + desc PORTINEN2 + 17 + 17 + read-write + + + PORTINEN3 + desc PORTINEN3 + 18 + 18 + read-write + + + PORTINEN4 + desc PORTINEN4 + 19 + 19 + read-write + + + INVSEL1 + desc INVSEL1 + 22 + 22 + read-write + + + INVSEL2 + desc INVSEL2 + 23 + 23 + read-write + + + INVSEL3 + desc INVSEL3 + 24 + 24 + read-write + + + INVSEL4 + desc INVSEL4 + 25 + 25 + read-write + + + + + CTL2 + desc CTL2 + 0x4 + 32 + read-write + 0x0 + 0xFFF00FF + + + PWMLV + desc PWMLV + 7 + 0 + read-write + + + NFSEL1 + desc NFSEL1 + 17 + 16 + read-write + + + NFEN1 + desc NFEN1 + 18 + 18 + read-write + + + NFSEL2 + desc NFSEL2 + 20 + 19 + read-write + + + NFEN2 + desc NFEN2 + 21 + 21 + read-write + + + NFSEL3 + desc NFSEL3 + 23 + 22 + read-write + + + NFEN3 + desc NFEN3 + 24 + 24 + read-write + + + NFSEL4 + desc NFSEL4 + 26 + 25 + read-write + + + NFEN4 + desc NFEN4 + 27 + 27 + read-write + + + + + SOE + desc SOE + 0x8 + 32 + read-write + 0x0 + 0x1 + + + SOE + desc SOE + 0 + 0 + read-write + + + + + STAT + desc STAT + 0xC + 32 + read-only + 0x0 + 0x3CFEE + + + PWMSF + desc PWMSF + 1 + 1 + read-only + + + CMPF + desc CMPF + 2 + 2 + read-only + + + OSF + desc OSF + 3 + 3 + read-only + + + PWMST + desc PWMST + 5 + 5 + read-only + + + CMPST + desc CMPST + 6 + 6 + read-only + + + OSST + desc OSST + 7 + 7 + read-only + + + PORTINF1 + desc PORTINF1 + 8 + 8 + read-only + + + PORTINF2 + desc PORTINF2 + 9 + 9 + read-only + + + PORTINF3 + desc PORTINF3 + 10 + 10 + read-only + + + PORTINF4 + desc PORTINF4 + 11 + 11 + read-only + + + PORTINST1 + desc PORTINST1 + 14 + 14 + read-only + + + PORTINST2 + desc PORTINST2 + 15 + 15 + read-only + + + PORTINST3 + desc PORTINST3 + 16 + 16 + read-only + + + PORTINST4 + desc PORTINST4 + 17 + 17 + read-only + + + + + STATCLR + desc STATCLR + 0x10 + 32 + write-only + 0x0 + 0xF0E + + + PWMSFCLR + desc PWMSFCLR + 1 + 1 + write-only + + + CMPFCLR + desc CMPFCLR + 2 + 2 + write-only + + + OSFCLR + desc OSFCLR + 3 + 3 + write-only + + + PORTINFCLR1 + desc PORTINFCLR1 + 8 + 8 + write-only + + + PORTINFCLR2 + desc PORTINFCLR2 + 9 + 9 + write-only + + + PORTINFCLR3 + desc PORTINFCLR3 + 10 + 10 + write-only + + + PORTINFCLR4 + desc PORTINFCLR4 + 11 + 11 + write-only + + + + + INTEN + desc INTEN + 0x14 + 32 + read-write + 0x0 + 0xF0E + + + PWMSINTEN + desc PWMSINTEN + 1 + 1 + read-write + + + CMPINTEN + desc CMPINTEN + 2 + 2 + read-write + + + OSINTEN + desc OSINTEN + 3 + 3 + read-write + + + PORTINTEN1 + desc PORTINTEN1 + 8 + 8 + read-write + + + PORTINTEN2 + desc PORTINTEN2 + 9 + 9 + read-write + + + PORTINTEN3 + desc PORTINTEN3 + 10 + 10 + read-write + + + PORTINTEN4 + desc PORTINTEN4 + 11 + 11 + read-write + + + + + RLSSEL + desc RLSSEL + 0x18 + 32 + read-write + 0x0 + 0xF0E + + + PWMRSEL + desc PWMRSEL + 1 + 1 + read-write + + + CMPRSEL + desc CMPRSEL + 2 + 2 + read-write + + + OSRSEL + desc OSRSEL + 3 + 3 + read-write + + + PORTINRSEL1 + desc PORTINRSEL1 + 8 + 8 + read-write + + + PORTINRSEL2 + desc PORTINRSEL2 + 9 + 9 + read-write + + + PORTINRSEL3 + desc PORTINRSEL3 + 10 + 10 + read-write + + + PORTINRSEL4 + desc PORTINRSEL4 + 11 + 11 + read-write + + + + + + + EMBG1 + desc EMBG1 + 0x40017C00 + EMBG0 + + 0x0 + 0x3C + + + + CTL1 + desc CTL1 + 0x20 + 32 + read-write + 0x0 + 0x3CF1FFF + + + CMPEN + desc CMPEN + 3 + 0 + read-write + + + OSCSTPEN + desc OSCSTPEN + 4 + 4 + read-write + + + PWMSEN + desc PWMSEN + 12 + 5 + read-write + + + PORTINEN1 + desc PORTINEN1 + 16 + 16 + read-write + + + PORTINEN2 + desc PORTINEN2 + 17 + 17 + read-write + + + PORTINEN3 + desc PORTINEN3 + 18 + 18 + read-write + + + PORTINEN4 + desc PORTINEN4 + 19 + 19 + read-write + + + INVSEL1 + desc INVSEL1 + 22 + 22 + read-write + + + INVSEL2 + desc INVSEL2 + 23 + 23 + read-write + + + INVSEL3 + desc INVSEL3 + 24 + 24 + read-write + + + INVSEL4 + desc INVSEL4 + 25 + 25 + read-write + + + + + CTL2 + desc CTL2 + 0x24 + 32 + read-write + 0x0 + 0xFFF00FF + + + PWMLV + desc PWMLV + 7 + 0 + read-write + + + NFSEL1 + desc NFSEL1 + 17 + 16 + read-write + + + NFEN1 + desc NFEN1 + 18 + 18 + read-write + + + NFSEL2 + desc NFSEL2 + 20 + 19 + read-write + + + NFEN2 + desc NFEN2 + 21 + 21 + read-write + + + NFSEL3 + desc NFSEL3 + 23 + 22 + read-write + + + NFEN3 + desc NFEN3 + 24 + 24 + read-write + + + NFSEL4 + desc NFSEL4 + 26 + 25 + read-write + + + NFEN4 + desc NFEN4 + 27 + 27 + read-write + + + + + SOE + desc SOE + 0x28 + 32 + read-write + 0x0 + 0x1 + + + SOE + desc SOE + 0 + 0 + read-write + + + + + STAT + desc STAT + 0x2C + 32 + read-only + 0x0 + 0x3CFEE + + + PWMSF + desc PWMSF + 1 + 1 + read-only + + + CMPF + desc CMPF + 2 + 2 + read-only + + + OSF + desc OSF + 3 + 3 + read-only + + + PWMST + desc PWMST + 5 + 5 + read-only + + + CMPST + desc CMPST + 6 + 6 + read-only + + + OSST + desc OSST + 7 + 7 + read-only + + + PORTINF1 + desc PORTINF1 + 8 + 8 + read-only + + + PORTINF2 + desc PORTINF2 + 9 + 9 + read-only + + + PORTINF3 + desc PORTINF3 + 10 + 10 + read-only + + + PORTINF4 + desc PORTINF4 + 11 + 11 + read-only + + + PORTINST1 + desc PORTINST1 + 14 + 14 + read-only + + + PORTINST2 + desc PORTINST2 + 15 + 15 + read-only + + + PORTINST3 + desc PORTINST3 + 16 + 16 + read-only + + + PORTINST4 + desc PORTINST4 + 17 + 17 + read-only + + + + + STATCLR + desc STATCLR + 0x30 + 32 + write-only + 0x0 + 0xF0E + + + PWMSFCLR + desc PWMSFCLR + 1 + 1 + write-only + + + CMPFCLR + desc CMPFCLR + 2 + 2 + write-only + + + OSFCLR + desc OSFCLR + 3 + 3 + write-only + + + PORTINFCLR1 + desc PORTINFCLR1 + 8 + 8 + write-only + + + PORTINFCLR2 + desc PORTINFCLR2 + 9 + 9 + write-only + + + PORTINFCLR3 + desc PORTINFCLR3 + 10 + 10 + write-only + + + PORTINFCLR4 + desc PORTINFCLR4 + 11 + 11 + write-only + + + + + INTEN + desc INTEN + 0x34 + 32 + read-write + 0x0 + 0xF0E + + + PWMSINTEN + desc PWMSINTEN + 1 + 1 + read-write + + + CMPINTEN + desc CMPINTEN + 2 + 2 + read-write + + + OSINTEN + desc OSINTEN + 3 + 3 + read-write + + + PORTINTEN1 + desc PORTINTEN1 + 8 + 8 + read-write + + + PORTINTEN2 + desc PORTINTEN2 + 9 + 9 + read-write + + + PORTINTEN3 + desc PORTINTEN3 + 10 + 10 + read-write + + + PORTINTEN4 + desc PORTINTEN4 + 11 + 11 + read-write + + + + + RLSSEL + desc RLSSEL + 0x38 + 32 + read-write + 0x0 + 0xF0E + + + PWMRSEL + desc PWMRSEL + 1 + 1 + read-write + + + CMPRSEL + desc CMPRSEL + 2 + 2 + read-write + + + OSRSEL + desc OSRSEL + 3 + 3 + read-write + + + PORTINRSEL1 + desc PORTINRSEL1 + 8 + 8 + read-write + + + PORTINRSEL2 + desc PORTINRSEL2 + 9 + 9 + read-write + + + PORTINRSEL3 + desc PORTINRSEL3 + 10 + 10 + read-write + + + PORTINRSEL4 + desc PORTINRSEL4 + 11 + 11 + read-write + + + + + + + EMBG2 + desc EMBG2 + 0x40017C00 + EMBG0 + + 0x0 + 0x5C + + + + CTL1 + desc CTL1 + 0x40 + 32 + read-write + 0x0 + 0x3CF1FFF + + + CMPEN + desc CMPEN + 3 + 0 + read-write + + + OSCSTPEN + desc OSCSTPEN + 4 + 4 + read-write + + + PWMSEN + desc PWMSEN + 12 + 5 + read-write + + + PORTINEN1 + desc PORTINEN1 + 16 + 16 + read-write + + + PORTINEN2 + desc PORTINEN2 + 17 + 17 + read-write + + + PORTINEN3 + desc PORTINEN3 + 18 + 18 + read-write + + + PORTINEN4 + desc PORTINEN4 + 19 + 19 + read-write + + + INVSEL1 + desc INVSEL1 + 22 + 22 + read-write + + + INVSEL2 + desc INVSEL2 + 23 + 23 + read-write + + + INVSEL3 + desc INVSEL3 + 24 + 24 + read-write + + + INVSEL4 + desc INVSEL4 + 25 + 25 + read-write + + + + + CTL2 + desc CTL2 + 0x44 + 32 + read-write + 0x0 + 0xFFF00FF + + + PWMLV + desc PWMLV + 7 + 0 + read-write + + + NFSEL1 + desc NFSEL1 + 17 + 16 + read-write + + + NFEN1 + desc NFEN1 + 18 + 18 + read-write + + + NFSEL2 + desc NFSEL2 + 20 + 19 + read-write + + + NFEN2 + desc NFEN2 + 21 + 21 + read-write + + + NFSEL3 + desc NFSEL3 + 23 + 22 + read-write + + + NFEN3 + desc NFEN3 + 24 + 24 + read-write + + + NFSEL4 + desc NFSEL4 + 26 + 25 + read-write + + + NFEN4 + desc NFEN4 + 27 + 27 + read-write + + + + + SOE + desc SOE + 0x48 + 32 + read-write + 0x0 + 0x1 + + + SOE + desc SOE + 0 + 0 + read-write + + + + + STAT + desc STAT + 0x4C + 32 + read-only + 0x0 + 0x3CFEE + + + PWMSF + desc PWMSF + 1 + 1 + read-only + + + CMPF + desc CMPF + 2 + 2 + read-only + + + OSF + desc OSF + 3 + 3 + read-only + + + PWMST + desc PWMST + 5 + 5 + read-only + + + CMPST + desc CMPST + 6 + 6 + read-only + + + OSST + desc OSST + 7 + 7 + read-only + + + PORTINF1 + desc PORTINF1 + 8 + 8 + read-only + + + PORTINF2 + desc PORTINF2 + 9 + 9 + read-only + + + PORTINF3 + desc PORTINF3 + 10 + 10 + read-only + + + PORTINF4 + desc PORTINF4 + 11 + 11 + read-only + + + PORTINST1 + desc PORTINST1 + 14 + 14 + read-only + + + PORTINST2 + desc PORTINST2 + 15 + 15 + read-only + + + PORTINST3 + desc PORTINST3 + 16 + 16 + read-only + + + PORTINST4 + desc PORTINST4 + 17 + 17 + read-only + + + + + STATCLR + desc STATCLR + 0x50 + 32 + write-only + 0x0 + 0xF0E + + + PWMSFCLR + desc PWMSFCLR + 1 + 1 + write-only + + + CMPFCLR + desc CMPFCLR + 2 + 2 + write-only + + + OSFCLR + desc OSFCLR + 3 + 3 + write-only + + + PORTINFCLR1 + desc PORTINFCLR1 + 8 + 8 + write-only + + + PORTINFCLR2 + desc PORTINFCLR2 + 9 + 9 + write-only + + + PORTINFCLR3 + desc PORTINFCLR3 + 10 + 10 + write-only + + + PORTINFCLR4 + desc PORTINFCLR4 + 11 + 11 + write-only + + + + + INTEN + desc INTEN + 0x54 + 32 + read-write + 0x0 + 0xF0E + + + PWMSINTEN + desc PWMSINTEN + 1 + 1 + read-write + + + CMPINTEN + desc CMPINTEN + 2 + 2 + read-write + + + OSINTEN + desc OSINTEN + 3 + 3 + read-write + + + PORTINTEN1 + desc PORTINTEN1 + 8 + 8 + read-write + + + PORTINTEN2 + desc PORTINTEN2 + 9 + 9 + read-write + + + PORTINTEN3 + desc PORTINTEN3 + 10 + 10 + read-write + + + PORTINTEN4 + desc PORTINTEN4 + 11 + 11 + read-write + + + + + RLSSEL + desc RLSSEL + 0x58 + 32 + read-write + 0x0 + 0xF0E + + + PWMRSEL + desc PWMRSEL + 1 + 1 + read-write + + + CMPRSEL + desc CMPRSEL + 2 + 2 + read-write + + + OSRSEL + desc OSRSEL + 3 + 3 + read-write + + + PORTINRSEL1 + desc PORTINRSEL1 + 8 + 8 + read-write + + + PORTINRSEL2 + desc PORTINRSEL2 + 9 + 9 + read-write + + + PORTINRSEL3 + desc PORTINRSEL3 + 10 + 10 + read-write + + + PORTINRSEL4 + desc PORTINRSEL4 + 11 + 11 + read-write + + + + + + + EMBG3 + desc EMBG3 + 0x40017C00 + EMBG0 + + 0x0 + 0x7C + + + + CTL1 + desc CTL1 + 0x60 + 32 + read-write + 0x0 + 0x3CF1FFF + + + CMPEN + desc CMPEN + 3 + 0 + read-write + + + OSCSTPEN + desc OSCSTPEN + 4 + 4 + read-write + + + PWMSEN + desc PWMSEN + 12 + 5 + read-write + + + PORTINEN1 + desc PORTINEN1 + 16 + 16 + read-write + + + PORTINEN2 + desc PORTINEN2 + 17 + 17 + read-write + + + PORTINEN3 + desc PORTINEN3 + 18 + 18 + read-write + + + PORTINEN4 + desc PORTINEN4 + 19 + 19 + read-write + + + INVSEL1 + desc INVSEL1 + 22 + 22 + read-write + + + INVSEL2 + desc INVSEL2 + 23 + 23 + read-write + + + INVSEL3 + desc INVSEL3 + 24 + 24 + read-write + + + INVSEL4 + desc INVSEL4 + 25 + 25 + read-write + + + + + CTL2 + desc CTL2 + 0x64 + 32 + read-write + 0x0 + 0xFFF00FF + + + PWMLV + desc PWMLV + 7 + 0 + read-write + + + NFSEL1 + desc NFSEL1 + 17 + 16 + read-write + + + NFEN1 + desc NFEN1 + 18 + 18 + read-write + + + NFSEL2 + desc NFSEL2 + 20 + 19 + read-write + + + NFEN2 + desc NFEN2 + 21 + 21 + read-write + + + NFSEL3 + desc NFSEL3 + 23 + 22 + read-write + + + NFEN3 + desc NFEN3 + 24 + 24 + read-write + + + NFSEL4 + desc NFSEL4 + 26 + 25 + read-write + + + NFEN4 + desc NFEN4 + 27 + 27 + read-write + + + + + SOE + desc SOE + 0x68 + 32 + read-write + 0x0 + 0x1 + + + SOE + desc SOE + 0 + 0 + read-write + + + + + STAT + desc STAT + 0x6C + 32 + read-only + 0x0 + 0x3CFEE + + + PWMSF + desc PWMSF + 1 + 1 + read-only + + + CMPF + desc CMPF + 2 + 2 + read-only + + + OSF + desc OSF + 3 + 3 + read-only + + + PWMST + desc PWMST + 5 + 5 + read-only + + + CMPST + desc CMPST + 6 + 6 + read-only + + + OSST + desc OSST + 7 + 7 + read-only + + + PORTINF1 + desc PORTINF1 + 8 + 8 + read-only + + + PORTINF2 + desc PORTINF2 + 9 + 9 + read-only + + + PORTINF3 + desc PORTINF3 + 10 + 10 + read-only + + + PORTINF4 + desc PORTINF4 + 11 + 11 + read-only + + + PORTINST1 + desc PORTINST1 + 14 + 14 + read-only + + + PORTINST2 + desc PORTINST2 + 15 + 15 + read-only + + + PORTINST3 + desc PORTINST3 + 16 + 16 + read-only + + + PORTINST4 + desc PORTINST4 + 17 + 17 + read-only + + + + + STATCLR + desc STATCLR + 0x70 + 32 + write-only + 0x0 + 0xF0E + + + PWMSFCLR + desc PWMSFCLR + 1 + 1 + write-only + + + CMPFCLR + desc CMPFCLR + 2 + 2 + write-only + + + OSFCLR + desc OSFCLR + 3 + 3 + write-only + + + PORTINFCLR1 + desc PORTINFCLR1 + 8 + 8 + write-only + + + PORTINFCLR2 + desc PORTINFCLR2 + 9 + 9 + write-only + + + PORTINFCLR3 + desc PORTINFCLR3 + 10 + 10 + write-only + + + PORTINFCLR4 + desc PORTINFCLR4 + 11 + 11 + write-only + + + + + INTEN + desc INTEN + 0x74 + 32 + read-write + 0x0 + 0xF0E + + + PWMSINTEN + desc PWMSINTEN + 1 + 1 + read-write + + + CMPINTEN + desc CMPINTEN + 2 + 2 + read-write + + + OSINTEN + desc OSINTEN + 3 + 3 + read-write + + + PORTINTEN1 + desc PORTINTEN1 + 8 + 8 + read-write + + + PORTINTEN2 + desc PORTINTEN2 + 9 + 9 + read-write + + + PORTINTEN3 + desc PORTINTEN3 + 10 + 10 + read-write + + + PORTINTEN4 + desc PORTINTEN4 + 11 + 11 + read-write + + + + + RLSSEL + desc RLSSEL + 0x78 + 32 + read-write + 0x0 + 0xF0E + + + PWMRSEL + desc PWMRSEL + 1 + 1 + read-write + + + CMPRSEL + desc CMPRSEL + 2 + 2 + read-write + + + OSRSEL + desc OSRSEL + 3 + 3 + read-write + + + PORTINRSEL1 + desc PORTINRSEL1 + 8 + 8 + read-write + + + PORTINRSEL2 + desc PORTINRSEL2 + 9 + 9 + read-write + + + PORTINRSEL3 + desc PORTINRSEL3 + 10 + 10 + read-write + + + PORTINRSEL4 + desc PORTINRSEL4 + 11 + 11 + read-write + + + + + + + EMBG4 + desc EMBG4 + 0x40017C00 + EMBG0 + + 0x0 + 0x9C + + + + CTL1 + desc CTL1 + 0x80 + 32 + read-write + 0x0 + 0x3CF00FF + + + CMPEN + desc CMPEN + 3 + 0 + read-write + + + OSCSTPEN + desc OSCSTPEN + 4 + 4 + read-write + + + PWMSEN + desc PWMSEN + 7 + 5 + read-write + + + PORTINEN1 + desc PORTINEN1 + 16 + 16 + read-write + + + PORTINEN2 + desc PORTINEN2 + 17 + 17 + read-write + + + PORTINEN3 + desc PORTINEN3 + 18 + 18 + read-write + + + PORTINEN4 + desc PORTINEN4 + 19 + 19 + read-write + + + INVSEL1 + desc INVSEL1 + 22 + 22 + read-write + + + INVSEL2 + desc INVSEL2 + 23 + 23 + read-write + + + INVSEL3 + desc INVSEL3 + 24 + 24 + read-write + + + INVSEL4 + desc INVSEL4 + 25 + 25 + read-write + + + + + CTL2 + desc CTL2 + 0x84 + 32 + read-write + 0x0 + 0xFFF0007 + + + PWMLV + desc PWMLV + 2 + 0 + read-write + + + NFSEL1 + desc NFSEL1 + 17 + 16 + read-write + + + NFEN1 + desc NFEN1 + 18 + 18 + read-write + + + NFSEL2 + desc NFSEL2 + 20 + 19 + read-write + + + NFEN2 + desc NFEN2 + 21 + 21 + read-write + + + NFSEL3 + desc NFSEL3 + 23 + 22 + read-write + + + NFEN3 + desc NFEN3 + 24 + 24 + read-write + + + NFSEL4 + desc NFSEL4 + 26 + 25 + read-write + + + NFEN4 + desc NFEN4 + 27 + 27 + read-write + + + + + SOE + desc SOE + 0x88 + 32 + read-write + 0x0 + 0x1 + + + SOE + desc SOE + 0 + 0 + read-write + + + + + STAT + desc STAT + 0x8C + 32 + read-only + 0x0 + 0x3CFEE + + + PWMSF + desc PWMSF + 1 + 1 + read-only + + + CMPF + desc CMPF + 2 + 2 + read-only + + + OSF + desc OSF + 3 + 3 + read-only + + + PWMST + desc PWMST + 5 + 5 + read-only + + + CMPST + desc CMPST + 6 + 6 + read-only + + + OSST + desc OSST + 7 + 7 + read-only + + + PORTINF1 + desc PORTINF1 + 8 + 8 + read-only + + + PORTINF2 + desc PORTINF2 + 9 + 9 + read-only + + + PORTINF3 + desc PORTINF3 + 10 + 10 + read-only + + + PORTINF4 + desc PORTINF4 + 11 + 11 + read-only + + + PORTINST1 + desc PORTINST1 + 14 + 14 + read-only + + + PORTINST2 + desc PORTINST2 + 15 + 15 + read-only + + + PORTINST3 + desc PORTINST3 + 16 + 16 + read-only + + + PORTINST4 + desc PORTINST4 + 17 + 17 + read-only + + + + + STATCLR + desc STATCLR + 0x90 + 32 + write-only + 0x0 + 0xF0E + + + PWMSFCLR + desc PWMSFCLR + 1 + 1 + write-only + + + CMPFCLR + desc CMPFCLR + 2 + 2 + write-only + + + OSFCLR + desc OSFCLR + 3 + 3 + write-only + + + PORTINFCLR1 + desc PORTINFCLR1 + 8 + 8 + write-only + + + PORTINFCLR2 + desc PORTINFCLR2 + 9 + 9 + write-only + + + PORTINFCLR3 + desc PORTINFCLR3 + 10 + 10 + write-only + + + PORTINFCLR4 + desc PORTINFCLR4 + 11 + 11 + write-only + + + + + INTEN + desc INTEN + 0x94 + 32 + read-write + 0x0 + 0xF0E + + + PWMSINTEN + desc PWMSINTEN + 1 + 1 + read-write + + + CMPINTEN + desc CMPINTEN + 2 + 2 + read-write + + + OSINTEN + desc OSINTEN + 3 + 3 + read-write + + + PORTINTEN1 + desc PORTINTEN1 + 8 + 8 + read-write + + + PORTINTEN2 + desc PORTINTEN2 + 9 + 9 + read-write + + + PORTINTEN3 + desc PORTINTEN3 + 10 + 10 + read-write + + + PORTINTEN4 + desc PORTINTEN4 + 11 + 11 + read-write + + + + + RLSSEL + desc RLSSEL + 0x98 + 32 + read-write + 0x0 + 0xF0E + + + PWMRSEL + desc PWMRSEL + 1 + 1 + read-write + + + CMPRSEL + desc CMPRSEL + 2 + 2 + read-write + + + OSRSEL + desc OSRSEL + 3 + 3 + read-write + + + PORTINRSEL1 + desc PORTINRSEL1 + 8 + 8 + read-write + + + PORTINRSEL2 + desc PORTINRSEL2 + 9 + 9 + read-write + + + PORTINRSEL3 + desc PORTINRSEL3 + 10 + 10 + read-write + + + PORTINRSEL4 + desc PORTINRSEL4 + 11 + 11 + read-write + + + + + + + EMBG5 + desc EMBG5 + 0x40017C00 + EMBG0 + + 0x0 + 0xBC + + + + CTL1 + desc CTL1 + 0xA0 + 32 + read-write + 0x0 + 0x3CF00FF + + + CMPEN + desc CMPEN + 3 + 0 + read-write + + + OSCSTPEN + desc OSCSTPEN + 4 + 4 + read-write + + + PWMSEN + desc PWMSEN + 7 + 5 + read-write + + + PORTINEN1 + desc PORTINEN1 + 16 + 16 + read-write + + + PORTINEN2 + desc PORTINEN2 + 17 + 17 + read-write + + + PORTINEN3 + desc PORTINEN3 + 18 + 18 + read-write + + + PORTINEN4 + desc PORTINEN4 + 19 + 19 + read-write + + + INVSEL1 + desc INVSEL1 + 22 + 22 + read-write + + + INVSEL2 + desc INVSEL2 + 23 + 23 + read-write + + + INVSEL3 + desc INVSEL3 + 24 + 24 + read-write + + + INVSEL4 + desc INVSEL4 + 25 + 25 + read-write + + + + + CTL2 + desc CTL2 + 0xA4 + 32 + read-write + 0x0 + 0xFFF0007 + + + PWMLV + desc PWMLV + 2 + 0 + read-write + + + NFSEL1 + desc NFSEL1 + 17 + 16 + read-write + + + NFEN1 + desc NFEN1 + 18 + 18 + read-write + + + NFSEL2 + desc NFSEL2 + 20 + 19 + read-write + + + NFEN2 + desc NFEN2 + 21 + 21 + read-write + + + NFSEL3 + desc NFSEL3 + 23 + 22 + read-write + + + NFEN3 + desc NFEN3 + 24 + 24 + read-write + + + NFSEL4 + desc NFSEL4 + 26 + 25 + read-write + + + NFEN4 + desc NFEN4 + 27 + 27 + read-write + + + + + SOE + desc SOE + 0xA8 + 32 + read-write + 0x0 + 0x1 + + + SOE + desc SOE + 0 + 0 + read-write + + + + + STAT + desc STAT + 0xAC + 32 + read-only + 0x0 + 0x3CFEE + + + PWMSF + desc PWMSF + 1 + 1 + read-only + + + CMPF + desc CMPF + 2 + 2 + read-only + + + OSF + desc OSF + 3 + 3 + read-only + + + PWMST + desc PWMST + 5 + 5 + read-only + + + CMPST + desc CMPST + 6 + 6 + read-only + + + OSST + desc OSST + 7 + 7 + read-only + + + PORTINF1 + desc PORTINF1 + 8 + 8 + read-only + + + PORTINF2 + desc PORTINF2 + 9 + 9 + read-only + + + PORTINF3 + desc PORTINF3 + 10 + 10 + read-only + + + PORTINF4 + desc PORTINF4 + 11 + 11 + read-only + + + PORTINST1 + desc PORTINST1 + 14 + 14 + read-only + + + PORTINST2 + desc PORTINST2 + 15 + 15 + read-only + + + PORTINST3 + desc PORTINST3 + 16 + 16 + read-only + + + PORTINST4 + desc PORTINST4 + 17 + 17 + read-only + + + + + STATCLR + desc STATCLR + 0xB0 + 32 + write-only + 0x0 + 0xF0E + + + PWMSFCLR + desc PWMSFCLR + 1 + 1 + write-only + + + CMPFCLR + desc CMPFCLR + 2 + 2 + write-only + + + OSFCLR + desc OSFCLR + 3 + 3 + write-only + + + PORTINFCLR1 + desc PORTINFCLR1 + 8 + 8 + write-only + + + PORTINFCLR2 + desc PORTINFCLR2 + 9 + 9 + write-only + + + PORTINFCLR3 + desc PORTINFCLR3 + 10 + 10 + write-only + + + PORTINFCLR4 + desc PORTINFCLR4 + 11 + 11 + write-only + + + + + INTEN + desc INTEN + 0xB4 + 32 + read-write + 0x0 + 0xF0E + + + PWMSINTEN + desc PWMSINTEN + 1 + 1 + read-write + + + CMPINTEN + desc CMPINTEN + 2 + 2 + read-write + + + OSINTEN + desc OSINTEN + 3 + 3 + read-write + + + PORTINTEN1 + desc PORTINTEN1 + 8 + 8 + read-write + + + PORTINTEN2 + desc PORTINTEN2 + 9 + 9 + read-write + + + PORTINTEN3 + desc PORTINTEN3 + 10 + 10 + read-write + + + PORTINTEN4 + desc PORTINTEN4 + 11 + 11 + read-write + + + + + RLSSEL + desc RLSSEL + 0xB8 + 32 + read-write + 0x0 + 0xF0E + + + PWMRSEL + desc PWMRSEL + 1 + 1 + read-write + + + CMPRSEL + desc CMPRSEL + 2 + 2 + read-write + + + OSRSEL + desc OSRSEL + 3 + 3 + read-write + + + PORTINRSEL1 + desc PORTINRSEL1 + 8 + 8 + read-write + + + PORTINRSEL2 + desc PORTINRSEL2 + 9 + 9 + read-write + + + PORTINRSEL3 + desc PORTINRSEL3 + 10 + 10 + read-write + + + PORTINRSEL4 + desc PORTINRSEL4 + 11 + 11 + read-write + + + + + + + EMBG6 + desc EMBG6 + 0x40017C00 + EMBG0 + + 0x0 + 0xDC + + + + CTL1 + desc CTL1 + 0xC0 + 32 + read-write + 0x0 + 0x3CF00FF + + + CMPEN + desc CMPEN + 3 + 0 + read-write + + + OSCSTPEN + desc OSCSTPEN + 4 + 4 + read-write + + + PWMSEN + desc PWMSEN + 7 + 5 + read-write + + + PORTINEN1 + desc PORTINEN1 + 16 + 16 + read-write + + + PORTINEN2 + desc PORTINEN2 + 17 + 17 + read-write + + + PORTINEN3 + desc PORTINEN3 + 18 + 18 + read-write + + + PORTINEN4 + desc PORTINEN4 + 19 + 19 + read-write + + + INVSEL1 + desc INVSEL1 + 22 + 22 + read-write + + + INVSEL2 + desc INVSEL2 + 23 + 23 + read-write + + + INVSEL3 + desc INVSEL3 + 24 + 24 + read-write + + + INVSEL4 + desc INVSEL4 + 25 + 25 + read-write + + + + + CTL2 + desc CTL2 + 0xC4 + 32 + read-write + 0x0 + 0xFFF0007 + + + PWMLV + desc PWMLV + 2 + 0 + read-write + + + NFSEL1 + desc NFSEL1 + 17 + 16 + read-write + + + NFEN1 + desc NFEN1 + 18 + 18 + read-write + + + NFSEL2 + desc NFSEL2 + 20 + 19 + read-write + + + NFEN2 + desc NFEN2 + 21 + 21 + read-write + + + NFSEL3 + desc NFSEL3 + 23 + 22 + read-write + + + NFEN3 + desc NFEN3 + 24 + 24 + read-write + + + NFSEL4 + desc NFSEL4 + 26 + 25 + read-write + + + NFEN4 + desc NFEN4 + 27 + 27 + read-write + + + + + SOE + desc SOE + 0xC8 + 32 + read-write + 0x0 + 0x1 + + + SOE + desc SOE + 0 + 0 + read-write + + + + + STAT + desc STAT + 0xCC + 32 + read-only + 0x0 + 0x3CFEE + + + PWMSF + desc PWMSF + 1 + 1 + read-only + + + CMPF + desc CMPF + 2 + 2 + read-only + + + OSF + desc OSF + 3 + 3 + read-only + + + PWMST + desc PWMST + 5 + 5 + read-only + + + CMPST + desc CMPST + 6 + 6 + read-only + + + OSST + desc OSST + 7 + 7 + read-only + + + PORTINF1 + desc PORTINF1 + 8 + 8 + read-only + + + PORTINF2 + desc PORTINF2 + 9 + 9 + read-only + + + PORTINF3 + desc PORTINF3 + 10 + 10 + read-only + + + PORTINF4 + desc PORTINF4 + 11 + 11 + read-only + + + PORTINST1 + desc PORTINST1 + 14 + 14 + read-only + + + PORTINST2 + desc PORTINST2 + 15 + 15 + read-only + + + PORTINST3 + desc PORTINST3 + 16 + 16 + read-only + + + PORTINST4 + desc PORTINST4 + 17 + 17 + read-only + + + + + STATCLR + desc STATCLR + 0xD0 + 32 + write-only + 0x0 + 0xF0E + + + PWMSFCLR + desc PWMSFCLR + 1 + 1 + write-only + + + CMPFCLR + desc CMPFCLR + 2 + 2 + write-only + + + OSFCLR + desc OSFCLR + 3 + 3 + write-only + + + PORTINFCLR1 + desc PORTINFCLR1 + 8 + 8 + write-only + + + PORTINFCLR2 + desc PORTINFCLR2 + 9 + 9 + write-only + + + PORTINFCLR3 + desc PORTINFCLR3 + 10 + 10 + write-only + + + PORTINFCLR4 + desc PORTINFCLR4 + 11 + 11 + write-only + + + + + INTEN + desc INTEN + 0xD4 + 32 + read-write + 0x0 + 0xF0E + + + PWMSINTEN + desc PWMSINTEN + 1 + 1 + read-write + + + CMPINTEN + desc CMPINTEN + 2 + 2 + read-write + + + OSINTEN + desc OSINTEN + 3 + 3 + read-write + + + PORTINTEN1 + desc PORTINTEN1 + 8 + 8 + read-write + + + PORTINTEN2 + desc PORTINTEN2 + 9 + 9 + read-write + + + PORTINTEN3 + desc PORTINTEN3 + 10 + 10 + read-write + + + PORTINTEN4 + desc PORTINTEN4 + 11 + 11 + read-write + + + + + RLSSEL + desc RLSSEL + 0xD8 + 32 + read-write + 0x0 + 0xF0E + + + PWMRSEL + desc PWMRSEL + 1 + 1 + read-write + + + CMPRSEL + desc CMPRSEL + 2 + 2 + read-write + + + OSRSEL + desc OSRSEL + 3 + 3 + read-write + + + PORTINRSEL1 + desc PORTINRSEL1 + 8 + 8 + read-write + + + PORTINRSEL2 + desc PORTINRSEL2 + 9 + 9 + read-write + + + PORTINRSEL3 + desc PORTINRSEL3 + 10 + 10 + read-write + + + PORTINRSEL4 + desc PORTINRSEL4 + 11 + 11 + read-write + + + + + + + ETH + desc ETH + 0x40050000 + + 0x0 + 0x11058 + + + + MAC_IFCONFR + desc MAC_IFCONFR + 0x5410 + 32 + read-write + 0x0 + 0x31 + + + IFSEL + desc IFSEL + 0 + 0 + read-write + + + RCKINV + desc RCKINV + 4 + 4 + read-write + + + TCKINV + desc TCKINV + 5 + 5 + read-write + + + + + MAC_CONFIGR + desc MAC_CONFIGR + 0x10000 + 32 + read-write + 0x8000 + 0x72CF7EFC + + + RE + desc RE + 2 + 2 + read-write + + + TE + desc TE + 3 + 3 + read-write + + + DC + desc DC + 4 + 4 + read-write + + + BL + desc BL + 6 + 5 + read-write + + + ACS + desc ACS + 7 + 7 + read-write + + + DRTY + desc DRTY + 9 + 9 + read-write + + + IPCO + desc IPCO + 10 + 10 + read-write + + + DM + desc DM + 11 + 11 + read-write + + + LM + desc LM + 12 + 12 + read-write + + + DO + desc DO + 13 + 13 + read-write + + + FES + desc FES + 14 + 14 + read-write + + + DCRS + desc DCRS + 16 + 16 + read-write + + + IFG + desc IFG + 19 + 17 + read-write + + + MJB + desc MJB + 22 + 22 + read-write + + + MWD + desc MWD + 23 + 23 + read-write + + + CST + desc CST + 25 + 25 + read-write + + + SAIRC + desc SAIRC + 30 + 28 + read-write + + + + + MAC_FLTCTLR + desc MAC_FLTCTLR + 0x10004 + 32 + read-write + 0x0 + 0x803107FF + + + PR + desc PR + 0 + 0 + read-write + + + HUC + desc HUC + 1 + 1 + read-write + + + HMC + desc HMC + 2 + 2 + read-write + + + DAIF + desc DAIF + 3 + 3 + read-write + + + PMF + desc PMF + 4 + 4 + read-write + + + DBF + desc DBF + 5 + 5 + read-write + + + PCF + desc PCF + 7 + 6 + read-write + + + SAIF + desc SAIF + 8 + 8 + read-write + + + SAF + desc SAF + 9 + 9 + read-write + + + HPF + desc HPF + 10 + 10 + read-write + + + VTFE + desc VTFE + 16 + 16 + read-write + + + IPFE + desc IPFE + 20 + 20 + read-write + + + DNTU + desc DNTU + 21 + 21 + read-write + + + RA + desc RA + 31 + 31 + read-write + + + + + MAC_HASHTHR + desc MAC_HASHTHR + 0x10008 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HTH + desc HTH + 31 + 0 + read-write + + + + + MAC_HASHTLR + desc MAC_HASHTLR + 0x1000C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HTL + desc HTL + 31 + 0 + read-write + + + + + MAC_SMIADDR + desc MAC_SMIADDR + 0x10010 + 32 + read-write + 0x0 + 0xFFFF + + + SMIB + desc SMIB + 0 + 0 + read-write + + + SMIW + desc SMIW + 1 + 1 + read-write + + + SMIC + desc SMIC + 5 + 2 + read-write + + + SMIR + desc SMIR + 10 + 6 + read-write + + + SMIA + desc SMIA + 15 + 11 + read-write + + + + + MAC_SMIDATR + desc MAC_SMIDATR + 0x10014 + 32 + read-write + 0x0 + 0xFFFF + + + SMID + desc SMID + 15 + 0 + read-write + + + + + MAC_FLOCTLR + desc MAC_FLOCTLR + 0x10018 + 32 + read-write + 0x0 + 0xFFFF00BF + + + FCA_BPA + desc FCA_BPA + 0 + 0 + read-write + + + TFE + desc TFE + 1 + 1 + read-write + + + RFE + desc RFE + 2 + 2 + read-write + + + UNP + desc UNP + 3 + 3 + read-write + + + PLT + desc PLT + 5 + 4 + read-write + + + DZPQ + desc DZPQ + 7 + 7 + read-write + + + PAUSET + desc PAUSET + 31 + 16 + read-write + + + + + MAC_VTAFLTR + desc MAC_VTAFLTR + 0x1001C + 32 + read-write + 0x0 + 0x10BFFFF + + + VLFLT + desc VLFLT + 15 + 0 + read-write + + + VTAL + desc VTAL + 16 + 16 + read-write + + + VTIM + desc VTIM + 17 + 17 + read-write + + + VTHM + desc VTHM + 19 + 19 + read-write + + + + + MAC_MACSTSR + desc MAC_MACSTSR + 0x10024 + 32 + read-only + 0x0 + 0x37F0377 + + + MREA + desc MREA + 0 + 0 + read-only + + + MRS + desc MRS + 2 + 1 + read-only + + + RFWA + desc RFWA + 4 + 4 + read-only + + + RFRS + desc RFRS + 6 + 5 + read-only + + + RFFL + desc RFFL + 9 + 8 + read-only + + + MTEA + desc MTEA + 16 + 16 + read-only + + + MTS + desc MTS + 18 + 17 + read-only + + + MTP + desc MTP + 19 + 19 + read-only + + + TFRS + desc TFRS + 21 + 20 + read-only + + + TFWA + desc TFWA + 22 + 22 + read-only + + + TFNE + desc TFNE + 24 + 24 + read-only + + + TFF + desc TFF + 25 + 25 + read-only + + + + + MAC_RTWKFFR + desc MAC_RTWKFFR + 0x10028 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + WKUPFRMFT + desc WKUPFRMFT + 31 + 0 + read-write + + + + + MAC_PMTCTLR + desc MAC_PMTCTLR + 0x1002C + 32 + read-write + 0x0 + 0x87000667 + + + PWDN + desc PWDN + 0 + 0 + read-write + + + MPEN + desc MPEN + 1 + 1 + read-write + + + WKEN + desc WKEN + 2 + 2 + read-write + + + MPFR + desc MPFR + 5 + 5 + read-only + + + WKFR + desc WKFR + 6 + 6 + read-only + + + GLUB + desc GLUB + 9 + 9 + read-write + + + RTWKTR + desc RTWKTR + 10 + 10 + read-write + + + RTWKPT + desc RTWKPT + 26 + 24 + read-only + + + RTWKFR + desc RTWKFR + 31 + 31 + read-write + + + + + MAC_INTSTSR + desc MAC_INTSTSR + 0x10038 + 32 + read-only + 0x0 + 0x278 + + + PMTIS + desc PMTIS + 3 + 3 + read-only + + + MMCIS + desc MMCIS + 4 + 4 + read-only + + + MMCRXIS + desc MMCRXIS + 5 + 5 + read-only + + + MMCTXIS + desc MMCTXIS + 6 + 6 + read-only + + + TSPIS + desc TSPIS + 9 + 9 + read-only + + + + + MAC_INTMSKR + desc MAC_INTMSKR + 0x1003C + 32 + read-write + 0x0 + 0x208 + + + PMTIM + desc PMTIM + 3 + 3 + read-write + + + TSPIM + desc TSPIM + 9 + 9 + read-write + + + + + MAC_MACADHR0 + desc MAC_MACADHR0 + 0x10040 + 32 + read-write + 0x8000FFFF + 0x8000FFFF + + + ADDRH0 + desc ADDRH0 + 15 + 0 + read-write + + + AE0 + desc AE0 + 31 + 31 + read-only + + + + + MAC_MACADLR0 + desc MAC_MACADLR0 + 0x10044 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + ADDRL0 + desc ADDRL0 + 31 + 0 + read-write + + + + + MAC_MACADHR1 + desc MAC_MACADHR1 + 0x10048 + 32 + read-write + 0xFFFF + 0xFF00FFFF + + + ADDRH1 + desc ADDRH1 + 15 + 0 + read-write + + + MBC1 + desc MBC1 + 29 + 24 + read-write + + + SA1 + desc SA1 + 30 + 30 + read-write + + + AE1 + desc AE1 + 31 + 31 + read-write + + + + + MAC_MACADLR1 + desc MAC_MACADLR1 + 0x1004C + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + ADDRL1 + desc ADDRL1 + 31 + 0 + read-write + + + + + MAC_MACADHR2 + desc MAC_MACADHR2 + 0x10050 + 32 + read-write + 0xFFFF + 0xFF00FFFF + + + ADDRH2 + desc ADDRH2 + 15 + 0 + read-write + + + MBC2 + desc MBC2 + 29 + 24 + read-write + + + SA2 + desc SA2 + 30 + 30 + read-write + + + AE2 + desc AE2 + 31 + 31 + read-write + + + + + MAC_MACADLR2 + desc MAC_MACADLR2 + 0x10054 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + ADDRL2 + desc ADDRL2 + 31 + 0 + read-write + + + + + MAC_MACADHR3 + desc MAC_MACADHR3 + 0x10058 + 32 + read-write + 0xFFFF + 0xFF00FFFF + + + ADDRH3 + desc ADDRH3 + 15 + 0 + read-write + + + MBC3 + desc MBC3 + 29 + 24 + read-write + + + SA3 + desc SA3 + 30 + 30 + read-write + + + AE3 + desc AE3 + 31 + 31 + read-write + + + + + MAC_MACADLR3 + desc MAC_MACADLR3 + 0x1005C + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + ADDRL3 + desc ADDRL3 + 31 + 0 + read-write + + + + + MAC_MACADHR4 + desc MAC_MACADHR4 + 0x10060 + 32 + read-write + 0xFFFF + 0xFF00FFFF + + + ADDRH4 + desc ADDRH4 + 15 + 0 + read-write + + + MBC4 + desc MBC4 + 29 + 24 + read-write + + + SA4 + desc SA4 + 30 + 30 + read-write + + + AE4 + desc AE4 + 31 + 31 + read-write + + + + + MAC_MACADLR4 + desc MAC_MACADLR4 + 0x10064 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + ADDRL4 + desc ADDRL4 + 31 + 0 + read-write + + + + + MMC_MMCCTLR + desc MMC_MMCCTLR + 0x10100 + 32 + read-write + 0x0 + 0x3F + + + CRST + desc CRST + 0 + 0 + read-write + + + COS + desc COS + 1 + 1 + read-write + + + ROR + desc ROR + 2 + 2 + read-write + + + MCF + desc MCF + 3 + 3 + read-write + + + MCPSET + desc MCPSET + 4 + 4 + read-write + + + MCPSEL + desc MCPSEL + 5 + 5 + read-write + + + + + MMC_REVSTSR + desc MMC_REVSTSR + 0x10104 + 32 + read-only + 0x0 + 0x10E00F8 + + + RXBGIS + desc RXBGIS + 3 + 3 + read-only + + + RXMGIS + desc RXMGIS + 4 + 4 + read-only + + + RXCEIS + desc RXCEIS + 5 + 5 + read-only + + + RXAEIS + desc RXAEIS + 6 + 6 + read-only + + + RXREIS + desc RXREIS + 7 + 7 + read-only + + + RXUGIS + desc RXUGIS + 17 + 17 + read-only + + + RXLEIS + desc RXLEIS + 18 + 18 + read-only + + + RXOEIS + desc RXOEIS + 19 + 19 + read-only + + + + + MMC_TRSSTSR + desc MMC_TRSSTSR + 0x10108 + 32 + read-only + 0x0 + 0x16F000C + + + TXBGIS + desc TXBGIS + 2 + 2 + read-only + + + TXMGIS + desc TXMGIS + 3 + 3 + read-only + + + TXDEEIS + desc TXDEEIS + 16 + 16 + read-only + + + TXLCEIS + desc TXLCEIS + 17 + 17 + read-only + + + TXECEIS + desc TXECEIS + 18 + 18 + read-only + + + TXCAEIS + desc TXCAEIS + 19 + 19 + read-only + + + TXUGIS + desc TXUGIS + 21 + 21 + read-only + + + TXEDEIS + desc TXEDEIS + 22 + 22 + read-only + + + + + MMC_RITCTLR + desc MMC_RITCTLR + 0x1010C + 32 + read-write + 0x0 + 0x10E00F8 + + + RXBGIM + desc RXBGIM + 3 + 3 + read-write + + + RXMGIM + desc RXMGIM + 4 + 4 + read-write + + + RXCEIM + desc RXCEIM + 5 + 5 + read-write + + + RXAEIM + desc RXAEIM + 6 + 6 + read-write + + + RXREIM + desc RXREIM + 7 + 7 + read-write + + + RXUGIM + desc RXUGIM + 17 + 17 + read-write + + + RXLEIM + desc RXLEIM + 18 + 18 + read-write + + + RXOEIM + desc RXOEIM + 19 + 19 + read-write + + + + + MMC_TITCTLR + desc MMC_TITCTLR + 0x10110 + 32 + read-write + 0x0 + 0x16F000C + + + TXBGIM + desc TXBGIM + 2 + 2 + read-write + + + TXMGIM + desc TXMGIM + 3 + 3 + read-write + + + TXDEEIM + desc TXDEEIM + 16 + 16 + read-write + + + TXLCEIM + desc TXLCEIM + 17 + 17 + read-write + + + TXECEIM + desc TXECEIM + 18 + 18 + read-write + + + TXCAEIM + desc TXCAEIM + 19 + 19 + read-write + + + TXUGIM + desc TXUGIM + 21 + 21 + read-write + + + TXEDEIM + desc TXEDEIM + 22 + 22 + read-write + + + + + MMC_TXBRGFR + desc MMC_TXBRGFR + 0x1011C + 32 + read-write + 0x0 + 0xFFFF + + + TXBRGCNT + desc TXBRGCNT + 15 + 0 + read-write + + + + + MMC_TXMUGFR + desc MMC_TXMUGFR + 0x10120 + 32 + read-write + 0x0 + 0xFFFF + + + TXMUGCNT + desc TXMUGCNT + 15 + 0 + read-write + + + + + MMC_TXDEEFR + desc MMC_TXDEEFR + 0x10154 + 32 + read-write + 0x0 + 0xFFFF + + + TXDEECNT + desc TXDEECNT + 15 + 0 + read-write + + + + + MMC_TXLCEFR + desc MMC_TXLCEFR + 0x10158 + 32 + read-write + 0x0 + 0xFFFF + + + TXLCECNT + desc TXLCECNT + 15 + 0 + read-write + + + + + MMC_TXECEFR + desc MMC_TXECEFR + 0x1015C + 32 + read-write + 0x0 + 0xFFFF + + + TXECECNT + desc TXECECNT + 15 + 0 + read-write + + + + + MMC_TXCAEFR + desc MMC_TXCAEFR + 0x10160 + 32 + read-write + 0x0 + 0xFFFF + + + TXCAECNT + desc TXCAECNT + 15 + 0 + read-write + + + + + MMC_TXUNGFR + desc MMC_TXUNGFR + 0x10168 + 32 + read-write + 0x0 + 0xFFFF + + + TXUNGCNT + desc TXUNGCNT + 15 + 0 + read-write + + + + + MMC_TXEDEFR + desc MMC_TXEDEFR + 0x1016C + 32 + read-write + 0x0 + 0xFFFF + + + TXEDECNT + desc TXEDECNT + 15 + 0 + read-write + + + + + MMC_RXBRGFR + desc MMC_RXBRGFR + 0x1018C + 32 + read-write + 0x0 + 0xFFFF + + + RXBRGCNT + desc RXBRGCNT + 15 + 0 + read-write + + + + + MMC_RXMUGFR + desc MMC_RXMUGFR + 0x10190 + 32 + read-write + 0x0 + 0xFFFF + + + RXMUGCNT + desc RXMUGCNT + 15 + 0 + read-write + + + + + MMC_RXCREFR + desc MMC_RXCREFR + 0x10194 + 32 + read-write + 0x0 + 0xFFFF + + + RXCRECNT + desc RXCRECNT + 15 + 0 + read-write + + + + + MMC_RXALEFR + desc MMC_RXALEFR + 0x10198 + 32 + read-write + 0x0 + 0xFFFF + + + RXALECNT + desc RXALECNT + 15 + 0 + read-write + + + + + MMC_RXRUEFR + desc MMC_RXRUEFR + 0x1019C + 32 + read-write + 0x0 + 0xFFFF + + + RXRUECNT + desc RXRUECNT + 15 + 0 + read-write + + + + + MMC_RXUNGFR + desc MMC_RXUNGFR + 0x101C4 + 32 + read-write + 0x0 + 0xFFFF + + + RXUNGCNT + desc RXUNGCNT + 15 + 0 + read-write + + + + + MMC_RXLEEFR + desc MMC_RXLEEFR + 0x101C8 + 32 + read-write + 0x0 + 0xFFFF + + + RXLEECNT + desc RXLEECNT + 15 + 0 + read-write + + + + + MMC_RXOREFR + desc MMC_RXOREFR + 0x101CC + 32 + read-write + 0x0 + 0xFFFF + + + RXORECNT + desc RXORECNT + 15 + 0 + read-write + + + + + MAC_L34CTLR + desc MAC_L34CTLR + 0x10400 + 32 + read-write + 0x0 + 0x13DFFFD + + + L3PEN + desc L3PEN + 0 + 0 + read-write + + + L3SAM + desc L3SAM + 2 + 2 + read-write + + + L3SAIM + desc L3SAIM + 3 + 3 + read-write + + + L3DAM + desc L3DAM + 4 + 4 + read-write + + + L3DAIM + desc L3DAIM + 5 + 5 + read-write + + + L3HSBM + desc L3HSBM + 10 + 6 + read-write + + + L3HDBM + desc L3HDBM + 15 + 11 + read-write + + + L4PEN + desc L4PEN + 16 + 16 + read-write + + + L4SPM + desc L4SPM + 18 + 18 + read-write + + + L4SPIM + desc L4SPIM + 19 + 19 + read-write + + + L4DPM + desc L4DPM + 20 + 20 + read-write + + + L4DPIM + desc L4DPIM + 21 + 21 + read-write + + + + + MAC_L4PORTR + desc MAC_L4PORTR + 0x10404 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + L4SPVAL + desc L4SPVAL + 15 + 0 + read-write + + + L4DPVAL + desc L4DPVAL + 31 + 16 + read-write + + + + + MAC_L3ADDRR0 + desc MAC_L3ADDRR0 + 0x10410 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + L3ADDR0 + desc L3ADDR0 + 31 + 0 + read-write + + + + + MAC_L3ADDRR1 + desc MAC_L3ADDRR1 + 0x10414 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + L3ADDR2 + desc L3ADDR2 + 31 + 0 + read-write + + + + + MAC_L3ADDRR2 + desc MAC_L3ADDRR2 + 0x10418 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + L3ADDR2 + desc L3ADDR2 + 31 + 0 + read-write + + + + + MAC_L3ADDRR3 + desc MAC_L3ADDRR3 + 0x1041C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + L3ADDR3 + desc L3ADDR3 + 31 + 0 + read-write + + + + + MAC_VTACTLR + desc MAC_VTACTLR + 0x10584 + 32 + read-write + 0x0 + 0x107FFFF + + + VLANV + desc VLANV + 15 + 0 + read-write + + + VLANC + desc VLANC + 17 + 16 + read-write + + + VLANS + desc VLANS + 18 + 18 + read-write + + + + + MAC_VLAHTBR + desc MAC_VLAHTBR + 0x10588 + 32 + read-write + 0x0 + 0xFFFF + + + VLHT + desc VLHT + 15 + 0 + read-write + + + + + PTP_TSPCTLR + desc PTP_TSPCTLR + 0x10700 + 32 + read-write + 0x2000 + 0x107FF3F + + + TSPEN + desc TSPEN + 0 + 0 + read-write + + + TSPUPSEL + desc TSPUPSEL + 1 + 1 + read-write + + + TSPINI + desc TSPINI + 2 + 2 + read-write + + + TSPUP + desc TSPUP + 3 + 3 + read-write + + + TSPINT + desc TSPINT + 4 + 4 + read-write + + + TSPADUP + desc TSPADUP + 5 + 5 + read-write + + + TSPEALL + desc TSPEALL + 8 + 8 + read-write + + + TSPSSR + desc TSPSSR + 9 + 9 + read-write + + + TSPVER + desc TSPVER + 10 + 10 + read-write + + + TSPOVETH + desc TSPOVETH + 11 + 11 + read-write + + + TSPOVIPV6 + desc TSPOVIPV6 + 12 + 12 + read-write + + + TSPOVIPV4 + desc TSPOVIPV4 + 13 + 13 + read-write + + + TSPMTSEL + desc TSPMTSEL + 17 + 14 + read-write + + + TSPADF + desc TSPADF + 18 + 18 + read-write + + + + + PTP_TSPNSAR + desc PTP_TSPNSAR + 0x10704 + 32 + read-write + 0x0 + 0xFF + + + TSPNSEADD + desc TSPNSEADD + 7 + 0 + read-write + + + + + PTP_TMSSECR + desc PTP_TMSSECR + 0x10708 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + TSPSYSSEC + desc TSPSYSSEC + 31 + 0 + read-only + + + + + PTP_TMSNSER + desc PTP_TMSNSER + 0x1070C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + TSPSYSNSEC + desc TSPSYSNSEC + 30 + 0 + read-only + + + + + PTP_TMUSECR + desc PTP_TMUSECR + 0x10710 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + TSPUPSEC + desc TSPUPSEC + 31 + 0 + read-write + + + + + PTP_TMUNSER + desc PTP_TMUNSER + 0x10714 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + TSPUPNSE + desc TSPUPNSE + 30 + 0 + read-write + + + TSPUPNS + desc TSPUPNS + 31 + 31 + read-write + + + + + PTP_TSPADDR + desc PTP_TSPADDR + 0x10718 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + TSPADD + desc TSPADD + 31 + 0 + read-write + + + + + PTP_TMTSECR0 + desc PTP_TMTSECR0 + 0x1071C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + TSPTAGSEC0 + desc TSPTAGSEC0 + 31 + 0 + read-write + + + + + PTP_TMTNSER0 + desc PTP_TMTNSER0 + 0x10720 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + TSPTAGNSEC0 + desc TSPTAGNSEC0 + 30 + 0 + read-write + + + + + PTP_TSPSTSR + desc PTP_TSPSTSR + 0x10728 + 32 + read-only + 0x0 + 0x3B + + + TSOVF + desc TSOVF + 0 + 0 + read-only + + + TSTAR0 + desc TSTAR0 + 1 + 1 + read-only + + + TSERR0 + desc TSERR0 + 3 + 3 + read-only + + + TSTAR1 + desc TSTAR1 + 4 + 4 + read-only + + + TSERR1 + desc TSERR1 + 5 + 5 + read-only + + + + + PTP_PPSCTLR + desc PTP_PPSCTLR + 0x1072C + 32 + read-write + 0x0 + 0x677F + + + PPSFRE0 + desc PPSFRE0 + 3 + 0 + read-write + + + PPSOMD + desc PPSOMD + 4 + 4 + read-write + + + TT0SEL + desc TT0SEL + 6 + 5 + read-write + + + PPSFRE1 + desc PPSFRE1 + 10 + 8 + read-write + + + TT1SEL + desc TT1SEL + 14 + 13 + read-write + + + + + PTP_TMTSECR1 + desc PTP_TMTSECR1 + 0x10780 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + TSPTAGSEC1 + desc TSPTAGSEC1 + 31 + 0 + read-write + + + + + PTP_TMTNSER1 + desc PTP_TMTNSER1 + 0x10784 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + TSPTAGNSEC1 + desc TSPTAGNSEC1 + 30 + 0 + read-write + + + + + DMA_BUSMODR + desc DMA_BUSMODR + 0x11000 + 32 + read-write + 0x20101 + 0xFFFFFFF + + + SWR + desc SWR + 0 + 0 + read-write + + + DMAA + desc DMAA + 1 + 1 + read-write + + + DSL + desc DSL + 6 + 2 + read-write + + + DSEN + desc DSEN + 7 + 7 + read-write + + + TPBL + desc TPBL + 13 + 8 + read-write + + + PRAT + desc PRAT + 15 + 14 + read-write + + + FBST + desc FBST + 16 + 16 + read-write + + + RPBL + desc RPBL + 22 + 17 + read-write + + + SPBL + desc SPBL + 23 + 23 + read-write + + + M8PBL + desc M8PBL + 24 + 24 + read-write + + + AAL + desc AAL + 25 + 25 + read-write + + + MBST + desc MBST + 26 + 26 + read-write + + + TXPR + desc TXPR + 27 + 27 + read-write + + + + + DMA_TXPOLLR + desc DMA_TXPOLLR + 0x11004 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + TXPOLL + desc TXPOLL + 31 + 0 + read-write + + + + + DMA_RXPOLLR + desc DMA_RXPOLLR + 0x11008 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + RXPOLL + desc RXPOLL + 31 + 0 + read-write + + + + + DMA_RXDLADR + desc DMA_RXDLADR + 0x1100C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + RXDLAD + desc RXDLAD + 31 + 0 + read-write + + + + + DMA_TXDLADR + desc DMA_TXDLADR + 0x11010 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + TXDLAD + desc TXDLAD + 31 + 0 + read-write + + + + + DMA_DMASTSR + desc DMA_DMASTSR + 0x11014 + 32 + read-only + 0x0 + 0x3BFFE7FF + + + TIS + desc TIS + 0 + 0 + read-only + + + TSS + desc TSS + 1 + 1 + read-only + + + TUS + desc TUS + 2 + 2 + read-only + + + TJS + desc TJS + 3 + 3 + read-only + + + OVS + desc OVS + 4 + 4 + read-only + + + UNS + desc UNS + 5 + 5 + read-only + + + RIS + desc RIS + 6 + 6 + read-only + + + RUS + desc RUS + 7 + 7 + read-only + + + RSS + desc RSS + 8 + 8 + read-only + + + RWS + desc RWS + 9 + 9 + read-only + + + ETS + desc ETS + 10 + 10 + read-only + + + FBS + desc FBS + 13 + 13 + read-only + + + ERS + desc ERS + 14 + 14 + read-only + + + AIS + desc AIS + 15 + 15 + read-only + + + NIS + desc NIS + 16 + 16 + read-only + + + RSTS + desc RSTS + 19 + 17 + read-only + + + TSTS + desc TSTS + 22 + 20 + read-only + + + EBUS + desc EBUS + 25 + 23 + read-only + + + MMCS + desc MMCS + 27 + 27 + read-only + + + PMTS + desc PMTS + 28 + 28 + read-only + + + PTPS + desc PTPS + 29 + 29 + read-only + + + + + DMA_OPRMODR + desc DMA_OPRMODR + 0x11018 + 32 + read-write + 0x0 + 0x731E0FE + + + STR + desc STR + 1 + 1 + read-write + + + OSF + desc OSF + 2 + 2 + read-write + + + RTC + desc RTC + 4 + 3 + read-write + + + DGF + desc DGF + 5 + 5 + read-write + + + FUF + desc FUF + 6 + 6 + read-write + + + FEF + desc FEF + 7 + 7 + read-write + + + STT + desc STT + 13 + 13 + read-write + + + TTC + desc TTC + 16 + 14 + read-write + + + FTF + desc FTF + 20 + 20 + read-write + + + TSF + desc TSF + 21 + 21 + read-write + + + DFRF + desc DFRF + 24 + 24 + read-write + + + RSF + desc RSF + 25 + 25 + read-write + + + DTCOE + desc DTCOE + 26 + 26 + read-write + + + + + DMA_INTENAR + desc DMA_INTENAR + 0x1101C + 32 + read-write + 0x0 + 0x101E7FF + + + TIE + desc TIE + 0 + 0 + read-write + + + TSE + desc TSE + 1 + 1 + read-write + + + TUE + desc TUE + 2 + 2 + read-write + + + TJE + desc TJE + 3 + 3 + read-write + + + OVE + desc OVE + 4 + 4 + read-write + + + UNE + desc UNE + 5 + 5 + read-write + + + RIE + desc RIE + 6 + 6 + read-write + + + RUE + desc RUE + 7 + 7 + read-write + + + RSE + desc RSE + 8 + 8 + read-write + + + RWE + desc RWE + 9 + 9 + read-write + + + ETE + desc ETE + 10 + 10 + read-write + + + FBE + desc FBE + 13 + 13 + read-write + + + ERE + desc ERE + 14 + 14 + read-write + + + AIE + desc AIE + 15 + 15 + read-write + + + NIE + desc NIE + 16 + 16 + read-write + + + + + DMA_RFRCNTR + desc DMA_RFRCNTR + 0x11020 + 32 + read-only + 0x0 + 0x1FFFFFFF + + + UNACNT + desc UNACNT + 15 + 0 + read-only + + + UNAOVF + desc UNAOVF + 16 + 16 + read-only + + + OVFCNT + desc OVFCNT + 27 + 17 + read-only + + + OVFOVF + desc OVFOVF + 28 + 28 + read-only + + + + + DMA_REVWDTR + desc DMA_REVWDTR + 0x11024 + 32 + read-write + 0x0 + 0xFF + + + RIWT + desc RIWT + 7 + 0 + read-write + + + + + DMA_CHTXDER + desc DMA_CHTXDER + 0x11048 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + CHTXDE + desc CHTXDE + 31 + 0 + read-only + + + + + DMA_CHRXDER + desc DMA_CHRXDER + 0x1104C + 32 + read-only + 0x0 + 0xFFFFFFFF + + + CHRXDE + desc CHRXDE + 31 + 0 + read-only + + + + + DMA_CHTXBFR + desc DMA_CHTXBFR + 0x11050 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + CHTXBF + desc CHTXBF + 31 + 0 + read-only + + + + + DMA_CHRXBFR + desc DMA_CHRXBFR + 0x11054 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + CHRXBF + desc CHRXBF + 31 + 0 + read-only + + + + + + + FCM + desc FCM + 0x40048400 + + 0x0 + 0x24 + + + + LVR + desc LVR + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + LVR + desc LVR + 15 + 0 + read-write + + + + + UVR + desc UVR + 0x4 + 32 + read-write + 0x0 + 0xFFFF + + + UVR + desc UVR + 15 + 0 + read-write + + + + + CNTR + desc CNTR + 0x8 + 32 + read-only + 0x0 + 0xFFFF + + + CNTR + desc CNTR + 15 + 0 + read-only + + + + + STR + desc STR + 0xC + 32 + read-write + 0x0 + 0x1 + + + START + desc START + 0 + 0 + read-write + + + + + MCCR + desc MCCR + 0x10 + 32 + read-write + 0x0 + 0xF3 + + + MDIVS + desc MDIVS + 1 + 0 + read-write + + + MCKS + desc MCKS + 7 + 4 + read-write + + + + + RCCR + desc RCCR + 0x14 + 32 + read-write + 0x0 + 0xB3FB + + + RDIVS + desc RDIVS + 1 + 0 + read-write + + + RCKS + desc RCKS + 6 + 3 + read-write + + + INEXS + desc INEXS + 7 + 7 + read-write + + + DNFS + desc DNFS + 9 + 8 + read-write + + + EDGES + desc EDGES + 13 + 12 + read-write + + + EXREFE + desc EXREFE + 15 + 15 + read-write + + + + + RIER + desc RIER + 0x18 + 32 + read-write + 0x0 + 0x97 + + + ERRIE + desc ERRIE + 0 + 0 + read-write + + + MENDIE + desc MENDIE + 1 + 1 + read-write + + + OVFIE + desc OVFIE + 2 + 2 + read-write + + + ERRINTRS + desc ERRINTRS + 4 + 4 + read-write + + + ERRE + desc ERRE + 7 + 7 + read-write + + + + + SR + desc SR + 0x1C + 32 + read-only + 0x0 + 0x7 + + + ERRF + desc ERRF + 0 + 0 + read-only + + + MENDF + desc MENDF + 1 + 1 + read-only + + + OVF + desc OVF + 2 + 2 + read-only + + + + + CLR + desc CLR + 0x20 + 32 + write-only + 0x0 + 0x7 + + + ERRFCLR + desc ERRFCLR + 0 + 0 + write-only + + + MENDFCLR + desc MENDFCLR + 1 + 1 + write-only + + + OVFCLR + desc OVFCLR + 2 + 2 + write-only + + + + + + + FMAC1 + desc FMAC1 + 0x40058000 + + 0x0 + 0x64 + + + + ENR + desc ENR + 0x0 + 32 + read-write + 0x0 + 0x1 + + + FMACEN + desc FMACEN + 0 + 0 + read-write + + + + + CTR + desc CTR + 0x4 + 32 + read-write + 0x10 + 0x1F1F + + + STAGE_NUM + desc STAGE_NUM + 4 + 0 + read-write + + + SHIFT + desc SHIFT + 12 + 8 + read-write + + + + + IER + desc IER + 0x8 + 32 + read-write + 0x0 + 0x1 + + + INTEN + desc INTEN + 0 + 0 + read-write + + + + + DTR + desc DTR + 0xC + 32 + read-write + 0x0 + 0xFFFF + + + DIN + desc DIN + 15 + 0 + read-write + + + + + RTR0 + desc RTR0 + 0x10 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + RTR1 + desc RTR1 + 0x14 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + STR + desc STR + 0x18 + 32 + read-write + 0x0 + 0x80000000 + + + READY + desc READY + 31 + 31 + read-write + + + + + COR0 + desc COR0 + 0x20 + 32 + read-write + 0x0 + 0xFFFF + + + CIN0 + desc CIN0 + 15 + 0 + read-write + + + + + COR1 + desc COR1 + 0x24 + 32 + read-write + 0x0 + 0xFFFF + + + CIN1 + desc CIN1 + 15 + 0 + read-write + + + + + COR2 + desc COR2 + 0x28 + 32 + read-write + 0x0 + 0xFFFF + + + CIN2 + desc CIN2 + 15 + 0 + read-write + + + + + COR3 + desc COR3 + 0x2C + 32 + read-write + 0x0 + 0xFFFF + + + CIN3 + desc CIN3 + 15 + 0 + read-write + + + + + COR4 + desc COR4 + 0x30 + 32 + read-write + 0x0 + 0xFFFF + + + CIN4 + desc CIN4 + 15 + 0 + read-write + + + + + COR5 + desc COR5 + 0x34 + 32 + read-write + 0x0 + 0xFFFF + + + CIN5 + desc CIN5 + 15 + 0 + read-write + + + + + COR6 + desc COR6 + 0x38 + 32 + read-write + 0x0 + 0xFFFF + + + CIN6 + desc CIN6 + 15 + 0 + read-write + + + + + COR7 + desc COR7 + 0x3C + 32 + read-write + 0x0 + 0xFFFF + + + CIN7 + desc CIN7 + 15 + 0 + read-write + + + + + COR8 + desc COR8 + 0x40 + 32 + read-write + 0x0 + 0xFFFF + + + CIN8 + desc CIN8 + 15 + 0 + read-write + + + + + COR9 + desc COR9 + 0x44 + 32 + read-write + 0x0 + 0xFFFF + + + CIN9 + desc CIN9 + 15 + 0 + read-write + + + + + COR10 + desc COR10 + 0x48 + 32 + read-write + 0x0 + 0xFFFF + + + CIN10 + desc CIN10 + 15 + 0 + read-write + + + + + COR11 + desc COR11 + 0x4C + 32 + read-write + 0x0 + 0xFFFF + + + CIN11 + desc CIN11 + 15 + 0 + read-write + + + + + COR12 + desc COR12 + 0x50 + 32 + read-write + 0x0 + 0xFFFF + + + CIN12 + desc CIN12 + 15 + 0 + read-write + + + + + COR13 + desc COR13 + 0x54 + 32 + read-write + 0x0 + 0xFFFF + + + CIN13 + desc CIN13 + 15 + 0 + read-write + + + + + COR14 + desc COR14 + 0x58 + 32 + read-write + 0x0 + 0xFFFF + + + CIN14 + desc CIN14 + 15 + 0 + read-write + + + + + COR15 + desc COR15 + 0x5C + 32 + read-write + 0x0 + 0xFFFF + + + CIN15 + desc CIN15 + 15 + 0 + read-write + + + + + COR16 + desc COR16 + 0x60 + 32 + read-write + 0x0 + 0xFFFF + + + CIN16 + desc CIN16 + 15 + 0 + read-write + + + + + + + FMAC2 + desc FMAC2 + 0x40058400 + + 0x0 + 0x64 + + + + ENR + desc ENR + 0x0 + 32 + read-write + 0x0 + 0x1 + + + FMACEN + desc FMACEN + 0 + 0 + read-write + + + + + CTR + desc CTR + 0x4 + 32 + read-write + 0x10 + 0x1F1F + + + STAGE_NUM + desc STAGE_NUM + 4 + 0 + read-write + + + SHIFT + desc SHIFT + 12 + 8 + read-write + + + + + IER + desc IER + 0x8 + 32 + read-write + 0x0 + 0x1 + + + INTEN + desc INTEN + 0 + 0 + read-write + + + + + DTR + desc DTR + 0xC + 32 + read-write + 0x0 + 0xFFFF + + + DIN + desc DIN + 15 + 0 + read-write + + + + + RTR0 + desc RTR0 + 0x10 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + RTR1 + desc RTR1 + 0x14 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + STR + desc STR + 0x18 + 32 + read-write + 0x0 + 0x80000000 + + + READY + desc READY + 31 + 31 + read-write + + + + + COR0 + desc COR0 + 0x20 + 32 + read-write + 0x0 + 0xFFFF + + + CIN0 + desc CIN0 + 15 + 0 + read-write + + + + + COR1 + desc COR1 + 0x24 + 32 + read-write + 0x0 + 0xFFFF + + + CIN1 + desc CIN1 + 15 + 0 + read-write + + + + + COR2 + desc COR2 + 0x28 + 32 + read-write + 0x0 + 0xFFFF + + + CIN2 + desc CIN2 + 15 + 0 + read-write + + + + + COR3 + desc COR3 + 0x2C + 32 + read-write + 0x0 + 0xFFFF + + + CIN3 + desc CIN3 + 15 + 0 + read-write + + + + + COR4 + desc COR4 + 0x30 + 32 + read-write + 0x0 + 0xFFFF + + + CIN4 + desc CIN4 + 15 + 0 + read-write + + + + + COR5 + desc COR5 + 0x34 + 32 + read-write + 0x0 + 0xFFFF + + + CIN5 + desc CIN5 + 15 + 0 + read-write + + + + + COR6 + desc COR6 + 0x38 + 32 + read-write + 0x0 + 0xFFFF + + + CIN6 + desc CIN6 + 15 + 0 + read-write + + + + + COR7 + desc COR7 + 0x3C + 32 + read-write + 0x0 + 0xFFFF + + + CIN7 + desc CIN7 + 15 + 0 + read-write + + + + + COR8 + desc COR8 + 0x40 + 32 + read-write + 0x0 + 0xFFFF + + + CIN8 + desc CIN8 + 15 + 0 + read-write + + + + + COR9 + desc COR9 + 0x44 + 32 + read-write + 0x0 + 0xFFFF + + + CIN9 + desc CIN9 + 15 + 0 + read-write + + + + + COR10 + desc COR10 + 0x48 + 32 + read-write + 0x0 + 0xFFFF + + + CIN10 + desc CIN10 + 15 + 0 + read-write + + + + + COR11 + desc COR11 + 0x4C + 32 + read-write + 0x0 + 0xFFFF + + + CIN11 + desc CIN11 + 15 + 0 + read-write + + + + + COR12 + desc COR12 + 0x50 + 32 + read-write + 0x0 + 0xFFFF + + + CIN12 + desc CIN12 + 15 + 0 + read-write + + + + + COR13 + desc COR13 + 0x54 + 32 + read-write + 0x0 + 0xFFFF + + + CIN13 + desc CIN13 + 15 + 0 + read-write + + + + + COR14 + desc COR14 + 0x58 + 32 + read-write + 0x0 + 0xFFFF + + + CIN14 + desc CIN14 + 15 + 0 + read-write + + + + + COR15 + desc COR15 + 0x5C + 32 + read-write + 0x0 + 0xFFFF + + + CIN15 + desc CIN15 + 15 + 0 + read-write + + + + + COR16 + desc COR16 + 0x60 + 32 + read-write + 0x0 + 0xFFFF + + + CIN16 + desc CIN16 + 15 + 0 + read-write + + + + + + + FMAC3 + desc FMAC3 + 0x40058800 + + 0x0 + 0x64 + + + + ENR + desc ENR + 0x0 + 32 + read-write + 0x0 + 0x1 + + + FMACEN + desc FMACEN + 0 + 0 + read-write + + + + + CTR + desc CTR + 0x4 + 32 + read-write + 0x10 + 0x1F1F + + + STAGE_NUM + desc STAGE_NUM + 4 + 0 + read-write + + + SHIFT + desc SHIFT + 12 + 8 + read-write + + + + + IER + desc IER + 0x8 + 32 + read-write + 0x0 + 0x1 + + + INTEN + desc INTEN + 0 + 0 + read-write + + + + + DTR + desc DTR + 0xC + 32 + read-write + 0x0 + 0xFFFF + + + DIN + desc DIN + 15 + 0 + read-write + + + + + RTR0 + desc RTR0 + 0x10 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + RTR1 + desc RTR1 + 0x14 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + STR + desc STR + 0x18 + 32 + read-write + 0x0 + 0x80000000 + + + READY + desc READY + 31 + 31 + read-write + + + + + COR0 + desc COR0 + 0x20 + 32 + read-write + 0x0 + 0xFFFF + + + CIN0 + desc CIN0 + 15 + 0 + read-write + + + + + COR1 + desc COR1 + 0x24 + 32 + read-write + 0x0 + 0xFFFF + + + CIN1 + desc CIN1 + 15 + 0 + read-write + + + + + COR2 + desc COR2 + 0x28 + 32 + read-write + 0x0 + 0xFFFF + + + CIN2 + desc CIN2 + 15 + 0 + read-write + + + + + COR3 + desc COR3 + 0x2C + 32 + read-write + 0x0 + 0xFFFF + + + CIN3 + desc CIN3 + 15 + 0 + read-write + + + + + COR4 + desc COR4 + 0x30 + 32 + read-write + 0x0 + 0xFFFF + + + CIN4 + desc CIN4 + 15 + 0 + read-write + + + + + COR5 + desc COR5 + 0x34 + 32 + read-write + 0x0 + 0xFFFF + + + CIN5 + desc CIN5 + 15 + 0 + read-write + + + + + COR6 + desc COR6 + 0x38 + 32 + read-write + 0x0 + 0xFFFF + + + CIN6 + desc CIN6 + 15 + 0 + read-write + + + + + COR7 + desc COR7 + 0x3C + 32 + read-write + 0x0 + 0xFFFF + + + CIN7 + desc CIN7 + 15 + 0 + read-write + + + + + COR8 + desc COR8 + 0x40 + 32 + read-write + 0x0 + 0xFFFF + + + CIN8 + desc CIN8 + 15 + 0 + read-write + + + + + COR9 + desc COR9 + 0x44 + 32 + read-write + 0x0 + 0xFFFF + + + CIN9 + desc CIN9 + 15 + 0 + read-write + + + + + COR10 + desc COR10 + 0x48 + 32 + read-write + 0x0 + 0xFFFF + + + CIN10 + desc CIN10 + 15 + 0 + read-write + + + + + COR11 + desc COR11 + 0x4C + 32 + read-write + 0x0 + 0xFFFF + + + CIN11 + desc CIN11 + 15 + 0 + read-write + + + + + COR12 + desc COR12 + 0x50 + 32 + read-write + 0x0 + 0xFFFF + + + CIN12 + desc CIN12 + 15 + 0 + read-write + + + + + COR13 + desc COR13 + 0x54 + 32 + read-write + 0x0 + 0xFFFF + + + CIN13 + desc CIN13 + 15 + 0 + read-write + + + + + COR14 + desc COR14 + 0x58 + 32 + read-write + 0x0 + 0xFFFF + + + CIN14 + desc CIN14 + 15 + 0 + read-write + + + + + COR15 + desc COR15 + 0x5C + 32 + read-write + 0x0 + 0xFFFF + + + CIN15 + desc CIN15 + 15 + 0 + read-write + + + + + COR16 + desc COR16 + 0x60 + 32 + read-write + 0x0 + 0xFFFF + + + CIN16 + desc CIN16 + 15 + 0 + read-write + + + + + + + FMAC4 + desc FMAC4 + 0x40058C00 + + 0x0 + 0x64 + + + + ENR + desc ENR + 0x0 + 32 + read-write + 0x0 + 0x1 + + + FMACEN + desc FMACEN + 0 + 0 + read-write + + + + + CTR + desc CTR + 0x4 + 32 + read-write + 0x10 + 0x1F1F + + + STAGE_NUM + desc STAGE_NUM + 4 + 0 + read-write + + + SHIFT + desc SHIFT + 12 + 8 + read-write + + + + + IER + desc IER + 0x8 + 32 + read-write + 0x0 + 0x1 + + + INTEN + desc INTEN + 0 + 0 + read-write + + + + + DTR + desc DTR + 0xC + 32 + read-write + 0x0 + 0xFFFF + + + DIN + desc DIN + 15 + 0 + read-write + + + + + RTR0 + desc RTR0 + 0x10 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + RTR1 + desc RTR1 + 0x14 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + STR + desc STR + 0x18 + 32 + read-write + 0x0 + 0x80000000 + + + READY + desc READY + 31 + 31 + read-write + + + + + COR0 + desc COR0 + 0x20 + 32 + read-write + 0x0 + 0xFFFF + + + CIN0 + desc CIN0 + 15 + 0 + read-write + + + + + COR1 + desc COR1 + 0x24 + 32 + read-write + 0x0 + 0xFFFF + + + CIN1 + desc CIN1 + 15 + 0 + read-write + + + + + COR2 + desc COR2 + 0x28 + 32 + read-write + 0x0 + 0xFFFF + + + CIN2 + desc CIN2 + 15 + 0 + read-write + + + + + COR3 + desc COR3 + 0x2C + 32 + read-write + 0x0 + 0xFFFF + + + CIN3 + desc CIN3 + 15 + 0 + read-write + + + + + COR4 + desc COR4 + 0x30 + 32 + read-write + 0x0 + 0xFFFF + + + CIN4 + desc CIN4 + 15 + 0 + read-write + + + + + COR5 + desc COR5 + 0x34 + 32 + read-write + 0x0 + 0xFFFF + + + CIN5 + desc CIN5 + 15 + 0 + read-write + + + + + COR6 + desc COR6 + 0x38 + 32 + read-write + 0x0 + 0xFFFF + + + CIN6 + desc CIN6 + 15 + 0 + read-write + + + + + COR7 + desc COR7 + 0x3C + 32 + read-write + 0x0 + 0xFFFF + + + CIN7 + desc CIN7 + 15 + 0 + read-write + + + + + COR8 + desc COR8 + 0x40 + 32 + read-write + 0x0 + 0xFFFF + + + CIN8 + desc CIN8 + 15 + 0 + read-write + + + + + COR9 + desc COR9 + 0x44 + 32 + read-write + 0x0 + 0xFFFF + + + CIN9 + desc CIN9 + 15 + 0 + read-write + + + + + COR10 + desc COR10 + 0x48 + 32 + read-write + 0x0 + 0xFFFF + + + CIN10 + desc CIN10 + 15 + 0 + read-write + + + + + COR11 + desc COR11 + 0x4C + 32 + read-write + 0x0 + 0xFFFF + + + CIN11 + desc CIN11 + 15 + 0 + read-write + + + + + COR12 + desc COR12 + 0x50 + 32 + read-write + 0x0 + 0xFFFF + + + CIN12 + desc CIN12 + 15 + 0 + read-write + + + + + COR13 + desc COR13 + 0x54 + 32 + read-write + 0x0 + 0xFFFF + + + CIN13 + desc CIN13 + 15 + 0 + read-write + + + + + COR14 + desc COR14 + 0x58 + 32 + read-write + 0x0 + 0xFFFF + + + CIN14 + desc CIN14 + 15 + 0 + read-write + + + + + COR15 + desc COR15 + 0x5C + 32 + read-write + 0x0 + 0xFFFF + + + CIN15 + desc CIN15 + 15 + 0 + read-write + + + + + COR16 + desc COR16 + 0x60 + 32 + read-write + 0x0 + 0xFFFF + + + CIN16 + desc CIN16 + 15 + 0 + read-write + + + + + + + GPIO + desc GPIO + 0x40053800 + + 0x0 + 0x638 + + + + PIDRA + desc PIDRA + 0x0 + 16 + read-only + 0x0 + 0xFFFF + + + PIN00 + desc PIN00 + 0 + 0 + read-only + + + PIN01 + desc PIN01 + 1 + 1 + read-only + + + PIN02 + desc PIN02 + 2 + 2 + read-only + + + PIN03 + desc PIN03 + 3 + 3 + read-only + + + PIN04 + desc PIN04 + 4 + 4 + read-only + + + PIN05 + desc PIN05 + 5 + 5 + read-only + + + PIN06 + desc PIN06 + 6 + 6 + read-only + + + PIN07 + desc PIN07 + 7 + 7 + read-only + + + PIN08 + desc PIN08 + 8 + 8 + read-only + + + PIN09 + desc PIN09 + 9 + 9 + read-only + + + PIN10 + desc PIN10 + 10 + 10 + read-only + + + PIN11 + desc PIN11 + 11 + 11 + read-only + + + PIN12 + desc PIN12 + 12 + 12 + read-only + + + PIN13 + desc PIN13 + 13 + 13 + read-only + + + PIN14 + desc PIN14 + 14 + 14 + read-only + + + PIN15 + desc PIN15 + 15 + 15 + read-only + + + + + PODRA + desc PODRA + 0x4 + 16 + read-write + 0x0 + 0xFFFF + + + POUT00 + desc POUT00 + 0 + 0 + read-write + + + POUT01 + desc POUT01 + 1 + 1 + read-write + + + POUT02 + desc POUT02 + 2 + 2 + read-write + + + POUT03 + desc POUT03 + 3 + 3 + read-write + + + POUT04 + desc POUT04 + 4 + 4 + read-write + + + POUT05 + desc POUT05 + 5 + 5 + read-write + + + POUT06 + desc POUT06 + 6 + 6 + read-write + + + POUT07 + desc POUT07 + 7 + 7 + read-write + + + POUT08 + desc POUT08 + 8 + 8 + read-write + + + POUT09 + desc POUT09 + 9 + 9 + read-write + + + POUT10 + desc POUT10 + 10 + 10 + read-write + + + POUT11 + desc POUT11 + 11 + 11 + read-write + + + POUT12 + desc POUT12 + 12 + 12 + read-write + + + POUT13 + desc POUT13 + 13 + 13 + read-write + + + POUT14 + desc POUT14 + 14 + 14 + read-write + + + POUT15 + desc POUT15 + 15 + 15 + read-write + + + + + POERA + desc POERA + 0x6 + 16 + read-write + 0x0 + 0xFFFF + + + POUTE00 + desc POUTE00 + 0 + 0 + read-write + + + POUTE01 + desc POUTE01 + 1 + 1 + read-write + + + POUTE02 + desc POUTE02 + 2 + 2 + read-write + + + POUTE03 + desc POUTE03 + 3 + 3 + read-write + + + POUTE04 + desc POUTE04 + 4 + 4 + read-write + + + POUTE05 + desc POUTE05 + 5 + 5 + read-write + + + POUTE06 + desc POUTE06 + 6 + 6 + read-write + + + POUTE07 + desc POUTE07 + 7 + 7 + read-write + + + POUTE08 + desc POUTE08 + 8 + 8 + read-write + + + POUTE09 + desc POUTE09 + 9 + 9 + read-write + + + POUTE10 + desc POUTE10 + 10 + 10 + read-write + + + POUTE11 + desc POUTE11 + 11 + 11 + read-write + + + POUTE12 + desc POUTE12 + 12 + 12 + read-write + + + POUTE13 + desc POUTE13 + 13 + 13 + read-write + + + POUTE14 + desc POUTE14 + 14 + 14 + read-write + + + POUTE15 + desc POUTE15 + 15 + 15 + read-write + + + + + POSRA + desc POSRA + 0x8 + 16 + write-only + 0x0 + 0xFFFF + + + POS00 + desc POS00 + 0 + 0 + write-only + + + POS01 + desc POS01 + 1 + 1 + write-only + + + POS02 + desc POS02 + 2 + 2 + write-only + + + POS03 + desc POS03 + 3 + 3 + write-only + + + POS04 + desc POS04 + 4 + 4 + write-only + + + POS05 + desc POS05 + 5 + 5 + write-only + + + POS06 + desc POS06 + 6 + 6 + write-only + + + POS07 + desc POS07 + 7 + 7 + write-only + + + POS08 + desc POS08 + 8 + 8 + write-only + + + POS09 + desc POS09 + 9 + 9 + write-only + + + POS10 + desc POS10 + 10 + 10 + write-only + + + POS11 + desc POS11 + 11 + 11 + write-only + + + POS12 + desc POS12 + 12 + 12 + write-only + + + POS13 + desc POS13 + 13 + 13 + write-only + + + POS14 + desc POS14 + 14 + 14 + write-only + + + POS15 + desc POS15 + 15 + 15 + write-only + + + + + PORRA + desc PORRA + 0xA + 16 + write-only + 0x0 + 0xFFFF + + + POR00 + desc POR00 + 0 + 0 + write-only + + + POR01 + desc POR01 + 1 + 1 + write-only + + + POR02 + desc POR02 + 2 + 2 + write-only + + + POR03 + desc POR03 + 3 + 3 + write-only + + + POR04 + desc POR04 + 4 + 4 + write-only + + + POR05 + desc POR05 + 5 + 5 + write-only + + + POR06 + desc POR06 + 6 + 6 + write-only + + + POR07 + desc POR07 + 7 + 7 + write-only + + + POR08 + desc POR08 + 8 + 8 + write-only + + + POR09 + desc POR09 + 9 + 9 + write-only + + + POR10 + desc POR10 + 10 + 10 + write-only + + + POR11 + desc POR11 + 11 + 11 + write-only + + + POR12 + desc POR12 + 12 + 12 + write-only + + + POR13 + desc POR13 + 13 + 13 + write-only + + + POR14 + desc POR14 + 14 + 14 + write-only + + + POR15 + desc POR15 + 15 + 15 + write-only + + + + + POTRA + desc POTRA + 0xC + 16 + write-only + 0x0 + 0xFFFF + + + POT00 + desc POT00 + 0 + 0 + write-only + + + POT01 + desc POT01 + 1 + 1 + write-only + + + POT02 + desc POT02 + 2 + 2 + write-only + + + POT03 + desc POT03 + 3 + 3 + write-only + + + POT04 + desc POT04 + 4 + 4 + write-only + + + POT05 + desc POT05 + 5 + 5 + write-only + + + POT06 + desc POT06 + 6 + 6 + write-only + + + POT07 + desc POT07 + 7 + 7 + write-only + + + POT08 + desc POT08 + 8 + 8 + write-only + + + POT09 + desc POT09 + 9 + 9 + write-only + + + POT10 + desc POT10 + 10 + 10 + write-only + + + POT11 + desc POT11 + 11 + 11 + write-only + + + POT12 + desc POT12 + 12 + 12 + write-only + + + POT13 + desc POT13 + 13 + 13 + write-only + + + POT14 + desc POT14 + 14 + 14 + write-only + + + POT15 + desc POT15 + 15 + 15 + write-only + + + + + PIDRB + desc PIDRB + 0x10 + 16 + read-only + 0x0 + 0xFFFF + + + PIN00 + desc PIN00 + 0 + 0 + read-only + + + PIN01 + desc PIN01 + 1 + 1 + read-only + + + PIN02 + desc PIN02 + 2 + 2 + read-only + + + PIN03 + desc PIN03 + 3 + 3 + read-only + + + PIN04 + desc PIN04 + 4 + 4 + read-only + + + PIN05 + desc PIN05 + 5 + 5 + read-only + + + PIN06 + desc PIN06 + 6 + 6 + read-only + + + PIN07 + desc PIN07 + 7 + 7 + read-only + + + PIN08 + desc PIN08 + 8 + 8 + read-only + + + PIN09 + desc PIN09 + 9 + 9 + read-only + + + PIN10 + desc PIN10 + 10 + 10 + read-only + + + PIN11 + desc PIN11 + 11 + 11 + read-only + + + PIN12 + desc PIN12 + 12 + 12 + read-only + + + PIN13 + desc PIN13 + 13 + 13 + read-only + + + PIN14 + desc PIN14 + 14 + 14 + read-only + + + PIN15 + desc PIN15 + 15 + 15 + read-only + + + + + PODRB + desc PODRB + 0x14 + 16 + read-write + 0x0 + 0xFFFF + + + POUT00 + desc POUT00 + 0 + 0 + read-write + + + POUT01 + desc POUT01 + 1 + 1 + read-write + + + POUT02 + desc POUT02 + 2 + 2 + read-write + + + POUT03 + desc POUT03 + 3 + 3 + read-write + + + POUT04 + desc POUT04 + 4 + 4 + read-write + + + POUT05 + desc POUT05 + 5 + 5 + read-write + + + POUT06 + desc POUT06 + 6 + 6 + read-write + + + POUT07 + desc POUT07 + 7 + 7 + read-write + + + POUT08 + desc POUT08 + 8 + 8 + read-write + + + POUT09 + desc POUT09 + 9 + 9 + read-write + + + POUT10 + desc POUT10 + 10 + 10 + read-write + + + POUT11 + desc POUT11 + 11 + 11 + read-write + + + POUT12 + desc POUT12 + 12 + 12 + read-write + + + POUT13 + desc POUT13 + 13 + 13 + read-write + + + POUT14 + desc POUT14 + 14 + 14 + read-write + + + POUT15 + desc POUT15 + 15 + 15 + read-write + + + + + POERB + desc POERB + 0x16 + 16 + read-write + 0x0 + 0xFFFF + + + POUTE00 + desc POUTE00 + 0 + 0 + read-write + + + POUTE01 + desc POUTE01 + 1 + 1 + read-write + + + POUTE02 + desc POUTE02 + 2 + 2 + read-write + + + POUTE03 + desc POUTE03 + 3 + 3 + read-write + + + POUTE04 + desc POUTE04 + 4 + 4 + read-write + + + POUTE05 + desc POUTE05 + 5 + 5 + read-write + + + POUTE06 + desc POUTE06 + 6 + 6 + read-write + + + POUTE07 + desc POUTE07 + 7 + 7 + read-write + + + POUTE08 + desc POUTE08 + 8 + 8 + read-write + + + POUTE09 + desc POUTE09 + 9 + 9 + read-write + + + POUTE10 + desc POUTE10 + 10 + 10 + read-write + + + POUTE11 + desc POUTE11 + 11 + 11 + read-write + + + POUTE12 + desc POUTE12 + 12 + 12 + read-write + + + POUTE13 + desc POUTE13 + 13 + 13 + read-write + + + POUTE14 + desc POUTE14 + 14 + 14 + read-write + + + POUTE15 + desc POUTE15 + 15 + 15 + read-write + + + + + POSRB + desc POSRB + 0x18 + 16 + write-only + 0x0 + 0xFFFF + + + POS00 + desc POS00 + 0 + 0 + write-only + + + POS01 + desc POS01 + 1 + 1 + write-only + + + POS02 + desc POS02 + 2 + 2 + write-only + + + POS03 + desc POS03 + 3 + 3 + write-only + + + POS04 + desc POS04 + 4 + 4 + write-only + + + POS05 + desc POS05 + 5 + 5 + write-only + + + POS06 + desc POS06 + 6 + 6 + write-only + + + POS07 + desc POS07 + 7 + 7 + write-only + + + POS08 + desc POS08 + 8 + 8 + write-only + + + POS09 + desc POS09 + 9 + 9 + write-only + + + POS10 + desc POS10 + 10 + 10 + write-only + + + POS11 + desc POS11 + 11 + 11 + write-only + + + POS12 + desc POS12 + 12 + 12 + write-only + + + POS13 + desc POS13 + 13 + 13 + write-only + + + POS14 + desc POS14 + 14 + 14 + write-only + + + POS15 + desc POS15 + 15 + 15 + write-only + + + + + PORRB + desc PORRB + 0x1A + 16 + write-only + 0x0 + 0xFFFF + + + POR00 + desc POR00 + 0 + 0 + write-only + + + POR01 + desc POR01 + 1 + 1 + write-only + + + POR02 + desc POR02 + 2 + 2 + write-only + + + POR03 + desc POR03 + 3 + 3 + write-only + + + POR04 + desc POR04 + 4 + 4 + write-only + + + POR05 + desc POR05 + 5 + 5 + write-only + + + POR06 + desc POR06 + 6 + 6 + write-only + + + POR07 + desc POR07 + 7 + 7 + write-only + + + POR08 + desc POR08 + 8 + 8 + write-only + + + POR09 + desc POR09 + 9 + 9 + write-only + + + POR10 + desc POR10 + 10 + 10 + write-only + + + POR11 + desc POR11 + 11 + 11 + write-only + + + POR12 + desc POR12 + 12 + 12 + write-only + + + POR13 + desc POR13 + 13 + 13 + write-only + + + POR14 + desc POR14 + 14 + 14 + write-only + + + POR15 + desc POR15 + 15 + 15 + write-only + + + + + POTRB + desc POTRB + 0x1C + 16 + write-only + 0x0 + 0xFFFF + + + POT00 + desc POT00 + 0 + 0 + write-only + + + POT01 + desc POT01 + 1 + 1 + write-only + + + POT02 + desc POT02 + 2 + 2 + write-only + + + POT03 + desc POT03 + 3 + 3 + write-only + + + POT04 + desc POT04 + 4 + 4 + write-only + + + POT05 + desc POT05 + 5 + 5 + write-only + + + POT06 + desc POT06 + 6 + 6 + write-only + + + POT07 + desc POT07 + 7 + 7 + write-only + + + POT08 + desc POT08 + 8 + 8 + write-only + + + POT09 + desc POT09 + 9 + 9 + write-only + + + POT10 + desc POT10 + 10 + 10 + write-only + + + POT11 + desc POT11 + 11 + 11 + write-only + + + POT12 + desc POT12 + 12 + 12 + write-only + + + POT13 + desc POT13 + 13 + 13 + write-only + + + POT14 + desc POT14 + 14 + 14 + write-only + + + POT15 + desc POT15 + 15 + 15 + write-only + + + + + PIDRC + desc PIDRC + 0x20 + 16 + read-only + 0x0 + 0xFFFF + + + PIN00 + desc PIN00 + 0 + 0 + read-only + + + PIN01 + desc PIN01 + 1 + 1 + read-only + + + PIN02 + desc PIN02 + 2 + 2 + read-only + + + PIN03 + desc PIN03 + 3 + 3 + read-only + + + PIN04 + desc PIN04 + 4 + 4 + read-only + + + PIN05 + desc PIN05 + 5 + 5 + read-only + + + PIN06 + desc PIN06 + 6 + 6 + read-only + + + PIN07 + desc PIN07 + 7 + 7 + read-only + + + PIN08 + desc PIN08 + 8 + 8 + read-only + + + PIN09 + desc PIN09 + 9 + 9 + read-only + + + PIN10 + desc PIN10 + 10 + 10 + read-only + + + PIN11 + desc PIN11 + 11 + 11 + read-only + + + PIN12 + desc PIN12 + 12 + 12 + read-only + + + PIN13 + desc PIN13 + 13 + 13 + read-only + + + PIN14 + desc PIN14 + 14 + 14 + read-only + + + PIN15 + desc PIN15 + 15 + 15 + read-only + + + + + PODRC + desc PODRC + 0x24 + 16 + read-write + 0x0 + 0xFFFF + + + POUT00 + desc POUT00 + 0 + 0 + read-write + + + POUT01 + desc POUT01 + 1 + 1 + read-write + + + POUT02 + desc POUT02 + 2 + 2 + read-write + + + POUT03 + desc POUT03 + 3 + 3 + read-write + + + POUT04 + desc POUT04 + 4 + 4 + read-write + + + POUT05 + desc POUT05 + 5 + 5 + read-write + + + POUT06 + desc POUT06 + 6 + 6 + read-write + + + POUT07 + desc POUT07 + 7 + 7 + read-write + + + POUT08 + desc POUT08 + 8 + 8 + read-write + + + POUT09 + desc POUT09 + 9 + 9 + read-write + + + POUT10 + desc POUT10 + 10 + 10 + read-write + + + POUT11 + desc POUT11 + 11 + 11 + read-write + + + POUT12 + desc POUT12 + 12 + 12 + read-write + + + POUT13 + desc POUT13 + 13 + 13 + read-write + + + POUT14 + desc POUT14 + 14 + 14 + read-write + + + POUT15 + desc POUT15 + 15 + 15 + read-write + + + + + POERC + desc POERC + 0x26 + 16 + read-write + 0x0 + 0xFFFF + + + POUTE00 + desc POUTE00 + 0 + 0 + read-write + + + POUTE01 + desc POUTE01 + 1 + 1 + read-write + + + POUTE02 + desc POUTE02 + 2 + 2 + read-write + + + POUTE03 + desc POUTE03 + 3 + 3 + read-write + + + POUTE04 + desc POUTE04 + 4 + 4 + read-write + + + POUTE05 + desc POUTE05 + 5 + 5 + read-write + + + POUTE06 + desc POUTE06 + 6 + 6 + read-write + + + POUTE07 + desc POUTE07 + 7 + 7 + read-write + + + POUTE08 + desc POUTE08 + 8 + 8 + read-write + + + POUTE09 + desc POUTE09 + 9 + 9 + read-write + + + POUTE10 + desc POUTE10 + 10 + 10 + read-write + + + POUTE11 + desc POUTE11 + 11 + 11 + read-write + + + POUTE12 + desc POUTE12 + 12 + 12 + read-write + + + POUTE13 + desc POUTE13 + 13 + 13 + read-write + + + POUTE14 + desc POUTE14 + 14 + 14 + read-write + + + POUTE15 + desc POUTE15 + 15 + 15 + read-write + + + + + POSRC + desc POSRC + 0x28 + 16 + write-only + 0x0 + 0xFFFF + + + POS00 + desc POS00 + 0 + 0 + write-only + + + POS01 + desc POS01 + 1 + 1 + write-only + + + POS02 + desc POS02 + 2 + 2 + write-only + + + POS03 + desc POS03 + 3 + 3 + write-only + + + POS04 + desc POS04 + 4 + 4 + write-only + + + POS05 + desc POS05 + 5 + 5 + write-only + + + POS06 + desc POS06 + 6 + 6 + write-only + + + POS07 + desc POS07 + 7 + 7 + write-only + + + POS08 + desc POS08 + 8 + 8 + write-only + + + POS09 + desc POS09 + 9 + 9 + write-only + + + POS10 + desc POS10 + 10 + 10 + write-only + + + POS11 + desc POS11 + 11 + 11 + write-only + + + POS12 + desc POS12 + 12 + 12 + write-only + + + POS13 + desc POS13 + 13 + 13 + write-only + + + POS14 + desc POS14 + 14 + 14 + write-only + + + POS15 + desc POS15 + 15 + 15 + write-only + + + + + PORRC + desc PORRC + 0x2A + 16 + write-only + 0x0 + 0xFFFF + + + POR00 + desc POR00 + 0 + 0 + write-only + + + POR01 + desc POR01 + 1 + 1 + write-only + + + POR02 + desc POR02 + 2 + 2 + write-only + + + POR03 + desc POR03 + 3 + 3 + write-only + + + POR04 + desc POR04 + 4 + 4 + write-only + + + POR05 + desc POR05 + 5 + 5 + write-only + + + POR06 + desc POR06 + 6 + 6 + write-only + + + POR07 + desc POR07 + 7 + 7 + write-only + + + POR08 + desc POR08 + 8 + 8 + write-only + + + POR09 + desc POR09 + 9 + 9 + write-only + + + POR10 + desc POR10 + 10 + 10 + write-only + + + POR11 + desc POR11 + 11 + 11 + write-only + + + POR12 + desc POR12 + 12 + 12 + write-only + + + POR13 + desc POR13 + 13 + 13 + write-only + + + POR14 + desc POR14 + 14 + 14 + write-only + + + POR15 + desc POR15 + 15 + 15 + write-only + + + + + POTRC + desc POTRC + 0x2C + 16 + write-only + 0x0 + 0xFFFF + + + POT00 + desc POT00 + 0 + 0 + write-only + + + POT01 + desc POT01 + 1 + 1 + write-only + + + POT02 + desc POT02 + 2 + 2 + write-only + + + POT03 + desc POT03 + 3 + 3 + write-only + + + POT04 + desc POT04 + 4 + 4 + write-only + + + POT05 + desc POT05 + 5 + 5 + write-only + + + POT06 + desc POT06 + 6 + 6 + write-only + + + POT07 + desc POT07 + 7 + 7 + write-only + + + POT08 + desc POT08 + 8 + 8 + write-only + + + POT09 + desc POT09 + 9 + 9 + write-only + + + POT10 + desc POT10 + 10 + 10 + write-only + + + POT11 + desc POT11 + 11 + 11 + write-only + + + POT12 + desc POT12 + 12 + 12 + write-only + + + POT13 + desc POT13 + 13 + 13 + write-only + + + POT14 + desc POT14 + 14 + 14 + write-only + + + POT15 + desc POT15 + 15 + 15 + write-only + + + + + PIDRD + desc PIDRD + 0x30 + 16 + read-only + 0x0 + 0xFFFF + + + PIN00 + desc PIN00 + 0 + 0 + read-only + + + PIN01 + desc PIN01 + 1 + 1 + read-only + + + PIN02 + desc PIN02 + 2 + 2 + read-only + + + PIN03 + desc PIN03 + 3 + 3 + read-only + + + PIN04 + desc PIN04 + 4 + 4 + read-only + + + PIN05 + desc PIN05 + 5 + 5 + read-only + + + PIN06 + desc PIN06 + 6 + 6 + read-only + + + PIN07 + desc PIN07 + 7 + 7 + read-only + + + PIN08 + desc PIN08 + 8 + 8 + read-only + + + PIN09 + desc PIN09 + 9 + 9 + read-only + + + PIN10 + desc PIN10 + 10 + 10 + read-only + + + PIN11 + desc PIN11 + 11 + 11 + read-only + + + PIN12 + desc PIN12 + 12 + 12 + read-only + + + PIN13 + desc PIN13 + 13 + 13 + read-only + + + PIN14 + desc PIN14 + 14 + 14 + read-only + + + PIN15 + desc PIN15 + 15 + 15 + read-only + + + + + PODRD + desc PODRD + 0x34 + 16 + read-write + 0x0 + 0xFFFF + + + POUT00 + desc POUT00 + 0 + 0 + read-write + + + POUT01 + desc POUT01 + 1 + 1 + read-write + + + POUT02 + desc POUT02 + 2 + 2 + read-write + + + POUT03 + desc POUT03 + 3 + 3 + read-write + + + POUT04 + desc POUT04 + 4 + 4 + read-write + + + POUT05 + desc POUT05 + 5 + 5 + read-write + + + POUT06 + desc POUT06 + 6 + 6 + read-write + + + POUT07 + desc POUT07 + 7 + 7 + read-write + + + POUT08 + desc POUT08 + 8 + 8 + read-write + + + POUT09 + desc POUT09 + 9 + 9 + read-write + + + POUT10 + desc POUT10 + 10 + 10 + read-write + + + POUT11 + desc POUT11 + 11 + 11 + read-write + + + POUT12 + desc POUT12 + 12 + 12 + read-write + + + POUT13 + desc POUT13 + 13 + 13 + read-write + + + POUT14 + desc POUT14 + 14 + 14 + read-write + + + POUT15 + desc POUT15 + 15 + 15 + read-write + + + + + POERD + desc POERD + 0x36 + 16 + read-write + 0x0 + 0xFFFF + + + POUTE00 + desc POUTE00 + 0 + 0 + read-write + + + POUTE01 + desc POUTE01 + 1 + 1 + read-write + + + POUTE02 + desc POUTE02 + 2 + 2 + read-write + + + POUTE03 + desc POUTE03 + 3 + 3 + read-write + + + POUTE04 + desc POUTE04 + 4 + 4 + read-write + + + POUTE05 + desc POUTE05 + 5 + 5 + read-write + + + POUTE06 + desc POUTE06 + 6 + 6 + read-write + + + POUTE07 + desc POUTE07 + 7 + 7 + read-write + + + POUTE08 + desc POUTE08 + 8 + 8 + read-write + + + POUTE09 + desc POUTE09 + 9 + 9 + read-write + + + POUTE10 + desc POUTE10 + 10 + 10 + read-write + + + POUTE11 + desc POUTE11 + 11 + 11 + read-write + + + POUTE12 + desc POUTE12 + 12 + 12 + read-write + + + POUTE13 + desc POUTE13 + 13 + 13 + read-write + + + POUTE14 + desc POUTE14 + 14 + 14 + read-write + + + POUTE15 + desc POUTE15 + 15 + 15 + read-write + + + + + POSRD + desc POSRD + 0x38 + 16 + write-only + 0x0 + 0xFFFF + + + POS00 + desc POS00 + 0 + 0 + write-only + + + POS01 + desc POS01 + 1 + 1 + write-only + + + POS02 + desc POS02 + 2 + 2 + write-only + + + POS03 + desc POS03 + 3 + 3 + write-only + + + POS04 + desc POS04 + 4 + 4 + write-only + + + POS05 + desc POS05 + 5 + 5 + write-only + + + POS06 + desc POS06 + 6 + 6 + write-only + + + POS07 + desc POS07 + 7 + 7 + write-only + + + POS08 + desc POS08 + 8 + 8 + write-only + + + POS09 + desc POS09 + 9 + 9 + write-only + + + POS10 + desc POS10 + 10 + 10 + write-only + + + POS11 + desc POS11 + 11 + 11 + write-only + + + POS12 + desc POS12 + 12 + 12 + write-only + + + POS13 + desc POS13 + 13 + 13 + write-only + + + POS14 + desc POS14 + 14 + 14 + write-only + + + POS15 + desc POS15 + 15 + 15 + write-only + + + + + PORRD + desc PORRD + 0x3A + 16 + write-only + 0x0 + 0xFFFF + + + POR00 + desc POR00 + 0 + 0 + write-only + + + POR01 + desc POR01 + 1 + 1 + write-only + + + POR02 + desc POR02 + 2 + 2 + write-only + + + POR03 + desc POR03 + 3 + 3 + write-only + + + POR04 + desc POR04 + 4 + 4 + write-only + + + POR05 + desc POR05 + 5 + 5 + write-only + + + POR06 + desc POR06 + 6 + 6 + write-only + + + POR07 + desc POR07 + 7 + 7 + write-only + + + POR08 + desc POR08 + 8 + 8 + write-only + + + POR09 + desc POR09 + 9 + 9 + write-only + + + POR10 + desc POR10 + 10 + 10 + write-only + + + POR11 + desc POR11 + 11 + 11 + write-only + + + POR12 + desc POR12 + 12 + 12 + write-only + + + POR13 + desc POR13 + 13 + 13 + write-only + + + POR14 + desc POR14 + 14 + 14 + write-only + + + POR15 + desc POR15 + 15 + 15 + write-only + + + + + POTRD + desc POTRD + 0x3C + 16 + write-only + 0x0 + 0xFFFF + + + POT00 + desc POT00 + 0 + 0 + write-only + + + POT01 + desc POT01 + 1 + 1 + write-only + + + POT02 + desc POT02 + 2 + 2 + write-only + + + POT03 + desc POT03 + 3 + 3 + write-only + + + POT04 + desc POT04 + 4 + 4 + write-only + + + POT05 + desc POT05 + 5 + 5 + write-only + + + POT06 + desc POT06 + 6 + 6 + write-only + + + POT07 + desc POT07 + 7 + 7 + write-only + + + POT08 + desc POT08 + 8 + 8 + write-only + + + POT09 + desc POT09 + 9 + 9 + write-only + + + POT10 + desc POT10 + 10 + 10 + write-only + + + POT11 + desc POT11 + 11 + 11 + write-only + + + POT12 + desc POT12 + 12 + 12 + write-only + + + POT13 + desc POT13 + 13 + 13 + write-only + + + POT14 + desc POT14 + 14 + 14 + write-only + + + POT15 + desc POT15 + 15 + 15 + write-only + + + + + PIDRE + desc PIDRE + 0x40 + 16 + read-only + 0x0 + 0xFFFF + + + PIN00 + desc PIN00 + 0 + 0 + read-only + + + PIN01 + desc PIN01 + 1 + 1 + read-only + + + PIN02 + desc PIN02 + 2 + 2 + read-only + + + PIN03 + desc PIN03 + 3 + 3 + read-only + + + PIN04 + desc PIN04 + 4 + 4 + read-only + + + PIN05 + desc PIN05 + 5 + 5 + read-only + + + PIN06 + desc PIN06 + 6 + 6 + read-only + + + PIN07 + desc PIN07 + 7 + 7 + read-only + + + PIN08 + desc PIN08 + 8 + 8 + read-only + + + PIN09 + desc PIN09 + 9 + 9 + read-only + + + PIN10 + desc PIN10 + 10 + 10 + read-only + + + PIN11 + desc PIN11 + 11 + 11 + read-only + + + PIN12 + desc PIN12 + 12 + 12 + read-only + + + PIN13 + desc PIN13 + 13 + 13 + read-only + + + PIN14 + desc PIN14 + 14 + 14 + read-only + + + PIN15 + desc PIN15 + 15 + 15 + read-only + + + + + PODRE + desc PODRE + 0x44 + 16 + read-write + 0x0 + 0xFFFF + + + POUT00 + desc POUT00 + 0 + 0 + read-write + + + POUT01 + desc POUT01 + 1 + 1 + read-write + + + POUT02 + desc POUT02 + 2 + 2 + read-write + + + POUT03 + desc POUT03 + 3 + 3 + read-write + + + POUT04 + desc POUT04 + 4 + 4 + read-write + + + POUT05 + desc POUT05 + 5 + 5 + read-write + + + POUT06 + desc POUT06 + 6 + 6 + read-write + + + POUT07 + desc POUT07 + 7 + 7 + read-write + + + POUT08 + desc POUT08 + 8 + 8 + read-write + + + POUT09 + desc POUT09 + 9 + 9 + read-write + + + POUT10 + desc POUT10 + 10 + 10 + read-write + + + POUT11 + desc POUT11 + 11 + 11 + read-write + + + POUT12 + desc POUT12 + 12 + 12 + read-write + + + POUT13 + desc POUT13 + 13 + 13 + read-write + + + POUT14 + desc POUT14 + 14 + 14 + read-write + + + POUT15 + desc POUT15 + 15 + 15 + read-write + + + + + POERE + desc POERE + 0x46 + 16 + read-write + 0x0 + 0xFFFF + + + POUTE00 + desc POUTE00 + 0 + 0 + read-write + + + POUTE01 + desc POUTE01 + 1 + 1 + read-write + + + POUTE02 + desc POUTE02 + 2 + 2 + read-write + + + POUTE03 + desc POUTE03 + 3 + 3 + read-write + + + POUTE04 + desc POUTE04 + 4 + 4 + read-write + + + POUTE05 + desc POUTE05 + 5 + 5 + read-write + + + POUTE06 + desc POUTE06 + 6 + 6 + read-write + + + POUTE07 + desc POUTE07 + 7 + 7 + read-write + + + POUTE08 + desc POUTE08 + 8 + 8 + read-write + + + POUTE09 + desc POUTE09 + 9 + 9 + read-write + + + POUTE10 + desc POUTE10 + 10 + 10 + read-write + + + POUTE11 + desc POUTE11 + 11 + 11 + read-write + + + POUTE12 + desc POUTE12 + 12 + 12 + read-write + + + POUTE13 + desc POUTE13 + 13 + 13 + read-write + + + POUTE14 + desc POUTE14 + 14 + 14 + read-write + + + POUTE15 + desc POUTE15 + 15 + 15 + read-write + + + + + POSRE + desc POSRE + 0x48 + 16 + write-only + 0x0 + 0xFFFF + + + POS00 + desc POS00 + 0 + 0 + write-only + + + POS01 + desc POS01 + 1 + 1 + write-only + + + POS02 + desc POS02 + 2 + 2 + write-only + + + POS03 + desc POS03 + 3 + 3 + write-only + + + POS04 + desc POS04 + 4 + 4 + write-only + + + POS05 + desc POS05 + 5 + 5 + write-only + + + POS06 + desc POS06 + 6 + 6 + write-only + + + POS07 + desc POS07 + 7 + 7 + write-only + + + POS08 + desc POS08 + 8 + 8 + write-only + + + POS09 + desc POS09 + 9 + 9 + write-only + + + POS10 + desc POS10 + 10 + 10 + write-only + + + POS11 + desc POS11 + 11 + 11 + write-only + + + POS12 + desc POS12 + 12 + 12 + write-only + + + POS13 + desc POS13 + 13 + 13 + write-only + + + POS14 + desc POS14 + 14 + 14 + write-only + + + POS15 + desc POS15 + 15 + 15 + write-only + + + + + PORRE + desc PORRE + 0x4A + 16 + write-only + 0x0 + 0xFFFF + + + POR00 + desc POR00 + 0 + 0 + write-only + + + POR01 + desc POR01 + 1 + 1 + write-only + + + POR02 + desc POR02 + 2 + 2 + write-only + + + POR03 + desc POR03 + 3 + 3 + write-only + + + POR04 + desc POR04 + 4 + 4 + write-only + + + POR05 + desc POR05 + 5 + 5 + write-only + + + POR06 + desc POR06 + 6 + 6 + write-only + + + POR07 + desc POR07 + 7 + 7 + write-only + + + POR08 + desc POR08 + 8 + 8 + write-only + + + POR09 + desc POR09 + 9 + 9 + write-only + + + POR10 + desc POR10 + 10 + 10 + write-only + + + POR11 + desc POR11 + 11 + 11 + write-only + + + POR12 + desc POR12 + 12 + 12 + write-only + + + POR13 + desc POR13 + 13 + 13 + write-only + + + POR14 + desc POR14 + 14 + 14 + write-only + + + POR15 + desc POR15 + 15 + 15 + write-only + + + + + POTRE + desc POTRE + 0x4C + 16 + write-only + 0x0 + 0xFFFF + + + POT00 + desc POT00 + 0 + 0 + write-only + + + POT01 + desc POT01 + 1 + 1 + write-only + + + POT02 + desc POT02 + 2 + 2 + write-only + + + POT03 + desc POT03 + 3 + 3 + write-only + + + POT04 + desc POT04 + 4 + 4 + write-only + + + POT05 + desc POT05 + 5 + 5 + write-only + + + POT06 + desc POT06 + 6 + 6 + write-only + + + POT07 + desc POT07 + 7 + 7 + write-only + + + POT08 + desc POT08 + 8 + 8 + write-only + + + POT09 + desc POT09 + 9 + 9 + write-only + + + POT10 + desc POT10 + 10 + 10 + write-only + + + POT11 + desc POT11 + 11 + 11 + write-only + + + POT12 + desc POT12 + 12 + 12 + write-only + + + POT13 + desc POT13 + 13 + 13 + write-only + + + POT14 + desc POT14 + 14 + 14 + write-only + + + POT15 + desc POT15 + 15 + 15 + write-only + + + + + PIDRF + desc PIDRF + 0x50 + 16 + read-only + 0x0 + 0xFFFF + + + PIN00 + desc PIN00 + 0 + 0 + read-only + + + PIN01 + desc PIN01 + 1 + 1 + read-only + + + PIN02 + desc PIN02 + 2 + 2 + read-only + + + PIN03 + desc PIN03 + 3 + 3 + read-only + + + PIN04 + desc PIN04 + 4 + 4 + read-only + + + PIN05 + desc PIN05 + 5 + 5 + read-only + + + PIN06 + desc PIN06 + 6 + 6 + read-only + + + PIN07 + desc PIN07 + 7 + 7 + read-only + + + PIN08 + desc PIN08 + 8 + 8 + read-only + + + PIN09 + desc PIN09 + 9 + 9 + read-only + + + PIN10 + desc PIN10 + 10 + 10 + read-only + + + PIN11 + desc PIN11 + 11 + 11 + read-only + + + PIN12 + desc PIN12 + 12 + 12 + read-only + + + PIN13 + desc PIN13 + 13 + 13 + read-only + + + PIN14 + desc PIN14 + 14 + 14 + read-only + + + PIN15 + desc PIN15 + 15 + 15 + read-only + + + + + PODRF + desc PODRF + 0x54 + 16 + read-write + 0x0 + 0xFFFF + + + POUT00 + desc POUT00 + 0 + 0 + read-write + + + POUT01 + desc POUT01 + 1 + 1 + read-write + + + POUT02 + desc POUT02 + 2 + 2 + read-write + + + POUT03 + desc POUT03 + 3 + 3 + read-write + + + POUT04 + desc POUT04 + 4 + 4 + read-write + + + POUT05 + desc POUT05 + 5 + 5 + read-write + + + POUT06 + desc POUT06 + 6 + 6 + read-write + + + POUT07 + desc POUT07 + 7 + 7 + read-write + + + POUT08 + desc POUT08 + 8 + 8 + read-write + + + POUT09 + desc POUT09 + 9 + 9 + read-write + + + POUT10 + desc POUT10 + 10 + 10 + read-write + + + POUT11 + desc POUT11 + 11 + 11 + read-write + + + POUT12 + desc POUT12 + 12 + 12 + read-write + + + POUT13 + desc POUT13 + 13 + 13 + read-write + + + POUT14 + desc POUT14 + 14 + 14 + read-write + + + POUT15 + desc POUT15 + 15 + 15 + read-write + + + + + POERF + desc POERF + 0x56 + 16 + read-write + 0x0 + 0xFFFF + + + POUTE00 + desc POUTE00 + 0 + 0 + read-write + + + POUTE01 + desc POUTE01 + 1 + 1 + read-write + + + POUTE02 + desc POUTE02 + 2 + 2 + read-write + + + POUTE03 + desc POUTE03 + 3 + 3 + read-write + + + POUTE04 + desc POUTE04 + 4 + 4 + read-write + + + POUTE05 + desc POUTE05 + 5 + 5 + read-write + + + POUTE06 + desc POUTE06 + 6 + 6 + read-write + + + POUTE07 + desc POUTE07 + 7 + 7 + read-write + + + POUTE08 + desc POUTE08 + 8 + 8 + read-write + + + POUTE09 + desc POUTE09 + 9 + 9 + read-write + + + POUTE10 + desc POUTE10 + 10 + 10 + read-write + + + POUTE11 + desc POUTE11 + 11 + 11 + read-write + + + POUTE12 + desc POUTE12 + 12 + 12 + read-write + + + POUTE13 + desc POUTE13 + 13 + 13 + read-write + + + POUTE14 + desc POUTE14 + 14 + 14 + read-write + + + POUTE15 + desc POUTE15 + 15 + 15 + read-write + + + + + POSRF + desc POSRF + 0x58 + 16 + write-only + 0x0 + 0xFFFF + + + POS00 + desc POS00 + 0 + 0 + write-only + + + POS01 + desc POS01 + 1 + 1 + write-only + + + POS02 + desc POS02 + 2 + 2 + write-only + + + POS03 + desc POS03 + 3 + 3 + write-only + + + POS04 + desc POS04 + 4 + 4 + write-only + + + POS05 + desc POS05 + 5 + 5 + write-only + + + POS06 + desc POS06 + 6 + 6 + write-only + + + POS07 + desc POS07 + 7 + 7 + write-only + + + POS08 + desc POS08 + 8 + 8 + write-only + + + POS09 + desc POS09 + 9 + 9 + write-only + + + POS10 + desc POS10 + 10 + 10 + write-only + + + POS11 + desc POS11 + 11 + 11 + write-only + + + POS12 + desc POS12 + 12 + 12 + write-only + + + POS13 + desc POS13 + 13 + 13 + write-only + + + POS14 + desc POS14 + 14 + 14 + write-only + + + POS15 + desc POS15 + 15 + 15 + write-only + + + + + PORRF + desc PORRF + 0x5A + 16 + write-only + 0x0 + 0xFFFF + + + POR00 + desc POR00 + 0 + 0 + write-only + + + POR01 + desc POR01 + 1 + 1 + write-only + + + POR02 + desc POR02 + 2 + 2 + write-only + + + POR03 + desc POR03 + 3 + 3 + write-only + + + POR04 + desc POR04 + 4 + 4 + write-only + + + POR05 + desc POR05 + 5 + 5 + write-only + + + POR06 + desc POR06 + 6 + 6 + write-only + + + POR07 + desc POR07 + 7 + 7 + write-only + + + POR08 + desc POR08 + 8 + 8 + write-only + + + POR09 + desc POR09 + 9 + 9 + write-only + + + POR10 + desc POR10 + 10 + 10 + write-only + + + POR11 + desc POR11 + 11 + 11 + write-only + + + POR12 + desc POR12 + 12 + 12 + write-only + + + POR13 + desc POR13 + 13 + 13 + write-only + + + POR14 + desc POR14 + 14 + 14 + write-only + + + POR15 + desc POR15 + 15 + 15 + write-only + + + + + POTRF + desc POTRF + 0x5C + 16 + write-only + 0x0 + 0xFFFF + + + POT00 + desc POT00 + 0 + 0 + write-only + + + POT01 + desc POT01 + 1 + 1 + write-only + + + POT02 + desc POT02 + 2 + 2 + write-only + + + POT03 + desc POT03 + 3 + 3 + write-only + + + POT04 + desc POT04 + 4 + 4 + write-only + + + POT05 + desc POT05 + 5 + 5 + write-only + + + POT06 + desc POT06 + 6 + 6 + write-only + + + POT07 + desc POT07 + 7 + 7 + write-only + + + POT08 + desc POT08 + 8 + 8 + write-only + + + POT09 + desc POT09 + 9 + 9 + write-only + + + POT10 + desc POT10 + 10 + 10 + write-only + + + POT11 + desc POT11 + 11 + 11 + write-only + + + POT12 + desc POT12 + 12 + 12 + write-only + + + POT13 + desc POT13 + 13 + 13 + write-only + + + POT14 + desc POT14 + 14 + 14 + write-only + + + POT15 + desc POT15 + 15 + 15 + write-only + + + + + PIDRG + desc PIDRG + 0x60 + 16 + read-only + 0x0 + 0xFFFF + + + PIN00 + desc PIN00 + 0 + 0 + read-only + + + PIN01 + desc PIN01 + 1 + 1 + read-only + + + PIN02 + desc PIN02 + 2 + 2 + read-only + + + PIN03 + desc PIN03 + 3 + 3 + read-only + + + PIN04 + desc PIN04 + 4 + 4 + read-only + + + PIN05 + desc PIN05 + 5 + 5 + read-only + + + PIN06 + desc PIN06 + 6 + 6 + read-only + + + PIN07 + desc PIN07 + 7 + 7 + read-only + + + PIN08 + desc PIN08 + 8 + 8 + read-only + + + PIN09 + desc PIN09 + 9 + 9 + read-only + + + PIN10 + desc PIN10 + 10 + 10 + read-only + + + PIN11 + desc PIN11 + 11 + 11 + read-only + + + PIN12 + desc PIN12 + 12 + 12 + read-only + + + PIN13 + desc PIN13 + 13 + 13 + read-only + + + PIN14 + desc PIN14 + 14 + 14 + read-only + + + PIN15 + desc PIN15 + 15 + 15 + read-only + + + + + PODRG + desc PODRG + 0x64 + 16 + read-write + 0x0 + 0xFFFF + + + POUT00 + desc POUT00 + 0 + 0 + read-write + + + POUT01 + desc POUT01 + 1 + 1 + read-write + + + POUT02 + desc POUT02 + 2 + 2 + read-write + + + POUT03 + desc POUT03 + 3 + 3 + read-write + + + POUT04 + desc POUT04 + 4 + 4 + read-write + + + POUT05 + desc POUT05 + 5 + 5 + read-write + + + POUT06 + desc POUT06 + 6 + 6 + read-write + + + POUT07 + desc POUT07 + 7 + 7 + read-write + + + POUT08 + desc POUT08 + 8 + 8 + read-write + + + POUT09 + desc POUT09 + 9 + 9 + read-write + + + POUT10 + desc POUT10 + 10 + 10 + read-write + + + POUT11 + desc POUT11 + 11 + 11 + read-write + + + POUT12 + desc POUT12 + 12 + 12 + read-write + + + POUT13 + desc POUT13 + 13 + 13 + read-write + + + POUT14 + desc POUT14 + 14 + 14 + read-write + + + POUT15 + desc POUT15 + 15 + 15 + read-write + + + + + POERG + desc POERG + 0x66 + 16 + read-write + 0x0 + 0xFFFF + + + POUTE00 + desc POUTE00 + 0 + 0 + read-write + + + POUTE01 + desc POUTE01 + 1 + 1 + read-write + + + POUTE02 + desc POUTE02 + 2 + 2 + read-write + + + POUTE03 + desc POUTE03 + 3 + 3 + read-write + + + POUTE04 + desc POUTE04 + 4 + 4 + read-write + + + POUTE05 + desc POUTE05 + 5 + 5 + read-write + + + POUTE06 + desc POUTE06 + 6 + 6 + read-write + + + POUTE07 + desc POUTE07 + 7 + 7 + read-write + + + POUTE08 + desc POUTE08 + 8 + 8 + read-write + + + POUTE09 + desc POUTE09 + 9 + 9 + read-write + + + POUTE10 + desc POUTE10 + 10 + 10 + read-write + + + POUTE11 + desc POUTE11 + 11 + 11 + read-write + + + POUTE12 + desc POUTE12 + 12 + 12 + read-write + + + POUTE13 + desc POUTE13 + 13 + 13 + read-write + + + POUTE14 + desc POUTE14 + 14 + 14 + read-write + + + POUTE15 + desc POUTE15 + 15 + 15 + read-write + + + + + POSRG + desc POSRG + 0x68 + 16 + write-only + 0x0 + 0xFFFF + + + POS00 + desc POS00 + 0 + 0 + write-only + + + POS01 + desc POS01 + 1 + 1 + write-only + + + POS02 + desc POS02 + 2 + 2 + write-only + + + POS03 + desc POS03 + 3 + 3 + write-only + + + POS04 + desc POS04 + 4 + 4 + write-only + + + POS05 + desc POS05 + 5 + 5 + write-only + + + POS06 + desc POS06 + 6 + 6 + write-only + + + POS07 + desc POS07 + 7 + 7 + write-only + + + POS08 + desc POS08 + 8 + 8 + write-only + + + POS09 + desc POS09 + 9 + 9 + write-only + + + POS10 + desc POS10 + 10 + 10 + write-only + + + POS11 + desc POS11 + 11 + 11 + write-only + + + POS12 + desc POS12 + 12 + 12 + write-only + + + POS13 + desc POS13 + 13 + 13 + write-only + + + POS14 + desc POS14 + 14 + 14 + write-only + + + POS15 + desc POS15 + 15 + 15 + write-only + + + + + PORRG + desc PORRG + 0x6A + 16 + write-only + 0x0 + 0xFFFF + + + POR00 + desc POR00 + 0 + 0 + write-only + + + POR01 + desc POR01 + 1 + 1 + write-only + + + POR02 + desc POR02 + 2 + 2 + write-only + + + POR03 + desc POR03 + 3 + 3 + write-only + + + POR04 + desc POR04 + 4 + 4 + write-only + + + POR05 + desc POR05 + 5 + 5 + write-only + + + POR06 + desc POR06 + 6 + 6 + write-only + + + POR07 + desc POR07 + 7 + 7 + write-only + + + POR08 + desc POR08 + 8 + 8 + write-only + + + POR09 + desc POR09 + 9 + 9 + write-only + + + POR10 + desc POR10 + 10 + 10 + write-only + + + POR11 + desc POR11 + 11 + 11 + write-only + + + POR12 + desc POR12 + 12 + 12 + write-only + + + POR13 + desc POR13 + 13 + 13 + write-only + + + POR14 + desc POR14 + 14 + 14 + write-only + + + POR15 + desc POR15 + 15 + 15 + write-only + + + + + POTRG + desc POTRG + 0x6C + 16 + write-only + 0x0 + 0xFFFF + + + POT00 + desc POT00 + 0 + 0 + write-only + + + POT01 + desc POT01 + 1 + 1 + write-only + + + POT02 + desc POT02 + 2 + 2 + write-only + + + POT03 + desc POT03 + 3 + 3 + write-only + + + POT04 + desc POT04 + 4 + 4 + write-only + + + POT05 + desc POT05 + 5 + 5 + write-only + + + POT06 + desc POT06 + 6 + 6 + write-only + + + POT07 + desc POT07 + 7 + 7 + write-only + + + POT08 + desc POT08 + 8 + 8 + write-only + + + POT09 + desc POT09 + 9 + 9 + write-only + + + POT10 + desc POT10 + 10 + 10 + write-only + + + POT11 + desc POT11 + 11 + 11 + write-only + + + POT12 + desc POT12 + 12 + 12 + write-only + + + POT13 + desc POT13 + 13 + 13 + write-only + + + POT14 + desc POT14 + 14 + 14 + write-only + + + POT15 + desc POT15 + 15 + 15 + write-only + + + + + PIDRH + desc PIDRH + 0x70 + 16 + read-only + 0x0 + 0xFFFF + + + PIN00 + desc PIN00 + 0 + 0 + read-only + + + PIN01 + desc PIN01 + 1 + 1 + read-only + + + PIN02 + desc PIN02 + 2 + 2 + read-only + + + PIN03 + desc PIN03 + 3 + 3 + read-only + + + PIN04 + desc PIN04 + 4 + 4 + read-only + + + PIN05 + desc PIN05 + 5 + 5 + read-only + + + PIN06 + desc PIN06 + 6 + 6 + read-only + + + PIN07 + desc PIN07 + 7 + 7 + read-only + + + PIN08 + desc PIN08 + 8 + 8 + read-only + + + PIN09 + desc PIN09 + 9 + 9 + read-only + + + PIN10 + desc PIN10 + 10 + 10 + read-only + + + PIN11 + desc PIN11 + 11 + 11 + read-only + + + PIN12 + desc PIN12 + 12 + 12 + read-only + + + PIN13 + desc PIN13 + 13 + 13 + read-only + + + PIN14 + desc PIN14 + 14 + 14 + read-only + + + PIN15 + desc PIN15 + 15 + 15 + read-only + + + + + PODRH + desc PODRH + 0x74 + 16 + read-write + 0x0 + 0xFFFF + + + POUT00 + desc POUT00 + 0 + 0 + read-write + + + POUT01 + desc POUT01 + 1 + 1 + read-write + + + POUT02 + desc POUT02 + 2 + 2 + read-write + + + POUT03 + desc POUT03 + 3 + 3 + read-write + + + POUT04 + desc POUT04 + 4 + 4 + read-write + + + POUT05 + desc POUT05 + 5 + 5 + read-write + + + POUT06 + desc POUT06 + 6 + 6 + read-write + + + POUT07 + desc POUT07 + 7 + 7 + read-write + + + POUT08 + desc POUT08 + 8 + 8 + read-write + + + POUT09 + desc POUT09 + 9 + 9 + read-write + + + POUT10 + desc POUT10 + 10 + 10 + read-write + + + POUT11 + desc POUT11 + 11 + 11 + read-write + + + POUT12 + desc POUT12 + 12 + 12 + read-write + + + POUT13 + desc POUT13 + 13 + 13 + read-write + + + POUT14 + desc POUT14 + 14 + 14 + read-write + + + POUT15 + desc POUT15 + 15 + 15 + read-write + + + + + POERH + desc POERH + 0x76 + 16 + read-write + 0x0 + 0xFFFF + + + POUTE00 + desc POUTE00 + 0 + 0 + read-write + + + POUTE01 + desc POUTE01 + 1 + 1 + read-write + + + POUTE02 + desc POUTE02 + 2 + 2 + read-write + + + POUTE03 + desc POUTE03 + 3 + 3 + read-write + + + POUTE04 + desc POUTE04 + 4 + 4 + read-write + + + POUTE05 + desc POUTE05 + 5 + 5 + read-write + + + POUTE06 + desc POUTE06 + 6 + 6 + read-write + + + POUTE07 + desc POUTE07 + 7 + 7 + read-write + + + POUTE08 + desc POUTE08 + 8 + 8 + read-write + + + POUTE09 + desc POUTE09 + 9 + 9 + read-write + + + POUTE10 + desc POUTE10 + 10 + 10 + read-write + + + POUTE11 + desc POUTE11 + 11 + 11 + read-write + + + POUTE12 + desc POUTE12 + 12 + 12 + read-write + + + POUTE13 + desc POUTE13 + 13 + 13 + read-write + + + POUTE14 + desc POUTE14 + 14 + 14 + read-write + + + POUTE15 + desc POUTE15 + 15 + 15 + read-write + + + + + POSRH + desc POSRH + 0x78 + 16 + write-only + 0x0 + 0xFFFF + + + POS00 + desc POS00 + 0 + 0 + write-only + + + POS01 + desc POS01 + 1 + 1 + write-only + + + POS02 + desc POS02 + 2 + 2 + write-only + + + POS03 + desc POS03 + 3 + 3 + write-only + + + POS04 + desc POS04 + 4 + 4 + write-only + + + POS05 + desc POS05 + 5 + 5 + write-only + + + POS06 + desc POS06 + 6 + 6 + write-only + + + POS07 + desc POS07 + 7 + 7 + write-only + + + POS08 + desc POS08 + 8 + 8 + write-only + + + POS09 + desc POS09 + 9 + 9 + write-only + + + POS10 + desc POS10 + 10 + 10 + write-only + + + POS11 + desc POS11 + 11 + 11 + write-only + + + POS12 + desc POS12 + 12 + 12 + write-only + + + POS13 + desc POS13 + 13 + 13 + write-only + + + POS14 + desc POS14 + 14 + 14 + write-only + + + POS15 + desc POS15 + 15 + 15 + write-only + + + + + PORRH + desc PORRH + 0x7A + 16 + write-only + 0x0 + 0xFFFF + + + POR00 + desc POR00 + 0 + 0 + write-only + + + POR01 + desc POR01 + 1 + 1 + write-only + + + POR02 + desc POR02 + 2 + 2 + write-only + + + POR03 + desc POR03 + 3 + 3 + write-only + + + POR04 + desc POR04 + 4 + 4 + write-only + + + POR05 + desc POR05 + 5 + 5 + write-only + + + POR06 + desc POR06 + 6 + 6 + write-only + + + POR07 + desc POR07 + 7 + 7 + write-only + + + POR08 + desc POR08 + 8 + 8 + write-only + + + POR09 + desc POR09 + 9 + 9 + write-only + + + POR10 + desc POR10 + 10 + 10 + write-only + + + POR11 + desc POR11 + 11 + 11 + write-only + + + POR12 + desc POR12 + 12 + 12 + write-only + + + POR13 + desc POR13 + 13 + 13 + write-only + + + POR14 + desc POR14 + 14 + 14 + write-only + + + POR15 + desc POR15 + 15 + 15 + write-only + + + + + POTRH + desc POTRH + 0x7C + 16 + write-only + 0x0 + 0xFFFF + + + POT00 + desc POT00 + 0 + 0 + write-only + + + POT01 + desc POT01 + 1 + 1 + write-only + + + POT02 + desc POT02 + 2 + 2 + write-only + + + POT03 + desc POT03 + 3 + 3 + write-only + + + POT04 + desc POT04 + 4 + 4 + write-only + + + POT05 + desc POT05 + 5 + 5 + write-only + + + POT06 + desc POT06 + 6 + 6 + write-only + + + POT07 + desc POT07 + 7 + 7 + write-only + + + POT08 + desc POT08 + 8 + 8 + write-only + + + POT09 + desc POT09 + 9 + 9 + write-only + + + POT10 + desc POT10 + 10 + 10 + write-only + + + POT11 + desc POT11 + 11 + 11 + write-only + + + POT12 + desc POT12 + 12 + 12 + write-only + + + POT13 + desc POT13 + 13 + 13 + write-only + + + POT14 + desc POT14 + 14 + 14 + write-only + + + POT15 + desc POT15 + 15 + 15 + write-only + + + + + PIDRI + desc PIDRI + 0x80 + 16 + read-only + 0x0 + 0x3FFF + + + PIN00 + desc PIN00 + 0 + 0 + read-only + + + PIN01 + desc PIN01 + 1 + 1 + read-only + + + PIN02 + desc PIN02 + 2 + 2 + read-only + + + PIN03 + desc PIN03 + 3 + 3 + read-only + + + PIN04 + desc PIN04 + 4 + 4 + read-only + + + PIN05 + desc PIN05 + 5 + 5 + read-only + + + PIN06 + desc PIN06 + 6 + 6 + read-only + + + PIN07 + desc PIN07 + 7 + 7 + read-only + + + PIN08 + desc PIN08 + 8 + 8 + read-only + + + PIN09 + desc PIN09 + 9 + 9 + read-only + + + PIN10 + desc PIN10 + 10 + 10 + read-only + + + PIN11 + desc PIN11 + 11 + 11 + read-only + + + PIN12 + desc PIN12 + 12 + 12 + read-only + + + PIN13 + desc PIN13 + 13 + 13 + read-only + + + + + PODRI + desc PODRI + 0x84 + 16 + read-write + 0x0 + 0x3FFF + + + POUT00 + desc POUT00 + 0 + 0 + read-write + + + POUT01 + desc POUT01 + 1 + 1 + read-write + + + POUT02 + desc POUT02 + 2 + 2 + read-write + + + POUT03 + desc POUT03 + 3 + 3 + read-write + + + POUT04 + desc POUT04 + 4 + 4 + read-write + + + POUT05 + desc POUT05 + 5 + 5 + read-write + + + POUT06 + desc POUT06 + 6 + 6 + read-write + + + POUT07 + desc POUT07 + 7 + 7 + read-write + + + POUT08 + desc POUT08 + 8 + 8 + read-write + + + POUT09 + desc POUT09 + 9 + 9 + read-write + + + POUT10 + desc POUT10 + 10 + 10 + read-write + + + POUT11 + desc POUT11 + 11 + 11 + read-write + + + POUT12 + desc POUT12 + 12 + 12 + read-write + + + POUT13 + desc POUT13 + 13 + 13 + read-write + + + + + POERI + desc POERI + 0x86 + 16 + read-write + 0x0 + 0x3FFF + + + POUTE00 + desc POUTE00 + 0 + 0 + read-write + + + POUTE01 + desc POUTE01 + 1 + 1 + read-write + + + POUTE02 + desc POUTE02 + 2 + 2 + read-write + + + POUTE03 + desc POUTE03 + 3 + 3 + read-write + + + POUTE04 + desc POUTE04 + 4 + 4 + read-write + + + POUTE05 + desc POUTE05 + 5 + 5 + read-write + + + POUTE06 + desc POUTE06 + 6 + 6 + read-write + + + POUTE07 + desc POUTE07 + 7 + 7 + read-write + + + POUTE08 + desc POUTE08 + 8 + 8 + read-write + + + POUTE09 + desc POUTE09 + 9 + 9 + read-write + + + POUTE10 + desc POUTE10 + 10 + 10 + read-write + + + POUTE11 + desc POUTE11 + 11 + 11 + read-write + + + POUTE12 + desc POUTE12 + 12 + 12 + read-write + + + POUTE13 + desc POUTE13 + 13 + 13 + read-write + + + + + POSRI + desc POSRI + 0x88 + 16 + write-only + 0x0 + 0x3FFF + + + POS00 + desc POS00 + 0 + 0 + write-only + + + POS01 + desc POS01 + 1 + 1 + write-only + + + POS02 + desc POS02 + 2 + 2 + write-only + + + POS03 + desc POS03 + 3 + 3 + write-only + + + POS04 + desc POS04 + 4 + 4 + write-only + + + POS05 + desc POS05 + 5 + 5 + write-only + + + POS06 + desc POS06 + 6 + 6 + write-only + + + POS07 + desc POS07 + 7 + 7 + write-only + + + POS08 + desc POS08 + 8 + 8 + write-only + + + POS09 + desc POS09 + 9 + 9 + write-only + + + POS10 + desc POS10 + 10 + 10 + write-only + + + POS11 + desc POS11 + 11 + 11 + write-only + + + POS12 + desc POS12 + 12 + 12 + write-only + + + POS13 + desc POS13 + 13 + 13 + write-only + + + + + PORRI + desc PORRI + 0x8A + 16 + write-only + 0x0 + 0x3FFF + + + POR00 + desc POR00 + 0 + 0 + write-only + + + POR01 + desc POR01 + 1 + 1 + write-only + + + POR02 + desc POR02 + 2 + 2 + write-only + + + POR03 + desc POR03 + 3 + 3 + write-only + + + POR04 + desc POR04 + 4 + 4 + write-only + + + POR05 + desc POR05 + 5 + 5 + write-only + + + POR06 + desc POR06 + 6 + 6 + write-only + + + POR07 + desc POR07 + 7 + 7 + write-only + + + POR08 + desc POR08 + 8 + 8 + write-only + + + POR09 + desc POR09 + 9 + 9 + write-only + + + POR10 + desc POR10 + 10 + 10 + write-only + + + POR11 + desc POR11 + 11 + 11 + write-only + + + POR12 + desc POR12 + 12 + 12 + write-only + + + POR13 + desc POR13 + 13 + 13 + write-only + + + + + POTRI + desc POTRI + 0x8C + 16 + write-only + 0x0 + 0x3FFF + + + POT00 + desc POT00 + 0 + 0 + write-only + + + POT01 + desc POT01 + 1 + 1 + write-only + + + POT02 + desc POT02 + 2 + 2 + write-only + + + POT03 + desc POT03 + 3 + 3 + write-only + + + POT04 + desc POT04 + 4 + 4 + write-only + + + POT05 + desc POT05 + 5 + 5 + write-only + + + POT06 + desc POT06 + 6 + 6 + write-only + + + POT07 + desc POT07 + 7 + 7 + write-only + + + POT08 + desc POT08 + 8 + 8 + write-only + + + POT09 + desc POT09 + 9 + 9 + write-only + + + POT10 + desc POT10 + 10 + 10 + write-only + + + POT11 + desc POT11 + 11 + 11 + write-only + + + POT12 + desc POT12 + 12 + 12 + write-only + + + POT13 + desc POT13 + 13 + 13 + write-only + + + + + PSPCR + desc PSPCR + 0x3F4 + 16 + read-write + 0x1F + 0x1F + + + SPFE + desc SPFE + 4 + 0 + read-write + + + + + PCCR + desc PCCR + 0x3F8 + 16 + read-write + 0x1000 + 0x703F + + + BFSEL + desc BFSEL + 5 + 0 + read-write + + + RDWT + desc RDWT + 14 + 12 + read-write + + + + + PINAER + desc PINAER + 0x3FA + 16 + read-write + 0x0 + 0x1FF + + + PINAE + desc PINAE + 8 + 0 + read-write + + + + + PWPR + desc PWPR + 0x3FC + 16 + read-write + 0x0 + 0xFF01 + + + WE + desc WE + 0 + 0 + read-write + + + WP + desc WP + 15 + 8 + write-only + + + + + PCRA0 + desc PCRA0 + 0x400 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRA0 + desc PFSRA0 + 0x402 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRA1 + desc PCRA1 + 0x404 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRA1 + desc PFSRA1 + 0x406 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRA2 + desc PCRA2 + 0x408 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRA2 + desc PFSRA2 + 0x40A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRA3 + desc PCRA3 + 0x40C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRA3 + desc PFSRA3 + 0x40E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRA4 + desc PCRA4 + 0x410 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRA4 + desc PFSRA4 + 0x412 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRA5 + desc PCRA5 + 0x414 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRA5 + desc PFSRA5 + 0x416 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRA6 + desc PCRA6 + 0x418 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRA6 + desc PFSRA6 + 0x41A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRA7 + desc PCRA7 + 0x41C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRA7 + desc PFSRA7 + 0x41E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRA8 + desc PCRA8 + 0x420 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRA8 + desc PFSRA8 + 0x422 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRA9 + desc PCRA9 + 0x424 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRA9 + desc PFSRA9 + 0x426 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRA10 + desc PCRA10 + 0x428 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRA10 + desc PFSRA10 + 0x42A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRA11 + desc PCRA11 + 0x42C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRA11 + desc PFSRA11 + 0x42E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRA12 + desc PCRA12 + 0x430 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRA12 + desc PFSRA12 + 0x432 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRA13 + desc PCRA13 + 0x434 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRA13 + desc PFSRA13 + 0x436 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRA14 + desc PCRA14 + 0x438 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRA14 + desc PFSRA14 + 0x43A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRA15 + desc PCRA15 + 0x43C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRA15 + desc PFSRA15 + 0x43E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRB0 + desc PCRB0 + 0x440 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRB0 + desc PFSRB0 + 0x442 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRB1 + desc PCRB1 + 0x444 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRB1 + desc PFSRB1 + 0x446 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRB2 + desc PCRB2 + 0x448 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRB2 + desc PFSRB2 + 0x44A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRB3 + desc PCRB3 + 0x44C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRB3 + desc PFSRB3 + 0x44E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRB4 + desc PCRB4 + 0x450 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRB4 + desc PFSRB4 + 0x452 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRB5 + desc PCRB5 + 0x454 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRB5 + desc PFSRB5 + 0x456 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRB6 + desc PCRB6 + 0x458 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRB6 + desc PFSRB6 + 0x45A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRB7 + desc PCRB7 + 0x45C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRB7 + desc PFSRB7 + 0x45E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRB8 + desc PCRB8 + 0x460 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRB8 + desc PFSRB8 + 0x462 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRB9 + desc PCRB9 + 0x464 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRB9 + desc PFSRB9 + 0x466 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRB10 + desc PCRB10 + 0x468 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRB10 + desc PFSRB10 + 0x46A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRB11 + desc PCRB11 + 0x46C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRB11 + desc PFSRB11 + 0x46E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRB12 + desc PCRB12 + 0x470 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRB12 + desc PFSRB12 + 0x472 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRB13 + desc PCRB13 + 0x474 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRB13 + desc PFSRB13 + 0x476 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRB14 + desc PCRB14 + 0x478 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRB14 + desc PFSRB14 + 0x47A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRB15 + desc PCRB15 + 0x47C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRB15 + desc PFSRB15 + 0x47E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRC0 + desc PCRC0 + 0x480 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRC0 + desc PFSRC0 + 0x482 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRC1 + desc PCRC1 + 0x484 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRC1 + desc PFSRC1 + 0x486 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRC2 + desc PCRC2 + 0x488 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRC2 + desc PFSRC2 + 0x48A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRC3 + desc PCRC3 + 0x48C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRC3 + desc PFSRC3 + 0x48E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRC4 + desc PCRC4 + 0x490 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRC4 + desc PFSRC4 + 0x492 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRC5 + desc PCRC5 + 0x494 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRC5 + desc PFSRC5 + 0x496 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRC6 + desc PCRC6 + 0x498 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRC6 + desc PFSRC6 + 0x49A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRC7 + desc PCRC7 + 0x49C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRC7 + desc PFSRC7 + 0x49E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRC8 + desc PCRC8 + 0x4A0 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRC8 + desc PFSRC8 + 0x4A2 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRC9 + desc PCRC9 + 0x4A4 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRC9 + desc PFSRC9 + 0x4A6 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRC10 + desc PCRC10 + 0x4A8 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRC10 + desc PFSRC10 + 0x4AA + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRC11 + desc PCRC11 + 0x4AC + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRC11 + desc PFSRC11 + 0x4AE + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRC12 + desc PCRC12 + 0x4B0 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRC12 + desc PFSRC12 + 0x4B2 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRC13 + desc PCRC13 + 0x4B4 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRC13 + desc PFSRC13 + 0x4B6 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRC14 + desc PCRC14 + 0x4B8 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRC14 + desc PFSRC14 + 0x4BA + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRC15 + desc PCRC15 + 0x4BC + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRC15 + desc PFSRC15 + 0x4BE + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRD0 + desc PCRD0 + 0x4C0 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRD0 + desc PFSRD0 + 0x4C2 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRD1 + desc PCRD1 + 0x4C4 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRD1 + desc PFSRD1 + 0x4C6 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRD2 + desc PCRD2 + 0x4C8 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRD2 + desc PFSRD2 + 0x4CA + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRD3 + desc PCRD3 + 0x4CC + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRD3 + desc PFSRD3 + 0x4CE + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRD4 + desc PCRD4 + 0x4D0 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRD4 + desc PFSRD4 + 0x4D2 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRD5 + desc PCRD5 + 0x4D4 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRD5 + desc PFSRD5 + 0x4D6 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRD6 + desc PCRD6 + 0x4D8 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRD6 + desc PFSRD6 + 0x4DA + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRD7 + desc PCRD7 + 0x4DC + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRD7 + desc PFSRD7 + 0x4DE + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRD8 + desc PCRD8 + 0x4E0 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRD8 + desc PFSRD8 + 0x4E2 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRD9 + desc PCRD9 + 0x4E4 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRD9 + desc PFSRD9 + 0x4E6 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRD10 + desc PCRD10 + 0x4E8 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRD10 + desc PFSRD10 + 0x4EA + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRD11 + desc PCRD11 + 0x4EC + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRD11 + desc PFSRD11 + 0x4EE + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRD12 + desc PCRD12 + 0x4F0 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRD12 + desc PFSRD12 + 0x4F2 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRD13 + desc PCRD13 + 0x4F4 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRD13 + desc PFSRD13 + 0x4F6 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRD14 + desc PCRD14 + 0x4F8 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRD14 + desc PFSRD14 + 0x4FA + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRD15 + desc PCRD15 + 0x4FC + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRD15 + desc PFSRD15 + 0x4FE + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRE0 + desc PCRE0 + 0x500 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRE0 + desc PFSRE0 + 0x502 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRE1 + desc PCRE1 + 0x504 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRE1 + desc PFSRE1 + 0x506 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRE2 + desc PCRE2 + 0x508 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRE2 + desc PFSRE2 + 0x50A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRE3 + desc PCRE3 + 0x50C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRE3 + desc PFSRE3 + 0x50E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRE4 + desc PCRE4 + 0x510 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRE4 + desc PFSRE4 + 0x512 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRE5 + desc PCRE5 + 0x514 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRE5 + desc PFSRE5 + 0x516 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRE6 + desc PCRE6 + 0x518 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRE6 + desc PFSRE6 + 0x51A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRE7 + desc PCRE7 + 0x51C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRE7 + desc PFSRE7 + 0x51E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRE8 + desc PCRE8 + 0x520 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRE8 + desc PFSRE8 + 0x522 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRE9 + desc PCRE9 + 0x524 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRE9 + desc PFSRE9 + 0x526 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRE10 + desc PCRE10 + 0x528 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRE10 + desc PFSRE10 + 0x52A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRE11 + desc PCRE11 + 0x52C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRE11 + desc PFSRE11 + 0x52E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRE12 + desc PCRE12 + 0x530 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRE12 + desc PFSRE12 + 0x532 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRE13 + desc PCRE13 + 0x534 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRE13 + desc PFSRE13 + 0x536 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRE14 + desc PCRE14 + 0x538 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRE14 + desc PFSRE14 + 0x53A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRE15 + desc PCRE15 + 0x53C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRE15 + desc PFSRE15 + 0x53E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRF0 + desc PCRF0 + 0x540 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRF0 + desc PFSRF0 + 0x542 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRF1 + desc PCRF1 + 0x544 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRF1 + desc PFSRF1 + 0x546 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRF2 + desc PCRF2 + 0x548 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRF2 + desc PFSRF2 + 0x54A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRF3 + desc PCRF3 + 0x54C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRF3 + desc PFSRF3 + 0x54E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRF4 + desc PCRF4 + 0x550 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRF4 + desc PFSRF4 + 0x552 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRF5 + desc PCRF5 + 0x554 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRF5 + desc PFSRF5 + 0x556 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRF6 + desc PCRF6 + 0x558 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRF6 + desc PFSRF6 + 0x55A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRF7 + desc PCRF7 + 0x55C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRF7 + desc PFSRF7 + 0x55E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRF8 + desc PCRF8 + 0x560 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRF8 + desc PFSRF8 + 0x562 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRF9 + desc PCRF9 + 0x564 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRF9 + desc PFSRF9 + 0x566 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRF10 + desc PCRF10 + 0x568 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRF10 + desc PFSRF10 + 0x56A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRF11 + desc PCRF11 + 0x56C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRF11 + desc PFSRF11 + 0x56E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRF12 + desc PCRF12 + 0x570 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRF12 + desc PFSRF12 + 0x572 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRF13 + desc PCRF13 + 0x574 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRF13 + desc PFSRF13 + 0x576 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRF14 + desc PCRF14 + 0x578 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRF14 + desc PFSRF14 + 0x57A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRF15 + desc PCRF15 + 0x57C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRF15 + desc PFSRF15 + 0x57E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRG0 + desc PCRG0 + 0x580 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRG0 + desc PFSRG0 + 0x582 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRG1 + desc PCRG1 + 0x584 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRG1 + desc PFSRG1 + 0x586 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRG2 + desc PCRG2 + 0x588 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRG2 + desc PFSRG2 + 0x58A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRG3 + desc PCRG3 + 0x58C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRG3 + desc PFSRG3 + 0x58E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRG4 + desc PCRG4 + 0x590 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRG4 + desc PFSRG4 + 0x592 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRG5 + desc PCRG5 + 0x594 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRG5 + desc PFSRG5 + 0x596 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRG6 + desc PCRG6 + 0x598 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRG6 + desc PFSRG6 + 0x59A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRG7 + desc PCRG7 + 0x59C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRG7 + desc PFSRG7 + 0x59E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRG8 + desc PCRG8 + 0x5A0 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRG8 + desc PFSRG8 + 0x5A2 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRG9 + desc PCRG9 + 0x5A4 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRG9 + desc PFSRG9 + 0x5A6 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRG10 + desc PCRG10 + 0x5A8 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRG10 + desc PFSRG10 + 0x5AA + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRG11 + desc PCRG11 + 0x5AC + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRG11 + desc PFSRG11 + 0x5AE + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRG12 + desc PCRG12 + 0x5B0 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRG12 + desc PFSRG12 + 0x5B2 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRG13 + desc PCRG13 + 0x5B4 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRG13 + desc PFSRG13 + 0x5B6 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRG14 + desc PCRG14 + 0x5B8 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRG14 + desc PFSRG14 + 0x5BA + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRG15 + desc PCRG15 + 0x5BC + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRG15 + desc PFSRG15 + 0x5BE + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRH0 + desc PCRH0 + 0x5C0 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRH0 + desc PFSRH0 + 0x5C2 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRH1 + desc PCRH1 + 0x5C4 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRH1 + desc PFSRH1 + 0x5C6 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRH2 + desc PCRH2 + 0x5C8 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRH2 + desc PFSRH2 + 0x5CA + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRH3 + desc PCRH3 + 0x5CC + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRH3 + desc PFSRH3 + 0x5CE + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRH4 + desc PCRH4 + 0x5D0 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRH4 + desc PFSRH4 + 0x5D2 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRH5 + desc PCRH5 + 0x5D4 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRH5 + desc PFSRH5 + 0x5D6 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRH6 + desc PCRH6 + 0x5D8 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRH6 + desc PFSRH6 + 0x5DA + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRH7 + desc PCRH7 + 0x5DC + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRH7 + desc PFSRH7 + 0x5DE + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRH8 + desc PCRH8 + 0x5E0 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRH8 + desc PFSRH8 + 0x5E2 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRH9 + desc PCRH9 + 0x5E4 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRH9 + desc PFSRH9 + 0x5E6 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRH10 + desc PCRH10 + 0x5E8 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRH10 + desc PFSRH10 + 0x5EA + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRH11 + desc PCRH11 + 0x5EC + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRH11 + desc PFSRH11 + 0x5EE + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRH12 + desc PCRH12 + 0x5F0 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRH12 + desc PFSRH12 + 0x5F2 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRH13 + desc PCRH13 + 0x5F4 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRH13 + desc PFSRH13 + 0x5F6 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRH14 + desc PCRH14 + 0x5F8 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRH14 + desc PFSRH14 + 0x5FA + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRH15 + desc PCRH15 + 0x5FC + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRH15 + desc PFSRH15 + 0x5FE + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRI0 + desc PCRI0 + 0x600 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRI0 + desc PFSRI0 + 0x602 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRI1 + desc PCRI1 + 0x604 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRI1 + desc PFSRI1 + 0x606 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRI2 + desc PCRI2 + 0x608 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRI2 + desc PFSRI2 + 0x60A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRI3 + desc PCRI3 + 0x60C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRI3 + desc PFSRI3 + 0x60E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRI4 + desc PCRI4 + 0x610 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRI4 + desc PFSRI4 + 0x612 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRI5 + desc PCRI5 + 0x614 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRI5 + desc PFSRI5 + 0x616 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRI6 + desc PCRI6 + 0x618 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRI6 + desc PFSRI6 + 0x61A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRI7 + desc PCRI7 + 0x61C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRI7 + desc PFSRI7 + 0x61E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRI8 + desc PCRI8 + 0x620 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRI8 + desc PFSRI8 + 0x622 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRI9 + desc PCRI9 + 0x624 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRI9 + desc PFSRI9 + 0x626 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRI10 + desc PCRI10 + 0x628 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRI10 + desc PFSRI10 + 0x62A + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRI11 + desc PCRI11 + 0x62C + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRI11 + desc PFSRI11 + 0x62E + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRI12 + desc PCRI12 + 0x630 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRI12 + desc PFSRI12 + 0x632 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + PCRI13 + desc PCRI13 + 0x634 + 16 + read-write + 0x0 + 0xD777 + + + POUT + desc POUT + 0 + 0 + read-write + + + POUTE + desc POUTE + 1 + 1 + read-write + + + NOD + desc NOD + 2 + 2 + read-write + + + DRV + desc DRV + 5 + 4 + read-write + + + PUU + desc PUU + 6 + 6 + read-write + + + PIN + desc PIN + 8 + 8 + read-only + + + INVE + desc INVE + 9 + 9 + read-write + + + CINSEL + desc CINSEL + 10 + 10 + read-write + + + INTE + desc INTE + 12 + 12 + read-write + + + LTE + desc LTE + 14 + 14 + read-write + + + DDIS + desc DDIS + 15 + 15 + read-write + + + + + PFSRI13 + desc PFSRI13 + 0x636 + 16 + read-write + 0x0 + 0x13F + + + FSEL + desc FSEL + 5 + 0 + read-write + + + BFE + desc BFE + 8 + 8 + read-write + + + + + + + HASH + desc HASH + 0x40008400 + + 0x0 + 0x80 + + + + CR + desc CR + 0x0 + 32 + read-write + 0x0 + 0xC777 + + + START + desc START + 0 + 0 + read-write + + + FST_GRP + desc FST_GRP + 1 + 1 + read-write + + + KMSG_END + desc KMSG_END + 2 + 2 + read-write + + + MODE + desc MODE + 5 + 4 + read-write + + + LKEY + desc LKEY + 6 + 6 + read-write + + + BUSY + desc BUSY + 8 + 8 + read-write + + + CYC_END + desc CYC_END + 9 + 9 + read-write + + + HMAC_END + desc HMAC_END + 10 + 10 + read-write + + + HCIE + desc HCIE + 14 + 14 + read-write + + + HEIE + desc HEIE + 15 + 15 + read-write + + + + + HR7 + desc HR7 + 0x10 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HR6 + desc HR6 + 0x14 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HR5 + desc HR5 + 0x18 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HR4 + desc HR4 + 0x1C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HR3 + desc HR3 + 0x20 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HR2 + desc HR2 + 0x24 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HR1 + desc HR1 + 0x28 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HR0 + desc HR0 + 0x2C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DR15 + desc DR15 + 0x40 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DR14 + desc DR14 + 0x44 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DR13 + desc DR13 + 0x48 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DR12 + desc DR12 + 0x4C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DR11 + desc DR11 + 0x50 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DR10 + desc DR10 + 0x54 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DR9 + desc DR9 + 0x58 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DR8 + desc DR8 + 0x5C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DR7 + desc DR7 + 0x60 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DR6 + desc DR6 + 0x64 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DR5 + desc DR5 + 0x68 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DR4 + desc DR4 + 0x6C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DR3 + desc DR3 + 0x70 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DR2 + desc DR2 + 0x74 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DR1 + desc DR1 + 0x78 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DR0 + desc DR0 + 0x7C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + + + HRPWM + desc HRPWM + 0x4003C000 + + 0x0 + 0x58 + + + + CR1 + desc CR1 + 0x0 + 32 + read-write + 0x0 + 0xE000FFFF + + + NSEL + desc NSEL + 7 + 0 + read-write + + + PSEL + desc PSEL + 15 + 8 + read-write + + + NE + desc NE + 29 + 29 + read-write + + + PE + desc PE + 30 + 30 + read-write + + + EN + desc EN + 31 + 31 + read-write + + + + + CR2 + desc CR2 + 0x4 + 32 + read-write + 0x0 + 0xE000FFFF + + + NSEL + desc NSEL + 7 + 0 + read-write + + + PSEL + desc PSEL + 15 + 8 + read-write + + + NE + desc NE + 29 + 29 + read-write + + + PE + desc PE + 30 + 30 + read-write + + + EN + desc EN + 31 + 31 + read-write + + + + + CR3 + desc CR3 + 0x8 + 32 + read-write + 0x0 + 0xE000FFFF + + + NSEL + desc NSEL + 7 + 0 + read-write + + + PSEL + desc PSEL + 15 + 8 + read-write + + + NE + desc NE + 29 + 29 + read-write + + + PE + desc PE + 30 + 30 + read-write + + + EN + desc EN + 31 + 31 + read-write + + + + + CR4 + desc CR4 + 0xC + 32 + read-write + 0x0 + 0xE000FFFF + + + NSEL + desc NSEL + 7 + 0 + read-write + + + PSEL + desc PSEL + 15 + 8 + read-write + + + NE + desc NE + 29 + 29 + read-write + + + PE + desc PE + 30 + 30 + read-write + + + EN + desc EN + 31 + 31 + read-write + + + + + CR5 + desc CR5 + 0x10 + 32 + read-write + 0x0 + 0xE000FFFF + + + NSEL + desc NSEL + 7 + 0 + read-write + + + PSEL + desc PSEL + 15 + 8 + read-write + + + NE + desc NE + 29 + 29 + read-write + + + PE + desc PE + 30 + 30 + read-write + + + EN + desc EN + 31 + 31 + read-write + + + + + CR6 + desc CR6 + 0x14 + 32 + read-write + 0x0 + 0xE000FFFF + + + NSEL + desc NSEL + 7 + 0 + read-write + + + PSEL + desc PSEL + 15 + 8 + read-write + + + NE + desc NE + 29 + 29 + read-write + + + PE + desc PE + 30 + 30 + read-write + + + EN + desc EN + 31 + 31 + read-write + + + + + CR7 + desc CR7 + 0x18 + 32 + read-write + 0x0 + 0xE000FFFF + + + NSEL + desc NSEL + 7 + 0 + read-write + + + PSEL + desc PSEL + 15 + 8 + read-write + + + NE + desc NE + 29 + 29 + read-write + + + PE + desc PE + 30 + 30 + read-write + + + EN + desc EN + 31 + 31 + read-write + + + + + CR8 + desc CR8 + 0x1C + 32 + read-write + 0x0 + 0xE000FFFF + + + NSEL + desc NSEL + 7 + 0 + read-write + + + PSEL + desc PSEL + 15 + 8 + read-write + + + NE + desc NE + 29 + 29 + read-write + + + PE + desc PE + 30 + 30 + read-write + + + EN + desc EN + 31 + 31 + read-write + + + + + CR9 + desc CR9 + 0x20 + 32 + read-write + 0x0 + 0xE000FFFF + + + NSEL + desc NSEL + 7 + 0 + read-write + + + PSEL + desc PSEL + 15 + 8 + read-write + + + NE + desc NE + 29 + 29 + read-write + + + PE + desc PE + 30 + 30 + read-write + + + EN + desc EN + 31 + 31 + read-write + + + + + CR10 + desc CR10 + 0x24 + 32 + read-write + 0x0 + 0xE000FFFF + + + NSEL + desc NSEL + 7 + 0 + read-write + + + PSEL + desc PSEL + 15 + 8 + read-write + + + NE + desc NE + 29 + 29 + read-write + + + PE + desc PE + 30 + 30 + read-write + + + EN + desc EN + 31 + 31 + read-write + + + + + CR11 + desc CR11 + 0x28 + 32 + read-write + 0x0 + 0xE000FFFF + + + NSEL + desc NSEL + 7 + 0 + read-write + + + PSEL + desc PSEL + 15 + 8 + read-write + + + NE + desc NE + 29 + 29 + read-write + + + PE + desc PE + 30 + 30 + read-write + + + EN + desc EN + 31 + 31 + read-write + + + + + CR12 + desc CR12 + 0x2C + 32 + read-write + 0x0 + 0xE000FFFF + + + NSEL + desc NSEL + 7 + 0 + read-write + + + PSEL + desc PSEL + 15 + 8 + read-write + + + NE + desc NE + 29 + 29 + read-write + + + PE + desc PE + 30 + 30 + read-write + + + EN + desc EN + 31 + 31 + read-write + + + + + CR13 + desc CR13 + 0x30 + 32 + read-write + 0x0 + 0xE000FFFF + + + NSEL + desc NSEL + 7 + 0 + read-write + + + PSEL + desc PSEL + 15 + 8 + read-write + + + NE + desc NE + 29 + 29 + read-write + + + PE + desc PE + 30 + 30 + read-write + + + EN + desc EN + 31 + 31 + read-write + + + + + CR14 + desc CR14 + 0x34 + 32 + read-write + 0x0 + 0xE000FFFF + + + NSEL + desc NSEL + 7 + 0 + read-write + + + PSEL + desc PSEL + 15 + 8 + read-write + + + NE + desc NE + 29 + 29 + read-write + + + PE + desc PE + 30 + 30 + read-write + + + EN + desc EN + 31 + 31 + read-write + + + + + CR15 + desc CR15 + 0x38 + 32 + read-write + 0x0 + 0xE000FFFF + + + NSEL + desc NSEL + 7 + 0 + read-write + + + PSEL + desc PSEL + 15 + 8 + read-write + + + NE + desc NE + 29 + 29 + read-write + + + PE + desc PE + 30 + 30 + read-write + + + EN + desc EN + 31 + 31 + read-write + + + + + CR16 + desc CR16 + 0x3C + 32 + read-write + 0x0 + 0xE000FFFF + + + NSEL + desc NSEL + 7 + 0 + read-write + + + PSEL + desc PSEL + 15 + 8 + read-write + + + NE + desc NE + 29 + 29 + read-write + + + PE + desc PE + 30 + 30 + read-write + + + EN + desc EN + 31 + 31 + read-write + + + + + CALCR0 + desc CALCR0 + 0x50 + 32 + read-write + 0x0 + 0x90FF + + + CALCODE + desc CALCODE + 7 + 0 + read-write + + + ENDF + desc ENDF + 12 + 12 + read-write + + + CALEN + desc CALEN + 15 + 15 + read-write + + + + + CALCR1 + desc CALCR1 + 0x54 + 32 + read-write + 0x0 + 0x90FF + + + CALCODE + desc CALCODE + 7 + 0 + read-write + + + ENDF + desc ENDF + 12 + 12 + read-write + + + CALEN + desc CALEN + 15 + 15 + read-write + + + + + + + I2C1 + desc I2C1 + 0x4004E000 + + 0x0 + 0x34 + + + + CR1 + desc CR1 + 0x0 + 32 + read-write + 0x40 + 0x87DF + + + PE + desc PE + 0 + 0 + read-write + + + SMBUS + desc SMBUS + 1 + 1 + read-write + + + SMBALRTEN + desc SMBALRTEN + 2 + 2 + read-write + + + SMBDEFAULTEN + desc SMBDEFAULTEN + 3 + 3 + read-write + + + SMBHOSTEN + desc SMBHOSTEN + 4 + 4 + read-write + + + ENGC + desc ENGC + 6 + 6 + read-write + + + RESTART + desc RESTART + 7 + 7 + read-write + + + START + desc START + 8 + 8 + read-write + + + STOP + desc STOP + 9 + 9 + read-write + + + ACK + desc ACK + 10 + 10 + read-write + + + SWRST + desc SWRST + 15 + 15 + read-write + + + + + CR2 + desc CR2 + 0x4 + 32 + read-write + 0x0 + 0xF052DF + + + STARTIE + desc STARTIE + 0 + 0 + read-write + + + SLADDR0IE + desc SLADDR0IE + 1 + 1 + read-write + + + SLADDR1IE + desc SLADDR1IE + 2 + 2 + read-write + + + TENDIE + desc TENDIE + 3 + 3 + read-write + + + STOPIE + desc STOPIE + 4 + 4 + read-write + + + RFULLIE + desc RFULLIE + 6 + 6 + read-write + + + TEMPTYIE + desc TEMPTYIE + 7 + 7 + read-write + + + ARLOIE + desc ARLOIE + 9 + 9 + read-write + + + NACKIE + desc NACKIE + 12 + 12 + read-write + + + TMOUTIE + desc TMOUTIE + 14 + 14 + read-write + + + GENCALLIE + desc GENCALLIE + 20 + 20 + read-write + + + SMBDEFAULTIE + desc SMBDEFAULTIE + 21 + 21 + read-write + + + SMHOSTIE + desc SMHOSTIE + 22 + 22 + read-write + + + SMBALRTIE + desc SMBALRTIE + 23 + 23 + read-write + + + + + CR3 + desc CR3 + 0x8 + 32 + read-write + 0x6 + 0x87 + + + TMOUTEN + desc TMOUTEN + 0 + 0 + read-write + + + LTMOUT + desc LTMOUT + 1 + 1 + read-write + + + HTMOUT + desc HTMOUT + 2 + 2 + read-write + + + FACKEN + desc FACKEN + 7 + 7 + read-write + + + + + SLR0 + desc SLR0 + 0x10 + 32 + read-write + 0x1000 + 0x93FF + + + SLADDR0 + desc SLADDR0 + 9 + 0 + read-write + + + SLADDR0EN + desc SLADDR0EN + 12 + 12 + read-write + + + ADDRMOD0 + desc ADDRMOD0 + 15 + 15 + read-write + + + + + SLR1 + desc SLR1 + 0x14 + 32 + read-write + 0x0 + 0x93FF + + + SLADDR1 + desc SLADDR1 + 9 + 0 + read-write + + + SLADDR1EN + desc SLADDR1EN + 12 + 12 + read-write + + + ADDRMOD1 + desc ADDRMOD1 + 15 + 15 + read-write + + + + + SLTR + desc SLTR + 0x18 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + TOUTLOW + desc TOUTLOW + 15 + 0 + read-write + + + TOUTHIGH + desc TOUTHIGH + 31 + 16 + read-write + + + + + SR + desc SR + 0x1C + 32 + read-write + 0x0 + 0xF756DF + + + STARTF + desc STARTF + 0 + 0 + read-write + + + SLADDR0F + desc SLADDR0F + 1 + 1 + read-write + + + SLADDR1F + desc SLADDR1F + 2 + 2 + read-write + + + TENDF + desc TENDF + 3 + 3 + read-write + + + STOPF + desc STOPF + 4 + 4 + read-write + + + RFULLF + desc RFULLF + 6 + 6 + read-write + + + TEMPTYF + desc TEMPTYF + 7 + 7 + read-write + + + ARLOF + desc ARLOF + 9 + 9 + read-write + + + ACKRF + desc ACKRF + 10 + 10 + read-write + + + NACKF + desc NACKF + 12 + 12 + read-write + + + TMOUTF + desc TMOUTF + 14 + 14 + read-write + + + MSL + desc MSL + 16 + 16 + read-write + + + BUSY + desc BUSY + 17 + 17 + read-write + + + TRA + desc TRA + 18 + 18 + read-write + + + GENCALLF + desc GENCALLF + 20 + 20 + read-write + + + SMBDEFAULTF + desc SMBDEFAULTF + 21 + 21 + read-write + + + SMBHOSTF + desc SMBHOSTF + 22 + 22 + read-write + + + SMBALRTF + desc SMBALRTF + 23 + 23 + read-write + + + + + CLR + desc CLR + 0x20 + 32 + write-only + 0x0 + 0xF052DF + + + STARTFCLR + desc STARTFCLR + 0 + 0 + write-only + + + SLADDR0FCLR + desc SLADDR0FCLR + 1 + 1 + write-only + + + SLADDR1FCLR + desc SLADDR1FCLR + 2 + 2 + write-only + + + TENDFCLR + desc TENDFCLR + 3 + 3 + write-only + + + STOPFCLR + desc STOPFCLR + 4 + 4 + write-only + + + RFULLFCLR + desc RFULLFCLR + 6 + 6 + write-only + + + TEMPTYFCLR + desc TEMPTYFCLR + 7 + 7 + write-only + + + ARLOFCLR + desc ARLOFCLR + 9 + 9 + write-only + + + NACKFCLR + desc NACKFCLR + 12 + 12 + write-only + + + TMOUTFCLR + desc TMOUTFCLR + 14 + 14 + write-only + + + GENCALLFCLR + desc GENCALLFCLR + 20 + 20 + write-only + + + SMBDEFAULTFCLR + desc SMBDEFAULTFCLR + 21 + 21 + write-only + + + SMBHOSTFCLR + desc SMBHOSTFCLR + 22 + 22 + write-only + + + SMBALRTFCLR + desc SMBALRTFCLR + 23 + 23 + write-only + + + + + DTR + desc DTR + 0x24 + 8 + write-only + 0xFF + 0xFF + + + DT + desc DT + 7 + 0 + write-only + + + + + DRR + desc DRR + 0x28 + 8 + read-only + 0x0 + 0xFF + + + DR + desc DR + 7 + 0 + read-only + + + + + CCR + desc CCR + 0x2C + 32 + read-write + 0x1F1F + 0x71F1F + + + SLOWW + desc SLOWW + 4 + 0 + read-write + + + SHIGHW + desc SHIGHW + 12 + 8 + read-write + + + FREQ + desc FREQ + 18 + 16 + read-write + + + + + FLTR + desc FLTR + 0x30 + 32 + read-write + 0x10 + 0x33 + + + DNF + desc DNF + 1 + 0 + read-write + + + DNFEN + desc DNFEN + 4 + 4 + read-write + + + ANFEN + desc ANFEN + 5 + 5 + read-write + + + + + + + I2C2 + desc I2C2 + 0x4004E400 + + 0x0 + 0x34 + + + + CR1 + desc CR1 + 0x0 + 32 + read-write + 0x40 + 0x87DF + + + PE + desc PE + 0 + 0 + read-write + + + SMBUS + desc SMBUS + 1 + 1 + read-write + + + SMBALRTEN + desc SMBALRTEN + 2 + 2 + read-write + + + SMBDEFAULTEN + desc SMBDEFAULTEN + 3 + 3 + read-write + + + SMBHOSTEN + desc SMBHOSTEN + 4 + 4 + read-write + + + ENGC + desc ENGC + 6 + 6 + read-write + + + RESTART + desc RESTART + 7 + 7 + read-write + + + START + desc START + 8 + 8 + read-write + + + STOP + desc STOP + 9 + 9 + read-write + + + ACK + desc ACK + 10 + 10 + read-write + + + SWRST + desc SWRST + 15 + 15 + read-write + + + + + CR2 + desc CR2 + 0x4 + 32 + read-write + 0x0 + 0xF052DF + + + STARTIE + desc STARTIE + 0 + 0 + read-write + + + SLADDR0IE + desc SLADDR0IE + 1 + 1 + read-write + + + SLADDR1IE + desc SLADDR1IE + 2 + 2 + read-write + + + TENDIE + desc TENDIE + 3 + 3 + read-write + + + STOPIE + desc STOPIE + 4 + 4 + read-write + + + RFULLIE + desc RFULLIE + 6 + 6 + read-write + + + TEMPTYIE + desc TEMPTYIE + 7 + 7 + read-write + + + ARLOIE + desc ARLOIE + 9 + 9 + read-write + + + NACKIE + desc NACKIE + 12 + 12 + read-write + + + TMOUTIE + desc TMOUTIE + 14 + 14 + read-write + + + GENCALLIE + desc GENCALLIE + 20 + 20 + read-write + + + SMBDEFAULTIE + desc SMBDEFAULTIE + 21 + 21 + read-write + + + SMHOSTIE + desc SMHOSTIE + 22 + 22 + read-write + + + SMBALRTIE + desc SMBALRTIE + 23 + 23 + read-write + + + + + CR3 + desc CR3 + 0x8 + 32 + read-write + 0x6 + 0x87 + + + TMOUTEN + desc TMOUTEN + 0 + 0 + read-write + + + LTMOUT + desc LTMOUT + 1 + 1 + read-write + + + HTMOUT + desc HTMOUT + 2 + 2 + read-write + + + FACKEN + desc FACKEN + 7 + 7 + read-write + + + + + SLR0 + desc SLR0 + 0x10 + 32 + read-write + 0x1000 + 0x93FF + + + SLADDR0 + desc SLADDR0 + 9 + 0 + read-write + + + SLADDR0EN + desc SLADDR0EN + 12 + 12 + read-write + + + ADDRMOD0 + desc ADDRMOD0 + 15 + 15 + read-write + + + + + SLR1 + desc SLR1 + 0x14 + 32 + read-write + 0x0 + 0x93FF + + + SLADDR1 + desc SLADDR1 + 9 + 0 + read-write + + + SLADDR1EN + desc SLADDR1EN + 12 + 12 + read-write + + + ADDRMOD1 + desc ADDRMOD1 + 15 + 15 + read-write + + + + + SLTR + desc SLTR + 0x18 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + TOUTLOW + desc TOUTLOW + 15 + 0 + read-write + + + TOUTHIGH + desc TOUTHIGH + 31 + 16 + read-write + + + + + SR + desc SR + 0x1C + 32 + read-write + 0x0 + 0xF756DF + + + STARTF + desc STARTF + 0 + 0 + read-write + + + SLADDR0F + desc SLADDR0F + 1 + 1 + read-write + + + SLADDR1F + desc SLADDR1F + 2 + 2 + read-write + + + TENDF + desc TENDF + 3 + 3 + read-write + + + STOPF + desc STOPF + 4 + 4 + read-write + + + RFULLF + desc RFULLF + 6 + 6 + read-write + + + TEMPTYF + desc TEMPTYF + 7 + 7 + read-write + + + ARLOF + desc ARLOF + 9 + 9 + read-write + + + ACKRF + desc ACKRF + 10 + 10 + read-write + + + NACKF + desc NACKF + 12 + 12 + read-write + + + TMOUTF + desc TMOUTF + 14 + 14 + read-write + + + MSL + desc MSL + 16 + 16 + read-write + + + BUSY + desc BUSY + 17 + 17 + read-write + + + TRA + desc TRA + 18 + 18 + read-write + + + GENCALLF + desc GENCALLF + 20 + 20 + read-write + + + SMBDEFAULTF + desc SMBDEFAULTF + 21 + 21 + read-write + + + SMBHOSTF + desc SMBHOSTF + 22 + 22 + read-write + + + SMBALRTF + desc SMBALRTF + 23 + 23 + read-write + + + + + CLR + desc CLR + 0x20 + 32 + write-only + 0x0 + 0xF052DF + + + STARTFCLR + desc STARTFCLR + 0 + 0 + write-only + + + SLADDR0FCLR + desc SLADDR0FCLR + 1 + 1 + write-only + + + SLADDR1FCLR + desc SLADDR1FCLR + 2 + 2 + write-only + + + TENDFCLR + desc TENDFCLR + 3 + 3 + write-only + + + STOPFCLR + desc STOPFCLR + 4 + 4 + write-only + + + RFULLFCLR + desc RFULLFCLR + 6 + 6 + write-only + + + TEMPTYFCLR + desc TEMPTYFCLR + 7 + 7 + write-only + + + ARLOFCLR + desc ARLOFCLR + 9 + 9 + write-only + + + NACKFCLR + desc NACKFCLR + 12 + 12 + write-only + + + TMOUTFCLR + desc TMOUTFCLR + 14 + 14 + write-only + + + GENCALLFCLR + desc GENCALLFCLR + 20 + 20 + write-only + + + SMBDEFAULTFCLR + desc SMBDEFAULTFCLR + 21 + 21 + write-only + + + SMBHOSTFCLR + desc SMBHOSTFCLR + 22 + 22 + write-only + + + SMBALRTFCLR + desc SMBALRTFCLR + 23 + 23 + write-only + + + + + DTR + desc DTR + 0x24 + 32 + write-only + 0xFF + 0xFF + + + DT + desc DT + 7 + 0 + write-only + + + + + DRR + desc DRR + 0x28 + 32 + read-only + 0x0 + 0xFF + + + DR + desc DR + 7 + 0 + read-only + + + + + CCR + desc CCR + 0x2C + 32 + read-write + 0x1F1F + 0x71F1F + + + SLOWW + desc SLOWW + 4 + 0 + read-write + + + SHIGHW + desc SHIGHW + 12 + 8 + read-write + + + FREQ + desc FREQ + 18 + 16 + read-write + + + + + FLTR + desc FLTR + 0x30 + 32 + read-write + 0x10 + 0x33 + + + DNF + desc DNF + 1 + 0 + read-write + + + DNFEN + desc DNFEN + 4 + 4 + read-write + + + ANFEN + desc ANFEN + 5 + 5 + read-write + + + + + + + I2C3 + desc I2C3 + 0x4004E800 + + 0x0 + 0x34 + + + + CR1 + desc CR1 + 0x0 + 32 + read-write + 0x40 + 0x87DF + + + PE + desc PE + 0 + 0 + read-write + + + SMBUS + desc SMBUS + 1 + 1 + read-write + + + SMBALRTEN + desc SMBALRTEN + 2 + 2 + read-write + + + SMBDEFAULTEN + desc SMBDEFAULTEN + 3 + 3 + read-write + + + SMBHOSTEN + desc SMBHOSTEN + 4 + 4 + read-write + + + ENGC + desc ENGC + 6 + 6 + read-write + + + RESTART + desc RESTART + 7 + 7 + read-write + + + START + desc START + 8 + 8 + read-write + + + STOP + desc STOP + 9 + 9 + read-write + + + ACK + desc ACK + 10 + 10 + read-write + + + SWRST + desc SWRST + 15 + 15 + read-write + + + + + CR2 + desc CR2 + 0x4 + 32 + read-write + 0x0 + 0xF052DF + + + STARTIE + desc STARTIE + 0 + 0 + read-write + + + SLADDR0IE + desc SLADDR0IE + 1 + 1 + read-write + + + SLADDR1IE + desc SLADDR1IE + 2 + 2 + read-write + + + TENDIE + desc TENDIE + 3 + 3 + read-write + + + STOPIE + desc STOPIE + 4 + 4 + read-write + + + RFULLIE + desc RFULLIE + 6 + 6 + read-write + + + TEMPTYIE + desc TEMPTYIE + 7 + 7 + read-write + + + ARLOIE + desc ARLOIE + 9 + 9 + read-write + + + NACKIE + desc NACKIE + 12 + 12 + read-write + + + TMOUTIE + desc TMOUTIE + 14 + 14 + read-write + + + GENCALLIE + desc GENCALLIE + 20 + 20 + read-write + + + SMBDEFAULTIE + desc SMBDEFAULTIE + 21 + 21 + read-write + + + SMHOSTIE + desc SMHOSTIE + 22 + 22 + read-write + + + SMBALRTIE + desc SMBALRTIE + 23 + 23 + read-write + + + + + CR3 + desc CR3 + 0x8 + 32 + read-write + 0x6 + 0x87 + + + TMOUTEN + desc TMOUTEN + 0 + 0 + read-write + + + LTMOUT + desc LTMOUT + 1 + 1 + read-write + + + HTMOUT + desc HTMOUT + 2 + 2 + read-write + + + FACKEN + desc FACKEN + 7 + 7 + read-write + + + + + SLR0 + desc SLR0 + 0x10 + 32 + read-write + 0x1000 + 0x93FF + + + SLADDR0 + desc SLADDR0 + 9 + 0 + read-write + + + SLADDR0EN + desc SLADDR0EN + 12 + 12 + read-write + + + ADDRMOD0 + desc ADDRMOD0 + 15 + 15 + read-write + + + + + SLR1 + desc SLR1 + 0x14 + 32 + read-write + 0x0 + 0x93FF + + + SLADDR1 + desc SLADDR1 + 9 + 0 + read-write + + + SLADDR1EN + desc SLADDR1EN + 12 + 12 + read-write + + + ADDRMOD1 + desc ADDRMOD1 + 15 + 15 + read-write + + + + + SLTR + desc SLTR + 0x18 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + TOUTLOW + desc TOUTLOW + 15 + 0 + read-write + + + TOUTHIGH + desc TOUTHIGH + 31 + 16 + read-write + + + + + SR + desc SR + 0x1C + 32 + read-write + 0x0 + 0xF756DF + + + STARTF + desc STARTF + 0 + 0 + read-write + + + SLADDR0F + desc SLADDR0F + 1 + 1 + read-write + + + SLADDR1F + desc SLADDR1F + 2 + 2 + read-write + + + TENDF + desc TENDF + 3 + 3 + read-write + + + STOPF + desc STOPF + 4 + 4 + read-write + + + RFULLF + desc RFULLF + 6 + 6 + read-write + + + TEMPTYF + desc TEMPTYF + 7 + 7 + read-write + + + ARLOF + desc ARLOF + 9 + 9 + read-write + + + ACKRF + desc ACKRF + 10 + 10 + read-write + + + NACKF + desc NACKF + 12 + 12 + read-write + + + TMOUTF + desc TMOUTF + 14 + 14 + read-write + + + MSL + desc MSL + 16 + 16 + read-write + + + BUSY + desc BUSY + 17 + 17 + read-write + + + TRA + desc TRA + 18 + 18 + read-write + + + GENCALLF + desc GENCALLF + 20 + 20 + read-write + + + SMBDEFAULTF + desc SMBDEFAULTF + 21 + 21 + read-write + + + SMBHOSTF + desc SMBHOSTF + 22 + 22 + read-write + + + SMBALRTF + desc SMBALRTF + 23 + 23 + read-write + + + + + CLR + desc CLR + 0x20 + 32 + write-only + 0x0 + 0xF052DF + + + STARTFCLR + desc STARTFCLR + 0 + 0 + write-only + + + SLADDR0FCLR + desc SLADDR0FCLR + 1 + 1 + write-only + + + SLADDR1FCLR + desc SLADDR1FCLR + 2 + 2 + write-only + + + TENDFCLR + desc TENDFCLR + 3 + 3 + write-only + + + STOPFCLR + desc STOPFCLR + 4 + 4 + write-only + + + RFULLFCLR + desc RFULLFCLR + 6 + 6 + write-only + + + TEMPTYFCLR + desc TEMPTYFCLR + 7 + 7 + write-only + + + ARLOFCLR + desc ARLOFCLR + 9 + 9 + write-only + + + NACKFCLR + desc NACKFCLR + 12 + 12 + write-only + + + TMOUTFCLR + desc TMOUTFCLR + 14 + 14 + write-only + + + GENCALLFCLR + desc GENCALLFCLR + 20 + 20 + write-only + + + SMBDEFAULTFCLR + desc SMBDEFAULTFCLR + 21 + 21 + write-only + + + SMBHOSTFCLR + desc SMBHOSTFCLR + 22 + 22 + write-only + + + SMBALRTFCLR + desc SMBALRTFCLR + 23 + 23 + write-only + + + + + DTR + desc DTR + 0x24 + 32 + write-only + 0xFF + 0xFF + + + DT + desc DT + 7 + 0 + write-only + + + + + DRR + desc DRR + 0x28 + 32 + read-only + 0x0 + 0xFF + + + DR + desc DR + 7 + 0 + read-only + + + + + CCR + desc CCR + 0x2C + 32 + read-write + 0x1F1F + 0x71F1F + + + SLOWW + desc SLOWW + 4 + 0 + read-write + + + SHIGHW + desc SHIGHW + 12 + 8 + read-write + + + FREQ + desc FREQ + 18 + 16 + read-write + + + + + FLTR + desc FLTR + 0x30 + 32 + read-write + 0x10 + 0x33 + + + DNF + desc DNF + 1 + 0 + read-write + + + DNFEN + desc DNFEN + 4 + 4 + read-write + + + ANFEN + desc ANFEN + 5 + 5 + read-write + + + + + + + I2C4 + desc I2C4 + 0x4004EC00 + + 0x0 + 0x34 + + + + CR1 + desc CR1 + 0x0 + 32 + read-write + 0x40 + 0x87DF + + + PE + desc PE + 0 + 0 + read-write + + + SMBUS + desc SMBUS + 1 + 1 + read-write + + + SMBALRTEN + desc SMBALRTEN + 2 + 2 + read-write + + + SMBDEFAULTEN + desc SMBDEFAULTEN + 3 + 3 + read-write + + + SMBHOSTEN + desc SMBHOSTEN + 4 + 4 + read-write + + + ENGC + desc ENGC + 6 + 6 + read-write + + + RESTART + desc RESTART + 7 + 7 + read-write + + + START + desc START + 8 + 8 + read-write + + + STOP + desc STOP + 9 + 9 + read-write + + + ACK + desc ACK + 10 + 10 + read-write + + + SWRST + desc SWRST + 15 + 15 + read-write + + + + + CR2 + desc CR2 + 0x4 + 32 + read-write + 0x0 + 0xF052DF + + + STARTIE + desc STARTIE + 0 + 0 + read-write + + + SLADDR0IE + desc SLADDR0IE + 1 + 1 + read-write + + + SLADDR1IE + desc SLADDR1IE + 2 + 2 + read-write + + + TENDIE + desc TENDIE + 3 + 3 + read-write + + + STOPIE + desc STOPIE + 4 + 4 + read-write + + + RFULLIE + desc RFULLIE + 6 + 6 + read-write + + + TEMPTYIE + desc TEMPTYIE + 7 + 7 + read-write + + + ARLOIE + desc ARLOIE + 9 + 9 + read-write + + + NACKIE + desc NACKIE + 12 + 12 + read-write + + + TMOUTIE + desc TMOUTIE + 14 + 14 + read-write + + + GENCALLIE + desc GENCALLIE + 20 + 20 + read-write + + + SMBDEFAULTIE + desc SMBDEFAULTIE + 21 + 21 + read-write + + + SMHOSTIE + desc SMHOSTIE + 22 + 22 + read-write + + + SMBALRTIE + desc SMBALRTIE + 23 + 23 + read-write + + + + + CR3 + desc CR3 + 0x8 + 32 + read-write + 0x6 + 0x87 + + + TMOUTEN + desc TMOUTEN + 0 + 0 + read-write + + + LTMOUT + desc LTMOUT + 1 + 1 + read-write + + + HTMOUT + desc HTMOUT + 2 + 2 + read-write + + + FACKEN + desc FACKEN + 7 + 7 + read-write + + + + + SLR0 + desc SLR0 + 0x10 + 32 + read-write + 0x1000 + 0x93FF + + + SLADDR0 + desc SLADDR0 + 9 + 0 + read-write + + + SLADDR0EN + desc SLADDR0EN + 12 + 12 + read-write + + + ADDRMOD0 + desc ADDRMOD0 + 15 + 15 + read-write + + + + + SLR1 + desc SLR1 + 0x14 + 32 + read-write + 0x0 + 0x93FF + + + SLADDR1 + desc SLADDR1 + 9 + 0 + read-write + + + SLADDR1EN + desc SLADDR1EN + 12 + 12 + read-write + + + ADDRMOD1 + desc ADDRMOD1 + 15 + 15 + read-write + + + + + SLTR + desc SLTR + 0x18 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + TOUTLOW + desc TOUTLOW + 15 + 0 + read-write + + + TOUTHIGH + desc TOUTHIGH + 31 + 16 + read-write + + + + + SR + desc SR + 0x1C + 32 + read-write + 0x0 + 0xF756DF + + + STARTF + desc STARTF + 0 + 0 + read-write + + + SLADDR0F + desc SLADDR0F + 1 + 1 + read-write + + + SLADDR1F + desc SLADDR1F + 2 + 2 + read-write + + + TENDF + desc TENDF + 3 + 3 + read-write + + + STOPF + desc STOPF + 4 + 4 + read-write + + + RFULLF + desc RFULLF + 6 + 6 + read-write + + + TEMPTYF + desc TEMPTYF + 7 + 7 + read-write + + + ARLOF + desc ARLOF + 9 + 9 + read-write + + + ACKRF + desc ACKRF + 10 + 10 + read-write + + + NACKF + desc NACKF + 12 + 12 + read-write + + + TMOUTF + desc TMOUTF + 14 + 14 + read-write + + + MSL + desc MSL + 16 + 16 + read-write + + + BUSY + desc BUSY + 17 + 17 + read-write + + + TRA + desc TRA + 18 + 18 + read-write + + + GENCALLF + desc GENCALLF + 20 + 20 + read-write + + + SMBDEFAULTF + desc SMBDEFAULTF + 21 + 21 + read-write + + + SMBHOSTF + desc SMBHOSTF + 22 + 22 + read-write + + + SMBALRTF + desc SMBALRTF + 23 + 23 + read-write + + + + + CLR + desc CLR + 0x20 + 32 + write-only + 0x0 + 0xF052DF + + + STARTFCLR + desc STARTFCLR + 0 + 0 + write-only + + + SLADDR0FCLR + desc SLADDR0FCLR + 1 + 1 + write-only + + + SLADDR1FCLR + desc SLADDR1FCLR + 2 + 2 + write-only + + + TENDFCLR + desc TENDFCLR + 3 + 3 + write-only + + + STOPFCLR + desc STOPFCLR + 4 + 4 + write-only + + + RFULLFCLR + desc RFULLFCLR + 6 + 6 + write-only + + + TEMPTYFCLR + desc TEMPTYFCLR + 7 + 7 + write-only + + + ARLOFCLR + desc ARLOFCLR + 9 + 9 + write-only + + + NACKFCLR + desc NACKFCLR + 12 + 12 + write-only + + + TMOUTFCLR + desc TMOUTFCLR + 14 + 14 + write-only + + + GENCALLFCLR + desc GENCALLFCLR + 20 + 20 + write-only + + + SMBDEFAULTFCLR + desc SMBDEFAULTFCLR + 21 + 21 + write-only + + + SMBHOSTFCLR + desc SMBHOSTFCLR + 22 + 22 + write-only + + + SMBALRTFCLR + desc SMBALRTFCLR + 23 + 23 + write-only + + + + + DTR + desc DTR + 0x24 + 32 + write-only + 0xFF + 0xFF + + + DT + desc DT + 7 + 0 + write-only + + + + + DRR + desc DRR + 0x28 + 32 + read-only + 0x0 + 0xFF + + + DR + desc DR + 7 + 0 + read-only + + + + + CCR + desc CCR + 0x2C + 32 + read-write + 0x1F1F + 0x71F1F + + + SLOWW + desc SLOWW + 4 + 0 + read-write + + + SHIGHW + desc SHIGHW + 12 + 8 + read-write + + + FREQ + desc FREQ + 18 + 16 + read-write + + + + + FLTR + desc FLTR + 0x30 + 32 + read-write + 0x10 + 0x33 + + + DNF + desc DNF + 1 + 0 + read-write + + + DNFEN + desc DNFEN + 4 + 4 + read-write + + + ANFEN + desc ANFEN + 5 + 5 + read-write + + + + + + + I2C5 + desc I2C5 + 0x4004F000 + + 0x0 + 0x34 + + + + CR1 + desc CR1 + 0x0 + 32 + read-write + 0x40 + 0x87DF + + + PE + desc PE + 0 + 0 + read-write + + + SMBUS + desc SMBUS + 1 + 1 + read-write + + + SMBALRTEN + desc SMBALRTEN + 2 + 2 + read-write + + + SMBDEFAULTEN + desc SMBDEFAULTEN + 3 + 3 + read-write + + + SMBHOSTEN + desc SMBHOSTEN + 4 + 4 + read-write + + + ENGC + desc ENGC + 6 + 6 + read-write + + + RESTART + desc RESTART + 7 + 7 + read-write + + + START + desc START + 8 + 8 + read-write + + + STOP + desc STOP + 9 + 9 + read-write + + + ACK + desc ACK + 10 + 10 + read-write + + + SWRST + desc SWRST + 15 + 15 + read-write + + + + + CR2 + desc CR2 + 0x4 + 32 + read-write + 0x0 + 0xF052DF + + + STARTIE + desc STARTIE + 0 + 0 + read-write + + + SLADDR0IE + desc SLADDR0IE + 1 + 1 + read-write + + + SLADDR1IE + desc SLADDR1IE + 2 + 2 + read-write + + + TENDIE + desc TENDIE + 3 + 3 + read-write + + + STOPIE + desc STOPIE + 4 + 4 + read-write + + + RFULLIE + desc RFULLIE + 6 + 6 + read-write + + + TEMPTYIE + desc TEMPTYIE + 7 + 7 + read-write + + + ARLOIE + desc ARLOIE + 9 + 9 + read-write + + + NACKIE + desc NACKIE + 12 + 12 + read-write + + + TMOUTIE + desc TMOUTIE + 14 + 14 + read-write + + + GENCALLIE + desc GENCALLIE + 20 + 20 + read-write + + + SMBDEFAULTIE + desc SMBDEFAULTIE + 21 + 21 + read-write + + + SMHOSTIE + desc SMHOSTIE + 22 + 22 + read-write + + + SMBALRTIE + desc SMBALRTIE + 23 + 23 + read-write + + + + + CR3 + desc CR3 + 0x8 + 32 + read-write + 0x6 + 0x87 + + + TMOUTEN + desc TMOUTEN + 0 + 0 + read-write + + + LTMOUT + desc LTMOUT + 1 + 1 + read-write + + + HTMOUT + desc HTMOUT + 2 + 2 + read-write + + + FACKEN + desc FACKEN + 7 + 7 + read-write + + + + + SLR0 + desc SLR0 + 0x10 + 32 + read-write + 0x1000 + 0x93FF + + + SLADDR0 + desc SLADDR0 + 9 + 0 + read-write + + + SLADDR0EN + desc SLADDR0EN + 12 + 12 + read-write + + + ADDRMOD0 + desc ADDRMOD0 + 15 + 15 + read-write + + + + + SLR1 + desc SLR1 + 0x14 + 32 + read-write + 0x0 + 0x93FF + + + SLADDR1 + desc SLADDR1 + 9 + 0 + read-write + + + SLADDR1EN + desc SLADDR1EN + 12 + 12 + read-write + + + ADDRMOD1 + desc ADDRMOD1 + 15 + 15 + read-write + + + + + SLTR + desc SLTR + 0x18 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + TOUTLOW + desc TOUTLOW + 15 + 0 + read-write + + + TOUTHIGH + desc TOUTHIGH + 31 + 16 + read-write + + + + + SR + desc SR + 0x1C + 32 + read-write + 0x0 + 0xF756DF + + + STARTF + desc STARTF + 0 + 0 + read-write + + + SLADDR0F + desc SLADDR0F + 1 + 1 + read-write + + + SLADDR1F + desc SLADDR1F + 2 + 2 + read-write + + + TENDF + desc TENDF + 3 + 3 + read-write + + + STOPF + desc STOPF + 4 + 4 + read-write + + + RFULLF + desc RFULLF + 6 + 6 + read-write + + + TEMPTYF + desc TEMPTYF + 7 + 7 + read-write + + + ARLOF + desc ARLOF + 9 + 9 + read-write + + + ACKRF + desc ACKRF + 10 + 10 + read-write + + + NACKF + desc NACKF + 12 + 12 + read-write + + + TMOUTF + desc TMOUTF + 14 + 14 + read-write + + + MSL + desc MSL + 16 + 16 + read-write + + + BUSY + desc BUSY + 17 + 17 + read-write + + + TRA + desc TRA + 18 + 18 + read-write + + + GENCALLF + desc GENCALLF + 20 + 20 + read-write + + + SMBDEFAULTF + desc SMBDEFAULTF + 21 + 21 + read-write + + + SMBHOSTF + desc SMBHOSTF + 22 + 22 + read-write + + + SMBALRTF + desc SMBALRTF + 23 + 23 + read-write + + + + + CLR + desc CLR + 0x20 + 32 + write-only + 0x0 + 0xF052DF + + + STARTFCLR + desc STARTFCLR + 0 + 0 + write-only + + + SLADDR0FCLR + desc SLADDR0FCLR + 1 + 1 + write-only + + + SLADDR1FCLR + desc SLADDR1FCLR + 2 + 2 + write-only + + + TENDFCLR + desc TENDFCLR + 3 + 3 + write-only + + + STOPFCLR + desc STOPFCLR + 4 + 4 + write-only + + + RFULLFCLR + desc RFULLFCLR + 6 + 6 + write-only + + + TEMPTYFCLR + desc TEMPTYFCLR + 7 + 7 + write-only + + + ARLOFCLR + desc ARLOFCLR + 9 + 9 + write-only + + + NACKFCLR + desc NACKFCLR + 12 + 12 + write-only + + + TMOUTFCLR + desc TMOUTFCLR + 14 + 14 + write-only + + + GENCALLFCLR + desc GENCALLFCLR + 20 + 20 + write-only + + + SMBDEFAULTFCLR + desc SMBDEFAULTFCLR + 21 + 21 + write-only + + + SMBHOSTFCLR + desc SMBHOSTFCLR + 22 + 22 + write-only + + + SMBALRTFCLR + desc SMBALRTFCLR + 23 + 23 + write-only + + + + + DTR + desc DTR + 0x24 + 32 + write-only + 0xFF + 0xFF + + + DT + desc DT + 7 + 0 + write-only + + + + + DRR + desc DRR + 0x28 + 32 + read-only + 0x0 + 0xFF + + + DR + desc DR + 7 + 0 + read-only + + + + + CCR + desc CCR + 0x2C + 32 + read-write + 0x1F1F + 0x71F1F + + + SLOWW + desc SLOWW + 4 + 0 + read-write + + + SHIGHW + desc SHIGHW + 12 + 8 + read-write + + + FREQ + desc FREQ + 18 + 16 + read-write + + + + + FLTR + desc FLTR + 0x30 + 32 + read-write + 0x10 + 0x33 + + + DNF + desc DNF + 1 + 0 + read-write + + + DNFEN + desc DNFEN + 4 + 4 + read-write + + + ANFEN + desc ANFEN + 5 + 5 + read-write + + + + + + + I2C6 + desc I2C6 + 0x4004F800 + + 0x0 + 0x34 + + + + CR1 + desc CR1 + 0x0 + 32 + read-write + 0x40 + 0x87DF + + + PE + desc PE + 0 + 0 + read-write + + + SMBUS + desc SMBUS + 1 + 1 + read-write + + + SMBALRTEN + desc SMBALRTEN + 2 + 2 + read-write + + + SMBDEFAULTEN + desc SMBDEFAULTEN + 3 + 3 + read-write + + + SMBHOSTEN + desc SMBHOSTEN + 4 + 4 + read-write + + + ENGC + desc ENGC + 6 + 6 + read-write + + + RESTART + desc RESTART + 7 + 7 + read-write + + + START + desc START + 8 + 8 + read-write + + + STOP + desc STOP + 9 + 9 + read-write + + + ACK + desc ACK + 10 + 10 + read-write + + + SWRST + desc SWRST + 15 + 15 + read-write + + + + + CR2 + desc CR2 + 0x4 + 32 + read-write + 0x0 + 0xF052DF + + + STARTIE + desc STARTIE + 0 + 0 + read-write + + + SLADDR0IE + desc SLADDR0IE + 1 + 1 + read-write + + + SLADDR1IE + desc SLADDR1IE + 2 + 2 + read-write + + + TENDIE + desc TENDIE + 3 + 3 + read-write + + + STOPIE + desc STOPIE + 4 + 4 + read-write + + + RFULLIE + desc RFULLIE + 6 + 6 + read-write + + + TEMPTYIE + desc TEMPTYIE + 7 + 7 + read-write + + + ARLOIE + desc ARLOIE + 9 + 9 + read-write + + + NACKIE + desc NACKIE + 12 + 12 + read-write + + + TMOUTIE + desc TMOUTIE + 14 + 14 + read-write + + + GENCALLIE + desc GENCALLIE + 20 + 20 + read-write + + + SMBDEFAULTIE + desc SMBDEFAULTIE + 21 + 21 + read-write + + + SMHOSTIE + desc SMHOSTIE + 22 + 22 + read-write + + + SMBALRTIE + desc SMBALRTIE + 23 + 23 + read-write + + + + + CR3 + desc CR3 + 0x8 + 32 + read-write + 0x6 + 0x87 + + + TMOUTEN + desc TMOUTEN + 0 + 0 + read-write + + + LTMOUT + desc LTMOUT + 1 + 1 + read-write + + + HTMOUT + desc HTMOUT + 2 + 2 + read-write + + + FACKEN + desc FACKEN + 7 + 7 + read-write + + + + + SLR0 + desc SLR0 + 0x10 + 32 + read-write + 0x1000 + 0x93FF + + + SLADDR0 + desc SLADDR0 + 9 + 0 + read-write + + + SLADDR0EN + desc SLADDR0EN + 12 + 12 + read-write + + + ADDRMOD0 + desc ADDRMOD0 + 15 + 15 + read-write + + + + + SLR1 + desc SLR1 + 0x14 + 32 + read-write + 0x0 + 0x93FF + + + SLADDR1 + desc SLADDR1 + 9 + 0 + read-write + + + SLADDR1EN + desc SLADDR1EN + 12 + 12 + read-write + + + ADDRMOD1 + desc ADDRMOD1 + 15 + 15 + read-write + + + + + SLTR + desc SLTR + 0x18 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + TOUTLOW + desc TOUTLOW + 15 + 0 + read-write + + + TOUTHIGH + desc TOUTHIGH + 31 + 16 + read-write + + + + + SR + desc SR + 0x1C + 32 + read-write + 0x0 + 0xF756DF + + + STARTF + desc STARTF + 0 + 0 + read-write + + + SLADDR0F + desc SLADDR0F + 1 + 1 + read-write + + + SLADDR1F + desc SLADDR1F + 2 + 2 + read-write + + + TENDF + desc TENDF + 3 + 3 + read-write + + + STOPF + desc STOPF + 4 + 4 + read-write + + + RFULLF + desc RFULLF + 6 + 6 + read-write + + + TEMPTYF + desc TEMPTYF + 7 + 7 + read-write + + + ARLOF + desc ARLOF + 9 + 9 + read-write + + + ACKRF + desc ACKRF + 10 + 10 + read-write + + + NACKF + desc NACKF + 12 + 12 + read-write + + + TMOUTF + desc TMOUTF + 14 + 14 + read-write + + + MSL + desc MSL + 16 + 16 + read-write + + + BUSY + desc BUSY + 17 + 17 + read-write + + + TRA + desc TRA + 18 + 18 + read-write + + + GENCALLF + desc GENCALLF + 20 + 20 + read-write + + + SMBDEFAULTF + desc SMBDEFAULTF + 21 + 21 + read-write + + + SMBHOSTF + desc SMBHOSTF + 22 + 22 + read-write + + + SMBALRTF + desc SMBALRTF + 23 + 23 + read-write + + + + + CLR + desc CLR + 0x20 + 32 + write-only + 0x0 + 0xF052DF + + + STARTFCLR + desc STARTFCLR + 0 + 0 + write-only + + + SLADDR0FCLR + desc SLADDR0FCLR + 1 + 1 + write-only + + + SLADDR1FCLR + desc SLADDR1FCLR + 2 + 2 + write-only + + + TENDFCLR + desc TENDFCLR + 3 + 3 + write-only + + + STOPFCLR + desc STOPFCLR + 4 + 4 + write-only + + + RFULLFCLR + desc RFULLFCLR + 6 + 6 + write-only + + + TEMPTYFCLR + desc TEMPTYFCLR + 7 + 7 + write-only + + + ARLOFCLR + desc ARLOFCLR + 9 + 9 + write-only + + + NACKFCLR + desc NACKFCLR + 12 + 12 + write-only + + + TMOUTFCLR + desc TMOUTFCLR + 14 + 14 + write-only + + + GENCALLFCLR + desc GENCALLFCLR + 20 + 20 + write-only + + + SMBDEFAULTFCLR + desc SMBDEFAULTFCLR + 21 + 21 + write-only + + + SMBHOSTFCLR + desc SMBHOSTFCLR + 22 + 22 + write-only + + + SMBALRTFCLR + desc SMBALRTFCLR + 23 + 23 + write-only + + + + + DTR + desc DTR + 0x24 + 32 + write-only + 0xFF + 0xFF + + + DT + desc DT + 7 + 0 + write-only + + + + + DRR + desc DRR + 0x28 + 32 + read-only + 0x0 + 0xFF + + + DR + desc DR + 7 + 0 + read-only + + + + + CCR + desc CCR + 0x2C + 32 + read-write + 0x1F1F + 0x71F1F + + + SLOWW + desc SLOWW + 4 + 0 + read-write + + + SHIGHW + desc SHIGHW + 12 + 8 + read-write + + + FREQ + desc FREQ + 18 + 16 + read-write + + + + + FLTR + desc FLTR + 0x30 + 32 + read-write + 0x10 + 0x33 + + + DNF + desc DNF + 1 + 0 + read-write + + + DNFEN + desc DNFEN + 4 + 4 + read-write + + + ANFEN + desc ANFEN + 5 + 5 + read-write + + + + + + + I2S1 + desc I2S + 0x4001E000 + + 0x0 + 0x1C + + + + CTRL + desc CTRL + 0x0 + 32 + read-write + 0x2200 + 0x1FF77FF + + + TXE + desc TXE + 0 + 0 + read-write + + + TXIE + desc TXIE + 1 + 1 + read-write + + + RXE + desc RXE + 2 + 2 + read-write + + + RXIE + desc RXIE + 3 + 3 + read-write + + + EIE + desc EIE + 4 + 4 + read-write + + + WMS + desc WMS + 5 + 5 + read-write + + + ODD + desc ODD + 6 + 6 + read-write + + + MCKOE + desc MCKOE + 7 + 7 + read-write + + + TXBIRQWL + desc TXBIRQWL + 10 + 8 + read-write + + + RXBIRQWL + desc RXBIRQWL + 14 + 12 + read-write + + + FIFOR + desc FIFOR + 16 + 16 + read-write + + + CODECRC + desc CODECRC + 17 + 17 + read-write + + + I2SPLLSEL + desc I2SPLLSEL + 18 + 18 + read-write + + + SDOE + desc SDOE + 19 + 19 + read-write + + + LRCKOE + desc LRCKOE + 20 + 20 + read-write + + + CKOE + desc CKOE + 21 + 21 + read-write + + + DUPLEX + desc DUPLEX + 22 + 22 + read-write + + + CLKSEL + desc CLKSEL + 23 + 23 + read-write + + + SRST + desc SRST + 24 + 24 + read-write + + + + + SR + desc SR + 0x4 + 32 + read-only + 0x14 + 0x3F + + + TXBA + desc TXBA + 0 + 0 + read-only + + + RXBA + desc RXBA + 1 + 1 + read-only + + + TXBE + desc TXBE + 2 + 2 + read-only + + + TXBF + desc TXBF + 3 + 3 + read-only + + + RXBE + desc RXBE + 4 + 4 + read-only + + + RXBF + desc RXBF + 5 + 5 + read-only + + + + + ER + desc ER + 0x8 + 32 + read-write + 0x0 + 0x3 + + + TXERR + desc TXERR + 0 + 0 + read-write + + + RXERR + desc RXERR + 1 + 1 + read-write + + + + + CFGR + desc CFGR + 0xC + 32 + read-write + 0x0 + 0x3F + + + I2SSTD + desc I2SSTD + 1 + 0 + read-write + + + DATLEN + desc DATLEN + 3 + 2 + read-write + + + CHLEN + desc CHLEN + 4 + 4 + read-write + + + PCMSYNC + desc PCMSYNC + 5 + 5 + read-write + + + + + TXBUF + desc TXBUF + 0x10 + 32 + write-only + 0x0 + 0xFFFFFFFF + + + RXBUF + desc RXBUF + 0x14 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + PR + desc PR + 0x18 + 32 + read-write + 0x2 + 0xFF + + + I2SDIV + desc I2SDIV + 7 + 0 + read-write + + + + + + + I2S2 + desc I2S2 + 0x4001E400 + + 0x0 + 0x1C + + + + CTRL + desc CTRL + 0x0 + 32 + read-write + 0x2200 + 0x1FF77FF + + + TXE + desc TXE + 0 + 0 + read-write + + + TXIE + desc TXIE + 1 + 1 + read-write + + + RXE + desc RXE + 2 + 2 + read-write + + + RXIE + desc RXIE + 3 + 3 + read-write + + + EIE + desc EIE + 4 + 4 + read-write + + + WMS + desc WMS + 5 + 5 + read-write + + + ODD + desc ODD + 6 + 6 + read-write + + + MCKOE + desc MCKOE + 7 + 7 + read-write + + + TXBIRQWL + desc TXBIRQWL + 10 + 8 + read-write + + + RXBIRQWL + desc RXBIRQWL + 14 + 12 + read-write + + + FIFOR + desc FIFOR + 16 + 16 + read-write + + + CODECRC + desc CODECRC + 17 + 17 + read-write + + + I2SPLLSEL + desc I2SPLLSEL + 18 + 18 + read-write + + + SDOE + desc SDOE + 19 + 19 + read-write + + + LRCKOE + desc LRCKOE + 20 + 20 + read-write + + + CKOE + desc CKOE + 21 + 21 + read-write + + + DUPLEX + desc DUPLEX + 22 + 22 + read-write + + + CLKSEL + desc CLKSEL + 23 + 23 + read-write + + + SRST + desc SRST + 24 + 24 + read-write + + + + + SR + desc SR + 0x4 + 32 + read-only + 0x14 + 0x3F + + + TXBA + desc TXBA + 0 + 0 + read-only + + + RXBA + desc RXBA + 1 + 1 + read-only + + + TXBE + desc TXBE + 2 + 2 + read-only + + + TXBUF + desc TXBUF + 3 + 3 + read-only + + + RXBE + desc RXBE + 4 + 4 + read-only + + + RXBUF + desc RXBUF + 5 + 5 + read-only + + + + + ER + desc ER + 0x8 + 32 + read-write + 0x0 + 0x3 + + + TXERR + desc TXERR + 0 + 0 + read-write + + + RXERR + desc RXERR + 1 + 1 + read-write + + + + + CFGR + desc CFGR + 0xC + 32 + read-write + 0x0 + 0x3F + + + I2SSTD + desc I2SSTD + 1 + 0 + read-write + + + DATLEN + desc DATLEN + 3 + 2 + read-write + + + CHLEN + desc CHLEN + 4 + 4 + read-write + + + PCMSYNC + desc PCMSYNC + 5 + 5 + read-write + + + + + TXBUF + desc TXBUF + 0x10 + 32 + write-only + 0x0 + 0xFFFFFFFF + + + RXBUF + desc RXBUF + 0x14 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + PR + desc PR + 0x18 + 32 + read-write + 0x2 + 0xFF + + + I2SDIV + desc I2SDIV + 7 + 0 + read-write + + + + + + + I2S3 + desc I2S3 + 0x40022000 + + 0x0 + 0x1C + + + + CTRL + desc CTRL + 0x0 + 32 + read-write + 0x2200 + 0x1FF77FF + + + TXE + desc TXE + 0 + 0 + read-write + + + TXIE + desc TXIE + 1 + 1 + read-write + + + RXE + desc RXE + 2 + 2 + read-write + + + RXIE + desc RXIE + 3 + 3 + read-write + + + EIE + desc EIE + 4 + 4 + read-write + + + WMS + desc WMS + 5 + 5 + read-write + + + ODD + desc ODD + 6 + 6 + read-write + + + MCKOE + desc MCKOE + 7 + 7 + read-write + + + TXBIRQWL + desc TXBIRQWL + 10 + 8 + read-write + + + RXBIRQWL + desc RXBIRQWL + 14 + 12 + read-write + + + FIFOR + desc FIFOR + 16 + 16 + read-write + + + CODECRC + desc CODECRC + 17 + 17 + read-write + + + I2SPLLSEL + desc I2SPLLSEL + 18 + 18 + read-write + + + SDOE + desc SDOE + 19 + 19 + read-write + + + LRCKOE + desc LRCKOE + 20 + 20 + read-write + + + CKOE + desc CKOE + 21 + 21 + read-write + + + DUPLEX + desc DUPLEX + 22 + 22 + read-write + + + CLKSEL + desc CLKSEL + 23 + 23 + read-write + + + SRST + desc SRST + 24 + 24 + read-write + + + + + SR + desc SR + 0x4 + 32 + read-only + 0x14 + 0x3F + + + TXBA + desc TXBA + 0 + 0 + read-only + + + RXBA + desc RXBA + 1 + 1 + read-only + + + TXBE + desc TXBE + 2 + 2 + read-only + + + TXBUF + desc TXBUF + 3 + 3 + read-only + + + RXBE + desc RXBE + 4 + 4 + read-only + + + RXBUF + desc RXBUF + 5 + 5 + read-only + + + + + ER + desc ER + 0x8 + 32 + read-write + 0x0 + 0x3 + + + TXERR + desc TXERR + 0 + 0 + read-write + + + RXERR + desc RXERR + 1 + 1 + read-write + + + + + CFGR + desc CFGR + 0xC + 32 + read-write + 0x0 + 0x3F + + + I2SSTD + desc I2SSTD + 1 + 0 + read-write + + + DATLEN + desc DATLEN + 3 + 2 + read-write + + + CHLEN + desc CHLEN + 4 + 4 + read-write + + + PCMSYNC + desc PCMSYNC + 5 + 5 + read-write + + + + + TXBUF + desc TXBUF + 0x10 + 32 + write-only + 0x0 + 0xFFFFFFFF + + + RXBUF + desc RXBUF + 0x14 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + PR + desc PR + 0x18 + 32 + read-write + 0x2 + 0xFF + + + I2SDIV + desc I2SDIV + 7 + 0 + read-write + + + + + + + I2S4 + desc I2S4 + 0x40022400 + + 0x0 + 0x1C + + + + CTRL + desc CTRL + 0x0 + 32 + read-write + 0x2200 + 0x1FF77FF + + + TXE + desc TXE + 0 + 0 + read-write + + + TXIE + desc TXIE + 1 + 1 + read-write + + + RXE + desc RXE + 2 + 2 + read-write + + + RXIE + desc RXIE + 3 + 3 + read-write + + + EIE + desc EIE + 4 + 4 + read-write + + + WMS + desc WMS + 5 + 5 + read-write + + + ODD + desc ODD + 6 + 6 + read-write + + + MCKOE + desc MCKOE + 7 + 7 + read-write + + + TXBIRQWL + desc TXBIRQWL + 10 + 8 + read-write + + + RXBIRQWL + desc RXBIRQWL + 14 + 12 + read-write + + + FIFOR + desc FIFOR + 16 + 16 + read-write + + + CODECRC + desc CODECRC + 17 + 17 + read-write + + + I2SPLLSEL + desc I2SPLLSEL + 18 + 18 + read-write + + + SDOE + desc SDOE + 19 + 19 + read-write + + + LRCKOE + desc LRCKOE + 20 + 20 + read-write + + + CKOE + desc CKOE + 21 + 21 + read-write + + + DUPLEX + desc DUPLEX + 22 + 22 + read-write + + + CLKSEL + desc CLKSEL + 23 + 23 + read-write + + + SRST + desc SRST + 24 + 24 + read-write + + + + + SR + desc SR + 0x4 + 32 + read-only + 0x14 + 0x3F + + + TXBA + desc TXBA + 0 + 0 + read-only + + + RXBA + desc RXBA + 1 + 1 + read-only + + + TXBE + desc TXBE + 2 + 2 + read-only + + + TXBUF + desc TXBUF + 3 + 3 + read-only + + + RXBE + desc RXBE + 4 + 4 + read-only + + + RXBUF + desc RXBUF + 5 + 5 + read-only + + + + + ER + desc ER + 0x8 + 32 + read-write + 0x0 + 0x3 + + + TXERR + desc TXERR + 0 + 0 + read-write + + + RXERR + desc RXERR + 1 + 1 + read-write + + + + + CFGR + desc CFGR + 0xC + 32 + read-write + 0x0 + 0x3F + + + I2SSTD + desc I2SSTD + 1 + 0 + read-write + + + DATLEN + desc DATLEN + 3 + 2 + read-write + + + CHLEN + desc CHLEN + 4 + 4 + read-write + + + PCMSYNC + desc PCMSYNC + 5 + 5 + read-write + + + + + TXBUF + desc TXBUF + 0x10 + 32 + write-only + 0x0 + 0xFFFFFFFF + + + RXBUF + desc RXBUF + 0x14 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + PR + desc PR + 0x18 + 32 + read-write + 0x2 + 0xFF + + + I2SDIV + desc I2SDIV + 7 + 0 + read-write + + + + + + + ICG + desc ICG + 0x00000400 + + 0x0 + 0x10 + + + + ICG0 + desc ICG0 + 0x0 + 32 + read-only + 0xFFFFFFFF + 0x1FFF1FFF + + + SWDTAUTS + desc SWDTAUTS + 0 + 0 + read-only + + + SWDTITS + desc SWDTITS + 1 + 1 + read-only + + + SWDTPERI + desc SWDTPERI + 3 + 2 + read-only + + + SWDTCKS + desc SWDTCKS + 7 + 4 + read-only + + + SWDTWDPT + desc SWDTWDPT + 11 + 8 + read-only + + + SWDTSLPOFF + desc SWDTSLPOFF + 12 + 12 + read-only + + + WDTAUTS + desc WDTAUTS + 16 + 16 + read-only + + + WDTITS + desc WDTITS + 17 + 17 + read-only + + + WDTPERI + desc WDTPERI + 19 + 18 + read-only + + + WDTCKS + desc WDTCKS + 23 + 20 + read-only + + + WDTWDPT + desc WDTWDPT + 27 + 24 + read-only + + + WDTSLPOFF + desc WDTSLPOFF + 28 + 28 + read-only + + + + + ICG1 + desc ICG1 + 0x4 + 32 + read-only + 0xFFFFFFFF + 0x70101 + + + HRCFREQSEL + desc HRCFREQSEL + 0 + 0 + read-only + + + HRCSTOP + desc HRCSTOP + 8 + 8 + read-only + + + BOR_LEV + desc BOR_LEV + 17 + 16 + read-only + + + BORDIS + desc BORDIS + 18 + 18 + read-only + + + + + ICG2 + desc ICG2 + 0x8 + 32 + read-only + 0xFFFFFFFF + 0xFFFFFF + + + BGO1M + desc BGO1M + 23 + 0 + read-only + + + + + ICG3 + desc ICG3 + 0xC + 32 + read-only + 0xFFFFFFFF + 0xFFFF + + + DBUSPRT + desc DBUSPRT + 15 + 0 + read-only + + + + + + + INTC + desc INTC + 0x40051000 + + 0x0 + 0x2B4 + + + + NOCCR + desc NOCCR + 0x0 + 32 + read-write + 0x0 + 0x3000 + + + NOCSEL + desc NOCSEL + 13 + 12 + read-write + + + + + NMIENR + desc NMIENR + 0x4 + 32 + read-write + 0x0 + 0xF3E + + + SWDTENR + desc SWDTENR + 1 + 1 + read-write + + + PVD1ENR + desc PVD1ENR + 2 + 2 + read-write + + + PVD2ENR + desc PVD2ENR + 3 + 3 + read-write + + + XTAL32STPENR + desc XTAL32STPENR + 4 + 4 + read-write + + + XTALSTPENR + desc XTALSTPENR + 5 + 5 + read-write + + + REPENR + desc REPENR + 8 + 8 + read-write + + + RECCENR + desc RECCENR + 9 + 9 + read-write + + + BUSMENR + desc BUSMENR + 10 + 10 + read-write + + + WDTENR + desc WDTENR + 11 + 11 + read-write + + + + + NMIFR + desc NMIFR + 0x8 + 32 + read-write + 0x0 + 0xF3E + + + SWDTFR + desc SWDTFR + 1 + 1 + read-write + + + PVD1FR + desc PVD1FR + 2 + 2 + read-write + + + PVD2FR + desc PVD2FR + 3 + 3 + read-write + + + XTAL32STPFR + desc XTAL32STPFR + 4 + 4 + read-write + + + XTALSTPFR + desc XTALSTPFR + 5 + 5 + read-write + + + REPFR + desc REPFR + 8 + 8 + read-write + + + RECCFR + desc RECCFR + 9 + 9 + read-write + + + BUSMFR + desc BUSMFR + 10 + 10 + read-write + + + WDTFR + desc WDTFR + 11 + 11 + read-write + + + + + NMICFR + desc NMICFR + 0xC + 32 + read-write + 0x0 + 0xF3E + + + SWDTCFR + desc SWDTCFR + 1 + 1 + read-write + + + PVD1CFR + desc PVD1CFR + 2 + 2 + read-write + + + PVD2CFR + desc PVD2CFR + 3 + 3 + read-write + + + XTAL32STPCFR + desc XTAL32STPCFR + 4 + 4 + read-write + + + XTALSTPCFR + desc XTALSTPCFR + 5 + 5 + read-write + + + REPCFR + desc REPCFR + 8 + 8 + read-write + + + RECCCFR + desc RECCCFR + 9 + 9 + read-write + + + BUSMCFR + desc BUSMCFR + 10 + 10 + read-write + + + WDTCFR + desc WDTCFR + 11 + 11 + read-write + + + + + EIRQCR0 + desc EIRQCR0 + 0x10 + 32 + read-write + 0x0 + 0x80B3 + + + EIRQTRG + desc EIRQTRG + 1 + 0 + read-write + + + EISMPCLK + desc EISMPCLK + 5 + 4 + read-write + + + EFEN + desc EFEN + 7 + 7 + read-write + + + NOCEN + desc NOCEN + 15 + 15 + read-write + + + + + EIRQCR1 + desc EIRQCR1 + 0x14 + 32 + read-write + 0x0 + 0x80B3 + + + EIRQTRG + desc EIRQTRG + 1 + 0 + read-write + + + EISMPCLK + desc EISMPCLK + 5 + 4 + read-write + + + EFEN + desc EFEN + 7 + 7 + read-write + + + NOCEN + desc NOCEN + 15 + 15 + read-write + + + + + EIRQCR2 + desc EIRQCR2 + 0x18 + 32 + read-write + 0x0 + 0x80B3 + + + EIRQTRG + desc EIRQTRG + 1 + 0 + read-write + + + EISMPCLK + desc EISMPCLK + 5 + 4 + read-write + + + EFEN + desc EFEN + 7 + 7 + read-write + + + NOCEN + desc NOCEN + 15 + 15 + read-write + + + + + EIRQCR3 + desc EIRQCR3 + 0x1C + 32 + read-write + 0x0 + 0x80B3 + + + EIRQTRG + desc EIRQTRG + 1 + 0 + read-write + + + EISMPCLK + desc EISMPCLK + 5 + 4 + read-write + + + EFEN + desc EFEN + 7 + 7 + read-write + + + NOCEN + desc NOCEN + 15 + 15 + read-write + + + + + EIRQCR4 + desc EIRQCR4 + 0x20 + 32 + read-write + 0x0 + 0x80B3 + + + EIRQTRG + desc EIRQTRG + 1 + 0 + read-write + + + EISMPCLK + desc EISMPCLK + 5 + 4 + read-write + + + EFEN + desc EFEN + 7 + 7 + read-write + + + NOCEN + desc NOCEN + 15 + 15 + read-write + + + + + EIRQCR5 + desc EIRQCR5 + 0x24 + 32 + read-write + 0x0 + 0x80B3 + + + EIRQTRG + desc EIRQTRG + 1 + 0 + read-write + + + EISMPCLK + desc EISMPCLK + 5 + 4 + read-write + + + EFEN + desc EFEN + 7 + 7 + read-write + + + NOCEN + desc NOCEN + 15 + 15 + read-write + + + + + EIRQCR6 + desc EIRQCR6 + 0x28 + 32 + read-write + 0x0 + 0x80B3 + + + EIRQTRG + desc EIRQTRG + 1 + 0 + read-write + + + EISMPCLK + desc EISMPCLK + 5 + 4 + read-write + + + EFEN + desc EFEN + 7 + 7 + read-write + + + NOCEN + desc NOCEN + 15 + 15 + read-write + + + + + EIRQCR7 + desc EIRQCR7 + 0x2C + 32 + read-write + 0x0 + 0x80B3 + + + EIRQTRG + desc EIRQTRG + 1 + 0 + read-write + + + EISMPCLK + desc EISMPCLK + 5 + 4 + read-write + + + EFEN + desc EFEN + 7 + 7 + read-write + + + NOCEN + desc NOCEN + 15 + 15 + read-write + + + + + EIRQCR8 + desc EIRQCR8 + 0x30 + 32 + read-write + 0x0 + 0x80B3 + + + EIRQTRG + desc EIRQTRG + 1 + 0 + read-write + + + EISMPCLK + desc EISMPCLK + 5 + 4 + read-write + + + EFEN + desc EFEN + 7 + 7 + read-write + + + NOCEN + desc NOCEN + 15 + 15 + read-write + + + + + EIRQCR9 + desc EIRQCR9 + 0x34 + 32 + read-write + 0x0 + 0x80B3 + + + EIRQTRG + desc EIRQTRG + 1 + 0 + read-write + + + EISMPCLK + desc EISMPCLK + 5 + 4 + read-write + + + EFEN + desc EFEN + 7 + 7 + read-write + + + NOCEN + desc NOCEN + 15 + 15 + read-write + + + + + EIRQCR10 + desc EIRQCR10 + 0x38 + 32 + read-write + 0x0 + 0x80B3 + + + EIRQTRG + desc EIRQTRG + 1 + 0 + read-write + + + EISMPCLK + desc EISMPCLK + 5 + 4 + read-write + + + EFEN + desc EFEN + 7 + 7 + read-write + + + NOCEN + desc NOCEN + 15 + 15 + read-write + + + + + EIRQCR11 + desc EIRQCR11 + 0x3C + 32 + read-write + 0x0 + 0x80B3 + + + EIRQTRG + desc EIRQTRG + 1 + 0 + read-write + + + EISMPCLK + desc EISMPCLK + 5 + 4 + read-write + + + EFEN + desc EFEN + 7 + 7 + read-write + + + NOCEN + desc NOCEN + 15 + 15 + read-write + + + + + EIRQCR12 + desc EIRQCR12 + 0x40 + 32 + read-write + 0x0 + 0x80B3 + + + EIRQTRG + desc EIRQTRG + 1 + 0 + read-write + + + EISMPCLK + desc EISMPCLK + 5 + 4 + read-write + + + EFEN + desc EFEN + 7 + 7 + read-write + + + NOCEN + desc NOCEN + 15 + 15 + read-write + + + + + EIRQCR13 + desc EIRQCR13 + 0x44 + 32 + read-write + 0x0 + 0x80B3 + + + EIRQTRG + desc EIRQTRG + 1 + 0 + read-write + + + EISMPCLK + desc EISMPCLK + 5 + 4 + read-write + + + EFEN + desc EFEN + 7 + 7 + read-write + + + NOCEN + desc NOCEN + 15 + 15 + read-write + + + + + EIRQCR14 + desc EIRQCR14 + 0x48 + 32 + read-write + 0x0 + 0x80B3 + + + EIRQTRG + desc EIRQTRG + 1 + 0 + read-write + + + EISMPCLK + desc EISMPCLK + 5 + 4 + read-write + + + EFEN + desc EFEN + 7 + 7 + read-write + + + NOCEN + desc NOCEN + 15 + 15 + read-write + + + + + EIRQCR15 + desc EIRQCR15 + 0x4C + 32 + read-write + 0x0 + 0x80B3 + + + EIRQTRG + desc EIRQTRG + 1 + 0 + read-write + + + EISMPCLK + desc EISMPCLK + 5 + 4 + read-write + + + EFEN + desc EFEN + 7 + 7 + read-write + + + NOCEN + desc NOCEN + 15 + 15 + read-write + + + + + WUPEN + desc WUPEN + 0x50 + 32 + read-write + 0x0 + 0x3FFFFFFF + + + EIRQWUEN + desc EIRQWUEN + 15 + 0 + read-write + + + SWDTWUEN + desc SWDTWUEN + 16 + 16 + read-write + + + PVD1WUEN + desc PVD1WUEN + 17 + 17 + read-write + + + PVD2WUEN + desc PVD2WUEN + 18 + 18 + read-write + + + CMPWUEN + desc CMPWUEN + 19 + 19 + read-write + + + WKTMWUEN + desc WKTMWUEN + 20 + 20 + read-write + + + RTCALMWUEN + desc RTCALMWUEN + 21 + 21 + read-write + + + RTCPRDWUEN + desc RTCPRDWUEN + 22 + 22 + read-write + + + TMR0GCMWUEN + desc TMR0GCMWUEN + 23 + 23 + read-write + + + TMR2GCMWUEN + desc TMR2GCMWUEN + 24 + 24 + read-write + + + TMR2OVFWUEN + desc TMR2OVFWUEN + 25 + 25 + read-write + + + RXWUEN + desc RXWUEN + 26 + 26 + read-write + + + USHWUEN + desc USHWUEN + 27 + 27 + read-write + + + USFWUEN + desc USFWUEN + 28 + 28 + read-write + + + ETHWUEN + desc ETHWUEN + 29 + 29 + read-write + + + + + EIFR + desc EIFR + 0x54 + 32 + read-write + 0x0 + 0xFFFF + + + EIFR0 + desc EIFR0 + 0 + 0 + read-write + + + EIFR1 + desc EIFR1 + 1 + 1 + read-write + + + EIFR2 + desc EIFR2 + 2 + 2 + read-write + + + EIFR3 + desc EIFR3 + 3 + 3 + read-write + + + EIFR4 + desc EIFR4 + 4 + 4 + read-write + + + EIFR5 + desc EIFR5 + 5 + 5 + read-write + + + EIFR6 + desc EIFR6 + 6 + 6 + read-write + + + EIFR7 + desc EIFR7 + 7 + 7 + read-write + + + EIFR8 + desc EIFR8 + 8 + 8 + read-write + + + EIFR9 + desc EIFR9 + 9 + 9 + read-write + + + EIFR10 + desc EIFR10 + 10 + 10 + read-write + + + EIFR11 + desc EIFR11 + 11 + 11 + read-write + + + EIFR12 + desc EIFR12 + 12 + 12 + read-write + + + EIFR13 + desc EIFR13 + 13 + 13 + read-write + + + EIFR14 + desc EIFR14 + 14 + 14 + read-write + + + EIFR15 + desc EIFR15 + 15 + 15 + read-write + + + + + EICFR + desc EICFR + 0x58 + 32 + read-write + 0x0 + 0xFFFF + + + EICFR0 + desc EICFR0 + 0 + 0 + read-write + + + EICFR1 + desc EICFR1 + 1 + 1 + read-write + + + EICFR2 + desc EICFR2 + 2 + 2 + read-write + + + EICFR3 + desc EICFR3 + 3 + 3 + read-write + + + EICFR4 + desc EICFR4 + 4 + 4 + read-write + + + EICFR5 + desc EICFR5 + 5 + 5 + read-write + + + EICFR6 + desc EICFR6 + 6 + 6 + read-write + + + EICFR7 + desc EICFR7 + 7 + 7 + read-write + + + EICFR8 + desc EICFR8 + 8 + 8 + read-write + + + EICFR9 + desc EICFR9 + 9 + 9 + read-write + + + EICFR10 + desc EICFR10 + 10 + 10 + read-write + + + EICFR11 + desc EICFR11 + 11 + 11 + read-write + + + EICFR12 + desc EICFR12 + 12 + 12 + read-write + + + EICFR13 + desc EICFR13 + 13 + 13 + read-write + + + EICFR14 + desc EICFR14 + 14 + 14 + read-write + + + EICFR15 + desc EICFR15 + 15 + 15 + read-write + + + + + SEL0 + desc SEL0 + 0x5C + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL1 + desc SEL1 + 0x60 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL2 + desc SEL2 + 0x64 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL3 + desc SEL3 + 0x68 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL4 + desc SEL4 + 0x6C + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL5 + desc SEL5 + 0x70 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL6 + desc SEL6 + 0x74 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL7 + desc SEL7 + 0x78 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL8 + desc SEL8 + 0x7C + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL9 + desc SEL9 + 0x80 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL10 + desc SEL10 + 0x84 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL11 + desc SEL11 + 0x88 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL12 + desc SEL12 + 0x8C + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL13 + desc SEL13 + 0x90 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL14 + desc SEL14 + 0x94 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL15 + desc SEL15 + 0x98 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL16 + desc SEL16 + 0x9C + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL17 + desc SEL17 + 0xA0 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL18 + desc SEL18 + 0xA4 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL19 + desc SEL19 + 0xA8 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL20 + desc SEL20 + 0xAC + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL21 + desc SEL21 + 0xB0 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL22 + desc SEL22 + 0xB4 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL23 + desc SEL23 + 0xB8 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL24 + desc SEL24 + 0xBC + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL25 + desc SEL25 + 0xC0 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL26 + desc SEL26 + 0xC4 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL27 + desc SEL27 + 0xC8 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL28 + desc SEL28 + 0xCC + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL29 + desc SEL29 + 0xD0 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL30 + desc SEL30 + 0xD4 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL31 + desc SEL31 + 0xD8 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL32 + desc SEL32 + 0xDC + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL33 + desc SEL33 + 0xE0 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL34 + desc SEL34 + 0xE4 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL35 + desc SEL35 + 0xE8 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL36 + desc SEL36 + 0xEC + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL37 + desc SEL37 + 0xF0 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL38 + desc SEL38 + 0xF4 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL39 + desc SEL39 + 0xF8 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL40 + desc SEL40 + 0xFC + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL41 + desc SEL41 + 0x100 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL42 + desc SEL42 + 0x104 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL43 + desc SEL43 + 0x108 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL44 + desc SEL44 + 0x10C + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL45 + desc SEL45 + 0x110 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL46 + desc SEL46 + 0x114 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL47 + desc SEL47 + 0x118 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL48 + desc SEL48 + 0x11C + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL49 + desc SEL49 + 0x120 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL50 + desc SEL50 + 0x124 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL51 + desc SEL51 + 0x128 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL52 + desc SEL52 + 0x12C + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL53 + desc SEL53 + 0x130 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL54 + desc SEL54 + 0x134 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL55 + desc SEL55 + 0x138 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL56 + desc SEL56 + 0x13C + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL57 + desc SEL57 + 0x140 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL58 + desc SEL58 + 0x144 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL59 + desc SEL59 + 0x148 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL60 + desc SEL60 + 0x14C + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL61 + desc SEL61 + 0x150 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL62 + desc SEL62 + 0x154 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL63 + desc SEL63 + 0x158 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL64 + desc SEL64 + 0x15C + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL65 + desc SEL65 + 0x160 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL66 + desc SEL66 + 0x164 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL67 + desc SEL67 + 0x168 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL68 + desc SEL68 + 0x16C + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL69 + desc SEL69 + 0x170 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL70 + desc SEL70 + 0x174 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL71 + desc SEL71 + 0x178 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL72 + desc SEL72 + 0x17C + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL73 + desc SEL73 + 0x180 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL74 + desc SEL74 + 0x184 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL75 + desc SEL75 + 0x188 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL76 + desc SEL76 + 0x18C + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL77 + desc SEL77 + 0x190 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL78 + desc SEL78 + 0x194 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL79 + desc SEL79 + 0x198 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL80 + desc SEL80 + 0x19C + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL81 + desc SEL81 + 0x1A0 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL82 + desc SEL82 + 0x1A4 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL83 + desc SEL83 + 0x1A8 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL84 + desc SEL84 + 0x1AC + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL85 + desc SEL85 + 0x1B0 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL86 + desc SEL86 + 0x1B4 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL87 + desc SEL87 + 0x1B8 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL88 + desc SEL88 + 0x1BC + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL89 + desc SEL89 + 0x1C0 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL90 + desc SEL90 + 0x1C4 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL91 + desc SEL91 + 0x1C8 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL92 + desc SEL92 + 0x1CC + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL93 + desc SEL93 + 0x1D0 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL94 + desc SEL94 + 0x1D4 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL95 + desc SEL95 + 0x1D8 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL96 + desc SEL96 + 0x1DC + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL97 + desc SEL97 + 0x1E0 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL98 + desc SEL98 + 0x1E4 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL99 + desc SEL99 + 0x1E8 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL100 + desc SEL100 + 0x1EC + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL101 + desc SEL101 + 0x1F0 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL102 + desc SEL102 + 0x1F4 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL103 + desc SEL103 + 0x1F8 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL104 + desc SEL104 + 0x1FC + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL105 + desc SEL105 + 0x200 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL106 + desc SEL106 + 0x204 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL107 + desc SEL107 + 0x208 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL108 + desc SEL108 + 0x20C + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL109 + desc SEL109 + 0x210 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL110 + desc SEL110 + 0x214 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL111 + desc SEL111 + 0x218 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL112 + desc SEL112 + 0x21C + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL113 + desc SEL113 + 0x220 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL114 + desc SEL114 + 0x224 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL115 + desc SEL115 + 0x228 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL116 + desc SEL116 + 0x22C + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL117 + desc SEL117 + 0x230 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL118 + desc SEL118 + 0x234 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL119 + desc SEL119 + 0x238 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL120 + desc SEL120 + 0x23C + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL121 + desc SEL121 + 0x240 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL122 + desc SEL122 + 0x244 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL123 + desc SEL123 + 0x248 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL124 + desc SEL124 + 0x24C + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL125 + desc SEL125 + 0x250 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL126 + desc SEL126 + 0x254 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + SEL127 + desc SEL127 + 0x258 + 32 + read-write + 0x1FF + 0x1FF + + + INTSEL + desc INTSEL + 8 + 0 + read-write + + + + + VSSEL128 + desc VSSEL128 + 0x25C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + VSEL0 + desc VSEL0 + 0 + 0 + read-write + + + VSEL1 + desc VSEL1 + 1 + 1 + read-write + + + VSEL2 + desc VSEL2 + 2 + 2 + read-write + + + VSEL3 + desc VSEL3 + 3 + 3 + read-write + + + VSEL4 + desc VSEL4 + 4 + 4 + read-write + + + VSEL5 + desc VSEL5 + 5 + 5 + read-write + + + VSEL6 + desc VSEL6 + 6 + 6 + read-write + + + VSEL7 + desc VSEL7 + 7 + 7 + read-write + + + VSEL8 + desc VSEL8 + 8 + 8 + read-write + + + VSEL9 + desc VSEL9 + 9 + 9 + read-write + + + VSEL10 + desc VSEL10 + 10 + 10 + read-write + + + VSEL11 + desc VSEL11 + 11 + 11 + read-write + + + VSEL12 + desc VSEL12 + 12 + 12 + read-write + + + VSEL13 + desc VSEL13 + 13 + 13 + read-write + + + VSEL14 + desc VSEL14 + 14 + 14 + read-write + + + VSEL15 + desc VSEL15 + 15 + 15 + read-write + + + VSEL16 + desc VSEL16 + 16 + 16 + read-write + + + VSEL17 + desc VSEL17 + 17 + 17 + read-write + + + VSEL18 + desc VSEL18 + 18 + 18 + read-write + + + VSEL19 + desc VSEL19 + 19 + 19 + read-write + + + VSEL20 + desc VSEL20 + 20 + 20 + read-write + + + VSEL21 + desc VSEL21 + 21 + 21 + read-write + + + VSEL22 + desc VSEL22 + 22 + 22 + read-write + + + VSEL23 + desc VSEL23 + 23 + 23 + read-write + + + VSEL24 + desc VSEL24 + 24 + 24 + read-write + + + VSEL25 + desc VSEL25 + 25 + 25 + read-write + + + VSEL26 + desc VSEL26 + 26 + 26 + read-write + + + VSEL27 + desc VSEL27 + 27 + 27 + read-write + + + VSEL28 + desc VSEL28 + 28 + 28 + read-write + + + VSEL29 + desc VSEL29 + 29 + 29 + read-write + + + VSEL30 + desc VSEL30 + 30 + 30 + read-write + + + VSEL31 + desc VSEL31 + 31 + 31 + read-write + + + + + VSSEL129 + desc VSSEL129 + 0x260 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + VSEL0 + desc VSEL0 + 0 + 0 + read-write + + + VSEL1 + desc VSEL1 + 1 + 1 + read-write + + + VSEL2 + desc VSEL2 + 2 + 2 + read-write + + + VSEL3 + desc VSEL3 + 3 + 3 + read-write + + + VSEL4 + desc VSEL4 + 4 + 4 + read-write + + + VSEL5 + desc VSEL5 + 5 + 5 + read-write + + + VSEL6 + desc VSEL6 + 6 + 6 + read-write + + + VSEL7 + desc VSEL7 + 7 + 7 + read-write + + + VSEL8 + desc VSEL8 + 8 + 8 + read-write + + + VSEL9 + desc VSEL9 + 9 + 9 + read-write + + + VSEL10 + desc VSEL10 + 10 + 10 + read-write + + + VSEL11 + desc VSEL11 + 11 + 11 + read-write + + + VSEL12 + desc VSEL12 + 12 + 12 + read-write + + + VSEL13 + desc VSEL13 + 13 + 13 + read-write + + + VSEL14 + desc VSEL14 + 14 + 14 + read-write + + + VSEL15 + desc VSEL15 + 15 + 15 + read-write + + + VSEL16 + desc VSEL16 + 16 + 16 + read-write + + + VSEL17 + desc VSEL17 + 17 + 17 + read-write + + + VSEL18 + desc VSEL18 + 18 + 18 + read-write + + + VSEL19 + desc VSEL19 + 19 + 19 + read-write + + + VSEL20 + desc VSEL20 + 20 + 20 + read-write + + + VSEL21 + desc VSEL21 + 21 + 21 + read-write + + + VSEL22 + desc VSEL22 + 22 + 22 + read-write + + + VSEL23 + desc VSEL23 + 23 + 23 + read-write + + + VSEL24 + desc VSEL24 + 24 + 24 + read-write + + + VSEL25 + desc VSEL25 + 25 + 25 + read-write + + + VSEL26 + desc VSEL26 + 26 + 26 + read-write + + + VSEL27 + desc VSEL27 + 27 + 27 + read-write + + + VSEL28 + desc VSEL28 + 28 + 28 + read-write + + + VSEL29 + desc VSEL29 + 29 + 29 + read-write + + + VSEL30 + desc VSEL30 + 30 + 30 + read-write + + + VSEL31 + desc VSEL31 + 31 + 31 + read-write + + + + + VSSEL130 + desc VSSEL130 + 0x264 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + VSEL0 + desc VSEL0 + 0 + 0 + read-write + + + VSEL1 + desc VSEL1 + 1 + 1 + read-write + + + VSEL2 + desc VSEL2 + 2 + 2 + read-write + + + VSEL3 + desc VSEL3 + 3 + 3 + read-write + + + VSEL4 + desc VSEL4 + 4 + 4 + read-write + + + VSEL5 + desc VSEL5 + 5 + 5 + read-write + + + VSEL6 + desc VSEL6 + 6 + 6 + read-write + + + VSEL7 + desc VSEL7 + 7 + 7 + read-write + + + VSEL8 + desc VSEL8 + 8 + 8 + read-write + + + VSEL9 + desc VSEL9 + 9 + 9 + read-write + + + VSEL10 + desc VSEL10 + 10 + 10 + read-write + + + VSEL11 + desc VSEL11 + 11 + 11 + read-write + + + VSEL12 + desc VSEL12 + 12 + 12 + read-write + + + VSEL13 + desc VSEL13 + 13 + 13 + read-write + + + VSEL14 + desc VSEL14 + 14 + 14 + read-write + + + VSEL15 + desc VSEL15 + 15 + 15 + read-write + + + VSEL16 + desc VSEL16 + 16 + 16 + read-write + + + VSEL17 + desc VSEL17 + 17 + 17 + read-write + + + VSEL18 + desc VSEL18 + 18 + 18 + read-write + + + VSEL19 + desc VSEL19 + 19 + 19 + read-write + + + VSEL20 + desc VSEL20 + 20 + 20 + read-write + + + VSEL21 + desc VSEL21 + 21 + 21 + read-write + + + VSEL22 + desc VSEL22 + 22 + 22 + read-write + + + VSEL23 + desc VSEL23 + 23 + 23 + read-write + + + VSEL24 + desc VSEL24 + 24 + 24 + read-write + + + VSEL25 + desc VSEL25 + 25 + 25 + read-write + + + VSEL26 + desc VSEL26 + 26 + 26 + read-write + + + VSEL27 + desc VSEL27 + 27 + 27 + read-write + + + VSEL28 + desc VSEL28 + 28 + 28 + read-write + + + VSEL29 + desc VSEL29 + 29 + 29 + read-write + + + VSEL30 + desc VSEL30 + 30 + 30 + read-write + + + VSEL31 + desc VSEL31 + 31 + 31 + read-write + + + + + VSSEL131 + desc VSSEL131 + 0x268 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + VSEL0 + desc VSEL0 + 0 + 0 + read-write + + + VSEL1 + desc VSEL1 + 1 + 1 + read-write + + + VSEL2 + desc VSEL2 + 2 + 2 + read-write + + + VSEL3 + desc VSEL3 + 3 + 3 + read-write + + + VSEL4 + desc VSEL4 + 4 + 4 + read-write + + + VSEL5 + desc VSEL5 + 5 + 5 + read-write + + + VSEL6 + desc VSEL6 + 6 + 6 + read-write + + + VSEL7 + desc VSEL7 + 7 + 7 + read-write + + + VSEL8 + desc VSEL8 + 8 + 8 + read-write + + + VSEL9 + desc VSEL9 + 9 + 9 + read-write + + + VSEL10 + desc VSEL10 + 10 + 10 + read-write + + + VSEL11 + desc VSEL11 + 11 + 11 + read-write + + + VSEL12 + desc VSEL12 + 12 + 12 + read-write + + + VSEL13 + desc VSEL13 + 13 + 13 + read-write + + + VSEL14 + desc VSEL14 + 14 + 14 + read-write + + + VSEL15 + desc VSEL15 + 15 + 15 + read-write + + + VSEL16 + desc VSEL16 + 16 + 16 + read-write + + + VSEL17 + desc VSEL17 + 17 + 17 + read-write + + + VSEL18 + desc VSEL18 + 18 + 18 + read-write + + + VSEL19 + desc VSEL19 + 19 + 19 + read-write + + + VSEL20 + desc VSEL20 + 20 + 20 + read-write + + + VSEL21 + desc VSEL21 + 21 + 21 + read-write + + + VSEL22 + desc VSEL22 + 22 + 22 + read-write + + + VSEL23 + desc VSEL23 + 23 + 23 + read-write + + + VSEL24 + desc VSEL24 + 24 + 24 + read-write + + + VSEL25 + desc VSEL25 + 25 + 25 + read-write + + + VSEL26 + desc VSEL26 + 26 + 26 + read-write + + + VSEL27 + desc VSEL27 + 27 + 27 + read-write + + + VSEL28 + desc VSEL28 + 28 + 28 + read-write + + + VSEL29 + desc VSEL29 + 29 + 29 + read-write + + + VSEL30 + desc VSEL30 + 30 + 30 + read-write + + + VSEL31 + desc VSEL31 + 31 + 31 + read-write + + + + + VSSEL132 + desc VSSEL132 + 0x26C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + VSEL0 + desc VSEL0 + 0 + 0 + read-write + + + VSEL1 + desc VSEL1 + 1 + 1 + read-write + + + VSEL2 + desc VSEL2 + 2 + 2 + read-write + + + VSEL3 + desc VSEL3 + 3 + 3 + read-write + + + VSEL4 + desc VSEL4 + 4 + 4 + read-write + + + VSEL5 + desc VSEL5 + 5 + 5 + read-write + + + VSEL6 + desc VSEL6 + 6 + 6 + read-write + + + VSEL7 + desc VSEL7 + 7 + 7 + read-write + + + VSEL8 + desc VSEL8 + 8 + 8 + read-write + + + VSEL9 + desc VSEL9 + 9 + 9 + read-write + + + VSEL10 + desc VSEL10 + 10 + 10 + read-write + + + VSEL11 + desc VSEL11 + 11 + 11 + read-write + + + VSEL12 + desc VSEL12 + 12 + 12 + read-write + + + VSEL13 + desc VSEL13 + 13 + 13 + read-write + + + VSEL14 + desc VSEL14 + 14 + 14 + read-write + + + VSEL15 + desc VSEL15 + 15 + 15 + read-write + + + VSEL16 + desc VSEL16 + 16 + 16 + read-write + + + VSEL17 + desc VSEL17 + 17 + 17 + read-write + + + VSEL18 + desc VSEL18 + 18 + 18 + read-write + + + VSEL19 + desc VSEL19 + 19 + 19 + read-write + + + VSEL20 + desc VSEL20 + 20 + 20 + read-write + + + VSEL21 + desc VSEL21 + 21 + 21 + read-write + + + VSEL22 + desc VSEL22 + 22 + 22 + read-write + + + VSEL23 + desc VSEL23 + 23 + 23 + read-write + + + VSEL24 + desc VSEL24 + 24 + 24 + read-write + + + VSEL25 + desc VSEL25 + 25 + 25 + read-write + + + VSEL26 + desc VSEL26 + 26 + 26 + read-write + + + VSEL27 + desc VSEL27 + 27 + 27 + read-write + + + VSEL28 + desc VSEL28 + 28 + 28 + read-write + + + VSEL29 + desc VSEL29 + 29 + 29 + read-write + + + VSEL30 + desc VSEL30 + 30 + 30 + read-write + + + VSEL31 + desc VSEL31 + 31 + 31 + read-write + + + + + VSSEL133 + desc VSSEL133 + 0x270 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + VSEL0 + desc VSEL0 + 0 + 0 + read-write + + + VSEL1 + desc VSEL1 + 1 + 1 + read-write + + + VSEL2 + desc VSEL2 + 2 + 2 + read-write + + + VSEL3 + desc VSEL3 + 3 + 3 + read-write + + + VSEL4 + desc VSEL4 + 4 + 4 + read-write + + + VSEL5 + desc VSEL5 + 5 + 5 + read-write + + + VSEL6 + desc VSEL6 + 6 + 6 + read-write + + + VSEL7 + desc VSEL7 + 7 + 7 + read-write + + + VSEL8 + desc VSEL8 + 8 + 8 + read-write + + + VSEL9 + desc VSEL9 + 9 + 9 + read-write + + + VSEL10 + desc VSEL10 + 10 + 10 + read-write + + + VSEL11 + desc VSEL11 + 11 + 11 + read-write + + + VSEL12 + desc VSEL12 + 12 + 12 + read-write + + + VSEL13 + desc VSEL13 + 13 + 13 + read-write + + + VSEL14 + desc VSEL14 + 14 + 14 + read-write + + + VSEL15 + desc VSEL15 + 15 + 15 + read-write + + + VSEL16 + desc VSEL16 + 16 + 16 + read-write + + + VSEL17 + desc VSEL17 + 17 + 17 + read-write + + + VSEL18 + desc VSEL18 + 18 + 18 + read-write + + + VSEL19 + desc VSEL19 + 19 + 19 + read-write + + + VSEL20 + desc VSEL20 + 20 + 20 + read-write + + + VSEL21 + desc VSEL21 + 21 + 21 + read-write + + + VSEL22 + desc VSEL22 + 22 + 22 + read-write + + + VSEL23 + desc VSEL23 + 23 + 23 + read-write + + + VSEL24 + desc VSEL24 + 24 + 24 + read-write + + + VSEL25 + desc VSEL25 + 25 + 25 + read-write + + + VSEL26 + desc VSEL26 + 26 + 26 + read-write + + + VSEL27 + desc VSEL27 + 27 + 27 + read-write + + + VSEL28 + desc VSEL28 + 28 + 28 + read-write + + + VSEL29 + desc VSEL29 + 29 + 29 + read-write + + + VSEL30 + desc VSEL30 + 30 + 30 + read-write + + + VSEL31 + desc VSEL31 + 31 + 31 + read-write + + + + + VSSEL134 + desc VSSEL134 + 0x274 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + VSEL0 + desc VSEL0 + 0 + 0 + read-write + + + VSEL1 + desc VSEL1 + 1 + 1 + read-write + + + VSEL2 + desc VSEL2 + 2 + 2 + read-write + + + VSEL3 + desc VSEL3 + 3 + 3 + read-write + + + VSEL4 + desc VSEL4 + 4 + 4 + read-write + + + VSEL5 + desc VSEL5 + 5 + 5 + read-write + + + VSEL6 + desc VSEL6 + 6 + 6 + read-write + + + VSEL7 + desc VSEL7 + 7 + 7 + read-write + + + VSEL8 + desc VSEL8 + 8 + 8 + read-write + + + VSEL9 + desc VSEL9 + 9 + 9 + read-write + + + VSEL10 + desc VSEL10 + 10 + 10 + read-write + + + VSEL11 + desc VSEL11 + 11 + 11 + read-write + + + VSEL12 + desc VSEL12 + 12 + 12 + read-write + + + VSEL13 + desc VSEL13 + 13 + 13 + read-write + + + VSEL14 + desc VSEL14 + 14 + 14 + read-write + + + VSEL15 + desc VSEL15 + 15 + 15 + read-write + + + VSEL16 + desc VSEL16 + 16 + 16 + read-write + + + VSEL17 + desc VSEL17 + 17 + 17 + read-write + + + VSEL18 + desc VSEL18 + 18 + 18 + read-write + + + VSEL19 + desc VSEL19 + 19 + 19 + read-write + + + VSEL20 + desc VSEL20 + 20 + 20 + read-write + + + VSEL21 + desc VSEL21 + 21 + 21 + read-write + + + VSEL22 + desc VSEL22 + 22 + 22 + read-write + + + VSEL23 + desc VSEL23 + 23 + 23 + read-write + + + VSEL24 + desc VSEL24 + 24 + 24 + read-write + + + VSEL25 + desc VSEL25 + 25 + 25 + read-write + + + VSEL26 + desc VSEL26 + 26 + 26 + read-write + + + VSEL27 + desc VSEL27 + 27 + 27 + read-write + + + VSEL28 + desc VSEL28 + 28 + 28 + read-write + + + VSEL29 + desc VSEL29 + 29 + 29 + read-write + + + VSEL30 + desc VSEL30 + 30 + 30 + read-write + + + VSEL31 + desc VSEL31 + 31 + 31 + read-write + + + + + VSSEL135 + desc VSSEL135 + 0x278 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + VSEL0 + desc VSEL0 + 0 + 0 + read-write + + + VSEL1 + desc VSEL1 + 1 + 1 + read-write + + + VSEL2 + desc VSEL2 + 2 + 2 + read-write + + + VSEL3 + desc VSEL3 + 3 + 3 + read-write + + + VSEL4 + desc VSEL4 + 4 + 4 + read-write + + + VSEL5 + desc VSEL5 + 5 + 5 + read-write + + + VSEL6 + desc VSEL6 + 6 + 6 + read-write + + + VSEL7 + desc VSEL7 + 7 + 7 + read-write + + + VSEL8 + desc VSEL8 + 8 + 8 + read-write + + + VSEL9 + desc VSEL9 + 9 + 9 + read-write + + + VSEL10 + desc VSEL10 + 10 + 10 + read-write + + + VSEL11 + desc VSEL11 + 11 + 11 + read-write + + + VSEL12 + desc VSEL12 + 12 + 12 + read-write + + + VSEL13 + desc VSEL13 + 13 + 13 + read-write + + + VSEL14 + desc VSEL14 + 14 + 14 + read-write + + + VSEL15 + desc VSEL15 + 15 + 15 + read-write + + + VSEL16 + desc VSEL16 + 16 + 16 + read-write + + + VSEL17 + desc VSEL17 + 17 + 17 + read-write + + + VSEL18 + desc VSEL18 + 18 + 18 + read-write + + + VSEL19 + desc VSEL19 + 19 + 19 + read-write + + + VSEL20 + desc VSEL20 + 20 + 20 + read-write + + + VSEL21 + desc VSEL21 + 21 + 21 + read-write + + + VSEL22 + desc VSEL22 + 22 + 22 + read-write + + + VSEL23 + desc VSEL23 + 23 + 23 + read-write + + + VSEL24 + desc VSEL24 + 24 + 24 + read-write + + + VSEL25 + desc VSEL25 + 25 + 25 + read-write + + + VSEL26 + desc VSEL26 + 26 + 26 + read-write + + + VSEL27 + desc VSEL27 + 27 + 27 + read-write + + + VSEL28 + desc VSEL28 + 28 + 28 + read-write + + + VSEL29 + desc VSEL29 + 29 + 29 + read-write + + + VSEL30 + desc VSEL30 + 30 + 30 + read-write + + + VSEL31 + desc VSEL31 + 31 + 31 + read-write + + + + + VSSEL136 + desc VSSEL136 + 0x27C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + VSEL0 + desc VSEL0 + 0 + 0 + read-write + + + VSEL1 + desc VSEL1 + 1 + 1 + read-write + + + VSEL2 + desc VSEL2 + 2 + 2 + read-write + + + VSEL3 + desc VSEL3 + 3 + 3 + read-write + + + VSEL4 + desc VSEL4 + 4 + 4 + read-write + + + VSEL5 + desc VSEL5 + 5 + 5 + read-write + + + VSEL6 + desc VSEL6 + 6 + 6 + read-write + + + VSEL7 + desc VSEL7 + 7 + 7 + read-write + + + VSEL8 + desc VSEL8 + 8 + 8 + read-write + + + VSEL9 + desc VSEL9 + 9 + 9 + read-write + + + VSEL10 + desc VSEL10 + 10 + 10 + read-write + + + VSEL11 + desc VSEL11 + 11 + 11 + read-write + + + VSEL12 + desc VSEL12 + 12 + 12 + read-write + + + VSEL13 + desc VSEL13 + 13 + 13 + read-write + + + VSEL14 + desc VSEL14 + 14 + 14 + read-write + + + VSEL15 + desc VSEL15 + 15 + 15 + read-write + + + VSEL16 + desc VSEL16 + 16 + 16 + read-write + + + VSEL17 + desc VSEL17 + 17 + 17 + read-write + + + VSEL18 + desc VSEL18 + 18 + 18 + read-write + + + VSEL19 + desc VSEL19 + 19 + 19 + read-write + + + VSEL20 + desc VSEL20 + 20 + 20 + read-write + + + VSEL21 + desc VSEL21 + 21 + 21 + read-write + + + VSEL22 + desc VSEL22 + 22 + 22 + read-write + + + VSEL23 + desc VSEL23 + 23 + 23 + read-write + + + VSEL24 + desc VSEL24 + 24 + 24 + read-write + + + VSEL25 + desc VSEL25 + 25 + 25 + read-write + + + VSEL26 + desc VSEL26 + 26 + 26 + read-write + + + VSEL27 + desc VSEL27 + 27 + 27 + read-write + + + VSEL28 + desc VSEL28 + 28 + 28 + read-write + + + VSEL29 + desc VSEL29 + 29 + 29 + read-write + + + VSEL30 + desc VSEL30 + 30 + 30 + read-write + + + VSEL31 + desc VSEL31 + 31 + 31 + read-write + + + + + VSSEL137 + desc VSSEL137 + 0x280 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + VSEL0 + desc VSEL0 + 0 + 0 + read-write + + + VSEL1 + desc VSEL1 + 1 + 1 + read-write + + + VSEL2 + desc VSEL2 + 2 + 2 + read-write + + + VSEL3 + desc VSEL3 + 3 + 3 + read-write + + + VSEL4 + desc VSEL4 + 4 + 4 + read-write + + + VSEL5 + desc VSEL5 + 5 + 5 + read-write + + + VSEL6 + desc VSEL6 + 6 + 6 + read-write + + + VSEL7 + desc VSEL7 + 7 + 7 + read-write + + + VSEL8 + desc VSEL8 + 8 + 8 + read-write + + + VSEL9 + desc VSEL9 + 9 + 9 + read-write + + + VSEL10 + desc VSEL10 + 10 + 10 + read-write + + + VSEL11 + desc VSEL11 + 11 + 11 + read-write + + + VSEL12 + desc VSEL12 + 12 + 12 + read-write + + + VSEL13 + desc VSEL13 + 13 + 13 + read-write + + + VSEL14 + desc VSEL14 + 14 + 14 + read-write + + + VSEL15 + desc VSEL15 + 15 + 15 + read-write + + + VSEL16 + desc VSEL16 + 16 + 16 + read-write + + + VSEL17 + desc VSEL17 + 17 + 17 + read-write + + + VSEL18 + desc VSEL18 + 18 + 18 + read-write + + + VSEL19 + desc VSEL19 + 19 + 19 + read-write + + + VSEL20 + desc VSEL20 + 20 + 20 + read-write + + + VSEL21 + desc VSEL21 + 21 + 21 + read-write + + + VSEL22 + desc VSEL22 + 22 + 22 + read-write + + + VSEL23 + desc VSEL23 + 23 + 23 + read-write + + + VSEL24 + desc VSEL24 + 24 + 24 + read-write + + + VSEL25 + desc VSEL25 + 25 + 25 + read-write + + + VSEL26 + desc VSEL26 + 26 + 26 + read-write + + + VSEL27 + desc VSEL27 + 27 + 27 + read-write + + + VSEL28 + desc VSEL28 + 28 + 28 + read-write + + + VSEL29 + desc VSEL29 + 29 + 29 + read-write + + + VSEL30 + desc VSEL30 + 30 + 30 + read-write + + + VSEL31 + desc VSEL31 + 31 + 31 + read-write + + + + + VSSEL138 + desc VSSEL138 + 0x284 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + VSEL0 + desc VSEL0 + 0 + 0 + read-write + + + VSEL1 + desc VSEL1 + 1 + 1 + read-write + + + VSEL2 + desc VSEL2 + 2 + 2 + read-write + + + VSEL3 + desc VSEL3 + 3 + 3 + read-write + + + VSEL4 + desc VSEL4 + 4 + 4 + read-write + + + VSEL5 + desc VSEL5 + 5 + 5 + read-write + + + VSEL6 + desc VSEL6 + 6 + 6 + read-write + + + VSEL7 + desc VSEL7 + 7 + 7 + read-write + + + VSEL8 + desc VSEL8 + 8 + 8 + read-write + + + VSEL9 + desc VSEL9 + 9 + 9 + read-write + + + VSEL10 + desc VSEL10 + 10 + 10 + read-write + + + VSEL11 + desc VSEL11 + 11 + 11 + read-write + + + VSEL12 + desc VSEL12 + 12 + 12 + read-write + + + VSEL13 + desc VSEL13 + 13 + 13 + read-write + + + VSEL14 + desc VSEL14 + 14 + 14 + read-write + + + VSEL15 + desc VSEL15 + 15 + 15 + read-write + + + VSEL16 + desc VSEL16 + 16 + 16 + read-write + + + VSEL17 + desc VSEL17 + 17 + 17 + read-write + + + VSEL18 + desc VSEL18 + 18 + 18 + read-write + + + VSEL19 + desc VSEL19 + 19 + 19 + read-write + + + VSEL20 + desc VSEL20 + 20 + 20 + read-write + + + VSEL21 + desc VSEL21 + 21 + 21 + read-write + + + VSEL22 + desc VSEL22 + 22 + 22 + read-write + + + VSEL23 + desc VSEL23 + 23 + 23 + read-write + + + VSEL24 + desc VSEL24 + 24 + 24 + read-write + + + VSEL25 + desc VSEL25 + 25 + 25 + read-write + + + VSEL26 + desc VSEL26 + 26 + 26 + read-write + + + VSEL27 + desc VSEL27 + 27 + 27 + read-write + + + VSEL28 + desc VSEL28 + 28 + 28 + read-write + + + VSEL29 + desc VSEL29 + 29 + 29 + read-write + + + VSEL30 + desc VSEL30 + 30 + 30 + read-write + + + VSEL31 + desc VSEL31 + 31 + 31 + read-write + + + + + VSSEL139 + desc VSSEL139 + 0x288 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + VSEL0 + desc VSEL0 + 0 + 0 + read-write + + + VSEL1 + desc VSEL1 + 1 + 1 + read-write + + + VSEL2 + desc VSEL2 + 2 + 2 + read-write + + + VSEL3 + desc VSEL3 + 3 + 3 + read-write + + + VSEL4 + desc VSEL4 + 4 + 4 + read-write + + + VSEL5 + desc VSEL5 + 5 + 5 + read-write + + + VSEL6 + desc VSEL6 + 6 + 6 + read-write + + + VSEL7 + desc VSEL7 + 7 + 7 + read-write + + + VSEL8 + desc VSEL8 + 8 + 8 + read-write + + + VSEL9 + desc VSEL9 + 9 + 9 + read-write + + + VSEL10 + desc VSEL10 + 10 + 10 + read-write + + + VSEL11 + desc VSEL11 + 11 + 11 + read-write + + + VSEL12 + desc VSEL12 + 12 + 12 + read-write + + + VSEL13 + desc VSEL13 + 13 + 13 + read-write + + + VSEL14 + desc VSEL14 + 14 + 14 + read-write + + + VSEL15 + desc VSEL15 + 15 + 15 + read-write + + + VSEL16 + desc VSEL16 + 16 + 16 + read-write + + + VSEL17 + desc VSEL17 + 17 + 17 + read-write + + + VSEL18 + desc VSEL18 + 18 + 18 + read-write + + + VSEL19 + desc VSEL19 + 19 + 19 + read-write + + + VSEL20 + desc VSEL20 + 20 + 20 + read-write + + + VSEL21 + desc VSEL21 + 21 + 21 + read-write + + + VSEL22 + desc VSEL22 + 22 + 22 + read-write + + + VSEL23 + desc VSEL23 + 23 + 23 + read-write + + + VSEL24 + desc VSEL24 + 24 + 24 + read-write + + + VSEL25 + desc VSEL25 + 25 + 25 + read-write + + + VSEL26 + desc VSEL26 + 26 + 26 + read-write + + + VSEL27 + desc VSEL27 + 27 + 27 + read-write + + + VSEL28 + desc VSEL28 + 28 + 28 + read-write + + + VSEL29 + desc VSEL29 + 29 + 29 + read-write + + + VSEL30 + desc VSEL30 + 30 + 30 + read-write + + + VSEL31 + desc VSEL31 + 31 + 31 + read-write + + + + + VSSEL140 + desc VSSEL140 + 0x28C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + VSEL0 + desc VSEL0 + 0 + 0 + read-write + + + VSEL1 + desc VSEL1 + 1 + 1 + read-write + + + VSEL2 + desc VSEL2 + 2 + 2 + read-write + + + VSEL3 + desc VSEL3 + 3 + 3 + read-write + + + VSEL4 + desc VSEL4 + 4 + 4 + read-write + + + VSEL5 + desc VSEL5 + 5 + 5 + read-write + + + VSEL6 + desc VSEL6 + 6 + 6 + read-write + + + VSEL7 + desc VSEL7 + 7 + 7 + read-write + + + VSEL8 + desc VSEL8 + 8 + 8 + read-write + + + VSEL9 + desc VSEL9 + 9 + 9 + read-write + + + VSEL10 + desc VSEL10 + 10 + 10 + read-write + + + VSEL11 + desc VSEL11 + 11 + 11 + read-write + + + VSEL12 + desc VSEL12 + 12 + 12 + read-write + + + VSEL13 + desc VSEL13 + 13 + 13 + read-write + + + VSEL14 + desc VSEL14 + 14 + 14 + read-write + + + VSEL15 + desc VSEL15 + 15 + 15 + read-write + + + VSEL16 + desc VSEL16 + 16 + 16 + read-write + + + VSEL17 + desc VSEL17 + 17 + 17 + read-write + + + VSEL18 + desc VSEL18 + 18 + 18 + read-write + + + VSEL19 + desc VSEL19 + 19 + 19 + read-write + + + VSEL20 + desc VSEL20 + 20 + 20 + read-write + + + VSEL21 + desc VSEL21 + 21 + 21 + read-write + + + VSEL22 + desc VSEL22 + 22 + 22 + read-write + + + VSEL23 + desc VSEL23 + 23 + 23 + read-write + + + VSEL24 + desc VSEL24 + 24 + 24 + read-write + + + VSEL25 + desc VSEL25 + 25 + 25 + read-write + + + VSEL26 + desc VSEL26 + 26 + 26 + read-write + + + VSEL27 + desc VSEL27 + 27 + 27 + read-write + + + VSEL28 + desc VSEL28 + 28 + 28 + read-write + + + VSEL29 + desc VSEL29 + 29 + 29 + read-write + + + VSEL30 + desc VSEL30 + 30 + 30 + read-write + + + VSEL31 + desc VSEL31 + 31 + 31 + read-write + + + + + VSSEL141 + desc VSSEL141 + 0x290 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + VSEL0 + desc VSEL0 + 0 + 0 + read-write + + + VSEL1 + desc VSEL1 + 1 + 1 + read-write + + + VSEL2 + desc VSEL2 + 2 + 2 + read-write + + + VSEL3 + desc VSEL3 + 3 + 3 + read-write + + + VSEL4 + desc VSEL4 + 4 + 4 + read-write + + + VSEL5 + desc VSEL5 + 5 + 5 + read-write + + + VSEL6 + desc VSEL6 + 6 + 6 + read-write + + + VSEL7 + desc VSEL7 + 7 + 7 + read-write + + + VSEL8 + desc VSEL8 + 8 + 8 + read-write + + + VSEL9 + desc VSEL9 + 9 + 9 + read-write + + + VSEL10 + desc VSEL10 + 10 + 10 + read-write + + + VSEL11 + desc VSEL11 + 11 + 11 + read-write + + + VSEL12 + desc VSEL12 + 12 + 12 + read-write + + + VSEL13 + desc VSEL13 + 13 + 13 + read-write + + + VSEL14 + desc VSEL14 + 14 + 14 + read-write + + + VSEL15 + desc VSEL15 + 15 + 15 + read-write + + + VSEL16 + desc VSEL16 + 16 + 16 + read-write + + + VSEL17 + desc VSEL17 + 17 + 17 + read-write + + + VSEL18 + desc VSEL18 + 18 + 18 + read-write + + + VSEL19 + desc VSEL19 + 19 + 19 + read-write + + + VSEL20 + desc VSEL20 + 20 + 20 + read-write + + + VSEL21 + desc VSEL21 + 21 + 21 + read-write + + + VSEL22 + desc VSEL22 + 22 + 22 + read-write + + + VSEL23 + desc VSEL23 + 23 + 23 + read-write + + + VSEL24 + desc VSEL24 + 24 + 24 + read-write + + + VSEL25 + desc VSEL25 + 25 + 25 + read-write + + + VSEL26 + desc VSEL26 + 26 + 26 + read-write + + + VSEL27 + desc VSEL27 + 27 + 27 + read-write + + + VSEL28 + desc VSEL28 + 28 + 28 + read-write + + + VSEL29 + desc VSEL29 + 29 + 29 + read-write + + + VSEL30 + desc VSEL30 + 30 + 30 + read-write + + + VSEL31 + desc VSEL31 + 31 + 31 + read-write + + + + + VSSEL142 + desc VSSEL142 + 0x294 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + VSEL0 + desc VSEL0 + 0 + 0 + read-write + + + VSEL1 + desc VSEL1 + 1 + 1 + read-write + + + VSEL2 + desc VSEL2 + 2 + 2 + read-write + + + VSEL3 + desc VSEL3 + 3 + 3 + read-write + + + VSEL4 + desc VSEL4 + 4 + 4 + read-write + + + VSEL5 + desc VSEL5 + 5 + 5 + read-write + + + VSEL6 + desc VSEL6 + 6 + 6 + read-write + + + VSEL7 + desc VSEL7 + 7 + 7 + read-write + + + VSEL8 + desc VSEL8 + 8 + 8 + read-write + + + VSEL9 + desc VSEL9 + 9 + 9 + read-write + + + VSEL10 + desc VSEL10 + 10 + 10 + read-write + + + VSEL11 + desc VSEL11 + 11 + 11 + read-write + + + VSEL12 + desc VSEL12 + 12 + 12 + read-write + + + VSEL13 + desc VSEL13 + 13 + 13 + read-write + + + VSEL14 + desc VSEL14 + 14 + 14 + read-write + + + VSEL15 + desc VSEL15 + 15 + 15 + read-write + + + VSEL16 + desc VSEL16 + 16 + 16 + read-write + + + VSEL17 + desc VSEL17 + 17 + 17 + read-write + + + VSEL18 + desc VSEL18 + 18 + 18 + read-write + + + VSEL19 + desc VSEL19 + 19 + 19 + read-write + + + VSEL20 + desc VSEL20 + 20 + 20 + read-write + + + VSEL21 + desc VSEL21 + 21 + 21 + read-write + + + VSEL22 + desc VSEL22 + 22 + 22 + read-write + + + VSEL23 + desc VSEL23 + 23 + 23 + read-write + + + VSEL24 + desc VSEL24 + 24 + 24 + read-write + + + VSEL25 + desc VSEL25 + 25 + 25 + read-write + + + VSEL26 + desc VSEL26 + 26 + 26 + read-write + + + VSEL27 + desc VSEL27 + 27 + 27 + read-write + + + VSEL28 + desc VSEL28 + 28 + 28 + read-write + + + VSEL29 + desc VSEL29 + 29 + 29 + read-write + + + VSEL30 + desc VSEL30 + 30 + 30 + read-write + + + VSEL31 + desc VSEL31 + 31 + 31 + read-write + + + + + VSSEL143 + desc VSSEL143 + 0x298 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + VSEL0 + desc VSEL0 + 0 + 0 + read-write + + + VSEL1 + desc VSEL1 + 1 + 1 + read-write + + + VSEL2 + desc VSEL2 + 2 + 2 + read-write + + + VSEL3 + desc VSEL3 + 3 + 3 + read-write + + + VSEL4 + desc VSEL4 + 4 + 4 + read-write + + + VSEL5 + desc VSEL5 + 5 + 5 + read-write + + + VSEL6 + desc VSEL6 + 6 + 6 + read-write + + + VSEL7 + desc VSEL7 + 7 + 7 + read-write + + + VSEL8 + desc VSEL8 + 8 + 8 + read-write + + + VSEL9 + desc VSEL9 + 9 + 9 + read-write + + + VSEL10 + desc VSEL10 + 10 + 10 + read-write + + + VSEL11 + desc VSEL11 + 11 + 11 + read-write + + + VSEL12 + desc VSEL12 + 12 + 12 + read-write + + + VSEL13 + desc VSEL13 + 13 + 13 + read-write + + + VSEL14 + desc VSEL14 + 14 + 14 + read-write + + + VSEL15 + desc VSEL15 + 15 + 15 + read-write + + + VSEL16 + desc VSEL16 + 16 + 16 + read-write + + + VSEL17 + desc VSEL17 + 17 + 17 + read-write + + + VSEL18 + desc VSEL18 + 18 + 18 + read-write + + + VSEL19 + desc VSEL19 + 19 + 19 + read-write + + + VSEL20 + desc VSEL20 + 20 + 20 + read-write + + + VSEL21 + desc VSEL21 + 21 + 21 + read-write + + + VSEL22 + desc VSEL22 + 22 + 22 + read-write + + + VSEL23 + desc VSEL23 + 23 + 23 + read-write + + + VSEL24 + desc VSEL24 + 24 + 24 + read-write + + + VSEL25 + desc VSEL25 + 25 + 25 + read-write + + + VSEL26 + desc VSEL26 + 26 + 26 + read-write + + + VSEL27 + desc VSEL27 + 27 + 27 + read-write + + + VSEL28 + desc VSEL28 + 28 + 28 + read-write + + + VSEL29 + desc VSEL29 + 29 + 29 + read-write + + + VSEL30 + desc VSEL30 + 30 + 30 + read-write + + + VSEL31 + desc VSEL31 + 31 + 31 + read-write + + + + + SWIER + desc SWIER + 0x29C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + SWIE0 + desc SWIE0 + 0 + 0 + read-write + + + SWIE1 + desc SWIE1 + 1 + 1 + read-write + + + SWIE2 + desc SWIE2 + 2 + 2 + read-write + + + SWIE3 + desc SWIE3 + 3 + 3 + read-write + + + SWIE4 + desc SWIE4 + 4 + 4 + read-write + + + SWIE5 + desc SWIE5 + 5 + 5 + read-write + + + SWIE6 + desc SWIE6 + 6 + 6 + read-write + + + SWIE7 + desc SWIE7 + 7 + 7 + read-write + + + SWIE8 + desc SWIE8 + 8 + 8 + read-write + + + SWIE9 + desc SWIE9 + 9 + 9 + read-write + + + SWIE10 + desc SWIE10 + 10 + 10 + read-write + + + SWIE11 + desc SWIE11 + 11 + 11 + read-write + + + SWIE12 + desc SWIE12 + 12 + 12 + read-write + + + SWIE13 + desc SWIE13 + 13 + 13 + read-write + + + SWIE14 + desc SWIE14 + 14 + 14 + read-write + + + SWIE15 + desc SWIE15 + 15 + 15 + read-write + + + SWIE16 + desc SWIE16 + 16 + 16 + read-write + + + SWIE17 + desc SWIE17 + 17 + 17 + read-write + + + SWIE18 + desc SWIE18 + 18 + 18 + read-write + + + SWIE19 + desc SWIE19 + 19 + 19 + read-write + + + SWIE20 + desc SWIE20 + 20 + 20 + read-write + + + SWIE21 + desc SWIE21 + 21 + 21 + read-write + + + SWIE22 + desc SWIE22 + 22 + 22 + read-write + + + SWIE23 + desc SWIE23 + 23 + 23 + read-write + + + SWIE24 + desc SWIE24 + 24 + 24 + read-write + + + SWIE25 + desc SWIE25 + 25 + 25 + read-write + + + SWIE26 + desc SWIE26 + 26 + 26 + read-write + + + SWIE27 + desc SWIE27 + 27 + 27 + read-write + + + SWIE28 + desc SWIE28 + 28 + 28 + read-write + + + SWIE29 + desc SWIE29 + 29 + 29 + read-write + + + SWIE30 + desc SWIE30 + 30 + 30 + read-write + + + SWIE31 + desc SWIE31 + 31 + 31 + read-write + + + + + EVTER + desc EVTER + 0x2A0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + EVTE0 + desc EVTE0 + 0 + 0 + read-write + + + EVTE1 + desc EVTE1 + 1 + 1 + read-write + + + EVTE2 + desc EVTE2 + 2 + 2 + read-write + + + EVTE3 + desc EVTE3 + 3 + 3 + read-write + + + EVTE4 + desc EVTE4 + 4 + 4 + read-write + + + EVTE5 + desc EVTE5 + 5 + 5 + read-write + + + EVTE6 + desc EVTE6 + 6 + 6 + read-write + + + EVTE7 + desc EVTE7 + 7 + 7 + read-write + + + EVTE8 + desc EVTE8 + 8 + 8 + read-write + + + EVTE9 + desc EVTE9 + 9 + 9 + read-write + + + EVTE10 + desc EVTE10 + 10 + 10 + read-write + + + EVTE11 + desc EVTE11 + 11 + 11 + read-write + + + EVTE12 + desc EVTE12 + 12 + 12 + read-write + + + EVTE13 + desc EVTE13 + 13 + 13 + read-write + + + EVTE14 + desc EVTE14 + 14 + 14 + read-write + + + EVTE15 + desc EVTE15 + 15 + 15 + read-write + + + EVTE16 + desc EVTE16 + 16 + 16 + read-write + + + EVTE17 + desc EVTE17 + 17 + 17 + read-write + + + EVTE18 + desc EVTE18 + 18 + 18 + read-write + + + EVTE19 + desc EVTE19 + 19 + 19 + read-write + + + EVTE20 + desc EVTE20 + 20 + 20 + read-write + + + EVTE21 + desc EVTE21 + 21 + 21 + read-write + + + EVTE22 + desc EVTE22 + 22 + 22 + read-write + + + EVTE23 + desc EVTE23 + 23 + 23 + read-write + + + EVTE24 + desc EVTE24 + 24 + 24 + read-write + + + EVTE25 + desc EVTE25 + 25 + 25 + read-write + + + EVTE26 + desc EVTE26 + 26 + 26 + read-write + + + EVTE27 + desc EVTE27 + 27 + 27 + read-write + + + EVTE28 + desc EVTE28 + 28 + 28 + read-write + + + EVTE29 + desc EVTE29 + 29 + 29 + read-write + + + EVTE30 + desc EVTE30 + 30 + 30 + read-write + + + EVTE31 + desc EVTE31 + 31 + 31 + read-write + + + + + IER + desc IER + 0x2A4 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + IER0 + desc IER0 + 0 + 0 + read-write + + + IER1 + desc IER1 + 1 + 1 + read-write + + + IER2 + desc IER2 + 2 + 2 + read-write + + + IER3 + desc IER3 + 3 + 3 + read-write + + + IER4 + desc IER4 + 4 + 4 + read-write + + + IER5 + desc IER5 + 5 + 5 + read-write + + + IER6 + desc IER6 + 6 + 6 + read-write + + + IER7 + desc IER7 + 7 + 7 + read-write + + + IER8 + desc IER8 + 8 + 8 + read-write + + + IER9 + desc IER9 + 9 + 9 + read-write + + + IER10 + desc IER10 + 10 + 10 + read-write + + + IER11 + desc IER11 + 11 + 11 + read-write + + + IER12 + desc IER12 + 12 + 12 + read-write + + + IER13 + desc IER13 + 13 + 13 + read-write + + + IER14 + desc IER14 + 14 + 14 + read-write + + + IER15 + desc IER15 + 15 + 15 + read-write + + + IER16 + desc IER16 + 16 + 16 + read-write + + + IER17 + desc IER17 + 17 + 17 + read-write + + + IER18 + desc IER18 + 18 + 18 + read-write + + + IER19 + desc IER19 + 19 + 19 + read-write + + + IER20 + desc IER20 + 20 + 20 + read-write + + + IER21 + desc IER21 + 21 + 21 + read-write + + + IER22 + desc IER22 + 22 + 22 + read-write + + + IER23 + desc IER23 + 23 + 23 + read-write + + + IER24 + desc IER24 + 24 + 24 + read-write + + + IER25 + desc IER25 + 25 + 25 + read-write + + + IER26 + desc IER26 + 26 + 26 + read-write + + + IER27 + desc IER27 + 27 + 27 + read-write + + + IER28 + desc IER28 + 28 + 28 + read-write + + + IER29 + desc IER29 + 29 + 29 + read-write + + + IER30 + desc IER30 + 30 + 30 + read-write + + + IER31 + desc IER31 + 31 + 31 + read-write + + + + + + + KEYSCAN + desc KEYSCAN + 0x40050C00 + + 0x0 + 0xC + + + + SCR + desc SCR + 0x0 + 32 + read-write + 0x0 + 0xFF37FFFF + + + KEYINSEL + desc KEYINSEL + 15 + 0 + read-write + + + KEYOUTSEL + desc KEYOUTSEL + 18 + 16 + read-write + + + CKSEL + desc CKSEL + 21 + 20 + read-write + + + T_LLEVEL + desc T_LLEVEL + 28 + 24 + read-write + + + T_HIZ + desc T_HIZ + 31 + 29 + read-write + + + + + SER + desc SER + 0x4 + 32 + read-write + 0x0 + 0x1 + + + SEN + desc SEN + 0 + 0 + read-write + + + + + SSR + desc SSR + 0x8 + 32 + read-write + 0x0 + 0x7 + + + INDEX + desc INDEX + 2 + 0 + read-write + + + + + + + MAU + desc MAU + 0x40055000 + + 0x0 + 0x18 + + + + CSR + desc CSR + 0x0 + 32 + read-write + 0x0 + 0x1F0B + + + START + desc START + 0 + 0 + read-write + + + INTEN + desc INTEN + 1 + 1 + read-write + + + BUSY + desc BUSY + 3 + 3 + read-write + + + SHIFT + desc SHIFT + 12 + 8 + read-write + + + + + DTR0 + desc DTR0 + 0x4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + RTR0 + desc RTR0 + 0xC + 32 + read-write + 0x0 + 0x1FFFF + + + SQRT_DOUT + desc SQRT_DOUT + 16 + 0 + read-write + + + + + DTR1 + desc DTR1 + 0x10 + 32 + read-write + 0x0 + 0xFFF + + + SIN_DIN + desc SIN_DIN + 11 + 0 + read-write + + + + + RTR1 + desc RTR1 + 0x14 + 32 + read-write + 0x0 + 0xFFFF + + + SIN_DOUT + desc SIN_DOUT + 15 + 0 + read-write + + + + + + + MPU + desc MPU + 0x40050000 + ETH + + 0x0 + 0xA0 + + + + RGD0 + desc RGD0 + 0x0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + MPURGSIZE + desc MPURGSIZE + 4 + 0 + read-write + + + MPURGADDR + desc MPURGADDR + 31 + 5 + read-write + + + + + RGD1 + desc RGD1 + 0x4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + MPURGSIZE + desc MPURGSIZE + 4 + 0 + read-write + + + MPURGADDR + desc MPURGADDR + 31 + 5 + read-write + + + + + RGD2 + desc RGD2 + 0x8 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + MPURGSIZE + desc MPURGSIZE + 4 + 0 + read-write + + + MPURGADDR + desc MPURGADDR + 31 + 5 + read-write + + + + + RGD3 + desc RGD3 + 0xC + 32 + read-write + 0x0 + 0xFFFFFFFF + + + MPURGSIZE + desc MPURGSIZE + 4 + 0 + read-write + + + MPURGADDR + desc MPURGADDR + 31 + 5 + read-write + + + + + RGD4 + desc RGD4 + 0x10 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + MPURGSIZE + desc MPURGSIZE + 4 + 0 + read-write + + + MPURGADDR + desc MPURGADDR + 31 + 5 + read-write + + + + + RGD5 + desc RGD5 + 0x14 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + MPURGSIZE + desc MPURGSIZE + 4 + 0 + read-write + + + MPURGADDR + desc MPURGADDR + 31 + 5 + read-write + + + + + RGD6 + desc RGD6 + 0x18 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + MPURGSIZE + desc MPURGSIZE + 4 + 0 + read-write + + + MPURGADDR + desc MPURGADDR + 31 + 5 + read-write + + + + + RGD7 + desc RGD7 + 0x1C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + MPURGSIZE + desc MPURGSIZE + 4 + 0 + read-write + + + MPURGADDR + desc MPURGADDR + 31 + 5 + read-write + + + + + RGD8 + desc RGD8 + 0x20 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + MPURGSIZE + desc MPURGSIZE + 4 + 0 + read-write + + + MPURGADDR + desc MPURGADDR + 31 + 5 + read-write + + + + + RGD9 + desc RGD9 + 0x24 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + MPURGSIZE + desc MPURGSIZE + 4 + 0 + read-write + + + MPURGADDR + desc MPURGADDR + 31 + 5 + read-write + + + + + RGD10 + desc RGD10 + 0x28 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + MPURGSIZE + desc MPURGSIZE + 4 + 0 + read-write + + + MPURGADDR + desc MPURGADDR + 31 + 5 + read-write + + + + + RGD11 + desc RGD11 + 0x2C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + MPURGSIZE + desc MPURGSIZE + 4 + 0 + read-write + + + MPURGADDR + desc MPURGADDR + 31 + 5 + read-write + + + + + RGD12 + desc RGD12 + 0x30 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + MPURGSIZE + desc MPURGSIZE + 4 + 0 + read-write + + + MPURGADDR + desc MPURGADDR + 31 + 5 + read-write + + + + + RGD13 + desc RGD13 + 0x34 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + MPURGSIZE + desc MPURGSIZE + 4 + 0 + read-write + + + MPURGADDR + desc MPURGADDR + 31 + 5 + read-write + + + + + RGD14 + desc RGD14 + 0x38 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + MPURGSIZE + desc MPURGSIZE + 4 + 0 + read-write + + + MPURGADDR + desc MPURGADDR + 31 + 5 + read-write + + + + + RGD15 + desc RGD15 + 0x3C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + MPURGSIZE + desc MPURGSIZE + 4 + 0 + read-write + + + MPURGADDR + desc MPURGADDR + 31 + 5 + read-write + + + + + SR + desc SR + 0x40 + 32 + read-only + 0x0 + 0x1F + + + SMPU1EAF + desc SMPU1EAF + 0 + 0 + read-only + + + SMPU2EAF + desc SMPU2EAF + 1 + 1 + read-only + + + FMPUEAF + desc FMPUEAF + 2 + 2 + read-only + + + HMPUEAF + desc HMPUEAF + 3 + 3 + read-only + + + EMPUEAF + desc EMPUEAF + 4 + 4 + read-only + + + + + ECLR + desc ECLR + 0x44 + 32 + write-only + 0x0 + 0x1F + + + SMPU1ECLR + desc SMPU1ECLR + 0 + 0 + write-only + + + SMPU2ECLR + desc SMPU2ECLR + 1 + 1 + write-only + + + FMPUECLR + desc FMPUECLR + 2 + 2 + write-only + + + HMPUECLR + desc HMPUECLR + 3 + 3 + write-only + + + EMPUECLR + desc EMPUECLR + 4 + 4 + write-only + + + + + WP + desc WP + 0x48 + 32 + read-write + 0x0 + 0xFFFF + + + MPUWE + desc MPUWE + 0 + 0 + read-write + + + WKEY + desc WKEY + 15 + 1 + write-only + + + + + IPPR + desc IPPR + 0x4C + 32 + read-write + 0x0 + 0xBFFFF3FF + + + AESRDP + desc AESRDP + 0 + 0 + read-write + + + AESWRP + desc AESWRP + 1 + 1 + read-write + + + HASHRDP + desc HASHRDP + 2 + 2 + read-write + + + HASHWRP + desc HASHWRP + 3 + 3 + read-write + + + TRNGRDP + desc TRNGRDP + 4 + 4 + read-write + + + TRNGWRP + desc TRNGWRP + 5 + 5 + read-write + + + CRCRDP + desc CRCRDP + 6 + 6 + read-write + + + CRCWRP + desc CRCWRP + 7 + 7 + read-write + + + FMCRDP + desc FMCRDP + 8 + 8 + read-write + + + FMCWRP + desc FMCWRP + 9 + 9 + read-write + + + WDTRDP + desc WDTRDP + 12 + 12 + read-write + + + WDTWRP + desc WDTWRP + 13 + 13 + read-write + + + SWDTRDP + desc SWDTRDP + 14 + 14 + read-write + + + SWDTWRP + desc SWDTWRP + 15 + 15 + read-write + + + BKSRAMRDP + desc BKSRAMRDP + 16 + 16 + read-write + + + BKSRAMWRP + desc BKSRAMWRP + 17 + 17 + read-write + + + RTCRDP + desc RTCRDP + 18 + 18 + read-write + + + RTCWRP + desc RTCWRP + 19 + 19 + read-write + + + DMPURDP + desc DMPURDP + 20 + 20 + read-write + + + DMPUWRP + desc DMPUWRP + 21 + 21 + read-write + + + SRAMCRDP + desc SRAMCRDP + 22 + 22 + read-write + + + SRAMCWRP + desc SRAMCWRP + 23 + 23 + read-write + + + INTCRDP + desc INTCRDP + 24 + 24 + read-write + + + INTCWRP + desc INTCWRP + 25 + 25 + read-write + + + SYSCRDP + desc SYSCRDP + 26 + 26 + read-write + + + SYSCWRP + desc SYSCWRP + 27 + 27 + read-write + + + MSTPRDP + desc MSTPRDP + 28 + 28 + read-write + + + MSPTWRP + desc MSPTWRP + 29 + 29 + read-write + + + BUSERRE + desc BUSERRE + 31 + 31 + read-write + + + + + S1RGE + desc S1RGE + 0x50 + 32 + read-write + 0x0 + 0xFFFF + + + S1RG0E + desc S1RG0E + 0 + 0 + read-write + + + S1RG1E + desc S1RG1E + 1 + 1 + read-write + + + S1RG2E + desc S1RG2E + 2 + 2 + read-write + + + S1RG3E + desc S1RG3E + 3 + 3 + read-write + + + S1RG4E + desc S1RG4E + 4 + 4 + read-write + + + S1RG5E + desc S1RG5E + 5 + 5 + read-write + + + S1RG6E + desc S1RG6E + 6 + 6 + read-write + + + S1RG7E + desc S1RG7E + 7 + 7 + read-write + + + S1RG8E + desc S1RG8E + 8 + 8 + read-write + + + S1RG9E + desc S1RG9E + 9 + 9 + read-write + + + S1RG10E + desc S1RG10E + 10 + 10 + read-write + + + S1RG11E + desc S1RG11E + 11 + 11 + read-write + + + S1RG12E + desc S1RG12E + 12 + 12 + read-write + + + S1RG13E + desc S1RG13E + 13 + 13 + read-write + + + S1RG14E + desc S1RG14E + 14 + 14 + read-write + + + S1RG15E + desc S1RG15E + 15 + 15 + read-write + + + + + S1RGWP + desc S1RGWP + 0x54 + 32 + read-write + 0x0 + 0xFFFF + + + S1RG0WP + desc S1RG0WP + 0 + 0 + read-write + + + S1RG1WP + desc S1RG1WP + 1 + 1 + read-write + + + S1RG2WP + desc S1RG2WP + 2 + 2 + read-write + + + S1RG3WP + desc S1RG3WP + 3 + 3 + read-write + + + S1RG4WP + desc S1RG4WP + 4 + 4 + read-write + + + S1RG5WP + desc S1RG5WP + 5 + 5 + read-write + + + S1RG6WP + desc S1RG6WP + 6 + 6 + read-write + + + S1RG7WP + desc S1RG7WP + 7 + 7 + read-write + + + S1RG8WP + desc S1RG8WP + 8 + 8 + read-write + + + S1RG9WP + desc S1RG9WP + 9 + 9 + read-write + + + S1RG10WP + desc S1RG10WP + 10 + 10 + read-write + + + S1RG11WP + desc S1RG11WP + 11 + 11 + read-write + + + S1RG12WP + desc S1RG12WP + 12 + 12 + read-write + + + S1RG13WP + desc S1RG13WP + 13 + 13 + read-write + + + S1RG14WP + desc S1RG14WP + 14 + 14 + read-write + + + S1RG15WP + desc S1RG15WP + 15 + 15 + read-write + + + + + S1RGRP + desc S1RGRP + 0x58 + 32 + read-write + 0x0 + 0xFFFF + + + S1RG0RP + desc S1RG0RP + 0 + 0 + read-write + + + S1RG1RP + desc S1RG1RP + 1 + 1 + read-write + + + S1RG2RP + desc S1RG2RP + 2 + 2 + read-write + + + S1RG3RP + desc S1RG3RP + 3 + 3 + read-write + + + S1RG4RP + desc S1RG4RP + 4 + 4 + read-write + + + S1RG5RP + desc S1RG5RP + 5 + 5 + read-write + + + S1RG6RP + desc S1RG6RP + 6 + 6 + read-write + + + S1RG7RP + desc S1RG7RP + 7 + 7 + read-write + + + S1RG8RP + desc S1RG8RP + 8 + 8 + read-write + + + S1RG9RP + desc S1RG9RP + 9 + 9 + read-write + + + S1RG10RP + desc S1RG10RP + 10 + 10 + read-write + + + S1RG11RP + desc S1RG11RP + 11 + 11 + read-write + + + S1RG12RP + desc S1RG12RP + 12 + 12 + read-write + + + S1RG13RP + desc S1RG13RP + 13 + 13 + read-write + + + S1RG14RP + desc S1RG14RP + 14 + 14 + read-write + + + S1RG15RP + desc S1RG15RP + 15 + 15 + read-write + + + + + S1CR + desc S1CR + 0x5C + 32 + read-write + 0x0 + 0x8F + + + SMPU1BRP + desc SMPU1BRP + 0 + 0 + read-write + + + SMPU1BWP + desc SMPU1BWP + 1 + 1 + read-write + + + SMPU1ACT + desc SMPU1ACT + 3 + 2 + read-write + + + SMPU1E + desc SMPU1E + 7 + 7 + read-write + + + + + S2RGE + desc S2RGE + 0x60 + 32 + read-write + 0x0 + 0xFFFF + + + S2RG0E + desc S2RG0E + 0 + 0 + read-write + + + S2RG1E + desc S2RG1E + 1 + 1 + read-write + + + S2RG2E + desc S2RG2E + 2 + 2 + read-write + + + S2RG3E + desc S2RG3E + 3 + 3 + read-write + + + S2RG4E + desc S2RG4E + 4 + 4 + read-write + + + S2RG5E + desc S2RG5E + 5 + 5 + read-write + + + S2RG6E + desc S2RG6E + 6 + 6 + read-write + + + S2RG7E + desc S2RG7E + 7 + 7 + read-write + + + S2RG8E + desc S2RG8E + 8 + 8 + read-write + + + S2RG9E + desc S2RG9E + 9 + 9 + read-write + + + S2RG10E + desc S2RG10E + 10 + 10 + read-write + + + S2RG11E + desc S2RG11E + 11 + 11 + read-write + + + S2RG12E + desc S2RG12E + 12 + 12 + read-write + + + S2RG13E + desc S2RG13E + 13 + 13 + read-write + + + S2RG14E + desc S2RG14E + 14 + 14 + read-write + + + S2RG15E + desc S2RG15E + 15 + 15 + read-write + + + + + S2RGWP + desc S2RGWP + 0x64 + 32 + read-write + 0x0 + 0xFFFF + + + S2RG0WP + desc S2RG0WP + 0 + 0 + read-write + + + S2RG1WP + desc S2RG1WP + 1 + 1 + read-write + + + S2RG2WP + desc S2RG2WP + 2 + 2 + read-write + + + S2RG3WP + desc S2RG3WP + 3 + 3 + read-write + + + S2RG4WP + desc S2RG4WP + 4 + 4 + read-write + + + S2RG5WP + desc S2RG5WP + 5 + 5 + read-write + + + S2RG6WP + desc S2RG6WP + 6 + 6 + read-write + + + S2RG7WP + desc S2RG7WP + 7 + 7 + read-write + + + S2RG8WP + desc S2RG8WP + 8 + 8 + read-write + + + S2RG9WP + desc S2RG9WP + 9 + 9 + read-write + + + S2RG10WP + desc S2RG10WP + 10 + 10 + read-write + + + S2RG11WP + desc S2RG11WP + 11 + 11 + read-write + + + S2RG12WP + desc S2RG12WP + 12 + 12 + read-write + + + S2RG13WP + desc S2RG13WP + 13 + 13 + read-write + + + S2RG14WP + desc S2RG14WP + 14 + 14 + read-write + + + S2RG15WP + desc S2RG15WP + 15 + 15 + read-write + + + + + S2RGRP + desc S2RGRP + 0x68 + 32 + read-write + 0x0 + 0xFFFF + + + S2RG0RP + desc S2RG0RP + 0 + 0 + read-write + + + S2RG1RP + desc S2RG1RP + 1 + 1 + read-write + + + S2RG2RP + desc S2RG2RP + 2 + 2 + read-write + + + S2RG3RP + desc S2RG3RP + 3 + 3 + read-write + + + S2RG4RP + desc S2RG4RP + 4 + 4 + read-write + + + S2RG5RP + desc S2RG5RP + 5 + 5 + read-write + + + S2RG6RP + desc S2RG6RP + 6 + 6 + read-write + + + S2RG7RP + desc S2RG7RP + 7 + 7 + read-write + + + S2RG8RP + desc S2RG8RP + 8 + 8 + read-write + + + S2RG9RP + desc S2RG9RP + 9 + 9 + read-write + + + S2RG10RP + desc S2RG10RP + 10 + 10 + read-write + + + S2RG11RP + desc S2RG11RP + 11 + 11 + read-write + + + S2RG12RP + desc S2RG12RP + 12 + 12 + read-write + + + S2RG13RP + desc S2RG13RP + 13 + 13 + read-write + + + S2RG14RP + desc S2RG14RP + 14 + 14 + read-write + + + S2RG15RP + desc S2RG15RP + 15 + 15 + read-write + + + + + S2CR + desc S2CR + 0x6C + 32 + read-write + 0x0 + 0x8F + + + SMPU2BRP + desc SMPU2BRP + 0 + 0 + read-write + + + SMPU2BWP + desc SMPU2BWP + 1 + 1 + read-write + + + SMPU2ACT + desc SMPU2ACT + 3 + 2 + read-write + + + SMPU2E + desc SMPU2E + 7 + 7 + read-write + + + + + FRGE + desc FRGE + 0x70 + 32 + read-write + 0x0 + 0xFF + + + FMPU0E + desc FMPU0E + 0 + 0 + read-write + + + FMPU1E + desc FMPU1E + 1 + 1 + read-write + + + FMPU2E + desc FMPU2E + 2 + 2 + read-write + + + FMPU3E + desc FMPU3E + 3 + 3 + read-write + + + FMPU4E + desc FMPU4E + 4 + 4 + read-write + + + FMPU5E + desc FMPU5E + 5 + 5 + read-write + + + FMPU6E + desc FMPU6E + 6 + 6 + read-write + + + FMPU7E + desc FMPU7E + 7 + 7 + read-write + + + + + FRGWP + desc FRGWP + 0x74 + 32 + read-write + 0x0 + 0xFF + + + FMPU0WP + desc FMPU0WP + 0 + 0 + read-write + + + FMPU1WP + desc FMPU1WP + 1 + 1 + read-write + + + FMPU2WP + desc FMPU2WP + 2 + 2 + read-write + + + FMPU3WP + desc FMPU3WP + 3 + 3 + read-write + + + FMPU4WP + desc FMPU4WP + 4 + 4 + read-write + + + FMPU5WP + desc FMPU5WP + 5 + 5 + read-write + + + FMPU6WP + desc FMPU6WP + 6 + 6 + read-write + + + FMPU7WP + desc FMPU7WP + 7 + 7 + read-write + + + + + FRGRP + desc FRGRP + 0x78 + 32 + read-write + 0x0 + 0xFF + + + FMPU0RP + desc FMPU0RP + 0 + 0 + read-write + + + FMPU1RP + desc FMPU1RP + 1 + 1 + read-write + + + FMPU2RP + desc FMPU2RP + 2 + 2 + read-write + + + FMPU3RP + desc FMPU3RP + 3 + 3 + read-write + + + FMPU4RP + desc FMPU4RP + 4 + 4 + read-write + + + FMPU5RP + desc FMPU5RP + 5 + 5 + read-write + + + FMPU6RP + desc FMPU6RP + 6 + 6 + read-write + + + FMPU7RP + desc FMPU7RP + 7 + 7 + read-write + + + + + FCR + desc FCR + 0x7C + 32 + read-write + 0x0 + 0x8F + + + FMPUBRP + desc FMPUBRP + 0 + 0 + read-write + + + FMPUBWP + desc FMPUBWP + 1 + 1 + read-write + + + FMPUACT + desc FMPUACT + 3 + 2 + read-write + + + FMPUE + desc FMPUE + 7 + 7 + read-write + + + + + HRGE + desc HRGE + 0x80 + 32 + read-write + 0x0 + 0xFF + + + HMPU0E + desc HMPU0E + 0 + 0 + read-write + + + HMPU1E + desc HMPU1E + 1 + 1 + read-write + + + HMPU2E + desc HMPU2E + 2 + 2 + read-write + + + HMPU3E + desc HMPU3E + 3 + 3 + read-write + + + HMPU4E + desc HMPU4E + 4 + 4 + read-write + + + HMPU5E + desc HMPU5E + 5 + 5 + read-write + + + HMPU6E + desc HMPU6E + 6 + 6 + read-write + + + HMPU7E + desc HMPU7E + 7 + 7 + read-write + + + + + HRGWP + desc HRGWP + 0x84 + 32 + read-write + 0x0 + 0xFF + + + HMPU0WP + desc HMPU0WP + 0 + 0 + read-write + + + HMPU1WP + desc HMPU1WP + 1 + 1 + read-write + + + HMPU2WP + desc HMPU2WP + 2 + 2 + read-write + + + HMPU3WP + desc HMPU3WP + 3 + 3 + read-write + + + HMPU4WP + desc HMPU4WP + 4 + 4 + read-write + + + HMPU5WP + desc HMPU5WP + 5 + 5 + read-write + + + HMPU6WP + desc HMPU6WP + 6 + 6 + read-write + + + HMPU7WP + desc HMPU7WP + 7 + 7 + read-write + + + + + HRGRP + desc HRGRP + 0x88 + 32 + read-write + 0x0 + 0xFF + + + HMPU0RP + desc HMPU0RP + 0 + 0 + read-write + + + HMPU1RP + desc HMPU1RP + 1 + 1 + read-write + + + HMPU2RP + desc HMPU2RP + 2 + 2 + read-write + + + HMPU3RP + desc HMPU3RP + 3 + 3 + read-write + + + HMPU4RP + desc HMPU4RP + 4 + 4 + read-write + + + HMPU5RP + desc HMPU5RP + 5 + 5 + read-write + + + HMPU6RP + desc HMPU6RP + 6 + 6 + read-write + + + HMPU7RP + desc HMPU7RP + 7 + 7 + read-write + + + + + HCR + desc HCR + 0x8C + 32 + read-write + 0x0 + 0x8F + + + HMPUBRP + desc HMPUBRP + 0 + 0 + read-write + + + HMPUBWP + desc HMPUBWP + 1 + 1 + read-write + + + HMPUACT + desc HMPUACT + 3 + 2 + read-write + + + HMPUE + desc HMPUE + 7 + 7 + read-write + + + + + ERGE + desc ERGE + 0x90 + 32 + read-write + 0x0 + 0xFF + + + EMPU0E + desc EMPU0E + 0 + 0 + read-write + + + EMPU1E + desc EMPU1E + 1 + 1 + read-write + + + EMPU2E + desc EMPU2E + 2 + 2 + read-write + + + EMPU3E + desc EMPU3E + 3 + 3 + read-write + + + EMPU4E + desc EMPU4E + 4 + 4 + read-write + + + EMPU5E + desc EMPU5E + 5 + 5 + read-write + + + EMPU6E + desc EMPU6E + 6 + 6 + read-write + + + EMPU7E + desc EMPU7E + 7 + 7 + read-write + + + + + ERGWP + desc ERGWP + 0x94 + 32 + read-write + 0x0 + 0xFF + + + EMPU0WP + desc EMPU0WP + 0 + 0 + read-write + + + EMPU1WP + desc EMPU1WP + 1 + 1 + read-write + + + EMPU2WP + desc EMPU2WP + 2 + 2 + read-write + + + EMPU3WP + desc EMPU3WP + 3 + 3 + read-write + + + EMPU4WP + desc EMPU4WP + 4 + 4 + read-write + + + EMPU5WP + desc EMPU5WP + 5 + 5 + read-write + + + EMPU6WP + desc EMPU6WP + 6 + 6 + read-write + + + EMPU7WP + desc EMPU7WP + 7 + 7 + read-write + + + + + ERGRP + desc ERGRP + 0x98 + 32 + read-write + 0x0 + 0xFF + + + EMPU0RP + desc EMPU0RP + 0 + 0 + read-write + + + EMPU1RP + desc EMPU1RP + 1 + 1 + read-write + + + EMPU2RP + desc EMPU2RP + 2 + 2 + read-write + + + EMPU3RP + desc EMPU3RP + 3 + 3 + read-write + + + EMPU4RP + desc EMPU4RP + 4 + 4 + read-write + + + EMPU5RP + desc EMPU5RP + 5 + 5 + read-write + + + EMPU6RP + desc EMPU6RP + 6 + 6 + read-write + + + EMPU7RP + desc EMPU7RP + 7 + 7 + read-write + + + + + ECR + desc ECR + 0x9C + 32 + read-write + 0x0 + 0x8F + + + EMPUBRP + desc EMPUBRP + 0 + 0 + read-write + + + EMPUBWP + desc EMPUBWP + 1 + 1 + read-write + + + EMPUACT + desc EMPUACT + 3 + 2 + read-write + + + EMPUE + desc EMPUE + 7 + 7 + read-write + + + + + + + NFC + desc NFC + 0x88100000 + + 0x0 + 0x8180 + + + + CMDR + desc CMDR + 0x8000 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + CMD + desc CMD + 7 + 0 + read-write + + + ARG + desc ARG + 31 + 8 + read-write + + + + + IDXR0 + desc IDXR0 + 0x8004 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + IENR + desc IENR + 0x8030 + 32 + read-write + 0x0 + 0x800000D3 + + + ECCEUEN + desc ECCEUEN + 0 + 0 + read-write + + + ECCECEN + desc ECCECEN + 1 + 1 + read-write + + + ECCCEN + desc ECCCEN + 4 + 4 + read-write + + + ECCEEN + desc ECCEEN + 6 + 6 + read-write + + + ECCDIS + desc ECCDIS + 7 + 7 + read-write + + + RBEN + desc RBEN + 15 + 8 + read-write + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ISTR + desc ISTR + 0x8034 + 32 + read-write + 0x0 + 0x8000FF53 + + + ECCEUST + desc ECCEUST + 0 + 0 + read-write + + + ECCECST + desc ECCECST + 1 + 1 + read-write + + + ECCCST + desc ECCCST + 4 + 4 + read-write + + + ECCEST + desc ECCEST + 6 + 6 + read-write + + + RBST + desc RBST + 15 + 8 + read-write + + + RESV + desc RESV + 31 + 31 + read-write + + + + + IRSR + desc IRSR + 0x8038 + 32 + read-write + 0x0 + 0x8000FF53 + + + ECCEURS + desc ECCEURS + 0 + 0 + read-write + + + ECCECRS + desc ECCECRS + 1 + 1 + read-write + + + ECCCRS + desc ECCCRS + 4 + 4 + read-write + + + ECCERS + desc ECCERS + 6 + 6 + read-write + + + RBRS + desc RBRS + 15 + 8 + read-write + + + RESV + desc RESV + 31 + 31 + read-write + + + + + IDXR1 + desc IDXR1 + 0x8048 + 32 + read-write + 0x0 + 0x800000FF + + + IDX1 + desc IDX1 + 7 + 0 + read-write + + + RESV + desc RESV + 31 + 31 + read-write + + + + + TMCR0 + desc TMCR0 + 0x804C + 32 + read-write + 0x3030202 + 0xFFFFFFFF + + + TS + desc TS + 7 + 0 + read-write + + + TWP + desc TWP + 15 + 8 + read-write + + + TRP + desc TRP + 23 + 16 + read-write + + + TH + desc TH + 31 + 24 + read-write + + + + + TMCR1 + desc TMCR1 + 0x8050 + 32 + read-write + 0x28080303 + 0xFFFFFFFF + + + TWH + desc TWH + 7 + 0 + read-write + + + TRH + desc TRH + 15 + 8 + read-write + + + TRR + desc TRR + 23 + 16 + read-write + + + TWB + desc TWB + 31 + 24 + read-write + + + + + BACR + desc BACR + 0x8054 + 32 + read-write + 0x2187 + 0x81FF3FCF + + + SIZE + desc SIZE + 2 + 0 + read-write + + + B16BIT + desc B16BIT + 3 + 3 + read-write + + + BANK + desc BANK + 7 + 6 + read-write + + + PAGE + desc PAGE + 9 + 8 + read-write + + + WP + desc WP + 10 + 10 + read-write + + + ECCM + desc ECCM + 12 + 11 + read-write + + + RAC + desc RAC + 13 + 13 + read-write + + + SCS + desc SCS + 23 + 16 + read-write + + + RESV7 + desc RESV7 + 24 + 24 + read-write + + + RESV + desc RESV + 31 + 31 + read-write + + + + + TMCR2 + desc TMCR2 + 0x805C + 32 + read-write + 0x3050D03 + 0xFFFFFFFF + + + TCCS + desc TCCS + 7 + 0 + read-write + + + TWTR + desc TWTR + 15 + 8 + read-write + + + TRTW + desc TRTW + 23 + 16 + read-write + + + TADL + desc TADL + 31 + 24 + read-write + + + + + ECCR0 + desc ECCR0 + 0x8060 + 32 + read-only + 0x0 + 0x80003FFF + + + ERRLOC + desc ERRLOC + 11 + 0 + read-only + + + SE + desc SE + 12 + 12 + read-only + + + ME + desc ME + 13 + 13 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECCR1 + desc ECCR1 + 0x8064 + 32 + read-only + 0x0 + 0x80003FFF + + + ERRLOC + desc ERRLOC + 11 + 0 + read-only + + + SE + desc SE + 12 + 12 + read-only + + + ME + desc ME + 13 + 13 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECCR2 + desc ECCR2 + 0x8068 + 32 + read-only + 0x0 + 0x80003FFF + + + ERRLOC + desc ERRLOC + 11 + 0 + read-only + + + SE + desc SE + 12 + 12 + read-only + + + ME + desc ME + 13 + 13 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECCR3 + desc ECCR3 + 0x806C + 32 + read-only + 0x0 + 0x80003FFF + + + ERRLOC + desc ERRLOC + 11 + 0 + read-only + + + SE + desc SE + 12 + 12 + read-only + + + ME + desc ME + 13 + 13 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECCR4 + desc ECCR4 + 0x8070 + 32 + read-only + 0x0 + 0x80003FFF + + + ERRLOC + desc ERRLOC + 11 + 0 + read-only + + + SE + desc SE + 12 + 12 + read-only + + + ME + desc ME + 13 + 13 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECCR5 + desc ECCR5 + 0x8074 + 32 + read-only + 0x0 + 0x80003FFF + + + ERRLOC + desc ERRLOC + 11 + 0 + read-only + + + SE + desc SE + 12 + 12 + read-only + + + ME + desc ME + 13 + 13 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECCR6 + desc ECCR6 + 0x8078 + 32 + read-only + 0x0 + 0x80003FFF + + + ERRLOC + desc ERRLOC + 11 + 0 + read-only + + + SE + desc SE + 12 + 12 + read-only + + + ME + desc ME + 13 + 13 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_STAT + desc ECC_STAT + 0x807C + 32 + read-only + 0x0 + 0x8000FFFF + + + ERRSEC + desc ERRSEC + 15 + 0 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND0_0 + desc ECC_SYND0_0 + 0x8080 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S1 + desc S1 + 12 + 0 + read-only + + + S2 + desc S2 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND0_1 + desc ECC_SYND0_1 + 0x8084 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S3 + desc S3 + 12 + 0 + read-only + + + S4 + desc S4 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND0_2 + desc ECC_SYND0_2 + 0x8088 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S5 + desc S5 + 12 + 0 + read-only + + + S6 + desc S6 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND0_3 + desc ECC_SYND0_3 + 0x808C + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S7 + desc S7 + 12 + 0 + read-only + + + S8 + desc S8 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND1_0 + desc ECC_SYND1_0 + 0x8090 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S1 + desc S1 + 12 + 0 + read-only + + + S2 + desc S2 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND1_1 + desc ECC_SYND1_1 + 0x8094 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S3 + desc S3 + 12 + 0 + read-only + + + S4 + desc S4 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND1_2 + desc ECC_SYND1_2 + 0x8098 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S5 + desc S5 + 12 + 0 + read-only + + + S6 + desc S6 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND1_3 + desc ECC_SYND1_3 + 0x809C + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S7 + desc S7 + 12 + 0 + read-only + + + S8 + desc S8 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND2_0 + desc ECC_SYND2_0 + 0x80A0 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S1 + desc S1 + 12 + 0 + read-only + + + S2 + desc S2 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND2_1 + desc ECC_SYND2_1 + 0x80A4 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S3 + desc S3 + 12 + 0 + read-only + + + S4 + desc S4 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND2_2 + desc ECC_SYND2_2 + 0x80A8 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S5 + desc S5 + 12 + 0 + read-only + + + S6 + desc S6 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND2_3 + desc ECC_SYND2_3 + 0x80AC + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S7 + desc S7 + 12 + 0 + read-only + + + S8 + desc S8 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND3_0 + desc ECC_SYND3_0 + 0x80B0 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S1 + desc S1 + 12 + 0 + read-only + + + S2 + desc S2 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND3_1 + desc ECC_SYND3_1 + 0x80B4 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S3 + desc S3 + 12 + 0 + read-only + + + S4 + desc S4 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND3_2 + desc ECC_SYND3_2 + 0x80B8 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S5 + desc S5 + 12 + 0 + read-only + + + S6 + desc S6 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND3_3 + desc ECC_SYND3_3 + 0x80BC + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S7 + desc S7 + 12 + 0 + read-only + + + S8 + desc S8 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND4_0 + desc ECC_SYND4_0 + 0x80C0 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S1 + desc S1 + 12 + 0 + read-only + + + S2 + desc S2 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND4_1 + desc ECC_SYND4_1 + 0x80C4 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S3 + desc S3 + 12 + 0 + read-only + + + S4 + desc S4 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND4_2 + desc ECC_SYND4_2 + 0x80C8 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S5 + desc S5 + 12 + 0 + read-only + + + S6 + desc S6 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND4_3 + desc ECC_SYND4_3 + 0x80CC + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S7 + desc S7 + 12 + 0 + read-only + + + S8 + desc S8 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND5_0 + desc ECC_SYND5_0 + 0x80D0 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S1 + desc S1 + 12 + 0 + read-only + + + S2 + desc S2 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND5_1 + desc ECC_SYND5_1 + 0x80D4 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S3 + desc S3 + 12 + 0 + read-only + + + S4 + desc S4 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND5_2 + desc ECC_SYND5_2 + 0x80D8 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S5 + desc S5 + 12 + 0 + read-only + + + S6 + desc S6 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND5_3 + desc ECC_SYND5_3 + 0x80DC + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S7 + desc S7 + 12 + 0 + read-only + + + S8 + desc S8 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND6_0 + desc ECC_SYND6_0 + 0x80E0 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S1 + desc S1 + 12 + 0 + read-only + + + S2 + desc S2 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND6_1 + desc ECC_SYND6_1 + 0x80E4 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S3 + desc S3 + 12 + 0 + read-only + + + S4 + desc S4 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND6_2 + desc ECC_SYND6_2 + 0x80E8 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S5 + desc S5 + 12 + 0 + read-only + + + S6 + desc S6 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND6_3 + desc ECC_SYND6_3 + 0x80EC + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S7 + desc S7 + 12 + 0 + read-only + + + S8 + desc S8 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND7_0 + desc ECC_SYND7_0 + 0x80F0 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S1 + desc S1 + 12 + 0 + read-only + + + S2 + desc S2 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND7_1 + desc ECC_SYND7_1 + 0x80F4 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S3 + desc S3 + 12 + 0 + read-only + + + S4 + desc S4 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND7_2 + desc ECC_SYND7_2 + 0x80F8 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S5 + desc S5 + 12 + 0 + read-only + + + S6 + desc S6 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND7_3 + desc ECC_SYND7_3 + 0x80FC + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S7 + desc S7 + 12 + 0 + read-only + + + S8 + desc S8 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND8_0 + desc ECC_SYND8_0 + 0x8100 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S1 + desc S1 + 12 + 0 + read-only + + + S2 + desc S2 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND8_1 + desc ECC_SYND8_1 + 0x8104 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S3 + desc S3 + 12 + 0 + read-only + + + S4 + desc S4 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND8_2 + desc ECC_SYND8_2 + 0x8108 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S5 + desc S5 + 12 + 0 + read-only + + + S6 + desc S6 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND8_3 + desc ECC_SYND8_3 + 0x810C + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S7 + desc S7 + 12 + 0 + read-only + + + S8 + desc S8 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND9_0 + desc ECC_SYND9_0 + 0x8110 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S1 + desc S1 + 12 + 0 + read-only + + + S2 + desc S2 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND9_1 + desc ECC_SYND9_1 + 0x8114 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S3 + desc S3 + 12 + 0 + read-only + + + S4 + desc S4 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND9_2 + desc ECC_SYND9_2 + 0x8118 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S5 + desc S5 + 12 + 0 + read-only + + + S6 + desc S6 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND9_3 + desc ECC_SYND9_3 + 0x811C + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S7 + desc S7 + 12 + 0 + read-only + + + S8 + desc S8 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND10_0 + desc ECC_SYND10_0 + 0x8120 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S1 + desc S1 + 12 + 0 + read-only + + + S2 + desc S2 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND10_1 + desc ECC_SYND10_1 + 0x8124 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S3 + desc S3 + 12 + 0 + read-only + + + S4 + desc S4 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND10_2 + desc ECC_SYND10_2 + 0x8128 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S5 + desc S5 + 12 + 0 + read-only + + + S6 + desc S6 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND10_3 + desc ECC_SYND10_3 + 0x812C + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S7 + desc S7 + 12 + 0 + read-only + + + S8 + desc S8 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND11_0 + desc ECC_SYND11_0 + 0x8130 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S1 + desc S1 + 12 + 0 + read-only + + + S2 + desc S2 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND11_1 + desc ECC_SYND11_1 + 0x8134 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S3 + desc S3 + 12 + 0 + read-only + + + S4 + desc S4 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND11_2 + desc ECC_SYND11_2 + 0x8138 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S5 + desc S5 + 12 + 0 + read-only + + + S6 + desc S6 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND11_3 + desc ECC_SYND11_3 + 0x813C + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S7 + desc S7 + 12 + 0 + read-only + + + S8 + desc S8 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND12_0 + desc ECC_SYND12_0 + 0x8140 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S1 + desc S1 + 12 + 0 + read-only + + + S2 + desc S2 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND12_1 + desc ECC_SYND12_1 + 0x8144 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S3 + desc S3 + 12 + 0 + read-only + + + S4 + desc S4 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND12_2 + desc ECC_SYND12_2 + 0x8148 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S5 + desc S5 + 12 + 0 + read-only + + + S6 + desc S6 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND12_3 + desc ECC_SYND12_3 + 0x814C + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S7 + desc S7 + 12 + 0 + read-only + + + S8 + desc S8 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND13_0 + desc ECC_SYND13_0 + 0x8150 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S1 + desc S1 + 12 + 0 + read-only + + + S2 + desc S2 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND13_1 + desc ECC_SYND13_1 + 0x8154 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S3 + desc S3 + 12 + 0 + read-only + + + S4 + desc S4 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND13_2 + desc ECC_SYND13_2 + 0x8158 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S5 + desc S5 + 12 + 0 + read-only + + + S6 + desc S6 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND13_3 + desc ECC_SYND13_3 + 0x815C + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S7 + desc S7 + 12 + 0 + read-only + + + S8 + desc S8 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND14_0 + desc ECC_SYND14_0 + 0x8160 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S1 + desc S1 + 12 + 0 + read-only + + + S2 + desc S2 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND14_1 + desc ECC_SYND14_1 + 0x8164 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S3 + desc S3 + 12 + 0 + read-only + + + S4 + desc S4 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND14_2 + desc ECC_SYND14_2 + 0x8168 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S5 + desc S5 + 12 + 0 + read-only + + + S6 + desc S6 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND14_3 + desc ECC_SYND14_3 + 0x816C + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S7 + desc S7 + 12 + 0 + read-only + + + S8 + desc S8 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND15_0 + desc ECC_SYND15_0 + 0x8170 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S1 + desc S1 + 12 + 0 + read-only + + + S2 + desc S2 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND15_1 + desc ECC_SYND15_1 + 0x8174 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S3 + desc S3 + 12 + 0 + read-only + + + S4 + desc S4 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND15_2 + desc ECC_SYND15_2 + 0x8178 + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S5 + desc S5 + 12 + 0 + read-only + + + S6 + desc S6 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + ECC_SYND15_3 + desc ECC_SYND15_3 + 0x817C + 32 + read-only + 0x0 + 0x9FFF1FFF + + + S7 + desc S7 + 12 + 0 + read-only + + + S8 + desc S8 + 28 + 16 + read-only + + + RESV + desc RESV + 31 + 31 + read-write + + + + + + + OTS + desc OTS + 0x4004A800 + + 0x0 + 0xC + + + + CTL + desc CTL + 0x0 + 16 + read-write + 0x0 + 0xF + + + OTSST + desc OTSST + 0 + 0 + read-write + + + OTSCK + desc OTSCK + 1 + 1 + read-write + + + OTSIE + desc OTSIE + 2 + 2 + read-write + + + TSSTP + desc TSSTP + 3 + 3 + read-write + + + + + DR1 + desc DR1 + 0x2 + 16 + read-write + 0x0 + 0xFFFF + + + DR2 + desc DR2 + 0x4 + 16 + read-write + 0x0 + 0xFFFF + + + ECR + desc ECR + 0x6 + 16 + read-write + 0x0 + 0xFFFF + + + LPR + desc LPR + 0x8 + 32 + read-only + 0xFFFFFFFF + 0xFFFFFFFF + + + TSOFS + desc TSOFS + 7 + 0 + read-only + + + TSSLP + desc TSSLP + 31 + 8 + read-only + + + + + + + PERIC + desc PERIC + 0x40055400 + + 0x0 + 0x10 + + + + USB_SYCTLREG + desc USB_SYCTLREG + 0x0 + 32 + read-write + 0x0 + 0x7070703 + + + USBFS_DFB + desc USBFS_DFB + 0 + 0 + read-write + + + USBFS_SOFEN + desc USBFS_SOFEN + 1 + 1 + read-write + + + USBHS_DFB + desc USBHS_DFB + 8 + 8 + read-write + + + USBHS_SOFEN + desc USBHS_SOFEN + 9 + 9 + read-write + + + USBHS_FSPHYE + desc USBHS_FSPHYE + 10 + 10 + read-write + + + USBFS_NFS + desc USBFS_NFS + 17 + 16 + read-write + + + USBFS_NFE + desc USBFS_NFE + 18 + 18 + read-write + + + USBHS_NFS + desc USBHS_NFS + 25 + 24 + read-write + + + USBHS_NFE + desc USBHS_NFE + 26 + 26 + read-write + + + + + SDIOC_SYCTLREG + desc SDIOC_SYCTLREG + 0x4 + 32 + read-write + 0x0 + 0xF + + + SELMMC1 + desc SELMMC1 + 1 + 1 + read-write + + + SELMMC2 + desc SELMMC2 + 3 + 3 + read-write + + + + + NFC_SYCTLREG + desc NFC_SYCTLREG + 0x8 + 32 + read-write + 0x0 + 0x1 + + + OPO + desc OPO + 0 + 0 + read-write + + + + + EXMC_ENAR + desc EXMC_ENAR + 0xC + 32 + read-write + 0x0 + 0x4 + + + DMCEN + desc DMCEN + 0 + 0 + read-write + + + SMCEN + desc SMCEN + 1 + 1 + read-write + + + NFCEN + desc NFCEN + 2 + 2 + read-write + + + + + CAN_SYCTLREG + desc CAN_SYCTLREG + 0x18 + 32 + read-write + 0x2 + 0x3 + + + CAN1FDE + desc CAN1FDE + 0 + 0 + read-write + + + CAN2FDE + desc CAN2FDE + 1 + 1 + read-write + + + + + USART1_NFC + desc USART1_NFC + 0x1C + 32 + read-write + 0x0 + 0x7 + + + NFS + desc NFS + 1 + 0 + read-write + + + NFE + desc NFE + 2 + 2 + read-write + + + + + NFC_SYSTATREG + desc NFC_SYSTATREG + 0x28 + 32 + read-write + 0x0 + 0x1FF + + + CHIPBUSY + desc CHIPBUSY + 7 + 0 + read-write + + + PECC + desc PECC + 8 + 8 + read-write + + + + + + + PWC + desc PWC + 0x40048000 + + 0x0 + 0xC400 + + + + FCG0 + desc FCG0 + 0x0 + 32 + read-write + 0xFFFFFA0E + 0xFFFFE4F1 + + + SRAMH + desc SRAMH + 0 + 0 + read-write + + + SRAM1 + desc SRAM1 + 4 + 4 + read-write + + + SRAM2 + desc SRAM2 + 5 + 5 + read-write + + + SRAM3 + desc SRAM3 + 6 + 6 + read-write + + + SRAM4 + desc SRAM4 + 7 + 7 + read-write + + + SRAMB + desc SRAMB + 10 + 10 + read-write + + + KEY + desc KEY + 13 + 13 + read-write + + + DMA1 + desc DMA1 + 14 + 14 + read-write + + + DMA2 + desc DMA2 + 15 + 15 + read-write + + + FCM + desc FCM + 16 + 16 + read-write + + + AOS + desc AOS + 17 + 17 + read-write + + + CTC + desc CTC + 18 + 18 + read-write + + + CORDIC + desc CORDIC + 19 + 19 + read-write + + + AES + desc AES + 20 + 20 + read-write + + + HASH + desc HASH + 21 + 21 + read-write + + + TRNG + desc TRNG + 22 + 22 + read-write + + + CRC + desc CRC + 23 + 23 + read-write + + + DCU1 + desc DCU1 + 24 + 24 + read-write + + + DCU2 + desc DCU2 + 25 + 25 + read-write + + + DCU3 + desc DCU3 + 26 + 26 + read-write + + + DCU4 + desc DCU4 + 27 + 27 + read-write + + + DCU5 + desc DCU5 + 28 + 28 + read-write + + + DCU6 + desc DCU6 + 29 + 29 + read-write + + + DCU7 + desc DCU7 + 30 + 30 + read-write + + + DCU8 + desc DCU8 + 31 + 31 + read-write + + + + + FCG1 + desc FCG1 + 0x4 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFF + + + CAN1 + desc CAN1 + 0 + 0 + read-write + + + CAN2 + desc CAN2 + 1 + 1 + read-write + + + ETHER + desc ETHER + 2 + 2 + read-write + + + QSPI + desc QSPI + 3 + 3 + read-write + + + IIC1 + desc IIC1 + 4 + 4 + read-write + + + IIC2 + desc IIC2 + 5 + 5 + read-write + + + IIC3 + desc IIC3 + 6 + 6 + read-write + + + IIC4 + desc IIC4 + 7 + 7 + read-write + + + IIC5 + desc IIC5 + 8 + 8 + read-write + + + IIC6 + desc IIC6 + 9 + 9 + read-write + + + SDIOC1 + desc SDIOC1 + 10 + 10 + read-write + + + SDIOC2 + desc SDIOC2 + 11 + 11 + read-write + + + I2S1 + desc I2S1 + 12 + 12 + read-write + + + I2S2 + desc I2S2 + 13 + 13 + read-write + + + I2S3 + desc I2S3 + 14 + 14 + read-write + + + I2S4 + desc I2S4 + 15 + 15 + read-write + + + SPI1 + desc SPI1 + 16 + 16 + read-write + + + SPI2 + desc SPI2 + 17 + 17 + read-write + + + SPI3 + desc SPI3 + 18 + 18 + read-write + + + SPI4 + desc SPI4 + 19 + 19 + read-write + + + SPI5 + desc SPI5 + 20 + 20 + read-write + + + SPI6 + desc SPI6 + 21 + 21 + read-write + + + USBFS + desc USBFS + 22 + 22 + read-write + + + USBHS + desc USBHS + 23 + 23 + read-write + + + FMAC1 + desc FMAC1 + 24 + 24 + read-write + + + FMAC2 + desc FMAC2 + 25 + 25 + read-write + + + FMAC3 + desc FMAC3 + 26 + 26 + read-write + + + FMAC4 + desc FMAC4 + 27 + 27 + read-write + + + + + FCG2 + desc FCG2 + 0x8 + 32 + read-write + 0xFFFFFFFF + 0xFFFFBFFF + + + TMR6_1 + desc TMR6_1 + 0 + 0 + read-write + + + TMR6_2 + desc TMR6_2 + 1 + 1 + read-write + + + TMR6_3 + desc TMR6_3 + 2 + 2 + read-write + + + TMR6_4 + desc TMR6_4 + 3 + 3 + read-write + + + TMR6_5 + desc TMR6_5 + 4 + 4 + read-write + + + TMR6_6 + desc TMR6_6 + 5 + 5 + read-write + + + TMR6_7 + desc TMR6_7 + 6 + 6 + read-write + + + TMR6_8 + desc TMR6_8 + 7 + 7 + read-write + + + TMR4_1 + desc TMR4_1 + 8 + 8 + read-write + + + TMR4_2 + desc TMR4_2 + 9 + 9 + read-write + + + TMR4_3 + desc TMR4_3 + 10 + 10 + read-write + + + HRPWM + desc HRPWM + 11 + 11 + read-write + + + TMR0_1 + desc TMR0_1 + 12 + 12 + read-write + + + TMR0_2 + desc TMR0_2 + 13 + 13 + read-write + + + EMB + desc EMB + 15 + 15 + read-write + + + TMR2_1 + desc TMR2_1 + 16 + 16 + read-write + + + TMR2_2 + desc TMR2_2 + 17 + 17 + read-write + + + TMR2_3 + desc TMR2_3 + 18 + 18 + read-write + + + TMR2_4 + desc TMR2_4 + 19 + 19 + read-write + + + TMRA_1 + desc TMRA_1 + 20 + 20 + read-write + + + TMRA_2 + desc TMRA_2 + 21 + 21 + read-write + + + TMRA_3 + desc TMRA_3 + 22 + 22 + read-write + + + TMRA_4 + desc TMRA_4 + 23 + 23 + read-write + + + TMRA_5 + desc TMRA_5 + 24 + 24 + read-write + + + TMRA_6 + desc TMRA_6 + 25 + 25 + read-write + + + TMRA_7 + desc TMRA_7 + 26 + 26 + read-write + + + TMRA_8 + desc TMRA_8 + 27 + 27 + read-write + + + TMRA_9 + desc TMRA_9 + 28 + 28 + read-write + + + TMRA_10 + desc TMRA_10 + 29 + 29 + read-write + + + TMRA_11 + desc TMRA_11 + 30 + 30 + read-write + + + TMRA_12 + desc TMRA_12 + 31 + 31 + read-write + + + + + FCG3 + desc FCG3 + 0xC + 32 + read-write + 0xFFFFFFFF + 0x3FF79337 + + + ADC1 + desc ADC1 + 0 + 0 + read-write + + + ADC2 + desc ADC2 + 1 + 1 + read-write + + + ADC3 + desc ADC3 + 2 + 2 + read-write + + + CMBIAS + desc CMBIAS + 3 + 3 + read-write + + + DAC1 + desc DAC1 + 4 + 4 + read-write + + + DAC2 + desc DAC2 + 5 + 5 + read-write + + + CMP1 + desc CMP1 + 8 + 8 + read-write + + + CMP2 + desc CMP2 + 9 + 9 + read-write + + + OTS + desc OTS + 12 + 12 + read-write + + + DVP + desc DVP + 15 + 15 + read-write + + + SMC + desc SMC + 16 + 16 + read-write + + + DMC + desc DMC + 17 + 17 + read-write + + + NFC + desc NFC + 18 + 18 + read-write + + + USART1 + desc USART1 + 20 + 20 + read-write + + + USART2 + desc USART2 + 21 + 21 + read-write + + + USART3 + desc USART3 + 22 + 22 + read-write + + + USART4 + desc USART4 + 23 + 23 + read-write + + + USART5 + desc USART5 + 24 + 24 + read-write + + + USART6 + desc USART6 + 25 + 25 + read-write + + + USART7 + desc USART7 + 26 + 26 + read-write + + + USART8 + desc USART8 + 27 + 27 + read-write + + + USART9 + desc USART9 + 28 + 28 + read-write + + + USART10 + desc USART10 + 29 + 29 + read-write + + + + + FCG0PC + desc FCG0PC + 0x10 + 32 + read-write + 0x0 + 0xFFFF0001 + + + PRT0 + desc PRT0 + 0 + 0 + read-write + + + FCG0PCWE + desc FCG0PCWE + 31 + 16 + write-only + + + + + VBATRSTR + desc VBATRSTR + 0x4430 + 8 + read-write + 0x0 + 0xFF + + + VBATCR + desc VBATCR + 0x4440 + 8 + read-write + 0x0 + 0x8F + + + VBTRSD + desc VBTRSD + 0 + 0 + read-write + + + RAMVALID + desc RAMVALID + 1 + 1 + read-write + + + RAMPDF + desc RAMPDF + 2 + 2 + read-write + + + VBATDIVMONE + desc VBATDIVMONE + 3 + 3 + read-write + + + CSDIS + desc CSDIS + 7 + 7 + read-write + + + + + WKTC0 + desc WKTC0 + 0x4450 + 8 + read-write + 0x0 + 0xFF + + + WKTMCMP + desc WKTMCMP + 7 + 0 + read-write + + + + + WKTC1 + desc WKTC1 + 0x4454 + 8 + read-write + 0x0 + 0xF + + + WKTMCMP + desc WKTMCMP + 3 + 0 + read-write + + + + + WKTC2 + desc WKTC2 + 0x4458 + 8 + read-write + 0x0 + 0xF0 + + + WKOVF + desc WKOVF + 4 + 4 + read-write + + + WKCKS + desc WKCKS + 6 + 5 + read-write + + + WKTCE + desc WKTCE + 7 + 7 + read-write + + + + + BKR0 + desc BKR0 + 0x4600 + 8 + read-write + 0x0 + 0xFF + + + BKR1 + desc BKR1 + 0x4604 + 8 + read-write + 0x0 + 0xFF + + + BKR2 + desc BKR2 + 0x4608 + 8 + read-write + 0x0 + 0xFF + + + BKR3 + desc BKR3 + 0x460C + 8 + read-write + 0x0 + 0xFF + + + BKR4 + desc BKR4 + 0x4610 + 8 + read-write + 0x0 + 0xFF + + + BKR5 + desc BKR5 + 0x4614 + 8 + read-write + 0x0 + 0xFF + + + BKR6 + desc BKR6 + 0x4618 + 8 + read-write + 0x0 + 0xFF + + + BKR7 + desc BKR7 + 0x461C + 8 + read-write + 0x0 + 0xFF + + + BKR8 + desc BKR8 + 0x4620 + 8 + read-write + 0x0 + 0xFF + + + BKR9 + desc BKR9 + 0x4624 + 8 + read-write + 0x0 + 0xFF + + + BKR10 + desc BKR10 + 0x4628 + 8 + read-write + 0x0 + 0xFF + + + BKR11 + desc BKR11 + 0x462C + 8 + read-write + 0x0 + 0xFF + + + BKR12 + desc BKR12 + 0x4630 + 8 + read-write + 0x0 + 0xFF + + + BKR13 + desc BKR13 + 0x4634 + 8 + read-write + 0x0 + 0xFF + + + BKR14 + desc BKR14 + 0x4638 + 8 + read-write + 0x0 + 0xFF + + + BKR15 + desc BKR15 + 0x463C + 8 + read-write + 0x0 + 0xFF + + + BKR16 + desc BKR16 + 0x4640 + 8 + read-write + 0x0 + 0xFF + + + BKR17 + desc BKR17 + 0x4644 + 8 + read-write + 0x0 + 0xFF + + + BKR18 + desc BKR18 + 0x4648 + 8 + read-write + 0x0 + 0xFF + + + BKR19 + desc BKR19 + 0x464C + 8 + read-write + 0x0 + 0xFF + + + BKR20 + desc BKR20 + 0x4650 + 8 + read-write + 0x0 + 0xFF + + + BKR21 + desc BKR21 + 0x4654 + 8 + read-write + 0x0 + 0xFF + + + BKR22 + desc BKR22 + 0x4658 + 8 + read-write + 0x0 + 0xFF + + + BKR23 + desc BKR23 + 0x465C + 8 + read-write + 0x0 + 0xFF + + + BKR24 + desc BKR24 + 0x4660 + 8 + read-write + 0x0 + 0xFF + + + BKR25 + desc BKR25 + 0x4664 + 8 + read-write + 0x0 + 0xFF + + + BKR26 + desc BKR26 + 0x4668 + 8 + read-write + 0x0 + 0xFF + + + BKR27 + desc BKR27 + 0x466C + 8 + read-write + 0x0 + 0xFF + + + BKR28 + desc BKR28 + 0x4670 + 8 + read-write + 0x0 + 0xFF + + + BKR29 + desc BKR29 + 0x4674 + 8 + read-write + 0x0 + 0xFF + + + BKR30 + desc BKR30 + 0x4678 + 8 + read-write + 0x0 + 0xFF + + + BKR31 + desc BKR31 + 0x467C + 8 + read-write + 0x0 + 0xFF + + + BKR32 + desc BKR32 + 0x4680 + 8 + read-write + 0x0 + 0xFF + + + BKR33 + desc BKR33 + 0x4684 + 8 + read-write + 0x0 + 0xFF + + + BKR34 + desc BKR34 + 0x4688 + 8 + read-write + 0x0 + 0xFF + + + BKR35 + desc BKR35 + 0x468C + 8 + read-write + 0x0 + 0xFF + + + BKR36 + desc BKR36 + 0x4690 + 8 + read-write + 0x0 + 0xFF + + + BKR37 + desc BKR37 + 0x4694 + 8 + read-write + 0x0 + 0xFF + + + BKR38 + desc BKR38 + 0x4698 + 8 + read-write + 0x0 + 0xFF + + + BKR39 + desc BKR39 + 0x469C + 8 + read-write + 0x0 + 0xFF + + + BKR40 + desc BKR40 + 0x46A0 + 8 + read-write + 0x0 + 0xFF + + + BKR41 + desc BKR41 + 0x46A4 + 8 + read-write + 0x0 + 0xFF + + + BKR42 + desc BKR42 + 0x46A8 + 8 + read-write + 0x0 + 0xFF + + + BKR43 + desc BKR43 + 0x46AC + 8 + read-write + 0x0 + 0xFF + + + BKR44 + desc BKR44 + 0x46B0 + 8 + read-write + 0x0 + 0xFF + + + BKR45 + desc BKR45 + 0x46B4 + 8 + read-write + 0x0 + 0xFF + + + BKR46 + desc BKR46 + 0x46B8 + 8 + read-write + 0x0 + 0xFF + + + BKR47 + desc BKR47 + 0x46BC + 8 + read-write + 0x0 + 0xFF + + + BKR48 + desc BKR48 + 0x46C0 + 8 + read-write + 0x0 + 0xFF + + + BKR49 + desc BKR49 + 0x46C4 + 8 + read-write + 0x0 + 0xFF + + + BKR50 + desc BKR50 + 0x46C8 + 8 + read-write + 0x0 + 0xFF + + + BKR51 + desc BKR51 + 0x46CC + 8 + read-write + 0x0 + 0xFF + + + BKR52 + desc BKR52 + 0x46D0 + 8 + read-write + 0x0 + 0xFF + + + BKR53 + desc BKR53 + 0x46D4 + 8 + read-write + 0x0 + 0xFF + + + BKR54 + desc BKR54 + 0x46D8 + 8 + read-write + 0x0 + 0xFF + + + BKR55 + desc BKR55 + 0x46DC + 8 + read-write + 0x0 + 0xFF + + + BKR56 + desc BKR56 + 0x46E0 + 8 + read-write + 0x0 + 0xFF + + + BKR57 + desc BKR57 + 0x46E4 + 8 + read-write + 0x0 + 0xFF + + + BKR58 + desc BKR58 + 0x46E8 + 8 + read-write + 0x0 + 0xFF + + + BKR59 + desc BKR59 + 0x46EC + 8 + read-write + 0x0 + 0xFF + + + BKR60 + desc BKR60 + 0x46F0 + 8 + read-write + 0x0 + 0xFF + + + BKR61 + desc BKR61 + 0x46F4 + 8 + read-write + 0x0 + 0xFF + + + BKR62 + desc BKR62 + 0x46F8 + 8 + read-write + 0x0 + 0xFF + + + BKR63 + desc BKR63 + 0x46FC + 8 + read-write + 0x0 + 0xFF + + + BKR64 + desc BKR64 + 0x4700 + 8 + read-write + 0x0 + 0xFF + + + BKR65 + desc BKR65 + 0x4704 + 8 + read-write + 0x0 + 0xFF + + + BKR66 + desc BKR66 + 0x4708 + 8 + read-write + 0x0 + 0xFF + + + BKR67 + desc BKR67 + 0x470C + 8 + read-write + 0x0 + 0xFF + + + BKR68 + desc BKR68 + 0x4710 + 8 + read-write + 0x0 + 0xFF + + + BKR69 + desc BKR69 + 0x4714 + 8 + read-write + 0x0 + 0xFF + + + BKR70 + desc BKR70 + 0x4718 + 8 + read-write + 0x0 + 0xFF + + + BKR71 + desc BKR71 + 0x471C + 8 + read-write + 0x0 + 0xFF + + + BKR72 + desc BKR72 + 0x4720 + 8 + read-write + 0x0 + 0xFF + + + BKR73 + desc BKR73 + 0x4724 + 8 + read-write + 0x0 + 0xFF + + + BKR74 + desc BKR74 + 0x4728 + 8 + read-write + 0x0 + 0xFF + + + BKR75 + desc BKR75 + 0x472C + 8 + read-write + 0x0 + 0xFF + + + BKR76 + desc BKR76 + 0x4730 + 8 + read-write + 0x0 + 0xFF + + + BKR77 + desc BKR77 + 0x4734 + 8 + read-write + 0x0 + 0xFF + + + BKR78 + desc BKR78 + 0x4738 + 8 + read-write + 0x0 + 0xFF + + + BKR79 + desc BKR79 + 0x473C + 8 + read-write + 0x0 + 0xFF + + + BKR80 + desc BKR80 + 0x4740 + 8 + read-write + 0x0 + 0xFF + + + BKR81 + desc BKR81 + 0x4744 + 8 + read-write + 0x0 + 0xFF + + + BKR82 + desc BKR82 + 0x4748 + 8 + read-write + 0x0 + 0xFF + + + BKR83 + desc BKR83 + 0x474C + 8 + read-write + 0x0 + 0xFF + + + BKR84 + desc BKR84 + 0x4750 + 8 + read-write + 0x0 + 0xFF + + + BKR85 + desc BKR85 + 0x4754 + 8 + read-write + 0x0 + 0xFF + + + BKR86 + desc BKR86 + 0x4758 + 8 + read-write + 0x0 + 0xFF + + + BKR87 + desc BKR87 + 0x475C + 8 + read-write + 0x0 + 0xFF + + + BKR88 + desc BKR88 + 0x4760 + 8 + read-write + 0x0 + 0xFF + + + BKR89 + desc BKR89 + 0x4764 + 8 + read-write + 0x0 + 0xFF + + + BKR90 + desc BKR90 + 0x4768 + 8 + read-write + 0x0 + 0xFF + + + BKR91 + desc BKR91 + 0x476C + 8 + read-write + 0x0 + 0xFF + + + BKR92 + desc BKR92 + 0x4770 + 8 + read-write + 0x0 + 0xFF + + + BKR93 + desc BKR93 + 0x4774 + 8 + read-write + 0x0 + 0xFF + + + BKR94 + desc BKR94 + 0x4778 + 8 + read-write + 0x0 + 0xFF + + + BKR95 + desc BKR95 + 0x477C + 8 + read-write + 0x0 + 0xFF + + + BKR96 + desc BKR96 + 0x4780 + 8 + read-write + 0x0 + 0xFF + + + BKR97 + desc BKR97 + 0x4784 + 8 + read-write + 0x0 + 0xFF + + + BKR98 + desc BKR98 + 0x4788 + 8 + read-write + 0x0 + 0xFF + + + BKR99 + desc BKR99 + 0x478C + 8 + read-write + 0x0 + 0xFF + + + BKR100 + desc BKR100 + 0x4790 + 8 + read-write + 0x0 + 0xFF + + + BKR101 + desc BKR101 + 0x4794 + 8 + read-write + 0x0 + 0xFF + + + BKR102 + desc BKR102 + 0x4798 + 8 + read-write + 0x0 + 0xFF + + + BKR103 + desc BKR103 + 0x479C + 8 + read-write + 0x0 + 0xFF + + + BKR104 + desc BKR104 + 0x47A0 + 8 + read-write + 0x0 + 0xFF + + + BKR105 + desc BKR105 + 0x47A4 + 8 + read-write + 0x0 + 0xFF + + + BKR106 + desc BKR106 + 0x47A8 + 8 + read-write + 0x0 + 0xFF + + + BKR107 + desc BKR107 + 0x47AC + 8 + read-write + 0x0 + 0xFF + + + BKR108 + desc BKR108 + 0x47B0 + 8 + read-write + 0x0 + 0xFF + + + BKR109 + desc BKR109 + 0x47B4 + 8 + read-write + 0x0 + 0xFF + + + BKR110 + desc BKR110 + 0x47B8 + 8 + read-write + 0x0 + 0xFF + + + BKR111 + desc BKR111 + 0x47BC + 8 + read-write + 0x0 + 0xFF + + + BKR112 + desc BKR112 + 0x47C0 + 8 + read-write + 0x0 + 0xFF + + + BKR113 + desc BKR113 + 0x47C4 + 8 + read-write + 0x0 + 0xFF + + + BKR114 + desc BKR114 + 0x47C8 + 8 + read-write + 0x0 + 0xFF + + + BKR115 + desc BKR115 + 0x47CC + 8 + read-write + 0x0 + 0xFF + + + BKR116 + desc BKR116 + 0x47D0 + 8 + read-write + 0x0 + 0xFF + + + BKR117 + desc BKR117 + 0x47D4 + 8 + read-write + 0x0 + 0xFF + + + BKR118 + desc BKR118 + 0x47D8 + 8 + read-write + 0x0 + 0xFF + + + BKR119 + desc BKR119 + 0x47DC + 8 + read-write + 0x0 + 0xFF + + + BKR120 + desc BKR120 + 0x47E0 + 8 + read-write + 0x0 + 0xFF + + + BKR121 + desc BKR121 + 0x47E4 + 8 + read-write + 0x0 + 0xFF + + + BKR122 + desc BKR122 + 0x47E8 + 8 + read-write + 0x0 + 0xFF + + + BKR123 + desc BKR123 + 0x47EC + 8 + read-write + 0x0 + 0xFF + + + BKR124 + desc BKR124 + 0x47F0 + 8 + read-write + 0x0 + 0xFF + + + BKR125 + desc BKR125 + 0x47F4 + 8 + read-write + 0x0 + 0xFF + + + BKR126 + desc BKR126 + 0x47F8 + 8 + read-write + 0x0 + 0xFF + + + BKR127 + desc BKR127 + 0x47FC + 8 + read-write + 0x0 + 0xFF + + + PWRC0 + desc PWRC0 + 0x4C00 + 8 + read-write + 0x0 + 0xBB + + + PDMDS + desc PDMDS + 1 + 0 + read-write + + + IORTN + desc IORTN + 5 + 4 + read-write + + + PWDN + desc PWDN + 7 + 7 + read-write + + + + + PWRC1 + desc PWRC1 + 0x4C04 + 8 + read-write + 0x0 + 0xCF + + + VPLLSD + desc VPLLSD + 1 + 0 + read-write + + + VHRCSD + desc VHRCSD + 2 + 2 + read-write + + + PDTS + desc PDTS + 3 + 3 + read-write + + + STPDAS + desc STPDAS + 7 + 6 + read-write + + + + + PWRC2 + desc PWRC2 + 0x4C08 + 8 + read-write + 0xFF + 0x3F + + + DDAS + desc DDAS + 3 + 0 + read-write + + + DVS + desc DVS + 5 + 4 + read-write + + + + + PWRC3 + desc PWRC3 + 0x4C0C + 8 + read-write + 0xFF + 0xFF + + + DDAS + desc DDAS + 7 + 0 + read-write + + + + + PWRC4 + desc PWRC4 + 0x4C10 + 8 + read-write + 0x0 + 0xD3 + + + VBATREFSEL + desc VBATREFSEL + 0 + 0 + read-write + + + VBATME + desc VBATME + 1 + 1 + read-write + + + VBATMON + desc VBATMON + 4 + 4 + read-write + + + ADBUFS + desc ADBUFS + 6 + 6 + read-write + + + ADBUFE + desc ADBUFE + 7 + 7 + read-write + + + + + PVDCR0 + desc PVDCR0 + 0x4C14 + 8 + read-write + 0x0 + 0x61 + + + EXVCCINEN + desc EXVCCINEN + 0 + 0 + read-write + + + PVD1EN + desc PVD1EN + 5 + 5 + read-write + + + PVD2EN + desc PVD2EN + 6 + 6 + read-write + + + + + PVDCR1 + desc PVDCR1 + 0x4C18 + 8 + read-write + 0x0 + 0x77 + + + PVD1IRE + desc PVD1IRE + 0 + 0 + read-write + + + PVD1IRS + desc PVD1IRS + 1 + 1 + read-write + + + PVD1CMPOE + desc PVD1CMPOE + 2 + 2 + read-write + + + PVD2IRE + desc PVD2IRE + 4 + 4 + read-write + + + PVD2IRS + desc PVD2IRS + 5 + 5 + read-write + + + PVD2CMPOE + desc PVD2CMPOE + 6 + 6 + read-write + + + + + PVDFCR + desc PVDFCR + 0x4C1C + 8 + read-write + 0x11 + 0x77 + + + PVD1NFDIS + desc PVD1NFDIS + 0 + 0 + read-write + + + PVD1NFCKS + desc PVD1NFCKS + 2 + 1 + read-write + + + PVD2NFDIS + desc PVD2NFDIS + 4 + 4 + read-write + + + PVD2NFCKS + desc PVD2NFCKS + 6 + 5 + read-write + + + + + PVDLCR + desc PVDLCR + 0x4C20 + 8 + read-write + 0x0 + 0x77 + + + PVD1LVL + desc PVD1LVL + 2 + 0 + read-write + + + PVD2LVL + desc PVD2LVL + 6 + 4 + read-write + + + + + PDWKE0 + desc PDWKE0 + 0x4C28 + 8 + read-write + 0x0 + 0xFF + + + WKE0_0 + desc WKE0_0 + 0 + 0 + read-write + + + WKE0_1 + desc WKE0_1 + 1 + 1 + read-write + + + WKE0_2 + desc WKE0_2 + 2 + 2 + read-write + + + WKE0_3 + desc WKE0_3 + 3 + 3 + read-write + + + WKE1_0 + desc WKE1_0 + 4 + 4 + read-write + + + WKE1_1 + desc WKE1_1 + 5 + 5 + read-write + + + WKE1_2 + desc WKE1_2 + 6 + 6 + read-write + + + WKE1_3 + desc WKE1_3 + 7 + 7 + read-write + + + + + PDWKE1 + desc PDWKE1 + 0x4C2C + 8 + read-write + 0x0 + 0xFF + + + WKE2_0 + desc WKE2_0 + 0 + 0 + read-write + + + WKE2_1 + desc WKE2_1 + 1 + 1 + read-write + + + WKE2_2 + desc WKE2_2 + 2 + 2 + read-write + + + WKE2_3 + desc WKE2_3 + 3 + 3 + read-write + + + WKE3_0 + desc WKE3_0 + 4 + 4 + read-write + + + WKE3_1 + desc WKE3_1 + 5 + 5 + read-write + + + WKE3_2 + desc WKE3_2 + 6 + 6 + read-write + + + WKE3_3 + desc WKE3_3 + 7 + 7 + read-write + + + + + PDWKE2 + desc PDWKE2 + 0x4C30 + 8 + read-write + 0x0 + 0xF3 + + + VD1WKE + desc VD1WKE + 0 + 0 + read-write + + + VD2WKE + desc VD2WKE + 1 + 1 + read-write + + + RTCPRDWKE + desc RTCPRDWKE + 4 + 4 + read-write + + + RTCALMWKE + desc RTCALMWKE + 5 + 5 + read-write + + + XTAL32ERWKE + desc XTAL32ERWKE + 6 + 6 + read-write + + + WKTMWKE + desc WKTMWKE + 7 + 7 + read-write + + + + + PDWKES + desc PDWKES + 0x4C34 + 8 + read-write + 0x0 + 0x3F + + + WK0EGS + desc WK0EGS + 0 + 0 + read-write + + + WK1EGS + desc WK1EGS + 1 + 1 + read-write + + + WK2EGS + desc WK2EGS + 2 + 2 + read-write + + + WK3EGS + desc WK3EGS + 3 + 3 + read-write + + + VD1EGS + desc VD1EGS + 4 + 4 + read-write + + + VD2EGS + desc VD2EGS + 5 + 5 + read-write + + + + + PDWKF0 + desc PDWKF0 + 0x4C38 + 8 + read-write + 0x0 + 0x3F + + + PTWK0F + desc PTWK0F + 0 + 0 + read-write + + + PTWK1F + desc PTWK1F + 1 + 1 + read-write + + + PTWK2F + desc PTWK2F + 2 + 2 + read-write + + + PTWK3F + desc PTWK3F + 3 + 3 + read-write + + + VD1WKF + desc VD1WKF + 4 + 4 + read-write + + + VD2WKF + desc VD2WKF + 5 + 5 + read-write + + + + + PDWKF1 + desc PDWKF1 + 0x4C3C + 8 + read-write + 0x0 + 0xF8 + + + RXD0WKF + desc RXD0WKF + 3 + 3 + read-write + + + RTCPRDWKF + desc RTCPRDWKF + 4 + 4 + read-write + + + RTCALMWKF + desc RTCALMWKF + 5 + 5 + read-write + + + XTAL32ERWKF + desc XTAL32ERWKF + 6 + 6 + read-write + + + WKTMWKF + desc WKTMWKF + 7 + 7 + read-write + + + + + RAMPC0 + desc RAMPC0 + 0x4CE0 + 32 + read-write + 0x0 + 0x7FF + + + RAMPDC0 + desc RAMPDC0 + 0 + 0 + read-write + + + RAMPDC1 + desc RAMPDC1 + 1 + 1 + read-write + + + RAMPDC2 + desc RAMPDC2 + 2 + 2 + read-write + + + RAMPDC3 + desc RAMPDC3 + 3 + 3 + read-write + + + RAMPDC4 + desc RAMPDC4 + 4 + 4 + read-write + + + RAMPDC5 + desc RAMPDC5 + 5 + 5 + read-write + + + RAMPDC6 + desc RAMPDC6 + 6 + 6 + read-write + + + RAMPDC7 + desc RAMPDC7 + 7 + 7 + read-write + + + RAMPDC8 + desc RAMPDC8 + 8 + 8 + read-write + + + RAMPDC9 + desc RAMPDC9 + 9 + 9 + read-write + + + RAMPDC10 + desc RAMPDC10 + 10 + 10 + read-write + + + + + RAMOPM + desc RAMOPM + 0x4CE4 + 32 + read-write + 0x8043 + 0xFFFF + + + RAMOPM + desc RAMOPM + 15 + 0 + read-write + + + + + PRAMLPC + desc PRAMLPC + 0x4CE8 + 32 + read-write + 0x0 + 0x3FF + + + PRAMPDC0 + desc PRAMPDC0 + 0 + 0 + read-write + + + PRAMPDC1 + desc PRAMPDC1 + 1 + 1 + read-write + + + PRAMPDC2 + desc PRAMPDC2 + 2 + 2 + read-write + + + PRAMPDC3 + desc PRAMPDC3 + 3 + 3 + read-write + + + PRAMPDC4 + desc PRAMPDC4 + 4 + 4 + read-write + + + PRAMPDC5 + desc PRAMPDC5 + 5 + 5 + read-write + + + PRAMPDC6 + desc PRAMPDC6 + 6 + 6 + read-write + + + PRAMPDC7 + desc PRAMPDC7 + 7 + 7 + read-write + + + PRAMPDC8 + desc PRAMPDC8 + 8 + 8 + read-write + + + PRAMPDC9 + desc PRAMPDC9 + 9 + 9 + read-write + + + + + PVDICR + desc PVDICR + 0x4CF0 + 8 + read-write + 0x0 + 0x77 + + + PVD1NMIS + desc PVD1NMIS + 0 + 0 + read-write + + + PVD1EDGS + desc PVD1EDGS + 2 + 1 + read-write + + + PVD2NMIS + desc PVD2NMIS + 4 + 4 + read-write + + + PVD2EDGS + desc PVD2EDGS + 6 + 5 + read-write + + + + + PVDDSR + desc PVDDSR + 0x4CF4 + 8 + read-write + 0x11 + 0x33 + + + PVD1MON + desc PVD1MON + 0 + 0 + read-write + + + PVD1DETFLG + desc PVD1DETFLG + 1 + 1 + read-write + + + PVD2MON + desc PVD2MON + 4 + 4 + read-write + + + PVD2DETFLG + desc PVD2DETFLG + 5 + 5 + read-write + + + + + STPMCR + desc STPMCR + 0xC00C + 16 + read-write + 0x0 + 0xC003 + + + FLNWT + desc FLNWT + 0 + 0 + read-write + + + CKSMRC + desc CKSMRC + 1 + 1 + read-write + + + EXBUSOE + desc EXBUSOE + 14 + 14 + read-write + + + STOP + desc STOP + 15 + 15 + read-write + + + + + FPRC + desc FPRC + 0xC3FE + 16 + read-write + 0x0 + 0xFF0F + + + FPRCB0 + desc FPRCB0 + 0 + 0 + read-write + + + FPRCB1 + desc FPRCB1 + 1 + 1 + read-write + + + FPRCB2 + desc FPRCB2 + 2 + 2 + read-write + + + FPRCB3 + desc FPRCB3 + 3 + 3 + read-write + + + FPRCWE + desc FPRCWE + 15 + 8 + read-write + + + + + + + QSPI + desc QSPI + 0x9C000000 + + 0x0 + 0x808 + + + + CR + desc CR + 0x0 + 32 + read-write + 0x3F0000 + 0x3F3FFF + + + MDSEL + desc MDSEL + 2 + 0 + read-write + + + PFE + desc PFE + 3 + 3 + read-write + + + PFSAE + desc PFSAE + 4 + 4 + read-write + + + DCOME + desc DCOME + 5 + 5 + read-write + + + XIPE + desc XIPE + 6 + 6 + read-write + + + SPIMD3 + desc SPIMD3 + 7 + 7 + read-write + + + IPRSL + desc IPRSL + 9 + 8 + read-write + + + APRSL + desc APRSL + 11 + 10 + read-write + + + DPRSL + desc DPRSL + 13 + 12 + read-write + + + DIV + desc DIV + 21 + 16 + read-write + + + + + CSCR + desc CSCR + 0x4 + 32 + read-write + 0xF + 0x3F + + + SSHW + desc SSHW + 3 + 0 + read-write + + + SSNW + desc SSNW + 5 + 4 + read-write + + + + + FCR + desc FCR + 0x8 + 32 + read-write + 0x80B3 + 0x8F77 + + + AWSL + desc AWSL + 1 + 0 + read-write + + + FOUR_BIC + desc FOUR_BIC + 2 + 2 + read-write + + + SSNHD + desc SSNHD + 4 + 4 + read-write + + + SSNLD + desc SSNLD + 5 + 5 + read-write + + + WPOL + desc WPOL + 6 + 6 + read-write + + + DMCYCN + desc DMCYCN + 11 + 8 + read-write + + + DUTY + desc DUTY + 15 + 15 + read-write + + + + + SR + desc SR + 0xC + 32 + read-write + 0x8000 + 0xDFC1 + + + BUSY + desc BUSY + 0 + 0 + read-write + + + XIPF + desc XIPF + 6 + 6 + read-write + + + RAER + desc RAER + 7 + 7 + read-write + + + PFNUM + desc PFNUM + 12 + 8 + read-write + + + PFFUL + desc PFFUL + 14 + 14 + read-write + + + PFAN + desc PFAN + 15 + 15 + read-write + + + + + DCOM + desc DCOM + 0x10 + 32 + read-write + 0x0 + 0xFF + + + DCOM + desc DCOM + 7 + 0 + read-write + + + + + CCMD + desc CCMD + 0x14 + 32 + read-write + 0x0 + 0xFF + + + RIC + desc RIC + 7 + 0 + read-write + + + + + XCMD + desc XCMD + 0x18 + 32 + read-write + 0xFF + 0xFF + + + XIPMC + desc XIPMC + 7 + 0 + read-write + + + + + SR2 + desc SR2 + 0x24 + 32 + write-only + 0x0 + 0x80 + + + RAERCLR + desc RAERCLR + 7 + 7 + write-only + + + + + EXAR + desc EXAR + 0x804 + 32 + read-write + 0x0 + 0xFC000000 + + + EXADR + desc EXADR + 31 + 26 + read-write + + + + + + + RMU + desc RMU + 0x4004CC00 + + 0x0 + 0x100 + + + + PRSTCR0 + desc PRSTCR0 + 0xF8 + 8 + read-write + 0x40 + 0x60 + + + LKUPREN + desc LKUPREN + 5 + 5 + read-write + + + + + RSTF0 + desc RSTF0 + 0xFC + 32 + read-write + 0x2 + 0xC0007FFF + + + PORF + desc PORF + 0 + 0 + read-write + + + PINRF + desc PINRF + 1 + 1 + read-write + + + BORF + desc BORF + 2 + 2 + read-write + + + PVD1RF + desc PVD1RF + 3 + 3 + read-write + + + PVD2RF + desc PVD2RF + 4 + 4 + read-write + + + WDRF + desc WDRF + 5 + 5 + read-write + + + SWDRF + desc SWDRF + 6 + 6 + read-write + + + PDRF + desc PDRF + 7 + 7 + read-write + + + SWRF + desc SWRF + 8 + 8 + read-write + + + MPUERF + desc MPUERF + 9 + 9 + read-write + + + RAPERF + desc RAPERF + 10 + 10 + read-write + + + RAECRF + desc RAECRF + 11 + 11 + read-write + + + CKFERF + desc CKFERF + 12 + 12 + read-write + + + XTALERF + desc XTALERF + 13 + 13 + read-write + + + LKUPRF + desc LKUPRF + 14 + 14 + read-write + + + MULTIRF + desc MULTIRF + 30 + 30 + read-write + + + CLRF + desc CLRF + 31 + 31 + read-write + + + + + + + RTC + desc RTC + 0x4004C000 + + 0x0 + 0x60 + + + + CR0 + desc CR0 + 0x0 + 8 + read-write + 0x0 + 0x1 + + + RESET + desc RESET + 0 + 0 + read-write + + + + + CR1 + desc CR1 + 0x4 + 8 + read-write + 0x0 + 0xEF + + + PRDS + desc PRDS + 2 + 0 + read-write + + + AMPM + desc AMPM + 3 + 3 + read-write + + + ONEHZOE + desc ONEHZOE + 5 + 5 + read-write + + + ONEHZSEL + desc ONEHZSEL + 6 + 6 + read-write + + + START + desc START + 7 + 7 + read-write + + + + + CR2 + desc CR2 + 0x8 + 8 + read-write + 0x0 + 0xEF + + + RWREQ + desc RWREQ + 0 + 0 + read-write + + + RWEN + desc RWEN + 1 + 1 + read-write + + + PRDF + desc PRDF + 2 + 2 + read-write + + + ALMF + desc ALMF + 3 + 3 + read-write + + + PRDIE + desc PRDIE + 5 + 5 + read-write + + + ALMIE + desc ALMIE + 6 + 6 + read-write + + + ALME + desc ALME + 7 + 7 + read-write + + + + + CR3 + desc CR3 + 0xC + 8 + read-write + 0x0 + 0x90 + + + LRCEN + desc LRCEN + 4 + 4 + read-write + + + RCKSEL + desc RCKSEL + 7 + 7 + read-write + + + + + SEC + desc SEC + 0x10 + 8 + read-write + 0x0 + 0x7F + + + SECU + desc SECU + 3 + 0 + read-write + + + SECD + desc SECD + 6 + 4 + read-write + + + + + MIN + desc MIN + 0x14 + 8 + read-write + 0x0 + 0x7F + + + MINU + desc MINU + 3 + 0 + read-write + + + MIND + desc MIND + 6 + 4 + read-write + + + + + HOUR + desc HOUR + 0x18 + 8 + read-write + 0x12 + 0x3F + + + HOURU + desc HOURU + 3 + 0 + read-write + + + HOURD + desc HOURD + 5 + 4 + read-write + + + + + WEEK + desc WEEK + 0x1C + 8 + read-write + 0x0 + 0x7 + + + WEEK + desc WEEK + 2 + 0 + read-write + + + + + DAY + desc DAY + 0x20 + 8 + read-write + 0x0 + 0x3F + + + DAYU + desc DAYU + 3 + 0 + read-write + + + DAYD + desc DAYD + 5 + 4 + read-write + + + + + MON + desc MON + 0x24 + 8 + read-write + 0x0 + 0x1F + + + MON + desc MON + 4 + 0 + read-write + + + + + YEAR + desc YEAR + 0x28 + 8 + read-write + 0x0 + 0xFF + + + YEARU + desc YEARU + 3 + 0 + read-write + + + YEARD + desc YEARD + 7 + 4 + read-write + + + + + ALMMIN + desc ALMMIN + 0x2C + 8 + read-write + 0x12 + 0x7F + + + ALMMINU + desc ALMMINU + 3 + 0 + read-write + + + ALMMIND + desc ALMMIND + 6 + 4 + read-write + + + + + ALMHOUR + desc ALMHOUR + 0x30 + 8 + read-write + 0x0 + 0x3F + + + ALMHOURU + desc ALMHOURU + 3 + 0 + read-write + + + ALMHOURD + desc ALMHOURD + 5 + 4 + read-write + + + + + ALMWEEK + desc ALMWEEK + 0x34 + 8 + read-write + 0x0 + 0x7F + + + ALMWEEK + desc ALMWEEK + 6 + 0 + read-write + + + + + ERRCRH + desc ERRCRH + 0x38 + 8 + read-write + 0x0 + 0x81 + + + COMP8 + desc COMP8 + 0 + 0 + read-write + + + COMPEN + desc COMPEN + 7 + 7 + read-write + + + + + ERRCRL + desc ERRCRL + 0x3C + 8 + read-write + 0x0 + 0xFF + + + COMP + desc COMP + 7 + 0 + read-write + + + + + TPCR0 + desc TPCR0 + 0x40 + 8 + read-write + 0x0 + 0xFF + + + TPCT0 + desc TPCT0 + 1 + 0 + read-write + + + TPNF0 + desc TPNF0 + 3 + 2 + read-write + + + TPRSTE0 + desc TPRSTE0 + 4 + 4 + read-write + + + TPIE0 + desc TPIE0 + 5 + 5 + read-write + + + TSTPE0 + desc TSTPE0 + 6 + 6 + read-write + + + TPEN0 + desc TPEN0 + 7 + 7 + read-write + + + + + TPCR1 + desc TPCR1 + 0x44 + 8 + read-write + 0x0 + 0xFF + + + TPCT1 + desc TPCT1 + 1 + 0 + read-write + + + TPNF1 + desc TPNF1 + 3 + 2 + read-write + + + TPRSTE1 + desc TPRSTE1 + 4 + 4 + read-write + + + TPIE1 + desc TPIE1 + 5 + 5 + read-write + + + TSTPE1 + desc TSTPE1 + 6 + 6 + read-write + + + TPEN1 + desc TPEN1 + 7 + 7 + read-write + + + + + TPSR + desc TPSR + 0x48 + 8 + read-write + 0x0 + 0x7 + + + TPF0 + desc TPF0 + 0 + 0 + read-write + + + TPF1 + desc TPF1 + 1 + 1 + read-write + + + TPOVF + desc TPOVF + 2 + 2 + read-write + + + + + SECTP + desc SECTP + 0x4C + 8 + read-write + 0x0 + 0x7F + + + SECTPU + desc SECTPU + 3 + 0 + read-write + + + SECTPD + desc SECTPD + 6 + 4 + read-write + + + + + MINTP + desc MINTP + 0x50 + 8 + read-write + 0x0 + 0x7F + + + MINTPU + desc MINTPU + 3 + 0 + read-write + + + MINTPD + desc MINTPD + 6 + 4 + read-write + + + + + HOURTP + desc HOURTP + 0x54 + 8 + read-write + 0x0 + 0x3F + + + HOURTPU + desc HOURTPU + 3 + 0 + read-write + + + HOURTPD + desc HOURTPD + 5 + 4 + read-write + + + + + DAYTP + desc DAYTP + 0x58 + 8 + read-write + 0x0 + 0x3F + + + DAYTPU + desc DAYTPU + 3 + 0 + read-write + + + DAYTPD + desc DAYTPD + 5 + 4 + read-write + + + + + MONTP + desc MONTP + 0x5C + 8 + read-write + 0x0 + 0x1F + + + MONTP + desc MONTP + 4 + 0 + read-write + + + + + + + SDIOC1 + desc SDIOC + 0x40070000 + + 0x0 + 0x54 + + + + BLKSIZE + desc BLKSIZE + 0x4 + 16 + read-write + 0x0 + 0xFFF + + + TBS + desc TBS + 11 + 0 + read-write + + + + + BLKCNT + desc BLKCNT + 0x6 + 16 + read-write + 0x0 + 0xFFFF + + + ARG0 + desc ARG0 + 0x8 + 16 + read-write + 0x0 + 0xFFFF + + + ARG1 + desc ARG1 + 0xA + 16 + read-write + 0x0 + 0xFFFF + + + TRANSMODE + desc TRANSMODE + 0xC + 16 + read-write + 0x0 + 0x3E + + + BCE + desc BCE + 1 + 1 + read-write + + + ATCEN + desc ATCEN + 3 + 2 + read-write + + + DDIR + desc DDIR + 4 + 4 + read-write + + + MULB + desc MULB + 5 + 5 + read-write + + + + + CMD + desc CMD + 0xE + 16 + read-write + 0x0 + 0x3FFB + + + RESTYP + desc RESTYP + 1 + 0 + read-write + + + CCE + desc CCE + 3 + 3 + read-write + + + ICE + desc ICE + 4 + 4 + read-write + + + DAT + desc DAT + 5 + 5 + read-write + + + TYP + desc TYP + 7 + 6 + read-write + + + IDX + desc IDX + 13 + 8 + read-write + + + + + RESP0 + desc RESP0 + 0x10 + 16 + read-only + 0x0 + 0xFFFF + + + RESP1 + desc RESP1 + 0x12 + 16 + read-only + 0x0 + 0xFFFF + + + RESP2 + desc RESP2 + 0x14 + 16 + read-only + 0x0 + 0xFFFF + + + RESP3 + desc RESP3 + 0x16 + 16 + read-only + 0x0 + 0xFFFF + + + RESP4 + desc RESP4 + 0x18 + 16 + read-only + 0x0 + 0xFFFF + + + RESP5 + desc RESP5 + 0x1A + 16 + read-only + 0x0 + 0xFFFF + + + RESP6 + desc RESP6 + 0x1C + 16 + read-only + 0x0 + 0xFFFF + + + RESP7 + desc RESP7 + 0x1E + 16 + read-only + 0x0 + 0xFFFF + + + BUF0 + desc BUF0 + 0x20 + 16 + read-write + 0x0 + 0xFFFF + + + BUF1 + desc BUF1 + 0x22 + 16 + read-write + 0x0 + 0xFFFF + + + PSTAT + desc PSTAT + 0x24 + 32 + read-only + 0x0 + 0x1FF0F07 + + + CIC + desc CIC + 0 + 0 + read-only + + + CID + desc CID + 1 + 1 + read-only + + + DA + desc DA + 2 + 2 + read-only + + + WTA + desc WTA + 8 + 8 + read-only + + + RTA + desc RTA + 9 + 9 + read-only + + + BWE + desc BWE + 10 + 10 + read-only + + + BRE + desc BRE + 11 + 11 + read-only + + + CIN + desc CIN + 16 + 16 + read-only + + + CSS + desc CSS + 17 + 17 + read-only + + + CDL + desc CDL + 18 + 18 + read-only + + + WPL + desc WPL + 19 + 19 + read-only + + + DATL + desc DATL + 23 + 20 + read-only + + + CMDL + desc CMDL + 24 + 24 + read-only + + + + + HOSTCON + desc HOSTCON + 0x28 + 8 + read-write + 0x0 + 0xE6 + + + DW + desc DW + 1 + 1 + read-write + + + HSEN + desc HSEN + 2 + 2 + read-write + + + EXDW + desc EXDW + 5 + 5 + read-write + + + CDTL + desc CDTL + 6 + 6 + read-write + + + CDSS + desc CDSS + 7 + 7 + read-write + + + + + PWRCON + desc PWRCON + 0x29 + 8 + read-write + 0x0 + 0x1 + + + PWON + desc PWON + 0 + 0 + read-write + + + + + BLKGPCON + desc BLKGPCON + 0x2A + 8 + read-write + 0x0 + 0xF + + + SABGR + desc SABGR + 0 + 0 + read-write + + + CR + desc CR + 1 + 1 + read-write + + + RWC + desc RWC + 2 + 2 + read-write + + + IABG + desc IABG + 3 + 3 + read-write + + + + + CLKCON + desc CLKCON + 0x2C + 16 + read-write + 0x2 + 0xFF05 + + + ICE + desc ICE + 0 + 0 + read-write + + + CE + desc CE + 2 + 2 + read-write + + + FS + desc FS + 15 + 8 + read-write + + + + + TOUTCON + desc TOUTCON + 0x2E + 8 + read-write + 0x0 + 0xF + + + DTO + desc DTO + 3 + 0 + read-write + + + + + SFTRST + desc SFTRST + 0x2F + 8 + read-write + 0x0 + 0x7 + + + RSTA + desc RSTA + 0 + 0 + read-write + + + RSTC + desc RSTC + 1 + 1 + read-write + + + RSTD + desc RSTD + 2 + 2 + read-write + + + + + NORINTST + desc NORINTST + 0x30 + 16 + read-write + 0x0 + 0x81F7 + + + CC + desc CC + 0 + 0 + read-write + + + TC + desc TC + 1 + 1 + read-write + + + BGE + desc BGE + 2 + 2 + read-write + + + BWR + desc BWR + 4 + 4 + read-write + + + BRR + desc BRR + 5 + 5 + read-write + + + CIST + desc CIST + 6 + 6 + read-write + + + CRM + desc CRM + 7 + 7 + read-write + + + CINT + desc CINT + 8 + 8 + read-only + + + EI + desc EI + 15 + 15 + read-only + + + + + ERRINTST + desc ERRINTST + 0x32 + 16 + read-write + 0x0 + 0x17F + + + CTOE + desc CTOE + 0 + 0 + read-write + + + CCE + desc CCE + 1 + 1 + read-write + + + CEBE + desc CEBE + 2 + 2 + read-write + + + CIE + desc CIE + 3 + 3 + read-write + + + DTOE + desc DTOE + 4 + 4 + read-write + + + DCE + desc DCE + 5 + 5 + read-write + + + DEBE + desc DEBE + 6 + 6 + read-write + + + ACE + desc ACE + 8 + 8 + read-write + + + + + NORINTSTEN + desc NORINTSTEN + 0x34 + 16 + read-write + 0x0 + 0x1F7 + + + CCEN + desc CCEN + 0 + 0 + read-write + + + TCEN + desc TCEN + 1 + 1 + read-write + + + BGEEN + desc BGEEN + 2 + 2 + read-write + + + BWREN + desc BWREN + 4 + 4 + read-write + + + BRREN + desc BRREN + 5 + 5 + read-write + + + CISTEN + desc CISTEN + 6 + 6 + read-write + + + CRMEN + desc CRMEN + 7 + 7 + read-write + + + CINTEN + desc CINTEN + 8 + 8 + read-write + + + + + ERRINTSTEN + desc ERRINTSTEN + 0x36 + 16 + read-write + 0x0 + 0x17F + + + CTOEEN + desc CTOEEN + 0 + 0 + read-write + + + CCEEN + desc CCEEN + 1 + 1 + read-write + + + CEBEEN + desc CEBEEN + 2 + 2 + read-write + + + CIEEN + desc CIEEN + 3 + 3 + read-write + + + DTOEEN + desc DTOEEN + 4 + 4 + read-write + + + DCEEN + desc DCEEN + 5 + 5 + read-write + + + DEBEEN + desc DEBEEN + 6 + 6 + read-write + + + ACEEN + desc ACEEN + 8 + 8 + read-write + + + + + NORINTSGEN + desc NORINTSGEN + 0x38 + 16 + read-write + 0x0 + 0x1F7 + + + CCSEN + desc CCSEN + 0 + 0 + read-write + + + TCSEN + desc TCSEN + 1 + 1 + read-write + + + BGESEN + desc BGESEN + 2 + 2 + read-write + + + BWRSEN + desc BWRSEN + 4 + 4 + read-write + + + BRRSEN + desc BRRSEN + 5 + 5 + read-write + + + CISTSEN + desc CISTSEN + 6 + 6 + read-write + + + CRMSEN + desc CRMSEN + 7 + 7 + read-write + + + CINTSEN + desc CINTSEN + 8 + 8 + read-write + + + + + ERRINTSGEN + desc ERRINTSGEN + 0x3A + 16 + read-write + 0x0 + 0x17F + + + CTOESEN + desc CTOESEN + 0 + 0 + read-write + + + CCESEN + desc CCESEN + 1 + 1 + read-write + + + CEBESEN + desc CEBESEN + 2 + 2 + read-write + + + CIESEN + desc CIESEN + 3 + 3 + read-write + + + DTOESEN + desc DTOESEN + 4 + 4 + read-write + + + DCESEN + desc DCESEN + 5 + 5 + read-write + + + DEBESEN + desc DEBESEN + 6 + 6 + read-write + + + ACESEN + desc ACESEN + 8 + 8 + read-write + + + + + ATCERRST + desc ATCERRST + 0x3C + 16 + read-only + 0x0 + 0x9F + + + NE + desc NE + 0 + 0 + read-only + + + TOE + desc TOE + 1 + 1 + read-only + + + CE + desc CE + 2 + 2 + read-only + + + EBE + desc EBE + 3 + 3 + read-only + + + IE + desc IE + 4 + 4 + read-only + + + CMDE + desc CMDE + 7 + 7 + read-only + + + + + FEA + desc FEA + 0x50 + 16 + write-only + 0x0 + 0x9F + + + FNE + desc FNE + 0 + 0 + write-only + + + FTOE + desc FTOE + 1 + 1 + write-only + + + FCE + desc FCE + 2 + 2 + write-only + + + FEBE + desc FEBE + 3 + 3 + write-only + + + FIE + desc FIE + 4 + 4 + write-only + + + FCMDE + desc FCMDE + 7 + 7 + write-only + + + + + FEE + desc FEE + 0x52 + 16 + write-only + 0x0 + 0x17F + + + FCTOE + desc FCTOE + 0 + 0 + write-only + + + FCCE + desc FCCE + 1 + 1 + write-only + + + FCEBE + desc FCEBE + 2 + 2 + write-only + + + FCIE + desc FCIE + 3 + 3 + write-only + + + FDTOE + desc FDTOE + 4 + 4 + write-only + + + FDCE + desc FDCE + 5 + 5 + write-only + + + FDEBE + desc FDEBE + 6 + 6 + write-only + + + FACE + desc FACE + 8 + 8 + write-only + + + + + + + SDIOC2 + desc SDIOC + 0x40078400 + + 0x0 + 0x54 + + + + SMC + desc SMC + 0x88000000 + + 0x0 + 0x210 + + + + STSR + desc STSR + 0x0 + 32 + read-only + 0x1 + 0x1 + + + STATUS + desc STATUS + 0 + 0 + read-only + + + + + STCR0 + desc STCR0 + 0x8 + 32 + write-only + 0x0 + 0x4 + + + LPWIR + desc LPWIR + 2 + 2 + write-only + + + + + STCR1 + desc STCR1 + 0xC + 32 + write-only + 0x0 + 0x4 + + + LPWOR + desc LPWOR + 2 + 2 + write-only + + + + + CMDR + desc CMDR + 0x10 + 32 + write-only + 0x0 + 0x3FFFFFF + + + CMDADD + desc CMDADD + 19 + 0 + write-only + + + CRES + desc CRES + 20 + 20 + write-only + + + CMD + desc CMD + 22 + 21 + write-only + + + CMDCHIP + desc CMDCHIP + 25 + 23 + write-only + + + + + TMCR + desc TMCR + 0x14 + 32 + write-only + 0x0 + 0x17777FF + + + T_RC + desc T_RC + 3 + 0 + write-only + + + T_WC + desc T_WC + 7 + 4 + write-only + + + T_CEOE + desc T_CEOE + 10 + 8 + write-only + + + T_WP + desc T_WP + 14 + 12 + write-only + + + T_PC + desc T_PC + 18 + 16 + write-only + + + T_TR + desc T_TR + 22 + 20 + write-only + + + RESV0 + desc RESV0 + 24 + 24 + read-write + + + + + CPCR + desc CPCR + 0x18 + 32 + write-only + 0x0 + 0xFFFF + + + RSYN + desc RSYN + 0 + 0 + write-only + + + RBL + desc RBL + 3 + 1 + write-only + + + WSYN + desc WSYN + 4 + 4 + write-only + + + WBL + desc WBL + 7 + 5 + write-only + + + MW + desc MW + 9 + 8 + write-only + + + BAAS + desc BAAS + 10 + 10 + write-only + + + ADVS + desc ADVS + 11 + 11 + write-only + + + BLSS + desc BLSS + 12 + 12 + write-only + + + + + RFTR + desc RFTR + 0x20 + 32 + read-write + 0x0 + 0xF + + + REFPRD + desc REFPRD + 3 + 0 + read-write + + + + + TMSR0 + desc TMSR0 + 0x100 + 32 + read-only + 0x1263CC + 0x17777FF + + + T_RC + desc T_RC + 3 + 0 + read-only + + + T_WC + desc T_WC + 7 + 4 + read-only + + + T_CEOE + desc T_CEOE + 10 + 8 + read-only + + + T_WP + desc T_WP + 14 + 12 + read-only + + + T_PC + desc T_PC + 18 + 16 + read-only + + + T_TR + desc T_TR + 22 + 20 + read-only + + + RESV1 + desc RESV1 + 24 + 24 + read-write + + + + + CPSR0 + desc CPSR0 + 0x104 + 32 + read-only + 0xFF0A00 + 0xFFFFFFFF + + + RSYN + desc RSYN + 0 + 0 + read-only + + + RBL + desc RBL + 3 + 1 + read-only + + + WSYN + desc WSYN + 4 + 4 + read-only + + + WBL + desc WBL + 7 + 5 + read-only + + + MW + desc MW + 9 + 8 + read-only + + + BAAS + desc BAAS + 10 + 10 + read-only + + + ADVS + desc ADVS + 11 + 11 + read-only + + + BLSS + desc BLSS + 12 + 12 + read-only + + + ADDMSK + desc ADDMSK + 23 + 16 + read-only + + + ADDMAT + desc ADDMAT + 31 + 24 + read-only + + + + + TMSR1 + desc TMSR1 + 0x120 + 32 + read-only + 0x1263CC + 0x17777FF + + + T_RC + desc T_RC + 3 + 0 + read-only + + + T_WC + desc T_WC + 7 + 4 + read-only + + + T_CEOE + desc T_CEOE + 10 + 8 + read-only + + + T_WP + desc T_WP + 14 + 12 + read-only + + + T_PC + desc T_PC + 18 + 16 + read-only + + + T_TR + desc T_TR + 22 + 20 + read-only + + + RESV1 + desc RESV1 + 24 + 24 + read-write + + + + + CPSR1 + desc CPSR1 + 0x124 + 32 + read-only + 0xFF0A00 + 0xFFFFFFFF + + + RSYN + desc RSYN + 0 + 0 + read-only + + + RBL + desc RBL + 3 + 1 + read-only + + + WSYN + desc WSYN + 4 + 4 + read-only + + + WBL + desc WBL + 7 + 5 + read-only + + + MW + desc MW + 9 + 8 + read-only + + + BAAS + desc BAAS + 10 + 10 + read-only + + + ADVS + desc ADVS + 11 + 11 + read-only + + + BLSS + desc BLSS + 12 + 12 + read-only + + + ADDMSK + desc ADDMSK + 23 + 16 + read-only + + + ADDMAT + desc ADDMAT + 31 + 24 + read-only + + + + + TMSR2 + desc TMSR2 + 0x140 + 32 + read-only + 0x1263CC + 0x17777FF + + + T_RC + desc T_RC + 3 + 0 + read-only + + + T_WC + desc T_WC + 7 + 4 + read-only + + + T_CEOE + desc T_CEOE + 10 + 8 + read-only + + + T_WP + desc T_WP + 14 + 12 + read-only + + + T_PC + desc T_PC + 18 + 16 + read-only + + + T_TR + desc T_TR + 22 + 20 + read-only + + + RESV1 + desc RESV1 + 24 + 24 + read-write + + + + + CPSR2 + desc CPSR2 + 0x144 + 32 + read-only + 0xFF0A00 + 0xFFFFFFFF + + + RSYN + desc RSYN + 0 + 0 + read-only + + + RBL + desc RBL + 3 + 1 + read-only + + + WSYN + desc WSYN + 4 + 4 + read-only + + + WBL + desc WBL + 7 + 5 + read-only + + + MW + desc MW + 9 + 8 + read-only + + + BAAS + desc BAAS + 10 + 10 + read-only + + + ADVS + desc ADVS + 11 + 11 + read-only + + + BLSS + desc BLSS + 12 + 12 + read-only + + + ADDMSK + desc ADDMSK + 23 + 16 + read-only + + + ADDMAT + desc ADDMAT + 31 + 24 + read-only + + + + + TMSR3 + desc TMSR3 + 0x160 + 32 + read-only + 0x1263CC + 0x17777FF + + + T_RC + desc T_RC + 3 + 0 + read-only + + + T_WC + desc T_WC + 7 + 4 + read-only + + + T_CEOE + desc T_CEOE + 10 + 8 + read-only + + + T_WP + desc T_WP + 14 + 12 + read-only + + + T_PC + desc T_PC + 18 + 16 + read-only + + + T_TR + desc T_TR + 22 + 20 + read-only + + + RESV1 + desc RESV1 + 24 + 24 + read-write + + + + + CPSR3 + desc CPSR3 + 0x164 + 32 + read-only + 0xFF0A00 + 0xFFFFFFFF + + + RSYN + desc RSYN + 0 + 0 + read-only + + + RBL + desc RBL + 3 + 1 + read-only + + + WSYN + desc WSYN + 4 + 4 + read-only + + + WBL + desc WBL + 7 + 5 + read-only + + + MW + desc MW + 9 + 8 + read-only + + + BAAS + desc BAAS + 10 + 10 + read-only + + + ADVS + desc ADVS + 11 + 11 + read-only + + + BLSS + desc BLSS + 12 + 12 + read-only + + + ADDMSK + desc ADDMSK + 23 + 16 + read-only + + + ADDMAT + desc ADDMAT + 31 + 24 + read-only + + + + + BACR + desc BACR + 0x200 + 32 + read-write + 0x300 + 0x10 + + + MUXMD + desc MUXMD + 4 + 4 + read-write + + + + + CSCR0 + desc CSCR0 + 0x208 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + ADDMSK0 + desc ADDMSK0 + 7 + 0 + read-write + + + ADDMSK1 + desc ADDMSK1 + 15 + 8 + read-write + + + ADDMSK2 + desc ADDMSK2 + 23 + 16 + read-write + + + ADDMSK3 + desc ADDMSK3 + 31 + 24 + read-write + + + + + CSCR1 + desc CSCR1 + 0x20C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + ADDMAT0 + desc ADDMAT0 + 7 + 0 + read-write + + + ADDMAT1 + desc ADDMAT1 + 15 + 8 + read-write + + + ADDMAT2 + desc ADDMAT2 + 23 + 16 + read-write + + + ADDMAT3 + desc ADDMAT3 + 31 + 24 + read-write + + + + + + + SPI1 + desc SPI1 + 0x4001C000 + + 0x0 + 0x1C + + + + DR + desc DR + 0x0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + CR1 + desc CR1 + 0x4 + 32 + read-write + 0x0 + 0xFFFB + + + SPIMDS + desc SPIMDS + 0 + 0 + read-write + + + TXMDS + desc TXMDS + 1 + 1 + read-write + + + MSTR + desc MSTR + 3 + 3 + read-write + + + SPLPBK + desc SPLPBK + 4 + 4 + read-write + + + SPLPBK2 + desc SPLPBK2 + 5 + 5 + read-write + + + SPE + desc SPE + 6 + 6 + read-write + + + CSUSPE + desc CSUSPE + 7 + 7 + read-write + + + EIE + desc EIE + 8 + 8 + read-write + + + TXIE + desc TXIE + 9 + 9 + read-write + + + RXIE + desc RXIE + 10 + 10 + read-write + + + IDIE + desc IDIE + 11 + 11 + read-write + + + MODFE + desc MODFE + 12 + 12 + read-write + + + PATE + desc PATE + 13 + 13 + read-write + + + PAOE + desc PAOE + 14 + 14 + read-write + + + PAE + desc PAE + 15 + 15 + read-write + + + + + CFG1 + desc CFG1 + 0xC + 32 + read-write + 0x10 + 0x77700F43 + + + FTHLV + desc FTHLV + 1 + 0 + read-write + + + SPRDTD + desc SPRDTD + 6 + 6 + read-write + + + SS0PV + desc SS0PV + 8 + 8 + read-write + + + SS1PV + desc SS1PV + 9 + 9 + read-write + + + SS2PV + desc SS2PV + 10 + 10 + read-write + + + SS3PV + desc SS3PV + 11 + 11 + read-write + + + MSSI + desc MSSI + 22 + 20 + read-write + + + MSSDL + desc MSSDL + 26 + 24 + read-write + + + MIDI + desc MIDI + 30 + 28 + read-write + + + + + SR + desc SR + 0x14 + 32 + read-write + 0x20 + 0xBF + + + OVRERF + desc OVRERF + 0 + 0 + read-write + + + IDLNF + desc IDLNF + 1 + 1 + read-write + + + MODFERF + desc MODFERF + 2 + 2 + read-write + + + PERF + desc PERF + 3 + 3 + read-write + + + UDRERF + desc UDRERF + 4 + 4 + read-write + + + TDEF + desc TDEF + 5 + 5 + read-write + + + RDFF + desc RDFF + 7 + 7 + read-write + + + + + CFG2 + desc CFG2 + 0x18 + 32 + read-write + 0xF1D + 0xFFFF + + + CPHA + desc CPHA + 0 + 0 + read-write + + + CPOL + desc CPOL + 1 + 1 + read-write + + + MBR + desc MBR + 4 + 2 + read-write + + + SSA + desc SSA + 7 + 5 + read-write + + + DSIZE + desc DSIZE + 11 + 8 + read-write + + + LSBF + desc LSBF + 12 + 12 + read-write + + + MIDIE + desc MIDIE + 13 + 13 + read-write + + + MSSDLE + desc MSSDLE + 14 + 14 + read-write + + + MSSIE + desc MSSIE + 15 + 15 + read-write + + + + + + + SPI2 + desc SPI2 + 0x4001C400 + + 0x0 + 0x1C + + + + DR + desc DR + 0x0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + CR1 + desc CR1 + 0x4 + 32 + read-write + 0x0 + 0xFFFB + + + SPIMDS + desc SPIMDS + 0 + 0 + read-write + + + TXMDS + desc TXMDS + 1 + 1 + read-write + + + MSTR + desc MSTR + 3 + 3 + read-write + + + SPLPBK + desc SPLPBK + 4 + 4 + read-write + + + SPLPBK2 + desc SPLPBK2 + 5 + 5 + read-write + + + SPE + desc SPE + 6 + 6 + read-write + + + CSUSPE + desc CSUSPE + 7 + 7 + read-write + + + EIE + desc EIE + 8 + 8 + read-write + + + TXIE + desc TXIE + 9 + 9 + read-write + + + RXIE + desc RXIE + 10 + 10 + read-write + + + IDIE + desc IDIE + 11 + 11 + read-write + + + MODFE + desc MODFE + 12 + 12 + read-write + + + PATE + desc PATE + 13 + 13 + read-write + + + PAOE + desc PAOE + 14 + 14 + read-write + + + PAE + desc PAE + 15 + 15 + read-write + + + + + CFG1 + desc CFG1 + 0xC + 32 + read-write + 0x10 + 0x77700F43 + + + FTHLV + desc FTHLV + 1 + 0 + read-write + + + SPRDTD + desc SPRDTD + 6 + 6 + read-write + + + SS0PV + desc SS0PV + 8 + 8 + read-write + + + SS1PV + desc SS1PV + 9 + 9 + read-write + + + SS2PV + desc SS2PV + 10 + 10 + read-write + + + SS3PV + desc SS3PV + 11 + 11 + read-write + + + MSSI + desc MSSI + 22 + 20 + read-write + + + MSSDL + desc MSSDL + 26 + 24 + read-write + + + MIDI + desc MIDI + 30 + 28 + read-write + + + + + SR + desc SR + 0x14 + 32 + read-write + 0x20 + 0xBF + + + OVRERF + desc OVRERF + 0 + 0 + read-write + + + IDLNF + desc IDLNF + 1 + 1 + read-write + + + MODFERF + desc MODFERF + 2 + 2 + read-write + + + PERF + desc PERF + 3 + 3 + read-write + + + UDRERF + desc UDRERF + 4 + 4 + read-write + + + TDEF + desc TDEF + 5 + 5 + read-write + + + RDFF + desc RDFF + 7 + 7 + read-write + + + + + CFG2 + desc CFG2 + 0x18 + 32 + read-write + 0xF1D + 0xFFFF + + + CPHA + desc CPHA + 0 + 0 + read-write + + + CPOL + desc CPOL + 1 + 1 + read-write + + + MBR + desc MBR + 4 + 2 + read-write + + + SSA + desc SSA + 7 + 5 + read-write + + + DSIZE + desc DSIZE + 11 + 8 + read-write + + + LSBF + desc LSBF + 12 + 12 + read-write + + + MIDIE + desc MIDIE + 13 + 13 + read-write + + + MSSDLE + desc MSSDLE + 14 + 14 + read-write + + + MSSIE + desc MSSIE + 15 + 15 + read-write + + + + + + + SPI3 + desc SPI3 + 0x4001C800 + + 0x0 + 0x1C + + + + DR + desc DR + 0x0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + CR1 + desc CR1 + 0x4 + 32 + read-write + 0x0 + 0xFFFB + + + SPIMDS + desc SPIMDS + 0 + 0 + read-write + + + TXMDS + desc TXMDS + 1 + 1 + read-write + + + MSTR + desc MSTR + 3 + 3 + read-write + + + SPLPBK + desc SPLPBK + 4 + 4 + read-write + + + SPLPBK2 + desc SPLPBK2 + 5 + 5 + read-write + + + SPE + desc SPE + 6 + 6 + read-write + + + CSUSPE + desc CSUSPE + 7 + 7 + read-write + + + EIE + desc EIE + 8 + 8 + read-write + + + TXIE + desc TXIE + 9 + 9 + read-write + + + RXIE + desc RXIE + 10 + 10 + read-write + + + IDIE + desc IDIE + 11 + 11 + read-write + + + MODFE + desc MODFE + 12 + 12 + read-write + + + PATE + desc PATE + 13 + 13 + read-write + + + PAOE + desc PAOE + 14 + 14 + read-write + + + PAE + desc PAE + 15 + 15 + read-write + + + + + CFG1 + desc CFG1 + 0xC + 32 + read-write + 0x10 + 0x77700F43 + + + FTHLV + desc FTHLV + 1 + 0 + read-write + + + SPRDTD + desc SPRDTD + 6 + 6 + read-write + + + SS0PV + desc SS0PV + 8 + 8 + read-write + + + SS1PV + desc SS1PV + 9 + 9 + read-write + + + SS2PV + desc SS2PV + 10 + 10 + read-write + + + SS3PV + desc SS3PV + 11 + 11 + read-write + + + MSSI + desc MSSI + 22 + 20 + read-write + + + MSSDL + desc MSSDL + 26 + 24 + read-write + + + MIDI + desc MIDI + 30 + 28 + read-write + + + + + SR + desc SR + 0x14 + 32 + read-write + 0x20 + 0xBF + + + OVRERF + desc OVRERF + 0 + 0 + read-write + + + IDLNF + desc IDLNF + 1 + 1 + read-write + + + MODFERF + desc MODFERF + 2 + 2 + read-write + + + PERF + desc PERF + 3 + 3 + read-write + + + UDRERF + desc UDRERF + 4 + 4 + read-write + + + TDEF + desc TDEF + 5 + 5 + read-write + + + RDFF + desc RDFF + 7 + 7 + read-write + + + + + CFG2 + desc CFG2 + 0x18 + 32 + read-write + 0xF1D + 0xFFFF + + + CPHA + desc CPHA + 0 + 0 + read-write + + + CPOL + desc CPOL + 1 + 1 + read-write + + + MBR + desc MBR + 4 + 2 + read-write + + + SSA + desc SSA + 7 + 5 + read-write + + + DSIZE + desc DSIZE + 11 + 8 + read-write + + + LSBF + desc LSBF + 12 + 12 + read-write + + + MIDIE + desc MIDIE + 13 + 13 + read-write + + + MSSDLE + desc MSSDLE + 14 + 14 + read-write + + + MSSIE + desc MSSIE + 15 + 15 + read-write + + + + + + + SPI4 + desc SPI4 + 0x40020000 + + 0x0 + 0x1C + + + + DR + desc DR + 0x0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + CR1 + desc CR1 + 0x4 + 32 + read-write + 0x0 + 0xFFFB + + + SPIMDS + desc SPIMDS + 0 + 0 + read-write + + + TXMDS + desc TXMDS + 1 + 1 + read-write + + + MSTR + desc MSTR + 3 + 3 + read-write + + + SPLPBK + desc SPLPBK + 4 + 4 + read-write + + + SPLPBK2 + desc SPLPBK2 + 5 + 5 + read-write + + + SPE + desc SPE + 6 + 6 + read-write + + + CSUSPE + desc CSUSPE + 7 + 7 + read-write + + + EIE + desc EIE + 8 + 8 + read-write + + + TXIE + desc TXIE + 9 + 9 + read-write + + + RXIE + desc RXIE + 10 + 10 + read-write + + + IDIE + desc IDIE + 11 + 11 + read-write + + + MODFE + desc MODFE + 12 + 12 + read-write + + + PATE + desc PATE + 13 + 13 + read-write + + + PAOE + desc PAOE + 14 + 14 + read-write + + + PAE + desc PAE + 15 + 15 + read-write + + + + + CFG1 + desc CFG1 + 0xC + 32 + read-write + 0x10 + 0x77700F43 + + + FTHLV + desc FTHLV + 1 + 0 + read-write + + + SPRDTD + desc SPRDTD + 6 + 6 + read-write + + + SS0PV + desc SS0PV + 8 + 8 + read-write + + + SS1PV + desc SS1PV + 9 + 9 + read-write + + + SS2PV + desc SS2PV + 10 + 10 + read-write + + + SS3PV + desc SS3PV + 11 + 11 + read-write + + + MSSI + desc MSSI + 22 + 20 + read-write + + + MSSDL + desc MSSDL + 26 + 24 + read-write + + + MIDI + desc MIDI + 30 + 28 + read-write + + + + + SR + desc SR + 0x14 + 32 + read-write + 0x20 + 0xBF + + + OVRERF + desc OVRERF + 0 + 0 + read-write + + + IDLNF + desc IDLNF + 1 + 1 + read-write + + + MODFERF + desc MODFERF + 2 + 2 + read-write + + + PERF + desc PERF + 3 + 3 + read-write + + + UDRERF + desc UDRERF + 4 + 4 + read-write + + + TDEF + desc TDEF + 5 + 5 + read-write + + + RDFF + desc RDFF + 7 + 7 + read-write + + + + + CFG2 + desc CFG2 + 0x18 + 32 + read-write + 0xF1D + 0xFFFF + + + CPHA + desc CPHA + 0 + 0 + read-write + + + CPOL + desc CPOL + 1 + 1 + read-write + + + MBR + desc MBR + 4 + 2 + read-write + + + SSA + desc SSA + 7 + 5 + read-write + + + DSIZE + desc DSIZE + 11 + 8 + read-write + + + LSBF + desc LSBF + 12 + 12 + read-write + + + MIDIE + desc MIDIE + 13 + 13 + read-write + + + MSSDLE + desc MSSDLE + 14 + 14 + read-write + + + MSSIE + desc MSSIE + 15 + 15 + read-write + + + + + + + SPI5 + desc SPI5 + 0x40020400 + + 0x0 + 0x1C + + + + DR + desc DR + 0x0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + CR1 + desc CR1 + 0x4 + 32 + read-write + 0x0 + 0xFFFB + + + SPIMDS + desc SPIMDS + 0 + 0 + read-write + + + TXMDS + desc TXMDS + 1 + 1 + read-write + + + MSTR + desc MSTR + 3 + 3 + read-write + + + SPLPBK + desc SPLPBK + 4 + 4 + read-write + + + SPLPBK2 + desc SPLPBK2 + 5 + 5 + read-write + + + SPE + desc SPE + 6 + 6 + read-write + + + CSUSPE + desc CSUSPE + 7 + 7 + read-write + + + EIE + desc EIE + 8 + 8 + read-write + + + TXIE + desc TXIE + 9 + 9 + read-write + + + RXIE + desc RXIE + 10 + 10 + read-write + + + IDIE + desc IDIE + 11 + 11 + read-write + + + MODFE + desc MODFE + 12 + 12 + read-write + + + PATE + desc PATE + 13 + 13 + read-write + + + PAOE + desc PAOE + 14 + 14 + read-write + + + PAE + desc PAE + 15 + 15 + read-write + + + + + CFG1 + desc CFG1 + 0xC + 32 + read-write + 0x10 + 0x77700F43 + + + FTHLV + desc FTHLV + 1 + 0 + read-write + + + SPRDTD + desc SPRDTD + 6 + 6 + read-write + + + SS0PV + desc SS0PV + 8 + 8 + read-write + + + SS1PV + desc SS1PV + 9 + 9 + read-write + + + SS2PV + desc SS2PV + 10 + 10 + read-write + + + SS3PV + desc SS3PV + 11 + 11 + read-write + + + MSSI + desc MSSI + 22 + 20 + read-write + + + MSSDL + desc MSSDL + 26 + 24 + read-write + + + MIDI + desc MIDI + 30 + 28 + read-write + + + + + SR + desc SR + 0x14 + 32 + read-write + 0x20 + 0xBF + + + OVRERF + desc OVRERF + 0 + 0 + read-write + + + IDLNF + desc IDLNF + 1 + 1 + read-write + + + MODFERF + desc MODFERF + 2 + 2 + read-write + + + PERF + desc PERF + 3 + 3 + read-write + + + UDRERF + desc UDRERF + 4 + 4 + read-write + + + TDEF + desc TDEF + 5 + 5 + read-write + + + RDFF + desc RDFF + 7 + 7 + read-write + + + + + CFG2 + desc CFG2 + 0x18 + 32 + read-write + 0xF1D + 0xFFFF + + + CPHA + desc CPHA + 0 + 0 + read-write + + + CPOL + desc CPOL + 1 + 1 + read-write + + + MBR + desc MBR + 4 + 2 + read-write + + + SSA + desc SSA + 7 + 5 + read-write + + + DSIZE + desc DSIZE + 11 + 8 + read-write + + + LSBF + desc LSBF + 12 + 12 + read-write + + + MIDIE + desc MIDIE + 13 + 13 + read-write + + + MSSDLE + desc MSSDLE + 14 + 14 + read-write + + + MSSIE + desc MSSIE + 15 + 15 + read-write + + + + + + + SPI6 + desc SPI6 + 0x40020800 + + 0x0 + 0x1C + + + + DR + desc DR + 0x0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + CR1 + desc CR1 + 0x4 + 32 + read-write + 0x0 + 0xFFFB + + + SPIMDS + desc SPIMDS + 0 + 0 + read-write + + + TXMDS + desc TXMDS + 1 + 1 + read-write + + + MSTR + desc MSTR + 3 + 3 + read-write + + + SPLPBK + desc SPLPBK + 4 + 4 + read-write + + + SPLPBK2 + desc SPLPBK2 + 5 + 5 + read-write + + + SPE + desc SPE + 6 + 6 + read-write + + + CSUSPE + desc CSUSPE + 7 + 7 + read-write + + + EIE + desc EIE + 8 + 8 + read-write + + + TXIE + desc TXIE + 9 + 9 + read-write + + + RXIE + desc RXIE + 10 + 10 + read-write + + + IDIE + desc IDIE + 11 + 11 + read-write + + + MODFE + desc MODFE + 12 + 12 + read-write + + + PATE + desc PATE + 13 + 13 + read-write + + + PAOE + desc PAOE + 14 + 14 + read-write + + + PAE + desc PAE + 15 + 15 + read-write + + + + + CFG1 + desc CFG1 + 0xC + 32 + read-write + 0x10 + 0x77700F43 + + + FTHLV + desc FTHLV + 1 + 0 + read-write + + + SPRDTD + desc SPRDTD + 6 + 6 + read-write + + + SS0PV + desc SS0PV + 8 + 8 + read-write + + + SS1PV + desc SS1PV + 9 + 9 + read-write + + + SS2PV + desc SS2PV + 10 + 10 + read-write + + + SS3PV + desc SS3PV + 11 + 11 + read-write + + + MSSI + desc MSSI + 22 + 20 + read-write + + + MSSDL + desc MSSDL + 26 + 24 + read-write + + + MIDI + desc MIDI + 30 + 28 + read-write + + + + + SR + desc SR + 0x14 + 32 + read-write + 0x20 + 0xBF + + + OVRERF + desc OVRERF + 0 + 0 + read-write + + + IDLNF + desc IDLNF + 1 + 1 + read-write + + + MODFERF + desc MODFERF + 2 + 2 + read-write + + + PERF + desc PERF + 3 + 3 + read-write + + + UDRERF + desc UDRERF + 4 + 4 + read-write + + + TDEF + desc TDEF + 5 + 5 + read-write + + + RDFF + desc RDFF + 7 + 7 + read-write + + + + + CFG2 + desc CFG2 + 0x18 + 32 + read-write + 0xF1D + 0xFFFF + + + CPHA + desc CPHA + 0 + 0 + read-write + + + CPOL + desc CPOL + 1 + 1 + read-write + + + MBR + desc MBR + 4 + 2 + read-write + + + SSA + desc SSA + 7 + 5 + read-write + + + DSIZE + desc DSIZE + 11 + 8 + read-write + + + LSBF + desc LSBF + 12 + 12 + read-write + + + MIDIE + desc MIDIE + 13 + 13 + read-write + + + MSSDLE + desc MSSDLE + 14 + 14 + read-write + + + MSSIE + desc MSSIE + 15 + 15 + read-write + + + + + + + SRAMC + desc SRAMC + 0x40050800 + + 0x0 + 0x14 + + + + WTCR + desc WTCR + 0x0 + 32 + read-write + 0x0 + 0x77777777 + + + SRAM123RWT + desc SRAM123RWT + 2 + 0 + read-write + + + SRAM123WWT + desc SRAM123WWT + 6 + 4 + read-write + + + SRAM4RWT + desc SRAM4RWT + 10 + 8 + read-write + + + SRAM4WWT + desc SRAM4WWT + 14 + 12 + read-write + + + SRAMHRWT + desc SRAMHRWT + 18 + 16 + read-write + + + SRAMHWWT + desc SRAMHWWT + 22 + 20 + read-write + + + SRAMBRWT + desc SRAMBRWT + 26 + 24 + read-write + + + SRAMBWWT + desc SRAMBWWT + 30 + 28 + read-write + + + + + WTPR + desc WTPR + 0x4 + 32 + read-write + 0x0 + 0xFF + + + WTPRC + desc WTPRC + 0 + 0 + read-write + + + WTPRKW + desc WTPRKW + 7 + 1 + read-write + + + + + CKCR + desc CKCR + 0x8 + 32 + read-write + 0x0 + 0xF030001 + + + PYOAD + desc PYOAD + 0 + 0 + read-write + + + ECCOAD + desc ECCOAD + 16 + 16 + read-write + + + BECCOAD + desc BECCOAD + 17 + 17 + read-write + + + ECCMOD + desc ECCMOD + 25 + 24 + read-write + + + BECCMOD + desc BECCMOD + 27 + 26 + read-write + + + + + CKPR + desc CKPR + 0xC + 32 + read-write + 0x0 + 0xFF + + + CKPRC + desc CKPRC + 0 + 0 + read-write + + + CKPRKW + desc CKPRKW + 7 + 1 + read-write + + + + + CKSR + desc CKSR + 0x10 + 32 + read-write + 0x0 + 0x1FF + + + SRAM1_PYERR + desc SRAM1_PYERR + 0 + 0 + read-write + + + SRAM2_PYERR + desc SRAM2_PYERR + 1 + 1 + read-write + + + SRAM3_PYERR + desc SRAM3_PYERR + 2 + 2 + read-write + + + SRAMH_PYERR + desc SRAMH_PYERR + 3 + 3 + read-write + + + SRAM4_1ERR + desc SRAM4_1ERR + 4 + 4 + read-write + + + SRAM4_2ERR + desc SRAM4_2ERR + 5 + 5 + read-write + + + SRAMB_1ERR + desc SRAMB_1ERR + 6 + 6 + read-write + + + SRAMB_2ERR + desc SRAMB_2ERR + 7 + 7 + read-write + + + CACHE_PYERR + desc CACHE_PYERR + 8 + 8 + read-write + + + + + + + SWDT + desc SWDT + 0x40049400 + + 0x0 + 0xC + + + + CR + desc CR + 0x0 + 32 + read-write + 0x80010FF3 + 0x80010FF3 + + + PERI + desc PERI + 1 + 0 + read-write + + + CKS + desc CKS + 7 + 4 + read-write + + + WDPT + desc WDPT + 11 + 8 + read-write + + + SLPOFF + desc SLPOFF + 16 + 16 + read-write + + + ITS + desc ITS + 31 + 31 + read-write + + + + + SR + desc SR + 0x4 + 32 + read-only + 0x0 + 0x3FFFF + + + CNT + desc CNT + 15 + 0 + read-only + + + UDF + desc UDF + 16 + 16 + read-write + + + REF + desc REF + 17 + 17 + read-write + + + + + RR + desc RR + 0x8 + 32 + read-only + 0x0 + 0xFFFF + + + RF + desc RF + 15 + 0 + read-only + + + + + + + TMR01 + desc TMR01 + 0x40024000 + + 0x0 + 0x18 + + + + CNTAR + desc CNTAR + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNTA + desc CNTA + 15 + 0 + read-write + + + + + CNTBR + desc CNTBR + 0x4 + 32 + read-write + 0x0 + 0xFFFF + + + CNTB + desc CNTB + 15 + 0 + read-write + + + + + CMPAR + desc CMPAR + 0x8 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMPA + desc CMPA + 15 + 0 + read-write + + + + + CMPBR + desc CMPBR + 0xC + 32 + read-write + 0xFFFF + 0xFFFF + + + CMPB + desc CMPB + 15 + 0 + read-write + + + + + BCONR + desc BCONR + 0x10 + 32 + read-write + 0x0 + 0xF7F7F7F7 + + + CSTA + desc CSTA + 0 + 0 + read-write + + + CAPMDA + desc CAPMDA + 1 + 1 + read-write + + + INTENA + desc INTENA + 2 + 2 + read-write + + + CKDIVA + desc CKDIVA + 7 + 4 + read-write + + + SYNSA + desc SYNSA + 8 + 8 + read-write + + + SYNCLKA + desc SYNCLKA + 9 + 9 + read-write + + + ASYNCLKA + desc ASYNCLKA + 10 + 10 + read-write + + + HSTAA + desc HSTAA + 12 + 12 + read-write + + + HSTPA + desc HSTPA + 13 + 13 + read-write + + + HCLEA + desc HCLEA + 14 + 14 + read-write + + + HICPA + desc HICPA + 15 + 15 + read-write + + + CSTB + desc CSTB + 16 + 16 + read-write + + + CAPMDB + desc CAPMDB + 17 + 17 + read-write + + + INTENB + desc INTENB + 18 + 18 + read-write + + + CKDIVB + desc CKDIVB + 23 + 20 + read-write + + + SYNSB + desc SYNSB + 24 + 24 + read-write + + + SYNCLKB + desc SYNCLKB + 25 + 25 + read-write + + + ASYNCLKB + desc ASYNCLKB + 26 + 26 + read-write + + + HSTAB + desc HSTAB + 28 + 28 + read-write + + + HSTPB + desc HSTPB + 29 + 29 + read-write + + + HCLEB + desc HCLEB + 30 + 30 + read-write + + + HICPB + desc HICPB + 31 + 31 + read-write + + + + + STFLR + desc STFLR + 0x14 + 32 + read-write + 0x0 + 0x10001 + + + CMFA + desc CMFA + 0 + 0 + read-write + + + CMFB + desc CMFB + 16 + 16 + read-write + + + + + + + TMR02 + desc TMR02 + 0x40024400 + + 0x0 + 0x18 + + + + CNTAR + desc CNTAR + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNTA + desc CNTA + 15 + 0 + read-write + + + + + CNTBR + desc CNTBR + 0x4 + 32 + read-write + 0x0 + 0xFFFF + + + CNTB + desc CNTB + 15 + 0 + read-write + + + + + CMPAR + desc CMPAR + 0x8 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMPA + desc CMPA + 15 + 0 + read-write + + + + + CMPBR + desc CMPBR + 0xC + 32 + read-write + 0xFFFF + 0xFFFF + + + CMPB + desc CMPB + 15 + 0 + read-write + + + + + BCONR + desc BCONR + 0x10 + 32 + read-write + 0x0 + 0xF7F7F7F7 + + + CSTA + desc CSTA + 0 + 0 + read-write + + + CAPMDA + desc CAPMDA + 1 + 1 + read-write + + + INTENA + desc INTENA + 2 + 2 + read-write + + + CKDIVA + desc CKDIVA + 7 + 4 + read-write + + + SYNSA + desc SYNSA + 8 + 8 + read-write + + + SYNCLKA + desc SYNCLKA + 9 + 9 + read-write + + + ASYNCLKA + desc ASYNCLKA + 10 + 10 + read-write + + + HSTAA + desc HSTAA + 12 + 12 + read-write + + + HSTPA + desc HSTPA + 13 + 13 + read-write + + + HCLEA + desc HCLEA + 14 + 14 + read-write + + + HICPA + desc HICPA + 15 + 15 + read-write + + + CSTB + desc CSTB + 16 + 16 + read-write + + + CAPMDB + desc CAPMDB + 17 + 17 + read-write + + + INTENB + desc INTENB + 18 + 18 + read-write + + + CKDIVB + desc CKDIVB + 23 + 20 + read-write + + + SYNSB + desc SYNSB + 24 + 24 + read-write + + + SYNCLKB + desc SYNCLKB + 25 + 25 + read-write + + + ASYNCLKB + desc ASYNCLKB + 26 + 26 + read-write + + + HSTAB + desc HSTAB + 28 + 28 + read-write + + + HSTPB + desc HSTPB + 29 + 29 + read-write + + + HCLEB + desc HCLEB + 30 + 30 + read-write + + + HICPB + desc HICPB + 31 + 31 + read-write + + + + + STFLR + desc STFLR + 0x14 + 32 + read-write + 0x0 + 0x10001 + + + CMFA + desc CMFA + 0 + 0 + read-write + + + CMFB + desc CMFB + 16 + 16 + read-write + + + + + + + TMR21 + desc TMR21 + 0x40024800 + + 0x0 + 0x24 + + + + CNTAR + desc CNTAR + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNTA + desc CNTA + 15 + 0 + read-write + + + + + CNTBR + desc CNTBR + 0x4 + 32 + read-write + 0x0 + 0xFFFF + + + CNTB + desc CNTB + 15 + 0 + read-write + + + + + CMPAR + desc CMPAR + 0x8 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMPA + desc CMPA + 15 + 0 + read-write + + + + + CMPBR + desc CMPBR + 0xC + 32 + read-write + 0xFFFF + 0xFFFF + + + CMPB + desc CMPB + 15 + 0 + read-write + + + + + BCONR + desc BCONR + 0x10 + 32 + read-write + 0x0 + 0x3FFB3FFB + + + CSTA + desc CSTA + 0 + 0 + read-write + + + CAPMDA + desc CAPMDA + 1 + 1 + read-write + + + SYNSA + desc SYNSA + 3 + 3 + read-write + + + CKDIVA + desc CKDIVA + 7 + 4 + read-write + + + SYNCLKA + desc SYNCLKA + 9 + 8 + read-write + + + ASYNCLKA + desc ASYNCLKA + 11 + 10 + read-write + + + SYNCLKAT + desc SYNCLKAT + 13 + 12 + read-write + + + CSTB + desc CSTB + 16 + 16 + read-write + + + CAPMDB + desc CAPMDB + 17 + 17 + read-write + + + SYNSB + desc SYNSB + 19 + 19 + read-write + + + CKDIVB + desc CKDIVB + 23 + 20 + read-write + + + SYNCLKB + desc SYNCLKB + 25 + 24 + read-write + + + ASYNCLKB + desc ASYNCLKB + 27 + 26 + read-write + + + SYNCLKBT + desc SYNCLKBT + 29 + 28 + read-write + + + + + ICONR + desc ICONR + 0x14 + 32 + read-write + 0x0 + 0x1030003 + + + CMENA + desc CMENA + 0 + 0 + read-write + + + OVENA + desc OVENA + 1 + 1 + read-write + + + CMENB + desc CMENB + 16 + 16 + read-write + + + OVENB + desc OVENB + 17 + 17 + read-write + + + RESV + desc RESV + 24 + 24 + read-write + + + + + PCONR + desc PCONR + 0x18 + 32 + read-write + 0x0 + 0x713F713F + + + STACA + desc STACA + 1 + 0 + read-write + + + STPCA + desc STPCA + 3 + 2 + read-write + + + CMPCA + desc CMPCA + 5 + 4 + read-write + + + OUTENA + desc OUTENA + 8 + 8 + read-write + + + NOFIENA + desc NOFIENA + 12 + 12 + read-write + + + NOFICKA + desc NOFICKA + 14 + 13 + read-write + + + STACB + desc STACB + 17 + 16 + read-write + + + STPCB + desc STPCB + 19 + 18 + read-write + + + CMPCB + desc CMPCB + 21 + 20 + read-write + + + OUTENB + desc OUTENB + 24 + 24 + read-write + + + NOFIENB + desc NOFIENB + 28 + 28 + read-write + + + NOFICKB + desc NOFICKB + 30 + 29 + read-write + + + + + HCONR + desc HCONR + 0x1C + 32 + read-write + 0x0 + 0x77777777 + + + HSTAA0 + desc HSTAA0 + 0 + 0 + read-write + + + HSTAA1 + desc HSTAA1 + 1 + 1 + read-write + + + HSTAA2 + desc HSTAA2 + 2 + 2 + read-write + + + HSTPA0 + desc HSTPA0 + 4 + 4 + read-write + + + HSTPA1 + desc HSTPA1 + 5 + 5 + read-write + + + HSTPA2 + desc HSTPA2 + 6 + 6 + read-write + + + HCLEA0 + desc HCLEA0 + 8 + 8 + read-write + + + HCLEA1 + desc HCLEA1 + 9 + 9 + read-write + + + HCLEA2 + desc HCLEA2 + 10 + 10 + read-write + + + HICPA0 + desc HICPA0 + 12 + 12 + read-write + + + HICPA1 + desc HICPA1 + 13 + 13 + read-write + + + HICPA2 + desc HICPA2 + 14 + 14 + read-write + + + HSTAB0 + desc HSTAB0 + 16 + 16 + read-write + + + HSTAB1 + desc HSTAB1 + 17 + 17 + read-write + + + HSTAB2 + desc HSTAB2 + 18 + 18 + read-write + + + HSTPB0 + desc HSTPB0 + 20 + 20 + read-write + + + HSTPB1 + desc HSTPB1 + 21 + 21 + read-write + + + HSTPB2 + desc HSTPB2 + 22 + 22 + read-write + + + HCLEB0 + desc HCLEB0 + 24 + 24 + read-write + + + HCLEB1 + desc HCLEB1 + 25 + 25 + read-write + + + HCLEB2 + desc HCLEB2 + 26 + 26 + read-write + + + HICPB0 + desc HICPB0 + 28 + 28 + read-write + + + HICPB1 + desc HICPB1 + 29 + 29 + read-write + + + HICPB2 + desc HICPB2 + 30 + 30 + read-write + + + + + STFLR + desc STFLR + 0x20 + 32 + read-write + 0x0 + 0x1030003 + + + CMFA + desc CMFA + 0 + 0 + read-write + + + OVFA + desc OVFA + 1 + 1 + read-write + + + CMFB + desc CMFB + 16 + 16 + read-write + + + OVFB + desc OVFB + 17 + 17 + read-write + + + RESV + desc RESV + 24 + 24 + read-write + + + + + + + TMR22 + desc TMR22 + 0x40024C00 + + 0x0 + 0x24 + + + + CNTAR + desc CNTAR + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNTA + desc CNTA + 15 + 0 + read-write + + + + + CNTBR + desc CNTBR + 0x4 + 32 + read-write + 0x0 + 0xFFFF + + + CNTB + desc CNTB + 15 + 0 + read-write + + + + + CMPAR + desc CMPAR + 0x8 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMPA + desc CMPA + 15 + 0 + read-write + + + + + CMPBR + desc CMPBR + 0xC + 32 + read-write + 0xFFFF + 0xFFFF + + + CMPB + desc CMPB + 15 + 0 + read-write + + + + + BCONR + desc BCONR + 0x10 + 32 + read-write + 0x0 + 0x3FFB3FFB + + + CSTA + desc CSTA + 0 + 0 + read-write + + + CAPMDA + desc CAPMDA + 1 + 1 + read-write + + + SYNSA + desc SYNSA + 3 + 3 + read-write + + + CKDIVA + desc CKDIVA + 7 + 4 + read-write + + + SYNCLKA + desc SYNCLKA + 9 + 8 + read-write + + + ASYNCLKA + desc ASYNCLKA + 11 + 10 + read-write + + + SYNCLKAT + desc SYNCLKAT + 13 + 12 + read-write + + + CSTB + desc CSTB + 16 + 16 + read-write + + + CAPMDB + desc CAPMDB + 17 + 17 + read-write + + + SYNSB + desc SYNSB + 19 + 19 + read-write + + + CKDIVB + desc CKDIVB + 23 + 20 + read-write + + + SYNCLKB + desc SYNCLKB + 25 + 24 + read-write + + + ASYNCLKB + desc ASYNCLKB + 27 + 26 + read-write + + + SYNCLKBT + desc SYNCLKBT + 29 + 28 + read-write + + + + + ICONR + desc ICONR + 0x14 + 32 + read-write + 0x0 + 0x1030003 + + + CMENA + desc CMENA + 0 + 0 + read-write + + + OVENA + desc OVENA + 1 + 1 + read-write + + + CMENB + desc CMENB + 16 + 16 + read-write + + + OVENB + desc OVENB + 17 + 17 + read-write + + + RESV + desc RESV + 24 + 24 + read-write + + + + + PCONR + desc PCONR + 0x18 + 32 + read-write + 0x0 + 0x713F713F + + + STACA + desc STACA + 1 + 0 + read-write + + + STPCA + desc STPCA + 3 + 2 + read-write + + + CMPCA + desc CMPCA + 5 + 4 + read-write + + + OUTENA + desc OUTENA + 8 + 8 + read-write + + + NOFIENA + desc NOFIENA + 12 + 12 + read-write + + + NOFICKA + desc NOFICKA + 14 + 13 + read-write + + + STACB + desc STACB + 17 + 16 + read-write + + + STPCB + desc STPCB + 19 + 18 + read-write + + + CMPCB + desc CMPCB + 21 + 20 + read-write + + + OUTENB + desc OUTENB + 24 + 24 + read-write + + + NOFIENB + desc NOFIENB + 28 + 28 + read-write + + + NOFICKB + desc NOFICKB + 30 + 29 + read-write + + + + + HCONR + desc HCONR + 0x1C + 32 + read-write + 0x0 + 0x77777777 + + + HSTAA0 + desc HSTAA0 + 0 + 0 + read-write + + + HSTAA1 + desc HSTAA1 + 1 + 1 + read-write + + + HSTAA2 + desc HSTAA2 + 2 + 2 + read-write + + + HSTPA0 + desc HSTPA0 + 4 + 4 + read-write + + + HSTPA1 + desc HSTPA1 + 5 + 5 + read-write + + + HSTPA2 + desc HSTPA2 + 6 + 6 + read-write + + + HCLEA0 + desc HCLEA0 + 8 + 8 + read-write + + + HCLEA1 + desc HCLEA1 + 9 + 9 + read-write + + + HCLEA2 + desc HCLEA2 + 10 + 10 + read-write + + + HICPA0 + desc HICPA0 + 12 + 12 + read-write + + + HICPA1 + desc HICPA1 + 13 + 13 + read-write + + + HICPA2 + desc HICPA2 + 14 + 14 + read-write + + + HSTAB0 + desc HSTAB0 + 16 + 16 + read-write + + + HSTAB1 + desc HSTAB1 + 17 + 17 + read-write + + + HSTAB2 + desc HSTAB2 + 18 + 18 + read-write + + + HSTPB0 + desc HSTPB0 + 20 + 20 + read-write + + + HSTPB1 + desc HSTPB1 + 21 + 21 + read-write + + + HSTPB2 + desc HSTPB2 + 22 + 22 + read-write + + + HCLEB0 + desc HCLEB0 + 24 + 24 + read-write + + + HCLEB1 + desc HCLEB1 + 25 + 25 + read-write + + + HCLEB2 + desc HCLEB2 + 26 + 26 + read-write + + + HICPB0 + desc HICPB0 + 28 + 28 + read-write + + + HICPB1 + desc HICPB1 + 29 + 29 + read-write + + + HICPB2 + desc HICPB2 + 30 + 30 + read-write + + + + + STFLR + desc STFLR + 0x20 + 32 + read-write + 0x0 + 0x1030003 + + + CMFA + desc CMFA + 0 + 0 + read-write + + + OVFA + desc OVFA + 1 + 1 + read-write + + + CMFB + desc CMFB + 16 + 16 + read-write + + + OVFB + desc OVFB + 17 + 17 + read-write + + + RESV + desc RESV + 24 + 24 + read-write + + + + + + + TMR23 + desc TMR23 + 0x40025000 + + 0x0 + 0x24 + + + + CNTAR + desc CNTAR + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNTA + desc CNTA + 15 + 0 + read-write + + + + + CNTBR + desc CNTBR + 0x4 + 32 + read-write + 0x0 + 0xFFFF + + + CNTB + desc CNTB + 15 + 0 + read-write + + + + + CMPAR + desc CMPAR + 0x8 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMPA + desc CMPA + 15 + 0 + read-write + + + + + CMPBR + desc CMPBR + 0xC + 32 + read-write + 0xFFFF + 0xFFFF + + + CMPB + desc CMPB + 15 + 0 + read-write + + + + + BCONR + desc BCONR + 0x10 + 32 + read-write + 0x0 + 0x3FFB3FFB + + + CSTA + desc CSTA + 0 + 0 + read-write + + + CAPMDA + desc CAPMDA + 1 + 1 + read-write + + + SYNSA + desc SYNSA + 3 + 3 + read-write + + + CKDIVA + desc CKDIVA + 7 + 4 + read-write + + + SYNCLKA + desc SYNCLKA + 9 + 8 + read-write + + + ASYNCLKA + desc ASYNCLKA + 11 + 10 + read-write + + + SYNCLKAT + desc SYNCLKAT + 13 + 12 + read-write + + + CSTB + desc CSTB + 16 + 16 + read-write + + + CAPMDB + desc CAPMDB + 17 + 17 + read-write + + + SYNSB + desc SYNSB + 19 + 19 + read-write + + + CKDIVB + desc CKDIVB + 23 + 20 + read-write + + + SYNCLKB + desc SYNCLKB + 25 + 24 + read-write + + + ASYNCLKB + desc ASYNCLKB + 27 + 26 + read-write + + + SYNCLKBT + desc SYNCLKBT + 29 + 28 + read-write + + + + + ICONR + desc ICONR + 0x14 + 32 + read-write + 0x0 + 0x1030003 + + + CMENA + desc CMENA + 0 + 0 + read-write + + + OVENA + desc OVENA + 1 + 1 + read-write + + + CMENB + desc CMENB + 16 + 16 + read-write + + + OVENB + desc OVENB + 17 + 17 + read-write + + + RESV + desc RESV + 24 + 24 + read-write + + + + + PCONR + desc PCONR + 0x18 + 32 + read-write + 0x0 + 0x713F713F + + + STACA + desc STACA + 1 + 0 + read-write + + + STPCA + desc STPCA + 3 + 2 + read-write + + + CMPCA + desc CMPCA + 5 + 4 + read-write + + + OUTENA + desc OUTENA + 8 + 8 + read-write + + + NOFIENA + desc NOFIENA + 12 + 12 + read-write + + + NOFICKA + desc NOFICKA + 14 + 13 + read-write + + + STACB + desc STACB + 17 + 16 + read-write + + + STPCB + desc STPCB + 19 + 18 + read-write + + + CMPCB + desc CMPCB + 21 + 20 + read-write + + + OUTENB + desc OUTENB + 24 + 24 + read-write + + + NOFIENB + desc NOFIENB + 28 + 28 + read-write + + + NOFICKB + desc NOFICKB + 30 + 29 + read-write + + + + + HCONR + desc HCONR + 0x1C + 32 + read-write + 0x0 + 0x77777777 + + + HSTAA0 + desc HSTAA0 + 0 + 0 + read-write + + + HSTAA1 + desc HSTAA1 + 1 + 1 + read-write + + + HSTAA2 + desc HSTAA2 + 2 + 2 + read-write + + + HSTPA0 + desc HSTPA0 + 4 + 4 + read-write + + + HSTPA1 + desc HSTPA1 + 5 + 5 + read-write + + + HSTPA2 + desc HSTPA2 + 6 + 6 + read-write + + + HCLEA0 + desc HCLEA0 + 8 + 8 + read-write + + + HCLEA1 + desc HCLEA1 + 9 + 9 + read-write + + + HCLEA2 + desc HCLEA2 + 10 + 10 + read-write + + + HICPA0 + desc HICPA0 + 12 + 12 + read-write + + + HICPA1 + desc HICPA1 + 13 + 13 + read-write + + + HICPA2 + desc HICPA2 + 14 + 14 + read-write + + + HSTAB0 + desc HSTAB0 + 16 + 16 + read-write + + + HSTAB1 + desc HSTAB1 + 17 + 17 + read-write + + + HSTAB2 + desc HSTAB2 + 18 + 18 + read-write + + + HSTPB0 + desc HSTPB0 + 20 + 20 + read-write + + + HSTPB1 + desc HSTPB1 + 21 + 21 + read-write + + + HSTPB2 + desc HSTPB2 + 22 + 22 + read-write + + + HCLEB0 + desc HCLEB0 + 24 + 24 + read-write + + + HCLEB1 + desc HCLEB1 + 25 + 25 + read-write + + + HCLEB2 + desc HCLEB2 + 26 + 26 + read-write + + + HICPB0 + desc HICPB0 + 28 + 28 + read-write + + + HICPB1 + desc HICPB1 + 29 + 29 + read-write + + + HICPB2 + desc HICPB2 + 30 + 30 + read-write + + + + + STFLR + desc STFLR + 0x20 + 32 + read-write + 0x0 + 0x1030003 + + + CMFA + desc CMFA + 0 + 0 + read-write + + + OVFA + desc OVFA + 1 + 1 + read-write + + + CMFB + desc CMFB + 16 + 16 + read-write + + + OVFB + desc OVFB + 17 + 17 + read-write + + + RESV + desc RESV + 24 + 24 + read-write + + + + + + + TMR24 + desc TMR24 + 0x40025400 + + 0x0 + 0x24 + + + + CNTAR + desc CNTAR + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNTA + desc CNTA + 15 + 0 + read-write + + + + + CNTBR + desc CNTBR + 0x4 + 32 + read-write + 0x0 + 0xFFFF + + + CNTB + desc CNTB + 15 + 0 + read-write + + + + + CMPAR + desc CMPAR + 0x8 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMPA + desc CMPA + 15 + 0 + read-write + + + + + CMPBR + desc CMPBR + 0xC + 32 + read-write + 0xFFFF + 0xFFFF + + + CMPB + desc CMPB + 15 + 0 + read-write + + + + + BCONR + desc BCONR + 0x10 + 32 + read-write + 0x0 + 0x3FFB3FFB + + + CSTA + desc CSTA + 0 + 0 + read-write + + + CAPMDA + desc CAPMDA + 1 + 1 + read-write + + + SYNSA + desc SYNSA + 3 + 3 + read-write + + + CKDIVA + desc CKDIVA + 7 + 4 + read-write + + + SYNCLKA + desc SYNCLKA + 9 + 8 + read-write + + + ASYNCLKA + desc ASYNCLKA + 11 + 10 + read-write + + + SYNCLKAT + desc SYNCLKAT + 13 + 12 + read-write + + + CSTB + desc CSTB + 16 + 16 + read-write + + + CAPMDB + desc CAPMDB + 17 + 17 + read-write + + + SYNSB + desc SYNSB + 19 + 19 + read-write + + + CKDIVB + desc CKDIVB + 23 + 20 + read-write + + + SYNCLKB + desc SYNCLKB + 25 + 24 + read-write + + + ASYNCLKB + desc ASYNCLKB + 27 + 26 + read-write + + + SYNCLKBT + desc SYNCLKBT + 29 + 28 + read-write + + + + + ICONR + desc ICONR + 0x14 + 32 + read-write + 0x0 + 0x1030003 + + + CMENA + desc CMENA + 0 + 0 + read-write + + + OVENA + desc OVENA + 1 + 1 + read-write + + + CMENB + desc CMENB + 16 + 16 + read-write + + + OVENB + desc OVENB + 17 + 17 + read-write + + + RESV + desc RESV + 24 + 24 + read-write + + + + + PCONR + desc PCONR + 0x18 + 32 + read-write + 0x0 + 0x713F713F + + + STACA + desc STACA + 1 + 0 + read-write + + + STPCA + desc STPCA + 3 + 2 + read-write + + + CMPCA + desc CMPCA + 5 + 4 + read-write + + + OUTENA + desc OUTENA + 8 + 8 + read-write + + + NOFIENA + desc NOFIENA + 12 + 12 + read-write + + + NOFICKA + desc NOFICKA + 14 + 13 + read-write + + + STACB + desc STACB + 17 + 16 + read-write + + + STPCB + desc STPCB + 19 + 18 + read-write + + + CMPCB + desc CMPCB + 21 + 20 + read-write + + + OUTENB + desc OUTENB + 24 + 24 + read-write + + + NOFIENB + desc NOFIENB + 28 + 28 + read-write + + + NOFICKB + desc NOFICKB + 30 + 29 + read-write + + + + + HCONR + desc HCONR + 0x1C + 32 + read-write + 0x0 + 0x77777777 + + + HSTAA0 + desc HSTAA0 + 0 + 0 + read-write + + + HSTAA1 + desc HSTAA1 + 1 + 1 + read-write + + + HSTAA2 + desc HSTAA2 + 2 + 2 + read-write + + + HSTPA0 + desc HSTPA0 + 4 + 4 + read-write + + + HSTPA1 + desc HSTPA1 + 5 + 5 + read-write + + + HSTPA2 + desc HSTPA2 + 6 + 6 + read-write + + + HCLEA0 + desc HCLEA0 + 8 + 8 + read-write + + + HCLEA1 + desc HCLEA1 + 9 + 9 + read-write + + + HCLEA2 + desc HCLEA2 + 10 + 10 + read-write + + + HICPA0 + desc HICPA0 + 12 + 12 + read-write + + + HICPA1 + desc HICPA1 + 13 + 13 + read-write + + + HICPA2 + desc HICPA2 + 14 + 14 + read-write + + + HSTAB0 + desc HSTAB0 + 16 + 16 + read-write + + + HSTAB1 + desc HSTAB1 + 17 + 17 + read-write + + + HSTAB2 + desc HSTAB2 + 18 + 18 + read-write + + + HSTPB0 + desc HSTPB0 + 20 + 20 + read-write + + + HSTPB1 + desc HSTPB1 + 21 + 21 + read-write + + + HSTPB2 + desc HSTPB2 + 22 + 22 + read-write + + + HCLEB0 + desc HCLEB0 + 24 + 24 + read-write + + + HCLEB1 + desc HCLEB1 + 25 + 25 + read-write + + + HCLEB2 + desc HCLEB2 + 26 + 26 + read-write + + + HICPB0 + desc HICPB0 + 28 + 28 + read-write + + + HICPB1 + desc HICPB1 + 29 + 29 + read-write + + + HICPB2 + desc HICPB2 + 30 + 30 + read-write + + + + + STFLR + desc STFLR + 0x20 + 32 + read-write + 0x0 + 0x1030003 + + + CMFA + desc CMFA + 0 + 0 + read-write + + + OVFA + desc OVFA + 1 + 1 + read-write + + + CMFB + desc CMFB + 16 + 16 + read-write + + + OVFB + desc OVFB + 17 + 17 + read-write + + + RESV + desc RESV + 24 + 24 + read-write + + + + + + + TMR41 + desc TMR41 + 0x40038000 + + 0x0 + 0xE6 + + + + OCCRUH + desc OCCRUH + 0x2 + 16 + read-write + 0x0 + 0xFFFF + + + OCCRUL + desc OCCRUL + 0x6 + 16 + read-write + 0x0 + 0xFFFF + + + OCCRVH + desc OCCRVH + 0xA + 16 + read-write + 0x0 + 0xFFFF + + + OCCRVL + desc OCCRVL + 0xE + 16 + read-write + 0x0 + 0xFFFF + + + OCCRWH + desc OCCRWH + 0x12 + 16 + read-write + 0x0 + 0xFFFF + + + OCCRWL + desc OCCRWL + 0x16 + 16 + read-write + 0x0 + 0xFFFF + + + OCSRU + desc OCSRU + 0x18 + 16 + read-write + 0xFF00 + 0xFF + + + OCEH + desc OCEH + 0 + 0 + read-write + + + OCEL + desc OCEL + 1 + 1 + read-write + + + OCPH + desc OCPH + 2 + 2 + read-write + + + OCPL + desc OCPL + 3 + 3 + read-write + + + OCIEH + desc OCIEH + 4 + 4 + read-write + + + OCIEL + desc OCIEL + 5 + 5 + read-write + + + OCFH + desc OCFH + 6 + 6 + read-write + + + OCFL + desc OCFL + 7 + 7 + read-write + + + + + OCERU + desc OCERU + 0x1A + 16 + read-write + 0x0 + 0x3FFF + + + CHBUFEN + desc CHBUFEN + 1 + 0 + read-write + + + CLBUFEN + desc CLBUFEN + 3 + 2 + read-write + + + MHBUFEN + desc MHBUFEN + 5 + 4 + read-write + + + MLBUFEN + desc MLBUFEN + 7 + 6 + read-write + + + LMCH + desc LMCH + 8 + 8 + read-write + + + LMCL + desc LMCL + 9 + 9 + read-write + + + LMMH + desc LMMH + 10 + 10 + read-write + + + LMML + desc LMML + 11 + 11 + read-write + + + MCECH + desc MCECH + 12 + 12 + read-write + + + MCECL + desc MCECL + 13 + 13 + read-write + + + + + OCSRV + desc OCSRV + 0x1C + 16 + read-write + 0xFF00 + 0xFF + + + OCEH + desc OCEH + 0 + 0 + read-write + + + OCEL + desc OCEL + 1 + 1 + read-write + + + OCPH + desc OCPH + 2 + 2 + read-write + + + OCPL + desc OCPL + 3 + 3 + read-write + + + OCIEH + desc OCIEH + 4 + 4 + read-write + + + OCIEL + desc OCIEL + 5 + 5 + read-write + + + OCFH + desc OCFH + 6 + 6 + read-write + + + OCFL + desc OCFL + 7 + 7 + read-write + + + + + OCERV + desc OCERV + 0x1E + 16 + read-write + 0x0 + 0x3FFF + + + CHBUFEN + desc CHBUFEN + 1 + 0 + read-write + + + CLBUFEN + desc CLBUFEN + 3 + 2 + read-write + + + MHBUFEN + desc MHBUFEN + 5 + 4 + read-write + + + MLBUFEN + desc MLBUFEN + 7 + 6 + read-write + + + LMCH + desc LMCH + 8 + 8 + read-write + + + LMCL + desc LMCL + 9 + 9 + read-write + + + LMMH + desc LMMH + 10 + 10 + read-write + + + LMML + desc LMML + 11 + 11 + read-write + + + MCECH + desc MCECH + 12 + 12 + read-write + + + MCECL + desc MCECL + 13 + 13 + read-write + + + + + OCSRW + desc OCSRW + 0x20 + 16 + read-write + 0xFF00 + 0xFF + + + OCEH + desc OCEH + 0 + 0 + read-write + + + OCEL + desc OCEL + 1 + 1 + read-write + + + OCPH + desc OCPH + 2 + 2 + read-write + + + OCPL + desc OCPL + 3 + 3 + read-write + + + OCIEH + desc OCIEH + 4 + 4 + read-write + + + OCIEL + desc OCIEL + 5 + 5 + read-write + + + OCFH + desc OCFH + 6 + 6 + read-write + + + OCFL + desc OCFL + 7 + 7 + read-write + + + + + OCERW + desc OCERW + 0x22 + 16 + read-write + 0x0 + 0x3FFF + + + CHBUFEN + desc CHBUFEN + 1 + 0 + read-write + + + CLBUFEN + desc CLBUFEN + 3 + 2 + read-write + + + MHBUFEN + desc MHBUFEN + 5 + 4 + read-write + + + MLBUFEN + desc MLBUFEN + 7 + 6 + read-write + + + LMCH + desc LMCH + 8 + 8 + read-write + + + LMCL + desc LMCL + 9 + 9 + read-write + + + LMMH + desc LMMH + 10 + 10 + read-write + + + LMML + desc LMML + 11 + 11 + read-write + + + MCECH + desc MCECH + 12 + 12 + read-write + + + MCECL + desc MCECL + 13 + 13 + read-write + + + + + OCMRHUH + desc OCMRHUH + 0x24 + 16 + read-write + 0x0 + 0xFFFF + + + OCFDCH + desc OCFDCH + 0 + 0 + read-write + + + OCFPKH + desc OCFPKH + 1 + 1 + read-write + + + OCFUCH + desc OCFUCH + 2 + 2 + read-write + + + OCFZRH + desc OCFZRH + 3 + 3 + read-write + + + OPDCH + desc OPDCH + 5 + 4 + read-write + + + OPPKH + desc OPPKH + 7 + 6 + read-write + + + OPUCH + desc OPUCH + 9 + 8 + read-write + + + OPZRH + desc OPZRH + 11 + 10 + read-write + + + OPNPKH + desc OPNPKH + 13 + 12 + read-write + + + OPNZRH + desc OPNZRH + 15 + 14 + read-write + + + + + OCMRLUL + desc OCMRLUL + 0x28 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + OCFDCL + desc OCFDCL + 0 + 0 + read-write + + + OCFPKL + desc OCFPKL + 1 + 1 + read-write + + + OCFUCL + desc OCFUCL + 2 + 2 + read-write + + + OCFZRL + desc OCFZRL + 3 + 3 + read-write + + + OPDCL + desc OPDCL + 5 + 4 + read-write + + + OPPKL + desc OPPKL + 7 + 6 + read-write + + + OPUCL + desc OPUCL + 9 + 8 + read-write + + + OPZRL + desc OPZRL + 11 + 10 + read-write + + + OPNPKL + desc OPNPKL + 13 + 12 + read-write + + + OPNZRL + desc OPNZRL + 15 + 14 + read-write + + + EOPNDCL + desc EOPNDCL + 17 + 16 + read-write + + + EOPNUCL + desc EOPNUCL + 19 + 18 + read-write + + + EOPDCL + desc EOPDCL + 21 + 20 + read-write + + + EOPPKL + desc EOPPKL + 23 + 22 + read-write + + + EOPUCL + desc EOPUCL + 25 + 24 + read-write + + + EOPZRL + desc EOPZRL + 27 + 26 + read-write + + + EOPNPKL + desc EOPNPKL + 29 + 28 + read-write + + + EOPNZRL + desc EOPNZRL + 31 + 30 + read-write + + + + + OCMRHVH + desc OCMRHVH + 0x2C + 16 + read-write + 0x0 + 0xFFFF + + + OCFDCH + desc OCFDCH + 0 + 0 + read-write + + + OCFPKH + desc OCFPKH + 1 + 1 + read-write + + + OCFUCH + desc OCFUCH + 2 + 2 + read-write + + + OCFZRH + desc OCFZRH + 3 + 3 + read-write + + + OPDCH + desc OPDCH + 5 + 4 + read-write + + + OPPKH + desc OPPKH + 7 + 6 + read-write + + + OPUCH + desc OPUCH + 9 + 8 + read-write + + + OPZRH + desc OPZRH + 11 + 10 + read-write + + + OPNPKH + desc OPNPKH + 13 + 12 + read-write + + + OPNZRH + desc OPNZRH + 15 + 14 + read-write + + + + + OCMRLVL + desc OCMRLVL + 0x30 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + OCFDCL + desc OCFDCL + 0 + 0 + read-write + + + OCFPKL + desc OCFPKL + 1 + 1 + read-write + + + OCFUCL + desc OCFUCL + 2 + 2 + read-write + + + OCFZRL + desc OCFZRL + 3 + 3 + read-write + + + OPDCL + desc OPDCL + 5 + 4 + read-write + + + OPPKL + desc OPPKL + 7 + 6 + read-write + + + OPUCL + desc OPUCL + 9 + 8 + read-write + + + OPZRL + desc OPZRL + 11 + 10 + read-write + + + OPNPKL + desc OPNPKL + 13 + 12 + read-write + + + OPNZRL + desc OPNZRL + 15 + 14 + read-write + + + EOPNDCL + desc EOPNDCL + 17 + 16 + read-write + + + EOPNUCL + desc EOPNUCL + 19 + 18 + read-write + + + EOPDCL + desc EOPDCL + 21 + 20 + read-write + + + EOPPKL + desc EOPPKL + 23 + 22 + read-write + + + EOPUCL + desc EOPUCL + 25 + 24 + read-write + + + EOPZRL + desc EOPZRL + 27 + 26 + read-write + + + EOPNPKL + desc EOPNPKL + 29 + 28 + read-write + + + EOPNZRL + desc EOPNZRL + 31 + 30 + read-write + + + + + OCMRHWH + desc OCMRHWH + 0x34 + 16 + read-write + 0x0 + 0xFFFF + + + OCFDCH + desc OCFDCH + 0 + 0 + read-write + + + OCFPKH + desc OCFPKH + 1 + 1 + read-write + + + OCFUCH + desc OCFUCH + 2 + 2 + read-write + + + OCFZRH + desc OCFZRH + 3 + 3 + read-write + + + OPDCH + desc OPDCH + 5 + 4 + read-write + + + OPPKH + desc OPPKH + 7 + 6 + read-write + + + OPUCH + desc OPUCH + 9 + 8 + read-write + + + OPZRH + desc OPZRH + 11 + 10 + read-write + + + OPNPKH + desc OPNPKH + 13 + 12 + read-write + + + OPNZRH + desc OPNZRH + 15 + 14 + read-write + + + + + OCMRLWL + desc OCMRLWL + 0x38 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + OCFDCL + desc OCFDCL + 0 + 0 + read-write + + + OCFPKL + desc OCFPKL + 1 + 1 + read-write + + + OCFUCL + desc OCFUCL + 2 + 2 + read-write + + + OCFZRL + desc OCFZRL + 3 + 3 + read-write + + + OPDCL + desc OPDCL + 5 + 4 + read-write + + + OPPKL + desc OPPKL + 7 + 6 + read-write + + + OPUCL + desc OPUCL + 9 + 8 + read-write + + + OPZRL + desc OPZRL + 11 + 10 + read-write + + + OPNPKL + desc OPNPKL + 13 + 12 + read-write + + + OPNZRL + desc OPNZRL + 15 + 14 + read-write + + + EOPNDCL + desc EOPNDCL + 17 + 16 + read-write + + + EOPNUCL + desc EOPNUCL + 19 + 18 + read-write + + + EOPDCL + desc EOPDCL + 21 + 20 + read-write + + + EOPPKL + desc EOPPKL + 23 + 22 + read-write + + + EOPUCL + desc EOPUCL + 25 + 24 + read-write + + + EOPZRL + desc EOPZRL + 27 + 26 + read-write + + + EOPNPKL + desc EOPNPKL + 29 + 28 + read-write + + + EOPNZRL + desc EOPNZRL + 31 + 30 + read-write + + + + + CPSR + desc CPSR + 0x42 + 16 + read-write + 0xFFFF + 0xFFFF + + + CNTR + desc CNTR + 0x46 + 16 + read-write + 0x0 + 0xFFFF + + + CCSR + desc CCSR + 0x48 + 16 + read-write + 0x40 + 0xE3FF + + + CKDIV + desc CKDIV + 3 + 0 + read-write + + + CLEAR + desc CLEAR + 4 + 4 + read-write + + + MODE + desc MODE + 5 + 5 + read-write + + + STOP + desc STOP + 6 + 6 + read-write + + + BUFEN + desc BUFEN + 7 + 7 + read-write + + + IRQPEN + desc IRQPEN + 8 + 8 + read-write + + + IRQPF + desc IRQPF + 9 + 9 + read-write + + + IRQZEN + desc IRQZEN + 13 + 13 + read-write + + + IRQZF + desc IRQZF + 14 + 14 + read-write + + + ECKEN + desc ECKEN + 15 + 15 + read-write + + + + + CVPR + desc CVPR + 0x4A + 16 + read-write + 0x0 + 0xFFFF + + + ZIM + desc ZIM + 3 + 0 + read-write + + + PIM + desc PIM + 7 + 4 + read-write + + + ZIC + desc ZIC + 11 + 8 + read-only + + + PIC + desc PIC + 15 + 12 + read-only + + + + + PFSRU + desc PFSRU + 0x82 + 16 + read-write + 0x0 + 0xFFFF + + + PDARU + desc PDARU + 0x84 + 16 + read-write + 0x0 + 0xFFFF + + + PDBRU + desc PDBRU + 0x86 + 16 + read-write + 0x0 + 0xFFFF + + + PFSRV + desc PFSRV + 0x8A + 16 + read-write + 0x0 + 0xFFFF + + + PDARV + desc PDARV + 0x8C + 16 + read-write + 0x0 + 0xFFFF + + + PDBRV + desc PDBRV + 0x8E + 16 + read-write + 0x0 + 0xFFFF + + + PFSRW + desc PFSRW + 0x92 + 16 + read-write + 0x0 + 0xFFFF + + + PDARW + desc PDARW + 0x94 + 16 + read-write + 0x0 + 0xFFFF + + + PDBRW + desc PDBRW + 0x96 + 16 + read-write + 0x0 + 0xFFFF + + + POCRU + desc POCRU + 0x98 + 16 + read-write + 0xFF00 + 0xFF + + + DIVCK + desc DIVCK + 2 + 0 + read-write + + + PWMMD + desc PWMMD + 5 + 4 + read-write + + + LVLS + desc LVLS + 7 + 6 + read-write + + + + + POCRV + desc POCRV + 0x9C + 16 + read-write + 0xFF00 + 0xFF + + + DIVCK + desc DIVCK + 2 + 0 + read-write + + + PWMMD + desc PWMMD + 5 + 4 + read-write + + + LVLS + desc LVLS + 7 + 6 + read-write + + + + + POCRW + desc POCRW + 0xA0 + 16 + read-write + 0xFF00 + 0xFF + + + DIVCK + desc DIVCK + 2 + 0 + read-write + + + PWMMD + desc PWMMD + 5 + 4 + read-write + + + LVLS + desc LVLS + 7 + 6 + read-write + + + + + RCSR + desc RCSR + 0xA4 + 16 + read-write + 0x0 + 0xFFF7 + + + RTIDU + desc RTIDU + 0 + 0 + read-write + + + RTIDV + desc RTIDV + 1 + 1 + read-write + + + RTIDW + desc RTIDW + 2 + 2 + read-write + + + RTIFU + desc RTIFU + 4 + 4 + read-only + + + RTICU + desc RTICU + 5 + 5 + read-write + + + RTEU + desc RTEU + 6 + 6 + read-write + + + RTSU + desc RTSU + 7 + 7 + read-write + + + RTIFV + desc RTIFV + 8 + 8 + read-only + + + RTICV + desc RTICV + 9 + 9 + read-write + + + RTEV + desc RTEV + 10 + 10 + read-write + + + RTSV + desc RTSV + 11 + 11 + read-write + + + RTIFW + desc RTIFW + 12 + 12 + read-only + + + RTICW + desc RTICW + 13 + 13 + read-write + + + RTEW + desc RTEW + 14 + 14 + read-write + + + RTSW + desc RTSW + 15 + 15 + read-write + + + + + SCCRUH + desc SCCRUH + 0xB2 + 16 + read-write + 0x0 + 0xFFFF + + + SCCRUL + desc SCCRUL + 0xB6 + 16 + read-write + 0x0 + 0xFFFF + + + SCCRVH + desc SCCRVH + 0xBA + 16 + read-write + 0x0 + 0xFFFF + + + SCCRVL + desc SCCRVL + 0xBE + 16 + read-write + 0x0 + 0xFFFF + + + SCCRWH + desc SCCRWH + 0xC2 + 16 + read-write + 0x0 + 0xFFFF + + + SCCRWL + desc SCCRWL + 0xC6 + 16 + read-write + 0x0 + 0xFFFF + + + SCSRUH + desc SCSRUH + 0xC8 + 16 + read-write + 0x0 + 0xF33F + + + BUFEN + desc BUFEN + 1 + 0 + read-write + + + EVTOS + desc EVTOS + 4 + 2 + read-write + + + LMC + desc LMC + 5 + 5 + read-write + + + EVTMS + desc EVTMS + 8 + 8 + read-write + + + EVTDS + desc EVTDS + 9 + 9 + read-write + + + DEN + desc DEN + 12 + 12 + read-write + + + PEN + desc PEN + 13 + 13 + read-write + + + UEN + desc UEN + 14 + 14 + read-write + + + ZEN + desc ZEN + 15 + 15 + read-write + + + + + SCMRUH + desc SCMRUH + 0xCA + 16 + read-write + 0xFF00 + 0xCF + + + AMC + desc AMC + 3 + 0 + read-write + + + MZCE + desc MZCE + 6 + 6 + read-write + + + MPCE + desc MPCE + 7 + 7 + read-write + + + + + SCSRUL + desc SCSRUL + 0xCC + 16 + read-write + 0x0 + 0xF33F + + + BUFEN + desc BUFEN + 1 + 0 + read-write + + + EVTOS + desc EVTOS + 4 + 2 + read-write + + + LMC + desc LMC + 5 + 5 + read-write + + + EVTMS + desc EVTMS + 8 + 8 + read-write + + + EVTDS + desc EVTDS + 9 + 9 + read-write + + + DEN + desc DEN + 12 + 12 + read-write + + + PEN + desc PEN + 13 + 13 + read-write + + + UEN + desc UEN + 14 + 14 + read-write + + + ZEN + desc ZEN + 15 + 15 + read-write + + + + + SCMRUL + desc SCMRUL + 0xCE + 16 + read-write + 0xFF00 + 0xCF + + + AMC + desc AMC + 3 + 0 + read-write + + + MZCE + desc MZCE + 6 + 6 + read-write + + + MPCE + desc MPCE + 7 + 7 + read-write + + + + + SCSRVH + desc SCSRVH + 0xD0 + 16 + read-write + 0x0 + 0xF33F + + + BUFEN + desc BUFEN + 1 + 0 + read-write + + + EVTOS + desc EVTOS + 4 + 2 + read-write + + + LMC + desc LMC + 5 + 5 + read-write + + + EVTMS + desc EVTMS + 8 + 8 + read-write + + + EVTDS + desc EVTDS + 9 + 9 + read-write + + + DEN + desc DEN + 12 + 12 + read-write + + + PEN + desc PEN + 13 + 13 + read-write + + + UEN + desc UEN + 14 + 14 + read-write + + + ZEN + desc ZEN + 15 + 15 + read-write + + + + + SCMRVH + desc SCMRVH + 0xD2 + 16 + read-write + 0xFF00 + 0xCF + + + AMC + desc AMC + 3 + 0 + read-write + + + MZCE + desc MZCE + 6 + 6 + read-write + + + MPCE + desc MPCE + 7 + 7 + read-write + + + + + SCSRVL + desc SCSRVL + 0xD4 + 16 + read-write + 0x0 + 0xF33F + + + BUFEN + desc BUFEN + 1 + 0 + read-write + + + EVTOS + desc EVTOS + 4 + 2 + read-write + + + LMC + desc LMC + 5 + 5 + read-write + + + EVTMS + desc EVTMS + 8 + 8 + read-write + + + EVTDS + desc EVTDS + 9 + 9 + read-write + + + DEN + desc DEN + 12 + 12 + read-write + + + PEN + desc PEN + 13 + 13 + read-write + + + UEN + desc UEN + 14 + 14 + read-write + + + ZEN + desc ZEN + 15 + 15 + read-write + + + + + SCMRVL + desc SCMRVL + 0xD6 + 16 + read-write + 0xFF00 + 0xCF + + + AMC + desc AMC + 3 + 0 + read-write + + + MZCE + desc MZCE + 6 + 6 + read-write + + + MPCE + desc MPCE + 7 + 7 + read-write + + + + + SCSRWH + desc SCSRWH + 0xD8 + 16 + read-write + 0x0 + 0xF33F + + + BUFEN + desc BUFEN + 1 + 0 + read-write + + + EVTOS + desc EVTOS + 4 + 2 + read-write + + + LMC + desc LMC + 5 + 5 + read-write + + + EVTMS + desc EVTMS + 8 + 8 + read-write + + + EVTDS + desc EVTDS + 9 + 9 + read-write + + + DEN + desc DEN + 12 + 12 + read-write + + + PEN + desc PEN + 13 + 13 + read-write + + + UEN + desc UEN + 14 + 14 + read-write + + + ZEN + desc ZEN + 15 + 15 + read-write + + + + + SCMRWH + desc SCMRWH + 0xDA + 16 + read-write + 0xFF00 + 0xCF + + + AMC + desc AMC + 3 + 0 + read-write + + + MZCE + desc MZCE + 6 + 6 + read-write + + + MPCE + desc MPCE + 7 + 7 + read-write + + + + + SCSRWL + desc SCSRWL + 0xDC + 16 + read-write + 0x0 + 0xF33F + + + BUFEN + desc BUFEN + 1 + 0 + read-write + + + EVTOS + desc EVTOS + 4 + 2 + read-write + + + LMC + desc LMC + 5 + 5 + read-write + + + EVTMS + desc EVTMS + 8 + 8 + read-write + + + EVTDS + desc EVTDS + 9 + 9 + read-write + + + DEN + desc DEN + 12 + 12 + read-write + + + PEN + desc PEN + 13 + 13 + read-write + + + UEN + desc UEN + 14 + 14 + read-write + + + ZEN + desc ZEN + 15 + 15 + read-write + + + + + SCMRWL + desc SCMRWL + 0xDE + 16 + read-write + 0xFF00 + 0xCF + + + AMC + desc AMC + 3 + 0 + read-write + + + MZCE + desc MZCE + 6 + 6 + read-write + + + MPCE + desc MPCE + 7 + 7 + read-write + + + + + PSCR + desc PSCR + 0xE0 + 32 + read-write + 0x5550000 + 0xFFF03FF + + + OEUH + desc OEUH + 0 + 0 + read-write + + + OEUL + desc OEUL + 1 + 1 + read-write + + + OEVH + desc OEVH + 2 + 2 + read-write + + + OEVL + desc OEVL + 3 + 3 + read-write + + + OEWH + desc OEWH + 4 + 4 + read-write + + + OEWL + desc OEWL + 5 + 5 + read-write + + + ODT + desc ODT + 7 + 6 + read-write + + + MOE + desc MOE + 8 + 8 + read-write + + + AOE + desc AOE + 9 + 9 + read-write + + + OSUH + desc OSUH + 17 + 16 + read-write + + + OSUL + desc OSUL + 19 + 18 + read-write + + + OSVH + desc OSVH + 21 + 20 + read-write + + + OSVL + desc OSVL + 23 + 22 + read-write + + + OSWH + desc OSWH + 25 + 24 + read-write + + + OSWL + desc OSWL + 27 + 26 + read-write + + + + + SCER + desc SCER + 0xE4 + 16 + read-write + 0xFF00 + 0xF + + + EVTRS + desc EVTRS + 2 + 0 + read-write + + + PCTS + desc PCTS + 3 + 3 + read-write + + + + + + + TMR42 + desc TMR42 + 0x40038400 + + 0x0 + 0xE6 + + + + OCCRUH + desc OCCRUH + 0x2 + 16 + read-write + 0x0 + 0xFFFF + + + OCCRUL + desc OCCRUL + 0x6 + 16 + read-write + 0x0 + 0xFFFF + + + OCCRVH + desc OCCRVH + 0xA + 16 + read-write + 0x0 + 0xFFFF + + + OCCRVL + desc OCCRVL + 0xE + 16 + read-write + 0x0 + 0xFFFF + + + OCCRWH + desc OCCRWH + 0x12 + 16 + read-write + 0x0 + 0xFFFF + + + OCCRWL + desc OCCRWL + 0x16 + 16 + read-write + 0x0 + 0xFFFF + + + OCSRU + desc OCSRU + 0x18 + 16 + read-write + 0xFF00 + 0xFF + + + OCEH + desc OCEH + 0 + 0 + read-write + + + OCEL + desc OCEL + 1 + 1 + read-write + + + OCPH + desc OCPH + 2 + 2 + read-write + + + OCPL + desc OCPL + 3 + 3 + read-write + + + OCIEH + desc OCIEH + 4 + 4 + read-write + + + OCIEL + desc OCIEL + 5 + 5 + read-write + + + OCFH + desc OCFH + 6 + 6 + read-write + + + OCFL + desc OCFL + 7 + 7 + read-write + + + + + OCERU + desc OCERU + 0x1A + 16 + read-write + 0x0 + 0x3FFF + + + CHBUFEN + desc CHBUFEN + 1 + 0 + read-write + + + CLBUFEN + desc CLBUFEN + 3 + 2 + read-write + + + MHBUFEN + desc MHBUFEN + 5 + 4 + read-write + + + MLBUFEN + desc MLBUFEN + 7 + 6 + read-write + + + LMCH + desc LMCH + 8 + 8 + read-write + + + LMCL + desc LMCL + 9 + 9 + read-write + + + LMMH + desc LMMH + 10 + 10 + read-write + + + LMML + desc LMML + 11 + 11 + read-write + + + MCECH + desc MCECH + 12 + 12 + read-write + + + MCECL + desc MCECL + 13 + 13 + read-write + + + + + OCSRV + desc OCSRV + 0x1C + 16 + read-write + 0xFF00 + 0xFF + + + OCEH + desc OCEH + 0 + 0 + read-write + + + OCEL + desc OCEL + 1 + 1 + read-write + + + OCPH + desc OCPH + 2 + 2 + read-write + + + OCPL + desc OCPL + 3 + 3 + read-write + + + OCIEH + desc OCIEH + 4 + 4 + read-write + + + OCIEL + desc OCIEL + 5 + 5 + read-write + + + OCFH + desc OCFH + 6 + 6 + read-write + + + OCFL + desc OCFL + 7 + 7 + read-write + + + + + OCERV + desc OCERV + 0x1E + 16 + read-write + 0x0 + 0x3FFF + + + CHBUFEN + desc CHBUFEN + 1 + 0 + read-write + + + CLBUFEN + desc CLBUFEN + 3 + 2 + read-write + + + MHBUFEN + desc MHBUFEN + 5 + 4 + read-write + + + MLBUFEN + desc MLBUFEN + 7 + 6 + read-write + + + LMCH + desc LMCH + 8 + 8 + read-write + + + LMCL + desc LMCL + 9 + 9 + read-write + + + LMMH + desc LMMH + 10 + 10 + read-write + + + LMML + desc LMML + 11 + 11 + read-write + + + MCECH + desc MCECH + 12 + 12 + read-write + + + MCECL + desc MCECL + 13 + 13 + read-write + + + + + OCSRW + desc OCSRW + 0x20 + 16 + read-write + 0xFF00 + 0xFF + + + OCEH + desc OCEH + 0 + 0 + read-write + + + OCEL + desc OCEL + 1 + 1 + read-write + + + OCPH + desc OCPH + 2 + 2 + read-write + + + OCPL + desc OCPL + 3 + 3 + read-write + + + OCIEH + desc OCIEH + 4 + 4 + read-write + + + OCIEL + desc OCIEL + 5 + 5 + read-write + + + OCFH + desc OCFH + 6 + 6 + read-write + + + OCFL + desc OCFL + 7 + 7 + read-write + + + + + OCERW + desc OCERW + 0x22 + 16 + read-write + 0x0 + 0x3FFF + + + CHBUFEN + desc CHBUFEN + 1 + 0 + read-write + + + CLBUFEN + desc CLBUFEN + 3 + 2 + read-write + + + MHBUFEN + desc MHBUFEN + 5 + 4 + read-write + + + MLBUFEN + desc MLBUFEN + 7 + 6 + read-write + + + LMCH + desc LMCH + 8 + 8 + read-write + + + LMCL + desc LMCL + 9 + 9 + read-write + + + LMMH + desc LMMH + 10 + 10 + read-write + + + LMML + desc LMML + 11 + 11 + read-write + + + MCECH + desc MCECH + 12 + 12 + read-write + + + MCECL + desc MCECL + 13 + 13 + read-write + + + + + OCMRHUH + desc OCMRHUH + 0x24 + 16 + read-write + 0x0 + 0xFFFF + + + OCFDCH + desc OCFDCH + 0 + 0 + read-write + + + OCFPKH + desc OCFPKH + 1 + 1 + read-write + + + OCFUCH + desc OCFUCH + 2 + 2 + read-write + + + OCFZRH + desc OCFZRH + 3 + 3 + read-write + + + OPDCH + desc OPDCH + 5 + 4 + read-write + + + OPPKH + desc OPPKH + 7 + 6 + read-write + + + OPUCH + desc OPUCH + 9 + 8 + read-write + + + OPZRH + desc OPZRH + 11 + 10 + read-write + + + OPNPKH + desc OPNPKH + 13 + 12 + read-write + + + OPNZRH + desc OPNZRH + 15 + 14 + read-write + + + + + OCMRLUL + desc OCMRLUL + 0x28 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + OCFDCL + desc OCFDCL + 0 + 0 + read-write + + + OCFPKL + desc OCFPKL + 1 + 1 + read-write + + + OCFUCL + desc OCFUCL + 2 + 2 + read-write + + + OCFZRL + desc OCFZRL + 3 + 3 + read-write + + + OPDCL + desc OPDCL + 5 + 4 + read-write + + + OPPKL + desc OPPKL + 7 + 6 + read-write + + + OPUCL + desc OPUCL + 9 + 8 + read-write + + + OPZRL + desc OPZRL + 11 + 10 + read-write + + + OPNPKL + desc OPNPKL + 13 + 12 + read-write + + + OPNZRL + desc OPNZRL + 15 + 14 + read-write + + + EOPNDCL + desc EOPNDCL + 17 + 16 + read-write + + + EOPNUCL + desc EOPNUCL + 19 + 18 + read-write + + + EOPDCL + desc EOPDCL + 21 + 20 + read-write + + + EOPPKL + desc EOPPKL + 23 + 22 + read-write + + + EOPUCL + desc EOPUCL + 25 + 24 + read-write + + + EOPZRL + desc EOPZRL + 27 + 26 + read-write + + + EOPNPKL + desc EOPNPKL + 29 + 28 + read-write + + + EOPNZRL + desc EOPNZRL + 31 + 30 + read-write + + + + + OCMRHVH + desc OCMRHVH + 0x2C + 16 + read-write + 0x0 + 0xFFFF + + + OCFDCH + desc OCFDCH + 0 + 0 + read-write + + + OCFPKH + desc OCFPKH + 1 + 1 + read-write + + + OCFUCH + desc OCFUCH + 2 + 2 + read-write + + + OCFZRH + desc OCFZRH + 3 + 3 + read-write + + + OPDCH + desc OPDCH + 5 + 4 + read-write + + + OPPKH + desc OPPKH + 7 + 6 + read-write + + + OPUCH + desc OPUCH + 9 + 8 + read-write + + + OPZRH + desc OPZRH + 11 + 10 + read-write + + + OPNPKH + desc OPNPKH + 13 + 12 + read-write + + + OPNZRH + desc OPNZRH + 15 + 14 + read-write + + + + + OCMRLVL + desc OCMRLVL + 0x30 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + OCFDCL + desc OCFDCL + 0 + 0 + read-write + + + OCFPKL + desc OCFPKL + 1 + 1 + read-write + + + OCFUCL + desc OCFUCL + 2 + 2 + read-write + + + OCFZRL + desc OCFZRL + 3 + 3 + read-write + + + OPDCL + desc OPDCL + 5 + 4 + read-write + + + OPPKL + desc OPPKL + 7 + 6 + read-write + + + OPUCL + desc OPUCL + 9 + 8 + read-write + + + OPZRL + desc OPZRL + 11 + 10 + read-write + + + OPNPKL + desc OPNPKL + 13 + 12 + read-write + + + OPNZRL + desc OPNZRL + 15 + 14 + read-write + + + EOPNDCL + desc EOPNDCL + 17 + 16 + read-write + + + EOPNUCL + desc EOPNUCL + 19 + 18 + read-write + + + EOPDCL + desc EOPDCL + 21 + 20 + read-write + + + EOPPKL + desc EOPPKL + 23 + 22 + read-write + + + EOPUCL + desc EOPUCL + 25 + 24 + read-write + + + EOPZRL + desc EOPZRL + 27 + 26 + read-write + + + EOPNPKL + desc EOPNPKL + 29 + 28 + read-write + + + EOPNZRL + desc EOPNZRL + 31 + 30 + read-write + + + + + OCMRHWH + desc OCMRHWH + 0x34 + 16 + read-write + 0x0 + 0xFFFF + + + OCFDCH + desc OCFDCH + 0 + 0 + read-write + + + OCFPKH + desc OCFPKH + 1 + 1 + read-write + + + OCFUCH + desc OCFUCH + 2 + 2 + read-write + + + OCFZRH + desc OCFZRH + 3 + 3 + read-write + + + OPDCH + desc OPDCH + 5 + 4 + read-write + + + OPPKH + desc OPPKH + 7 + 6 + read-write + + + OPUCH + desc OPUCH + 9 + 8 + read-write + + + OPZRH + desc OPZRH + 11 + 10 + read-write + + + OPNPKH + desc OPNPKH + 13 + 12 + read-write + + + OPNZRH + desc OPNZRH + 15 + 14 + read-write + + + + + OCMRLWL + desc OCMRLWL + 0x38 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + OCFDCL + desc OCFDCL + 0 + 0 + read-write + + + OCFPKL + desc OCFPKL + 1 + 1 + read-write + + + OCFUCL + desc OCFUCL + 2 + 2 + read-write + + + OCFZRL + desc OCFZRL + 3 + 3 + read-write + + + OPDCL + desc OPDCL + 5 + 4 + read-write + + + OPPKL + desc OPPKL + 7 + 6 + read-write + + + OPUCL + desc OPUCL + 9 + 8 + read-write + + + OPZRL + desc OPZRL + 11 + 10 + read-write + + + OPNPKL + desc OPNPKL + 13 + 12 + read-write + + + OPNZRL + desc OPNZRL + 15 + 14 + read-write + + + EOPNDCL + desc EOPNDCL + 17 + 16 + read-write + + + EOPNUCL + desc EOPNUCL + 19 + 18 + read-write + + + EOPDCL + desc EOPDCL + 21 + 20 + read-write + + + EOPPKL + desc EOPPKL + 23 + 22 + read-write + + + EOPUCL + desc EOPUCL + 25 + 24 + read-write + + + EOPZRL + desc EOPZRL + 27 + 26 + read-write + + + EOPNPKL + desc EOPNPKL + 29 + 28 + read-write + + + EOPNZRL + desc EOPNZRL + 31 + 30 + read-write + + + + + CPSR + desc CPSR + 0x42 + 16 + read-write + 0xFFFF + 0xFFFF + + + CNTR + desc CNTR + 0x46 + 16 + read-write + 0x0 + 0xFFFF + + + CCSR + desc CCSR + 0x48 + 16 + read-write + 0x40 + 0xE3FF + + + CKDIV + desc CKDIV + 3 + 0 + read-write + + + CLEAR + desc CLEAR + 4 + 4 + read-write + + + MODE + desc MODE + 5 + 5 + read-write + + + STOP + desc STOP + 6 + 6 + read-write + + + BUFEN + desc BUFEN + 7 + 7 + read-write + + + IRQPEN + desc IRQPEN + 8 + 8 + read-write + + + IRQPF + desc IRQPF + 9 + 9 + read-write + + + IRQZEN + desc IRQZEN + 13 + 13 + read-write + + + IRQZF + desc IRQZF + 14 + 14 + read-write + + + ECKEN + desc ECKEN + 15 + 15 + read-write + + + + + CVPR + desc CVPR + 0x4A + 16 + read-write + 0x0 + 0xFFFF + + + ZIM + desc ZIM + 3 + 0 + read-write + + + PIM + desc PIM + 7 + 4 + read-write + + + ZIC + desc ZIC + 11 + 8 + read-only + + + PIC + desc PIC + 15 + 12 + read-only + + + + + PFSRU + desc PFSRU + 0x82 + 16 + read-write + 0x0 + 0xFFFF + + + PDARU + desc PDARU + 0x84 + 16 + read-write + 0x0 + 0xFFFF + + + PDBRU + desc PDBRU + 0x86 + 16 + read-write + 0x0 + 0xFFFF + + + PFSRV + desc PFSRV + 0x8A + 16 + read-write + 0x0 + 0xFFFF + + + PDARV + desc PDARV + 0x8C + 16 + read-write + 0x0 + 0xFFFF + + + PDBRV + desc PDBRV + 0x8E + 16 + read-write + 0x0 + 0xFFFF + + + PFSRW + desc PFSRW + 0x92 + 16 + read-write + 0x0 + 0xFFFF + + + PDARW + desc PDARW + 0x94 + 16 + read-write + 0x0 + 0xFFFF + + + PDBRW + desc PDBRW + 0x96 + 16 + read-write + 0x0 + 0xFFFF + + + POCRU + desc POCRU + 0x98 + 16 + read-write + 0xFF00 + 0xFF + + + DIVCK + desc DIVCK + 2 + 0 + read-write + + + PWMMD + desc PWMMD + 5 + 4 + read-write + + + LVLS + desc LVLS + 7 + 6 + read-write + + + + + POCRV + desc POCRV + 0x9C + 16 + read-write + 0xFF00 + 0xFF + + + DIVCK + desc DIVCK + 2 + 0 + read-write + + + PWMMD + desc PWMMD + 5 + 4 + read-write + + + LVLS + desc LVLS + 7 + 6 + read-write + + + + + POCRW + desc POCRW + 0xA0 + 16 + read-write + 0xFF00 + 0xFF + + + DIVCK + desc DIVCK + 2 + 0 + read-write + + + PWMMD + desc PWMMD + 5 + 4 + read-write + + + LVLS + desc LVLS + 7 + 6 + read-write + + + + + RCSR + desc RCSR + 0xA4 + 16 + read-write + 0x0 + 0xFFF7 + + + RTIDU + desc RTIDU + 0 + 0 + read-write + + + RTIDV + desc RTIDV + 1 + 1 + read-write + + + RTIDW + desc RTIDW + 2 + 2 + read-write + + + RTIFU + desc RTIFU + 4 + 4 + read-only + + + RTICU + desc RTICU + 5 + 5 + read-write + + + RTEU + desc RTEU + 6 + 6 + read-write + + + RTSU + desc RTSU + 7 + 7 + read-write + + + RTIFV + desc RTIFV + 8 + 8 + read-only + + + RTICV + desc RTICV + 9 + 9 + read-write + + + RTEV + desc RTEV + 10 + 10 + read-write + + + RTSV + desc RTSV + 11 + 11 + read-write + + + RTIFW + desc RTIFW + 12 + 12 + read-only + + + RTICW + desc RTICW + 13 + 13 + read-write + + + RTEW + desc RTEW + 14 + 14 + read-write + + + RTSW + desc RTSW + 15 + 15 + read-write + + + + + SCCRUH + desc SCCRUH + 0xB2 + 16 + read-write + 0x0 + 0xFFFF + + + SCCRUL + desc SCCRUL + 0xB6 + 16 + read-write + 0x0 + 0xFFFF + + + SCCRVH + desc SCCRVH + 0xBA + 16 + read-write + 0x0 + 0xFFFF + + + SCCRVL + desc SCCRVL + 0xBE + 16 + read-write + 0x0 + 0xFFFF + + + SCCRWH + desc SCCRWH + 0xC2 + 16 + read-write + 0x0 + 0xFFFF + + + SCCRWL + desc SCCRWL + 0xC6 + 16 + read-write + 0x0 + 0xFFFF + + + SCSRUH + desc SCSRUH + 0xC8 + 16 + read-write + 0x0 + 0xF33F + + + BUFEN + desc BUFEN + 1 + 0 + read-write + + + EVTOS + desc EVTOS + 4 + 2 + read-write + + + LMC + desc LMC + 5 + 5 + read-write + + + EVTMS + desc EVTMS + 8 + 8 + read-write + + + EVTDS + desc EVTDS + 9 + 9 + read-write + + + DEN + desc DEN + 12 + 12 + read-write + + + PEN + desc PEN + 13 + 13 + read-write + + + UEN + desc UEN + 14 + 14 + read-write + + + ZEN + desc ZEN + 15 + 15 + read-write + + + + + SCMRUH + desc SCMRUH + 0xCA + 16 + read-write + 0xFF00 + 0xCF + + + AMC + desc AMC + 3 + 0 + read-write + + + MZCE + desc MZCE + 6 + 6 + read-write + + + MPCE + desc MPCE + 7 + 7 + read-write + + + + + SCSRUL + desc SCSRUL + 0xCC + 16 + read-write + 0x0 + 0xF33F + + + BUFEN + desc BUFEN + 1 + 0 + read-write + + + EVTOS + desc EVTOS + 4 + 2 + read-write + + + LMC + desc LMC + 5 + 5 + read-write + + + EVTMS + desc EVTMS + 8 + 8 + read-write + + + EVTDS + desc EVTDS + 9 + 9 + read-write + + + DEN + desc DEN + 12 + 12 + read-write + + + PEN + desc PEN + 13 + 13 + read-write + + + UEN + desc UEN + 14 + 14 + read-write + + + ZEN + desc ZEN + 15 + 15 + read-write + + + + + SCMRUL + desc SCMRUL + 0xCE + 16 + read-write + 0xFF00 + 0xCF + + + AMC + desc AMC + 3 + 0 + read-write + + + MZCE + desc MZCE + 6 + 6 + read-write + + + MPCE + desc MPCE + 7 + 7 + read-write + + + + + SCSRVH + desc SCSRVH + 0xD0 + 16 + read-write + 0x0 + 0xF33F + + + BUFEN + desc BUFEN + 1 + 0 + read-write + + + EVTOS + desc EVTOS + 4 + 2 + read-write + + + LMC + desc LMC + 5 + 5 + read-write + + + EVTMS + desc EVTMS + 8 + 8 + read-write + + + EVTDS + desc EVTDS + 9 + 9 + read-write + + + DEN + desc DEN + 12 + 12 + read-write + + + PEN + desc PEN + 13 + 13 + read-write + + + UEN + desc UEN + 14 + 14 + read-write + + + ZEN + desc ZEN + 15 + 15 + read-write + + + + + SCMRVH + desc SCMRVH + 0xD2 + 16 + read-write + 0xFF00 + 0xCF + + + AMC + desc AMC + 3 + 0 + read-write + + + MZCE + desc MZCE + 6 + 6 + read-write + + + MPCE + desc MPCE + 7 + 7 + read-write + + + + + SCSRVL + desc SCSRVL + 0xD4 + 16 + read-write + 0x0 + 0xF33F + + + BUFEN + desc BUFEN + 1 + 0 + read-write + + + EVTOS + desc EVTOS + 4 + 2 + read-write + + + LMC + desc LMC + 5 + 5 + read-write + + + EVTMS + desc EVTMS + 8 + 8 + read-write + + + EVTDS + desc EVTDS + 9 + 9 + read-write + + + DEN + desc DEN + 12 + 12 + read-write + + + PEN + desc PEN + 13 + 13 + read-write + + + UEN + desc UEN + 14 + 14 + read-write + + + ZEN + desc ZEN + 15 + 15 + read-write + + + + + SCMRVL + desc SCMRVL + 0xD6 + 16 + read-write + 0xFF00 + 0xCF + + + AMC + desc AMC + 3 + 0 + read-write + + + MZCE + desc MZCE + 6 + 6 + read-write + + + MPCE + desc MPCE + 7 + 7 + read-write + + + + + SCSRWH + desc SCSRWH + 0xD8 + 16 + read-write + 0x0 + 0xF33F + + + BUFEN + desc BUFEN + 1 + 0 + read-write + + + EVTOS + desc EVTOS + 4 + 2 + read-write + + + LMC + desc LMC + 5 + 5 + read-write + + + EVTMS + desc EVTMS + 8 + 8 + read-write + + + EVTDS + desc EVTDS + 9 + 9 + read-write + + + DEN + desc DEN + 12 + 12 + read-write + + + PEN + desc PEN + 13 + 13 + read-write + + + UEN + desc UEN + 14 + 14 + read-write + + + ZEN + desc ZEN + 15 + 15 + read-write + + + + + SCMRWH + desc SCMRWH + 0xDA + 16 + read-write + 0xFF00 + 0xCF + + + AMC + desc AMC + 3 + 0 + read-write + + + MZCE + desc MZCE + 6 + 6 + read-write + + + MPCE + desc MPCE + 7 + 7 + read-write + + + + + SCSRWL + desc SCSRWL + 0xDC + 16 + read-write + 0x0 + 0xF33F + + + BUFEN + desc BUFEN + 1 + 0 + read-write + + + EVTOS + desc EVTOS + 4 + 2 + read-write + + + LMC + desc LMC + 5 + 5 + read-write + + + EVTMS + desc EVTMS + 8 + 8 + read-write + + + EVTDS + desc EVTDS + 9 + 9 + read-write + + + DEN + desc DEN + 12 + 12 + read-write + + + PEN + desc PEN + 13 + 13 + read-write + + + UEN + desc UEN + 14 + 14 + read-write + + + ZEN + desc ZEN + 15 + 15 + read-write + + + + + SCMRWL + desc SCMRWL + 0xDE + 16 + read-write + 0xFF00 + 0xCF + + + AMC + desc AMC + 3 + 0 + read-write + + + MZCE + desc MZCE + 6 + 6 + read-write + + + MPCE + desc MPCE + 7 + 7 + read-write + + + + + PSCR + desc PSCR + 0xE0 + 32 + read-write + 0x5550000 + 0xFFF03FF + + + OEUH + desc OEUH + 0 + 0 + read-write + + + OEUL + desc OEUL + 1 + 1 + read-write + + + OEVH + desc OEVH + 2 + 2 + read-write + + + OEVL + desc OEVL + 3 + 3 + read-write + + + OEWH + desc OEWH + 4 + 4 + read-write + + + OEWL + desc OEWL + 5 + 5 + read-write + + + ODT + desc ODT + 7 + 6 + read-write + + + MOE + desc MOE + 8 + 8 + read-write + + + AOE + desc AOE + 9 + 9 + read-write + + + OSUH + desc OSUH + 17 + 16 + read-write + + + OSUL + desc OSUL + 19 + 18 + read-write + + + OSVH + desc OSVH + 21 + 20 + read-write + + + OSVL + desc OSVL + 23 + 22 + read-write + + + OSWH + desc OSWH + 25 + 24 + read-write + + + OSWL + desc OSWL + 27 + 26 + read-write + + + + + SCER + desc SCER + 0xE4 + 16 + read-write + 0xFF00 + 0xF + + + EVTRS + desc EVTRS + 2 + 0 + read-write + + + PCTS + desc PCTS + 3 + 3 + read-write + + + + + + + TMR43 + desc TMR43 + 0x40038800 + + 0x0 + 0xE6 + + + + OCCRUH + desc OCCRUH + 0x2 + 16 + read-write + 0x0 + 0xFFFF + + + OCCRUL + desc OCCRUL + 0x6 + 16 + read-write + 0x0 + 0xFFFF + + + OCCRVH + desc OCCRVH + 0xA + 16 + read-write + 0x0 + 0xFFFF + + + OCCRVL + desc OCCRVL + 0xE + 16 + read-write + 0x0 + 0xFFFF + + + OCCRWH + desc OCCRWH + 0x12 + 16 + read-write + 0x0 + 0xFFFF + + + OCCRWL + desc OCCRWL + 0x16 + 16 + read-write + 0x0 + 0xFFFF + + + OCSRU + desc OCSRU + 0x18 + 16 + read-write + 0xFF00 + 0xFF + + + OCEH + desc OCEH + 0 + 0 + read-write + + + OCEL + desc OCEL + 1 + 1 + read-write + + + OCPH + desc OCPH + 2 + 2 + read-write + + + OCPL + desc OCPL + 3 + 3 + read-write + + + OCIEH + desc OCIEH + 4 + 4 + read-write + + + OCIEL + desc OCIEL + 5 + 5 + read-write + + + OCFH + desc OCFH + 6 + 6 + read-write + + + OCFL + desc OCFL + 7 + 7 + read-write + + + + + OCERU + desc OCERU + 0x1A + 16 + read-write + 0x0 + 0x3FFF + + + CHBUFEN + desc CHBUFEN + 1 + 0 + read-write + + + CLBUFEN + desc CLBUFEN + 3 + 2 + read-write + + + MHBUFEN + desc MHBUFEN + 5 + 4 + read-write + + + MLBUFEN + desc MLBUFEN + 7 + 6 + read-write + + + LMCH + desc LMCH + 8 + 8 + read-write + + + LMCL + desc LMCL + 9 + 9 + read-write + + + LMMH + desc LMMH + 10 + 10 + read-write + + + LMML + desc LMML + 11 + 11 + read-write + + + MCECH + desc MCECH + 12 + 12 + read-write + + + MCECL + desc MCECL + 13 + 13 + read-write + + + + + OCSRV + desc OCSRV + 0x1C + 16 + read-write + 0xFF00 + 0xFF + + + OCEH + desc OCEH + 0 + 0 + read-write + + + OCEL + desc OCEL + 1 + 1 + read-write + + + OCPH + desc OCPH + 2 + 2 + read-write + + + OCPL + desc OCPL + 3 + 3 + read-write + + + OCIEH + desc OCIEH + 4 + 4 + read-write + + + OCIEL + desc OCIEL + 5 + 5 + read-write + + + OCFH + desc OCFH + 6 + 6 + read-write + + + OCFL + desc OCFL + 7 + 7 + read-write + + + + + OCERV + desc OCERV + 0x1E + 16 + read-write + 0x0 + 0x3FFF + + + CHBUFEN + desc CHBUFEN + 1 + 0 + read-write + + + CLBUFEN + desc CLBUFEN + 3 + 2 + read-write + + + MHBUFEN + desc MHBUFEN + 5 + 4 + read-write + + + MLBUFEN + desc MLBUFEN + 7 + 6 + read-write + + + LMCH + desc LMCH + 8 + 8 + read-write + + + LMCL + desc LMCL + 9 + 9 + read-write + + + LMMH + desc LMMH + 10 + 10 + read-write + + + LMML + desc LMML + 11 + 11 + read-write + + + MCECH + desc MCECH + 12 + 12 + read-write + + + MCECL + desc MCECL + 13 + 13 + read-write + + + + + OCSRW + desc OCSRW + 0x20 + 16 + read-write + 0xFF00 + 0xFF + + + OCEH + desc OCEH + 0 + 0 + read-write + + + OCEL + desc OCEL + 1 + 1 + read-write + + + OCPH + desc OCPH + 2 + 2 + read-write + + + OCPL + desc OCPL + 3 + 3 + read-write + + + OCIEH + desc OCIEH + 4 + 4 + read-write + + + OCIEL + desc OCIEL + 5 + 5 + read-write + + + OCFH + desc OCFH + 6 + 6 + read-write + + + OCFL + desc OCFL + 7 + 7 + read-write + + + + + OCERW + desc OCERW + 0x22 + 16 + read-write + 0x0 + 0x3FFF + + + CHBUFEN + desc CHBUFEN + 1 + 0 + read-write + + + CLBUFEN + desc CLBUFEN + 3 + 2 + read-write + + + MHBUFEN + desc MHBUFEN + 5 + 4 + read-write + + + MLBUFEN + desc MLBUFEN + 7 + 6 + read-write + + + LMCH + desc LMCH + 8 + 8 + read-write + + + LMCL + desc LMCL + 9 + 9 + read-write + + + LMMH + desc LMMH + 10 + 10 + read-write + + + LMML + desc LMML + 11 + 11 + read-write + + + MCECH + desc MCECH + 12 + 12 + read-write + + + MCECL + desc MCECL + 13 + 13 + read-write + + + + + OCMRHUH + desc OCMRHUH + 0x24 + 16 + read-write + 0x0 + 0xFFFF + + + OCFDCH + desc OCFDCH + 0 + 0 + read-write + + + OCFPKH + desc OCFPKH + 1 + 1 + read-write + + + OCFUCH + desc OCFUCH + 2 + 2 + read-write + + + OCFZRH + desc OCFZRH + 3 + 3 + read-write + + + OPDCH + desc OPDCH + 5 + 4 + read-write + + + OPPKH + desc OPPKH + 7 + 6 + read-write + + + OPUCH + desc OPUCH + 9 + 8 + read-write + + + OPZRH + desc OPZRH + 11 + 10 + read-write + + + OPNPKH + desc OPNPKH + 13 + 12 + read-write + + + OPNZRH + desc OPNZRH + 15 + 14 + read-write + + + + + OCMRLUL + desc OCMRLUL + 0x28 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + OCFDCL + desc OCFDCL + 0 + 0 + read-write + + + OCFPKL + desc OCFPKL + 1 + 1 + read-write + + + OCFUCL + desc OCFUCL + 2 + 2 + read-write + + + OCFZRL + desc OCFZRL + 3 + 3 + read-write + + + OPDCL + desc OPDCL + 5 + 4 + read-write + + + OPPKL + desc OPPKL + 7 + 6 + read-write + + + OPUCL + desc OPUCL + 9 + 8 + read-write + + + OPZRL + desc OPZRL + 11 + 10 + read-write + + + OPNPKL + desc OPNPKL + 13 + 12 + read-write + + + OPNZRL + desc OPNZRL + 15 + 14 + read-write + + + EOPNDCL + desc EOPNDCL + 17 + 16 + read-write + + + EOPNUCL + desc EOPNUCL + 19 + 18 + read-write + + + EOPDCL + desc EOPDCL + 21 + 20 + read-write + + + EOPPKL + desc EOPPKL + 23 + 22 + read-write + + + EOPUCL + desc EOPUCL + 25 + 24 + read-write + + + EOPZRL + desc EOPZRL + 27 + 26 + read-write + + + EOPNPKL + desc EOPNPKL + 29 + 28 + read-write + + + EOPNZRL + desc EOPNZRL + 31 + 30 + read-write + + + + + OCMRHVH + desc OCMRHVH + 0x2C + 16 + read-write + 0x0 + 0xFFFF + + + OCFDCH + desc OCFDCH + 0 + 0 + read-write + + + OCFPKH + desc OCFPKH + 1 + 1 + read-write + + + OCFUCH + desc OCFUCH + 2 + 2 + read-write + + + OCFZRH + desc OCFZRH + 3 + 3 + read-write + + + OPDCH + desc OPDCH + 5 + 4 + read-write + + + OPPKH + desc OPPKH + 7 + 6 + read-write + + + OPUCH + desc OPUCH + 9 + 8 + read-write + + + OPZRH + desc OPZRH + 11 + 10 + read-write + + + OPNPKH + desc OPNPKH + 13 + 12 + read-write + + + OPNZRH + desc OPNZRH + 15 + 14 + read-write + + + + + OCMRLVL + desc OCMRLVL + 0x30 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + OCFDCL + desc OCFDCL + 0 + 0 + read-write + + + OCFPKL + desc OCFPKL + 1 + 1 + read-write + + + OCFUCL + desc OCFUCL + 2 + 2 + read-write + + + OCFZRL + desc OCFZRL + 3 + 3 + read-write + + + OPDCL + desc OPDCL + 5 + 4 + read-write + + + OPPKL + desc OPPKL + 7 + 6 + read-write + + + OPUCL + desc OPUCL + 9 + 8 + read-write + + + OPZRL + desc OPZRL + 11 + 10 + read-write + + + OPNPKL + desc OPNPKL + 13 + 12 + read-write + + + OPNZRL + desc OPNZRL + 15 + 14 + read-write + + + EOPNDCL + desc EOPNDCL + 17 + 16 + read-write + + + EOPNUCL + desc EOPNUCL + 19 + 18 + read-write + + + EOPDCL + desc EOPDCL + 21 + 20 + read-write + + + EOPPKL + desc EOPPKL + 23 + 22 + read-write + + + EOPUCL + desc EOPUCL + 25 + 24 + read-write + + + EOPZRL + desc EOPZRL + 27 + 26 + read-write + + + EOPNPKL + desc EOPNPKL + 29 + 28 + read-write + + + EOPNZRL + desc EOPNZRL + 31 + 30 + read-write + + + + + OCMRHWH + desc OCMRHWH + 0x34 + 16 + read-write + 0x0 + 0xFFFF + + + OCFDCH + desc OCFDCH + 0 + 0 + read-write + + + OCFPKH + desc OCFPKH + 1 + 1 + read-write + + + OCFUCH + desc OCFUCH + 2 + 2 + read-write + + + OCFZRH + desc OCFZRH + 3 + 3 + read-write + + + OPDCH + desc OPDCH + 5 + 4 + read-write + + + OPPKH + desc OPPKH + 7 + 6 + read-write + + + OPUCH + desc OPUCH + 9 + 8 + read-write + + + OPZRH + desc OPZRH + 11 + 10 + read-write + + + OPNPKH + desc OPNPKH + 13 + 12 + read-write + + + OPNZRH + desc OPNZRH + 15 + 14 + read-write + + + + + OCMRLWL + desc OCMRLWL + 0x38 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + OCFDCL + desc OCFDCL + 0 + 0 + read-write + + + OCFPKL + desc OCFPKL + 1 + 1 + read-write + + + OCFUCL + desc OCFUCL + 2 + 2 + read-write + + + OCFZRL + desc OCFZRL + 3 + 3 + read-write + + + OPDCL + desc OPDCL + 5 + 4 + read-write + + + OPPKL + desc OPPKL + 7 + 6 + read-write + + + OPUCL + desc OPUCL + 9 + 8 + read-write + + + OPZRL + desc OPZRL + 11 + 10 + read-write + + + OPNPKL + desc OPNPKL + 13 + 12 + read-write + + + OPNZRL + desc OPNZRL + 15 + 14 + read-write + + + EOPNDCL + desc EOPNDCL + 17 + 16 + read-write + + + EOPNUCL + desc EOPNUCL + 19 + 18 + read-write + + + EOPDCL + desc EOPDCL + 21 + 20 + read-write + + + EOPPKL + desc EOPPKL + 23 + 22 + read-write + + + EOPUCL + desc EOPUCL + 25 + 24 + read-write + + + EOPZRL + desc EOPZRL + 27 + 26 + read-write + + + EOPNPKL + desc EOPNPKL + 29 + 28 + read-write + + + EOPNZRL + desc EOPNZRL + 31 + 30 + read-write + + + + + CPSR + desc CPSR + 0x42 + 16 + read-write + 0xFFFF + 0xFFFF + + + CNTR + desc CNTR + 0x46 + 16 + read-write + 0x0 + 0xFFFF + + + CCSR + desc CCSR + 0x48 + 16 + read-write + 0x40 + 0xE3FF + + + CKDIV + desc CKDIV + 3 + 0 + read-write + + + CLEAR + desc CLEAR + 4 + 4 + read-write + + + MODE + desc MODE + 5 + 5 + read-write + + + STOP + desc STOP + 6 + 6 + read-write + + + BUFEN + desc BUFEN + 7 + 7 + read-write + + + IRQPEN + desc IRQPEN + 8 + 8 + read-write + + + IRQPF + desc IRQPF + 9 + 9 + read-write + + + IRQZEN + desc IRQZEN + 13 + 13 + read-write + + + IRQZF + desc IRQZF + 14 + 14 + read-write + + + ECKEN + desc ECKEN + 15 + 15 + read-write + + + + + CVPR + desc CVPR + 0x4A + 16 + read-write + 0x0 + 0xFFFF + + + ZIM + desc ZIM + 3 + 0 + read-write + + + PIM + desc PIM + 7 + 4 + read-write + + + ZIC + desc ZIC + 11 + 8 + read-only + + + PIC + desc PIC + 15 + 12 + read-only + + + + + PFSRU + desc PFSRU + 0x82 + 16 + read-write + 0x0 + 0xFFFF + + + PDARU + desc PDARU + 0x84 + 16 + read-write + 0x0 + 0xFFFF + + + PDBRU + desc PDBRU + 0x86 + 16 + read-write + 0x0 + 0xFFFF + + + PFSRV + desc PFSRV + 0x8A + 16 + read-write + 0x0 + 0xFFFF + + + PDARV + desc PDARV + 0x8C + 16 + read-write + 0x0 + 0xFFFF + + + PDBRV + desc PDBRV + 0x8E + 16 + read-write + 0x0 + 0xFFFF + + + PFSRW + desc PFSRW + 0x92 + 16 + read-write + 0x0 + 0xFFFF + + + PDARW + desc PDARW + 0x94 + 16 + read-write + 0x0 + 0xFFFF + + + PDBRW + desc PDBRW + 0x96 + 16 + read-write + 0x0 + 0xFFFF + + + POCRU + desc POCRU + 0x98 + 16 + read-write + 0xFF00 + 0xFF + + + DIVCK + desc DIVCK + 2 + 0 + read-write + + + PWMMD + desc PWMMD + 5 + 4 + read-write + + + LVLS + desc LVLS + 7 + 6 + read-write + + + + + POCRV + desc POCRV + 0x9C + 16 + read-write + 0xFF00 + 0xFF + + + DIVCK + desc DIVCK + 2 + 0 + read-write + + + PWMMD + desc PWMMD + 5 + 4 + read-write + + + LVLS + desc LVLS + 7 + 6 + read-write + + + + + POCRW + desc POCRW + 0xA0 + 16 + read-write + 0xFF00 + 0xFF + + + DIVCK + desc DIVCK + 2 + 0 + read-write + + + PWMMD + desc PWMMD + 5 + 4 + read-write + + + LVLS + desc LVLS + 7 + 6 + read-write + + + + + RCSR + desc RCSR + 0xA4 + 16 + read-write + 0x0 + 0xFFF7 + + + RTIDU + desc RTIDU + 0 + 0 + read-write + + + RTIDV + desc RTIDV + 1 + 1 + read-write + + + RTIDW + desc RTIDW + 2 + 2 + read-write + + + RTIFU + desc RTIFU + 4 + 4 + read-only + + + RTICU + desc RTICU + 5 + 5 + read-write + + + RTEU + desc RTEU + 6 + 6 + read-write + + + RTSU + desc RTSU + 7 + 7 + read-write + + + RTIFV + desc RTIFV + 8 + 8 + read-only + + + RTICV + desc RTICV + 9 + 9 + read-write + + + RTEV + desc RTEV + 10 + 10 + read-write + + + RTSV + desc RTSV + 11 + 11 + read-write + + + RTIFW + desc RTIFW + 12 + 12 + read-only + + + RTICW + desc RTICW + 13 + 13 + read-write + + + RTEW + desc RTEW + 14 + 14 + read-write + + + RTSW + desc RTSW + 15 + 15 + read-write + + + + + SCCRUH + desc SCCRUH + 0xB2 + 16 + read-write + 0x0 + 0xFFFF + + + SCCRUL + desc SCCRUL + 0xB6 + 16 + read-write + 0x0 + 0xFFFF + + + SCCRVH + desc SCCRVH + 0xBA + 16 + read-write + 0x0 + 0xFFFF + + + SCCRVL + desc SCCRVL + 0xBE + 16 + read-write + 0x0 + 0xFFFF + + + SCCRWH + desc SCCRWH + 0xC2 + 16 + read-write + 0x0 + 0xFFFF + + + SCCRWL + desc SCCRWL + 0xC6 + 16 + read-write + 0x0 + 0xFFFF + + + SCSRUH + desc SCSRUH + 0xC8 + 16 + read-write + 0x0 + 0xF33F + + + BUFEN + desc BUFEN + 1 + 0 + read-write + + + EVTOS + desc EVTOS + 4 + 2 + read-write + + + LMC + desc LMC + 5 + 5 + read-write + + + EVTMS + desc EVTMS + 8 + 8 + read-write + + + EVTDS + desc EVTDS + 9 + 9 + read-write + + + DEN + desc DEN + 12 + 12 + read-write + + + PEN + desc PEN + 13 + 13 + read-write + + + UEN + desc UEN + 14 + 14 + read-write + + + ZEN + desc ZEN + 15 + 15 + read-write + + + + + SCMRUH + desc SCMRUH + 0xCA + 16 + read-write + 0xFF00 + 0xCF + + + AMC + desc AMC + 3 + 0 + read-write + + + MZCE + desc MZCE + 6 + 6 + read-write + + + MPCE + desc MPCE + 7 + 7 + read-write + + + + + SCSRUL + desc SCSRUL + 0xCC + 16 + read-write + 0x0 + 0xF33F + + + BUFEN + desc BUFEN + 1 + 0 + read-write + + + EVTOS + desc EVTOS + 4 + 2 + read-write + + + LMC + desc LMC + 5 + 5 + read-write + + + EVTMS + desc EVTMS + 8 + 8 + read-write + + + EVTDS + desc EVTDS + 9 + 9 + read-write + + + DEN + desc DEN + 12 + 12 + read-write + + + PEN + desc PEN + 13 + 13 + read-write + + + UEN + desc UEN + 14 + 14 + read-write + + + ZEN + desc ZEN + 15 + 15 + read-write + + + + + SCMRUL + desc SCMRUL + 0xCE + 16 + read-write + 0xFF00 + 0xCF + + + AMC + desc AMC + 3 + 0 + read-write + + + MZCE + desc MZCE + 6 + 6 + read-write + + + MPCE + desc MPCE + 7 + 7 + read-write + + + + + SCSRVH + desc SCSRVH + 0xD0 + 16 + read-write + 0x0 + 0xF33F + + + BUFEN + desc BUFEN + 1 + 0 + read-write + + + EVTOS + desc EVTOS + 4 + 2 + read-write + + + LMC + desc LMC + 5 + 5 + read-write + + + EVTMS + desc EVTMS + 8 + 8 + read-write + + + EVTDS + desc EVTDS + 9 + 9 + read-write + + + DEN + desc DEN + 12 + 12 + read-write + + + PEN + desc PEN + 13 + 13 + read-write + + + UEN + desc UEN + 14 + 14 + read-write + + + ZEN + desc ZEN + 15 + 15 + read-write + + + + + SCMRVH + desc SCMRVH + 0xD2 + 16 + read-write + 0xFF00 + 0xCF + + + AMC + desc AMC + 3 + 0 + read-write + + + MZCE + desc MZCE + 6 + 6 + read-write + + + MPCE + desc MPCE + 7 + 7 + read-write + + + + + SCSRVL + desc SCSRVL + 0xD4 + 16 + read-write + 0x0 + 0xF33F + + + BUFEN + desc BUFEN + 1 + 0 + read-write + + + EVTOS + desc EVTOS + 4 + 2 + read-write + + + LMC + desc LMC + 5 + 5 + read-write + + + EVTMS + desc EVTMS + 8 + 8 + read-write + + + EVTDS + desc EVTDS + 9 + 9 + read-write + + + DEN + desc DEN + 12 + 12 + read-write + + + PEN + desc PEN + 13 + 13 + read-write + + + UEN + desc UEN + 14 + 14 + read-write + + + ZEN + desc ZEN + 15 + 15 + read-write + + + + + SCMRVL + desc SCMRVL + 0xD6 + 16 + read-write + 0xFF00 + 0xCF + + + AMC + desc AMC + 3 + 0 + read-write + + + MZCE + desc MZCE + 6 + 6 + read-write + + + MPCE + desc MPCE + 7 + 7 + read-write + + + + + SCSRWH + desc SCSRWH + 0xD8 + 16 + read-write + 0x0 + 0xF33F + + + BUFEN + desc BUFEN + 1 + 0 + read-write + + + EVTOS + desc EVTOS + 4 + 2 + read-write + + + LMC + desc LMC + 5 + 5 + read-write + + + EVTMS + desc EVTMS + 8 + 8 + read-write + + + EVTDS + desc EVTDS + 9 + 9 + read-write + + + DEN + desc DEN + 12 + 12 + read-write + + + PEN + desc PEN + 13 + 13 + read-write + + + UEN + desc UEN + 14 + 14 + read-write + + + ZEN + desc ZEN + 15 + 15 + read-write + + + + + SCMRWH + desc SCMRWH + 0xDA + 16 + read-write + 0xFF00 + 0xCF + + + AMC + desc AMC + 3 + 0 + read-write + + + MZCE + desc MZCE + 6 + 6 + read-write + + + MPCE + desc MPCE + 7 + 7 + read-write + + + + + SCSRWL + desc SCSRWL + 0xDC + 16 + read-write + 0x0 + 0xF33F + + + BUFEN + desc BUFEN + 1 + 0 + read-write + + + EVTOS + desc EVTOS + 4 + 2 + read-write + + + LMC + desc LMC + 5 + 5 + read-write + + + EVTMS + desc EVTMS + 8 + 8 + read-write + + + EVTDS + desc EVTDS + 9 + 9 + read-write + + + DEN + desc DEN + 12 + 12 + read-write + + + PEN + desc PEN + 13 + 13 + read-write + + + UEN + desc UEN + 14 + 14 + read-write + + + ZEN + desc ZEN + 15 + 15 + read-write + + + + + SCMRWL + desc SCMRWL + 0xDE + 16 + read-write + 0xFF00 + 0xCF + + + AMC + desc AMC + 3 + 0 + read-write + + + MZCE + desc MZCE + 6 + 6 + read-write + + + MPCE + desc MPCE + 7 + 7 + read-write + + + + + PSCR + desc PSCR + 0xE0 + 32 + read-write + 0x5550000 + 0xFFF03FF + + + OEUH + desc OEUH + 0 + 0 + read-write + + + OEUL + desc OEUL + 1 + 1 + read-write + + + OEVH + desc OEVH + 2 + 2 + read-write + + + OEVL + desc OEVL + 3 + 3 + read-write + + + OEWH + desc OEWH + 4 + 4 + read-write + + + OEWL + desc OEWL + 5 + 5 + read-write + + + ODT + desc ODT + 7 + 6 + read-write + + + MOE + desc MOE + 8 + 8 + read-write + + + AOE + desc AOE + 9 + 9 + read-write + + + OSUH + desc OSUH + 17 + 16 + read-write + + + OSUL + desc OSUL + 19 + 18 + read-write + + + OSVH + desc OSVH + 21 + 20 + read-write + + + OSVL + desc OSVL + 23 + 22 + read-write + + + OSWH + desc OSWH + 25 + 24 + read-write + + + OSWL + desc OSWL + 27 + 26 + read-write + + + + + SCER + desc SCER + 0xE4 + 16 + read-write + 0xFF00 + 0xF + + + EVTRS + desc EVTRS + 2 + 0 + read-write + + + PCTS + desc PCTS + 3 + 3 + read-write + + + + + + + TMR61 + desc TMR61 + 0x40018000 + + 0x0 + 0x400 + + + + CNTER + desc CNTER + 0x0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + UPDAR + desc UPDAR + 0x4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + PERAR + desc PERAR + 0x40 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + PERBR + desc PERBR + 0x44 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + PERCR + desc PERCR + 0x48 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMAR + desc GCMAR + 0x80 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMBR + desc GCMBR + 0x84 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMCR + desc GCMCR + 0x88 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMDR + desc GCMDR + 0x8C + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMER + desc GCMER + 0x90 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMFR + desc GCMFR + 0x94 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMAR + desc SCMAR + 0xC0 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMBR + desc SCMBR + 0xC4 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMCR + desc SCMCR + 0xC8 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMDR + desc SCMDR + 0xCC + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMER + desc SCMER + 0xD0 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMFR + desc SCMFR + 0xD4 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + DTUAR + desc DTUAR + 0x100 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + DTDAR + desc DTDAR + 0x104 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + DTUBR + desc DTUBR + 0x108 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + DTDBR + desc DTDBR + 0x10C + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCONR + desc GCONR + 0x140 + 32 + read-write + 0x2 + 0xF01F7 + + + START + desc START + 0 + 0 + read-write + + + DIR + desc DIR + 1 + 1 + read-write + + + MODE + desc MODE + 2 + 2 + read-write + + + CKDIV + desc CKDIV + 7 + 4 + read-write + + + OVSTP + desc OVSTP + 8 + 8 + read-write + + + ZMSKREV + desc ZMSKREV + 16 + 16 + read-write + + + ZMSKPOS + desc ZMSKPOS + 17 + 17 + read-write + + + ZMSKVAL + desc ZMSKVAL + 19 + 18 + read-write + + + + + ICONR + desc ICONR + 0x144 + 32 + read-write + 0x0 + 0xF01FF + + + INTENA + desc INTENA + 0 + 0 + read-write + + + INTENB + desc INTENB + 1 + 1 + read-write + + + INTENC + desc INTENC + 2 + 2 + read-write + + + INTEND + desc INTEND + 3 + 3 + read-write + + + INTENE + desc INTENE + 4 + 4 + read-write + + + INTENF + desc INTENF + 5 + 5 + read-write + + + INTENOVF + desc INTENOVF + 6 + 6 + read-write + + + INTENUDF + desc INTENUDF + 7 + 7 + read-write + + + INTENDTE + desc INTENDTE + 8 + 8 + read-write + + + INTENSAU + desc INTENSAU + 16 + 16 + read-write + + + INTENSAD + desc INTENSAD + 17 + 17 + read-write + + + INTENSBU + desc INTENSBU + 18 + 18 + read-write + + + INTENSBD + desc INTENSBD + 19 + 19 + read-write + + + + + BCONR + desc BCONR + 0x148 + 32 + read-write + 0x0 + 0xFF0FFF + + + BENA + desc BENA + 0 + 0 + read-write + + + BSEA + desc BSEA + 1 + 1 + read-write + + + BTRUA + desc BTRUA + 2 + 2 + read-write + + + BTRDA + desc BTRDA + 3 + 3 + read-write + + + BENB + desc BENB + 4 + 4 + read-write + + + BSEB + desc BSEB + 5 + 5 + read-write + + + BTRUB + desc BTRUB + 6 + 6 + read-write + + + BTRDB + desc BTRDB + 7 + 7 + read-write + + + BENP + desc BENP + 8 + 8 + read-write + + + BSEP + desc BSEP + 9 + 9 + read-write + + + BTRUP + desc BTRUP + 10 + 10 + read-write + + + BTRDP + desc BTRDP + 11 + 11 + read-write + + + BENSPA + desc BENSPA + 16 + 16 + read-write + + + BSESPA + desc BSESPA + 17 + 17 + read-write + + + BTRUSPA + desc BTRUSPA + 18 + 18 + read-write + + + BTRDSPA + desc BTRDSPA + 19 + 19 + read-write + + + BENSPB + desc BENSPB + 20 + 20 + read-write + + + BSESPB + desc BSESPB + 21 + 21 + read-write + + + BTRUSPB + desc BTRUSPB + 22 + 22 + read-write + + + BTRDSPB + desc BTRDSPB + 23 + 23 + read-write + + + + + DCONR + desc DCONR + 0x14C + 32 + read-write + 0x0 + 0xF3 + + + DTCEN + desc DTCEN + 0 + 0 + read-write + + + SEPA + desc SEPA + 1 + 1 + read-write + + + DTBENU + desc DTBENU + 4 + 4 + read-write + + + DTBEND + desc DTBEND + 5 + 5 + read-write + + + DTBTRU + desc DTBTRU + 6 + 6 + read-write + + + DTBTRD + desc DTBTRD + 7 + 7 + read-write + + + + + PCNAR + desc PCNAR + 0x154 + 32 + read-write + 0x0 + 0x93F3FFFF + + + STACA + desc STACA + 1 + 0 + read-write + + + STPCA + desc STPCA + 3 + 2 + read-write + + + OVFCA + desc OVFCA + 5 + 4 + read-write + + + UDFCA + desc UDFCA + 7 + 6 + read-write + + + CMAUCA + desc CMAUCA + 9 + 8 + read-write + + + CMADCA + desc CMADCA + 11 + 10 + read-write + + + CMBUCA + desc CMBUCA + 13 + 12 + read-write + + + CMBDCA + desc CMBDCA + 15 + 14 + read-write + + + FORCA + desc FORCA + 17 + 16 + read-write + + + EMBCA + desc EMBCA + 21 + 20 + read-write + + + EMBRA + desc EMBRA + 23 + 22 + read-write + + + EMBSA + desc EMBSA + 25 + 24 + read-write + + + OUTENA + desc OUTENA + 28 + 28 + read-write + + + CAPMDA + desc CAPMDA + 31 + 31 + read-write + + + + + PCNBR + desc PCNBR + 0x158 + 32 + read-write + 0x0 + 0x93F3FFFF + + + STACB + desc STACB + 1 + 0 + read-write + + + STPCB + desc STPCB + 3 + 2 + read-write + + + OVFCB + desc OVFCB + 5 + 4 + read-write + + + UDFCB + desc UDFCB + 7 + 6 + read-write + + + CMAUCB + desc CMAUCB + 9 + 8 + read-write + + + CMADCB + desc CMADCB + 11 + 10 + read-write + + + CMBUCB + desc CMBUCB + 13 + 12 + read-write + + + CMBDCB + desc CMBDCB + 15 + 14 + read-write + + + FORCB + desc FORCB + 17 + 16 + read-write + + + EMBCB + desc EMBCB + 21 + 20 + read-write + + + EMBRB + desc EMBRB + 23 + 22 + read-write + + + EMBSB + desc EMBSB + 25 + 24 + read-write + + + OUTENB + desc OUTENB + 28 + 28 + read-write + + + CAPMDB + desc CAPMDB + 31 + 31 + read-write + + + + + FCNGR + desc FCNGR + 0x15C + 32 + read-write + 0x0 + 0x77 + + + NOFIENGA + desc NOFIENGA + 0 + 0 + read-write + + + NOFICKGA + desc NOFICKGA + 2 + 1 + read-write + + + NOFIENGB + desc NOFIENGB + 4 + 4 + read-write + + + NOFICKGB + desc NOFICKGB + 6 + 5 + read-write + + + + + VPERR + desc VPERR + 0x160 + 32 + read-write + 0x0 + 0x1F0300 + + + SPPERIA + desc SPPERIA + 8 + 8 + read-write + + + SPPERIB + desc SPPERIB + 9 + 9 + read-write + + + PCNTE + desc PCNTE + 17 + 16 + read-write + + + PCNTS + desc PCNTS + 20 + 18 + read-write + + + + + STFLR + desc STFLR + 0x164 + 32 + read-write + 0x80000000 + 0x80E01FFF + + + CMAF + desc CMAF + 0 + 0 + read-write + + + CMBF + desc CMBF + 1 + 1 + read-write + + + CMCF + desc CMCF + 2 + 2 + read-write + + + CMDF + desc CMDF + 3 + 3 + read-write + + + CMEF + desc CMEF + 4 + 4 + read-write + + + CMFF + desc CMFF + 5 + 5 + read-write + + + OVFF + desc OVFF + 6 + 6 + read-write + + + UDFF + desc UDFF + 7 + 7 + read-write + + + DTEF + desc DTEF + 8 + 8 + read-only + + + CMSAUF + desc CMSAUF + 9 + 9 + read-write + + + CMSADF + desc CMSADF + 10 + 10 + read-write + + + CMSBUF + desc CMSBUF + 11 + 11 + read-write + + + CMSBDF + desc CMSBDF + 12 + 12 + read-write + + + VPERNUM + desc VPERNUM + 23 + 21 + read-only + + + DIRF + desc DIRF + 31 + 31 + read-only + + + + + HSTAR + desc HSTAR + 0x180 + 32 + read-write + 0x0 + 0xFF0F8F + + + HSTA0 + desc HSTA0 + 0 + 0 + read-write + + + HSTA1 + desc HSTA1 + 1 + 1 + read-write + + + HSTA2 + desc HSTA2 + 2 + 2 + read-write + + + HSTA3 + desc HSTA3 + 3 + 3 + read-write + + + STAS + desc STAS + 7 + 7 + read-write + + + HSTA8 + desc HSTA8 + 8 + 8 + read-write + + + HSTA9 + desc HSTA9 + 9 + 9 + read-write + + + HSTA10 + desc HSTA10 + 10 + 10 + read-write + + + HSTA11 + desc HSTA11 + 11 + 11 + read-write + + + HSTA16 + desc HSTA16 + 16 + 16 + read-write + + + HSTA17 + desc HSTA17 + 17 + 17 + read-write + + + HSTA18 + desc HSTA18 + 18 + 18 + read-write + + + HSTA19 + desc HSTA19 + 19 + 19 + read-write + + + HSTA20 + desc HSTA20 + 20 + 20 + read-write + + + HSTA21 + desc HSTA21 + 21 + 21 + read-write + + + HSTA22 + desc HSTA22 + 22 + 22 + read-write + + + HSTA23 + desc HSTA23 + 23 + 23 + read-write + + + + + HSTPR + desc HSTPR + 0x184 + 32 + read-write + 0x0 + 0xFF0F8F + + + HSTP0 + desc HSTP0 + 0 + 0 + read-write + + + HSTP1 + desc HSTP1 + 1 + 1 + read-write + + + HSTP2 + desc HSTP2 + 2 + 2 + read-write + + + HSTP3 + desc HSTP3 + 3 + 3 + read-write + + + STPS + desc STPS + 7 + 7 + read-write + + + HSTP8 + desc HSTP8 + 8 + 8 + read-write + + + HSTP9 + desc HSTP9 + 9 + 9 + read-write + + + HSTP10 + desc HSTP10 + 10 + 10 + read-write + + + HSTP11 + desc HSTP11 + 11 + 11 + read-write + + + HSTP16 + desc HSTP16 + 16 + 16 + read-write + + + HSTP17 + desc HSTP17 + 17 + 17 + read-write + + + HSTP18 + desc HSTP18 + 18 + 18 + read-write + + + HSTP19 + desc HSTP19 + 19 + 19 + read-write + + + HSTP20 + desc HSTP20 + 20 + 20 + read-write + + + HSTP21 + desc HSTP21 + 21 + 21 + read-write + + + HSTP22 + desc HSTP22 + 22 + 22 + read-write + + + HSTP23 + desc HSTP23 + 23 + 23 + read-write + + + + + HCLRR + desc HCLRR + 0x188 + 32 + read-write + 0x0 + 0xFF0F8F + + + HCLE0 + desc HCLE0 + 0 + 0 + read-write + + + HCLE1 + desc HCLE1 + 1 + 1 + read-write + + + HCLE2 + desc HCLE2 + 2 + 2 + read-write + + + HCLE3 + desc HCLE3 + 3 + 3 + read-write + + + CLES + desc CLES + 7 + 7 + read-write + + + HCLE8 + desc HCLE8 + 8 + 8 + read-write + + + HCLE9 + desc HCLE9 + 9 + 9 + read-write + + + HCLE10 + desc HCLE10 + 10 + 10 + read-write + + + HCLE11 + desc HCLE11 + 11 + 11 + read-write + + + HCLE16 + desc HCLE16 + 16 + 16 + read-write + + + HCLE17 + desc HCLE17 + 17 + 17 + read-write + + + HCLE18 + desc HCLE18 + 18 + 18 + read-write + + + HCLE19 + desc HCLE19 + 19 + 19 + read-write + + + HCLE20 + desc HCLE20 + 20 + 20 + read-write + + + HCLE21 + desc HCLE21 + 21 + 21 + read-write + + + HCLE22 + desc HCLE22 + 22 + 22 + read-write + + + HCLE23 + desc HCLE23 + 23 + 23 + read-write + + + + + HUPDR + desc HUPDR + 0x18C + 32 + read-write + 0x0 + 0xFF0F8F + + + HUPD0 + desc HUPD0 + 0 + 0 + read-write + + + HUPD1 + desc HUPD1 + 1 + 1 + read-write + + + HUPD2 + desc HUPD2 + 2 + 2 + read-write + + + HUPD3 + desc HUPD3 + 3 + 3 + read-write + + + UPDS + desc UPDS + 7 + 7 + read-write + + + HUPD8 + desc HUPD8 + 8 + 8 + read-write + + + HUPD9 + desc HUPD9 + 9 + 9 + read-write + + + HUPD10 + desc HUPD10 + 10 + 10 + read-write + + + HUPD11 + desc HUPD11 + 11 + 11 + read-write + + + HUPD16 + desc HUPD16 + 16 + 16 + read-write + + + HUPD17 + desc HUPD17 + 17 + 17 + read-write + + + HUPD18 + desc HUPD18 + 18 + 18 + read-write + + + HUPD19 + desc HUPD19 + 19 + 19 + read-write + + + HUPD20 + desc HUPD20 + 20 + 20 + read-write + + + HUPD21 + desc HUPD21 + 21 + 21 + read-write + + + HUPD22 + desc HUPD22 + 22 + 22 + read-write + + + HUPD23 + desc HUPD23 + 23 + 23 + read-write + + + + + HCPAR + desc HCPAR + 0x190 + 32 + read-write + 0x0 + 0xFF0F0F + + + HCPA0 + desc HCPA0 + 0 + 0 + read-write + + + HCPA1 + desc HCPA1 + 1 + 1 + read-write + + + HCPA2 + desc HCPA2 + 2 + 2 + read-write + + + HCPA3 + desc HCPA3 + 3 + 3 + read-write + + + HCPA8 + desc HCPA8 + 8 + 8 + read-write + + + HCPA9 + desc HCPA9 + 9 + 9 + read-write + + + HCPA10 + desc HCPA10 + 10 + 10 + read-write + + + HCPA11 + desc HCPA11 + 11 + 11 + read-write + + + HCPA16 + desc HCPA16 + 16 + 16 + read-write + + + HCPA17 + desc HCPA17 + 17 + 17 + read-write + + + HCPA18 + desc HCPA18 + 18 + 18 + read-write + + + HCPA19 + desc HCPA19 + 19 + 19 + read-write + + + HCPA20 + desc HCPA20 + 20 + 20 + read-write + + + HCPA21 + desc HCPA21 + 21 + 21 + read-write + + + HCPA22 + desc HCPA22 + 22 + 22 + read-write + + + HCPA23 + desc HCPA23 + 23 + 23 + read-write + + + + + HCPBR + desc HCPBR + 0x194 + 32 + read-write + 0x0 + 0xFF0F0F + + + HCPB0 + desc HCPB0 + 0 + 0 + read-write + + + HCPB1 + desc HCPB1 + 1 + 1 + read-write + + + HCPB2 + desc HCPB2 + 2 + 2 + read-write + + + HCPB3 + desc HCPB3 + 3 + 3 + read-write + + + HCPB8 + desc HCPB8 + 8 + 8 + read-write + + + HCPB9 + desc HCPB9 + 9 + 9 + read-write + + + HCPB10 + desc HCPB10 + 10 + 10 + read-write + + + HCPB11 + desc HCPB11 + 11 + 11 + read-write + + + HCPB16 + desc HCPB16 + 16 + 16 + read-write + + + HCPB17 + desc HCPB17 + 17 + 17 + read-write + + + HCPB18 + desc HCPB18 + 18 + 18 + read-write + + + HCPB19 + desc HCPB19 + 19 + 19 + read-write + + + HCPB20 + desc HCPB20 + 20 + 20 + read-write + + + HCPB21 + desc HCPB21 + 21 + 21 + read-write + + + HCPB22 + desc HCPB22 + 22 + 22 + read-write + + + HCPB23 + desc HCPB23 + 23 + 23 + read-write + + + + + HCUPR + desc HCUPR + 0x198 + 32 + read-write + 0x0 + 0xFF0FFF + + + HCUP0 + desc HCUP0 + 0 + 0 + read-write + + + HCUP1 + desc HCUP1 + 1 + 1 + read-write + + + HCUP2 + desc HCUP2 + 2 + 2 + read-write + + + HCUP3 + desc HCUP3 + 3 + 3 + read-write + + + HCUP4 + desc HCUP4 + 4 + 4 + read-write + + + HCUP5 + desc HCUP5 + 5 + 5 + read-write + + + HCUP6 + desc HCUP6 + 6 + 6 + read-write + + + HCUP7 + desc HCUP7 + 7 + 7 + read-write + + + HCUP8 + desc HCUP8 + 8 + 8 + read-write + + + HCUP9 + desc HCUP9 + 9 + 9 + read-write + + + HCUP10 + desc HCUP10 + 10 + 10 + read-write + + + HCUP11 + desc HCUP11 + 11 + 11 + read-write + + + HCUP16 + desc HCUP16 + 16 + 16 + read-write + + + HCUP17 + desc HCUP17 + 17 + 17 + read-write + + + HCUP18 + desc HCUP18 + 18 + 18 + read-write + + + HCUP19 + desc HCUP19 + 19 + 19 + read-write + + + HCUP20 + desc HCUP20 + 20 + 20 + read-write + + + HCUP21 + desc HCUP21 + 21 + 21 + read-write + + + HCUP22 + desc HCUP22 + 22 + 22 + read-write + + + HCUP23 + desc HCUP23 + 23 + 23 + read-write + + + + + HCDOR + desc HCDOR + 0x19C + 32 + read-write + 0x0 + 0xFF0FFF + + + HCDO0 + desc HCDO0 + 0 + 0 + read-write + + + HCDO1 + desc HCDO1 + 1 + 1 + read-write + + + HCDO2 + desc HCDO2 + 2 + 2 + read-write + + + HCDO3 + desc HCDO3 + 3 + 3 + read-write + + + HCDO4 + desc HCDO4 + 4 + 4 + read-write + + + HCDO5 + desc HCDO5 + 5 + 5 + read-write + + + HCDO6 + desc HCDO6 + 6 + 6 + read-write + + + HCDO7 + desc HCDO7 + 7 + 7 + read-write + + + HCDO8 + desc HCDO8 + 8 + 8 + read-write + + + HCDO9 + desc HCDO9 + 9 + 9 + read-write + + + HCDO10 + desc HCDO10 + 10 + 10 + read-write + + + HCDO11 + desc HCDO11 + 11 + 11 + read-write + + + HCDO16 + desc HCDO16 + 16 + 16 + read-write + + + HCDO17 + desc HCDO17 + 17 + 17 + read-write + + + HCDO18 + desc HCDO18 + 18 + 18 + read-write + + + HCDO19 + desc HCDO19 + 19 + 19 + read-write + + + HCDO20 + desc HCDO20 + 20 + 20 + read-write + + + HCDO21 + desc HCDO21 + 21 + 21 + read-write + + + HCDO22 + desc HCDO22 + 22 + 22 + read-write + + + HCDO23 + desc HCDO23 + 23 + 23 + read-write + + + + + FCNTR + desc FCNTR + 0x3EC + 32 + read-write + 0x0 + 0x7777 + + + NOFIENTA + desc NOFIENTA + 0 + 0 + read-write + + + NOFICKTA + desc NOFICKTA + 2 + 1 + read-write + + + NOFIENTB + desc NOFIENTB + 4 + 4 + read-write + + + NOFICKTB + desc NOFICKTB + 6 + 5 + read-write + + + NOFIENTC + desc NOFIENTC + 8 + 8 + read-write + + + NOFICKTC + desc NOFICKTC + 10 + 9 + read-write + + + NOFIENTD + desc NOFIENTD + 12 + 12 + read-write + + + NOFICKTD + desc NOFICKTD + 14 + 13 + read-write + + + + + SSTAR + desc SSTAR + 0x3F0 + 32 + read-write + 0x0 + 0xFF + + + SSTA1 + desc SSTA1 + 0 + 0 + read-write + + + SSTA2 + desc SSTA2 + 1 + 1 + read-write + + + SSTA3 + desc SSTA3 + 2 + 2 + read-write + + + SSTA4 + desc SSTA4 + 3 + 3 + read-write + + + SSTA5 + desc SSTA5 + 4 + 4 + read-write + + + SSTA6 + desc SSTA6 + 5 + 5 + read-write + + + SSTA7 + desc SSTA7 + 6 + 6 + read-write + + + SSTA8 + desc SSTA8 + 7 + 7 + read-write + + + + + SSTPR + desc SSTPR + 0x3F4 + 32 + read-write + 0x0 + 0xFF + + + SSTP1 + desc SSTP1 + 0 + 0 + read-write + + + SSTP2 + desc SSTP2 + 1 + 1 + read-write + + + SSTP3 + desc SSTP3 + 2 + 2 + read-write + + + SSTP4 + desc SSTP4 + 3 + 3 + read-write + + + SSTP5 + desc SSTP5 + 4 + 4 + read-write + + + SSTP6 + desc SSTP6 + 5 + 5 + read-write + + + SSTP7 + desc SSTP7 + 6 + 6 + read-write + + + SSTP8 + desc SSTP8 + 7 + 7 + read-write + + + + + SCLRR + desc SCLRR + 0x3F8 + 32 + read-write + 0x0 + 0xFF + + + SCLE1 + desc SCLE1 + 0 + 0 + read-write + + + SCLE2 + desc SCLE2 + 1 + 1 + read-write + + + SCLE3 + desc SCLE3 + 2 + 2 + read-write + + + SCLE4 + desc SCLE4 + 3 + 3 + read-write + + + SCLE5 + desc SCLE5 + 4 + 4 + read-write + + + SCLE6 + desc SCLE6 + 5 + 5 + read-write + + + SCLE7 + desc SCLE7 + 6 + 6 + read-write + + + SCLE8 + desc SCLE8 + 7 + 7 + read-write + + + + + SUPDR + desc SUPDR + 0x3FC + 32 + read-write + 0x0 + 0xFF + + + SUPD1 + desc SUPD1 + 0 + 0 + read-write + + + SUPD2 + desc SUPD2 + 1 + 1 + read-write + + + SUPD3 + desc SUPD3 + 2 + 2 + read-write + + + SUPD4 + desc SUPD4 + 3 + 3 + read-write + + + SUPD5 + desc SUPD5 + 4 + 4 + read-write + + + SUPD6 + desc SUPD6 + 5 + 5 + read-write + + + SUPD7 + desc SUPD7 + 6 + 6 + read-write + + + SUPD8 + desc SUPD8 + 7 + 7 + read-write + + + + + + + TMR62 + desc TMR62 + 0x40018400 + + 0x0 + 0x1A0 + + + + CNTER + desc CNTER + 0x0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + UPDAR + desc UPDAR + 0x4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + PERAR + desc PERAR + 0x40 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + PERBR + desc PERBR + 0x44 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + PERCR + desc PERCR + 0x48 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMAR + desc GCMAR + 0x80 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMBR + desc GCMBR + 0x84 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMCR + desc GCMCR + 0x88 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMDR + desc GCMDR + 0x8C + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMER + desc GCMER + 0x90 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMFR + desc GCMFR + 0x94 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMAR + desc SCMAR + 0xC0 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMBR + desc SCMBR + 0xC4 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMCR + desc SCMCR + 0xC8 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMDR + desc SCMDR + 0xCC + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMER + desc SCMER + 0xD0 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMFR + desc SCMFR + 0xD4 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + DTUAR + desc DTUAR + 0x100 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + DTDAR + desc DTDAR + 0x104 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + DTUBR + desc DTUBR + 0x108 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + DTDBR + desc DTDBR + 0x10C + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCONR + desc GCONR + 0x140 + 32 + read-write + 0x2 + 0xF01F7 + + + START + desc START + 0 + 0 + read-write + + + DIR + desc DIR + 1 + 1 + read-write + + + MODE + desc MODE + 2 + 2 + read-write + + + CKDIV + desc CKDIV + 7 + 4 + read-write + + + OVSTP + desc OVSTP + 8 + 8 + read-write + + + ZMSKREV + desc ZMSKREV + 16 + 16 + read-write + + + ZMSKPOS + desc ZMSKPOS + 17 + 17 + read-write + + + ZMSKVAL + desc ZMSKVAL + 19 + 18 + read-write + + + + + ICONR + desc ICONR + 0x144 + 32 + read-write + 0x0 + 0xF01FF + + + INTENA + desc INTENA + 0 + 0 + read-write + + + INTENB + desc INTENB + 1 + 1 + read-write + + + INTENC + desc INTENC + 2 + 2 + read-write + + + INTEND + desc INTEND + 3 + 3 + read-write + + + INTENE + desc INTENE + 4 + 4 + read-write + + + INTENF + desc INTENF + 5 + 5 + read-write + + + INTENOVF + desc INTENOVF + 6 + 6 + read-write + + + INTENUDF + desc INTENUDF + 7 + 7 + read-write + + + INTENDTE + desc INTENDTE + 8 + 8 + read-write + + + INTENSAU + desc INTENSAU + 16 + 16 + read-write + + + INTENSAD + desc INTENSAD + 17 + 17 + read-write + + + INTENSBU + desc INTENSBU + 18 + 18 + read-write + + + INTENSBD + desc INTENSBD + 19 + 19 + read-write + + + + + BCONR + desc BCONR + 0x148 + 32 + read-write + 0x0 + 0xFF0FFF + + + BENA + desc BENA + 0 + 0 + read-write + + + BSEA + desc BSEA + 1 + 1 + read-write + + + BTRUA + desc BTRUA + 2 + 2 + read-write + + + BTRDA + desc BTRDA + 3 + 3 + read-write + + + BENB + desc BENB + 4 + 4 + read-write + + + BSEB + desc BSEB + 5 + 5 + read-write + + + BTRUB + desc BTRUB + 6 + 6 + read-write + + + BTRDB + desc BTRDB + 7 + 7 + read-write + + + BENP + desc BENP + 8 + 8 + read-write + + + BSEP + desc BSEP + 9 + 9 + read-write + + + BTRUP + desc BTRUP + 10 + 10 + read-write + + + BTRDP + desc BTRDP + 11 + 11 + read-write + + + BENSPA + desc BENSPA + 16 + 16 + read-write + + + BSESPA + desc BSESPA + 17 + 17 + read-write + + + BTRUSPA + desc BTRUSPA + 18 + 18 + read-write + + + BTRDSPA + desc BTRDSPA + 19 + 19 + read-write + + + BENSPB + desc BENSPB + 20 + 20 + read-write + + + BSESPB + desc BSESPB + 21 + 21 + read-write + + + BTRUSPB + desc BTRUSPB + 22 + 22 + read-write + + + BTRDSPB + desc BTRDSPB + 23 + 23 + read-write + + + + + DCONR + desc DCONR + 0x14C + 32 + read-write + 0x0 + 0xF3 + + + DTCEN + desc DTCEN + 0 + 0 + read-write + + + SEPA + desc SEPA + 1 + 1 + read-write + + + DTBENU + desc DTBENU + 4 + 4 + read-write + + + DTBEND + desc DTBEND + 5 + 5 + read-write + + + DTBTRU + desc DTBTRU + 6 + 6 + read-write + + + DTBTRD + desc DTBTRD + 7 + 7 + read-write + + + + + PCNAR + desc PCNAR + 0x154 + 32 + read-write + 0x0 + 0x93F3FFFF + + + STACA + desc STACA + 1 + 0 + read-write + + + STPCA + desc STPCA + 3 + 2 + read-write + + + OVFCA + desc OVFCA + 5 + 4 + read-write + + + UDFCA + desc UDFCA + 7 + 6 + read-write + + + CMAUCA + desc CMAUCA + 9 + 8 + read-write + + + CMADCA + desc CMADCA + 11 + 10 + read-write + + + CMBUCA + desc CMBUCA + 13 + 12 + read-write + + + CMBDCA + desc CMBDCA + 15 + 14 + read-write + + + FORCA + desc FORCA + 17 + 16 + read-write + + + EMBCA + desc EMBCA + 21 + 20 + read-write + + + EMBRA + desc EMBRA + 23 + 22 + read-write + + + EMBSA + desc EMBSA + 25 + 24 + read-write + + + OUTENA + desc OUTENA + 28 + 28 + read-write + + + CAPMDA + desc CAPMDA + 31 + 31 + read-write + + + + + PCNBR + desc PCNBR + 0x158 + 32 + read-write + 0x0 + 0x93F3FFFF + + + STACB + desc STACB + 1 + 0 + read-write + + + STPCB + desc STPCB + 3 + 2 + read-write + + + OVFCB + desc OVFCB + 5 + 4 + read-write + + + UDFCB + desc UDFCB + 7 + 6 + read-write + + + CMAUCB + desc CMAUCB + 9 + 8 + read-write + + + CMADCB + desc CMADCB + 11 + 10 + read-write + + + CMBUCB + desc CMBUCB + 13 + 12 + read-write + + + CMBDCB + desc CMBDCB + 15 + 14 + read-write + + + FORCB + desc FORCB + 17 + 16 + read-write + + + EMBCB + desc EMBCB + 21 + 20 + read-write + + + EMBRB + desc EMBRB + 23 + 22 + read-write + + + EMBSB + desc EMBSB + 25 + 24 + read-write + + + OUTENB + desc OUTENB + 28 + 28 + read-write + + + CAPMDB + desc CAPMDB + 31 + 31 + read-write + + + + + FCNGR + desc FCNGR + 0x15C + 32 + read-write + 0x0 + 0x77 + + + NOFIENGA + desc NOFIENGA + 0 + 0 + read-write + + + NOFICKGA + desc NOFICKGA + 2 + 1 + read-write + + + NOFIENGB + desc NOFIENGB + 4 + 4 + read-write + + + NOFICKGB + desc NOFICKGB + 6 + 5 + read-write + + + + + VPERR + desc VPERR + 0x160 + 32 + read-write + 0x0 + 0x1F0300 + + + SPPERIA + desc SPPERIA + 8 + 8 + read-write + + + SPPERIB + desc SPPERIB + 9 + 9 + read-write + + + PCNTE + desc PCNTE + 17 + 16 + read-write + + + PCNTS + desc PCNTS + 20 + 18 + read-write + + + + + STFLR + desc STFLR + 0x164 + 32 + read-write + 0x80000000 + 0x80E01FFF + + + CMAF + desc CMAF + 0 + 0 + read-write + + + CMBF + desc CMBF + 1 + 1 + read-write + + + CMCF + desc CMCF + 2 + 2 + read-write + + + CMDF + desc CMDF + 3 + 3 + read-write + + + CMEF + desc CMEF + 4 + 4 + read-write + + + CMFF + desc CMFF + 5 + 5 + read-write + + + OVFF + desc OVFF + 6 + 6 + read-write + + + UDFF + desc UDFF + 7 + 7 + read-write + + + DTEF + desc DTEF + 8 + 8 + read-only + + + CMSAUF + desc CMSAUF + 9 + 9 + read-write + + + CMSADF + desc CMSADF + 10 + 10 + read-write + + + CMSBUF + desc CMSBUF + 11 + 11 + read-write + + + CMSBDF + desc CMSBDF + 12 + 12 + read-write + + + VPERNUM + desc VPERNUM + 23 + 21 + read-only + + + DIRF + desc DIRF + 31 + 31 + read-only + + + + + HSTAR + desc HSTAR + 0x180 + 32 + read-write + 0x0 + 0xFF0F8F + + + HSTA0 + desc HSTA0 + 0 + 0 + read-write + + + HSTA1 + desc HSTA1 + 1 + 1 + read-write + + + HSTA2 + desc HSTA2 + 2 + 2 + read-write + + + HSTA3 + desc HSTA3 + 3 + 3 + read-write + + + STAS + desc STAS + 7 + 7 + read-write + + + HSTA8 + desc HSTA8 + 8 + 8 + read-write + + + HSTA9 + desc HSTA9 + 9 + 9 + read-write + + + HSTA10 + desc HSTA10 + 10 + 10 + read-write + + + HSTA11 + desc HSTA11 + 11 + 11 + read-write + + + HSTA16 + desc HSTA16 + 16 + 16 + read-write + + + HSTA17 + desc HSTA17 + 17 + 17 + read-write + + + HSTA18 + desc HSTA18 + 18 + 18 + read-write + + + HSTA19 + desc HSTA19 + 19 + 19 + read-write + + + HSTA20 + desc HSTA20 + 20 + 20 + read-write + + + HSTA21 + desc HSTA21 + 21 + 21 + read-write + + + HSTA22 + desc HSTA22 + 22 + 22 + read-write + + + HSTA23 + desc HSTA23 + 23 + 23 + read-write + + + + + HSTPR + desc HSTPR + 0x184 + 32 + read-write + 0x0 + 0xFF0F8F + + + HSTP0 + desc HSTP0 + 0 + 0 + read-write + + + HSTP1 + desc HSTP1 + 1 + 1 + read-write + + + HSTP2 + desc HSTP2 + 2 + 2 + read-write + + + HSTP3 + desc HSTP3 + 3 + 3 + read-write + + + STPS + desc STPS + 7 + 7 + read-write + + + HSTP8 + desc HSTP8 + 8 + 8 + read-write + + + HSTP9 + desc HSTP9 + 9 + 9 + read-write + + + HSTP10 + desc HSTP10 + 10 + 10 + read-write + + + HSTP11 + desc HSTP11 + 11 + 11 + read-write + + + HSTP16 + desc HSTP16 + 16 + 16 + read-write + + + HSTP17 + desc HSTP17 + 17 + 17 + read-write + + + HSTP18 + desc HSTP18 + 18 + 18 + read-write + + + HSTP19 + desc HSTP19 + 19 + 19 + read-write + + + HSTP20 + desc HSTP20 + 20 + 20 + read-write + + + HSTP21 + desc HSTP21 + 21 + 21 + read-write + + + HSTP22 + desc HSTP22 + 22 + 22 + read-write + + + HSTP23 + desc HSTP23 + 23 + 23 + read-write + + + + + HCLRR + desc HCLRR + 0x188 + 32 + read-write + 0x0 + 0xFF0F8F + + + HCLE0 + desc HCLE0 + 0 + 0 + read-write + + + HCLE1 + desc HCLE1 + 1 + 1 + read-write + + + HCLE2 + desc HCLE2 + 2 + 2 + read-write + + + HCLE3 + desc HCLE3 + 3 + 3 + read-write + + + CLES + desc CLES + 7 + 7 + read-write + + + HCLE8 + desc HCLE8 + 8 + 8 + read-write + + + HCLE9 + desc HCLE9 + 9 + 9 + read-write + + + HCLE10 + desc HCLE10 + 10 + 10 + read-write + + + HCLE11 + desc HCLE11 + 11 + 11 + read-write + + + HCLE16 + desc HCLE16 + 16 + 16 + read-write + + + HCLE17 + desc HCLE17 + 17 + 17 + read-write + + + HCLE18 + desc HCLE18 + 18 + 18 + read-write + + + HCLE19 + desc HCLE19 + 19 + 19 + read-write + + + HCLE20 + desc HCLE20 + 20 + 20 + read-write + + + HCLE21 + desc HCLE21 + 21 + 21 + read-write + + + HCLE22 + desc HCLE22 + 22 + 22 + read-write + + + HCLE23 + desc HCLE23 + 23 + 23 + read-write + + + + + HUPDR + desc HUPDR + 0x18C + 32 + read-write + 0x0 + 0xFF0F8F + + + HUPD0 + desc HUPD0 + 0 + 0 + read-write + + + HUPD1 + desc HUPD1 + 1 + 1 + read-write + + + HUPD2 + desc HUPD2 + 2 + 2 + read-write + + + HUPD3 + desc HUPD3 + 3 + 3 + read-write + + + UPDS + desc UPDS + 7 + 7 + read-write + + + HUPD8 + desc HUPD8 + 8 + 8 + read-write + + + HUPD9 + desc HUPD9 + 9 + 9 + read-write + + + HUPD10 + desc HUPD10 + 10 + 10 + read-write + + + HUPD11 + desc HUPD11 + 11 + 11 + read-write + + + HUPD16 + desc HUPD16 + 16 + 16 + read-write + + + HUPD17 + desc HUPD17 + 17 + 17 + read-write + + + HUPD18 + desc HUPD18 + 18 + 18 + read-write + + + HUPD19 + desc HUPD19 + 19 + 19 + read-write + + + HUPD20 + desc HUPD20 + 20 + 20 + read-write + + + HUPD21 + desc HUPD21 + 21 + 21 + read-write + + + HUPD22 + desc HUPD22 + 22 + 22 + read-write + + + HUPD23 + desc HUPD23 + 23 + 23 + read-write + + + + + HCPAR + desc HCPAR + 0x190 + 32 + read-write + 0x0 + 0xFF0F0F + + + HCPA0 + desc HCPA0 + 0 + 0 + read-write + + + HCPA1 + desc HCPA1 + 1 + 1 + read-write + + + HCPA2 + desc HCPA2 + 2 + 2 + read-write + + + HCPA3 + desc HCPA3 + 3 + 3 + read-write + + + HCPA8 + desc HCPA8 + 8 + 8 + read-write + + + HCPA9 + desc HCPA9 + 9 + 9 + read-write + + + HCPA10 + desc HCPA10 + 10 + 10 + read-write + + + HCPA11 + desc HCPA11 + 11 + 11 + read-write + + + HCPA16 + desc HCPA16 + 16 + 16 + read-write + + + HCPA17 + desc HCPA17 + 17 + 17 + read-write + + + HCPA18 + desc HCPA18 + 18 + 18 + read-write + + + HCPA19 + desc HCPA19 + 19 + 19 + read-write + + + HCPA20 + desc HCPA20 + 20 + 20 + read-write + + + HCPA21 + desc HCPA21 + 21 + 21 + read-write + + + HCPA22 + desc HCPA22 + 22 + 22 + read-write + + + HCPA23 + desc HCPA23 + 23 + 23 + read-write + + + + + HCPBR + desc HCPBR + 0x194 + 32 + read-write + 0x0 + 0xFF0F0F + + + HCPB0 + desc HCPB0 + 0 + 0 + read-write + + + HCPB1 + desc HCPB1 + 1 + 1 + read-write + + + HCPB2 + desc HCPB2 + 2 + 2 + read-write + + + HCPB3 + desc HCPB3 + 3 + 3 + read-write + + + HCPB8 + desc HCPB8 + 8 + 8 + read-write + + + HCPB9 + desc HCPB9 + 9 + 9 + read-write + + + HCPB10 + desc HCPB10 + 10 + 10 + read-write + + + HCPB11 + desc HCPB11 + 11 + 11 + read-write + + + HCPB16 + desc HCPB16 + 16 + 16 + read-write + + + HCPB17 + desc HCPB17 + 17 + 17 + read-write + + + HCPB18 + desc HCPB18 + 18 + 18 + read-write + + + HCPB19 + desc HCPB19 + 19 + 19 + read-write + + + HCPB20 + desc HCPB20 + 20 + 20 + read-write + + + HCPB21 + desc HCPB21 + 21 + 21 + read-write + + + HCPB22 + desc HCPB22 + 22 + 22 + read-write + + + HCPB23 + desc HCPB23 + 23 + 23 + read-write + + + + + HCUPR + desc HCUPR + 0x198 + 32 + read-write + 0x0 + 0xFF0FFF + + + HCUP0 + desc HCUP0 + 0 + 0 + read-write + + + HCUP1 + desc HCUP1 + 1 + 1 + read-write + + + HCUP2 + desc HCUP2 + 2 + 2 + read-write + + + HCUP3 + desc HCUP3 + 3 + 3 + read-write + + + HCUP4 + desc HCUP4 + 4 + 4 + read-write + + + HCUP5 + desc HCUP5 + 5 + 5 + read-write + + + HCUP6 + desc HCUP6 + 6 + 6 + read-write + + + HCUP7 + desc HCUP7 + 7 + 7 + read-write + + + HCUP8 + desc HCUP8 + 8 + 8 + read-write + + + HCUP9 + desc HCUP9 + 9 + 9 + read-write + + + HCUP10 + desc HCUP10 + 10 + 10 + read-write + + + HCUP11 + desc HCUP11 + 11 + 11 + read-write + + + HCUP16 + desc HCUP16 + 16 + 16 + read-write + + + HCUP17 + desc HCUP17 + 17 + 17 + read-write + + + HCUP18 + desc HCUP18 + 18 + 18 + read-write + + + HCUP19 + desc HCUP19 + 19 + 19 + read-write + + + HCUP20 + desc HCUP20 + 20 + 20 + read-write + + + HCUP21 + desc HCUP21 + 21 + 21 + read-write + + + HCUP22 + desc HCUP22 + 22 + 22 + read-write + + + HCUP23 + desc HCUP23 + 23 + 23 + read-write + + + + + HCDOR + desc HCDOR + 0x19C + 32 + read-write + 0x0 + 0xFF0FFF + + + HCDO0 + desc HCDO0 + 0 + 0 + read-write + + + HCDO1 + desc HCDO1 + 1 + 1 + read-write + + + HCDO2 + desc HCDO2 + 2 + 2 + read-write + + + HCDO3 + desc HCDO3 + 3 + 3 + read-write + + + HCDO4 + desc HCDO4 + 4 + 4 + read-write + + + HCDO5 + desc HCDO5 + 5 + 5 + read-write + + + HCDO6 + desc HCDO6 + 6 + 6 + read-write + + + HCDO7 + desc HCDO7 + 7 + 7 + read-write + + + HCDO8 + desc HCDO8 + 8 + 8 + read-write + + + HCDO9 + desc HCDO9 + 9 + 9 + read-write + + + HCDO10 + desc HCDO10 + 10 + 10 + read-write + + + HCDO11 + desc HCDO11 + 11 + 11 + read-write + + + HCDO16 + desc HCDO16 + 16 + 16 + read-write + + + HCDO17 + desc HCDO17 + 17 + 17 + read-write + + + HCDO18 + desc HCDO18 + 18 + 18 + read-write + + + HCDO19 + desc HCDO19 + 19 + 19 + read-write + + + HCDO20 + desc HCDO20 + 20 + 20 + read-write + + + HCDO21 + desc HCDO21 + 21 + 21 + read-write + + + HCDO22 + desc HCDO22 + 22 + 22 + read-write + + + HCDO23 + desc HCDO23 + 23 + 23 + read-write + + + + + + + TMR63 + desc TMR63 + 0x40018800 + + 0x0 + 0x1A0 + + + + CNTER + desc CNTER + 0x0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + UPDAR + desc UPDAR + 0x4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + PERAR + desc PERAR + 0x40 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + PERBR + desc PERBR + 0x44 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + PERCR + desc PERCR + 0x48 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMAR + desc GCMAR + 0x80 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMBR + desc GCMBR + 0x84 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMCR + desc GCMCR + 0x88 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMDR + desc GCMDR + 0x8C + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMER + desc GCMER + 0x90 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMFR + desc GCMFR + 0x94 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMAR + desc SCMAR + 0xC0 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMBR + desc SCMBR + 0xC4 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMCR + desc SCMCR + 0xC8 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMDR + desc SCMDR + 0xCC + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMER + desc SCMER + 0xD0 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMFR + desc SCMFR + 0xD4 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + DTUAR + desc DTUAR + 0x100 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + DTDAR + desc DTDAR + 0x104 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + DTUBR + desc DTUBR + 0x108 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + DTDBR + desc DTDBR + 0x10C + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCONR + desc GCONR + 0x140 + 32 + read-write + 0x2 + 0xF01F7 + + + START + desc START + 0 + 0 + read-write + + + DIR + desc DIR + 1 + 1 + read-write + + + MODE + desc MODE + 2 + 2 + read-write + + + CKDIV + desc CKDIV + 7 + 4 + read-write + + + OVSTP + desc OVSTP + 8 + 8 + read-write + + + ZMSKREV + desc ZMSKREV + 16 + 16 + read-write + + + ZMSKPOS + desc ZMSKPOS + 17 + 17 + read-write + + + ZMSKVAL + desc ZMSKVAL + 19 + 18 + read-write + + + + + ICONR + desc ICONR + 0x144 + 32 + read-write + 0x0 + 0xF01FF + + + INTENA + desc INTENA + 0 + 0 + read-write + + + INTENB + desc INTENB + 1 + 1 + read-write + + + INTENC + desc INTENC + 2 + 2 + read-write + + + INTEND + desc INTEND + 3 + 3 + read-write + + + INTENE + desc INTENE + 4 + 4 + read-write + + + INTENF + desc INTENF + 5 + 5 + read-write + + + INTENOVF + desc INTENOVF + 6 + 6 + read-write + + + INTENUDF + desc INTENUDF + 7 + 7 + read-write + + + INTENDTE + desc INTENDTE + 8 + 8 + read-write + + + INTENSAU + desc INTENSAU + 16 + 16 + read-write + + + INTENSAD + desc INTENSAD + 17 + 17 + read-write + + + INTENSBU + desc INTENSBU + 18 + 18 + read-write + + + INTENSBD + desc INTENSBD + 19 + 19 + read-write + + + + + BCONR + desc BCONR + 0x148 + 32 + read-write + 0x0 + 0xFF0FFF + + + BENA + desc BENA + 0 + 0 + read-write + + + BSEA + desc BSEA + 1 + 1 + read-write + + + BTRUA + desc BTRUA + 2 + 2 + read-write + + + BTRDA + desc BTRDA + 3 + 3 + read-write + + + BENB + desc BENB + 4 + 4 + read-write + + + BSEB + desc BSEB + 5 + 5 + read-write + + + BTRUB + desc BTRUB + 6 + 6 + read-write + + + BTRDB + desc BTRDB + 7 + 7 + read-write + + + BENP + desc BENP + 8 + 8 + read-write + + + BSEP + desc BSEP + 9 + 9 + read-write + + + BTRUP + desc BTRUP + 10 + 10 + read-write + + + BTRDP + desc BTRDP + 11 + 11 + read-write + + + BENSPA + desc BENSPA + 16 + 16 + read-write + + + BSESPA + desc BSESPA + 17 + 17 + read-write + + + BTRUSPA + desc BTRUSPA + 18 + 18 + read-write + + + BTRDSPA + desc BTRDSPA + 19 + 19 + read-write + + + BENSPB + desc BENSPB + 20 + 20 + read-write + + + BSESPB + desc BSESPB + 21 + 21 + read-write + + + BTRUSPB + desc BTRUSPB + 22 + 22 + read-write + + + BTRDSPB + desc BTRDSPB + 23 + 23 + read-write + + + + + DCONR + desc DCONR + 0x14C + 32 + read-write + 0x0 + 0xF3 + + + DTCEN + desc DTCEN + 0 + 0 + read-write + + + SEPA + desc SEPA + 1 + 1 + read-write + + + DTBENU + desc DTBENU + 4 + 4 + read-write + + + DTBEND + desc DTBEND + 5 + 5 + read-write + + + DTBTRU + desc DTBTRU + 6 + 6 + read-write + + + DTBTRD + desc DTBTRD + 7 + 7 + read-write + + + + + PCNAR + desc PCNAR + 0x154 + 32 + read-write + 0x0 + 0x93F3FFFF + + + STACA + desc STACA + 1 + 0 + read-write + + + STPCA + desc STPCA + 3 + 2 + read-write + + + OVFCA + desc OVFCA + 5 + 4 + read-write + + + UDFCA + desc UDFCA + 7 + 6 + read-write + + + CMAUCA + desc CMAUCA + 9 + 8 + read-write + + + CMADCA + desc CMADCA + 11 + 10 + read-write + + + CMBUCA + desc CMBUCA + 13 + 12 + read-write + + + CMBDCA + desc CMBDCA + 15 + 14 + read-write + + + FORCA + desc FORCA + 17 + 16 + read-write + + + EMBCA + desc EMBCA + 21 + 20 + read-write + + + EMBRA + desc EMBRA + 23 + 22 + read-write + + + EMBSA + desc EMBSA + 25 + 24 + read-write + + + OUTENA + desc OUTENA + 28 + 28 + read-write + + + CAPMDA + desc CAPMDA + 31 + 31 + read-write + + + + + PCNBR + desc PCNBR + 0x158 + 32 + read-write + 0x0 + 0x93F3FFFF + + + STACB + desc STACB + 1 + 0 + read-write + + + STPCB + desc STPCB + 3 + 2 + read-write + + + OVFCB + desc OVFCB + 5 + 4 + read-write + + + UDFCB + desc UDFCB + 7 + 6 + read-write + + + CMAUCB + desc CMAUCB + 9 + 8 + read-write + + + CMADCB + desc CMADCB + 11 + 10 + read-write + + + CMBUCB + desc CMBUCB + 13 + 12 + read-write + + + CMBDCB + desc CMBDCB + 15 + 14 + read-write + + + FORCB + desc FORCB + 17 + 16 + read-write + + + EMBCB + desc EMBCB + 21 + 20 + read-write + + + EMBRB + desc EMBRB + 23 + 22 + read-write + + + EMBSB + desc EMBSB + 25 + 24 + read-write + + + OUTENB + desc OUTENB + 28 + 28 + read-write + + + CAPMDB + desc CAPMDB + 31 + 31 + read-write + + + + + FCNGR + desc FCNGR + 0x15C + 32 + read-write + 0x0 + 0x77 + + + NOFIENGA + desc NOFIENGA + 0 + 0 + read-write + + + NOFICKGA + desc NOFICKGA + 2 + 1 + read-write + + + NOFIENGB + desc NOFIENGB + 4 + 4 + read-write + + + NOFICKGB + desc NOFICKGB + 6 + 5 + read-write + + + + + VPERR + desc VPERR + 0x160 + 32 + read-write + 0x0 + 0x1F0300 + + + SPPERIA + desc SPPERIA + 8 + 8 + read-write + + + SPPERIB + desc SPPERIB + 9 + 9 + read-write + + + PCNTE + desc PCNTE + 17 + 16 + read-write + + + PCNTS + desc PCNTS + 20 + 18 + read-write + + + + + STFLR + desc STFLR + 0x164 + 32 + read-write + 0x80000000 + 0x80E01FFF + + + CMAF + desc CMAF + 0 + 0 + read-write + + + CMBF + desc CMBF + 1 + 1 + read-write + + + CMCF + desc CMCF + 2 + 2 + read-write + + + CMDF + desc CMDF + 3 + 3 + read-write + + + CMEF + desc CMEF + 4 + 4 + read-write + + + CMFF + desc CMFF + 5 + 5 + read-write + + + OVFF + desc OVFF + 6 + 6 + read-write + + + UDFF + desc UDFF + 7 + 7 + read-write + + + DTEF + desc DTEF + 8 + 8 + read-only + + + CMSAUF + desc CMSAUF + 9 + 9 + read-write + + + CMSADF + desc CMSADF + 10 + 10 + read-write + + + CMSBUF + desc CMSBUF + 11 + 11 + read-write + + + CMSBDF + desc CMSBDF + 12 + 12 + read-write + + + VPERNUM + desc VPERNUM + 23 + 21 + read-only + + + DIRF + desc DIRF + 31 + 31 + read-only + + + + + HSTAR + desc HSTAR + 0x180 + 32 + read-write + 0x0 + 0xFF0F8F + + + HSTA0 + desc HSTA0 + 0 + 0 + read-write + + + HSTA1 + desc HSTA1 + 1 + 1 + read-write + + + HSTA2 + desc HSTA2 + 2 + 2 + read-write + + + HSTA3 + desc HSTA3 + 3 + 3 + read-write + + + STAS + desc STAS + 7 + 7 + read-write + + + HSTA8 + desc HSTA8 + 8 + 8 + read-write + + + HSTA9 + desc HSTA9 + 9 + 9 + read-write + + + HSTA10 + desc HSTA10 + 10 + 10 + read-write + + + HSTA11 + desc HSTA11 + 11 + 11 + read-write + + + HSTA16 + desc HSTA16 + 16 + 16 + read-write + + + HSTA17 + desc HSTA17 + 17 + 17 + read-write + + + HSTA18 + desc HSTA18 + 18 + 18 + read-write + + + HSTA19 + desc HSTA19 + 19 + 19 + read-write + + + HSTA20 + desc HSTA20 + 20 + 20 + read-write + + + HSTA21 + desc HSTA21 + 21 + 21 + read-write + + + HSTA22 + desc HSTA22 + 22 + 22 + read-write + + + HSTA23 + desc HSTA23 + 23 + 23 + read-write + + + + + HSTPR + desc HSTPR + 0x184 + 32 + read-write + 0x0 + 0xFF0F8F + + + HSTP0 + desc HSTP0 + 0 + 0 + read-write + + + HSTP1 + desc HSTP1 + 1 + 1 + read-write + + + HSTP2 + desc HSTP2 + 2 + 2 + read-write + + + HSTP3 + desc HSTP3 + 3 + 3 + read-write + + + STPS + desc STPS + 7 + 7 + read-write + + + HSTP8 + desc HSTP8 + 8 + 8 + read-write + + + HSTP9 + desc HSTP9 + 9 + 9 + read-write + + + HSTP10 + desc HSTP10 + 10 + 10 + read-write + + + HSTP11 + desc HSTP11 + 11 + 11 + read-write + + + HSTP16 + desc HSTP16 + 16 + 16 + read-write + + + HSTP17 + desc HSTP17 + 17 + 17 + read-write + + + HSTP18 + desc HSTP18 + 18 + 18 + read-write + + + HSTP19 + desc HSTP19 + 19 + 19 + read-write + + + HSTP20 + desc HSTP20 + 20 + 20 + read-write + + + HSTP21 + desc HSTP21 + 21 + 21 + read-write + + + HSTP22 + desc HSTP22 + 22 + 22 + read-write + + + HSTP23 + desc HSTP23 + 23 + 23 + read-write + + + + + HCLRR + desc HCLRR + 0x188 + 32 + read-write + 0x0 + 0xFF0F8F + + + HCLE0 + desc HCLE0 + 0 + 0 + read-write + + + HCLE1 + desc HCLE1 + 1 + 1 + read-write + + + HCLE2 + desc HCLE2 + 2 + 2 + read-write + + + HCLE3 + desc HCLE3 + 3 + 3 + read-write + + + CLES + desc CLES + 7 + 7 + read-write + + + HCLE8 + desc HCLE8 + 8 + 8 + read-write + + + HCLE9 + desc HCLE9 + 9 + 9 + read-write + + + HCLE10 + desc HCLE10 + 10 + 10 + read-write + + + HCLE11 + desc HCLE11 + 11 + 11 + read-write + + + HCLE16 + desc HCLE16 + 16 + 16 + read-write + + + HCLE17 + desc HCLE17 + 17 + 17 + read-write + + + HCLE18 + desc HCLE18 + 18 + 18 + read-write + + + HCLE19 + desc HCLE19 + 19 + 19 + read-write + + + HCLE20 + desc HCLE20 + 20 + 20 + read-write + + + HCLE21 + desc HCLE21 + 21 + 21 + read-write + + + HCLE22 + desc HCLE22 + 22 + 22 + read-write + + + HCLE23 + desc HCLE23 + 23 + 23 + read-write + + + + + HUPDR + desc HUPDR + 0x18C + 32 + read-write + 0x0 + 0xFF0F8F + + + HUPD0 + desc HUPD0 + 0 + 0 + read-write + + + HUPD1 + desc HUPD1 + 1 + 1 + read-write + + + HUPD2 + desc HUPD2 + 2 + 2 + read-write + + + HUPD3 + desc HUPD3 + 3 + 3 + read-write + + + UPDS + desc UPDS + 7 + 7 + read-write + + + HUPD8 + desc HUPD8 + 8 + 8 + read-write + + + HUPD9 + desc HUPD9 + 9 + 9 + read-write + + + HUPD10 + desc HUPD10 + 10 + 10 + read-write + + + HUPD11 + desc HUPD11 + 11 + 11 + read-write + + + HUPD16 + desc HUPD16 + 16 + 16 + read-write + + + HUPD17 + desc HUPD17 + 17 + 17 + read-write + + + HUPD18 + desc HUPD18 + 18 + 18 + read-write + + + HUPD19 + desc HUPD19 + 19 + 19 + read-write + + + HUPD20 + desc HUPD20 + 20 + 20 + read-write + + + HUPD21 + desc HUPD21 + 21 + 21 + read-write + + + HUPD22 + desc HUPD22 + 22 + 22 + read-write + + + HUPD23 + desc HUPD23 + 23 + 23 + read-write + + + + + HCPAR + desc HCPAR + 0x190 + 32 + read-write + 0x0 + 0xFF0F0F + + + HCPA0 + desc HCPA0 + 0 + 0 + read-write + + + HCPA1 + desc HCPA1 + 1 + 1 + read-write + + + HCPA2 + desc HCPA2 + 2 + 2 + read-write + + + HCPA3 + desc HCPA3 + 3 + 3 + read-write + + + HCPA8 + desc HCPA8 + 8 + 8 + read-write + + + HCPA9 + desc HCPA9 + 9 + 9 + read-write + + + HCPA10 + desc HCPA10 + 10 + 10 + read-write + + + HCPA11 + desc HCPA11 + 11 + 11 + read-write + + + HCPA16 + desc HCPA16 + 16 + 16 + read-write + + + HCPA17 + desc HCPA17 + 17 + 17 + read-write + + + HCPA18 + desc HCPA18 + 18 + 18 + read-write + + + HCPA19 + desc HCPA19 + 19 + 19 + read-write + + + HCPA20 + desc HCPA20 + 20 + 20 + read-write + + + HCPA21 + desc HCPA21 + 21 + 21 + read-write + + + HCPA22 + desc HCPA22 + 22 + 22 + read-write + + + HCPA23 + desc HCPA23 + 23 + 23 + read-write + + + + + HCPBR + desc HCPBR + 0x194 + 32 + read-write + 0x0 + 0xFF0F0F + + + HCPB0 + desc HCPB0 + 0 + 0 + read-write + + + HCPB1 + desc HCPB1 + 1 + 1 + read-write + + + HCPB2 + desc HCPB2 + 2 + 2 + read-write + + + HCPB3 + desc HCPB3 + 3 + 3 + read-write + + + HCPB8 + desc HCPB8 + 8 + 8 + read-write + + + HCPB9 + desc HCPB9 + 9 + 9 + read-write + + + HCPB10 + desc HCPB10 + 10 + 10 + read-write + + + HCPB11 + desc HCPB11 + 11 + 11 + read-write + + + HCPB16 + desc HCPB16 + 16 + 16 + read-write + + + HCPB17 + desc HCPB17 + 17 + 17 + read-write + + + HCPB18 + desc HCPB18 + 18 + 18 + read-write + + + HCPB19 + desc HCPB19 + 19 + 19 + read-write + + + HCPB20 + desc HCPB20 + 20 + 20 + read-write + + + HCPB21 + desc HCPB21 + 21 + 21 + read-write + + + HCPB22 + desc HCPB22 + 22 + 22 + read-write + + + HCPB23 + desc HCPB23 + 23 + 23 + read-write + + + + + HCUPR + desc HCUPR + 0x198 + 32 + read-write + 0x0 + 0xFF0FFF + + + HCUP0 + desc HCUP0 + 0 + 0 + read-write + + + HCUP1 + desc HCUP1 + 1 + 1 + read-write + + + HCUP2 + desc HCUP2 + 2 + 2 + read-write + + + HCUP3 + desc HCUP3 + 3 + 3 + read-write + + + HCUP4 + desc HCUP4 + 4 + 4 + read-write + + + HCUP5 + desc HCUP5 + 5 + 5 + read-write + + + HCUP6 + desc HCUP6 + 6 + 6 + read-write + + + HCUP7 + desc HCUP7 + 7 + 7 + read-write + + + HCUP8 + desc HCUP8 + 8 + 8 + read-write + + + HCUP9 + desc HCUP9 + 9 + 9 + read-write + + + HCUP10 + desc HCUP10 + 10 + 10 + read-write + + + HCUP11 + desc HCUP11 + 11 + 11 + read-write + + + HCUP16 + desc HCUP16 + 16 + 16 + read-write + + + HCUP17 + desc HCUP17 + 17 + 17 + read-write + + + HCUP18 + desc HCUP18 + 18 + 18 + read-write + + + HCUP19 + desc HCUP19 + 19 + 19 + read-write + + + HCUP20 + desc HCUP20 + 20 + 20 + read-write + + + HCUP21 + desc HCUP21 + 21 + 21 + read-write + + + HCUP22 + desc HCUP22 + 22 + 22 + read-write + + + HCUP23 + desc HCUP23 + 23 + 23 + read-write + + + + + HCDOR + desc HCDOR + 0x19C + 32 + read-write + 0x0 + 0xFF0FFF + + + HCDO0 + desc HCDO0 + 0 + 0 + read-write + + + HCDO1 + desc HCDO1 + 1 + 1 + read-write + + + HCDO2 + desc HCDO2 + 2 + 2 + read-write + + + HCDO3 + desc HCDO3 + 3 + 3 + read-write + + + HCDO4 + desc HCDO4 + 4 + 4 + read-write + + + HCDO5 + desc HCDO5 + 5 + 5 + read-write + + + HCDO6 + desc HCDO6 + 6 + 6 + read-write + + + HCDO7 + desc HCDO7 + 7 + 7 + read-write + + + HCDO8 + desc HCDO8 + 8 + 8 + read-write + + + HCDO9 + desc HCDO9 + 9 + 9 + read-write + + + HCDO10 + desc HCDO10 + 10 + 10 + read-write + + + HCDO11 + desc HCDO11 + 11 + 11 + read-write + + + HCDO16 + desc HCDO16 + 16 + 16 + read-write + + + HCDO17 + desc HCDO17 + 17 + 17 + read-write + + + HCDO18 + desc HCDO18 + 18 + 18 + read-write + + + HCDO19 + desc HCDO19 + 19 + 19 + read-write + + + HCDO20 + desc HCDO20 + 20 + 20 + read-write + + + HCDO21 + desc HCDO21 + 21 + 21 + read-write + + + HCDO22 + desc HCDO22 + 22 + 22 + read-write + + + HCDO23 + desc HCDO23 + 23 + 23 + read-write + + + + + + + TMR64 + desc TMR64 + 0x40018C00 + + 0x0 + 0x1A0 + + + + CNTER + desc CNTER + 0x0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + UPDAR + desc UPDAR + 0x4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + PERAR + desc PERAR + 0x40 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + PERBR + desc PERBR + 0x44 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + PERCR + desc PERCR + 0x48 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMAR + desc GCMAR + 0x80 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMBR + desc GCMBR + 0x84 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMCR + desc GCMCR + 0x88 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMDR + desc GCMDR + 0x8C + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMER + desc GCMER + 0x90 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCMFR + desc GCMFR + 0x94 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMAR + desc SCMAR + 0xC0 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMBR + desc SCMBR + 0xC4 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMCR + desc SCMCR + 0xC8 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMDR + desc SCMDR + 0xCC + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMER + desc SCMER + 0xD0 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + SCMFR + desc SCMFR + 0xD4 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + DTUAR + desc DTUAR + 0x100 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + DTDAR + desc DTDAR + 0x104 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + DTUBR + desc DTUBR + 0x108 + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + DTDBR + desc DTDBR + 0x10C + 32 + read-write + 0xFFFFFFFF + 0xFFFFFFFF + + + GCONR + desc GCONR + 0x140 + 32 + read-write + 0x2 + 0xF01F7 + + + START + desc START + 0 + 0 + read-write + + + DIR + desc DIR + 1 + 1 + read-write + + + MODE + desc MODE + 2 + 2 + read-write + + + CKDIV + desc CKDIV + 7 + 4 + read-write + + + OVSTP + desc OVSTP + 8 + 8 + read-write + + + ZMSKREV + desc ZMSKREV + 16 + 16 + read-write + + + ZMSKPOS + desc ZMSKPOS + 17 + 17 + read-write + + + ZMSKVAL + desc ZMSKVAL + 19 + 18 + read-write + + + + + ICONR + desc ICONR + 0x144 + 32 + read-write + 0x0 + 0xF01FF + + + INTENA + desc INTENA + 0 + 0 + read-write + + + INTENB + desc INTENB + 1 + 1 + read-write + + + INTENC + desc INTENC + 2 + 2 + read-write + + + INTEND + desc INTEND + 3 + 3 + read-write + + + INTENE + desc INTENE + 4 + 4 + read-write + + + INTENF + desc INTENF + 5 + 5 + read-write + + + INTENOVF + desc INTENOVF + 6 + 6 + read-write + + + INTENUDF + desc INTENUDF + 7 + 7 + read-write + + + INTENDTE + desc INTENDTE + 8 + 8 + read-write + + + INTENSAU + desc INTENSAU + 16 + 16 + read-write + + + INTENSAD + desc INTENSAD + 17 + 17 + read-write + + + INTENSBU + desc INTENSBU + 18 + 18 + read-write + + + INTENSBD + desc INTENSBD + 19 + 19 + read-write + + + + + BCONR + desc BCONR + 0x148 + 32 + read-write + 0x0 + 0xFF0FFF + + + BENA + desc BENA + 0 + 0 + read-write + + + BSEA + desc BSEA + 1 + 1 + read-write + + + BTRUA + desc BTRUA + 2 + 2 + read-write + + + BTRDA + desc BTRDA + 3 + 3 + read-write + + + BENB + desc BENB + 4 + 4 + read-write + + + BSEB + desc BSEB + 5 + 5 + read-write + + + BTRUB + desc BTRUB + 6 + 6 + read-write + + + BTRDB + desc BTRDB + 7 + 7 + read-write + + + BENP + desc BENP + 8 + 8 + read-write + + + BSEP + desc BSEP + 9 + 9 + read-write + + + BTRUP + desc BTRUP + 10 + 10 + read-write + + + BTRDP + desc BTRDP + 11 + 11 + read-write + + + BENSPA + desc BENSPA + 16 + 16 + read-write + + + BSESPA + desc BSESPA + 17 + 17 + read-write + + + BTRUSPA + desc BTRUSPA + 18 + 18 + read-write + + + BTRDSPA + desc BTRDSPA + 19 + 19 + read-write + + + BENSPB + desc BENSPB + 20 + 20 + read-write + + + BSESPB + desc BSESPB + 21 + 21 + read-write + + + BTRUSPB + desc BTRUSPB + 22 + 22 + read-write + + + BTRDSPB + desc BTRDSPB + 23 + 23 + read-write + + + + + DCONR + desc DCONR + 0x14C + 32 + read-write + 0x0 + 0xF3 + + + DTCEN + desc DTCEN + 0 + 0 + read-write + + + SEPA + desc SEPA + 1 + 1 + read-write + + + DTBENU + desc DTBENU + 4 + 4 + read-write + + + DTBEND + desc DTBEND + 5 + 5 + read-write + + + DTBTRU + desc DTBTRU + 6 + 6 + read-write + + + DTBTRD + desc DTBTRD + 7 + 7 + read-write + + + + + PCNAR + desc PCNAR + 0x154 + 32 + read-write + 0x0 + 0x93F3FFFF + + + STACA + desc STACA + 1 + 0 + read-write + + + STPCA + desc STPCA + 3 + 2 + read-write + + + OVFCA + desc OVFCA + 5 + 4 + read-write + + + UDFCA + desc UDFCA + 7 + 6 + read-write + + + CMAUCA + desc CMAUCA + 9 + 8 + read-write + + + CMADCA + desc CMADCA + 11 + 10 + read-write + + + CMBUCA + desc CMBUCA + 13 + 12 + read-write + + + CMBDCA + desc CMBDCA + 15 + 14 + read-write + + + FORCA + desc FORCA + 17 + 16 + read-write + + + EMBCA + desc EMBCA + 21 + 20 + read-write + + + EMBRA + desc EMBRA + 23 + 22 + read-write + + + EMBSA + desc EMBSA + 25 + 24 + read-write + + + OUTENA + desc OUTENA + 28 + 28 + read-write + + + CAPMDA + desc CAPMDA + 31 + 31 + read-write + + + + + PCNBR + desc PCNBR + 0x158 + 32 + read-write + 0x0 + 0x93F3FFFF + + + STACB + desc STACB + 1 + 0 + read-write + + + STPCB + desc STPCB + 3 + 2 + read-write + + + OVFCB + desc OVFCB + 5 + 4 + read-write + + + UDFCB + desc UDFCB + 7 + 6 + read-write + + + CMAUCB + desc CMAUCB + 9 + 8 + read-write + + + CMADCB + desc CMADCB + 11 + 10 + read-write + + + CMBUCB + desc CMBUCB + 13 + 12 + read-write + + + CMBDCB + desc CMBDCB + 15 + 14 + read-write + + + FORCB + desc FORCB + 17 + 16 + read-write + + + EMBCB + desc EMBCB + 21 + 20 + read-write + + + EMBRB + desc EMBRB + 23 + 22 + read-write + + + EMBSB + desc EMBSB + 25 + 24 + read-write + + + OUTENB + desc OUTENB + 28 + 28 + read-write + + + CAPMDB + desc CAPMDB + 31 + 31 + read-write + + + + + FCNGR + desc FCNGR + 0x15C + 32 + read-write + 0x0 + 0x77 + + + NOFIENGA + desc NOFIENGA + 0 + 0 + read-write + + + NOFICKGA + desc NOFICKGA + 2 + 1 + read-write + + + NOFIENGB + desc NOFIENGB + 4 + 4 + read-write + + + NOFICKGB + desc NOFICKGB + 6 + 5 + read-write + + + + + VPERR + desc VPERR + 0x160 + 32 + read-write + 0x0 + 0x1F0300 + + + SPPERIA + desc SPPERIA + 8 + 8 + read-write + + + SPPERIB + desc SPPERIB + 9 + 9 + read-write + + + PCNTE + desc PCNTE + 17 + 16 + read-write + + + PCNTS + desc PCNTS + 20 + 18 + read-write + + + + + STFLR + desc STFLR + 0x164 + 32 + read-write + 0x80000000 + 0x80E01FFF + + + CMAF + desc CMAF + 0 + 0 + read-write + + + CMBF + desc CMBF + 1 + 1 + read-write + + + CMCF + desc CMCF + 2 + 2 + read-write + + + CMDF + desc CMDF + 3 + 3 + read-write + + + CMEF + desc CMEF + 4 + 4 + read-write + + + CMFF + desc CMFF + 5 + 5 + read-write + + + OVFF + desc OVFF + 6 + 6 + read-write + + + UDFF + desc UDFF + 7 + 7 + read-write + + + DTEF + desc DTEF + 8 + 8 + read-only + + + CMSAUF + desc CMSAUF + 9 + 9 + read-write + + + CMSADF + desc CMSADF + 10 + 10 + read-write + + + CMSBUF + desc CMSBUF + 11 + 11 + read-write + + + CMSBDF + desc CMSBDF + 12 + 12 + read-write + + + VPERNUM + desc VPERNUM + 23 + 21 + read-only + + + DIRF + desc DIRF + 31 + 31 + read-only + + + + + HSTAR + desc HSTAR + 0x180 + 32 + read-write + 0x0 + 0xFF0F8F + + + HSTA0 + desc HSTA0 + 0 + 0 + read-write + + + HSTA1 + desc HSTA1 + 1 + 1 + read-write + + + HSTA2 + desc HSTA2 + 2 + 2 + read-write + + + HSTA3 + desc HSTA3 + 3 + 3 + read-write + + + STAS + desc STAS + 7 + 7 + read-write + + + HSTA8 + desc HSTA8 + 8 + 8 + read-write + + + HSTA9 + desc HSTA9 + 9 + 9 + read-write + + + HSTA10 + desc HSTA10 + 10 + 10 + read-write + + + HSTA11 + desc HSTA11 + 11 + 11 + read-write + + + HSTA16 + desc HSTA16 + 16 + 16 + read-write + + + HSTA17 + desc HSTA17 + 17 + 17 + read-write + + + HSTA18 + desc HSTA18 + 18 + 18 + read-write + + + HSTA19 + desc HSTA19 + 19 + 19 + read-write + + + HSTA20 + desc HSTA20 + 20 + 20 + read-write + + + HSTA21 + desc HSTA21 + 21 + 21 + read-write + + + HSTA22 + desc HSTA22 + 22 + 22 + read-write + + + HSTA23 + desc HSTA23 + 23 + 23 + read-write + + + + + HSTPR + desc HSTPR + 0x184 + 32 + read-write + 0x0 + 0xFF0F8F + + + HSTP0 + desc HSTP0 + 0 + 0 + read-write + + + HSTP1 + desc HSTP1 + 1 + 1 + read-write + + + HSTP2 + desc HSTP2 + 2 + 2 + read-write + + + HSTP3 + desc HSTP3 + 3 + 3 + read-write + + + STPS + desc STPS + 7 + 7 + read-write + + + HSTP8 + desc HSTP8 + 8 + 8 + read-write + + + HSTP9 + desc HSTP9 + 9 + 9 + read-write + + + HSTP10 + desc HSTP10 + 10 + 10 + read-write + + + HSTP11 + desc HSTP11 + 11 + 11 + read-write + + + HSTP16 + desc HSTP16 + 16 + 16 + read-write + + + HSTP17 + desc HSTP17 + 17 + 17 + read-write + + + HSTP18 + desc HSTP18 + 18 + 18 + read-write + + + HSTP19 + desc HSTP19 + 19 + 19 + read-write + + + HSTP20 + desc HSTP20 + 20 + 20 + read-write + + + HSTP21 + desc HSTP21 + 21 + 21 + read-write + + + HSTP22 + desc HSTP22 + 22 + 22 + read-write + + + HSTP23 + desc HSTP23 + 23 + 23 + read-write + + + + + HCLRR + desc HCLRR + 0x188 + 32 + read-write + 0x0 + 0xFF0F8F + + + HCLE0 + desc HCLE0 + 0 + 0 + read-write + + + HCLE1 + desc HCLE1 + 1 + 1 + read-write + + + HCLE2 + desc HCLE2 + 2 + 2 + read-write + + + HCLE3 + desc HCLE3 + 3 + 3 + read-write + + + CLES + desc CLES + 7 + 7 + read-write + + + HCLE8 + desc HCLE8 + 8 + 8 + read-write + + + HCLE9 + desc HCLE9 + 9 + 9 + read-write + + + HCLE10 + desc HCLE10 + 10 + 10 + read-write + + + HCLE11 + desc HCLE11 + 11 + 11 + read-write + + + HCLE16 + desc HCLE16 + 16 + 16 + read-write + + + HCLE17 + desc HCLE17 + 17 + 17 + read-write + + + HCLE18 + desc HCLE18 + 18 + 18 + read-write + + + HCLE19 + desc HCLE19 + 19 + 19 + read-write + + + HCLE20 + desc HCLE20 + 20 + 20 + read-write + + + HCLE21 + desc HCLE21 + 21 + 21 + read-write + + + HCLE22 + desc HCLE22 + 22 + 22 + read-write + + + HCLE23 + desc HCLE23 + 23 + 23 + read-write + + + + + HUPDR + desc HUPDR + 0x18C + 32 + read-write + 0x0 + 0xFF0F8F + + + HUPD0 + desc HUPD0 + 0 + 0 + read-write + + + HUPD1 + desc HUPD1 + 1 + 1 + read-write + + + HUPD2 + desc HUPD2 + 2 + 2 + read-write + + + HUPD3 + desc HUPD3 + 3 + 3 + read-write + + + UPDS + desc UPDS + 7 + 7 + read-write + + + HUPD8 + desc HUPD8 + 8 + 8 + read-write + + + HUPD9 + desc HUPD9 + 9 + 9 + read-write + + + HUPD10 + desc HUPD10 + 10 + 10 + read-write + + + HUPD11 + desc HUPD11 + 11 + 11 + read-write + + + HUPD16 + desc HUPD16 + 16 + 16 + read-write + + + HUPD17 + desc HUPD17 + 17 + 17 + read-write + + + HUPD18 + desc HUPD18 + 18 + 18 + read-write + + + HUPD19 + desc HUPD19 + 19 + 19 + read-write + + + HUPD20 + desc HUPD20 + 20 + 20 + read-write + + + HUPD21 + desc HUPD21 + 21 + 21 + read-write + + + HUPD22 + desc HUPD22 + 22 + 22 + read-write + + + HUPD23 + desc HUPD23 + 23 + 23 + read-write + + + + + HCPAR + desc HCPAR + 0x190 + 32 + read-write + 0x0 + 0xFF0F0F + + + HCPA0 + desc HCPA0 + 0 + 0 + read-write + + + HCPA1 + desc HCPA1 + 1 + 1 + read-write + + + HCPA2 + desc HCPA2 + 2 + 2 + read-write + + + HCPA3 + desc HCPA3 + 3 + 3 + read-write + + + HCPA8 + desc HCPA8 + 8 + 8 + read-write + + + HCPA9 + desc HCPA9 + 9 + 9 + read-write + + + HCPA10 + desc HCPA10 + 10 + 10 + read-write + + + HCPA11 + desc HCPA11 + 11 + 11 + read-write + + + HCPA16 + desc HCPA16 + 16 + 16 + read-write + + + HCPA17 + desc HCPA17 + 17 + 17 + read-write + + + HCPA18 + desc HCPA18 + 18 + 18 + read-write + + + HCPA19 + desc HCPA19 + 19 + 19 + read-write + + + HCPA20 + desc HCPA20 + 20 + 20 + read-write + + + HCPA21 + desc HCPA21 + 21 + 21 + read-write + + + HCPA22 + desc HCPA22 + 22 + 22 + read-write + + + HCPA23 + desc HCPA23 + 23 + 23 + read-write + + + + + HCPBR + desc HCPBR + 0x194 + 32 + read-write + 0x0 + 0xFF0F0F + + + HCPB0 + desc HCPB0 + 0 + 0 + read-write + + + HCPB1 + desc HCPB1 + 1 + 1 + read-write + + + HCPB2 + desc HCPB2 + 2 + 2 + read-write + + + HCPB3 + desc HCPB3 + 3 + 3 + read-write + + + HCPB8 + desc HCPB8 + 8 + 8 + read-write + + + HCPB9 + desc HCPB9 + 9 + 9 + read-write + + + HCPB10 + desc HCPB10 + 10 + 10 + read-write + + + HCPB11 + desc HCPB11 + 11 + 11 + read-write + + + HCPB16 + desc HCPB16 + 16 + 16 + read-write + + + HCPB17 + desc HCPB17 + 17 + 17 + read-write + + + HCPB18 + desc HCPB18 + 18 + 18 + read-write + + + HCPB19 + desc HCPB19 + 19 + 19 + read-write + + + HCPB20 + desc HCPB20 + 20 + 20 + read-write + + + HCPB21 + desc HCPB21 + 21 + 21 + read-write + + + HCPB22 + desc HCPB22 + 22 + 22 + read-write + + + HCPB23 + desc HCPB23 + 23 + 23 + read-write + + + + + HCUPR + desc HCUPR + 0x198 + 32 + read-write + 0x0 + 0xFF0FFF + + + HCUP0 + desc HCUP0 + 0 + 0 + read-write + + + HCUP1 + desc HCUP1 + 1 + 1 + read-write + + + HCUP2 + desc HCUP2 + 2 + 2 + read-write + + + HCUP3 + desc HCUP3 + 3 + 3 + read-write + + + HCUP4 + desc HCUP4 + 4 + 4 + read-write + + + HCUP5 + desc HCUP5 + 5 + 5 + read-write + + + HCUP6 + desc HCUP6 + 6 + 6 + read-write + + + HCUP7 + desc HCUP7 + 7 + 7 + read-write + + + HCUP8 + desc HCUP8 + 8 + 8 + read-write + + + HCUP9 + desc HCUP9 + 9 + 9 + read-write + + + HCUP10 + desc HCUP10 + 10 + 10 + read-write + + + HCUP11 + desc HCUP11 + 11 + 11 + read-write + + + HCUP16 + desc HCUP16 + 16 + 16 + read-write + + + HCUP17 + desc HCUP17 + 17 + 17 + read-write + + + HCUP18 + desc HCUP18 + 18 + 18 + read-write + + + HCUP19 + desc HCUP19 + 19 + 19 + read-write + + + HCUP20 + desc HCUP20 + 20 + 20 + read-write + + + HCUP21 + desc HCUP21 + 21 + 21 + read-write + + + HCUP22 + desc HCUP22 + 22 + 22 + read-write + + + HCUP23 + desc HCUP23 + 23 + 23 + read-write + + + + + HCDOR + desc HCDOR + 0x19C + 32 + read-write + 0x0 + 0xFF0FFF + + + HCDO0 + desc HCDO0 + 0 + 0 + read-write + + + HCDO1 + desc HCDO1 + 1 + 1 + read-write + + + HCDO2 + desc HCDO2 + 2 + 2 + read-write + + + HCDO3 + desc HCDO3 + 3 + 3 + read-write + + + HCDO4 + desc HCDO4 + 4 + 4 + read-write + + + HCDO5 + desc HCDO5 + 5 + 5 + read-write + + + HCDO6 + desc HCDO6 + 6 + 6 + read-write + + + HCDO7 + desc HCDO7 + 7 + 7 + read-write + + + HCDO8 + desc HCDO8 + 8 + 8 + read-write + + + HCDO9 + desc HCDO9 + 9 + 9 + read-write + + + HCDO10 + desc HCDO10 + 10 + 10 + read-write + + + HCDO11 + desc HCDO11 + 11 + 11 + read-write + + + HCDO16 + desc HCDO16 + 16 + 16 + read-write + + + HCDO17 + desc HCDO17 + 17 + 17 + read-write + + + HCDO18 + desc HCDO18 + 18 + 18 + read-write + + + HCDO19 + desc HCDO19 + 19 + 19 + read-write + + + HCDO20 + desc HCDO20 + 20 + 20 + read-write + + + HCDO21 + desc HCDO21 + 21 + 21 + read-write + + + HCDO22 + desc HCDO22 + 22 + 22 + read-write + + + HCDO23 + desc HCDO23 + 23 + 23 + read-write + + + + + + + TMR65 + desc TMR65 + 0x40019000 + + 0x0 + 0x1A0 + + + + CNTER + desc CNTER + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNT + desc CNT + 15 + 0 + read-write + + + + + UPDAR + desc UPDAR + 0x4 + 32 + read-write + 0x0 + 0xFFFF + + + UPDA + desc UPDA + 15 + 0 + read-write + + + + + PERAR + desc PERAR + 0x40 + 32 + read-write + 0xFFFF + 0xFFFF + + + PERA + desc PERA + 15 + 0 + read-write + + + + + PERBR + desc PERBR + 0x44 + 32 + read-write + 0xFFFF + 0xFFFF + + + PERB + desc PERB + 15 + 0 + read-write + + + + + PERCR + desc PERCR + 0x48 + 32 + read-write + 0xFFFF + 0xFFFF + + + PERC + desc PERC + 15 + 0 + read-write + + + + + GCMAR + desc GCMAR + 0x80 + 32 + read-write + 0xFFFF + 0xFFFF + + + GCMA + desc GCMA + 15 + 0 + read-write + + + + + GCMBR + desc GCMBR + 0x84 + 32 + read-write + 0xFFFF + 0xFFFF + + + GCMB + desc GCMB + 15 + 0 + read-write + + + + + GCMCR + desc GCMCR + 0x88 + 32 + read-write + 0xFFFF + 0xFFFF + + + GCMC + desc GCMC + 15 + 0 + read-write + + + + + GCMDR + desc GCMDR + 0x8C + 32 + read-write + 0xFFFF + 0xFFFF + + + GCMD + desc GCMD + 15 + 0 + read-write + + + + + GCMER + desc GCMER + 0x90 + 32 + read-write + 0xFFFF + 0xFFFF + + + GCME + desc GCME + 15 + 0 + read-write + + + + + GCMFR + desc GCMFR + 0x94 + 32 + read-write + 0xFFFF + 0xFFFF + + + GCMF + desc GCMF + 15 + 0 + read-write + + + + + SCMAR + desc SCMAR + 0xC0 + 32 + read-write + 0xFFFF + 0xFFFF + + + SCMA + desc SCMA + 15 + 0 + read-write + + + + + SCMBR + desc SCMBR + 0xC4 + 32 + read-write + 0xFFFF + 0xFFFF + + + SCMB + desc SCMB + 15 + 0 + read-write + + + + + SCMCR + desc SCMCR + 0xC8 + 32 + read-write + 0xFFFF + 0xFFFF + + + SCMC + desc SCMC + 15 + 0 + read-write + + + + + SCMDR + desc SCMDR + 0xCC + 32 + read-write + 0xFFFF + 0xFFFF + + + SCMD + desc SCMD + 15 + 0 + read-write + + + + + SCMER + desc SCMER + 0xD0 + 32 + read-write + 0xFFFF + 0xFFFF + + + SCME + desc SCME + 15 + 0 + read-write + + + + + SCMFR + desc SCMFR + 0xD4 + 32 + read-write + 0xFFFF + 0xFFFF + + + SCMF + desc SCMF + 15 + 0 + read-write + + + + + DTUAR + desc DTUAR + 0x100 + 32 + read-write + 0xFFFF + 0xFFFF + + + DTUA + desc DTUA + 15 + 0 + read-write + + + + + DTDAR + desc DTDAR + 0x104 + 32 + read-write + 0xFFFF + 0xFFFF + + + DTDA + desc DTDA + 15 + 0 + read-write + + + + + DTUBR + desc DTUBR + 0x108 + 32 + read-write + 0xFFFF + 0xFFFF + + + DTUB + desc DTUB + 15 + 0 + read-write + + + + + DTDBR + desc DTDBR + 0x10C + 32 + read-write + 0xFFFF + 0xFFFF + + + DTDB + desc DTDB + 15 + 0 + read-write + + + + + GCONR + desc GCONR + 0x140 + 32 + read-write + 0x2 + 0xF01F7 + + + START + desc START + 0 + 0 + read-write + + + DIR + desc DIR + 1 + 1 + read-write + + + MODE + desc MODE + 2 + 2 + read-write + + + CKDIV + desc CKDIV + 7 + 4 + read-write + + + OVSTP + desc OVSTP + 8 + 8 + read-write + + + ZMSKREV + desc ZMSKREV + 16 + 16 + read-write + + + ZMSKPOS + desc ZMSKPOS + 17 + 17 + read-write + + + ZMSKVAL + desc ZMSKVAL + 19 + 18 + read-write + + + + + ICONR + desc ICONR + 0x144 + 32 + read-write + 0x0 + 0xF01FF + + + INTENA + desc INTENA + 0 + 0 + read-write + + + INTENB + desc INTENB + 1 + 1 + read-write + + + INTENC + desc INTENC + 2 + 2 + read-write + + + INTEND + desc INTEND + 3 + 3 + read-write + + + INTENE + desc INTENE + 4 + 4 + read-write + + + INTENF + desc INTENF + 5 + 5 + read-write + + + INTENOVF + desc INTENOVF + 6 + 6 + read-write + + + INTENUDF + desc INTENUDF + 7 + 7 + read-write + + + INTENDTE + desc INTENDTE + 8 + 8 + read-write + + + INTENSAU + desc INTENSAU + 16 + 16 + read-write + + + INTENSAD + desc INTENSAD + 17 + 17 + read-write + + + INTENSBU + desc INTENSBU + 18 + 18 + read-write + + + INTENSBD + desc INTENSBD + 19 + 19 + read-write + + + + + BCONR + desc BCONR + 0x148 + 32 + read-write + 0x0 + 0xFF0FFF + + + BENA + desc BENA + 0 + 0 + read-write + + + BSEA + desc BSEA + 1 + 1 + read-write + + + BTRUA + desc BTRUA + 2 + 2 + read-write + + + BTRDA + desc BTRDA + 3 + 3 + read-write + + + BENB + desc BENB + 4 + 4 + read-write + + + BSEB + desc BSEB + 5 + 5 + read-write + + + BTRUB + desc BTRUB + 6 + 6 + read-write + + + BTRDB + desc BTRDB + 7 + 7 + read-write + + + BENP + desc BENP + 8 + 8 + read-write + + + BSEP + desc BSEP + 9 + 9 + read-write + + + BTRUP + desc BTRUP + 10 + 10 + read-write + + + BTRDP + desc BTRDP + 11 + 11 + read-write + + + BENSPA + desc BENSPA + 16 + 16 + read-write + + + BSESPA + desc BSESPA + 17 + 17 + read-write + + + BTRUSPA + desc BTRUSPA + 18 + 18 + read-write + + + BTRDSPA + desc BTRDSPA + 19 + 19 + read-write + + + BENSPB + desc BENSPB + 20 + 20 + read-write + + + BSESPB + desc BSESPB + 21 + 21 + read-write + + + BTRUSPB + desc BTRUSPB + 22 + 22 + read-write + + + BTRDSPB + desc BTRDSPB + 23 + 23 + read-write + + + + + DCONR + desc DCONR + 0x14C + 32 + read-write + 0x0 + 0xF3 + + + DTCEN + desc DTCEN + 0 + 0 + read-write + + + SEPA + desc SEPA + 1 + 1 + read-write + + + DTBENU + desc DTBENU + 4 + 4 + read-write + + + DTBEND + desc DTBEND + 5 + 5 + read-write + + + DTBTRU + desc DTBTRU + 6 + 6 + read-write + + + DTBTRD + desc DTBTRD + 7 + 7 + read-write + + + + + PCNAR + desc PCNAR + 0x154 + 32 + read-write + 0x0 + 0x93F3FFFF + + + STACA + desc STACA + 1 + 0 + read-write + + + STPCA + desc STPCA + 3 + 2 + read-write + + + OVFCA + desc OVFCA + 5 + 4 + read-write + + + UDFCA + desc UDFCA + 7 + 6 + read-write + + + CMAUCA + desc CMAUCA + 9 + 8 + read-write + + + CMADCA + desc CMADCA + 11 + 10 + read-write + + + CMBUCA + desc CMBUCA + 13 + 12 + read-write + + + CMBDCA + desc CMBDCA + 15 + 14 + read-write + + + FORCA + desc FORCA + 17 + 16 + read-write + + + EMBCA + desc EMBCA + 21 + 20 + read-write + + + EMBRA + desc EMBRA + 23 + 22 + read-write + + + EMBSA + desc EMBSA + 25 + 24 + read-write + + + OUTENA + desc OUTENA + 28 + 28 + read-write + + + CAPMDA + desc CAPMDA + 31 + 31 + read-write + + + + + PCNBR + desc PCNBR + 0x158 + 32 + read-write + 0x0 + 0x93F3FFFF + + + STACB + desc STACB + 1 + 0 + read-write + + + STPCB + desc STPCB + 3 + 2 + read-write + + + OVFCB + desc OVFCB + 5 + 4 + read-write + + + UDFCB + desc UDFCB + 7 + 6 + read-write + + + CMAUCB + desc CMAUCB + 9 + 8 + read-write + + + CMADCB + desc CMADCB + 11 + 10 + read-write + + + CMBUCB + desc CMBUCB + 13 + 12 + read-write + + + CMBDCB + desc CMBDCB + 15 + 14 + read-write + + + FORCB + desc FORCB + 17 + 16 + read-write + + + EMBCB + desc EMBCB + 21 + 20 + read-write + + + EMBRB + desc EMBRB + 23 + 22 + read-write + + + EMBSB + desc EMBSB + 25 + 24 + read-write + + + OUTENB + desc OUTENB + 28 + 28 + read-write + + + CAPMDB + desc CAPMDB + 31 + 31 + read-write + + + + + FCNGR + desc FCNGR + 0x15C + 32 + read-write + 0x0 + 0x77 + + + NOFIENGA + desc NOFIENGA + 0 + 0 + read-write + + + NOFICKGA + desc NOFICKGA + 2 + 1 + read-write + + + NOFIENGB + desc NOFIENGB + 4 + 4 + read-write + + + NOFICKGB + desc NOFICKGB + 6 + 5 + read-write + + + + + VPERR + desc VPERR + 0x160 + 32 + read-write + 0x0 + 0x1F0300 + + + SPPERIA + desc SPPERIA + 8 + 8 + read-write + + + SPPERIB + desc SPPERIB + 9 + 9 + read-write + + + PCNTE + desc PCNTE + 17 + 16 + read-write + + + PCNTS + desc PCNTS + 20 + 18 + read-write + + + + + STFLR + desc STFLR + 0x164 + 32 + read-write + 0x80000000 + 0x80E01FFF + + + CMAF + desc CMAF + 0 + 0 + read-write + + + CMBF + desc CMBF + 1 + 1 + read-write + + + CMCF + desc CMCF + 2 + 2 + read-write + + + CMDF + desc CMDF + 3 + 3 + read-write + + + CMEF + desc CMEF + 4 + 4 + read-write + + + CMFF + desc CMFF + 5 + 5 + read-write + + + OVFF + desc OVFF + 6 + 6 + read-write + + + UDFF + desc UDFF + 7 + 7 + read-write + + + DTEF + desc DTEF + 8 + 8 + read-only + + + CMSAUF + desc CMSAUF + 9 + 9 + read-write + + + CMSADF + desc CMSADF + 10 + 10 + read-write + + + CMSBUF + desc CMSBUF + 11 + 11 + read-write + + + CMSBDF + desc CMSBDF + 12 + 12 + read-write + + + VPERNUM + desc VPERNUM + 23 + 21 + read-only + + + DIRF + desc DIRF + 31 + 31 + read-only + + + + + HSTAR + desc HSTAR + 0x180 + 32 + read-write + 0x0 + 0xFF0F8F + + + HSTA0 + desc HSTA0 + 0 + 0 + read-write + + + HSTA1 + desc HSTA1 + 1 + 1 + read-write + + + HSTA2 + desc HSTA2 + 2 + 2 + read-write + + + HSTA3 + desc HSTA3 + 3 + 3 + read-write + + + STAS + desc STAS + 7 + 7 + read-write + + + HSTA8 + desc HSTA8 + 8 + 8 + read-write + + + HSTA9 + desc HSTA9 + 9 + 9 + read-write + + + HSTA10 + desc HSTA10 + 10 + 10 + read-write + + + HSTA11 + desc HSTA11 + 11 + 11 + read-write + + + HSTA16 + desc HSTA16 + 16 + 16 + read-write + + + HSTA17 + desc HSTA17 + 17 + 17 + read-write + + + HSTA18 + desc HSTA18 + 18 + 18 + read-write + + + HSTA19 + desc HSTA19 + 19 + 19 + read-write + + + HSTA20 + desc HSTA20 + 20 + 20 + read-write + + + HSTA21 + desc HSTA21 + 21 + 21 + read-write + + + HSTA22 + desc HSTA22 + 22 + 22 + read-write + + + HSTA23 + desc HSTA23 + 23 + 23 + read-write + + + + + HSTPR + desc HSTPR + 0x184 + 32 + read-write + 0x0 + 0xFF0F8F + + + HSTP0 + desc HSTP0 + 0 + 0 + read-write + + + HSTP1 + desc HSTP1 + 1 + 1 + read-write + + + HSTP2 + desc HSTP2 + 2 + 2 + read-write + + + HSTP3 + desc HSTP3 + 3 + 3 + read-write + + + STPS + desc STPS + 7 + 7 + read-write + + + HSTP8 + desc HSTP8 + 8 + 8 + read-write + + + HSTP9 + desc HSTP9 + 9 + 9 + read-write + + + HSTP10 + desc HSTP10 + 10 + 10 + read-write + + + HSTP11 + desc HSTP11 + 11 + 11 + read-write + + + HSTP16 + desc HSTP16 + 16 + 16 + read-write + + + HSTP17 + desc HSTP17 + 17 + 17 + read-write + + + HSTP18 + desc HSTP18 + 18 + 18 + read-write + + + HSTP19 + desc HSTP19 + 19 + 19 + read-write + + + HSTP20 + desc HSTP20 + 20 + 20 + read-write + + + HSTP21 + desc HSTP21 + 21 + 21 + read-write + + + HSTP22 + desc HSTP22 + 22 + 22 + read-write + + + HSTP23 + desc HSTP23 + 23 + 23 + read-write + + + + + HCLRR + desc HCLRR + 0x188 + 32 + read-write + 0x0 + 0xFF0F8F + + + HCLE0 + desc HCLE0 + 0 + 0 + read-write + + + HCLE1 + desc HCLE1 + 1 + 1 + read-write + + + HCLE2 + desc HCLE2 + 2 + 2 + read-write + + + HCLE3 + desc HCLE3 + 3 + 3 + read-write + + + CLES + desc CLES + 7 + 7 + read-write + + + HCLE8 + desc HCLE8 + 8 + 8 + read-write + + + HCLE9 + desc HCLE9 + 9 + 9 + read-write + + + HCLE10 + desc HCLE10 + 10 + 10 + read-write + + + HCLE11 + desc HCLE11 + 11 + 11 + read-write + + + HCLE16 + desc HCLE16 + 16 + 16 + read-write + + + HCLE17 + desc HCLE17 + 17 + 17 + read-write + + + HCLE18 + desc HCLE18 + 18 + 18 + read-write + + + HCLE19 + desc HCLE19 + 19 + 19 + read-write + + + HCLE20 + desc HCLE20 + 20 + 20 + read-write + + + HCLE21 + desc HCLE21 + 21 + 21 + read-write + + + HCLE22 + desc HCLE22 + 22 + 22 + read-write + + + HCLE23 + desc HCLE23 + 23 + 23 + read-write + + + + + HUPDR + desc HUPDR + 0x18C + 32 + read-write + 0x0 + 0xFF0F8F + + + HUPD0 + desc HUPD0 + 0 + 0 + read-write + + + HUPD1 + desc HUPD1 + 1 + 1 + read-write + + + HUPD2 + desc HUPD2 + 2 + 2 + read-write + + + HUPD3 + desc HUPD3 + 3 + 3 + read-write + + + UPDS + desc UPDS + 7 + 7 + read-write + + + HUPD8 + desc HUPD8 + 8 + 8 + read-write + + + HUPD9 + desc HUPD9 + 9 + 9 + read-write + + + HUPD10 + desc HUPD10 + 10 + 10 + read-write + + + HUPD11 + desc HUPD11 + 11 + 11 + read-write + + + HUPD16 + desc HUPD16 + 16 + 16 + read-write + + + HUPD17 + desc HUPD17 + 17 + 17 + read-write + + + HUPD18 + desc HUPD18 + 18 + 18 + read-write + + + HUPD19 + desc HUPD19 + 19 + 19 + read-write + + + HUPD20 + desc HUPD20 + 20 + 20 + read-write + + + HUPD21 + desc HUPD21 + 21 + 21 + read-write + + + HUPD22 + desc HUPD22 + 22 + 22 + read-write + + + HUPD23 + desc HUPD23 + 23 + 23 + read-write + + + + + HCPAR + desc HCPAR + 0x190 + 32 + read-write + 0x0 + 0xFF0F0F + + + HCPA0 + desc HCPA0 + 0 + 0 + read-write + + + HCPA1 + desc HCPA1 + 1 + 1 + read-write + + + HCPA2 + desc HCPA2 + 2 + 2 + read-write + + + HCPA3 + desc HCPA3 + 3 + 3 + read-write + + + HCPA8 + desc HCPA8 + 8 + 8 + read-write + + + HCPA9 + desc HCPA9 + 9 + 9 + read-write + + + HCPA10 + desc HCPA10 + 10 + 10 + read-write + + + HCPA11 + desc HCPA11 + 11 + 11 + read-write + + + HCPA16 + desc HCPA16 + 16 + 16 + read-write + + + HCPA17 + desc HCPA17 + 17 + 17 + read-write + + + HCPA18 + desc HCPA18 + 18 + 18 + read-write + + + HCPA19 + desc HCPA19 + 19 + 19 + read-write + + + HCPA20 + desc HCPA20 + 20 + 20 + read-write + + + HCPA21 + desc HCPA21 + 21 + 21 + read-write + + + HCPA22 + desc HCPA22 + 22 + 22 + read-write + + + HCPA23 + desc HCPA23 + 23 + 23 + read-write + + + + + HCPBR + desc HCPBR + 0x194 + 32 + read-write + 0x0 + 0xFF0F0F + + + HCPB0 + desc HCPB0 + 0 + 0 + read-write + + + HCPB1 + desc HCPB1 + 1 + 1 + read-write + + + HCPB2 + desc HCPB2 + 2 + 2 + read-write + + + HCPB3 + desc HCPB3 + 3 + 3 + read-write + + + HCPB8 + desc HCPB8 + 8 + 8 + read-write + + + HCPB9 + desc HCPB9 + 9 + 9 + read-write + + + HCPB10 + desc HCPB10 + 10 + 10 + read-write + + + HCPB11 + desc HCPB11 + 11 + 11 + read-write + + + HCPB16 + desc HCPB16 + 16 + 16 + read-write + + + HCPB17 + desc HCPB17 + 17 + 17 + read-write + + + HCPB18 + desc HCPB18 + 18 + 18 + read-write + + + HCPB19 + desc HCPB19 + 19 + 19 + read-write + + + HCPB20 + desc HCPB20 + 20 + 20 + read-write + + + HCPB21 + desc HCPB21 + 21 + 21 + read-write + + + HCPB22 + desc HCPB22 + 22 + 22 + read-write + + + HCPB23 + desc HCPB23 + 23 + 23 + read-write + + + + + HCUPR + desc HCUPR + 0x198 + 32 + read-write + 0x0 + 0xFF0FFF + + + HCUP0 + desc HCUP0 + 0 + 0 + read-write + + + HCUP1 + desc HCUP1 + 1 + 1 + read-write + + + HCUP2 + desc HCUP2 + 2 + 2 + read-write + + + HCUP3 + desc HCUP3 + 3 + 3 + read-write + + + HCUP4 + desc HCUP4 + 4 + 4 + read-write + + + HCUP5 + desc HCUP5 + 5 + 5 + read-write + + + HCUP6 + desc HCUP6 + 6 + 6 + read-write + + + HCUP7 + desc HCUP7 + 7 + 7 + read-write + + + HCUP8 + desc HCUP8 + 8 + 8 + read-write + + + HCUP9 + desc HCUP9 + 9 + 9 + read-write + + + HCUP10 + desc HCUP10 + 10 + 10 + read-write + + + HCUP11 + desc HCUP11 + 11 + 11 + read-write + + + HCUP16 + desc HCUP16 + 16 + 16 + read-write + + + HCUP17 + desc HCUP17 + 17 + 17 + read-write + + + HCUP18 + desc HCUP18 + 18 + 18 + read-write + + + HCUP19 + desc HCUP19 + 19 + 19 + read-write + + + HCUP20 + desc HCUP20 + 20 + 20 + read-write + + + HCUP21 + desc HCUP21 + 21 + 21 + read-write + + + HCUP22 + desc HCUP22 + 22 + 22 + read-write + + + HCUP23 + desc HCUP23 + 23 + 23 + read-write + + + + + HCDOR + desc HCDOR + 0x19C + 32 + read-write + 0x0 + 0xFF0FFF + + + HCDO0 + desc HCDO0 + 0 + 0 + read-write + + + HCDO1 + desc HCDO1 + 1 + 1 + read-write + + + HCDO2 + desc HCDO2 + 2 + 2 + read-write + + + HCDO3 + desc HCDO3 + 3 + 3 + read-write + + + HCDO4 + desc HCDO4 + 4 + 4 + read-write + + + HCDO5 + desc HCDO5 + 5 + 5 + read-write + + + HCDO6 + desc HCDO6 + 6 + 6 + read-write + + + HCDO7 + desc HCDO7 + 7 + 7 + read-write + + + HCDO8 + desc HCDO8 + 8 + 8 + read-write + + + HCDO9 + desc HCDO9 + 9 + 9 + read-write + + + HCDO10 + desc HCDO10 + 10 + 10 + read-write + + + HCDO11 + desc HCDO11 + 11 + 11 + read-write + + + HCDO16 + desc HCDO16 + 16 + 16 + read-write + + + HCDO17 + desc HCDO17 + 17 + 17 + read-write + + + HCDO18 + desc HCDO18 + 18 + 18 + read-write + + + HCDO19 + desc HCDO19 + 19 + 19 + read-write + + + HCDO20 + desc HCDO20 + 20 + 20 + read-write + + + HCDO21 + desc HCDO21 + 21 + 21 + read-write + + + HCDO22 + desc HCDO22 + 22 + 22 + read-write + + + HCDO23 + desc HCDO23 + 23 + 23 + read-write + + + + + + + TMR66 + desc TMR66 + 0x40019400 + + 0x0 + 0x1A0 + + + + CNTER + desc CNTER + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNT + desc CNT + 15 + 0 + read-write + + + + + UPDAR + desc UPDAR + 0x4 + 32 + read-write + 0x0 + 0xFFFF + + + UPDA + desc UPDA + 15 + 0 + read-write + + + + + PERAR + desc PERAR + 0x40 + 32 + read-write + 0xFFFF + 0xFFFF + + + PERA + desc PERA + 15 + 0 + read-write + + + + + PERBR + desc PERBR + 0x44 + 32 + read-write + 0xFFFF + 0xFFFF + + + PERB + desc PERB + 15 + 0 + read-write + + + + + PERCR + desc PERCR + 0x48 + 32 + read-write + 0xFFFF + 0xFFFF + + + PERC + desc PERC + 15 + 0 + read-write + + + + + GCMAR + desc GCMAR + 0x80 + 32 + read-write + 0xFFFF + 0xFFFF + + + GCMA + desc GCMA + 15 + 0 + read-write + + + + + GCMBR + desc GCMBR + 0x84 + 32 + read-write + 0xFFFF + 0xFFFF + + + GCMB + desc GCMB + 15 + 0 + read-write + + + + + GCMCR + desc GCMCR + 0x88 + 32 + read-write + 0xFFFF + 0xFFFF + + + GCMC + desc GCMC + 15 + 0 + read-write + + + + + GCMDR + desc GCMDR + 0x8C + 32 + read-write + 0xFFFF + 0xFFFF + + + GCMD + desc GCMD + 15 + 0 + read-write + + + + + GCMER + desc GCMER + 0x90 + 32 + read-write + 0xFFFF + 0xFFFF + + + GCME + desc GCME + 15 + 0 + read-write + + + + + GCMFR + desc GCMFR + 0x94 + 32 + read-write + 0xFFFF + 0xFFFF + + + GCMF + desc GCMF + 15 + 0 + read-write + + + + + SCMAR + desc SCMAR + 0xC0 + 32 + read-write + 0xFFFF + 0xFFFF + + + SCMA + desc SCMA + 15 + 0 + read-write + + + + + SCMBR + desc SCMBR + 0xC4 + 32 + read-write + 0xFFFF + 0xFFFF + + + SCMB + desc SCMB + 15 + 0 + read-write + + + + + SCMCR + desc SCMCR + 0xC8 + 32 + read-write + 0xFFFF + 0xFFFF + + + SCMC + desc SCMC + 15 + 0 + read-write + + + + + SCMDR + desc SCMDR + 0xCC + 32 + read-write + 0xFFFF + 0xFFFF + + + SCMD + desc SCMD + 15 + 0 + read-write + + + + + SCMER + desc SCMER + 0xD0 + 32 + read-write + 0xFFFF + 0xFFFF + + + SCME + desc SCME + 15 + 0 + read-write + + + + + SCMFR + desc SCMFR + 0xD4 + 32 + read-write + 0xFFFF + 0xFFFF + + + SCMF + desc SCMF + 15 + 0 + read-write + + + + + DTUAR + desc DTUAR + 0x100 + 32 + read-write + 0xFFFF + 0xFFFF + + + DTUA + desc DTUA + 15 + 0 + read-write + + + + + DTDAR + desc DTDAR + 0x104 + 32 + read-write + 0xFFFF + 0xFFFF + + + DTDA + desc DTDA + 15 + 0 + read-write + + + + + DTUBR + desc DTUBR + 0x108 + 32 + read-write + 0xFFFF + 0xFFFF + + + DTUB + desc DTUB + 15 + 0 + read-write + + + + + DTDBR + desc DTDBR + 0x10C + 32 + read-write + 0xFFFF + 0xFFFF + + + DTDB + desc DTDB + 15 + 0 + read-write + + + + + GCONR + desc GCONR + 0x140 + 32 + read-write + 0x2 + 0xF01F7 + + + START + desc START + 0 + 0 + read-write + + + DIR + desc DIR + 1 + 1 + read-write + + + MODE + desc MODE + 2 + 2 + read-write + + + CKDIV + desc CKDIV + 7 + 4 + read-write + + + OVSTP + desc OVSTP + 8 + 8 + read-write + + + ZMSKREV + desc ZMSKREV + 16 + 16 + read-write + + + ZMSKPOS + desc ZMSKPOS + 17 + 17 + read-write + + + ZMSKVAL + desc ZMSKVAL + 19 + 18 + read-write + + + + + ICONR + desc ICONR + 0x144 + 32 + read-write + 0x0 + 0xF01FF + + + INTENA + desc INTENA + 0 + 0 + read-write + + + INTENB + desc INTENB + 1 + 1 + read-write + + + INTENC + desc INTENC + 2 + 2 + read-write + + + INTEND + desc INTEND + 3 + 3 + read-write + + + INTENE + desc INTENE + 4 + 4 + read-write + + + INTENF + desc INTENF + 5 + 5 + read-write + + + INTENOVF + desc INTENOVF + 6 + 6 + read-write + + + INTENUDF + desc INTENUDF + 7 + 7 + read-write + + + INTENDTE + desc INTENDTE + 8 + 8 + read-write + + + INTENSAU + desc INTENSAU + 16 + 16 + read-write + + + INTENSAD + desc INTENSAD + 17 + 17 + read-write + + + INTENSBU + desc INTENSBU + 18 + 18 + read-write + + + INTENSBD + desc INTENSBD + 19 + 19 + read-write + + + + + BCONR + desc BCONR + 0x148 + 32 + read-write + 0x0 + 0xFF0FFF + + + BENA + desc BENA + 0 + 0 + read-write + + + BSEA + desc BSEA + 1 + 1 + read-write + + + BTRUA + desc BTRUA + 2 + 2 + read-write + + + BTRDA + desc BTRDA + 3 + 3 + read-write + + + BENB + desc BENB + 4 + 4 + read-write + + + BSEB + desc BSEB + 5 + 5 + read-write + + + BTRUB + desc BTRUB + 6 + 6 + read-write + + + BTRDB + desc BTRDB + 7 + 7 + read-write + + + BENP + desc BENP + 8 + 8 + read-write + + + BSEP + desc BSEP + 9 + 9 + read-write + + + BTRUP + desc BTRUP + 10 + 10 + read-write + + + BTRDP + desc BTRDP + 11 + 11 + read-write + + + BENSPA + desc BENSPA + 16 + 16 + read-write + + + BSESPA + desc BSESPA + 17 + 17 + read-write + + + BTRUSPA + desc BTRUSPA + 18 + 18 + read-write + + + BTRDSPA + desc BTRDSPA + 19 + 19 + read-write + + + BENSPB + desc BENSPB + 20 + 20 + read-write + + + BSESPB + desc BSESPB + 21 + 21 + read-write + + + BTRUSPB + desc BTRUSPB + 22 + 22 + read-write + + + BTRDSPB + desc BTRDSPB + 23 + 23 + read-write + + + + + DCONR + desc DCONR + 0x14C + 32 + read-write + 0x0 + 0xF3 + + + DTCEN + desc DTCEN + 0 + 0 + read-write + + + SEPA + desc SEPA + 1 + 1 + read-write + + + DTBENU + desc DTBENU + 4 + 4 + read-write + + + DTBEND + desc DTBEND + 5 + 5 + read-write + + + DTBTRU + desc DTBTRU + 6 + 6 + read-write + + + DTBTRD + desc DTBTRD + 7 + 7 + read-write + + + + + PCNAR + desc PCNAR + 0x154 + 32 + read-write + 0x0 + 0x93F3FFFF + + + STACA + desc STACA + 1 + 0 + read-write + + + STPCA + desc STPCA + 3 + 2 + read-write + + + OVFCA + desc OVFCA + 5 + 4 + read-write + + + UDFCA + desc UDFCA + 7 + 6 + read-write + + + CMAUCA + desc CMAUCA + 9 + 8 + read-write + + + CMADCA + desc CMADCA + 11 + 10 + read-write + + + CMBUCA + desc CMBUCA + 13 + 12 + read-write + + + CMBDCA + desc CMBDCA + 15 + 14 + read-write + + + FORCA + desc FORCA + 17 + 16 + read-write + + + EMBCA + desc EMBCA + 21 + 20 + read-write + + + EMBRA + desc EMBRA + 23 + 22 + read-write + + + EMBSA + desc EMBSA + 25 + 24 + read-write + + + OUTENA + desc OUTENA + 28 + 28 + read-write + + + CAPMDA + desc CAPMDA + 31 + 31 + read-write + + + + + PCNBR + desc PCNBR + 0x158 + 32 + read-write + 0x0 + 0x93F3FFFF + + + STACB + desc STACB + 1 + 0 + read-write + + + STPCB + desc STPCB + 3 + 2 + read-write + + + OVFCB + desc OVFCB + 5 + 4 + read-write + + + UDFCB + desc UDFCB + 7 + 6 + read-write + + + CMAUCB + desc CMAUCB + 9 + 8 + read-write + + + CMADCB + desc CMADCB + 11 + 10 + read-write + + + CMBUCB + desc CMBUCB + 13 + 12 + read-write + + + CMBDCB + desc CMBDCB + 15 + 14 + read-write + + + FORCB + desc FORCB + 17 + 16 + read-write + + + EMBCB + desc EMBCB + 21 + 20 + read-write + + + EMBRB + desc EMBRB + 23 + 22 + read-write + + + EMBSB + desc EMBSB + 25 + 24 + read-write + + + OUTENB + desc OUTENB + 28 + 28 + read-write + + + CAPMDB + desc CAPMDB + 31 + 31 + read-write + + + + + FCNGR + desc FCNGR + 0x15C + 32 + read-write + 0x0 + 0x77 + + + NOFIENGA + desc NOFIENGA + 0 + 0 + read-write + + + NOFICKGA + desc NOFICKGA + 2 + 1 + read-write + + + NOFIENGB + desc NOFIENGB + 4 + 4 + read-write + + + NOFICKGB + desc NOFICKGB + 6 + 5 + read-write + + + + + VPERR + desc VPERR + 0x160 + 32 + read-write + 0x0 + 0x1F0300 + + + SPPERIA + desc SPPERIA + 8 + 8 + read-write + + + SPPERIB + desc SPPERIB + 9 + 9 + read-write + + + PCNTE + desc PCNTE + 17 + 16 + read-write + + + PCNTS + desc PCNTS + 20 + 18 + read-write + + + + + STFLR + desc STFLR + 0x164 + 32 + read-write + 0x80000000 + 0x80E01FFF + + + CMAF + desc CMAF + 0 + 0 + read-write + + + CMBF + desc CMBF + 1 + 1 + read-write + + + CMCF + desc CMCF + 2 + 2 + read-write + + + CMDF + desc CMDF + 3 + 3 + read-write + + + CMEF + desc CMEF + 4 + 4 + read-write + + + CMFF + desc CMFF + 5 + 5 + read-write + + + OVFF + desc OVFF + 6 + 6 + read-write + + + UDFF + desc UDFF + 7 + 7 + read-write + + + DTEF + desc DTEF + 8 + 8 + read-only + + + CMSAUF + desc CMSAUF + 9 + 9 + read-write + + + CMSADF + desc CMSADF + 10 + 10 + read-write + + + CMSBUF + desc CMSBUF + 11 + 11 + read-write + + + CMSBDF + desc CMSBDF + 12 + 12 + read-write + + + VPERNUM + desc VPERNUM + 23 + 21 + read-only + + + DIRF + desc DIRF + 31 + 31 + read-only + + + + + HSTAR + desc HSTAR + 0x180 + 32 + read-write + 0x0 + 0xFF0F8F + + + HSTA0 + desc HSTA0 + 0 + 0 + read-write + + + HSTA1 + desc HSTA1 + 1 + 1 + read-write + + + HSTA2 + desc HSTA2 + 2 + 2 + read-write + + + HSTA3 + desc HSTA3 + 3 + 3 + read-write + + + STAS + desc STAS + 7 + 7 + read-write + + + HSTA8 + desc HSTA8 + 8 + 8 + read-write + + + HSTA9 + desc HSTA9 + 9 + 9 + read-write + + + HSTA10 + desc HSTA10 + 10 + 10 + read-write + + + HSTA11 + desc HSTA11 + 11 + 11 + read-write + + + HSTA16 + desc HSTA16 + 16 + 16 + read-write + + + HSTA17 + desc HSTA17 + 17 + 17 + read-write + + + HSTA18 + desc HSTA18 + 18 + 18 + read-write + + + HSTA19 + desc HSTA19 + 19 + 19 + read-write + + + HSTA20 + desc HSTA20 + 20 + 20 + read-write + + + HSTA21 + desc HSTA21 + 21 + 21 + read-write + + + HSTA22 + desc HSTA22 + 22 + 22 + read-write + + + HSTA23 + desc HSTA23 + 23 + 23 + read-write + + + + + HSTPR + desc HSTPR + 0x184 + 32 + read-write + 0x0 + 0xFF0F8F + + + HSTP0 + desc HSTP0 + 0 + 0 + read-write + + + HSTP1 + desc HSTP1 + 1 + 1 + read-write + + + HSTP2 + desc HSTP2 + 2 + 2 + read-write + + + HSTP3 + desc HSTP3 + 3 + 3 + read-write + + + STPS + desc STPS + 7 + 7 + read-write + + + HSTP8 + desc HSTP8 + 8 + 8 + read-write + + + HSTP9 + desc HSTP9 + 9 + 9 + read-write + + + HSTP10 + desc HSTP10 + 10 + 10 + read-write + + + HSTP11 + desc HSTP11 + 11 + 11 + read-write + + + HSTP16 + desc HSTP16 + 16 + 16 + read-write + + + HSTP17 + desc HSTP17 + 17 + 17 + read-write + + + HSTP18 + desc HSTP18 + 18 + 18 + read-write + + + HSTP19 + desc HSTP19 + 19 + 19 + read-write + + + HSTP20 + desc HSTP20 + 20 + 20 + read-write + + + HSTP21 + desc HSTP21 + 21 + 21 + read-write + + + HSTP22 + desc HSTP22 + 22 + 22 + read-write + + + HSTP23 + desc HSTP23 + 23 + 23 + read-write + + + + + HCLRR + desc HCLRR + 0x188 + 32 + read-write + 0x0 + 0xFF0F8F + + + HCLE0 + desc HCLE0 + 0 + 0 + read-write + + + HCLE1 + desc HCLE1 + 1 + 1 + read-write + + + HCLE2 + desc HCLE2 + 2 + 2 + read-write + + + HCLE3 + desc HCLE3 + 3 + 3 + read-write + + + CLES + desc CLES + 7 + 7 + read-write + + + HCLE8 + desc HCLE8 + 8 + 8 + read-write + + + HCLE9 + desc HCLE9 + 9 + 9 + read-write + + + HCLE10 + desc HCLE10 + 10 + 10 + read-write + + + HCLE11 + desc HCLE11 + 11 + 11 + read-write + + + HCLE16 + desc HCLE16 + 16 + 16 + read-write + + + HCLE17 + desc HCLE17 + 17 + 17 + read-write + + + HCLE18 + desc HCLE18 + 18 + 18 + read-write + + + HCLE19 + desc HCLE19 + 19 + 19 + read-write + + + HCLE20 + desc HCLE20 + 20 + 20 + read-write + + + HCLE21 + desc HCLE21 + 21 + 21 + read-write + + + HCLE22 + desc HCLE22 + 22 + 22 + read-write + + + HCLE23 + desc HCLE23 + 23 + 23 + read-write + + + + + HUPDR + desc HUPDR + 0x18C + 32 + read-write + 0x0 + 0xFF0F8F + + + HUPD0 + desc HUPD0 + 0 + 0 + read-write + + + HUPD1 + desc HUPD1 + 1 + 1 + read-write + + + HUPD2 + desc HUPD2 + 2 + 2 + read-write + + + HUPD3 + desc HUPD3 + 3 + 3 + read-write + + + UPDS + desc UPDS + 7 + 7 + read-write + + + HUPD8 + desc HUPD8 + 8 + 8 + read-write + + + HUPD9 + desc HUPD9 + 9 + 9 + read-write + + + HUPD10 + desc HUPD10 + 10 + 10 + read-write + + + HUPD11 + desc HUPD11 + 11 + 11 + read-write + + + HUPD16 + desc HUPD16 + 16 + 16 + read-write + + + HUPD17 + desc HUPD17 + 17 + 17 + read-write + + + HUPD18 + desc HUPD18 + 18 + 18 + read-write + + + HUPD19 + desc HUPD19 + 19 + 19 + read-write + + + HUPD20 + desc HUPD20 + 20 + 20 + read-write + + + HUPD21 + desc HUPD21 + 21 + 21 + read-write + + + HUPD22 + desc HUPD22 + 22 + 22 + read-write + + + HUPD23 + desc HUPD23 + 23 + 23 + read-write + + + + + HCPAR + desc HCPAR + 0x190 + 32 + read-write + 0x0 + 0xFF0F0F + + + HCPA0 + desc HCPA0 + 0 + 0 + read-write + + + HCPA1 + desc HCPA1 + 1 + 1 + read-write + + + HCPA2 + desc HCPA2 + 2 + 2 + read-write + + + HCPA3 + desc HCPA3 + 3 + 3 + read-write + + + HCPA8 + desc HCPA8 + 8 + 8 + read-write + + + HCPA9 + desc HCPA9 + 9 + 9 + read-write + + + HCPA10 + desc HCPA10 + 10 + 10 + read-write + + + HCPA11 + desc HCPA11 + 11 + 11 + read-write + + + HCPA16 + desc HCPA16 + 16 + 16 + read-write + + + HCPA17 + desc HCPA17 + 17 + 17 + read-write + + + HCPA18 + desc HCPA18 + 18 + 18 + read-write + + + HCPA19 + desc HCPA19 + 19 + 19 + read-write + + + HCPA20 + desc HCPA20 + 20 + 20 + read-write + + + HCPA21 + desc HCPA21 + 21 + 21 + read-write + + + HCPA22 + desc HCPA22 + 22 + 22 + read-write + + + HCPA23 + desc HCPA23 + 23 + 23 + read-write + + + + + HCPBR + desc HCPBR + 0x194 + 32 + read-write + 0x0 + 0xFF0F0F + + + HCPB0 + desc HCPB0 + 0 + 0 + read-write + + + HCPB1 + desc HCPB1 + 1 + 1 + read-write + + + HCPB2 + desc HCPB2 + 2 + 2 + read-write + + + HCPB3 + desc HCPB3 + 3 + 3 + read-write + + + HCPB8 + desc HCPB8 + 8 + 8 + read-write + + + HCPB9 + desc HCPB9 + 9 + 9 + read-write + + + HCPB10 + desc HCPB10 + 10 + 10 + read-write + + + HCPB11 + desc HCPB11 + 11 + 11 + read-write + + + HCPB16 + desc HCPB16 + 16 + 16 + read-write + + + HCPB17 + desc HCPB17 + 17 + 17 + read-write + + + HCPB18 + desc HCPB18 + 18 + 18 + read-write + + + HCPB19 + desc HCPB19 + 19 + 19 + read-write + + + HCPB20 + desc HCPB20 + 20 + 20 + read-write + + + HCPB21 + desc HCPB21 + 21 + 21 + read-write + + + HCPB22 + desc HCPB22 + 22 + 22 + read-write + + + HCPB23 + desc HCPB23 + 23 + 23 + read-write + + + + + HCUPR + desc HCUPR + 0x198 + 32 + read-write + 0x0 + 0xFF0FFF + + + HCUP0 + desc HCUP0 + 0 + 0 + read-write + + + HCUP1 + desc HCUP1 + 1 + 1 + read-write + + + HCUP2 + desc HCUP2 + 2 + 2 + read-write + + + HCUP3 + desc HCUP3 + 3 + 3 + read-write + + + HCUP4 + desc HCUP4 + 4 + 4 + read-write + + + HCUP5 + desc HCUP5 + 5 + 5 + read-write + + + HCUP6 + desc HCUP6 + 6 + 6 + read-write + + + HCUP7 + desc HCUP7 + 7 + 7 + read-write + + + HCUP8 + desc HCUP8 + 8 + 8 + read-write + + + HCUP9 + desc HCUP9 + 9 + 9 + read-write + + + HCUP10 + desc HCUP10 + 10 + 10 + read-write + + + HCUP11 + desc HCUP11 + 11 + 11 + read-write + + + HCUP16 + desc HCUP16 + 16 + 16 + read-write + + + HCUP17 + desc HCUP17 + 17 + 17 + read-write + + + HCUP18 + desc HCUP18 + 18 + 18 + read-write + + + HCUP19 + desc HCUP19 + 19 + 19 + read-write + + + HCUP20 + desc HCUP20 + 20 + 20 + read-write + + + HCUP21 + desc HCUP21 + 21 + 21 + read-write + + + HCUP22 + desc HCUP22 + 22 + 22 + read-write + + + HCUP23 + desc HCUP23 + 23 + 23 + read-write + + + + + HCDOR + desc HCDOR + 0x19C + 32 + read-write + 0x0 + 0xFF0FFF + + + HCDO0 + desc HCDO0 + 0 + 0 + read-write + + + HCDO1 + desc HCDO1 + 1 + 1 + read-write + + + HCDO2 + desc HCDO2 + 2 + 2 + read-write + + + HCDO3 + desc HCDO3 + 3 + 3 + read-write + + + HCDO4 + desc HCDO4 + 4 + 4 + read-write + + + HCDO5 + desc HCDO5 + 5 + 5 + read-write + + + HCDO6 + desc HCDO6 + 6 + 6 + read-write + + + HCDO7 + desc HCDO7 + 7 + 7 + read-write + + + HCDO8 + desc HCDO8 + 8 + 8 + read-write + + + HCDO9 + desc HCDO9 + 9 + 9 + read-write + + + HCDO10 + desc HCDO10 + 10 + 10 + read-write + + + HCDO11 + desc HCDO11 + 11 + 11 + read-write + + + HCDO16 + desc HCDO16 + 16 + 16 + read-write + + + HCDO17 + desc HCDO17 + 17 + 17 + read-write + + + HCDO18 + desc HCDO18 + 18 + 18 + read-write + + + HCDO19 + desc HCDO19 + 19 + 19 + read-write + + + HCDO20 + desc HCDO20 + 20 + 20 + read-write + + + HCDO21 + desc HCDO21 + 21 + 21 + read-write + + + HCDO22 + desc HCDO22 + 22 + 22 + read-write + + + HCDO23 + desc HCDO23 + 23 + 23 + read-write + + + + + + + TMR67 + desc TMR67 + 0x40019800 + + 0x0 + 0x1A0 + + + + CNTER + desc CNTER + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNT + desc CNT + 15 + 0 + read-write + + + + + UPDAR + desc UPDAR + 0x4 + 32 + read-write + 0x0 + 0xFFFF + + + UPDA + desc UPDA + 15 + 0 + read-write + + + + + PERAR + desc PERAR + 0x40 + 32 + read-write + 0xFFFF + 0xFFFF + + + PERA + desc PERA + 15 + 0 + read-write + + + + + PERBR + desc PERBR + 0x44 + 32 + read-write + 0xFFFF + 0xFFFF + + + PERB + desc PERB + 15 + 0 + read-write + + + + + PERCR + desc PERCR + 0x48 + 32 + read-write + 0xFFFF + 0xFFFF + + + PERC + desc PERC + 15 + 0 + read-write + + + + + GCMAR + desc GCMAR + 0x80 + 32 + read-write + 0xFFFF + 0xFFFF + + + GCMA + desc GCMA + 15 + 0 + read-write + + + + + GCMBR + desc GCMBR + 0x84 + 32 + read-write + 0xFFFF + 0xFFFF + + + GCMB + desc GCMB + 15 + 0 + read-write + + + + + GCMCR + desc GCMCR + 0x88 + 32 + read-write + 0xFFFF + 0xFFFF + + + GCMC + desc GCMC + 15 + 0 + read-write + + + + + GCMDR + desc GCMDR + 0x8C + 32 + read-write + 0xFFFF + 0xFFFF + + + GCMD + desc GCMD + 15 + 0 + read-write + + + + + GCMER + desc GCMER + 0x90 + 32 + read-write + 0xFFFF + 0xFFFF + + + GCME + desc GCME + 15 + 0 + read-write + + + + + GCMFR + desc GCMFR + 0x94 + 32 + read-write + 0xFFFF + 0xFFFF + + + GCMF + desc GCMF + 15 + 0 + read-write + + + + + SCMAR + desc SCMAR + 0xC0 + 32 + read-write + 0xFFFF + 0xFFFF + + + SCMA + desc SCMA + 15 + 0 + read-write + + + + + SCMBR + desc SCMBR + 0xC4 + 32 + read-write + 0xFFFF + 0xFFFF + + + SCMB + desc SCMB + 15 + 0 + read-write + + + + + SCMCR + desc SCMCR + 0xC8 + 32 + read-write + 0xFFFF + 0xFFFF + + + SCMC + desc SCMC + 15 + 0 + read-write + + + + + SCMDR + desc SCMDR + 0xCC + 32 + read-write + 0xFFFF + 0xFFFF + + + SCMD + desc SCMD + 15 + 0 + read-write + + + + + SCMER + desc SCMER + 0xD0 + 32 + read-write + 0xFFFF + 0xFFFF + + + SCME + desc SCME + 15 + 0 + read-write + + + + + SCMFR + desc SCMFR + 0xD4 + 32 + read-write + 0xFFFF + 0xFFFF + + + SCMF + desc SCMF + 15 + 0 + read-write + + + + + DTUAR + desc DTUAR + 0x100 + 32 + read-write + 0xFFFF + 0xFFFF + + + DTUA + desc DTUA + 15 + 0 + read-write + + + + + DTDAR + desc DTDAR + 0x104 + 32 + read-write + 0xFFFF + 0xFFFF + + + DTDA + desc DTDA + 15 + 0 + read-write + + + + + DTUBR + desc DTUBR + 0x108 + 32 + read-write + 0xFFFF + 0xFFFF + + + DTUB + desc DTUB + 15 + 0 + read-write + + + + + DTDBR + desc DTDBR + 0x10C + 32 + read-write + 0xFFFF + 0xFFFF + + + DTDB + desc DTDB + 15 + 0 + read-write + + + + + GCONR + desc GCONR + 0x140 + 32 + read-write + 0x2 + 0xF01F7 + + + START + desc START + 0 + 0 + read-write + + + DIR + desc DIR + 1 + 1 + read-write + + + MODE + desc MODE + 2 + 2 + read-write + + + CKDIV + desc CKDIV + 7 + 4 + read-write + + + OVSTP + desc OVSTP + 8 + 8 + read-write + + + ZMSKREV + desc ZMSKREV + 16 + 16 + read-write + + + ZMSKPOS + desc ZMSKPOS + 17 + 17 + read-write + + + ZMSKVAL + desc ZMSKVAL + 19 + 18 + read-write + + + + + ICONR + desc ICONR + 0x144 + 32 + read-write + 0x0 + 0xF01FF + + + INTENA + desc INTENA + 0 + 0 + read-write + + + INTENB + desc INTENB + 1 + 1 + read-write + + + INTENC + desc INTENC + 2 + 2 + read-write + + + INTEND + desc INTEND + 3 + 3 + read-write + + + INTENE + desc INTENE + 4 + 4 + read-write + + + INTENF + desc INTENF + 5 + 5 + read-write + + + INTENOVF + desc INTENOVF + 6 + 6 + read-write + + + INTENUDF + desc INTENUDF + 7 + 7 + read-write + + + INTENDTE + desc INTENDTE + 8 + 8 + read-write + + + INTENSAU + desc INTENSAU + 16 + 16 + read-write + + + INTENSAD + desc INTENSAD + 17 + 17 + read-write + + + INTENSBU + desc INTENSBU + 18 + 18 + read-write + + + INTENSBD + desc INTENSBD + 19 + 19 + read-write + + + + + BCONR + desc BCONR + 0x148 + 32 + read-write + 0x0 + 0xFF0FFF + + + BENA + desc BENA + 0 + 0 + read-write + + + BSEA + desc BSEA + 1 + 1 + read-write + + + BTRUA + desc BTRUA + 2 + 2 + read-write + + + BTRDA + desc BTRDA + 3 + 3 + read-write + + + BENB + desc BENB + 4 + 4 + read-write + + + BSEB + desc BSEB + 5 + 5 + read-write + + + BTRUB + desc BTRUB + 6 + 6 + read-write + + + BTRDB + desc BTRDB + 7 + 7 + read-write + + + BENP + desc BENP + 8 + 8 + read-write + + + BSEP + desc BSEP + 9 + 9 + read-write + + + BTRUP + desc BTRUP + 10 + 10 + read-write + + + BTRDP + desc BTRDP + 11 + 11 + read-write + + + BENSPA + desc BENSPA + 16 + 16 + read-write + + + BSESPA + desc BSESPA + 17 + 17 + read-write + + + BTRUSPA + desc BTRUSPA + 18 + 18 + read-write + + + BTRDSPA + desc BTRDSPA + 19 + 19 + read-write + + + BENSPB + desc BENSPB + 20 + 20 + read-write + + + BSESPB + desc BSESPB + 21 + 21 + read-write + + + BTRUSPB + desc BTRUSPB + 22 + 22 + read-write + + + BTRDSPB + desc BTRDSPB + 23 + 23 + read-write + + + + + DCONR + desc DCONR + 0x14C + 32 + read-write + 0x0 + 0xF3 + + + DTCEN + desc DTCEN + 0 + 0 + read-write + + + SEPA + desc SEPA + 1 + 1 + read-write + + + DTBENU + desc DTBENU + 4 + 4 + read-write + + + DTBEND + desc DTBEND + 5 + 5 + read-write + + + DTBTRU + desc DTBTRU + 6 + 6 + read-write + + + DTBTRD + desc DTBTRD + 7 + 7 + read-write + + + + + PCNAR + desc PCNAR + 0x154 + 32 + read-write + 0x0 + 0x93F3FFFF + + + STACA + desc STACA + 1 + 0 + read-write + + + STPCA + desc STPCA + 3 + 2 + read-write + + + OVFCA + desc OVFCA + 5 + 4 + read-write + + + UDFCA + desc UDFCA + 7 + 6 + read-write + + + CMAUCA + desc CMAUCA + 9 + 8 + read-write + + + CMADCA + desc CMADCA + 11 + 10 + read-write + + + CMBUCA + desc CMBUCA + 13 + 12 + read-write + + + CMBDCA + desc CMBDCA + 15 + 14 + read-write + + + FORCA + desc FORCA + 17 + 16 + read-write + + + EMBCA + desc EMBCA + 21 + 20 + read-write + + + EMBRA + desc EMBRA + 23 + 22 + read-write + + + EMBSA + desc EMBSA + 25 + 24 + read-write + + + OUTENA + desc OUTENA + 28 + 28 + read-write + + + CAPMDA + desc CAPMDA + 31 + 31 + read-write + + + + + PCNBR + desc PCNBR + 0x158 + 32 + read-write + 0x0 + 0x93F3FFFF + + + STACB + desc STACB + 1 + 0 + read-write + + + STPCB + desc STPCB + 3 + 2 + read-write + + + OVFCB + desc OVFCB + 5 + 4 + read-write + + + UDFCB + desc UDFCB + 7 + 6 + read-write + + + CMAUCB + desc CMAUCB + 9 + 8 + read-write + + + CMADCB + desc CMADCB + 11 + 10 + read-write + + + CMBUCB + desc CMBUCB + 13 + 12 + read-write + + + CMBDCB + desc CMBDCB + 15 + 14 + read-write + + + FORCB + desc FORCB + 17 + 16 + read-write + + + EMBCB + desc EMBCB + 21 + 20 + read-write + + + EMBRB + desc EMBRB + 23 + 22 + read-write + + + EMBSB + desc EMBSB + 25 + 24 + read-write + + + OUTENB + desc OUTENB + 28 + 28 + read-write + + + CAPMDB + desc CAPMDB + 31 + 31 + read-write + + + + + FCNGR + desc FCNGR + 0x15C + 32 + read-write + 0x0 + 0x77 + + + NOFIENGA + desc NOFIENGA + 0 + 0 + read-write + + + NOFICKGA + desc NOFICKGA + 2 + 1 + read-write + + + NOFIENGB + desc NOFIENGB + 4 + 4 + read-write + + + NOFICKGB + desc NOFICKGB + 6 + 5 + read-write + + + + + VPERR + desc VPERR + 0x160 + 32 + read-write + 0x0 + 0x1F0300 + + + SPPERIA + desc SPPERIA + 8 + 8 + read-write + + + SPPERIB + desc SPPERIB + 9 + 9 + read-write + + + PCNTE + desc PCNTE + 17 + 16 + read-write + + + PCNTS + desc PCNTS + 20 + 18 + read-write + + + + + STFLR + desc STFLR + 0x164 + 32 + read-write + 0x80000000 + 0x80E01FFF + + + CMAF + desc CMAF + 0 + 0 + read-write + + + CMBF + desc CMBF + 1 + 1 + read-write + + + CMCF + desc CMCF + 2 + 2 + read-write + + + CMDF + desc CMDF + 3 + 3 + read-write + + + CMEF + desc CMEF + 4 + 4 + read-write + + + CMFF + desc CMFF + 5 + 5 + read-write + + + OVFF + desc OVFF + 6 + 6 + read-write + + + UDFF + desc UDFF + 7 + 7 + read-write + + + DTEF + desc DTEF + 8 + 8 + read-only + + + CMSAUF + desc CMSAUF + 9 + 9 + read-write + + + CMSADF + desc CMSADF + 10 + 10 + read-write + + + CMSBUF + desc CMSBUF + 11 + 11 + read-write + + + CMSBDF + desc CMSBDF + 12 + 12 + read-write + + + VPERNUM + desc VPERNUM + 23 + 21 + read-only + + + DIRF + desc DIRF + 31 + 31 + read-only + + + + + HSTAR + desc HSTAR + 0x180 + 32 + read-write + 0x0 + 0xFF0F8F + + + HSTA0 + desc HSTA0 + 0 + 0 + read-write + + + HSTA1 + desc HSTA1 + 1 + 1 + read-write + + + HSTA2 + desc HSTA2 + 2 + 2 + read-write + + + HSTA3 + desc HSTA3 + 3 + 3 + read-write + + + STAS + desc STAS + 7 + 7 + read-write + + + HSTA8 + desc HSTA8 + 8 + 8 + read-write + + + HSTA9 + desc HSTA9 + 9 + 9 + read-write + + + HSTA10 + desc HSTA10 + 10 + 10 + read-write + + + HSTA11 + desc HSTA11 + 11 + 11 + read-write + + + HSTA16 + desc HSTA16 + 16 + 16 + read-write + + + HSTA17 + desc HSTA17 + 17 + 17 + read-write + + + HSTA18 + desc HSTA18 + 18 + 18 + read-write + + + HSTA19 + desc HSTA19 + 19 + 19 + read-write + + + HSTA20 + desc HSTA20 + 20 + 20 + read-write + + + HSTA21 + desc HSTA21 + 21 + 21 + read-write + + + HSTA22 + desc HSTA22 + 22 + 22 + read-write + + + HSTA23 + desc HSTA23 + 23 + 23 + read-write + + + + + HSTPR + desc HSTPR + 0x184 + 32 + read-write + 0x0 + 0xFF0F8F + + + HSTP0 + desc HSTP0 + 0 + 0 + read-write + + + HSTP1 + desc HSTP1 + 1 + 1 + read-write + + + HSTP2 + desc HSTP2 + 2 + 2 + read-write + + + HSTP3 + desc HSTP3 + 3 + 3 + read-write + + + STPS + desc STPS + 7 + 7 + read-write + + + HSTP8 + desc HSTP8 + 8 + 8 + read-write + + + HSTP9 + desc HSTP9 + 9 + 9 + read-write + + + HSTP10 + desc HSTP10 + 10 + 10 + read-write + + + HSTP11 + desc HSTP11 + 11 + 11 + read-write + + + HSTP16 + desc HSTP16 + 16 + 16 + read-write + + + HSTP17 + desc HSTP17 + 17 + 17 + read-write + + + HSTP18 + desc HSTP18 + 18 + 18 + read-write + + + HSTP19 + desc HSTP19 + 19 + 19 + read-write + + + HSTP20 + desc HSTP20 + 20 + 20 + read-write + + + HSTP21 + desc HSTP21 + 21 + 21 + read-write + + + HSTP22 + desc HSTP22 + 22 + 22 + read-write + + + HSTP23 + desc HSTP23 + 23 + 23 + read-write + + + + + HCLRR + desc HCLRR + 0x188 + 32 + read-write + 0x0 + 0xFF0F8F + + + HCLE0 + desc HCLE0 + 0 + 0 + read-write + + + HCLE1 + desc HCLE1 + 1 + 1 + read-write + + + HCLE2 + desc HCLE2 + 2 + 2 + read-write + + + HCLE3 + desc HCLE3 + 3 + 3 + read-write + + + CLES + desc CLES + 7 + 7 + read-write + + + HCLE8 + desc HCLE8 + 8 + 8 + read-write + + + HCLE9 + desc HCLE9 + 9 + 9 + read-write + + + HCLE10 + desc HCLE10 + 10 + 10 + read-write + + + HCLE11 + desc HCLE11 + 11 + 11 + read-write + + + HCLE16 + desc HCLE16 + 16 + 16 + read-write + + + HCLE17 + desc HCLE17 + 17 + 17 + read-write + + + HCLE18 + desc HCLE18 + 18 + 18 + read-write + + + HCLE19 + desc HCLE19 + 19 + 19 + read-write + + + HCLE20 + desc HCLE20 + 20 + 20 + read-write + + + HCLE21 + desc HCLE21 + 21 + 21 + read-write + + + HCLE22 + desc HCLE22 + 22 + 22 + read-write + + + HCLE23 + desc HCLE23 + 23 + 23 + read-write + + + + + HUPDR + desc HUPDR + 0x18C + 32 + read-write + 0x0 + 0xFF0F8F + + + HUPD0 + desc HUPD0 + 0 + 0 + read-write + + + HUPD1 + desc HUPD1 + 1 + 1 + read-write + + + HUPD2 + desc HUPD2 + 2 + 2 + read-write + + + HUPD3 + desc HUPD3 + 3 + 3 + read-write + + + UPDS + desc UPDS + 7 + 7 + read-write + + + HUPD8 + desc HUPD8 + 8 + 8 + read-write + + + HUPD9 + desc HUPD9 + 9 + 9 + read-write + + + HUPD10 + desc HUPD10 + 10 + 10 + read-write + + + HUPD11 + desc HUPD11 + 11 + 11 + read-write + + + HUPD16 + desc HUPD16 + 16 + 16 + read-write + + + HUPD17 + desc HUPD17 + 17 + 17 + read-write + + + HUPD18 + desc HUPD18 + 18 + 18 + read-write + + + HUPD19 + desc HUPD19 + 19 + 19 + read-write + + + HUPD20 + desc HUPD20 + 20 + 20 + read-write + + + HUPD21 + desc HUPD21 + 21 + 21 + read-write + + + HUPD22 + desc HUPD22 + 22 + 22 + read-write + + + HUPD23 + desc HUPD23 + 23 + 23 + read-write + + + + + HCPAR + desc HCPAR + 0x190 + 32 + read-write + 0x0 + 0xFF0F0F + + + HCPA0 + desc HCPA0 + 0 + 0 + read-write + + + HCPA1 + desc HCPA1 + 1 + 1 + read-write + + + HCPA2 + desc HCPA2 + 2 + 2 + read-write + + + HCPA3 + desc HCPA3 + 3 + 3 + read-write + + + HCPA8 + desc HCPA8 + 8 + 8 + read-write + + + HCPA9 + desc HCPA9 + 9 + 9 + read-write + + + HCPA10 + desc HCPA10 + 10 + 10 + read-write + + + HCPA11 + desc HCPA11 + 11 + 11 + read-write + + + HCPA16 + desc HCPA16 + 16 + 16 + read-write + + + HCPA17 + desc HCPA17 + 17 + 17 + read-write + + + HCPA18 + desc HCPA18 + 18 + 18 + read-write + + + HCPA19 + desc HCPA19 + 19 + 19 + read-write + + + HCPA20 + desc HCPA20 + 20 + 20 + read-write + + + HCPA21 + desc HCPA21 + 21 + 21 + read-write + + + HCPA22 + desc HCPA22 + 22 + 22 + read-write + + + HCPA23 + desc HCPA23 + 23 + 23 + read-write + + + + + HCPBR + desc HCPBR + 0x194 + 32 + read-write + 0x0 + 0xFF0F0F + + + HCPB0 + desc HCPB0 + 0 + 0 + read-write + + + HCPB1 + desc HCPB1 + 1 + 1 + read-write + + + HCPB2 + desc HCPB2 + 2 + 2 + read-write + + + HCPB3 + desc HCPB3 + 3 + 3 + read-write + + + HCPB8 + desc HCPB8 + 8 + 8 + read-write + + + HCPB9 + desc HCPB9 + 9 + 9 + read-write + + + HCPB10 + desc HCPB10 + 10 + 10 + read-write + + + HCPB11 + desc HCPB11 + 11 + 11 + read-write + + + HCPB16 + desc HCPB16 + 16 + 16 + read-write + + + HCPB17 + desc HCPB17 + 17 + 17 + read-write + + + HCPB18 + desc HCPB18 + 18 + 18 + read-write + + + HCPB19 + desc HCPB19 + 19 + 19 + read-write + + + HCPB20 + desc HCPB20 + 20 + 20 + read-write + + + HCPB21 + desc HCPB21 + 21 + 21 + read-write + + + HCPB22 + desc HCPB22 + 22 + 22 + read-write + + + HCPB23 + desc HCPB23 + 23 + 23 + read-write + + + + + HCUPR + desc HCUPR + 0x198 + 32 + read-write + 0x0 + 0xFF0FFF + + + HCUP0 + desc HCUP0 + 0 + 0 + read-write + + + HCUP1 + desc HCUP1 + 1 + 1 + read-write + + + HCUP2 + desc HCUP2 + 2 + 2 + read-write + + + HCUP3 + desc HCUP3 + 3 + 3 + read-write + + + HCUP4 + desc HCUP4 + 4 + 4 + read-write + + + HCUP5 + desc HCUP5 + 5 + 5 + read-write + + + HCUP6 + desc HCUP6 + 6 + 6 + read-write + + + HCUP7 + desc HCUP7 + 7 + 7 + read-write + + + HCUP8 + desc HCUP8 + 8 + 8 + read-write + + + HCUP9 + desc HCUP9 + 9 + 9 + read-write + + + HCUP10 + desc HCUP10 + 10 + 10 + read-write + + + HCUP11 + desc HCUP11 + 11 + 11 + read-write + + + HCUP16 + desc HCUP16 + 16 + 16 + read-write + + + HCUP17 + desc HCUP17 + 17 + 17 + read-write + + + HCUP18 + desc HCUP18 + 18 + 18 + read-write + + + HCUP19 + desc HCUP19 + 19 + 19 + read-write + + + HCUP20 + desc HCUP20 + 20 + 20 + read-write + + + HCUP21 + desc HCUP21 + 21 + 21 + read-write + + + HCUP22 + desc HCUP22 + 22 + 22 + read-write + + + HCUP23 + desc HCUP23 + 23 + 23 + read-write + + + + + HCDOR + desc HCDOR + 0x19C + 32 + read-write + 0x0 + 0xFF0FFF + + + HCDO0 + desc HCDO0 + 0 + 0 + read-write + + + HCDO1 + desc HCDO1 + 1 + 1 + read-write + + + HCDO2 + desc HCDO2 + 2 + 2 + read-write + + + HCDO3 + desc HCDO3 + 3 + 3 + read-write + + + HCDO4 + desc HCDO4 + 4 + 4 + read-write + + + HCDO5 + desc HCDO5 + 5 + 5 + read-write + + + HCDO6 + desc HCDO6 + 6 + 6 + read-write + + + HCDO7 + desc HCDO7 + 7 + 7 + read-write + + + HCDO8 + desc HCDO8 + 8 + 8 + read-write + + + HCDO9 + desc HCDO9 + 9 + 9 + read-write + + + HCDO10 + desc HCDO10 + 10 + 10 + read-write + + + HCDO11 + desc HCDO11 + 11 + 11 + read-write + + + HCDO16 + desc HCDO16 + 16 + 16 + read-write + + + HCDO17 + desc HCDO17 + 17 + 17 + read-write + + + HCDO18 + desc HCDO18 + 18 + 18 + read-write + + + HCDO19 + desc HCDO19 + 19 + 19 + read-write + + + HCDO20 + desc HCDO20 + 20 + 20 + read-write + + + HCDO21 + desc HCDO21 + 21 + 21 + read-write + + + HCDO22 + desc HCDO22 + 22 + 22 + read-write + + + HCDO23 + desc HCDO23 + 23 + 23 + read-write + + + + + + + TMR68 + desc TMR68 + 0x40019C00 + + 0x0 + 0x1A0 + + + + CNTER + desc CNTER + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNT + desc CNT + 15 + 0 + read-write + + + + + UPDAR + desc UPDAR + 0x4 + 32 + read-write + 0x0 + 0xFFFF + + + UPDA + desc UPDA + 15 + 0 + read-write + + + + + PERAR + desc PERAR + 0x40 + 32 + read-write + 0xFFFF + 0xFFFF + + + PERA + desc PERA + 15 + 0 + read-write + + + + + PERBR + desc PERBR + 0x44 + 32 + read-write + 0xFFFF + 0xFFFF + + + PERB + desc PERB + 15 + 0 + read-write + + + + + PERCR + desc PERCR + 0x48 + 32 + read-write + 0xFFFF + 0xFFFF + + + PERC + desc PERC + 15 + 0 + read-write + + + + + GCMAR + desc GCMAR + 0x80 + 32 + read-write + 0xFFFF + 0xFFFF + + + GCMA + desc GCMA + 15 + 0 + read-write + + + + + GCMBR + desc GCMBR + 0x84 + 32 + read-write + 0xFFFF + 0xFFFF + + + GCMB + desc GCMB + 15 + 0 + read-write + + + + + GCMCR + desc GCMCR + 0x88 + 32 + read-write + 0xFFFF + 0xFFFF + + + GCMC + desc GCMC + 15 + 0 + read-write + + + + + GCMDR + desc GCMDR + 0x8C + 32 + read-write + 0xFFFF + 0xFFFF + + + GCMD + desc GCMD + 15 + 0 + read-write + + + + + GCMER + desc GCMER + 0x90 + 32 + read-write + 0xFFFF + 0xFFFF + + + GCME + desc GCME + 15 + 0 + read-write + + + + + GCMFR + desc GCMFR + 0x94 + 32 + read-write + 0xFFFF + 0xFFFF + + + GCMF + desc GCMF + 15 + 0 + read-write + + + + + SCMAR + desc SCMAR + 0xC0 + 32 + read-write + 0xFFFF + 0xFFFF + + + SCMA + desc SCMA + 15 + 0 + read-write + + + + + SCMBR + desc SCMBR + 0xC4 + 32 + read-write + 0xFFFF + 0xFFFF + + + SCMB + desc SCMB + 15 + 0 + read-write + + + + + SCMCR + desc SCMCR + 0xC8 + 32 + read-write + 0xFFFF + 0xFFFF + + + SCMC + desc SCMC + 15 + 0 + read-write + + + + + SCMDR + desc SCMDR + 0xCC + 32 + read-write + 0xFFFF + 0xFFFF + + + SCMD + desc SCMD + 15 + 0 + read-write + + + + + SCMER + desc SCMER + 0xD0 + 32 + read-write + 0xFFFF + 0xFFFF + + + SCME + desc SCME + 15 + 0 + read-write + + + + + SCMFR + desc SCMFR + 0xD4 + 32 + read-write + 0xFFFF + 0xFFFF + + + SCMF + desc SCMF + 15 + 0 + read-write + + + + + DTUAR + desc DTUAR + 0x100 + 32 + read-write + 0xFFFF + 0xFFFF + + + DTUA + desc DTUA + 15 + 0 + read-write + + + + + DTDAR + desc DTDAR + 0x104 + 32 + read-write + 0xFFFF + 0xFFFF + + + DTDA + desc DTDA + 15 + 0 + read-write + + + + + DTUBR + desc DTUBR + 0x108 + 32 + read-write + 0xFFFF + 0xFFFF + + + DTUB + desc DTUB + 15 + 0 + read-write + + + + + DTDBR + desc DTDBR + 0x10C + 32 + read-write + 0xFFFF + 0xFFFF + + + DTDB + desc DTDB + 15 + 0 + read-write + + + + + GCONR + desc GCONR + 0x140 + 32 + read-write + 0x2 + 0xF01F7 + + + START + desc START + 0 + 0 + read-write + + + DIR + desc DIR + 1 + 1 + read-write + + + MODE + desc MODE + 2 + 2 + read-write + + + CKDIV + desc CKDIV + 7 + 4 + read-write + + + OVSTP + desc OVSTP + 8 + 8 + read-write + + + ZMSKREV + desc ZMSKREV + 16 + 16 + read-write + + + ZMSKPOS + desc ZMSKPOS + 17 + 17 + read-write + + + ZMSKVAL + desc ZMSKVAL + 19 + 18 + read-write + + + + + ICONR + desc ICONR + 0x144 + 32 + read-write + 0x0 + 0xF01FF + + + INTENA + desc INTENA + 0 + 0 + read-write + + + INTENB + desc INTENB + 1 + 1 + read-write + + + INTENC + desc INTENC + 2 + 2 + read-write + + + INTEND + desc INTEND + 3 + 3 + read-write + + + INTENE + desc INTENE + 4 + 4 + read-write + + + INTENF + desc INTENF + 5 + 5 + read-write + + + INTENOVF + desc INTENOVF + 6 + 6 + read-write + + + INTENUDF + desc INTENUDF + 7 + 7 + read-write + + + INTENDTE + desc INTENDTE + 8 + 8 + read-write + + + INTENSAU + desc INTENSAU + 16 + 16 + read-write + + + INTENSAD + desc INTENSAD + 17 + 17 + read-write + + + INTENSBU + desc INTENSBU + 18 + 18 + read-write + + + INTENSBD + desc INTENSBD + 19 + 19 + read-write + + + + + BCONR + desc BCONR + 0x148 + 32 + read-write + 0x0 + 0xFF0FFF + + + BENA + desc BENA + 0 + 0 + read-write + + + BSEA + desc BSEA + 1 + 1 + read-write + + + BTRUA + desc BTRUA + 2 + 2 + read-write + + + BTRDA + desc BTRDA + 3 + 3 + read-write + + + BENB + desc BENB + 4 + 4 + read-write + + + BSEB + desc BSEB + 5 + 5 + read-write + + + BTRUB + desc BTRUB + 6 + 6 + read-write + + + BTRDB + desc BTRDB + 7 + 7 + read-write + + + BENP + desc BENP + 8 + 8 + read-write + + + BSEP + desc BSEP + 9 + 9 + read-write + + + BTRUP + desc BTRUP + 10 + 10 + read-write + + + BTRDP + desc BTRDP + 11 + 11 + read-write + + + BENSPA + desc BENSPA + 16 + 16 + read-write + + + BSESPA + desc BSESPA + 17 + 17 + read-write + + + BTRUSPA + desc BTRUSPA + 18 + 18 + read-write + + + BTRDSPA + desc BTRDSPA + 19 + 19 + read-write + + + BENSPB + desc BENSPB + 20 + 20 + read-write + + + BSESPB + desc BSESPB + 21 + 21 + read-write + + + BTRUSPB + desc BTRUSPB + 22 + 22 + read-write + + + BTRDSPB + desc BTRDSPB + 23 + 23 + read-write + + + + + DCONR + desc DCONR + 0x14C + 32 + read-write + 0x0 + 0xF3 + + + DTCEN + desc DTCEN + 0 + 0 + read-write + + + SEPA + desc SEPA + 1 + 1 + read-write + + + DTBENU + desc DTBENU + 4 + 4 + read-write + + + DTBEND + desc DTBEND + 5 + 5 + read-write + + + DTBTRU + desc DTBTRU + 6 + 6 + read-write + + + DTBTRD + desc DTBTRD + 7 + 7 + read-write + + + + + PCNAR + desc PCNAR + 0x154 + 32 + read-write + 0x0 + 0x93F3FFFF + + + STACA + desc STACA + 1 + 0 + read-write + + + STPCA + desc STPCA + 3 + 2 + read-write + + + OVFCA + desc OVFCA + 5 + 4 + read-write + + + UDFCA + desc UDFCA + 7 + 6 + read-write + + + CMAUCA + desc CMAUCA + 9 + 8 + read-write + + + CMADCA + desc CMADCA + 11 + 10 + read-write + + + CMBUCA + desc CMBUCA + 13 + 12 + read-write + + + CMBDCA + desc CMBDCA + 15 + 14 + read-write + + + FORCA + desc FORCA + 17 + 16 + read-write + + + EMBCA + desc EMBCA + 21 + 20 + read-write + + + EMBRA + desc EMBRA + 23 + 22 + read-write + + + EMBSA + desc EMBSA + 25 + 24 + read-write + + + OUTENA + desc OUTENA + 28 + 28 + read-write + + + CAPMDA + desc CAPMDA + 31 + 31 + read-write + + + + + PCNBR + desc PCNBR + 0x158 + 32 + read-write + 0x0 + 0x93F3FFFF + + + STACB + desc STACB + 1 + 0 + read-write + + + STPCB + desc STPCB + 3 + 2 + read-write + + + OVFCB + desc OVFCB + 5 + 4 + read-write + + + UDFCB + desc UDFCB + 7 + 6 + read-write + + + CMAUCB + desc CMAUCB + 9 + 8 + read-write + + + CMADCB + desc CMADCB + 11 + 10 + read-write + + + CMBUCB + desc CMBUCB + 13 + 12 + read-write + + + CMBDCB + desc CMBDCB + 15 + 14 + read-write + + + FORCB + desc FORCB + 17 + 16 + read-write + + + EMBCB + desc EMBCB + 21 + 20 + read-write + + + EMBRB + desc EMBRB + 23 + 22 + read-write + + + EMBSB + desc EMBSB + 25 + 24 + read-write + + + OUTENB + desc OUTENB + 28 + 28 + read-write + + + CAPMDB + desc CAPMDB + 31 + 31 + read-write + + + + + FCNGR + desc FCNGR + 0x15C + 32 + read-write + 0x0 + 0x77 + + + NOFIENGA + desc NOFIENGA + 0 + 0 + read-write + + + NOFICKGA + desc NOFICKGA + 2 + 1 + read-write + + + NOFIENGB + desc NOFIENGB + 4 + 4 + read-write + + + NOFICKGB + desc NOFICKGB + 6 + 5 + read-write + + + + + VPERR + desc VPERR + 0x160 + 32 + read-write + 0x0 + 0x1F0300 + + + SPPERIA + desc SPPERIA + 8 + 8 + read-write + + + SPPERIB + desc SPPERIB + 9 + 9 + read-write + + + PCNTE + desc PCNTE + 17 + 16 + read-write + + + PCNTS + desc PCNTS + 20 + 18 + read-write + + + + + STFLR + desc STFLR + 0x164 + 32 + read-write + 0x80000000 + 0x80E01FFF + + + CMAF + desc CMAF + 0 + 0 + read-write + + + CMBF + desc CMBF + 1 + 1 + read-write + + + CMCF + desc CMCF + 2 + 2 + read-write + + + CMDF + desc CMDF + 3 + 3 + read-write + + + CMEF + desc CMEF + 4 + 4 + read-write + + + CMFF + desc CMFF + 5 + 5 + read-write + + + OVFF + desc OVFF + 6 + 6 + read-write + + + UDFF + desc UDFF + 7 + 7 + read-write + + + DTEF + desc DTEF + 8 + 8 + read-only + + + CMSAUF + desc CMSAUF + 9 + 9 + read-write + + + CMSADF + desc CMSADF + 10 + 10 + read-write + + + CMSBUF + desc CMSBUF + 11 + 11 + read-write + + + CMSBDF + desc CMSBDF + 12 + 12 + read-write + + + VPERNUM + desc VPERNUM + 23 + 21 + read-only + + + DIRF + desc DIRF + 31 + 31 + read-only + + + + + HSTAR + desc HSTAR + 0x180 + 32 + read-write + 0x0 + 0xFF0F8F + + + HSTA0 + desc HSTA0 + 0 + 0 + read-write + + + HSTA1 + desc HSTA1 + 1 + 1 + read-write + + + HSTA2 + desc HSTA2 + 2 + 2 + read-write + + + HSTA3 + desc HSTA3 + 3 + 3 + read-write + + + STAS + desc STAS + 7 + 7 + read-write + + + HSTA8 + desc HSTA8 + 8 + 8 + read-write + + + HSTA9 + desc HSTA9 + 9 + 9 + read-write + + + HSTA10 + desc HSTA10 + 10 + 10 + read-write + + + HSTA11 + desc HSTA11 + 11 + 11 + read-write + + + HSTA16 + desc HSTA16 + 16 + 16 + read-write + + + HSTA17 + desc HSTA17 + 17 + 17 + read-write + + + HSTA18 + desc HSTA18 + 18 + 18 + read-write + + + HSTA19 + desc HSTA19 + 19 + 19 + read-write + + + HSTA20 + desc HSTA20 + 20 + 20 + read-write + + + HSTA21 + desc HSTA21 + 21 + 21 + read-write + + + HSTA22 + desc HSTA22 + 22 + 22 + read-write + + + HSTA23 + desc HSTA23 + 23 + 23 + read-write + + + + + HSTPR + desc HSTPR + 0x184 + 32 + read-write + 0x0 + 0xFF0F8F + + + HSTP0 + desc HSTP0 + 0 + 0 + read-write + + + HSTP1 + desc HSTP1 + 1 + 1 + read-write + + + HSTP2 + desc HSTP2 + 2 + 2 + read-write + + + HSTP3 + desc HSTP3 + 3 + 3 + read-write + + + STPS + desc STPS + 7 + 7 + read-write + + + HSTP8 + desc HSTP8 + 8 + 8 + read-write + + + HSTP9 + desc HSTP9 + 9 + 9 + read-write + + + HSTP10 + desc HSTP10 + 10 + 10 + read-write + + + HSTP11 + desc HSTP11 + 11 + 11 + read-write + + + HSTP16 + desc HSTP16 + 16 + 16 + read-write + + + HSTP17 + desc HSTP17 + 17 + 17 + read-write + + + HSTP18 + desc HSTP18 + 18 + 18 + read-write + + + HSTP19 + desc HSTP19 + 19 + 19 + read-write + + + HSTP20 + desc HSTP20 + 20 + 20 + read-write + + + HSTP21 + desc HSTP21 + 21 + 21 + read-write + + + HSTP22 + desc HSTP22 + 22 + 22 + read-write + + + HSTP23 + desc HSTP23 + 23 + 23 + read-write + + + + + HCLRR + desc HCLRR + 0x188 + 32 + read-write + 0x0 + 0xFF0F8F + + + HCLE0 + desc HCLE0 + 0 + 0 + read-write + + + HCLE1 + desc HCLE1 + 1 + 1 + read-write + + + HCLE2 + desc HCLE2 + 2 + 2 + read-write + + + HCLE3 + desc HCLE3 + 3 + 3 + read-write + + + CLES + desc CLES + 7 + 7 + read-write + + + HCLE8 + desc HCLE8 + 8 + 8 + read-write + + + HCLE9 + desc HCLE9 + 9 + 9 + read-write + + + HCLE10 + desc HCLE10 + 10 + 10 + read-write + + + HCLE11 + desc HCLE11 + 11 + 11 + read-write + + + HCLE16 + desc HCLE16 + 16 + 16 + read-write + + + HCLE17 + desc HCLE17 + 17 + 17 + read-write + + + HCLE18 + desc HCLE18 + 18 + 18 + read-write + + + HCLE19 + desc HCLE19 + 19 + 19 + read-write + + + HCLE20 + desc HCLE20 + 20 + 20 + read-write + + + HCLE21 + desc HCLE21 + 21 + 21 + read-write + + + HCLE22 + desc HCLE22 + 22 + 22 + read-write + + + HCLE23 + desc HCLE23 + 23 + 23 + read-write + + + + + HUPDR + desc HUPDR + 0x18C + 32 + read-write + 0x0 + 0xFF0F8F + + + HUPD0 + desc HUPD0 + 0 + 0 + read-write + + + HUPD1 + desc HUPD1 + 1 + 1 + read-write + + + HUPD2 + desc HUPD2 + 2 + 2 + read-write + + + HUPD3 + desc HUPD3 + 3 + 3 + read-write + + + UPDS + desc UPDS + 7 + 7 + read-write + + + HUPD8 + desc HUPD8 + 8 + 8 + read-write + + + HUPD9 + desc HUPD9 + 9 + 9 + read-write + + + HUPD10 + desc HUPD10 + 10 + 10 + read-write + + + HUPD11 + desc HUPD11 + 11 + 11 + read-write + + + HUPD16 + desc HUPD16 + 16 + 16 + read-write + + + HUPD17 + desc HUPD17 + 17 + 17 + read-write + + + HUPD18 + desc HUPD18 + 18 + 18 + read-write + + + HUPD19 + desc HUPD19 + 19 + 19 + read-write + + + HUPD20 + desc HUPD20 + 20 + 20 + read-write + + + HUPD21 + desc HUPD21 + 21 + 21 + read-write + + + HUPD22 + desc HUPD22 + 22 + 22 + read-write + + + HUPD23 + desc HUPD23 + 23 + 23 + read-write + + + + + HCPAR + desc HCPAR + 0x190 + 32 + read-write + 0x0 + 0xFF0F0F + + + HCPA0 + desc HCPA0 + 0 + 0 + read-write + + + HCPA1 + desc HCPA1 + 1 + 1 + read-write + + + HCPA2 + desc HCPA2 + 2 + 2 + read-write + + + HCPA3 + desc HCPA3 + 3 + 3 + read-write + + + HCPA8 + desc HCPA8 + 8 + 8 + read-write + + + HCPA9 + desc HCPA9 + 9 + 9 + read-write + + + HCPA10 + desc HCPA10 + 10 + 10 + read-write + + + HCPA11 + desc HCPA11 + 11 + 11 + read-write + + + HCPA16 + desc HCPA16 + 16 + 16 + read-write + + + HCPA17 + desc HCPA17 + 17 + 17 + read-write + + + HCPA18 + desc HCPA18 + 18 + 18 + read-write + + + HCPA19 + desc HCPA19 + 19 + 19 + read-write + + + HCPA20 + desc HCPA20 + 20 + 20 + read-write + + + HCPA21 + desc HCPA21 + 21 + 21 + read-write + + + HCPA22 + desc HCPA22 + 22 + 22 + read-write + + + HCPA23 + desc HCPA23 + 23 + 23 + read-write + + + + + HCPBR + desc HCPBR + 0x194 + 32 + read-write + 0x0 + 0xFF0F0F + + + HCPB0 + desc HCPB0 + 0 + 0 + read-write + + + HCPB1 + desc HCPB1 + 1 + 1 + read-write + + + HCPB2 + desc HCPB2 + 2 + 2 + read-write + + + HCPB3 + desc HCPB3 + 3 + 3 + read-write + + + HCPB8 + desc HCPB8 + 8 + 8 + read-write + + + HCPB9 + desc HCPB9 + 9 + 9 + read-write + + + HCPB10 + desc HCPB10 + 10 + 10 + read-write + + + HCPB11 + desc HCPB11 + 11 + 11 + read-write + + + HCPB16 + desc HCPB16 + 16 + 16 + read-write + + + HCPB17 + desc HCPB17 + 17 + 17 + read-write + + + HCPB18 + desc HCPB18 + 18 + 18 + read-write + + + HCPB19 + desc HCPB19 + 19 + 19 + read-write + + + HCPB20 + desc HCPB20 + 20 + 20 + read-write + + + HCPB21 + desc HCPB21 + 21 + 21 + read-write + + + HCPB22 + desc HCPB22 + 22 + 22 + read-write + + + HCPB23 + desc HCPB23 + 23 + 23 + read-write + + + + + HCUPR + desc HCUPR + 0x198 + 32 + read-write + 0x0 + 0xFF0FFF + + + HCUP0 + desc HCUP0 + 0 + 0 + read-write + + + HCUP1 + desc HCUP1 + 1 + 1 + read-write + + + HCUP2 + desc HCUP2 + 2 + 2 + read-write + + + HCUP3 + desc HCUP3 + 3 + 3 + read-write + + + HCUP4 + desc HCUP4 + 4 + 4 + read-write + + + HCUP5 + desc HCUP5 + 5 + 5 + read-write + + + HCUP6 + desc HCUP6 + 6 + 6 + read-write + + + HCUP7 + desc HCUP7 + 7 + 7 + read-write + + + HCUP8 + desc HCUP8 + 8 + 8 + read-write + + + HCUP9 + desc HCUP9 + 9 + 9 + read-write + + + HCUP10 + desc HCUP10 + 10 + 10 + read-write + + + HCUP11 + desc HCUP11 + 11 + 11 + read-write + + + HCUP16 + desc HCUP16 + 16 + 16 + read-write + + + HCUP17 + desc HCUP17 + 17 + 17 + read-write + + + HCUP18 + desc HCUP18 + 18 + 18 + read-write + + + HCUP19 + desc HCUP19 + 19 + 19 + read-write + + + HCUP20 + desc HCUP20 + 20 + 20 + read-write + + + HCUP21 + desc HCUP21 + 21 + 21 + read-write + + + HCUP22 + desc HCUP22 + 22 + 22 + read-write + + + HCUP23 + desc HCUP23 + 23 + 23 + read-write + + + + + HCDOR + desc HCDOR + 0x19C + 32 + read-write + 0x0 + 0xFF0FFF + + + HCDO0 + desc HCDO0 + 0 + 0 + read-write + + + HCDO1 + desc HCDO1 + 1 + 1 + read-write + + + HCDO2 + desc HCDO2 + 2 + 2 + read-write + + + HCDO3 + desc HCDO3 + 3 + 3 + read-write + + + HCDO4 + desc HCDO4 + 4 + 4 + read-write + + + HCDO5 + desc HCDO5 + 5 + 5 + read-write + + + HCDO6 + desc HCDO6 + 6 + 6 + read-write + + + HCDO7 + desc HCDO7 + 7 + 7 + read-write + + + HCDO8 + desc HCDO8 + 8 + 8 + read-write + + + HCDO9 + desc HCDO9 + 9 + 9 + read-write + + + HCDO10 + desc HCDO10 + 10 + 10 + read-write + + + HCDO11 + desc HCDO11 + 11 + 11 + read-write + + + HCDO16 + desc HCDO16 + 16 + 16 + read-write + + + HCDO17 + desc HCDO17 + 17 + 17 + read-write + + + HCDO18 + desc HCDO18 + 18 + 18 + read-write + + + HCDO19 + desc HCDO19 + 19 + 19 + read-write + + + HCDO20 + desc HCDO20 + 20 + 20 + read-write + + + HCDO21 + desc HCDO21 + 21 + 21 + read-write + + + HCDO22 + desc HCDO22 + 22 + 22 + read-write + + + HCDO23 + desc HCDO23 + 23 + 23 + read-write + + + + + + + TMRA1 + desc TMRA + 0x4003A000 + + 0x0 + 0x150 + + + + CNTER + desc CNTER + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNT + desc CNT + 15 + 0 + read-write + + + + + PERAR + desc PERAR + 0x4 + 32 + read-write + 0xFFFF + 0xFFFF + + + PER + desc PER + 15 + 0 + read-write + + + + + CMPAR1 + desc CMPAR1 + 0x40 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR2 + desc CMPAR2 + 0x44 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR3 + desc CMPAR3 + 0x48 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR4 + desc CMPAR4 + 0x4C + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + BCSTR + desc BCSTR + 0x80 + 32 + read-write + 0x2 + 0xF1FF + + + START + desc START + 0 + 0 + read-write + + + DIR + desc DIR + 1 + 1 + read-write + + + MODE + desc MODE + 2 + 2 + read-write + + + SYNST + desc SYNST + 3 + 3 + read-write + + + CKDIV + desc CKDIV + 7 + 4 + read-write + + + OVSTP + desc OVSTP + 8 + 8 + read-write + + + ITENOVF + desc ITENOVF + 12 + 12 + read-write + + + ITENUDF + desc ITENUDF + 13 + 13 + read-write + + + OVFF + desc OVFF + 14 + 14 + read-write + + + UDFF + desc UDFF + 15 + 15 + read-write + + + + + HCONR + desc HCONR + 0x84 + 32 + read-write + 0x0 + 0xF777 + + + HSTA0 + desc HSTA0 + 0 + 0 + read-write + + + HSTA1 + desc HSTA1 + 1 + 1 + read-write + + + HSTA2 + desc HSTA2 + 2 + 2 + read-write + + + HSTP0 + desc HSTP0 + 4 + 4 + read-write + + + HSTP1 + desc HSTP1 + 5 + 5 + read-write + + + HSTP2 + desc HSTP2 + 6 + 6 + read-write + + + HCLE0 + desc HCLE0 + 8 + 8 + read-write + + + HCLE1 + desc HCLE1 + 9 + 9 + read-write + + + HCLE2 + desc HCLE2 + 10 + 10 + read-write + + + HCLE3 + desc HCLE3 + 12 + 12 + read-write + + + HCLE4 + desc HCLE4 + 13 + 13 + read-write + + + HCLE5 + desc HCLE5 + 14 + 14 + read-write + + + HCLE6 + desc HCLE6 + 15 + 15 + read-write + + + + + HCUPR + desc HCUPR + 0x88 + 32 + read-write + 0x0 + 0x1FFF + + + HCUP0 + desc HCUP0 + 0 + 0 + read-write + + + HCUP1 + desc HCUP1 + 1 + 1 + read-write + + + HCUP2 + desc HCUP2 + 2 + 2 + read-write + + + HCUP3 + desc HCUP3 + 3 + 3 + read-write + + + HCUP4 + desc HCUP4 + 4 + 4 + read-write + + + HCUP5 + desc HCUP5 + 5 + 5 + read-write + + + HCUP6 + desc HCUP6 + 6 + 6 + read-write + + + HCUP7 + desc HCUP7 + 7 + 7 + read-write + + + HCUP8 + desc HCUP8 + 8 + 8 + read-write + + + HCUP9 + desc HCUP9 + 9 + 9 + read-write + + + HCUP10 + desc HCUP10 + 10 + 10 + read-write + + + HCUP11 + desc HCUP11 + 11 + 11 + read-write + + + HCUP12 + desc HCUP12 + 12 + 12 + read-write + + + + + HCDOR + desc HCDOR + 0x8C + 32 + read-write + 0x0 + 0x1FFF + + + HCDO0 + desc HCDO0 + 0 + 0 + read-write + + + HCDO1 + desc HCDO1 + 1 + 1 + read-write + + + HCDO2 + desc HCDO2 + 2 + 2 + read-write + + + HCDO3 + desc HCDO3 + 3 + 3 + read-write + + + HCDO4 + desc HCDO4 + 4 + 4 + read-write + + + HCDO5 + desc HCDO5 + 5 + 5 + read-write + + + HCDO6 + desc HCDO6 + 6 + 6 + read-write + + + HCDO7 + desc HCDO7 + 7 + 7 + read-write + + + HCDO8 + desc HCDO8 + 8 + 8 + read-write + + + HCDO9 + desc HCDO9 + 9 + 9 + read-write + + + HCDO10 + desc HCDO10 + 10 + 10 + read-write + + + HCDO11 + desc HCDO11 + 11 + 11 + read-write + + + HCDO12 + desc HCDO12 + 12 + 12 + read-write + + + + + ICONR + desc ICONR + 0x90 + 32 + read-write + 0x0 + 0xF + + + ITEN1 + desc ITEN1 + 0 + 0 + read-write + + + ITEN2 + desc ITEN2 + 1 + 1 + read-write + + + ITEN3 + desc ITEN3 + 2 + 2 + read-write + + + ITEN4 + desc ITEN4 + 3 + 3 + read-write + + + + + ECONR + desc ECONR + 0x94 + 32 + read-write + 0x0 + 0xF + + + ETEN1 + desc ETEN1 + 0 + 0 + read-write + + + ETEN2 + desc ETEN2 + 1 + 1 + read-write + + + ETEN3 + desc ETEN3 + 2 + 2 + read-write + + + ETEN4 + desc ETEN4 + 3 + 3 + read-write + + + + + FCONR + desc FCONR + 0x98 + 32 + read-write + 0x0 + 0x7707 + + + NOFIENTG + desc NOFIENTG + 0 + 0 + read-write + + + NOFICKTG + desc NOFICKTG + 2 + 1 + read-write + + + NOFIENCA + desc NOFIENCA + 8 + 8 + read-write + + + NOFICKCA + desc NOFICKCA + 10 + 9 + read-write + + + NOFIENCB + desc NOFIENCB + 12 + 12 + read-write + + + NOFICKCB + desc NOFICKCB + 14 + 13 + read-write + + + + + STFLR + desc STFLR + 0x9C + 32 + read-write + 0x0 + 0xF + + + CMPF1 + desc CMPF1 + 0 + 0 + read-write + + + CMPF2 + desc CMPF2 + 1 + 1 + read-write + + + CMPF3 + desc CMPF3 + 2 + 2 + read-write + + + CMPF4 + desc CMPF4 + 3 + 3 + read-write + + + + + BCONR1 + desc BCONR1 + 0xC0 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + BCONR2 + desc BCONR2 + 0xC8 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + CCONR1 + desc CCONR1 + 0x100 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR2 + desc CCONR2 + 0x104 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR3 + desc CCONR3 + 0x108 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR4 + desc CCONR4 + 0x10C + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + PCONR1 + desc PCONR1 + 0x140 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR2 + desc PCONR2 + 0x144 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR3 + desc PCONR3 + 0x148 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR4 + desc PCONR4 + 0x14C + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + + + TMRA10 + desc TMRA10 + 0x40027400 + + 0x0 + 0x150 + + + + CNTER + desc CNTER + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNT + desc CNT + 15 + 0 + read-write + + + + + PERAR + desc PERAR + 0x4 + 32 + read-write + 0xFFFF + 0xFFFF + + + PER + desc PER + 15 + 0 + read-write + + + + + CMPAR1 + desc CMPAR1 + 0x40 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR2 + desc CMPAR2 + 0x44 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR3 + desc CMPAR3 + 0x48 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR4 + desc CMPAR4 + 0x4C + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + BCSTR + desc BCSTR + 0x80 + 32 + read-write + 0x2 + 0xF1FF + + + START + desc START + 0 + 0 + read-write + + + DIR + desc DIR + 1 + 1 + read-write + + + MODE + desc MODE + 2 + 2 + read-write + + + SYNST + desc SYNST + 3 + 3 + read-write + + + CKDIV + desc CKDIV + 7 + 4 + read-write + + + OVSTP + desc OVSTP + 8 + 8 + read-write + + + ITENOVF + desc ITENOVF + 12 + 12 + read-write + + + ITENUDF + desc ITENUDF + 13 + 13 + read-write + + + OVFF + desc OVFF + 14 + 14 + read-write + + + UDFF + desc UDFF + 15 + 15 + read-write + + + + + HCONR + desc HCONR + 0x84 + 32 + read-write + 0x0 + 0xF777 + + + HSTA0 + desc HSTA0 + 0 + 0 + read-write + + + HSTA1 + desc HSTA1 + 1 + 1 + read-write + + + HSTA2 + desc HSTA2 + 2 + 2 + read-write + + + HSTP0 + desc HSTP0 + 4 + 4 + read-write + + + HSTP1 + desc HSTP1 + 5 + 5 + read-write + + + HSTP2 + desc HSTP2 + 6 + 6 + read-write + + + HCLE0 + desc HCLE0 + 8 + 8 + read-write + + + HCLE1 + desc HCLE1 + 9 + 9 + read-write + + + HCLE2 + desc HCLE2 + 10 + 10 + read-write + + + HCLE3 + desc HCLE3 + 12 + 12 + read-write + + + HCLE4 + desc HCLE4 + 13 + 13 + read-write + + + HCLE5 + desc HCLE5 + 14 + 14 + read-write + + + HCLE6 + desc HCLE6 + 15 + 15 + read-write + + + + + HCUPR + desc HCUPR + 0x88 + 32 + read-write + 0x0 + 0x1FFF + + + HCUP0 + desc HCUP0 + 0 + 0 + read-write + + + HCUP1 + desc HCUP1 + 1 + 1 + read-write + + + HCUP2 + desc HCUP2 + 2 + 2 + read-write + + + HCUP3 + desc HCUP3 + 3 + 3 + read-write + + + HCUP4 + desc HCUP4 + 4 + 4 + read-write + + + HCUP5 + desc HCUP5 + 5 + 5 + read-write + + + HCUP6 + desc HCUP6 + 6 + 6 + read-write + + + HCUP7 + desc HCUP7 + 7 + 7 + read-write + + + HCUP8 + desc HCUP8 + 8 + 8 + read-write + + + HCUP9 + desc HCUP9 + 9 + 9 + read-write + + + HCUP10 + desc HCUP10 + 10 + 10 + read-write + + + HCUP11 + desc HCUP11 + 11 + 11 + read-write + + + HCUP12 + desc HCUP12 + 12 + 12 + read-write + + + + + HCDOR + desc HCDOR + 0x8C + 32 + read-write + 0x0 + 0x1FFF + + + HCDO0 + desc HCDO0 + 0 + 0 + read-write + + + HCDO1 + desc HCDO1 + 1 + 1 + read-write + + + HCDO2 + desc HCDO2 + 2 + 2 + read-write + + + HCDO3 + desc HCDO3 + 3 + 3 + read-write + + + HCDO4 + desc HCDO4 + 4 + 4 + read-write + + + HCDO5 + desc HCDO5 + 5 + 5 + read-write + + + HCDO6 + desc HCDO6 + 6 + 6 + read-write + + + HCDO7 + desc HCDO7 + 7 + 7 + read-write + + + HCDO8 + desc HCDO8 + 8 + 8 + read-write + + + HCDO9 + desc HCDO9 + 9 + 9 + read-write + + + HCDO10 + desc HCDO10 + 10 + 10 + read-write + + + HCDO11 + desc HCDO11 + 11 + 11 + read-write + + + HCDO12 + desc HCDO12 + 12 + 12 + read-write + + + + + ICONR + desc ICONR + 0x90 + 32 + read-write + 0x0 + 0xF + + + ITEN1 + desc ITEN1 + 0 + 0 + read-write + + + ITEN2 + desc ITEN2 + 1 + 1 + read-write + + + ITEN3 + desc ITEN3 + 2 + 2 + read-write + + + ITEN4 + desc ITEN4 + 3 + 3 + read-write + + + + + ECONR + desc ECONR + 0x94 + 32 + read-write + 0x0 + 0xF + + + ETEN1 + desc ETEN1 + 0 + 0 + read-write + + + ETEN2 + desc ETEN2 + 1 + 1 + read-write + + + ETEN3 + desc ETEN3 + 2 + 2 + read-write + + + ETEN4 + desc ETEN4 + 3 + 3 + read-write + + + + + FCONR + desc FCONR + 0x98 + 32 + read-write + 0x0 + 0x7707 + + + NOFIENTG + desc NOFIENTG + 0 + 0 + read-write + + + NOFICKTG + desc NOFICKTG + 2 + 1 + read-write + + + NOFIENCA + desc NOFIENCA + 8 + 8 + read-write + + + NOFICKCA + desc NOFICKCA + 10 + 9 + read-write + + + NOFIENCB + desc NOFIENCB + 12 + 12 + read-write + + + NOFICKCB + desc NOFICKCB + 14 + 13 + read-write + + + + + STFLR + desc STFLR + 0x9C + 32 + read-write + 0x0 + 0xF + + + CMPF1 + desc CMPF1 + 0 + 0 + read-write + + + CMPF2 + desc CMPF2 + 1 + 1 + read-write + + + CMPF3 + desc CMPF3 + 2 + 2 + read-write + + + CMPF4 + desc CMPF4 + 3 + 3 + read-write + + + + + BCONR1 + desc BCONR1 + 0xC0 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + BCONR2 + desc BCONR2 + 0xC8 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + CCONR1 + desc CCONR1 + 0x100 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR2 + desc CCONR2 + 0x104 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR3 + desc CCONR3 + 0x108 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR4 + desc CCONR4 + 0x10C + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + PCONR1 + desc PCONR1 + 0x140 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR2 + desc PCONR2 + 0x144 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR3 + desc PCONR3 + 0x148 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR4 + desc PCONR4 + 0x14C + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + + + TMRA11 + desc TMRA11 + 0x40027800 + + 0x0 + 0x150 + + + + CNTER + desc CNTER + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNT + desc CNT + 15 + 0 + read-write + + + + + PERAR + desc PERAR + 0x4 + 32 + read-write + 0xFFFF + 0xFFFF + + + PER + desc PER + 15 + 0 + read-write + + + + + CMPAR1 + desc CMPAR1 + 0x40 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR2 + desc CMPAR2 + 0x44 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR3 + desc CMPAR3 + 0x48 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR4 + desc CMPAR4 + 0x4C + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + BCSTR + desc BCSTR + 0x80 + 32 + read-write + 0x2 + 0xF1FF + + + START + desc START + 0 + 0 + read-write + + + DIR + desc DIR + 1 + 1 + read-write + + + MODE + desc MODE + 2 + 2 + read-write + + + SYNST + desc SYNST + 3 + 3 + read-write + + + CKDIV + desc CKDIV + 7 + 4 + read-write + + + OVSTP + desc OVSTP + 8 + 8 + read-write + + + ITENOVF + desc ITENOVF + 12 + 12 + read-write + + + ITENUDF + desc ITENUDF + 13 + 13 + read-write + + + OVFF + desc OVFF + 14 + 14 + read-write + + + UDFF + desc UDFF + 15 + 15 + read-write + + + + + HCONR + desc HCONR + 0x84 + 32 + read-write + 0x0 + 0xF777 + + + HSTA0 + desc HSTA0 + 0 + 0 + read-write + + + HSTA1 + desc HSTA1 + 1 + 1 + read-write + + + HSTA2 + desc HSTA2 + 2 + 2 + read-write + + + HSTP0 + desc HSTP0 + 4 + 4 + read-write + + + HSTP1 + desc HSTP1 + 5 + 5 + read-write + + + HSTP2 + desc HSTP2 + 6 + 6 + read-write + + + HCLE0 + desc HCLE0 + 8 + 8 + read-write + + + HCLE1 + desc HCLE1 + 9 + 9 + read-write + + + HCLE2 + desc HCLE2 + 10 + 10 + read-write + + + HCLE3 + desc HCLE3 + 12 + 12 + read-write + + + HCLE4 + desc HCLE4 + 13 + 13 + read-write + + + HCLE5 + desc HCLE5 + 14 + 14 + read-write + + + HCLE6 + desc HCLE6 + 15 + 15 + read-write + + + + + HCUPR + desc HCUPR + 0x88 + 32 + read-write + 0x0 + 0x1FFF + + + HCUP0 + desc HCUP0 + 0 + 0 + read-write + + + HCUP1 + desc HCUP1 + 1 + 1 + read-write + + + HCUP2 + desc HCUP2 + 2 + 2 + read-write + + + HCUP3 + desc HCUP3 + 3 + 3 + read-write + + + HCUP4 + desc HCUP4 + 4 + 4 + read-write + + + HCUP5 + desc HCUP5 + 5 + 5 + read-write + + + HCUP6 + desc HCUP6 + 6 + 6 + read-write + + + HCUP7 + desc HCUP7 + 7 + 7 + read-write + + + HCUP8 + desc HCUP8 + 8 + 8 + read-write + + + HCUP9 + desc HCUP9 + 9 + 9 + read-write + + + HCUP10 + desc HCUP10 + 10 + 10 + read-write + + + HCUP11 + desc HCUP11 + 11 + 11 + read-write + + + HCUP12 + desc HCUP12 + 12 + 12 + read-write + + + + + HCDOR + desc HCDOR + 0x8C + 32 + read-write + 0x0 + 0x1FFF + + + HCDO0 + desc HCDO0 + 0 + 0 + read-write + + + HCDO1 + desc HCDO1 + 1 + 1 + read-write + + + HCDO2 + desc HCDO2 + 2 + 2 + read-write + + + HCDO3 + desc HCDO3 + 3 + 3 + read-write + + + HCDO4 + desc HCDO4 + 4 + 4 + read-write + + + HCDO5 + desc HCDO5 + 5 + 5 + read-write + + + HCDO6 + desc HCDO6 + 6 + 6 + read-write + + + HCDO7 + desc HCDO7 + 7 + 7 + read-write + + + HCDO8 + desc HCDO8 + 8 + 8 + read-write + + + HCDO9 + desc HCDO9 + 9 + 9 + read-write + + + HCDO10 + desc HCDO10 + 10 + 10 + read-write + + + HCDO11 + desc HCDO11 + 11 + 11 + read-write + + + HCDO12 + desc HCDO12 + 12 + 12 + read-write + + + + + ICONR + desc ICONR + 0x90 + 32 + read-write + 0x0 + 0xF + + + ITEN1 + desc ITEN1 + 0 + 0 + read-write + + + ITEN2 + desc ITEN2 + 1 + 1 + read-write + + + ITEN3 + desc ITEN3 + 2 + 2 + read-write + + + ITEN4 + desc ITEN4 + 3 + 3 + read-write + + + + + ECONR + desc ECONR + 0x94 + 32 + read-write + 0x0 + 0xF + + + ETEN1 + desc ETEN1 + 0 + 0 + read-write + + + ETEN2 + desc ETEN2 + 1 + 1 + read-write + + + ETEN3 + desc ETEN3 + 2 + 2 + read-write + + + ETEN4 + desc ETEN4 + 3 + 3 + read-write + + + + + FCONR + desc FCONR + 0x98 + 32 + read-write + 0x0 + 0x7707 + + + NOFIENTG + desc NOFIENTG + 0 + 0 + read-write + + + NOFICKTG + desc NOFICKTG + 2 + 1 + read-write + + + NOFIENCA + desc NOFIENCA + 8 + 8 + read-write + + + NOFICKCA + desc NOFICKCA + 10 + 9 + read-write + + + NOFIENCB + desc NOFIENCB + 12 + 12 + read-write + + + NOFICKCB + desc NOFICKCB + 14 + 13 + read-write + + + + + STFLR + desc STFLR + 0x9C + 32 + read-write + 0x0 + 0xF + + + CMPF1 + desc CMPF1 + 0 + 0 + read-write + + + CMPF2 + desc CMPF2 + 1 + 1 + read-write + + + CMPF3 + desc CMPF3 + 2 + 2 + read-write + + + CMPF4 + desc CMPF4 + 3 + 3 + read-write + + + + + BCONR1 + desc BCONR1 + 0xC0 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + BCONR2 + desc BCONR2 + 0xC8 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + CCONR1 + desc CCONR1 + 0x100 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR2 + desc CCONR2 + 0x104 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR3 + desc CCONR3 + 0x108 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR4 + desc CCONR4 + 0x10C + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + PCONR1 + desc PCONR1 + 0x140 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR2 + desc PCONR2 + 0x144 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR3 + desc PCONR3 + 0x148 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR4 + desc PCONR4 + 0x14C + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + + + TMRA12 + desc TMRA12 + 0x40027C00 + + 0x0 + 0x150 + + + + CNTER + desc CNTER + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNT + desc CNT + 15 + 0 + read-write + + + + + PERAR + desc PERAR + 0x4 + 32 + read-write + 0xFFFF + 0xFFFF + + + PER + desc PER + 15 + 0 + read-write + + + + + CMPAR1 + desc CMPAR1 + 0x40 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR2 + desc CMPAR2 + 0x44 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR3 + desc CMPAR3 + 0x48 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR4 + desc CMPAR4 + 0x4C + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + BCSTR + desc BCSTR + 0x80 + 32 + read-write + 0x2 + 0xF1FF + + + START + desc START + 0 + 0 + read-write + + + DIR + desc DIR + 1 + 1 + read-write + + + MODE + desc MODE + 2 + 2 + read-write + + + SYNST + desc SYNST + 3 + 3 + read-write + + + CKDIV + desc CKDIV + 7 + 4 + read-write + + + OVSTP + desc OVSTP + 8 + 8 + read-write + + + ITENOVF + desc ITENOVF + 12 + 12 + read-write + + + ITENUDF + desc ITENUDF + 13 + 13 + read-write + + + OVFF + desc OVFF + 14 + 14 + read-write + + + UDFF + desc UDFF + 15 + 15 + read-write + + + + + HCONR + desc HCONR + 0x84 + 32 + read-write + 0x0 + 0xF777 + + + HSTA0 + desc HSTA0 + 0 + 0 + read-write + + + HSTA1 + desc HSTA1 + 1 + 1 + read-write + + + HSTA2 + desc HSTA2 + 2 + 2 + read-write + + + HSTP0 + desc HSTP0 + 4 + 4 + read-write + + + HSTP1 + desc HSTP1 + 5 + 5 + read-write + + + HSTP2 + desc HSTP2 + 6 + 6 + read-write + + + HCLE0 + desc HCLE0 + 8 + 8 + read-write + + + HCLE1 + desc HCLE1 + 9 + 9 + read-write + + + HCLE2 + desc HCLE2 + 10 + 10 + read-write + + + HCLE3 + desc HCLE3 + 12 + 12 + read-write + + + HCLE4 + desc HCLE4 + 13 + 13 + read-write + + + HCLE5 + desc HCLE5 + 14 + 14 + read-write + + + HCLE6 + desc HCLE6 + 15 + 15 + read-write + + + + + HCUPR + desc HCUPR + 0x88 + 32 + read-write + 0x0 + 0x1FFF + + + HCUP0 + desc HCUP0 + 0 + 0 + read-write + + + HCUP1 + desc HCUP1 + 1 + 1 + read-write + + + HCUP2 + desc HCUP2 + 2 + 2 + read-write + + + HCUP3 + desc HCUP3 + 3 + 3 + read-write + + + HCUP4 + desc HCUP4 + 4 + 4 + read-write + + + HCUP5 + desc HCUP5 + 5 + 5 + read-write + + + HCUP6 + desc HCUP6 + 6 + 6 + read-write + + + HCUP7 + desc HCUP7 + 7 + 7 + read-write + + + HCUP8 + desc HCUP8 + 8 + 8 + read-write + + + HCUP9 + desc HCUP9 + 9 + 9 + read-write + + + HCUP10 + desc HCUP10 + 10 + 10 + read-write + + + HCUP11 + desc HCUP11 + 11 + 11 + read-write + + + HCUP12 + desc HCUP12 + 12 + 12 + read-write + + + + + HCDOR + desc HCDOR + 0x8C + 32 + read-write + 0x0 + 0x1FFF + + + HCDO0 + desc HCDO0 + 0 + 0 + read-write + + + HCDO1 + desc HCDO1 + 1 + 1 + read-write + + + HCDO2 + desc HCDO2 + 2 + 2 + read-write + + + HCDO3 + desc HCDO3 + 3 + 3 + read-write + + + HCDO4 + desc HCDO4 + 4 + 4 + read-write + + + HCDO5 + desc HCDO5 + 5 + 5 + read-write + + + HCDO6 + desc HCDO6 + 6 + 6 + read-write + + + HCDO7 + desc HCDO7 + 7 + 7 + read-write + + + HCDO8 + desc HCDO8 + 8 + 8 + read-write + + + HCDO9 + desc HCDO9 + 9 + 9 + read-write + + + HCDO10 + desc HCDO10 + 10 + 10 + read-write + + + HCDO11 + desc HCDO11 + 11 + 11 + read-write + + + HCDO12 + desc HCDO12 + 12 + 12 + read-write + + + + + ICONR + desc ICONR + 0x90 + 32 + read-write + 0x0 + 0xF + + + ITEN1 + desc ITEN1 + 0 + 0 + read-write + + + ITEN2 + desc ITEN2 + 1 + 1 + read-write + + + ITEN3 + desc ITEN3 + 2 + 2 + read-write + + + ITEN4 + desc ITEN4 + 3 + 3 + read-write + + + + + ECONR + desc ECONR + 0x94 + 32 + read-write + 0x0 + 0xF + + + ETEN1 + desc ETEN1 + 0 + 0 + read-write + + + ETEN2 + desc ETEN2 + 1 + 1 + read-write + + + ETEN3 + desc ETEN3 + 2 + 2 + read-write + + + ETEN4 + desc ETEN4 + 3 + 3 + read-write + + + + + FCONR + desc FCONR + 0x98 + 32 + read-write + 0x0 + 0x7707 + + + NOFIENTG + desc NOFIENTG + 0 + 0 + read-write + + + NOFICKTG + desc NOFICKTG + 2 + 1 + read-write + + + NOFIENCA + desc NOFIENCA + 8 + 8 + read-write + + + NOFICKCA + desc NOFICKCA + 10 + 9 + read-write + + + NOFIENCB + desc NOFIENCB + 12 + 12 + read-write + + + NOFICKCB + desc NOFICKCB + 14 + 13 + read-write + + + + + STFLR + desc STFLR + 0x9C + 32 + read-write + 0x0 + 0xF + + + CMPF1 + desc CMPF1 + 0 + 0 + read-write + + + CMPF2 + desc CMPF2 + 1 + 1 + read-write + + + CMPF3 + desc CMPF3 + 2 + 2 + read-write + + + CMPF4 + desc CMPF4 + 3 + 3 + read-write + + + + + BCONR1 + desc BCONR1 + 0xC0 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + BCONR2 + desc BCONR2 + 0xC8 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + CCONR1 + desc CCONR1 + 0x100 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR2 + desc CCONR2 + 0x104 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR3 + desc CCONR3 + 0x108 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR4 + desc CCONR4 + 0x10C + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + PCONR1 + desc PCONR1 + 0x140 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR2 + desc PCONR2 + 0x144 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR3 + desc PCONR3 + 0x148 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR4 + desc PCONR4 + 0x14C + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + + + TMRA2 + desc TMRA2 + 0x4003A400 + + 0x0 + 0x150 + + + + CNTER + desc CNTER + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNT + desc CNT + 15 + 0 + read-write + + + + + PERAR + desc PERAR + 0x4 + 32 + read-write + 0xFFFF + 0xFFFF + + + PER + desc PER + 15 + 0 + read-write + + + + + CMPAR1 + desc CMPAR1 + 0x40 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR2 + desc CMPAR2 + 0x44 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR3 + desc CMPAR3 + 0x48 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR4 + desc CMPAR4 + 0x4C + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + BCSTR + desc BCSTR + 0x80 + 32 + read-write + 0x2 + 0xF1FF + + + START + desc START + 0 + 0 + read-write + + + DIR + desc DIR + 1 + 1 + read-write + + + MODE + desc MODE + 2 + 2 + read-write + + + SYNST + desc SYNST + 3 + 3 + read-write + + + CKDIV + desc CKDIV + 7 + 4 + read-write + + + OVSTP + desc OVSTP + 8 + 8 + read-write + + + ITENOVF + desc ITENOVF + 12 + 12 + read-write + + + ITENUDF + desc ITENUDF + 13 + 13 + read-write + + + OVFF + desc OVFF + 14 + 14 + read-write + + + UDFF + desc UDFF + 15 + 15 + read-write + + + + + HCONR + desc HCONR + 0x84 + 32 + read-write + 0x0 + 0xF777 + + + HSTA0 + desc HSTA0 + 0 + 0 + read-write + + + HSTA1 + desc HSTA1 + 1 + 1 + read-write + + + HSTA2 + desc HSTA2 + 2 + 2 + read-write + + + HSTP0 + desc HSTP0 + 4 + 4 + read-write + + + HSTP1 + desc HSTP1 + 5 + 5 + read-write + + + HSTP2 + desc HSTP2 + 6 + 6 + read-write + + + HCLE0 + desc HCLE0 + 8 + 8 + read-write + + + HCLE1 + desc HCLE1 + 9 + 9 + read-write + + + HCLE2 + desc HCLE2 + 10 + 10 + read-write + + + HCLE3 + desc HCLE3 + 12 + 12 + read-write + + + HCLE4 + desc HCLE4 + 13 + 13 + read-write + + + HCLE5 + desc HCLE5 + 14 + 14 + read-write + + + HCLE6 + desc HCLE6 + 15 + 15 + read-write + + + + + HCUPR + desc HCUPR + 0x88 + 32 + read-write + 0x0 + 0x1FFF + + + HCUP0 + desc HCUP0 + 0 + 0 + read-write + + + HCUP1 + desc HCUP1 + 1 + 1 + read-write + + + HCUP2 + desc HCUP2 + 2 + 2 + read-write + + + HCUP3 + desc HCUP3 + 3 + 3 + read-write + + + HCUP4 + desc HCUP4 + 4 + 4 + read-write + + + HCUP5 + desc HCUP5 + 5 + 5 + read-write + + + HCUP6 + desc HCUP6 + 6 + 6 + read-write + + + HCUP7 + desc HCUP7 + 7 + 7 + read-write + + + HCUP8 + desc HCUP8 + 8 + 8 + read-write + + + HCUP9 + desc HCUP9 + 9 + 9 + read-write + + + HCUP10 + desc HCUP10 + 10 + 10 + read-write + + + HCUP11 + desc HCUP11 + 11 + 11 + read-write + + + HCUP12 + desc HCUP12 + 12 + 12 + read-write + + + + + HCDOR + desc HCDOR + 0x8C + 32 + read-write + 0x0 + 0x1FFF + + + HCDO0 + desc HCDO0 + 0 + 0 + read-write + + + HCDO1 + desc HCDO1 + 1 + 1 + read-write + + + HCDO2 + desc HCDO2 + 2 + 2 + read-write + + + HCDO3 + desc HCDO3 + 3 + 3 + read-write + + + HCDO4 + desc HCDO4 + 4 + 4 + read-write + + + HCDO5 + desc HCDO5 + 5 + 5 + read-write + + + HCDO6 + desc HCDO6 + 6 + 6 + read-write + + + HCDO7 + desc HCDO7 + 7 + 7 + read-write + + + HCDO8 + desc HCDO8 + 8 + 8 + read-write + + + HCDO9 + desc HCDO9 + 9 + 9 + read-write + + + HCDO10 + desc HCDO10 + 10 + 10 + read-write + + + HCDO11 + desc HCDO11 + 11 + 11 + read-write + + + HCDO12 + desc HCDO12 + 12 + 12 + read-write + + + + + ICONR + desc ICONR + 0x90 + 32 + read-write + 0x0 + 0xF + + + ITEN1 + desc ITEN1 + 0 + 0 + read-write + + + ITEN2 + desc ITEN2 + 1 + 1 + read-write + + + ITEN3 + desc ITEN3 + 2 + 2 + read-write + + + ITEN4 + desc ITEN4 + 3 + 3 + read-write + + + + + ECONR + desc ECONR + 0x94 + 32 + read-write + 0x0 + 0xF + + + ETEN1 + desc ETEN1 + 0 + 0 + read-write + + + ETEN2 + desc ETEN2 + 1 + 1 + read-write + + + ETEN3 + desc ETEN3 + 2 + 2 + read-write + + + ETEN4 + desc ETEN4 + 3 + 3 + read-write + + + + + FCONR + desc FCONR + 0x98 + 32 + read-write + 0x0 + 0x7707 + + + NOFIENTG + desc NOFIENTG + 0 + 0 + read-write + + + NOFICKTG + desc NOFICKTG + 2 + 1 + read-write + + + NOFIENCA + desc NOFIENCA + 8 + 8 + read-write + + + NOFICKCA + desc NOFICKCA + 10 + 9 + read-write + + + NOFIENCB + desc NOFIENCB + 12 + 12 + read-write + + + NOFICKCB + desc NOFICKCB + 14 + 13 + read-write + + + + + STFLR + desc STFLR + 0x9C + 32 + read-write + 0x0 + 0xF + + + CMPF1 + desc CMPF1 + 0 + 0 + read-write + + + CMPF2 + desc CMPF2 + 1 + 1 + read-write + + + CMPF3 + desc CMPF3 + 2 + 2 + read-write + + + CMPF4 + desc CMPF4 + 3 + 3 + read-write + + + + + BCONR1 + desc BCONR1 + 0xC0 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + BCONR2 + desc BCONR2 + 0xC8 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + CCONR1 + desc CCONR1 + 0x100 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR2 + desc CCONR2 + 0x104 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR3 + desc CCONR3 + 0x108 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR4 + desc CCONR4 + 0x10C + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + PCONR1 + desc PCONR1 + 0x140 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR2 + desc PCONR2 + 0x144 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR3 + desc PCONR3 + 0x148 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR4 + desc PCONR4 + 0x14C + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + + + TMRA3 + desc TMRA3 + 0x4003A800 + + 0x0 + 0x150 + + + + CNTER + desc CNTER + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNT + desc CNT + 15 + 0 + read-write + + + + + PERAR + desc PERAR + 0x4 + 32 + read-write + 0xFFFF + 0xFFFF + + + PER + desc PER + 15 + 0 + read-write + + + + + CMPAR1 + desc CMPAR1 + 0x40 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR2 + desc CMPAR2 + 0x44 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR3 + desc CMPAR3 + 0x48 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR4 + desc CMPAR4 + 0x4C + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + BCSTR + desc BCSTR + 0x80 + 32 + read-write + 0x2 + 0xF1FF + + + START + desc START + 0 + 0 + read-write + + + DIR + desc DIR + 1 + 1 + read-write + + + MODE + desc MODE + 2 + 2 + read-write + + + SYNST + desc SYNST + 3 + 3 + read-write + + + CKDIV + desc CKDIV + 7 + 4 + read-write + + + OVSTP + desc OVSTP + 8 + 8 + read-write + + + ITENOVF + desc ITENOVF + 12 + 12 + read-write + + + ITENUDF + desc ITENUDF + 13 + 13 + read-write + + + OVFF + desc OVFF + 14 + 14 + read-write + + + UDFF + desc UDFF + 15 + 15 + read-write + + + + + HCONR + desc HCONR + 0x84 + 32 + read-write + 0x0 + 0xF777 + + + HSTA0 + desc HSTA0 + 0 + 0 + read-write + + + HSTA1 + desc HSTA1 + 1 + 1 + read-write + + + HSTA2 + desc HSTA2 + 2 + 2 + read-write + + + HSTP0 + desc HSTP0 + 4 + 4 + read-write + + + HSTP1 + desc HSTP1 + 5 + 5 + read-write + + + HSTP2 + desc HSTP2 + 6 + 6 + read-write + + + HCLE0 + desc HCLE0 + 8 + 8 + read-write + + + HCLE1 + desc HCLE1 + 9 + 9 + read-write + + + HCLE2 + desc HCLE2 + 10 + 10 + read-write + + + HCLE3 + desc HCLE3 + 12 + 12 + read-write + + + HCLE4 + desc HCLE4 + 13 + 13 + read-write + + + HCLE5 + desc HCLE5 + 14 + 14 + read-write + + + HCLE6 + desc HCLE6 + 15 + 15 + read-write + + + + + HCUPR + desc HCUPR + 0x88 + 32 + read-write + 0x0 + 0x1FFF + + + HCUP0 + desc HCUP0 + 0 + 0 + read-write + + + HCUP1 + desc HCUP1 + 1 + 1 + read-write + + + HCUP2 + desc HCUP2 + 2 + 2 + read-write + + + HCUP3 + desc HCUP3 + 3 + 3 + read-write + + + HCUP4 + desc HCUP4 + 4 + 4 + read-write + + + HCUP5 + desc HCUP5 + 5 + 5 + read-write + + + HCUP6 + desc HCUP6 + 6 + 6 + read-write + + + HCUP7 + desc HCUP7 + 7 + 7 + read-write + + + HCUP8 + desc HCUP8 + 8 + 8 + read-write + + + HCUP9 + desc HCUP9 + 9 + 9 + read-write + + + HCUP10 + desc HCUP10 + 10 + 10 + read-write + + + HCUP11 + desc HCUP11 + 11 + 11 + read-write + + + HCUP12 + desc HCUP12 + 12 + 12 + read-write + + + + + HCDOR + desc HCDOR + 0x8C + 32 + read-write + 0x0 + 0x1FFF + + + HCDO0 + desc HCDO0 + 0 + 0 + read-write + + + HCDO1 + desc HCDO1 + 1 + 1 + read-write + + + HCDO2 + desc HCDO2 + 2 + 2 + read-write + + + HCDO3 + desc HCDO3 + 3 + 3 + read-write + + + HCDO4 + desc HCDO4 + 4 + 4 + read-write + + + HCDO5 + desc HCDO5 + 5 + 5 + read-write + + + HCDO6 + desc HCDO6 + 6 + 6 + read-write + + + HCDO7 + desc HCDO7 + 7 + 7 + read-write + + + HCDO8 + desc HCDO8 + 8 + 8 + read-write + + + HCDO9 + desc HCDO9 + 9 + 9 + read-write + + + HCDO10 + desc HCDO10 + 10 + 10 + read-write + + + HCDO11 + desc HCDO11 + 11 + 11 + read-write + + + HCDO12 + desc HCDO12 + 12 + 12 + read-write + + + + + ICONR + desc ICONR + 0x90 + 32 + read-write + 0x0 + 0xF + + + ITEN1 + desc ITEN1 + 0 + 0 + read-write + + + ITEN2 + desc ITEN2 + 1 + 1 + read-write + + + ITEN3 + desc ITEN3 + 2 + 2 + read-write + + + ITEN4 + desc ITEN4 + 3 + 3 + read-write + + + + + ECONR + desc ECONR + 0x94 + 32 + read-write + 0x0 + 0xF + + + ETEN1 + desc ETEN1 + 0 + 0 + read-write + + + ETEN2 + desc ETEN2 + 1 + 1 + read-write + + + ETEN3 + desc ETEN3 + 2 + 2 + read-write + + + ETEN4 + desc ETEN4 + 3 + 3 + read-write + + + + + FCONR + desc FCONR + 0x98 + 32 + read-write + 0x0 + 0x7707 + + + NOFIENTG + desc NOFIENTG + 0 + 0 + read-write + + + NOFICKTG + desc NOFICKTG + 2 + 1 + read-write + + + NOFIENCA + desc NOFIENCA + 8 + 8 + read-write + + + NOFICKCA + desc NOFICKCA + 10 + 9 + read-write + + + NOFIENCB + desc NOFIENCB + 12 + 12 + read-write + + + NOFICKCB + desc NOFICKCB + 14 + 13 + read-write + + + + + STFLR + desc STFLR + 0x9C + 32 + read-write + 0x0 + 0xF + + + CMPF1 + desc CMPF1 + 0 + 0 + read-write + + + CMPF2 + desc CMPF2 + 1 + 1 + read-write + + + CMPF3 + desc CMPF3 + 2 + 2 + read-write + + + CMPF4 + desc CMPF4 + 3 + 3 + read-write + + + + + BCONR1 + desc BCONR1 + 0xC0 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + BCONR2 + desc BCONR2 + 0xC8 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + CCONR1 + desc CCONR1 + 0x100 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR2 + desc CCONR2 + 0x104 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR3 + desc CCONR3 + 0x108 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR4 + desc CCONR4 + 0x10C + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + PCONR1 + desc PCONR1 + 0x140 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR2 + desc PCONR2 + 0x144 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR3 + desc PCONR3 + 0x148 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR4 + desc PCONR4 + 0x14C + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + + + TMRA4 + desc TMRA4 + 0x4003AC00 + + 0x0 + 0x150 + + + + CNTER + desc CNTER + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNT + desc CNT + 15 + 0 + read-write + + + + + PERAR + desc PERAR + 0x4 + 32 + read-write + 0xFFFF + 0xFFFF + + + PER + desc PER + 15 + 0 + read-write + + + + + CMPAR1 + desc CMPAR1 + 0x40 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR2 + desc CMPAR2 + 0x44 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR3 + desc CMPAR3 + 0x48 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR4 + desc CMPAR4 + 0x4C + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + BCSTR + desc BCSTR + 0x80 + 32 + read-write + 0x2 + 0xF1FF + + + START + desc START + 0 + 0 + read-write + + + DIR + desc DIR + 1 + 1 + read-write + + + MODE + desc MODE + 2 + 2 + read-write + + + SYNST + desc SYNST + 3 + 3 + read-write + + + CKDIV + desc CKDIV + 7 + 4 + read-write + + + OVSTP + desc OVSTP + 8 + 8 + read-write + + + ITENOVF + desc ITENOVF + 12 + 12 + read-write + + + ITENUDF + desc ITENUDF + 13 + 13 + read-write + + + OVFF + desc OVFF + 14 + 14 + read-write + + + UDFF + desc UDFF + 15 + 15 + read-write + + + + + HCONR + desc HCONR + 0x84 + 32 + read-write + 0x0 + 0xF777 + + + HSTA0 + desc HSTA0 + 0 + 0 + read-write + + + HSTA1 + desc HSTA1 + 1 + 1 + read-write + + + HSTA2 + desc HSTA2 + 2 + 2 + read-write + + + HSTP0 + desc HSTP0 + 4 + 4 + read-write + + + HSTP1 + desc HSTP1 + 5 + 5 + read-write + + + HSTP2 + desc HSTP2 + 6 + 6 + read-write + + + HCLE0 + desc HCLE0 + 8 + 8 + read-write + + + HCLE1 + desc HCLE1 + 9 + 9 + read-write + + + HCLE2 + desc HCLE2 + 10 + 10 + read-write + + + HCLE3 + desc HCLE3 + 12 + 12 + read-write + + + HCLE4 + desc HCLE4 + 13 + 13 + read-write + + + HCLE5 + desc HCLE5 + 14 + 14 + read-write + + + HCLE6 + desc HCLE6 + 15 + 15 + read-write + + + + + HCUPR + desc HCUPR + 0x88 + 32 + read-write + 0x0 + 0x1FFF + + + HCUP0 + desc HCUP0 + 0 + 0 + read-write + + + HCUP1 + desc HCUP1 + 1 + 1 + read-write + + + HCUP2 + desc HCUP2 + 2 + 2 + read-write + + + HCUP3 + desc HCUP3 + 3 + 3 + read-write + + + HCUP4 + desc HCUP4 + 4 + 4 + read-write + + + HCUP5 + desc HCUP5 + 5 + 5 + read-write + + + HCUP6 + desc HCUP6 + 6 + 6 + read-write + + + HCUP7 + desc HCUP7 + 7 + 7 + read-write + + + HCUP8 + desc HCUP8 + 8 + 8 + read-write + + + HCUP9 + desc HCUP9 + 9 + 9 + read-write + + + HCUP10 + desc HCUP10 + 10 + 10 + read-write + + + HCUP11 + desc HCUP11 + 11 + 11 + read-write + + + HCUP12 + desc HCUP12 + 12 + 12 + read-write + + + + + HCDOR + desc HCDOR + 0x8C + 32 + read-write + 0x0 + 0x1FFF + + + HCDO0 + desc HCDO0 + 0 + 0 + read-write + + + HCDO1 + desc HCDO1 + 1 + 1 + read-write + + + HCDO2 + desc HCDO2 + 2 + 2 + read-write + + + HCDO3 + desc HCDO3 + 3 + 3 + read-write + + + HCDO4 + desc HCDO4 + 4 + 4 + read-write + + + HCDO5 + desc HCDO5 + 5 + 5 + read-write + + + HCDO6 + desc HCDO6 + 6 + 6 + read-write + + + HCDO7 + desc HCDO7 + 7 + 7 + read-write + + + HCDO8 + desc HCDO8 + 8 + 8 + read-write + + + HCDO9 + desc HCDO9 + 9 + 9 + read-write + + + HCDO10 + desc HCDO10 + 10 + 10 + read-write + + + HCDO11 + desc HCDO11 + 11 + 11 + read-write + + + HCDO12 + desc HCDO12 + 12 + 12 + read-write + + + + + ICONR + desc ICONR + 0x90 + 32 + read-write + 0x0 + 0xF + + + ITEN1 + desc ITEN1 + 0 + 0 + read-write + + + ITEN2 + desc ITEN2 + 1 + 1 + read-write + + + ITEN3 + desc ITEN3 + 2 + 2 + read-write + + + ITEN4 + desc ITEN4 + 3 + 3 + read-write + + + + + ECONR + desc ECONR + 0x94 + 32 + read-write + 0x0 + 0xF + + + ETEN1 + desc ETEN1 + 0 + 0 + read-write + + + ETEN2 + desc ETEN2 + 1 + 1 + read-write + + + ETEN3 + desc ETEN3 + 2 + 2 + read-write + + + ETEN4 + desc ETEN4 + 3 + 3 + read-write + + + + + FCONR + desc FCONR + 0x98 + 32 + read-write + 0x0 + 0x7707 + + + NOFIENTG + desc NOFIENTG + 0 + 0 + read-write + + + NOFICKTG + desc NOFICKTG + 2 + 1 + read-write + + + NOFIENCA + desc NOFIENCA + 8 + 8 + read-write + + + NOFICKCA + desc NOFICKCA + 10 + 9 + read-write + + + NOFIENCB + desc NOFIENCB + 12 + 12 + read-write + + + NOFICKCB + desc NOFICKCB + 14 + 13 + read-write + + + + + STFLR + desc STFLR + 0x9C + 32 + read-write + 0x0 + 0xF + + + CMPF1 + desc CMPF1 + 0 + 0 + read-write + + + CMPF2 + desc CMPF2 + 1 + 1 + read-write + + + CMPF3 + desc CMPF3 + 2 + 2 + read-write + + + CMPF4 + desc CMPF4 + 3 + 3 + read-write + + + + + BCONR1 + desc BCONR1 + 0xC0 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + BCONR2 + desc BCONR2 + 0xC8 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + CCONR1 + desc CCONR1 + 0x100 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR2 + desc CCONR2 + 0x104 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR3 + desc CCONR3 + 0x108 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR4 + desc CCONR4 + 0x10C + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + PCONR1 + desc PCONR1 + 0x140 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR2 + desc PCONR2 + 0x144 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR3 + desc PCONR3 + 0x148 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR4 + desc PCONR4 + 0x14C + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + + + TMRA5 + desc TMRA5 + 0x40026000 + + 0x0 + 0x150 + + + + CNTER + desc CNTER + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNT + desc CNT + 15 + 0 + read-write + + + + + PERAR + desc PERAR + 0x4 + 32 + read-write + 0xFFFF + 0xFFFF + + + PER + desc PER + 15 + 0 + read-write + + + + + CMPAR1 + desc CMPAR1 + 0x40 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR2 + desc CMPAR2 + 0x44 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR3 + desc CMPAR3 + 0x48 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR4 + desc CMPAR4 + 0x4C + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + BCSTR + desc BCSTR + 0x80 + 32 + read-write + 0x2 + 0xF1FF + + + START + desc START + 0 + 0 + read-write + + + DIR + desc DIR + 1 + 1 + read-write + + + MODE + desc MODE + 2 + 2 + read-write + + + SYNST + desc SYNST + 3 + 3 + read-write + + + CKDIV + desc CKDIV + 7 + 4 + read-write + + + OVSTP + desc OVSTP + 8 + 8 + read-write + + + ITENOVF + desc ITENOVF + 12 + 12 + read-write + + + ITENUDF + desc ITENUDF + 13 + 13 + read-write + + + OVFF + desc OVFF + 14 + 14 + read-write + + + UDFF + desc UDFF + 15 + 15 + read-write + + + + + HCONR + desc HCONR + 0x84 + 32 + read-write + 0x0 + 0xF777 + + + HSTA0 + desc HSTA0 + 0 + 0 + read-write + + + HSTA1 + desc HSTA1 + 1 + 1 + read-write + + + HSTA2 + desc HSTA2 + 2 + 2 + read-write + + + HSTP0 + desc HSTP0 + 4 + 4 + read-write + + + HSTP1 + desc HSTP1 + 5 + 5 + read-write + + + HSTP2 + desc HSTP2 + 6 + 6 + read-write + + + HCLE0 + desc HCLE0 + 8 + 8 + read-write + + + HCLE1 + desc HCLE1 + 9 + 9 + read-write + + + HCLE2 + desc HCLE2 + 10 + 10 + read-write + + + HCLE3 + desc HCLE3 + 12 + 12 + read-write + + + HCLE4 + desc HCLE4 + 13 + 13 + read-write + + + HCLE5 + desc HCLE5 + 14 + 14 + read-write + + + HCLE6 + desc HCLE6 + 15 + 15 + read-write + + + + + HCUPR + desc HCUPR + 0x88 + 32 + read-write + 0x0 + 0x1FFF + + + HCUP0 + desc HCUP0 + 0 + 0 + read-write + + + HCUP1 + desc HCUP1 + 1 + 1 + read-write + + + HCUP2 + desc HCUP2 + 2 + 2 + read-write + + + HCUP3 + desc HCUP3 + 3 + 3 + read-write + + + HCUP4 + desc HCUP4 + 4 + 4 + read-write + + + HCUP5 + desc HCUP5 + 5 + 5 + read-write + + + HCUP6 + desc HCUP6 + 6 + 6 + read-write + + + HCUP7 + desc HCUP7 + 7 + 7 + read-write + + + HCUP8 + desc HCUP8 + 8 + 8 + read-write + + + HCUP9 + desc HCUP9 + 9 + 9 + read-write + + + HCUP10 + desc HCUP10 + 10 + 10 + read-write + + + HCUP11 + desc HCUP11 + 11 + 11 + read-write + + + HCUP12 + desc HCUP12 + 12 + 12 + read-write + + + + + HCDOR + desc HCDOR + 0x8C + 32 + read-write + 0x0 + 0x1FFF + + + HCDO0 + desc HCDO0 + 0 + 0 + read-write + + + HCDO1 + desc HCDO1 + 1 + 1 + read-write + + + HCDO2 + desc HCDO2 + 2 + 2 + read-write + + + HCDO3 + desc HCDO3 + 3 + 3 + read-write + + + HCDO4 + desc HCDO4 + 4 + 4 + read-write + + + HCDO5 + desc HCDO5 + 5 + 5 + read-write + + + HCDO6 + desc HCDO6 + 6 + 6 + read-write + + + HCDO7 + desc HCDO7 + 7 + 7 + read-write + + + HCDO8 + desc HCDO8 + 8 + 8 + read-write + + + HCDO9 + desc HCDO9 + 9 + 9 + read-write + + + HCDO10 + desc HCDO10 + 10 + 10 + read-write + + + HCDO11 + desc HCDO11 + 11 + 11 + read-write + + + HCDO12 + desc HCDO12 + 12 + 12 + read-write + + + + + ICONR + desc ICONR + 0x90 + 32 + read-write + 0x0 + 0xF + + + ITEN1 + desc ITEN1 + 0 + 0 + read-write + + + ITEN2 + desc ITEN2 + 1 + 1 + read-write + + + ITEN3 + desc ITEN3 + 2 + 2 + read-write + + + ITEN4 + desc ITEN4 + 3 + 3 + read-write + + + + + ECONR + desc ECONR + 0x94 + 32 + read-write + 0x0 + 0xF + + + ETEN1 + desc ETEN1 + 0 + 0 + read-write + + + ETEN2 + desc ETEN2 + 1 + 1 + read-write + + + ETEN3 + desc ETEN3 + 2 + 2 + read-write + + + ETEN4 + desc ETEN4 + 3 + 3 + read-write + + + + + FCONR + desc FCONR + 0x98 + 32 + read-write + 0x0 + 0x7707 + + + NOFIENTG + desc NOFIENTG + 0 + 0 + read-write + + + NOFICKTG + desc NOFICKTG + 2 + 1 + read-write + + + NOFIENCA + desc NOFIENCA + 8 + 8 + read-write + + + NOFICKCA + desc NOFICKCA + 10 + 9 + read-write + + + NOFIENCB + desc NOFIENCB + 12 + 12 + read-write + + + NOFICKCB + desc NOFICKCB + 14 + 13 + read-write + + + + + STFLR + desc STFLR + 0x9C + 32 + read-write + 0x0 + 0xF + + + CMPF1 + desc CMPF1 + 0 + 0 + read-write + + + CMPF2 + desc CMPF2 + 1 + 1 + read-write + + + CMPF3 + desc CMPF3 + 2 + 2 + read-write + + + CMPF4 + desc CMPF4 + 3 + 3 + read-write + + + + + BCONR1 + desc BCONR1 + 0xC0 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + BCONR2 + desc BCONR2 + 0xC8 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + CCONR1 + desc CCONR1 + 0x100 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR2 + desc CCONR2 + 0x104 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR3 + desc CCONR3 + 0x108 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR4 + desc CCONR4 + 0x10C + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + PCONR1 + desc PCONR1 + 0x140 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR2 + desc PCONR2 + 0x144 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR3 + desc PCONR3 + 0x148 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR4 + desc PCONR4 + 0x14C + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + + + TMRA6 + desc TMRA6 + 0x40026400 + + 0x0 + 0x150 + + + + CNTER + desc CNTER + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNT + desc CNT + 15 + 0 + read-write + + + + + PERAR + desc PERAR + 0x4 + 32 + read-write + 0xFFFF + 0xFFFF + + + PER + desc PER + 15 + 0 + read-write + + + + + CMPAR1 + desc CMPAR1 + 0x40 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR2 + desc CMPAR2 + 0x44 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR3 + desc CMPAR3 + 0x48 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR4 + desc CMPAR4 + 0x4C + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + BCSTR + desc BCSTR + 0x80 + 32 + read-write + 0x2 + 0xF1FF + + + START + desc START + 0 + 0 + read-write + + + DIR + desc DIR + 1 + 1 + read-write + + + MODE + desc MODE + 2 + 2 + read-write + + + SYNST + desc SYNST + 3 + 3 + read-write + + + CKDIV + desc CKDIV + 7 + 4 + read-write + + + OVSTP + desc OVSTP + 8 + 8 + read-write + + + ITENOVF + desc ITENOVF + 12 + 12 + read-write + + + ITENUDF + desc ITENUDF + 13 + 13 + read-write + + + OVFF + desc OVFF + 14 + 14 + read-write + + + UDFF + desc UDFF + 15 + 15 + read-write + + + + + HCONR + desc HCONR + 0x84 + 32 + read-write + 0x0 + 0xF777 + + + HSTA0 + desc HSTA0 + 0 + 0 + read-write + + + HSTA1 + desc HSTA1 + 1 + 1 + read-write + + + HSTA2 + desc HSTA2 + 2 + 2 + read-write + + + HSTP0 + desc HSTP0 + 4 + 4 + read-write + + + HSTP1 + desc HSTP1 + 5 + 5 + read-write + + + HSTP2 + desc HSTP2 + 6 + 6 + read-write + + + HCLE0 + desc HCLE0 + 8 + 8 + read-write + + + HCLE1 + desc HCLE1 + 9 + 9 + read-write + + + HCLE2 + desc HCLE2 + 10 + 10 + read-write + + + HCLE3 + desc HCLE3 + 12 + 12 + read-write + + + HCLE4 + desc HCLE4 + 13 + 13 + read-write + + + HCLE5 + desc HCLE5 + 14 + 14 + read-write + + + HCLE6 + desc HCLE6 + 15 + 15 + read-write + + + + + HCUPR + desc HCUPR + 0x88 + 32 + read-write + 0x0 + 0x1FFF + + + HCUP0 + desc HCUP0 + 0 + 0 + read-write + + + HCUP1 + desc HCUP1 + 1 + 1 + read-write + + + HCUP2 + desc HCUP2 + 2 + 2 + read-write + + + HCUP3 + desc HCUP3 + 3 + 3 + read-write + + + HCUP4 + desc HCUP4 + 4 + 4 + read-write + + + HCUP5 + desc HCUP5 + 5 + 5 + read-write + + + HCUP6 + desc HCUP6 + 6 + 6 + read-write + + + HCUP7 + desc HCUP7 + 7 + 7 + read-write + + + HCUP8 + desc HCUP8 + 8 + 8 + read-write + + + HCUP9 + desc HCUP9 + 9 + 9 + read-write + + + HCUP10 + desc HCUP10 + 10 + 10 + read-write + + + HCUP11 + desc HCUP11 + 11 + 11 + read-write + + + HCUP12 + desc HCUP12 + 12 + 12 + read-write + + + + + HCDOR + desc HCDOR + 0x8C + 32 + read-write + 0x0 + 0x1FFF + + + HCDO0 + desc HCDO0 + 0 + 0 + read-write + + + HCDO1 + desc HCDO1 + 1 + 1 + read-write + + + HCDO2 + desc HCDO2 + 2 + 2 + read-write + + + HCDO3 + desc HCDO3 + 3 + 3 + read-write + + + HCDO4 + desc HCDO4 + 4 + 4 + read-write + + + HCDO5 + desc HCDO5 + 5 + 5 + read-write + + + HCDO6 + desc HCDO6 + 6 + 6 + read-write + + + HCDO7 + desc HCDO7 + 7 + 7 + read-write + + + HCDO8 + desc HCDO8 + 8 + 8 + read-write + + + HCDO9 + desc HCDO9 + 9 + 9 + read-write + + + HCDO10 + desc HCDO10 + 10 + 10 + read-write + + + HCDO11 + desc HCDO11 + 11 + 11 + read-write + + + HCDO12 + desc HCDO12 + 12 + 12 + read-write + + + + + ICONR + desc ICONR + 0x90 + 32 + read-write + 0x0 + 0xF + + + ITEN1 + desc ITEN1 + 0 + 0 + read-write + + + ITEN2 + desc ITEN2 + 1 + 1 + read-write + + + ITEN3 + desc ITEN3 + 2 + 2 + read-write + + + ITEN4 + desc ITEN4 + 3 + 3 + read-write + + + + + ECONR + desc ECONR + 0x94 + 32 + read-write + 0x0 + 0xF + + + ETEN1 + desc ETEN1 + 0 + 0 + read-write + + + ETEN2 + desc ETEN2 + 1 + 1 + read-write + + + ETEN3 + desc ETEN3 + 2 + 2 + read-write + + + ETEN4 + desc ETEN4 + 3 + 3 + read-write + + + + + FCONR + desc FCONR + 0x98 + 32 + read-write + 0x0 + 0x7707 + + + NOFIENTG + desc NOFIENTG + 0 + 0 + read-write + + + NOFICKTG + desc NOFICKTG + 2 + 1 + read-write + + + NOFIENCA + desc NOFIENCA + 8 + 8 + read-write + + + NOFICKCA + desc NOFICKCA + 10 + 9 + read-write + + + NOFIENCB + desc NOFIENCB + 12 + 12 + read-write + + + NOFICKCB + desc NOFICKCB + 14 + 13 + read-write + + + + + STFLR + desc STFLR + 0x9C + 32 + read-write + 0x0 + 0xF + + + CMPF1 + desc CMPF1 + 0 + 0 + read-write + + + CMPF2 + desc CMPF2 + 1 + 1 + read-write + + + CMPF3 + desc CMPF3 + 2 + 2 + read-write + + + CMPF4 + desc CMPF4 + 3 + 3 + read-write + + + + + BCONR1 + desc BCONR1 + 0xC0 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + BCONR2 + desc BCONR2 + 0xC8 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + CCONR1 + desc CCONR1 + 0x100 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR2 + desc CCONR2 + 0x104 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR3 + desc CCONR3 + 0x108 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR4 + desc CCONR4 + 0x10C + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + PCONR1 + desc PCONR1 + 0x140 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR2 + desc PCONR2 + 0x144 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR3 + desc PCONR3 + 0x148 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR4 + desc PCONR4 + 0x14C + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + + + TMRA7 + desc TMRA7 + 0x40026800 + + 0x0 + 0x150 + + + + CNTER + desc CNTER + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNT + desc CNT + 15 + 0 + read-write + + + + + PERAR + desc PERAR + 0x4 + 32 + read-write + 0xFFFF + 0xFFFF + + + PER + desc PER + 15 + 0 + read-write + + + + + CMPAR1 + desc CMPAR1 + 0x40 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR2 + desc CMPAR2 + 0x44 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR3 + desc CMPAR3 + 0x48 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR4 + desc CMPAR4 + 0x4C + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + BCSTR + desc BCSTR + 0x80 + 32 + read-write + 0x2 + 0xF1FF + + + START + desc START + 0 + 0 + read-write + + + DIR + desc DIR + 1 + 1 + read-write + + + MODE + desc MODE + 2 + 2 + read-write + + + SYNST + desc SYNST + 3 + 3 + read-write + + + CKDIV + desc CKDIV + 7 + 4 + read-write + + + OVSTP + desc OVSTP + 8 + 8 + read-write + + + ITENOVF + desc ITENOVF + 12 + 12 + read-write + + + ITENUDF + desc ITENUDF + 13 + 13 + read-write + + + OVFF + desc OVFF + 14 + 14 + read-write + + + UDFF + desc UDFF + 15 + 15 + read-write + + + + + HCONR + desc HCONR + 0x84 + 32 + read-write + 0x0 + 0xF777 + + + HSTA0 + desc HSTA0 + 0 + 0 + read-write + + + HSTA1 + desc HSTA1 + 1 + 1 + read-write + + + HSTA2 + desc HSTA2 + 2 + 2 + read-write + + + HSTP0 + desc HSTP0 + 4 + 4 + read-write + + + HSTP1 + desc HSTP1 + 5 + 5 + read-write + + + HSTP2 + desc HSTP2 + 6 + 6 + read-write + + + HCLE0 + desc HCLE0 + 8 + 8 + read-write + + + HCLE1 + desc HCLE1 + 9 + 9 + read-write + + + HCLE2 + desc HCLE2 + 10 + 10 + read-write + + + HCLE3 + desc HCLE3 + 12 + 12 + read-write + + + HCLE4 + desc HCLE4 + 13 + 13 + read-write + + + HCLE5 + desc HCLE5 + 14 + 14 + read-write + + + HCLE6 + desc HCLE6 + 15 + 15 + read-write + + + + + HCUPR + desc HCUPR + 0x88 + 32 + read-write + 0x0 + 0x1FFF + + + HCUP0 + desc HCUP0 + 0 + 0 + read-write + + + HCUP1 + desc HCUP1 + 1 + 1 + read-write + + + HCUP2 + desc HCUP2 + 2 + 2 + read-write + + + HCUP3 + desc HCUP3 + 3 + 3 + read-write + + + HCUP4 + desc HCUP4 + 4 + 4 + read-write + + + HCUP5 + desc HCUP5 + 5 + 5 + read-write + + + HCUP6 + desc HCUP6 + 6 + 6 + read-write + + + HCUP7 + desc HCUP7 + 7 + 7 + read-write + + + HCUP8 + desc HCUP8 + 8 + 8 + read-write + + + HCUP9 + desc HCUP9 + 9 + 9 + read-write + + + HCUP10 + desc HCUP10 + 10 + 10 + read-write + + + HCUP11 + desc HCUP11 + 11 + 11 + read-write + + + HCUP12 + desc HCUP12 + 12 + 12 + read-write + + + + + HCDOR + desc HCDOR + 0x8C + 32 + read-write + 0x0 + 0x1FFF + + + HCDO0 + desc HCDO0 + 0 + 0 + read-write + + + HCDO1 + desc HCDO1 + 1 + 1 + read-write + + + HCDO2 + desc HCDO2 + 2 + 2 + read-write + + + HCDO3 + desc HCDO3 + 3 + 3 + read-write + + + HCDO4 + desc HCDO4 + 4 + 4 + read-write + + + HCDO5 + desc HCDO5 + 5 + 5 + read-write + + + HCDO6 + desc HCDO6 + 6 + 6 + read-write + + + HCDO7 + desc HCDO7 + 7 + 7 + read-write + + + HCDO8 + desc HCDO8 + 8 + 8 + read-write + + + HCDO9 + desc HCDO9 + 9 + 9 + read-write + + + HCDO10 + desc HCDO10 + 10 + 10 + read-write + + + HCDO11 + desc HCDO11 + 11 + 11 + read-write + + + HCDO12 + desc HCDO12 + 12 + 12 + read-write + + + + + ICONR + desc ICONR + 0x90 + 32 + read-write + 0x0 + 0xF + + + ITEN1 + desc ITEN1 + 0 + 0 + read-write + + + ITEN2 + desc ITEN2 + 1 + 1 + read-write + + + ITEN3 + desc ITEN3 + 2 + 2 + read-write + + + ITEN4 + desc ITEN4 + 3 + 3 + read-write + + + + + ECONR + desc ECONR + 0x94 + 32 + read-write + 0x0 + 0xF + + + ETEN1 + desc ETEN1 + 0 + 0 + read-write + + + ETEN2 + desc ETEN2 + 1 + 1 + read-write + + + ETEN3 + desc ETEN3 + 2 + 2 + read-write + + + ETEN4 + desc ETEN4 + 3 + 3 + read-write + + + + + FCONR + desc FCONR + 0x98 + 32 + read-write + 0x0 + 0x7707 + + + NOFIENTG + desc NOFIENTG + 0 + 0 + read-write + + + NOFICKTG + desc NOFICKTG + 2 + 1 + read-write + + + NOFIENCA + desc NOFIENCA + 8 + 8 + read-write + + + NOFICKCA + desc NOFICKCA + 10 + 9 + read-write + + + NOFIENCB + desc NOFIENCB + 12 + 12 + read-write + + + NOFICKCB + desc NOFICKCB + 14 + 13 + read-write + + + + + STFLR + desc STFLR + 0x9C + 32 + read-write + 0x0 + 0xF + + + CMPF1 + desc CMPF1 + 0 + 0 + read-write + + + CMPF2 + desc CMPF2 + 1 + 1 + read-write + + + CMPF3 + desc CMPF3 + 2 + 2 + read-write + + + CMPF4 + desc CMPF4 + 3 + 3 + read-write + + + + + BCONR1 + desc BCONR1 + 0xC0 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + BCONR2 + desc BCONR2 + 0xC8 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + CCONR1 + desc CCONR1 + 0x100 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR2 + desc CCONR2 + 0x104 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR3 + desc CCONR3 + 0x108 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR4 + desc CCONR4 + 0x10C + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + PCONR1 + desc PCONR1 + 0x140 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR2 + desc PCONR2 + 0x144 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR3 + desc PCONR3 + 0x148 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR4 + desc PCONR4 + 0x14C + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + + + TMRA8 + desc TMRA8 + 0x40026C00 + + 0x0 + 0x150 + + + + CNTER + desc CNTER + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNT + desc CNT + 15 + 0 + read-write + + + + + PERAR + desc PERAR + 0x4 + 32 + read-write + 0xFFFF + 0xFFFF + + + PER + desc PER + 15 + 0 + read-write + + + + + CMPAR1 + desc CMPAR1 + 0x40 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR2 + desc CMPAR2 + 0x44 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR3 + desc CMPAR3 + 0x48 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR4 + desc CMPAR4 + 0x4C + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + BCSTR + desc BCSTR + 0x80 + 32 + read-write + 0x2 + 0xF1FF + + + START + desc START + 0 + 0 + read-write + + + DIR + desc DIR + 1 + 1 + read-write + + + MODE + desc MODE + 2 + 2 + read-write + + + SYNST + desc SYNST + 3 + 3 + read-write + + + CKDIV + desc CKDIV + 7 + 4 + read-write + + + OVSTP + desc OVSTP + 8 + 8 + read-write + + + ITENOVF + desc ITENOVF + 12 + 12 + read-write + + + ITENUDF + desc ITENUDF + 13 + 13 + read-write + + + OVFF + desc OVFF + 14 + 14 + read-write + + + UDFF + desc UDFF + 15 + 15 + read-write + + + + + HCONR + desc HCONR + 0x84 + 32 + read-write + 0x0 + 0xF777 + + + HSTA0 + desc HSTA0 + 0 + 0 + read-write + + + HSTA1 + desc HSTA1 + 1 + 1 + read-write + + + HSTA2 + desc HSTA2 + 2 + 2 + read-write + + + HSTP0 + desc HSTP0 + 4 + 4 + read-write + + + HSTP1 + desc HSTP1 + 5 + 5 + read-write + + + HSTP2 + desc HSTP2 + 6 + 6 + read-write + + + HCLE0 + desc HCLE0 + 8 + 8 + read-write + + + HCLE1 + desc HCLE1 + 9 + 9 + read-write + + + HCLE2 + desc HCLE2 + 10 + 10 + read-write + + + HCLE3 + desc HCLE3 + 12 + 12 + read-write + + + HCLE4 + desc HCLE4 + 13 + 13 + read-write + + + HCLE5 + desc HCLE5 + 14 + 14 + read-write + + + HCLE6 + desc HCLE6 + 15 + 15 + read-write + + + + + HCUPR + desc HCUPR + 0x88 + 32 + read-write + 0x0 + 0x1FFF + + + HCUP0 + desc HCUP0 + 0 + 0 + read-write + + + HCUP1 + desc HCUP1 + 1 + 1 + read-write + + + HCUP2 + desc HCUP2 + 2 + 2 + read-write + + + HCUP3 + desc HCUP3 + 3 + 3 + read-write + + + HCUP4 + desc HCUP4 + 4 + 4 + read-write + + + HCUP5 + desc HCUP5 + 5 + 5 + read-write + + + HCUP6 + desc HCUP6 + 6 + 6 + read-write + + + HCUP7 + desc HCUP7 + 7 + 7 + read-write + + + HCUP8 + desc HCUP8 + 8 + 8 + read-write + + + HCUP9 + desc HCUP9 + 9 + 9 + read-write + + + HCUP10 + desc HCUP10 + 10 + 10 + read-write + + + HCUP11 + desc HCUP11 + 11 + 11 + read-write + + + HCUP12 + desc HCUP12 + 12 + 12 + read-write + + + + + HCDOR + desc HCDOR + 0x8C + 32 + read-write + 0x0 + 0x1FFF + + + HCDO0 + desc HCDO0 + 0 + 0 + read-write + + + HCDO1 + desc HCDO1 + 1 + 1 + read-write + + + HCDO2 + desc HCDO2 + 2 + 2 + read-write + + + HCDO3 + desc HCDO3 + 3 + 3 + read-write + + + HCDO4 + desc HCDO4 + 4 + 4 + read-write + + + HCDO5 + desc HCDO5 + 5 + 5 + read-write + + + HCDO6 + desc HCDO6 + 6 + 6 + read-write + + + HCDO7 + desc HCDO7 + 7 + 7 + read-write + + + HCDO8 + desc HCDO8 + 8 + 8 + read-write + + + HCDO9 + desc HCDO9 + 9 + 9 + read-write + + + HCDO10 + desc HCDO10 + 10 + 10 + read-write + + + HCDO11 + desc HCDO11 + 11 + 11 + read-write + + + HCDO12 + desc HCDO12 + 12 + 12 + read-write + + + + + ICONR + desc ICONR + 0x90 + 32 + read-write + 0x0 + 0xF + + + ITEN1 + desc ITEN1 + 0 + 0 + read-write + + + ITEN2 + desc ITEN2 + 1 + 1 + read-write + + + ITEN3 + desc ITEN3 + 2 + 2 + read-write + + + ITEN4 + desc ITEN4 + 3 + 3 + read-write + + + + + ECONR + desc ECONR + 0x94 + 32 + read-write + 0x0 + 0xF + + + ETEN1 + desc ETEN1 + 0 + 0 + read-write + + + ETEN2 + desc ETEN2 + 1 + 1 + read-write + + + ETEN3 + desc ETEN3 + 2 + 2 + read-write + + + ETEN4 + desc ETEN4 + 3 + 3 + read-write + + + + + FCONR + desc FCONR + 0x98 + 32 + read-write + 0x0 + 0x7707 + + + NOFIENTG + desc NOFIENTG + 0 + 0 + read-write + + + NOFICKTG + desc NOFICKTG + 2 + 1 + read-write + + + NOFIENCA + desc NOFIENCA + 8 + 8 + read-write + + + NOFICKCA + desc NOFICKCA + 10 + 9 + read-write + + + NOFIENCB + desc NOFIENCB + 12 + 12 + read-write + + + NOFICKCB + desc NOFICKCB + 14 + 13 + read-write + + + + + STFLR + desc STFLR + 0x9C + 32 + read-write + 0x0 + 0xF + + + CMPF1 + desc CMPF1 + 0 + 0 + read-write + + + CMPF2 + desc CMPF2 + 1 + 1 + read-write + + + CMPF3 + desc CMPF3 + 2 + 2 + read-write + + + CMPF4 + desc CMPF4 + 3 + 3 + read-write + + + + + BCONR1 + desc BCONR1 + 0xC0 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + BCONR2 + desc BCONR2 + 0xC8 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + CCONR1 + desc CCONR1 + 0x100 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR2 + desc CCONR2 + 0x104 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR3 + desc CCONR3 + 0x108 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR4 + desc CCONR4 + 0x10C + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + PCONR1 + desc PCONR1 + 0x140 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR2 + desc PCONR2 + 0x144 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR3 + desc PCONR3 + 0x148 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR4 + desc PCONR4 + 0x14C + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + + + TMRA9 + desc TMRA9 + 0x40027000 + + 0x0 + 0x150 + + + + CNTER + desc CNTER + 0x0 + 32 + read-write + 0x0 + 0xFFFF + + + CNT + desc CNT + 15 + 0 + read-write + + + + + PERAR + desc PERAR + 0x4 + 32 + read-write + 0xFFFF + 0xFFFF + + + PER + desc PER + 15 + 0 + read-write + + + + + CMPAR1 + desc CMPAR1 + 0x40 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR2 + desc CMPAR2 + 0x44 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR3 + desc CMPAR3 + 0x48 + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + CMPAR4 + desc CMPAR4 + 0x4C + 32 + read-write + 0xFFFF + 0xFFFF + + + CMP + desc CMP + 15 + 0 + read-write + + + + + BCSTR + desc BCSTR + 0x80 + 32 + read-write + 0x2 + 0xF1FF + + + START + desc START + 0 + 0 + read-write + + + DIR + desc DIR + 1 + 1 + read-write + + + MODE + desc MODE + 2 + 2 + read-write + + + SYNST + desc SYNST + 3 + 3 + read-write + + + CKDIV + desc CKDIV + 7 + 4 + read-write + + + OVSTP + desc OVSTP + 8 + 8 + read-write + + + ITENOVF + desc ITENOVF + 12 + 12 + read-write + + + ITENUDF + desc ITENUDF + 13 + 13 + read-write + + + OVFF + desc OVFF + 14 + 14 + read-write + + + UDFF + desc UDFF + 15 + 15 + read-write + + + + + HCONR + desc HCONR + 0x84 + 32 + read-write + 0x0 + 0xF777 + + + HSTA0 + desc HSTA0 + 0 + 0 + read-write + + + HSTA1 + desc HSTA1 + 1 + 1 + read-write + + + HSTA2 + desc HSTA2 + 2 + 2 + read-write + + + HSTP0 + desc HSTP0 + 4 + 4 + read-write + + + HSTP1 + desc HSTP1 + 5 + 5 + read-write + + + HSTP2 + desc HSTP2 + 6 + 6 + read-write + + + HCLE0 + desc HCLE0 + 8 + 8 + read-write + + + HCLE1 + desc HCLE1 + 9 + 9 + read-write + + + HCLE2 + desc HCLE2 + 10 + 10 + read-write + + + HCLE3 + desc HCLE3 + 12 + 12 + read-write + + + HCLE4 + desc HCLE4 + 13 + 13 + read-write + + + HCLE5 + desc HCLE5 + 14 + 14 + read-write + + + HCLE6 + desc HCLE6 + 15 + 15 + read-write + + + + + HCUPR + desc HCUPR + 0x88 + 32 + read-write + 0x0 + 0x1FFF + + + HCUP0 + desc HCUP0 + 0 + 0 + read-write + + + HCUP1 + desc HCUP1 + 1 + 1 + read-write + + + HCUP2 + desc HCUP2 + 2 + 2 + read-write + + + HCUP3 + desc HCUP3 + 3 + 3 + read-write + + + HCUP4 + desc HCUP4 + 4 + 4 + read-write + + + HCUP5 + desc HCUP5 + 5 + 5 + read-write + + + HCUP6 + desc HCUP6 + 6 + 6 + read-write + + + HCUP7 + desc HCUP7 + 7 + 7 + read-write + + + HCUP8 + desc HCUP8 + 8 + 8 + read-write + + + HCUP9 + desc HCUP9 + 9 + 9 + read-write + + + HCUP10 + desc HCUP10 + 10 + 10 + read-write + + + HCUP11 + desc HCUP11 + 11 + 11 + read-write + + + HCUP12 + desc HCUP12 + 12 + 12 + read-write + + + + + HCDOR + desc HCDOR + 0x8C + 32 + read-write + 0x0 + 0x1FFF + + + HCDO0 + desc HCDO0 + 0 + 0 + read-write + + + HCDO1 + desc HCDO1 + 1 + 1 + read-write + + + HCDO2 + desc HCDO2 + 2 + 2 + read-write + + + HCDO3 + desc HCDO3 + 3 + 3 + read-write + + + HCDO4 + desc HCDO4 + 4 + 4 + read-write + + + HCDO5 + desc HCDO5 + 5 + 5 + read-write + + + HCDO6 + desc HCDO6 + 6 + 6 + read-write + + + HCDO7 + desc HCDO7 + 7 + 7 + read-write + + + HCDO8 + desc HCDO8 + 8 + 8 + read-write + + + HCDO9 + desc HCDO9 + 9 + 9 + read-write + + + HCDO10 + desc HCDO10 + 10 + 10 + read-write + + + HCDO11 + desc HCDO11 + 11 + 11 + read-write + + + HCDO12 + desc HCDO12 + 12 + 12 + read-write + + + + + ICONR + desc ICONR + 0x90 + 32 + read-write + 0x0 + 0xF + + + ITEN1 + desc ITEN1 + 0 + 0 + read-write + + + ITEN2 + desc ITEN2 + 1 + 1 + read-write + + + ITEN3 + desc ITEN3 + 2 + 2 + read-write + + + ITEN4 + desc ITEN4 + 3 + 3 + read-write + + + + + ECONR + desc ECONR + 0x94 + 32 + read-write + 0x0 + 0xF + + + ETEN1 + desc ETEN1 + 0 + 0 + read-write + + + ETEN2 + desc ETEN2 + 1 + 1 + read-write + + + ETEN3 + desc ETEN3 + 2 + 2 + read-write + + + ETEN4 + desc ETEN4 + 3 + 3 + read-write + + + + + FCONR + desc FCONR + 0x98 + 32 + read-write + 0x0 + 0x7707 + + + NOFIENTG + desc NOFIENTG + 0 + 0 + read-write + + + NOFICKTG + desc NOFICKTG + 2 + 1 + read-write + + + NOFIENCA + desc NOFIENCA + 8 + 8 + read-write + + + NOFICKCA + desc NOFICKCA + 10 + 9 + read-write + + + NOFIENCB + desc NOFIENCB + 12 + 12 + read-write + + + NOFICKCB + desc NOFICKCB + 14 + 13 + read-write + + + + + STFLR + desc STFLR + 0x9C + 32 + read-write + 0x0 + 0xF + + + CMPF1 + desc CMPF1 + 0 + 0 + read-write + + + CMPF2 + desc CMPF2 + 1 + 1 + read-write + + + CMPF3 + desc CMPF3 + 2 + 2 + read-write + + + CMPF4 + desc CMPF4 + 3 + 3 + read-write + + + + + BCONR1 + desc BCONR1 + 0xC0 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + BCONR2 + desc BCONR2 + 0xC8 + 32 + read-write + 0x0 + 0x7 + + + BEN + desc BEN + 0 + 0 + read-write + + + BSE0 + desc BSE0 + 1 + 1 + read-write + + + BSE1 + desc BSE1 + 2 + 2 + read-write + + + + + CCONR1 + desc CCONR1 + 0x100 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR2 + desc CCONR2 + 0x104 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR3 + desc CCONR3 + 0x108 + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + CCONR4 + desc CCONR4 + 0x10C + 32 + read-write + 0x0 + 0x7371 + + + CAPMD + desc CAPMD + 0 + 0 + read-write + + + HICP0 + desc HICP0 + 4 + 4 + read-write + + + HICP1 + desc HICP1 + 5 + 5 + read-write + + + HICP2 + desc HICP2 + 6 + 6 + read-write + + + HICP3 + desc HICP3 + 8 + 8 + read-write + + + HICP4 + desc HICP4 + 9 + 9 + read-write + + + NOFIENCP + desc NOFIENCP + 12 + 12 + read-write + + + NOFICKCP + desc NOFICKCP + 14 + 13 + read-write + + + + + PCONR1 + desc PCONR1 + 0x140 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR2 + desc PCONR2 + 0x144 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR3 + desc PCONR3 + 0x148 + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + PCONR4 + desc PCONR4 + 0x14C + 32 + read-write + 0x0 + 0x13FF + + + STAC + desc STAC + 1 + 0 + read-write + + + STPC + desc STPC + 3 + 2 + read-write + + + CMPC + desc CMPC + 5 + 4 + read-write + + + PERC + desc PERC + 7 + 6 + read-write + + + FORC + desc FORC + 9 + 8 + read-write + + + OUTEN + desc OUTEN + 12 + 12 + read-write + + + + + + + TRNG + desc TRNG + 0x40042000 + + 0x0 + 0x14 + + + + CR + desc CR + 0x0 + 32 + read-write + 0x0 + 0x3 + + + EN + desc EN + 0 + 0 + read-write + + + RUN + desc RUN + 1 + 1 + read-write + + + + + MR + desc MR + 0x4 + 32 + read-write + 0x12 + 0x1D + + + LOAD + desc LOAD + 0 + 0 + read-write + + + CNT + desc CNT + 4 + 2 + read-write + + + + + DR0 + desc DR0 + 0xC + 32 + read-only + 0x8000000 + 0xFFFFFFFF + + + DR1 + desc DR1 + 0x10 + 32 + read-only + 0x8000200 + 0xFFFFFFFF + + + + + USART1 + desc USART1 + 0x4001CC00 + + 0x0 + 0x10 + + + + SR + desc SR + 0x0 + 32 + read-only + 0xC0 + 0x101EB + + + PE + desc PE + 0 + 0 + read-only + + + FE + desc FE + 1 + 1 + read-only + + + ORE + desc ORE + 3 + 3 + read-only + + + RXNE + desc RXNE + 5 + 5 + read-only + + + TC + desc TC + 6 + 6 + read-only + + + TXE + desc TXE + 7 + 7 + read-only + + + RTOF + desc RTOF + 8 + 8 + read-only + + + MPB + desc MPB + 16 + 16 + read-only + + + + + DR + desc DR + 0x4 + 32 + read-write + 0x1FF + 0x1FF03FF + + + TDR + desc TDR + 8 + 0 + read-write + + + MPID + desc MPID + 9 + 9 + read-write + + + RDR + desc RDR + 24 + 16 + read-write + + + + + BRR + desc BRR + 0x8 + 32 + read-write + 0xFF00 + 0xFF7F + + + DIV_FRACTION + desc DIV_FRACTION + 6 + 0 + read-write + + + DIV_INTEGER + desc DIV_INTEGER + 15 + 8 + read-write + + + + + CR1 + desc CR1 + 0xC + 32 + read-write + 0x80000000 + 0xF11B96FF + + + RTOE + desc RTOE + 0 + 0 + read-write + + + RTOIE + desc RTOIE + 1 + 1 + read-write + + + RE + desc RE + 2 + 2 + read-write + + + TE + desc TE + 3 + 3 + read-write + + + SLME + desc SLME + 4 + 4 + read-write + + + RIE + desc RIE + 5 + 5 + read-write + + + TCIE + desc TCIE + 6 + 6 + read-write + + + TXEIE + desc TXEIE + 7 + 7 + read-write + + + PS + desc PS + 9 + 9 + read-write + + + PCE + desc PCE + 10 + 10 + read-write + + + M + desc M + 12 + 12 + read-write + + + OVER8 + desc OVER8 + 15 + 15 + read-write + + + CPE + desc CPE + 16 + 16 + write-only + + + CFE + desc CFE + 17 + 17 + write-only + + + CORE + desc CORE + 19 + 19 + write-only + + + CRTOF + desc CRTOF + 20 + 20 + write-only + + + MS + desc MS + 24 + 24 + read-write + + + ML + desc ML + 28 + 28 + read-write + + + FBME + desc FBME + 29 + 29 + read-write + + + NFE + desc NFE + 30 + 30 + read-write + + + SBS + desc SBS + 31 + 31 + read-write + + + + + CR2 + desc CR2 + 0x10 + 32 + read-write + 0x600 + 0x3801 + + + MPE + desc MPE + 0 + 0 + read-write + + + CLKC + desc CLKC + 12 + 11 + read-write + + + STOP + desc STOP + 13 + 13 + read-write + + + + + CR3 + desc CR3 + 0x14 + 32 + read-write + 0x0 + 0xE00328 + + + HDSEL + desc HDSEL + 3 + 3 + read-write + + + LOOP + desc LOOP + 4 + 4 + read-write + + + SCEN + desc SCEN + 5 + 5 + read-write + + + RTSE + desc RTSE + 8 + 8 + read-write + + + CTSE + desc CTSE + 9 + 9 + read-write + + + BCN + desc BCN + 23 + 21 + read-write + + + + + PR + desc PR + 0x18 + 32 + read-write + 0x0 + 0x3 + + + PSC + desc PSC + 1 + 0 + read-write + + + + + + + USART10 + desc USART10 + 0x40021C00 + + 0x0 + 0x10 + + + + SR + desc SR + 0x0 + 32 + read-only + 0xC0 + 0x106FB + + + PE + desc PE + 0 + 0 + read-only + + + FE + desc FE + 1 + 1 + read-only + + + ORE + desc ORE + 3 + 3 + read-only + + + BE + desc BE + 4 + 4 + read-only + + + RXNE + desc RXNE + 5 + 5 + read-only + + + TC + desc TC + 6 + 6 + read-only + + + TXE + desc TXE + 7 + 7 + read-only + + + WKUP + desc WKUP + 9 + 9 + read-only + + + LBD + desc LBD + 10 + 10 + read-only + + + MPB + desc MPB + 16 + 16 + read-only + + + + + DR + desc DR + 0x4 + 32 + read-write + 0x1FF + 0x1FF03FF + + + TDR + desc TDR + 8 + 0 + read-write + + + MPID + desc MPID + 9 + 9 + read-write + + + RDR + desc RDR + 24 + 16 + read-write + + + + + BRR + desc BRR + 0x8 + 32 + read-write + 0xFF00 + 0xFF00 + + + DIV_INTEGER + desc DIV_INTEGER + 15 + 8 + read-write + + + + + CR1 + desc CR1 + 0xC + 32 + read-write + 0x80000000 + 0xD1EF96FC + + + RE + desc RE + 2 + 2 + read-write + + + TE + desc TE + 3 + 3 + read-write + + + SLME + desc SLME + 4 + 4 + read-write + + + RIE + desc RIE + 5 + 5 + read-write + + + TCIE + desc TCIE + 6 + 6 + read-write + + + TXEIE + desc TXEIE + 7 + 7 + read-write + + + PS + desc PS + 9 + 9 + read-write + + + PCE + desc PCE + 10 + 10 + read-write + + + M + desc M + 12 + 12 + read-write + + + OVER8 + desc OVER8 + 15 + 15 + read-write + + + CPE + desc CPE + 16 + 16 + write-only + + + CFE + desc CFE + 17 + 17 + write-only + + + CNF + desc CNF + 18 + 18 + write-only + + + CORE + desc CORE + 19 + 19 + write-only + + + CBE + desc CBE + 21 + 21 + write-only + + + CWKUP + desc CWKUP + 22 + 22 + write-only + + + CLBD + desc CLBD + 23 + 23 + write-only + + + MS + desc MS + 24 + 24 + read-write + + + ML + desc ML + 28 + 28 + read-write + + + NFE + desc NFE + 30 + 30 + read-write + + + SBS + desc SBS + 31 + 31 + read-write + + + + + CR2 + desc CR2 + 0x10 + 32 + read-write + 0x600 + 0x779FF + + + MPE + desc MPE + 0 + 0 + read-write + + + WKUPIE + desc WKUPIE + 1 + 1 + read-write + + + BEIE + desc BEIE + 2 + 2 + read-write + + + BEE + desc BEE + 3 + 3 + read-write + + + LBDIE + desc LBDIE + 4 + 4 + read-write + + + LBDL + desc LBDL + 5 + 5 + read-write + + + SBKL + desc SBKL + 7 + 6 + read-write + + + WKUPE + desc WKUPE + 8 + 8 + read-write + + + CLKC + desc CLKC + 12 + 11 + read-write + + + STOP + desc STOP + 13 + 13 + read-write + + + LINEN + desc LINEN + 14 + 14 + read-write + + + SBK + desc SBK + 16 + 16 + read-write + + + SBKM + desc SBKM + 17 + 17 + read-write + + + + + CR3 + desc CR3 + 0x14 + 32 + read-write + 0x0 + 0x318 + + + HDSEL + desc HDSEL + 3 + 3 + read-write + + + LOOP + desc LOOP + 4 + 4 + read-write + + + RTSE + desc RTSE + 8 + 8 + read-write + + + CTSE + desc CTSE + 9 + 9 + read-write + + + + + PR + desc PR + 0x18 + 32 + read-write + 0x0 + 0xF + + + PSC + desc PSC + 1 + 0 + read-write + + + LBMPSC + desc LBMPSC + 3 + 2 + read-write + + + + + LBMC + desc LBMC + 0x1C + 32 + read-write + 0x0 + 0xFFFF + + + LBMC + desc LBMC + 15 + 0 + read-write + + + + + + + USART2 + desc USART2 + 0x4001D000 + + 0x0 + 0x10 + + + + SR + desc SR + 0x0 + 32 + read-only + 0xC0 + 0x101EB + + + PE + desc PE + 0 + 0 + read-only + + + FE + desc FE + 1 + 1 + read-only + + + ORE + desc ORE + 3 + 3 + read-only + + + RXNE + desc RXNE + 5 + 5 + read-only + + + TC + desc TC + 6 + 6 + read-only + + + TXE + desc TXE + 7 + 7 + read-only + + + RTOF + desc RTOF + 8 + 8 + read-only + + + MPB + desc MPB + 16 + 16 + read-only + + + + + DR + desc DR + 0x4 + 32 + read-write + 0x1FF + 0x1FF03FF + + + TDR + desc TDR + 8 + 0 + read-write + + + MPID + desc MPID + 9 + 9 + read-write + + + RDR + desc RDR + 24 + 16 + read-write + + + + + BRR + desc BRR + 0x8 + 32 + read-write + 0xFF00 + 0xFF7F + + + DIV_FRACTION + desc DIV_FRACTION + 6 + 0 + read-write + + + DIV_INTEGER + desc DIV_INTEGER + 15 + 8 + read-write + + + + + CR1 + desc CR1 + 0xC + 32 + read-write + 0x80000000 + 0xF11B96FF + + + RTOE + desc RTOE + 0 + 0 + read-write + + + RTOIE + desc RTOIE + 1 + 1 + read-write + + + RE + desc RE + 2 + 2 + read-write + + + TE + desc TE + 3 + 3 + read-write + + + SLME + desc SLME + 4 + 4 + read-write + + + RIE + desc RIE + 5 + 5 + read-write + + + TCIE + desc TCIE + 6 + 6 + read-write + + + TXEIE + desc TXEIE + 7 + 7 + read-write + + + PS + desc PS + 9 + 9 + read-write + + + PCE + desc PCE + 10 + 10 + read-write + + + M + desc M + 12 + 12 + read-write + + + OVER8 + desc OVER8 + 15 + 15 + read-write + + + CPE + desc CPE + 16 + 16 + write-only + + + CFE + desc CFE + 17 + 17 + write-only + + + CORE + desc CORE + 19 + 19 + write-only + + + CRTOF + desc CRTOF + 20 + 20 + write-only + + + MS + desc MS + 24 + 24 + read-write + + + ML + desc ML + 28 + 28 + read-write + + + FBME + desc FBME + 29 + 29 + read-write + + + NFE + desc NFE + 30 + 30 + read-write + + + SBS + desc SBS + 31 + 31 + read-write + + + + + CR2 + desc CR2 + 0x10 + 32 + read-write + 0x600 + 0x3801 + + + MPE + desc MPE + 0 + 0 + read-write + + + CLKC + desc CLKC + 12 + 11 + read-write + + + STOP + desc STOP + 13 + 13 + read-write + + + + + CR3 + desc CR3 + 0x14 + 32 + read-write + 0x0 + 0xE00328 + + + HDSEL + desc HDSEL + 3 + 3 + read-write + + + LOOP + desc LOOP + 4 + 4 + read-write + + + SCEN + desc SCEN + 5 + 5 + read-write + + + RTSE + desc RTSE + 8 + 8 + read-write + + + CTSE + desc CTSE + 9 + 9 + read-write + + + BCN + desc BCN + 23 + 21 + read-write + + + + + PR + desc PR + 0x18 + 32 + read-write + 0x0 + 0x3 + + + PSC + desc PSC + 1 + 0 + read-write + + + + + + + USART3 + desc USART3 + 0x4001D400 + + 0x0 + 0x10 + + + + SR + desc SR + 0x0 + 32 + read-only + 0xC0 + 0x101EB + + + PE + desc PE + 0 + 0 + read-only + + + FE + desc FE + 1 + 1 + read-only + + + ORE + desc ORE + 3 + 3 + read-only + + + RXNE + desc RXNE + 5 + 5 + read-only + + + TC + desc TC + 6 + 6 + read-only + + + TXE + desc TXE + 7 + 7 + read-only + + + RTOF + desc RTOF + 8 + 8 + read-only + + + MPB + desc MPB + 16 + 16 + read-only + + + + + DR + desc DR + 0x4 + 32 + read-write + 0x1FF + 0x1FF03FF + + + TDR + desc TDR + 8 + 0 + read-write + + + MPID + desc MPID + 9 + 9 + read-write + + + RDR + desc RDR + 24 + 16 + read-write + + + + + BRR + desc BRR + 0x8 + 32 + read-write + 0xFF00 + 0xFF7F + + + DIV_FRACTION + desc DIV_FRACTION + 6 + 0 + read-write + + + DIV_INTEGER + desc DIV_INTEGER + 15 + 8 + read-write + + + + + CR1 + desc CR1 + 0xC + 32 + read-write + 0x80000000 + 0xF11B96FF + + + RTOE + desc RTOE + 0 + 0 + read-write + + + RTOIE + desc RTOIE + 1 + 1 + read-write + + + RE + desc RE + 2 + 2 + read-write + + + TE + desc TE + 3 + 3 + read-write + + + SLME + desc SLME + 4 + 4 + read-write + + + RIE + desc RIE + 5 + 5 + read-write + + + TCIE + desc TCIE + 6 + 6 + read-write + + + TXEIE + desc TXEIE + 7 + 7 + read-write + + + PS + desc PS + 9 + 9 + read-write + + + PCE + desc PCE + 10 + 10 + read-write + + + M + desc M + 12 + 12 + read-write + + + OVER8 + desc OVER8 + 15 + 15 + read-write + + + CPE + desc CPE + 16 + 16 + write-only + + + CFE + desc CFE + 17 + 17 + write-only + + + CORE + desc CORE + 19 + 19 + write-only + + + CRTOF + desc CRTOF + 20 + 20 + write-only + + + MS + desc MS + 24 + 24 + read-write + + + ML + desc ML + 28 + 28 + read-write + + + FBME + desc FBME + 29 + 29 + read-write + + + NFE + desc NFE + 30 + 30 + read-write + + + SBS + desc SBS + 31 + 31 + read-write + + + + + CR2 + desc CR2 + 0x10 + 32 + read-write + 0x600 + 0x3801 + + + MPE + desc MPE + 0 + 0 + read-write + + + CLKC + desc CLKC + 12 + 11 + read-write + + + STOP + desc STOP + 13 + 13 + read-write + + + + + CR3 + desc CR3 + 0x14 + 32 + read-write + 0x0 + 0xE00328 + + + HDSEL + desc HDSEL + 3 + 3 + read-write + + + LOOP + desc LOOP + 4 + 4 + read-write + + + SCEN + desc SCEN + 5 + 5 + read-write + + + RTSE + desc RTSE + 8 + 8 + read-write + + + CTSE + desc CTSE + 9 + 9 + read-write + + + BCN + desc BCN + 23 + 21 + read-write + + + + + PR + desc PR + 0x18 + 32 + read-write + 0x0 + 0x3 + + + PSC + desc PSC + 1 + 0 + read-write + + + + + + + USART4 + desc USART4 + 0x4001D800 + + 0x0 + 0x10 + + + + SR + desc SR + 0x0 + 32 + read-only + 0xC0 + 0x101EB + + + PE + desc PE + 0 + 0 + read-only + + + FE + desc FE + 1 + 1 + read-only + + + ORE + desc ORE + 3 + 3 + read-only + + + RXNE + desc RXNE + 5 + 5 + read-only + + + TC + desc TC + 6 + 6 + read-only + + + TXE + desc TXE + 7 + 7 + read-only + + + RTOF + desc RTOF + 8 + 8 + read-only + + + MPB + desc MPB + 16 + 16 + read-only + + + + + DR + desc DR + 0x4 + 32 + read-write + 0x1FF + 0x1FF03FF + + + TDR + desc TDR + 8 + 0 + read-write + + + MPID + desc MPID + 9 + 9 + read-write + + + RDR + desc RDR + 24 + 16 + read-write + + + + + BRR + desc BRR + 0x8 + 32 + read-write + 0xFF00 + 0xFF7F + + + DIV_FRACTION + desc DIV_FRACTION + 6 + 0 + read-write + + + DIV_INTEGER + desc DIV_INTEGER + 15 + 8 + read-write + + + + + CR1 + desc CR1 + 0xC + 32 + read-write + 0x80000000 + 0xF11B96FF + + + RTOE + desc RTOE + 0 + 0 + read-write + + + RTOIE + desc RTOIE + 1 + 1 + read-write + + + RE + desc RE + 2 + 2 + read-write + + + TE + desc TE + 3 + 3 + read-write + + + SLME + desc SLME + 4 + 4 + read-write + + + RIE + desc RIE + 5 + 5 + read-write + + + TCIE + desc TCIE + 6 + 6 + read-write + + + TXEIE + desc TXEIE + 7 + 7 + read-write + + + PS + desc PS + 9 + 9 + read-write + + + PCE + desc PCE + 10 + 10 + read-write + + + M + desc M + 12 + 12 + read-write + + + OVER8 + desc OVER8 + 15 + 15 + read-write + + + CPE + desc CPE + 16 + 16 + write-only + + + CFE + desc CFE + 17 + 17 + write-only + + + CORE + desc CORE + 19 + 19 + write-only + + + CRTOF + desc CRTOF + 20 + 20 + write-only + + + MS + desc MS + 24 + 24 + read-write + + + ML + desc ML + 28 + 28 + read-write + + + FBME + desc FBME + 29 + 29 + read-write + + + NFE + desc NFE + 30 + 30 + read-write + + + SBS + desc SBS + 31 + 31 + read-write + + + + + CR2 + desc CR2 + 0x10 + 32 + read-write + 0x600 + 0x3801 + + + MPE + desc MPE + 0 + 0 + read-write + + + CLKC + desc CLKC + 12 + 11 + read-write + + + STOP + desc STOP + 13 + 13 + read-write + + + + + CR3 + desc CR3 + 0x14 + 32 + read-write + 0x0 + 0xE00328 + + + HDSEL + desc HDSEL + 3 + 3 + read-write + + + LOOP + desc LOOP + 4 + 4 + read-write + + + SCEN + desc SCEN + 5 + 5 + read-write + + + RTSE + desc RTSE + 8 + 8 + read-write + + + CTSE + desc CTSE + 9 + 9 + read-write + + + BCN + desc BCN + 23 + 21 + read-write + + + + + PR + desc PR + 0x18 + 32 + read-write + 0x0 + 0x3 + + + PSC + desc PSC + 1 + 0 + read-write + + + + + + + USART5 + desc USART5 + 0x4001DC00 + + 0x0 + 0x10 + + + + SR + desc SR + 0x0 + 32 + read-only + 0xC0 + 0x106FB + + + PE + desc PE + 0 + 0 + read-only + + + FE + desc FE + 1 + 1 + read-only + + + ORE + desc ORE + 3 + 3 + read-only + + + BE + desc BE + 4 + 4 + read-only + + + RXNE + desc RXNE + 5 + 5 + read-only + + + TC + desc TC + 6 + 6 + read-only + + + TXE + desc TXE + 7 + 7 + read-only + + + WKUP + desc WKUP + 9 + 9 + read-only + + + LBD + desc LBD + 10 + 10 + read-only + + + MPB + desc MPB + 16 + 16 + read-only + + + + + DR + desc DR + 0x4 + 32 + read-write + 0x1FF + 0x1FF03FF + + + TDR + desc TDR + 8 + 0 + read-write + + + MPID + desc MPID + 9 + 9 + read-write + + + RDR + desc RDR + 24 + 16 + read-write + + + + + BRR + desc BRR + 0x8 + 32 + read-write + 0xFF00 + 0xFF00 + + + DIV_INTEGER + desc DIV_INTEGER + 15 + 8 + read-write + + + + + CR1 + desc CR1 + 0xC + 32 + read-write + 0x80000000 + 0xD1EF96FC + + + RE + desc RE + 2 + 2 + read-write + + + TE + desc TE + 3 + 3 + read-write + + + SLME + desc SLME + 4 + 4 + read-write + + + RIE + desc RIE + 5 + 5 + read-write + + + TCIE + desc TCIE + 6 + 6 + read-write + + + TXEIE + desc TXEIE + 7 + 7 + read-write + + + PS + desc PS + 9 + 9 + read-write + + + PCE + desc PCE + 10 + 10 + read-write + + + M + desc M + 12 + 12 + read-write + + + OVER8 + desc OVER8 + 15 + 15 + read-write + + + CPE + desc CPE + 16 + 16 + write-only + + + CFE + desc CFE + 17 + 17 + write-only + + + CNF + desc CNF + 18 + 18 + write-only + + + CORE + desc CORE + 19 + 19 + write-only + + + CBE + desc CBE + 21 + 21 + write-only + + + CWKUP + desc CWKUP + 22 + 22 + write-only + + + CLBD + desc CLBD + 23 + 23 + write-only + + + MS + desc MS + 24 + 24 + read-write + + + ML + desc ML + 28 + 28 + read-write + + + NFE + desc NFE + 30 + 30 + read-write + + + SBS + desc SBS + 31 + 31 + read-write + + + + + CR2 + desc CR2 + 0x10 + 32 + read-write + 0x600 + 0x779FF + + + MPE + desc MPE + 0 + 0 + read-write + + + WKUPIE + desc WKUPIE + 1 + 1 + read-write + + + BEIE + desc BEIE + 2 + 2 + read-write + + + BEE + desc BEE + 3 + 3 + read-write + + + LBDIE + desc LBDIE + 4 + 4 + read-write + + + LBDL + desc LBDL + 5 + 5 + read-write + + + SBKL + desc SBKL + 7 + 6 + read-write + + + WKUPE + desc WKUPE + 8 + 8 + read-write + + + CLKC + desc CLKC + 12 + 11 + read-write + + + STOP + desc STOP + 13 + 13 + read-write + + + LINEN + desc LINEN + 14 + 14 + read-write + + + SBK + desc SBK + 16 + 16 + read-write + + + SBKM + desc SBKM + 17 + 17 + read-write + + + + + CR3 + desc CR3 + 0x14 + 32 + read-write + 0x0 + 0x318 + + + HDSEL + desc HDSEL + 3 + 3 + read-write + + + LOOP + desc LOOP + 4 + 4 + read-write + + + RTSE + desc RTSE + 8 + 8 + read-write + + + CTSE + desc CTSE + 9 + 9 + read-write + + + + + PR + desc PR + 0x18 + 32 + read-write + 0x0 + 0xF + + + PSC + desc PSC + 1 + 0 + read-write + + + LBMPSC + desc LBMPSC + 3 + 2 + read-write + + + + + LBMC + desc LBMC + 0x1C + 32 + read-write + 0x0 + 0xFFFF + + + LBMC + desc LBMC + 15 + 0 + read-write + + + + + + + USART6 + desc USART6 + 0x40020C00 + + 0x0 + 0x10 + + + + SR + desc SR + 0x0 + 32 + read-only + 0xC0 + 0x101EB + + + PE + desc PE + 0 + 0 + read-only + + + FE + desc FE + 1 + 1 + read-only + + + ORE + desc ORE + 3 + 3 + read-only + + + RXNE + desc RXNE + 5 + 5 + read-only + + + TC + desc TC + 6 + 6 + read-only + + + TXE + desc TXE + 7 + 7 + read-only + + + RTOF + desc RTOF + 8 + 8 + read-only + + + MPB + desc MPB + 16 + 16 + read-only + + + + + DR + desc DR + 0x4 + 32 + read-write + 0x1FF + 0x1FF03FF + + + TDR + desc TDR + 8 + 0 + read-write + + + MPID + desc MPID + 9 + 9 + read-write + + + RDR + desc RDR + 24 + 16 + read-write + + + + + BRR + desc BRR + 0x8 + 32 + read-write + 0xFF00 + 0xFF7F + + + DIV_FRACTION + desc DIV_FRACTION + 6 + 0 + read-write + + + DIV_INTEGER + desc DIV_INTEGER + 15 + 8 + read-write + + + + + CR1 + desc CR1 + 0xC + 32 + read-write + 0x80000000 + 0xF11B96FF + + + RTOE + desc RTOE + 0 + 0 + read-write + + + RTOIE + desc RTOIE + 1 + 1 + read-write + + + RE + desc RE + 2 + 2 + read-write + + + TE + desc TE + 3 + 3 + read-write + + + SLME + desc SLME + 4 + 4 + read-write + + + RIE + desc RIE + 5 + 5 + read-write + + + TCIE + desc TCIE + 6 + 6 + read-write + + + TXEIE + desc TXEIE + 7 + 7 + read-write + + + PS + desc PS + 9 + 9 + read-write + + + PCE + desc PCE + 10 + 10 + read-write + + + M + desc M + 12 + 12 + read-write + + + OVER8 + desc OVER8 + 15 + 15 + read-write + + + CPE + desc CPE + 16 + 16 + write-only + + + CFE + desc CFE + 17 + 17 + write-only + + + CORE + desc CORE + 19 + 19 + write-only + + + CRTOF + desc CRTOF + 20 + 20 + write-only + + + MS + desc MS + 24 + 24 + read-write + + + ML + desc ML + 28 + 28 + read-write + + + FBME + desc FBME + 29 + 29 + read-write + + + NFE + desc NFE + 30 + 30 + read-write + + + SBS + desc SBS + 31 + 31 + read-write + + + + + CR2 + desc CR2 + 0x10 + 32 + read-write + 0x600 + 0x3801 + + + MPE + desc MPE + 0 + 0 + read-write + + + CLKC + desc CLKC + 12 + 11 + read-write + + + STOP + desc STOP + 13 + 13 + read-write + + + + + CR3 + desc CR3 + 0x14 + 32 + read-write + 0x0 + 0xE00328 + + + HDSEL + desc HDSEL + 3 + 3 + read-write + + + LOOP + desc LOOP + 4 + 4 + read-write + + + SCEN + desc SCEN + 5 + 5 + read-write + + + RTSE + desc RTSE + 8 + 8 + read-write + + + CTSE + desc CTSE + 9 + 9 + read-write + + + BCN + desc BCN + 23 + 21 + read-write + + + + + PR + desc PR + 0x18 + 32 + read-write + 0x0 + 0x3 + + + PSC + desc PSC + 1 + 0 + read-write + + + + + + + USART7 + desc USART7 + 0x40021000 + + 0x0 + 0x10 + + + + SR + desc SR + 0x0 + 32 + read-only + 0xC0 + 0x101EB + + + PE + desc PE + 0 + 0 + read-only + + + FE + desc FE + 1 + 1 + read-only + + + ORE + desc ORE + 3 + 3 + read-only + + + RXNE + desc RXNE + 5 + 5 + read-only + + + TC + desc TC + 6 + 6 + read-only + + + TXE + desc TXE + 7 + 7 + read-only + + + RTOF + desc RTOF + 8 + 8 + read-only + + + MPB + desc MPB + 16 + 16 + read-only + + + + + DR + desc DR + 0x4 + 32 + read-write + 0x1FF + 0x1FF03FF + + + TDR + desc TDR + 8 + 0 + read-write + + + MPID + desc MPID + 9 + 9 + read-write + + + RDR + desc RDR + 24 + 16 + read-write + + + + + BRR + desc BRR + 0x8 + 32 + read-write + 0xFF00 + 0xFF7F + + + DIV_FRACTION + desc DIV_FRACTION + 6 + 0 + read-write + + + DIV_INTEGER + desc DIV_INTEGER + 15 + 8 + read-write + + + + + CR1 + desc CR1 + 0xC + 32 + read-write + 0x80000000 + 0xF11B96FF + + + RTOE + desc RTOE + 0 + 0 + read-write + + + RTOIE + desc RTOIE + 1 + 1 + read-write + + + RE + desc RE + 2 + 2 + read-write + + + TE + desc TE + 3 + 3 + read-write + + + SLME + desc SLME + 4 + 4 + read-write + + + RIE + desc RIE + 5 + 5 + read-write + + + TCIE + desc TCIE + 6 + 6 + read-write + + + TXEIE + desc TXEIE + 7 + 7 + read-write + + + PS + desc PS + 9 + 9 + read-write + + + PCE + desc PCE + 10 + 10 + read-write + + + M + desc M + 12 + 12 + read-write + + + OVER8 + desc OVER8 + 15 + 15 + read-write + + + CPE + desc CPE + 16 + 16 + write-only + + + CFE + desc CFE + 17 + 17 + write-only + + + CORE + desc CORE + 19 + 19 + write-only + + + CRTOF + desc CRTOF + 20 + 20 + write-only + + + MS + desc MS + 24 + 24 + read-write + + + ML + desc ML + 28 + 28 + read-write + + + FBME + desc FBME + 29 + 29 + read-write + + + NFE + desc NFE + 30 + 30 + read-write + + + SBS + desc SBS + 31 + 31 + read-write + + + + + CR2 + desc CR2 + 0x10 + 32 + read-write + 0x600 + 0x3801 + + + MPE + desc MPE + 0 + 0 + read-write + + + CLKC + desc CLKC + 12 + 11 + read-write + + + STOP + desc STOP + 13 + 13 + read-write + + + + + CR3 + desc CR3 + 0x14 + 32 + read-write + 0x0 + 0xE00328 + + + HDSEL + desc HDSEL + 3 + 3 + read-write + + + LOOP + desc LOOP + 4 + 4 + read-write + + + SCEN + desc SCEN + 5 + 5 + read-write + + + RTSE + desc RTSE + 8 + 8 + read-write + + + CTSE + desc CTSE + 9 + 9 + read-write + + + BCN + desc BCN + 23 + 21 + read-write + + + + + PR + desc PR + 0x18 + 32 + read-write + 0x0 + 0x3 + + + PSC + desc PSC + 1 + 0 + read-write + + + + + + + USART8 + desc USART8 + 0x40021400 + + 0x0 + 0x10 + + + + SR + desc SR + 0x0 + 32 + read-only + 0xC0 + 0x101EB + + + PE + desc PE + 0 + 0 + read-only + + + FE + desc FE + 1 + 1 + read-only + + + ORE + desc ORE + 3 + 3 + read-only + + + RXNE + desc RXNE + 5 + 5 + read-only + + + TC + desc TC + 6 + 6 + read-only + + + TXE + desc TXE + 7 + 7 + read-only + + + RTOF + desc RTOF + 8 + 8 + read-only + + + MPB + desc MPB + 16 + 16 + read-only + + + + + DR + desc DR + 0x4 + 32 + read-write + 0x1FF + 0x1FF03FF + + + TDR + desc TDR + 8 + 0 + read-write + + + MPID + desc MPID + 9 + 9 + read-write + + + RDR + desc RDR + 24 + 16 + read-write + + + + + BRR + desc BRR + 0x8 + 32 + read-write + 0xFF00 + 0xFF7F + + + DIV_FRACTION + desc DIV_FRACTION + 6 + 0 + read-write + + + DIV_INTEGER + desc DIV_INTEGER + 15 + 8 + read-write + + + + + CR1 + desc CR1 + 0xC + 32 + read-write + 0x80000000 + 0xF11B96FF + + + RTOE + desc RTOE + 0 + 0 + read-write + + + RTOIE + desc RTOIE + 1 + 1 + read-write + + + RE + desc RE + 2 + 2 + read-write + + + TE + desc TE + 3 + 3 + read-write + + + SLME + desc SLME + 4 + 4 + read-write + + + RIE + desc RIE + 5 + 5 + read-write + + + TCIE + desc TCIE + 6 + 6 + read-write + + + TXEIE + desc TXEIE + 7 + 7 + read-write + + + PS + desc PS + 9 + 9 + read-write + + + PCE + desc PCE + 10 + 10 + read-write + + + M + desc M + 12 + 12 + read-write + + + OVER8 + desc OVER8 + 15 + 15 + read-write + + + CPE + desc CPE + 16 + 16 + write-only + + + CFE + desc CFE + 17 + 17 + write-only + + + CORE + desc CORE + 19 + 19 + write-only + + + CRTOF + desc CRTOF + 20 + 20 + write-only + + + MS + desc MS + 24 + 24 + read-write + + + ML + desc ML + 28 + 28 + read-write + + + FBME + desc FBME + 29 + 29 + read-write + + + NFE + desc NFE + 30 + 30 + read-write + + + SBS + desc SBS + 31 + 31 + read-write + + + + + CR2 + desc CR2 + 0x10 + 32 + read-write + 0x600 + 0x3801 + + + MPE + desc MPE + 0 + 0 + read-write + + + CLKC + desc CLKC + 12 + 11 + read-write + + + STOP + desc STOP + 13 + 13 + read-write + + + + + CR3 + desc CR3 + 0x14 + 32 + read-write + 0x0 + 0xE00328 + + + HDSEL + desc HDSEL + 3 + 3 + read-write + + + LOOP + desc LOOP + 4 + 4 + read-write + + + SCEN + desc SCEN + 5 + 5 + read-write + + + RTSE + desc RTSE + 8 + 8 + read-write + + + CTSE + desc CTSE + 9 + 9 + read-write + + + BCN + desc BCN + 23 + 21 + read-write + + + + + PR + desc PR + 0x18 + 32 + read-write + 0x0 + 0x3 + + + PSC + desc PSC + 1 + 0 + read-write + + + + + + + USART9 + desc USART9 + 0x40021800 + + 0x0 + 0x10 + + + + SR + desc SR + 0x0 + 32 + read-only + 0xC0 + 0x101EB + + + PE + desc PE + 0 + 0 + read-only + + + FE + desc FE + 1 + 1 + read-only + + + ORE + desc ORE + 3 + 3 + read-only + + + RXNE + desc RXNE + 5 + 5 + read-only + + + TC + desc TC + 6 + 6 + read-only + + + TXE + desc TXE + 7 + 7 + read-only + + + RTOF + desc RTOF + 8 + 8 + read-only + + + MPB + desc MPB + 16 + 16 + read-only + + + + + DR + desc DR + 0x4 + 32 + read-write + 0x1FF + 0x1FF03FF + + + TDR + desc TDR + 8 + 0 + read-write + + + MPID + desc MPID + 9 + 9 + read-write + + + RDR + desc RDR + 24 + 16 + read-write + + + + + BRR + desc BRR + 0x8 + 32 + read-write + 0xFF00 + 0xFF7F + + + DIV_FRACTION + desc DIV_FRACTION + 6 + 0 + read-write + + + DIV_INTEGER + desc DIV_INTEGER + 15 + 8 + read-write + + + + + CR1 + desc CR1 + 0xC + 32 + read-write + 0x80000000 + 0xF11B96FF + + + RTOE + desc RTOE + 0 + 0 + read-write + + + RTOIE + desc RTOIE + 1 + 1 + read-write + + + RE + desc RE + 2 + 2 + read-write + + + TE + desc TE + 3 + 3 + read-write + + + SLME + desc SLME + 4 + 4 + read-write + + + RIE + desc RIE + 5 + 5 + read-write + + + TCIE + desc TCIE + 6 + 6 + read-write + + + TXEIE + desc TXEIE + 7 + 7 + read-write + + + PS + desc PS + 9 + 9 + read-write + + + PCE + desc PCE + 10 + 10 + read-write + + + M + desc M + 12 + 12 + read-write + + + OVER8 + desc OVER8 + 15 + 15 + read-write + + + CPE + desc CPE + 16 + 16 + write-only + + + CFE + desc CFE + 17 + 17 + write-only + + + CORE + desc CORE + 19 + 19 + write-only + + + CRTOF + desc CRTOF + 20 + 20 + write-only + + + MS + desc MS + 24 + 24 + read-write + + + ML + desc ML + 28 + 28 + read-write + + + FBME + desc FBME + 29 + 29 + read-write + + + NFE + desc NFE + 30 + 30 + read-write + + + SBS + desc SBS + 31 + 31 + read-write + + + + + CR2 + desc CR2 + 0x10 + 32 + read-write + 0x600 + 0x3801 + + + MPE + desc MPE + 0 + 0 + read-write + + + CLKC + desc CLKC + 12 + 11 + read-write + + + STOP + desc STOP + 13 + 13 + read-write + + + + + CR3 + desc CR3 + 0x14 + 32 + read-write + 0x0 + 0xE00328 + + + HDSEL + desc HDSEL + 3 + 3 + read-write + + + LOOP + desc LOOP + 4 + 4 + read-write + + + SCEN + desc SCEN + 5 + 5 + read-write + + + RTSE + desc RTSE + 8 + 8 + read-write + + + CTSE + desc CTSE + 9 + 9 + read-write + + + BCN + desc BCN + 23 + 21 + read-write + + + + + PR + desc PR + 0x18 + 32 + read-write + 0x0 + 0x3 + + + PSC + desc PSC + 1 + 0 + read-write + + + + + + + USBF + desc USBF + 0x40080000 + + 0x0 + 0xE04 + + + + GOTGCTL + desc GOTGCTL + 0x0 + 32 + read-only + 0x10000 + 0x3F9FFF + + + SESREQSCS + desc SESREQSCS + 0 + 0 + read-only + + + SESREQ + desc SESREQ + 1 + 1 + read-write + + + VBVALIDOVEN + desc VBVALIDOVEN + 2 + 2 + read-write + + + VBVALIDOVVAL + desc VBVALIDOVVAL + 3 + 3 + read-write + + + AVALIDOVEN + desc AVALIDOVEN + 4 + 4 + read-write + + + AVALIDOVVAL + desc AVALIDOVVAL + 5 + 5 + read-write + + + BVALIDOVEN + desc BVALIDOVEN + 6 + 6 + read-write + + + BVALIDOVVAL + desc BVALIDOVVAL + 7 + 7 + read-write + + + HSTNEGSCS + desc HSTNEGSCS + 8 + 8 + read-only + + + HNPREQ + desc HNPREQ + 9 + 9 + read-write + + + HSTSETHNPEN + desc HSTSETHNPEN + 10 + 10 + read-write + + + DEVHNPEN + desc DEVHNPEN + 11 + 11 + read-write + + + EHEN + desc EHEN + 12 + 12 + read-write + + + DBNCEFLTRBYPASS + desc DBNCEFLTRBYPASS + 15 + 15 + read-write + + + CONIDSTS + desc CONIDSTS + 16 + 16 + read-only + + + DBNCTIME + desc DBNCTIME + 17 + 17 + read-only + + + ASESVLD + desc ASESVLD + 18 + 18 + read-only + + + BSESVLD + desc BSESVLD + 19 + 19 + read-only + + + OTGVER + desc OTGVER + 20 + 20 + read-write + + + CURMOD + desc CURMOD + 21 + 21 + read-only + + + + + GOTGINT + desc GOTGINT + 0x4 + 32 + read-write + 0x0 + 0xE0304 + + + SESENDDET + desc SESENDDET + 2 + 2 + read-write + + + SESREQSUCSTSCHNG + desc SESREQSUCSTSCHNG + 8 + 8 + read-write + + + HSTNEGSUCSTSCHNG + desc HSTNEGSUCSTSCHNG + 9 + 9 + read-write + + + HSTNEGDET + desc HSTNEGDET + 17 + 17 + read-write + + + ADEVTOUTCHG + desc ADEVTOUTCHG + 18 + 18 + read-write + + + DBNCEDONE + desc DBNCEDONE + 19 + 19 + read-write + + + + + GAHBCFG + desc GAHBCFG + 0x8 + 32 + read-write + 0x0 + 0xE001BF + + + GLBLINTRMSK + desc GLBLINTRMSK + 0 + 0 + read-write + + + HBSTLEN + desc HBSTLEN + 4 + 1 + read-write + + + DMAEN + desc DMAEN + 5 + 5 + read-write + + + NPTXFEMPLVL + desc NPTXFEMPLVL + 7 + 7 + read-write + + + PTXFEMPLVL + desc PTXFEMPLVL + 8 + 8 + read-write + + + REMMEMSUPP + desc REMMEMSUPP + 21 + 21 + read-write + + + NOTIALLDMAWRIT + desc NOTIALLDMAWRIT + 22 + 22 + read-write + + + AHBSINGLE + desc AHBSINGLE + 23 + 23 + read-write + + + + + GUSBCFG + desc GUSBCFG + 0xC + 32 + read-write + 0x1440 + 0xF4403F6F + + + TOUTCAL + desc TOUTCAL + 2 + 0 + read-write + + + PHYIF + desc PHYIF + 3 + 3 + read-write + + + FSINTF + desc FSINTF + 5 + 5 + read-write + + + PHYSEL + desc PHYSEL + 6 + 6 + read-write + + + SRPCAP + desc SRPCAP + 8 + 8 + read-write + + + HNPCAP + desc HNPCAP + 9 + 9 + read-write + + + USBTRDTIM + desc USBTRDTIM + 13 + 10 + read-write + + + TERMSELDLPULSE + desc TERMSELDLPULSE + 22 + 22 + read-write + + + IC_USBCAP + desc IC_USBCAP + 26 + 26 + read-write + + + TXENDDELAY + desc TXENDDELAY + 28 + 28 + read-write + + + FORCEHSTMODE + desc FORCEHSTMODE + 29 + 29 + read-write + + + FORCEDEVMODE + desc FORCEDEVMODE + 30 + 30 + read-write + + + CORRUPTTXPKT + desc CORRUPTTXPKT + 31 + 31 + write-only + + + + + GRSTCTL + desc GRSTCTL + 0x10 + 32 + read-write + 0x80000000 + 0xC00007F7 + + + CSFTRST + desc CSFTRST + 0 + 0 + read-write + + + PIUFSSFTRST + desc PIUFSSFTRST + 1 + 1 + read-write + + + FRMCNTRRST + desc FRMCNTRRST + 2 + 2 + read-write + + + RXFFLSH + desc RXFFLSH + 4 + 4 + read-write + + + TXFFLSH + desc TXFFLSH + 5 + 5 + read-write + + + TXFNUM + desc TXFNUM + 10 + 6 + read-write + + + DMAREQ + desc DMAREQ + 30 + 30 + read-only + + + AHBIDLE + desc AHBIDLE + 31 + 31 + read-only + + + + + GINTSTS + desc GINTSTS + 0x14 + 32 + read-only + 0x14000020 + 0xFFFEFCFF + + + CURMOD + desc CURMOD + 0 + 0 + read-only + + + MODEMIS + desc MODEMIS + 1 + 1 + read-write + + + OTGINT + desc OTGINT + 2 + 2 + read-only + + + SOF + desc SOF + 3 + 3 + read-write + + + RXFLVL + desc RXFLVL + 4 + 4 + read-only + + + NPTXFEMP + desc NPTXFEMP + 5 + 5 + read-only + + + GINNAKEFF + desc GINNAKEFF + 6 + 6 + read-only + + + GOUTNAKEFF + desc GOUTNAKEFF + 7 + 7 + read-only + + + ERLYSUSP + desc ERLYSUSP + 10 + 10 + read-write + + + USBSUSP + desc USBSUSP + 11 + 11 + read-write + + + USBRST + desc USBRST + 12 + 12 + read-write + + + ENUMDONE + desc ENUMDONE + 13 + 13 + read-write + + + ISOOUTDROP + desc ISOOUTDROP + 14 + 14 + read-write + + + EOPF + desc EOPF + 15 + 15 + read-write + + + EPMIS + desc EPMIS + 17 + 17 + read-write + + + IEPINT + desc IEPINT + 18 + 18 + read-only + + + OEPINT + desc OEPINT + 19 + 19 + read-only + + + INCOMPISOIN + desc INCOMPISOIN + 20 + 20 + read-write + + + INCOMPLP + desc INCOMPLP + 21 + 21 + read-write + + + FETSUSP + desc FETSUSP + 22 + 22 + read-write + + + RESETDET + desc RESETDET + 23 + 23 + read-write + + + PRTINT + desc PRTINT + 24 + 24 + read-only + + + HCHINT + desc HCHINT + 25 + 25 + read-only + + + PTXFEMP + desc PTXFEMP + 26 + 26 + read-only + + + LPM_INT + desc LPM_INT + 27 + 27 + read-write + + + CONIDSTSCHNG + desc CONIDSTSCHNG + 28 + 28 + read-write + + + DISCONNINT + desc DISCONNINT + 29 + 29 + read-write + + + SESSREQINT + desc SESSREQINT + 30 + 30 + read-write + + + WKUPINT + desc WKUPINT + 31 + 31 + read-write + + + + + GINTMSK + desc GINTMSK + 0x18 + 32 + read-write + 0x0 + 0xFFEEFCFE + + + MODEMISMSK + desc MODEMISMSK + 1 + 1 + read-write + + + OTGINTMSK + desc OTGINTMSK + 2 + 2 + read-write + + + SOFMSK + desc SOFMSK + 3 + 3 + read-write + + + RXFLVLMSK + desc RXFLVLMSK + 4 + 4 + read-write + + + NPTXFEMPMSK + desc NPTXFEMPMSK + 5 + 5 + read-write + + + GINNAKEFFMSK + desc GINNAKEFFMSK + 6 + 6 + read-write + + + GOUTNAKEFFMSK + desc GOUTNAKEFFMSK + 7 + 7 + read-write + + + ERLYSUSPMSK + desc ERLYSUSPMSK + 10 + 10 + read-write + + + USBSUSPMSK + desc USBSUSPMSK + 11 + 11 + read-write + + + USBRSTMSK + desc USBRSTMSK + 12 + 12 + read-write + + + ENUMDONEMSK + desc ENUMDONEMSK + 13 + 13 + read-write + + + ISOOUTDROPMSK + desc ISOOUTDROPMSK + 14 + 14 + read-write + + + EOPFMSK + desc EOPFMSK + 15 + 15 + read-write + + + EPMISMSK + desc EPMISMSK + 17 + 17 + read-write + + + IEPINTMSK + desc IEPINTMSK + 18 + 18 + read-write + + + OEPINTMSK + desc OEPINTMSK + 19 + 19 + read-write + + + INCOMPLPMSK + desc INCOMPLPMSK + 21 + 21 + read-write + + + FETSUSPMSK + desc FETSUSPMSK + 22 + 22 + read-write + + + RESETDETMSK + desc RESETDETMSK + 23 + 23 + read-write + + + PRTINTMSK + desc PRTINTMSK + 24 + 24 + read-write + + + HCHINTMSK + desc HCHINTMSK + 25 + 25 + read-write + + + PTXFEMPMSK + desc PTXFEMPMSK + 26 + 26 + read-write + + + LPM_INTMSK + desc LPM_INTMSK + 27 + 27 + read-write + + + CONIDSTSCHNGMSK + desc CONIDSTSCHNGMSK + 28 + 28 + read-write + + + DISCONNINTMSK + desc DISCONNINTMSK + 29 + 29 + read-write + + + SESSREQINTMSK + desc SESSREQINTMSK + 30 + 30 + read-write + + + WKUPINTMSK + desc WKUPINTMSK + 31 + 31 + read-write + + + + + GRXSTSR + desc GRXSTSR + 0x1C + 32 + read-only + 0x0 + 0x1FFFFFF + + + CHNUM + desc CHNUM + 3 + 0 + read-only + + + BCNT + desc BCNT + 14 + 4 + read-only + + + DPID + desc DPID + 16 + 15 + read-only + + + PKTSTS + desc PKTSTS + 20 + 17 + read-only + + + FN + desc FN + 24 + 21 + read-only + + + + + GRXSTSP + desc GRXSTSP + 0x20 + 32 + read-only + 0x0 + 0x1FFFFFF + + + CHNUM + desc CHNUM + 3 + 0 + read-only + + + BCNT + desc BCNT + 14 + 4 + read-only + + + DPID + desc DPID + 16 + 15 + read-only + + + PKTSTS + desc PKTSTS + 20 + 17 + read-only + + + FN + desc FN + 24 + 21 + read-only + + + + + GRXFSIZ + desc GRXFSIZ + 0x24 + 32 + read-write + 0x280 + 0x3FF + + + RXFDEP + desc RXFDEP + 9 + 0 + read-write + + + + + GNPTXFSIZ + desc GNPTXFSIZ + 0x28 + 32 + read-write + 0x2800280 + 0x3FF03FF + + + NPTXFSTADDR + desc NPTXFSTADDR + 9 + 0 + read-write + + + NPTXFDEP + desc NPTXFDEP + 25 + 16 + read-write + + + + + GNPTXSTS + desc GNPTXSTS + 0x2C + 32 + read-only + 0x80280 + 0x7FFFFFFF + + + NPTXFSPCAVAIL + desc NPTXFSPCAVAIL + 15 + 0 + read-only + + + NPTXQSPCAVAIL + desc NPTXQSPCAVAIL + 23 + 16 + read-only + + + NPTXQTOP + desc NPTXQTOP + 30 + 24 + read-only + + + + + GUID + desc GUID + 0x3C + 32 + read-write + 0x12345678 + 0xFFFFFFFF + + + GLPMCFG + desc GLPMCFG + 0x54 + 32 + read-write + 0x0 + 0x3FFFFFFF + + + LPMCAP + desc LPMCAP + 0 + 0 + read-write + + + APPL1RES + desc APPL1RES + 1 + 1 + read-write + + + HIRD + desc HIRD + 5 + 2 + read-write + + + BREMOTEWAKE + desc BREMOTEWAKE + 6 + 6 + read-write + + + ENBLSLPM + desc ENBLSLPM + 7 + 7 + read-write + + + HIRD_THRES + desc HIRD_THRES + 12 + 8 + read-write + + + COREL1RES + desc COREL1RES + 14 + 13 + read-only + + + SLPSTS + desc SLPSTS + 15 + 15 + read-only + + + L1RESUMEOK + desc L1RESUMEOK + 16 + 16 + read-only + + + LPM_CHNL_INDX + desc LPM_CHNL_INDX + 20 + 17 + read-write + + + LPM_RETRY_CNT + desc LPM_RETRY_CNT + 23 + 21 + read-write + + + SNDLPM + desc SNDLPM + 24 + 24 + read-write + + + LPM_RETRYCNT_STS + desc LPM_RETRYCNT_STS + 27 + 25 + read-only + + + LPM_ENBESL + desc LPM_ENBESL + 28 + 28 + read-write + + + LPM_RESTORESLPSTS + desc LPM_RESTORESLPSTS + 29 + 29 + read-write + + + + + GDFIFOCFG + desc GDFIFOCFG + 0x5C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + GDFIFOCFG + desc GDFIFOCFG + 15 + 0 + read-write + + + EPINFOBASEADDR + desc EPINFOBASEADDR + 31 + 16 + read-write + + + + + HPTXFSIZ + desc HPTXFSIZ + 0x100 + 32 + read-write + 0x2600280 + 0x3FF07FF + + + PTXFSTADDR + desc PTXFSTADDR + 10 + 0 + read-write + + + PTXFSIZE + desc PTXFSIZE + 25 + 16 + read-write + + + + + DIEPTXF1 + desc DIEPTXF1 + 0x104 + 32 + read-write + 0x2800500 + 0x3FF07FF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 10 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 25 + 16 + read-write + + + + + DIEPTXF2 + desc DIEPTXF2 + 0x108 + 32 + read-write + 0x2800780 + 0x3FF07FF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 10 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 25 + 16 + read-write + + + + + DIEPTXF3 + desc DIEPTXF3 + 0x10C + 32 + read-write + 0x2800A00 + 0x3FF0FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 11 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 25 + 16 + read-write + + + + + DIEPTXF4 + desc DIEPTXF4 + 0x110 + 32 + read-write + 0x2800C80 + 0x3FF0FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 11 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 25 + 16 + read-write + + + + + DIEPTXF5 + desc DIEPTXF5 + 0x114 + 32 + read-write + 0x2800F00 + 0x3FF0FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 11 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 25 + 16 + read-write + + + + + DIEPTXF6 + desc DIEPTXF6 + 0x118 + 32 + read-write + 0x2801180 + 0x3FF1FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 12 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 25 + 16 + read-write + + + + + DIEPTXF7 + desc DIEPTXF7 + 0x11C + 32 + read-write + 0x2801400 + 0x3FF1FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 12 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 25 + 16 + read-write + + + + + DIEPTXF8 + desc DIEPTXF8 + 0x120 + 32 + read-write + 0x2801680 + 0x3FF1FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 12 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 25 + 16 + read-write + + + + + DIEPTXF9 + desc DIEPTXF9 + 0x124 + 32 + read-write + 0x2801900 + 0x3FF1FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 12 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 25 + 16 + read-write + + + + + DIEPTXF10 + desc DIEPTXF10 + 0x128 + 32 + read-write + 0x2801B80 + 0x3FF1FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 12 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 25 + 16 + read-write + + + + + DIEPTXF11 + desc DIEPTXF11 + 0x12C + 32 + read-write + 0x2801E00 + 0x3FF1FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 12 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 25 + 16 + read-write + + + + + DIEPTXF12 + desc DIEPTXF12 + 0x130 + 32 + read-write + 0x2802080 + 0x3FF3FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 13 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 25 + 16 + read-write + + + + + DIEPTXF13 + desc DIEPTXF13 + 0x134 + 32 + read-write + 0x2802300 + 0x3FF3FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 13 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 25 + 16 + read-write + + + + + DIEPTXF14 + desc DIEPTXF14 + 0x138 + 32 + read-write + 0x2802580 + 0x3FF3FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 13 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 25 + 16 + read-write + + + + + DIEPTXF15 + desc DIEPTXF15 + 0x13C + 32 + read-write + 0x2802800 + 0x3FF3FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 13 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 25 + 16 + read-write + + + + + HCFG + desc HCFG + 0x400 + 32 + read-write + 0x200 + 0x8000FF87 + + + FSLSPCLKSEL + desc FSLSPCLKSEL + 1 + 0 + read-write + + + FSLSSUPP + desc FSLSSUPP + 2 + 2 + read-write + + + ENA32KHZS + desc ENA32KHZS + 7 + 7 + read-write + + + RESVALID + desc RESVALID + 15 + 8 + read-write + + + MODECHTIMEN + desc MODECHTIMEN + 31 + 31 + read-write + + + + + HFIR + desc HFIR + 0x404 + 32 + read-write + 0x17D7 + 0x1FFFF + + + FRINT + desc FRINT + 15 + 0 + read-write + + + HFIRRLDCTRL + desc HFIRRLDCTRL + 16 + 16 + read-write + + + + + HFNUM + desc HFNUM + 0x408 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + FRNUM + desc FRNUM + 15 + 0 + read-only + + + FRREM + desc FRREM + 31 + 16 + read-only + + + + + HPTXSTS + desc HPTXSTS + 0x410 + 32 + read-only + 0x80280 + 0xFFFFFFFF + + + PTXFSPCAVAIL + desc PTXFSPCAVAIL + 15 + 0 + read-only + + + PTXQSPCAVAIL + desc PTXQSPCAVAIL + 23 + 16 + read-only + + + PTXQTOP + desc PTXQTOP + 31 + 24 + read-only + + + + + HAINT + desc HAINT + 0x414 + 32 + read-only + 0x0 + 0xFFFF + + + HAINT + desc HAINT + 15 + 0 + read-only + + + + + HAINTMSK + desc HAINTMSK + 0x418 + 32 + read-write + 0x0 + 0xFFFF + + + HAINTMSK + desc HAINTMSK + 15 + 0 + read-write + + + + + HPRT + desc HPRT + 0x440 + 32 + read-only + 0x0 + 0x7FDFF + + + PRTCONNSTS + desc PRTCONNSTS + 0 + 0 + read-only + + + PRTCONNDET + desc PRTCONNDET + 1 + 1 + read-write + + + PRTENA + desc PRTENA + 2 + 2 + read-write + + + PRTENCHNG + desc PRTENCHNG + 3 + 3 + read-write + + + PRTOVRCURRACT + desc PRTOVRCURRACT + 4 + 4 + read-only + + + PRTOVRCURRCHNG + desc PRTOVRCURRCHNG + 5 + 5 + read-write + + + PRTRES + desc PRTRES + 6 + 6 + read-write + + + PRTSUSP + desc PRTSUSP + 7 + 7 + read-write + + + PRTRST + desc PRTRST + 8 + 8 + read-write + + + PRTLNSTS + desc PRTLNSTS + 11 + 10 + read-only + + + PRTPWR + desc PRTPWR + 12 + 12 + read-write + + + PRTTSTCTL + desc PRTTSTCTL + 16 + 13 + read-write + + + PRTSPD + desc PRTSPD + 18 + 17 + read-only + + + + + HCCHAR0 + desc HCCHAR0 + 0x500 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT0 + desc HCSPLT0 + 0x504 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT0 + desc HCINT0 + 0x508 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK0 + desc HCINTMSK0 + 0x50C + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ0 + desc HCTSIZ0 + 0x510 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA0 + desc HCDMA0 + 0x514 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR1 + desc HCCHAR1 + 0x520 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT1 + desc HCSPLT1 + 0x524 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT1 + desc HCINT1 + 0x528 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK1 + desc HCINTMSK1 + 0x52C + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ1 + desc HCTSIZ1 + 0x530 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA1 + desc HCDMA1 + 0x534 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR2 + desc HCCHAR2 + 0x540 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT2 + desc HCSPLT2 + 0x544 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT2 + desc HCINT2 + 0x548 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK2 + desc HCINTMSK2 + 0x54C + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ2 + desc HCTSIZ2 + 0x550 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA2 + desc HCDMA2 + 0x554 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR3 + desc HCCHAR3 + 0x560 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT3 + desc HCSPLT3 + 0x564 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT3 + desc HCINT3 + 0x568 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK3 + desc HCINTMSK3 + 0x56C + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ3 + desc HCTSIZ3 + 0x570 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA3 + desc HCDMA3 + 0x574 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR4 + desc HCCHAR4 + 0x580 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT4 + desc HCSPLT4 + 0x584 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT4 + desc HCINT4 + 0x588 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK4 + desc HCINTMSK4 + 0x58C + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ4 + desc HCTSIZ4 + 0x590 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA4 + desc HCDMA4 + 0x594 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR5 + desc HCCHAR5 + 0x5A0 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT5 + desc HCSPLT5 + 0x5A4 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT5 + desc HCINT5 + 0x5A8 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK5 + desc HCINTMSK5 + 0x5AC + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ5 + desc HCTSIZ5 + 0x5B0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA5 + desc HCDMA5 + 0x5B4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR6 + desc HCCHAR6 + 0x5C0 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT6 + desc HCSPLT6 + 0x5C4 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT6 + desc HCINT6 + 0x5C8 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK6 + desc HCINTMSK6 + 0x5CC + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ6 + desc HCTSIZ6 + 0x5D0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA6 + desc HCDMA6 + 0x5D4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR7 + desc HCCHAR7 + 0x5E0 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT7 + desc HCSPLT7 + 0x5E4 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT7 + desc HCINT7 + 0x5E8 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK7 + desc HCINTMSK7 + 0x5EC + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ7 + desc HCTSIZ7 + 0x5F0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA7 + desc HCDMA7 + 0x5F4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR8 + desc HCCHAR8 + 0x600 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT8 + desc HCSPLT8 + 0x604 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT8 + desc HCINT8 + 0x608 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK8 + desc HCINTMSK8 + 0x60C + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ8 + desc HCTSIZ8 + 0x610 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA8 + desc HCDMA8 + 0x614 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR9 + desc HCCHAR9 + 0x620 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT9 + desc HCSPLT9 + 0x624 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT9 + desc HCINT9 + 0x628 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK9 + desc HCINTMSK9 + 0x62C + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ9 + desc HCTSIZ9 + 0x630 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA9 + desc HCDMA9 + 0x634 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR10 + desc HCCHAR10 + 0x640 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT10 + desc HCSPLT10 + 0x644 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT10 + desc HCINT10 + 0x648 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK10 + desc HCINTMSK10 + 0x64C + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ10 + desc HCTSIZ10 + 0x650 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA10 + desc HCDMA10 + 0x654 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR11 + desc HCCHAR11 + 0x660 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT11 + desc HCSPLT11 + 0x664 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT11 + desc HCINT11 + 0x668 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK11 + desc HCINTMSK11 + 0x66C + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ11 + desc HCTSIZ11 + 0x670 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA11 + desc HCDMA11 + 0x674 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR12 + desc HCCHAR12 + 0x680 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT12 + desc HCSPLT12 + 0x684 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT12 + desc HCINT12 + 0x688 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK12 + desc HCINTMSK12 + 0x68C + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ12 + desc HCTSIZ12 + 0x690 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA12 + desc HCDMA12 + 0x694 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR13 + desc HCCHAR13 + 0x6A0 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT13 + desc HCSPLT13 + 0x6A4 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT13 + desc HCINT13 + 0x6A8 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK13 + desc HCINTMSK13 + 0x6AC + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ13 + desc HCTSIZ13 + 0x6B0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA13 + desc HCDMA13 + 0x6B4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR14 + desc HCCHAR14 + 0x6C0 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT14 + desc HCSPLT14 + 0x6C4 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT14 + desc HCINT14 + 0x6C8 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK14 + desc HCINTMSK14 + 0x6CC + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ14 + desc HCTSIZ14 + 0x6D0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA14 + desc HCDMA14 + 0x6D4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR15 + desc HCCHAR15 + 0x6E0 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT15 + desc HCSPLT15 + 0x6E4 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT15 + desc HCINT15 + 0x6E8 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK15 + desc HCINTMSK15 + 0x6EC + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ15 + desc HCTSIZ15 + 0x6F0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA15 + desc HCDMA15 + 0x6F4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DCFG + desc DCFG + 0x800 + 32 + read-write + 0x8220000 + 0xFF00DFFF + + + DEVSPD + desc DEVSPD + 1 + 0 + read-write + + + NZSTSOUTHSHK + desc NZSTSOUTHSHK + 2 + 2 + read-write + + + ENA32KHZSUSP + desc ENA32KHZSUSP + 3 + 3 + read-write + + + DEVADDR + desc DEVADDR + 10 + 4 + read-write + + + PERFRINT + desc PERFRINT + 12 + 11 + read-write + + + XCVRDLY + desc XCVRDLY + 14 + 14 + read-write + + + ERRATICINTMSK + desc ERRATICINTMSK + 15 + 15 + read-write + + + PERSCHINTVL + desc PERSCHINTVL + 25 + 24 + read-write + + + RESVALID + desc RESVALID + 31 + 26 + read-write + + + + + DCTL + desc DCTL + 0x804 + 32 + read-write + 0x2 + 0xD8FFF + + + RMTWKUPSIG + desc RMTWKUPSIG + 0 + 0 + read-write + + + SFTDISCON + desc SFTDISCON + 1 + 1 + read-write + + + GNPINNAKSTS + desc GNPINNAKSTS + 2 + 2 + read-only + + + GOUTNAKSTS + desc GOUTNAKSTS + 3 + 3 + read-only + + + TSTCTL + desc TSTCTL + 6 + 4 + read-write + + + SGNPINNAK + desc SGNPINNAK + 7 + 7 + write-only + + + CGNPINNAK + desc CGNPINNAK + 8 + 8 + write-only + + + SGOUTNAK + desc SGOUTNAK + 9 + 9 + write-only + + + CGOUTNAK + desc CGOUTNAK + 10 + 10 + write-only + + + PWRONPRGDONE + desc PWRONPRGDONE + 11 + 11 + read-write + + + IGNRFRMNUM + desc IGNRFRMNUM + 15 + 15 + read-write + + + NAKONBBLE + desc NAKONBBLE + 16 + 16 + read-write + + + DEEPSLEEPBESLREJECT + desc DEEPSLEEPBESLREJECT + 18 + 18 + read-write + + + SERVINT + desc SERVINT + 19 + 19 + read-write + + + + + DSTS + desc DSTS + 0x808 + 32 + read-only + 0x2 + 0xFFFF0F + + + SUSPSTS + desc SUSPSTS + 0 + 0 + read-only + + + ENUMSPD + desc ENUMSPD + 2 + 1 + read-only + + + ERRTICERR + desc ERRTICERR + 3 + 3 + read-only + + + SOFFN + desc SOFFN + 21 + 8 + read-only + + + DEVLNSTS + desc DEVLNSTS + 23 + 22 + read-only + + + + + DIEPMSK + desc DIEPMSK + 0x810 + 32 + read-write + 0x0 + 0x217F + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + EPDISBLDMSK + desc EPDISBLDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + TIMEOUTMSK + desc TIMEOUTMSK + 3 + 3 + read-write + + + INTKNTXFEMPMSK + desc INTKNTXFEMPMSK + 4 + 4 + read-write + + + INTKNEPMISMSK + desc INTKNEPMISMSK + 5 + 5 + read-write + + + INEPNAKEFFMSK + desc INEPNAKEFFMSK + 6 + 6 + read-write + + + TXFIFOUNDRNMSK + desc TXFIFOUNDRNMSK + 8 + 8 + read-write + + + NAKMSK + desc NAKMSK + 13 + 13 + read-write + + + + + DOEPMSK + desc DOEPMSK + 0x814 + 32 + read-write + 0x0 + 0x717F + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + EPDISBLDMSK + desc EPDISBLDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + SETUPMSK + desc SETUPMSK + 3 + 3 + read-write + + + OUTTKNEPDISMSK + desc OUTTKNEPDISMSK + 4 + 4 + read-write + + + STSPHSERCVDMSK + desc STSPHSERCVDMSK + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERRMSK + desc OUTPKTERRMSK + 8 + 8 + read-write + + + BBLEERRMSK + desc BBLEERRMSK + 12 + 12 + read-write + + + NAKMSK + desc NAKMSK + 13 + 13 + read-write + + + NYETMSK + desc NYETMSK + 14 + 14 + read-write + + + + + DAINT + desc DAINT + 0x818 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + INEPINT0 + desc INEPINT0 + 0 + 0 + read-only + + + INEPINT1 + desc INEPINT1 + 1 + 1 + read-only + + + INEPINT2 + desc INEPINT2 + 2 + 2 + read-only + + + INEPINT3 + desc INEPINT3 + 3 + 3 + read-only + + + INEPINT4 + desc INEPINT4 + 4 + 4 + read-only + + + INEPINT5 + desc INEPINT5 + 5 + 5 + read-only + + + INEPINT6 + desc INEPINT6 + 6 + 6 + read-only + + + INEPINT7 + desc INEPINT7 + 7 + 7 + read-only + + + INEPINT8 + desc INEPINT8 + 8 + 8 + read-only + + + INEPINT9 + desc INEPINT9 + 9 + 9 + read-only + + + INEPINT10 + desc INEPINT10 + 10 + 10 + read-only + + + INEPINT11 + desc INEPINT11 + 11 + 11 + read-only + + + INEPINT12 + desc INEPINT12 + 12 + 12 + read-only + + + INEPINT13 + desc INEPINT13 + 13 + 13 + read-only + + + INEPINT14 + desc INEPINT14 + 14 + 14 + read-only + + + INEPINT15 + desc INEPINT15 + 15 + 15 + read-only + + + OUTEPINT0 + desc OUTEPINT0 + 16 + 16 + read-only + + + OUTEPINT1 + desc OUTEPINT1 + 17 + 17 + read-only + + + OUTEPINT2 + desc OUTEPINT2 + 18 + 18 + read-only + + + OUTEPINT3 + desc OUTEPINT3 + 19 + 19 + read-only + + + OUTEPINT4 + desc OUTEPINT4 + 20 + 20 + read-only + + + OUTEPINT5 + desc OUTEPINT5 + 21 + 21 + read-only + + + OUTEPINT6 + desc OUTEPINT6 + 22 + 22 + read-only + + + OUTEPINT7 + desc OUTEPINT7 + 23 + 23 + read-only + + + OUTEPINT8 + desc OUTEPINT8 + 24 + 24 + read-only + + + OUTEPINT9 + desc OUTEPINT9 + 25 + 25 + read-only + + + OUTEPINT10 + desc OUTEPINT10 + 26 + 26 + read-only + + + OUTEPINT11 + desc OUTEPINT11 + 27 + 27 + read-only + + + OUTEPINT12 + desc OUTEPINT12 + 28 + 28 + read-only + + + OUTEPINT13 + desc OUTEPINT13 + 29 + 29 + read-only + + + OUTEPINT14 + desc OUTEPINT14 + 30 + 30 + read-only + + + OUTEPINT15 + desc OUTEPINT15 + 31 + 31 + read-only + + + + + DAINTMSK + desc DAINTMSK + 0x81C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + INEPMSK0 + desc INEPMSK0 + 0 + 0 + read-write + + + INEPMSK1 + desc INEPMSK1 + 1 + 1 + read-write + + + INEPMSK2 + desc INEPMSK2 + 2 + 2 + read-write + + + INEPMSK3 + desc INEPMSK3 + 3 + 3 + read-write + + + INEPMSK4 + desc INEPMSK4 + 4 + 4 + read-write + + + INEPMSK5 + desc INEPMSK5 + 5 + 5 + read-write + + + INEPMSK6 + desc INEPMSK6 + 6 + 6 + read-write + + + INEPMSK7 + desc INEPMSK7 + 7 + 7 + read-write + + + INEPMSK8 + desc INEPMSK8 + 8 + 8 + read-write + + + INEPMSK9 + desc INEPMSK9 + 9 + 9 + read-write + + + INEPMSK10 + desc INEPMSK10 + 10 + 10 + read-write + + + INEPMSK11 + desc INEPMSK11 + 11 + 11 + read-write + + + INEPMSK12 + desc INEPMSK12 + 12 + 12 + read-write + + + INEPMSK13 + desc INEPMSK13 + 13 + 13 + read-write + + + INEPMSK14 + desc INEPMSK14 + 14 + 14 + read-write + + + INEPMSK15 + desc INEPMSK15 + 15 + 15 + read-write + + + OUTEPMSK0 + desc OUTEPMSK0 + 16 + 16 + read-write + + + OUTEPMSK1 + desc OUTEPMSK1 + 17 + 17 + read-write + + + OUTEPMSK2 + desc OUTEPMSK2 + 18 + 18 + read-write + + + OUTEPMSK3 + desc OUTEPMSK3 + 19 + 19 + read-write + + + OUTEPMSK4 + desc OUTEPMSK4 + 20 + 20 + read-write + + + OUTEPMSK5 + desc OUTEPMSK5 + 21 + 21 + read-write + + + OUTEPMSK6 + desc OUTEPMSK6 + 22 + 22 + read-write + + + OUTEPMSK7 + desc OUTEPMSK7 + 23 + 23 + read-write + + + OUTEPMSK8 + desc OUTEPMSK8 + 24 + 24 + read-write + + + OUTEPMSK9 + desc OUTEPMSK9 + 25 + 25 + read-write + + + OUTEPMSK10 + desc OUTEPMSK10 + 26 + 26 + read-write + + + OUTEPMSK11 + desc OUTEPMSK11 + 27 + 27 + read-write + + + OUTEPMSK12 + desc OUTEPMSK12 + 28 + 28 + read-write + + + OUTEPMSK13 + desc OUTEPMSK13 + 29 + 29 + read-write + + + OUTEPMSK14 + desc OUTEPMSK14 + 30 + 30 + read-write + + + OUTEPMSK15 + desc OUTEPMSK15 + 31 + 31 + read-write + + + + + DIEPEMPMSK + desc DIEPEMPMSK + 0x834 + 32 + read-write + 0x0 + 0xFFFF + + + INEPTXFEMPMSK + desc INEPTXFEMPMSK + 15 + 0 + read-write + + + + + DIEPCTL0 + desc DIEPCTL0 + 0x900 + 32 + read-write + 0x8000 + 0xCFEE8003 + + + MPS + desc MPS + 1 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-only + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT0 + desc DIEPINT0 + 0x908 + 32 + read-write + 0x0 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ0 + desc DIEPTSIZ0 + 0x910 + 32 + read-write + 0x0 + 0x18007F + + + XFERSIZE + desc XFERSIZE + 6 + 0 + read-write + + + PKTCNT + desc PKTCNT + 20 + 19 + read-write + + + + + DIEPDMA0 + desc DIEPDMA0 + 0x914 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTXFSTS0 + desc DTXFSTS0 + 0x918 + 32 + read-only + 0x280 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL1 + desc DIEPCTL1 + 0x920 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT1 + desc DIEPINT1 + 0x928 + 32 + read-write + 0x0 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ1 + desc DIEPTSIZ1 + 0x930 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA1 + desc DIEPDMA1 + 0x934 + 32 + read-write + 0x280 + 0xFFFFFFFF + + + DTXFSTS1 + desc DTXFSTS1 + 0x938 + 32 + read-only + 0x0 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL2 + desc DIEPCTL2 + 0x940 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT2 + desc DIEPINT2 + 0x948 + 32 + read-write + 0x0 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ2 + desc DIEPTSIZ2 + 0x950 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA2 + desc DIEPDMA2 + 0x954 + 32 + read-write + 0x280 + 0xFFFFFFFF + + + DTXFSTS2 + desc DTXFSTS2 + 0x958 + 32 + read-only + 0x0 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL3 + desc DIEPCTL3 + 0x960 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT3 + desc DIEPINT3 + 0x968 + 32 + read-write + 0x0 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ3 + desc DIEPTSIZ3 + 0x970 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA3 + desc DIEPDMA3 + 0x974 + 32 + read-write + 0x280 + 0xFFFFFFFF + + + DTXFSTS3 + desc DTXFSTS3 + 0x978 + 32 + read-only + 0x0 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL4 + desc DIEPCTL4 + 0x980 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT4 + desc DIEPINT4 + 0x988 + 32 + read-write + 0x0 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ4 + desc DIEPTSIZ4 + 0x990 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA4 + desc DIEPDMA4 + 0x994 + 32 + read-write + 0x280 + 0xFFFFFFFF + + + DTXFSTS4 + desc DTXFSTS4 + 0x998 + 32 + read-only + 0x0 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL5 + desc DIEPCTL5 + 0x9A0 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT5 + desc DIEPINT5 + 0x9A8 + 32 + read-write + 0x0 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ5 + desc DIEPTSIZ5 + 0x9B0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA5 + desc DIEPDMA5 + 0x9B4 + 32 + read-write + 0x280 + 0xFFFFFFFF + + + DTXFSTS5 + desc DTXFSTS5 + 0x9B8 + 32 + read-only + 0x0 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL6 + desc DIEPCTL6 + 0x9C0 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT6 + desc DIEPINT6 + 0x9C8 + 32 + read-write + 0x0 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ6 + desc DIEPTSIZ6 + 0x9D0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA6 + desc DIEPDMA6 + 0x9D4 + 32 + read-write + 0x280 + 0xFFFFFFFF + + + DTXFSTS6 + desc DTXFSTS6 + 0x9D8 + 32 + read-only + 0x0 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL7 + desc DIEPCTL7 + 0x9E0 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT7 + desc DIEPINT7 + 0x9E8 + 32 + read-write + 0x0 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ7 + desc DIEPTSIZ7 + 0x9F0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA7 + desc DIEPDMA7 + 0x9F4 + 32 + read-write + 0x280 + 0xFFFFFFFF + + + DTXFSTS7 + desc DTXFSTS7 + 0x9F8 + 32 + read-only + 0x0 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL8 + desc DIEPCTL8 + 0xA00 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT8 + desc DIEPINT8 + 0xA08 + 32 + read-write + 0x0 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ8 + desc DIEPTSIZ8 + 0xA10 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA8 + desc DIEPDMA8 + 0xA14 + 32 + read-write + 0x280 + 0xFFFFFFFF + + + DTXFSTS8 + desc DTXFSTS8 + 0xA18 + 32 + read-only + 0x0 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL9 + desc DIEPCTL9 + 0xA20 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT9 + desc DIEPINT9 + 0xA28 + 32 + read-write + 0x0 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ9 + desc DIEPTSIZ9 + 0xA30 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA9 + desc DIEPDMA9 + 0xA34 + 32 + read-write + 0x280 + 0xFFFFFFFF + + + DTXFSTS9 + desc DTXFSTS9 + 0xA38 + 32 + read-only + 0x0 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL10 + desc DIEPCTL10 + 0xA40 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT10 + desc DIEPINT10 + 0xA48 + 32 + read-write + 0x0 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ10 + desc DIEPTSIZ10 + 0xA50 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA10 + desc DIEPDMA10 + 0xA54 + 32 + read-write + 0x280 + 0xFFFFFFFF + + + DTXFSTS10 + desc DTXFSTS10 + 0xA58 + 32 + read-only + 0x0 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL11 + desc DIEPCTL11 + 0xA60 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT11 + desc DIEPINT11 + 0xA68 + 32 + read-write + 0x0 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ11 + desc DIEPTSIZ11 + 0xA70 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA11 + desc DIEPDMA11 + 0xA74 + 32 + read-write + 0x280 + 0xFFFFFFFF + + + DTXFSTS11 + desc DTXFSTS11 + 0xA78 + 32 + read-only + 0x0 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL12 + desc DIEPCTL12 + 0xA80 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT12 + desc DIEPINT12 + 0xA88 + 32 + read-write + 0x0 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ12 + desc DIEPTSIZ12 + 0xA90 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA12 + desc DIEPDMA12 + 0xA94 + 32 + read-write + 0x280 + 0xFFFFFFFF + + + DTXFSTS12 + desc DTXFSTS12 + 0xA98 + 32 + read-only + 0x0 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL13 + desc DIEPCTL13 + 0xAA0 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT13 + desc DIEPINT13 + 0xAA8 + 32 + read-write + 0x0 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ13 + desc DIEPTSIZ13 + 0xAB0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA13 + desc DIEPDMA13 + 0xAB4 + 32 + read-write + 0x280 + 0xFFFFFFFF + + + DTXFSTS13 + desc DTXFSTS13 + 0xAB8 + 32 + read-only + 0x0 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL14 + desc DIEPCTL14 + 0xAC0 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT14 + desc DIEPINT14 + 0xAC8 + 32 + read-write + 0x0 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ14 + desc DIEPTSIZ14 + 0xAD0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA14 + desc DIEPDMA14 + 0xAD4 + 32 + read-write + 0x280 + 0xFFFFFFFF + + + DTXFSTS14 + desc DTXFSTS14 + 0xAD8 + 32 + read-only + 0x0 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL15 + desc DIEPCTL15 + 0xAE0 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT15 + desc DIEPINT15 + 0xAE8 + 32 + read-write + 0x0 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ15 + desc DIEPTSIZ15 + 0xAF0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA15 + desc DIEPDMA15 + 0xAF4 + 32 + read-write + 0x280 + 0xFFFFFFFF + + + DTXFSTS15 + desc DTXFSTS15 + 0xAF8 + 32 + read-only + 0x0 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DOEPCTL0 + desc DOEPCTL0 + 0xB00 + 32 + read-only + 0x8000 + 0xCC3E8003 + + + MPS + desc MPS + 1 + 0 + read-only + + + USBACTEP + desc USBACTEP + 15 + 15 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-only + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-only + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT0 + desc DOEPINT0 + 0xB08 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ0 + desc DOEPTSIZ0 + 0xB10 + 32 + read-write + 0x0 + 0x6008007F + + + XFERSIZE + desc XFERSIZE + 6 + 0 + read-write + + + PKTCNT + desc PKTCNT + 19 + 19 + read-write + + + SUPCNT + desc SUPCNT + 30 + 29 + read-write + + + + + DOEPDMA0 + desc DOEPDMA0 + 0xB14 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL1 + desc DOEPCTL1 + 0xB20 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT1 + desc DOEPINT1 + 0xB28 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ1 + desc DOEPTSIZ1 + 0xB30 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA1 + desc DOEPDMA1 + 0xB34 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL2 + desc DOEPCTL2 + 0xB40 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT2 + desc DOEPINT2 + 0xB48 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ2 + desc DOEPTSIZ2 + 0xB50 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA2 + desc DOEPDMA2 + 0xB54 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL3 + desc DOEPCTL3 + 0xB60 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT3 + desc DOEPINT3 + 0xB68 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ3 + desc DOEPTSIZ3 + 0xB70 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA3 + desc DOEPDMA3 + 0xB74 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL4 + desc DOEPCTL4 + 0xB80 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT4 + desc DOEPINT4 + 0xB88 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ4 + desc DOEPTSIZ4 + 0xB90 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA4 + desc DOEPDMA4 + 0xB94 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL5 + desc DOEPCTL5 + 0xBA0 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT5 + desc DOEPINT5 + 0xBA8 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ5 + desc DOEPTSIZ5 + 0xBB0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA5 + desc DOEPDMA5 + 0xBB4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL6 + desc DOEPCTL6 + 0xBC0 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT6 + desc DOEPINT6 + 0xBC8 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ6 + desc DOEPTSIZ6 + 0xBD0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA6 + desc DOEPDMA6 + 0xBD4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL7 + desc DOEPCTL7 + 0xBE0 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT7 + desc DOEPINT7 + 0xBE8 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ7 + desc DOEPTSIZ7 + 0xBF0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA7 + desc DOEPDMA7 + 0xBF4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL8 + desc DOEPCTL8 + 0xC00 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT8 + desc DOEPINT8 + 0xC08 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ8 + desc DOEPTSIZ8 + 0xC10 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA8 + desc DOEPDMA8 + 0xC14 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL9 + desc DOEPCTL9 + 0xC20 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT9 + desc DOEPINT9 + 0xC28 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ9 + desc DOEPTSIZ9 + 0xC30 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA9 + desc DOEPDMA9 + 0xC34 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL10 + desc DOEPCTL10 + 0xC40 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT10 + desc DOEPINT10 + 0xC48 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ10 + desc DOEPTSIZ10 + 0xC50 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA10 + desc DOEPDMA10 + 0xC54 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL11 + desc DOEPCTL11 + 0xC60 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT11 + desc DOEPINT11 + 0xC68 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ11 + desc DOEPTSIZ11 + 0xC70 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA11 + desc DOEPDMA11 + 0xC74 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL12 + desc DOEPCTL12 + 0xC80 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT12 + desc DOEPINT12 + 0xC88 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ12 + desc DOEPTSIZ12 + 0xC90 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA12 + desc DOEPDMA12 + 0xC94 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL13 + desc DOEPCTL13 + 0xCA0 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT13 + desc DOEPINT13 + 0xCA8 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ13 + desc DOEPTSIZ13 + 0xCB0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA13 + desc DOEPDMA13 + 0xCB4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL14 + desc DOEPCTL14 + 0xCC0 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT14 + desc DOEPINT14 + 0xCC8 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ14 + desc DOEPTSIZ14 + 0xCD0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA14 + desc DOEPDMA14 + 0xCD4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL15 + desc DOEPCTL15 + 0xCE0 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT15 + desc DOEPINT15 + 0xCE8 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ15 + desc DOEPTSIZ15 + 0xCF0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA15 + desc DOEPDMA15 + 0xCF4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + PCGCCTL + desc PCGCCTL + 0xE00 + 32 + read-write + 0x0 + 0x1EF + + + STOPPCLK + desc STOPPCLK + 0 + 0 + read-write + + + GATEHCLK + desc GATEHCLK + 1 + 1 + read-write + + + PWRCLMP + desc PWRCLMP + 2 + 2 + read-write + + + RSTPDWNMODULE + desc RSTPDWNMODULE + 3 + 3 + read-write + + + ENBL_L1GATING + desc ENBL_L1GATING + 5 + 5 + read-write + + + PHYSLEEP + desc PHYSLEEP + 6 + 6 + read-only + + + L1SUSPENDED + desc L1SUSPENDED + 7 + 7 + read-only + + + RESETAFTERSUSP + desc RESETAFTERSUSP + 8 + 8 + read-write + + + + + + + USBH + desc USBH + 0x400C0000 + + 0x0 + 0xE04 + + + + GOTGCTL + desc GOTGCTL + 0x0 + 32 + read-only + 0x10000 + 0x803F9FFF + + + SESREQSCS + desc SESREQSCS + 0 + 0 + read-only + + + SESREQ + desc SESREQ + 1 + 1 + read-write + + + VBVALIDOVEN + desc VBVALIDOVEN + 2 + 2 + read-write + + + VBVALIDOVVAL + desc VBVALIDOVVAL + 3 + 3 + read-write + + + AVALIDOVEN + desc AVALIDOVEN + 4 + 4 + read-write + + + AVALIDOVVAL + desc AVALIDOVVAL + 5 + 5 + read-write + + + BVALIDOVEN + desc BVALIDOVEN + 6 + 6 + read-write + + + BVALIDOVVAL + desc BVALIDOVVAL + 7 + 7 + read-write + + + HSTNEGSCS + desc HSTNEGSCS + 8 + 8 + read-only + + + HNPREQ + desc HNPREQ + 9 + 9 + read-write + + + HSTSETHNPEN + desc HSTSETHNPEN + 10 + 10 + read-write + + + DEVHNPEN + desc DEVHNPEN + 11 + 11 + read-write + + + EHEN + desc EHEN + 12 + 12 + read-write + + + DBNCEFLTRBYPASS + desc DBNCEFLTRBYPASS + 15 + 15 + read-write + + + CONIDSTS + desc CONIDSTS + 16 + 16 + read-only + + + DBNCTIME + desc DBNCTIME + 17 + 17 + read-only + + + ASESVLD + desc ASESVLD + 18 + 18 + read-only + + + BSESVLD + desc BSESVLD + 19 + 19 + read-only + + + OTGVER + desc OTGVER + 20 + 20 + read-write + + + CURMOD + desc CURMOD + 21 + 21 + read-only + + + TESTMODE_CORR_EUSB2 + desc TESTMODE_CORR_EUSB2 + 31 + 31 + read-write + + + + + GOTGINT + desc GOTGINT + 0x4 + 32 + read-write + 0x0 + 0xE0304 + + + SESENDDET + desc SESENDDET + 2 + 2 + read-write + + + SESREQSUCSTSCHNG + desc SESREQSUCSTSCHNG + 8 + 8 + read-write + + + HSTNEGSUCSTSCHNG + desc HSTNEGSUCSTSCHNG + 9 + 9 + read-write + + + HSTNEGDET + desc HSTNEGDET + 17 + 17 + read-write + + + ADEVTOUTCHG + desc ADEVTOUTCHG + 18 + 18 + read-write + + + DBNCEDONE + desc DBNCEDONE + 19 + 19 + read-write + + + + + GAHBCFG + desc GAHBCFG + 0x8 + 32 + read-write + 0x0 + 0xE001BF + + + GLBLINTRMSK + desc GLBLINTRMSK + 0 + 0 + read-write + + + HBSTLEN + desc HBSTLEN + 4 + 1 + read-write + + + DMAEN + desc DMAEN + 5 + 5 + read-write + + + NPTXFEMPLVL + desc NPTXFEMPLVL + 7 + 7 + read-write + + + PTXFEMPLVL + desc PTXFEMPLVL + 8 + 8 + read-write + + + REMMEMSUPP + desc REMMEMSUPP + 21 + 21 + read-write + + + NOTIALLDMAWRIT + desc NOTIALLDMAWRIT + 22 + 22 + read-write + + + AHBSINGLE + desc AHBSINGLE + 23 + 23 + read-write + + + + + GUSBCFG + desc GUSBCFG + 0xC + 32 + read-write + 0x1410 + 0xF7FE3FFF + + + TOUTCAL + desc TOUTCAL + 2 + 0 + read-write + + + PHYIF + desc PHYIF + 3 + 3 + read-write + + + ULPI_UTMI_SEL + desc ULPI_UTMI_SEL + 4 + 4 + read-write + + + FSINTF + desc FSINTF + 5 + 5 + read-write + + + PHYSEL + desc PHYSEL + 6 + 6 + read-write + + + DDRSEL + desc DDRSEL + 7 + 7 + read-write + + + SRPCAP + desc SRPCAP + 8 + 8 + read-write + + + HNPCAP + desc HNPCAP + 9 + 9 + read-write + + + USBTRDTIM + desc USBTRDTIM + 13 + 10 + read-write + + + ULPIFSLS + desc ULPIFSLS + 17 + 17 + read-write + + + ULPIAUTORES + desc ULPIAUTORES + 18 + 18 + read-write + + + ULPICLKSUSM + desc ULPICLKSUSM + 19 + 19 + read-write + + + ULPIEXTVBUSDRV + desc ULPIEXTVBUSDRV + 20 + 20 + read-write + + + ULPIEXTVBUSINDICATOR + desc ULPIEXTVBUSINDICATOR + 21 + 21 + read-write + + + TERMSELDLPULSE + desc TERMSELDLPULSE + 22 + 22 + read-write + + + COMPLEMENT + desc COMPLEMENT + 23 + 23 + read-write + + + INDICATOR + desc INDICATOR + 24 + 24 + read-write + + + ULPI + desc ULPI + 25 + 25 + read-write + + + IC_USBCAP + desc IC_USBCAP + 26 + 26 + read-write + + + TXENDDELAY + desc TXENDDELAY + 28 + 28 + read-write + + + FORCEHSTMODE + desc FORCEHSTMODE + 29 + 29 + read-write + + + FORCEDEVMODE + desc FORCEDEVMODE + 30 + 30 + read-write + + + CORRUPTTXPKT + desc CORRUPTTXPKT + 31 + 31 + write-only + + + + + GRSTCTL + desc GRSTCTL + 0x10 + 32 + read-write + 0x80000000 + 0xC00007F7 + + + CSFTRST + desc CSFTRST + 0 + 0 + read-write + + + PIUFSSFTRST + desc PIUFSSFTRST + 1 + 1 + read-write + + + FRMCNTRRST + desc FRMCNTRRST + 2 + 2 + read-write + + + RXFFLSH + desc RXFFLSH + 4 + 4 + read-write + + + TXFFLSH + desc TXFFLSH + 5 + 5 + read-write + + + TXFNUM + desc TXFNUM + 10 + 6 + read-write + + + DMAREQ + desc DMAREQ + 30 + 30 + read-only + + + AHBIDLE + desc AHBIDLE + 31 + 31 + read-only + + + + + GINTSTS + desc GINTSTS + 0x14 + 32 + read-only + 0x14000020 + 0xFFFEFCFF + + + CURMOD + desc CURMOD + 0 + 0 + read-only + + + MODEMIS + desc MODEMIS + 1 + 1 + read-write + + + OTGINT + desc OTGINT + 2 + 2 + read-only + + + SOF + desc SOF + 3 + 3 + read-write + + + RXFLVL + desc RXFLVL + 4 + 4 + read-only + + + NPTXFEMP + desc NPTXFEMP + 5 + 5 + read-only + + + GINNAKEFF + desc GINNAKEFF + 6 + 6 + read-only + + + GOUTNAKEFF + desc GOUTNAKEFF + 7 + 7 + read-only + + + ERLYSUSP + desc ERLYSUSP + 10 + 10 + read-write + + + USBSUSP + desc USBSUSP + 11 + 11 + read-write + + + USBRST + desc USBRST + 12 + 12 + read-write + + + ENUMDONE + desc ENUMDONE + 13 + 13 + read-write + + + ISOOUTDROP + desc ISOOUTDROP + 14 + 14 + read-write + + + EOPF + desc EOPF + 15 + 15 + read-write + + + EPMIS + desc EPMIS + 17 + 17 + read-write + + + IEPINT + desc IEPINT + 18 + 18 + read-only + + + OEPINT + desc OEPINT + 19 + 19 + read-only + + + INCOMPISOIN + desc INCOMPISOIN + 20 + 20 + read-write + + + INCOMPLP + desc INCOMPLP + 21 + 21 + read-write + + + FETSUSP + desc FETSUSP + 22 + 22 + read-write + + + RESETDET + desc RESETDET + 23 + 23 + read-write + + + PRTINT + desc PRTINT + 24 + 24 + read-only + + + HCHINT + desc HCHINT + 25 + 25 + read-only + + + PTXFEMP + desc PTXFEMP + 26 + 26 + read-only + + + LPM_INT + desc LPM_INT + 27 + 27 + read-write + + + CONIDSTSCHNG + desc CONIDSTSCHNG + 28 + 28 + read-write + + + DISCONNINT + desc DISCONNINT + 29 + 29 + read-write + + + SESSREQINT + desc SESSREQINT + 30 + 30 + read-write + + + WKUPINT + desc WKUPINT + 31 + 31 + read-write + + + + + GINTMSK + desc GINTMSK + 0x18 + 32 + read-write + 0x0 + 0xFFEEFCFE + + + MODEMISMSK + desc MODEMISMSK + 1 + 1 + read-write + + + OTGINTMSK + desc OTGINTMSK + 2 + 2 + read-write + + + SOFMSK + desc SOFMSK + 3 + 3 + read-write + + + RXFLVLMSK + desc RXFLVLMSK + 4 + 4 + read-write + + + NPTXFEMPMSK + desc NPTXFEMPMSK + 5 + 5 + read-write + + + GINNAKEFFMSK + desc GINNAKEFFMSK + 6 + 6 + read-write + + + GOUTNAKEFFMSK + desc GOUTNAKEFFMSK + 7 + 7 + read-write + + + ERLYSUSPMSK + desc ERLYSUSPMSK + 10 + 10 + read-write + + + USBSUSPMSK + desc USBSUSPMSK + 11 + 11 + read-write + + + USBRSTMSK + desc USBRSTMSK + 12 + 12 + read-write + + + ENUMDONEMSK + desc ENUMDONEMSK + 13 + 13 + read-write + + + ISOOUTDROPMSK + desc ISOOUTDROPMSK + 14 + 14 + read-write + + + EOPFMSK + desc EOPFMSK + 15 + 15 + read-write + + + EPMISMSK + desc EPMISMSK + 17 + 17 + read-write + + + IEPINTMSK + desc IEPINTMSK + 18 + 18 + read-write + + + OEPINTMSK + desc OEPINTMSK + 19 + 19 + read-write + + + INCOMPLPMSK + desc INCOMPLPMSK + 21 + 21 + read-write + + + FETSUSPMSK + desc FETSUSPMSK + 22 + 22 + read-write + + + RESETDETMSK + desc RESETDETMSK + 23 + 23 + read-write + + + PRTINTMSK + desc PRTINTMSK + 24 + 24 + read-write + + + HCHINTMSK + desc HCHINTMSK + 25 + 25 + read-write + + + PTXFEMPMSK + desc PTXFEMPMSK + 26 + 26 + read-write + + + LPM_INTMSK + desc LPM_INTMSK + 27 + 27 + read-write + + + CONIDSTSCHNGMSK + desc CONIDSTSCHNGMSK + 28 + 28 + read-write + + + DISCONNINTMSK + desc DISCONNINTMSK + 29 + 29 + read-write + + + SESSREQINTMSK + desc SESSREQINTMSK + 30 + 30 + read-write + + + WKUPINTMSK + desc WKUPINTMSK + 31 + 31 + read-write + + + + + GRXSTSR + desc GRXSTSR + 0x1C + 32 + read-only + 0x0 + 0x1FFFFFF + + + CHNUM + desc CHNUM + 3 + 0 + read-only + + + BCNT + desc BCNT + 14 + 4 + read-only + + + DPID + desc DPID + 16 + 15 + read-only + + + PKTSTS + desc PKTSTS + 20 + 17 + read-only + + + FN + desc FN + 24 + 21 + read-only + + + + + GRXSTSP + desc GRXSTSP + 0x20 + 32 + read-only + 0x0 + 0x1FFFFFF + + + CHNUM + desc CHNUM + 3 + 0 + read-only + + + BCNT + desc BCNT + 14 + 4 + read-only + + + DPID + desc DPID + 16 + 15 + read-only + + + PKTSTS + desc PKTSTS + 20 + 17 + read-only + + + FN + desc FN + 24 + 21 + read-only + + + + + GRXFSIZ + desc GRXFSIZ + 0x24 + 32 + read-write + 0x800 + 0xFFF + + + RXFDEP + desc RXFDEP + 11 + 0 + read-write + + + + + GNPTXFSIZ + desc GNPTXFSIZ + 0x28 + 32 + read-write + 0x8000800 + 0xFFF0FFF + + + NPTXFSTADDR + desc NPTXFSTADDR + 11 + 0 + read-write + + + NPTXFDEP + desc NPTXFDEP + 27 + 16 + read-write + + + + + GNPTXSTS + desc GNPTXSTS + 0x2C + 32 + read-only + 0x8000800 + 0x7FFFFFFF + + + NPTXFSPCAVAIL + desc NPTXFSPCAVAIL + 15 + 0 + read-only + + + NPTXQSPCAVAIL + desc NPTXQSPCAVAIL + 23 + 16 + read-only + + + NPTXQTOP + desc NPTXQTOP + 30 + 24 + read-only + + + + + GPVNDCTL + desc GPVNDCTL + 0x34 + 32 + read-write + 0x0 + 0xE7FFFFF + + + REGDATA + desc REGDATA + 7 + 0 + read-write + + + VCTRL + desc VCTRL + 15 + 8 + read-write + + + REGADDR + desc REGADDR + 21 + 16 + read-write + + + REGWR + desc REGWR + 22 + 22 + read-write + + + NEWREGREQ + desc NEWREGREQ + 25 + 25 + read-write + + + VSTSBSY + desc VSTSBSY + 26 + 26 + read-only + + + VSTSDONE + desc VSTSDONE + 27 + 27 + read-write + + + + + GUID + desc GUID + 0x3C + 32 + read-write + 0x12345678 + 0xFFFFFFFF + + + GLPMCFG + desc GLPMCFG + 0x54 + 32 + read-write + 0x0 + 0x3FFFFFFF + + + LPMCAP + desc LPMCAP + 0 + 0 + read-write + + + APPL1RES + desc APPL1RES + 1 + 1 + read-write + + + HIRD + desc HIRD + 5 + 2 + read-write + + + BREMOTEWAKE + desc BREMOTEWAKE + 6 + 6 + read-write + + + ENBLSLPM + desc ENBLSLPM + 7 + 7 + read-write + + + HIRD_THRES + desc HIRD_THRES + 12 + 8 + read-write + + + COREL1RES + desc COREL1RES + 14 + 13 + read-only + + + SLPSTS + desc SLPSTS + 15 + 15 + read-only + + + L1RESUMEOK + desc L1RESUMEOK + 16 + 16 + read-only + + + LPM_CHNL_INDX + desc LPM_CHNL_INDX + 20 + 17 + read-write + + + LPM_RETRY_CNT + desc LPM_RETRY_CNT + 23 + 21 + read-write + + + SNDLPM + desc SNDLPM + 24 + 24 + read-write + + + LPM_RETRYCNT_STS + desc LPM_RETRYCNT_STS + 27 + 25 + read-only + + + LPM_ENBESL + desc LPM_ENBESL + 28 + 28 + read-write + + + LPM_RESTORESLPSTS + desc LPM_RESTORESLPSTS + 29 + 29 + read-write + + + + + GDFIFOCFG + desc GDFIFOCFG + 0x5C + 32 + read-write + 0x7E00800 + 0xFFFFFFFF + + + GDFIFOCFG + desc GDFIFOCFG + 15 + 0 + read-write + + + EPINFOBASEADDR + desc EPINFOBASEADDR + 31 + 16 + read-write + + + + + HPTXFSIZ + desc HPTXFSIZ + 0x100 + 32 + read-write + 0x0 + 0xFFF1FFF + + + PTXFSTADDR + desc PTXFSTADDR + 12 + 0 + read-write + + + PTXFSIZE + desc PTXFSIZE + 27 + 16 + read-write + + + + + DIEPTXF1 + desc DIEPTXF1 + 0x104 + 32 + read-write + 0x8001000 + 0xFFF1FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 12 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 27 + 16 + read-write + + + + + DIEPTXF2 + desc DIEPTXF2 + 0x108 + 32 + read-write + 0x8001800 + 0xFFF1FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 12 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 27 + 16 + read-write + + + + + DIEPTXF3 + desc DIEPTXF3 + 0x10C + 32 + read-write + 0x8002000 + 0xFFF3FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 13 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 27 + 16 + read-write + + + + + DIEPTXF4 + desc DIEPTXF4 + 0x110 + 32 + read-write + 0x8002800 + 0xFFF3FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 13 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 27 + 16 + read-write + + + + + DIEPTXF5 + desc DIEPTXF5 + 0x114 + 32 + read-write + 0x8003000 + 0xFFF3FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 13 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 27 + 16 + read-write + + + + + DIEPTXF6 + desc DIEPTXF6 + 0x118 + 32 + read-write + 0x8003800 + 0xFFF3FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 13 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 27 + 16 + read-write + + + + + DIEPTXF7 + desc DIEPTXF7 + 0x11C + 32 + read-write + 0x8004000 + 0xFFF7FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 14 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 27 + 16 + read-write + + + + + DIEPTXF8 + desc DIEPTXF8 + 0x120 + 32 + read-write + 0x8004800 + 0xFFF7FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 14 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 27 + 16 + read-write + + + + + DIEPTXF9 + desc DIEPTXF9 + 0x124 + 32 + read-write + 0x8005000 + 0xFFF7FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 14 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 27 + 16 + read-write + + + + + DIEPTXF10 + desc DIEPTXF10 + 0x128 + 32 + read-write + 0x8005800 + 0xFFF7FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 14 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 27 + 16 + read-write + + + + + DIEPTXF11 + desc DIEPTXF11 + 0x12C + 32 + read-write + 0x8006000 + 0xFFF7FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 14 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 27 + 16 + read-write + + + + + DIEPTXF12 + desc DIEPTXF12 + 0x130 + 32 + read-write + 0x8006800 + 0xFFF7FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 14 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 27 + 16 + read-write + + + + + DIEPTXF13 + desc DIEPTXF13 + 0x134 + 32 + read-write + 0x8007000 + 0xFFF7FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 14 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 27 + 16 + read-write + + + + + DIEPTXF14 + desc DIEPTXF14 + 0x138 + 32 + read-write + 0x8007800 + 0xFFF7FFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 14 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 27 + 16 + read-write + + + + + DIEPTXF15 + desc DIEPTXF15 + 0x13C + 32 + read-write + 0x8008000 + 0xFFFFFFF + + + INEPNTXFSTADDR + desc INEPNTXFSTADDR + 15 + 0 + read-write + + + INEPNTXFDEP + desc INEPNTXFDEP + 27 + 16 + read-write + + + + + HCFG + desc HCFG + 0x400 + 32 + read-write + 0x220000 + 0x8000FF87 + + + FSLSPCLKSEL + desc FSLSPCLKSEL + 1 + 0 + read-write + + + FSLSSUPP + desc FSLSSUPP + 2 + 2 + read-write + + + ENA32KHZS + desc ENA32KHZS + 7 + 7 + read-write + + + RESVALID + desc RESVALID + 15 + 8 + read-write + + + MODECHTIMEN + desc MODECHTIMEN + 31 + 31 + read-write + + + + + HFIR + desc HFIR + 0x404 + 32 + read-write + 0x17D7 + 0x1FFFF + + + FRINT + desc FRINT + 15 + 0 + read-write + + + HFIRRLDCTRL + desc HFIRRLDCTRL + 16 + 16 + read-write + + + + + HFNUM + desc HFNUM + 0x408 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + FRNUM + desc FRNUM + 15 + 0 + read-only + + + FRREM + desc FRREM + 31 + 16 + read-only + + + + + HPTXSTS + desc HPTXSTS + 0x410 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + PTXFSPCAVAIL + desc PTXFSPCAVAIL + 15 + 0 + read-only + + + PTXQSPCAVAIL + desc PTXQSPCAVAIL + 23 + 16 + read-only + + + PTXQTOP + desc PTXQTOP + 31 + 24 + read-only + + + + + HAINT + desc HAINT + 0x414 + 32 + read-only + 0x0 + 0xFFFF + + + HAINT + desc HAINT + 15 + 0 + read-only + + + + + HAINTMSK + desc HAINTMSK + 0x418 + 32 + read-write + 0x0 + 0xFFFF + + + HAINTMSK + desc HAINTMSK + 15 + 0 + read-write + + + + + HPRT + desc HPRT + 0x440 + 32 + read-only + 0x0 + 0x7FDFF + + + PRTCONNSTS + desc PRTCONNSTS + 0 + 0 + read-only + + + PRTCONNDET + desc PRTCONNDET + 1 + 1 + read-write + + + PRTENA + desc PRTENA + 2 + 2 + read-write + + + PRTENCHNG + desc PRTENCHNG + 3 + 3 + read-write + + + PRTOVRCURRACT + desc PRTOVRCURRACT + 4 + 4 + read-only + + + PRTOVRCURRCHNG + desc PRTOVRCURRCHNG + 5 + 5 + read-write + + + PRTRES + desc PRTRES + 6 + 6 + read-write + + + PRTSUSP + desc PRTSUSP + 7 + 7 + read-write + + + PRTRST + desc PRTRST + 8 + 8 + read-write + + + PRTLNSTS + desc PRTLNSTS + 11 + 10 + read-only + + + PRTPWR + desc PRTPWR + 12 + 12 + read-write + + + PRTTSTCTL + desc PRTTSTCTL + 16 + 13 + read-write + + + PRTSPD + desc PRTSPD + 18 + 17 + read-only + + + + + HCCHAR0 + desc HCCHAR0 + 0x500 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT0 + desc HCSPLT0 + 0x504 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT0 + desc HCINT0 + 0x508 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK0 + desc HCINTMSK0 + 0x50C + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ0 + desc HCTSIZ0 + 0x510 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA0 + desc HCDMA0 + 0x514 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR1 + desc HCCHAR1 + 0x520 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT1 + desc HCSPLT1 + 0x524 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT1 + desc HCINT1 + 0x528 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK1 + desc HCINTMSK1 + 0x52C + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ1 + desc HCTSIZ1 + 0x530 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA1 + desc HCDMA1 + 0x534 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR2 + desc HCCHAR2 + 0x540 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT2 + desc HCSPLT2 + 0x544 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT2 + desc HCINT2 + 0x548 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK2 + desc HCINTMSK2 + 0x54C + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ2 + desc HCTSIZ2 + 0x550 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA2 + desc HCDMA2 + 0x554 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR3 + desc HCCHAR3 + 0x560 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT3 + desc HCSPLT3 + 0x564 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT3 + desc HCINT3 + 0x568 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK3 + desc HCINTMSK3 + 0x56C + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ3 + desc HCTSIZ3 + 0x570 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA3 + desc HCDMA3 + 0x574 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR4 + desc HCCHAR4 + 0x580 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT4 + desc HCSPLT4 + 0x584 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT4 + desc HCINT4 + 0x588 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK4 + desc HCINTMSK4 + 0x58C + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ4 + desc HCTSIZ4 + 0x590 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA4 + desc HCDMA4 + 0x594 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR5 + desc HCCHAR5 + 0x5A0 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT5 + desc HCSPLT5 + 0x5A4 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT5 + desc HCINT5 + 0x5A8 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK5 + desc HCINTMSK5 + 0x5AC + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ5 + desc HCTSIZ5 + 0x5B0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA5 + desc HCDMA5 + 0x5B4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR6 + desc HCCHAR6 + 0x5C0 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT6 + desc HCSPLT6 + 0x5C4 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT6 + desc HCINT6 + 0x5C8 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK6 + desc HCINTMSK6 + 0x5CC + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ6 + desc HCTSIZ6 + 0x5D0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA6 + desc HCDMA6 + 0x5D4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR7 + desc HCCHAR7 + 0x5E0 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT7 + desc HCSPLT7 + 0x5E4 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT7 + desc HCINT7 + 0x5E8 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK7 + desc HCINTMSK7 + 0x5EC + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ7 + desc HCTSIZ7 + 0x5F0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA7 + desc HCDMA7 + 0x5F4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR8 + desc HCCHAR8 + 0x600 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT8 + desc HCSPLT8 + 0x604 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT8 + desc HCINT8 + 0x608 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK8 + desc HCINTMSK8 + 0x60C + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ8 + desc HCTSIZ8 + 0x610 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA8 + desc HCDMA8 + 0x614 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR9 + desc HCCHAR9 + 0x620 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT9 + desc HCSPLT9 + 0x624 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT9 + desc HCINT9 + 0x628 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK9 + desc HCINTMSK9 + 0x62C + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ9 + desc HCTSIZ9 + 0x630 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA9 + desc HCDMA9 + 0x634 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR10 + desc HCCHAR10 + 0x640 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT10 + desc HCSPLT10 + 0x644 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT10 + desc HCINT10 + 0x648 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK10 + desc HCINTMSK10 + 0x64C + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ10 + desc HCTSIZ10 + 0x650 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA10 + desc HCDMA10 + 0x654 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR11 + desc HCCHAR11 + 0x660 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT11 + desc HCSPLT11 + 0x664 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT11 + desc HCINT11 + 0x668 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK11 + desc HCINTMSK11 + 0x66C + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ11 + desc HCTSIZ11 + 0x670 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA11 + desc HCDMA11 + 0x674 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR12 + desc HCCHAR12 + 0x680 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT12 + desc HCSPLT12 + 0x684 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT12 + desc HCINT12 + 0x688 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK12 + desc HCINTMSK12 + 0x68C + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ12 + desc HCTSIZ12 + 0x690 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA12 + desc HCDMA12 + 0x694 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR13 + desc HCCHAR13 + 0x6A0 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT13 + desc HCSPLT13 + 0x6A4 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT13 + desc HCINT13 + 0x6A8 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK13 + desc HCINTMSK13 + 0x6AC + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ13 + desc HCTSIZ13 + 0x6B0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA13 + desc HCDMA13 + 0x6B4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR14 + desc HCCHAR14 + 0x6C0 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT14 + desc HCSPLT14 + 0x6C4 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT14 + desc HCINT14 + 0x6C8 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK14 + desc HCINTMSK14 + 0x6CC + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ14 + desc HCTSIZ14 + 0x6D0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA14 + desc HCDMA14 + 0x6D4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + HCCHAR15 + desc HCCHAR15 + 0x6E0 + 32 + read-write + 0x0 + 0xFFFEFFFF + + + MPS + desc MPS + 10 + 0 + read-write + + + EPNUM + desc EPNUM + 14 + 11 + read-write + + + EPDIR + desc EPDIR + 15 + 15 + read-write + + + LSPDDEV + desc LSPDDEV + 17 + 17 + read-write + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + EC + desc EC + 21 + 20 + read-write + + + DEVADDR + desc DEVADDR + 28 + 22 + read-write + + + ODDFRM + desc ODDFRM + 29 + 29 + read-write + + + CHDIS + desc CHDIS + 30 + 30 + read-write + + + CHENA + desc CHENA + 31 + 31 + read-write + + + + + HCSPLT15 + desc HCSPLT15 + 0x6E4 + 32 + read-write + 0x0 + 0x8001FFFF + + + PRTADDR + desc PRTADDR + 6 + 0 + read-write + + + HUBADDR + desc HUBADDR + 13 + 7 + read-write + + + XACTPOS + desc XACTPOS + 15 + 14 + read-write + + + COMPSPLT + desc COMPSPLT + 16 + 16 + read-write + + + SPLTENA + desc SPLTENA + 31 + 31 + read-write + + + + + HCINT15 + desc HCINT15 + 0x6E8 + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + CHHLTD + desc CHHLTD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + STALL + desc STALL + 3 + 3 + read-write + + + NAK + desc NAK + 4 + 4 + read-write + + + ACK + desc ACK + 5 + 5 + read-write + + + NYET + desc NYET + 6 + 6 + read-write + + + XACTERR + desc XACTERR + 7 + 7 + read-write + + + BBLERR + desc BBLERR + 8 + 8 + read-write + + + FRMOVRUN + desc FRMOVRUN + 9 + 9 + read-write + + + DATATGLERR + desc DATATGLERR + 10 + 10 + read-write + + + + + HCINTMSK15 + desc HCINTMSK15 + 0x6EC + 32 + read-write + 0x0 + 0x7FF + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + CHHLTDMSK + desc CHHLTDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + STALLMSK + desc STALLMSK + 3 + 3 + read-write + + + NAKMSK + desc NAKMSK + 4 + 4 + read-write + + + ACKMSK + desc ACKMSK + 5 + 5 + read-write + + + NYETMSK + desc NYETMSK + 6 + 6 + read-write + + + XACTERRMSK + desc XACTERRMSK + 7 + 7 + read-write + + + BBLERRMSK + desc BBLERRMSK + 8 + 8 + read-write + + + FRMOVRUNMSK + desc FRMOVRUNMSK + 9 + 9 + read-write + + + DATATGLERRMSK + desc DATATGLERRMSK + 10 + 10 + read-write + + + + + HCTSIZ15 + desc HCTSIZ15 + 0x6F0 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + PID + desc PID + 30 + 29 + read-write + + + DOPNG + desc DOPNG + 31 + 31 + read-write + + + + + HCDMA15 + desc HCDMA15 + 0x6F4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DCFG + desc DCFG + 0x800 + 32 + read-write + 0x8220000 + 0xFF02DFFF + + + DEVSPD + desc DEVSPD + 1 + 0 + read-write + + + NZSTSOUTHSHK + desc NZSTSOUTHSHK + 2 + 2 + read-write + + + ENA32KHZSUSP + desc ENA32KHZSUSP + 3 + 3 + read-write + + + DEVADDR + desc DEVADDR + 10 + 4 + read-write + + + PERFRINT + desc PERFRINT + 12 + 11 + read-write + + + XCVRDLY + desc XCVRDLY + 14 + 14 + read-write + + + ERRATICINTMSK + desc ERRATICINTMSK + 15 + 15 + read-write + + + IPGISOCSUPT + desc IPGISOCSUPT + 17 + 17 + read-write + + + PERSCHINTVL + desc PERSCHINTVL + 25 + 24 + read-write + + + RESVALID + desc RESVALID + 31 + 26 + read-write + + + + + DCTL + desc DCTL + 0x804 + 32 + read-write + 0x2 + 0xD8FFF + + + RMTWKUPSIG + desc RMTWKUPSIG + 0 + 0 + read-write + + + SFTDISCON + desc SFTDISCON + 1 + 1 + read-write + + + GNPINNAKSTS + desc GNPINNAKSTS + 2 + 2 + read-only + + + GOUTNAKSTS + desc GOUTNAKSTS + 3 + 3 + read-only + + + TSTCTL + desc TSTCTL + 6 + 4 + read-write + + + SGNPINNAK + desc SGNPINNAK + 7 + 7 + write-only + + + CGNPINNAK + desc CGNPINNAK + 8 + 8 + write-only + + + SGOUTNAK + desc SGOUTNAK + 9 + 9 + write-only + + + CGOUTNAK + desc CGOUTNAK + 10 + 10 + write-only + + + PWRONPRGDONE + desc PWRONPRGDONE + 11 + 11 + read-write + + + IGNRFRMNUM + desc IGNRFRMNUM + 15 + 15 + read-write + + + NAKONBBLE + desc NAKONBBLE + 16 + 16 + read-write + + + DEEPSLEEPBESLREJECT + desc DEEPSLEEPBESLREJECT + 18 + 18 + read-write + + + SERVINT + desc SERVINT + 19 + 19 + read-write + + + + + DSTS + desc DSTS + 0x808 + 32 + read-only + 0x2 + 0xFFFF0F + + + SUSPSTS + desc SUSPSTS + 0 + 0 + read-only + + + ENUMSPD + desc ENUMSPD + 2 + 1 + read-only + + + ERRTICERR + desc ERRTICERR + 3 + 3 + read-only + + + SOFFN + desc SOFFN + 21 + 8 + read-only + + + DEVLNSTS + desc DEVLNSTS + 23 + 22 + read-only + + + + + DIEPMSK + desc DIEPMSK + 0x810 + 32 + read-write + 0x0 + 0x217F + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + EPDISBLDMSK + desc EPDISBLDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + TIMEOUTMSK + desc TIMEOUTMSK + 3 + 3 + read-write + + + INTKNTXFEMPMSK + desc INTKNTXFEMPMSK + 4 + 4 + read-write + + + INTKNEPMISMSK + desc INTKNEPMISMSK + 5 + 5 + read-write + + + INEPNAKEFFMSK + desc INEPNAKEFFMSK + 6 + 6 + read-write + + + TXFIFOUNDRNMSK + desc TXFIFOUNDRNMSK + 8 + 8 + read-write + + + NAKMSK + desc NAKMSK + 13 + 13 + read-write + + + + + DOEPMSK + desc DOEPMSK + 0x814 + 32 + read-write + 0x0 + 0x717F + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + EPDISBLDMSK + desc EPDISBLDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + SETUPMSK + desc SETUPMSK + 3 + 3 + read-write + + + OUTTKNEPDISMSK + desc OUTTKNEPDISMSK + 4 + 4 + read-write + + + STSPHSERCVDMSK + desc STSPHSERCVDMSK + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERRMSK + desc OUTPKTERRMSK + 8 + 8 + read-write + + + BBLEERRMSK + desc BBLEERRMSK + 12 + 12 + read-write + + + NAKMSK + desc NAKMSK + 13 + 13 + read-write + + + NYETMSK + desc NYETMSK + 14 + 14 + read-write + + + + + DAINT + desc DAINT + 0x818 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + INEPINT0 + desc INEPINT0 + 0 + 0 + read-only + + + INEPINT1 + desc INEPINT1 + 1 + 1 + read-only + + + INEPINT2 + desc INEPINT2 + 2 + 2 + read-only + + + INEPINT3 + desc INEPINT3 + 3 + 3 + read-only + + + INEPINT4 + desc INEPINT4 + 4 + 4 + read-only + + + INEPINT5 + desc INEPINT5 + 5 + 5 + read-only + + + INEPINT6 + desc INEPINT6 + 6 + 6 + read-only + + + INEPINT7 + desc INEPINT7 + 7 + 7 + read-only + + + INEPINT8 + desc INEPINT8 + 8 + 8 + read-only + + + INEPINT9 + desc INEPINT9 + 9 + 9 + read-only + + + INEPINT10 + desc INEPINT10 + 10 + 10 + read-only + + + INEPINT11 + desc INEPINT11 + 11 + 11 + read-only + + + INEPINT12 + desc INEPINT12 + 12 + 12 + read-only + + + INEPINT13 + desc INEPINT13 + 13 + 13 + read-only + + + INEPINT14 + desc INEPINT14 + 14 + 14 + read-only + + + INEPINT15 + desc INEPINT15 + 15 + 15 + read-only + + + OUTEPINT0 + desc OUTEPINT0 + 16 + 16 + read-only + + + OUTEPINT1 + desc OUTEPINT1 + 17 + 17 + read-only + + + OUTEPINT2 + desc OUTEPINT2 + 18 + 18 + read-only + + + OUTEPINT3 + desc OUTEPINT3 + 19 + 19 + read-only + + + OUTEPINT4 + desc OUTEPINT4 + 20 + 20 + read-only + + + OUTEPINT5 + desc OUTEPINT5 + 21 + 21 + read-only + + + OUTEPINT6 + desc OUTEPINT6 + 22 + 22 + read-only + + + OUTEPINT7 + desc OUTEPINT7 + 23 + 23 + read-only + + + OUTEPINT8 + desc OUTEPINT8 + 24 + 24 + read-only + + + OUTEPINT9 + desc OUTEPINT9 + 25 + 25 + read-only + + + OUTEPINT10 + desc OUTEPINT10 + 26 + 26 + read-only + + + OUTEPINT11 + desc OUTEPINT11 + 27 + 27 + read-only + + + OUTEPINT12 + desc OUTEPINT12 + 28 + 28 + read-only + + + OUTEPINT13 + desc OUTEPINT13 + 29 + 29 + read-only + + + OUTEPINT14 + desc OUTEPINT14 + 30 + 30 + read-only + + + OUTEPINT15 + desc OUTEPINT15 + 31 + 31 + read-only + + + + + DAINTMSK + desc DAINTMSK + 0x81C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + INEPMSK0 + desc INEPMSK0 + 0 + 0 + read-write + + + INEPMSK1 + desc INEPMSK1 + 1 + 1 + read-write + + + INEPMSK2 + desc INEPMSK2 + 2 + 2 + read-write + + + INEPMSK3 + desc INEPMSK3 + 3 + 3 + read-write + + + INEPMSK4 + desc INEPMSK4 + 4 + 4 + read-write + + + INEPMSK5 + desc INEPMSK5 + 5 + 5 + read-write + + + INEPMSK6 + desc INEPMSK6 + 6 + 6 + read-write + + + INEPMSK7 + desc INEPMSK7 + 7 + 7 + read-write + + + INEPMSK8 + desc INEPMSK8 + 8 + 8 + read-write + + + INEPMSK9 + desc INEPMSK9 + 9 + 9 + read-write + + + INEPMSK10 + desc INEPMSK10 + 10 + 10 + read-write + + + INEPMSK11 + desc INEPMSK11 + 11 + 11 + read-write + + + INEPMSK12 + desc INEPMSK12 + 12 + 12 + read-write + + + INEPMSK13 + desc INEPMSK13 + 13 + 13 + read-write + + + INEPMSK14 + desc INEPMSK14 + 14 + 14 + read-write + + + INEPMSK15 + desc INEPMSK15 + 15 + 15 + read-write + + + OUTEPMSK0 + desc OUTEPMSK0 + 16 + 16 + read-write + + + OUTEPMSK1 + desc OUTEPMSK1 + 17 + 17 + read-write + + + OUTEPMSK2 + desc OUTEPMSK2 + 18 + 18 + read-write + + + OUTEPMSK3 + desc OUTEPMSK3 + 19 + 19 + read-write + + + OUTEPMSK4 + desc OUTEPMSK4 + 20 + 20 + read-write + + + OUTEPMSK5 + desc OUTEPMSK5 + 21 + 21 + read-write + + + OUTEPMSK6 + desc OUTEPMSK6 + 22 + 22 + read-write + + + OUTEPMSK7 + desc OUTEPMSK7 + 23 + 23 + read-write + + + OUTEPMSK8 + desc OUTEPMSK8 + 24 + 24 + read-write + + + OUTEPMSK9 + desc OUTEPMSK9 + 25 + 25 + read-write + + + OUTEPMSK10 + desc OUTEPMSK10 + 26 + 26 + read-write + + + OUTEPMSK11 + desc OUTEPMSK11 + 27 + 27 + read-write + + + OUTEPMSK12 + desc OUTEPMSK12 + 28 + 28 + read-write + + + OUTEPMSK13 + desc OUTEPMSK13 + 29 + 29 + read-write + + + OUTEPMSK14 + desc OUTEPMSK14 + 30 + 30 + read-write + + + OUTEPMSK15 + desc OUTEPMSK15 + 31 + 31 + read-write + + + + + DTHRCTL + desc DTHRCTL + 0x830 + 32 + read-write + 0x1C100020 + 0xBFF1FFF + + + NONISOTHREN + desc NONISOTHREN + 0 + 0 + read-write + + + ISOTHREN + desc ISOTHREN + 1 + 1 + read-write + + + TXTHRLEN + desc TXTHRLEN + 10 + 2 + read-write + + + AHBTHRRATIO + desc AHBTHRRATIO + 12 + 11 + read-write + + + RXTHREN + desc RXTHREN + 16 + 16 + read-write + + + RXTHRLEN + desc RXTHRLEN + 25 + 17 + read-write + + + ARBPRKEN + desc ARBPRKEN + 27 + 27 + read-write + + + + + DIEPEMPMSK + desc DIEPEMPMSK + 0x834 + 32 + read-write + 0x0 + 0xFFFF + + + INEPTXFEMPMSK + desc INEPTXFEMPMSK + 15 + 0 + read-write + + + + + DEACHINT + desc DEACHINT + 0x838 + 32 + read-only + 0x0 + 0xFFFFFFFF + + + ECHINEPINT + desc ECHINEPINT + 15 + 0 + read-only + + + ECHOUTEPINT + desc ECHOUTEPINT + 31 + 16 + read-only + + + + + DEACHINTMSK + desc DEACHINTMSK + 0x83C + 32 + read-write + 0x0 + 0xFFFFFFFF + + + ECHINEPMSK0 + desc ECHINEPMSK0 + 0 + 0 + read-write + + + ECHINEPMSK1 + desc ECHINEPMSK1 + 1 + 1 + read-write + + + ECHINEPMSK2 + desc ECHINEPMSK2 + 2 + 2 + read-write + + + ECHINEPMSK3 + desc ECHINEPMSK3 + 3 + 3 + read-write + + + ECHINEPMSK4 + desc ECHINEPMSK4 + 4 + 4 + read-write + + + ECHINEPMSK5 + desc ECHINEPMSK5 + 5 + 5 + read-write + + + ECHINEPMSK6 + desc ECHINEPMSK6 + 6 + 6 + read-write + + + ECHINEPMSK7 + desc ECHINEPMSK7 + 7 + 7 + read-write + + + ECHINEPMSK8 + desc ECHINEPMSK8 + 8 + 8 + read-write + + + ECHINEPMSK9 + desc ECHINEPMSK9 + 9 + 9 + read-write + + + ECHINEPMSK10 + desc ECHINEPMSK10 + 10 + 10 + read-write + + + ECHINEPMSK11 + desc ECHINEPMSK11 + 11 + 11 + read-write + + + ECHINEPMSK12 + desc ECHINEPMSK12 + 12 + 12 + read-write + + + ECHINEPMSK13 + desc ECHINEPMSK13 + 13 + 13 + read-write + + + ECHINEPMSK14 + desc ECHINEPMSK14 + 14 + 14 + read-write + + + ECHINEPMSK15 + desc ECHINEPMSK15 + 15 + 15 + read-write + + + ECHOUTEPMSK0 + desc ECHOUTEPMSK0 + 16 + 16 + read-write + + + ECHOUTEPMSK1 + desc ECHOUTEPMSK1 + 17 + 17 + read-write + + + ECHOUTEPMSK2 + desc ECHOUTEPMSK2 + 18 + 18 + read-write + + + ECHOUTEPMSK3 + desc ECHOUTEPMSK3 + 19 + 19 + read-write + + + ECHOUTEPMSK4 + desc ECHOUTEPMSK4 + 20 + 20 + read-write + + + ECHOUTEPMSK5 + desc ECHOUTEPMSK5 + 21 + 21 + read-write + + + ECHOUTEPMSK6 + desc ECHOUTEPMSK6 + 22 + 22 + read-write + + + ECHOUTEPMSK7 + desc ECHOUTEPMSK7 + 23 + 23 + read-write + + + ECHOUTEPMSK8 + desc ECHOUTEPMSK8 + 24 + 24 + read-write + + + ECHOUTEPMSK9 + desc ECHOUTEPMSK9 + 25 + 25 + read-write + + + ECHOUTEPMSK10 + desc ECHOUTEPMSK10 + 26 + 26 + read-write + + + ECHOUTEPMSK11 + desc ECHOUTEPMSK11 + 27 + 27 + read-write + + + ECHOUTEPMSK12 + desc ECHOUTEPMSK12 + 28 + 28 + read-write + + + ECHOUTEPMSK13 + desc ECHOUTEPMSK13 + 29 + 29 + read-write + + + ECHOUTEPMSK14 + desc ECHOUTEPMSK14 + 30 + 30 + read-write + + + ECHOUTEPMSK15 + desc ECHOUTEPMSK15 + 31 + 31 + read-write + + + + + DIEPEACHMSK1 + desc DIEPEACHMSK1 + 0x844 + 32 + read-write + 0x0 + 0x217F + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + EPDISBLDMSK + desc EPDISBLDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + TIMEOUTMSK + desc TIMEOUTMSK + 3 + 3 + read-write + + + INTKNTXFEMPMSK + desc INTKNTXFEMPMSK + 4 + 4 + read-write + + + INTKNEPMISMSK + desc INTKNEPMISMSK + 5 + 5 + read-write + + + INEPNAKEFFMSK + desc INEPNAKEFFMSK + 6 + 6 + read-write + + + TXFIFOUNDRNMSK + desc TXFIFOUNDRNMSK + 8 + 8 + read-write + + + NAKMSK + desc NAKMSK + 13 + 13 + read-write + + + + + DOEPEACHMSK1 + desc DOEPEACHMSK1 + 0x884 + 32 + read-write + 0x0 + 0x717F + + + XFERCOMPLMSK + desc XFERCOMPLMSK + 0 + 0 + read-write + + + EPDISBLDMSK + desc EPDISBLDMSK + 1 + 1 + read-write + + + AHBERRMSK + desc AHBERRMSK + 2 + 2 + read-write + + + SETUPMSK + desc SETUPMSK + 3 + 3 + read-write + + + OUTTKNEPDISMSK + desc OUTTKNEPDISMSK + 4 + 4 + read-write + + + STSPHSRCVDMSK + desc STSPHSRCVDMSK + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERRMSK + desc OUTPKTERRMSK + 8 + 8 + read-write + + + BBLEERRMSK + desc BBLEERRMSK + 12 + 12 + read-write + + + NAKMSK + desc NAKMSK + 13 + 13 + read-write + + + NYETMSK + desc NYETMSK + 14 + 14 + read-write + + + + + DIEPCTL0 + desc DIEPCTL0 + 0x900 + 32 + read-write + 0x8000 + 0xCFEE8003 + + + MPS + desc MPS + 1 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-only + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT0 + desc DIEPINT0 + 0x908 + 32 + read-write + 0x80 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ0 + desc DIEPTSIZ0 + 0x910 + 32 + read-write + 0x0 + 0x18007F + + + XFERSIZE + desc XFERSIZE + 6 + 0 + read-write + + + PKTCNT + desc PKTCNT + 20 + 19 + read-write + + + + + DIEPDMA0 + desc DIEPDMA0 + 0x914 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTXFSTS0 + desc DTXFSTS0 + 0x918 + 32 + read-only + 0x800 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL1 + desc DIEPCTL1 + 0x920 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT1 + desc DIEPINT1 + 0x928 + 32 + read-write + 0x80 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ1 + desc DIEPTSIZ1 + 0x930 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA1 + desc DIEPDMA1 + 0x934 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTXFSTS1 + desc DTXFSTS1 + 0x938 + 32 + read-only + 0x800 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL2 + desc DIEPCTL2 + 0x940 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT2 + desc DIEPINT2 + 0x948 + 32 + read-write + 0x80 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ2 + desc DIEPTSIZ2 + 0x950 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA2 + desc DIEPDMA2 + 0x954 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTXFSTS2 + desc DTXFSTS2 + 0x958 + 32 + read-only + 0x800 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL3 + desc DIEPCTL3 + 0x960 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT3 + desc DIEPINT3 + 0x968 + 32 + read-write + 0x80 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ3 + desc DIEPTSIZ3 + 0x970 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA3 + desc DIEPDMA3 + 0x974 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTXFSTS3 + desc DTXFSTS3 + 0x978 + 32 + read-only + 0x800 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL4 + desc DIEPCTL4 + 0x980 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT4 + desc DIEPINT4 + 0x988 + 32 + read-write + 0x80 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ4 + desc DIEPTSIZ4 + 0x990 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA4 + desc DIEPDMA4 + 0x994 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTXFSTS4 + desc DTXFSTS4 + 0x998 + 32 + read-only + 0x800 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL5 + desc DIEPCTL5 + 0x9A0 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT5 + desc DIEPINT5 + 0x9A8 + 32 + read-write + 0x80 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ5 + desc DIEPTSIZ5 + 0x9B0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA5 + desc DIEPDMA5 + 0x9B4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTXFSTS5 + desc DTXFSTS5 + 0x9B8 + 32 + read-only + 0x800 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL6 + desc DIEPCTL6 + 0x9C0 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT6 + desc DIEPINT6 + 0x9C8 + 32 + read-write + 0x80 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ6 + desc DIEPTSIZ6 + 0x9D0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA6 + desc DIEPDMA6 + 0x9D4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTXFSTS6 + desc DTXFSTS6 + 0x9D8 + 32 + read-only + 0x800 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL7 + desc DIEPCTL7 + 0x9E0 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT7 + desc DIEPINT7 + 0x9E8 + 32 + read-write + 0x80 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ7 + desc DIEPTSIZ7 + 0x9F0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA7 + desc DIEPDMA7 + 0x9F4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTXFSTS7 + desc DTXFSTS7 + 0x9F8 + 32 + read-only + 0x800 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL8 + desc DIEPCTL8 + 0xA00 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT8 + desc DIEPINT8 + 0xA08 + 32 + read-write + 0x80 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ8 + desc DIEPTSIZ8 + 0xA10 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA8 + desc DIEPDMA8 + 0xA14 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTXFSTS8 + desc DTXFSTS8 + 0xA18 + 32 + read-only + 0x800 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL9 + desc DIEPCTL9 + 0xA20 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT9 + desc DIEPINT9 + 0xA28 + 32 + read-write + 0x80 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ9 + desc DIEPTSIZ9 + 0xA30 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA9 + desc DIEPDMA9 + 0xA34 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTXFSTS9 + desc DTXFSTS9 + 0xA38 + 32 + read-only + 0x800 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL10 + desc DIEPCTL10 + 0xA40 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT10 + desc DIEPINT10 + 0xA48 + 32 + read-write + 0x80 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ10 + desc DIEPTSIZ10 + 0xA50 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA10 + desc DIEPDMA10 + 0xA54 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTXFSTS10 + desc DTXFSTS10 + 0xA58 + 32 + read-only + 0x800 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL11 + desc DIEPCTL11 + 0xA60 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT11 + desc DIEPINT11 + 0xA68 + 32 + read-write + 0x80 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ11 + desc DIEPTSIZ11 + 0xA70 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA11 + desc DIEPDMA11 + 0xA74 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTXFSTS11 + desc DTXFSTS11 + 0xA78 + 32 + read-only + 0x800 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL12 + desc DIEPCTL12 + 0xA80 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT12 + desc DIEPINT12 + 0xA88 + 32 + read-write + 0x80 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ12 + desc DIEPTSIZ12 + 0xA90 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA12 + desc DIEPDMA12 + 0xA94 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTXFSTS12 + desc DTXFSTS12 + 0xA98 + 32 + read-only + 0x800 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL13 + desc DIEPCTL13 + 0xAA0 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT13 + desc DIEPINT13 + 0xAA8 + 32 + read-write + 0x80 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ13 + desc DIEPTSIZ13 + 0xAB0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA13 + desc DIEPDMA13 + 0xAB4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTXFSTS13 + desc DTXFSTS13 + 0xAB8 + 32 + read-only + 0x800 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL14 + desc DIEPCTL14 + 0xAC0 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT14 + desc DIEPINT14 + 0xAC8 + 32 + read-write + 0x80 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ14 + desc DIEPTSIZ14 + 0xAD0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA14 + desc DIEPDMA14 + 0xAD4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTXFSTS14 + desc DTXFSTS14 + 0xAD8 + 32 + read-only + 0x800 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DIEPCTL15 + desc DIEPCTL15 + 0xAE0 + 32 + read-write + 0x0 + 0xFFEF87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + TXFNUM + desc TXFNUM + 25 + 22 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DIEPINT15 + desc DIEPINT15 + 0xAE8 + 32 + read-write + 0x80 + 0x7BFF + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + TIMEOUT + desc TIMEOUT + 3 + 3 + read-write + + + INTKNTXFEMP + desc INTKNTXFEMP + 4 + 4 + read-write + + + INTKNEPMIS + desc INTKNEPMIS + 5 + 5 + read-write + + + INEPNAKEFF + desc INEPNAKEFF + 6 + 6 + read-write + + + TXFEMP + desc TXFEMP + 7 + 7 + read-only + + + TXFIFOUNDRN + desc TXFIFOUNDRN + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + + + DIEPTSIZ15 + desc DIEPTSIZ15 + 0xAF0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + MC + desc MC + 30 + 29 + read-write + + + + + DIEPDMA15 + desc DIEPDMA15 + 0xAF4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DTXFSTS15 + desc DTXFSTS15 + 0xAF8 + 32 + read-only + 0x800 + 0xFFFF + + + INEPTXFSPCAVAIL + desc INEPTXFSPCAVAIL + 15 + 0 + read-only + + + + + DOEPCTL0 + desc DOEPCTL0 + 0xB00 + 32 + read-only + 0x8000 + 0xCC3E8003 + + + MPS + desc MPS + 1 + 0 + read-only + + + USBACTEP + desc USBACTEP + 15 + 15 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-only + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-only + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT0 + desc DOEPINT0 + 0xB08 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ0 + desc DOEPTSIZ0 + 0xB10 + 32 + read-write + 0x0 + 0x6008007F + + + XFERSIZE + desc XFERSIZE + 6 + 0 + read-write + + + PKTCNT + desc PKTCNT + 19 + 19 + read-write + + + SUPCNT + desc SUPCNT + 30 + 29 + read-write + + + + + DOEPDMA0 + desc DOEPDMA0 + 0xB14 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL1 + desc DOEPCTL1 + 0xB20 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT1 + desc DOEPINT1 + 0xB28 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ1 + desc DOEPTSIZ1 + 0xB30 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA1 + desc DOEPDMA1 + 0xB34 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL2 + desc DOEPCTL2 + 0xB40 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT2 + desc DOEPINT2 + 0xB48 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ2 + desc DOEPTSIZ2 + 0xB50 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA2 + desc DOEPDMA2 + 0xB54 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL3 + desc DOEPCTL3 + 0xB60 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT3 + desc DOEPINT3 + 0xB68 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ3 + desc DOEPTSIZ3 + 0xB70 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA3 + desc DOEPDMA3 + 0xB74 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL4 + desc DOEPCTL4 + 0xB80 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT4 + desc DOEPINT4 + 0xB88 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ4 + desc DOEPTSIZ4 + 0xB90 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA4 + desc DOEPDMA4 + 0xB94 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL5 + desc DOEPCTL5 + 0xBA0 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT5 + desc DOEPINT5 + 0xBA8 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ5 + desc DOEPTSIZ5 + 0xBB0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA5 + desc DOEPDMA5 + 0xBB4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL6 + desc DOEPCTL6 + 0xBC0 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT6 + desc DOEPINT6 + 0xBC8 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ6 + desc DOEPTSIZ6 + 0xBD0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA6 + desc DOEPDMA6 + 0xBD4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL7 + desc DOEPCTL7 + 0xBE0 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT7 + desc DOEPINT7 + 0xBE8 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ7 + desc DOEPTSIZ7 + 0xBF0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA7 + desc DOEPDMA7 + 0xBF4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL8 + desc DOEPCTL8 + 0xC00 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT8 + desc DOEPINT8 + 0xC08 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ8 + desc DOEPTSIZ8 + 0xC10 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA8 + desc DOEPDMA8 + 0xC14 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL9 + desc DOEPCTL9 + 0xC20 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT9 + desc DOEPINT9 + 0xC28 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ9 + desc DOEPTSIZ9 + 0xC30 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA9 + desc DOEPDMA9 + 0xC34 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL10 + desc DOEPCTL10 + 0xC40 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT10 + desc DOEPINT10 + 0xC48 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ10 + desc DOEPTSIZ10 + 0xC50 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA10 + desc DOEPDMA10 + 0xC54 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL11 + desc DOEPCTL11 + 0xC60 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT11 + desc DOEPINT11 + 0xC68 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ11 + desc DOEPTSIZ11 + 0xC70 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA11 + desc DOEPDMA11 + 0xC74 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL12 + desc DOEPCTL12 + 0xC80 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT12 + desc DOEPINT12 + 0xC88 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ12 + desc DOEPTSIZ12 + 0xC90 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA12 + desc DOEPDMA12 + 0xC94 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL13 + desc DOEPCTL13 + 0xCA0 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT13 + desc DOEPINT13 + 0xCA8 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ13 + desc DOEPTSIZ13 + 0xCB0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA13 + desc DOEPDMA13 + 0xCB4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL14 + desc DOEPCTL14 + 0xCC0 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT14 + desc DOEPINT14 + 0xCC8 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ14 + desc DOEPTSIZ14 + 0xCD0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA14 + desc DOEPDMA14 + 0xCD4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + DOEPCTL15 + desc DOEPCTL15 + 0xCE0 + 32 + read-write + 0x0 + 0xFC3F87FF + + + MPS + desc MPS + 10 + 0 + read-write + + + USBACTEP + desc USBACTEP + 15 + 15 + read-write + + + DPID + desc DPID + 16 + 16 + read-only + + + NAKSTS + desc NAKSTS + 17 + 17 + read-only + + + EPTYPE + desc EPTYPE + 19 + 18 + read-write + + + SNP + desc SNP + 20 + 20 + read-write + + + STALL + desc STALL + 21 + 21 + read-write + + + CNAK + desc CNAK + 26 + 26 + write-only + + + SNAK + desc SNAK + 27 + 27 + write-only + + + SETD0PID + desc SETD0PID + 28 + 28 + write-only + + + SETD1PID + desc SETD1PID + 29 + 29 + write-only + + + EPDIS + desc EPDIS + 30 + 30 + read-write + + + EPENA + desc EPENA + 31 + 31 + read-write + + + + + DOEPINT15 + desc DOEPINT15 + 0xCE8 + 32 + read-write + 0x0 + 0xFB7F + + + XFERCOMPL + desc XFERCOMPL + 0 + 0 + read-write + + + EPDISBLD + desc EPDISBLD + 1 + 1 + read-write + + + AHBERR + desc AHBERR + 2 + 2 + read-write + + + SETUP + desc SETUP + 3 + 3 + read-write + + + OUTTKNEPDIS + desc OUTTKNEPDIS + 4 + 4 + read-write + + + STSPHSERCVD + desc STSPHSERCVD + 5 + 5 + read-write + + + BACK2BACKSETUP + desc BACK2BACKSETUP + 6 + 6 + read-write + + + OUTPKTERR + desc OUTPKTERR + 8 + 8 + read-write + + + BNAINTR + desc BNAINTR + 9 + 9 + read-write + + + PKTDRPSTS + desc PKTDRPSTS + 11 + 11 + read-write + + + BBLEERR + desc BBLEERR + 12 + 12 + read-write + + + NAKINTRPT + desc NAKINTRPT + 13 + 13 + read-write + + + NYETINTRPT + desc NYETINTRPT + 14 + 14 + read-write + + + STUPPKTRCVD + desc STUPPKTRCVD + 15 + 15 + read-write + + + + + DOEPTSIZ15 + desc DOEPTSIZ15 + 0xCF0 + 32 + read-write + 0x0 + 0x7FFFFFFF + + + XFERSIZE + desc XFERSIZE + 18 + 0 + read-write + + + PKTCNT + desc PKTCNT + 28 + 19 + read-write + + + RXDPID + desc RXDPID + 30 + 29 + read-only + + + + + DOEPDMA15 + desc DOEPDMA15 + 0xCF4 + 32 + read-write + 0x0 + 0xFFFFFFFF + + + PCGCCTL + desc PCGCCTL + 0xE00 + 32 + read-write + 0x0 + 0x1EF + + + STOPPCLK + desc STOPPCLK + 0 + 0 + read-write + + + GATEHCLK + desc GATEHCLK + 1 + 1 + read-write + + + PWRCLMP + desc PWRCLMP + 2 + 2 + read-write + + + RSTPDWNMODULE + desc RSTPDWNMODULE + 3 + 3 + read-write + + + ENBL_L1GATING + desc ENBL_L1GATING + 5 + 5 + read-write + + + PHYSLEEP + desc PHYSLEEP + 6 + 6 + read-only + + + L1SUSPENDED + desc L1SUSPENDED + 7 + 7 + read-only + + + RESETAFTERSUSP + desc RESETAFTERSUSP + 8 + 8 + read-write + + + + + + + WDT + desc WDT + 0x40049000 + + 0x0 + 0xC + + + + CR + desc CR + 0x0 + 32 + read-write + 0x80010FF3 + 0x80010FF3 + + + PERI + desc PERI + 1 + 0 + read-write + + + CKS + desc CKS + 7 + 4 + read-write + + + WDPT + desc WDPT + 11 + 8 + read-write + + + SLPOFF + desc SLPOFF + 16 + 16 + read-write + + + ITS + desc ITS + 31 + 31 + read-write + + + + + SR + desc SR + 0x4 + 32 + read-only + 0x0 + 0x3FFFF + + + CNT + desc CNT + 15 + 0 + read-only + + + UDF + desc UDF + 16 + 16 + read-write + + + REF + desc REF + 17 + 17 + read-write + + + + + RR + desc RR + 0x8 + 32 + read-only + 0x0 + 0xFFFF + + + RF + desc RF + 15 + 0 + read-only + + + + + + + diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/IAR/startup_hc32f4a0.s b/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/IAR/startup_hc32f4a0.s new file mode 100644 index 0000000000..a9ed8f4bd3 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/IAR/startup_hc32f4a0.s @@ -0,0 +1,1039 @@ +;******************************************************************************* +; Copyright (C) 2016, Huada Semiconductor Co.,Ltd All rights reserved. +; +; This software is owned and published by: +; Huada Semiconductor Co.,Ltd ("HDSC"). +; +; BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND +; BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT. +; +; This software contains source code for use with HDSC +; components. This software is licensed by HDSC to be adapted only +; for use in systems utilizing HDSC components. HDSC shall not be +; responsible for misuse or illegal use of this software for devices not +; supported herein. HDSC is providing this software "AS IS" and will +; not be responsible for issues arising from incorrect user implementation +; of the software. +; +; Disclaimer: +; HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE, +; REGARDING THE SOFTWARE (INCLUDING ANY ACCOMPANYING WRITTEN MATERIALS), +; ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING, +; WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED +; WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED +; WARRANTY OF NONINFRINGEMENT. +; HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT, +; NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT +; LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, +; LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR +; INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT, +; INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA, +; SAVINGS OR PROFITS, +; EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +; YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR +; INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED +; FROM, THE SOFTWARE. +; +; This software may be replicated in part or whole for the licensed use, +; with the restriction that this Disclaimer and Copyright notice must be +; included with each copy of this software, whether used in part or whole, +; at all times. +;/ +;/*****************************************************************************/ +;/* Startup for IAR */ +;/* Version V1.0 */ +;/* Date 2020-06-12 */ +;/* Target-mcu HC32F4A0 */ +;/*****************************************************************************/ + + + MODULE ?cstartup + + ;; Forward declaration of sections. + SECTION CSTACK:DATA:NOROOT(3) + + SECTION .intvec:CODE:NOROOT(2) + + EXTERN __iar_program_start + EXTERN SystemInit + PUBLIC __vector_table + + SECTION .intvec:CODE:NOROOT(8) + DATA +__vector_table + DCD sfe(CSTACK) ; Top of Stack + DCD Reset_Handler ; Reset + DCD NMI_Handler ; NMI + DCD HardFault_Handler ; Hard Fault + DCD MemManage_Handler ; MemManage Fault + DCD BusFault_Handler ; Bus Fault + DCD UsageFault_Handler ; Usage Fault + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall + DCD DebugMon_Handler ; Debug Monitor + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV + DCD SysTick_Handler ; SysTick + +; Numbered IRQ handler vectors + +; Note: renaming to device dependent ISR function names are done in +; ddl.h (section "IRQ name definition for all type MCUs") + DCD IRQ000_Handler + DCD IRQ001_Handler + DCD IRQ002_Handler + DCD IRQ003_Handler + DCD IRQ004_Handler + DCD IRQ005_Handler + DCD IRQ006_Handler + DCD IRQ007_Handler + DCD IRQ008_Handler + DCD IRQ009_Handler + DCD IRQ010_Handler + DCD IRQ011_Handler + DCD IRQ012_Handler + DCD IRQ013_Handler + DCD IRQ014_Handler + DCD IRQ015_Handler + DCD IRQ016_Handler + DCD IRQ017_Handler + DCD IRQ018_Handler + DCD IRQ019_Handler + DCD IRQ020_Handler + DCD IRQ021_Handler + DCD IRQ022_Handler + DCD IRQ023_Handler + DCD IRQ024_Handler + DCD IRQ025_Handler + DCD IRQ026_Handler + DCD IRQ027_Handler + DCD IRQ028_Handler + DCD IRQ029_Handler + DCD IRQ030_Handler + DCD IRQ031_Handler + DCD IRQ032_Handler + DCD IRQ033_Handler + DCD IRQ034_Handler + DCD IRQ035_Handler + DCD IRQ036_Handler + DCD IRQ037_Handler + DCD IRQ038_Handler + DCD IRQ039_Handler + DCD IRQ040_Handler + DCD IRQ041_Handler + DCD IRQ042_Handler + DCD IRQ043_Handler + DCD IRQ044_Handler + DCD IRQ045_Handler + DCD IRQ046_Handler + DCD IRQ047_Handler + DCD IRQ048_Handler + DCD IRQ049_Handler + DCD IRQ050_Handler + DCD IRQ051_Handler + DCD IRQ052_Handler + DCD IRQ053_Handler + DCD IRQ054_Handler + DCD IRQ055_Handler + DCD IRQ056_Handler + DCD IRQ057_Handler + DCD IRQ058_Handler + DCD IRQ059_Handler + DCD IRQ060_Handler + DCD IRQ061_Handler + DCD IRQ062_Handler + DCD IRQ063_Handler + DCD IRQ064_Handler + DCD IRQ065_Handler + DCD IRQ066_Handler + DCD IRQ067_Handler + DCD IRQ068_Handler + DCD IRQ069_Handler + DCD IRQ070_Handler + DCD IRQ071_Handler + DCD IRQ072_Handler + DCD IRQ073_Handler + DCD IRQ074_Handler + DCD IRQ075_Handler + DCD IRQ076_Handler + DCD IRQ077_Handler + DCD IRQ078_Handler + DCD IRQ079_Handler + DCD IRQ080_Handler + DCD IRQ081_Handler + DCD IRQ082_Handler + DCD IRQ083_Handler + DCD IRQ084_Handler + DCD IRQ085_Handler + DCD IRQ086_Handler + DCD IRQ087_Handler + DCD IRQ088_Handler + DCD IRQ089_Handler + DCD IRQ090_Handler + DCD IRQ091_Handler + DCD IRQ092_Handler + DCD IRQ093_Handler + DCD IRQ094_Handler + DCD IRQ095_Handler + DCD IRQ096_Handler + DCD IRQ097_Handler + DCD IRQ098_Handler + DCD IRQ099_Handler + DCD IRQ100_Handler + DCD IRQ101_Handler + DCD IRQ102_Handler + DCD IRQ103_Handler + DCD IRQ104_Handler + DCD IRQ105_Handler + DCD IRQ106_Handler + DCD IRQ107_Handler + DCD IRQ108_Handler + DCD IRQ109_Handler + DCD IRQ110_Handler + DCD IRQ111_Handler + DCD IRQ112_Handler + DCD IRQ113_Handler + DCD IRQ114_Handler + DCD IRQ115_Handler + DCD IRQ116_Handler + DCD IRQ117_Handler + DCD IRQ118_Handler + DCD IRQ119_Handler + DCD IRQ120_Handler + DCD IRQ121_Handler + DCD IRQ122_Handler + DCD IRQ123_Handler + DCD IRQ124_Handler + DCD IRQ125_Handler + DCD IRQ126_Handler + DCD IRQ127_Handler + DCD IRQ128_Handler + DCD IRQ129_Handler + DCD IRQ130_Handler + DCD IRQ131_Handler + DCD IRQ132_Handler + DCD IRQ133_Handler + DCD IRQ134_Handler + DCD IRQ135_Handler + DCD IRQ136_Handler + DCD IRQ137_Handler + DCD IRQ138_Handler + DCD IRQ139_Handler + DCD IRQ140_Handler + DCD IRQ141_Handler + DCD IRQ142_Handler + DCD IRQ143_Handler + + THUMB +; Dummy Exception Handlers (infinite loops which can be modified) + + PUBWEAK Reset_Handler + SECTION .text:CODE:NOROOT:REORDER(4) +Reset_Handler + LDR R0, =SystemInit + BLX R0 + LDR R0, =__iar_program_start + BX R0 + + PUBWEAK NMI_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +NMI_Handler + B NMI_Handler + + PUBWEAK HardFault_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +HardFault_Handler + B HardFault_Handler + + PUBWEAK MemManage_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +MemManage_Handler + B MemManage_Handler + + PUBWEAK BusFault_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +BusFault_Handler + B BusFault_Handler + + PUBWEAK UsageFault_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +UsageFault_Handler + B UsageFault_Handler + + PUBWEAK SVC_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +SVC_Handler + B SVC_Handler + + PUBWEAK DebugMon_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +DebugMon_Handler + B DebugMon_Handler + + PUBWEAK PendSV_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +PendSV_Handler + B PendSV_Handler + + PUBWEAK SysTick_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +SysTick_Handler + B SysTick_Handler + + + + PUBWEAK IRQ000_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ000_Handler + B IRQ000_Handler + + + PUBWEAK IRQ001_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ001_Handler + B IRQ001_Handler + + + PUBWEAK IRQ002_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ002_Handler + B IRQ002_Handler + + + PUBWEAK IRQ003_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ003_Handler + B IRQ003_Handler + + + PUBWEAK IRQ004_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ004_Handler + B IRQ004_Handler + + + PUBWEAK IRQ005_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ005_Handler + B IRQ005_Handler + + + PUBWEAK IRQ006_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ006_Handler + B IRQ006_Handler + + + PUBWEAK IRQ007_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ007_Handler + B IRQ007_Handler + + + PUBWEAK IRQ008_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ008_Handler + B IRQ008_Handler + + + PUBWEAK IRQ009_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ009_Handler + B IRQ009_Handler + + + PUBWEAK IRQ010_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ010_Handler + B IRQ010_Handler + + + PUBWEAK IRQ011_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ011_Handler + B IRQ011_Handler + + + PUBWEAK IRQ012_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ012_Handler + B IRQ012_Handler + + + PUBWEAK IRQ013_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ013_Handler + B IRQ013_Handler + + + PUBWEAK IRQ014_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ014_Handler + B IRQ014_Handler + + + PUBWEAK IRQ015_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ015_Handler + B IRQ015_Handler + + + PUBWEAK IRQ016_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ016_Handler + B IRQ016_Handler + + + PUBWEAK IRQ017_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ017_Handler + B IRQ017_Handler + + + PUBWEAK IRQ018_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ018_Handler + B IRQ018_Handler + + + PUBWEAK IRQ019_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ019_Handler + B IRQ019_Handler + + + PUBWEAK IRQ020_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ020_Handler + B IRQ020_Handler + + + PUBWEAK IRQ021_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ021_Handler + B IRQ021_Handler + + + PUBWEAK IRQ022_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ022_Handler + B IRQ022_Handler + + + PUBWEAK IRQ023_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ023_Handler + B IRQ023_Handler + + + PUBWEAK IRQ024_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ024_Handler + B IRQ024_Handler + + + PUBWEAK IRQ025_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ025_Handler + B IRQ025_Handler + + + PUBWEAK IRQ026_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ026_Handler + B IRQ026_Handler + + + PUBWEAK IRQ027_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ027_Handler + B IRQ027_Handler + + + PUBWEAK IRQ028_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ028_Handler + B IRQ028_Handler + + + PUBWEAK IRQ029_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ029_Handler + B IRQ029_Handler + + + PUBWEAK IRQ030_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ030_Handler + B IRQ030_Handler + + + PUBWEAK IRQ031_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ031_Handler + B IRQ031_Handler + + PUBWEAK IRQ032_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ032_Handler + B IRQ032_Handler + + PUBWEAK IRQ033_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ033_Handler + B IRQ033_Handler + + PUBWEAK IRQ034_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ034_Handler + B IRQ034_Handler + + PUBWEAK IRQ035_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ035_Handler + B IRQ035_Handler + + PUBWEAK IRQ036_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ036_Handler + B IRQ036_Handler + + PUBWEAK IRQ037_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ037_Handler + B IRQ037_Handler + + PUBWEAK IRQ038_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ038_Handler + B IRQ038_Handler + + PUBWEAK IRQ039_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ039_Handler + B IRQ039_Handler + + PUBWEAK IRQ040_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ040_Handler + B IRQ040_Handler + + PUBWEAK IRQ041_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ041_Handler + B IRQ041_Handler + + PUBWEAK IRQ042_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ042_Handler + B IRQ042_Handler + + PUBWEAK IRQ043_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ043_Handler + B IRQ043_Handler + + PUBWEAK IRQ044_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ044_Handler + B IRQ044_Handler + + PUBWEAK IRQ045_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ045_Handler + B IRQ045_Handler + + PUBWEAK IRQ046_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ046_Handler + B IRQ046_Handler + + PUBWEAK IRQ047_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ047_Handler + B IRQ047_Handler + + PUBWEAK IRQ048_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ048_Handler + B IRQ048_Handler + + PUBWEAK IRQ049_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ049_Handler + B IRQ049_Handler + + PUBWEAK IRQ050_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ050_Handler + B IRQ050_Handler + + PUBWEAK IRQ051_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ051_Handler + B IRQ051_Handler + + PUBWEAK IRQ052_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ052_Handler + B IRQ052_Handler + + PUBWEAK IRQ053_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ053_Handler + B IRQ053_Handler + + PUBWEAK IRQ054_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ054_Handler + B IRQ054_Handler + + PUBWEAK IRQ055_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ055_Handler + B IRQ055_Handler + + PUBWEAK IRQ056_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ056_Handler + B IRQ056_Handler + + PUBWEAK IRQ057_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ057_Handler + B IRQ057_Handler + + PUBWEAK IRQ058_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ058_Handler + B IRQ058_Handler + + PUBWEAK IRQ059_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ059_Handler + B IRQ059_Handler + + PUBWEAK IRQ060_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ060_Handler + B IRQ060_Handler + + PUBWEAK IRQ061_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ061_Handler + B IRQ061_Handler + + PUBWEAK IRQ062_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ062_Handler + B IRQ062_Handler + + PUBWEAK IRQ063_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ063_Handler + B IRQ063_Handler + + PUBWEAK IRQ064_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ064_Handler + B IRQ064_Handler + + PUBWEAK IRQ065_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ065_Handler + B IRQ065_Handler + + PUBWEAK IRQ066_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ066_Handler + B IRQ066_Handler + + PUBWEAK IRQ067_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ067_Handler + B IRQ067_Handler + + PUBWEAK IRQ068_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ068_Handler + B IRQ068_Handler + + PUBWEAK IRQ069_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ069_Handler + B IRQ069_Handler + + PUBWEAK IRQ070_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ070_Handler + B IRQ070_Handler + + PUBWEAK IRQ071_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ071_Handler + B IRQ071_Handler + + PUBWEAK IRQ072_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ072_Handler + B IRQ072_Handler + + PUBWEAK IRQ073_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ073_Handler + B IRQ073_Handler + + PUBWEAK IRQ074_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ074_Handler + B IRQ074_Handler + + PUBWEAK IRQ075_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ075_Handler + B IRQ075_Handler + + PUBWEAK IRQ076_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ076_Handler + B IRQ076_Handler + + PUBWEAK IRQ077_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ077_Handler + B IRQ077_Handler + + PUBWEAK IRQ078_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ078_Handler + B IRQ078_Handler + + PUBWEAK IRQ079_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ079_Handler + B IRQ079_Handler + + PUBWEAK IRQ080_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ080_Handler + B IRQ080_Handler + + PUBWEAK IRQ081_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ081_Handler + B IRQ081_Handler + + PUBWEAK IRQ082_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ082_Handler + B IRQ082_Handler + + PUBWEAK IRQ083_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ083_Handler + B IRQ083_Handler + + PUBWEAK IRQ084_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ084_Handler + B IRQ084_Handler + + PUBWEAK IRQ085_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ085_Handler + B IRQ085_Handler + + PUBWEAK IRQ086_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ086_Handler + B IRQ086_Handler + + PUBWEAK IRQ087_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ087_Handler + B IRQ087_Handler + + PUBWEAK IRQ088_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ088_Handler + B IRQ088_Handler + + PUBWEAK IRQ089_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ089_Handler + B IRQ089_Handler + + PUBWEAK IRQ090_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ090_Handler + B IRQ090_Handler + + PUBWEAK IRQ091_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ091_Handler + B IRQ091_Handler + + PUBWEAK IRQ092_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ092_Handler + B IRQ092_Handler + + PUBWEAK IRQ093_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ093_Handler + B IRQ093_Handler + + PUBWEAK IRQ094_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ094_Handler + B IRQ094_Handler + + PUBWEAK IRQ095_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ095_Handler + B IRQ095_Handler + + PUBWEAK IRQ096_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ096_Handler + B IRQ096_Handler + + PUBWEAK IRQ097_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ097_Handler + B IRQ097_Handler + + PUBWEAK IRQ098_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ098_Handler + B IRQ098_Handler + + PUBWEAK IRQ099_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ099_Handler + B IRQ099_Handler + + PUBWEAK IRQ100_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ100_Handler + B IRQ100_Handler + + PUBWEAK IRQ101_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ101_Handler + B IRQ101_Handler + + PUBWEAK IRQ102_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ102_Handler + B IRQ102_Handler + + PUBWEAK IRQ103_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ103_Handler + B IRQ103_Handler + + PUBWEAK IRQ104_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ104_Handler + B IRQ104_Handler + + PUBWEAK IRQ105_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ105_Handler + B IRQ105_Handler + + PUBWEAK IRQ106_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ106_Handler + B IRQ106_Handler + + PUBWEAK IRQ107_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ107_Handler + B IRQ107_Handler + + PUBWEAK IRQ108_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ108_Handler + B IRQ108_Handler + + PUBWEAK IRQ109_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ109_Handler + B IRQ109_Handler + + PUBWEAK IRQ110_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ110_Handler + B IRQ110_Handler + + PUBWEAK IRQ111_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ111_Handler + B IRQ111_Handler + + PUBWEAK IRQ112_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ112_Handler + B IRQ112_Handler + + PUBWEAK IRQ113_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ113_Handler + B IRQ113_Handler + + PUBWEAK IRQ114_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ114_Handler + B IRQ114_Handler + + PUBWEAK IRQ115_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ115_Handler + B IRQ115_Handler + + PUBWEAK IRQ116_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ116_Handler + B IRQ116_Handler + + PUBWEAK IRQ117_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ117_Handler + B IRQ117_Handler + + PUBWEAK IRQ118_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ118_Handler + B IRQ118_Handler + + PUBWEAK IRQ119_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ119_Handler + B IRQ119_Handler + + PUBWEAK IRQ120_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ120_Handler + B IRQ120_Handler + + PUBWEAK IRQ121_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ121_Handler + B IRQ121_Handler + + PUBWEAK IRQ122_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ122_Handler + B IRQ122_Handler + + PUBWEAK IRQ123_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ123_Handler + B IRQ123_Handler + + PUBWEAK IRQ124_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ124_Handler + B IRQ124_Handler + + PUBWEAK IRQ125_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ125_Handler + B IRQ125_Handler + + PUBWEAK IRQ126_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ126_Handler + B IRQ126_Handler + + PUBWEAK IRQ127_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ127_Handler + B IRQ127_Handler + + PUBWEAK IRQ128_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ128_Handler + B IRQ128_Handler + + PUBWEAK IRQ129_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ129_Handler + B IRQ129_Handler + + PUBWEAK IRQ130_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ130_Handler + B IRQ130_Handler + + PUBWEAK IRQ131_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ131_Handler + B IRQ131_Handler + + PUBWEAK IRQ132_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ132_Handler + B IRQ132_Handler + + PUBWEAK IRQ133_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ133_Handler + B IRQ133_Handler + + PUBWEAK IRQ134_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ134_Handler + B IRQ134_Handler + + PUBWEAK IRQ135_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ135_Handler + B IRQ135_Handler + + PUBWEAK IRQ136_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ136_Handler + B IRQ136_Handler + + PUBWEAK IRQ137_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ137_Handler + B IRQ137_Handler + + PUBWEAK IRQ138_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ138_Handler + B IRQ138_Handler + + PUBWEAK IRQ139_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ139_Handler + B IRQ139_Handler + + PUBWEAK IRQ140_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ140_Handler + B IRQ140_Handler + + PUBWEAK IRQ141_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ141_Handler + B IRQ141_Handler + + PUBWEAK IRQ142_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ142_Handler + B IRQ142_Handler + + PUBWEAK IRQ143_Handler + SECTION .text:CODE:NOROOT:REORDER(1) +IRQ143_Handler + B IRQ143_Handler + + END diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/system_hc32f4a0.c b/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/system_hc32f4a0.c new file mode 100644 index 0000000000..8ca8da5816 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Device/HDSC/HC32F4A0/Source/system_hc32f4a0.c @@ -0,0 +1,168 @@ +/** + ******************************************************************************* + * @file system_hc32f4a0.c + * @brief This file provides two functions and one global variable to be called + * from user application + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Zhangxl First version + 2020-07-03 Zhangxl Modify for 16MHz & 20MHz HRC + 2020-09-10 Zhangxl Simplify the declare + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" + +/** + * @addtogroup CMSIS + * @{ + */ + +/** + * @addtogroup HC32F4A0_System + * @{ + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('define') + ******************************************************************************/ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ +/** + * @addtogroup HC32F4A0_System_Global_Variable + * @{ + */ + +/*!< System clock frequency (Core clock) */ +__NO_INIT uint32_t SystemCoreClock; +/*!< High speed RC frequency (HCR clock) */ +__NO_INIT uint32_t HRC_VALUE; + +/** + * @} + */ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @addtogroup HC32F4A0_System_Global_Functions + * @{ + */ + +/** + * @brief Setup the microcontroller system. Initialize the System and update + * the SystemCoreClock variable. + * @param None + * @retval None + */ +void SystemInit(void) +{ + (*((volatile unsigned short*)(0x400543FEUL)))=0xA50BU; + (*((volatile unsigned int*)(0x4004CCE8UL)))=0x00040000UL; + (*((volatile unsigned short*)(0x400543FEUL)))=0xA500U; + /* FPU settings */ +#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) + SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */ +#endif + SystemCoreClockUpdate(); +} + +/** + * @brief Update SystemCoreClock variable according to Clock Register Values. + * @param None + * @retval None + */ +void SystemCoreClockUpdate(void) +{ + uint8_t tmp; + uint32_t plln; + uint32_t pllp; + uint32_t pllm; + + /* Select proper HRC_VALUE according to ICG1.HRCFREQSEL bit */ + /* ICG1.HRCFREQSEL = '0' represent HRC_VALUE = 20000000UL */ + /* ICG1.HRCFREQSEL = '1' represent HRC_VALUE = 16000000UL */ + if (1UL == (HRC_FREQ_MON() & 1UL)) + { + HRC_VALUE = HRC_16MHz_VALUE; + } + else + { + HRC_VALUE = HRC_20MHz_VALUE; + } + + tmp = M4_CMU->CKSWR & CMU_CKSWR_CKSW; + switch(tmp) + { + case 0x00U: /* use internal high speed RC */ + SystemCoreClock = HRC_VALUE; + break; + case 0x01U: /* use internal middle speed RC */ + SystemCoreClock = MRC_VALUE; + break; + case 0x02U: /* use internal low speed RC */ + SystemCoreClock = LRC_VALUE; + break; + case 0x03U: /* use external high speed OSC */ + SystemCoreClock = XTAL_VALUE; + break; + case 0x04U: /* use external low speed OSC */ + SystemCoreClock = XTAL32_VALUE; + break; + case 0x05U: /* use PLLH */ + /* PLLCLK = ((pllsrc / pllm) * plln) / pllp */ + pllp = (uint32_t)((M4_CMU->PLLHCFGR >> CMU_PLLHCFGR_PLLHP_POS) & 0x0FUL); + plln = (uint32_t)((M4_CMU->PLLHCFGR >> CMU_PLLHCFGR_PLLHN_POS) & 0xFFUL); + pllm = (uint32_t)((M4_CMU->PLLHCFGR >> CMU_PLLHCFGR_PLLHM_POS) & 0x03UL); + + /* use external high speed OSC as PLL source */ + if (0UL == bM4_CMU->PLLHCFGR_b.PLLSRC) + { + SystemCoreClock = (XTAL_VALUE) / (pllm + 1UL) * (plln + 1UL) / (pllp + 1UL); + } + /* use internal high RC as PLL source */ + else + { + SystemCoreClock = (HRC_VALUE) / (pllm + 1UL) * (plln + 1UL) / (pllp + 1UL); + } + break; + default: + break; + } +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_armcc.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_armcc.h new file mode 100644 index 0000000000..59f173ac71 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_armcc.h @@ -0,0 +1,894 @@ +/**************************************************************************//** + * @file cmsis_armcc.h + * @brief CMSIS compiler ARMCC (Arm Compiler 5) header file + * @version V5.1.0 + * @date 08. May 2019 + ******************************************************************************/ +/* + * Copyright (c) 2009-2019 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __CMSIS_ARMCC_H +#define __CMSIS_ARMCC_H + + +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 400677) + #error "Please use Arm Compiler Toolchain V4.0.677 or later!" +#endif + +/* CMSIS compiler control architecture macros */ +#if ((defined (__TARGET_ARCH_6_M ) && (__TARGET_ARCH_6_M == 1)) || \ + (defined (__TARGET_ARCH_6S_M ) && (__TARGET_ARCH_6S_M == 1)) ) + #define __ARM_ARCH_6M__ 1 +#endif + +#if (defined (__TARGET_ARCH_7_M ) && (__TARGET_ARCH_7_M == 1)) + #define __ARM_ARCH_7M__ 1 +#endif + +#if (defined (__TARGET_ARCH_7E_M) && (__TARGET_ARCH_7E_M == 1)) + #define __ARM_ARCH_7EM__ 1 +#endif + + /* __ARM_ARCH_8M_BASE__ not applicable */ + /* __ARM_ARCH_8M_MAIN__ not applicable */ + +/* CMSIS compiler control DSP macros */ +#if ((defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) + #define __ARM_FEATURE_DSP 1 +#endif + +/* CMSIS compiler specific defines */ +#ifndef __ASM + #define __ASM __asm +#endif +#ifndef __INLINE + #define __INLINE __inline +#endif +#ifndef __STATIC_INLINE + #define __STATIC_INLINE static __inline +#endif +#ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE static __forceinline +#endif +#ifndef __NO_RETURN + #define __NO_RETURN __declspec(noreturn) +#endif +#ifndef __USED + #define __USED __attribute__((used)) +#endif +#ifndef __WEAK + #define __WEAK __attribute__((weak)) +#endif +#ifndef __PACKED + #define __PACKED __attribute__((packed)) +#endif +#ifndef __PACKED_STRUCT + #define __PACKED_STRUCT __packed struct +#endif +#ifndef __PACKED_UNION + #define __PACKED_UNION __packed union +#endif +#ifndef __UNALIGNED_UINT32 /* deprecated */ + #define __UNALIGNED_UINT32(x) (*((__packed uint32_t *)(x))) +#endif +#ifndef __UNALIGNED_UINT16_WRITE + #define __UNALIGNED_UINT16_WRITE(addr, val) ((*((__packed uint16_t *)(addr))) = (val)) +#endif +#ifndef __UNALIGNED_UINT16_READ + #define __UNALIGNED_UINT16_READ(addr) (*((const __packed uint16_t *)(addr))) +#endif +#ifndef __UNALIGNED_UINT32_WRITE + #define __UNALIGNED_UINT32_WRITE(addr, val) ((*((__packed uint32_t *)(addr))) = (val)) +#endif +#ifndef __UNALIGNED_UINT32_READ + #define __UNALIGNED_UINT32_READ(addr) (*((const __packed uint32_t *)(addr))) +#endif +#ifndef __ALIGNED + #define __ALIGNED(x) __attribute__((aligned(x))) +#endif +#ifndef __RESTRICT + #define __RESTRICT __restrict +#endif +#ifndef __COMPILER_BARRIER + #define __COMPILER_BARRIER() __memory_changed() +#endif + +/* ######################### Startup and Lowlevel Init ######################## */ + +#ifndef __PROGRAM_START +#define __PROGRAM_START __main +#endif + +#ifndef __INITIAL_SP +#define __INITIAL_SP Image$$ARM_LIB_STACK$$ZI$$Limit +#endif + +#ifndef __STACK_LIMIT +#define __STACK_LIMIT Image$$ARM_LIB_STACK$$ZI$$Base +#endif + +#ifndef __VECTOR_TABLE +#define __VECTOR_TABLE __Vectors +#endif + +#ifndef __VECTOR_TABLE_ATTRIBUTE +#define __VECTOR_TABLE_ATTRIBUTE __attribute((used, section("RESET"))) +#endif + +/* ########################### Core Function Access ########################### */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions + @{ + */ + +/** + \brief Enable IRQ Interrupts + \details Enables IRQ interrupts by clearing the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +/* intrinsic void __enable_irq(); */ + + +/** + \brief Disable IRQ Interrupts + \details Disables IRQ interrupts by setting the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +/* intrinsic void __disable_irq(); */ + +/** + \brief Get Control Register + \details Returns the content of the Control Register. + \return Control Register value + */ +__STATIC_INLINE uint32_t __get_CONTROL(void) +{ + register uint32_t __regControl __ASM("control"); + return(__regControl); +} + + +/** + \brief Set Control Register + \details Writes the given value to the Control Register. + \param [in] control Control Register value to set + */ +__STATIC_INLINE void __set_CONTROL(uint32_t control) +{ + register uint32_t __regControl __ASM("control"); + __regControl = control; +} + + +/** + \brief Get IPSR Register + \details Returns the content of the IPSR Register. + \return IPSR Register value + */ +__STATIC_INLINE uint32_t __get_IPSR(void) +{ + register uint32_t __regIPSR __ASM("ipsr"); + return(__regIPSR); +} + + +/** + \brief Get APSR Register + \details Returns the content of the APSR Register. + \return APSR Register value + */ +__STATIC_INLINE uint32_t __get_APSR(void) +{ + register uint32_t __regAPSR __ASM("apsr"); + return(__regAPSR); +} + + +/** + \brief Get xPSR Register + \details Returns the content of the xPSR Register. + \return xPSR Register value + */ +__STATIC_INLINE uint32_t __get_xPSR(void) +{ + register uint32_t __regXPSR __ASM("xpsr"); + return(__regXPSR); +} + + +/** + \brief Get Process Stack Pointer + \details Returns the current value of the Process Stack Pointer (PSP). + \return PSP Register value + */ +__STATIC_INLINE uint32_t __get_PSP(void) +{ + register uint32_t __regProcessStackPointer __ASM("psp"); + return(__regProcessStackPointer); +} + + +/** + \brief Set Process Stack Pointer + \details Assigns the given value to the Process Stack Pointer (PSP). + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) +{ + register uint32_t __regProcessStackPointer __ASM("psp"); + __regProcessStackPointer = topOfProcStack; +} + + +/** + \brief Get Main Stack Pointer + \details Returns the current value of the Main Stack Pointer (MSP). + \return MSP Register value + */ +__STATIC_INLINE uint32_t __get_MSP(void) +{ + register uint32_t __regMainStackPointer __ASM("msp"); + return(__regMainStackPointer); +} + + +/** + \brief Set Main Stack Pointer + \details Assigns the given value to the Main Stack Pointer (MSP). + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__STATIC_INLINE void __set_MSP(uint32_t topOfMainStack) +{ + register uint32_t __regMainStackPointer __ASM("msp"); + __regMainStackPointer = topOfMainStack; +} + + +/** + \brief Get Priority Mask + \details Returns the current state of the priority mask bit from the Priority Mask Register. + \return Priority Mask value + */ +__STATIC_INLINE uint32_t __get_PRIMASK(void) +{ + register uint32_t __regPriMask __ASM("primask"); + return(__regPriMask); +} + + +/** + \brief Set Priority Mask + \details Assigns the given value to the Priority Mask Register. + \param [in] priMask Priority Mask + */ +__STATIC_INLINE void __set_PRIMASK(uint32_t priMask) +{ + register uint32_t __regPriMask __ASM("primask"); + __regPriMask = (priMask); +} + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) + +/** + \brief Enable FIQ + \details Enables FIQ interrupts by clearing the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +#define __enable_fault_irq __enable_fiq + + +/** + \brief Disable FIQ + \details Disables FIQ interrupts by setting the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +#define __disable_fault_irq __disable_fiq + + +/** + \brief Get Base Priority + \details Returns the current value of the Base Priority register. + \return Base Priority register value + */ +__STATIC_INLINE uint32_t __get_BASEPRI(void) +{ + register uint32_t __regBasePri __ASM("basepri"); + return(__regBasePri); +} + + +/** + \brief Set Base Priority + \details Assigns the given value to the Base Priority register. + \param [in] basePri Base Priority value to set + */ +__STATIC_INLINE void __set_BASEPRI(uint32_t basePri) +{ + register uint32_t __regBasePri __ASM("basepri"); + __regBasePri = (basePri & 0xFFU); +} + + +/** + \brief Set Base Priority with condition + \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, + or the new value increases the BASEPRI priority level. + \param [in] basePri Base Priority value to set + */ +__STATIC_INLINE void __set_BASEPRI_MAX(uint32_t basePri) +{ + register uint32_t __regBasePriMax __ASM("basepri_max"); + __regBasePriMax = (basePri & 0xFFU); +} + + +/** + \brief Get Fault Mask + \details Returns the current value of the Fault Mask register. + \return Fault Mask register value + */ +__STATIC_INLINE uint32_t __get_FAULTMASK(void) +{ + register uint32_t __regFaultMask __ASM("faultmask"); + return(__regFaultMask); +} + + +/** + \brief Set Fault Mask + \details Assigns the given value to the Fault Mask register. + \param [in] faultMask Fault Mask value to set + */ +__STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask) +{ + register uint32_t __regFaultMask __ASM("faultmask"); + __regFaultMask = (faultMask & (uint32_t)1U); +} + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ + + +/** + \brief Get FPSCR + \details Returns the current value of the Floating Point Status/Control register. + \return Floating Point Status/Control register value + */ +__STATIC_INLINE uint32_t __get_FPSCR(void) +{ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) + register uint32_t __regfpscr __ASM("fpscr"); + return(__regfpscr); +#else + return(0U); +#endif +} + + +/** + \brief Set FPSCR + \details Assigns the given value to the Floating Point Status/Control register. + \param [in] fpscr Floating Point Status/Control value to set + */ +__STATIC_INLINE void __set_FPSCR(uint32_t fpscr) +{ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) + register uint32_t __regfpscr __ASM("fpscr"); + __regfpscr = (fpscr); +#else + (void)fpscr; +#endif +} + + +/*@} end of CMSIS_Core_RegAccFunctions */ + + +/* ########################## Core Instruction Access ######################### */ +/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface + Access to dedicated instructions + @{ +*/ + +/** + \brief No Operation + \details No Operation does nothing. This instruction can be used for code alignment purposes. + */ +#define __NOP __nop + + +/** + \brief Wait For Interrupt + \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. + */ +#define __WFI __wfi + + +/** + \brief Wait For Event + \details Wait For Event is a hint instruction that permits the processor to enter + a low-power state until one of a number of events occurs. + */ +#define __WFE __wfe + + +/** + \brief Send Event + \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. + */ +#define __SEV __sev + + +/** + \brief Instruction Synchronization Barrier + \details Instruction Synchronization Barrier flushes the pipeline in the processor, + so that all instructions following the ISB are fetched from cache or memory, + after the instruction has been completed. + */ +#define __ISB() do {\ + __schedule_barrier();\ + __isb(0xF);\ + __schedule_barrier();\ + } while (0U) + +/** + \brief Data Synchronization Barrier + \details Acts as a special kind of Data Memory Barrier. + It completes when all explicit memory accesses before this instruction complete. + */ +#define __DSB() do {\ + __schedule_barrier();\ + __dsb(0xF);\ + __schedule_barrier();\ + } while (0U) + +/** + \brief Data Memory Barrier + \details Ensures the apparent order of the explicit memory operations before + and after the instruction, without ensuring their completion. + */ +#define __DMB() do {\ + __schedule_barrier();\ + __dmb(0xF);\ + __schedule_barrier();\ + } while (0U) + + +/** + \brief Reverse byte order (32 bit) + \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. + \param [in] value Value to reverse + \return Reversed value + */ +#define __REV __rev + + +/** + \brief Reverse byte order (16 bit) + \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. + \param [in] value Value to reverse + \return Reversed value + */ +#ifndef __NO_EMBEDDED_ASM +__attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value) +{ + rev16 r0, r0 + bx lr +} +#endif + + +/** + \brief Reverse byte order (16 bit) + \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. + \param [in] value Value to reverse + \return Reversed value + */ +#ifndef __NO_EMBEDDED_ASM +__attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int16_t __REVSH(int16_t value) +{ + revsh r0, r0 + bx lr +} +#endif + + +/** + \brief Rotate Right in unsigned value (32 bit) + \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. + \param [in] op1 Value to rotate + \param [in] op2 Number of Bits to rotate + \return Rotated value + */ +#define __ROR __ror + + +/** + \brief Breakpoint + \details Causes the processor to enter Debug state. + Debug tools can use this to investigate system state when the instruction at a particular address is reached. + \param [in] value is ignored by the processor. + If required, a debugger can use it to store additional information about the breakpoint. + */ +#define __BKPT(value) __breakpoint(value) + + +/** + \brief Reverse bit order of value + \details Reverses the bit order of the given value. + \param [in] value Value to reverse + \return Reversed value + */ +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) + #define __RBIT __rbit +#else +__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) +{ + uint32_t result; + uint32_t s = (4U /*sizeof(v)*/ * 8U) - 1U; /* extra shift needed at end */ + + result = value; /* r will be reversed bits of v; first get LSB of v */ + for (value >>= 1U; value != 0U; value >>= 1U) + { + result <<= 1U; + result |= value & 1U; + s--; + } + result <<= s; /* shift when v's highest bits are zero */ + return result; +} +#endif + + +/** + \brief Count leading zeros + \details Counts the number of leading zeros of a data value. + \param [in] value Value to count the leading zeros + \return number of leading zeros in value + */ +#define __CLZ __clz + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) + +/** + \brief LDR Exclusive (8 bit) + \details Executes a exclusive LDR instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __LDREXB(ptr) ((uint8_t ) __ldrex(ptr)) +#else + #define __LDREXB(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint8_t ) __ldrex(ptr)) _Pragma("pop") +#endif + + +/** + \brief LDR Exclusive (16 bit) + \details Executes a exclusive LDR instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __LDREXH(ptr) ((uint16_t) __ldrex(ptr)) +#else + #define __LDREXH(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint16_t) __ldrex(ptr)) _Pragma("pop") +#endif + + +/** + \brief LDR Exclusive (32 bit) + \details Executes a exclusive LDR instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __LDREXW(ptr) ((uint32_t ) __ldrex(ptr)) +#else + #define __LDREXW(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint32_t ) __ldrex(ptr)) _Pragma("pop") +#endif + + +/** + \brief STR Exclusive (8 bit) + \details Executes a exclusive STR instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __STREXB(value, ptr) __strex(value, ptr) +#else + #define __STREXB(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop") +#endif + + +/** + \brief STR Exclusive (16 bit) + \details Executes a exclusive STR instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __STREXH(value, ptr) __strex(value, ptr) +#else + #define __STREXH(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop") +#endif + + +/** + \brief STR Exclusive (32 bit) + \details Executes a exclusive STR instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __STREXW(value, ptr) __strex(value, ptr) +#else + #define __STREXW(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop") +#endif + + +/** + \brief Remove the exclusive lock + \details Removes the exclusive lock which is created by LDREX. + */ +#define __CLREX __clrex + + +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +#define __SSAT __ssat + + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +#define __USAT __usat + + +/** + \brief Rotate Right with Extend (32 bit) + \details Moves each bit of a bitstring right by one bit. + The carry input is shifted in at the left end of the bitstring. + \param [in] value Value to rotate + \return Rotated value + */ +#ifndef __NO_EMBEDDED_ASM +__attribute__((section(".rrx_text"))) __STATIC_INLINE __ASM uint32_t __RRX(uint32_t value) +{ + rrx r0, r0 + bx lr +} +#endif + + +/** + \brief LDRT Unprivileged (8 bit) + \details Executes a Unprivileged LDRT instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +#define __LDRBT(ptr) ((uint8_t ) __ldrt(ptr)) + + +/** + \brief LDRT Unprivileged (16 bit) + \details Executes a Unprivileged LDRT instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +#define __LDRHT(ptr) ((uint16_t) __ldrt(ptr)) + + +/** + \brief LDRT Unprivileged (32 bit) + \details Executes a Unprivileged LDRT instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +#define __LDRT(ptr) ((uint32_t ) __ldrt(ptr)) + + +/** + \brief STRT Unprivileged (8 bit) + \details Executes a Unprivileged STRT instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +#define __STRBT(value, ptr) __strt(value, ptr) + + +/** + \brief STRT Unprivileged (16 bit) + \details Executes a Unprivileged STRT instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +#define __STRHT(value, ptr) __strt(value, ptr) + + +/** + \brief STRT Unprivileged (32 bit) + \details Executes a Unprivileged STRT instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +#define __STRT(value, ptr) __strt(value, ptr) + +#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ + +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +__attribute__((always_inline)) __STATIC_INLINE int32_t __SSAT(int32_t val, uint32_t sat) +{ + if ((sat >= 1U) && (sat <= 32U)) + { + const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); + const int32_t min = -1 - max ; + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + } + return val; +} + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __USAT(int32_t val, uint32_t sat) +{ + if (sat <= 31U) + { + const uint32_t max = ((1U << sat) - 1U); + if (val > (int32_t)max) + { + return max; + } + else if (val < 0) + { + return 0U; + } + } + return (uint32_t)val; +} + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ + +/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ + + +/* ################### Compiler specific Intrinsics ########################### */ +/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics + Access to dedicated SIMD instructions + @{ +*/ + +#if ((defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) + +#define __SADD8 __sadd8 +#define __QADD8 __qadd8 +#define __SHADD8 __shadd8 +#define __UADD8 __uadd8 +#define __UQADD8 __uqadd8 +#define __UHADD8 __uhadd8 +#define __SSUB8 __ssub8 +#define __QSUB8 __qsub8 +#define __SHSUB8 __shsub8 +#define __USUB8 __usub8 +#define __UQSUB8 __uqsub8 +#define __UHSUB8 __uhsub8 +#define __SADD16 __sadd16 +#define __QADD16 __qadd16 +#define __SHADD16 __shadd16 +#define __UADD16 __uadd16 +#define __UQADD16 __uqadd16 +#define __UHADD16 __uhadd16 +#define __SSUB16 __ssub16 +#define __QSUB16 __qsub16 +#define __SHSUB16 __shsub16 +#define __USUB16 __usub16 +#define __UQSUB16 __uqsub16 +#define __UHSUB16 __uhsub16 +#define __SASX __sasx +#define __QASX __qasx +#define __SHASX __shasx +#define __UASX __uasx +#define __UQASX __uqasx +#define __UHASX __uhasx +#define __SSAX __ssax +#define __QSAX __qsax +#define __SHSAX __shsax +#define __USAX __usax +#define __UQSAX __uqsax +#define __UHSAX __uhsax +#define __USAD8 __usad8 +#define __USADA8 __usada8 +#define __SSAT16 __ssat16 +#define __USAT16 __usat16 +#define __UXTB16 __uxtb16 +#define __UXTAB16 __uxtab16 +#define __SXTB16 __sxtb16 +#define __SXTAB16 __sxtab16 +#define __SMUAD __smuad +#define __SMUADX __smuadx +#define __SMLAD __smlad +#define __SMLADX __smladx +#define __SMLALD __smlald +#define __SMLALDX __smlaldx +#define __SMUSD __smusd +#define __SMUSDX __smusdx +#define __SMLSD __smlsd +#define __SMLSDX __smlsdx +#define __SMLSLD __smlsld +#define __SMLSLDX __smlsldx +#define __SEL __sel +#define __QADD __qadd +#define __QSUB __qsub + +#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \ + ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) + +#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \ + ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) + +#define __SMMLA(ARG1,ARG2,ARG3) ( (int32_t)((((int64_t)(ARG1) * (ARG2)) + \ + ((int64_t)(ARG3) << 32U) ) >> 32U)) + +#endif /* ((defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ +/*@} end of group CMSIS_SIMD_intrinsics */ + + +#endif /* __CMSIS_ARMCC_H */ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_armclang.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_armclang.h new file mode 100644 index 0000000000..e917f357a3 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_armclang.h @@ -0,0 +1,1444 @@ +/**************************************************************************//** + * @file cmsis_armclang.h + * @brief CMSIS compiler armclang (Arm Compiler 6) header file + * @version V5.2.0 + * @date 08. May 2019 + ******************************************************************************/ +/* + * Copyright (c) 2009-2019 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*lint -esym(9058, IRQn)*/ /* disable MISRA 2012 Rule 2.4 for IRQn */ + +#ifndef __CMSIS_ARMCLANG_H +#define __CMSIS_ARMCLANG_H + +#pragma clang system_header /* treat file as system include file */ + +#ifndef __ARM_COMPAT_H +#include /* Compatibility header for Arm Compiler 5 intrinsics */ +#endif + +/* CMSIS compiler specific defines */ +#ifndef __ASM + #define __ASM __asm +#endif +#ifndef __INLINE + #define __INLINE __inline +#endif +#ifndef __STATIC_INLINE + #define __STATIC_INLINE static __inline +#endif +#ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE __attribute__((always_inline)) static __inline +#endif +#ifndef __NO_RETURN + #define __NO_RETURN __attribute__((__noreturn__)) +#endif +#ifndef __USED + #define __USED __attribute__((used)) +#endif +#ifndef __WEAK + #define __WEAK __attribute__((weak)) +#endif +#ifndef __PACKED + #define __PACKED __attribute__((packed, aligned(1))) +#endif +#ifndef __PACKED_STRUCT + #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) +#endif +#ifndef __PACKED_UNION + #define __PACKED_UNION union __attribute__((packed, aligned(1))) +#endif +#ifndef __UNALIGNED_UINT32 /* deprecated */ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT32)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32 */ + struct __attribute__((packed)) T_UINT32 { uint32_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) +#endif +#ifndef __UNALIGNED_UINT16_WRITE + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT16_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_WRITE */ + __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) +#endif +#ifndef __UNALIGNED_UINT16_READ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT16_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_READ */ + __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) +#endif +#ifndef __UNALIGNED_UINT32_WRITE + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT32_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_WRITE */ + __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) +#endif +#ifndef __UNALIGNED_UINT32_READ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT32_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_READ */ + __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) +#endif +#ifndef __ALIGNED + #define __ALIGNED(x) __attribute__((aligned(x))) +#endif +#ifndef __RESTRICT + #define __RESTRICT __restrict +#endif +#ifndef __COMPILER_BARRIER + #define __COMPILER_BARRIER() __ASM volatile("":::"memory") +#endif + +/* ######################### Startup and Lowlevel Init ######################## */ + +#ifndef __PROGRAM_START +#define __PROGRAM_START __main +#endif + +#ifndef __INITIAL_SP +#define __INITIAL_SP Image$$ARM_LIB_STACK$$ZI$$Limit +#endif + +#ifndef __STACK_LIMIT +#define __STACK_LIMIT Image$$ARM_LIB_STACK$$ZI$$Base +#endif + +#ifndef __VECTOR_TABLE +#define __VECTOR_TABLE __Vectors +#endif + +#ifndef __VECTOR_TABLE_ATTRIBUTE +#define __VECTOR_TABLE_ATTRIBUTE __attribute((used, section("RESET"))) +#endif + +/* ########################### Core Function Access ########################### */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions + @{ + */ + +/** + \brief Enable IRQ Interrupts + \details Enables IRQ interrupts by clearing the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +/* intrinsic void __enable_irq(); see arm_compat.h */ + + +/** + \brief Disable IRQ Interrupts + \details Disables IRQ interrupts by setting the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +/* intrinsic void __disable_irq(); see arm_compat.h */ + + +/** + \brief Get Control Register + \details Returns the content of the Control Register. + \return Control Register value + */ +__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Control Register (non-secure) + \details Returns the content of the non-secure Control Register when in secure mode. + \return non-secure Control Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Control Register + \details Writes the given value to the Control Register. + \param [in] control Control Register value to set + */ +__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) +{ + __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Control Register (non-secure) + \details Writes the given value to the non-secure Control Register when in secure state. + \param [in] control Control Register value to set + */ +__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) +{ + __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); +} +#endif + + +/** + \brief Get IPSR Register + \details Returns the content of the IPSR Register. + \return IPSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_IPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get APSR Register + \details Returns the content of the APSR Register. + \return APSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_APSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, apsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get xPSR Register + \details Returns the content of the xPSR Register. + \return xPSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_xPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get Process Stack Pointer + \details Returns the current value of the Process Stack Pointer (PSP). + \return PSP Register value + */ +__STATIC_FORCEINLINE uint32_t __get_PSP(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, psp" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Process Stack Pointer (non-secure) + \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. + \return PSP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Process Stack Pointer + \details Assigns the given value to the Process Stack Pointer (PSP). + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Process Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); +} +#endif + + +/** + \brief Get Main Stack Pointer + \details Returns the current value of the Main Stack Pointer (MSP). + \return MSP Register value + */ +__STATIC_FORCEINLINE uint32_t __get_MSP(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, msp" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Main Stack Pointer (non-secure) + \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. + \return MSP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Main Stack Pointer + \details Assigns the given value to the Main Stack Pointer (MSP). + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Main Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); +} +#endif + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Stack Pointer (non-secure) + \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. + \return SP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); + return(result); +} + + +/** + \brief Set Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. + \param [in] topOfStack Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) +{ + __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); +} +#endif + + +/** + \brief Get Priority Mask + \details Returns the current state of the priority mask bit from the Priority Mask Register. + \return Priority Mask value + */ +__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Priority Mask (non-secure) + \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. + \return Priority Mask value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Priority Mask + \details Assigns the given value to the Priority Mask Register. + \param [in] priMask Priority Mask + */ +__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) +{ + __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Priority Mask (non-secure) + \details Assigns the given value to the non-secure Priority Mask Register when in secure state. + \param [in] priMask Priority Mask + */ +__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) +{ + __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); +} +#endif + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) +/** + \brief Enable FIQ + \details Enables FIQ interrupts by clearing the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +#define __enable_fault_irq __enable_fiq /* see arm_compat.h */ + + +/** + \brief Disable FIQ + \details Disables FIQ interrupts by setting the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +#define __disable_fault_irq __disable_fiq /* see arm_compat.h */ + + +/** + \brief Get Base Priority + \details Returns the current value of the Base Priority register. + \return Base Priority register value + */ +__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, basepri" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Base Priority (non-secure) + \details Returns the current value of the non-secure Base Priority register when in secure state. + \return Base Priority register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Base Priority + \details Assigns the given value to the Base Priority register. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) +{ + __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Base Priority (non-secure) + \details Assigns the given value to the non-secure Base Priority register when in secure state. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) +{ + __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); +} +#endif + + +/** + \brief Set Base Priority with condition + \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, + or the new value increases the BASEPRI priority level. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) +{ + __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); +} + + +/** + \brief Get Fault Mask + \details Returns the current value of the Fault Mask register. + \return Fault Mask register value + */ +__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Fault Mask (non-secure) + \details Returns the current value of the non-secure Fault Mask register when in secure state. + \return Fault Mask register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Fault Mask + \details Assigns the given value to the Fault Mask register. + \param [in] faultMask Fault Mask value to set + */ +__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) +{ + __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Fault Mask (non-secure) + \details Assigns the given value to the non-secure Fault Mask register when in secure state. + \param [in] faultMask Fault Mask value to set + */ +__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) +{ + __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); +} +#endif + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) + +/** + \brief Get Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). + \return PSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, psplim" : "=r" (result) ); + return result; +#endif +} + +#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Process Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \return PSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); + return result; +#endif +} +#endif + + +/** + \brief Set Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Process Stack Pointer (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); +#endif +} +#endif + + +/** + \brief Get Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). + \return MSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim" : "=r" (result) ); + return result; +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. + \return MSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); + return result; +#endif +} +#endif + + +/** + \brief Set Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. + + \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). + \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. + + \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. + \param [in] MainStackPtrLimit Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); +#endif +} +#endif + +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + +/** + \brief Get FPSCR + \details Returns the current value of the Floating Point Status/Control register. + \return Floating Point Status/Control register value + */ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#define __get_FPSCR (uint32_t)__builtin_arm_get_fpscr +#else +#define __get_FPSCR() ((uint32_t)0U) +#endif + +/** + \brief Set FPSCR + \details Assigns the given value to the Floating Point Status/Control register. + \param [in] fpscr Floating Point Status/Control value to set + */ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#define __set_FPSCR __builtin_arm_set_fpscr +#else +#define __set_FPSCR(x) ((void)(x)) +#endif + + +/*@} end of CMSIS_Core_RegAccFunctions */ + + +/* ########################## Core Instruction Access ######################### */ +/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface + Access to dedicated instructions + @{ +*/ + +/* Define macros for porting to both thumb1 and thumb2. + * For thumb1, use low register (r0-r7), specified by constraint "l" + * Otherwise, use general registers, specified by constraint "r" */ +#if defined (__thumb__) && !defined (__thumb2__) +#define __CMSIS_GCC_OUT_REG(r) "=l" (r) +#define __CMSIS_GCC_RW_REG(r) "+l" (r) +#define __CMSIS_GCC_USE_REG(r) "l" (r) +#else +#define __CMSIS_GCC_OUT_REG(r) "=r" (r) +#define __CMSIS_GCC_RW_REG(r) "+r" (r) +#define __CMSIS_GCC_USE_REG(r) "r" (r) +#endif + +/** + \brief No Operation + \details No Operation does nothing. This instruction can be used for code alignment purposes. + */ +#define __NOP __builtin_arm_nop + +/** + \brief Wait For Interrupt + \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. + */ +#define __WFI __builtin_arm_wfi + + +/** + \brief Wait For Event + \details Wait For Event is a hint instruction that permits the processor to enter + a low-power state until one of a number of events occurs. + */ +#define __WFE __builtin_arm_wfe + + +/** + \brief Send Event + \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. + */ +#define __SEV __builtin_arm_sev + + +/** + \brief Instruction Synchronization Barrier + \details Instruction Synchronization Barrier flushes the pipeline in the processor, + so that all instructions following the ISB are fetched from cache or memory, + after the instruction has been completed. + */ +#define __ISB() __builtin_arm_isb(0xF) + +/** + \brief Data Synchronization Barrier + \details Acts as a special kind of Data Memory Barrier. + It completes when all explicit memory accesses before this instruction complete. + */ +#define __DSB() __builtin_arm_dsb(0xF) + + +/** + \brief Data Memory Barrier + \details Ensures the apparent order of the explicit memory operations before + and after the instruction, without ensuring their completion. + */ +#define __DMB() __builtin_arm_dmb(0xF) + + +/** + \brief Reverse byte order (32 bit) + \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. + \param [in] value Value to reverse + \return Reversed value + */ +#define __REV(value) __builtin_bswap32(value) + + +/** + \brief Reverse byte order (16 bit) + \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. + \param [in] value Value to reverse + \return Reversed value + */ +#define __REV16(value) __ROR(__REV(value), 16) + + +/** + \brief Reverse byte order (16 bit) + \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. + \param [in] value Value to reverse + \return Reversed value + */ +#define __REVSH(value) (int16_t)__builtin_bswap16(value) + + +/** + \brief Rotate Right in unsigned value (32 bit) + \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. + \param [in] op1 Value to rotate + \param [in] op2 Number of Bits to rotate + \return Rotated value + */ +__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) +{ + op2 %= 32U; + if (op2 == 0U) + { + return op1; + } + return (op1 >> op2) | (op1 << (32U - op2)); +} + + +/** + \brief Breakpoint + \details Causes the processor to enter Debug state. + Debug tools can use this to investigate system state when the instruction at a particular address is reached. + \param [in] value is ignored by the processor. + If required, a debugger can use it to store additional information about the breakpoint. + */ +#define __BKPT(value) __ASM volatile ("bkpt "#value) + + +/** + \brief Reverse bit order of value + \details Reverses the bit order of the given value. + \param [in] value Value to reverse + \return Reversed value + */ +#define __RBIT __builtin_arm_rbit + +/** + \brief Count leading zeros + \details Counts the number of leading zeros of a data value. + \param [in] value Value to count the leading zeros + \return number of leading zeros in value + */ +__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value) +{ + /* Even though __builtin_clz produces a CLZ instruction on ARM, formally + __builtin_clz(0) is undefined behaviour, so handle this case specially. + This guarantees ARM-compatible results if happening to compile on a non-ARM + target, and ensures the compiler doesn't decide to activate any + optimisations using the logic "value was passed to __builtin_clz, so it + is non-zero". + ARM Compiler 6.10 and possibly earlier will optimise this test away, leaving a + single CLZ instruction. + */ + if (value == 0U) + { + return 32U; + } + return __builtin_clz(value); +} + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +/** + \brief LDR Exclusive (8 bit) + \details Executes a exclusive LDR instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +#define __LDREXB (uint8_t)__builtin_arm_ldrex + + +/** + \brief LDR Exclusive (16 bit) + \details Executes a exclusive LDR instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +#define __LDREXH (uint16_t)__builtin_arm_ldrex + + +/** + \brief LDR Exclusive (32 bit) + \details Executes a exclusive LDR instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +#define __LDREXW (uint32_t)__builtin_arm_ldrex + + +/** + \brief STR Exclusive (8 bit) + \details Executes a exclusive STR instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STREXB (uint32_t)__builtin_arm_strex + + +/** + \brief STR Exclusive (16 bit) + \details Executes a exclusive STR instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STREXH (uint32_t)__builtin_arm_strex + + +/** + \brief STR Exclusive (32 bit) + \details Executes a exclusive STR instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STREXW (uint32_t)__builtin_arm_strex + + +/** + \brief Remove the exclusive lock + \details Removes the exclusive lock which is created by LDREX. + */ +#define __CLREX __builtin_arm_clrex + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) + +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +#define __SSAT __builtin_arm_ssat + + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +#define __USAT __builtin_arm_usat + + +/** + \brief Rotate Right with Extend (32 bit) + \details Moves each bit of a bitstring right by one bit. + The carry input is shifted in at the left end of the bitstring. + \param [in] value Value to rotate + \return Rotated value + */ +__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) +{ + uint32_t result; + + __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return(result); +} + + +/** + \brief LDRT Unprivileged (8 bit) + \details Executes a Unprivileged LDRT instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint8_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDRT Unprivileged (16 bit) + \details Executes a Unprivileged LDRT instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint16_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDRT Unprivileged (32 bit) + \details Executes a Unprivileged LDRT instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); + return(result); +} + + +/** + \brief STRT Unprivileged (8 bit) + \details Executes a Unprivileged STRT instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) +{ + __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief STRT Unprivileged (16 bit) + \details Executes a Unprivileged STRT instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) +{ + __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief STRT Unprivileged (32 bit) + \details Executes a Unprivileged STRT instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) +{ + __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); +} + +#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) +{ + if ((sat >= 1U) && (sat <= 32U)) + { + const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); + const int32_t min = -1 - max ; + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + } + return val; +} + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) +{ + if (sat <= 31U) + { + const uint32_t max = ((1U << sat) - 1U); + if (val > (int32_t)max) + { + return max; + } + else if (val < 0) + { + return 0U; + } + } + return (uint32_t)val; +} + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +/** + \brief Load-Acquire (8 bit) + \details Executes a LDAB instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint8_t) result); +} + + +/** + \brief Load-Acquire (16 bit) + \details Executes a LDAH instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint16_t) result); +} + + +/** + \brief Load-Acquire (32 bit) + \details Executes a LDA instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) ); + return(result); +} + + +/** + \brief Store-Release (8 bit) + \details Executes a STLB instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) +{ + __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief Store-Release (16 bit) + \details Executes a STLH instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) +{ + __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief Store-Release (32 bit) + \details Executes a STL instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) +{ + __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief Load-Acquire Exclusive (8 bit) + \details Executes a LDAB exclusive instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +#define __LDAEXB (uint8_t)__builtin_arm_ldaex + + +/** + \brief Load-Acquire Exclusive (16 bit) + \details Executes a LDAH exclusive instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +#define __LDAEXH (uint16_t)__builtin_arm_ldaex + + +/** + \brief Load-Acquire Exclusive (32 bit) + \details Executes a LDA exclusive instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +#define __LDAEX (uint32_t)__builtin_arm_ldaex + + +/** + \brief Store-Release Exclusive (8 bit) + \details Executes a STLB exclusive instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STLEXB (uint32_t)__builtin_arm_stlex + + +/** + \brief Store-Release Exclusive (16 bit) + \details Executes a STLH exclusive instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STLEXH (uint32_t)__builtin_arm_stlex + + +/** + \brief Store-Release Exclusive (32 bit) + \details Executes a STL exclusive instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STLEX (uint32_t)__builtin_arm_stlex + +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + +/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ + + +/* ################### Compiler specific Intrinsics ########################### */ +/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics + Access to dedicated SIMD instructions + @{ +*/ + +#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)) + +#define __SADD8 __builtin_arm_sadd8 +#define __QADD8 __builtin_arm_qadd8 +#define __SHADD8 __builtin_arm_shadd8 +#define __UADD8 __builtin_arm_uadd8 +#define __UQADD8 __builtin_arm_uqadd8 +#define __UHADD8 __builtin_arm_uhadd8 +#define __SSUB8 __builtin_arm_ssub8 +#define __QSUB8 __builtin_arm_qsub8 +#define __SHSUB8 __builtin_arm_shsub8 +#define __USUB8 __builtin_arm_usub8 +#define __UQSUB8 __builtin_arm_uqsub8 +#define __UHSUB8 __builtin_arm_uhsub8 +#define __SADD16 __builtin_arm_sadd16 +#define __QADD16 __builtin_arm_qadd16 +#define __SHADD16 __builtin_arm_shadd16 +#define __UADD16 __builtin_arm_uadd16 +#define __UQADD16 __builtin_arm_uqadd16 +#define __UHADD16 __builtin_arm_uhadd16 +#define __SSUB16 __builtin_arm_ssub16 +#define __QSUB16 __builtin_arm_qsub16 +#define __SHSUB16 __builtin_arm_shsub16 +#define __USUB16 __builtin_arm_usub16 +#define __UQSUB16 __builtin_arm_uqsub16 +#define __UHSUB16 __builtin_arm_uhsub16 +#define __SASX __builtin_arm_sasx +#define __QASX __builtin_arm_qasx +#define __SHASX __builtin_arm_shasx +#define __UASX __builtin_arm_uasx +#define __UQASX __builtin_arm_uqasx +#define __UHASX __builtin_arm_uhasx +#define __SSAX __builtin_arm_ssax +#define __QSAX __builtin_arm_qsax +#define __SHSAX __builtin_arm_shsax +#define __USAX __builtin_arm_usax +#define __UQSAX __builtin_arm_uqsax +#define __UHSAX __builtin_arm_uhsax +#define __USAD8 __builtin_arm_usad8 +#define __USADA8 __builtin_arm_usada8 +#define __SSAT16 __builtin_arm_ssat16 +#define __USAT16 __builtin_arm_usat16 +#define __UXTB16 __builtin_arm_uxtb16 +#define __UXTAB16 __builtin_arm_uxtab16 +#define __SXTB16 __builtin_arm_sxtb16 +#define __SXTAB16 __builtin_arm_sxtab16 +#define __SMUAD __builtin_arm_smuad +#define __SMUADX __builtin_arm_smuadx +#define __SMLAD __builtin_arm_smlad +#define __SMLADX __builtin_arm_smladx +#define __SMLALD __builtin_arm_smlald +#define __SMLALDX __builtin_arm_smlaldx +#define __SMUSD __builtin_arm_smusd +#define __SMUSDX __builtin_arm_smusdx +#define __SMLSD __builtin_arm_smlsd +#define __SMLSDX __builtin_arm_smlsdx +#define __SMLSLD __builtin_arm_smlsld +#define __SMLSLDX __builtin_arm_smlsldx +#define __SEL __builtin_arm_sel +#define __QADD __builtin_arm_qadd +#define __QSUB __builtin_arm_qsub + +#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \ + ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) + +#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \ + ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) + +__STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) +{ + int32_t result; + + __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +#endif /* (__ARM_FEATURE_DSP == 1) */ +/*@} end of group CMSIS_SIMD_intrinsics */ + + +#endif /* __CMSIS_ARMCLANG_H */ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_armclang_ltm.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_armclang_ltm.h new file mode 100644 index 0000000000..feec324059 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_armclang_ltm.h @@ -0,0 +1,1891 @@ +/**************************************************************************//** + * @file cmsis_armclang_ltm.h + * @brief CMSIS compiler armclang (Arm Compiler 6) header file + * @version V1.2.0 + * @date 08. May 2019 + ******************************************************************************/ +/* + * Copyright (c) 2018-2019 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*lint -esym(9058, IRQn)*/ /* disable MISRA 2012 Rule 2.4 for IRQn */ + +#ifndef __CMSIS_ARMCLANG_H +#define __CMSIS_ARMCLANG_H + +#pragma clang system_header /* treat file as system include file */ + +#ifndef __ARM_COMPAT_H +#include /* Compatibility header for Arm Compiler 5 intrinsics */ +#endif + +/* CMSIS compiler specific defines */ +#ifndef __ASM + #define __ASM __asm +#endif +#ifndef __INLINE + #define __INLINE __inline +#endif +#ifndef __STATIC_INLINE + #define __STATIC_INLINE static __inline +#endif +#ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE __attribute__((always_inline)) static __inline +#endif +#ifndef __NO_RETURN + #define __NO_RETURN __attribute__((__noreturn__)) +#endif +#ifndef __USED + #define __USED __attribute__((used)) +#endif +#ifndef __WEAK + #define __WEAK __attribute__((weak)) +#endif +#ifndef __PACKED + #define __PACKED __attribute__((packed, aligned(1))) +#endif +#ifndef __PACKED_STRUCT + #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) +#endif +#ifndef __PACKED_UNION + #define __PACKED_UNION union __attribute__((packed, aligned(1))) +#endif +#ifndef __UNALIGNED_UINT32 /* deprecated */ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT32)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32 */ + struct __attribute__((packed)) T_UINT32 { uint32_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) +#endif +#ifndef __UNALIGNED_UINT16_WRITE + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT16_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_WRITE */ + __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) +#endif +#ifndef __UNALIGNED_UINT16_READ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT16_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_READ */ + __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) +#endif +#ifndef __UNALIGNED_UINT32_WRITE + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT32_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_WRITE */ + __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) +#endif +#ifndef __UNALIGNED_UINT32_READ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT32_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_READ */ + __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) +#endif +#ifndef __ALIGNED + #define __ALIGNED(x) __attribute__((aligned(x))) +#endif +#ifndef __RESTRICT + #define __RESTRICT __restrict +#endif +#ifndef __COMPILER_BARRIER + #define __COMPILER_BARRIER() __ASM volatile("":::"memory") +#endif + +/* ######################### Startup and Lowlevel Init ######################## */ + +#ifndef __PROGRAM_START +#define __PROGRAM_START __main +#endif + +#ifndef __INITIAL_SP +#define __INITIAL_SP Image$$ARM_LIB_STACK$$ZI$$Limit +#endif + +#ifndef __STACK_LIMIT +#define __STACK_LIMIT Image$$ARM_LIB_STACK$$ZI$$Base +#endif + +#ifndef __VECTOR_TABLE +#define __VECTOR_TABLE __Vectors +#endif + +#ifndef __VECTOR_TABLE_ATTRIBUTE +#define __VECTOR_TABLE_ATTRIBUTE __attribute((used, section("RESET"))) +#endif + + +/* ########################### Core Function Access ########################### */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions + @{ + */ + +/** + \brief Enable IRQ Interrupts + \details Enables IRQ interrupts by clearing the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +/* intrinsic void __enable_irq(); see arm_compat.h */ + + +/** + \brief Disable IRQ Interrupts + \details Disables IRQ interrupts by setting the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +/* intrinsic void __disable_irq(); see arm_compat.h */ + + +/** + \brief Get Control Register + \details Returns the content of the Control Register. + \return Control Register value + */ +__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Control Register (non-secure) + \details Returns the content of the non-secure Control Register when in secure mode. + \return non-secure Control Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Control Register + \details Writes the given value to the Control Register. + \param [in] control Control Register value to set + */ +__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) +{ + __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Control Register (non-secure) + \details Writes the given value to the non-secure Control Register when in secure state. + \param [in] control Control Register value to set + */ +__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) +{ + __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); +} +#endif + + +/** + \brief Get IPSR Register + \details Returns the content of the IPSR Register. + \return IPSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_IPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get APSR Register + \details Returns the content of the APSR Register. + \return APSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_APSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, apsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get xPSR Register + \details Returns the content of the xPSR Register. + \return xPSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_xPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get Process Stack Pointer + \details Returns the current value of the Process Stack Pointer (PSP). + \return PSP Register value + */ +__STATIC_FORCEINLINE uint32_t __get_PSP(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, psp" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Process Stack Pointer (non-secure) + \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. + \return PSP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Process Stack Pointer + \details Assigns the given value to the Process Stack Pointer (PSP). + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Process Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); +} +#endif + + +/** + \brief Get Main Stack Pointer + \details Returns the current value of the Main Stack Pointer (MSP). + \return MSP Register value + */ +__STATIC_FORCEINLINE uint32_t __get_MSP(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, msp" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Main Stack Pointer (non-secure) + \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. + \return MSP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Main Stack Pointer + \details Assigns the given value to the Main Stack Pointer (MSP). + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Main Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); +} +#endif + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Stack Pointer (non-secure) + \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. + \return SP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); + return(result); +} + + +/** + \brief Set Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. + \param [in] topOfStack Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) +{ + __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); +} +#endif + + +/** + \brief Get Priority Mask + \details Returns the current state of the priority mask bit from the Priority Mask Register. + \return Priority Mask value + */ +__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Priority Mask (non-secure) + \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. + \return Priority Mask value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Priority Mask + \details Assigns the given value to the Priority Mask Register. + \param [in] priMask Priority Mask + */ +__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) +{ + __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Priority Mask (non-secure) + \details Assigns the given value to the non-secure Priority Mask Register when in secure state. + \param [in] priMask Priority Mask + */ +__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) +{ + __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); +} +#endif + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) +/** + \brief Enable FIQ + \details Enables FIQ interrupts by clearing the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +#define __enable_fault_irq __enable_fiq /* see arm_compat.h */ + + +/** + \brief Disable FIQ + \details Disables FIQ interrupts by setting the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +#define __disable_fault_irq __disable_fiq /* see arm_compat.h */ + + +/** + \brief Get Base Priority + \details Returns the current value of the Base Priority register. + \return Base Priority register value + */ +__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, basepri" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Base Priority (non-secure) + \details Returns the current value of the non-secure Base Priority register when in secure state. + \return Base Priority register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Base Priority + \details Assigns the given value to the Base Priority register. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) +{ + __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Base Priority (non-secure) + \details Assigns the given value to the non-secure Base Priority register when in secure state. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) +{ + __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); +} +#endif + + +/** + \brief Set Base Priority with condition + \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, + or the new value increases the BASEPRI priority level. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) +{ + __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); +} + + +/** + \brief Get Fault Mask + \details Returns the current value of the Fault Mask register. + \return Fault Mask register value + */ +__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Fault Mask (non-secure) + \details Returns the current value of the non-secure Fault Mask register when in secure state. + \return Fault Mask register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Fault Mask + \details Assigns the given value to the Fault Mask register. + \param [in] faultMask Fault Mask value to set + */ +__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) +{ + __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Fault Mask (non-secure) + \details Assigns the given value to the non-secure Fault Mask register when in secure state. + \param [in] faultMask Fault Mask value to set + */ +__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) +{ + __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); +} +#endif + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) + +/** + \brief Get Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). + \return PSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, psplim" : "=r" (result) ); + return result; +#endif +} + +#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Process Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \return PSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); + return result; +#endif +} +#endif + + +/** + \brief Set Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Process Stack Pointer (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); +#endif +} +#endif + + +/** + \brief Get Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). + \return MSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim" : "=r" (result) ); + return result; +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. + \return MSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); + return result; +#endif +} +#endif + + +/** + \brief Set Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. + + \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). + \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. + + \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. + \param [in] MainStackPtrLimit Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); +#endif +} +#endif + +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + +/** + \brief Get FPSCR + \details Returns the current value of the Floating Point Status/Control register. + \return Floating Point Status/Control register value + */ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#define __get_FPSCR (uint32_t)__builtin_arm_get_fpscr +#else +#define __get_FPSCR() ((uint32_t)0U) +#endif + +/** + \brief Set FPSCR + \details Assigns the given value to the Floating Point Status/Control register. + \param [in] fpscr Floating Point Status/Control value to set + */ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#define __set_FPSCR __builtin_arm_set_fpscr +#else +#define __set_FPSCR(x) ((void)(x)) +#endif + + +/*@} end of CMSIS_Core_RegAccFunctions */ + + +/* ########################## Core Instruction Access ######################### */ +/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface + Access to dedicated instructions + @{ +*/ + +/* Define macros for porting to both thumb1 and thumb2. + * For thumb1, use low register (r0-r7), specified by constraint "l" + * Otherwise, use general registers, specified by constraint "r" */ +#if defined (__thumb__) && !defined (__thumb2__) +#define __CMSIS_GCC_OUT_REG(r) "=l" (r) +#define __CMSIS_GCC_USE_REG(r) "l" (r) +#else +#define __CMSIS_GCC_OUT_REG(r) "=r" (r) +#define __CMSIS_GCC_USE_REG(r) "r" (r) +#endif + +/** + \brief No Operation + \details No Operation does nothing. This instruction can be used for code alignment purposes. + */ +#define __NOP __builtin_arm_nop + +/** + \brief Wait For Interrupt + \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. + */ +#define __WFI __builtin_arm_wfi + + +/** + \brief Wait For Event + \details Wait For Event is a hint instruction that permits the processor to enter + a low-power state until one of a number of events occurs. + */ +#define __WFE __builtin_arm_wfe + + +/** + \brief Send Event + \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. + */ +#define __SEV __builtin_arm_sev + + +/** + \brief Instruction Synchronization Barrier + \details Instruction Synchronization Barrier flushes the pipeline in the processor, + so that all instructions following the ISB are fetched from cache or memory, + after the instruction has been completed. + */ +#define __ISB() __builtin_arm_isb(0xF) + +/** + \brief Data Synchronization Barrier + \details Acts as a special kind of Data Memory Barrier. + It completes when all explicit memory accesses before this instruction complete. + */ +#define __DSB() __builtin_arm_dsb(0xF) + + +/** + \brief Data Memory Barrier + \details Ensures the apparent order of the explicit memory operations before + and after the instruction, without ensuring their completion. + */ +#define __DMB() __builtin_arm_dmb(0xF) + + +/** + \brief Reverse byte order (32 bit) + \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. + \param [in] value Value to reverse + \return Reversed value + */ +#define __REV(value) __builtin_bswap32(value) + + +/** + \brief Reverse byte order (16 bit) + \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. + \param [in] value Value to reverse + \return Reversed value + */ +#define __REV16(value) __ROR(__REV(value), 16) + + +/** + \brief Reverse byte order (16 bit) + \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. + \param [in] value Value to reverse + \return Reversed value + */ +#define __REVSH(value) (int16_t)__builtin_bswap16(value) + + +/** + \brief Rotate Right in unsigned value (32 bit) + \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. + \param [in] op1 Value to rotate + \param [in] op2 Number of Bits to rotate + \return Rotated value + */ +__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) +{ + op2 %= 32U; + if (op2 == 0U) + { + return op1; + } + return (op1 >> op2) | (op1 << (32U - op2)); +} + + +/** + \brief Breakpoint + \details Causes the processor to enter Debug state. + Debug tools can use this to investigate system state when the instruction at a particular address is reached. + \param [in] value is ignored by the processor. + If required, a debugger can use it to store additional information about the breakpoint. + */ +#define __BKPT(value) __ASM volatile ("bkpt "#value) + + +/** + \brief Reverse bit order of value + \details Reverses the bit order of the given value. + \param [in] value Value to reverse + \return Reversed value + */ +#define __RBIT __builtin_arm_rbit + +/** + \brief Count leading zeros + \details Counts the number of leading zeros of a data value. + \param [in] value Value to count the leading zeros + \return number of leading zeros in value + */ +__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value) +{ + /* Even though __builtin_clz produces a CLZ instruction on ARM, formally + __builtin_clz(0) is undefined behaviour, so handle this case specially. + This guarantees ARM-compatible results if happening to compile on a non-ARM + target, and ensures the compiler doesn't decide to activate any + optimisations using the logic "value was passed to __builtin_clz, so it + is non-zero". + ARM Compiler 6.10 and possibly earlier will optimise this test away, leaving a + single CLZ instruction. + */ + if (value == 0U) + { + return 32U; + } + return __builtin_clz(value); +} + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +/** + \brief LDR Exclusive (8 bit) + \details Executes a exclusive LDR instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +#define __LDREXB (uint8_t)__builtin_arm_ldrex + + +/** + \brief LDR Exclusive (16 bit) + \details Executes a exclusive LDR instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +#define __LDREXH (uint16_t)__builtin_arm_ldrex + + +/** + \brief LDR Exclusive (32 bit) + \details Executes a exclusive LDR instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +#define __LDREXW (uint32_t)__builtin_arm_ldrex + + +/** + \brief STR Exclusive (8 bit) + \details Executes a exclusive STR instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STREXB (uint32_t)__builtin_arm_strex + + +/** + \brief STR Exclusive (16 bit) + \details Executes a exclusive STR instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STREXH (uint32_t)__builtin_arm_strex + + +/** + \brief STR Exclusive (32 bit) + \details Executes a exclusive STR instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STREXW (uint32_t)__builtin_arm_strex + + +/** + \brief Remove the exclusive lock + \details Removes the exclusive lock which is created by LDREX. + */ +#define __CLREX __builtin_arm_clrex + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) + +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +#define __SSAT __builtin_arm_ssat + + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +#define __USAT __builtin_arm_usat + + +/** + \brief Rotate Right with Extend (32 bit) + \details Moves each bit of a bitstring right by one bit. + The carry input is shifted in at the left end of the bitstring. + \param [in] value Value to rotate + \return Rotated value + */ +__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) +{ + uint32_t result; + + __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return(result); +} + + +/** + \brief LDRT Unprivileged (8 bit) + \details Executes a Unprivileged LDRT instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint8_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDRT Unprivileged (16 bit) + \details Executes a Unprivileged LDRT instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint16_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDRT Unprivileged (32 bit) + \details Executes a Unprivileged LDRT instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); + return(result); +} + + +/** + \brief STRT Unprivileged (8 bit) + \details Executes a Unprivileged STRT instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) +{ + __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief STRT Unprivileged (16 bit) + \details Executes a Unprivileged STRT instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) +{ + __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief STRT Unprivileged (32 bit) + \details Executes a Unprivileged STRT instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) +{ + __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); +} + +#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) +{ + if ((sat >= 1U) && (sat <= 32U)) + { + const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); + const int32_t min = -1 - max ; + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + } + return val; +} + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) +{ + if (sat <= 31U) + { + const uint32_t max = ((1U << sat) - 1U); + if (val > (int32_t)max) + { + return max; + } + else if (val < 0) + { + return 0U; + } + } + return (uint32_t)val; +} + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +/** + \brief Load-Acquire (8 bit) + \details Executes a LDAB instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint8_t) result); +} + + +/** + \brief Load-Acquire (16 bit) + \details Executes a LDAH instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint16_t) result); +} + + +/** + \brief Load-Acquire (32 bit) + \details Executes a LDA instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) ); + return(result); +} + + +/** + \brief Store-Release (8 bit) + \details Executes a STLB instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) +{ + __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief Store-Release (16 bit) + \details Executes a STLH instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) +{ + __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief Store-Release (32 bit) + \details Executes a STL instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) +{ + __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief Load-Acquire Exclusive (8 bit) + \details Executes a LDAB exclusive instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +#define __LDAEXB (uint8_t)__builtin_arm_ldaex + + +/** + \brief Load-Acquire Exclusive (16 bit) + \details Executes a LDAH exclusive instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +#define __LDAEXH (uint16_t)__builtin_arm_ldaex + + +/** + \brief Load-Acquire Exclusive (32 bit) + \details Executes a LDA exclusive instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +#define __LDAEX (uint32_t)__builtin_arm_ldaex + + +/** + \brief Store-Release Exclusive (8 bit) + \details Executes a STLB exclusive instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STLEXB (uint32_t)__builtin_arm_stlex + + +/** + \brief Store-Release Exclusive (16 bit) + \details Executes a STLH exclusive instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STLEXH (uint32_t)__builtin_arm_stlex + + +/** + \brief Store-Release Exclusive (32 bit) + \details Executes a STL exclusive instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STLEX (uint32_t)__builtin_arm_stlex + +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + +/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ + + +/* ################### Compiler specific Intrinsics ########################### */ +/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics + Access to dedicated SIMD instructions + @{ +*/ + +#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)) + +__STATIC_FORCEINLINE uint32_t __SADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + + +__STATIC_FORCEINLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + + +__STATIC_FORCEINLINE uint32_t __SADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USAD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +#define __SSAT16(ARG1,ARG2) \ +({ \ + int32_t __RES, __ARG1 = (ARG1); \ + __ASM ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + +#define __USAT16(ARG1,ARG2) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1); \ + __ASM ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + +__STATIC_FORCEINLINE uint32_t __UXTB16(uint32_t op1) +{ + uint32_t result; + + __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SXTB16(uint32_t op1) +{ + uint32_t result; + + __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMUAD (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint32_t __SMUSD (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint32_t __SEL (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE int32_t __QADD( int32_t op1, int32_t op2) +{ + int32_t result; + + __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE int32_t __QSUB( int32_t op1, int32_t op2) +{ + int32_t result; + + __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \ + ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) + +#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \ + ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) + +__STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) +{ + int32_t result; + + __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +#endif /* (__ARM_FEATURE_DSP == 1) */ +/*@} end of group CMSIS_SIMD_intrinsics */ + + +#endif /* __CMSIS_ARMCLANG_H */ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_compiler.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_compiler.h new file mode 100644 index 0000000000..adbf296f15 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_compiler.h @@ -0,0 +1,283 @@ +/**************************************************************************//** + * @file cmsis_compiler.h + * @brief CMSIS compiler generic header file + * @version V5.1.0 + * @date 09. October 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __CMSIS_COMPILER_H +#define __CMSIS_COMPILER_H + +#include + +/* + * Arm Compiler 4/5 + */ +#if defined ( __CC_ARM ) + #include "cmsis_armcc.h" + + +/* + * Arm Compiler 6.6 LTM (armclang) + */ +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) && (__ARMCC_VERSION < 6100100) + #include "cmsis_armclang_ltm.h" + + /* + * Arm Compiler above 6.10.1 (armclang) + */ +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100) + #include "cmsis_armclang.h" + + +/* + * GNU Compiler + */ +#elif defined ( __GNUC__ ) + #include "cmsis_gcc.h" + + +/* + * IAR Compiler + */ +#elif defined ( __ICCARM__ ) + #include + + +/* + * TI Arm Compiler + */ +#elif defined ( __TI_ARM__ ) + #include + + #ifndef __ASM + #define __ASM __asm + #endif + #ifndef __INLINE + #define __INLINE inline + #endif + #ifndef __STATIC_INLINE + #define __STATIC_INLINE static inline + #endif + #ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE __STATIC_INLINE + #endif + #ifndef __NO_RETURN + #define __NO_RETURN __attribute__((noreturn)) + #endif + #ifndef __USED + #define __USED __attribute__((used)) + #endif + #ifndef __WEAK + #define __WEAK __attribute__((weak)) + #endif + #ifndef __PACKED + #define __PACKED __attribute__((packed)) + #endif + #ifndef __PACKED_STRUCT + #define __PACKED_STRUCT struct __attribute__((packed)) + #endif + #ifndef __PACKED_UNION + #define __PACKED_UNION union __attribute__((packed)) + #endif + #ifndef __UNALIGNED_UINT32 /* deprecated */ + struct __attribute__((packed)) T_UINT32 { uint32_t v; }; + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) + #endif + #ifndef __UNALIGNED_UINT16_WRITE + __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; + #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void*)(addr))->v) = (val)) + #endif + #ifndef __UNALIGNED_UINT16_READ + __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; + #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) + #endif + #ifndef __UNALIGNED_UINT32_WRITE + __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; + #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) + #endif + #ifndef __UNALIGNED_UINT32_READ + __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; + #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) + #endif + #ifndef __ALIGNED + #define __ALIGNED(x) __attribute__((aligned(x))) + #endif + #ifndef __RESTRICT + #define __RESTRICT __restrict + #endif + #ifndef __COMPILER_BARRIER + #warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored. + #define __COMPILER_BARRIER() (void)0 + #endif + + +/* + * TASKING Compiler + */ +#elif defined ( __TASKING__ ) + /* + * The CMSIS functions have been implemented as intrinsics in the compiler. + * Please use "carm -?i" to get an up to date list of all intrinsics, + * Including the CMSIS ones. + */ + + #ifndef __ASM + #define __ASM __asm + #endif + #ifndef __INLINE + #define __INLINE inline + #endif + #ifndef __STATIC_INLINE + #define __STATIC_INLINE static inline + #endif + #ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE __STATIC_INLINE + #endif + #ifndef __NO_RETURN + #define __NO_RETURN __attribute__((noreturn)) + #endif + #ifndef __USED + #define __USED __attribute__((used)) + #endif + #ifndef __WEAK + #define __WEAK __attribute__((weak)) + #endif + #ifndef __PACKED + #define __PACKED __packed__ + #endif + #ifndef __PACKED_STRUCT + #define __PACKED_STRUCT struct __packed__ + #endif + #ifndef __PACKED_UNION + #define __PACKED_UNION union __packed__ + #endif + #ifndef __UNALIGNED_UINT32 /* deprecated */ + struct __packed__ T_UINT32 { uint32_t v; }; + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) + #endif + #ifndef __UNALIGNED_UINT16_WRITE + __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; + #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) + #endif + #ifndef __UNALIGNED_UINT16_READ + __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; + #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) + #endif + #ifndef __UNALIGNED_UINT32_WRITE + __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; + #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) + #endif + #ifndef __UNALIGNED_UINT32_READ + __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; + #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) + #endif + #ifndef __ALIGNED + #define __ALIGNED(x) __align(x) + #endif + #ifndef __RESTRICT + #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. + #define __RESTRICT + #endif + #ifndef __COMPILER_BARRIER + #warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored. + #define __COMPILER_BARRIER() (void)0 + #endif + + +/* + * COSMIC Compiler + */ +#elif defined ( __CSMC__ ) + #include + + #ifndef __ASM + #define __ASM _asm + #endif + #ifndef __INLINE + #define __INLINE inline + #endif + #ifndef __STATIC_INLINE + #define __STATIC_INLINE static inline + #endif + #ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE __STATIC_INLINE + #endif + #ifndef __NO_RETURN + // NO RETURN is automatically detected hence no warning here + #define __NO_RETURN + #endif + #ifndef __USED + #warning No compiler specific solution for __USED. __USED is ignored. + #define __USED + #endif + #ifndef __WEAK + #define __WEAK __weak + #endif + #ifndef __PACKED + #define __PACKED @packed + #endif + #ifndef __PACKED_STRUCT + #define __PACKED_STRUCT @packed struct + #endif + #ifndef __PACKED_UNION + #define __PACKED_UNION @packed union + #endif + #ifndef __UNALIGNED_UINT32 /* deprecated */ + @packed struct T_UINT32 { uint32_t v; }; + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) + #endif + #ifndef __UNALIGNED_UINT16_WRITE + __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; + #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) + #endif + #ifndef __UNALIGNED_UINT16_READ + __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; + #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) + #endif + #ifndef __UNALIGNED_UINT32_WRITE + __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; + #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) + #endif + #ifndef __UNALIGNED_UINT32_READ + __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; + #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) + #endif + #ifndef __ALIGNED + #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored. + #define __ALIGNED(x) + #endif + #ifndef __RESTRICT + #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. + #define __RESTRICT + #endif + #ifndef __COMPILER_BARRIER + #warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored. + #define __COMPILER_BARRIER() (void)0 + #endif + + +#else + #error Unknown compiler. +#endif + + +#endif /* __CMSIS_COMPILER_H */ + diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_gcc.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_gcc.h new file mode 100644 index 0000000000..3ddcc58b69 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_gcc.h @@ -0,0 +1,2168 @@ +/**************************************************************************//** + * @file cmsis_gcc.h + * @brief CMSIS compiler GCC header file + * @version V5.2.0 + * @date 08. May 2019 + ******************************************************************************/ +/* + * Copyright (c) 2009-2019 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __CMSIS_GCC_H +#define __CMSIS_GCC_H + +/* ignore some GCC warnings */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" +#pragma GCC diagnostic ignored "-Wunused-parameter" + +/* Fallback for __has_builtin */ +#ifndef __has_builtin + #define __has_builtin(x) (0) +#endif + +/* CMSIS compiler specific defines */ +#ifndef __ASM + #define __ASM __asm +#endif +#ifndef __INLINE + #define __INLINE inline +#endif +#ifndef __STATIC_INLINE + #define __STATIC_INLINE static inline +#endif +#ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE __attribute__((always_inline)) static inline +#endif +#ifndef __NO_RETURN + #define __NO_RETURN __attribute__((__noreturn__)) +#endif +#ifndef __USED + #define __USED __attribute__((used)) +#endif +#ifndef __WEAK + #define __WEAK __attribute__((weak)) +#endif +#ifndef __PACKED + #define __PACKED __attribute__((packed, aligned(1))) +#endif +#ifndef __PACKED_STRUCT + #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) +#endif +#ifndef __PACKED_UNION + #define __PACKED_UNION union __attribute__((packed, aligned(1))) +#endif +#ifndef __UNALIGNED_UINT32 /* deprecated */ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpacked" + #pragma GCC diagnostic ignored "-Wattributes" + struct __attribute__((packed)) T_UINT32 { uint32_t v; }; + #pragma GCC diagnostic pop + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) +#endif +#ifndef __UNALIGNED_UINT16_WRITE + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpacked" + #pragma GCC diagnostic ignored "-Wattributes" + __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; + #pragma GCC diagnostic pop + #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) +#endif +#ifndef __UNALIGNED_UINT16_READ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpacked" + #pragma GCC diagnostic ignored "-Wattributes" + __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; + #pragma GCC diagnostic pop + #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) +#endif +#ifndef __UNALIGNED_UINT32_WRITE + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpacked" + #pragma GCC diagnostic ignored "-Wattributes" + __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; + #pragma GCC diagnostic pop + #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) +#endif +#ifndef __UNALIGNED_UINT32_READ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpacked" + #pragma GCC diagnostic ignored "-Wattributes" + __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; + #pragma GCC diagnostic pop + #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) +#endif +#ifndef __ALIGNED + #define __ALIGNED(x) __attribute__((aligned(x))) +#endif +#ifndef __RESTRICT + #define __RESTRICT __restrict +#endif +#ifndef __COMPILER_BARRIER + #define __COMPILER_BARRIER() __ASM volatile("":::"memory") +#endif + +/* ######################### Startup and Lowlevel Init ######################## */ + +#ifndef __PROGRAM_START + +/** + \brief Initializes data and bss sections + \details This default implementations initialized all data and additional bss + sections relying on .copy.table and .zero.table specified properly + in the used linker script. + + */ +__STATIC_FORCEINLINE __NO_RETURN void __cmsis_start(void) +{ + extern void _start(void) __NO_RETURN; + + typedef struct { + uint32_t const* src; + uint32_t* dest; + uint32_t wlen; + } __copy_table_t; + + typedef struct { + uint32_t* dest; + uint32_t wlen; + } __zero_table_t; + + extern const __copy_table_t __copy_table_start__; + extern const __copy_table_t __copy_table_end__; + extern const __zero_table_t __zero_table_start__; + extern const __zero_table_t __zero_table_end__; + + for (__copy_table_t const* pTable = &__copy_table_start__; pTable < &__copy_table_end__; ++pTable) { + for(uint32_t i=0u; iwlen; ++i) { + pTable->dest[i] = pTable->src[i]; + } + } + + for (__zero_table_t const* pTable = &__zero_table_start__; pTable < &__zero_table_end__; ++pTable) { + for(uint32_t i=0u; iwlen; ++i) { + pTable->dest[i] = 0u; + } + } + + _start(); +} + +#define __PROGRAM_START __cmsis_start +#endif + +#ifndef __INITIAL_SP +#define __INITIAL_SP __StackTop +#endif + +#ifndef __STACK_LIMIT +#define __STACK_LIMIT __StackLimit +#endif + +#ifndef __VECTOR_TABLE +#define __VECTOR_TABLE __Vectors +#endif + +#ifndef __VECTOR_TABLE_ATTRIBUTE +#define __VECTOR_TABLE_ATTRIBUTE __attribute((used, section(".vectors"))) +#endif + +/* ########################### Core Function Access ########################### */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions + @{ + */ + +/** + \brief Enable IRQ Interrupts + \details Enables IRQ interrupts by clearing the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__STATIC_FORCEINLINE void __enable_irq(void) +{ + __ASM volatile ("cpsie i" : : : "memory"); +} + + +/** + \brief Disable IRQ Interrupts + \details Disables IRQ interrupts by setting the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__STATIC_FORCEINLINE void __disable_irq(void) +{ + __ASM volatile ("cpsid i" : : : "memory"); +} + + +/** + \brief Get Control Register + \details Returns the content of the Control Register. + \return Control Register value + */ +__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Control Register (non-secure) + \details Returns the content of the non-secure Control Register when in secure mode. + \return non-secure Control Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Control Register + \details Writes the given value to the Control Register. + \param [in] control Control Register value to set + */ +__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) +{ + __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Control Register (non-secure) + \details Writes the given value to the non-secure Control Register when in secure state. + \param [in] control Control Register value to set + */ +__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) +{ + __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); +} +#endif + + +/** + \brief Get IPSR Register + \details Returns the content of the IPSR Register. + \return IPSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_IPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get APSR Register + \details Returns the content of the APSR Register. + \return APSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_APSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, apsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get xPSR Register + \details Returns the content of the xPSR Register. + \return xPSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_xPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get Process Stack Pointer + \details Returns the current value of the Process Stack Pointer (PSP). + \return PSP Register value + */ +__STATIC_FORCEINLINE uint32_t __get_PSP(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, psp" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Process Stack Pointer (non-secure) + \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. + \return PSP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Process Stack Pointer + \details Assigns the given value to the Process Stack Pointer (PSP). + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Process Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); +} +#endif + + +/** + \brief Get Main Stack Pointer + \details Returns the current value of the Main Stack Pointer (MSP). + \return MSP Register value + */ +__STATIC_FORCEINLINE uint32_t __get_MSP(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, msp" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Main Stack Pointer (non-secure) + \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. + \return MSP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Main Stack Pointer + \details Assigns the given value to the Main Stack Pointer (MSP). + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Main Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); +} +#endif + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Stack Pointer (non-secure) + \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. + \return SP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); + return(result); +} + + +/** + \brief Set Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. + \param [in] topOfStack Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) +{ + __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); +} +#endif + + +/** + \brief Get Priority Mask + \details Returns the current state of the priority mask bit from the Priority Mask Register. + \return Priority Mask value + */ +__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask" : "=r" (result) :: "memory"); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Priority Mask (non-secure) + \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. + \return Priority Mask value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask_ns" : "=r" (result) :: "memory"); + return(result); +} +#endif + + +/** + \brief Set Priority Mask + \details Assigns the given value to the Priority Mask Register. + \param [in] priMask Priority Mask + */ +__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) +{ + __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Priority Mask (non-secure) + \details Assigns the given value to the non-secure Priority Mask Register when in secure state. + \param [in] priMask Priority Mask + */ +__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) +{ + __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); +} +#endif + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) +/** + \brief Enable FIQ + \details Enables FIQ interrupts by clearing the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__STATIC_FORCEINLINE void __enable_fault_irq(void) +{ + __ASM volatile ("cpsie f" : : : "memory"); +} + + +/** + \brief Disable FIQ + \details Disables FIQ interrupts by setting the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__STATIC_FORCEINLINE void __disable_fault_irq(void) +{ + __ASM volatile ("cpsid f" : : : "memory"); +} + + +/** + \brief Get Base Priority + \details Returns the current value of the Base Priority register. + \return Base Priority register value + */ +__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, basepri" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Base Priority (non-secure) + \details Returns the current value of the non-secure Base Priority register when in secure state. + \return Base Priority register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Base Priority + \details Assigns the given value to the Base Priority register. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) +{ + __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Base Priority (non-secure) + \details Assigns the given value to the non-secure Base Priority register when in secure state. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) +{ + __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); +} +#endif + + +/** + \brief Set Base Priority with condition + \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, + or the new value increases the BASEPRI priority level. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) +{ + __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); +} + + +/** + \brief Get Fault Mask + \details Returns the current value of the Fault Mask register. + \return Fault Mask register value + */ +__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Fault Mask (non-secure) + \details Returns the current value of the non-secure Fault Mask register when in secure state. + \return Fault Mask register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Fault Mask + \details Assigns the given value to the Fault Mask register. + \param [in] faultMask Fault Mask value to set + */ +__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) +{ + __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Fault Mask (non-secure) + \details Assigns the given value to the non-secure Fault Mask register when in secure state. + \param [in] faultMask Fault Mask value to set + */ +__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) +{ + __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); +} +#endif + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) + +/** + \brief Get Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). + \return PSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, psplim" : "=r" (result) ); + return result; +#endif +} + +#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Process Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \return PSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); + return result; +#endif +} +#endif + + +/** + \brief Set Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Process Stack Pointer (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. + + \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); +#endif +} +#endif + + +/** + \brief Get Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). + \return MSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim" : "=r" (result) ); + return result; +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. + \return MSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); + return result; +#endif +} +#endif + + +/** + \brief Set Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). + \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. + + \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. + \param [in] MainStackPtrLimit Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); +#endif +} +#endif + +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + + +/** + \brief Get FPSCR + \details Returns the current value of the Floating Point Status/Control register. + \return Floating Point Status/Control register value + */ +__STATIC_FORCEINLINE uint32_t __get_FPSCR(void) +{ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#if __has_builtin(__builtin_arm_get_fpscr) +// Re-enable using built-in when GCC has been fixed +// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2) + /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */ + return __builtin_arm_get_fpscr(); +#else + uint32_t result; + + __ASM volatile ("VMRS %0, fpscr" : "=r" (result) ); + return(result); +#endif +#else + return(0U); +#endif +} + + +/** + \brief Set FPSCR + \details Assigns the given value to the Floating Point Status/Control register. + \param [in] fpscr Floating Point Status/Control value to set + */ +__STATIC_FORCEINLINE void __set_FPSCR(uint32_t fpscr) +{ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#if __has_builtin(__builtin_arm_set_fpscr) +// Re-enable using built-in when GCC has been fixed +// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2) + /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */ + __builtin_arm_set_fpscr(fpscr); +#else + __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc", "memory"); +#endif +#else + (void)fpscr; +#endif +} + + +/*@} end of CMSIS_Core_RegAccFunctions */ + + +/* ########################## Core Instruction Access ######################### */ +/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface + Access to dedicated instructions + @{ +*/ + +/* Define macros for porting to both thumb1 and thumb2. + * For thumb1, use low register (r0-r7), specified by constraint "l" + * Otherwise, use general registers, specified by constraint "r" */ +#if defined (__thumb__) && !defined (__thumb2__) +#define __CMSIS_GCC_OUT_REG(r) "=l" (r) +#define __CMSIS_GCC_RW_REG(r) "+l" (r) +#define __CMSIS_GCC_USE_REG(r) "l" (r) +#else +#define __CMSIS_GCC_OUT_REG(r) "=r" (r) +#define __CMSIS_GCC_RW_REG(r) "+r" (r) +#define __CMSIS_GCC_USE_REG(r) "r" (r) +#endif + +/** + \brief No Operation + \details No Operation does nothing. This instruction can be used for code alignment purposes. + */ +#define __NOP() __ASM volatile ("nop") + +/** + \brief Wait For Interrupt + \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. + */ +#define __WFI() __ASM volatile ("wfi") + + +/** + \brief Wait For Event + \details Wait For Event is a hint instruction that permits the processor to enter + a low-power state until one of a number of events occurs. + */ +#define __WFE() __ASM volatile ("wfe") + + +/** + \brief Send Event + \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. + */ +#define __SEV() __ASM volatile ("sev") + + +/** + \brief Instruction Synchronization Barrier + \details Instruction Synchronization Barrier flushes the pipeline in the processor, + so that all instructions following the ISB are fetched from cache or memory, + after the instruction has been completed. + */ +__STATIC_FORCEINLINE void __ISB(void) +{ + __ASM volatile ("isb 0xF":::"memory"); +} + + +/** + \brief Data Synchronization Barrier + \details Acts as a special kind of Data Memory Barrier. + It completes when all explicit memory accesses before this instruction complete. + */ +__STATIC_FORCEINLINE void __DSB(void) +{ + __ASM volatile ("dsb 0xF":::"memory"); +} + + +/** + \brief Data Memory Barrier + \details Ensures the apparent order of the explicit memory operations before + and after the instruction, without ensuring their completion. + */ +__STATIC_FORCEINLINE void __DMB(void) +{ + __ASM volatile ("dmb 0xF":::"memory"); +} + + +/** + \brief Reverse byte order (32 bit) + \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. + \param [in] value Value to reverse + \return Reversed value + */ +__STATIC_FORCEINLINE uint32_t __REV(uint32_t value) +{ +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) + return __builtin_bswap32(value); +#else + uint32_t result; + + __ASM volatile ("rev %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return result; +#endif +} + + +/** + \brief Reverse byte order (16 bit) + \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. + \param [in] value Value to reverse + \return Reversed value + */ +__STATIC_FORCEINLINE uint32_t __REV16(uint32_t value) +{ + uint32_t result; + + __ASM volatile ("rev16 %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return result; +} + + +/** + \brief Reverse byte order (16 bit) + \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. + \param [in] value Value to reverse + \return Reversed value + */ +__STATIC_FORCEINLINE int16_t __REVSH(int16_t value) +{ +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + return (int16_t)__builtin_bswap16(value); +#else + int16_t result; + + __ASM volatile ("revsh %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return result; +#endif +} + + +/** + \brief Rotate Right in unsigned value (32 bit) + \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. + \param [in] op1 Value to rotate + \param [in] op2 Number of Bits to rotate + \return Rotated value + */ +__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) +{ + op2 %= 32U; + if (op2 == 0U) + { + return op1; + } + return (op1 >> op2) | (op1 << (32U - op2)); +} + + +/** + \brief Breakpoint + \details Causes the processor to enter Debug state. + Debug tools can use this to investigate system state when the instruction at a particular address is reached. + \param [in] value is ignored by the processor. + If required, a debugger can use it to store additional information about the breakpoint. + */ +#define __BKPT(value) __ASM volatile ("bkpt "#value) + + +/** + \brief Reverse bit order of value + \details Reverses the bit order of the given value. + \param [in] value Value to reverse + \return Reversed value + */ +__STATIC_FORCEINLINE uint32_t __RBIT(uint32_t value) +{ + uint32_t result; + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) + __ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) ); +#else + uint32_t s = (4U /*sizeof(v)*/ * 8U) - 1U; /* extra shift needed at end */ + + result = value; /* r will be reversed bits of v; first get LSB of v */ + for (value >>= 1U; value != 0U; value >>= 1U) + { + result <<= 1U; + result |= value & 1U; + s--; + } + result <<= s; /* shift when v's highest bits are zero */ +#endif + return result; +} + + +/** + \brief Count leading zeros + \details Counts the number of leading zeros of a data value. + \param [in] value Value to count the leading zeros + \return number of leading zeros in value + */ +__STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value) +{ + /* Even though __builtin_clz produces a CLZ instruction on ARM, formally + __builtin_clz(0) is undefined behaviour, so handle this case specially. + This guarantees ARM-compatible results if happening to compile on a non-ARM + target, and ensures the compiler doesn't decide to activate any + optimisations using the logic "value was passed to __builtin_clz, so it + is non-zero". + ARM GCC 7.3 and possibly earlier will optimise this test away, leaving a + single CLZ instruction. + */ + if (value == 0U) + { + return 32U; + } + return __builtin_clz(value); +} + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +/** + \brief LDR Exclusive (8 bit) + \details Executes a exclusive LDR instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDREXB(volatile uint8_t *addr) +{ + uint32_t result; + +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrexb %0, %1" : "=r" (result) : "Q" (*addr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrexb %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); +#endif + return ((uint8_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDR Exclusive (16 bit) + \details Executes a exclusive LDR instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDREXH(volatile uint16_t *addr) +{ + uint32_t result; + +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrexh %0, %1" : "=r" (result) : "Q" (*addr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrexh %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); +#endif + return ((uint16_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDR Exclusive (32 bit) + \details Executes a exclusive LDR instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDREXW(volatile uint32_t *addr) +{ + uint32_t result; + + __ASM volatile ("ldrex %0, %1" : "=r" (result) : "Q" (*addr) ); + return(result); +} + + +/** + \brief STR Exclusive (8 bit) + \details Executes a exclusive STR instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__STATIC_FORCEINLINE uint32_t __STREXB(uint8_t value, volatile uint8_t *addr) +{ + uint32_t result; + + __ASM volatile ("strexb %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); + return(result); +} + + +/** + \brief STR Exclusive (16 bit) + \details Executes a exclusive STR instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__STATIC_FORCEINLINE uint32_t __STREXH(uint16_t value, volatile uint16_t *addr) +{ + uint32_t result; + + __ASM volatile ("strexh %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); + return(result); +} + + +/** + \brief STR Exclusive (32 bit) + \details Executes a exclusive STR instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__STATIC_FORCEINLINE uint32_t __STREXW(uint32_t value, volatile uint32_t *addr) +{ + uint32_t result; + + __ASM volatile ("strex %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" (value) ); + return(result); +} + + +/** + \brief Remove the exclusive lock + \details Removes the exclusive lock which is created by LDREX. + */ +__STATIC_FORCEINLINE void __CLREX(void) +{ + __ASM volatile ("clrex" ::: "memory"); +} + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] ARG1 Value to be saturated + \param [in] ARG2 Bit position to saturate to (1..32) + \return Saturated value + */ +#define __SSAT(ARG1,ARG2) \ +__extension__ \ +({ \ + int32_t __RES, __ARG1 = (ARG1); \ + __ASM ("ssat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] ARG1 Value to be saturated + \param [in] ARG2 Bit position to saturate to (0..31) + \return Saturated value + */ +#define __USAT(ARG1,ARG2) \ + __extension__ \ +({ \ + uint32_t __RES, __ARG1 = (ARG1); \ + __ASM ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + + +/** + \brief Rotate Right with Extend (32 bit) + \details Moves each bit of a bitstring right by one bit. + The carry input is shifted in at the left end of the bitstring. + \param [in] value Value to rotate + \return Rotated value + */ +__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) +{ + uint32_t result; + + __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return(result); +} + + +/** + \brief LDRT Unprivileged (8 bit) + \details Executes a Unprivileged LDRT instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) +{ + uint32_t result; + +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrbt %0, [%1]" : "=r" (result) : "r" (ptr) : "memory" ); +#endif + return ((uint8_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDRT Unprivileged (16 bit) + \details Executes a Unprivileged LDRT instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) +{ + uint32_t result; + +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrht %0, [%1]" : "=r" (result) : "r" (ptr) : "memory" ); +#endif + return ((uint16_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDRT Unprivileged (32 bit) + \details Executes a Unprivileged LDRT instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); + return(result); +} + + +/** + \brief STRT Unprivileged (8 bit) + \details Executes a Unprivileged STRT instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) +{ + __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief STRT Unprivileged (16 bit) + \details Executes a Unprivileged STRT instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) +{ + __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief STRT Unprivileged (32 bit) + \details Executes a Unprivileged STRT instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) +{ + __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); +} + +#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) +{ + if ((sat >= 1U) && (sat <= 32U)) + { + const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); + const int32_t min = -1 - max ; + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + } + return val; +} + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) +{ + if (sat <= 31U) + { + const uint32_t max = ((1U << sat) - 1U); + if (val > (int32_t)max) + { + return max; + } + else if (val < 0) + { + return 0U; + } + } + return (uint32_t)val; +} + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +/** + \brief Load-Acquire (8 bit) + \details Executes a LDAB instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint8_t) result); +} + + +/** + \brief Load-Acquire (16 bit) + \details Executes a LDAH instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint16_t) result); +} + + +/** + \brief Load-Acquire (32 bit) + \details Executes a LDA instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) ); + return(result); +} + + +/** + \brief Store-Release (8 bit) + \details Executes a STLB instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) +{ + __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief Store-Release (16 bit) + \details Executes a STLH instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) +{ + __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief Store-Release (32 bit) + \details Executes a STL instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) +{ + __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief Load-Acquire Exclusive (8 bit) + \details Executes a LDAB exclusive instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDAEXB(volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldaexb %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint8_t) result); +} + + +/** + \brief Load-Acquire Exclusive (16 bit) + \details Executes a LDAH exclusive instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDAEXH(volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldaexh %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint16_t) result); +} + + +/** + \brief Load-Acquire Exclusive (32 bit) + \details Executes a LDA exclusive instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDAEX(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldaex %0, %1" : "=r" (result) : "Q" (*ptr) ); + return(result); +} + + +/** + \brief Store-Release Exclusive (8 bit) + \details Executes a STLB exclusive instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__STATIC_FORCEINLINE uint32_t __STLEXB(uint8_t value, volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("stlexb %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) ); + return(result); +} + + +/** + \brief Store-Release Exclusive (16 bit) + \details Executes a STLH exclusive instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__STATIC_FORCEINLINE uint32_t __STLEXH(uint16_t value, volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("stlexh %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) ); + return(result); +} + + +/** + \brief Store-Release Exclusive (32 bit) + \details Executes a STL exclusive instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__STATIC_FORCEINLINE uint32_t __STLEX(uint32_t value, volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("stlex %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) ); + return(result); +} + +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + +/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ + + +/* ################### Compiler specific Intrinsics ########################### */ +/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics + Access to dedicated SIMD instructions + @{ +*/ + +#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)) + +__STATIC_FORCEINLINE uint32_t __SADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + + +__STATIC_FORCEINLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + + +__STATIC_FORCEINLINE uint32_t __SADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USAD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +#define __SSAT16(ARG1,ARG2) \ +({ \ + int32_t __RES, __ARG1 = (ARG1); \ + __ASM ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + +#define __USAT16(ARG1,ARG2) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1); \ + __ASM ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + +__STATIC_FORCEINLINE uint32_t __UXTB16(uint32_t op1) +{ + uint32_t result; + + __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SXTB16(uint32_t op1) +{ + uint32_t result; + + __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMUAD (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint32_t __SMUSD (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint32_t __SEL (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE int32_t __QADD( int32_t op1, int32_t op2) +{ + int32_t result; + + __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE int32_t __QSUB( int32_t op1, int32_t op2) +{ + int32_t result; + + __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +#if 0 +#define __PKHBT(ARG1,ARG2,ARG3) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ + __ASM ("pkhbt %0, %1, %2, lsl %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ + __RES; \ + }) + +#define __PKHTB(ARG1,ARG2,ARG3) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ + if (ARG3 == 0) \ + __ASM ("pkhtb %0, %1, %2" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2) ); \ + else \ + __ASM ("pkhtb %0, %1, %2, asr %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ + __RES; \ + }) +#endif + +#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \ + ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) + +#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \ + ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) + +__STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) +{ + int32_t result; + + __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +#endif /* (__ARM_FEATURE_DSP == 1) */ +/*@} end of group CMSIS_SIMD_intrinsics */ + + +#pragma GCC diagnostic pop + +#endif /* __CMSIS_GCC_H */ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_iccarm.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_iccarm.h new file mode 100644 index 0000000000..12d68fd9a6 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_iccarm.h @@ -0,0 +1,964 @@ +/**************************************************************************//** + * @file cmsis_iccarm.h + * @brief CMSIS compiler ICCARM (IAR Compiler for Arm) header file + * @version V5.1.0 + * @date 08. May 2019 + ******************************************************************************/ + +//------------------------------------------------------------------------------ +// +// Copyright (c) 2017-2019 IAR Systems +// Copyright (c) 2017-2019 Arm Limited. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------ + + +#ifndef __CMSIS_ICCARM_H__ +#define __CMSIS_ICCARM_H__ + +#ifndef __ICCARM__ + #error This file should only be compiled by ICCARM +#endif + +#pragma system_include + +#define __IAR_FT _Pragma("inline=forced") __intrinsic + +#if (__VER__ >= 8000000) + #define __ICCARM_V8 1 +#else + #define __ICCARM_V8 0 +#endif + +#ifndef __ALIGNED + #if __ICCARM_V8 + #define __ALIGNED(x) __attribute__((aligned(x))) + #elif (__VER__ >= 7080000) + /* Needs IAR language extensions */ + #define __ALIGNED(x) __attribute__((aligned(x))) + #else + #warning No compiler specific solution for __ALIGNED.__ALIGNED is ignored. + #define __ALIGNED(x) + #endif +#endif + + +/* Define compiler macros for CPU architecture, used in CMSIS 5. + */ +#if __ARM_ARCH_6M__ || __ARM_ARCH_7M__ || __ARM_ARCH_7EM__ || __ARM_ARCH_8M_BASE__ || __ARM_ARCH_8M_MAIN__ +/* Macros already defined */ +#else + #if defined(__ARM8M_MAINLINE__) || defined(__ARM8EM_MAINLINE__) + #define __ARM_ARCH_8M_MAIN__ 1 + #elif defined(__ARM8M_BASELINE__) + #define __ARM_ARCH_8M_BASE__ 1 + #elif defined(__ARM_ARCH_PROFILE) && __ARM_ARCH_PROFILE == 'M' + #if __ARM_ARCH == 6 + #define __ARM_ARCH_6M__ 1 + #elif __ARM_ARCH == 7 + #if __ARM_FEATURE_DSP + #define __ARM_ARCH_7EM__ 1 + #else + #define __ARM_ARCH_7M__ 1 + #endif + #endif /* __ARM_ARCH */ + #endif /* __ARM_ARCH_PROFILE == 'M' */ +#endif + +/* Alternativ core deduction for older ICCARM's */ +#if !defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7EM__) && \ + !defined(__ARM_ARCH_8M_BASE__) && !defined(__ARM_ARCH_8M_MAIN__) + #if defined(__ARM6M__) && (__CORE__ == __ARM6M__) + #define __ARM_ARCH_6M__ 1 + #elif defined(__ARM7M__) && (__CORE__ == __ARM7M__) + #define __ARM_ARCH_7M__ 1 + #elif defined(__ARM7EM__) && (__CORE__ == __ARM7EM__) + #define __ARM_ARCH_7EM__ 1 + #elif defined(__ARM8M_BASELINE__) && (__CORE == __ARM8M_BASELINE__) + #define __ARM_ARCH_8M_BASE__ 1 + #elif defined(__ARM8M_MAINLINE__) && (__CORE == __ARM8M_MAINLINE__) + #define __ARM_ARCH_8M_MAIN__ 1 + #elif defined(__ARM8EM_MAINLINE__) && (__CORE == __ARM8EM_MAINLINE__) + #define __ARM_ARCH_8M_MAIN__ 1 + #else + #error "Unknown target." + #endif +#endif + + + +#if defined(__ARM_ARCH_6M__) && __ARM_ARCH_6M__==1 + #define __IAR_M0_FAMILY 1 +#elif defined(__ARM_ARCH_8M_BASE__) && __ARM_ARCH_8M_BASE__==1 + #define __IAR_M0_FAMILY 1 +#else + #define __IAR_M0_FAMILY 0 +#endif + + +#ifndef __ASM + #define __ASM __asm +#endif + +#ifndef __COMPILER_BARRIER + #define __COMPILER_BARRIER() __ASM volatile("":::"memory") +#endif + +#ifndef __INLINE + #define __INLINE inline +#endif + +#ifndef __NO_RETURN + #if __ICCARM_V8 + #define __NO_RETURN __attribute__((__noreturn__)) + #else + #define __NO_RETURN _Pragma("object_attribute=__noreturn") + #endif +#endif + +#ifndef __PACKED + #if __ICCARM_V8 + #define __PACKED __attribute__((packed, aligned(1))) + #else + /* Needs IAR language extensions */ + #define __PACKED __packed + #endif +#endif + +#ifndef __PACKED_STRUCT + #if __ICCARM_V8 + #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) + #else + /* Needs IAR language extensions */ + #define __PACKED_STRUCT __packed struct + #endif +#endif + +#ifndef __PACKED_UNION + #if __ICCARM_V8 + #define __PACKED_UNION union __attribute__((packed, aligned(1))) + #else + /* Needs IAR language extensions */ + #define __PACKED_UNION __packed union + #endif +#endif + +#ifndef __RESTRICT + #if __ICCARM_V8 + #define __RESTRICT __restrict + #else + /* Needs IAR language extensions */ + #define __RESTRICT restrict + #endif +#endif + +#ifndef __STATIC_INLINE + #define __STATIC_INLINE static inline +#endif + +#ifndef __FORCEINLINE + #define __FORCEINLINE _Pragma("inline=forced") +#endif + +#ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE __FORCEINLINE __STATIC_INLINE +#endif + +#ifndef __UNALIGNED_UINT16_READ +#pragma language=save +#pragma language=extended +__IAR_FT uint16_t __iar_uint16_read(void const *ptr) +{ + return *(__packed uint16_t*)(ptr); +} +#pragma language=restore +#define __UNALIGNED_UINT16_READ(PTR) __iar_uint16_read(PTR) +#endif + + +#ifndef __UNALIGNED_UINT16_WRITE +#pragma language=save +#pragma language=extended +__IAR_FT void __iar_uint16_write(void const *ptr, uint16_t val) +{ + *(__packed uint16_t*)(ptr) = val;; +} +#pragma language=restore +#define __UNALIGNED_UINT16_WRITE(PTR,VAL) __iar_uint16_write(PTR,VAL) +#endif + +#ifndef __UNALIGNED_UINT32_READ +#pragma language=save +#pragma language=extended +__IAR_FT uint32_t __iar_uint32_read(void const *ptr) +{ + return *(__packed uint32_t*)(ptr); +} +#pragma language=restore +#define __UNALIGNED_UINT32_READ(PTR) __iar_uint32_read(PTR) +#endif + +#ifndef __UNALIGNED_UINT32_WRITE +#pragma language=save +#pragma language=extended +__IAR_FT void __iar_uint32_write(void const *ptr, uint32_t val) +{ + *(__packed uint32_t*)(ptr) = val;; +} +#pragma language=restore +#define __UNALIGNED_UINT32_WRITE(PTR,VAL) __iar_uint32_write(PTR,VAL) +#endif + +#ifndef __UNALIGNED_UINT32 /* deprecated */ +#pragma language=save +#pragma language=extended +__packed struct __iar_u32 { uint32_t v; }; +#pragma language=restore +#define __UNALIGNED_UINT32(PTR) (((struct __iar_u32 *)(PTR))->v) +#endif + +#ifndef __USED + #if __ICCARM_V8 + #define __USED __attribute__((used)) + #else + #define __USED _Pragma("__root") + #endif +#endif + +#ifndef __WEAK + #if __ICCARM_V8 + #define __WEAK __attribute__((weak)) + #else + #define __WEAK _Pragma("__weak") + #endif +#endif + +#ifndef __PROGRAM_START +#define __PROGRAM_START __iar_program_start +#endif + +#ifndef __INITIAL_SP +#define __INITIAL_SP CSTACK$$Limit +#endif + +#ifndef __STACK_LIMIT +#define __STACK_LIMIT CSTACK$$Base +#endif + +#ifndef __VECTOR_TABLE +#define __VECTOR_TABLE __vector_table +#endif + +#ifndef __VECTOR_TABLE_ATTRIBUTE +#define __VECTOR_TABLE_ATTRIBUTE @".intvec" +#endif + +#ifndef __ICCARM_INTRINSICS_VERSION__ + #define __ICCARM_INTRINSICS_VERSION__ 0 +#endif + +#if __ICCARM_INTRINSICS_VERSION__ == 2 + + #if defined(__CLZ) + #undef __CLZ + #endif + #if defined(__REVSH) + #undef __REVSH + #endif + #if defined(__RBIT) + #undef __RBIT + #endif + #if defined(__SSAT) + #undef __SSAT + #endif + #if defined(__USAT) + #undef __USAT + #endif + + #include "iccarm_builtin.h" + + #define __disable_fault_irq __iar_builtin_disable_fiq + #define __disable_irq __iar_builtin_disable_interrupt + #define __enable_fault_irq __iar_builtin_enable_fiq + #define __enable_irq __iar_builtin_enable_interrupt + #define __arm_rsr __iar_builtin_rsr + #define __arm_wsr __iar_builtin_wsr + + + #define __get_APSR() (__arm_rsr("APSR")) + #define __get_BASEPRI() (__arm_rsr("BASEPRI")) + #define __get_CONTROL() (__arm_rsr("CONTROL")) + #define __get_FAULTMASK() (__arm_rsr("FAULTMASK")) + + #if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) + #define __get_FPSCR() (__arm_rsr("FPSCR")) + #define __set_FPSCR(VALUE) (__arm_wsr("FPSCR", (VALUE))) + #else + #define __get_FPSCR() ( 0 ) + #define __set_FPSCR(VALUE) ((void)VALUE) + #endif + + #define __get_IPSR() (__arm_rsr("IPSR")) + #define __get_MSP() (__arm_rsr("MSP")) + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + #define __get_MSPLIM() (0U) + #else + #define __get_MSPLIM() (__arm_rsr("MSPLIM")) + #endif + #define __get_PRIMASK() (__arm_rsr("PRIMASK")) + #define __get_PSP() (__arm_rsr("PSP")) + + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + #define __get_PSPLIM() (0U) + #else + #define __get_PSPLIM() (__arm_rsr("PSPLIM")) + #endif + + #define __get_xPSR() (__arm_rsr("xPSR")) + + #define __set_BASEPRI(VALUE) (__arm_wsr("BASEPRI", (VALUE))) + #define __set_BASEPRI_MAX(VALUE) (__arm_wsr("BASEPRI_MAX", (VALUE))) + #define __set_CONTROL(VALUE) (__arm_wsr("CONTROL", (VALUE))) + #define __set_FAULTMASK(VALUE) (__arm_wsr("FAULTMASK", (VALUE))) + #define __set_MSP(VALUE) (__arm_wsr("MSP", (VALUE))) + + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + #define __set_MSPLIM(VALUE) ((void)(VALUE)) + #else + #define __set_MSPLIM(VALUE) (__arm_wsr("MSPLIM", (VALUE))) + #endif + #define __set_PRIMASK(VALUE) (__arm_wsr("PRIMASK", (VALUE))) + #define __set_PSP(VALUE) (__arm_wsr("PSP", (VALUE))) + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + #define __set_PSPLIM(VALUE) ((void)(VALUE)) + #else + #define __set_PSPLIM(VALUE) (__arm_wsr("PSPLIM", (VALUE))) + #endif + + #define __TZ_get_CONTROL_NS() (__arm_rsr("CONTROL_NS")) + #define __TZ_set_CONTROL_NS(VALUE) (__arm_wsr("CONTROL_NS", (VALUE))) + #define __TZ_get_PSP_NS() (__arm_rsr("PSP_NS")) + #define __TZ_set_PSP_NS(VALUE) (__arm_wsr("PSP_NS", (VALUE))) + #define __TZ_get_MSP_NS() (__arm_rsr("MSP_NS")) + #define __TZ_set_MSP_NS(VALUE) (__arm_wsr("MSP_NS", (VALUE))) + #define __TZ_get_SP_NS() (__arm_rsr("SP_NS")) + #define __TZ_set_SP_NS(VALUE) (__arm_wsr("SP_NS", (VALUE))) + #define __TZ_get_PRIMASK_NS() (__arm_rsr("PRIMASK_NS")) + #define __TZ_set_PRIMASK_NS(VALUE) (__arm_wsr("PRIMASK_NS", (VALUE))) + #define __TZ_get_BASEPRI_NS() (__arm_rsr("BASEPRI_NS")) + #define __TZ_set_BASEPRI_NS(VALUE) (__arm_wsr("BASEPRI_NS", (VALUE))) + #define __TZ_get_FAULTMASK_NS() (__arm_rsr("FAULTMASK_NS")) + #define __TZ_set_FAULTMASK_NS(VALUE)(__arm_wsr("FAULTMASK_NS", (VALUE))) + + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + #define __TZ_get_PSPLIM_NS() (0U) + #define __TZ_set_PSPLIM_NS(VALUE) ((void)(VALUE)) + #else + #define __TZ_get_PSPLIM_NS() (__arm_rsr("PSPLIM_NS")) + #define __TZ_set_PSPLIM_NS(VALUE) (__arm_wsr("PSPLIM_NS", (VALUE))) + #endif + + #define __TZ_get_MSPLIM_NS() (__arm_rsr("MSPLIM_NS")) + #define __TZ_set_MSPLIM_NS(VALUE) (__arm_wsr("MSPLIM_NS", (VALUE))) + + #define __NOP __iar_builtin_no_operation + + #define __CLZ __iar_builtin_CLZ + #define __CLREX __iar_builtin_CLREX + + #define __DMB __iar_builtin_DMB + #define __DSB __iar_builtin_DSB + #define __ISB __iar_builtin_ISB + + #define __LDREXB __iar_builtin_LDREXB + #define __LDREXH __iar_builtin_LDREXH + #define __LDREXW __iar_builtin_LDREX + + #define __RBIT __iar_builtin_RBIT + #define __REV __iar_builtin_REV + #define __REV16 __iar_builtin_REV16 + + __IAR_FT int16_t __REVSH(int16_t val) + { + return (int16_t) __iar_builtin_REVSH(val); + } + + #define __ROR __iar_builtin_ROR + #define __RRX __iar_builtin_RRX + + #define __SEV __iar_builtin_SEV + + #if !__IAR_M0_FAMILY + #define __SSAT __iar_builtin_SSAT + #endif + + #define __STREXB __iar_builtin_STREXB + #define __STREXH __iar_builtin_STREXH + #define __STREXW __iar_builtin_STREX + + #if !__IAR_M0_FAMILY + #define __USAT __iar_builtin_USAT + #endif + + #define __WFE __iar_builtin_WFE + #define __WFI __iar_builtin_WFI + + #if __ARM_MEDIA__ + #define __SADD8 __iar_builtin_SADD8 + #define __QADD8 __iar_builtin_QADD8 + #define __SHADD8 __iar_builtin_SHADD8 + #define __UADD8 __iar_builtin_UADD8 + #define __UQADD8 __iar_builtin_UQADD8 + #define __UHADD8 __iar_builtin_UHADD8 + #define __SSUB8 __iar_builtin_SSUB8 + #define __QSUB8 __iar_builtin_QSUB8 + #define __SHSUB8 __iar_builtin_SHSUB8 + #define __USUB8 __iar_builtin_USUB8 + #define __UQSUB8 __iar_builtin_UQSUB8 + #define __UHSUB8 __iar_builtin_UHSUB8 + #define __SADD16 __iar_builtin_SADD16 + #define __QADD16 __iar_builtin_QADD16 + #define __SHADD16 __iar_builtin_SHADD16 + #define __UADD16 __iar_builtin_UADD16 + #define __UQADD16 __iar_builtin_UQADD16 + #define __UHADD16 __iar_builtin_UHADD16 + #define __SSUB16 __iar_builtin_SSUB16 + #define __QSUB16 __iar_builtin_QSUB16 + #define __SHSUB16 __iar_builtin_SHSUB16 + #define __USUB16 __iar_builtin_USUB16 + #define __UQSUB16 __iar_builtin_UQSUB16 + #define __UHSUB16 __iar_builtin_UHSUB16 + #define __SASX __iar_builtin_SASX + #define __QASX __iar_builtin_QASX + #define __SHASX __iar_builtin_SHASX + #define __UASX __iar_builtin_UASX + #define __UQASX __iar_builtin_UQASX + #define __UHASX __iar_builtin_UHASX + #define __SSAX __iar_builtin_SSAX + #define __QSAX __iar_builtin_QSAX + #define __SHSAX __iar_builtin_SHSAX + #define __USAX __iar_builtin_USAX + #define __UQSAX __iar_builtin_UQSAX + #define __UHSAX __iar_builtin_UHSAX + #define __USAD8 __iar_builtin_USAD8 + #define __USADA8 __iar_builtin_USADA8 + #define __SSAT16 __iar_builtin_SSAT16 + #define __USAT16 __iar_builtin_USAT16 + #define __UXTB16 __iar_builtin_UXTB16 + #define __UXTAB16 __iar_builtin_UXTAB16 + #define __SXTB16 __iar_builtin_SXTB16 + #define __SXTAB16 __iar_builtin_SXTAB16 + #define __SMUAD __iar_builtin_SMUAD + #define __SMUADX __iar_builtin_SMUADX + #define __SMMLA __iar_builtin_SMMLA + #define __SMLAD __iar_builtin_SMLAD + #define __SMLADX __iar_builtin_SMLADX + #define __SMLALD __iar_builtin_SMLALD + #define __SMLALDX __iar_builtin_SMLALDX + #define __SMUSD __iar_builtin_SMUSD + #define __SMUSDX __iar_builtin_SMUSDX + #define __SMLSD __iar_builtin_SMLSD + #define __SMLSDX __iar_builtin_SMLSDX + #define __SMLSLD __iar_builtin_SMLSLD + #define __SMLSLDX __iar_builtin_SMLSLDX + #define __SEL __iar_builtin_SEL + #define __QADD __iar_builtin_QADD + #define __QSUB __iar_builtin_QSUB + #define __PKHBT __iar_builtin_PKHBT + #define __PKHTB __iar_builtin_PKHTB + #endif + +#else /* __ICCARM_INTRINSICS_VERSION__ == 2 */ + + #if __IAR_M0_FAMILY + /* Avoid clash between intrinsics.h and arm_math.h when compiling for Cortex-M0. */ + #define __CLZ __cmsis_iar_clz_not_active + #define __SSAT __cmsis_iar_ssat_not_active + #define __USAT __cmsis_iar_usat_not_active + #define __RBIT __cmsis_iar_rbit_not_active + #define __get_APSR __cmsis_iar_get_APSR_not_active + #endif + + + #if (!((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) )) + #define __get_FPSCR __cmsis_iar_get_FPSR_not_active + #define __set_FPSCR __cmsis_iar_set_FPSR_not_active + #endif + + #ifdef __INTRINSICS_INCLUDED + #error intrinsics.h is already included previously! + #endif + + #include + + #if __IAR_M0_FAMILY + /* Avoid clash between intrinsics.h and arm_math.h when compiling for Cortex-M0. */ + #undef __CLZ + #undef __SSAT + #undef __USAT + #undef __RBIT + #undef __get_APSR + + __STATIC_INLINE uint8_t __CLZ(uint32_t data) + { + if (data == 0U) { return 32U; } + + uint32_t count = 0U; + uint32_t mask = 0x80000000U; + + while ((data & mask) == 0U) + { + count += 1U; + mask = mask >> 1U; + } + return count; + } + + __STATIC_INLINE uint32_t __RBIT(uint32_t v) + { + uint8_t sc = 31U; + uint32_t r = v; + for (v >>= 1U; v; v >>= 1U) + { + r <<= 1U; + r |= v & 1U; + sc--; + } + return (r << sc); + } + + __STATIC_INLINE uint32_t __get_APSR(void) + { + uint32_t res; + __asm("MRS %0,APSR" : "=r" (res)); + return res; + } + + #endif + + #if (!((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) )) + #undef __get_FPSCR + #undef __set_FPSCR + #define __get_FPSCR() (0) + #define __set_FPSCR(VALUE) ((void)VALUE) + #endif + + #pragma diag_suppress=Pe940 + #pragma diag_suppress=Pe177 + + #define __enable_irq __enable_interrupt + #define __disable_irq __disable_interrupt + #define __NOP __no_operation + + #define __get_xPSR __get_PSR + + #if (!defined(__ARM_ARCH_6M__) || __ARM_ARCH_6M__==0) + + __IAR_FT uint32_t __LDREXW(uint32_t volatile *ptr) + { + return __LDREX((unsigned long *)ptr); + } + + __IAR_FT uint32_t __STREXW(uint32_t value, uint32_t volatile *ptr) + { + return __STREX(value, (unsigned long *)ptr); + } + #endif + + + /* __CORTEX_M is defined in core_cm0.h, core_cm3.h and core_cm4.h. */ + #if (__CORTEX_M >= 0x03) + + __IAR_FT uint32_t __RRX(uint32_t value) + { + uint32_t result; + __ASM("RRX %0, %1" : "=r"(result) : "r" (value) : "cc"); + return(result); + } + + __IAR_FT void __set_BASEPRI_MAX(uint32_t value) + { + __asm volatile("MSR BASEPRI_MAX,%0"::"r" (value)); + } + + + #define __enable_fault_irq __enable_fiq + #define __disable_fault_irq __disable_fiq + + + #endif /* (__CORTEX_M >= 0x03) */ + + __IAR_FT uint32_t __ROR(uint32_t op1, uint32_t op2) + { + return (op1 >> op2) | (op1 << ((sizeof(op1)*8)-op2)); + } + + #if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) + + __IAR_FT uint32_t __get_MSPLIM(void) + { + uint32_t res; + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + res = 0U; + #else + __asm volatile("MRS %0,MSPLIM" : "=r" (res)); + #endif + return res; + } + + __IAR_FT void __set_MSPLIM(uint32_t value) + { + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)value; + #else + __asm volatile("MSR MSPLIM,%0" :: "r" (value)); + #endif + } + + __IAR_FT uint32_t __get_PSPLIM(void) + { + uint32_t res; + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + res = 0U; + #else + __asm volatile("MRS %0,PSPLIM" : "=r" (res)); + #endif + return res; + } + + __IAR_FT void __set_PSPLIM(uint32_t value) + { + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)value; + #else + __asm volatile("MSR PSPLIM,%0" :: "r" (value)); + #endif + } + + __IAR_FT uint32_t __TZ_get_CONTROL_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,CONTROL_NS" : "=r" (res)); + return res; + } + + __IAR_FT void __TZ_set_CONTROL_NS(uint32_t value) + { + __asm volatile("MSR CONTROL_NS,%0" :: "r" (value)); + } + + __IAR_FT uint32_t __TZ_get_PSP_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,PSP_NS" : "=r" (res)); + return res; + } + + __IAR_FT void __TZ_set_PSP_NS(uint32_t value) + { + __asm volatile("MSR PSP_NS,%0" :: "r" (value)); + } + + __IAR_FT uint32_t __TZ_get_MSP_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,MSP_NS" : "=r" (res)); + return res; + } + + __IAR_FT void __TZ_set_MSP_NS(uint32_t value) + { + __asm volatile("MSR MSP_NS,%0" :: "r" (value)); + } + + __IAR_FT uint32_t __TZ_get_SP_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,SP_NS" : "=r" (res)); + return res; + } + __IAR_FT void __TZ_set_SP_NS(uint32_t value) + { + __asm volatile("MSR SP_NS,%0" :: "r" (value)); + } + + __IAR_FT uint32_t __TZ_get_PRIMASK_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,PRIMASK_NS" : "=r" (res)); + return res; + } + + __IAR_FT void __TZ_set_PRIMASK_NS(uint32_t value) + { + __asm volatile("MSR PRIMASK_NS,%0" :: "r" (value)); + } + + __IAR_FT uint32_t __TZ_get_BASEPRI_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,BASEPRI_NS" : "=r" (res)); + return res; + } + + __IAR_FT void __TZ_set_BASEPRI_NS(uint32_t value) + { + __asm volatile("MSR BASEPRI_NS,%0" :: "r" (value)); + } + + __IAR_FT uint32_t __TZ_get_FAULTMASK_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,FAULTMASK_NS" : "=r" (res)); + return res; + } + + __IAR_FT void __TZ_set_FAULTMASK_NS(uint32_t value) + { + __asm volatile("MSR FAULTMASK_NS,%0" :: "r" (value)); + } + + __IAR_FT uint32_t __TZ_get_PSPLIM_NS(void) + { + uint32_t res; + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + res = 0U; + #else + __asm volatile("MRS %0,PSPLIM_NS" : "=r" (res)); + #endif + return res; + } + + __IAR_FT void __TZ_set_PSPLIM_NS(uint32_t value) + { + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)value; + #else + __asm volatile("MSR PSPLIM_NS,%0" :: "r" (value)); + #endif + } + + __IAR_FT uint32_t __TZ_get_MSPLIM_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,MSPLIM_NS" : "=r" (res)); + return res; + } + + __IAR_FT void __TZ_set_MSPLIM_NS(uint32_t value) + { + __asm volatile("MSR MSPLIM_NS,%0" :: "r" (value)); + } + + #endif /* __ARM_ARCH_8M_MAIN__ or __ARM_ARCH_8M_BASE__ */ + +#endif /* __ICCARM_INTRINSICS_VERSION__ == 2 */ + +#define __BKPT(value) __asm volatile ("BKPT %0" : : "i"(value)) + +#if __IAR_M0_FAMILY + __STATIC_INLINE int32_t __SSAT(int32_t val, uint32_t sat) + { + if ((sat >= 1U) && (sat <= 32U)) + { + const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); + const int32_t min = -1 - max ; + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + } + return val; + } + + __STATIC_INLINE uint32_t __USAT(int32_t val, uint32_t sat) + { + if (sat <= 31U) + { + const uint32_t max = ((1U << sat) - 1U); + if (val > (int32_t)max) + { + return max; + } + else if (val < 0) + { + return 0U; + } + } + return (uint32_t)val; + } +#endif + +#if (__CORTEX_M >= 0x03) /* __CORTEX_M is defined in core_cm0.h, core_cm3.h and core_cm4.h. */ + + __IAR_FT uint8_t __LDRBT(volatile uint8_t *addr) + { + uint32_t res; + __ASM("LDRBT %0, [%1]" : "=r" (res) : "r" (addr) : "memory"); + return ((uint8_t)res); + } + + __IAR_FT uint16_t __LDRHT(volatile uint16_t *addr) + { + uint32_t res; + __ASM("LDRHT %0, [%1]" : "=r" (res) : "r" (addr) : "memory"); + return ((uint16_t)res); + } + + __IAR_FT uint32_t __LDRT(volatile uint32_t *addr) + { + uint32_t res; + __ASM("LDRT %0, [%1]" : "=r" (res) : "r" (addr) : "memory"); + return res; + } + + __IAR_FT void __STRBT(uint8_t value, volatile uint8_t *addr) + { + __ASM("STRBT %1, [%0]" : : "r" (addr), "r" ((uint32_t)value) : "memory"); + } + + __IAR_FT void __STRHT(uint16_t value, volatile uint16_t *addr) + { + __ASM("STRHT %1, [%0]" : : "r" (addr), "r" ((uint32_t)value) : "memory"); + } + + __IAR_FT void __STRT(uint32_t value, volatile uint32_t *addr) + { + __ASM("STRT %1, [%0]" : : "r" (addr), "r" (value) : "memory"); + } + +#endif /* (__CORTEX_M >= 0x03) */ + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) + + + __IAR_FT uint8_t __LDAB(volatile uint8_t *ptr) + { + uint32_t res; + __ASM volatile ("LDAB %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); + return ((uint8_t)res); + } + + __IAR_FT uint16_t __LDAH(volatile uint16_t *ptr) + { + uint32_t res; + __ASM volatile ("LDAH %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); + return ((uint16_t)res); + } + + __IAR_FT uint32_t __LDA(volatile uint32_t *ptr) + { + uint32_t res; + __ASM volatile ("LDA %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); + return res; + } + + __IAR_FT void __STLB(uint8_t value, volatile uint8_t *ptr) + { + __ASM volatile ("STLB %1, [%0]" :: "r" (ptr), "r" (value) : "memory"); + } + + __IAR_FT void __STLH(uint16_t value, volatile uint16_t *ptr) + { + __ASM volatile ("STLH %1, [%0]" :: "r" (ptr), "r" (value) : "memory"); + } + + __IAR_FT void __STL(uint32_t value, volatile uint32_t *ptr) + { + __ASM volatile ("STL %1, [%0]" :: "r" (ptr), "r" (value) : "memory"); + } + + __IAR_FT uint8_t __LDAEXB(volatile uint8_t *ptr) + { + uint32_t res; + __ASM volatile ("LDAEXB %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); + return ((uint8_t)res); + } + + __IAR_FT uint16_t __LDAEXH(volatile uint16_t *ptr) + { + uint32_t res; + __ASM volatile ("LDAEXH %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); + return ((uint16_t)res); + } + + __IAR_FT uint32_t __LDAEX(volatile uint32_t *ptr) + { + uint32_t res; + __ASM volatile ("LDAEX %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); + return res; + } + + __IAR_FT uint32_t __STLEXB(uint8_t value, volatile uint8_t *ptr) + { + uint32_t res; + __ASM volatile ("STLEXB %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory"); + return res; + } + + __IAR_FT uint32_t __STLEXH(uint16_t value, volatile uint16_t *ptr) + { + uint32_t res; + __ASM volatile ("STLEXH %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory"); + return res; + } + + __IAR_FT uint32_t __STLEX(uint32_t value, volatile uint32_t *ptr) + { + uint32_t res; + __ASM volatile ("STLEX %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory"); + return res; + } + +#endif /* __ARM_ARCH_8M_MAIN__ or __ARM_ARCH_8M_BASE__ */ + +#undef __IAR_FT +#undef __IAR_M0_FAMILY +#undef __ICCARM_V8 + +#pragma diag_default=Pe940 +#pragma diag_default=Pe177 + +#endif /* __CMSIS_ICCARM_H__ */ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_version.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_version.h new file mode 100644 index 0000000000..f2e2746626 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/cmsis_version.h @@ -0,0 +1,39 @@ +/**************************************************************************//** + * @file cmsis_version.h + * @brief CMSIS Core(M) Version definitions + * @version V5.0.3 + * @date 24. June 2019 + ******************************************************************************/ +/* + * Copyright (c) 2009-2019 ARM Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CMSIS_VERSION_H +#define __CMSIS_VERSION_H + +/* CMSIS Version definitions */ +#define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */ +#define __CM_CMSIS_VERSION_SUB ( 3U) /*!< [15:0] CMSIS Core(M) sub version */ +#define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \ + __CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */ +#endif diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/core_armv81mml.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_armv81mml.h new file mode 100644 index 0000000000..8441e57fb1 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_armv81mml.h @@ -0,0 +1,2968 @@ +/**************************************************************************//** + * @file core_armv81mml.h + * @brief CMSIS Armv8.1-M Mainline Core Peripheral Access Layer Header File + * @version V1.0.0 + * @date 15. March 2019 + ******************************************************************************/ +/* + * Copyright (c) 2018-2019 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_ARMV81MML_H_GENERIC +#define __CORE_ARMV81MML_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_ARMV81MML + @{ + */ + +#include "cmsis_version.h" + +#define __ARM_ARCH_8M_MAIN__ 1 // patching for now +/* CMSIS ARMV81MML definitions */ +#define __ARMv81MML_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __ARMv81MML_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __ARMv81MML_CMSIS_VERSION ((__ARMv81MML_CMSIS_VERSION_MAIN << 16U) | \ + __ARMv81MML_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M (81U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions. +*/ +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined(__ARM_FEATURE_DSP) + #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_FP + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined(__ARM_FEATURE_DSP) + #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined(__ARM_FEATURE_DSP) + #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined(__ARM_FEATURE_DSP) + #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_ARMV81MML_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_ARMV81MML_H_DEPENDANT +#define __CORE_ARMV81MML_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __ARMv81MML_REV + #define __ARMv81MML_REV 0x0000U + #warning "__ARMv81MML_REV not defined in device header file; using default!" + #endif + + #ifndef __FPU_PRESENT + #define __FPU_PRESENT 0U + #warning "__FPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __SAUREGION_PRESENT + #define __SAUREGION_PRESENT 0U + #warning "__SAUREGION_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __DSP_PRESENT + #define __DSP_PRESENT 0U + #warning "__DSP_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 3U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group ARMv81MML */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + - Core SAU Register + - Core FPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + +#define APSR_Q_Pos 27U /*!< APSR: Q Position */ +#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ + +#define APSR_GE_Pos 16U /*!< APSR: GE Position */ +#define APSR_GE_Msk (0xFUL << APSR_GE_Pos) /*!< APSR: GE Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */ +#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ + +#define xPSR_IT_Pos 25U /*!< xPSR: IT Position */ +#define xPSR_IT_Msk (3UL << xPSR_IT_Pos) /*!< xPSR: IT Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_GE_Pos 16U /*!< xPSR: GE Position */ +#define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos) /*!< xPSR: GE Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack-pointer select */ + uint32_t FPCA:1; /*!< bit: 2 Floating-point context active */ + uint32_t SFPA:1; /*!< bit: 3 Secure floating-point active */ + uint32_t _reserved1:28; /*!< bit: 4..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SFPA_Pos 3U /*!< CONTROL: SFPA Position */ +#define CONTROL_SFPA_Msk (1UL << CONTROL_SFPA_Pos) /*!< CONTROL: SFPA Mask */ + +#define CONTROL_FPCA_Pos 2U /*!< CONTROL: FPCA Position */ +#define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos) /*!< CONTROL: FPCA Mask */ + +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[16U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[16U]; + __IOM uint32_t ICER[16U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[16U]; + __IOM uint32_t ISPR[16U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[16U]; + __IOM uint32_t ICPR[16U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[16U]; + __IOM uint32_t IABR[16U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[16U]; + __IOM uint32_t ITNS[16U]; /*!< Offset: 0x280 (R/W) Interrupt Non-Secure State Register */ + uint32_t RESERVED5[16U]; + __IOM uint8_t IPR[496U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ + uint32_t RESERVED6[580U]; + __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ +} NVIC_Type; + +/* Software Triggered Interrupt Register Definitions */ +#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ +#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + __IOM uint8_t SHPR[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ + __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ + __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ + __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ + __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ + __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ + __IM uint32_t ID_PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ + __IM uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ + __IM uint32_t ID_ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t ID_MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ + __IM uint32_t ID_ISAR[6U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ + __IM uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */ + __IM uint32_t CTR; /*!< Offset: 0x07C (R/ ) Cache Type register */ + __IM uint32_t CCSIDR; /*!< Offset: 0x080 (R/ ) Cache Size ID Register */ + __IOM uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */ + __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ + __IOM uint32_t NSACR; /*!< Offset: 0x08C (R/W) Non-Secure Access Control Register */ + uint32_t RESERVED3[92U]; + __OM uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */ + uint32_t RESERVED4[15U]; + __IM uint32_t MVFR0; /*!< Offset: 0x240 (R/ ) Media and VFP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x244 (R/ ) Media and VFP Feature Register 1 */ + __IM uint32_t MVFR2; /*!< Offset: 0x248 (R/ ) Media and VFP Feature Register 2 */ + uint32_t RESERVED5[1U]; + __OM uint32_t ICIALLU; /*!< Offset: 0x250 ( /W) I-Cache Invalidate All to PoU */ + uint32_t RESERVED6[1U]; + __OM uint32_t ICIMVAU; /*!< Offset: 0x258 ( /W) I-Cache Invalidate by MVA to PoU */ + __OM uint32_t DCIMVAC; /*!< Offset: 0x25C ( /W) D-Cache Invalidate by MVA to PoC */ + __OM uint32_t DCISW; /*!< Offset: 0x260 ( /W) D-Cache Invalidate by Set-way */ + __OM uint32_t DCCMVAU; /*!< Offset: 0x264 ( /W) D-Cache Clean by MVA to PoU */ + __OM uint32_t DCCMVAC; /*!< Offset: 0x268 ( /W) D-Cache Clean by MVA to PoC */ + __OM uint32_t DCCSW; /*!< Offset: 0x26C ( /W) D-Cache Clean by Set-way */ + __OM uint32_t DCCIMVAC; /*!< Offset: 0x270 ( /W) D-Cache Clean and Invalidate by MVA to PoC */ + __OM uint32_t DCCISW; /*!< Offset: 0x274 ( /W) D-Cache Clean and Invalidate by Set-way */ + uint32_t RESERVED7[6U]; + __IOM uint32_t ITCMCR; /*!< Offset: 0x290 (R/W) Instruction Tightly-Coupled Memory Control Register */ + __IOM uint32_t DTCMCR; /*!< Offset: 0x294 (R/W) Data Tightly-Coupled Memory Control Registers */ + __IOM uint32_t AHBPCR; /*!< Offset: 0x298 (R/W) AHBP Control Register */ + __IOM uint32_t CACR; /*!< Offset: 0x29C (R/W) L1 Cache Control Register */ + __IOM uint32_t AHBSCR; /*!< Offset: 0x2A0 (R/W) AHB Slave Control Register */ + uint32_t RESERVED8[1U]; + __IOM uint32_t ABFSR; /*!< Offset: 0x2A8 (R/W) Auxiliary Bus Fault Status Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_PENDNMISET_Pos 31U /*!< SCB ICSR: PENDNMISET Position */ +#define SCB_ICSR_PENDNMISET_Msk (1UL << SCB_ICSR_PENDNMISET_Pos) /*!< SCB ICSR: PENDNMISET Mask */ + +#define SCB_ICSR_NMIPENDSET_Pos SCB_ICSR_PENDNMISET_Pos /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */ +#define SCB_ICSR_NMIPENDSET_Msk SCB_ICSR_PENDNMISET_Msk /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */ + +#define SCB_ICSR_PENDNMICLR_Pos 30U /*!< SCB ICSR: PENDNMICLR Position */ +#define SCB_ICSR_PENDNMICLR_Msk (1UL << SCB_ICSR_PENDNMICLR_Pos) /*!< SCB ICSR: PENDNMICLR Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_STTNS_Pos 24U /*!< SCB ICSR: STTNS Position (Security Extension) */ +#define SCB_ICSR_STTNS_Msk (1UL << SCB_ICSR_STTNS_Pos) /*!< SCB ICSR: STTNS Mask (Security Extension) */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Vector Table Offset Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIS_Pos 14U /*!< SCB AIRCR: PRIS Position */ +#define SCB_AIRCR_PRIS_Msk (1UL << SCB_AIRCR_PRIS_Pos) /*!< SCB AIRCR: PRIS Mask */ + +#define SCB_AIRCR_BFHFNMINS_Pos 13U /*!< SCB AIRCR: BFHFNMINS Position */ +#define SCB_AIRCR_BFHFNMINS_Msk (1UL << SCB_AIRCR_BFHFNMINS_Pos) /*!< SCB AIRCR: BFHFNMINS Mask */ + +#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */ +#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ + +#define SCB_AIRCR_SYSRESETREQS_Pos 3U /*!< SCB AIRCR: SYSRESETREQS Position */ +#define SCB_AIRCR_SYSRESETREQS_Msk (1UL << SCB_AIRCR_SYSRESETREQS_Pos) /*!< SCB AIRCR: SYSRESETREQS Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEPS_Pos 3U /*!< SCB SCR: SLEEPDEEPS Position */ +#define SCB_SCR_SLEEPDEEPS_Msk (1UL << SCB_SCR_SLEEPDEEPS_Pos) /*!< SCB SCR: SLEEPDEEPS Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_BP_Pos 18U /*!< SCB CCR: BP Position */ +#define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: BP Mask */ + +#define SCB_CCR_IC_Pos 17U /*!< SCB CCR: IC Position */ +#define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: IC Mask */ + +#define SCB_CCR_DC_Pos 16U /*!< SCB CCR: DC Position */ +#define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: DC Mask */ + +#define SCB_CCR_STKOFHFNMIGN_Pos 10U /*!< SCB CCR: STKOFHFNMIGN Position */ +#define SCB_CCR_STKOFHFNMIGN_Msk (1UL << SCB_CCR_STKOFHFNMIGN_Pos) /*!< SCB CCR: STKOFHFNMIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_HARDFAULTPENDED_Pos 21U /*!< SCB SHCSR: HARDFAULTPENDED Position */ +#define SCB_SHCSR_HARDFAULTPENDED_Msk (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos) /*!< SCB SHCSR: HARDFAULTPENDED Mask */ + +#define SCB_SHCSR_SECUREFAULTPENDED_Pos 20U /*!< SCB SHCSR: SECUREFAULTPENDED Position */ +#define SCB_SHCSR_SECUREFAULTPENDED_Msk (1UL << SCB_SHCSR_SECUREFAULTPENDED_Pos) /*!< SCB SHCSR: SECUREFAULTPENDED Mask */ + +#define SCB_SHCSR_SECUREFAULTENA_Pos 19U /*!< SCB SHCSR: SECUREFAULTENA Position */ +#define SCB_SHCSR_SECUREFAULTENA_Msk (1UL << SCB_SHCSR_SECUREFAULTENA_Pos) /*!< SCB SHCSR: SECUREFAULTENA Mask */ + +#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */ +#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ + +#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */ +#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ + +#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */ +#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */ +#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ + +#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */ +#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ + +#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */ +#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */ +#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_NMIACT_Pos 5U /*!< SCB SHCSR: NMIACT Position */ +#define SCB_SHCSR_NMIACT_Msk (1UL << SCB_SHCSR_NMIACT_Pos) /*!< SCB SHCSR: NMIACT Mask */ + +#define SCB_SHCSR_SECUREFAULTACT_Pos 4U /*!< SCB SHCSR: SECUREFAULTACT Position */ +#define SCB_SHCSR_SECUREFAULTACT_Msk (1UL << SCB_SHCSR_SECUREFAULTACT_Pos) /*!< SCB SHCSR: SECUREFAULTACT Mask */ + +#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */ +#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ + +#define SCB_SHCSR_HARDFAULTACT_Pos 2U /*!< SCB SHCSR: HARDFAULTACT Position */ +#define SCB_SHCSR_HARDFAULTACT_Msk (1UL << SCB_SHCSR_HARDFAULTACT_Pos) /*!< SCB SHCSR: HARDFAULTACT Mask */ + +#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */ +#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ + +#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */ +#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ + +/* SCB Configurable Fault Status Register Definitions */ +#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */ +#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ + +#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */ +#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ + +#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */ +#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ + +/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ + +#define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ +#define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ + +#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ + +#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ + +#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ + +#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ + +/* BusFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */ +#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */ + +#define SCB_CFSR_LSPERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 5U) /*!< SCB CFSR (BFSR): LSPERR Position */ +#define SCB_CFSR_LSPERR_Msk (1UL << SCB_CFSR_LSPERR_Pos) /*!< SCB CFSR (BFSR): LSPERR Mask */ + +#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */ +#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */ + +#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */ +#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */ + +#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */ +#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */ + +#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */ +#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */ + +#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */ +#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */ + +/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */ +#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */ + +#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */ +#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */ + +#define SCB_CFSR_STKOF_Pos (SCB_CFSR_USGFAULTSR_Pos + 4U) /*!< SCB CFSR (UFSR): STKOF Position */ +#define SCB_CFSR_STKOF_Msk (1UL << SCB_CFSR_STKOF_Pos) /*!< SCB CFSR (UFSR): STKOF Mask */ + +#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */ +#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */ + +#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */ +#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */ + +#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */ +#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */ + +#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */ +#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */ + +/* SCB Hard Fault Status Register Definitions */ +#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */ +#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ + +#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */ +#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ + +#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */ +#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ + +/* SCB Debug Fault Status Register Definitions */ +#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */ +#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ + +#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */ +#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ + +#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */ +#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ + +#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */ +#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ + +#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */ +#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ + +/* SCB Non-Secure Access Control Register Definitions */ +#define SCB_NSACR_CP11_Pos 11U /*!< SCB NSACR: CP11 Position */ +#define SCB_NSACR_CP11_Msk (1UL << SCB_NSACR_CP11_Pos) /*!< SCB NSACR: CP11 Mask */ + +#define SCB_NSACR_CP10_Pos 10U /*!< SCB NSACR: CP10 Position */ +#define SCB_NSACR_CP10_Msk (1UL << SCB_NSACR_CP10_Pos) /*!< SCB NSACR: CP10 Mask */ + +#define SCB_NSACR_CPn_Pos 0U /*!< SCB NSACR: CPn Position */ +#define SCB_NSACR_CPn_Msk (1UL /*<< SCB_NSACR_CPn_Pos*/) /*!< SCB NSACR: CPn Mask */ + +/* SCB Cache Level ID Register Definitions */ +#define SCB_CLIDR_LOUU_Pos 27U /*!< SCB CLIDR: LoUU Position */ +#define SCB_CLIDR_LOUU_Msk (7UL << SCB_CLIDR_LOUU_Pos) /*!< SCB CLIDR: LoUU Mask */ + +#define SCB_CLIDR_LOC_Pos 24U /*!< SCB CLIDR: LoC Position */ +#define SCB_CLIDR_LOC_Msk (7UL << SCB_CLIDR_LOC_Pos) /*!< SCB CLIDR: LoC Mask */ + +/* SCB Cache Type Register Definitions */ +#define SCB_CTR_FORMAT_Pos 29U /*!< SCB CTR: Format Position */ +#define SCB_CTR_FORMAT_Msk (7UL << SCB_CTR_FORMAT_Pos) /*!< SCB CTR: Format Mask */ + +#define SCB_CTR_CWG_Pos 24U /*!< SCB CTR: CWG Position */ +#define SCB_CTR_CWG_Msk (0xFUL << SCB_CTR_CWG_Pos) /*!< SCB CTR: CWG Mask */ + +#define SCB_CTR_ERG_Pos 20U /*!< SCB CTR: ERG Position */ +#define SCB_CTR_ERG_Msk (0xFUL << SCB_CTR_ERG_Pos) /*!< SCB CTR: ERG Mask */ + +#define SCB_CTR_DMINLINE_Pos 16U /*!< SCB CTR: DminLine Position */ +#define SCB_CTR_DMINLINE_Msk (0xFUL << SCB_CTR_DMINLINE_Pos) /*!< SCB CTR: DminLine Mask */ + +#define SCB_CTR_IMINLINE_Pos 0U /*!< SCB CTR: ImInLine Position */ +#define SCB_CTR_IMINLINE_Msk (0xFUL /*<< SCB_CTR_IMINLINE_Pos*/) /*!< SCB CTR: ImInLine Mask */ + +/* SCB Cache Size ID Register Definitions */ +#define SCB_CCSIDR_WT_Pos 31U /*!< SCB CCSIDR: WT Position */ +#define SCB_CCSIDR_WT_Msk (1UL << SCB_CCSIDR_WT_Pos) /*!< SCB CCSIDR: WT Mask */ + +#define SCB_CCSIDR_WB_Pos 30U /*!< SCB CCSIDR: WB Position */ +#define SCB_CCSIDR_WB_Msk (1UL << SCB_CCSIDR_WB_Pos) /*!< SCB CCSIDR: WB Mask */ + +#define SCB_CCSIDR_RA_Pos 29U /*!< SCB CCSIDR: RA Position */ +#define SCB_CCSIDR_RA_Msk (1UL << SCB_CCSIDR_RA_Pos) /*!< SCB CCSIDR: RA Mask */ + +#define SCB_CCSIDR_WA_Pos 28U /*!< SCB CCSIDR: WA Position */ +#define SCB_CCSIDR_WA_Msk (1UL << SCB_CCSIDR_WA_Pos) /*!< SCB CCSIDR: WA Mask */ + +#define SCB_CCSIDR_NUMSETS_Pos 13U /*!< SCB CCSIDR: NumSets Position */ +#define SCB_CCSIDR_NUMSETS_Msk (0x7FFFUL << SCB_CCSIDR_NUMSETS_Pos) /*!< SCB CCSIDR: NumSets Mask */ + +#define SCB_CCSIDR_ASSOCIATIVITY_Pos 3U /*!< SCB CCSIDR: Associativity Position */ +#define SCB_CCSIDR_ASSOCIATIVITY_Msk (0x3FFUL << SCB_CCSIDR_ASSOCIATIVITY_Pos) /*!< SCB CCSIDR: Associativity Mask */ + +#define SCB_CCSIDR_LINESIZE_Pos 0U /*!< SCB CCSIDR: LineSize Position */ +#define SCB_CCSIDR_LINESIZE_Msk (7UL /*<< SCB_CCSIDR_LINESIZE_Pos*/) /*!< SCB CCSIDR: LineSize Mask */ + +/* SCB Cache Size Selection Register Definitions */ +#define SCB_CSSELR_LEVEL_Pos 1U /*!< SCB CSSELR: Level Position */ +#define SCB_CSSELR_LEVEL_Msk (7UL << SCB_CSSELR_LEVEL_Pos) /*!< SCB CSSELR: Level Mask */ + +#define SCB_CSSELR_IND_Pos 0U /*!< SCB CSSELR: InD Position */ +#define SCB_CSSELR_IND_Msk (1UL /*<< SCB_CSSELR_IND_Pos*/) /*!< SCB CSSELR: InD Mask */ + +/* SCB Software Triggered Interrupt Register Definitions */ +#define SCB_STIR_INTID_Pos 0U /*!< SCB STIR: INTID Position */ +#define SCB_STIR_INTID_Msk (0x1FFUL /*<< SCB_STIR_INTID_Pos*/) /*!< SCB STIR: INTID Mask */ + +/* SCB D-Cache Invalidate by Set-way Register Definitions */ +#define SCB_DCISW_WAY_Pos 30U /*!< SCB DCISW: Way Position */ +#define SCB_DCISW_WAY_Msk (3UL << SCB_DCISW_WAY_Pos) /*!< SCB DCISW: Way Mask */ + +#define SCB_DCISW_SET_Pos 5U /*!< SCB DCISW: Set Position */ +#define SCB_DCISW_SET_Msk (0x1FFUL << SCB_DCISW_SET_Pos) /*!< SCB DCISW: Set Mask */ + +/* SCB D-Cache Clean by Set-way Register Definitions */ +#define SCB_DCCSW_WAY_Pos 30U /*!< SCB DCCSW: Way Position */ +#define SCB_DCCSW_WAY_Msk (3UL << SCB_DCCSW_WAY_Pos) /*!< SCB DCCSW: Way Mask */ + +#define SCB_DCCSW_SET_Pos 5U /*!< SCB DCCSW: Set Position */ +#define SCB_DCCSW_SET_Msk (0x1FFUL << SCB_DCCSW_SET_Pos) /*!< SCB DCCSW: Set Mask */ + +/* SCB D-Cache Clean and Invalidate by Set-way Register Definitions */ +#define SCB_DCCISW_WAY_Pos 30U /*!< SCB DCCISW: Way Position */ +#define SCB_DCCISW_WAY_Msk (3UL << SCB_DCCISW_WAY_Pos) /*!< SCB DCCISW: Way Mask */ + +#define SCB_DCCISW_SET_Pos 5U /*!< SCB DCCISW: Set Position */ +#define SCB_DCCISW_SET_Msk (0x1FFUL << SCB_DCCISW_SET_Pos) /*!< SCB DCCISW: Set Mask */ + +/* Instruction Tightly-Coupled Memory Control Register Definitions */ +#define SCB_ITCMCR_SZ_Pos 3U /*!< SCB ITCMCR: SZ Position */ +#define SCB_ITCMCR_SZ_Msk (0xFUL << SCB_ITCMCR_SZ_Pos) /*!< SCB ITCMCR: SZ Mask */ + +#define SCB_ITCMCR_RETEN_Pos 2U /*!< SCB ITCMCR: RETEN Position */ +#define SCB_ITCMCR_RETEN_Msk (1UL << SCB_ITCMCR_RETEN_Pos) /*!< SCB ITCMCR: RETEN Mask */ + +#define SCB_ITCMCR_RMW_Pos 1U /*!< SCB ITCMCR: RMW Position */ +#define SCB_ITCMCR_RMW_Msk (1UL << SCB_ITCMCR_RMW_Pos) /*!< SCB ITCMCR: RMW Mask */ + +#define SCB_ITCMCR_EN_Pos 0U /*!< SCB ITCMCR: EN Position */ +#define SCB_ITCMCR_EN_Msk (1UL /*<< SCB_ITCMCR_EN_Pos*/) /*!< SCB ITCMCR: EN Mask */ + +/* Data Tightly-Coupled Memory Control Register Definitions */ +#define SCB_DTCMCR_SZ_Pos 3U /*!< SCB DTCMCR: SZ Position */ +#define SCB_DTCMCR_SZ_Msk (0xFUL << SCB_DTCMCR_SZ_Pos) /*!< SCB DTCMCR: SZ Mask */ + +#define SCB_DTCMCR_RETEN_Pos 2U /*!< SCB DTCMCR: RETEN Position */ +#define SCB_DTCMCR_RETEN_Msk (1UL << SCB_DTCMCR_RETEN_Pos) /*!< SCB DTCMCR: RETEN Mask */ + +#define SCB_DTCMCR_RMW_Pos 1U /*!< SCB DTCMCR: RMW Position */ +#define SCB_DTCMCR_RMW_Msk (1UL << SCB_DTCMCR_RMW_Pos) /*!< SCB DTCMCR: RMW Mask */ + +#define SCB_DTCMCR_EN_Pos 0U /*!< SCB DTCMCR: EN Position */ +#define SCB_DTCMCR_EN_Msk (1UL /*<< SCB_DTCMCR_EN_Pos*/) /*!< SCB DTCMCR: EN Mask */ + +/* AHBP Control Register Definitions */ +#define SCB_AHBPCR_SZ_Pos 1U /*!< SCB AHBPCR: SZ Position */ +#define SCB_AHBPCR_SZ_Msk (7UL << SCB_AHBPCR_SZ_Pos) /*!< SCB AHBPCR: SZ Mask */ + +#define SCB_AHBPCR_EN_Pos 0U /*!< SCB AHBPCR: EN Position */ +#define SCB_AHBPCR_EN_Msk (1UL /*<< SCB_AHBPCR_EN_Pos*/) /*!< SCB AHBPCR: EN Mask */ + +/* L1 Cache Control Register Definitions */ +#define SCB_CACR_FORCEWT_Pos 2U /*!< SCB CACR: FORCEWT Position */ +#define SCB_CACR_FORCEWT_Msk (1UL << SCB_CACR_FORCEWT_Pos) /*!< SCB CACR: FORCEWT Mask */ + +#define SCB_CACR_ECCEN_Pos 1U /*!< SCB CACR: ECCEN Position */ +#define SCB_CACR_ECCEN_Msk (1UL << SCB_CACR_ECCEN_Pos) /*!< SCB CACR: ECCEN Mask */ + +#define SCB_CACR_SIWT_Pos 0U /*!< SCB CACR: SIWT Position */ +#define SCB_CACR_SIWT_Msk (1UL /*<< SCB_CACR_SIWT_Pos*/) /*!< SCB CACR: SIWT Mask */ + +/* AHBS Control Register Definitions */ +#define SCB_AHBSCR_INITCOUNT_Pos 11U /*!< SCB AHBSCR: INITCOUNT Position */ +#define SCB_AHBSCR_INITCOUNT_Msk (0x1FUL << SCB_AHBPCR_INITCOUNT_Pos) /*!< SCB AHBSCR: INITCOUNT Mask */ + +#define SCB_AHBSCR_TPRI_Pos 2U /*!< SCB AHBSCR: TPRI Position */ +#define SCB_AHBSCR_TPRI_Msk (0x1FFUL << SCB_AHBPCR_TPRI_Pos) /*!< SCB AHBSCR: TPRI Mask */ + +#define SCB_AHBSCR_CTL_Pos 0U /*!< SCB AHBSCR: CTL Position*/ +#define SCB_AHBSCR_CTL_Msk (3UL /*<< SCB_AHBPCR_CTL_Pos*/) /*!< SCB AHBSCR: CTL Mask */ + +/* Auxiliary Bus Fault Status Register Definitions */ +#define SCB_ABFSR_AXIMTYPE_Pos 8U /*!< SCB ABFSR: AXIMTYPE Position*/ +#define SCB_ABFSR_AXIMTYPE_Msk (3UL << SCB_ABFSR_AXIMTYPE_Pos) /*!< SCB ABFSR: AXIMTYPE Mask */ + +#define SCB_ABFSR_EPPB_Pos 4U /*!< SCB ABFSR: EPPB Position*/ +#define SCB_ABFSR_EPPB_Msk (1UL << SCB_ABFSR_EPPB_Pos) /*!< SCB ABFSR: EPPB Mask */ + +#define SCB_ABFSR_AXIM_Pos 3U /*!< SCB ABFSR: AXIM Position*/ +#define SCB_ABFSR_AXIM_Msk (1UL << SCB_ABFSR_AXIM_Pos) /*!< SCB ABFSR: AXIM Mask */ + +#define SCB_ABFSR_AHBP_Pos 2U /*!< SCB ABFSR: AHBP Position*/ +#define SCB_ABFSR_AHBP_Msk (1UL << SCB_ABFSR_AHBP_Pos) /*!< SCB ABFSR: AHBP Mask */ + +#define SCB_ABFSR_DTCM_Pos 1U /*!< SCB ABFSR: DTCM Position*/ +#define SCB_ABFSR_DTCM_Msk (1UL << SCB_ABFSR_DTCM_Pos) /*!< SCB ABFSR: DTCM Mask */ + +#define SCB_ABFSR_ITCM_Pos 0U /*!< SCB ABFSR: ITCM Position*/ +#define SCB_ABFSR_ITCM_Msk (1UL /*<< SCB_ABFSR_ITCM_Pos*/) /*!< SCB ABFSR: ITCM Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** + \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ + __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ + __IOM uint32_t CPPWR; /*!< Offset: 0x00C (R/W) Coprocessor Power Control Register */ +} SCnSCB_Type; + +/* Interrupt Controller Type Register Definitions */ +#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ +#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_SCnotSCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) + \brief Type definitions for the Instrumentation Trace Macrocell (ITM) + @{ + */ + +/** + \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). + */ +typedef struct +{ + __OM union + { + __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ + __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ + __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ + } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ + uint32_t RESERVED0[864U]; + __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ + uint32_t RESERVED1[15U]; + __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ + uint32_t RESERVED2[15U]; + __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ + uint32_t RESERVED3[29U]; + __OM uint32_t IWR; /*!< Offset: 0xEF8 ( /W) ITM Integration Write Register */ + __IM uint32_t IRR; /*!< Offset: 0xEFC (R/ ) ITM Integration Read Register */ + __IOM uint32_t IMCR; /*!< Offset: 0xF00 (R/W) ITM Integration Mode Control Register */ + uint32_t RESERVED4[43U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ + uint32_t RESERVED5[1U]; + __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) ITM Device Architecture Register */ + uint32_t RESERVED6[4U]; + __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ + __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ + __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ + __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ + __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ + __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ + __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ + __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ + __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ + __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ + __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ + __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ +} ITM_Type; + +/* ITM Stimulus Port Register Definitions */ +#define ITM_STIM_DISABLED_Pos 1U /*!< ITM STIM: DISABLED Position */ +#define ITM_STIM_DISABLED_Msk (0x1UL << ITM_STIM_DISABLED_Pos) /*!< ITM STIM: DISABLED Mask */ + +#define ITM_STIM_FIFOREADY_Pos 0U /*!< ITM STIM: FIFOREADY Position */ +#define ITM_STIM_FIFOREADY_Msk (0x1UL /*<< ITM_STIM_FIFOREADY_Pos*/) /*!< ITM STIM: FIFOREADY Mask */ + +/* ITM Trace Privilege Register Definitions */ +#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */ +#define ITM_TPR_PRIVMASK_Msk (0xFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ + +/* ITM Trace Control Register Definitions */ +#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */ +#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ + +#define ITM_TCR_TRACEBUSID_Pos 16U /*!< ITM TCR: ATBID Position */ +#define ITM_TCR_TRACEBUSID_Msk (0x7FUL << ITM_TCR_TRACEBUSID_Pos) /*!< ITM TCR: ATBID Mask */ + +#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */ +#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ + +#define ITM_TCR_TSPRESCALE_Pos 8U /*!< ITM TCR: TSPRESCALE Position */ +#define ITM_TCR_TSPRESCALE_Msk (3UL << ITM_TCR_TSPRESCALE_Pos) /*!< ITM TCR: TSPRESCALE Mask */ + +#define ITM_TCR_STALLENA_Pos 5U /*!< ITM TCR: STALLENA Position */ +#define ITM_TCR_STALLENA_Msk (1UL << ITM_TCR_STALLENA_Pos) /*!< ITM TCR: STALLENA Mask */ + +#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */ +#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ + +#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */ +#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ + +#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */ +#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ + +#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */ +#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ + +#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ +#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ + +/* ITM Integration Write Register Definitions */ +#define ITM_IWR_ATVALIDM_Pos 0U /*!< ITM IWR: ATVALIDM Position */ +#define ITM_IWR_ATVALIDM_Msk (1UL /*<< ITM_IWR_ATVALIDM_Pos*/) /*!< ITM IWR: ATVALIDM Mask */ + +/* ITM Integration Read Register Definitions */ +#define ITM_IRR_ATREADYM_Pos 0U /*!< ITM IRR: ATREADYM Position */ +#define ITM_IRR_ATREADYM_Msk (1UL /*<< ITM_IRR_ATREADYM_Pos*/) /*!< ITM IRR: ATREADYM Mask */ + +/* ITM Integration Mode Control Register Definitions */ +#define ITM_IMCR_INTEGRATION_Pos 0U /*!< ITM IMCR: INTEGRATION Position */ +#define ITM_IMCR_INTEGRATION_Msk (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/) /*!< ITM IMCR: INTEGRATION Mask */ + +/* ITM Lock Status Register Definitions */ +#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */ +#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ + +#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */ +#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ + +#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ +#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ + +/*@}*/ /* end of group CMSIS_ITM */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ + __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ + __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ + __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ + __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ + __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + uint32_t RESERVED3[1U]; + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED4[1U]; + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + uint32_t RESERVED5[1U]; + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED6[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + uint32_t RESERVED7[1U]; + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ + uint32_t RESERVED8[1U]; + __IOM uint32_t COMP4; /*!< Offset: 0x060 (R/W) Comparator Register 4 */ + uint32_t RESERVED9[1U]; + __IOM uint32_t FUNCTION4; /*!< Offset: 0x068 (R/W) Function Register 4 */ + uint32_t RESERVED10[1U]; + __IOM uint32_t COMP5; /*!< Offset: 0x070 (R/W) Comparator Register 5 */ + uint32_t RESERVED11[1U]; + __IOM uint32_t FUNCTION5; /*!< Offset: 0x078 (R/W) Function Register 5 */ + uint32_t RESERVED12[1U]; + __IOM uint32_t COMP6; /*!< Offset: 0x080 (R/W) Comparator Register 6 */ + uint32_t RESERVED13[1U]; + __IOM uint32_t FUNCTION6; /*!< Offset: 0x088 (R/W) Function Register 6 */ + uint32_t RESERVED14[1U]; + __IOM uint32_t COMP7; /*!< Offset: 0x090 (R/W) Comparator Register 7 */ + uint32_t RESERVED15[1U]; + __IOM uint32_t FUNCTION7; /*!< Offset: 0x098 (R/W) Function Register 7 */ + uint32_t RESERVED16[1U]; + __IOM uint32_t COMP8; /*!< Offset: 0x0A0 (R/W) Comparator Register 8 */ + uint32_t RESERVED17[1U]; + __IOM uint32_t FUNCTION8; /*!< Offset: 0x0A8 (R/W) Function Register 8 */ + uint32_t RESERVED18[1U]; + __IOM uint32_t COMP9; /*!< Offset: 0x0B0 (R/W) Comparator Register 9 */ + uint32_t RESERVED19[1U]; + __IOM uint32_t FUNCTION9; /*!< Offset: 0x0B8 (R/W) Function Register 9 */ + uint32_t RESERVED20[1U]; + __IOM uint32_t COMP10; /*!< Offset: 0x0C0 (R/W) Comparator Register 10 */ + uint32_t RESERVED21[1U]; + __IOM uint32_t FUNCTION10; /*!< Offset: 0x0C8 (R/W) Function Register 10 */ + uint32_t RESERVED22[1U]; + __IOM uint32_t COMP11; /*!< Offset: 0x0D0 (R/W) Comparator Register 11 */ + uint32_t RESERVED23[1U]; + __IOM uint32_t FUNCTION11; /*!< Offset: 0x0D8 (R/W) Function Register 11 */ + uint32_t RESERVED24[1U]; + __IOM uint32_t COMP12; /*!< Offset: 0x0E0 (R/W) Comparator Register 12 */ + uint32_t RESERVED25[1U]; + __IOM uint32_t FUNCTION12; /*!< Offset: 0x0E8 (R/W) Function Register 12 */ + uint32_t RESERVED26[1U]; + __IOM uint32_t COMP13; /*!< Offset: 0x0F0 (R/W) Comparator Register 13 */ + uint32_t RESERVED27[1U]; + __IOM uint32_t FUNCTION13; /*!< Offset: 0x0F8 (R/W) Function Register 13 */ + uint32_t RESERVED28[1U]; + __IOM uint32_t COMP14; /*!< Offset: 0x100 (R/W) Comparator Register 14 */ + uint32_t RESERVED29[1U]; + __IOM uint32_t FUNCTION14; /*!< Offset: 0x108 (R/W) Function Register 14 */ + uint32_t RESERVED30[1U]; + __IOM uint32_t COMP15; /*!< Offset: 0x110 (R/W) Comparator Register 15 */ + uint32_t RESERVED31[1U]; + __IOM uint32_t FUNCTION15; /*!< Offset: 0x118 (R/W) Function Register 15 */ + uint32_t RESERVED32[934U]; + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R ) Lock Status Register */ + uint32_t RESERVED33[1U]; + __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) Device Architecture Register */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +#define DWT_CTRL_CYCDISS_Pos 23U /*!< DWT CTRL: CYCDISS Position */ +#define DWT_CTRL_CYCDISS_Msk (0x1UL << DWT_CTRL_CYCDISS_Pos) /*!< DWT CTRL: CYCDISS Mask */ + +#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */ +#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ + +#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */ +#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ + +#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */ +#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ + +#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */ +#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ + +#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */ +#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ + +#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */ +#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ + +#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */ +#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ + +#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */ +#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ + +#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */ +#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ + +#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */ +#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ + +#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */ +#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ + +#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */ +#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ + +#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */ +#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ + +/* DWT CPI Count Register Definitions */ +#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */ +#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ + +/* DWT Exception Overhead Count Register Definitions */ +#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */ +#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ + +/* DWT Sleep Count Register Definitions */ +#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */ +#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ + +/* DWT LSU Count Register Definitions */ +#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */ +#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ + +/* DWT Folded-instruction Count Register Definitions */ +#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */ +#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_ID_Pos 27U /*!< DWT FUNCTION: ID Position */ +#define DWT_FUNCTION_ID_Msk (0x1FUL << DWT_FUNCTION_ID_Pos) /*!< DWT FUNCTION: ID Mask */ + +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_ACTION_Pos 4U /*!< DWT FUNCTION: ACTION Position */ +#define DWT_FUNCTION_ACTION_Msk (0x1UL << DWT_FUNCTION_ACTION_Pos) /*!< DWT FUNCTION: ACTION Mask */ + +#define DWT_FUNCTION_MATCH_Pos 0U /*!< DWT FUNCTION: MATCH Position */ +#define DWT_FUNCTION_MATCH_Msk (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/) /*!< DWT FUNCTION: MATCH Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Sizes Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Sizes Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IM uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */ + uint32_t RESERVED3[759U]; + __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER */ + __IM uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */ + __IM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */ + uint32_t RESERVED4[1U]; + __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */ + __IM uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */ + __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ + uint32_t RESERVED5[39U]; + __IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ + __IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ + uint32_t RESERVED7[8U]; + __IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */ +#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI TRIGGER Register Definitions */ +#define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */ +#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ + +/* TPI Integration ETM Data Register Definitions (FIFO0) */ +#define TPI_FIFO0_ITM_ATVALID_Pos 29U /*!< TPI FIFO0: ITM_ATVALID Position */ +#define TPI_FIFO0_ITM_ATVALID_Msk (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */ + +#define TPI_FIFO0_ITM_bytecount_Pos 27U /*!< TPI FIFO0: ITM_bytecount Position */ +#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */ + +#define TPI_FIFO0_ETM_ATVALID_Pos 26U /*!< TPI FIFO0: ETM_ATVALID Position */ +#define TPI_FIFO0_ETM_ATVALID_Msk (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */ + +#define TPI_FIFO0_ETM_bytecount_Pos 24U /*!< TPI FIFO0: ETM_bytecount Position */ +#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */ + +#define TPI_FIFO0_ETM2_Pos 16U /*!< TPI FIFO0: ETM2 Position */ +#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */ + +#define TPI_FIFO0_ETM1_Pos 8U /*!< TPI FIFO0: ETM1 Position */ +#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */ + +#define TPI_FIFO0_ETM0_Pos 0U /*!< TPI FIFO0: ETM0 Position */ +#define TPI_FIFO0_ETM0_Msk (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/) /*!< TPI FIFO0: ETM0 Mask */ + +/* TPI ITATBCTR2 Register Definitions */ +#define TPI_ITATBCTR2_ATREADY_Pos 0U /*!< TPI ITATBCTR2: ATREADY Position */ +#define TPI_ITATBCTR2_ATREADY_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY_Pos*/) /*!< TPI ITATBCTR2: ATREADY Mask */ + +/* TPI Integration ITM Data Register Definitions (FIFO1) */ +#define TPI_FIFO1_ITM_ATVALID_Pos 29U /*!< TPI FIFO1: ITM_ATVALID Position */ +#define TPI_FIFO1_ITM_ATVALID_Msk (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */ + +#define TPI_FIFO1_ITM_bytecount_Pos 27U /*!< TPI FIFO1: ITM_bytecount Position */ +#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */ + +#define TPI_FIFO1_ETM_ATVALID_Pos 26U /*!< TPI FIFO1: ETM_ATVALID Position */ +#define TPI_FIFO1_ETM_ATVALID_Msk (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */ + +#define TPI_FIFO1_ETM_bytecount_Pos 24U /*!< TPI FIFO1: ETM_bytecount Position */ +#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */ + +#define TPI_FIFO1_ITM2_Pos 16U /*!< TPI FIFO1: ITM2 Position */ +#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */ + +#define TPI_FIFO1_ITM1_Pos 8U /*!< TPI FIFO1: ITM1 Position */ +#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */ + +#define TPI_FIFO1_ITM0_Pos 0U /*!< TPI FIFO1: ITM0 Position */ +#define TPI_FIFO1_ITM0_Msk (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/) /*!< TPI FIFO1: ITM0 Mask */ + +/* TPI ITATBCTR0 Register Definitions */ +#define TPI_ITATBCTR0_ATREADY_Pos 0U /*!< TPI ITATBCTR0: ATREADY Position */ +#define TPI_ITATBCTR0_ATREADY_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY_Pos*/) /*!< TPI ITATBCTR0: ATREADY Mask */ + +/* TPI Integration Mode Control Register Definitions */ +#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */ +#define TPI_ITCTRL_Mode_Msk (0x1UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_MinBufSz_Pos 6U /*!< TPI DEVID: MinBufSz Position */ +#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */ + +#define TPI_DEVID_AsynClkIn_Pos 5U /*!< TPI DEVID: AsynClkIn Position */ +#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */ + +#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */ +#define TPI_DEVID_NrTraceInput_Msk (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_MajorType_Pos 4U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +#define TPI_DEVTYPE_SubType_Pos 0U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) MPU Region Limit Address Register */ + __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Region Base Address Register Alias 1 */ + __IOM uint32_t RLAR_A1; /*!< Offset: 0x018 (R/W) MPU Region Limit Address Register Alias 1 */ + __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Region Base Address Register Alias 2 */ + __IOM uint32_t RLAR_A2; /*!< Offset: 0x020 (R/W) MPU Region Limit Address Register Alias 2 */ + __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Region Base Address Register Alias 3 */ + __IOM uint32_t RLAR_A3; /*!< Offset: 0x028 (R/W) MPU Region Limit Address Register Alias 3 */ + uint32_t RESERVED0[1]; + union { + __IOM uint32_t MAIR[2]; + struct { + __IOM uint32_t MAIR0; /*!< Offset: 0x030 (R/W) MPU Memory Attribute Indirection Register 0 */ + __IOM uint32_t MAIR1; /*!< Offset: 0x034 (R/W) MPU Memory Attribute Indirection Register 1 */ + }; + }; +} MPU_Type; + +#define MPU_TYPE_RALIASES 4U + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_ADDR_Pos 5U /*!< MPU RBAR: ADDR Position */ +#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ + +#define MPU_RBAR_SH_Pos 3U /*!< MPU RBAR: SH Position */ +#define MPU_RBAR_SH_Msk (0x3UL << MPU_RBAR_SH_Pos) /*!< MPU RBAR: SH Mask */ + +#define MPU_RBAR_AP_Pos 1U /*!< MPU RBAR: AP Position */ +#define MPU_RBAR_AP_Msk (0x3UL << MPU_RBAR_AP_Pos) /*!< MPU RBAR: AP Mask */ + +#define MPU_RBAR_XN_Pos 0U /*!< MPU RBAR: XN Position */ +#define MPU_RBAR_XN_Msk (01UL /*<< MPU_RBAR_XN_Pos*/) /*!< MPU RBAR: XN Mask */ + +/* MPU Region Limit Address Register Definitions */ +#define MPU_RLAR_LIMIT_Pos 5U /*!< MPU RLAR: LIMIT Position */ +#define MPU_RLAR_LIMIT_Msk (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos) /*!< MPU RLAR: LIMIT Mask */ + +#define MPU_RLAR_PXN_Pos 4U /*!< MPU RLAR: PXN Position */ +#define MPU_RLAR_PXN_Msk (0x1UL << MPU_RLAR_PXN_Pos) /*!< MPU RLAR: PXN Mask */ + +#define MPU_RLAR_AttrIndx_Pos 1U /*!< MPU RLAR: AttrIndx Position */ +#define MPU_RLAR_AttrIndx_Msk (0x7UL << MPU_RLAR_AttrIndx_Pos) /*!< MPU RLAR: AttrIndx Mask */ + +#define MPU_RLAR_EN_Pos 0U /*!< MPU RLAR: Region enable bit Position */ +#define MPU_RLAR_EN_Msk (1UL /*<< MPU_RLAR_EN_Pos*/) /*!< MPU RLAR: Region enable bit Disable Mask */ + +/* MPU Memory Attribute Indirection Register 0 Definitions */ +#define MPU_MAIR0_Attr3_Pos 24U /*!< MPU MAIR0: Attr3 Position */ +#define MPU_MAIR0_Attr3_Msk (0xFFUL << MPU_MAIR0_Attr3_Pos) /*!< MPU MAIR0: Attr3 Mask */ + +#define MPU_MAIR0_Attr2_Pos 16U /*!< MPU MAIR0: Attr2 Position */ +#define MPU_MAIR0_Attr2_Msk (0xFFUL << MPU_MAIR0_Attr2_Pos) /*!< MPU MAIR0: Attr2 Mask */ + +#define MPU_MAIR0_Attr1_Pos 8U /*!< MPU MAIR0: Attr1 Position */ +#define MPU_MAIR0_Attr1_Msk (0xFFUL << MPU_MAIR0_Attr1_Pos) /*!< MPU MAIR0: Attr1 Mask */ + +#define MPU_MAIR0_Attr0_Pos 0U /*!< MPU MAIR0: Attr0 Position */ +#define MPU_MAIR0_Attr0_Msk (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/) /*!< MPU MAIR0: Attr0 Mask */ + +/* MPU Memory Attribute Indirection Register 1 Definitions */ +#define MPU_MAIR1_Attr7_Pos 24U /*!< MPU MAIR1: Attr7 Position */ +#define MPU_MAIR1_Attr7_Msk (0xFFUL << MPU_MAIR1_Attr7_Pos) /*!< MPU MAIR1: Attr7 Mask */ + +#define MPU_MAIR1_Attr6_Pos 16U /*!< MPU MAIR1: Attr6 Position */ +#define MPU_MAIR1_Attr6_Msk (0xFFUL << MPU_MAIR1_Attr6_Pos) /*!< MPU MAIR1: Attr6 Mask */ + +#define MPU_MAIR1_Attr5_Pos 8U /*!< MPU MAIR1: Attr5 Position */ +#define MPU_MAIR1_Attr5_Msk (0xFFUL << MPU_MAIR1_Attr5_Pos) /*!< MPU MAIR1: Attr5 Mask */ + +#define MPU_MAIR1_Attr4_Pos 0U /*!< MPU MAIR1: Attr4 Position */ +#define MPU_MAIR1_Attr4_Msk (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/) /*!< MPU MAIR1: Attr4 Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SAU Security Attribution Unit (SAU) + \brief Type definitions for the Security Attribution Unit (SAU) + @{ + */ + +/** + \brief Structure type to access the Security Attribution Unit (SAU). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SAU Control Register */ + __IM uint32_t TYPE; /*!< Offset: 0x004 (R/ ) SAU Type Register */ +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) SAU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) SAU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) SAU Region Limit Address Register */ +#else + uint32_t RESERVED0[3]; +#endif + __IOM uint32_t SFSR; /*!< Offset: 0x014 (R/W) Secure Fault Status Register */ + __IOM uint32_t SFAR; /*!< Offset: 0x018 (R/W) Secure Fault Address Register */ +} SAU_Type; + +/* SAU Control Register Definitions */ +#define SAU_CTRL_ALLNS_Pos 1U /*!< SAU CTRL: ALLNS Position */ +#define SAU_CTRL_ALLNS_Msk (1UL << SAU_CTRL_ALLNS_Pos) /*!< SAU CTRL: ALLNS Mask */ + +#define SAU_CTRL_ENABLE_Pos 0U /*!< SAU CTRL: ENABLE Position */ +#define SAU_CTRL_ENABLE_Msk (1UL /*<< SAU_CTRL_ENABLE_Pos*/) /*!< SAU CTRL: ENABLE Mask */ + +/* SAU Type Register Definitions */ +#define SAU_TYPE_SREGION_Pos 0U /*!< SAU TYPE: SREGION Position */ +#define SAU_TYPE_SREGION_Msk (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/) /*!< SAU TYPE: SREGION Mask */ + +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) +/* SAU Region Number Register Definitions */ +#define SAU_RNR_REGION_Pos 0U /*!< SAU RNR: REGION Position */ +#define SAU_RNR_REGION_Msk (0xFFUL /*<< SAU_RNR_REGION_Pos*/) /*!< SAU RNR: REGION Mask */ + +/* SAU Region Base Address Register Definitions */ +#define SAU_RBAR_BADDR_Pos 5U /*!< SAU RBAR: BADDR Position */ +#define SAU_RBAR_BADDR_Msk (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos) /*!< SAU RBAR: BADDR Mask */ + +/* SAU Region Limit Address Register Definitions */ +#define SAU_RLAR_LADDR_Pos 5U /*!< SAU RLAR: LADDR Position */ +#define SAU_RLAR_LADDR_Msk (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos) /*!< SAU RLAR: LADDR Mask */ + +#define SAU_RLAR_NSC_Pos 1U /*!< SAU RLAR: NSC Position */ +#define SAU_RLAR_NSC_Msk (1UL << SAU_RLAR_NSC_Pos) /*!< SAU RLAR: NSC Mask */ + +#define SAU_RLAR_ENABLE_Pos 0U /*!< SAU RLAR: ENABLE Position */ +#define SAU_RLAR_ENABLE_Msk (1UL /*<< SAU_RLAR_ENABLE_Pos*/) /*!< SAU RLAR: ENABLE Mask */ + +#endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */ + +/* Secure Fault Status Register Definitions */ +#define SAU_SFSR_LSERR_Pos 7U /*!< SAU SFSR: LSERR Position */ +#define SAU_SFSR_LSERR_Msk (1UL << SAU_SFSR_LSERR_Pos) /*!< SAU SFSR: LSERR Mask */ + +#define SAU_SFSR_SFARVALID_Pos 6U /*!< SAU SFSR: SFARVALID Position */ +#define SAU_SFSR_SFARVALID_Msk (1UL << SAU_SFSR_SFARVALID_Pos) /*!< SAU SFSR: SFARVALID Mask */ + +#define SAU_SFSR_LSPERR_Pos 5U /*!< SAU SFSR: LSPERR Position */ +#define SAU_SFSR_LSPERR_Msk (1UL << SAU_SFSR_LSPERR_Pos) /*!< SAU SFSR: LSPERR Mask */ + +#define SAU_SFSR_INVTRAN_Pos 4U /*!< SAU SFSR: INVTRAN Position */ +#define SAU_SFSR_INVTRAN_Msk (1UL << SAU_SFSR_INVTRAN_Pos) /*!< SAU SFSR: INVTRAN Mask */ + +#define SAU_SFSR_AUVIOL_Pos 3U /*!< SAU SFSR: AUVIOL Position */ +#define SAU_SFSR_AUVIOL_Msk (1UL << SAU_SFSR_AUVIOL_Pos) /*!< SAU SFSR: AUVIOL Mask */ + +#define SAU_SFSR_INVER_Pos 2U /*!< SAU SFSR: INVER Position */ +#define SAU_SFSR_INVER_Msk (1UL << SAU_SFSR_INVER_Pos) /*!< SAU SFSR: INVER Mask */ + +#define SAU_SFSR_INVIS_Pos 1U /*!< SAU SFSR: INVIS Position */ +#define SAU_SFSR_INVIS_Msk (1UL << SAU_SFSR_INVIS_Pos) /*!< SAU SFSR: INVIS Mask */ + +#define SAU_SFSR_INVEP_Pos 0U /*!< SAU SFSR: INVEP Position */ +#define SAU_SFSR_INVEP_Msk (1UL /*<< SAU_SFSR_INVEP_Pos*/) /*!< SAU SFSR: INVEP Mask */ + +/*@} end of group CMSIS_SAU */ +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_FPU Floating Point Unit (FPU) + \brief Type definitions for the Floating Point Unit (FPU) + @{ + */ + +/** + \brief Structure type to access the Floating Point Unit (FPU). + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IOM uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */ + __IOM uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */ + __IOM uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */ + __IM uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and FP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and FP Feature Register 1 */ +} FPU_Type; + +/* Floating-Point Context Control Register Definitions */ +#define FPU_FPCCR_ASPEN_Pos 31U /*!< FPCCR: ASPEN bit Position */ +#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */ + +#define FPU_FPCCR_LSPEN_Pos 30U /*!< FPCCR: LSPEN Position */ +#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */ + +#define FPU_FPCCR_LSPENS_Pos 29U /*!< FPCCR: LSPENS Position */ +#define FPU_FPCCR_LSPENS_Msk (1UL << FPU_FPCCR_LSPENS_Pos) /*!< FPCCR: LSPENS bit Mask */ + +#define FPU_FPCCR_CLRONRET_Pos 28U /*!< FPCCR: CLRONRET Position */ +#define FPU_FPCCR_CLRONRET_Msk (1UL << FPU_FPCCR_CLRONRET_Pos) /*!< FPCCR: CLRONRET bit Mask */ + +#define FPU_FPCCR_CLRONRETS_Pos 27U /*!< FPCCR: CLRONRETS Position */ +#define FPU_FPCCR_CLRONRETS_Msk (1UL << FPU_FPCCR_CLRONRETS_Pos) /*!< FPCCR: CLRONRETS bit Mask */ + +#define FPU_FPCCR_TS_Pos 26U /*!< FPCCR: TS Position */ +#define FPU_FPCCR_TS_Msk (1UL << FPU_FPCCR_TS_Pos) /*!< FPCCR: TS bit Mask */ + +#define FPU_FPCCR_UFRDY_Pos 10U /*!< FPCCR: UFRDY Position */ +#define FPU_FPCCR_UFRDY_Msk (1UL << FPU_FPCCR_UFRDY_Pos) /*!< FPCCR: UFRDY bit Mask */ + +#define FPU_FPCCR_SPLIMVIOL_Pos 9U /*!< FPCCR: SPLIMVIOL Position */ +#define FPU_FPCCR_SPLIMVIOL_Msk (1UL << FPU_FPCCR_SPLIMVIOL_Pos) /*!< FPCCR: SPLIMVIOL bit Mask */ + +#define FPU_FPCCR_MONRDY_Pos 8U /*!< FPCCR: MONRDY Position */ +#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */ + +#define FPU_FPCCR_SFRDY_Pos 7U /*!< FPCCR: SFRDY Position */ +#define FPU_FPCCR_SFRDY_Msk (1UL << FPU_FPCCR_SFRDY_Pos) /*!< FPCCR: SFRDY bit Mask */ + +#define FPU_FPCCR_BFRDY_Pos 6U /*!< FPCCR: BFRDY Position */ +#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */ + +#define FPU_FPCCR_MMRDY_Pos 5U /*!< FPCCR: MMRDY Position */ +#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */ + +#define FPU_FPCCR_HFRDY_Pos 4U /*!< FPCCR: HFRDY Position */ +#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */ + +#define FPU_FPCCR_THREAD_Pos 3U /*!< FPCCR: processor mode bit Position */ +#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */ + +#define FPU_FPCCR_S_Pos 2U /*!< FPCCR: Security status of the FP context bit Position */ +#define FPU_FPCCR_S_Msk (1UL << FPU_FPCCR_S_Pos) /*!< FPCCR: Security status of the FP context bit Mask */ + +#define FPU_FPCCR_USER_Pos 1U /*!< FPCCR: privilege level bit Position */ +#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */ + +#define FPU_FPCCR_LSPACT_Pos 0U /*!< FPCCR: Lazy state preservation active bit Position */ +#define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/) /*!< FPCCR: Lazy state preservation active bit Mask */ + +/* Floating-Point Context Address Register Definitions */ +#define FPU_FPCAR_ADDRESS_Pos 3U /*!< FPCAR: ADDRESS bit Position */ +#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */ + +/* Floating-Point Default Status Control Register Definitions */ +#define FPU_FPDSCR_AHP_Pos 26U /*!< FPDSCR: AHP bit Position */ +#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */ + +#define FPU_FPDSCR_DN_Pos 25U /*!< FPDSCR: DN bit Position */ +#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */ + +#define FPU_FPDSCR_FZ_Pos 24U /*!< FPDSCR: FZ bit Position */ +#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */ + +#define FPU_FPDSCR_RMode_Pos 22U /*!< FPDSCR: RMode bit Position */ +#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */ + +/* Media and FP Feature Register 0 Definitions */ +#define FPU_MVFR0_FP_rounding_modes_Pos 28U /*!< MVFR0: FP rounding modes bits Position */ +#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */ + +#define FPU_MVFR0_Short_vectors_Pos 24U /*!< MVFR0: Short vectors bits Position */ +#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */ + +#define FPU_MVFR0_Square_root_Pos 20U /*!< MVFR0: Square root bits Position */ +#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */ + +#define FPU_MVFR0_Divide_Pos 16U /*!< MVFR0: Divide bits Position */ +#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */ + +#define FPU_MVFR0_FP_excep_trapping_Pos 12U /*!< MVFR0: FP exception trapping bits Position */ +#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */ + +#define FPU_MVFR0_Double_precision_Pos 8U /*!< MVFR0: Double-precision bits Position */ +#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */ + +#define FPU_MVFR0_Single_precision_Pos 4U /*!< MVFR0: Single-precision bits Position */ +#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */ + +#define FPU_MVFR0_A_SIMD_registers_Pos 0U /*!< MVFR0: A_SIMD registers bits Position */ +#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/) /*!< MVFR0: A_SIMD registers bits Mask */ + +/* Media and FP Feature Register 1 Definitions */ +#define FPU_MVFR1_FP_fused_MAC_Pos 28U /*!< MVFR1: FP fused MAC bits Position */ +#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */ + +#define FPU_MVFR1_FP_HPFP_Pos 24U /*!< MVFR1: FP HPFP bits Position */ +#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */ + +#define FPU_MVFR1_D_NaN_mode_Pos 4U /*!< MVFR1: D_NaN mode bits Position */ +#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */ + +#define FPU_MVFR1_FtZ_mode_Pos 0U /*!< MVFR1: FtZ mode bits Position */ +#define FPU_MVFR1_FtZ_mode_Msk (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/) /*!< MVFR1: FtZ mode bits Mask */ + +/*@} end of group CMSIS_FPU */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** + \brief Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ + uint32_t RESERVED4[1U]; + __IOM uint32_t DAUTHCTRL; /*!< Offset: 0x014 (R/W) Debug Authentication Control Register */ + __IOM uint32_t DSCSR; /*!< Offset: 0x018 (R/W) Debug Security Control and Status Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register Definitions */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESTART_ST_Pos 26U /*!< CoreDebug DHCSR: S_RESTART_ST Position */ +#define CoreDebug_DHCSR_S_RESTART_ST_Msk (1UL << CoreDebug_DHCSR_S_RESTART_ST_Pos) /*!< CoreDebug DHCSR: S_RESTART_ST Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ +#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register Definitions */ +#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register Definitions */ +#define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< CoreDebug DEMCR: TRCENA Position */ +#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ + +#define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< CoreDebug DEMCR: MON_REQ Position */ +#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ + +#define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< CoreDebug DEMCR: MON_STEP Position */ +#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ + +#define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< CoreDebug DEMCR: MON_PEND Position */ +#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ + +#define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< CoreDebug DEMCR: MON_EN Position */ +#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< CoreDebug DEMCR: VC_INTERR Position */ +#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ + +#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< CoreDebug DEMCR: VC_BUSERR Position */ +#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ + +#define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< CoreDebug DEMCR: VC_STATERR Position */ +#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ + +#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< CoreDebug DEMCR: VC_CHKERR Position */ +#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ + +#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< CoreDebug DEMCR: VC_NOCPERR Position */ +#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ + +#define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< CoreDebug DEMCR: VC_MMERR Position */ +#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ + +/* Debug Authentication Control Register Definitions */ +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos 3U /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Position */ +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Mask */ + +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos 2U /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Msk (1UL << CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos) /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Mask */ + +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Pos 1U /*!< CoreDebug DAUTHCTRL: INTSPIDEN Position */ +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPIDEN Mask */ + +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Pos 0U /*!< CoreDebug DAUTHCTRL: SPIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Msk (1UL /*<< CoreDebug_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< CoreDebug DAUTHCTRL: SPIDENSEL Mask */ + +/* Debug Security Control and Status Register Definitions */ +#define CoreDebug_DSCSR_CDS_Pos 16U /*!< CoreDebug DSCSR: CDS Position */ +#define CoreDebug_DSCSR_CDS_Msk (1UL << CoreDebug_DSCSR_CDS_Pos) /*!< CoreDebug DSCSR: CDS Mask */ + +#define CoreDebug_DSCSR_SBRSEL_Pos 1U /*!< CoreDebug DSCSR: SBRSEL Position */ +#define CoreDebug_DSCSR_SBRSEL_Msk (1UL << CoreDebug_DSCSR_SBRSEL_Pos) /*!< CoreDebug DSCSR: SBRSEL Mask */ + +#define CoreDebug_DSCSR_SBRSELEN_Pos 0U /*!< CoreDebug DSCSR: SBRSELEN Position */ +#define CoreDebug_DSCSR_SBRSELEN_Msk (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/) /*!< CoreDebug DSCSR: SBRSELEN Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ + #define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ + #define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ + #define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ + #define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ + #define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ + #define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ + #define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ + #define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + + #define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ + #define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ + #define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ + #define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ + #define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ + #define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ + #define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ + #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE ) /*!< Core Debug configuration struct */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ + #endif + + #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SAU_BASE (SCS_BASE + 0x0DD0UL) /*!< Security Attribution Unit */ + #define SAU ((SAU_Type *) SAU_BASE ) /*!< Security Attribution Unit */ + #endif + + #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ + #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */ + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SCS_BASE_NS (0xE002E000UL) /*!< System Control Space Base Address (non-secure address space) */ + #define CoreDebug_BASE_NS (0xE002EDF0UL) /*!< Core Debug Base Address (non-secure address space) */ + #define SysTick_BASE_NS (SCS_BASE_NS + 0x0010UL) /*!< SysTick Base Address (non-secure address space) */ + #define NVIC_BASE_NS (SCS_BASE_NS + 0x0100UL) /*!< NVIC Base Address (non-secure address space) */ + #define SCB_BASE_NS (SCS_BASE_NS + 0x0D00UL) /*!< System Control Block Base Address (non-secure address space) */ + + #define SCnSCB_NS ((SCnSCB_Type *) SCS_BASE_NS ) /*!< System control Register not in SCB(non-secure address space) */ + #define SCB_NS ((SCB_Type *) SCB_BASE_NS ) /*!< SCB configuration struct (non-secure address space) */ + #define SysTick_NS ((SysTick_Type *) SysTick_BASE_NS ) /*!< SysTick configuration struct (non-secure address space) */ + #define NVIC_NS ((NVIC_Type *) NVIC_BASE_NS ) /*!< NVIC configuration struct (non-secure address space) */ + #define CoreDebug_NS ((CoreDebug_Type *) CoreDebug_BASE_NS) /*!< Core Debug configuration struct (non-secure address space) */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE_NS (SCS_BASE_NS + 0x0D90UL) /*!< Memory Protection Unit (non-secure address space) */ + #define MPU_NS ((MPU_Type *) MPU_BASE_NS ) /*!< Memory Protection Unit (non-secure address space) */ + #endif + + #define FPU_BASE_NS (SCS_BASE_NS + 0x0F30UL) /*!< Floating Point Unit (non-secure address space) */ + #define FPU_NS ((FPU_Type *) FPU_BASE_NS ) /*!< Floating Point Unit (non-secure address space) */ + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Debug Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ + #define NVIC_GetActive __NVIC_GetActive + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + + +/** + \brief Set Priority Grouping + \details Sets the priority grouping field using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << 8U) ); /* Insert write key and priorty group */ + SCB->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping + \details Reads the priority grouping field from the NVIC Interrupt Controller. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) +{ + return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Get Interrupt Target State + \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + \return 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Target State + \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Clear Interrupt Target State + \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; + __DSB(); +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Set Priority Grouping (non-secure) + \details Sets the non-secure priority grouping field when in secure state using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void TZ_NVIC_SetPriorityGrouping_NS(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB_NS->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << 8U) ); /* Insert write key and priorty group */ + SCB_NS->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping (non-secure) + \details Reads the priority grouping field from the non-secure NVIC when in secure state. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPriorityGrouping_NS(void) +{ + return ((uint32_t)((SCB_NS->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt (non-secure) + \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status (non-secure) + \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt (non-secure) + \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Pending Interrupt (non-secure) + \details Reads the NVIC pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt (non-secure) + \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt (non-secure) + \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt (non-secure) + \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority (non-secure) + \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every non-secure processor exception. + */ +__STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority (non-secure) + \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC_NS->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_NVICFunctions */ + +/* ########################## MPU functions #################################### */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + +#include "mpu_armv8.h" + +#endif + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + uint32_t mvfr0; + + mvfr0 = FPU->MVFR0; + if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x220U) + { + return 2U; /* Double + Single precision FPU */ + } + else if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U) + { + return 1U; /* Single precision FPU */ + } + else + { + return 0U; /* No FPU */ + } +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ########################## SAU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SAUFunctions SAU Functions + \brief Functions that configure the SAU. + @{ + */ + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + +/** + \brief Enable SAU + \details Enables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Enable(void) +{ + SAU->CTRL |= (SAU_CTRL_ENABLE_Msk); +} + + + +/** + \brief Disable SAU + \details Disables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Disable(void) +{ + SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk); +} + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_SAUFunctions */ + + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief System Tick Configuration (non-secure) + \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function TZ_SysTick_Config_NS is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + + */ +__STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick_NS->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick_NS->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick_NS->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + +/* ##################################### Debug In/Output function ########################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_core_DebugFunctions ITM Functions + \brief Functions that access the ITM debug interface. + @{ + */ + +extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ +#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ + + +/** + \brief ITM Send Character + \details Transmits a character via the ITM channel 0, and + \li Just returns when no debugger is connected that has booked the output. + \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. + \param [in] ch Character to transmit. + \returns Character to transmit. + */ +__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) +{ + if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ + ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ + { + while (ITM->PORT[0U].u32 == 0UL) + { + __NOP(); + } + ITM->PORT[0U].u8 = (uint8_t)ch; + } + return (ch); +} + + +/** + \brief ITM Receive Character + \details Inputs a character via the external variable \ref ITM_RxBuffer. + \return Received character. + \return -1 No character pending. + */ +__STATIC_INLINE int32_t ITM_ReceiveChar (void) +{ + int32_t ch = -1; /* no character available */ + + if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) + { + ch = ITM_RxBuffer; + ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ + } + + return (ch); +} + + +/** + \brief ITM Check Character + \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. + \return 0 No character available. + \return 1 Character available. + */ +__STATIC_INLINE int32_t ITM_CheckChar (void) +{ + + if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) + { + return (0); /* no character available */ + } + else + { + return (1); /* character available */ + } +} + +/*@} end of CMSIS_core_DebugFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_ARMV81MML_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/core_armv8mbl.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_armv8mbl.h new file mode 100644 index 0000000000..344dca5148 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_armv8mbl.h @@ -0,0 +1,1921 @@ +/**************************************************************************//** + * @file core_armv8mbl.h + * @brief CMSIS Armv8-M Baseline Core Peripheral Access Layer Header File + * @version V5.0.8 + * @date 12. November 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_ARMV8MBL_H_GENERIC +#define __CORE_ARMV8MBL_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_ARMv8MBL + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS definitions */ +#define __ARMv8MBL_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __ARMv8MBL_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __ARMv8MBL_CMSIS_VERSION ((__ARMv8MBL_CMSIS_VERSION_MAIN << 16U) | \ + __ARMv8MBL_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M ( 2U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + This core does not support an FPU at all +*/ +#define __FPU_USED 0U + +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_FP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_ARMV8MBL_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_ARMV8MBL_H_DEPENDANT +#define __CORE_ARMV8MBL_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __ARMv8MBL_REV + #define __ARMv8MBL_REV 0x0000U + #warning "__ARMv8MBL_REV not defined in device header file; using default!" + #endif + + #ifndef __FPU_PRESENT + #define __FPU_PRESENT 0U + #warning "__FPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __SAUREGION_PRESENT + #define __SAUREGION_PRESENT 0U + #warning "__SAUREGION_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __VTOR_PRESENT + #define __VTOR_PRESENT 0U + #warning "__VTOR_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 2U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif + + #ifndef __ETM_PRESENT + #define __ETM_PRESENT 0U + #warning "__ETM_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MTB_PRESENT + #define __MTB_PRESENT 0U + #warning "__MTB_PRESENT not defined in device header file; using default!" + #endif + +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group ARMv8MBL */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + - Core SAU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack-pointer select */ + uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[16U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[16U]; + __IOM uint32_t ICER[16U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[16U]; + __IOM uint32_t ISPR[16U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[16U]; + __IOM uint32_t ICPR[16U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[16U]; + __IOM uint32_t IABR[16U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[16U]; + __IOM uint32_t ITNS[16U]; /*!< Offset: 0x280 (R/W) Interrupt Non-Secure State Register */ + uint32_t RESERVED5[16U]; + __IOM uint32_t IPR[124U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */ +} NVIC_Type; + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ +#else + uint32_t RESERVED0; +#endif + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + uint32_t RESERVED1; + __IOM uint32_t SHPR[2U]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_PENDNMISET_Pos 31U /*!< SCB ICSR: PENDNMISET Position */ +#define SCB_ICSR_PENDNMISET_Msk (1UL << SCB_ICSR_PENDNMISET_Pos) /*!< SCB ICSR: PENDNMISET Mask */ + +#define SCB_ICSR_NMIPENDSET_Pos SCB_ICSR_PENDNMISET_Pos /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */ +#define SCB_ICSR_NMIPENDSET_Msk SCB_ICSR_PENDNMISET_Msk /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */ + +#define SCB_ICSR_PENDNMICLR_Pos 30U /*!< SCB ICSR: PENDNMICLR Position */ +#define SCB_ICSR_PENDNMICLR_Msk (1UL << SCB_ICSR_PENDNMICLR_Pos) /*!< SCB ICSR: PENDNMICLR Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_STTNS_Pos 24U /*!< SCB ICSR: STTNS Position (Security Extension) */ +#define SCB_ICSR_STTNS_Msk (1UL << SCB_ICSR_STTNS_Pos) /*!< SCB ICSR: STTNS Mask (Security Extension) */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) +/* SCB Vector Table Offset Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ +#endif + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIS_Pos 14U /*!< SCB AIRCR: PRIS Position */ +#define SCB_AIRCR_PRIS_Msk (1UL << SCB_AIRCR_PRIS_Pos) /*!< SCB AIRCR: PRIS Mask */ + +#define SCB_AIRCR_BFHFNMINS_Pos 13U /*!< SCB AIRCR: BFHFNMINS Position */ +#define SCB_AIRCR_BFHFNMINS_Msk (1UL << SCB_AIRCR_BFHFNMINS_Pos) /*!< SCB AIRCR: BFHFNMINS Mask */ + +#define SCB_AIRCR_SYSRESETREQS_Pos 3U /*!< SCB AIRCR: SYSRESETREQS Position */ +#define SCB_AIRCR_SYSRESETREQS_Msk (1UL << SCB_AIRCR_SYSRESETREQS_Pos) /*!< SCB AIRCR: SYSRESETREQS Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEPS_Pos 3U /*!< SCB SCR: SLEEPDEEPS Position */ +#define SCB_SCR_SLEEPDEEPS_Msk (1UL << SCB_SCR_SLEEPDEEPS_Pos) /*!< SCB SCR: SLEEPDEEPS Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_BP_Pos 18U /*!< SCB CCR: BP Position */ +#define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: BP Mask */ + +#define SCB_CCR_IC_Pos 17U /*!< SCB CCR: IC Position */ +#define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: IC Mask */ + +#define SCB_CCR_DC_Pos 16U /*!< SCB CCR: DC Position */ +#define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: DC Mask */ + +#define SCB_CCR_STKOFHFNMIGN_Pos 10U /*!< SCB CCR: STKOFHFNMIGN Position */ +#define SCB_CCR_STKOFHFNMIGN_Msk (1UL << SCB_CCR_STKOFHFNMIGN_Pos) /*!< SCB CCR: STKOFHFNMIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_HARDFAULTPENDED_Pos 21U /*!< SCB SHCSR: HARDFAULTPENDED Position */ +#define SCB_SHCSR_HARDFAULTPENDED_Msk (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos) /*!< SCB SHCSR: HARDFAULTPENDED Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_NMIACT_Pos 5U /*!< SCB SHCSR: NMIACT Position */ +#define SCB_SHCSR_NMIACT_Msk (1UL << SCB_SHCSR_NMIACT_Pos) /*!< SCB SHCSR: NMIACT Mask */ + +#define SCB_SHCSR_HARDFAULTACT_Pos 2U /*!< SCB SHCSR: HARDFAULTACT Position */ +#define SCB_SHCSR_HARDFAULTACT_Msk (1UL << SCB_SHCSR_HARDFAULTACT_Pos) /*!< SCB SHCSR: HARDFAULTACT Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + uint32_t RESERVED0[6U]; + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + uint32_t RESERVED3[1U]; + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED4[1U]; + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + uint32_t RESERVED5[1U]; + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED6[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + uint32_t RESERVED7[1U]; + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ + uint32_t RESERVED8[1U]; + __IOM uint32_t COMP4; /*!< Offset: 0x060 (R/W) Comparator Register 4 */ + uint32_t RESERVED9[1U]; + __IOM uint32_t FUNCTION4; /*!< Offset: 0x068 (R/W) Function Register 4 */ + uint32_t RESERVED10[1U]; + __IOM uint32_t COMP5; /*!< Offset: 0x070 (R/W) Comparator Register 5 */ + uint32_t RESERVED11[1U]; + __IOM uint32_t FUNCTION5; /*!< Offset: 0x078 (R/W) Function Register 5 */ + uint32_t RESERVED12[1U]; + __IOM uint32_t COMP6; /*!< Offset: 0x080 (R/W) Comparator Register 6 */ + uint32_t RESERVED13[1U]; + __IOM uint32_t FUNCTION6; /*!< Offset: 0x088 (R/W) Function Register 6 */ + uint32_t RESERVED14[1U]; + __IOM uint32_t COMP7; /*!< Offset: 0x090 (R/W) Comparator Register 7 */ + uint32_t RESERVED15[1U]; + __IOM uint32_t FUNCTION7; /*!< Offset: 0x098 (R/W) Function Register 7 */ + uint32_t RESERVED16[1U]; + __IOM uint32_t COMP8; /*!< Offset: 0x0A0 (R/W) Comparator Register 8 */ + uint32_t RESERVED17[1U]; + __IOM uint32_t FUNCTION8; /*!< Offset: 0x0A8 (R/W) Function Register 8 */ + uint32_t RESERVED18[1U]; + __IOM uint32_t COMP9; /*!< Offset: 0x0B0 (R/W) Comparator Register 9 */ + uint32_t RESERVED19[1U]; + __IOM uint32_t FUNCTION9; /*!< Offset: 0x0B8 (R/W) Function Register 9 */ + uint32_t RESERVED20[1U]; + __IOM uint32_t COMP10; /*!< Offset: 0x0C0 (R/W) Comparator Register 10 */ + uint32_t RESERVED21[1U]; + __IOM uint32_t FUNCTION10; /*!< Offset: 0x0C8 (R/W) Function Register 10 */ + uint32_t RESERVED22[1U]; + __IOM uint32_t COMP11; /*!< Offset: 0x0D0 (R/W) Comparator Register 11 */ + uint32_t RESERVED23[1U]; + __IOM uint32_t FUNCTION11; /*!< Offset: 0x0D8 (R/W) Function Register 11 */ + uint32_t RESERVED24[1U]; + __IOM uint32_t COMP12; /*!< Offset: 0x0E0 (R/W) Comparator Register 12 */ + uint32_t RESERVED25[1U]; + __IOM uint32_t FUNCTION12; /*!< Offset: 0x0E8 (R/W) Function Register 12 */ + uint32_t RESERVED26[1U]; + __IOM uint32_t COMP13; /*!< Offset: 0x0F0 (R/W) Comparator Register 13 */ + uint32_t RESERVED27[1U]; + __IOM uint32_t FUNCTION13; /*!< Offset: 0x0F8 (R/W) Function Register 13 */ + uint32_t RESERVED28[1U]; + __IOM uint32_t COMP14; /*!< Offset: 0x100 (R/W) Comparator Register 14 */ + uint32_t RESERVED29[1U]; + __IOM uint32_t FUNCTION14; /*!< Offset: 0x108 (R/W) Function Register 14 */ + uint32_t RESERVED30[1U]; + __IOM uint32_t COMP15; /*!< Offset: 0x110 (R/W) Comparator Register 15 */ + uint32_t RESERVED31[1U]; + __IOM uint32_t FUNCTION15; /*!< Offset: 0x118 (R/W) Function Register 15 */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_ID_Pos 27U /*!< DWT FUNCTION: ID Position */ +#define DWT_FUNCTION_ID_Msk (0x1FUL << DWT_FUNCTION_ID_Pos) /*!< DWT FUNCTION: ID Mask */ + +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_ACTION_Pos 4U /*!< DWT FUNCTION: ACTION Position */ +#define DWT_FUNCTION_ACTION_Msk (0x3UL << DWT_FUNCTION_ACTION_Pos) /*!< DWT FUNCTION: ACTION Mask */ + +#define DWT_FUNCTION_MATCH_Pos 0U /*!< DWT FUNCTION: MATCH Position */ +#define DWT_FUNCTION_MATCH_Msk (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/) /*!< DWT FUNCTION: MATCH Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Sizes Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Sizes Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IOM uint32_t PSCR; /*!< Offset: 0x308 (R/W) Periodic Synchronization Control Register */ + uint32_t RESERVED3[809U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) Software Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) Software Lock Status Register */ + uint32_t RESERVED4[4U]; + __IM uint32_t TYPE; /*!< Offset: 0xFC8 (R/ ) Device Identifier Register */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) Device Type Register */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_SWOSCALER_Pos 0U /*!< TPI ACPR: SWOSCALER Position */ +#define TPI_ACPR_SWOSCALER_Msk (0xFFFFUL /*<< TPI_ACPR_SWOSCALER_Pos*/) /*!< TPI ACPR: SWOSCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_FOnMan_Pos 6U /*!< TPI FFCR: FOnMan Position */ +#define TPI_FFCR_FOnMan_Msk (0x1UL << TPI_FFCR_FOnMan_Pos) /*!< TPI FFCR: FOnMan Mask */ + +#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI Periodic Synchronization Control Register Definitions */ +#define TPI_PSCR_PSCount_Pos 0U /*!< TPI PSCR: PSCount Position */ +#define TPI_PSCR_PSCount_Msk (0x1FUL /*<< TPI_PSCR_PSCount_Pos*/) /*!< TPI PSCR: TPSCount Mask */ + +/* TPI Software Lock Status Register Definitions */ +#define TPI_LSR_nTT_Pos 1U /*!< TPI LSR: Not thirty-two bit. Position */ +#define TPI_LSR_nTT_Msk (0x1UL << TPI_LSR_nTT_Pos) /*!< TPI LSR: Not thirty-two bit. Mask */ + +#define TPI_LSR_SLK_Pos 1U /*!< TPI LSR: Software Lock status Position */ +#define TPI_LSR_SLK_Msk (0x1UL << TPI_LSR_SLK_Pos) /*!< TPI LSR: Software Lock status Mask */ + +#define TPI_LSR_SLI_Pos 0U /*!< TPI LSR: Software Lock implemented Position */ +#define TPI_LSR_SLI_Msk (0x1UL /*<< TPI_LSR_SLI_Pos*/) /*!< TPI LSR: Software Lock implemented Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_FIFOSZ_Pos 6U /*!< TPI DEVID: FIFO depth Position */ +#define TPI_DEVID_FIFOSZ_Msk (0x7UL << TPI_DEVID_FIFOSZ_Pos) /*!< TPI DEVID: FIFO depth Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) MPU Region Limit Address Register */ + uint32_t RESERVED0[7U]; + union { + __IOM uint32_t MAIR[2]; + struct { + __IOM uint32_t MAIR0; /*!< Offset: 0x030 (R/W) MPU Memory Attribute Indirection Register 0 */ + __IOM uint32_t MAIR1; /*!< Offset: 0x034 (R/W) MPU Memory Attribute Indirection Register 1 */ + }; + }; +} MPU_Type; + +#define MPU_TYPE_RALIASES 1U + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_BASE_Pos 5U /*!< MPU RBAR: BASE Position */ +#define MPU_RBAR_BASE_Msk (0x7FFFFFFUL << MPU_RBAR_BASE_Pos) /*!< MPU RBAR: BASE Mask */ + +#define MPU_RBAR_SH_Pos 3U /*!< MPU RBAR: SH Position */ +#define MPU_RBAR_SH_Msk (0x3UL << MPU_RBAR_SH_Pos) /*!< MPU RBAR: SH Mask */ + +#define MPU_RBAR_AP_Pos 1U /*!< MPU RBAR: AP Position */ +#define MPU_RBAR_AP_Msk (0x3UL << MPU_RBAR_AP_Pos) /*!< MPU RBAR: AP Mask */ + +#define MPU_RBAR_XN_Pos 0U /*!< MPU RBAR: XN Position */ +#define MPU_RBAR_XN_Msk (01UL /*<< MPU_RBAR_XN_Pos*/) /*!< MPU RBAR: XN Mask */ + +/* MPU Region Limit Address Register Definitions */ +#define MPU_RLAR_LIMIT_Pos 5U /*!< MPU RLAR: LIMIT Position */ +#define MPU_RLAR_LIMIT_Msk (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos) /*!< MPU RLAR: LIMIT Mask */ + +#define MPU_RLAR_AttrIndx_Pos 1U /*!< MPU RLAR: AttrIndx Position */ +#define MPU_RLAR_AttrIndx_Msk (0x7UL << MPU_RLAR_AttrIndx_Pos) /*!< MPU RLAR: AttrIndx Mask */ + +#define MPU_RLAR_EN_Pos 0U /*!< MPU RLAR: EN Position */ +#define MPU_RLAR_EN_Msk (1UL /*<< MPU_RLAR_EN_Pos*/) /*!< MPU RLAR: EN Mask */ + +/* MPU Memory Attribute Indirection Register 0 Definitions */ +#define MPU_MAIR0_Attr3_Pos 24U /*!< MPU MAIR0: Attr3 Position */ +#define MPU_MAIR0_Attr3_Msk (0xFFUL << MPU_MAIR0_Attr3_Pos) /*!< MPU MAIR0: Attr3 Mask */ + +#define MPU_MAIR0_Attr2_Pos 16U /*!< MPU MAIR0: Attr2 Position */ +#define MPU_MAIR0_Attr2_Msk (0xFFUL << MPU_MAIR0_Attr2_Pos) /*!< MPU MAIR0: Attr2 Mask */ + +#define MPU_MAIR0_Attr1_Pos 8U /*!< MPU MAIR0: Attr1 Position */ +#define MPU_MAIR0_Attr1_Msk (0xFFUL << MPU_MAIR0_Attr1_Pos) /*!< MPU MAIR0: Attr1 Mask */ + +#define MPU_MAIR0_Attr0_Pos 0U /*!< MPU MAIR0: Attr0 Position */ +#define MPU_MAIR0_Attr0_Msk (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/) /*!< MPU MAIR0: Attr0 Mask */ + +/* MPU Memory Attribute Indirection Register 1 Definitions */ +#define MPU_MAIR1_Attr7_Pos 24U /*!< MPU MAIR1: Attr7 Position */ +#define MPU_MAIR1_Attr7_Msk (0xFFUL << MPU_MAIR1_Attr7_Pos) /*!< MPU MAIR1: Attr7 Mask */ + +#define MPU_MAIR1_Attr6_Pos 16U /*!< MPU MAIR1: Attr6 Position */ +#define MPU_MAIR1_Attr6_Msk (0xFFUL << MPU_MAIR1_Attr6_Pos) /*!< MPU MAIR1: Attr6 Mask */ + +#define MPU_MAIR1_Attr5_Pos 8U /*!< MPU MAIR1: Attr5 Position */ +#define MPU_MAIR1_Attr5_Msk (0xFFUL << MPU_MAIR1_Attr5_Pos) /*!< MPU MAIR1: Attr5 Mask */ + +#define MPU_MAIR1_Attr4_Pos 0U /*!< MPU MAIR1: Attr4 Position */ +#define MPU_MAIR1_Attr4_Msk (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/) /*!< MPU MAIR1: Attr4 Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SAU Security Attribution Unit (SAU) + \brief Type definitions for the Security Attribution Unit (SAU) + @{ + */ + +/** + \brief Structure type to access the Security Attribution Unit (SAU). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SAU Control Register */ + __IM uint32_t TYPE; /*!< Offset: 0x004 (R/ ) SAU Type Register */ +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) SAU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) SAU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) SAU Region Limit Address Register */ +#endif +} SAU_Type; + +/* SAU Control Register Definitions */ +#define SAU_CTRL_ALLNS_Pos 1U /*!< SAU CTRL: ALLNS Position */ +#define SAU_CTRL_ALLNS_Msk (1UL << SAU_CTRL_ALLNS_Pos) /*!< SAU CTRL: ALLNS Mask */ + +#define SAU_CTRL_ENABLE_Pos 0U /*!< SAU CTRL: ENABLE Position */ +#define SAU_CTRL_ENABLE_Msk (1UL /*<< SAU_CTRL_ENABLE_Pos*/) /*!< SAU CTRL: ENABLE Mask */ + +/* SAU Type Register Definitions */ +#define SAU_TYPE_SREGION_Pos 0U /*!< SAU TYPE: SREGION Position */ +#define SAU_TYPE_SREGION_Msk (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/) /*!< SAU TYPE: SREGION Mask */ + +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) +/* SAU Region Number Register Definitions */ +#define SAU_RNR_REGION_Pos 0U /*!< SAU RNR: REGION Position */ +#define SAU_RNR_REGION_Msk (0xFFUL /*<< SAU_RNR_REGION_Pos*/) /*!< SAU RNR: REGION Mask */ + +/* SAU Region Base Address Register Definitions */ +#define SAU_RBAR_BADDR_Pos 5U /*!< SAU RBAR: BADDR Position */ +#define SAU_RBAR_BADDR_Msk (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos) /*!< SAU RBAR: BADDR Mask */ + +/* SAU Region Limit Address Register Definitions */ +#define SAU_RLAR_LADDR_Pos 5U /*!< SAU RLAR: LADDR Position */ +#define SAU_RLAR_LADDR_Msk (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos) /*!< SAU RLAR: LADDR Mask */ + +#define SAU_RLAR_NSC_Pos 1U /*!< SAU RLAR: NSC Position */ +#define SAU_RLAR_NSC_Msk (1UL << SAU_RLAR_NSC_Pos) /*!< SAU RLAR: NSC Mask */ + +#define SAU_RLAR_ENABLE_Pos 0U /*!< SAU RLAR: ENABLE Position */ +#define SAU_RLAR_ENABLE_Msk (1UL /*<< SAU_RLAR_ENABLE_Pos*/) /*!< SAU RLAR: ENABLE Mask */ + +#endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */ + +/*@} end of group CMSIS_SAU */ +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** + \brief Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ + uint32_t RESERVED4[1U]; + __IOM uint32_t DAUTHCTRL; /*!< Offset: 0x014 (R/W) Debug Authentication Control Register */ + __IOM uint32_t DSCSR; /*!< Offset: 0x018 (R/W) Debug Security Control and Status Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register Definitions */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESTART_ST_Pos 26U /*!< CoreDebug DHCSR: S_RESTART_ST Position */ +#define CoreDebug_DHCSR_S_RESTART_ST_Msk (1UL << CoreDebug_DHCSR_S_RESTART_ST_Pos) /*!< CoreDebug DHCSR: S_RESTART_ST Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register Definitions */ +#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register */ +#define CoreDebug_DEMCR_DWTENA_Pos 24U /*!< CoreDebug DEMCR: DWTENA Position */ +#define CoreDebug_DEMCR_DWTENA_Msk (1UL << CoreDebug_DEMCR_DWTENA_Pos) /*!< CoreDebug DEMCR: DWTENA Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ + +/* Debug Authentication Control Register Definitions */ +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos 3U /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Position */ +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Mask */ + +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos 2U /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Msk (1UL << CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos) /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Mask */ + +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Pos 1U /*!< CoreDebug DAUTHCTRL: INTSPIDEN Position */ +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPIDEN Mask */ + +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Pos 0U /*!< CoreDebug DAUTHCTRL: SPIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Msk (1UL /*<< CoreDebug_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< CoreDebug DAUTHCTRL: SPIDENSEL Mask */ + +/* Debug Security Control and Status Register Definitions */ +#define CoreDebug_DSCSR_CDS_Pos 16U /*!< CoreDebug DSCSR: CDS Position */ +#define CoreDebug_DSCSR_CDS_Msk (1UL << CoreDebug_DSCSR_CDS_Pos) /*!< CoreDebug DSCSR: CDS Mask */ + +#define CoreDebug_DSCSR_SBRSEL_Pos 1U /*!< CoreDebug DSCSR: SBRSEL Position */ +#define CoreDebug_DSCSR_SBRSEL_Msk (1UL << CoreDebug_DSCSR_SBRSEL_Pos) /*!< CoreDebug DSCSR: SBRSEL Mask */ + +#define CoreDebug_DSCSR_SBRSELEN_Pos 0U /*!< CoreDebug DSCSR: SBRSELEN Position */ +#define CoreDebug_DSCSR_SBRSELEN_Msk (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/) /*!< CoreDebug DSCSR: SBRSELEN Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ + #define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ + #define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ + #define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ + #define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ + #define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ + #define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ + #define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + + + #define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ + #define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ + #define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ + #define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ + #define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ + #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE ) /*!< Core Debug configuration struct */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ + #endif + + #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SAU_BASE (SCS_BASE + 0x0DD0UL) /*!< Security Attribution Unit */ + #define SAU ((SAU_Type *) SAU_BASE ) /*!< Security Attribution Unit */ + #endif + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SCS_BASE_NS (0xE002E000UL) /*!< System Control Space Base Address (non-secure address space) */ + #define CoreDebug_BASE_NS (0xE002EDF0UL) /*!< Core Debug Base Address (non-secure address space) */ + #define SysTick_BASE_NS (SCS_BASE_NS + 0x0010UL) /*!< SysTick Base Address (non-secure address space) */ + #define NVIC_BASE_NS (SCS_BASE_NS + 0x0100UL) /*!< NVIC Base Address (non-secure address space) */ + #define SCB_BASE_NS (SCS_BASE_NS + 0x0D00UL) /*!< System Control Block Base Address (non-secure address space) */ + + #define SCB_NS ((SCB_Type *) SCB_BASE_NS ) /*!< SCB configuration struct (non-secure address space) */ + #define SysTick_NS ((SysTick_Type *) SysTick_BASE_NS ) /*!< SysTick configuration struct (non-secure address space) */ + #define NVIC_NS ((NVIC_Type *) NVIC_BASE_NS ) /*!< NVIC configuration struct (non-secure address space) */ + #define CoreDebug_NS ((CoreDebug_Type *) CoreDebug_BASE_NS) /*!< Core Debug configuration struct (non-secure address space) */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE_NS (SCS_BASE_NS + 0x0D90UL) /*!< Memory Protection Unit (non-secure address space) */ + #define MPU_NS ((MPU_Type *) MPU_BASE_NS ) /*!< Memory Protection Unit (non-secure address space) */ + #endif + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ + #define NVIC_GetActive __NVIC_GetActive + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* Special LR values for Secure/Non-Secure call handling and exception handling */ + +/* Function Return Payload (from ARMv8-M Architecture Reference Manual) LR value on entry from Secure BLXNS */ +#define FNC_RETURN (0xFEFFFFFFUL) /* bit [0] ignored when processing a branch */ + +/* The following EXC_RETURN mask values are used to evaluate the LR on exception entry */ +#define EXC_RETURN_PREFIX (0xFF000000UL) /* bits [31:24] set to indicate an EXC_RETURN value */ +#define EXC_RETURN_S (0x00000040UL) /* bit [6] stack used to push registers: 0=Non-secure 1=Secure */ +#define EXC_RETURN_DCRS (0x00000020UL) /* bit [5] stacking rules for called registers: 0=skipped 1=saved */ +#define EXC_RETURN_FTYPE (0x00000010UL) /* bit [4] allocate stack for floating-point context: 0=done 1=skipped */ +#define EXC_RETURN_MODE (0x00000008UL) /* bit [3] processor mode for return: 0=Handler mode 1=Thread mode */ +#define EXC_RETURN_SPSEL (0x00000004UL) /* bit [2] stack pointer used to restore context: 0=MSP 1=PSP */ +#define EXC_RETURN_ES (0x00000001UL) /* bit [0] security state exception was taken to: 0=Non-secure 1=Secure */ + +/* Integrity Signature (from ARMv8-M Architecture Reference Manual) for exception context stacking */ +#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) /* Value for processors with floating-point extension: */ +#define EXC_INTEGRITY_SIGNATURE (0xFEFA125AUL) /* bit [0] SFTC must match LR bit[4] EXC_RETURN_FTYPE */ +#else +#define EXC_INTEGRITY_SIGNATURE (0xFEFA125BUL) /* Value for processors without floating-point extension */ +#endif + + +/* Interrupt Priorities are WORD accessible only under Armv6-M */ +/* The following MACROS handle generation of the register offset and byte masks */ +#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL) +#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) ) +#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) ) + +#define __NVIC_SetPriorityGrouping(X) (void)(X) +#define __NVIC_GetPriorityGrouping() (0U) + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + __COMPILER_BARRIER(); + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __COMPILER_BARRIER(); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Get Interrupt Target State + \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + \return 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Target State + \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Clear Interrupt Target State + \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IPR[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IPR[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } + else + { + SCB->SHPR[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHPR[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IPR[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return((uint32_t)(((SCB->SHPR[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + If VTOR is not present address 0 must be mapped to SRAM. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) + uint32_t *vectors = (uint32_t *)SCB->VTOR; +#else + uint32_t *vectors = (uint32_t *)0x0U; +#endif + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; + __DSB(); +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) + uint32_t *vectors = (uint32_t *)SCB->VTOR; +#else + uint32_t *vectors = (uint32_t *)0x0U; +#endif + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + SCB_AIRCR_SYSRESETREQ_Msk); + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Enable Interrupt (non-secure) + \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status (non-secure) + \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt (non-secure) + \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Pending Interrupt (non-secure) + \details Reads the NVIC pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt (non-secure) + \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt (non-secure) + \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt (non-secure) + \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority (non-secure) + \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every non-secure processor exception. + */ +__STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->IPR[_IP_IDX(IRQn)] = ((uint32_t)(NVIC_NS->IPR[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } + else + { + SCB_NS->SHPR[_SHP_IDX(IRQn)] = ((uint32_t)(SCB_NS->SHPR[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } +} + + +/** + \brief Get Interrupt Priority (non-secure) + \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->IPR[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return((uint32_t)(((SCB_NS->SHPR[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_NVICFunctions */ + +/* ########################## MPU functions #################################### */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + +#include "mpu_armv8.h" + +#endif + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + return 0U; /* No FPU */ +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ########################## SAU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SAUFunctions SAU Functions + \brief Functions that configure the SAU. + @{ + */ + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + +/** + \brief Enable SAU + \details Enables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Enable(void) +{ + SAU->CTRL |= (SAU_CTRL_ENABLE_Msk); +} + + + +/** + \brief Disable SAU + \details Disables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Disable(void) +{ + SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk); +} + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_SAUFunctions */ + + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief System Tick Configuration (non-secure) + \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function TZ_SysTick_Config_NS is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + + */ +__STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick_NS->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick_NS->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick_NS->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_ARMV8MBL_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/core_armv8mml.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_armv8mml.h new file mode 100644 index 0000000000..5ddb8aeda7 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_armv8mml.h @@ -0,0 +1,2835 @@ +/**************************************************************************//** + * @file core_armv8mml.h + * @brief CMSIS Armv8-M Mainline Core Peripheral Access Layer Header File + * @version V5.1.0 + * @date 12. September 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_ARMV8MML_H_GENERIC +#define __CORE_ARMV8MML_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_ARMv8MML + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS Armv8MML definitions */ +#define __ARMv8MML_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __ARMv8MML_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __ARMv8MML_CMSIS_VERSION ((__ARMv8MML_CMSIS_VERSION_MAIN << 16U) | \ + __ARMv8MML_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M (81U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions. +*/ +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined(__ARM_FEATURE_DSP) + #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_FP + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined(__ARM_FEATURE_DSP) + #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined(__ARM_FEATURE_DSP) + #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined(__ARM_FEATURE_DSP) + #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_ARMV8MML_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_ARMV8MML_H_DEPENDANT +#define __CORE_ARMV8MML_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __ARMv8MML_REV + #define __ARMv8MML_REV 0x0000U + #warning "__ARMv8MML_REV not defined in device header file; using default!" + #endif + + #ifndef __FPU_PRESENT + #define __FPU_PRESENT 0U + #warning "__FPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __SAUREGION_PRESENT + #define __SAUREGION_PRESENT 0U + #warning "__SAUREGION_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __DSP_PRESENT + #define __DSP_PRESENT 0U + #warning "__DSP_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 3U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group ARMv8MML */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + - Core SAU Register + - Core FPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + +#define APSR_Q_Pos 27U /*!< APSR: Q Position */ +#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ + +#define APSR_GE_Pos 16U /*!< APSR: GE Position */ +#define APSR_GE_Msk (0xFUL << APSR_GE_Pos) /*!< APSR: GE Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */ +#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ + +#define xPSR_IT_Pos 25U /*!< xPSR: IT Position */ +#define xPSR_IT_Msk (3UL << xPSR_IT_Pos) /*!< xPSR: IT Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_GE_Pos 16U /*!< xPSR: GE Position */ +#define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos) /*!< xPSR: GE Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack-pointer select */ + uint32_t FPCA:1; /*!< bit: 2 Floating-point context active */ + uint32_t SFPA:1; /*!< bit: 3 Secure floating-point active */ + uint32_t _reserved1:28; /*!< bit: 4..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SFPA_Pos 3U /*!< CONTROL: SFPA Position */ +#define CONTROL_SFPA_Msk (1UL << CONTROL_SFPA_Pos) /*!< CONTROL: SFPA Mask */ + +#define CONTROL_FPCA_Pos 2U /*!< CONTROL: FPCA Position */ +#define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos) /*!< CONTROL: FPCA Mask */ + +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[16U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[16U]; + __IOM uint32_t ICER[16U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[16U]; + __IOM uint32_t ISPR[16U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[16U]; + __IOM uint32_t ICPR[16U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[16U]; + __IOM uint32_t IABR[16U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[16U]; + __IOM uint32_t ITNS[16U]; /*!< Offset: 0x280 (R/W) Interrupt Non-Secure State Register */ + uint32_t RESERVED5[16U]; + __IOM uint8_t IPR[496U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ + uint32_t RESERVED6[580U]; + __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ +} NVIC_Type; + +/* Software Triggered Interrupt Register Definitions */ +#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ +#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + __IOM uint8_t SHPR[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ + __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ + __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ + __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ + __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ + __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ + __IM uint32_t ID_PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ + __IM uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ + __IM uint32_t ID_ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t ID_MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ + __IM uint32_t ID_ISAR[6U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ + __IM uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */ + __IM uint32_t CTR; /*!< Offset: 0x07C (R/ ) Cache Type register */ + __IM uint32_t CCSIDR; /*!< Offset: 0x080 (R/ ) Cache Size ID Register */ + __IOM uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */ + __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ + __IOM uint32_t NSACR; /*!< Offset: 0x08C (R/W) Non-Secure Access Control Register */ + uint32_t RESERVED3[92U]; + __OM uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */ + uint32_t RESERVED4[15U]; + __IM uint32_t MVFR0; /*!< Offset: 0x240 (R/ ) Media and VFP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x244 (R/ ) Media and VFP Feature Register 1 */ + __IM uint32_t MVFR2; /*!< Offset: 0x248 (R/ ) Media and VFP Feature Register 2 */ + uint32_t RESERVED5[1U]; + __OM uint32_t ICIALLU; /*!< Offset: 0x250 ( /W) I-Cache Invalidate All to PoU */ + uint32_t RESERVED6[1U]; + __OM uint32_t ICIMVAU; /*!< Offset: 0x258 ( /W) I-Cache Invalidate by MVA to PoU */ + __OM uint32_t DCIMVAC; /*!< Offset: 0x25C ( /W) D-Cache Invalidate by MVA to PoC */ + __OM uint32_t DCISW; /*!< Offset: 0x260 ( /W) D-Cache Invalidate by Set-way */ + __OM uint32_t DCCMVAU; /*!< Offset: 0x264 ( /W) D-Cache Clean by MVA to PoU */ + __OM uint32_t DCCMVAC; /*!< Offset: 0x268 ( /W) D-Cache Clean by MVA to PoC */ + __OM uint32_t DCCSW; /*!< Offset: 0x26C ( /W) D-Cache Clean by Set-way */ + __OM uint32_t DCCIMVAC; /*!< Offset: 0x270 ( /W) D-Cache Clean and Invalidate by MVA to PoC */ + __OM uint32_t DCCISW; /*!< Offset: 0x274 ( /W) D-Cache Clean and Invalidate by Set-way */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_PENDNMISET_Pos 31U /*!< SCB ICSR: PENDNMISET Position */ +#define SCB_ICSR_PENDNMISET_Msk (1UL << SCB_ICSR_PENDNMISET_Pos) /*!< SCB ICSR: PENDNMISET Mask */ + +#define SCB_ICSR_NMIPENDSET_Pos SCB_ICSR_PENDNMISET_Pos /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */ +#define SCB_ICSR_NMIPENDSET_Msk SCB_ICSR_PENDNMISET_Msk /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */ + +#define SCB_ICSR_PENDNMICLR_Pos 30U /*!< SCB ICSR: PENDNMICLR Position */ +#define SCB_ICSR_PENDNMICLR_Msk (1UL << SCB_ICSR_PENDNMICLR_Pos) /*!< SCB ICSR: PENDNMICLR Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_STTNS_Pos 24U /*!< SCB ICSR: STTNS Position (Security Extension) */ +#define SCB_ICSR_STTNS_Msk (1UL << SCB_ICSR_STTNS_Pos) /*!< SCB ICSR: STTNS Mask (Security Extension) */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Vector Table Offset Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIS_Pos 14U /*!< SCB AIRCR: PRIS Position */ +#define SCB_AIRCR_PRIS_Msk (1UL << SCB_AIRCR_PRIS_Pos) /*!< SCB AIRCR: PRIS Mask */ + +#define SCB_AIRCR_BFHFNMINS_Pos 13U /*!< SCB AIRCR: BFHFNMINS Position */ +#define SCB_AIRCR_BFHFNMINS_Msk (1UL << SCB_AIRCR_BFHFNMINS_Pos) /*!< SCB AIRCR: BFHFNMINS Mask */ + +#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */ +#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ + +#define SCB_AIRCR_SYSRESETREQS_Pos 3U /*!< SCB AIRCR: SYSRESETREQS Position */ +#define SCB_AIRCR_SYSRESETREQS_Msk (1UL << SCB_AIRCR_SYSRESETREQS_Pos) /*!< SCB AIRCR: SYSRESETREQS Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEPS_Pos 3U /*!< SCB SCR: SLEEPDEEPS Position */ +#define SCB_SCR_SLEEPDEEPS_Msk (1UL << SCB_SCR_SLEEPDEEPS_Pos) /*!< SCB SCR: SLEEPDEEPS Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_BP_Pos 18U /*!< SCB CCR: BP Position */ +#define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: BP Mask */ + +#define SCB_CCR_IC_Pos 17U /*!< SCB CCR: IC Position */ +#define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: IC Mask */ + +#define SCB_CCR_DC_Pos 16U /*!< SCB CCR: DC Position */ +#define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: DC Mask */ + +#define SCB_CCR_STKOFHFNMIGN_Pos 10U /*!< SCB CCR: STKOFHFNMIGN Position */ +#define SCB_CCR_STKOFHFNMIGN_Msk (1UL << SCB_CCR_STKOFHFNMIGN_Pos) /*!< SCB CCR: STKOFHFNMIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_HARDFAULTPENDED_Pos 21U /*!< SCB SHCSR: HARDFAULTPENDED Position */ +#define SCB_SHCSR_HARDFAULTPENDED_Msk (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos) /*!< SCB SHCSR: HARDFAULTPENDED Mask */ + +#define SCB_SHCSR_SECUREFAULTPENDED_Pos 20U /*!< SCB SHCSR: SECUREFAULTPENDED Position */ +#define SCB_SHCSR_SECUREFAULTPENDED_Msk (1UL << SCB_SHCSR_SECUREFAULTPENDED_Pos) /*!< SCB SHCSR: SECUREFAULTPENDED Mask */ + +#define SCB_SHCSR_SECUREFAULTENA_Pos 19U /*!< SCB SHCSR: SECUREFAULTENA Position */ +#define SCB_SHCSR_SECUREFAULTENA_Msk (1UL << SCB_SHCSR_SECUREFAULTENA_Pos) /*!< SCB SHCSR: SECUREFAULTENA Mask */ + +#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */ +#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ + +#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */ +#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ + +#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */ +#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */ +#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ + +#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */ +#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ + +#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */ +#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */ +#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_NMIACT_Pos 5U /*!< SCB SHCSR: NMIACT Position */ +#define SCB_SHCSR_NMIACT_Msk (1UL << SCB_SHCSR_NMIACT_Pos) /*!< SCB SHCSR: NMIACT Mask */ + +#define SCB_SHCSR_SECUREFAULTACT_Pos 4U /*!< SCB SHCSR: SECUREFAULTACT Position */ +#define SCB_SHCSR_SECUREFAULTACT_Msk (1UL << SCB_SHCSR_SECUREFAULTACT_Pos) /*!< SCB SHCSR: SECUREFAULTACT Mask */ + +#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */ +#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ + +#define SCB_SHCSR_HARDFAULTACT_Pos 2U /*!< SCB SHCSR: HARDFAULTACT Position */ +#define SCB_SHCSR_HARDFAULTACT_Msk (1UL << SCB_SHCSR_HARDFAULTACT_Pos) /*!< SCB SHCSR: HARDFAULTACT Mask */ + +#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */ +#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ + +#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */ +#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ + +/* SCB Configurable Fault Status Register Definitions */ +#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */ +#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ + +#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */ +#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ + +#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */ +#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ + +/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ + +#define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ +#define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ + +#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ + +#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ + +#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ + +#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ + +/* BusFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */ +#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */ + +#define SCB_CFSR_LSPERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 5U) /*!< SCB CFSR (BFSR): LSPERR Position */ +#define SCB_CFSR_LSPERR_Msk (1UL << SCB_CFSR_LSPERR_Pos) /*!< SCB CFSR (BFSR): LSPERR Mask */ + +#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */ +#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */ + +#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */ +#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */ + +#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */ +#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */ + +#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */ +#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */ + +#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */ +#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */ + +/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */ +#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */ + +#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */ +#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */ + +#define SCB_CFSR_STKOF_Pos (SCB_CFSR_USGFAULTSR_Pos + 4U) /*!< SCB CFSR (UFSR): STKOF Position */ +#define SCB_CFSR_STKOF_Msk (1UL << SCB_CFSR_STKOF_Pos) /*!< SCB CFSR (UFSR): STKOF Mask */ + +#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */ +#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */ + +#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */ +#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */ + +#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */ +#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */ + +#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */ +#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */ + +/* SCB Hard Fault Status Register Definitions */ +#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */ +#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ + +#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */ +#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ + +#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */ +#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ + +/* SCB Debug Fault Status Register Definitions */ +#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */ +#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ + +#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */ +#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ + +#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */ +#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ + +#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */ +#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ + +#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */ +#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ + +/* SCB Non-Secure Access Control Register Definitions */ +#define SCB_NSACR_CP11_Pos 11U /*!< SCB NSACR: CP11 Position */ +#define SCB_NSACR_CP11_Msk (1UL << SCB_NSACR_CP11_Pos) /*!< SCB NSACR: CP11 Mask */ + +#define SCB_NSACR_CP10_Pos 10U /*!< SCB NSACR: CP10 Position */ +#define SCB_NSACR_CP10_Msk (1UL << SCB_NSACR_CP10_Pos) /*!< SCB NSACR: CP10 Mask */ + +#define SCB_NSACR_CPn_Pos 0U /*!< SCB NSACR: CPn Position */ +#define SCB_NSACR_CPn_Msk (1UL /*<< SCB_NSACR_CPn_Pos*/) /*!< SCB NSACR: CPn Mask */ + +/* SCB Cache Level ID Register Definitions */ +#define SCB_CLIDR_LOUU_Pos 27U /*!< SCB CLIDR: LoUU Position */ +#define SCB_CLIDR_LOUU_Msk (7UL << SCB_CLIDR_LOUU_Pos) /*!< SCB CLIDR: LoUU Mask */ + +#define SCB_CLIDR_LOC_Pos 24U /*!< SCB CLIDR: LoC Position */ +#define SCB_CLIDR_LOC_Msk (7UL << SCB_CLIDR_LOC_Pos) /*!< SCB CLIDR: LoC Mask */ + +/* SCB Cache Type Register Definitions */ +#define SCB_CTR_FORMAT_Pos 29U /*!< SCB CTR: Format Position */ +#define SCB_CTR_FORMAT_Msk (7UL << SCB_CTR_FORMAT_Pos) /*!< SCB CTR: Format Mask */ + +#define SCB_CTR_CWG_Pos 24U /*!< SCB CTR: CWG Position */ +#define SCB_CTR_CWG_Msk (0xFUL << SCB_CTR_CWG_Pos) /*!< SCB CTR: CWG Mask */ + +#define SCB_CTR_ERG_Pos 20U /*!< SCB CTR: ERG Position */ +#define SCB_CTR_ERG_Msk (0xFUL << SCB_CTR_ERG_Pos) /*!< SCB CTR: ERG Mask */ + +#define SCB_CTR_DMINLINE_Pos 16U /*!< SCB CTR: DminLine Position */ +#define SCB_CTR_DMINLINE_Msk (0xFUL << SCB_CTR_DMINLINE_Pos) /*!< SCB CTR: DminLine Mask */ + +#define SCB_CTR_IMINLINE_Pos 0U /*!< SCB CTR: ImInLine Position */ +#define SCB_CTR_IMINLINE_Msk (0xFUL /*<< SCB_CTR_IMINLINE_Pos*/) /*!< SCB CTR: ImInLine Mask */ + +/* SCB Cache Size ID Register Definitions */ +#define SCB_CCSIDR_WT_Pos 31U /*!< SCB CCSIDR: WT Position */ +#define SCB_CCSIDR_WT_Msk (1UL << SCB_CCSIDR_WT_Pos) /*!< SCB CCSIDR: WT Mask */ + +#define SCB_CCSIDR_WB_Pos 30U /*!< SCB CCSIDR: WB Position */ +#define SCB_CCSIDR_WB_Msk (1UL << SCB_CCSIDR_WB_Pos) /*!< SCB CCSIDR: WB Mask */ + +#define SCB_CCSIDR_RA_Pos 29U /*!< SCB CCSIDR: RA Position */ +#define SCB_CCSIDR_RA_Msk (1UL << SCB_CCSIDR_RA_Pos) /*!< SCB CCSIDR: RA Mask */ + +#define SCB_CCSIDR_WA_Pos 28U /*!< SCB CCSIDR: WA Position */ +#define SCB_CCSIDR_WA_Msk (1UL << SCB_CCSIDR_WA_Pos) /*!< SCB CCSIDR: WA Mask */ + +#define SCB_CCSIDR_NUMSETS_Pos 13U /*!< SCB CCSIDR: NumSets Position */ +#define SCB_CCSIDR_NUMSETS_Msk (0x7FFFUL << SCB_CCSIDR_NUMSETS_Pos) /*!< SCB CCSIDR: NumSets Mask */ + +#define SCB_CCSIDR_ASSOCIATIVITY_Pos 3U /*!< SCB CCSIDR: Associativity Position */ +#define SCB_CCSIDR_ASSOCIATIVITY_Msk (0x3FFUL << SCB_CCSIDR_ASSOCIATIVITY_Pos) /*!< SCB CCSIDR: Associativity Mask */ + +#define SCB_CCSIDR_LINESIZE_Pos 0U /*!< SCB CCSIDR: LineSize Position */ +#define SCB_CCSIDR_LINESIZE_Msk (7UL /*<< SCB_CCSIDR_LINESIZE_Pos*/) /*!< SCB CCSIDR: LineSize Mask */ + +/* SCB Cache Size Selection Register Definitions */ +#define SCB_CSSELR_LEVEL_Pos 1U /*!< SCB CSSELR: Level Position */ +#define SCB_CSSELR_LEVEL_Msk (7UL << SCB_CSSELR_LEVEL_Pos) /*!< SCB CSSELR: Level Mask */ + +#define SCB_CSSELR_IND_Pos 0U /*!< SCB CSSELR: InD Position */ +#define SCB_CSSELR_IND_Msk (1UL /*<< SCB_CSSELR_IND_Pos*/) /*!< SCB CSSELR: InD Mask */ + +/* SCB Software Triggered Interrupt Register Definitions */ +#define SCB_STIR_INTID_Pos 0U /*!< SCB STIR: INTID Position */ +#define SCB_STIR_INTID_Msk (0x1FFUL /*<< SCB_STIR_INTID_Pos*/) /*!< SCB STIR: INTID Mask */ + +/* SCB D-Cache Invalidate by Set-way Register Definitions */ +#define SCB_DCISW_WAY_Pos 30U /*!< SCB DCISW: Way Position */ +#define SCB_DCISW_WAY_Msk (3UL << SCB_DCISW_WAY_Pos) /*!< SCB DCISW: Way Mask */ + +#define SCB_DCISW_SET_Pos 5U /*!< SCB DCISW: Set Position */ +#define SCB_DCISW_SET_Msk (0x1FFUL << SCB_DCISW_SET_Pos) /*!< SCB DCISW: Set Mask */ + +/* SCB D-Cache Clean by Set-way Register Definitions */ +#define SCB_DCCSW_WAY_Pos 30U /*!< SCB DCCSW: Way Position */ +#define SCB_DCCSW_WAY_Msk (3UL << SCB_DCCSW_WAY_Pos) /*!< SCB DCCSW: Way Mask */ + +#define SCB_DCCSW_SET_Pos 5U /*!< SCB DCCSW: Set Position */ +#define SCB_DCCSW_SET_Msk (0x1FFUL << SCB_DCCSW_SET_Pos) /*!< SCB DCCSW: Set Mask */ + +/* SCB D-Cache Clean and Invalidate by Set-way Register Definitions */ +#define SCB_DCCISW_WAY_Pos 30U /*!< SCB DCCISW: Way Position */ +#define SCB_DCCISW_WAY_Msk (3UL << SCB_DCCISW_WAY_Pos) /*!< SCB DCCISW: Way Mask */ + +#define SCB_DCCISW_SET_Pos 5U /*!< SCB DCCISW: Set Position */ +#define SCB_DCCISW_SET_Msk (0x1FFUL << SCB_DCCISW_SET_Pos) /*!< SCB DCCISW: Set Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** + \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ + __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ + __IOM uint32_t CPPWR; /*!< Offset: 0x00C (R/W) Coprocessor Power Control Register */ +} SCnSCB_Type; + +/* Interrupt Controller Type Register Definitions */ +#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ +#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_SCnotSCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) + \brief Type definitions for the Instrumentation Trace Macrocell (ITM) + @{ + */ + +/** + \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). + */ +typedef struct +{ + __OM union + { + __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ + __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ + __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ + } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ + uint32_t RESERVED0[864U]; + __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ + uint32_t RESERVED1[15U]; + __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ + uint32_t RESERVED2[15U]; + __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ + uint32_t RESERVED3[32U]; + uint32_t RESERVED4[43U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ + uint32_t RESERVED5[1U]; + __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) ITM Device Architecture Register */ + uint32_t RESERVED6[4U]; + __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ + __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ + __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ + __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ + __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ + __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ + __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ + __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ + __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ + __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ + __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ + __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ +} ITM_Type; + +/* ITM Stimulus Port Register Definitions */ +#define ITM_STIM_DISABLED_Pos 1U /*!< ITM STIM: DISABLED Position */ +#define ITM_STIM_DISABLED_Msk (0x1UL << ITM_STIM_DISABLED_Pos) /*!< ITM STIM: DISABLED Mask */ + +#define ITM_STIM_FIFOREADY_Pos 0U /*!< ITM STIM: FIFOREADY Position */ +#define ITM_STIM_FIFOREADY_Msk (0x1UL /*<< ITM_STIM_FIFOREADY_Pos*/) /*!< ITM STIM: FIFOREADY Mask */ + +/* ITM Trace Privilege Register Definitions */ +#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */ +#define ITM_TPR_PRIVMASK_Msk (0xFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ + +/* ITM Trace Control Register Definitions */ +#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */ +#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ + +#define ITM_TCR_TRACEBUSID_Pos 16U /*!< ITM TCR: ATBID Position */ +#define ITM_TCR_TRACEBUSID_Msk (0x7FUL << ITM_TCR_TRACEBUSID_Pos) /*!< ITM TCR: ATBID Mask */ + +#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */ +#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ + +#define ITM_TCR_TSPRESCALE_Pos 8U /*!< ITM TCR: TSPRESCALE Position */ +#define ITM_TCR_TSPRESCALE_Msk (3UL << ITM_TCR_TSPRESCALE_Pos) /*!< ITM TCR: TSPRESCALE Mask */ + +#define ITM_TCR_STALLENA_Pos 5U /*!< ITM TCR: STALLENA Position */ +#define ITM_TCR_STALLENA_Msk (1UL << ITM_TCR_STALLENA_Pos) /*!< ITM TCR: STALLENA Mask */ + +#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */ +#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ + +#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */ +#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ + +#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */ +#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ + +#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */ +#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ + +#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ +#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ + +/* ITM Lock Status Register Definitions */ +#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */ +#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ + +#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */ +#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ + +#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ +#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ + +/*@}*/ /* end of group CMSIS_ITM */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ + __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ + __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ + __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ + __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ + __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + uint32_t RESERVED3[1U]; + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED4[1U]; + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + uint32_t RESERVED5[1U]; + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED6[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + uint32_t RESERVED7[1U]; + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ + uint32_t RESERVED8[1U]; + __IOM uint32_t COMP4; /*!< Offset: 0x060 (R/W) Comparator Register 4 */ + uint32_t RESERVED9[1U]; + __IOM uint32_t FUNCTION4; /*!< Offset: 0x068 (R/W) Function Register 4 */ + uint32_t RESERVED10[1U]; + __IOM uint32_t COMP5; /*!< Offset: 0x070 (R/W) Comparator Register 5 */ + uint32_t RESERVED11[1U]; + __IOM uint32_t FUNCTION5; /*!< Offset: 0x078 (R/W) Function Register 5 */ + uint32_t RESERVED12[1U]; + __IOM uint32_t COMP6; /*!< Offset: 0x080 (R/W) Comparator Register 6 */ + uint32_t RESERVED13[1U]; + __IOM uint32_t FUNCTION6; /*!< Offset: 0x088 (R/W) Function Register 6 */ + uint32_t RESERVED14[1U]; + __IOM uint32_t COMP7; /*!< Offset: 0x090 (R/W) Comparator Register 7 */ + uint32_t RESERVED15[1U]; + __IOM uint32_t FUNCTION7; /*!< Offset: 0x098 (R/W) Function Register 7 */ + uint32_t RESERVED16[1U]; + __IOM uint32_t COMP8; /*!< Offset: 0x0A0 (R/W) Comparator Register 8 */ + uint32_t RESERVED17[1U]; + __IOM uint32_t FUNCTION8; /*!< Offset: 0x0A8 (R/W) Function Register 8 */ + uint32_t RESERVED18[1U]; + __IOM uint32_t COMP9; /*!< Offset: 0x0B0 (R/W) Comparator Register 9 */ + uint32_t RESERVED19[1U]; + __IOM uint32_t FUNCTION9; /*!< Offset: 0x0B8 (R/W) Function Register 9 */ + uint32_t RESERVED20[1U]; + __IOM uint32_t COMP10; /*!< Offset: 0x0C0 (R/W) Comparator Register 10 */ + uint32_t RESERVED21[1U]; + __IOM uint32_t FUNCTION10; /*!< Offset: 0x0C8 (R/W) Function Register 10 */ + uint32_t RESERVED22[1U]; + __IOM uint32_t COMP11; /*!< Offset: 0x0D0 (R/W) Comparator Register 11 */ + uint32_t RESERVED23[1U]; + __IOM uint32_t FUNCTION11; /*!< Offset: 0x0D8 (R/W) Function Register 11 */ + uint32_t RESERVED24[1U]; + __IOM uint32_t COMP12; /*!< Offset: 0x0E0 (R/W) Comparator Register 12 */ + uint32_t RESERVED25[1U]; + __IOM uint32_t FUNCTION12; /*!< Offset: 0x0E8 (R/W) Function Register 12 */ + uint32_t RESERVED26[1U]; + __IOM uint32_t COMP13; /*!< Offset: 0x0F0 (R/W) Comparator Register 13 */ + uint32_t RESERVED27[1U]; + __IOM uint32_t FUNCTION13; /*!< Offset: 0x0F8 (R/W) Function Register 13 */ + uint32_t RESERVED28[1U]; + __IOM uint32_t COMP14; /*!< Offset: 0x100 (R/W) Comparator Register 14 */ + uint32_t RESERVED29[1U]; + __IOM uint32_t FUNCTION14; /*!< Offset: 0x108 (R/W) Function Register 14 */ + uint32_t RESERVED30[1U]; + __IOM uint32_t COMP15; /*!< Offset: 0x110 (R/W) Comparator Register 15 */ + uint32_t RESERVED31[1U]; + __IOM uint32_t FUNCTION15; /*!< Offset: 0x118 (R/W) Function Register 15 */ + uint32_t RESERVED32[934U]; + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R ) Lock Status Register */ + uint32_t RESERVED33[1U]; + __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) Device Architecture Register */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +#define DWT_CTRL_CYCDISS_Pos 23U /*!< DWT CTRL: CYCDISS Position */ +#define DWT_CTRL_CYCDISS_Msk (0x1UL << DWT_CTRL_CYCDISS_Pos) /*!< DWT CTRL: CYCDISS Mask */ + +#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */ +#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ + +#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */ +#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ + +#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */ +#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ + +#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */ +#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ + +#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */ +#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ + +#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */ +#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ + +#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */ +#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ + +#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */ +#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ + +#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */ +#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ + +#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */ +#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ + +#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */ +#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ + +#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */ +#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ + +#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */ +#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ + +/* DWT CPI Count Register Definitions */ +#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */ +#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ + +/* DWT Exception Overhead Count Register Definitions */ +#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */ +#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ + +/* DWT Sleep Count Register Definitions */ +#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */ +#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ + +/* DWT LSU Count Register Definitions */ +#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */ +#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ + +/* DWT Folded-instruction Count Register Definitions */ +#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */ +#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_ID_Pos 27U /*!< DWT FUNCTION: ID Position */ +#define DWT_FUNCTION_ID_Msk (0x1FUL << DWT_FUNCTION_ID_Pos) /*!< DWT FUNCTION: ID Mask */ + +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_ACTION_Pos 4U /*!< DWT FUNCTION: ACTION Position */ +#define DWT_FUNCTION_ACTION_Msk (0x1UL << DWT_FUNCTION_ACTION_Pos) /*!< DWT FUNCTION: ACTION Mask */ + +#define DWT_FUNCTION_MATCH_Pos 0U /*!< DWT FUNCTION: MATCH Position */ +#define DWT_FUNCTION_MATCH_Msk (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/) /*!< DWT FUNCTION: MATCH Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Sizes Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Sizes Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IOM uint32_t PSCR; /*!< Offset: 0x308 (R/W) Periodic Synchronization Control Register */ + uint32_t RESERVED3[809U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) Software Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) Software Lock Status Register */ + uint32_t RESERVED4[4U]; + __IM uint32_t TYPE; /*!< Offset: 0xFC8 (R/ ) Device Identifier Register */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) Device Type Register */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_SWOSCALER_Pos 0U /*!< TPI ACPR: SWOSCALER Position */ +#define TPI_ACPR_SWOSCALER_Msk (0xFFFFUL /*<< TPI_ACPR_SWOSCALER_Pos*/) /*!< TPI ACPR: SWOSCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_FOnMan_Pos 6U /*!< TPI FFCR: FOnMan Position */ +#define TPI_FFCR_FOnMan_Msk (0x1UL << TPI_FFCR_FOnMan_Pos) /*!< TPI FFCR: FOnMan Mask */ + +#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI Periodic Synchronization Control Register Definitions */ +#define TPI_PSCR_PSCount_Pos 0U /*!< TPI PSCR: PSCount Position */ +#define TPI_PSCR_PSCount_Msk (0x1FUL /*<< TPI_PSCR_PSCount_Pos*/) /*!< TPI PSCR: TPSCount Mask */ + +/* TPI Software Lock Status Register Definitions */ +#define TPI_LSR_nTT_Pos 1U /*!< TPI LSR: Not thirty-two bit. Position */ +#define TPI_LSR_nTT_Msk (0x1UL << TPI_LSR_nTT_Pos) /*!< TPI LSR: Not thirty-two bit. Mask */ + +#define TPI_LSR_SLK_Pos 1U /*!< TPI LSR: Software Lock status Position */ +#define TPI_LSR_SLK_Msk (0x1UL << TPI_LSR_SLK_Pos) /*!< TPI LSR: Software Lock status Mask */ + +#define TPI_LSR_SLI_Pos 0U /*!< TPI LSR: Software Lock implemented Position */ +#define TPI_LSR_SLI_Msk (0x1UL /*<< TPI_LSR_SLI_Pos*/) /*!< TPI LSR: Software Lock implemented Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_FIFOSZ_Pos 6U /*!< TPI DEVID: FIFO depth Position */ +#define TPI_DEVID_FIFOSZ_Msk (0x7UL << TPI_DEVID_FIFOSZ_Pos) /*!< TPI DEVID: FIFO depth Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) MPU Region Limit Address Register */ + __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Region Base Address Register Alias 1 */ + __IOM uint32_t RLAR_A1; /*!< Offset: 0x018 (R/W) MPU Region Limit Address Register Alias 1 */ + __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Region Base Address Register Alias 2 */ + __IOM uint32_t RLAR_A2; /*!< Offset: 0x020 (R/W) MPU Region Limit Address Register Alias 2 */ + __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Region Base Address Register Alias 3 */ + __IOM uint32_t RLAR_A3; /*!< Offset: 0x028 (R/W) MPU Region Limit Address Register Alias 3 */ + uint32_t RESERVED0[1]; + union { + __IOM uint32_t MAIR[2]; + struct { + __IOM uint32_t MAIR0; /*!< Offset: 0x030 (R/W) MPU Memory Attribute Indirection Register 0 */ + __IOM uint32_t MAIR1; /*!< Offset: 0x034 (R/W) MPU Memory Attribute Indirection Register 1 */ + }; + }; +} MPU_Type; + +#define MPU_TYPE_RALIASES 4U + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_BASE_Pos 5U /*!< MPU RBAR: BASE Position */ +#define MPU_RBAR_BASE_Msk (0x7FFFFFFUL << MPU_RBAR_BASE_Pos) /*!< MPU RBAR: BASE Mask */ + +#define MPU_RBAR_SH_Pos 3U /*!< MPU RBAR: SH Position */ +#define MPU_RBAR_SH_Msk (0x3UL << MPU_RBAR_SH_Pos) /*!< MPU RBAR: SH Mask */ + +#define MPU_RBAR_AP_Pos 1U /*!< MPU RBAR: AP Position */ +#define MPU_RBAR_AP_Msk (0x3UL << MPU_RBAR_AP_Pos) /*!< MPU RBAR: AP Mask */ + +#define MPU_RBAR_XN_Pos 0U /*!< MPU RBAR: XN Position */ +#define MPU_RBAR_XN_Msk (01UL /*<< MPU_RBAR_XN_Pos*/) /*!< MPU RBAR: XN Mask */ + +/* MPU Region Limit Address Register Definitions */ +#define MPU_RLAR_LIMIT_Pos 5U /*!< MPU RLAR: LIMIT Position */ +#define MPU_RLAR_LIMIT_Msk (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos) /*!< MPU RLAR: LIMIT Mask */ + +#define MPU_RLAR_AttrIndx_Pos 1U /*!< MPU RLAR: AttrIndx Position */ +#define MPU_RLAR_AttrIndx_Msk (0x7UL << MPU_RLAR_AttrIndx_Pos) /*!< MPU RLAR: AttrIndx Mask */ + +#define MPU_RLAR_EN_Pos 0U /*!< MPU RLAR: Region enable bit Position */ +#define MPU_RLAR_EN_Msk (1UL /*<< MPU_RLAR_EN_Pos*/) /*!< MPU RLAR: Region enable bit Disable Mask */ + +/* MPU Memory Attribute Indirection Register 0 Definitions */ +#define MPU_MAIR0_Attr3_Pos 24U /*!< MPU MAIR0: Attr3 Position */ +#define MPU_MAIR0_Attr3_Msk (0xFFUL << MPU_MAIR0_Attr3_Pos) /*!< MPU MAIR0: Attr3 Mask */ + +#define MPU_MAIR0_Attr2_Pos 16U /*!< MPU MAIR0: Attr2 Position */ +#define MPU_MAIR0_Attr2_Msk (0xFFUL << MPU_MAIR0_Attr2_Pos) /*!< MPU MAIR0: Attr2 Mask */ + +#define MPU_MAIR0_Attr1_Pos 8U /*!< MPU MAIR0: Attr1 Position */ +#define MPU_MAIR0_Attr1_Msk (0xFFUL << MPU_MAIR0_Attr1_Pos) /*!< MPU MAIR0: Attr1 Mask */ + +#define MPU_MAIR0_Attr0_Pos 0U /*!< MPU MAIR0: Attr0 Position */ +#define MPU_MAIR0_Attr0_Msk (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/) /*!< MPU MAIR0: Attr0 Mask */ + +/* MPU Memory Attribute Indirection Register 1 Definitions */ +#define MPU_MAIR1_Attr7_Pos 24U /*!< MPU MAIR1: Attr7 Position */ +#define MPU_MAIR1_Attr7_Msk (0xFFUL << MPU_MAIR1_Attr7_Pos) /*!< MPU MAIR1: Attr7 Mask */ + +#define MPU_MAIR1_Attr6_Pos 16U /*!< MPU MAIR1: Attr6 Position */ +#define MPU_MAIR1_Attr6_Msk (0xFFUL << MPU_MAIR1_Attr6_Pos) /*!< MPU MAIR1: Attr6 Mask */ + +#define MPU_MAIR1_Attr5_Pos 8U /*!< MPU MAIR1: Attr5 Position */ +#define MPU_MAIR1_Attr5_Msk (0xFFUL << MPU_MAIR1_Attr5_Pos) /*!< MPU MAIR1: Attr5 Mask */ + +#define MPU_MAIR1_Attr4_Pos 0U /*!< MPU MAIR1: Attr4 Position */ +#define MPU_MAIR1_Attr4_Msk (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/) /*!< MPU MAIR1: Attr4 Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SAU Security Attribution Unit (SAU) + \brief Type definitions for the Security Attribution Unit (SAU) + @{ + */ + +/** + \brief Structure type to access the Security Attribution Unit (SAU). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SAU Control Register */ + __IM uint32_t TYPE; /*!< Offset: 0x004 (R/ ) SAU Type Register */ +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) SAU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) SAU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) SAU Region Limit Address Register */ +#else + uint32_t RESERVED0[3]; +#endif + __IOM uint32_t SFSR; /*!< Offset: 0x014 (R/W) Secure Fault Status Register */ + __IOM uint32_t SFAR; /*!< Offset: 0x018 (R/W) Secure Fault Address Register */ +} SAU_Type; + +/* SAU Control Register Definitions */ +#define SAU_CTRL_ALLNS_Pos 1U /*!< SAU CTRL: ALLNS Position */ +#define SAU_CTRL_ALLNS_Msk (1UL << SAU_CTRL_ALLNS_Pos) /*!< SAU CTRL: ALLNS Mask */ + +#define SAU_CTRL_ENABLE_Pos 0U /*!< SAU CTRL: ENABLE Position */ +#define SAU_CTRL_ENABLE_Msk (1UL /*<< SAU_CTRL_ENABLE_Pos*/) /*!< SAU CTRL: ENABLE Mask */ + +/* SAU Type Register Definitions */ +#define SAU_TYPE_SREGION_Pos 0U /*!< SAU TYPE: SREGION Position */ +#define SAU_TYPE_SREGION_Msk (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/) /*!< SAU TYPE: SREGION Mask */ + +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) +/* SAU Region Number Register Definitions */ +#define SAU_RNR_REGION_Pos 0U /*!< SAU RNR: REGION Position */ +#define SAU_RNR_REGION_Msk (0xFFUL /*<< SAU_RNR_REGION_Pos*/) /*!< SAU RNR: REGION Mask */ + +/* SAU Region Base Address Register Definitions */ +#define SAU_RBAR_BADDR_Pos 5U /*!< SAU RBAR: BADDR Position */ +#define SAU_RBAR_BADDR_Msk (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos) /*!< SAU RBAR: BADDR Mask */ + +/* SAU Region Limit Address Register Definitions */ +#define SAU_RLAR_LADDR_Pos 5U /*!< SAU RLAR: LADDR Position */ +#define SAU_RLAR_LADDR_Msk (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos) /*!< SAU RLAR: LADDR Mask */ + +#define SAU_RLAR_NSC_Pos 1U /*!< SAU RLAR: NSC Position */ +#define SAU_RLAR_NSC_Msk (1UL << SAU_RLAR_NSC_Pos) /*!< SAU RLAR: NSC Mask */ + +#define SAU_RLAR_ENABLE_Pos 0U /*!< SAU RLAR: ENABLE Position */ +#define SAU_RLAR_ENABLE_Msk (1UL /*<< SAU_RLAR_ENABLE_Pos*/) /*!< SAU RLAR: ENABLE Mask */ + +#endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */ + +/* Secure Fault Status Register Definitions */ +#define SAU_SFSR_LSERR_Pos 7U /*!< SAU SFSR: LSERR Position */ +#define SAU_SFSR_LSERR_Msk (1UL << SAU_SFSR_LSERR_Pos) /*!< SAU SFSR: LSERR Mask */ + +#define SAU_SFSR_SFARVALID_Pos 6U /*!< SAU SFSR: SFARVALID Position */ +#define SAU_SFSR_SFARVALID_Msk (1UL << SAU_SFSR_SFARVALID_Pos) /*!< SAU SFSR: SFARVALID Mask */ + +#define SAU_SFSR_LSPERR_Pos 5U /*!< SAU SFSR: LSPERR Position */ +#define SAU_SFSR_LSPERR_Msk (1UL << SAU_SFSR_LSPERR_Pos) /*!< SAU SFSR: LSPERR Mask */ + +#define SAU_SFSR_INVTRAN_Pos 4U /*!< SAU SFSR: INVTRAN Position */ +#define SAU_SFSR_INVTRAN_Msk (1UL << SAU_SFSR_INVTRAN_Pos) /*!< SAU SFSR: INVTRAN Mask */ + +#define SAU_SFSR_AUVIOL_Pos 3U /*!< SAU SFSR: AUVIOL Position */ +#define SAU_SFSR_AUVIOL_Msk (1UL << SAU_SFSR_AUVIOL_Pos) /*!< SAU SFSR: AUVIOL Mask */ + +#define SAU_SFSR_INVER_Pos 2U /*!< SAU SFSR: INVER Position */ +#define SAU_SFSR_INVER_Msk (1UL << SAU_SFSR_INVER_Pos) /*!< SAU SFSR: INVER Mask */ + +#define SAU_SFSR_INVIS_Pos 1U /*!< SAU SFSR: INVIS Position */ +#define SAU_SFSR_INVIS_Msk (1UL << SAU_SFSR_INVIS_Pos) /*!< SAU SFSR: INVIS Mask */ + +#define SAU_SFSR_INVEP_Pos 0U /*!< SAU SFSR: INVEP Position */ +#define SAU_SFSR_INVEP_Msk (1UL /*<< SAU_SFSR_INVEP_Pos*/) /*!< SAU SFSR: INVEP Mask */ + +/*@} end of group CMSIS_SAU */ +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_FPU Floating Point Unit (FPU) + \brief Type definitions for the Floating Point Unit (FPU) + @{ + */ + +/** + \brief Structure type to access the Floating Point Unit (FPU). + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IOM uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */ + __IOM uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */ + __IOM uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */ + __IM uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and FP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and FP Feature Register 1 */ +} FPU_Type; + +/* Floating-Point Context Control Register Definitions */ +#define FPU_FPCCR_ASPEN_Pos 31U /*!< FPCCR: ASPEN bit Position */ +#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */ + +#define FPU_FPCCR_LSPEN_Pos 30U /*!< FPCCR: LSPEN Position */ +#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */ + +#define FPU_FPCCR_LSPENS_Pos 29U /*!< FPCCR: LSPENS Position */ +#define FPU_FPCCR_LSPENS_Msk (1UL << FPU_FPCCR_LSPENS_Pos) /*!< FPCCR: LSPENS bit Mask */ + +#define FPU_FPCCR_CLRONRET_Pos 28U /*!< FPCCR: CLRONRET Position */ +#define FPU_FPCCR_CLRONRET_Msk (1UL << FPU_FPCCR_CLRONRET_Pos) /*!< FPCCR: CLRONRET bit Mask */ + +#define FPU_FPCCR_CLRONRETS_Pos 27U /*!< FPCCR: CLRONRETS Position */ +#define FPU_FPCCR_CLRONRETS_Msk (1UL << FPU_FPCCR_CLRONRETS_Pos) /*!< FPCCR: CLRONRETS bit Mask */ + +#define FPU_FPCCR_TS_Pos 26U /*!< FPCCR: TS Position */ +#define FPU_FPCCR_TS_Msk (1UL << FPU_FPCCR_TS_Pos) /*!< FPCCR: TS bit Mask */ + +#define FPU_FPCCR_UFRDY_Pos 10U /*!< FPCCR: UFRDY Position */ +#define FPU_FPCCR_UFRDY_Msk (1UL << FPU_FPCCR_UFRDY_Pos) /*!< FPCCR: UFRDY bit Mask */ + +#define FPU_FPCCR_SPLIMVIOL_Pos 9U /*!< FPCCR: SPLIMVIOL Position */ +#define FPU_FPCCR_SPLIMVIOL_Msk (1UL << FPU_FPCCR_SPLIMVIOL_Pos) /*!< FPCCR: SPLIMVIOL bit Mask */ + +#define FPU_FPCCR_MONRDY_Pos 8U /*!< FPCCR: MONRDY Position */ +#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */ + +#define FPU_FPCCR_SFRDY_Pos 7U /*!< FPCCR: SFRDY Position */ +#define FPU_FPCCR_SFRDY_Msk (1UL << FPU_FPCCR_SFRDY_Pos) /*!< FPCCR: SFRDY bit Mask */ + +#define FPU_FPCCR_BFRDY_Pos 6U /*!< FPCCR: BFRDY Position */ +#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */ + +#define FPU_FPCCR_MMRDY_Pos 5U /*!< FPCCR: MMRDY Position */ +#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */ + +#define FPU_FPCCR_HFRDY_Pos 4U /*!< FPCCR: HFRDY Position */ +#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */ + +#define FPU_FPCCR_THREAD_Pos 3U /*!< FPCCR: processor mode bit Position */ +#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */ + +#define FPU_FPCCR_S_Pos 2U /*!< FPCCR: Security status of the FP context bit Position */ +#define FPU_FPCCR_S_Msk (1UL << FPU_FPCCR_S_Pos) /*!< FPCCR: Security status of the FP context bit Mask */ + +#define FPU_FPCCR_USER_Pos 1U /*!< FPCCR: privilege level bit Position */ +#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */ + +#define FPU_FPCCR_LSPACT_Pos 0U /*!< FPCCR: Lazy state preservation active bit Position */ +#define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/) /*!< FPCCR: Lazy state preservation active bit Mask */ + +/* Floating-Point Context Address Register Definitions */ +#define FPU_FPCAR_ADDRESS_Pos 3U /*!< FPCAR: ADDRESS bit Position */ +#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */ + +/* Floating-Point Default Status Control Register Definitions */ +#define FPU_FPDSCR_AHP_Pos 26U /*!< FPDSCR: AHP bit Position */ +#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */ + +#define FPU_FPDSCR_DN_Pos 25U /*!< FPDSCR: DN bit Position */ +#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */ + +#define FPU_FPDSCR_FZ_Pos 24U /*!< FPDSCR: FZ bit Position */ +#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */ + +#define FPU_FPDSCR_RMode_Pos 22U /*!< FPDSCR: RMode bit Position */ +#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */ + +/* Media and FP Feature Register 0 Definitions */ +#define FPU_MVFR0_FP_rounding_modes_Pos 28U /*!< MVFR0: FP rounding modes bits Position */ +#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */ + +#define FPU_MVFR0_Short_vectors_Pos 24U /*!< MVFR0: Short vectors bits Position */ +#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */ + +#define FPU_MVFR0_Square_root_Pos 20U /*!< MVFR0: Square root bits Position */ +#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */ + +#define FPU_MVFR0_Divide_Pos 16U /*!< MVFR0: Divide bits Position */ +#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */ + +#define FPU_MVFR0_FP_excep_trapping_Pos 12U /*!< MVFR0: FP exception trapping bits Position */ +#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */ + +#define FPU_MVFR0_Double_precision_Pos 8U /*!< MVFR0: Double-precision bits Position */ +#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */ + +#define FPU_MVFR0_Single_precision_Pos 4U /*!< MVFR0: Single-precision bits Position */ +#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */ + +#define FPU_MVFR0_A_SIMD_registers_Pos 0U /*!< MVFR0: A_SIMD registers bits Position */ +#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/) /*!< MVFR0: A_SIMD registers bits Mask */ + +/* Media and FP Feature Register 1 Definitions */ +#define FPU_MVFR1_FP_fused_MAC_Pos 28U /*!< MVFR1: FP fused MAC bits Position */ +#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */ + +#define FPU_MVFR1_FP_HPFP_Pos 24U /*!< MVFR1: FP HPFP bits Position */ +#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */ + +#define FPU_MVFR1_D_NaN_mode_Pos 4U /*!< MVFR1: D_NaN mode bits Position */ +#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */ + +#define FPU_MVFR1_FtZ_mode_Pos 0U /*!< MVFR1: FtZ mode bits Position */ +#define FPU_MVFR1_FtZ_mode_Msk (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/) /*!< MVFR1: FtZ mode bits Mask */ + +/*@} end of group CMSIS_FPU */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** + \brief Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ + uint32_t RESERVED4[1U]; + __IOM uint32_t DAUTHCTRL; /*!< Offset: 0x014 (R/W) Debug Authentication Control Register */ + __IOM uint32_t DSCSR; /*!< Offset: 0x018 (R/W) Debug Security Control and Status Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register Definitions */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESTART_ST_Pos 26U /*!< CoreDebug DHCSR: S_RESTART_ST Position */ +#define CoreDebug_DHCSR_S_RESTART_ST_Msk (1UL << CoreDebug_DHCSR_S_RESTART_ST_Pos) /*!< CoreDebug DHCSR: S_RESTART_ST Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ +#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register Definitions */ +#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register Definitions */ +#define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< CoreDebug DEMCR: TRCENA Position */ +#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ + +#define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< CoreDebug DEMCR: MON_REQ Position */ +#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ + +#define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< CoreDebug DEMCR: MON_STEP Position */ +#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ + +#define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< CoreDebug DEMCR: MON_PEND Position */ +#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ + +#define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< CoreDebug DEMCR: MON_EN Position */ +#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< CoreDebug DEMCR: VC_INTERR Position */ +#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ + +#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< CoreDebug DEMCR: VC_BUSERR Position */ +#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ + +#define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< CoreDebug DEMCR: VC_STATERR Position */ +#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ + +#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< CoreDebug DEMCR: VC_CHKERR Position */ +#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ + +#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< CoreDebug DEMCR: VC_NOCPERR Position */ +#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ + +#define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< CoreDebug DEMCR: VC_MMERR Position */ +#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ + +/* Debug Authentication Control Register Definitions */ +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos 3U /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Position */ +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Mask */ + +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos 2U /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Msk (1UL << CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos) /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Mask */ + +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Pos 1U /*!< CoreDebug DAUTHCTRL: INTSPIDEN Position */ +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPIDEN Mask */ + +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Pos 0U /*!< CoreDebug DAUTHCTRL: SPIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Msk (1UL /*<< CoreDebug_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< CoreDebug DAUTHCTRL: SPIDENSEL Mask */ + +/* Debug Security Control and Status Register Definitions */ +#define CoreDebug_DSCSR_CDS_Pos 16U /*!< CoreDebug DSCSR: CDS Position */ +#define CoreDebug_DSCSR_CDS_Msk (1UL << CoreDebug_DSCSR_CDS_Pos) /*!< CoreDebug DSCSR: CDS Mask */ + +#define CoreDebug_DSCSR_SBRSEL_Pos 1U /*!< CoreDebug DSCSR: SBRSEL Position */ +#define CoreDebug_DSCSR_SBRSEL_Msk (1UL << CoreDebug_DSCSR_SBRSEL_Pos) /*!< CoreDebug DSCSR: SBRSEL Mask */ + +#define CoreDebug_DSCSR_SBRSELEN_Pos 0U /*!< CoreDebug DSCSR: SBRSELEN Position */ +#define CoreDebug_DSCSR_SBRSELEN_Msk (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/) /*!< CoreDebug DSCSR: SBRSELEN Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ + #define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ + #define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ + #define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ + #define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ + #define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ + #define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ + #define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ + #define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + + #define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ + #define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ + #define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ + #define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ + #define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ + #define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ + #define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ + #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE ) /*!< Core Debug configuration struct */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ + #endif + + #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SAU_BASE (SCS_BASE + 0x0DD0UL) /*!< Security Attribution Unit */ + #define SAU ((SAU_Type *) SAU_BASE ) /*!< Security Attribution Unit */ + #endif + + #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ + #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */ + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SCS_BASE_NS (0xE002E000UL) /*!< System Control Space Base Address (non-secure address space) */ + #define CoreDebug_BASE_NS (0xE002EDF0UL) /*!< Core Debug Base Address (non-secure address space) */ + #define SysTick_BASE_NS (SCS_BASE_NS + 0x0010UL) /*!< SysTick Base Address (non-secure address space) */ + #define NVIC_BASE_NS (SCS_BASE_NS + 0x0100UL) /*!< NVIC Base Address (non-secure address space) */ + #define SCB_BASE_NS (SCS_BASE_NS + 0x0D00UL) /*!< System Control Block Base Address (non-secure address space) */ + + #define SCnSCB_NS ((SCnSCB_Type *) SCS_BASE_NS ) /*!< System control Register not in SCB(non-secure address space) */ + #define SCB_NS ((SCB_Type *) SCB_BASE_NS ) /*!< SCB configuration struct (non-secure address space) */ + #define SysTick_NS ((SysTick_Type *) SysTick_BASE_NS ) /*!< SysTick configuration struct (non-secure address space) */ + #define NVIC_NS ((NVIC_Type *) NVIC_BASE_NS ) /*!< NVIC configuration struct (non-secure address space) */ + #define CoreDebug_NS ((CoreDebug_Type *) CoreDebug_BASE_NS) /*!< Core Debug configuration struct (non-secure address space) */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE_NS (SCS_BASE_NS + 0x0D90UL) /*!< Memory Protection Unit (non-secure address space) */ + #define MPU_NS ((MPU_Type *) MPU_BASE_NS ) /*!< Memory Protection Unit (non-secure address space) */ + #endif + + #define FPU_BASE_NS (SCS_BASE_NS + 0x0F30UL) /*!< Floating Point Unit (non-secure address space) */ + #define FPU_NS ((FPU_Type *) FPU_BASE_NS ) /*!< Floating Point Unit (non-secure address space) */ + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Debug Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ + #define NVIC_GetActive __NVIC_GetActive + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* Special LR values for Secure/Non-Secure call handling and exception handling */ + +/* Function Return Payload (from ARMv8-M Architecture Reference Manual) LR value on entry from Secure BLXNS */ +#define FNC_RETURN (0xFEFFFFFFUL) /* bit [0] ignored when processing a branch */ + +/* The following EXC_RETURN mask values are used to evaluate the LR on exception entry */ +#define EXC_RETURN_PREFIX (0xFF000000UL) /* bits [31:24] set to indicate an EXC_RETURN value */ +#define EXC_RETURN_S (0x00000040UL) /* bit [6] stack used to push registers: 0=Non-secure 1=Secure */ +#define EXC_RETURN_DCRS (0x00000020UL) /* bit [5] stacking rules for called registers: 0=skipped 1=saved */ +#define EXC_RETURN_FTYPE (0x00000010UL) /* bit [4] allocate stack for floating-point context: 0=done 1=skipped */ +#define EXC_RETURN_MODE (0x00000008UL) /* bit [3] processor mode for return: 0=Handler mode 1=Thread mode */ +#define EXC_RETURN_SPSEL (0x00000004UL) /* bit [2] stack pointer used to restore context: 0=MSP 1=PSP */ +#define EXC_RETURN_ES (0x00000001UL) /* bit [0] security state exception was taken to: 0=Non-secure 1=Secure */ + +/* Integrity Signature (from ARMv8-M Architecture Reference Manual) for exception context stacking */ +#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) /* Value for processors with floating-point extension: */ +#define EXC_INTEGRITY_SIGNATURE (0xFEFA125AUL) /* bit [0] SFTC must match LR bit[4] EXC_RETURN_FTYPE */ +#else +#define EXC_INTEGRITY_SIGNATURE (0xFEFA125BUL) /* Value for processors without floating-point extension */ +#endif + + +/** + \brief Set Priority Grouping + \details Sets the priority grouping field using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ + SCB->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping + \details Reads the priority grouping field from the NVIC Interrupt Controller. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) +{ + return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + __COMPILER_BARRIER(); + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __COMPILER_BARRIER(); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Get Interrupt Target State + \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + \return 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Target State + \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Clear Interrupt Target State + \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; + __DSB(); +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Set Priority Grouping (non-secure) + \details Sets the non-secure priority grouping field when in secure state using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void TZ_NVIC_SetPriorityGrouping_NS(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB_NS->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ + SCB_NS->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping (non-secure) + \details Reads the priority grouping field from the non-secure NVIC when in secure state. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPriorityGrouping_NS(void) +{ + return ((uint32_t)((SCB_NS->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt (non-secure) + \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status (non-secure) + \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt (non-secure) + \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Pending Interrupt (non-secure) + \details Reads the NVIC pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt (non-secure) + \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt (non-secure) + \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt (non-secure) + \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority (non-secure) + \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every non-secure processor exception. + */ +__STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority (non-secure) + \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC_NS->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_NVICFunctions */ + +/* ########################## MPU functions #################################### */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + +#include "mpu_armv8.h" + +#endif + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + uint32_t mvfr0; + + mvfr0 = FPU->MVFR0; + if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x220U) + { + return 2U; /* Double + Single precision FPU */ + } + else if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U) + { + return 1U; /* Single precision FPU */ + } + else + { + return 0U; /* No FPU */ + } +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ########################## SAU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SAUFunctions SAU Functions + \brief Functions that configure the SAU. + @{ + */ + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + +/** + \brief Enable SAU + \details Enables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Enable(void) +{ + SAU->CTRL |= (SAU_CTRL_ENABLE_Msk); +} + + + +/** + \brief Disable SAU + \details Disables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Disable(void) +{ + SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk); +} + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_SAUFunctions */ + + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief System Tick Configuration (non-secure) + \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function TZ_SysTick_Config_NS is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + + */ +__STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick_NS->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick_NS->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick_NS->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + +/* ##################################### Debug In/Output function ########################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_core_DebugFunctions ITM Functions + \brief Functions that access the ITM debug interface. + @{ + */ + +extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ +#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ + + +/** + \brief ITM Send Character + \details Transmits a character via the ITM channel 0, and + \li Just returns when no debugger is connected that has booked the output. + \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. + \param [in] ch Character to transmit. + \returns Character to transmit. + */ +__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) +{ + if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ + ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ + { + while (ITM->PORT[0U].u32 == 0UL) + { + __NOP(); + } + ITM->PORT[0U].u8 = (uint8_t)ch; + } + return (ch); +} + + +/** + \brief ITM Receive Character + \details Inputs a character via the external variable \ref ITM_RxBuffer. + \return Received character. + \return -1 No character pending. + */ +__STATIC_INLINE int32_t ITM_ReceiveChar (void) +{ + int32_t ch = -1; /* no character available */ + + if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) + { + ch = ITM_RxBuffer; + ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ + } + + return (ch); +} + + +/** + \brief ITM Check Character + \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. + \return 0 No character available. + \return 1 Character available. + */ +__STATIC_INLINE int32_t ITM_CheckChar (void) +{ + + if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) + { + return (0); /* no character available */ + } + else + { + return (1); /* character available */ + } +} + +/*@} end of CMSIS_core_DebugFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_ARMV8MML_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm0.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm0.h new file mode 100644 index 0000000000..cafae5a0a7 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm0.h @@ -0,0 +1,952 @@ +/**************************************************************************//** + * @file core_cm0.h + * @brief CMSIS Cortex-M0 Core Peripheral Access Layer Header File + * @version V5.0.6 + * @date 13. March 2019 + ******************************************************************************/ +/* + * Copyright (c) 2009-2019 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_CM0_H_GENERIC +#define __CORE_CM0_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_M0 + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS CM0 definitions */ +#define __CM0_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __CM0_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __CM0_CMSIS_VERSION ((__CM0_CMSIS_VERSION_MAIN << 16U) | \ + __CM0_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M (0U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + This core does not support an FPU at all +*/ +#define __FPU_USED 0U + +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_FP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM0_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM0_H_DEPENDANT +#define __CORE_CM0_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM0_REV + #define __CM0_REV 0x0000U + #warning "__CM0_REV not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 2U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group Cortex_M0 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t _reserved0:1; /*!< bit: 0 Reserved */ + uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ + uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[1U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[31U]; + __IOM uint32_t ICER[1U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RESERVED1[31U]; + __IOM uint32_t ISPR[1U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[31U]; + __IOM uint32_t ICPR[1U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[31U]; + uint32_t RESERVED4[64U]; + __IOM uint32_t IP[8U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */ +} NVIC_Type; + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + uint32_t RESERVED0; + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + uint32_t RESERVED1; + __IOM uint32_t SHP[2U]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */ +#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */ +#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Cortex-M0 Core Debug Registers (DCB registers, SHCSR, and DFSR) are only accessible over DAP and not via processor. + Therefore they are not covered by the Cortex-M0 header file. + @{ + */ +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ +#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ +#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ +#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ +#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + +#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ +#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ +#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ + + +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ +/*#define NVIC_GetActive __NVIC_GetActive not available for Cortex-M0 */ + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* The following EXC_RETURN values are saved the LR on exception entry */ +#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */ +#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */ +#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */ + + +/* Interrupt Priorities are WORD accessible only under Armv6-M */ +/* The following MACROS handle generation of the register offset and byte masks */ +#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL) +#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) ) +#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) ) + +#define __NVIC_SetPriorityGrouping(X) (void)(X) +#define __NVIC_GetPriorityGrouping() (0U) + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + __COMPILER_BARRIER(); + NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __COMPILER_BARRIER(); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IP[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } + else + { + SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + Address 0 must be mapped to SRAM. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t vectors = 0x0U; + (* (int *) (vectors + ((int32_t)IRQn + NVIC_USER_IRQ_OFFSET) * 4)) = vector; + /* ARM Application Note 321 states that the M0 does not require the architectural barrier */ +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t vectors = 0x0U; + return (uint32_t)(* (int *) (vectors + ((int32_t)IRQn + NVIC_USER_IRQ_OFFSET) * 4)); +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + SCB_AIRCR_SYSRESETREQ_Msk); + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +/*@} end of CMSIS_Core_NVICFunctions */ + + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + return 0U; /* No FPU */ +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM0_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm0plus.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm0plus.h new file mode 100644 index 0000000000..d104965db5 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm0plus.h @@ -0,0 +1,1085 @@ +/**************************************************************************//** + * @file core_cm0plus.h + * @brief CMSIS Cortex-M0+ Core Peripheral Access Layer Header File + * @version V5.0.7 + * @date 13. March 2019 + ******************************************************************************/ +/* + * Copyright (c) 2009-2019 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_CM0PLUS_H_GENERIC +#define __CORE_CM0PLUS_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex-M0+ + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS CM0+ definitions */ +#define __CM0PLUS_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __CM0PLUS_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __CM0PLUS_CMSIS_VERSION ((__CM0PLUS_CMSIS_VERSION_MAIN << 16U) | \ + __CM0PLUS_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M (0U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + This core does not support an FPU at all +*/ +#define __FPU_USED 0U + +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_FP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM0PLUS_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM0PLUS_H_DEPENDANT +#define __CORE_CM0PLUS_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM0PLUS_REV + #define __CM0PLUS_REV 0x0000U + #warning "__CM0PLUS_REV not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __VTOR_PRESENT + #define __VTOR_PRESENT 0U + #warning "__VTOR_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 2U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group Cortex-M0+ */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core MPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ + uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[1U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[31U]; + __IOM uint32_t ICER[1U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RESERVED1[31U]; + __IOM uint32_t ISPR[1U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[31U]; + __IOM uint32_t ICPR[1U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[31U]; + uint32_t RESERVED4[64U]; + __IOM uint32_t IP[8U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */ +} NVIC_Type; + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ +#else + uint32_t RESERVED0; +#endif + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + uint32_t RESERVED1; + __IOM uint32_t SHP[2U]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */ +#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) +/* SCB Interrupt Control State Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 8U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0xFFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ +#endif + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */ +#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ +} MPU_Type; + +#define MPU_TYPE_RALIASES 1U + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_ADDR_Pos 8U /*!< MPU RBAR: ADDR Position */ +#define MPU_RBAR_ADDR_Msk (0xFFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ + +#define MPU_RBAR_VALID_Pos 4U /*!< MPU RBAR: VALID Position */ +#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ + +#define MPU_RBAR_REGION_Pos 0U /*!< MPU RBAR: REGION Position */ +#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ + +/* MPU Region Attribute and Size Register Definitions */ +#define MPU_RASR_ATTRS_Pos 16U /*!< MPU RASR: MPU Region Attribute field Position */ +#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ + +#define MPU_RASR_XN_Pos 28U /*!< MPU RASR: ATTRS.XN Position */ +#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ + +#define MPU_RASR_AP_Pos 24U /*!< MPU RASR: ATTRS.AP Position */ +#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ + +#define MPU_RASR_TEX_Pos 19U /*!< MPU RASR: ATTRS.TEX Position */ +#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ + +#define MPU_RASR_S_Pos 18U /*!< MPU RASR: ATTRS.S Position */ +#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ + +#define MPU_RASR_C_Pos 17U /*!< MPU RASR: ATTRS.C Position */ +#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ + +#define MPU_RASR_B_Pos 16U /*!< MPU RASR: ATTRS.B Position */ +#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ + +#define MPU_RASR_SRD_Pos 8U /*!< MPU RASR: Sub-Region Disable Position */ +#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ + +#define MPU_RASR_SIZE_Pos 1U /*!< MPU RASR: Region Size Field Position */ +#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ + +#define MPU_RASR_ENABLE_Pos 0U /*!< MPU RASR: Region enable bit Position */ +#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Cortex-M0+ Core Debug Registers (DCB registers, SHCSR, and DFSR) are only accessible over DAP and not via processor. + Therefore they are not covered by the Cortex-M0+ header file. + @{ + */ +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ +#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ +#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ +#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ +#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + +#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ +#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ +#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ +#endif + +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ +/*#define NVIC_GetActive __NVIC_GetActive not available for Cortex-M0+ */ + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* The following EXC_RETURN values are saved the LR on exception entry */ +#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */ +#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */ +#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */ + + +/* Interrupt Priorities are WORD accessible only under Armv6-M */ +/* The following MACROS handle generation of the register offset and byte masks */ +#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL) +#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) ) +#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) ) + +#define __NVIC_SetPriorityGrouping(X) (void)(X) +#define __NVIC_GetPriorityGrouping() (0U) + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + __COMPILER_BARRIER(); + NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __COMPILER_BARRIER(); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IP[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } + else + { + SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + If VTOR is not present address 0 must be mapped to SRAM. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) + uint32_t vectors = SCB->VTOR; +#else + uint32_t vectors = 0x0U; +#endif + (* (int *) (vectors + ((int32_t)IRQn + NVIC_USER_IRQ_OFFSET) * 4)) = vector; + /* ARM Application Note 321 states that the M0+ does not require the architectural barrier */ +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) + uint32_t vectors = SCB->VTOR; +#else + uint32_t vectors = 0x0U; +#endif + return (uint32_t)(* (int *) (vectors + ((int32_t)IRQn + NVIC_USER_IRQ_OFFSET) * 4)); +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + SCB_AIRCR_SYSRESETREQ_Msk); + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +/*@} end of CMSIS_Core_NVICFunctions */ + +/* ########################## MPU functions #################################### */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + +#include "mpu_armv7.h" + +#endif + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + return 0U; /* No FPU */ +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM0PLUS_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm1.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm1.h new file mode 100644 index 0000000000..76b4569743 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm1.h @@ -0,0 +1,979 @@ +/**************************************************************************//** + * @file core_cm1.h + * @brief CMSIS Cortex-M1 Core Peripheral Access Layer Header File + * @version V1.0.1 + * @date 12. November 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_CM1_H_GENERIC +#define __CORE_CM1_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_M1 + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS CM1 definitions */ +#define __CM1_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __CM1_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __CM1_CMSIS_VERSION ((__CM1_CMSIS_VERSION_MAIN << 16U) | \ + __CM1_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M (1U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + This core does not support an FPU at all +*/ +#define __FPU_USED 0U + +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_FP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM1_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM1_H_DEPENDANT +#define __CORE_CM1_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM1_REV + #define __CM1_REV 0x0100U + #warning "__CM1_REV not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 2U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group Cortex_M1 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t _reserved0:1; /*!< bit: 0 Reserved */ + uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ + uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[1U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[31U]; + __IOM uint32_t ICER[1U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[31U]; + __IOM uint32_t ISPR[1U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[31U]; + __IOM uint32_t ICPR[1U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[31U]; + uint32_t RESERVED4[64U]; + __IOM uint32_t IP[8U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */ +} NVIC_Type; + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + uint32_t RESERVED0; + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + uint32_t RESERVED1; + __IOM uint32_t SHP[2U]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */ +#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */ +#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** + \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ +} SCnSCB_Type; + +/* Auxiliary Control Register Definitions */ +#define SCnSCB_ACTLR_ITCMUAEN_Pos 4U /*!< ACTLR: Instruction TCM Upper Alias Enable Position */ +#define SCnSCB_ACTLR_ITCMUAEN_Msk (1UL << SCnSCB_ACTLR_ITCMUAEN_Pos) /*!< ACTLR: Instruction TCM Upper Alias Enable Mask */ + +#define SCnSCB_ACTLR_ITCMLAEN_Pos 3U /*!< ACTLR: Instruction TCM Lower Alias Enable Position */ +#define SCnSCB_ACTLR_ITCMLAEN_Msk (1UL << SCnSCB_ACTLR_ITCMLAEN_Pos) /*!< ACTLR: Instruction TCM Lower Alias Enable Mask */ + +/*@} end of group CMSIS_SCnotSCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Cortex-M1 Core Debug Registers (DCB registers, SHCSR, and DFSR) are only accessible over DAP and not via processor. + Therefore they are not covered by the Cortex-M1 header file. + @{ + */ +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ +#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ +#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ +#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ +#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + +#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ +#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ +#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ +#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ + + +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ +/*#define NVIC_GetActive __NVIC_GetActive not available for Cortex-M1 */ + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* The following EXC_RETURN values are saved the LR on exception entry */ +#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */ +#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */ +#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */ + + +/* Interrupt Priorities are WORD accessible only under Armv6-M */ +/* The following MACROS handle generation of the register offset and byte masks */ +#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL) +#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) ) +#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) ) + +#define __NVIC_SetPriorityGrouping(X) (void)(X) +#define __NVIC_GetPriorityGrouping() (0U) + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + __COMPILER_BARRIER(); + NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __COMPILER_BARRIER(); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IP[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } + else + { + SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + Address 0 must be mapped to SRAM. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t *vectors = (uint32_t *)0x0U; + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; + /* ARM Application Note 321 states that the M1 does not require the architectural barrier */ +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t *vectors = (uint32_t *)0x0U; + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + SCB_AIRCR_SYSRESETREQ_Msk); + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +/*@} end of CMSIS_Core_NVICFunctions */ + + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + return 0U; /* No FPU */ +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM1_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm23.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm23.h new file mode 100644 index 0000000000..b79c6af0b1 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm23.h @@ -0,0 +1,1996 @@ +/**************************************************************************//** + * @file core_cm23.h + * @brief CMSIS Cortex-M23 Core Peripheral Access Layer Header File + * @version V5.0.8 + * @date 12. November 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_CM23_H_GENERIC +#define __CORE_CM23_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_M23 + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS definitions */ +#define __CM23_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __CM23_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __CM23_CMSIS_VERSION ((__CM23_CMSIS_VERSION_MAIN << 16U) | \ + __CM23_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M (23U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + This core does not support an FPU at all +*/ +#define __FPU_USED 0U + +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_FP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM23_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM23_H_DEPENDANT +#define __CORE_CM23_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM23_REV + #define __CM23_REV 0x0000U + #warning "__CM23_REV not defined in device header file; using default!" + #endif + + #ifndef __FPU_PRESENT + #define __FPU_PRESENT 0U + #warning "__FPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __SAUREGION_PRESENT + #define __SAUREGION_PRESENT 0U + #warning "__SAUREGION_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __VTOR_PRESENT + #define __VTOR_PRESENT 0U + #warning "__VTOR_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 2U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif + + #ifndef __ETM_PRESENT + #define __ETM_PRESENT 0U + #warning "__ETM_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MTB_PRESENT + #define __MTB_PRESENT 0U + #warning "__MTB_PRESENT not defined in device header file; using default!" + #endif + +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group Cortex_M23 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + - Core SAU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack-pointer select */ + uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[16U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[16U]; + __IOM uint32_t ICER[16U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[16U]; + __IOM uint32_t ISPR[16U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[16U]; + __IOM uint32_t ICPR[16U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[16U]; + __IOM uint32_t IABR[16U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[16U]; + __IOM uint32_t ITNS[16U]; /*!< Offset: 0x280 (R/W) Interrupt Non-Secure State Register */ + uint32_t RESERVED5[16U]; + __IOM uint32_t IPR[124U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */ +} NVIC_Type; + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ +#else + uint32_t RESERVED0; +#endif + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + uint32_t RESERVED1; + __IOM uint32_t SHPR[2U]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_PENDNMISET_Pos 31U /*!< SCB ICSR: PENDNMISET Position */ +#define SCB_ICSR_PENDNMISET_Msk (1UL << SCB_ICSR_PENDNMISET_Pos) /*!< SCB ICSR: PENDNMISET Mask */ + +#define SCB_ICSR_NMIPENDSET_Pos SCB_ICSR_PENDNMISET_Pos /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */ +#define SCB_ICSR_NMIPENDSET_Msk SCB_ICSR_PENDNMISET_Msk /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */ + +#define SCB_ICSR_PENDNMICLR_Pos 30U /*!< SCB ICSR: PENDNMICLR Position */ +#define SCB_ICSR_PENDNMICLR_Msk (1UL << SCB_ICSR_PENDNMICLR_Pos) /*!< SCB ICSR: PENDNMICLR Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_STTNS_Pos 24U /*!< SCB ICSR: STTNS Position (Security Extension) */ +#define SCB_ICSR_STTNS_Msk (1UL << SCB_ICSR_STTNS_Pos) /*!< SCB ICSR: STTNS Mask (Security Extension) */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) +/* SCB Vector Table Offset Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ +#endif + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIS_Pos 14U /*!< SCB AIRCR: PRIS Position */ +#define SCB_AIRCR_PRIS_Msk (1UL << SCB_AIRCR_PRIS_Pos) /*!< SCB AIRCR: PRIS Mask */ + +#define SCB_AIRCR_BFHFNMINS_Pos 13U /*!< SCB AIRCR: BFHFNMINS Position */ +#define SCB_AIRCR_BFHFNMINS_Msk (1UL << SCB_AIRCR_BFHFNMINS_Pos) /*!< SCB AIRCR: BFHFNMINS Mask */ + +#define SCB_AIRCR_SYSRESETREQS_Pos 3U /*!< SCB AIRCR: SYSRESETREQS Position */ +#define SCB_AIRCR_SYSRESETREQS_Msk (1UL << SCB_AIRCR_SYSRESETREQS_Pos) /*!< SCB AIRCR: SYSRESETREQS Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEPS_Pos 3U /*!< SCB SCR: SLEEPDEEPS Position */ +#define SCB_SCR_SLEEPDEEPS_Msk (1UL << SCB_SCR_SLEEPDEEPS_Pos) /*!< SCB SCR: SLEEPDEEPS Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_BP_Pos 18U /*!< SCB CCR: BP Position */ +#define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: BP Mask */ + +#define SCB_CCR_IC_Pos 17U /*!< SCB CCR: IC Position */ +#define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: IC Mask */ + +#define SCB_CCR_DC_Pos 16U /*!< SCB CCR: DC Position */ +#define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: DC Mask */ + +#define SCB_CCR_STKOFHFNMIGN_Pos 10U /*!< SCB CCR: STKOFHFNMIGN Position */ +#define SCB_CCR_STKOFHFNMIGN_Msk (1UL << SCB_CCR_STKOFHFNMIGN_Pos) /*!< SCB CCR: STKOFHFNMIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_HARDFAULTPENDED_Pos 21U /*!< SCB SHCSR: HARDFAULTPENDED Position */ +#define SCB_SHCSR_HARDFAULTPENDED_Msk (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos) /*!< SCB SHCSR: HARDFAULTPENDED Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_NMIACT_Pos 5U /*!< SCB SHCSR: NMIACT Position */ +#define SCB_SHCSR_NMIACT_Msk (1UL << SCB_SHCSR_NMIACT_Pos) /*!< SCB SHCSR: NMIACT Mask */ + +#define SCB_SHCSR_HARDFAULTACT_Pos 2U /*!< SCB SHCSR: HARDFAULTACT Position */ +#define SCB_SHCSR_HARDFAULTACT_Msk (1UL << SCB_SHCSR_HARDFAULTACT_Pos) /*!< SCB SHCSR: HARDFAULTACT Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + uint32_t RESERVED0[6U]; + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + uint32_t RESERVED3[1U]; + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED4[1U]; + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + uint32_t RESERVED5[1U]; + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED6[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + uint32_t RESERVED7[1U]; + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ + uint32_t RESERVED8[1U]; + __IOM uint32_t COMP4; /*!< Offset: 0x060 (R/W) Comparator Register 4 */ + uint32_t RESERVED9[1U]; + __IOM uint32_t FUNCTION4; /*!< Offset: 0x068 (R/W) Function Register 4 */ + uint32_t RESERVED10[1U]; + __IOM uint32_t COMP5; /*!< Offset: 0x070 (R/W) Comparator Register 5 */ + uint32_t RESERVED11[1U]; + __IOM uint32_t FUNCTION5; /*!< Offset: 0x078 (R/W) Function Register 5 */ + uint32_t RESERVED12[1U]; + __IOM uint32_t COMP6; /*!< Offset: 0x080 (R/W) Comparator Register 6 */ + uint32_t RESERVED13[1U]; + __IOM uint32_t FUNCTION6; /*!< Offset: 0x088 (R/W) Function Register 6 */ + uint32_t RESERVED14[1U]; + __IOM uint32_t COMP7; /*!< Offset: 0x090 (R/W) Comparator Register 7 */ + uint32_t RESERVED15[1U]; + __IOM uint32_t FUNCTION7; /*!< Offset: 0x098 (R/W) Function Register 7 */ + uint32_t RESERVED16[1U]; + __IOM uint32_t COMP8; /*!< Offset: 0x0A0 (R/W) Comparator Register 8 */ + uint32_t RESERVED17[1U]; + __IOM uint32_t FUNCTION8; /*!< Offset: 0x0A8 (R/W) Function Register 8 */ + uint32_t RESERVED18[1U]; + __IOM uint32_t COMP9; /*!< Offset: 0x0B0 (R/W) Comparator Register 9 */ + uint32_t RESERVED19[1U]; + __IOM uint32_t FUNCTION9; /*!< Offset: 0x0B8 (R/W) Function Register 9 */ + uint32_t RESERVED20[1U]; + __IOM uint32_t COMP10; /*!< Offset: 0x0C0 (R/W) Comparator Register 10 */ + uint32_t RESERVED21[1U]; + __IOM uint32_t FUNCTION10; /*!< Offset: 0x0C8 (R/W) Function Register 10 */ + uint32_t RESERVED22[1U]; + __IOM uint32_t COMP11; /*!< Offset: 0x0D0 (R/W) Comparator Register 11 */ + uint32_t RESERVED23[1U]; + __IOM uint32_t FUNCTION11; /*!< Offset: 0x0D8 (R/W) Function Register 11 */ + uint32_t RESERVED24[1U]; + __IOM uint32_t COMP12; /*!< Offset: 0x0E0 (R/W) Comparator Register 12 */ + uint32_t RESERVED25[1U]; + __IOM uint32_t FUNCTION12; /*!< Offset: 0x0E8 (R/W) Function Register 12 */ + uint32_t RESERVED26[1U]; + __IOM uint32_t COMP13; /*!< Offset: 0x0F0 (R/W) Comparator Register 13 */ + uint32_t RESERVED27[1U]; + __IOM uint32_t FUNCTION13; /*!< Offset: 0x0F8 (R/W) Function Register 13 */ + uint32_t RESERVED28[1U]; + __IOM uint32_t COMP14; /*!< Offset: 0x100 (R/W) Comparator Register 14 */ + uint32_t RESERVED29[1U]; + __IOM uint32_t FUNCTION14; /*!< Offset: 0x108 (R/W) Function Register 14 */ + uint32_t RESERVED30[1U]; + __IOM uint32_t COMP15; /*!< Offset: 0x110 (R/W) Comparator Register 15 */ + uint32_t RESERVED31[1U]; + __IOM uint32_t FUNCTION15; /*!< Offset: 0x118 (R/W) Function Register 15 */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_ID_Pos 27U /*!< DWT FUNCTION: ID Position */ +#define DWT_FUNCTION_ID_Msk (0x1FUL << DWT_FUNCTION_ID_Pos) /*!< DWT FUNCTION: ID Mask */ + +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_ACTION_Pos 4U /*!< DWT FUNCTION: ACTION Position */ +#define DWT_FUNCTION_ACTION_Msk (0x3UL << DWT_FUNCTION_ACTION_Pos) /*!< DWT FUNCTION: ACTION Mask */ + +#define DWT_FUNCTION_MATCH_Pos 0U /*!< DWT FUNCTION: MATCH Position */ +#define DWT_FUNCTION_MATCH_Msk (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/) /*!< DWT FUNCTION: MATCH Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IOM uint32_t PSCR; /*!< Offset: 0x308 (R/W) Periodic Synchronization Control Register */ + uint32_t RESERVED3[759U]; + __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER Register */ + __IM uint32_t ITFTTD0; /*!< Offset: 0xEEC (R/ ) Integration Test FIFO Test Data 0 Register */ + __IOM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/W) Integration Test ATB Control Register 2 */ + uint32_t RESERVED4[1U]; + __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) Integration Test ATB Control Register 0 */ + __IM uint32_t ITFTTD1; /*!< Offset: 0xEFC (R/ ) Integration Test FIFO Test Data 1 Register */ + __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ + uint32_t RESERVED5[39U]; + __IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ + __IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ + uint32_t RESERVED7[8U]; + __IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) Device Configuration Register */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) Device Type Identifier Register */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */ +#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_FOnMan_Pos 6U /*!< TPI FFCR: FOnMan Position */ +#define TPI_FFCR_FOnMan_Msk (0x1UL << TPI_FFCR_FOnMan_Pos) /*!< TPI FFCR: FOnMan Mask */ + +#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI TRIGGER Register Definitions */ +#define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */ +#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ + +/* TPI Integration Test FIFO Test Data 0 Register Definitions */ +#define TPI_ITFTTD0_ATB_IF2_ATVALID_Pos 29U /*!< TPI ITFTTD0: ATB Interface 2 ATVALIDPosition */ +#define TPI_ITFTTD0_ATB_IF2_ATVALID_Msk (0x3UL << TPI_ITFTTD0_ATB_IF2_ATVALID_Pos) /*!< TPI ITFTTD0: ATB Interface 2 ATVALID Mask */ + +#define TPI_ITFTTD0_ATB_IF2_bytecount_Pos 27U /*!< TPI ITFTTD0: ATB Interface 2 byte count Position */ +#define TPI_ITFTTD0_ATB_IF2_bytecount_Msk (0x3UL << TPI_ITFTTD0_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 2 byte count Mask */ + +#define TPI_ITFTTD0_ATB_IF1_ATVALID_Pos 26U /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Position */ +#define TPI_ITFTTD0_ATB_IF1_ATVALID_Msk (0x3UL << TPI_ITFTTD0_ATB_IF1_ATVALID_Pos) /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Mask */ + +#define TPI_ITFTTD0_ATB_IF1_bytecount_Pos 24U /*!< TPI ITFTTD0: ATB Interface 1 byte count Position */ +#define TPI_ITFTTD0_ATB_IF1_bytecount_Msk (0x3UL << TPI_ITFTTD0_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 1 byte countt Mask */ + +#define TPI_ITFTTD0_ATB_IF1_data2_Pos 16U /*!< TPI ITFTTD0: ATB Interface 1 data2 Position */ +#define TPI_ITFTTD0_ATB_IF1_data2_Msk (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos) /*!< TPI ITFTTD0: ATB Interface 1 data2 Mask */ + +#define TPI_ITFTTD0_ATB_IF1_data1_Pos 8U /*!< TPI ITFTTD0: ATB Interface 1 data1 Position */ +#define TPI_ITFTTD0_ATB_IF1_data1_Msk (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos) /*!< TPI ITFTTD0: ATB Interface 1 data1 Mask */ + +#define TPI_ITFTTD0_ATB_IF1_data0_Pos 0U /*!< TPI ITFTTD0: ATB Interface 1 data0 Position */ +#define TPI_ITFTTD0_ATB_IF1_data0_Msk (0xFFUL /*<< TPI_ITFTTD0_ATB_IF1_data0_Pos*/) /*!< TPI ITFTTD0: ATB Interface 1 data0 Mask */ + +/* TPI Integration Test ATB Control Register 2 Register Definitions */ +#define TPI_ITATBCTR2_AFVALID2S_Pos 1U /*!< TPI ITATBCTR2: AFVALID2S Position */ +#define TPI_ITATBCTR2_AFVALID2S_Msk (0x1UL << TPI_ITATBCTR2_AFVALID2S_Pos) /*!< TPI ITATBCTR2: AFVALID2SS Mask */ + +#define TPI_ITATBCTR2_AFVALID1S_Pos 1U /*!< TPI ITATBCTR2: AFVALID1S Position */ +#define TPI_ITATBCTR2_AFVALID1S_Msk (0x1UL << TPI_ITATBCTR2_AFVALID1S_Pos) /*!< TPI ITATBCTR2: AFVALID1SS Mask */ + +#define TPI_ITATBCTR2_ATREADY2S_Pos 0U /*!< TPI ITATBCTR2: ATREADY2S Position */ +#define TPI_ITATBCTR2_ATREADY2S_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY2S_Pos*/) /*!< TPI ITATBCTR2: ATREADY2S Mask */ + +#define TPI_ITATBCTR2_ATREADY1S_Pos 0U /*!< TPI ITATBCTR2: ATREADY1S Position */ +#define TPI_ITATBCTR2_ATREADY1S_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY1S_Pos*/) /*!< TPI ITATBCTR2: ATREADY1S Mask */ + +/* TPI Integration Test FIFO Test Data 1 Register Definitions */ +#define TPI_ITFTTD1_ATB_IF2_ATVALID_Pos 29U /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Position */ +#define TPI_ITFTTD1_ATB_IF2_ATVALID_Msk (0x3UL << TPI_ITFTTD1_ATB_IF2_ATVALID_Pos) /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Mask */ + +#define TPI_ITFTTD1_ATB_IF2_bytecount_Pos 27U /*!< TPI ITFTTD1: ATB Interface 2 byte count Position */ +#define TPI_ITFTTD1_ATB_IF2_bytecount_Msk (0x3UL << TPI_ITFTTD1_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 2 byte count Mask */ + +#define TPI_ITFTTD1_ATB_IF1_ATVALID_Pos 26U /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Position */ +#define TPI_ITFTTD1_ATB_IF1_ATVALID_Msk (0x3UL << TPI_ITFTTD1_ATB_IF1_ATVALID_Pos) /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Mask */ + +#define TPI_ITFTTD1_ATB_IF1_bytecount_Pos 24U /*!< TPI ITFTTD1: ATB Interface 1 byte count Position */ +#define TPI_ITFTTD1_ATB_IF1_bytecount_Msk (0x3UL << TPI_ITFTTD1_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 1 byte countt Mask */ + +#define TPI_ITFTTD1_ATB_IF2_data2_Pos 16U /*!< TPI ITFTTD1: ATB Interface 2 data2 Position */ +#define TPI_ITFTTD1_ATB_IF2_data2_Msk (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos) /*!< TPI ITFTTD1: ATB Interface 2 data2 Mask */ + +#define TPI_ITFTTD1_ATB_IF2_data1_Pos 8U /*!< TPI ITFTTD1: ATB Interface 2 data1 Position */ +#define TPI_ITFTTD1_ATB_IF2_data1_Msk (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos) /*!< TPI ITFTTD1: ATB Interface 2 data1 Mask */ + +#define TPI_ITFTTD1_ATB_IF2_data0_Pos 0U /*!< TPI ITFTTD1: ATB Interface 2 data0 Position */ +#define TPI_ITFTTD1_ATB_IF2_data0_Msk (0xFFUL /*<< TPI_ITFTTD1_ATB_IF2_data0_Pos*/) /*!< TPI ITFTTD1: ATB Interface 2 data0 Mask */ + +/* TPI Integration Test ATB Control Register 0 Definitions */ +#define TPI_ITATBCTR0_AFVALID2S_Pos 1U /*!< TPI ITATBCTR0: AFVALID2S Position */ +#define TPI_ITATBCTR0_AFVALID2S_Msk (0x1UL << TPI_ITATBCTR0_AFVALID2S_Pos) /*!< TPI ITATBCTR0: AFVALID2SS Mask */ + +#define TPI_ITATBCTR0_AFVALID1S_Pos 1U /*!< TPI ITATBCTR0: AFVALID1S Position */ +#define TPI_ITATBCTR0_AFVALID1S_Msk (0x1UL << TPI_ITATBCTR0_AFVALID1S_Pos) /*!< TPI ITATBCTR0: AFVALID1SS Mask */ + +#define TPI_ITATBCTR0_ATREADY2S_Pos 0U /*!< TPI ITATBCTR0: ATREADY2S Position */ +#define TPI_ITATBCTR0_ATREADY2S_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY2S_Pos*/) /*!< TPI ITATBCTR0: ATREADY2S Mask */ + +#define TPI_ITATBCTR0_ATREADY1S_Pos 0U /*!< TPI ITATBCTR0: ATREADY1S Position */ +#define TPI_ITATBCTR0_ATREADY1S_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY1S_Pos*/) /*!< TPI ITATBCTR0: ATREADY1S Mask */ + +/* TPI Integration Mode Control Register Definitions */ +#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */ +#define TPI_ITCTRL_Mode_Msk (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_FIFOSZ_Pos 6U /*!< TPI DEVID: FIFOSZ Position */ +#define TPI_DEVID_FIFOSZ_Msk (0x7UL << TPI_DEVID_FIFOSZ_Pos) /*!< TPI DEVID: FIFOSZ Mask */ + +#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */ +#define TPI_DEVID_NrTraceInput_Msk (0x3FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) MPU Region Limit Address Register */ + uint32_t RESERVED0[7U]; + union { + __IOM uint32_t MAIR[2]; + struct { + __IOM uint32_t MAIR0; /*!< Offset: 0x030 (R/W) MPU Memory Attribute Indirection Register 0 */ + __IOM uint32_t MAIR1; /*!< Offset: 0x034 (R/W) MPU Memory Attribute Indirection Register 1 */ + }; + }; +} MPU_Type; + +#define MPU_TYPE_RALIASES 1U + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_BASE_Pos 5U /*!< MPU RBAR: BASE Position */ +#define MPU_RBAR_BASE_Msk (0x7FFFFFFUL << MPU_RBAR_BASE_Pos) /*!< MPU RBAR: BASE Mask */ + +#define MPU_RBAR_SH_Pos 3U /*!< MPU RBAR: SH Position */ +#define MPU_RBAR_SH_Msk (0x3UL << MPU_RBAR_SH_Pos) /*!< MPU RBAR: SH Mask */ + +#define MPU_RBAR_AP_Pos 1U /*!< MPU RBAR: AP Position */ +#define MPU_RBAR_AP_Msk (0x3UL << MPU_RBAR_AP_Pos) /*!< MPU RBAR: AP Mask */ + +#define MPU_RBAR_XN_Pos 0U /*!< MPU RBAR: XN Position */ +#define MPU_RBAR_XN_Msk (01UL /*<< MPU_RBAR_XN_Pos*/) /*!< MPU RBAR: XN Mask */ + +/* MPU Region Limit Address Register Definitions */ +#define MPU_RLAR_LIMIT_Pos 5U /*!< MPU RLAR: LIMIT Position */ +#define MPU_RLAR_LIMIT_Msk (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos) /*!< MPU RLAR: LIMIT Mask */ + +#define MPU_RLAR_AttrIndx_Pos 1U /*!< MPU RLAR: AttrIndx Position */ +#define MPU_RLAR_AttrIndx_Msk (0x7UL << MPU_RLAR_AttrIndx_Pos) /*!< MPU RLAR: AttrIndx Mask */ + +#define MPU_RLAR_EN_Pos 0U /*!< MPU RLAR: EN Position */ +#define MPU_RLAR_EN_Msk (1UL /*<< MPU_RLAR_EN_Pos*/) /*!< MPU RLAR: EN Mask */ + +/* MPU Memory Attribute Indirection Register 0 Definitions */ +#define MPU_MAIR0_Attr3_Pos 24U /*!< MPU MAIR0: Attr3 Position */ +#define MPU_MAIR0_Attr3_Msk (0xFFUL << MPU_MAIR0_Attr3_Pos) /*!< MPU MAIR0: Attr3 Mask */ + +#define MPU_MAIR0_Attr2_Pos 16U /*!< MPU MAIR0: Attr2 Position */ +#define MPU_MAIR0_Attr2_Msk (0xFFUL << MPU_MAIR0_Attr2_Pos) /*!< MPU MAIR0: Attr2 Mask */ + +#define MPU_MAIR0_Attr1_Pos 8U /*!< MPU MAIR0: Attr1 Position */ +#define MPU_MAIR0_Attr1_Msk (0xFFUL << MPU_MAIR0_Attr1_Pos) /*!< MPU MAIR0: Attr1 Mask */ + +#define MPU_MAIR0_Attr0_Pos 0U /*!< MPU MAIR0: Attr0 Position */ +#define MPU_MAIR0_Attr0_Msk (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/) /*!< MPU MAIR0: Attr0 Mask */ + +/* MPU Memory Attribute Indirection Register 1 Definitions */ +#define MPU_MAIR1_Attr7_Pos 24U /*!< MPU MAIR1: Attr7 Position */ +#define MPU_MAIR1_Attr7_Msk (0xFFUL << MPU_MAIR1_Attr7_Pos) /*!< MPU MAIR1: Attr7 Mask */ + +#define MPU_MAIR1_Attr6_Pos 16U /*!< MPU MAIR1: Attr6 Position */ +#define MPU_MAIR1_Attr6_Msk (0xFFUL << MPU_MAIR1_Attr6_Pos) /*!< MPU MAIR1: Attr6 Mask */ + +#define MPU_MAIR1_Attr5_Pos 8U /*!< MPU MAIR1: Attr5 Position */ +#define MPU_MAIR1_Attr5_Msk (0xFFUL << MPU_MAIR1_Attr5_Pos) /*!< MPU MAIR1: Attr5 Mask */ + +#define MPU_MAIR1_Attr4_Pos 0U /*!< MPU MAIR1: Attr4 Position */ +#define MPU_MAIR1_Attr4_Msk (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/) /*!< MPU MAIR1: Attr4 Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SAU Security Attribution Unit (SAU) + \brief Type definitions for the Security Attribution Unit (SAU) + @{ + */ + +/** + \brief Structure type to access the Security Attribution Unit (SAU). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SAU Control Register */ + __IM uint32_t TYPE; /*!< Offset: 0x004 (R/ ) SAU Type Register */ +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) SAU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) SAU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) SAU Region Limit Address Register */ +#endif +} SAU_Type; + +/* SAU Control Register Definitions */ +#define SAU_CTRL_ALLNS_Pos 1U /*!< SAU CTRL: ALLNS Position */ +#define SAU_CTRL_ALLNS_Msk (1UL << SAU_CTRL_ALLNS_Pos) /*!< SAU CTRL: ALLNS Mask */ + +#define SAU_CTRL_ENABLE_Pos 0U /*!< SAU CTRL: ENABLE Position */ +#define SAU_CTRL_ENABLE_Msk (1UL /*<< SAU_CTRL_ENABLE_Pos*/) /*!< SAU CTRL: ENABLE Mask */ + +/* SAU Type Register Definitions */ +#define SAU_TYPE_SREGION_Pos 0U /*!< SAU TYPE: SREGION Position */ +#define SAU_TYPE_SREGION_Msk (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/) /*!< SAU TYPE: SREGION Mask */ + +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) +/* SAU Region Number Register Definitions */ +#define SAU_RNR_REGION_Pos 0U /*!< SAU RNR: REGION Position */ +#define SAU_RNR_REGION_Msk (0xFFUL /*<< SAU_RNR_REGION_Pos*/) /*!< SAU RNR: REGION Mask */ + +/* SAU Region Base Address Register Definitions */ +#define SAU_RBAR_BADDR_Pos 5U /*!< SAU RBAR: BADDR Position */ +#define SAU_RBAR_BADDR_Msk (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos) /*!< SAU RBAR: BADDR Mask */ + +/* SAU Region Limit Address Register Definitions */ +#define SAU_RLAR_LADDR_Pos 5U /*!< SAU RLAR: LADDR Position */ +#define SAU_RLAR_LADDR_Msk (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos) /*!< SAU RLAR: LADDR Mask */ + +#define SAU_RLAR_NSC_Pos 1U /*!< SAU RLAR: NSC Position */ +#define SAU_RLAR_NSC_Msk (1UL << SAU_RLAR_NSC_Pos) /*!< SAU RLAR: NSC Mask */ + +#define SAU_RLAR_ENABLE_Pos 0U /*!< SAU RLAR: ENABLE Position */ +#define SAU_RLAR_ENABLE_Msk (1UL /*<< SAU_RLAR_ENABLE_Pos*/) /*!< SAU RLAR: ENABLE Mask */ + +#endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */ + +/*@} end of group CMSIS_SAU */ +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** + \brief Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ + uint32_t RESERVED4[1U]; + __IOM uint32_t DAUTHCTRL; /*!< Offset: 0x014 (R/W) Debug Authentication Control Register */ + __IOM uint32_t DSCSR; /*!< Offset: 0x018 (R/W) Debug Security Control and Status Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register Definitions */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESTART_ST_Pos 26U /*!< CoreDebug DHCSR: S_RESTART_ST Position */ +#define CoreDebug_DHCSR_S_RESTART_ST_Msk (1UL << CoreDebug_DHCSR_S_RESTART_ST_Pos) /*!< CoreDebug DHCSR: S_RESTART_ST Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register Definitions */ +#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register */ +#define CoreDebug_DEMCR_DWTENA_Pos 24U /*!< CoreDebug DEMCR: DWTENA Position */ +#define CoreDebug_DEMCR_DWTENA_Msk (1UL << CoreDebug_DEMCR_DWTENA_Pos) /*!< CoreDebug DEMCR: DWTENA Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ + +/* Debug Authentication Control Register Definitions */ +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos 3U /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Position */ +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Mask */ + +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos 2U /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Msk (1UL << CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos) /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Mask */ + +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Pos 1U /*!< CoreDebug DAUTHCTRL: INTSPIDEN Position */ +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPIDEN Mask */ + +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Pos 0U /*!< CoreDebug DAUTHCTRL: SPIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Msk (1UL /*<< CoreDebug_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< CoreDebug DAUTHCTRL: SPIDENSEL Mask */ + +/* Debug Security Control and Status Register Definitions */ +#define CoreDebug_DSCSR_CDS_Pos 16U /*!< CoreDebug DSCSR: CDS Position */ +#define CoreDebug_DSCSR_CDS_Msk (1UL << CoreDebug_DSCSR_CDS_Pos) /*!< CoreDebug DSCSR: CDS Mask */ + +#define CoreDebug_DSCSR_SBRSEL_Pos 1U /*!< CoreDebug DSCSR: SBRSEL Position */ +#define CoreDebug_DSCSR_SBRSEL_Msk (1UL << CoreDebug_DSCSR_SBRSEL_Pos) /*!< CoreDebug DSCSR: SBRSEL Mask */ + +#define CoreDebug_DSCSR_SBRSELEN_Pos 0U /*!< CoreDebug DSCSR: SBRSELEN Position */ +#define CoreDebug_DSCSR_SBRSELEN_Msk (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/) /*!< CoreDebug DSCSR: SBRSELEN Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ + #define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ + #define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ + #define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ + #define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ + #define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ + #define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ + #define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + + + #define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ + #define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ + #define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ + #define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ + #define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ + #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE ) /*!< Core Debug configuration struct */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ + #endif + + #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SAU_BASE (SCS_BASE + 0x0DD0UL) /*!< Security Attribution Unit */ + #define SAU ((SAU_Type *) SAU_BASE ) /*!< Security Attribution Unit */ + #endif + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SCS_BASE_NS (0xE002E000UL) /*!< System Control Space Base Address (non-secure address space) */ + #define CoreDebug_BASE_NS (0xE002EDF0UL) /*!< Core Debug Base Address (non-secure address space) */ + #define SysTick_BASE_NS (SCS_BASE_NS + 0x0010UL) /*!< SysTick Base Address (non-secure address space) */ + #define NVIC_BASE_NS (SCS_BASE_NS + 0x0100UL) /*!< NVIC Base Address (non-secure address space) */ + #define SCB_BASE_NS (SCS_BASE_NS + 0x0D00UL) /*!< System Control Block Base Address (non-secure address space) */ + + #define SCB_NS ((SCB_Type *) SCB_BASE_NS ) /*!< SCB configuration struct (non-secure address space) */ + #define SysTick_NS ((SysTick_Type *) SysTick_BASE_NS ) /*!< SysTick configuration struct (non-secure address space) */ + #define NVIC_NS ((NVIC_Type *) NVIC_BASE_NS ) /*!< NVIC configuration struct (non-secure address space) */ + #define CoreDebug_NS ((CoreDebug_Type *) CoreDebug_BASE_NS) /*!< Core Debug configuration struct (non-secure address space) */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE_NS (SCS_BASE_NS + 0x0D90UL) /*!< Memory Protection Unit (non-secure address space) */ + #define MPU_NS ((MPU_Type *) MPU_BASE_NS ) /*!< Memory Protection Unit (non-secure address space) */ + #endif + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else +/*#define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping not available for Cortex-M23 */ +/*#define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping not available for Cortex-M23 */ + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ + #define NVIC_GetActive __NVIC_GetActive + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* Special LR values for Secure/Non-Secure call handling and exception handling */ + +/* Function Return Payload (from ARMv8-M Architecture Reference Manual) LR value on entry from Secure BLXNS */ +#define FNC_RETURN (0xFEFFFFFFUL) /* bit [0] ignored when processing a branch */ + +/* The following EXC_RETURN mask values are used to evaluate the LR on exception entry */ +#define EXC_RETURN_PREFIX (0xFF000000UL) /* bits [31:24] set to indicate an EXC_RETURN value */ +#define EXC_RETURN_S (0x00000040UL) /* bit [6] stack used to push registers: 0=Non-secure 1=Secure */ +#define EXC_RETURN_DCRS (0x00000020UL) /* bit [5] stacking rules for called registers: 0=skipped 1=saved */ +#define EXC_RETURN_FTYPE (0x00000010UL) /* bit [4] allocate stack for floating-point context: 0=done 1=skipped */ +#define EXC_RETURN_MODE (0x00000008UL) /* bit [3] processor mode for return: 0=Handler mode 1=Thread mode */ +#define EXC_RETURN_SPSEL (0x00000004UL) /* bit [2] stack pointer used to restore context: 0=MSP 1=PSP */ +#define EXC_RETURN_ES (0x00000001UL) /* bit [0] security state exception was taken to: 0=Non-secure 1=Secure */ + +/* Integrity Signature (from ARMv8-M Architecture Reference Manual) for exception context stacking */ +#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) /* Value for processors with floating-point extension: */ +#define EXC_INTEGRITY_SIGNATURE (0xFEFA125AUL) /* bit [0] SFTC must match LR bit[4] EXC_RETURN_FTYPE */ +#else +#define EXC_INTEGRITY_SIGNATURE (0xFEFA125BUL) /* Value for processors without floating-point extension */ +#endif + + +/* Interrupt Priorities are WORD accessible only under Armv6-M */ +/* The following MACROS handle generation of the register offset and byte masks */ +#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL) +#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) ) +#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) ) + +#define __NVIC_SetPriorityGrouping(X) (void)(X) +#define __NVIC_GetPriorityGrouping() (0U) + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + __COMPILER_BARRIER(); + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __COMPILER_BARRIER(); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Get Interrupt Target State + \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + \return 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Target State + \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Clear Interrupt Target State + \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IPR[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IPR[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } + else + { + SCB->SHPR[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHPR[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IPR[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return((uint32_t)(((SCB->SHPR[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + If VTOR is not present address 0 must be mapped to SRAM. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) + uint32_t *vectors = (uint32_t *)SCB->VTOR; +#else + uint32_t *vectors = (uint32_t *)0x0U; +#endif + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; + __DSB(); +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) + uint32_t *vectors = (uint32_t *)SCB->VTOR; +#else + uint32_t *vectors = (uint32_t *)0x0U; +#endif + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + SCB_AIRCR_SYSRESETREQ_Msk); + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Enable Interrupt (non-secure) + \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status (non-secure) + \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt (non-secure) + \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Pending Interrupt (non-secure) + \details Reads the NVIC pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt (non-secure) + \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt (non-secure) + \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt (non-secure) + \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority (non-secure) + \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every non-secure processor exception. + */ +__STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->IPR[_IP_IDX(IRQn)] = ((uint32_t)(NVIC_NS->IPR[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } + else + { + SCB_NS->SHPR[_SHP_IDX(IRQn)] = ((uint32_t)(SCB_NS->SHPR[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } +} + + +/** + \brief Get Interrupt Priority (non-secure) + \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->IPR[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return((uint32_t)(((SCB_NS->SHPR[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_NVICFunctions */ + +/* ########################## MPU functions #################################### */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + +#include "mpu_armv8.h" + +#endif + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + return 0U; /* No FPU */ +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ########################## SAU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SAUFunctions SAU Functions + \brief Functions that configure the SAU. + @{ + */ + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + +/** + \brief Enable SAU + \details Enables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Enable(void) +{ + SAU->CTRL |= (SAU_CTRL_ENABLE_Msk); +} + + + +/** + \brief Disable SAU + \details Disables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Disable(void) +{ + SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk); +} + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_SAUFunctions */ + + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief System Tick Configuration (non-secure) + \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function TZ_SysTick_Config_NS is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + + */ +__STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick_NS->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick_NS->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick_NS->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM23_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm3.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm3.h new file mode 100644 index 0000000000..8157ca782d --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm3.h @@ -0,0 +1,1937 @@ +/**************************************************************************//** + * @file core_cm3.h + * @brief CMSIS Cortex-M3 Core Peripheral Access Layer Header File + * @version V5.1.0 + * @date 13. March 2019 + ******************************************************************************/ +/* + * Copyright (c) 2009-2019 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_CM3_H_GENERIC +#define __CORE_CM3_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_M3 + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS CM3 definitions */ +#define __CM3_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __CM3_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __CM3_CMSIS_VERSION ((__CM3_CMSIS_VERSION_MAIN << 16U) | \ + __CM3_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M (3U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + This core does not support an FPU at all +*/ +#define __FPU_USED 0U + +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_FP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM3_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM3_H_DEPENDANT +#define __CORE_CM3_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM3_REV + #define __CM3_REV 0x0200U + #warning "__CM3_REV not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 3U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group Cortex_M3 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:27; /*!< bit: 0..26 Reserved */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + +#define APSR_Q_Pos 27U /*!< APSR: Q Position */ +#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:1; /*!< bit: 9 Reserved */ + uint32_t ICI_IT_1:6; /*!< bit: 10..15 ICI/IT part 1 */ + uint32_t _reserved1:8; /*!< bit: 16..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit */ + uint32_t ICI_IT_2:2; /*!< bit: 25..26 ICI/IT part 2 */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */ +#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ + +#define xPSR_ICI_IT_2_Pos 25U /*!< xPSR: ICI/IT part 2 Position */ +#define xPSR_ICI_IT_2_Msk (3UL << xPSR_ICI_IT_2_Pos) /*!< xPSR: ICI/IT part 2 Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_ICI_IT_1_Pos 10U /*!< xPSR: ICI/IT part 1 Position */ +#define xPSR_ICI_IT_1_Msk (0x3FUL << xPSR_ICI_IT_1_Pos) /*!< xPSR: ICI/IT part 1 Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ + uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[8U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[24U]; + __IOM uint32_t ICER[8U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RESERVED1[24U]; + __IOM uint32_t ISPR[8U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[24U]; + __IOM uint32_t ICPR[8U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[24U]; + __IOM uint32_t IABR[8U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[56U]; + __IOM uint8_t IP[240U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ + uint32_t RESERVED5[644U]; + __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ +} NVIC_Type; + +/* Software Triggered Interrupt Register Definitions */ +#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ +#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + __IOM uint8_t SHP[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ + __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ + __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ + __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ + __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ + __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ + __IM uint32_t PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ + __IM uint32_t DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ + __IM uint32_t ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ + __IM uint32_t ISAR[5U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ + uint32_t RESERVED0[5U]; + __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */ +#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Vector Table Offset Register Definitions */ +#if defined (__CM3_REV) && (__CM3_REV < 0x0201U) /* core r2p1 */ +#define SCB_VTOR_TBLBASE_Pos 29U /*!< SCB VTOR: TBLBASE Position */ +#define SCB_VTOR_TBLBASE_Msk (1UL << SCB_VTOR_TBLBASE_Pos) /*!< SCB VTOR: TBLBASE Mask */ + +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x3FFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ +#else +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ +#endif + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */ +#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +#define SCB_AIRCR_VECTRESET_Pos 0U /*!< SCB AIRCR: VECTRESET Position */ +#define SCB_AIRCR_VECTRESET_Msk (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/) /*!< SCB AIRCR: VECTRESET Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */ +#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +#define SCB_CCR_NONBASETHRDENA_Pos 0U /*!< SCB CCR: NONBASETHRDENA Position */ +#define SCB_CCR_NONBASETHRDENA_Msk (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/) /*!< SCB CCR: NONBASETHRDENA Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */ +#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ + +#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */ +#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ + +#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */ +#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */ +#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ + +#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */ +#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ + +#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */ +#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */ +#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */ +#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ + +#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */ +#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ + +#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */ +#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ + +/* SCB Configurable Fault Status Register Definitions */ +#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */ +#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ + +#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */ +#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ + +#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */ +#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ + +/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ + +#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ + +#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ + +#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ + +#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ + +/* BusFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */ +#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */ + +#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */ +#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */ + +#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */ +#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */ + +#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */ +#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */ + +#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */ +#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */ + +#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */ +#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */ + +/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */ +#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */ + +#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */ +#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */ + +#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */ +#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */ + +#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */ +#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */ + +#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */ +#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */ + +#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */ +#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */ + +/* SCB Hard Fault Status Register Definitions */ +#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */ +#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ + +#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */ +#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ + +#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */ +#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ + +/* SCB Debug Fault Status Register Definitions */ +#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */ +#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ + +#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */ +#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ + +#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */ +#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ + +#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */ +#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ + +#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */ +#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** + \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ +#if defined (__CM3_REV) && (__CM3_REV >= 0x200U) + __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ +#else + uint32_t RESERVED1[1U]; +#endif +} SCnSCB_Type; + +/* Interrupt Controller Type Register Definitions */ +#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ +#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ + +/* Auxiliary Control Register Definitions */ +#if defined (__CM3_REV) && (__CM3_REV >= 0x200U) +#define SCnSCB_ACTLR_DISOOFP_Pos 9U /*!< ACTLR: DISOOFP Position */ +#define SCnSCB_ACTLR_DISOOFP_Msk (1UL << SCnSCB_ACTLR_DISOOFP_Pos) /*!< ACTLR: DISOOFP Mask */ + +#define SCnSCB_ACTLR_DISFPCA_Pos 8U /*!< ACTLR: DISFPCA Position */ +#define SCnSCB_ACTLR_DISFPCA_Msk (1UL << SCnSCB_ACTLR_DISFPCA_Pos) /*!< ACTLR: DISFPCA Mask */ + +#define SCnSCB_ACTLR_DISFOLD_Pos 2U /*!< ACTLR: DISFOLD Position */ +#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */ + +#define SCnSCB_ACTLR_DISDEFWBUF_Pos 1U /*!< ACTLR: DISDEFWBUF Position */ +#define SCnSCB_ACTLR_DISDEFWBUF_Msk (1UL << SCnSCB_ACTLR_DISDEFWBUF_Pos) /*!< ACTLR: DISDEFWBUF Mask */ + +#define SCnSCB_ACTLR_DISMCYCINT_Pos 0U /*!< ACTLR: DISMCYCINT Position */ +#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/) /*!< ACTLR: DISMCYCINT Mask */ +#endif + +/*@} end of group CMSIS_SCnotSCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) + \brief Type definitions for the Instrumentation Trace Macrocell (ITM) + @{ + */ + +/** + \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). + */ +typedef struct +{ + __OM union + { + __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ + __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ + __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ + } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ + uint32_t RESERVED0[864U]; + __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ + uint32_t RESERVED1[15U]; + __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ + uint32_t RESERVED2[15U]; + __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ + uint32_t RESERVED3[32U]; + uint32_t RESERVED4[43U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ + uint32_t RESERVED5[6U]; + __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ + __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ + __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ + __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ + __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ + __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ + __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ + __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ + __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ + __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ + __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ + __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ +} ITM_Type; + +/* ITM Trace Privilege Register Definitions */ +#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */ +#define ITM_TPR_PRIVMASK_Msk (0xFFFFFFFFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ + +/* ITM Trace Control Register Definitions */ +#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */ +#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ + +#define ITM_TCR_TraceBusID_Pos 16U /*!< ITM TCR: ATBID Position */ +#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */ + +#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */ +#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ + +#define ITM_TCR_TSPrescale_Pos 8U /*!< ITM TCR: TSPrescale Position */ +#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */ + +#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */ +#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ + +#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */ +#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ + +#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */ +#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ + +#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */ +#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ + +#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ +#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ + +/* ITM Lock Status Register Definitions */ +#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */ +#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ + +#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */ +#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ + +#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ +#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ + +/*@}*/ /* end of group CMSIS_ITM */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ + __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ + __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ + __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ + __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ + __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + __IOM uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */ + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED0[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + __IOM uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */ + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + __IOM uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */ + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + __IOM uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */ + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */ +#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ + +#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */ +#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ + +#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */ +#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ + +#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */ +#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ + +#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */ +#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ + +#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */ +#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ + +#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */ +#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ + +#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */ +#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ + +#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */ +#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ + +#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */ +#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ + +#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */ +#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ + +#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */ +#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ + +#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */ +#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ + +/* DWT CPI Count Register Definitions */ +#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */ +#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ + +/* DWT Exception Overhead Count Register Definitions */ +#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */ +#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ + +/* DWT Sleep Count Register Definitions */ +#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */ +#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ + +/* DWT LSU Count Register Definitions */ +#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */ +#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ + +/* DWT Folded-instruction Count Register Definitions */ +#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */ +#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ + +/* DWT Comparator Mask Register Definitions */ +#define DWT_MASK_MASK_Pos 0U /*!< DWT MASK: MASK Position */ +#define DWT_MASK_MASK_Msk (0x1FUL /*<< DWT_MASK_MASK_Pos*/) /*!< DWT MASK: MASK Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVADDR1_Pos 16U /*!< DWT FUNCTION: DATAVADDR1 Position */ +#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos) /*!< DWT FUNCTION: DATAVADDR1 Mask */ + +#define DWT_FUNCTION_DATAVADDR0_Pos 12U /*!< DWT FUNCTION: DATAVADDR0 Position */ +#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos) /*!< DWT FUNCTION: DATAVADDR0 Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_LNK1ENA_Pos 9U /*!< DWT FUNCTION: LNK1ENA Position */ +#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos) /*!< DWT FUNCTION: LNK1ENA Mask */ + +#define DWT_FUNCTION_DATAVMATCH_Pos 8U /*!< DWT FUNCTION: DATAVMATCH Position */ +#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos) /*!< DWT FUNCTION: DATAVMATCH Mask */ + +#define DWT_FUNCTION_CYCMATCH_Pos 7U /*!< DWT FUNCTION: CYCMATCH Position */ +#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos) /*!< DWT FUNCTION: CYCMATCH Mask */ + +#define DWT_FUNCTION_EMITRANGE_Pos 5U /*!< DWT FUNCTION: EMITRANGE Position */ +#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos) /*!< DWT FUNCTION: EMITRANGE Mask */ + +#define DWT_FUNCTION_FUNCTION_Pos 0U /*!< DWT FUNCTION: FUNCTION Position */ +#define DWT_FUNCTION_FUNCTION_Msk (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/) /*!< DWT FUNCTION: FUNCTION Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IM uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */ + uint32_t RESERVED3[759U]; + __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER Register */ + __IM uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */ + __IM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */ + uint32_t RESERVED4[1U]; + __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */ + __IM uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */ + __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ + uint32_t RESERVED5[39U]; + __IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ + __IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ + uint32_t RESERVED7[8U]; + __IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */ +#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI TRIGGER Register Definitions */ +#define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */ +#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ + +/* TPI Integration ETM Data Register Definitions (FIFO0) */ +#define TPI_FIFO0_ITM_ATVALID_Pos 29U /*!< TPI FIFO0: ITM_ATVALID Position */ +#define TPI_FIFO0_ITM_ATVALID_Msk (0x1UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */ + +#define TPI_FIFO0_ITM_bytecount_Pos 27U /*!< TPI FIFO0: ITM_bytecount Position */ +#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */ + +#define TPI_FIFO0_ETM_ATVALID_Pos 26U /*!< TPI FIFO0: ETM_ATVALID Position */ +#define TPI_FIFO0_ETM_ATVALID_Msk (0x1UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */ + +#define TPI_FIFO0_ETM_bytecount_Pos 24U /*!< TPI FIFO0: ETM_bytecount Position */ +#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */ + +#define TPI_FIFO0_ETM2_Pos 16U /*!< TPI FIFO0: ETM2 Position */ +#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */ + +#define TPI_FIFO0_ETM1_Pos 8U /*!< TPI FIFO0: ETM1 Position */ +#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */ + +#define TPI_FIFO0_ETM0_Pos 0U /*!< TPI FIFO0: ETM0 Position */ +#define TPI_FIFO0_ETM0_Msk (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/) /*!< TPI FIFO0: ETM0 Mask */ + +/* TPI ITATBCTR2 Register Definitions */ +#define TPI_ITATBCTR2_ATREADY2_Pos 0U /*!< TPI ITATBCTR2: ATREADY2 Position */ +#define TPI_ITATBCTR2_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY2_Pos*/) /*!< TPI ITATBCTR2: ATREADY2 Mask */ + +#define TPI_ITATBCTR2_ATREADY1_Pos 0U /*!< TPI ITATBCTR2: ATREADY1 Position */ +#define TPI_ITATBCTR2_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY1_Pos*/) /*!< TPI ITATBCTR2: ATREADY1 Mask */ + +/* TPI Integration ITM Data Register Definitions (FIFO1) */ +#define TPI_FIFO1_ITM_ATVALID_Pos 29U /*!< TPI FIFO1: ITM_ATVALID Position */ +#define TPI_FIFO1_ITM_ATVALID_Msk (0x1UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */ + +#define TPI_FIFO1_ITM_bytecount_Pos 27U /*!< TPI FIFO1: ITM_bytecount Position */ +#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */ + +#define TPI_FIFO1_ETM_ATVALID_Pos 26U /*!< TPI FIFO1: ETM_ATVALID Position */ +#define TPI_FIFO1_ETM_ATVALID_Msk (0x1UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */ + +#define TPI_FIFO1_ETM_bytecount_Pos 24U /*!< TPI FIFO1: ETM_bytecount Position */ +#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */ + +#define TPI_FIFO1_ITM2_Pos 16U /*!< TPI FIFO1: ITM2 Position */ +#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */ + +#define TPI_FIFO1_ITM1_Pos 8U /*!< TPI FIFO1: ITM1 Position */ +#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */ + +#define TPI_FIFO1_ITM0_Pos 0U /*!< TPI FIFO1: ITM0 Position */ +#define TPI_FIFO1_ITM0_Msk (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/) /*!< TPI FIFO1: ITM0 Mask */ + +/* TPI ITATBCTR0 Register Definitions */ +#define TPI_ITATBCTR0_ATREADY2_Pos 0U /*!< TPI ITATBCTR0: ATREADY2 Position */ +#define TPI_ITATBCTR0_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY2_Pos*/) /*!< TPI ITATBCTR0: ATREADY2 Mask */ + +#define TPI_ITATBCTR0_ATREADY1_Pos 0U /*!< TPI ITATBCTR0: ATREADY1 Position */ +#define TPI_ITATBCTR0_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY1_Pos*/) /*!< TPI ITATBCTR0: ATREADY1 Mask */ + +/* TPI Integration Mode Control Register Definitions */ +#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */ +#define TPI_ITCTRL_Mode_Msk (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_MinBufSz_Pos 6U /*!< TPI DEVID: MinBufSz Position */ +#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */ + +#define TPI_DEVID_AsynClkIn_Pos 5U /*!< TPI DEVID: AsynClkIn Position */ +#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */ + +#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */ +#define TPI_DEVID_NrTraceInput_Msk (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ + __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */ + __IOM uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */ + __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */ + __IOM uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */ + __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */ + __IOM uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */ +} MPU_Type; + +#define MPU_TYPE_RALIASES 4U + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_ADDR_Pos 5U /*!< MPU RBAR: ADDR Position */ +#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ + +#define MPU_RBAR_VALID_Pos 4U /*!< MPU RBAR: VALID Position */ +#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ + +#define MPU_RBAR_REGION_Pos 0U /*!< MPU RBAR: REGION Position */ +#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ + +/* MPU Region Attribute and Size Register Definitions */ +#define MPU_RASR_ATTRS_Pos 16U /*!< MPU RASR: MPU Region Attribute field Position */ +#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ + +#define MPU_RASR_XN_Pos 28U /*!< MPU RASR: ATTRS.XN Position */ +#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ + +#define MPU_RASR_AP_Pos 24U /*!< MPU RASR: ATTRS.AP Position */ +#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ + +#define MPU_RASR_TEX_Pos 19U /*!< MPU RASR: ATTRS.TEX Position */ +#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ + +#define MPU_RASR_S_Pos 18U /*!< MPU RASR: ATTRS.S Position */ +#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ + +#define MPU_RASR_C_Pos 17U /*!< MPU RASR: ATTRS.C Position */ +#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ + +#define MPU_RASR_B_Pos 16U /*!< MPU RASR: ATTRS.B Position */ +#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ + +#define MPU_RASR_SRD_Pos 8U /*!< MPU RASR: Sub-Region Disable Position */ +#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ + +#define MPU_RASR_SIZE_Pos 1U /*!< MPU RASR: Region Size Field Position */ +#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ + +#define MPU_RASR_ENABLE_Pos 0U /*!< MPU RASR: Region enable bit Position */ +#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** + \brief Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register Definitions */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ +#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register Definitions */ +#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register Definitions */ +#define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< CoreDebug DEMCR: TRCENA Position */ +#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ + +#define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< CoreDebug DEMCR: MON_REQ Position */ +#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ + +#define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< CoreDebug DEMCR: MON_STEP Position */ +#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ + +#define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< CoreDebug DEMCR: MON_PEND Position */ +#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ + +#define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< CoreDebug DEMCR: MON_EN Position */ +#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< CoreDebug DEMCR: VC_INTERR Position */ +#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ + +#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< CoreDebug DEMCR: VC_BUSERR Position */ +#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ + +#define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< CoreDebug DEMCR: VC_STATERR Position */ +#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ + +#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< CoreDebug DEMCR: VC_CHKERR Position */ +#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ + +#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< CoreDebug DEMCR: VC_NOCPERR Position */ +#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ + +#define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< CoreDebug DEMCR: VC_MMERR Position */ +#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ +#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ +#define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ +#define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ +#define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ +#define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ +#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ +#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ +#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + +#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ +#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ +#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ +#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ +#define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ +#define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ +#define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ +#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ +#endif + +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Debug Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ + #define NVIC_GetActive __NVIC_GetActive + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* The following EXC_RETURN values are saved the LR on exception entry */ +#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */ +#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */ +#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */ + + +/** + \brief Set Priority Grouping + \details Sets the priority grouping field using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ + SCB->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping + \details Reads the priority grouping field from the NVIC Interrupt Controller. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) +{ + return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + __COMPILER_BARRIER(); + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __COMPILER_BARRIER(); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IP[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC->IP[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t vectors = (uint32_t )SCB->VTOR; + (* (int *) (vectors + ((int32_t)IRQn + NVIC_USER_IRQ_OFFSET) * 4)) = vector; + /* ARM Application Note 321 states that the M3 does not require the architectural barrier */ +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t vectors = (uint32_t )SCB->VTOR; + return (uint32_t)(* (int *) (vectors + ((int32_t)IRQn + NVIC_USER_IRQ_OFFSET) * 4)); +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +/*@} end of CMSIS_Core_NVICFunctions */ + +/* ########################## MPU functions #################################### */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + +#include "mpu_armv7.h" + +#endif + + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + return 0U; /* No FPU */ +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + +/* ##################################### Debug In/Output function ########################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_core_DebugFunctions ITM Functions + \brief Functions that access the ITM debug interface. + @{ + */ + +extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ +#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ + + +/** + \brief ITM Send Character + \details Transmits a character via the ITM channel 0, and + \li Just returns when no debugger is connected that has booked the output. + \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. + \param [in] ch Character to transmit. + \returns Character to transmit. + */ +__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) +{ + if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ + ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ + { + while (ITM->PORT[0U].u32 == 0UL) + { + __NOP(); + } + ITM->PORT[0U].u8 = (uint8_t)ch; + } + return (ch); +} + + +/** + \brief ITM Receive Character + \details Inputs a character via the external variable \ref ITM_RxBuffer. + \return Received character. + \return -1 No character pending. + */ +__STATIC_INLINE int32_t ITM_ReceiveChar (void) +{ + int32_t ch = -1; /* no character available */ + + if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) + { + ch = ITM_RxBuffer; + ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ + } + + return (ch); +} + + +/** + \brief ITM Check Character + \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. + \return 0 No character available. + \return 1 Character available. + */ +__STATIC_INLINE int32_t ITM_CheckChar (void) +{ + + if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) + { + return (0); /* no character available */ + } + else + { + return (1); /* character available */ + } +} + +/*@} end of CMSIS_core_DebugFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM3_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm33.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm33.h new file mode 100644 index 0000000000..7fed59a88e --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm33.h @@ -0,0 +1,2910 @@ +/**************************************************************************//** + * @file core_cm33.h + * @brief CMSIS Cortex-M33 Core Peripheral Access Layer Header File + * @version V5.1.0 + * @date 12. November 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_CM33_H_GENERIC +#define __CORE_CM33_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_M33 + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS CM33 definitions */ +#define __CM33_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __CM33_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __CM33_CMSIS_VERSION ((__CM33_CMSIS_VERSION_MAIN << 16U) | \ + __CM33_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M (33U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions. +*/ +#if defined ( __CC_ARM ) + #if defined (__TARGET_FPU_VFP) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) + #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined (__ARM_FP) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) + #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) + #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __ICCARM__ ) + #if defined (__ARMVFP__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) + #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __TI_ARM__ ) + #if defined (__TI_VFP_SUPPORT__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __TASKING__ ) + #if defined (__FPU_VFP__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM33_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM33_H_DEPENDANT +#define __CORE_CM33_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM33_REV + #define __CM33_REV 0x0000U + #warning "__CM33_REV not defined in device header file; using default!" + #endif + + #ifndef __FPU_PRESENT + #define __FPU_PRESENT 0U + #warning "__FPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __SAUREGION_PRESENT + #define __SAUREGION_PRESENT 0U + #warning "__SAUREGION_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __DSP_PRESENT + #define __DSP_PRESENT 0U + #warning "__DSP_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 3U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group Cortex_M33 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + - Core SAU Register + - Core FPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + +#define APSR_Q_Pos 27U /*!< APSR: Q Position */ +#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ + +#define APSR_GE_Pos 16U /*!< APSR: GE Position */ +#define APSR_GE_Msk (0xFUL << APSR_GE_Pos) /*!< APSR: GE Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */ +#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ + +#define xPSR_IT_Pos 25U /*!< xPSR: IT Position */ +#define xPSR_IT_Msk (3UL << xPSR_IT_Pos) /*!< xPSR: IT Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_GE_Pos 16U /*!< xPSR: GE Position */ +#define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos) /*!< xPSR: GE Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack-pointer select */ + uint32_t FPCA:1; /*!< bit: 2 Floating-point context active */ + uint32_t SFPA:1; /*!< bit: 3 Secure floating-point active */ + uint32_t _reserved1:28; /*!< bit: 4..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SFPA_Pos 3U /*!< CONTROL: SFPA Position */ +#define CONTROL_SFPA_Msk (1UL << CONTROL_SFPA_Pos) /*!< CONTROL: SFPA Mask */ + +#define CONTROL_FPCA_Pos 2U /*!< CONTROL: FPCA Position */ +#define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos) /*!< CONTROL: FPCA Mask */ + +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[16U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[16U]; + __IOM uint32_t ICER[16U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[16U]; + __IOM uint32_t ISPR[16U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[16U]; + __IOM uint32_t ICPR[16U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[16U]; + __IOM uint32_t IABR[16U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[16U]; + __IOM uint32_t ITNS[16U]; /*!< Offset: 0x280 (R/W) Interrupt Non-Secure State Register */ + uint32_t RESERVED5[16U]; + __IOM uint8_t IPR[496U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ + uint32_t RESERVED6[580U]; + __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ +} NVIC_Type; + +/* Software Triggered Interrupt Register Definitions */ +#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ +#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + __IOM uint8_t SHPR[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ + __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ + __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ + __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ + __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ + __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ + __IM uint32_t ID_PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ + __IM uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ + __IM uint32_t ID_ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t ID_MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ + __IM uint32_t ID_ISAR[6U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ + __IM uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */ + __IM uint32_t CTR; /*!< Offset: 0x07C (R/ ) Cache Type register */ + __IM uint32_t CCSIDR; /*!< Offset: 0x080 (R/ ) Cache Size ID Register */ + __IOM uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */ + __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ + __IOM uint32_t NSACR; /*!< Offset: 0x08C (R/W) Non-Secure Access Control Register */ + uint32_t RESERVED3[92U]; + __OM uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */ + uint32_t RESERVED4[15U]; + __IM uint32_t MVFR0; /*!< Offset: 0x240 (R/ ) Media and VFP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x244 (R/ ) Media and VFP Feature Register 1 */ + __IM uint32_t MVFR2; /*!< Offset: 0x248 (R/ ) Media and VFP Feature Register 2 */ + uint32_t RESERVED5[1U]; + __OM uint32_t ICIALLU; /*!< Offset: 0x250 ( /W) I-Cache Invalidate All to PoU */ + uint32_t RESERVED6[1U]; + __OM uint32_t ICIMVAU; /*!< Offset: 0x258 ( /W) I-Cache Invalidate by MVA to PoU */ + __OM uint32_t DCIMVAC; /*!< Offset: 0x25C ( /W) D-Cache Invalidate by MVA to PoC */ + __OM uint32_t DCISW; /*!< Offset: 0x260 ( /W) D-Cache Invalidate by Set-way */ + __OM uint32_t DCCMVAU; /*!< Offset: 0x264 ( /W) D-Cache Clean by MVA to PoU */ + __OM uint32_t DCCMVAC; /*!< Offset: 0x268 ( /W) D-Cache Clean by MVA to PoC */ + __OM uint32_t DCCSW; /*!< Offset: 0x26C ( /W) D-Cache Clean by Set-way */ + __OM uint32_t DCCIMVAC; /*!< Offset: 0x270 ( /W) D-Cache Clean and Invalidate by MVA to PoC */ + __OM uint32_t DCCISW; /*!< Offset: 0x274 ( /W) D-Cache Clean and Invalidate by Set-way */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_PENDNMISET_Pos 31U /*!< SCB ICSR: PENDNMISET Position */ +#define SCB_ICSR_PENDNMISET_Msk (1UL << SCB_ICSR_PENDNMISET_Pos) /*!< SCB ICSR: PENDNMISET Mask */ + +#define SCB_ICSR_NMIPENDSET_Pos SCB_ICSR_PENDNMISET_Pos /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */ +#define SCB_ICSR_NMIPENDSET_Msk SCB_ICSR_PENDNMISET_Msk /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */ + +#define SCB_ICSR_PENDNMICLR_Pos 30U /*!< SCB ICSR: PENDNMICLR Position */ +#define SCB_ICSR_PENDNMICLR_Msk (1UL << SCB_ICSR_PENDNMICLR_Pos) /*!< SCB ICSR: PENDNMICLR Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_STTNS_Pos 24U /*!< SCB ICSR: STTNS Position (Security Extension) */ +#define SCB_ICSR_STTNS_Msk (1UL << SCB_ICSR_STTNS_Pos) /*!< SCB ICSR: STTNS Mask (Security Extension) */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Vector Table Offset Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIS_Pos 14U /*!< SCB AIRCR: PRIS Position */ +#define SCB_AIRCR_PRIS_Msk (1UL << SCB_AIRCR_PRIS_Pos) /*!< SCB AIRCR: PRIS Mask */ + +#define SCB_AIRCR_BFHFNMINS_Pos 13U /*!< SCB AIRCR: BFHFNMINS Position */ +#define SCB_AIRCR_BFHFNMINS_Msk (1UL << SCB_AIRCR_BFHFNMINS_Pos) /*!< SCB AIRCR: BFHFNMINS Mask */ + +#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */ +#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ + +#define SCB_AIRCR_SYSRESETREQS_Pos 3U /*!< SCB AIRCR: SYSRESETREQS Position */ +#define SCB_AIRCR_SYSRESETREQS_Msk (1UL << SCB_AIRCR_SYSRESETREQS_Pos) /*!< SCB AIRCR: SYSRESETREQS Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEPS_Pos 3U /*!< SCB SCR: SLEEPDEEPS Position */ +#define SCB_SCR_SLEEPDEEPS_Msk (1UL << SCB_SCR_SLEEPDEEPS_Pos) /*!< SCB SCR: SLEEPDEEPS Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_BP_Pos 18U /*!< SCB CCR: BP Position */ +#define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: BP Mask */ + +#define SCB_CCR_IC_Pos 17U /*!< SCB CCR: IC Position */ +#define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: IC Mask */ + +#define SCB_CCR_DC_Pos 16U /*!< SCB CCR: DC Position */ +#define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: DC Mask */ + +#define SCB_CCR_STKOFHFNMIGN_Pos 10U /*!< SCB CCR: STKOFHFNMIGN Position */ +#define SCB_CCR_STKOFHFNMIGN_Msk (1UL << SCB_CCR_STKOFHFNMIGN_Pos) /*!< SCB CCR: STKOFHFNMIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_HARDFAULTPENDED_Pos 21U /*!< SCB SHCSR: HARDFAULTPENDED Position */ +#define SCB_SHCSR_HARDFAULTPENDED_Msk (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos) /*!< SCB SHCSR: HARDFAULTPENDED Mask */ + +#define SCB_SHCSR_SECUREFAULTPENDED_Pos 20U /*!< SCB SHCSR: SECUREFAULTPENDED Position */ +#define SCB_SHCSR_SECUREFAULTPENDED_Msk (1UL << SCB_SHCSR_SECUREFAULTPENDED_Pos) /*!< SCB SHCSR: SECUREFAULTPENDED Mask */ + +#define SCB_SHCSR_SECUREFAULTENA_Pos 19U /*!< SCB SHCSR: SECUREFAULTENA Position */ +#define SCB_SHCSR_SECUREFAULTENA_Msk (1UL << SCB_SHCSR_SECUREFAULTENA_Pos) /*!< SCB SHCSR: SECUREFAULTENA Mask */ + +#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */ +#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ + +#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */ +#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ + +#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */ +#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */ +#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ + +#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */ +#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ + +#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */ +#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */ +#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_NMIACT_Pos 5U /*!< SCB SHCSR: NMIACT Position */ +#define SCB_SHCSR_NMIACT_Msk (1UL << SCB_SHCSR_NMIACT_Pos) /*!< SCB SHCSR: NMIACT Mask */ + +#define SCB_SHCSR_SECUREFAULTACT_Pos 4U /*!< SCB SHCSR: SECUREFAULTACT Position */ +#define SCB_SHCSR_SECUREFAULTACT_Msk (1UL << SCB_SHCSR_SECUREFAULTACT_Pos) /*!< SCB SHCSR: SECUREFAULTACT Mask */ + +#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */ +#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ + +#define SCB_SHCSR_HARDFAULTACT_Pos 2U /*!< SCB SHCSR: HARDFAULTACT Position */ +#define SCB_SHCSR_HARDFAULTACT_Msk (1UL << SCB_SHCSR_HARDFAULTACT_Pos) /*!< SCB SHCSR: HARDFAULTACT Mask */ + +#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */ +#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ + +#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */ +#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ + +/* SCB Configurable Fault Status Register Definitions */ +#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */ +#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ + +#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */ +#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ + +#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */ +#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ + +/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ + +#define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ +#define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ + +#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ + +#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ + +#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ + +#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ + +/* BusFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */ +#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */ + +#define SCB_CFSR_LSPERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 5U) /*!< SCB CFSR (BFSR): LSPERR Position */ +#define SCB_CFSR_LSPERR_Msk (1UL << SCB_CFSR_LSPERR_Pos) /*!< SCB CFSR (BFSR): LSPERR Mask */ + +#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */ +#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */ + +#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */ +#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */ + +#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */ +#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */ + +#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */ +#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */ + +#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */ +#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */ + +/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */ +#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */ + +#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */ +#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */ + +#define SCB_CFSR_STKOF_Pos (SCB_CFSR_USGFAULTSR_Pos + 4U) /*!< SCB CFSR (UFSR): STKOF Position */ +#define SCB_CFSR_STKOF_Msk (1UL << SCB_CFSR_STKOF_Pos) /*!< SCB CFSR (UFSR): STKOF Mask */ + +#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */ +#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */ + +#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */ +#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */ + +#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */ +#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */ + +#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */ +#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */ + +/* SCB Hard Fault Status Register Definitions */ +#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */ +#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ + +#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */ +#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ + +#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */ +#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ + +/* SCB Debug Fault Status Register Definitions */ +#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */ +#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ + +#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */ +#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ + +#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */ +#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ + +#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */ +#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ + +#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */ +#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ + +/* SCB Non-Secure Access Control Register Definitions */ +#define SCB_NSACR_CP11_Pos 11U /*!< SCB NSACR: CP11 Position */ +#define SCB_NSACR_CP11_Msk (1UL << SCB_NSACR_CP11_Pos) /*!< SCB NSACR: CP11 Mask */ + +#define SCB_NSACR_CP10_Pos 10U /*!< SCB NSACR: CP10 Position */ +#define SCB_NSACR_CP10_Msk (1UL << SCB_NSACR_CP10_Pos) /*!< SCB NSACR: CP10 Mask */ + +#define SCB_NSACR_CPn_Pos 0U /*!< SCB NSACR: CPn Position */ +#define SCB_NSACR_CPn_Msk (1UL /*<< SCB_NSACR_CPn_Pos*/) /*!< SCB NSACR: CPn Mask */ + +/* SCB Cache Level ID Register Definitions */ +#define SCB_CLIDR_LOUU_Pos 27U /*!< SCB CLIDR: LoUU Position */ +#define SCB_CLIDR_LOUU_Msk (7UL << SCB_CLIDR_LOUU_Pos) /*!< SCB CLIDR: LoUU Mask */ + +#define SCB_CLIDR_LOC_Pos 24U /*!< SCB CLIDR: LoC Position */ +#define SCB_CLIDR_LOC_Msk (7UL << SCB_CLIDR_LOC_Pos) /*!< SCB CLIDR: LoC Mask */ + +/* SCB Cache Type Register Definitions */ +#define SCB_CTR_FORMAT_Pos 29U /*!< SCB CTR: Format Position */ +#define SCB_CTR_FORMAT_Msk (7UL << SCB_CTR_FORMAT_Pos) /*!< SCB CTR: Format Mask */ + +#define SCB_CTR_CWG_Pos 24U /*!< SCB CTR: CWG Position */ +#define SCB_CTR_CWG_Msk (0xFUL << SCB_CTR_CWG_Pos) /*!< SCB CTR: CWG Mask */ + +#define SCB_CTR_ERG_Pos 20U /*!< SCB CTR: ERG Position */ +#define SCB_CTR_ERG_Msk (0xFUL << SCB_CTR_ERG_Pos) /*!< SCB CTR: ERG Mask */ + +#define SCB_CTR_DMINLINE_Pos 16U /*!< SCB CTR: DminLine Position */ +#define SCB_CTR_DMINLINE_Msk (0xFUL << SCB_CTR_DMINLINE_Pos) /*!< SCB CTR: DminLine Mask */ + +#define SCB_CTR_IMINLINE_Pos 0U /*!< SCB CTR: ImInLine Position */ +#define SCB_CTR_IMINLINE_Msk (0xFUL /*<< SCB_CTR_IMINLINE_Pos*/) /*!< SCB CTR: ImInLine Mask */ + +/* SCB Cache Size ID Register Definitions */ +#define SCB_CCSIDR_WT_Pos 31U /*!< SCB CCSIDR: WT Position */ +#define SCB_CCSIDR_WT_Msk (1UL << SCB_CCSIDR_WT_Pos) /*!< SCB CCSIDR: WT Mask */ + +#define SCB_CCSIDR_WB_Pos 30U /*!< SCB CCSIDR: WB Position */ +#define SCB_CCSIDR_WB_Msk (1UL << SCB_CCSIDR_WB_Pos) /*!< SCB CCSIDR: WB Mask */ + +#define SCB_CCSIDR_RA_Pos 29U /*!< SCB CCSIDR: RA Position */ +#define SCB_CCSIDR_RA_Msk (1UL << SCB_CCSIDR_RA_Pos) /*!< SCB CCSIDR: RA Mask */ + +#define SCB_CCSIDR_WA_Pos 28U /*!< SCB CCSIDR: WA Position */ +#define SCB_CCSIDR_WA_Msk (1UL << SCB_CCSIDR_WA_Pos) /*!< SCB CCSIDR: WA Mask */ + +#define SCB_CCSIDR_NUMSETS_Pos 13U /*!< SCB CCSIDR: NumSets Position */ +#define SCB_CCSIDR_NUMSETS_Msk (0x7FFFUL << SCB_CCSIDR_NUMSETS_Pos) /*!< SCB CCSIDR: NumSets Mask */ + +#define SCB_CCSIDR_ASSOCIATIVITY_Pos 3U /*!< SCB CCSIDR: Associativity Position */ +#define SCB_CCSIDR_ASSOCIATIVITY_Msk (0x3FFUL << SCB_CCSIDR_ASSOCIATIVITY_Pos) /*!< SCB CCSIDR: Associativity Mask */ + +#define SCB_CCSIDR_LINESIZE_Pos 0U /*!< SCB CCSIDR: LineSize Position */ +#define SCB_CCSIDR_LINESIZE_Msk (7UL /*<< SCB_CCSIDR_LINESIZE_Pos*/) /*!< SCB CCSIDR: LineSize Mask */ + +/* SCB Cache Size Selection Register Definitions */ +#define SCB_CSSELR_LEVEL_Pos 1U /*!< SCB CSSELR: Level Position */ +#define SCB_CSSELR_LEVEL_Msk (7UL << SCB_CSSELR_LEVEL_Pos) /*!< SCB CSSELR: Level Mask */ + +#define SCB_CSSELR_IND_Pos 0U /*!< SCB CSSELR: InD Position */ +#define SCB_CSSELR_IND_Msk (1UL /*<< SCB_CSSELR_IND_Pos*/) /*!< SCB CSSELR: InD Mask */ + +/* SCB Software Triggered Interrupt Register Definitions */ +#define SCB_STIR_INTID_Pos 0U /*!< SCB STIR: INTID Position */ +#define SCB_STIR_INTID_Msk (0x1FFUL /*<< SCB_STIR_INTID_Pos*/) /*!< SCB STIR: INTID Mask */ + +/* SCB D-Cache Invalidate by Set-way Register Definitions */ +#define SCB_DCISW_WAY_Pos 30U /*!< SCB DCISW: Way Position */ +#define SCB_DCISW_WAY_Msk (3UL << SCB_DCISW_WAY_Pos) /*!< SCB DCISW: Way Mask */ + +#define SCB_DCISW_SET_Pos 5U /*!< SCB DCISW: Set Position */ +#define SCB_DCISW_SET_Msk (0x1FFUL << SCB_DCISW_SET_Pos) /*!< SCB DCISW: Set Mask */ + +/* SCB D-Cache Clean by Set-way Register Definitions */ +#define SCB_DCCSW_WAY_Pos 30U /*!< SCB DCCSW: Way Position */ +#define SCB_DCCSW_WAY_Msk (3UL << SCB_DCCSW_WAY_Pos) /*!< SCB DCCSW: Way Mask */ + +#define SCB_DCCSW_SET_Pos 5U /*!< SCB DCCSW: Set Position */ +#define SCB_DCCSW_SET_Msk (0x1FFUL << SCB_DCCSW_SET_Pos) /*!< SCB DCCSW: Set Mask */ + +/* SCB D-Cache Clean and Invalidate by Set-way Register Definitions */ +#define SCB_DCCISW_WAY_Pos 30U /*!< SCB DCCISW: Way Position */ +#define SCB_DCCISW_WAY_Msk (3UL << SCB_DCCISW_WAY_Pos) /*!< SCB DCCISW: Way Mask */ + +#define SCB_DCCISW_SET_Pos 5U /*!< SCB DCCISW: Set Position */ +#define SCB_DCCISW_SET_Msk (0x1FFUL << SCB_DCCISW_SET_Pos) /*!< SCB DCCISW: Set Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** + \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ + __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ + __IOM uint32_t CPPWR; /*!< Offset: 0x00C (R/W) Coprocessor Power Control Register */ +} SCnSCB_Type; + +/* Interrupt Controller Type Register Definitions */ +#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ +#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_SCnotSCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) + \brief Type definitions for the Instrumentation Trace Macrocell (ITM) + @{ + */ + +/** + \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). + */ +typedef struct +{ + __OM union + { + __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ + __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ + __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ + } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ + uint32_t RESERVED0[864U]; + __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ + uint32_t RESERVED1[15U]; + __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ + uint32_t RESERVED2[15U]; + __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ + uint32_t RESERVED3[32U]; + uint32_t RESERVED4[43U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ + uint32_t RESERVED5[1U]; + __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) ITM Device Architecture Register */ + uint32_t RESERVED6[4U]; + __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ + __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ + __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ + __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ + __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ + __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ + __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ + __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ + __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ + __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ + __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ + __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ +} ITM_Type; + +/* ITM Stimulus Port Register Definitions */ +#define ITM_STIM_DISABLED_Pos 1U /*!< ITM STIM: DISABLED Position */ +#define ITM_STIM_DISABLED_Msk (0x1UL << ITM_STIM_DISABLED_Pos) /*!< ITM STIM: DISABLED Mask */ + +#define ITM_STIM_FIFOREADY_Pos 0U /*!< ITM STIM: FIFOREADY Position */ +#define ITM_STIM_FIFOREADY_Msk (0x1UL /*<< ITM_STIM_FIFOREADY_Pos*/) /*!< ITM STIM: FIFOREADY Mask */ + +/* ITM Trace Privilege Register Definitions */ +#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */ +#define ITM_TPR_PRIVMASK_Msk (0xFFFFFFFFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ + +/* ITM Trace Control Register Definitions */ +#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */ +#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ + +#define ITM_TCR_TRACEBUSID_Pos 16U /*!< ITM TCR: ATBID Position */ +#define ITM_TCR_TRACEBUSID_Msk (0x7FUL << ITM_TCR_TRACEBUSID_Pos) /*!< ITM TCR: ATBID Mask */ + +#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */ +#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ + +#define ITM_TCR_TSPRESCALE_Pos 8U /*!< ITM TCR: TSPRESCALE Position */ +#define ITM_TCR_TSPRESCALE_Msk (3UL << ITM_TCR_TSPRESCALE_Pos) /*!< ITM TCR: TSPRESCALE Mask */ + +#define ITM_TCR_STALLENA_Pos 5U /*!< ITM TCR: STALLENA Position */ +#define ITM_TCR_STALLENA_Msk (1UL << ITM_TCR_STALLENA_Pos) /*!< ITM TCR: STALLENA Mask */ + +#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */ +#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ + +#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */ +#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ + +#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */ +#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ + +#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */ +#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ + +#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ +#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ + +/* ITM Lock Status Register Definitions */ +#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */ +#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ + +#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */ +#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ + +#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ +#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ + +/*@}*/ /* end of group CMSIS_ITM */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ + __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ + __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ + __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ + __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ + __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + uint32_t RESERVED3[1U]; + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED4[1U]; + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + uint32_t RESERVED5[1U]; + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED6[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + uint32_t RESERVED7[1U]; + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ + uint32_t RESERVED8[1U]; + __IOM uint32_t COMP4; /*!< Offset: 0x060 (R/W) Comparator Register 4 */ + uint32_t RESERVED9[1U]; + __IOM uint32_t FUNCTION4; /*!< Offset: 0x068 (R/W) Function Register 4 */ + uint32_t RESERVED10[1U]; + __IOM uint32_t COMP5; /*!< Offset: 0x070 (R/W) Comparator Register 5 */ + uint32_t RESERVED11[1U]; + __IOM uint32_t FUNCTION5; /*!< Offset: 0x078 (R/W) Function Register 5 */ + uint32_t RESERVED12[1U]; + __IOM uint32_t COMP6; /*!< Offset: 0x080 (R/W) Comparator Register 6 */ + uint32_t RESERVED13[1U]; + __IOM uint32_t FUNCTION6; /*!< Offset: 0x088 (R/W) Function Register 6 */ + uint32_t RESERVED14[1U]; + __IOM uint32_t COMP7; /*!< Offset: 0x090 (R/W) Comparator Register 7 */ + uint32_t RESERVED15[1U]; + __IOM uint32_t FUNCTION7; /*!< Offset: 0x098 (R/W) Function Register 7 */ + uint32_t RESERVED16[1U]; + __IOM uint32_t COMP8; /*!< Offset: 0x0A0 (R/W) Comparator Register 8 */ + uint32_t RESERVED17[1U]; + __IOM uint32_t FUNCTION8; /*!< Offset: 0x0A8 (R/W) Function Register 8 */ + uint32_t RESERVED18[1U]; + __IOM uint32_t COMP9; /*!< Offset: 0x0B0 (R/W) Comparator Register 9 */ + uint32_t RESERVED19[1U]; + __IOM uint32_t FUNCTION9; /*!< Offset: 0x0B8 (R/W) Function Register 9 */ + uint32_t RESERVED20[1U]; + __IOM uint32_t COMP10; /*!< Offset: 0x0C0 (R/W) Comparator Register 10 */ + uint32_t RESERVED21[1U]; + __IOM uint32_t FUNCTION10; /*!< Offset: 0x0C8 (R/W) Function Register 10 */ + uint32_t RESERVED22[1U]; + __IOM uint32_t COMP11; /*!< Offset: 0x0D0 (R/W) Comparator Register 11 */ + uint32_t RESERVED23[1U]; + __IOM uint32_t FUNCTION11; /*!< Offset: 0x0D8 (R/W) Function Register 11 */ + uint32_t RESERVED24[1U]; + __IOM uint32_t COMP12; /*!< Offset: 0x0E0 (R/W) Comparator Register 12 */ + uint32_t RESERVED25[1U]; + __IOM uint32_t FUNCTION12; /*!< Offset: 0x0E8 (R/W) Function Register 12 */ + uint32_t RESERVED26[1U]; + __IOM uint32_t COMP13; /*!< Offset: 0x0F0 (R/W) Comparator Register 13 */ + uint32_t RESERVED27[1U]; + __IOM uint32_t FUNCTION13; /*!< Offset: 0x0F8 (R/W) Function Register 13 */ + uint32_t RESERVED28[1U]; + __IOM uint32_t COMP14; /*!< Offset: 0x100 (R/W) Comparator Register 14 */ + uint32_t RESERVED29[1U]; + __IOM uint32_t FUNCTION14; /*!< Offset: 0x108 (R/W) Function Register 14 */ + uint32_t RESERVED30[1U]; + __IOM uint32_t COMP15; /*!< Offset: 0x110 (R/W) Comparator Register 15 */ + uint32_t RESERVED31[1U]; + __IOM uint32_t FUNCTION15; /*!< Offset: 0x118 (R/W) Function Register 15 */ + uint32_t RESERVED32[934U]; + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R ) Lock Status Register */ + uint32_t RESERVED33[1U]; + __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) Device Architecture Register */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +#define DWT_CTRL_CYCDISS_Pos 23U /*!< DWT CTRL: CYCDISS Position */ +#define DWT_CTRL_CYCDISS_Msk (0x1UL << DWT_CTRL_CYCDISS_Pos) /*!< DWT CTRL: CYCDISS Mask */ + +#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */ +#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ + +#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */ +#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ + +#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */ +#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ + +#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */ +#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ + +#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */ +#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ + +#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */ +#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ + +#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */ +#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ + +#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */ +#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ + +#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */ +#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ + +#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */ +#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ + +#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */ +#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ + +#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */ +#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ + +#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */ +#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ + +/* DWT CPI Count Register Definitions */ +#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */ +#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ + +/* DWT Exception Overhead Count Register Definitions */ +#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */ +#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ + +/* DWT Sleep Count Register Definitions */ +#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */ +#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ + +/* DWT LSU Count Register Definitions */ +#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */ +#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ + +/* DWT Folded-instruction Count Register Definitions */ +#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */ +#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_ID_Pos 27U /*!< DWT FUNCTION: ID Position */ +#define DWT_FUNCTION_ID_Msk (0x1FUL << DWT_FUNCTION_ID_Pos) /*!< DWT FUNCTION: ID Mask */ + +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_ACTION_Pos 4U /*!< DWT FUNCTION: ACTION Position */ +#define DWT_FUNCTION_ACTION_Msk (0x1UL << DWT_FUNCTION_ACTION_Pos) /*!< DWT FUNCTION: ACTION Mask */ + +#define DWT_FUNCTION_MATCH_Pos 0U /*!< DWT FUNCTION: MATCH Position */ +#define DWT_FUNCTION_MATCH_Msk (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/) /*!< DWT FUNCTION: MATCH Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IOM uint32_t PSCR; /*!< Offset: 0x308 (R/W) Periodic Synchronization Control Register */ + uint32_t RESERVED3[759U]; + __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER Register */ + __IM uint32_t ITFTTD0; /*!< Offset: 0xEEC (R/ ) Integration Test FIFO Test Data 0 Register */ + __IOM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/W) Integration Test ATB Control Register 2 */ + uint32_t RESERVED4[1U]; + __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) Integration Test ATB Control Register 0 */ + __IM uint32_t ITFTTD1; /*!< Offset: 0xEFC (R/ ) Integration Test FIFO Test Data 1 Register */ + __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ + uint32_t RESERVED5[39U]; + __IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ + __IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ + uint32_t RESERVED7[8U]; + __IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) Device Configuration Register */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) Device Type Identifier Register */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */ +#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_FOnMan_Pos 6U /*!< TPI FFCR: FOnMan Position */ +#define TPI_FFCR_FOnMan_Msk (0x1UL << TPI_FFCR_FOnMan_Pos) /*!< TPI FFCR: FOnMan Mask */ + +#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI TRIGGER Register Definitions */ +#define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */ +#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ + +/* TPI Integration Test FIFO Test Data 0 Register Definitions */ +#define TPI_ITFTTD0_ATB_IF2_ATVALID_Pos 29U /*!< TPI ITFTTD0: ATB Interface 2 ATVALIDPosition */ +#define TPI_ITFTTD0_ATB_IF2_ATVALID_Msk (0x3UL << TPI_ITFTTD0_ATB_IF2_ATVALID_Pos) /*!< TPI ITFTTD0: ATB Interface 2 ATVALID Mask */ + +#define TPI_ITFTTD0_ATB_IF2_bytecount_Pos 27U /*!< TPI ITFTTD0: ATB Interface 2 byte count Position */ +#define TPI_ITFTTD0_ATB_IF2_bytecount_Msk (0x3UL << TPI_ITFTTD0_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 2 byte count Mask */ + +#define TPI_ITFTTD0_ATB_IF1_ATVALID_Pos 26U /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Position */ +#define TPI_ITFTTD0_ATB_IF1_ATVALID_Msk (0x3UL << TPI_ITFTTD0_ATB_IF1_ATVALID_Pos) /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Mask */ + +#define TPI_ITFTTD0_ATB_IF1_bytecount_Pos 24U /*!< TPI ITFTTD0: ATB Interface 1 byte count Position */ +#define TPI_ITFTTD0_ATB_IF1_bytecount_Msk (0x3UL << TPI_ITFTTD0_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 1 byte countt Mask */ + +#define TPI_ITFTTD0_ATB_IF1_data2_Pos 16U /*!< TPI ITFTTD0: ATB Interface 1 data2 Position */ +#define TPI_ITFTTD0_ATB_IF1_data2_Msk (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos) /*!< TPI ITFTTD0: ATB Interface 1 data2 Mask */ + +#define TPI_ITFTTD0_ATB_IF1_data1_Pos 8U /*!< TPI ITFTTD0: ATB Interface 1 data1 Position */ +#define TPI_ITFTTD0_ATB_IF1_data1_Msk (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos) /*!< TPI ITFTTD0: ATB Interface 1 data1 Mask */ + +#define TPI_ITFTTD0_ATB_IF1_data0_Pos 0U /*!< TPI ITFTTD0: ATB Interface 1 data0 Position */ +#define TPI_ITFTTD0_ATB_IF1_data0_Msk (0xFFUL /*<< TPI_ITFTTD0_ATB_IF1_data0_Pos*/) /*!< TPI ITFTTD0: ATB Interface 1 data0 Mask */ + +/* TPI Integration Test ATB Control Register 2 Register Definitions */ +#define TPI_ITATBCTR2_AFVALID2S_Pos 1U /*!< TPI ITATBCTR2: AFVALID2S Position */ +#define TPI_ITATBCTR2_AFVALID2S_Msk (0x1UL << TPI_ITATBCTR2_AFVALID2S_Pos) /*!< TPI ITATBCTR2: AFVALID2SS Mask */ + +#define TPI_ITATBCTR2_AFVALID1S_Pos 1U /*!< TPI ITATBCTR2: AFVALID1S Position */ +#define TPI_ITATBCTR2_AFVALID1S_Msk (0x1UL << TPI_ITATBCTR2_AFVALID1S_Pos) /*!< TPI ITATBCTR2: AFVALID1SS Mask */ + +#define TPI_ITATBCTR2_ATREADY2S_Pos 0U /*!< TPI ITATBCTR2: ATREADY2S Position */ +#define TPI_ITATBCTR2_ATREADY2S_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY2S_Pos*/) /*!< TPI ITATBCTR2: ATREADY2S Mask */ + +#define TPI_ITATBCTR2_ATREADY1S_Pos 0U /*!< TPI ITATBCTR2: ATREADY1S Position */ +#define TPI_ITATBCTR2_ATREADY1S_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY1S_Pos*/) /*!< TPI ITATBCTR2: ATREADY1S Mask */ + +/* TPI Integration Test FIFO Test Data 1 Register Definitions */ +#define TPI_ITFTTD1_ATB_IF2_ATVALID_Pos 29U /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Position */ +#define TPI_ITFTTD1_ATB_IF2_ATVALID_Msk (0x3UL << TPI_ITFTTD1_ATB_IF2_ATVALID_Pos) /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Mask */ + +#define TPI_ITFTTD1_ATB_IF2_bytecount_Pos 27U /*!< TPI ITFTTD1: ATB Interface 2 byte count Position */ +#define TPI_ITFTTD1_ATB_IF2_bytecount_Msk (0x3UL << TPI_ITFTTD1_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 2 byte count Mask */ + +#define TPI_ITFTTD1_ATB_IF1_ATVALID_Pos 26U /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Position */ +#define TPI_ITFTTD1_ATB_IF1_ATVALID_Msk (0x3UL << TPI_ITFTTD1_ATB_IF1_ATVALID_Pos) /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Mask */ + +#define TPI_ITFTTD1_ATB_IF1_bytecount_Pos 24U /*!< TPI ITFTTD1: ATB Interface 1 byte count Position */ +#define TPI_ITFTTD1_ATB_IF1_bytecount_Msk (0x3UL << TPI_ITFTTD1_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 1 byte countt Mask */ + +#define TPI_ITFTTD1_ATB_IF2_data2_Pos 16U /*!< TPI ITFTTD1: ATB Interface 2 data2 Position */ +#define TPI_ITFTTD1_ATB_IF2_data2_Msk (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos) /*!< TPI ITFTTD1: ATB Interface 2 data2 Mask */ + +#define TPI_ITFTTD1_ATB_IF2_data1_Pos 8U /*!< TPI ITFTTD1: ATB Interface 2 data1 Position */ +#define TPI_ITFTTD1_ATB_IF2_data1_Msk (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos) /*!< TPI ITFTTD1: ATB Interface 2 data1 Mask */ + +#define TPI_ITFTTD1_ATB_IF2_data0_Pos 0U /*!< TPI ITFTTD1: ATB Interface 2 data0 Position */ +#define TPI_ITFTTD1_ATB_IF2_data0_Msk (0xFFUL /*<< TPI_ITFTTD1_ATB_IF2_data0_Pos*/) /*!< TPI ITFTTD1: ATB Interface 2 data0 Mask */ + +/* TPI Integration Test ATB Control Register 0 Definitions */ +#define TPI_ITATBCTR0_AFVALID2S_Pos 1U /*!< TPI ITATBCTR0: AFVALID2S Position */ +#define TPI_ITATBCTR0_AFVALID2S_Msk (0x1UL << TPI_ITATBCTR0_AFVALID2S_Pos) /*!< TPI ITATBCTR0: AFVALID2SS Mask */ + +#define TPI_ITATBCTR0_AFVALID1S_Pos 1U /*!< TPI ITATBCTR0: AFVALID1S Position */ +#define TPI_ITATBCTR0_AFVALID1S_Msk (0x1UL << TPI_ITATBCTR0_AFVALID1S_Pos) /*!< TPI ITATBCTR0: AFVALID1SS Mask */ + +#define TPI_ITATBCTR0_ATREADY2S_Pos 0U /*!< TPI ITATBCTR0: ATREADY2S Position */ +#define TPI_ITATBCTR0_ATREADY2S_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY2S_Pos*/) /*!< TPI ITATBCTR0: ATREADY2S Mask */ + +#define TPI_ITATBCTR0_ATREADY1S_Pos 0U /*!< TPI ITATBCTR0: ATREADY1S Position */ +#define TPI_ITATBCTR0_ATREADY1S_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY1S_Pos*/) /*!< TPI ITATBCTR0: ATREADY1S Mask */ + +/* TPI Integration Mode Control Register Definitions */ +#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */ +#define TPI_ITCTRL_Mode_Msk (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_FIFOSZ_Pos 6U /*!< TPI DEVID: FIFOSZ Position */ +#define TPI_DEVID_FIFOSZ_Msk (0x7UL << TPI_DEVID_FIFOSZ_Pos) /*!< TPI DEVID: FIFOSZ Mask */ + +#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */ +#define TPI_DEVID_NrTraceInput_Msk (0x3FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) MPU Region Limit Address Register */ + __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Region Base Address Register Alias 1 */ + __IOM uint32_t RLAR_A1; /*!< Offset: 0x018 (R/W) MPU Region Limit Address Register Alias 1 */ + __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Region Base Address Register Alias 2 */ + __IOM uint32_t RLAR_A2; /*!< Offset: 0x020 (R/W) MPU Region Limit Address Register Alias 2 */ + __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Region Base Address Register Alias 3 */ + __IOM uint32_t RLAR_A3; /*!< Offset: 0x028 (R/W) MPU Region Limit Address Register Alias 3 */ + uint32_t RESERVED0[1]; + union { + __IOM uint32_t MAIR[2]; + struct { + __IOM uint32_t MAIR0; /*!< Offset: 0x030 (R/W) MPU Memory Attribute Indirection Register 0 */ + __IOM uint32_t MAIR1; /*!< Offset: 0x034 (R/W) MPU Memory Attribute Indirection Register 1 */ + }; + }; +} MPU_Type; + +#define MPU_TYPE_RALIASES 4U + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_BASE_Pos 5U /*!< MPU RBAR: BASE Position */ +#define MPU_RBAR_BASE_Msk (0x7FFFFFFUL << MPU_RBAR_BASE_Pos) /*!< MPU RBAR: BASE Mask */ + +#define MPU_RBAR_SH_Pos 3U /*!< MPU RBAR: SH Position */ +#define MPU_RBAR_SH_Msk (0x3UL << MPU_RBAR_SH_Pos) /*!< MPU RBAR: SH Mask */ + +#define MPU_RBAR_AP_Pos 1U /*!< MPU RBAR: AP Position */ +#define MPU_RBAR_AP_Msk (0x3UL << MPU_RBAR_AP_Pos) /*!< MPU RBAR: AP Mask */ + +#define MPU_RBAR_XN_Pos 0U /*!< MPU RBAR: XN Position */ +#define MPU_RBAR_XN_Msk (01UL /*<< MPU_RBAR_XN_Pos*/) /*!< MPU RBAR: XN Mask */ + +/* MPU Region Limit Address Register Definitions */ +#define MPU_RLAR_LIMIT_Pos 5U /*!< MPU RLAR: LIMIT Position */ +#define MPU_RLAR_LIMIT_Msk (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos) /*!< MPU RLAR: LIMIT Mask */ + +#define MPU_RLAR_AttrIndx_Pos 1U /*!< MPU RLAR: AttrIndx Position */ +#define MPU_RLAR_AttrIndx_Msk (0x7UL << MPU_RLAR_AttrIndx_Pos) /*!< MPU RLAR: AttrIndx Mask */ + +#define MPU_RLAR_EN_Pos 0U /*!< MPU RLAR: Region enable bit Position */ +#define MPU_RLAR_EN_Msk (1UL /*<< MPU_RLAR_EN_Pos*/) /*!< MPU RLAR: Region enable bit Disable Mask */ + +/* MPU Memory Attribute Indirection Register 0 Definitions */ +#define MPU_MAIR0_Attr3_Pos 24U /*!< MPU MAIR0: Attr3 Position */ +#define MPU_MAIR0_Attr3_Msk (0xFFUL << MPU_MAIR0_Attr3_Pos) /*!< MPU MAIR0: Attr3 Mask */ + +#define MPU_MAIR0_Attr2_Pos 16U /*!< MPU MAIR0: Attr2 Position */ +#define MPU_MAIR0_Attr2_Msk (0xFFUL << MPU_MAIR0_Attr2_Pos) /*!< MPU MAIR0: Attr2 Mask */ + +#define MPU_MAIR0_Attr1_Pos 8U /*!< MPU MAIR0: Attr1 Position */ +#define MPU_MAIR0_Attr1_Msk (0xFFUL << MPU_MAIR0_Attr1_Pos) /*!< MPU MAIR0: Attr1 Mask */ + +#define MPU_MAIR0_Attr0_Pos 0U /*!< MPU MAIR0: Attr0 Position */ +#define MPU_MAIR0_Attr0_Msk (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/) /*!< MPU MAIR0: Attr0 Mask */ + +/* MPU Memory Attribute Indirection Register 1 Definitions */ +#define MPU_MAIR1_Attr7_Pos 24U /*!< MPU MAIR1: Attr7 Position */ +#define MPU_MAIR1_Attr7_Msk (0xFFUL << MPU_MAIR1_Attr7_Pos) /*!< MPU MAIR1: Attr7 Mask */ + +#define MPU_MAIR1_Attr6_Pos 16U /*!< MPU MAIR1: Attr6 Position */ +#define MPU_MAIR1_Attr6_Msk (0xFFUL << MPU_MAIR1_Attr6_Pos) /*!< MPU MAIR1: Attr6 Mask */ + +#define MPU_MAIR1_Attr5_Pos 8U /*!< MPU MAIR1: Attr5 Position */ +#define MPU_MAIR1_Attr5_Msk (0xFFUL << MPU_MAIR1_Attr5_Pos) /*!< MPU MAIR1: Attr5 Mask */ + +#define MPU_MAIR1_Attr4_Pos 0U /*!< MPU MAIR1: Attr4 Position */ +#define MPU_MAIR1_Attr4_Msk (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/) /*!< MPU MAIR1: Attr4 Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SAU Security Attribution Unit (SAU) + \brief Type definitions for the Security Attribution Unit (SAU) + @{ + */ + +/** + \brief Structure type to access the Security Attribution Unit (SAU). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SAU Control Register */ + __IM uint32_t TYPE; /*!< Offset: 0x004 (R/ ) SAU Type Register */ +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) SAU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) SAU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) SAU Region Limit Address Register */ +#else + uint32_t RESERVED0[3]; +#endif + __IOM uint32_t SFSR; /*!< Offset: 0x014 (R/W) Secure Fault Status Register */ + __IOM uint32_t SFAR; /*!< Offset: 0x018 (R/W) Secure Fault Address Register */ +} SAU_Type; + +/* SAU Control Register Definitions */ +#define SAU_CTRL_ALLNS_Pos 1U /*!< SAU CTRL: ALLNS Position */ +#define SAU_CTRL_ALLNS_Msk (1UL << SAU_CTRL_ALLNS_Pos) /*!< SAU CTRL: ALLNS Mask */ + +#define SAU_CTRL_ENABLE_Pos 0U /*!< SAU CTRL: ENABLE Position */ +#define SAU_CTRL_ENABLE_Msk (1UL /*<< SAU_CTRL_ENABLE_Pos*/) /*!< SAU CTRL: ENABLE Mask */ + +/* SAU Type Register Definitions */ +#define SAU_TYPE_SREGION_Pos 0U /*!< SAU TYPE: SREGION Position */ +#define SAU_TYPE_SREGION_Msk (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/) /*!< SAU TYPE: SREGION Mask */ + +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) +/* SAU Region Number Register Definitions */ +#define SAU_RNR_REGION_Pos 0U /*!< SAU RNR: REGION Position */ +#define SAU_RNR_REGION_Msk (0xFFUL /*<< SAU_RNR_REGION_Pos*/) /*!< SAU RNR: REGION Mask */ + +/* SAU Region Base Address Register Definitions */ +#define SAU_RBAR_BADDR_Pos 5U /*!< SAU RBAR: BADDR Position */ +#define SAU_RBAR_BADDR_Msk (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos) /*!< SAU RBAR: BADDR Mask */ + +/* SAU Region Limit Address Register Definitions */ +#define SAU_RLAR_LADDR_Pos 5U /*!< SAU RLAR: LADDR Position */ +#define SAU_RLAR_LADDR_Msk (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos) /*!< SAU RLAR: LADDR Mask */ + +#define SAU_RLAR_NSC_Pos 1U /*!< SAU RLAR: NSC Position */ +#define SAU_RLAR_NSC_Msk (1UL << SAU_RLAR_NSC_Pos) /*!< SAU RLAR: NSC Mask */ + +#define SAU_RLAR_ENABLE_Pos 0U /*!< SAU RLAR: ENABLE Position */ +#define SAU_RLAR_ENABLE_Msk (1UL /*<< SAU_RLAR_ENABLE_Pos*/) /*!< SAU RLAR: ENABLE Mask */ + +#endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */ + +/* Secure Fault Status Register Definitions */ +#define SAU_SFSR_LSERR_Pos 7U /*!< SAU SFSR: LSERR Position */ +#define SAU_SFSR_LSERR_Msk (1UL << SAU_SFSR_LSERR_Pos) /*!< SAU SFSR: LSERR Mask */ + +#define SAU_SFSR_SFARVALID_Pos 6U /*!< SAU SFSR: SFARVALID Position */ +#define SAU_SFSR_SFARVALID_Msk (1UL << SAU_SFSR_SFARVALID_Pos) /*!< SAU SFSR: SFARVALID Mask */ + +#define SAU_SFSR_LSPERR_Pos 5U /*!< SAU SFSR: LSPERR Position */ +#define SAU_SFSR_LSPERR_Msk (1UL << SAU_SFSR_LSPERR_Pos) /*!< SAU SFSR: LSPERR Mask */ + +#define SAU_SFSR_INVTRAN_Pos 4U /*!< SAU SFSR: INVTRAN Position */ +#define SAU_SFSR_INVTRAN_Msk (1UL << SAU_SFSR_INVTRAN_Pos) /*!< SAU SFSR: INVTRAN Mask */ + +#define SAU_SFSR_AUVIOL_Pos 3U /*!< SAU SFSR: AUVIOL Position */ +#define SAU_SFSR_AUVIOL_Msk (1UL << SAU_SFSR_AUVIOL_Pos) /*!< SAU SFSR: AUVIOL Mask */ + +#define SAU_SFSR_INVER_Pos 2U /*!< SAU SFSR: INVER Position */ +#define SAU_SFSR_INVER_Msk (1UL << SAU_SFSR_INVER_Pos) /*!< SAU SFSR: INVER Mask */ + +#define SAU_SFSR_INVIS_Pos 1U /*!< SAU SFSR: INVIS Position */ +#define SAU_SFSR_INVIS_Msk (1UL << SAU_SFSR_INVIS_Pos) /*!< SAU SFSR: INVIS Mask */ + +#define SAU_SFSR_INVEP_Pos 0U /*!< SAU SFSR: INVEP Position */ +#define SAU_SFSR_INVEP_Msk (1UL /*<< SAU_SFSR_INVEP_Pos*/) /*!< SAU SFSR: INVEP Mask */ + +/*@} end of group CMSIS_SAU */ +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_FPU Floating Point Unit (FPU) + \brief Type definitions for the Floating Point Unit (FPU) + @{ + */ + +/** + \brief Structure type to access the Floating Point Unit (FPU). + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IOM uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */ + __IOM uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */ + __IOM uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */ + __IM uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and FP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and FP Feature Register 1 */ +} FPU_Type; + +/* Floating-Point Context Control Register Definitions */ +#define FPU_FPCCR_ASPEN_Pos 31U /*!< FPCCR: ASPEN bit Position */ +#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */ + +#define FPU_FPCCR_LSPEN_Pos 30U /*!< FPCCR: LSPEN Position */ +#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */ + +#define FPU_FPCCR_LSPENS_Pos 29U /*!< FPCCR: LSPENS Position */ +#define FPU_FPCCR_LSPENS_Msk (1UL << FPU_FPCCR_LSPENS_Pos) /*!< FPCCR: LSPENS bit Mask */ + +#define FPU_FPCCR_CLRONRET_Pos 28U /*!< FPCCR: CLRONRET Position */ +#define FPU_FPCCR_CLRONRET_Msk (1UL << FPU_FPCCR_CLRONRET_Pos) /*!< FPCCR: CLRONRET bit Mask */ + +#define FPU_FPCCR_CLRONRETS_Pos 27U /*!< FPCCR: CLRONRETS Position */ +#define FPU_FPCCR_CLRONRETS_Msk (1UL << FPU_FPCCR_CLRONRETS_Pos) /*!< FPCCR: CLRONRETS bit Mask */ + +#define FPU_FPCCR_TS_Pos 26U /*!< FPCCR: TS Position */ +#define FPU_FPCCR_TS_Msk (1UL << FPU_FPCCR_TS_Pos) /*!< FPCCR: TS bit Mask */ + +#define FPU_FPCCR_UFRDY_Pos 10U /*!< FPCCR: UFRDY Position */ +#define FPU_FPCCR_UFRDY_Msk (1UL << FPU_FPCCR_UFRDY_Pos) /*!< FPCCR: UFRDY bit Mask */ + +#define FPU_FPCCR_SPLIMVIOL_Pos 9U /*!< FPCCR: SPLIMVIOL Position */ +#define FPU_FPCCR_SPLIMVIOL_Msk (1UL << FPU_FPCCR_SPLIMVIOL_Pos) /*!< FPCCR: SPLIMVIOL bit Mask */ + +#define FPU_FPCCR_MONRDY_Pos 8U /*!< FPCCR: MONRDY Position */ +#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */ + +#define FPU_FPCCR_SFRDY_Pos 7U /*!< FPCCR: SFRDY Position */ +#define FPU_FPCCR_SFRDY_Msk (1UL << FPU_FPCCR_SFRDY_Pos) /*!< FPCCR: SFRDY bit Mask */ + +#define FPU_FPCCR_BFRDY_Pos 6U /*!< FPCCR: BFRDY Position */ +#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */ + +#define FPU_FPCCR_MMRDY_Pos 5U /*!< FPCCR: MMRDY Position */ +#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */ + +#define FPU_FPCCR_HFRDY_Pos 4U /*!< FPCCR: HFRDY Position */ +#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */ + +#define FPU_FPCCR_THREAD_Pos 3U /*!< FPCCR: processor mode bit Position */ +#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */ + +#define FPU_FPCCR_S_Pos 2U /*!< FPCCR: Security status of the FP context bit Position */ +#define FPU_FPCCR_S_Msk (1UL << FPU_FPCCR_S_Pos) /*!< FPCCR: Security status of the FP context bit Mask */ + +#define FPU_FPCCR_USER_Pos 1U /*!< FPCCR: privilege level bit Position */ +#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */ + +#define FPU_FPCCR_LSPACT_Pos 0U /*!< FPCCR: Lazy state preservation active bit Position */ +#define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/) /*!< FPCCR: Lazy state preservation active bit Mask */ + +/* Floating-Point Context Address Register Definitions */ +#define FPU_FPCAR_ADDRESS_Pos 3U /*!< FPCAR: ADDRESS bit Position */ +#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */ + +/* Floating-Point Default Status Control Register Definitions */ +#define FPU_FPDSCR_AHP_Pos 26U /*!< FPDSCR: AHP bit Position */ +#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */ + +#define FPU_FPDSCR_DN_Pos 25U /*!< FPDSCR: DN bit Position */ +#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */ + +#define FPU_FPDSCR_FZ_Pos 24U /*!< FPDSCR: FZ bit Position */ +#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */ + +#define FPU_FPDSCR_RMode_Pos 22U /*!< FPDSCR: RMode bit Position */ +#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */ + +/* Media and FP Feature Register 0 Definitions */ +#define FPU_MVFR0_FP_rounding_modes_Pos 28U /*!< MVFR0: FP rounding modes bits Position */ +#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */ + +#define FPU_MVFR0_Short_vectors_Pos 24U /*!< MVFR0: Short vectors bits Position */ +#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */ + +#define FPU_MVFR0_Square_root_Pos 20U /*!< MVFR0: Square root bits Position */ +#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */ + +#define FPU_MVFR0_Divide_Pos 16U /*!< MVFR0: Divide bits Position */ +#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */ + +#define FPU_MVFR0_FP_excep_trapping_Pos 12U /*!< MVFR0: FP exception trapping bits Position */ +#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */ + +#define FPU_MVFR0_Double_precision_Pos 8U /*!< MVFR0: Double-precision bits Position */ +#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */ + +#define FPU_MVFR0_Single_precision_Pos 4U /*!< MVFR0: Single-precision bits Position */ +#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */ + +#define FPU_MVFR0_A_SIMD_registers_Pos 0U /*!< MVFR0: A_SIMD registers bits Position */ +#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/) /*!< MVFR0: A_SIMD registers bits Mask */ + +/* Media and FP Feature Register 1 Definitions */ +#define FPU_MVFR1_FP_fused_MAC_Pos 28U /*!< MVFR1: FP fused MAC bits Position */ +#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */ + +#define FPU_MVFR1_FP_HPFP_Pos 24U /*!< MVFR1: FP HPFP bits Position */ +#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */ + +#define FPU_MVFR1_D_NaN_mode_Pos 4U /*!< MVFR1: D_NaN mode bits Position */ +#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */ + +#define FPU_MVFR1_FtZ_mode_Pos 0U /*!< MVFR1: FtZ mode bits Position */ +#define FPU_MVFR1_FtZ_mode_Msk (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/) /*!< MVFR1: FtZ mode bits Mask */ + +/*@} end of group CMSIS_FPU */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** + \brief Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ + uint32_t RESERVED4[1U]; + __IOM uint32_t DAUTHCTRL; /*!< Offset: 0x014 (R/W) Debug Authentication Control Register */ + __IOM uint32_t DSCSR; /*!< Offset: 0x018 (R/W) Debug Security Control and Status Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register Definitions */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESTART_ST_Pos 26U /*!< CoreDebug DHCSR: S_RESTART_ST Position */ +#define CoreDebug_DHCSR_S_RESTART_ST_Msk (1UL << CoreDebug_DHCSR_S_RESTART_ST_Pos) /*!< CoreDebug DHCSR: S_RESTART_ST Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ +#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register Definitions */ +#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register Definitions */ +#define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< CoreDebug DEMCR: TRCENA Position */ +#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ + +#define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< CoreDebug DEMCR: MON_REQ Position */ +#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ + +#define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< CoreDebug DEMCR: MON_STEP Position */ +#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ + +#define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< CoreDebug DEMCR: MON_PEND Position */ +#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ + +#define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< CoreDebug DEMCR: MON_EN Position */ +#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< CoreDebug DEMCR: VC_INTERR Position */ +#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ + +#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< CoreDebug DEMCR: VC_BUSERR Position */ +#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ + +#define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< CoreDebug DEMCR: VC_STATERR Position */ +#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ + +#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< CoreDebug DEMCR: VC_CHKERR Position */ +#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ + +#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< CoreDebug DEMCR: VC_NOCPERR Position */ +#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ + +#define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< CoreDebug DEMCR: VC_MMERR Position */ +#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ + +/* Debug Authentication Control Register Definitions */ +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos 3U /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Position */ +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Mask */ + +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos 2U /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Msk (1UL << CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos) /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Mask */ + +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Pos 1U /*!< CoreDebug DAUTHCTRL: INTSPIDEN Position */ +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPIDEN Mask */ + +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Pos 0U /*!< CoreDebug DAUTHCTRL: SPIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Msk (1UL /*<< CoreDebug_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< CoreDebug DAUTHCTRL: SPIDENSEL Mask */ + +/* Debug Security Control and Status Register Definitions */ +#define CoreDebug_DSCSR_CDS_Pos 16U /*!< CoreDebug DSCSR: CDS Position */ +#define CoreDebug_DSCSR_CDS_Msk (1UL << CoreDebug_DSCSR_CDS_Pos) /*!< CoreDebug DSCSR: CDS Mask */ + +#define CoreDebug_DSCSR_SBRSEL_Pos 1U /*!< CoreDebug DSCSR: SBRSEL Position */ +#define CoreDebug_DSCSR_SBRSEL_Msk (1UL << CoreDebug_DSCSR_SBRSEL_Pos) /*!< CoreDebug DSCSR: SBRSEL Mask */ + +#define CoreDebug_DSCSR_SBRSELEN_Pos 0U /*!< CoreDebug DSCSR: SBRSELEN Position */ +#define CoreDebug_DSCSR_SBRSELEN_Msk (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/) /*!< CoreDebug DSCSR: SBRSELEN Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ + #define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ + #define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ + #define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ + #define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ + #define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ + #define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ + #define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ + #define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + + #define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ + #define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ + #define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ + #define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ + #define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ + #define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ + #define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ + #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE ) /*!< Core Debug configuration struct */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ + #endif + + #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SAU_BASE (SCS_BASE + 0x0DD0UL) /*!< Security Attribution Unit */ + #define SAU ((SAU_Type *) SAU_BASE ) /*!< Security Attribution Unit */ + #endif + + #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ + #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */ + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SCS_BASE_NS (0xE002E000UL) /*!< System Control Space Base Address (non-secure address space) */ + #define CoreDebug_BASE_NS (0xE002EDF0UL) /*!< Core Debug Base Address (non-secure address space) */ + #define SysTick_BASE_NS (SCS_BASE_NS + 0x0010UL) /*!< SysTick Base Address (non-secure address space) */ + #define NVIC_BASE_NS (SCS_BASE_NS + 0x0100UL) /*!< NVIC Base Address (non-secure address space) */ + #define SCB_BASE_NS (SCS_BASE_NS + 0x0D00UL) /*!< System Control Block Base Address (non-secure address space) */ + + #define SCnSCB_NS ((SCnSCB_Type *) SCS_BASE_NS ) /*!< System control Register not in SCB(non-secure address space) */ + #define SCB_NS ((SCB_Type *) SCB_BASE_NS ) /*!< SCB configuration struct (non-secure address space) */ + #define SysTick_NS ((SysTick_Type *) SysTick_BASE_NS ) /*!< SysTick configuration struct (non-secure address space) */ + #define NVIC_NS ((NVIC_Type *) NVIC_BASE_NS ) /*!< NVIC configuration struct (non-secure address space) */ + #define CoreDebug_NS ((CoreDebug_Type *) CoreDebug_BASE_NS) /*!< Core Debug configuration struct (non-secure address space) */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE_NS (SCS_BASE_NS + 0x0D90UL) /*!< Memory Protection Unit (non-secure address space) */ + #define MPU_NS ((MPU_Type *) MPU_BASE_NS ) /*!< Memory Protection Unit (non-secure address space) */ + #endif + + #define FPU_BASE_NS (SCS_BASE_NS + 0x0F30UL) /*!< Floating Point Unit (non-secure address space) */ + #define FPU_NS ((FPU_Type *) FPU_BASE_NS ) /*!< Floating Point Unit (non-secure address space) */ + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Debug Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ + #define NVIC_GetActive __NVIC_GetActive + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* Special LR values for Secure/Non-Secure call handling and exception handling */ + +/* Function Return Payload (from ARMv8-M Architecture Reference Manual) LR value on entry from Secure BLXNS */ +#define FNC_RETURN (0xFEFFFFFFUL) /* bit [0] ignored when processing a branch */ + +/* The following EXC_RETURN mask values are used to evaluate the LR on exception entry */ +#define EXC_RETURN_PREFIX (0xFF000000UL) /* bits [31:24] set to indicate an EXC_RETURN value */ +#define EXC_RETURN_S (0x00000040UL) /* bit [6] stack used to push registers: 0=Non-secure 1=Secure */ +#define EXC_RETURN_DCRS (0x00000020UL) /* bit [5] stacking rules for called registers: 0=skipped 1=saved */ +#define EXC_RETURN_FTYPE (0x00000010UL) /* bit [4] allocate stack for floating-point context: 0=done 1=skipped */ +#define EXC_RETURN_MODE (0x00000008UL) /* bit [3] processor mode for return: 0=Handler mode 1=Thread mode */ +#define EXC_RETURN_SPSEL (0x00000004UL) /* bit [2] stack pointer used to restore context: 0=MSP 1=PSP */ +#define EXC_RETURN_ES (0x00000001UL) /* bit [0] security state exception was taken to: 0=Non-secure 1=Secure */ + +/* Integrity Signature (from ARMv8-M Architecture Reference Manual) for exception context stacking */ +#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) /* Value for processors with floating-point extension: */ +#define EXC_INTEGRITY_SIGNATURE (0xFEFA125AUL) /* bit [0] SFTC must match LR bit[4] EXC_RETURN_FTYPE */ +#else +#define EXC_INTEGRITY_SIGNATURE (0xFEFA125BUL) /* Value for processors without floating-point extension */ +#endif + + +/** + \brief Set Priority Grouping + \details Sets the priority grouping field using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ + SCB->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping + \details Reads the priority grouping field from the NVIC Interrupt Controller. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) +{ + return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + __COMPILER_BARRIER(); + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __COMPILER_BARRIER(); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Get Interrupt Target State + \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + \return 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Target State + \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Clear Interrupt Target State + \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; + __DSB(); +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Set Priority Grouping (non-secure) + \details Sets the non-secure priority grouping field when in secure state using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void TZ_NVIC_SetPriorityGrouping_NS(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB_NS->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ + SCB_NS->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping (non-secure) + \details Reads the priority grouping field from the non-secure NVIC when in secure state. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPriorityGrouping_NS(void) +{ + return ((uint32_t)((SCB_NS->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt (non-secure) + \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status (non-secure) + \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt (non-secure) + \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Pending Interrupt (non-secure) + \details Reads the NVIC pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt (non-secure) + \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt (non-secure) + \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt (non-secure) + \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority (non-secure) + \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every non-secure processor exception. + */ +__STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority (non-secure) + \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC_NS->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_NVICFunctions */ + +/* ########################## MPU functions #################################### */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + +#include "mpu_armv8.h" + +#endif + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + uint32_t mvfr0; + + mvfr0 = FPU->MVFR0; + if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x220U) + { + return 2U; /* Double + Single precision FPU */ + } + else if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U) + { + return 1U; /* Single precision FPU */ + } + else + { + return 0U; /* No FPU */ + } +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ########################## SAU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SAUFunctions SAU Functions + \brief Functions that configure the SAU. + @{ + */ + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + +/** + \brief Enable SAU + \details Enables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Enable(void) +{ + SAU->CTRL |= (SAU_CTRL_ENABLE_Msk); +} + + + +/** + \brief Disable SAU + \details Disables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Disable(void) +{ + SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk); +} + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_SAUFunctions */ + + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief System Tick Configuration (non-secure) + \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function TZ_SysTick_Config_NS is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + + */ +__STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick_NS->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick_NS->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick_NS->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + +/* ##################################### Debug In/Output function ########################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_core_DebugFunctions ITM Functions + \brief Functions that access the ITM debug interface. + @{ + */ + +extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ +#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ + + +/** + \brief ITM Send Character + \details Transmits a character via the ITM channel 0, and + \li Just returns when no debugger is connected that has booked the output. + \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. + \param [in] ch Character to transmit. + \returns Character to transmit. + */ +__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) +{ + if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ + ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ + { + while (ITM->PORT[0U].u32 == 0UL) + { + __NOP(); + } + ITM->PORT[0U].u8 = (uint8_t)ch; + } + return (ch); +} + + +/** + \brief ITM Receive Character + \details Inputs a character via the external variable \ref ITM_RxBuffer. + \return Received character. + \return -1 No character pending. + */ +__STATIC_INLINE int32_t ITM_ReceiveChar (void) +{ + int32_t ch = -1; /* no character available */ + + if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) + { + ch = ITM_RxBuffer; + ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ + } + + return (ch); +} + + +/** + \brief ITM Check Character + \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. + \return 0 No character available. + \return 1 Character available. + */ +__STATIC_INLINE int32_t ITM_CheckChar (void) +{ + + if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) + { + return (0); /* no character available */ + } + else + { + return (1); /* character available */ + } +} + +/*@} end of CMSIS_core_DebugFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM33_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm35p.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm35p.h new file mode 100644 index 0000000000..5579c82306 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm35p.h @@ -0,0 +1,2910 @@ +/**************************************************************************//** + * @file core_cm35p.h + * @brief CMSIS Cortex-M35P Core Peripheral Access Layer Header File + * @version V1.0.0 + * @date 12. November 2018 + ******************************************************************************/ +/* + * Copyright (c) 2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_CM35P_H_GENERIC +#define __CORE_CM35P_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_M35P + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS CM35P definitions */ +#define __CM35P_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __CM35P_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __CM35P_CMSIS_VERSION ((__CM35P_CMSIS_VERSION_MAIN << 16U) | \ + __CM35P_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M (35U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions. +*/ +#if defined ( __CC_ARM ) + #if defined (__TARGET_FPU_VFP) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) + #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined (__ARM_FP) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) + #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) + #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __ICCARM__ ) + #if defined (__ARMVFP__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) + #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __TI_ARM__ ) + #if defined (__TI_VFP_SUPPORT__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __TASKING__ ) + #if defined (__FPU_VFP__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM35P_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM35P_H_DEPENDANT +#define __CORE_CM35P_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM35P_REV + #define __CM35P_REV 0x0000U + #warning "__CM35P_REV not defined in device header file; using default!" + #endif + + #ifndef __FPU_PRESENT + #define __FPU_PRESENT 0U + #warning "__FPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __SAUREGION_PRESENT + #define __SAUREGION_PRESENT 0U + #warning "__SAUREGION_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __DSP_PRESENT + #define __DSP_PRESENT 0U + #warning "__DSP_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 3U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group Cortex_M35P */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + - Core SAU Register + - Core FPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + +#define APSR_Q_Pos 27U /*!< APSR: Q Position */ +#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ + +#define APSR_GE_Pos 16U /*!< APSR: GE Position */ +#define APSR_GE_Msk (0xFUL << APSR_GE_Pos) /*!< APSR: GE Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */ +#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ + +#define xPSR_IT_Pos 25U /*!< xPSR: IT Position */ +#define xPSR_IT_Msk (3UL << xPSR_IT_Pos) /*!< xPSR: IT Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_GE_Pos 16U /*!< xPSR: GE Position */ +#define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos) /*!< xPSR: GE Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack-pointer select */ + uint32_t FPCA:1; /*!< bit: 2 Floating-point context active */ + uint32_t SFPA:1; /*!< bit: 3 Secure floating-point active */ + uint32_t _reserved1:28; /*!< bit: 4..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SFPA_Pos 3U /*!< CONTROL: SFPA Position */ +#define CONTROL_SFPA_Msk (1UL << CONTROL_SFPA_Pos) /*!< CONTROL: SFPA Mask */ + +#define CONTROL_FPCA_Pos 2U /*!< CONTROL: FPCA Position */ +#define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos) /*!< CONTROL: FPCA Mask */ + +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[16U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[16U]; + __IOM uint32_t ICER[16U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[16U]; + __IOM uint32_t ISPR[16U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[16U]; + __IOM uint32_t ICPR[16U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[16U]; + __IOM uint32_t IABR[16U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[16U]; + __IOM uint32_t ITNS[16U]; /*!< Offset: 0x280 (R/W) Interrupt Non-Secure State Register */ + uint32_t RESERVED5[16U]; + __IOM uint8_t IPR[496U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ + uint32_t RESERVED6[580U]; + __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ +} NVIC_Type; + +/* Software Triggered Interrupt Register Definitions */ +#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ +#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + __IOM uint8_t SHPR[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ + __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ + __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ + __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ + __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ + __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ + __IM uint32_t ID_PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ + __IM uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ + __IM uint32_t ID_ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t ID_MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ + __IM uint32_t ID_ISAR[6U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ + __IM uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */ + __IM uint32_t CTR; /*!< Offset: 0x07C (R/ ) Cache Type register */ + __IM uint32_t CCSIDR; /*!< Offset: 0x080 (R/ ) Cache Size ID Register */ + __IOM uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */ + __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ + __IOM uint32_t NSACR; /*!< Offset: 0x08C (R/W) Non-Secure Access Control Register */ + uint32_t RESERVED3[92U]; + __OM uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */ + uint32_t RESERVED4[15U]; + __IM uint32_t MVFR0; /*!< Offset: 0x240 (R/ ) Media and VFP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x244 (R/ ) Media and VFP Feature Register 1 */ + __IM uint32_t MVFR2; /*!< Offset: 0x248 (R/ ) Media and VFP Feature Register 2 */ + uint32_t RESERVED5[1U]; + __OM uint32_t ICIALLU; /*!< Offset: 0x250 ( /W) I-Cache Invalidate All to PoU */ + uint32_t RESERVED6[1U]; + __OM uint32_t ICIMVAU; /*!< Offset: 0x258 ( /W) I-Cache Invalidate by MVA to PoU */ + __OM uint32_t DCIMVAC; /*!< Offset: 0x25C ( /W) D-Cache Invalidate by MVA to PoC */ + __OM uint32_t DCISW; /*!< Offset: 0x260 ( /W) D-Cache Invalidate by Set-way */ + __OM uint32_t DCCMVAU; /*!< Offset: 0x264 ( /W) D-Cache Clean by MVA to PoU */ + __OM uint32_t DCCMVAC; /*!< Offset: 0x268 ( /W) D-Cache Clean by MVA to PoC */ + __OM uint32_t DCCSW; /*!< Offset: 0x26C ( /W) D-Cache Clean by Set-way */ + __OM uint32_t DCCIMVAC; /*!< Offset: 0x270 ( /W) D-Cache Clean and Invalidate by MVA to PoC */ + __OM uint32_t DCCISW; /*!< Offset: 0x274 ( /W) D-Cache Clean and Invalidate by Set-way */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_PENDNMISET_Pos 31U /*!< SCB ICSR: PENDNMISET Position */ +#define SCB_ICSR_PENDNMISET_Msk (1UL << SCB_ICSR_PENDNMISET_Pos) /*!< SCB ICSR: PENDNMISET Mask */ + +#define SCB_ICSR_NMIPENDSET_Pos SCB_ICSR_PENDNMISET_Pos /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */ +#define SCB_ICSR_NMIPENDSET_Msk SCB_ICSR_PENDNMISET_Msk /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */ + +#define SCB_ICSR_PENDNMICLR_Pos 30U /*!< SCB ICSR: PENDNMICLR Position */ +#define SCB_ICSR_PENDNMICLR_Msk (1UL << SCB_ICSR_PENDNMICLR_Pos) /*!< SCB ICSR: PENDNMICLR Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_STTNS_Pos 24U /*!< SCB ICSR: STTNS Position (Security Extension) */ +#define SCB_ICSR_STTNS_Msk (1UL << SCB_ICSR_STTNS_Pos) /*!< SCB ICSR: STTNS Mask (Security Extension) */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Vector Table Offset Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIS_Pos 14U /*!< SCB AIRCR: PRIS Position */ +#define SCB_AIRCR_PRIS_Msk (1UL << SCB_AIRCR_PRIS_Pos) /*!< SCB AIRCR: PRIS Mask */ + +#define SCB_AIRCR_BFHFNMINS_Pos 13U /*!< SCB AIRCR: BFHFNMINS Position */ +#define SCB_AIRCR_BFHFNMINS_Msk (1UL << SCB_AIRCR_BFHFNMINS_Pos) /*!< SCB AIRCR: BFHFNMINS Mask */ + +#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */ +#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ + +#define SCB_AIRCR_SYSRESETREQS_Pos 3U /*!< SCB AIRCR: SYSRESETREQS Position */ +#define SCB_AIRCR_SYSRESETREQS_Msk (1UL << SCB_AIRCR_SYSRESETREQS_Pos) /*!< SCB AIRCR: SYSRESETREQS Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEPS_Pos 3U /*!< SCB SCR: SLEEPDEEPS Position */ +#define SCB_SCR_SLEEPDEEPS_Msk (1UL << SCB_SCR_SLEEPDEEPS_Pos) /*!< SCB SCR: SLEEPDEEPS Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_BP_Pos 18U /*!< SCB CCR: BP Position */ +#define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: BP Mask */ + +#define SCB_CCR_IC_Pos 17U /*!< SCB CCR: IC Position */ +#define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: IC Mask */ + +#define SCB_CCR_DC_Pos 16U /*!< SCB CCR: DC Position */ +#define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: DC Mask */ + +#define SCB_CCR_STKOFHFNMIGN_Pos 10U /*!< SCB CCR: STKOFHFNMIGN Position */ +#define SCB_CCR_STKOFHFNMIGN_Msk (1UL << SCB_CCR_STKOFHFNMIGN_Pos) /*!< SCB CCR: STKOFHFNMIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_HARDFAULTPENDED_Pos 21U /*!< SCB SHCSR: HARDFAULTPENDED Position */ +#define SCB_SHCSR_HARDFAULTPENDED_Msk (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos) /*!< SCB SHCSR: HARDFAULTPENDED Mask */ + +#define SCB_SHCSR_SECUREFAULTPENDED_Pos 20U /*!< SCB SHCSR: SECUREFAULTPENDED Position */ +#define SCB_SHCSR_SECUREFAULTPENDED_Msk (1UL << SCB_SHCSR_SECUREFAULTPENDED_Pos) /*!< SCB SHCSR: SECUREFAULTPENDED Mask */ + +#define SCB_SHCSR_SECUREFAULTENA_Pos 19U /*!< SCB SHCSR: SECUREFAULTENA Position */ +#define SCB_SHCSR_SECUREFAULTENA_Msk (1UL << SCB_SHCSR_SECUREFAULTENA_Pos) /*!< SCB SHCSR: SECUREFAULTENA Mask */ + +#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */ +#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ + +#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */ +#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ + +#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */ +#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */ +#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ + +#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */ +#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ + +#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */ +#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */ +#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_NMIACT_Pos 5U /*!< SCB SHCSR: NMIACT Position */ +#define SCB_SHCSR_NMIACT_Msk (1UL << SCB_SHCSR_NMIACT_Pos) /*!< SCB SHCSR: NMIACT Mask */ + +#define SCB_SHCSR_SECUREFAULTACT_Pos 4U /*!< SCB SHCSR: SECUREFAULTACT Position */ +#define SCB_SHCSR_SECUREFAULTACT_Msk (1UL << SCB_SHCSR_SECUREFAULTACT_Pos) /*!< SCB SHCSR: SECUREFAULTACT Mask */ + +#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */ +#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ + +#define SCB_SHCSR_HARDFAULTACT_Pos 2U /*!< SCB SHCSR: HARDFAULTACT Position */ +#define SCB_SHCSR_HARDFAULTACT_Msk (1UL << SCB_SHCSR_HARDFAULTACT_Pos) /*!< SCB SHCSR: HARDFAULTACT Mask */ + +#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */ +#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ + +#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */ +#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ + +/* SCB Configurable Fault Status Register Definitions */ +#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */ +#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ + +#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */ +#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ + +#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */ +#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ + +/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ + +#define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ +#define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ + +#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ + +#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ + +#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ + +#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ + +/* BusFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */ +#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */ + +#define SCB_CFSR_LSPERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 5U) /*!< SCB CFSR (BFSR): LSPERR Position */ +#define SCB_CFSR_LSPERR_Msk (1UL << SCB_CFSR_LSPERR_Pos) /*!< SCB CFSR (BFSR): LSPERR Mask */ + +#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */ +#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */ + +#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */ +#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */ + +#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */ +#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */ + +#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */ +#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */ + +#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */ +#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */ + +/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */ +#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */ + +#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */ +#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */ + +#define SCB_CFSR_STKOF_Pos (SCB_CFSR_USGFAULTSR_Pos + 4U) /*!< SCB CFSR (UFSR): STKOF Position */ +#define SCB_CFSR_STKOF_Msk (1UL << SCB_CFSR_STKOF_Pos) /*!< SCB CFSR (UFSR): STKOF Mask */ + +#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */ +#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */ + +#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */ +#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */ + +#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */ +#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */ + +#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */ +#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */ + +/* SCB Hard Fault Status Register Definitions */ +#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */ +#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ + +#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */ +#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ + +#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */ +#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ + +/* SCB Debug Fault Status Register Definitions */ +#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */ +#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ + +#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */ +#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ + +#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */ +#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ + +#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */ +#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ + +#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */ +#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ + +/* SCB Non-Secure Access Control Register Definitions */ +#define SCB_NSACR_CP11_Pos 11U /*!< SCB NSACR: CP11 Position */ +#define SCB_NSACR_CP11_Msk (1UL << SCB_NSACR_CP11_Pos) /*!< SCB NSACR: CP11 Mask */ + +#define SCB_NSACR_CP10_Pos 10U /*!< SCB NSACR: CP10 Position */ +#define SCB_NSACR_CP10_Msk (1UL << SCB_NSACR_CP10_Pos) /*!< SCB NSACR: CP10 Mask */ + +#define SCB_NSACR_CPn_Pos 0U /*!< SCB NSACR: CPn Position */ +#define SCB_NSACR_CPn_Msk (1UL /*<< SCB_NSACR_CPn_Pos*/) /*!< SCB NSACR: CPn Mask */ + +/* SCB Cache Level ID Register Definitions */ +#define SCB_CLIDR_LOUU_Pos 27U /*!< SCB CLIDR: LoUU Position */ +#define SCB_CLIDR_LOUU_Msk (7UL << SCB_CLIDR_LOUU_Pos) /*!< SCB CLIDR: LoUU Mask */ + +#define SCB_CLIDR_LOC_Pos 24U /*!< SCB CLIDR: LoC Position */ +#define SCB_CLIDR_LOC_Msk (7UL << SCB_CLIDR_LOC_Pos) /*!< SCB CLIDR: LoC Mask */ + +/* SCB Cache Type Register Definitions */ +#define SCB_CTR_FORMAT_Pos 29U /*!< SCB CTR: Format Position */ +#define SCB_CTR_FORMAT_Msk (7UL << SCB_CTR_FORMAT_Pos) /*!< SCB CTR: Format Mask */ + +#define SCB_CTR_CWG_Pos 24U /*!< SCB CTR: CWG Position */ +#define SCB_CTR_CWG_Msk (0xFUL << SCB_CTR_CWG_Pos) /*!< SCB CTR: CWG Mask */ + +#define SCB_CTR_ERG_Pos 20U /*!< SCB CTR: ERG Position */ +#define SCB_CTR_ERG_Msk (0xFUL << SCB_CTR_ERG_Pos) /*!< SCB CTR: ERG Mask */ + +#define SCB_CTR_DMINLINE_Pos 16U /*!< SCB CTR: DminLine Position */ +#define SCB_CTR_DMINLINE_Msk (0xFUL << SCB_CTR_DMINLINE_Pos) /*!< SCB CTR: DminLine Mask */ + +#define SCB_CTR_IMINLINE_Pos 0U /*!< SCB CTR: ImInLine Position */ +#define SCB_CTR_IMINLINE_Msk (0xFUL /*<< SCB_CTR_IMINLINE_Pos*/) /*!< SCB CTR: ImInLine Mask */ + +/* SCB Cache Size ID Register Definitions */ +#define SCB_CCSIDR_WT_Pos 31U /*!< SCB CCSIDR: WT Position */ +#define SCB_CCSIDR_WT_Msk (1UL << SCB_CCSIDR_WT_Pos) /*!< SCB CCSIDR: WT Mask */ + +#define SCB_CCSIDR_WB_Pos 30U /*!< SCB CCSIDR: WB Position */ +#define SCB_CCSIDR_WB_Msk (1UL << SCB_CCSIDR_WB_Pos) /*!< SCB CCSIDR: WB Mask */ + +#define SCB_CCSIDR_RA_Pos 29U /*!< SCB CCSIDR: RA Position */ +#define SCB_CCSIDR_RA_Msk (1UL << SCB_CCSIDR_RA_Pos) /*!< SCB CCSIDR: RA Mask */ + +#define SCB_CCSIDR_WA_Pos 28U /*!< SCB CCSIDR: WA Position */ +#define SCB_CCSIDR_WA_Msk (1UL << SCB_CCSIDR_WA_Pos) /*!< SCB CCSIDR: WA Mask */ + +#define SCB_CCSIDR_NUMSETS_Pos 13U /*!< SCB CCSIDR: NumSets Position */ +#define SCB_CCSIDR_NUMSETS_Msk (0x7FFFUL << SCB_CCSIDR_NUMSETS_Pos) /*!< SCB CCSIDR: NumSets Mask */ + +#define SCB_CCSIDR_ASSOCIATIVITY_Pos 3U /*!< SCB CCSIDR: Associativity Position */ +#define SCB_CCSIDR_ASSOCIATIVITY_Msk (0x3FFUL << SCB_CCSIDR_ASSOCIATIVITY_Pos) /*!< SCB CCSIDR: Associativity Mask */ + +#define SCB_CCSIDR_LINESIZE_Pos 0U /*!< SCB CCSIDR: LineSize Position */ +#define SCB_CCSIDR_LINESIZE_Msk (7UL /*<< SCB_CCSIDR_LINESIZE_Pos*/) /*!< SCB CCSIDR: LineSize Mask */ + +/* SCB Cache Size Selection Register Definitions */ +#define SCB_CSSELR_LEVEL_Pos 1U /*!< SCB CSSELR: Level Position */ +#define SCB_CSSELR_LEVEL_Msk (7UL << SCB_CSSELR_LEVEL_Pos) /*!< SCB CSSELR: Level Mask */ + +#define SCB_CSSELR_IND_Pos 0U /*!< SCB CSSELR: InD Position */ +#define SCB_CSSELR_IND_Msk (1UL /*<< SCB_CSSELR_IND_Pos*/) /*!< SCB CSSELR: InD Mask */ + +/* SCB Software Triggered Interrupt Register Definitions */ +#define SCB_STIR_INTID_Pos 0U /*!< SCB STIR: INTID Position */ +#define SCB_STIR_INTID_Msk (0x1FFUL /*<< SCB_STIR_INTID_Pos*/) /*!< SCB STIR: INTID Mask */ + +/* SCB D-Cache Invalidate by Set-way Register Definitions */ +#define SCB_DCISW_WAY_Pos 30U /*!< SCB DCISW: Way Position */ +#define SCB_DCISW_WAY_Msk (3UL << SCB_DCISW_WAY_Pos) /*!< SCB DCISW: Way Mask */ + +#define SCB_DCISW_SET_Pos 5U /*!< SCB DCISW: Set Position */ +#define SCB_DCISW_SET_Msk (0x1FFUL << SCB_DCISW_SET_Pos) /*!< SCB DCISW: Set Mask */ + +/* SCB D-Cache Clean by Set-way Register Definitions */ +#define SCB_DCCSW_WAY_Pos 30U /*!< SCB DCCSW: Way Position */ +#define SCB_DCCSW_WAY_Msk (3UL << SCB_DCCSW_WAY_Pos) /*!< SCB DCCSW: Way Mask */ + +#define SCB_DCCSW_SET_Pos 5U /*!< SCB DCCSW: Set Position */ +#define SCB_DCCSW_SET_Msk (0x1FFUL << SCB_DCCSW_SET_Pos) /*!< SCB DCCSW: Set Mask */ + +/* SCB D-Cache Clean and Invalidate by Set-way Register Definitions */ +#define SCB_DCCISW_WAY_Pos 30U /*!< SCB DCCISW: Way Position */ +#define SCB_DCCISW_WAY_Msk (3UL << SCB_DCCISW_WAY_Pos) /*!< SCB DCCISW: Way Mask */ + +#define SCB_DCCISW_SET_Pos 5U /*!< SCB DCCISW: Set Position */ +#define SCB_DCCISW_SET_Msk (0x1FFUL << SCB_DCCISW_SET_Pos) /*!< SCB DCCISW: Set Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** + \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ + __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ + __IOM uint32_t CPPWR; /*!< Offset: 0x00C (R/W) Coprocessor Power Control Register */ +} SCnSCB_Type; + +/* Interrupt Controller Type Register Definitions */ +#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ +#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_SCnotSCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) + \brief Type definitions for the Instrumentation Trace Macrocell (ITM) + @{ + */ + +/** + \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). + */ +typedef struct +{ + __OM union + { + __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ + __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ + __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ + } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ + uint32_t RESERVED0[864U]; + __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ + uint32_t RESERVED1[15U]; + __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ + uint32_t RESERVED2[15U]; + __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ + uint32_t RESERVED3[32U]; + uint32_t RESERVED4[43U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ + uint32_t RESERVED5[1U]; + __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) ITM Device Architecture Register */ + uint32_t RESERVED6[4U]; + __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ + __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ + __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ + __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ + __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ + __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ + __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ + __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ + __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ + __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ + __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ + __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ +} ITM_Type; + +/* ITM Stimulus Port Register Definitions */ +#define ITM_STIM_DISABLED_Pos 1U /*!< ITM STIM: DISABLED Position */ +#define ITM_STIM_DISABLED_Msk (0x1UL << ITM_STIM_DISABLED_Pos) /*!< ITM STIM: DISABLED Mask */ + +#define ITM_STIM_FIFOREADY_Pos 0U /*!< ITM STIM: FIFOREADY Position */ +#define ITM_STIM_FIFOREADY_Msk (0x1UL /*<< ITM_STIM_FIFOREADY_Pos*/) /*!< ITM STIM: FIFOREADY Mask */ + +/* ITM Trace Privilege Register Definitions */ +#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */ +#define ITM_TPR_PRIVMASK_Msk (0xFFFFFFFFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ + +/* ITM Trace Control Register Definitions */ +#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */ +#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ + +#define ITM_TCR_TRACEBUSID_Pos 16U /*!< ITM TCR: ATBID Position */ +#define ITM_TCR_TRACEBUSID_Msk (0x7FUL << ITM_TCR_TRACEBUSID_Pos) /*!< ITM TCR: ATBID Mask */ + +#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */ +#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ + +#define ITM_TCR_TSPRESCALE_Pos 8U /*!< ITM TCR: TSPRESCALE Position */ +#define ITM_TCR_TSPRESCALE_Msk (3UL << ITM_TCR_TSPRESCALE_Pos) /*!< ITM TCR: TSPRESCALE Mask */ + +#define ITM_TCR_STALLENA_Pos 5U /*!< ITM TCR: STALLENA Position */ +#define ITM_TCR_STALLENA_Msk (1UL << ITM_TCR_STALLENA_Pos) /*!< ITM TCR: STALLENA Mask */ + +#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */ +#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ + +#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */ +#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ + +#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */ +#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ + +#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */ +#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ + +#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ +#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ + +/* ITM Lock Status Register Definitions */ +#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */ +#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ + +#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */ +#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ + +#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ +#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ + +/*@}*/ /* end of group CMSIS_ITM */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ + __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ + __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ + __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ + __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ + __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + uint32_t RESERVED3[1U]; + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED4[1U]; + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + uint32_t RESERVED5[1U]; + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED6[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + uint32_t RESERVED7[1U]; + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ + uint32_t RESERVED8[1U]; + __IOM uint32_t COMP4; /*!< Offset: 0x060 (R/W) Comparator Register 4 */ + uint32_t RESERVED9[1U]; + __IOM uint32_t FUNCTION4; /*!< Offset: 0x068 (R/W) Function Register 4 */ + uint32_t RESERVED10[1U]; + __IOM uint32_t COMP5; /*!< Offset: 0x070 (R/W) Comparator Register 5 */ + uint32_t RESERVED11[1U]; + __IOM uint32_t FUNCTION5; /*!< Offset: 0x078 (R/W) Function Register 5 */ + uint32_t RESERVED12[1U]; + __IOM uint32_t COMP6; /*!< Offset: 0x080 (R/W) Comparator Register 6 */ + uint32_t RESERVED13[1U]; + __IOM uint32_t FUNCTION6; /*!< Offset: 0x088 (R/W) Function Register 6 */ + uint32_t RESERVED14[1U]; + __IOM uint32_t COMP7; /*!< Offset: 0x090 (R/W) Comparator Register 7 */ + uint32_t RESERVED15[1U]; + __IOM uint32_t FUNCTION7; /*!< Offset: 0x098 (R/W) Function Register 7 */ + uint32_t RESERVED16[1U]; + __IOM uint32_t COMP8; /*!< Offset: 0x0A0 (R/W) Comparator Register 8 */ + uint32_t RESERVED17[1U]; + __IOM uint32_t FUNCTION8; /*!< Offset: 0x0A8 (R/W) Function Register 8 */ + uint32_t RESERVED18[1U]; + __IOM uint32_t COMP9; /*!< Offset: 0x0B0 (R/W) Comparator Register 9 */ + uint32_t RESERVED19[1U]; + __IOM uint32_t FUNCTION9; /*!< Offset: 0x0B8 (R/W) Function Register 9 */ + uint32_t RESERVED20[1U]; + __IOM uint32_t COMP10; /*!< Offset: 0x0C0 (R/W) Comparator Register 10 */ + uint32_t RESERVED21[1U]; + __IOM uint32_t FUNCTION10; /*!< Offset: 0x0C8 (R/W) Function Register 10 */ + uint32_t RESERVED22[1U]; + __IOM uint32_t COMP11; /*!< Offset: 0x0D0 (R/W) Comparator Register 11 */ + uint32_t RESERVED23[1U]; + __IOM uint32_t FUNCTION11; /*!< Offset: 0x0D8 (R/W) Function Register 11 */ + uint32_t RESERVED24[1U]; + __IOM uint32_t COMP12; /*!< Offset: 0x0E0 (R/W) Comparator Register 12 */ + uint32_t RESERVED25[1U]; + __IOM uint32_t FUNCTION12; /*!< Offset: 0x0E8 (R/W) Function Register 12 */ + uint32_t RESERVED26[1U]; + __IOM uint32_t COMP13; /*!< Offset: 0x0F0 (R/W) Comparator Register 13 */ + uint32_t RESERVED27[1U]; + __IOM uint32_t FUNCTION13; /*!< Offset: 0x0F8 (R/W) Function Register 13 */ + uint32_t RESERVED28[1U]; + __IOM uint32_t COMP14; /*!< Offset: 0x100 (R/W) Comparator Register 14 */ + uint32_t RESERVED29[1U]; + __IOM uint32_t FUNCTION14; /*!< Offset: 0x108 (R/W) Function Register 14 */ + uint32_t RESERVED30[1U]; + __IOM uint32_t COMP15; /*!< Offset: 0x110 (R/W) Comparator Register 15 */ + uint32_t RESERVED31[1U]; + __IOM uint32_t FUNCTION15; /*!< Offset: 0x118 (R/W) Function Register 15 */ + uint32_t RESERVED32[934U]; + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R ) Lock Status Register */ + uint32_t RESERVED33[1U]; + __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) Device Architecture Register */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +#define DWT_CTRL_CYCDISS_Pos 23U /*!< DWT CTRL: CYCDISS Position */ +#define DWT_CTRL_CYCDISS_Msk (0x1UL << DWT_CTRL_CYCDISS_Pos) /*!< DWT CTRL: CYCDISS Mask */ + +#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */ +#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ + +#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */ +#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ + +#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */ +#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ + +#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */ +#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ + +#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */ +#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ + +#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */ +#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ + +#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */ +#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ + +#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */ +#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ + +#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */ +#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ + +#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */ +#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ + +#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */ +#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ + +#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */ +#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ + +#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */ +#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ + +/* DWT CPI Count Register Definitions */ +#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */ +#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ + +/* DWT Exception Overhead Count Register Definitions */ +#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */ +#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ + +/* DWT Sleep Count Register Definitions */ +#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */ +#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ + +/* DWT LSU Count Register Definitions */ +#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */ +#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ + +/* DWT Folded-instruction Count Register Definitions */ +#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */ +#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_ID_Pos 27U /*!< DWT FUNCTION: ID Position */ +#define DWT_FUNCTION_ID_Msk (0x1FUL << DWT_FUNCTION_ID_Pos) /*!< DWT FUNCTION: ID Mask */ + +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_ACTION_Pos 4U /*!< DWT FUNCTION: ACTION Position */ +#define DWT_FUNCTION_ACTION_Msk (0x1UL << DWT_FUNCTION_ACTION_Pos) /*!< DWT FUNCTION: ACTION Mask */ + +#define DWT_FUNCTION_MATCH_Pos 0U /*!< DWT FUNCTION: MATCH Position */ +#define DWT_FUNCTION_MATCH_Msk (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/) /*!< DWT FUNCTION: MATCH Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IOM uint32_t PSCR; /*!< Offset: 0x308 (R/W) Periodic Synchronization Control Register */ + uint32_t RESERVED3[759U]; + __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER Register */ + __IM uint32_t ITFTTD0; /*!< Offset: 0xEEC (R/ ) Integration Test FIFO Test Data 0 Register */ + __IOM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/W) Integration Test ATB Control Register 2 */ + uint32_t RESERVED4[1U]; + __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) Integration Test ATB Control Register 0 */ + __IM uint32_t ITFTTD1; /*!< Offset: 0xEFC (R/ ) Integration Test FIFO Test Data 1 Register */ + __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ + uint32_t RESERVED5[39U]; + __IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ + __IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ + uint32_t RESERVED7[8U]; + __IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) Device Configuration Register */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) Device Type Identifier Register */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */ +#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_FOnMan_Pos 6U /*!< TPI FFCR: FOnMan Position */ +#define TPI_FFCR_FOnMan_Msk (0x1UL << TPI_FFCR_FOnMan_Pos) /*!< TPI FFCR: FOnMan Mask */ + +#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI TRIGGER Register Definitions */ +#define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */ +#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ + +/* TPI Integration Test FIFO Test Data 0 Register Definitions */ +#define TPI_ITFTTD0_ATB_IF2_ATVALID_Pos 29U /*!< TPI ITFTTD0: ATB Interface 2 ATVALIDPosition */ +#define TPI_ITFTTD0_ATB_IF2_ATVALID_Msk (0x3UL << TPI_ITFTTD0_ATB_IF2_ATVALID_Pos) /*!< TPI ITFTTD0: ATB Interface 2 ATVALID Mask */ + +#define TPI_ITFTTD0_ATB_IF2_bytecount_Pos 27U /*!< TPI ITFTTD0: ATB Interface 2 byte count Position */ +#define TPI_ITFTTD0_ATB_IF2_bytecount_Msk (0x3UL << TPI_ITFTTD0_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 2 byte count Mask */ + +#define TPI_ITFTTD0_ATB_IF1_ATVALID_Pos 26U /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Position */ +#define TPI_ITFTTD0_ATB_IF1_ATVALID_Msk (0x3UL << TPI_ITFTTD0_ATB_IF1_ATVALID_Pos) /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Mask */ + +#define TPI_ITFTTD0_ATB_IF1_bytecount_Pos 24U /*!< TPI ITFTTD0: ATB Interface 1 byte count Position */ +#define TPI_ITFTTD0_ATB_IF1_bytecount_Msk (0x3UL << TPI_ITFTTD0_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 1 byte countt Mask */ + +#define TPI_ITFTTD0_ATB_IF1_data2_Pos 16U /*!< TPI ITFTTD0: ATB Interface 1 data2 Position */ +#define TPI_ITFTTD0_ATB_IF1_data2_Msk (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos) /*!< TPI ITFTTD0: ATB Interface 1 data2 Mask */ + +#define TPI_ITFTTD0_ATB_IF1_data1_Pos 8U /*!< TPI ITFTTD0: ATB Interface 1 data1 Position */ +#define TPI_ITFTTD0_ATB_IF1_data1_Msk (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos) /*!< TPI ITFTTD0: ATB Interface 1 data1 Mask */ + +#define TPI_ITFTTD0_ATB_IF1_data0_Pos 0U /*!< TPI ITFTTD0: ATB Interface 1 data0 Position */ +#define TPI_ITFTTD0_ATB_IF1_data0_Msk (0xFFUL /*<< TPI_ITFTTD0_ATB_IF1_data0_Pos*/) /*!< TPI ITFTTD0: ATB Interface 1 data0 Mask */ + +/* TPI Integration Test ATB Control Register 2 Register Definitions */ +#define TPI_ITATBCTR2_AFVALID2S_Pos 1U /*!< TPI ITATBCTR2: AFVALID2S Position */ +#define TPI_ITATBCTR2_AFVALID2S_Msk (0x1UL << TPI_ITATBCTR2_AFVALID2S_Pos) /*!< TPI ITATBCTR2: AFVALID2SS Mask */ + +#define TPI_ITATBCTR2_AFVALID1S_Pos 1U /*!< TPI ITATBCTR2: AFVALID1S Position */ +#define TPI_ITATBCTR2_AFVALID1S_Msk (0x1UL << TPI_ITATBCTR2_AFVALID1S_Pos) /*!< TPI ITATBCTR2: AFVALID1SS Mask */ + +#define TPI_ITATBCTR2_ATREADY2S_Pos 0U /*!< TPI ITATBCTR2: ATREADY2S Position */ +#define TPI_ITATBCTR2_ATREADY2S_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY2S_Pos*/) /*!< TPI ITATBCTR2: ATREADY2S Mask */ + +#define TPI_ITATBCTR2_ATREADY1S_Pos 0U /*!< TPI ITATBCTR2: ATREADY1S Position */ +#define TPI_ITATBCTR2_ATREADY1S_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY1S_Pos*/) /*!< TPI ITATBCTR2: ATREADY1S Mask */ + +/* TPI Integration Test FIFO Test Data 1 Register Definitions */ +#define TPI_ITFTTD1_ATB_IF2_ATVALID_Pos 29U /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Position */ +#define TPI_ITFTTD1_ATB_IF2_ATVALID_Msk (0x3UL << TPI_ITFTTD1_ATB_IF2_ATVALID_Pos) /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Mask */ + +#define TPI_ITFTTD1_ATB_IF2_bytecount_Pos 27U /*!< TPI ITFTTD1: ATB Interface 2 byte count Position */ +#define TPI_ITFTTD1_ATB_IF2_bytecount_Msk (0x3UL << TPI_ITFTTD1_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 2 byte count Mask */ + +#define TPI_ITFTTD1_ATB_IF1_ATVALID_Pos 26U /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Position */ +#define TPI_ITFTTD1_ATB_IF1_ATVALID_Msk (0x3UL << TPI_ITFTTD1_ATB_IF1_ATVALID_Pos) /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Mask */ + +#define TPI_ITFTTD1_ATB_IF1_bytecount_Pos 24U /*!< TPI ITFTTD1: ATB Interface 1 byte count Position */ +#define TPI_ITFTTD1_ATB_IF1_bytecount_Msk (0x3UL << TPI_ITFTTD1_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 1 byte countt Mask */ + +#define TPI_ITFTTD1_ATB_IF2_data2_Pos 16U /*!< TPI ITFTTD1: ATB Interface 2 data2 Position */ +#define TPI_ITFTTD1_ATB_IF2_data2_Msk (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos) /*!< TPI ITFTTD1: ATB Interface 2 data2 Mask */ + +#define TPI_ITFTTD1_ATB_IF2_data1_Pos 8U /*!< TPI ITFTTD1: ATB Interface 2 data1 Position */ +#define TPI_ITFTTD1_ATB_IF2_data1_Msk (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos) /*!< TPI ITFTTD1: ATB Interface 2 data1 Mask */ + +#define TPI_ITFTTD1_ATB_IF2_data0_Pos 0U /*!< TPI ITFTTD1: ATB Interface 2 data0 Position */ +#define TPI_ITFTTD1_ATB_IF2_data0_Msk (0xFFUL /*<< TPI_ITFTTD1_ATB_IF2_data0_Pos*/) /*!< TPI ITFTTD1: ATB Interface 2 data0 Mask */ + +/* TPI Integration Test ATB Control Register 0 Definitions */ +#define TPI_ITATBCTR0_AFVALID2S_Pos 1U /*!< TPI ITATBCTR0: AFVALID2S Position */ +#define TPI_ITATBCTR0_AFVALID2S_Msk (0x1UL << TPI_ITATBCTR0_AFVALID2S_Pos) /*!< TPI ITATBCTR0: AFVALID2SS Mask */ + +#define TPI_ITATBCTR0_AFVALID1S_Pos 1U /*!< TPI ITATBCTR0: AFVALID1S Position */ +#define TPI_ITATBCTR0_AFVALID1S_Msk (0x1UL << TPI_ITATBCTR0_AFVALID1S_Pos) /*!< TPI ITATBCTR0: AFVALID1SS Mask */ + +#define TPI_ITATBCTR0_ATREADY2S_Pos 0U /*!< TPI ITATBCTR0: ATREADY2S Position */ +#define TPI_ITATBCTR0_ATREADY2S_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY2S_Pos*/) /*!< TPI ITATBCTR0: ATREADY2S Mask */ + +#define TPI_ITATBCTR0_ATREADY1S_Pos 0U /*!< TPI ITATBCTR0: ATREADY1S Position */ +#define TPI_ITATBCTR0_ATREADY1S_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY1S_Pos*/) /*!< TPI ITATBCTR0: ATREADY1S Mask */ + +/* TPI Integration Mode Control Register Definitions */ +#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */ +#define TPI_ITCTRL_Mode_Msk (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_FIFOSZ_Pos 6U /*!< TPI DEVID: FIFOSZ Position */ +#define TPI_DEVID_FIFOSZ_Msk (0x7UL << TPI_DEVID_FIFOSZ_Pos) /*!< TPI DEVID: FIFOSZ Mask */ + +#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */ +#define TPI_DEVID_NrTraceInput_Msk (0x3FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) MPU Region Limit Address Register */ + __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Region Base Address Register Alias 1 */ + __IOM uint32_t RLAR_A1; /*!< Offset: 0x018 (R/W) MPU Region Limit Address Register Alias 1 */ + __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Region Base Address Register Alias 2 */ + __IOM uint32_t RLAR_A2; /*!< Offset: 0x020 (R/W) MPU Region Limit Address Register Alias 2 */ + __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Region Base Address Register Alias 3 */ + __IOM uint32_t RLAR_A3; /*!< Offset: 0x028 (R/W) MPU Region Limit Address Register Alias 3 */ + uint32_t RESERVED0[1]; + union { + __IOM uint32_t MAIR[2]; + struct { + __IOM uint32_t MAIR0; /*!< Offset: 0x030 (R/W) MPU Memory Attribute Indirection Register 0 */ + __IOM uint32_t MAIR1; /*!< Offset: 0x034 (R/W) MPU Memory Attribute Indirection Register 1 */ + }; + }; +} MPU_Type; + +#define MPU_TYPE_RALIASES 4U + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_BASE_Pos 5U /*!< MPU RBAR: BASE Position */ +#define MPU_RBAR_BASE_Msk (0x7FFFFFFUL << MPU_RBAR_BASE_Pos) /*!< MPU RBAR: BASE Mask */ + +#define MPU_RBAR_SH_Pos 3U /*!< MPU RBAR: SH Position */ +#define MPU_RBAR_SH_Msk (0x3UL << MPU_RBAR_SH_Pos) /*!< MPU RBAR: SH Mask */ + +#define MPU_RBAR_AP_Pos 1U /*!< MPU RBAR: AP Position */ +#define MPU_RBAR_AP_Msk (0x3UL << MPU_RBAR_AP_Pos) /*!< MPU RBAR: AP Mask */ + +#define MPU_RBAR_XN_Pos 0U /*!< MPU RBAR: XN Position */ +#define MPU_RBAR_XN_Msk (01UL /*<< MPU_RBAR_XN_Pos*/) /*!< MPU RBAR: XN Mask */ + +/* MPU Region Limit Address Register Definitions */ +#define MPU_RLAR_LIMIT_Pos 5U /*!< MPU RLAR: LIMIT Position */ +#define MPU_RLAR_LIMIT_Msk (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos) /*!< MPU RLAR: LIMIT Mask */ + +#define MPU_RLAR_AttrIndx_Pos 1U /*!< MPU RLAR: AttrIndx Position */ +#define MPU_RLAR_AttrIndx_Msk (0x7UL << MPU_RLAR_AttrIndx_Pos) /*!< MPU RLAR: AttrIndx Mask */ + +#define MPU_RLAR_EN_Pos 0U /*!< MPU RLAR: Region enable bit Position */ +#define MPU_RLAR_EN_Msk (1UL /*<< MPU_RLAR_EN_Pos*/) /*!< MPU RLAR: Region enable bit Disable Mask */ + +/* MPU Memory Attribute Indirection Register 0 Definitions */ +#define MPU_MAIR0_Attr3_Pos 24U /*!< MPU MAIR0: Attr3 Position */ +#define MPU_MAIR0_Attr3_Msk (0xFFUL << MPU_MAIR0_Attr3_Pos) /*!< MPU MAIR0: Attr3 Mask */ + +#define MPU_MAIR0_Attr2_Pos 16U /*!< MPU MAIR0: Attr2 Position */ +#define MPU_MAIR0_Attr2_Msk (0xFFUL << MPU_MAIR0_Attr2_Pos) /*!< MPU MAIR0: Attr2 Mask */ + +#define MPU_MAIR0_Attr1_Pos 8U /*!< MPU MAIR0: Attr1 Position */ +#define MPU_MAIR0_Attr1_Msk (0xFFUL << MPU_MAIR0_Attr1_Pos) /*!< MPU MAIR0: Attr1 Mask */ + +#define MPU_MAIR0_Attr0_Pos 0U /*!< MPU MAIR0: Attr0 Position */ +#define MPU_MAIR0_Attr0_Msk (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/) /*!< MPU MAIR0: Attr0 Mask */ + +/* MPU Memory Attribute Indirection Register 1 Definitions */ +#define MPU_MAIR1_Attr7_Pos 24U /*!< MPU MAIR1: Attr7 Position */ +#define MPU_MAIR1_Attr7_Msk (0xFFUL << MPU_MAIR1_Attr7_Pos) /*!< MPU MAIR1: Attr7 Mask */ + +#define MPU_MAIR1_Attr6_Pos 16U /*!< MPU MAIR1: Attr6 Position */ +#define MPU_MAIR1_Attr6_Msk (0xFFUL << MPU_MAIR1_Attr6_Pos) /*!< MPU MAIR1: Attr6 Mask */ + +#define MPU_MAIR1_Attr5_Pos 8U /*!< MPU MAIR1: Attr5 Position */ +#define MPU_MAIR1_Attr5_Msk (0xFFUL << MPU_MAIR1_Attr5_Pos) /*!< MPU MAIR1: Attr5 Mask */ + +#define MPU_MAIR1_Attr4_Pos 0U /*!< MPU MAIR1: Attr4 Position */ +#define MPU_MAIR1_Attr4_Msk (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/) /*!< MPU MAIR1: Attr4 Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SAU Security Attribution Unit (SAU) + \brief Type definitions for the Security Attribution Unit (SAU) + @{ + */ + +/** + \brief Structure type to access the Security Attribution Unit (SAU). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SAU Control Register */ + __IM uint32_t TYPE; /*!< Offset: 0x004 (R/ ) SAU Type Register */ +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) SAU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) SAU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) SAU Region Limit Address Register */ +#else + uint32_t RESERVED0[3]; +#endif + __IOM uint32_t SFSR; /*!< Offset: 0x014 (R/W) Secure Fault Status Register */ + __IOM uint32_t SFAR; /*!< Offset: 0x018 (R/W) Secure Fault Address Register */ +} SAU_Type; + +/* SAU Control Register Definitions */ +#define SAU_CTRL_ALLNS_Pos 1U /*!< SAU CTRL: ALLNS Position */ +#define SAU_CTRL_ALLNS_Msk (1UL << SAU_CTRL_ALLNS_Pos) /*!< SAU CTRL: ALLNS Mask */ + +#define SAU_CTRL_ENABLE_Pos 0U /*!< SAU CTRL: ENABLE Position */ +#define SAU_CTRL_ENABLE_Msk (1UL /*<< SAU_CTRL_ENABLE_Pos*/) /*!< SAU CTRL: ENABLE Mask */ + +/* SAU Type Register Definitions */ +#define SAU_TYPE_SREGION_Pos 0U /*!< SAU TYPE: SREGION Position */ +#define SAU_TYPE_SREGION_Msk (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/) /*!< SAU TYPE: SREGION Mask */ + +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) +/* SAU Region Number Register Definitions */ +#define SAU_RNR_REGION_Pos 0U /*!< SAU RNR: REGION Position */ +#define SAU_RNR_REGION_Msk (0xFFUL /*<< SAU_RNR_REGION_Pos*/) /*!< SAU RNR: REGION Mask */ + +/* SAU Region Base Address Register Definitions */ +#define SAU_RBAR_BADDR_Pos 5U /*!< SAU RBAR: BADDR Position */ +#define SAU_RBAR_BADDR_Msk (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos) /*!< SAU RBAR: BADDR Mask */ + +/* SAU Region Limit Address Register Definitions */ +#define SAU_RLAR_LADDR_Pos 5U /*!< SAU RLAR: LADDR Position */ +#define SAU_RLAR_LADDR_Msk (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos) /*!< SAU RLAR: LADDR Mask */ + +#define SAU_RLAR_NSC_Pos 1U /*!< SAU RLAR: NSC Position */ +#define SAU_RLAR_NSC_Msk (1UL << SAU_RLAR_NSC_Pos) /*!< SAU RLAR: NSC Mask */ + +#define SAU_RLAR_ENABLE_Pos 0U /*!< SAU RLAR: ENABLE Position */ +#define SAU_RLAR_ENABLE_Msk (1UL /*<< SAU_RLAR_ENABLE_Pos*/) /*!< SAU RLAR: ENABLE Mask */ + +#endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */ + +/* Secure Fault Status Register Definitions */ +#define SAU_SFSR_LSERR_Pos 7U /*!< SAU SFSR: LSERR Position */ +#define SAU_SFSR_LSERR_Msk (1UL << SAU_SFSR_LSERR_Pos) /*!< SAU SFSR: LSERR Mask */ + +#define SAU_SFSR_SFARVALID_Pos 6U /*!< SAU SFSR: SFARVALID Position */ +#define SAU_SFSR_SFARVALID_Msk (1UL << SAU_SFSR_SFARVALID_Pos) /*!< SAU SFSR: SFARVALID Mask */ + +#define SAU_SFSR_LSPERR_Pos 5U /*!< SAU SFSR: LSPERR Position */ +#define SAU_SFSR_LSPERR_Msk (1UL << SAU_SFSR_LSPERR_Pos) /*!< SAU SFSR: LSPERR Mask */ + +#define SAU_SFSR_INVTRAN_Pos 4U /*!< SAU SFSR: INVTRAN Position */ +#define SAU_SFSR_INVTRAN_Msk (1UL << SAU_SFSR_INVTRAN_Pos) /*!< SAU SFSR: INVTRAN Mask */ + +#define SAU_SFSR_AUVIOL_Pos 3U /*!< SAU SFSR: AUVIOL Position */ +#define SAU_SFSR_AUVIOL_Msk (1UL << SAU_SFSR_AUVIOL_Pos) /*!< SAU SFSR: AUVIOL Mask */ + +#define SAU_SFSR_INVER_Pos 2U /*!< SAU SFSR: INVER Position */ +#define SAU_SFSR_INVER_Msk (1UL << SAU_SFSR_INVER_Pos) /*!< SAU SFSR: INVER Mask */ + +#define SAU_SFSR_INVIS_Pos 1U /*!< SAU SFSR: INVIS Position */ +#define SAU_SFSR_INVIS_Msk (1UL << SAU_SFSR_INVIS_Pos) /*!< SAU SFSR: INVIS Mask */ + +#define SAU_SFSR_INVEP_Pos 0U /*!< SAU SFSR: INVEP Position */ +#define SAU_SFSR_INVEP_Msk (1UL /*<< SAU_SFSR_INVEP_Pos*/) /*!< SAU SFSR: INVEP Mask */ + +/*@} end of group CMSIS_SAU */ +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_FPU Floating Point Unit (FPU) + \brief Type definitions for the Floating Point Unit (FPU) + @{ + */ + +/** + \brief Structure type to access the Floating Point Unit (FPU). + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IOM uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */ + __IOM uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */ + __IOM uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */ + __IM uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and FP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and FP Feature Register 1 */ +} FPU_Type; + +/* Floating-Point Context Control Register Definitions */ +#define FPU_FPCCR_ASPEN_Pos 31U /*!< FPCCR: ASPEN bit Position */ +#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */ + +#define FPU_FPCCR_LSPEN_Pos 30U /*!< FPCCR: LSPEN Position */ +#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */ + +#define FPU_FPCCR_LSPENS_Pos 29U /*!< FPCCR: LSPENS Position */ +#define FPU_FPCCR_LSPENS_Msk (1UL << FPU_FPCCR_LSPENS_Pos) /*!< FPCCR: LSPENS bit Mask */ + +#define FPU_FPCCR_CLRONRET_Pos 28U /*!< FPCCR: CLRONRET Position */ +#define FPU_FPCCR_CLRONRET_Msk (1UL << FPU_FPCCR_CLRONRET_Pos) /*!< FPCCR: CLRONRET bit Mask */ + +#define FPU_FPCCR_CLRONRETS_Pos 27U /*!< FPCCR: CLRONRETS Position */ +#define FPU_FPCCR_CLRONRETS_Msk (1UL << FPU_FPCCR_CLRONRETS_Pos) /*!< FPCCR: CLRONRETS bit Mask */ + +#define FPU_FPCCR_TS_Pos 26U /*!< FPCCR: TS Position */ +#define FPU_FPCCR_TS_Msk (1UL << FPU_FPCCR_TS_Pos) /*!< FPCCR: TS bit Mask */ + +#define FPU_FPCCR_UFRDY_Pos 10U /*!< FPCCR: UFRDY Position */ +#define FPU_FPCCR_UFRDY_Msk (1UL << FPU_FPCCR_UFRDY_Pos) /*!< FPCCR: UFRDY bit Mask */ + +#define FPU_FPCCR_SPLIMVIOL_Pos 9U /*!< FPCCR: SPLIMVIOL Position */ +#define FPU_FPCCR_SPLIMVIOL_Msk (1UL << FPU_FPCCR_SPLIMVIOL_Pos) /*!< FPCCR: SPLIMVIOL bit Mask */ + +#define FPU_FPCCR_MONRDY_Pos 8U /*!< FPCCR: MONRDY Position */ +#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */ + +#define FPU_FPCCR_SFRDY_Pos 7U /*!< FPCCR: SFRDY Position */ +#define FPU_FPCCR_SFRDY_Msk (1UL << FPU_FPCCR_SFRDY_Pos) /*!< FPCCR: SFRDY bit Mask */ + +#define FPU_FPCCR_BFRDY_Pos 6U /*!< FPCCR: BFRDY Position */ +#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */ + +#define FPU_FPCCR_MMRDY_Pos 5U /*!< FPCCR: MMRDY Position */ +#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */ + +#define FPU_FPCCR_HFRDY_Pos 4U /*!< FPCCR: HFRDY Position */ +#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */ + +#define FPU_FPCCR_THREAD_Pos 3U /*!< FPCCR: processor mode bit Position */ +#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */ + +#define FPU_FPCCR_S_Pos 2U /*!< FPCCR: Security status of the FP context bit Position */ +#define FPU_FPCCR_S_Msk (1UL << FPU_FPCCR_S_Pos) /*!< FPCCR: Security status of the FP context bit Mask */ + +#define FPU_FPCCR_USER_Pos 1U /*!< FPCCR: privilege level bit Position */ +#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */ + +#define FPU_FPCCR_LSPACT_Pos 0U /*!< FPCCR: Lazy state preservation active bit Position */ +#define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/) /*!< FPCCR: Lazy state preservation active bit Mask */ + +/* Floating-Point Context Address Register Definitions */ +#define FPU_FPCAR_ADDRESS_Pos 3U /*!< FPCAR: ADDRESS bit Position */ +#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */ + +/* Floating-Point Default Status Control Register Definitions */ +#define FPU_FPDSCR_AHP_Pos 26U /*!< FPDSCR: AHP bit Position */ +#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */ + +#define FPU_FPDSCR_DN_Pos 25U /*!< FPDSCR: DN bit Position */ +#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */ + +#define FPU_FPDSCR_FZ_Pos 24U /*!< FPDSCR: FZ bit Position */ +#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */ + +#define FPU_FPDSCR_RMode_Pos 22U /*!< FPDSCR: RMode bit Position */ +#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */ + +/* Media and FP Feature Register 0 Definitions */ +#define FPU_MVFR0_FP_rounding_modes_Pos 28U /*!< MVFR0: FP rounding modes bits Position */ +#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */ + +#define FPU_MVFR0_Short_vectors_Pos 24U /*!< MVFR0: Short vectors bits Position */ +#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */ + +#define FPU_MVFR0_Square_root_Pos 20U /*!< MVFR0: Square root bits Position */ +#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */ + +#define FPU_MVFR0_Divide_Pos 16U /*!< MVFR0: Divide bits Position */ +#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */ + +#define FPU_MVFR0_FP_excep_trapping_Pos 12U /*!< MVFR0: FP exception trapping bits Position */ +#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */ + +#define FPU_MVFR0_Double_precision_Pos 8U /*!< MVFR0: Double-precision bits Position */ +#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */ + +#define FPU_MVFR0_Single_precision_Pos 4U /*!< MVFR0: Single-precision bits Position */ +#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */ + +#define FPU_MVFR0_A_SIMD_registers_Pos 0U /*!< MVFR0: A_SIMD registers bits Position */ +#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/) /*!< MVFR0: A_SIMD registers bits Mask */ + +/* Media and FP Feature Register 1 Definitions */ +#define FPU_MVFR1_FP_fused_MAC_Pos 28U /*!< MVFR1: FP fused MAC bits Position */ +#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */ + +#define FPU_MVFR1_FP_HPFP_Pos 24U /*!< MVFR1: FP HPFP bits Position */ +#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */ + +#define FPU_MVFR1_D_NaN_mode_Pos 4U /*!< MVFR1: D_NaN mode bits Position */ +#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */ + +#define FPU_MVFR1_FtZ_mode_Pos 0U /*!< MVFR1: FtZ mode bits Position */ +#define FPU_MVFR1_FtZ_mode_Msk (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/) /*!< MVFR1: FtZ mode bits Mask */ + +/*@} end of group CMSIS_FPU */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** + \brief Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ + uint32_t RESERVED4[1U]; + __IOM uint32_t DAUTHCTRL; /*!< Offset: 0x014 (R/W) Debug Authentication Control Register */ + __IOM uint32_t DSCSR; /*!< Offset: 0x018 (R/W) Debug Security Control and Status Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register Definitions */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESTART_ST_Pos 26U /*!< CoreDebug DHCSR: S_RESTART_ST Position */ +#define CoreDebug_DHCSR_S_RESTART_ST_Msk (1UL << CoreDebug_DHCSR_S_RESTART_ST_Pos) /*!< CoreDebug DHCSR: S_RESTART_ST Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ +#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register Definitions */ +#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register Definitions */ +#define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< CoreDebug DEMCR: TRCENA Position */ +#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ + +#define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< CoreDebug DEMCR: MON_REQ Position */ +#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ + +#define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< CoreDebug DEMCR: MON_STEP Position */ +#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ + +#define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< CoreDebug DEMCR: MON_PEND Position */ +#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ + +#define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< CoreDebug DEMCR: MON_EN Position */ +#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< CoreDebug DEMCR: VC_INTERR Position */ +#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ + +#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< CoreDebug DEMCR: VC_BUSERR Position */ +#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ + +#define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< CoreDebug DEMCR: VC_STATERR Position */ +#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ + +#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< CoreDebug DEMCR: VC_CHKERR Position */ +#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ + +#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< CoreDebug DEMCR: VC_NOCPERR Position */ +#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ + +#define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< CoreDebug DEMCR: VC_MMERR Position */ +#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ + +/* Debug Authentication Control Register Definitions */ +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos 3U /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Position */ +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Mask */ + +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos 2U /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Msk (1UL << CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos) /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Mask */ + +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Pos 1U /*!< CoreDebug DAUTHCTRL: INTSPIDEN Position */ +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPIDEN Mask */ + +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Pos 0U /*!< CoreDebug DAUTHCTRL: SPIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Msk (1UL /*<< CoreDebug_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< CoreDebug DAUTHCTRL: SPIDENSEL Mask */ + +/* Debug Security Control and Status Register Definitions */ +#define CoreDebug_DSCSR_CDS_Pos 16U /*!< CoreDebug DSCSR: CDS Position */ +#define CoreDebug_DSCSR_CDS_Msk (1UL << CoreDebug_DSCSR_CDS_Pos) /*!< CoreDebug DSCSR: CDS Mask */ + +#define CoreDebug_DSCSR_SBRSEL_Pos 1U /*!< CoreDebug DSCSR: SBRSEL Position */ +#define CoreDebug_DSCSR_SBRSEL_Msk (1UL << CoreDebug_DSCSR_SBRSEL_Pos) /*!< CoreDebug DSCSR: SBRSEL Mask */ + +#define CoreDebug_DSCSR_SBRSELEN_Pos 0U /*!< CoreDebug DSCSR: SBRSELEN Position */ +#define CoreDebug_DSCSR_SBRSELEN_Msk (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/) /*!< CoreDebug DSCSR: SBRSELEN Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ + #define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ + #define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ + #define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ + #define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ + #define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ + #define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ + #define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ + #define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + + #define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ + #define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ + #define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ + #define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ + #define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ + #define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ + #define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ + #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE ) /*!< Core Debug configuration struct */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ + #endif + + #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SAU_BASE (SCS_BASE + 0x0DD0UL) /*!< Security Attribution Unit */ + #define SAU ((SAU_Type *) SAU_BASE ) /*!< Security Attribution Unit */ + #endif + + #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ + #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */ + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SCS_BASE_NS (0xE002E000UL) /*!< System Control Space Base Address (non-secure address space) */ + #define CoreDebug_BASE_NS (0xE002EDF0UL) /*!< Core Debug Base Address (non-secure address space) */ + #define SysTick_BASE_NS (SCS_BASE_NS + 0x0010UL) /*!< SysTick Base Address (non-secure address space) */ + #define NVIC_BASE_NS (SCS_BASE_NS + 0x0100UL) /*!< NVIC Base Address (non-secure address space) */ + #define SCB_BASE_NS (SCS_BASE_NS + 0x0D00UL) /*!< System Control Block Base Address (non-secure address space) */ + + #define SCnSCB_NS ((SCnSCB_Type *) SCS_BASE_NS ) /*!< System control Register not in SCB(non-secure address space) */ + #define SCB_NS ((SCB_Type *) SCB_BASE_NS ) /*!< SCB configuration struct (non-secure address space) */ + #define SysTick_NS ((SysTick_Type *) SysTick_BASE_NS ) /*!< SysTick configuration struct (non-secure address space) */ + #define NVIC_NS ((NVIC_Type *) NVIC_BASE_NS ) /*!< NVIC configuration struct (non-secure address space) */ + #define CoreDebug_NS ((CoreDebug_Type *) CoreDebug_BASE_NS) /*!< Core Debug configuration struct (non-secure address space) */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE_NS (SCS_BASE_NS + 0x0D90UL) /*!< Memory Protection Unit (non-secure address space) */ + #define MPU_NS ((MPU_Type *) MPU_BASE_NS ) /*!< Memory Protection Unit (non-secure address space) */ + #endif + + #define FPU_BASE_NS (SCS_BASE_NS + 0x0F30UL) /*!< Floating Point Unit (non-secure address space) */ + #define FPU_NS ((FPU_Type *) FPU_BASE_NS ) /*!< Floating Point Unit (non-secure address space) */ + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Debug Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ + #define NVIC_GetActive __NVIC_GetActive + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* Special LR values for Secure/Non-Secure call handling and exception handling */ + +/* Function Return Payload (from ARMv8-M Architecture Reference Manual) LR value on entry from Secure BLXNS */ +#define FNC_RETURN (0xFEFFFFFFUL) /* bit [0] ignored when processing a branch */ + +/* The following EXC_RETURN mask values are used to evaluate the LR on exception entry */ +#define EXC_RETURN_PREFIX (0xFF000000UL) /* bits [31:24] set to indicate an EXC_RETURN value */ +#define EXC_RETURN_S (0x00000040UL) /* bit [6] stack used to push registers: 0=Non-secure 1=Secure */ +#define EXC_RETURN_DCRS (0x00000020UL) /* bit [5] stacking rules for called registers: 0=skipped 1=saved */ +#define EXC_RETURN_FTYPE (0x00000010UL) /* bit [4] allocate stack for floating-point context: 0=done 1=skipped */ +#define EXC_RETURN_MODE (0x00000008UL) /* bit [3] processor mode for return: 0=Handler mode 1=Thread mode */ +#define EXC_RETURN_SPSEL (0x00000004UL) /* bit [2] stack pointer used to restore context: 0=MSP 1=PSP */ +#define EXC_RETURN_ES (0x00000001UL) /* bit [0] security state exception was taken to: 0=Non-secure 1=Secure */ + +/* Integrity Signature (from ARMv8-M Architecture Reference Manual) for exception context stacking */ +#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) /* Value for processors with floating-point extension: */ +#define EXC_INTEGRITY_SIGNATURE (0xFEFA125AUL) /* bit [0] SFTC must match LR bit[4] EXC_RETURN_FTYPE */ +#else +#define EXC_INTEGRITY_SIGNATURE (0xFEFA125BUL) /* Value for processors without floating-point extension */ +#endif + + +/** + \brief Set Priority Grouping + \details Sets the priority grouping field using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ + SCB->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping + \details Reads the priority grouping field from the NVIC Interrupt Controller. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) +{ + return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + __COMPILER_BARRIER(); + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __COMPILER_BARRIER(); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Get Interrupt Target State + \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + \return 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Target State + \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Clear Interrupt Target State + \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; + __DSB(); +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Set Priority Grouping (non-secure) + \details Sets the non-secure priority grouping field when in secure state using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void TZ_NVIC_SetPriorityGrouping_NS(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB_NS->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ + SCB_NS->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping (non-secure) + \details Reads the priority grouping field from the non-secure NVIC when in secure state. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPriorityGrouping_NS(void) +{ + return ((uint32_t)((SCB_NS->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt (non-secure) + \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status (non-secure) + \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt (non-secure) + \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Pending Interrupt (non-secure) + \details Reads the NVIC pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt (non-secure) + \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt (non-secure) + \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt (non-secure) + \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority (non-secure) + \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every non-secure processor exception. + */ +__STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority (non-secure) + \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC_NS->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_NVICFunctions */ + +/* ########################## MPU functions #################################### */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + +#include "mpu_armv8.h" + +#endif + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + uint32_t mvfr0; + + mvfr0 = FPU->MVFR0; + if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x220U) + { + return 2U; /* Double + Single precision FPU */ + } + else if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U) + { + return 1U; /* Single precision FPU */ + } + else + { + return 0U; /* No FPU */ + } +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ########################## SAU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SAUFunctions SAU Functions + \brief Functions that configure the SAU. + @{ + */ + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + +/** + \brief Enable SAU + \details Enables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Enable(void) +{ + SAU->CTRL |= (SAU_CTRL_ENABLE_Msk); +} + + + +/** + \brief Disable SAU + \details Disables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Disable(void) +{ + SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk); +} + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_SAUFunctions */ + + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief System Tick Configuration (non-secure) + \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function TZ_SysTick_Config_NS is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + + */ +__STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick_NS->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick_NS->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick_NS->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + +/* ##################################### Debug In/Output function ########################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_core_DebugFunctions ITM Functions + \brief Functions that access the ITM debug interface. + @{ + */ + +extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ +#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ + + +/** + \brief ITM Send Character + \details Transmits a character via the ITM channel 0, and + \li Just returns when no debugger is connected that has booked the output. + \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. + \param [in] ch Character to transmit. + \returns Character to transmit. + */ +__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) +{ + if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ + ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ + { + while (ITM->PORT[0U].u32 == 0UL) + { + __NOP(); + } + ITM->PORT[0U].u8 = (uint8_t)ch; + } + return (ch); +} + + +/** + \brief ITM Receive Character + \details Inputs a character via the external variable \ref ITM_RxBuffer. + \return Received character. + \return -1 No character pending. + */ +__STATIC_INLINE int32_t ITM_ReceiveChar (void) +{ + int32_t ch = -1; /* no character available */ + + if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) + { + ch = ITM_RxBuffer; + ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ + } + + return (ch); +} + + +/** + \brief ITM Check Character + \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. + \return 0 No character available. + \return 1 Character available. + */ +__STATIC_INLINE int32_t ITM_CheckChar (void) +{ + + if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) + { + return (0); /* no character available */ + } + else + { + return (1); /* character available */ + } +} + +/*@} end of CMSIS_core_DebugFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM35P_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm4.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm4.h new file mode 100644 index 0000000000..12c023b801 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm4.h @@ -0,0 +1,2124 @@ +/**************************************************************************//** + * @file core_cm4.h + * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Header File + * @version V5.1.0 + * @date 13. March 2019 + ******************************************************************************/ +/* + * Copyright (c) 2009-2019 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_CM4_H_GENERIC +#define __CORE_CM4_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_M4 + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS CM4 definitions */ +#define __CM4_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __CM4_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __CM4_CMSIS_VERSION ((__CM4_CMSIS_VERSION_MAIN << 16U) | \ + __CM4_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M (4U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions. +*/ +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_FP + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM4_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM4_H_DEPENDANT +#define __CORE_CM4_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM4_REV + #define __CM4_REV 0x0000U + #warning "__CM4_REV not defined in device header file; using default!" + #endif + + #ifndef __FPU_PRESENT + #define __FPU_PRESENT 0U + #warning "__FPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 3U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group Cortex_M4 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + - Core FPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + +#define APSR_Q_Pos 27U /*!< APSR: Q Position */ +#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ + +#define APSR_GE_Pos 16U /*!< APSR: GE Position */ +#define APSR_GE_Msk (0xFUL << APSR_GE_Pos) /*!< APSR: GE Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:1; /*!< bit: 9 Reserved */ + uint32_t ICI_IT_1:6; /*!< bit: 10..15 ICI/IT part 1 */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit */ + uint32_t ICI_IT_2:2; /*!< bit: 25..26 ICI/IT part 2 */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */ +#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ + +#define xPSR_ICI_IT_2_Pos 25U /*!< xPSR: ICI/IT part 2 Position */ +#define xPSR_ICI_IT_2_Msk (3UL << xPSR_ICI_IT_2_Pos) /*!< xPSR: ICI/IT part 2 Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_GE_Pos 16U /*!< xPSR: GE Position */ +#define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos) /*!< xPSR: GE Mask */ + +#define xPSR_ICI_IT_1_Pos 10U /*!< xPSR: ICI/IT part 1 Position */ +#define xPSR_ICI_IT_1_Msk (0x3FUL << xPSR_ICI_IT_1_Pos) /*!< xPSR: ICI/IT part 1 Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ + uint32_t FPCA:1; /*!< bit: 2 FP extension active flag */ + uint32_t _reserved0:29; /*!< bit: 3..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_FPCA_Pos 2U /*!< CONTROL: FPCA Position */ +#define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos) /*!< CONTROL: FPCA Mask */ + +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[8U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[24U]; + __IOM uint32_t ICER[8U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RESERVED1[24U]; + __IOM uint32_t ISPR[8U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[24U]; + __IOM uint32_t ICPR[8U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[24U]; + __IOM uint32_t IABR[8U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[56U]; + __IOM uint8_t IP[240U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ + uint32_t RESERVED5[644U]; + __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ +} NVIC_Type; + +/* Software Triggered Interrupt Register Definitions */ +#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ +#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + __IOM uint8_t SHP[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ + __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ + __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ + __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ + __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ + __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ + __IM uint32_t PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ + __IM uint32_t DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ + __IM uint32_t ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ + __IM uint32_t ISAR[5U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ + uint32_t RESERVED0[5U]; + __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */ +#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Vector Table Offset Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */ +#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +#define SCB_AIRCR_VECTRESET_Pos 0U /*!< SCB AIRCR: VECTRESET Position */ +#define SCB_AIRCR_VECTRESET_Msk (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/) /*!< SCB AIRCR: VECTRESET Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */ +#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +#define SCB_CCR_NONBASETHRDENA_Pos 0U /*!< SCB CCR: NONBASETHRDENA Position */ +#define SCB_CCR_NONBASETHRDENA_Msk (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/) /*!< SCB CCR: NONBASETHRDENA Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */ +#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ + +#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */ +#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ + +#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */ +#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */ +#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ + +#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */ +#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ + +#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */ +#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */ +#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */ +#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ + +#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */ +#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ + +#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */ +#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ + +/* SCB Configurable Fault Status Register Definitions */ +#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */ +#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ + +#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */ +#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ + +#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */ +#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ + +/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ + +#define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ +#define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ + +#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ + +#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ + +#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ + +#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ + +/* BusFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */ +#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */ + +#define SCB_CFSR_LSPERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 5U) /*!< SCB CFSR (BFSR): LSPERR Position */ +#define SCB_CFSR_LSPERR_Msk (1UL << SCB_CFSR_LSPERR_Pos) /*!< SCB CFSR (BFSR): LSPERR Mask */ + +#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */ +#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */ + +#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */ +#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */ + +#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */ +#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */ + +#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */ +#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */ + +#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */ +#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */ + +/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */ +#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */ + +#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */ +#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */ + +#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */ +#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */ + +#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */ +#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */ + +#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */ +#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */ + +#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */ +#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */ + +/* SCB Hard Fault Status Register Definitions */ +#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */ +#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ + +#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */ +#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ + +#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */ +#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ + +/* SCB Debug Fault Status Register Definitions */ +#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */ +#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ + +#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */ +#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ + +#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */ +#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ + +#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */ +#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ + +#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */ +#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** + \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ + __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ +} SCnSCB_Type; + +/* Interrupt Controller Type Register Definitions */ +#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ +#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ + +/* Auxiliary Control Register Definitions */ +#define SCnSCB_ACTLR_DISOOFP_Pos 9U /*!< ACTLR: DISOOFP Position */ +#define SCnSCB_ACTLR_DISOOFP_Msk (1UL << SCnSCB_ACTLR_DISOOFP_Pos) /*!< ACTLR: DISOOFP Mask */ + +#define SCnSCB_ACTLR_DISFPCA_Pos 8U /*!< ACTLR: DISFPCA Position */ +#define SCnSCB_ACTLR_DISFPCA_Msk (1UL << SCnSCB_ACTLR_DISFPCA_Pos) /*!< ACTLR: DISFPCA Mask */ + +#define SCnSCB_ACTLR_DISFOLD_Pos 2U /*!< ACTLR: DISFOLD Position */ +#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */ + +#define SCnSCB_ACTLR_DISDEFWBUF_Pos 1U /*!< ACTLR: DISDEFWBUF Position */ +#define SCnSCB_ACTLR_DISDEFWBUF_Msk (1UL << SCnSCB_ACTLR_DISDEFWBUF_Pos) /*!< ACTLR: DISDEFWBUF Mask */ + +#define SCnSCB_ACTLR_DISMCYCINT_Pos 0U /*!< ACTLR: DISMCYCINT Position */ +#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/) /*!< ACTLR: DISMCYCINT Mask */ + +/*@} end of group CMSIS_SCnotSCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) + \brief Type definitions for the Instrumentation Trace Macrocell (ITM) + @{ + */ + +/** + \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). + */ +typedef struct +{ + __OM union + { + __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ + __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ + __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ + } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ + uint32_t RESERVED0[864U]; + __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ + uint32_t RESERVED1[15U]; + __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ + uint32_t RESERVED2[15U]; + __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ + uint32_t RESERVED3[32U]; + uint32_t RESERVED4[43U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ + uint32_t RESERVED5[6U]; + __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ + __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ + __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ + __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ + __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ + __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ + __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ + __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ + __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ + __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ + __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ + __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ +} ITM_Type; + +/* ITM Trace Privilege Register Definitions */ +#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */ +#define ITM_TPR_PRIVMASK_Msk (0xFFFFFFFFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ + +/* ITM Trace Control Register Definitions */ +#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */ +#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ + +#define ITM_TCR_TraceBusID_Pos 16U /*!< ITM TCR: ATBID Position */ +#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */ + +#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */ +#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ + +#define ITM_TCR_TSPrescale_Pos 8U /*!< ITM TCR: TSPrescale Position */ +#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */ + +#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */ +#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ + +#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */ +#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ + +#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */ +#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ + +#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */ +#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ + +#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ +#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ + +/* ITM Lock Status Register Definitions */ +#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */ +#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ + +#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */ +#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ + +#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ +#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ + +/*@}*/ /* end of group CMSIS_ITM */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ + __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ + __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ + __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ + __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ + __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + __IOM uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */ + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED0[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + __IOM uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */ + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + __IOM uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */ + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + __IOM uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */ + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */ +#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ + +#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */ +#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ + +#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */ +#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ + +#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */ +#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ + +#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */ +#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ + +#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */ +#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ + +#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */ +#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ + +#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */ +#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ + +#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */ +#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ + +#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */ +#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ + +#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */ +#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ + +#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */ +#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ + +#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */ +#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ + +/* DWT CPI Count Register Definitions */ +#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */ +#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ + +/* DWT Exception Overhead Count Register Definitions */ +#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */ +#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ + +/* DWT Sleep Count Register Definitions */ +#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */ +#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ + +/* DWT LSU Count Register Definitions */ +#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */ +#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ + +/* DWT Folded-instruction Count Register Definitions */ +#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */ +#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ + +/* DWT Comparator Mask Register Definitions */ +#define DWT_MASK_MASK_Pos 0U /*!< DWT MASK: MASK Position */ +#define DWT_MASK_MASK_Msk (0x1FUL /*<< DWT_MASK_MASK_Pos*/) /*!< DWT MASK: MASK Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVADDR1_Pos 16U /*!< DWT FUNCTION: DATAVADDR1 Position */ +#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos) /*!< DWT FUNCTION: DATAVADDR1 Mask */ + +#define DWT_FUNCTION_DATAVADDR0_Pos 12U /*!< DWT FUNCTION: DATAVADDR0 Position */ +#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos) /*!< DWT FUNCTION: DATAVADDR0 Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_LNK1ENA_Pos 9U /*!< DWT FUNCTION: LNK1ENA Position */ +#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos) /*!< DWT FUNCTION: LNK1ENA Mask */ + +#define DWT_FUNCTION_DATAVMATCH_Pos 8U /*!< DWT FUNCTION: DATAVMATCH Position */ +#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos) /*!< DWT FUNCTION: DATAVMATCH Mask */ + +#define DWT_FUNCTION_CYCMATCH_Pos 7U /*!< DWT FUNCTION: CYCMATCH Position */ +#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos) /*!< DWT FUNCTION: CYCMATCH Mask */ + +#define DWT_FUNCTION_EMITRANGE_Pos 5U /*!< DWT FUNCTION: EMITRANGE Position */ +#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos) /*!< DWT FUNCTION: EMITRANGE Mask */ + +#define DWT_FUNCTION_FUNCTION_Pos 0U /*!< DWT FUNCTION: FUNCTION Position */ +#define DWT_FUNCTION_FUNCTION_Msk (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/) /*!< DWT FUNCTION: FUNCTION Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IM uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */ + uint32_t RESERVED3[759U]; + __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER Register */ + __IM uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */ + __IM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */ + uint32_t RESERVED4[1U]; + __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */ + __IM uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */ + __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ + uint32_t RESERVED5[39U]; + __IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ + __IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ + uint32_t RESERVED7[8U]; + __IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */ +#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI TRIGGER Register Definitions */ +#define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */ +#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ + +/* TPI Integration ETM Data Register Definitions (FIFO0) */ +#define TPI_FIFO0_ITM_ATVALID_Pos 29U /*!< TPI FIFO0: ITM_ATVALID Position */ +#define TPI_FIFO0_ITM_ATVALID_Msk (0x1UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */ + +#define TPI_FIFO0_ITM_bytecount_Pos 27U /*!< TPI FIFO0: ITM_bytecount Position */ +#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */ + +#define TPI_FIFO0_ETM_ATVALID_Pos 26U /*!< TPI FIFO0: ETM_ATVALID Position */ +#define TPI_FIFO0_ETM_ATVALID_Msk (0x1UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */ + +#define TPI_FIFO0_ETM_bytecount_Pos 24U /*!< TPI FIFO0: ETM_bytecount Position */ +#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */ + +#define TPI_FIFO0_ETM2_Pos 16U /*!< TPI FIFO0: ETM2 Position */ +#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */ + +#define TPI_FIFO0_ETM1_Pos 8U /*!< TPI FIFO0: ETM1 Position */ +#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */ + +#define TPI_FIFO0_ETM0_Pos 0U /*!< TPI FIFO0: ETM0 Position */ +#define TPI_FIFO0_ETM0_Msk (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/) /*!< TPI FIFO0: ETM0 Mask */ + +/* TPI ITATBCTR2 Register Definitions */ +#define TPI_ITATBCTR2_ATREADY2_Pos 0U /*!< TPI ITATBCTR2: ATREADY2 Position */ +#define TPI_ITATBCTR2_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY2_Pos*/) /*!< TPI ITATBCTR2: ATREADY2 Mask */ + +#define TPI_ITATBCTR2_ATREADY1_Pos 0U /*!< TPI ITATBCTR2: ATREADY1 Position */ +#define TPI_ITATBCTR2_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY1_Pos*/) /*!< TPI ITATBCTR2: ATREADY1 Mask */ + +/* TPI Integration ITM Data Register Definitions (FIFO1) */ +#define TPI_FIFO1_ITM_ATVALID_Pos 29U /*!< TPI FIFO1: ITM_ATVALID Position */ +#define TPI_FIFO1_ITM_ATVALID_Msk (0x1UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */ + +#define TPI_FIFO1_ITM_bytecount_Pos 27U /*!< TPI FIFO1: ITM_bytecount Position */ +#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */ + +#define TPI_FIFO1_ETM_ATVALID_Pos 26U /*!< TPI FIFO1: ETM_ATVALID Position */ +#define TPI_FIFO1_ETM_ATVALID_Msk (0x1UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */ + +#define TPI_FIFO1_ETM_bytecount_Pos 24U /*!< TPI FIFO1: ETM_bytecount Position */ +#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */ + +#define TPI_FIFO1_ITM2_Pos 16U /*!< TPI FIFO1: ITM2 Position */ +#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */ + +#define TPI_FIFO1_ITM1_Pos 8U /*!< TPI FIFO1: ITM1 Position */ +#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */ + +#define TPI_FIFO1_ITM0_Pos 0U /*!< TPI FIFO1: ITM0 Position */ +#define TPI_FIFO1_ITM0_Msk (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/) /*!< TPI FIFO1: ITM0 Mask */ + +/* TPI ITATBCTR0 Register Definitions */ +#define TPI_ITATBCTR0_ATREADY2_Pos 0U /*!< TPI ITATBCTR0: ATREADY2 Position */ +#define TPI_ITATBCTR0_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY2_Pos*/) /*!< TPI ITATBCTR0: ATREADY2 Mask */ + +#define TPI_ITATBCTR0_ATREADY1_Pos 0U /*!< TPI ITATBCTR0: ATREADY1 Position */ +#define TPI_ITATBCTR0_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY1_Pos*/) /*!< TPI ITATBCTR0: ATREADY1 Mask */ + +/* TPI Integration Mode Control Register Definitions */ +#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */ +#define TPI_ITCTRL_Mode_Msk (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_MinBufSz_Pos 6U /*!< TPI DEVID: MinBufSz Position */ +#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */ + +#define TPI_DEVID_AsynClkIn_Pos 5U /*!< TPI DEVID: AsynClkIn Position */ +#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */ + +#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */ +#define TPI_DEVID_NrTraceInput_Msk (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ + __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */ + __IOM uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */ + __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */ + __IOM uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */ + __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */ + __IOM uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */ +} MPU_Type; + +#define MPU_TYPE_RALIASES 4U + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_ADDR_Pos 5U /*!< MPU RBAR: ADDR Position */ +#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ + +#define MPU_RBAR_VALID_Pos 4U /*!< MPU RBAR: VALID Position */ +#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ + +#define MPU_RBAR_REGION_Pos 0U /*!< MPU RBAR: REGION Position */ +#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ + +/* MPU Region Attribute and Size Register Definitions */ +#define MPU_RASR_ATTRS_Pos 16U /*!< MPU RASR: MPU Region Attribute field Position */ +#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ + +#define MPU_RASR_XN_Pos 28U /*!< MPU RASR: ATTRS.XN Position */ +#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ + +#define MPU_RASR_AP_Pos 24U /*!< MPU RASR: ATTRS.AP Position */ +#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ + +#define MPU_RASR_TEX_Pos 19U /*!< MPU RASR: ATTRS.TEX Position */ +#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ + +#define MPU_RASR_S_Pos 18U /*!< MPU RASR: ATTRS.S Position */ +#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ + +#define MPU_RASR_C_Pos 17U /*!< MPU RASR: ATTRS.C Position */ +#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ + +#define MPU_RASR_B_Pos 16U /*!< MPU RASR: ATTRS.B Position */ +#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ + +#define MPU_RASR_SRD_Pos 8U /*!< MPU RASR: Sub-Region Disable Position */ +#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ + +#define MPU_RASR_SIZE_Pos 1U /*!< MPU RASR: Region Size Field Position */ +#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ + +#define MPU_RASR_ENABLE_Pos 0U /*!< MPU RASR: Region enable bit Position */ +#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ + +/*@} end of group CMSIS_MPU */ +#endif /* defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_FPU Floating Point Unit (FPU) + \brief Type definitions for the Floating Point Unit (FPU) + @{ + */ + +/** + \brief Structure type to access the Floating Point Unit (FPU). + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IOM uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */ + __IOM uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */ + __IOM uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */ + __IM uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and FP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and FP Feature Register 1 */ + __IM uint32_t MVFR2; /*!< Offset: 0x018 (R/ ) Media and FP Feature Register 2 */ +} FPU_Type; + +/* Floating-Point Context Control Register Definitions */ +#define FPU_FPCCR_ASPEN_Pos 31U /*!< FPCCR: ASPEN bit Position */ +#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */ + +#define FPU_FPCCR_LSPEN_Pos 30U /*!< FPCCR: LSPEN Position */ +#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */ + +#define FPU_FPCCR_MONRDY_Pos 8U /*!< FPCCR: MONRDY Position */ +#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */ + +#define FPU_FPCCR_BFRDY_Pos 6U /*!< FPCCR: BFRDY Position */ +#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */ + +#define FPU_FPCCR_MMRDY_Pos 5U /*!< FPCCR: MMRDY Position */ +#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */ + +#define FPU_FPCCR_HFRDY_Pos 4U /*!< FPCCR: HFRDY Position */ +#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */ + +#define FPU_FPCCR_THREAD_Pos 3U /*!< FPCCR: processor mode bit Position */ +#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */ + +#define FPU_FPCCR_USER_Pos 1U /*!< FPCCR: privilege level bit Position */ +#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */ + +#define FPU_FPCCR_LSPACT_Pos 0U /*!< FPCCR: Lazy state preservation active bit Position */ +#define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/) /*!< FPCCR: Lazy state preservation active bit Mask */ + +/* Floating-Point Context Address Register Definitions */ +#define FPU_FPCAR_ADDRESS_Pos 3U /*!< FPCAR: ADDRESS bit Position */ +#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */ + +/* Floating-Point Default Status Control Register Definitions */ +#define FPU_FPDSCR_AHP_Pos 26U /*!< FPDSCR: AHP bit Position */ +#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */ + +#define FPU_FPDSCR_DN_Pos 25U /*!< FPDSCR: DN bit Position */ +#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */ + +#define FPU_FPDSCR_FZ_Pos 24U /*!< FPDSCR: FZ bit Position */ +#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */ + +#define FPU_FPDSCR_RMode_Pos 22U /*!< FPDSCR: RMode bit Position */ +#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */ + +/* Media and FP Feature Register 0 Definitions */ +#define FPU_MVFR0_FP_rounding_modes_Pos 28U /*!< MVFR0: FP rounding modes bits Position */ +#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */ + +#define FPU_MVFR0_Short_vectors_Pos 24U /*!< MVFR0: Short vectors bits Position */ +#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */ + +#define FPU_MVFR0_Square_root_Pos 20U /*!< MVFR0: Square root bits Position */ +#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */ + +#define FPU_MVFR0_Divide_Pos 16U /*!< MVFR0: Divide bits Position */ +#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */ + +#define FPU_MVFR0_FP_excep_trapping_Pos 12U /*!< MVFR0: FP exception trapping bits Position */ +#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */ + +#define FPU_MVFR0_Double_precision_Pos 8U /*!< MVFR0: Double-precision bits Position */ +#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */ + +#define FPU_MVFR0_Single_precision_Pos 4U /*!< MVFR0: Single-precision bits Position */ +#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */ + +#define FPU_MVFR0_A_SIMD_registers_Pos 0U /*!< MVFR0: A_SIMD registers bits Position */ +#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/) /*!< MVFR0: A_SIMD registers bits Mask */ + +/* Media and FP Feature Register 1 Definitions */ +#define FPU_MVFR1_FP_fused_MAC_Pos 28U /*!< MVFR1: FP fused MAC bits Position */ +#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */ + +#define FPU_MVFR1_FP_HPFP_Pos 24U /*!< MVFR1: FP HPFP bits Position */ +#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */ + +#define FPU_MVFR1_D_NaN_mode_Pos 4U /*!< MVFR1: D_NaN mode bits Position */ +#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */ + +#define FPU_MVFR1_FtZ_mode_Pos 0U /*!< MVFR1: FtZ mode bits Position */ +#define FPU_MVFR1_FtZ_mode_Msk (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/) /*!< MVFR1: FtZ mode bits Mask */ + +/* Media and FP Feature Register 2 Definitions */ + +#define FPU_MVFR2_VFP_Misc_Pos 4U /*!< MVFR2: VFP Misc bits Position */ +#define FPU_MVFR2_VFP_Misc_Msk (0xFUL << FPU_MVFR2_VFP_Misc_Pos) /*!< MVFR2: VFP Misc bits Mask */ + +/*@} end of group CMSIS_FPU */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** + \brief Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register Definitions */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ +#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register Definitions */ +#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register Definitions */ +#define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< CoreDebug DEMCR: TRCENA Position */ +#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ + +#define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< CoreDebug DEMCR: MON_REQ Position */ +#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ + +#define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< CoreDebug DEMCR: MON_STEP Position */ +#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ + +#define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< CoreDebug DEMCR: MON_PEND Position */ +#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ + +#define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< CoreDebug DEMCR: MON_EN Position */ +#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< CoreDebug DEMCR: VC_INTERR Position */ +#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ + +#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< CoreDebug DEMCR: VC_BUSERR Position */ +#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ + +#define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< CoreDebug DEMCR: VC_STATERR Position */ +#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ + +#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< CoreDebug DEMCR: VC_CHKERR Position */ +#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ + +#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< CoreDebug DEMCR: VC_NOCPERR Position */ +#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ + +#define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< CoreDebug DEMCR: VC_MMERR Position */ +#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ +#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ +#define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ +#define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ +#define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ +#define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ +#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ +#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ +#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + +#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ +#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ +#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ +#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ +#define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ +#define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ +#define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ +#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ +#endif + +#define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ +#define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */ + +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Debug Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ + #define NVIC_GetActive __NVIC_GetActive + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* The following EXC_RETURN values are saved the LR on exception entry */ +#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */ +#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */ +#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */ +#define EXC_RETURN_HANDLER_FPU (0xFFFFFFE1UL) /* return to Handler mode, uses MSP after return, restore floating-point state */ +#define EXC_RETURN_THREAD_MSP_FPU (0xFFFFFFE9UL) /* return to Thread mode, uses MSP after return, restore floating-point state */ +#define EXC_RETURN_THREAD_PSP_FPU (0xFFFFFFEDUL) /* return to Thread mode, uses PSP after return, restore floating-point state */ + + +/** + \brief Set Priority Grouping + \details Sets the priority grouping field using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ + SCB->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping + \details Reads the priority grouping field from the NVIC Interrupt Controller. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) +{ + return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + __COMPILER_BARRIER(); + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __COMPILER_BARRIER(); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IP[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC->IP[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t vectors = (uint32_t )SCB->VTOR; + (* (int *) (vectors + ((int32_t)IRQn + NVIC_USER_IRQ_OFFSET) * 4)) = vector; + /* ARM Application Note 321 states that the M4 does not require the architectural barrier */ +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t vectors = (uint32_t )SCB->VTOR; + return (uint32_t)(* (int *) (vectors + ((int32_t)IRQn + NVIC_USER_IRQ_OFFSET) * 4)); +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +/*@} end of CMSIS_Core_NVICFunctions */ + + +/* ########################## MPU functions #################################### */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + +#include "mpu_armv7.h" + +#endif + + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + uint32_t mvfr0; + + mvfr0 = FPU->MVFR0; + if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U) + { + return 1U; /* Single precision FPU */ + } + else + { + return 0U; /* No FPU */ + } +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + +/* ##################################### Debug In/Output function ########################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_core_DebugFunctions ITM Functions + \brief Functions that access the ITM debug interface. + @{ + */ + +extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ +#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ + + +/** + \brief ITM Send Character + \details Transmits a character via the ITM channel 0, and + \li Just returns when no debugger is connected that has booked the output. + \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. + \param [in] ch Character to transmit. + \returns Character to transmit. + */ +__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) +{ + if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ + ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ + { + while (ITM->PORT[0U].u32 == 0UL) + { + __NOP(); + } + ITM->PORT[0U].u8 = (uint8_t)ch; + } + return (ch); +} + + +/** + \brief ITM Receive Character + \details Inputs a character via the external variable \ref ITM_RxBuffer. + \return Received character. + \return -1 No character pending. + */ +__STATIC_INLINE int32_t ITM_ReceiveChar (void) +{ + int32_t ch = -1; /* no character available */ + + if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) + { + ch = ITM_RxBuffer; + ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ + } + + return (ch); +} + + +/** + \brief ITM Check Character + \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. + \return 0 No character available. + \return 1 Character available. + */ +__STATIC_INLINE int32_t ITM_CheckChar (void) +{ + + if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) + { + return (0); /* no character available */ + } + else + { + return (1); /* character available */ + } +} + +/*@} end of CMSIS_core_DebugFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM4_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm7.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm7.h new file mode 100644 index 0000000000..c4515d8fa3 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_cm7.h @@ -0,0 +1,2725 @@ +/**************************************************************************//** + * @file core_cm7.h + * @brief CMSIS Cortex-M7 Core Peripheral Access Layer Header File + * @version V5.1.1 + * @date 28. March 2019 + ******************************************************************************/ +/* + * Copyright (c) 2009-2019 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_CM7_H_GENERIC +#define __CORE_CM7_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_M7 + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS CM7 definitions */ +#define __CM7_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __CM7_CMSIS_VERSION_SUB ( __CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __CM7_CMSIS_VERSION ((__CM7_CMSIS_VERSION_MAIN << 16U) | \ + __CM7_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M (7U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions. +*/ +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_FP + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM7_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM7_H_DEPENDANT +#define __CORE_CM7_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM7_REV + #define __CM7_REV 0x0000U + #warning "__CM7_REV not defined in device header file; using default!" + #endif + + #ifndef __FPU_PRESENT + #define __FPU_PRESENT 0U + #warning "__FPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __ICACHE_PRESENT + #define __ICACHE_PRESENT 0U + #warning "__ICACHE_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __DCACHE_PRESENT + #define __DCACHE_PRESENT 0U + #warning "__DCACHE_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __DTCM_PRESENT + #define __DTCM_PRESENT 0U + #warning "__DTCM_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 3U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group Cortex_M7 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + - Core FPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + +#define APSR_Q_Pos 27U /*!< APSR: Q Position */ +#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ + +#define APSR_GE_Pos 16U /*!< APSR: GE Position */ +#define APSR_GE_Msk (0xFUL << APSR_GE_Pos) /*!< APSR: GE Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:1; /*!< bit: 9 Reserved */ + uint32_t ICI_IT_1:6; /*!< bit: 10..15 ICI/IT part 1 */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit */ + uint32_t ICI_IT_2:2; /*!< bit: 25..26 ICI/IT part 2 */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */ +#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ + +#define xPSR_ICI_IT_2_Pos 25U /*!< xPSR: ICI/IT part 2 Position */ +#define xPSR_ICI_IT_2_Msk (3UL << xPSR_ICI_IT_2_Pos) /*!< xPSR: ICI/IT part 2 Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_GE_Pos 16U /*!< xPSR: GE Position */ +#define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos) /*!< xPSR: GE Mask */ + +#define xPSR_ICI_IT_1_Pos 10U /*!< xPSR: ICI/IT part 1 Position */ +#define xPSR_ICI_IT_1_Msk (0x3FUL << xPSR_ICI_IT_1_Pos) /*!< xPSR: ICI/IT part 1 Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ + uint32_t FPCA:1; /*!< bit: 2 FP extension active flag */ + uint32_t _reserved0:29; /*!< bit: 3..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_FPCA_Pos 2U /*!< CONTROL: FPCA Position */ +#define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos) /*!< CONTROL: FPCA Mask */ + +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[8U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[24U]; + __IOM uint32_t ICER[8U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RESERVED1[24U]; + __IOM uint32_t ISPR[8U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[24U]; + __IOM uint32_t ICPR[8U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[24U]; + __IOM uint32_t IABR[8U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[56U]; + __IOM uint8_t IP[240U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ + uint32_t RESERVED5[644U]; + __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ +} NVIC_Type; + +/* Software Triggered Interrupt Register Definitions */ +#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ +#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + __IOM uint8_t SHPR[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ + __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ + __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ + __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ + __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ + __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ + __IM uint32_t ID_PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ + __IM uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ + __IM uint32_t ID_AFR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t ID_MFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ + __IM uint32_t ID_ISAR[5U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ + uint32_t RESERVED0[1U]; + __IM uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */ + __IM uint32_t CTR; /*!< Offset: 0x07C (R/ ) Cache Type register */ + __IM uint32_t CCSIDR; /*!< Offset: 0x080 (R/ ) Cache Size ID Register */ + __IOM uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */ + __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ + uint32_t RESERVED3[93U]; + __OM uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */ + uint32_t RESERVED4[15U]; + __IM uint32_t MVFR0; /*!< Offset: 0x240 (R/ ) Media and VFP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x244 (R/ ) Media and VFP Feature Register 1 */ + __IM uint32_t MVFR2; /*!< Offset: 0x248 (R/ ) Media and VFP Feature Register 2 */ + uint32_t RESERVED5[1U]; + __OM uint32_t ICIALLU; /*!< Offset: 0x250 ( /W) I-Cache Invalidate All to PoU */ + uint32_t RESERVED6[1U]; + __OM uint32_t ICIMVAU; /*!< Offset: 0x258 ( /W) I-Cache Invalidate by MVA to PoU */ + __OM uint32_t DCIMVAC; /*!< Offset: 0x25C ( /W) D-Cache Invalidate by MVA to PoC */ + __OM uint32_t DCISW; /*!< Offset: 0x260 ( /W) D-Cache Invalidate by Set-way */ + __OM uint32_t DCCMVAU; /*!< Offset: 0x264 ( /W) D-Cache Clean by MVA to PoU */ + __OM uint32_t DCCMVAC; /*!< Offset: 0x268 ( /W) D-Cache Clean by MVA to PoC */ + __OM uint32_t DCCSW; /*!< Offset: 0x26C ( /W) D-Cache Clean by Set-way */ + __OM uint32_t DCCIMVAC; /*!< Offset: 0x270 ( /W) D-Cache Clean and Invalidate by MVA to PoC */ + __OM uint32_t DCCISW; /*!< Offset: 0x274 ( /W) D-Cache Clean and Invalidate by Set-way */ + uint32_t RESERVED7[6U]; + __IOM uint32_t ITCMCR; /*!< Offset: 0x290 (R/W) Instruction Tightly-Coupled Memory Control Register */ + __IOM uint32_t DTCMCR; /*!< Offset: 0x294 (R/W) Data Tightly-Coupled Memory Control Registers */ + __IOM uint32_t AHBPCR; /*!< Offset: 0x298 (R/W) AHBP Control Register */ + __IOM uint32_t CACR; /*!< Offset: 0x29C (R/W) L1 Cache Control Register */ + __IOM uint32_t AHBSCR; /*!< Offset: 0x2A0 (R/W) AHB Slave Control Register */ + uint32_t RESERVED8[1U]; + __IOM uint32_t ABFSR; /*!< Offset: 0x2A8 (R/W) Auxiliary Bus Fault Status Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */ +#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Vector Table Offset Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */ +#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +#define SCB_AIRCR_VECTRESET_Pos 0U /*!< SCB AIRCR: VECTRESET Position */ +#define SCB_AIRCR_VECTRESET_Msk (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/) /*!< SCB AIRCR: VECTRESET Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_BP_Pos 18U /*!< SCB CCR: Branch prediction enable bit Position */ +#define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: Branch prediction enable bit Mask */ + +#define SCB_CCR_IC_Pos 17U /*!< SCB CCR: Instruction cache enable bit Position */ +#define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: Instruction cache enable bit Mask */ + +#define SCB_CCR_DC_Pos 16U /*!< SCB CCR: Cache enable bit Position */ +#define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: Cache enable bit Mask */ + +#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */ +#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +#define SCB_CCR_NONBASETHRDENA_Pos 0U /*!< SCB CCR: NONBASETHRDENA Position */ +#define SCB_CCR_NONBASETHRDENA_Msk (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/) /*!< SCB CCR: NONBASETHRDENA Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */ +#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ + +#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */ +#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ + +#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */ +#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */ +#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ + +#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */ +#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ + +#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */ +#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */ +#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */ +#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ + +#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */ +#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ + +#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */ +#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ + +/* SCB Configurable Fault Status Register Definitions */ +#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */ +#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ + +#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */ +#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ + +#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */ +#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ + +/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ + +#define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ +#define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ + +#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ + +#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ + +#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ + +#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ + +/* BusFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */ +#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */ + +#define SCB_CFSR_LSPERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 5U) /*!< SCB CFSR (BFSR): LSPERR Position */ +#define SCB_CFSR_LSPERR_Msk (1UL << SCB_CFSR_LSPERR_Pos) /*!< SCB CFSR (BFSR): LSPERR Mask */ + +#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */ +#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */ + +#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */ +#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */ + +#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */ +#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */ + +#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */ +#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */ + +#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */ +#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */ + +/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */ +#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */ + +#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */ +#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */ + +#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */ +#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */ + +#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */ +#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */ + +#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */ +#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */ + +#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */ +#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */ + +/* SCB Hard Fault Status Register Definitions */ +#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */ +#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ + +#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */ +#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ + +#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */ +#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ + +/* SCB Debug Fault Status Register Definitions */ +#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */ +#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ + +#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */ +#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ + +#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */ +#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ + +#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */ +#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ + +#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */ +#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ + +/* SCB Cache Level ID Register Definitions */ +#define SCB_CLIDR_LOUU_Pos 27U /*!< SCB CLIDR: LoUU Position */ +#define SCB_CLIDR_LOUU_Msk (7UL << SCB_CLIDR_LOUU_Pos) /*!< SCB CLIDR: LoUU Mask */ + +#define SCB_CLIDR_LOC_Pos 24U /*!< SCB CLIDR: LoC Position */ +#define SCB_CLIDR_LOC_Msk (7UL << SCB_CLIDR_LOC_Pos) /*!< SCB CLIDR: LoC Mask */ + +/* SCB Cache Type Register Definitions */ +#define SCB_CTR_FORMAT_Pos 29U /*!< SCB CTR: Format Position */ +#define SCB_CTR_FORMAT_Msk (7UL << SCB_CTR_FORMAT_Pos) /*!< SCB CTR: Format Mask */ + +#define SCB_CTR_CWG_Pos 24U /*!< SCB CTR: CWG Position */ +#define SCB_CTR_CWG_Msk (0xFUL << SCB_CTR_CWG_Pos) /*!< SCB CTR: CWG Mask */ + +#define SCB_CTR_ERG_Pos 20U /*!< SCB CTR: ERG Position */ +#define SCB_CTR_ERG_Msk (0xFUL << SCB_CTR_ERG_Pos) /*!< SCB CTR: ERG Mask */ + +#define SCB_CTR_DMINLINE_Pos 16U /*!< SCB CTR: DminLine Position */ +#define SCB_CTR_DMINLINE_Msk (0xFUL << SCB_CTR_DMINLINE_Pos) /*!< SCB CTR: DminLine Mask */ + +#define SCB_CTR_IMINLINE_Pos 0U /*!< SCB CTR: ImInLine Position */ +#define SCB_CTR_IMINLINE_Msk (0xFUL /*<< SCB_CTR_IMINLINE_Pos*/) /*!< SCB CTR: ImInLine Mask */ + +/* SCB Cache Size ID Register Definitions */ +#define SCB_CCSIDR_WT_Pos 31U /*!< SCB CCSIDR: WT Position */ +#define SCB_CCSIDR_WT_Msk (1UL << SCB_CCSIDR_WT_Pos) /*!< SCB CCSIDR: WT Mask */ + +#define SCB_CCSIDR_WB_Pos 30U /*!< SCB CCSIDR: WB Position */ +#define SCB_CCSIDR_WB_Msk (1UL << SCB_CCSIDR_WB_Pos) /*!< SCB CCSIDR: WB Mask */ + +#define SCB_CCSIDR_RA_Pos 29U /*!< SCB CCSIDR: RA Position */ +#define SCB_CCSIDR_RA_Msk (1UL << SCB_CCSIDR_RA_Pos) /*!< SCB CCSIDR: RA Mask */ + +#define SCB_CCSIDR_WA_Pos 28U /*!< SCB CCSIDR: WA Position */ +#define SCB_CCSIDR_WA_Msk (1UL << SCB_CCSIDR_WA_Pos) /*!< SCB CCSIDR: WA Mask */ + +#define SCB_CCSIDR_NUMSETS_Pos 13U /*!< SCB CCSIDR: NumSets Position */ +#define SCB_CCSIDR_NUMSETS_Msk (0x7FFFUL << SCB_CCSIDR_NUMSETS_Pos) /*!< SCB CCSIDR: NumSets Mask */ + +#define SCB_CCSIDR_ASSOCIATIVITY_Pos 3U /*!< SCB CCSIDR: Associativity Position */ +#define SCB_CCSIDR_ASSOCIATIVITY_Msk (0x3FFUL << SCB_CCSIDR_ASSOCIATIVITY_Pos) /*!< SCB CCSIDR: Associativity Mask */ + +#define SCB_CCSIDR_LINESIZE_Pos 0U /*!< SCB CCSIDR: LineSize Position */ +#define SCB_CCSIDR_LINESIZE_Msk (7UL /*<< SCB_CCSIDR_LINESIZE_Pos*/) /*!< SCB CCSIDR: LineSize Mask */ + +/* SCB Cache Size Selection Register Definitions */ +#define SCB_CSSELR_LEVEL_Pos 1U /*!< SCB CSSELR: Level Position */ +#define SCB_CSSELR_LEVEL_Msk (7UL << SCB_CSSELR_LEVEL_Pos) /*!< SCB CSSELR: Level Mask */ + +#define SCB_CSSELR_IND_Pos 0U /*!< SCB CSSELR: InD Position */ +#define SCB_CSSELR_IND_Msk (1UL /*<< SCB_CSSELR_IND_Pos*/) /*!< SCB CSSELR: InD Mask */ + +/* SCB Software Triggered Interrupt Register Definitions */ +#define SCB_STIR_INTID_Pos 0U /*!< SCB STIR: INTID Position */ +#define SCB_STIR_INTID_Msk (0x1FFUL /*<< SCB_STIR_INTID_Pos*/) /*!< SCB STIR: INTID Mask */ + +/* SCB D-Cache Invalidate by Set-way Register Definitions */ +#define SCB_DCISW_WAY_Pos 30U /*!< SCB DCISW: Way Position */ +#define SCB_DCISW_WAY_Msk (3UL << SCB_DCISW_WAY_Pos) /*!< SCB DCISW: Way Mask */ + +#define SCB_DCISW_SET_Pos 5U /*!< SCB DCISW: Set Position */ +#define SCB_DCISW_SET_Msk (0x1FFUL << SCB_DCISW_SET_Pos) /*!< SCB DCISW: Set Mask */ + +/* SCB D-Cache Clean by Set-way Register Definitions */ +#define SCB_DCCSW_WAY_Pos 30U /*!< SCB DCCSW: Way Position */ +#define SCB_DCCSW_WAY_Msk (3UL << SCB_DCCSW_WAY_Pos) /*!< SCB DCCSW: Way Mask */ + +#define SCB_DCCSW_SET_Pos 5U /*!< SCB DCCSW: Set Position */ +#define SCB_DCCSW_SET_Msk (0x1FFUL << SCB_DCCSW_SET_Pos) /*!< SCB DCCSW: Set Mask */ + +/* SCB D-Cache Clean and Invalidate by Set-way Register Definitions */ +#define SCB_DCCISW_WAY_Pos 30U /*!< SCB DCCISW: Way Position */ +#define SCB_DCCISW_WAY_Msk (3UL << SCB_DCCISW_WAY_Pos) /*!< SCB DCCISW: Way Mask */ + +#define SCB_DCCISW_SET_Pos 5U /*!< SCB DCCISW: Set Position */ +#define SCB_DCCISW_SET_Msk (0x1FFUL << SCB_DCCISW_SET_Pos) /*!< SCB DCCISW: Set Mask */ + +/* Instruction Tightly-Coupled Memory Control Register Definitions */ +#define SCB_ITCMCR_SZ_Pos 3U /*!< SCB ITCMCR: SZ Position */ +#define SCB_ITCMCR_SZ_Msk (0xFUL << SCB_ITCMCR_SZ_Pos) /*!< SCB ITCMCR: SZ Mask */ + +#define SCB_ITCMCR_RETEN_Pos 2U /*!< SCB ITCMCR: RETEN Position */ +#define SCB_ITCMCR_RETEN_Msk (1UL << SCB_ITCMCR_RETEN_Pos) /*!< SCB ITCMCR: RETEN Mask */ + +#define SCB_ITCMCR_RMW_Pos 1U /*!< SCB ITCMCR: RMW Position */ +#define SCB_ITCMCR_RMW_Msk (1UL << SCB_ITCMCR_RMW_Pos) /*!< SCB ITCMCR: RMW Mask */ + +#define SCB_ITCMCR_EN_Pos 0U /*!< SCB ITCMCR: EN Position */ +#define SCB_ITCMCR_EN_Msk (1UL /*<< SCB_ITCMCR_EN_Pos*/) /*!< SCB ITCMCR: EN Mask */ + +/* Data Tightly-Coupled Memory Control Register Definitions */ +#define SCB_DTCMCR_SZ_Pos 3U /*!< SCB DTCMCR: SZ Position */ +#define SCB_DTCMCR_SZ_Msk (0xFUL << SCB_DTCMCR_SZ_Pos) /*!< SCB DTCMCR: SZ Mask */ + +#define SCB_DTCMCR_RETEN_Pos 2U /*!< SCB DTCMCR: RETEN Position */ +#define SCB_DTCMCR_RETEN_Msk (1UL << SCB_DTCMCR_RETEN_Pos) /*!< SCB DTCMCR: RETEN Mask */ + +#define SCB_DTCMCR_RMW_Pos 1U /*!< SCB DTCMCR: RMW Position */ +#define SCB_DTCMCR_RMW_Msk (1UL << SCB_DTCMCR_RMW_Pos) /*!< SCB DTCMCR: RMW Mask */ + +#define SCB_DTCMCR_EN_Pos 0U /*!< SCB DTCMCR: EN Position */ +#define SCB_DTCMCR_EN_Msk (1UL /*<< SCB_DTCMCR_EN_Pos*/) /*!< SCB DTCMCR: EN Mask */ + +/* AHBP Control Register Definitions */ +#define SCB_AHBPCR_SZ_Pos 1U /*!< SCB AHBPCR: SZ Position */ +#define SCB_AHBPCR_SZ_Msk (7UL << SCB_AHBPCR_SZ_Pos) /*!< SCB AHBPCR: SZ Mask */ + +#define SCB_AHBPCR_EN_Pos 0U /*!< SCB AHBPCR: EN Position */ +#define SCB_AHBPCR_EN_Msk (1UL /*<< SCB_AHBPCR_EN_Pos*/) /*!< SCB AHBPCR: EN Mask */ + +/* L1 Cache Control Register Definitions */ +#define SCB_CACR_FORCEWT_Pos 2U /*!< SCB CACR: FORCEWT Position */ +#define SCB_CACR_FORCEWT_Msk (1UL << SCB_CACR_FORCEWT_Pos) /*!< SCB CACR: FORCEWT Mask */ + +#define SCB_CACR_ECCEN_Pos 1U /*!< SCB CACR: ECCEN Position */ +#define SCB_CACR_ECCEN_Msk (1UL << SCB_CACR_ECCEN_Pos) /*!< SCB CACR: ECCEN Mask */ + +#define SCB_CACR_SIWT_Pos 0U /*!< SCB CACR: SIWT Position */ +#define SCB_CACR_SIWT_Msk (1UL /*<< SCB_CACR_SIWT_Pos*/) /*!< SCB CACR: SIWT Mask */ + +/* AHBS Control Register Definitions */ +#define SCB_AHBSCR_INITCOUNT_Pos 11U /*!< SCB AHBSCR: INITCOUNT Position */ +#define SCB_AHBSCR_INITCOUNT_Msk (0x1FUL << SCB_AHBPCR_INITCOUNT_Pos) /*!< SCB AHBSCR: INITCOUNT Mask */ + +#define SCB_AHBSCR_TPRI_Pos 2U /*!< SCB AHBSCR: TPRI Position */ +#define SCB_AHBSCR_TPRI_Msk (0x1FFUL << SCB_AHBPCR_TPRI_Pos) /*!< SCB AHBSCR: TPRI Mask */ + +#define SCB_AHBSCR_CTL_Pos 0U /*!< SCB AHBSCR: CTL Position*/ +#define SCB_AHBSCR_CTL_Msk (3UL /*<< SCB_AHBPCR_CTL_Pos*/) /*!< SCB AHBSCR: CTL Mask */ + +/* Auxiliary Bus Fault Status Register Definitions */ +#define SCB_ABFSR_AXIMTYPE_Pos 8U /*!< SCB ABFSR: AXIMTYPE Position*/ +#define SCB_ABFSR_AXIMTYPE_Msk (3UL << SCB_ABFSR_AXIMTYPE_Pos) /*!< SCB ABFSR: AXIMTYPE Mask */ + +#define SCB_ABFSR_EPPB_Pos 4U /*!< SCB ABFSR: EPPB Position*/ +#define SCB_ABFSR_EPPB_Msk (1UL << SCB_ABFSR_EPPB_Pos) /*!< SCB ABFSR: EPPB Mask */ + +#define SCB_ABFSR_AXIM_Pos 3U /*!< SCB ABFSR: AXIM Position*/ +#define SCB_ABFSR_AXIM_Msk (1UL << SCB_ABFSR_AXIM_Pos) /*!< SCB ABFSR: AXIM Mask */ + +#define SCB_ABFSR_AHBP_Pos 2U /*!< SCB ABFSR: AHBP Position*/ +#define SCB_ABFSR_AHBP_Msk (1UL << SCB_ABFSR_AHBP_Pos) /*!< SCB ABFSR: AHBP Mask */ + +#define SCB_ABFSR_DTCM_Pos 1U /*!< SCB ABFSR: DTCM Position*/ +#define SCB_ABFSR_DTCM_Msk (1UL << SCB_ABFSR_DTCM_Pos) /*!< SCB ABFSR: DTCM Mask */ + +#define SCB_ABFSR_ITCM_Pos 0U /*!< SCB ABFSR: ITCM Position*/ +#define SCB_ABFSR_ITCM_Msk (1UL /*<< SCB_ABFSR_ITCM_Pos*/) /*!< SCB ABFSR: ITCM Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** + \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ + __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ +} SCnSCB_Type; + +/* Interrupt Controller Type Register Definitions */ +#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ +#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ + +/* Auxiliary Control Register Definitions */ +#define SCnSCB_ACTLR_DISDYNADD_Pos 26U /*!< ACTLR: DISDYNADD Position */ +#define SCnSCB_ACTLR_DISDYNADD_Msk (1UL << SCnSCB_ACTLR_DISDYNADD_Pos) /*!< ACTLR: DISDYNADD Mask */ + +#define SCnSCB_ACTLR_DISISSCH1_Pos 21U /*!< ACTLR: DISISSCH1 Position */ +#define SCnSCB_ACTLR_DISISSCH1_Msk (0x1FUL << SCnSCB_ACTLR_DISISSCH1_Pos) /*!< ACTLR: DISISSCH1 Mask */ + +#define SCnSCB_ACTLR_DISDI_Pos 16U /*!< ACTLR: DISDI Position */ +#define SCnSCB_ACTLR_DISDI_Msk (0x1FUL << SCnSCB_ACTLR_DISDI_Pos) /*!< ACTLR: DISDI Mask */ + +#define SCnSCB_ACTLR_DISCRITAXIRUR_Pos 15U /*!< ACTLR: DISCRITAXIRUR Position */ +#define SCnSCB_ACTLR_DISCRITAXIRUR_Msk (1UL << SCnSCB_ACTLR_DISCRITAXIRUR_Pos) /*!< ACTLR: DISCRITAXIRUR Mask */ + +#define SCnSCB_ACTLR_DISBTACALLOC_Pos 14U /*!< ACTLR: DISBTACALLOC Position */ +#define SCnSCB_ACTLR_DISBTACALLOC_Msk (1UL << SCnSCB_ACTLR_DISBTACALLOC_Pos) /*!< ACTLR: DISBTACALLOC Mask */ + +#define SCnSCB_ACTLR_DISBTACREAD_Pos 13U /*!< ACTLR: DISBTACREAD Position */ +#define SCnSCB_ACTLR_DISBTACREAD_Msk (1UL << SCnSCB_ACTLR_DISBTACREAD_Pos) /*!< ACTLR: DISBTACREAD Mask */ + +#define SCnSCB_ACTLR_DISITMATBFLUSH_Pos 12U /*!< ACTLR: DISITMATBFLUSH Position */ +#define SCnSCB_ACTLR_DISITMATBFLUSH_Msk (1UL << SCnSCB_ACTLR_DISITMATBFLUSH_Pos) /*!< ACTLR: DISITMATBFLUSH Mask */ + +#define SCnSCB_ACTLR_DISRAMODE_Pos 11U /*!< ACTLR: DISRAMODE Position */ +#define SCnSCB_ACTLR_DISRAMODE_Msk (1UL << SCnSCB_ACTLR_DISRAMODE_Pos) /*!< ACTLR: DISRAMODE Mask */ + +#define SCnSCB_ACTLR_FPEXCODIS_Pos 10U /*!< ACTLR: FPEXCODIS Position */ +#define SCnSCB_ACTLR_FPEXCODIS_Msk (1UL << SCnSCB_ACTLR_FPEXCODIS_Pos) /*!< ACTLR: FPEXCODIS Mask */ + +#define SCnSCB_ACTLR_DISFOLD_Pos 2U /*!< ACTLR: DISFOLD Position */ +#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */ + +#define SCnSCB_ACTLR_DISMCYCINT_Pos 0U /*!< ACTLR: DISMCYCINT Position */ +#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/) /*!< ACTLR: DISMCYCINT Mask */ + +/*@} end of group CMSIS_SCnotSCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) + \brief Type definitions for the Instrumentation Trace Macrocell (ITM) + @{ + */ + +/** + \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). + */ +typedef struct +{ + __OM union + { + __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ + __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ + __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ + } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ + uint32_t RESERVED0[864U]; + __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ + uint32_t RESERVED1[15U]; + __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ + uint32_t RESERVED2[15U]; + __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ + uint32_t RESERVED3[32U]; + uint32_t RESERVED4[43U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ + uint32_t RESERVED5[6U]; + __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ + __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ + __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ + __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ + __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ + __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ + __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ + __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ + __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ + __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ + __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ + __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ +} ITM_Type; + +/* ITM Trace Privilege Register Definitions */ +#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */ +#define ITM_TPR_PRIVMASK_Msk (0xFFFFFFFFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ + +/* ITM Trace Control Register Definitions */ +#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */ +#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ + +#define ITM_TCR_TraceBusID_Pos 16U /*!< ITM TCR: ATBID Position */ +#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */ + +#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */ +#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ + +#define ITM_TCR_TSPrescale_Pos 8U /*!< ITM TCR: TSPrescale Position */ +#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */ + +#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */ +#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ + +#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */ +#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ + +#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */ +#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ + +#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */ +#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ + +#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ +#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ + +/* ITM Lock Status Register Definitions */ +#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */ +#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ + +#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */ +#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ + +#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ +#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ + +/*@}*/ /* end of group CMSIS_ITM */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ + __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ + __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ + __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ + __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ + __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + __IOM uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */ + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED0[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + __IOM uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */ + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + __IOM uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */ + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + __IOM uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */ + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ + uint32_t RESERVED3[981U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( W) Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R ) Lock Status Register */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */ +#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ + +#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */ +#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ + +#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */ +#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ + +#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */ +#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ + +#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */ +#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ + +#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */ +#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ + +#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */ +#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ + +#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */ +#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ + +#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */ +#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ + +#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */ +#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ + +#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */ +#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ + +#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */ +#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ + +#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */ +#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ + +/* DWT CPI Count Register Definitions */ +#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */ +#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ + +/* DWT Exception Overhead Count Register Definitions */ +#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */ +#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ + +/* DWT Sleep Count Register Definitions */ +#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */ +#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ + +/* DWT LSU Count Register Definitions */ +#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */ +#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ + +/* DWT Folded-instruction Count Register Definitions */ +#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */ +#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ + +/* DWT Comparator Mask Register Definitions */ +#define DWT_MASK_MASK_Pos 0U /*!< DWT MASK: MASK Position */ +#define DWT_MASK_MASK_Msk (0x1FUL /*<< DWT_MASK_MASK_Pos*/) /*!< DWT MASK: MASK Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVADDR1_Pos 16U /*!< DWT FUNCTION: DATAVADDR1 Position */ +#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos) /*!< DWT FUNCTION: DATAVADDR1 Mask */ + +#define DWT_FUNCTION_DATAVADDR0_Pos 12U /*!< DWT FUNCTION: DATAVADDR0 Position */ +#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos) /*!< DWT FUNCTION: DATAVADDR0 Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_LNK1ENA_Pos 9U /*!< DWT FUNCTION: LNK1ENA Position */ +#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos) /*!< DWT FUNCTION: LNK1ENA Mask */ + +#define DWT_FUNCTION_DATAVMATCH_Pos 8U /*!< DWT FUNCTION: DATAVMATCH Position */ +#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos) /*!< DWT FUNCTION: DATAVMATCH Mask */ + +#define DWT_FUNCTION_CYCMATCH_Pos 7U /*!< DWT FUNCTION: CYCMATCH Position */ +#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos) /*!< DWT FUNCTION: CYCMATCH Mask */ + +#define DWT_FUNCTION_EMITRANGE_Pos 5U /*!< DWT FUNCTION: EMITRANGE Position */ +#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos) /*!< DWT FUNCTION: EMITRANGE Mask */ + +#define DWT_FUNCTION_FUNCTION_Pos 0U /*!< DWT FUNCTION: FUNCTION Position */ +#define DWT_FUNCTION_FUNCTION_Msk (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/) /*!< DWT FUNCTION: FUNCTION Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IM uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */ + uint32_t RESERVED3[759U]; + __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER Register */ + __IM uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */ + __IM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */ + uint32_t RESERVED4[1U]; + __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */ + __IM uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */ + __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ + uint32_t RESERVED5[39U]; + __IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ + __IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ + uint32_t RESERVED7[8U]; + __IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */ +#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI TRIGGER Register Definitions */ +#define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */ +#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ + +/* TPI Integration ETM Data Register Definitions (FIFO0) */ +#define TPI_FIFO0_ITM_ATVALID_Pos 29U /*!< TPI FIFO0: ITM_ATVALID Position */ +#define TPI_FIFO0_ITM_ATVALID_Msk (0x1UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */ + +#define TPI_FIFO0_ITM_bytecount_Pos 27U /*!< TPI FIFO0: ITM_bytecount Position */ +#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */ + +#define TPI_FIFO0_ETM_ATVALID_Pos 26U /*!< TPI FIFO0: ETM_ATVALID Position */ +#define TPI_FIFO0_ETM_ATVALID_Msk (0x1UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */ + +#define TPI_FIFO0_ETM_bytecount_Pos 24U /*!< TPI FIFO0: ETM_bytecount Position */ +#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */ + +#define TPI_FIFO0_ETM2_Pos 16U /*!< TPI FIFO0: ETM2 Position */ +#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */ + +#define TPI_FIFO0_ETM1_Pos 8U /*!< TPI FIFO0: ETM1 Position */ +#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */ + +#define TPI_FIFO0_ETM0_Pos 0U /*!< TPI FIFO0: ETM0 Position */ +#define TPI_FIFO0_ETM0_Msk (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/) /*!< TPI FIFO0: ETM0 Mask */ + +/* TPI ITATBCTR2 Register Definitions */ +#define TPI_ITATBCTR2_ATREADY2_Pos 0U /*!< TPI ITATBCTR2: ATREADY2 Position */ +#define TPI_ITATBCTR2_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY2_Pos*/) /*!< TPI ITATBCTR2: ATREADY2 Mask */ + +#define TPI_ITATBCTR2_ATREADY1_Pos 0U /*!< TPI ITATBCTR2: ATREADY1 Position */ +#define TPI_ITATBCTR2_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY1_Pos*/) /*!< TPI ITATBCTR2: ATREADY1 Mask */ + +/* TPI Integration ITM Data Register Definitions (FIFO1) */ +#define TPI_FIFO1_ITM_ATVALID_Pos 29U /*!< TPI FIFO1: ITM_ATVALID Position */ +#define TPI_FIFO1_ITM_ATVALID_Msk (0x1UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */ + +#define TPI_FIFO1_ITM_bytecount_Pos 27U /*!< TPI FIFO1: ITM_bytecount Position */ +#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */ + +#define TPI_FIFO1_ETM_ATVALID_Pos 26U /*!< TPI FIFO1: ETM_ATVALID Position */ +#define TPI_FIFO1_ETM_ATVALID_Msk (0x1UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */ + +#define TPI_FIFO1_ETM_bytecount_Pos 24U /*!< TPI FIFO1: ETM_bytecount Position */ +#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */ + +#define TPI_FIFO1_ITM2_Pos 16U /*!< TPI FIFO1: ITM2 Position */ +#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */ + +#define TPI_FIFO1_ITM1_Pos 8U /*!< TPI FIFO1: ITM1 Position */ +#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */ + +#define TPI_FIFO1_ITM0_Pos 0U /*!< TPI FIFO1: ITM0 Position */ +#define TPI_FIFO1_ITM0_Msk (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/) /*!< TPI FIFO1: ITM0 Mask */ + +/* TPI ITATBCTR0 Register Definitions */ +#define TPI_ITATBCTR0_ATREADY2_Pos 0U /*!< TPI ITATBCTR0: ATREADY2 Position */ +#define TPI_ITATBCTR0_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY2_Pos*/) /*!< TPI ITATBCTR0: ATREADY2 Mask */ + +#define TPI_ITATBCTR0_ATREADY1_Pos 0U /*!< TPI ITATBCTR0: ATREADY1 Position */ +#define TPI_ITATBCTR0_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY1_Pos*/) /*!< TPI ITATBCTR0: ATREADY1 Mask */ + +/* TPI Integration Mode Control Register Definitions */ +#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */ +#define TPI_ITCTRL_Mode_Msk (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_MinBufSz_Pos 6U /*!< TPI DEVID: MinBufSz Position */ +#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */ + +#define TPI_DEVID_AsynClkIn_Pos 5U /*!< TPI DEVID: AsynClkIn Position */ +#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */ + +#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */ +#define TPI_DEVID_NrTraceInput_Msk (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ + __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */ + __IOM uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */ + __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */ + __IOM uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */ + __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */ + __IOM uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */ +} MPU_Type; + +#define MPU_TYPE_RALIASES 4U + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_ADDR_Pos 5U /*!< MPU RBAR: ADDR Position */ +#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ + +#define MPU_RBAR_VALID_Pos 4U /*!< MPU RBAR: VALID Position */ +#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ + +#define MPU_RBAR_REGION_Pos 0U /*!< MPU RBAR: REGION Position */ +#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ + +/* MPU Region Attribute and Size Register Definitions */ +#define MPU_RASR_ATTRS_Pos 16U /*!< MPU RASR: MPU Region Attribute field Position */ +#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ + +#define MPU_RASR_XN_Pos 28U /*!< MPU RASR: ATTRS.XN Position */ +#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ + +#define MPU_RASR_AP_Pos 24U /*!< MPU RASR: ATTRS.AP Position */ +#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ + +#define MPU_RASR_TEX_Pos 19U /*!< MPU RASR: ATTRS.TEX Position */ +#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ + +#define MPU_RASR_S_Pos 18U /*!< MPU RASR: ATTRS.S Position */ +#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ + +#define MPU_RASR_C_Pos 17U /*!< MPU RASR: ATTRS.C Position */ +#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ + +#define MPU_RASR_B_Pos 16U /*!< MPU RASR: ATTRS.B Position */ +#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ + +#define MPU_RASR_SRD_Pos 8U /*!< MPU RASR: Sub-Region Disable Position */ +#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ + +#define MPU_RASR_SIZE_Pos 1U /*!< MPU RASR: Region Size Field Position */ +#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ + +#define MPU_RASR_ENABLE_Pos 0U /*!< MPU RASR: Region enable bit Position */ +#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ + +/*@} end of group CMSIS_MPU */ +#endif /* defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_FPU Floating Point Unit (FPU) + \brief Type definitions for the Floating Point Unit (FPU) + @{ + */ + +/** + \brief Structure type to access the Floating Point Unit (FPU). + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IOM uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */ + __IOM uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */ + __IOM uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */ + __IM uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and FP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and FP Feature Register 1 */ + __IM uint32_t MVFR2; /*!< Offset: 0x018 (R/ ) Media and FP Feature Register 2 */ +} FPU_Type; + +/* Floating-Point Context Control Register Definitions */ +#define FPU_FPCCR_ASPEN_Pos 31U /*!< FPCCR: ASPEN bit Position */ +#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */ + +#define FPU_FPCCR_LSPEN_Pos 30U /*!< FPCCR: LSPEN Position */ +#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */ + +#define FPU_FPCCR_MONRDY_Pos 8U /*!< FPCCR: MONRDY Position */ +#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */ + +#define FPU_FPCCR_BFRDY_Pos 6U /*!< FPCCR: BFRDY Position */ +#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */ + +#define FPU_FPCCR_MMRDY_Pos 5U /*!< FPCCR: MMRDY Position */ +#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */ + +#define FPU_FPCCR_HFRDY_Pos 4U /*!< FPCCR: HFRDY Position */ +#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */ + +#define FPU_FPCCR_THREAD_Pos 3U /*!< FPCCR: processor mode bit Position */ +#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */ + +#define FPU_FPCCR_USER_Pos 1U /*!< FPCCR: privilege level bit Position */ +#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */ + +#define FPU_FPCCR_LSPACT_Pos 0U /*!< FPCCR: Lazy state preservation active bit Position */ +#define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/) /*!< FPCCR: Lazy state preservation active bit Mask */ + +/* Floating-Point Context Address Register Definitions */ +#define FPU_FPCAR_ADDRESS_Pos 3U /*!< FPCAR: ADDRESS bit Position */ +#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */ + +/* Floating-Point Default Status Control Register Definitions */ +#define FPU_FPDSCR_AHP_Pos 26U /*!< FPDSCR: AHP bit Position */ +#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */ + +#define FPU_FPDSCR_DN_Pos 25U /*!< FPDSCR: DN bit Position */ +#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */ + +#define FPU_FPDSCR_FZ_Pos 24U /*!< FPDSCR: FZ bit Position */ +#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */ + +#define FPU_FPDSCR_RMode_Pos 22U /*!< FPDSCR: RMode bit Position */ +#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */ + +/* Media and FP Feature Register 0 Definitions */ +#define FPU_MVFR0_FP_rounding_modes_Pos 28U /*!< MVFR0: FP rounding modes bits Position */ +#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */ + +#define FPU_MVFR0_Short_vectors_Pos 24U /*!< MVFR0: Short vectors bits Position */ +#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */ + +#define FPU_MVFR0_Square_root_Pos 20U /*!< MVFR0: Square root bits Position */ +#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */ + +#define FPU_MVFR0_Divide_Pos 16U /*!< MVFR0: Divide bits Position */ +#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */ + +#define FPU_MVFR0_FP_excep_trapping_Pos 12U /*!< MVFR0: FP exception trapping bits Position */ +#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */ + +#define FPU_MVFR0_Double_precision_Pos 8U /*!< MVFR0: Double-precision bits Position */ +#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */ + +#define FPU_MVFR0_Single_precision_Pos 4U /*!< MVFR0: Single-precision bits Position */ +#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */ + +#define FPU_MVFR0_A_SIMD_registers_Pos 0U /*!< MVFR0: A_SIMD registers bits Position */ +#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/) /*!< MVFR0: A_SIMD registers bits Mask */ + +/* Media and FP Feature Register 1 Definitions */ +#define FPU_MVFR1_FP_fused_MAC_Pos 28U /*!< MVFR1: FP fused MAC bits Position */ +#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */ + +#define FPU_MVFR1_FP_HPFP_Pos 24U /*!< MVFR1: FP HPFP bits Position */ +#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */ + +#define FPU_MVFR1_D_NaN_mode_Pos 4U /*!< MVFR1: D_NaN mode bits Position */ +#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */ + +#define FPU_MVFR1_FtZ_mode_Pos 0U /*!< MVFR1: FtZ mode bits Position */ +#define FPU_MVFR1_FtZ_mode_Msk (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/) /*!< MVFR1: FtZ mode bits Mask */ + +/* Media and FP Feature Register 2 Definitions */ + +#define FPU_MVFR2_VFP_Misc_Pos 4U /*!< MVFR2: VFP Misc bits Position */ +#define FPU_MVFR2_VFP_Misc_Msk (0xFUL << FPU_MVFR2_VFP_Misc_Pos) /*!< MVFR2: VFP Misc bits Mask */ + +/*@} end of group CMSIS_FPU */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** + \brief Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register Definitions */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ +#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register Definitions */ +#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register Definitions */ +#define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< CoreDebug DEMCR: TRCENA Position */ +#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ + +#define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< CoreDebug DEMCR: MON_REQ Position */ +#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ + +#define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< CoreDebug DEMCR: MON_STEP Position */ +#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ + +#define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< CoreDebug DEMCR: MON_PEND Position */ +#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ + +#define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< CoreDebug DEMCR: MON_EN Position */ +#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< CoreDebug DEMCR: VC_INTERR Position */ +#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ + +#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< CoreDebug DEMCR: VC_BUSERR Position */ +#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ + +#define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< CoreDebug DEMCR: VC_STATERR Position */ +#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ + +#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< CoreDebug DEMCR: VC_CHKERR Position */ +#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ + +#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< CoreDebug DEMCR: VC_NOCPERR Position */ +#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ + +#define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< CoreDebug DEMCR: VC_MMERR Position */ +#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ +#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ +#define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ +#define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ +#define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ +#define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ +#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ +#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ +#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + +#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ +#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ +#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ +#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ +#define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ +#define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ +#define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ +#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ +#endif + +#define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ +#define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */ + +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Debug Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ + #define NVIC_GetActive __NVIC_GetActive + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* The following EXC_RETURN values are saved the LR on exception entry */ +#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */ +#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */ +#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */ +#define EXC_RETURN_HANDLER_FPU (0xFFFFFFE1UL) /* return to Handler mode, uses MSP after return, restore floating-point state */ +#define EXC_RETURN_THREAD_MSP_FPU (0xFFFFFFE9UL) /* return to Thread mode, uses MSP after return, restore floating-point state */ +#define EXC_RETURN_THREAD_PSP_FPU (0xFFFFFFEDUL) /* return to Thread mode, uses PSP after return, restore floating-point state */ + + +/** + \brief Set Priority Grouping + \details Sets the priority grouping field using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ + SCB->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping + \details Reads the priority grouping field from the NVIC Interrupt Controller. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) +{ + return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + __COMPILER_BARRIER(); + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __COMPILER_BARRIER(); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IP[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC->IP[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t vectors = (uint32_t )SCB->VTOR; + (* (int *) (vectors + ((int32_t)IRQn + NVIC_USER_IRQ_OFFSET) * 4)) = vector; + __DSB(); +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t vectors = (uint32_t )SCB->VTOR; + return (uint32_t)(* (int *) (vectors + ((int32_t)IRQn + NVIC_USER_IRQ_OFFSET) * 4)); +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +/*@} end of CMSIS_Core_NVICFunctions */ + + +/* ########################## MPU functions #################################### */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + +#include "mpu_armv7.h" + +#endif + + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + uint32_t mvfr0; + + mvfr0 = SCB->MVFR0; + if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x220U) + { + return 2U; /* Double + Single precision FPU */ + } + else if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U) + { + return 1U; /* Single precision FPU */ + } + else + { + return 0U; /* No FPU */ + } +} + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ########################## Cache functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_CacheFunctions Cache Functions + \brief Functions that configure Instruction and Data cache. + @{ + */ + +/* Cache Size ID Register Macros */ +#define CCSIDR_WAYS(x) (((x) & SCB_CCSIDR_ASSOCIATIVITY_Msk) >> SCB_CCSIDR_ASSOCIATIVITY_Pos) +#define CCSIDR_SETS(x) (((x) & SCB_CCSIDR_NUMSETS_Msk ) >> SCB_CCSIDR_NUMSETS_Pos ) + +#define __SCB_DCACHE_LINE_SIZE 32U /*!< Cortex-M7 cache line size is fixed to 32 bytes (8 words). See also register SCB_CCSIDR */ +#define __SCB_ICACHE_LINE_SIZE 32U /*!< Cortex-M7 cache line size is fixed to 32 bytes (8 words). See also register SCB_CCSIDR */ + +/** + \brief Enable I-Cache + \details Turns on I-Cache + */ +__STATIC_FORCEINLINE void SCB_EnableICache (void) +{ + #if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U) + if (SCB->CCR & SCB_CCR_IC_Msk) return; /* return if ICache is already enabled */ + + __DSB(); + __ISB(); + SCB->ICIALLU = 0UL; /* invalidate I-Cache */ + __DSB(); + __ISB(); + SCB->CCR |= (uint32_t)SCB_CCR_IC_Msk; /* enable I-Cache */ + __DSB(); + __ISB(); + #endif +} + + +/** + \brief Disable I-Cache + \details Turns off I-Cache + */ +__STATIC_FORCEINLINE void SCB_DisableICache (void) +{ + #if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U) + __DSB(); + __ISB(); + SCB->CCR &= ~(uint32_t)SCB_CCR_IC_Msk; /* disable I-Cache */ + SCB->ICIALLU = 0UL; /* invalidate I-Cache */ + __DSB(); + __ISB(); + #endif +} + + +/** + \brief Invalidate I-Cache + \details Invalidates I-Cache + */ +__STATIC_FORCEINLINE void SCB_InvalidateICache (void) +{ + #if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U) + __DSB(); + __ISB(); + SCB->ICIALLU = 0UL; + __DSB(); + __ISB(); + #endif +} + + +/** + \brief I-Cache Invalidate by address + \details Invalidates I-Cache for the given address. + I-Cache is invalidated starting from a 32 byte aligned address in 32 byte granularity. + I-Cache memory blocks which are part of given address + given size are invalidated. + \param[in] addr address + \param[in] isize size of memory block (in number of bytes) +*/ +__STATIC_FORCEINLINE void SCB_InvalidateICache_by_Addr (void *addr, int32_t isize) +{ + #if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U) + if ( isize > 0 ) { + int32_t op_size = isize + (((uint32_t)addr) & (__SCB_ICACHE_LINE_SIZE - 1U)); + uint32_t op_addr = (uint32_t)addr /* & ~(__SCB_ICACHE_LINE_SIZE - 1U) */; + + __DSB(); + + do { + SCB->ICIMVAU = op_addr; /* register accepts only 32byte aligned values, only bits 31..5 are valid */ + op_addr += __SCB_ICACHE_LINE_SIZE; + op_size -= __SCB_ICACHE_LINE_SIZE; + } while ( op_size > 0 ); + + __DSB(); + __ISB(); + } + #endif +} + + +/** + \brief Enable D-Cache + \details Turns on D-Cache + */ +__STATIC_FORCEINLINE void SCB_EnableDCache (void) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + uint32_t ccsidr; + uint32_t sets; + uint32_t ways; + + if (SCB->CCR & SCB_CCR_DC_Msk) return; /* return if DCache is already enabled */ + + SCB->CSSELR = 0U; /* select Level 1 data cache */ + __DSB(); + + ccsidr = SCB->CCSIDR; + + /* invalidate D-Cache */ + sets = (uint32_t)(CCSIDR_SETS(ccsidr)); + do { + ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); + do { + SCB->DCISW = (((sets << SCB_DCISW_SET_Pos) & SCB_DCISW_SET_Msk) | + ((ways << SCB_DCISW_WAY_Pos) & SCB_DCISW_WAY_Msk) ); + #if defined ( __CC_ARM ) + __schedule_barrier(); + #endif + } while (ways-- != 0U); + } while(sets-- != 0U); + __DSB(); + + SCB->CCR |= (uint32_t)SCB_CCR_DC_Msk; /* enable D-Cache */ + + __DSB(); + __ISB(); + #endif +} + + +/** + \brief Disable D-Cache + \details Turns off D-Cache + */ +__STATIC_FORCEINLINE void SCB_DisableDCache (void) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + uint32_t ccsidr; + uint32_t sets; + uint32_t ways; + + SCB->CSSELR = 0U; /* select Level 1 data cache */ + __DSB(); + + SCB->CCR &= ~(uint32_t)SCB_CCR_DC_Msk; /* disable D-Cache */ + __DSB(); + + ccsidr = SCB->CCSIDR; + + /* clean & invalidate D-Cache */ + sets = (uint32_t)(CCSIDR_SETS(ccsidr)); + do { + ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); + do { + SCB->DCCISW = (((sets << SCB_DCCISW_SET_Pos) & SCB_DCCISW_SET_Msk) | + ((ways << SCB_DCCISW_WAY_Pos) & SCB_DCCISW_WAY_Msk) ); + #if defined ( __CC_ARM ) + __schedule_barrier(); + #endif + } while (ways-- != 0U); + } while(sets-- != 0U); + + __DSB(); + __ISB(); + #endif +} + + +/** + \brief Invalidate D-Cache + \details Invalidates D-Cache + */ +__STATIC_FORCEINLINE void SCB_InvalidateDCache (void) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + uint32_t ccsidr; + uint32_t sets; + uint32_t ways; + + SCB->CSSELR = 0U; /* select Level 1 data cache */ + __DSB(); + + ccsidr = SCB->CCSIDR; + + /* invalidate D-Cache */ + sets = (uint32_t)(CCSIDR_SETS(ccsidr)); + do { + ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); + do { + SCB->DCISW = (((sets << SCB_DCISW_SET_Pos) & SCB_DCISW_SET_Msk) | + ((ways << SCB_DCISW_WAY_Pos) & SCB_DCISW_WAY_Msk) ); + #if defined ( __CC_ARM ) + __schedule_barrier(); + #endif + } while (ways-- != 0U); + } while(sets-- != 0U); + + __DSB(); + __ISB(); + #endif +} + + +/** + \brief Clean D-Cache + \details Cleans D-Cache + */ +__STATIC_FORCEINLINE void SCB_CleanDCache (void) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + uint32_t ccsidr; + uint32_t sets; + uint32_t ways; + + SCB->CSSELR = 0U; /* select Level 1 data cache */ + __DSB(); + + ccsidr = SCB->CCSIDR; + + /* clean D-Cache */ + sets = (uint32_t)(CCSIDR_SETS(ccsidr)); + do { + ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); + do { + SCB->DCCSW = (((sets << SCB_DCCSW_SET_Pos) & SCB_DCCSW_SET_Msk) | + ((ways << SCB_DCCSW_WAY_Pos) & SCB_DCCSW_WAY_Msk) ); + #if defined ( __CC_ARM ) + __schedule_barrier(); + #endif + } while (ways-- != 0U); + } while(sets-- != 0U); + + __DSB(); + __ISB(); + #endif +} + + +/** + \brief Clean & Invalidate D-Cache + \details Cleans and Invalidates D-Cache + */ +__STATIC_FORCEINLINE void SCB_CleanInvalidateDCache (void) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + uint32_t ccsidr; + uint32_t sets; + uint32_t ways; + + SCB->CSSELR = 0U; /* select Level 1 data cache */ + __DSB(); + + ccsidr = SCB->CCSIDR; + + /* clean & invalidate D-Cache */ + sets = (uint32_t)(CCSIDR_SETS(ccsidr)); + do { + ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); + do { + SCB->DCCISW = (((sets << SCB_DCCISW_SET_Pos) & SCB_DCCISW_SET_Msk) | + ((ways << SCB_DCCISW_WAY_Pos) & SCB_DCCISW_WAY_Msk) ); + #if defined ( __CC_ARM ) + __schedule_barrier(); + #endif + } while (ways-- != 0U); + } while(sets-- != 0U); + + __DSB(); + __ISB(); + #endif +} + + +/** + \brief D-Cache Invalidate by address + \details Invalidates D-Cache for the given address. + D-Cache is invalidated starting from a 32 byte aligned address in 32 byte granularity. + D-Cache memory blocks which are part of given address + given size are invalidated. + \param[in] addr address + \param[in] dsize size of memory block (in number of bytes) +*/ +__STATIC_FORCEINLINE void SCB_InvalidateDCache_by_Addr (void *addr, int32_t dsize) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + if ( dsize > 0 ) { + int32_t op_size = dsize + (((uint32_t)addr) & (__SCB_DCACHE_LINE_SIZE - 1U)); + uint32_t op_addr = (uint32_t)addr /* & ~(__SCB_DCACHE_LINE_SIZE - 1U) */; + + __DSB(); + + do { + SCB->DCIMVAC = op_addr; /* register accepts only 32byte aligned values, only bits 31..5 are valid */ + op_addr += __SCB_DCACHE_LINE_SIZE; + op_size -= __SCB_DCACHE_LINE_SIZE; + } while ( op_size > 0 ); + + __DSB(); + __ISB(); + } + #endif +} + + +/** + \brief D-Cache Clean by address + \details Cleans D-Cache for the given address + D-Cache is cleaned starting from a 32 byte aligned address in 32 byte granularity. + D-Cache memory blocks which are part of given address + given size are cleaned. + \param[in] addr address + \param[in] dsize size of memory block (in number of bytes) +*/ +__STATIC_FORCEINLINE void SCB_CleanDCache_by_Addr (uint32_t *addr, int32_t dsize) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + if ( dsize > 0 ) { + int32_t op_size = dsize + (((uint32_t)addr) & (__SCB_DCACHE_LINE_SIZE - 1U)); + uint32_t op_addr = (uint32_t)addr /* & ~(__SCB_DCACHE_LINE_SIZE - 1U) */; + + __DSB(); + + do { + SCB->DCCMVAC = op_addr; /* register accepts only 32byte aligned values, only bits 31..5 are valid */ + op_addr += __SCB_DCACHE_LINE_SIZE; + op_size -= __SCB_DCACHE_LINE_SIZE; + } while ( op_size > 0 ); + + __DSB(); + __ISB(); + } + #endif +} + + +/** + \brief D-Cache Clean and Invalidate by address + \details Cleans and invalidates D_Cache for the given address + D-Cache is cleaned and invalidated starting from a 32 byte aligned address in 32 byte granularity. + D-Cache memory blocks which are part of given address + given size are cleaned and invalidated. + \param[in] addr address (aligned to 32-byte boundary) + \param[in] dsize size of memory block (in number of bytes) +*/ +__STATIC_FORCEINLINE void SCB_CleanInvalidateDCache_by_Addr (uint32_t *addr, int32_t dsize) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + if ( dsize > 0 ) { + int32_t op_size = dsize + (((uint32_t)addr) & (__SCB_DCACHE_LINE_SIZE - 1U)); + uint32_t op_addr = (uint32_t)addr /* & ~(__SCB_DCACHE_LINE_SIZE - 1U) */; + + __DSB(); + + do { + SCB->DCCIMVAC = op_addr; /* register accepts only 32byte aligned values, only bits 31..5 are valid */ + op_addr += __SCB_DCACHE_LINE_SIZE; + op_size -= __SCB_DCACHE_LINE_SIZE; + } while ( op_size > 0 ); + + __DSB(); + __ISB(); + } + #endif +} + +/*@} end of CMSIS_Core_CacheFunctions */ + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + +/* ##################################### Debug In/Output function ########################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_core_DebugFunctions ITM Functions + \brief Functions that access the ITM debug interface. + @{ + */ + +extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ +#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ + + +/** + \brief ITM Send Character + \details Transmits a character via the ITM channel 0, and + \li Just returns when no debugger is connected that has booked the output. + \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. + \param [in] ch Character to transmit. + \returns Character to transmit. + */ +__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) +{ + if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ + ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ + { + while (ITM->PORT[0U].u32 == 0UL) + { + __NOP(); + } + ITM->PORT[0U].u8 = (uint8_t)ch; + } + return (ch); +} + + +/** + \brief ITM Receive Character + \details Inputs a character via the external variable \ref ITM_RxBuffer. + \return Received character. + \return -1 No character pending. + */ +__STATIC_INLINE int32_t ITM_ReceiveChar (void) +{ + int32_t ch = -1; /* no character available */ + + if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) + { + ch = ITM_RxBuffer; + ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ + } + + return (ch); +} + + +/** + \brief ITM Check Character + \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. + \return 0 No character available. + \return 1 Character available. + */ +__STATIC_INLINE int32_t ITM_CheckChar (void) +{ + + if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) + { + return (0); /* no character available */ + } + else + { + return (1); /* character available */ + } +} + +/*@} end of CMSIS_core_DebugFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM7_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/core_sc000.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_sc000.h new file mode 100644 index 0000000000..cf92577b63 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_sc000.h @@ -0,0 +1,1025 @@ +/**************************************************************************//** + * @file core_sc000.h + * @brief CMSIS SC000 Core Peripheral Access Layer Header File + * @version V5.0.6 + * @date 12. November 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_SC000_H_GENERIC +#define __CORE_SC000_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup SC000 + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS SC000 definitions */ +#define __SC000_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __SC000_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __SC000_CMSIS_VERSION ((__SC000_CMSIS_VERSION_MAIN << 16U) | \ + __SC000_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_SC (000U) /*!< Cortex secure core */ + +/** __FPU_USED indicates whether an FPU is used or not. + This core does not support an FPU at all +*/ +#define __FPU_USED 0U + +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_FP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_SC000_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_SC000_H_DEPENDANT +#define __CORE_SC000_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __SC000_REV + #define __SC000_REV 0x0000U + #warning "__SC000_REV not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 2U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group SC000 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core MPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t _reserved0:1; /*!< bit: 0 Reserved */ + uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ + uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[1U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[31U]; + __IOM uint32_t ICER[1U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[31U]; + __IOM uint32_t ISPR[1U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[31U]; + __IOM uint32_t ICPR[1U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[31U]; + uint32_t RESERVED4[64U]; + __IOM uint32_t IP[8U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */ +} NVIC_Type; + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + uint32_t RESERVED0[1U]; + __IOM uint32_t SHP[2U]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + uint32_t RESERVED1[154U]; + __IOM uint32_t SFCR; /*!< Offset: 0x290 (R/W) Security Features Control Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */ +#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */ +#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** + \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ +} SCnSCB_Type; + +/* Auxiliary Control Register Definitions */ +#define SCnSCB_ACTLR_DISMCYCINT_Pos 0U /*!< ACTLR: DISMCYCINT Position */ +#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/) /*!< ACTLR: DISMCYCINT Mask */ + +/*@} end of group CMSIS_SCnotSCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ +} MPU_Type; + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_ADDR_Pos 8U /*!< MPU RBAR: ADDR Position */ +#define MPU_RBAR_ADDR_Msk (0xFFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ + +#define MPU_RBAR_VALID_Pos 4U /*!< MPU RBAR: VALID Position */ +#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ + +#define MPU_RBAR_REGION_Pos 0U /*!< MPU RBAR: REGION Position */ +#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ + +/* MPU Region Attribute and Size Register Definitions */ +#define MPU_RASR_ATTRS_Pos 16U /*!< MPU RASR: MPU Region Attribute field Position */ +#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ + +#define MPU_RASR_XN_Pos 28U /*!< MPU RASR: ATTRS.XN Position */ +#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ + +#define MPU_RASR_AP_Pos 24U /*!< MPU RASR: ATTRS.AP Position */ +#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ + +#define MPU_RASR_TEX_Pos 19U /*!< MPU RASR: ATTRS.TEX Position */ +#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ + +#define MPU_RASR_S_Pos 18U /*!< MPU RASR: ATTRS.S Position */ +#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ + +#define MPU_RASR_C_Pos 17U /*!< MPU RASR: ATTRS.C Position */ +#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ + +#define MPU_RASR_B_Pos 16U /*!< MPU RASR: ATTRS.B Position */ +#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ + +#define MPU_RASR_SRD_Pos 8U /*!< MPU RASR: Sub-Region Disable Position */ +#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ + +#define MPU_RASR_SIZE_Pos 1U /*!< MPU RASR: Region Size Field Position */ +#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ + +#define MPU_RASR_ENABLE_Pos 0U /*!< MPU RASR: Region enable bit Position */ +#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief SC000 Core Debug Registers (DCB registers, SHCSR, and DFSR) are only accessible over DAP and not via processor. + Therefore they are not covered by the SC000 header file. + @{ + */ +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ +#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ +#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ +#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ +#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + +#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ +#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ +#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ +#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ +#endif + +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else +/*#define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping not available for SC000 */ +/*#define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping not available for SC000 */ + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ +/*#define NVIC_GetActive __NVIC_GetActive not available for SC000 */ + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* The following EXC_RETURN values are saved the LR on exception entry */ +#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */ +#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */ +#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */ + + +/* Interrupt Priorities are WORD accessible only under Armv6-M */ +/* The following MACROS handle generation of the register offset and byte masks */ +#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL) +#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) ) +#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) ) + + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + __COMPILER_BARRIER(); + NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __COMPILER_BARRIER(); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IP[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } + else + { + SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; + /* ARM Application Note 321 states that the M0 and M0+ do not require the architectural barrier - assume SC000 is the same */ +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + SCB_AIRCR_SYSRESETREQ_Msk); + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +/*@} end of CMSIS_Core_NVICFunctions */ + + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + return 0U; /* No FPU */ +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_SC000_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/core_sc300.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_sc300.h new file mode 100644 index 0000000000..40f3af81be --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/core_sc300.h @@ -0,0 +1,1912 @@ +/**************************************************************************//** + * @file core_sc300.h + * @brief CMSIS SC300 Core Peripheral Access Layer Header File + * @version V5.0.8 + * @date 31. May 2019 + ******************************************************************************/ +/* + * Copyright (c) 2009-2019 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_SC300_H_GENERIC +#define __CORE_SC300_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup SC3000 + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS SC300 definitions */ +#define __SC300_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __SC300_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __SC300_CMSIS_VERSION ((__SC300_CMSIS_VERSION_MAIN << 16U) | \ + __SC300_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_SC (300U) /*!< Cortex secure core */ + +/** __FPU_USED indicates whether an FPU is used or not. + This core does not support an FPU at all +*/ +#define __FPU_USED 0U + +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_FP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_SC300_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_SC300_H_DEPENDANT +#define __CORE_SC300_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __SC300_REV + #define __SC300_REV 0x0000U + #warning "__SC300_REV not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 3U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group SC300 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:27; /*!< bit: 0..26 Reserved */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + +#define APSR_Q_Pos 27U /*!< APSR: Q Position */ +#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:1; /*!< bit: 9 Reserved */ + uint32_t ICI_IT_1:6; /*!< bit: 10..15 ICI/IT part 1 */ + uint32_t _reserved1:8; /*!< bit: 16..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit */ + uint32_t ICI_IT_2:2; /*!< bit: 25..26 ICI/IT part 2 */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */ +#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ + +#define xPSR_ICI_IT_2_Pos 25U /*!< xPSR: ICI/IT part 2 Position */ +#define xPSR_ICI_IT_2_Msk (3UL << xPSR_ICI_IT_2_Pos) /*!< xPSR: ICI/IT part 2 Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_ICI_IT_1_Pos 10U /*!< xPSR: ICI/IT part 1 Position */ +#define xPSR_ICI_IT_1_Msk (0x3FUL << xPSR_ICI_IT_1_Pos) /*!< xPSR: ICI/IT part 1 Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ + uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[8U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[24U]; + __IOM uint32_t ICER[8U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RESERVED1[24U]; + __IOM uint32_t ISPR[8U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[24U]; + __IOM uint32_t ICPR[8U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[24U]; + __IOM uint32_t IABR[8U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[56U]; + __IOM uint8_t IP[240U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ + uint32_t RESERVED5[644U]; + __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ +} NVIC_Type; + +/* Software Triggered Interrupt Register Definitions */ +#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ +#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + __IOM uint8_t SHP[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ + __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ + __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ + __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ + __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ + __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ + __IM uint32_t PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ + __IM uint32_t DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ + __IM uint32_t ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ + __IM uint32_t ISAR[5U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ + uint32_t RESERVED0[5U]; + __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ + uint32_t RESERVED1[129U]; + __IOM uint32_t SFCR; /*!< Offset: 0x290 (R/W) Security Features Control Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */ +#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Vector Table Offset Register Definitions */ +#define SCB_VTOR_TBLBASE_Pos 29U /*!< SCB VTOR: TBLBASE Position */ +#define SCB_VTOR_TBLBASE_Msk (1UL << SCB_VTOR_TBLBASE_Pos) /*!< SCB VTOR: TBLBASE Mask */ + +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x3FFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */ +#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +#define SCB_AIRCR_VECTRESET_Pos 0U /*!< SCB AIRCR: VECTRESET Position */ +#define SCB_AIRCR_VECTRESET_Msk (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/) /*!< SCB AIRCR: VECTRESET Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */ +#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +#define SCB_CCR_NONBASETHRDENA_Pos 0U /*!< SCB CCR: NONBASETHRDENA Position */ +#define SCB_CCR_NONBASETHRDENA_Msk (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/) /*!< SCB CCR: NONBASETHRDENA Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */ +#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ + +#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */ +#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ + +#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */ +#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */ +#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ + +#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */ +#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ + +#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */ +#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */ +#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */ +#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ + +#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */ +#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ + +#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */ +#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ + +/* SCB Configurable Fault Status Register Definitions */ +#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */ +#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ + +#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */ +#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ + +#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */ +#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ + +/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ + +#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ + +#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ + +#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ + +#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ + +/* BusFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */ +#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */ + +#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */ +#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */ + +#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */ +#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */ + +#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */ +#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */ + +#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */ +#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */ + +#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */ +#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */ + +/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */ +#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */ + +#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */ +#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */ + +#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */ +#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */ + +#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */ +#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */ + +#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */ +#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */ + +#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */ +#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */ + +/* SCB Hard Fault Status Register Definitions */ +#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */ +#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ + +#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */ +#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ + +#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */ +#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ + +/* SCB Debug Fault Status Register Definitions */ +#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */ +#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ + +#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */ +#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ + +#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */ +#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ + +#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */ +#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ + +#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */ +#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** + \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ + __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ +} SCnSCB_Type; + +/* Interrupt Controller Type Register Definitions */ +#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ +#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ + +/* Auxiliary Control Register Definitions */ +#define SCnSCB_ACTLR_DISFOLD_Pos 2U /*!< ACTLR: DISFOLD Position */ +#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */ + +#define SCnSCB_ACTLR_DISDEFWBUF_Pos 1U /*!< ACTLR: DISDEFWBUF Position */ +#define SCnSCB_ACTLR_DISDEFWBUF_Msk (1UL << SCnSCB_ACTLR_DISDEFWBUF_Pos) /*!< ACTLR: DISDEFWBUF Mask */ + +#define SCnSCB_ACTLR_DISMCYCINT_Pos 0U /*!< ACTLR: DISMCYCINT Position */ +#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/) /*!< ACTLR: DISMCYCINT Mask */ + +/*@} end of group CMSIS_SCnotSCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) + \brief Type definitions for the Instrumentation Trace Macrocell (ITM) + @{ + */ + +/** + \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). + */ +typedef struct +{ + __OM union + { + __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ + __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ + __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ + } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ + uint32_t RESERVED0[864U]; + __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ + uint32_t RESERVED1[15U]; + __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ + uint32_t RESERVED2[15U]; + __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ + uint32_t RESERVED3[32U]; + uint32_t RESERVED4[43U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ + uint32_t RESERVED5[6U]; + __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ + __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ + __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ + __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ + __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ + __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ + __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ + __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ + __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ + __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ + __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ + __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ +} ITM_Type; + +/* ITM Trace Privilege Register Definitions */ +#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */ +#define ITM_TPR_PRIVMASK_Msk (0xFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ + +/* ITM Trace Control Register Definitions */ +#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */ +#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ + +#define ITM_TCR_TraceBusID_Pos 16U /*!< ITM TCR: ATBID Position */ +#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */ + +#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */ +#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ + +#define ITM_TCR_TSPrescale_Pos 8U /*!< ITM TCR: TSPrescale Position */ +#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */ + +#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */ +#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ + +#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */ +#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ + +#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */ +#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ + +#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */ +#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ + +#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ +#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ + +/* ITM Lock Status Register Definitions */ +#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */ +#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ + +#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */ +#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ + +#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ +#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ + +/*@}*/ /* end of group CMSIS_ITM */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ + __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ + __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ + __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ + __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ + __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + __IOM uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */ + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED0[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + __IOM uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */ + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + __IOM uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */ + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + __IOM uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */ + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */ +#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ + +#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */ +#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ + +#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */ +#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ + +#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */ +#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ + +#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */ +#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ + +#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */ +#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ + +#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */ +#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ + +#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */ +#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ + +#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */ +#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ + +#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */ +#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ + +#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */ +#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ + +#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */ +#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ + +#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */ +#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ + +/* DWT CPI Count Register Definitions */ +#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */ +#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ + +/* DWT Exception Overhead Count Register Definitions */ +#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */ +#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ + +/* DWT Sleep Count Register Definitions */ +#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */ +#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ + +/* DWT LSU Count Register Definitions */ +#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */ +#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ + +/* DWT Folded-instruction Count Register Definitions */ +#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */ +#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ + +/* DWT Comparator Mask Register Definitions */ +#define DWT_MASK_MASK_Pos 0U /*!< DWT MASK: MASK Position */ +#define DWT_MASK_MASK_Msk (0x1FUL /*<< DWT_MASK_MASK_Pos*/) /*!< DWT MASK: MASK Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVADDR1_Pos 16U /*!< DWT FUNCTION: DATAVADDR1 Position */ +#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos) /*!< DWT FUNCTION: DATAVADDR1 Mask */ + +#define DWT_FUNCTION_DATAVADDR0_Pos 12U /*!< DWT FUNCTION: DATAVADDR0 Position */ +#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos) /*!< DWT FUNCTION: DATAVADDR0 Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_LNK1ENA_Pos 9U /*!< DWT FUNCTION: LNK1ENA Position */ +#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos) /*!< DWT FUNCTION: LNK1ENA Mask */ + +#define DWT_FUNCTION_DATAVMATCH_Pos 8U /*!< DWT FUNCTION: DATAVMATCH Position */ +#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos) /*!< DWT FUNCTION: DATAVMATCH Mask */ + +#define DWT_FUNCTION_CYCMATCH_Pos 7U /*!< DWT FUNCTION: CYCMATCH Position */ +#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos) /*!< DWT FUNCTION: CYCMATCH Mask */ + +#define DWT_FUNCTION_EMITRANGE_Pos 5U /*!< DWT FUNCTION: EMITRANGE Position */ +#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos) /*!< DWT FUNCTION: EMITRANGE Mask */ + +#define DWT_FUNCTION_FUNCTION_Pos 0U /*!< DWT FUNCTION: FUNCTION Position */ +#define DWT_FUNCTION_FUNCTION_Msk (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/) /*!< DWT FUNCTION: FUNCTION Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IM uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */ + uint32_t RESERVED3[759U]; + __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER Register */ + __IM uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */ + __IM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */ + uint32_t RESERVED4[1U]; + __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */ + __IM uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */ + __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ + uint32_t RESERVED5[39U]; + __IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ + __IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ + uint32_t RESERVED7[8U]; + __IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */ +#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI TRIGGER Register Definitions */ +#define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */ +#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ + +/* TPI Integration ETM Data Register Definitions (FIFO0) */ +#define TPI_FIFO0_ITM_ATVALID_Pos 29U /*!< TPI FIFO0: ITM_ATVALID Position */ +#define TPI_FIFO0_ITM_ATVALID_Msk (0x1UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */ + +#define TPI_FIFO0_ITM_bytecount_Pos 27U /*!< TPI FIFO0: ITM_bytecount Position */ +#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */ + +#define TPI_FIFO0_ETM_ATVALID_Pos 26U /*!< TPI FIFO0: ETM_ATVALID Position */ +#define TPI_FIFO0_ETM_ATVALID_Msk (0x1UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */ + +#define TPI_FIFO0_ETM_bytecount_Pos 24U /*!< TPI FIFO0: ETM_bytecount Position */ +#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */ + +#define TPI_FIFO0_ETM2_Pos 16U /*!< TPI FIFO0: ETM2 Position */ +#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */ + +#define TPI_FIFO0_ETM1_Pos 8U /*!< TPI FIFO0: ETM1 Position */ +#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */ + +#define TPI_FIFO0_ETM0_Pos 0U /*!< TPI FIFO0: ETM0 Position */ +#define TPI_FIFO0_ETM0_Msk (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/) /*!< TPI FIFO0: ETM0 Mask */ + +/* TPI ITATBCTR2 Register Definitions */ +#define TPI_ITATBCTR2_ATREADY2_Pos 0U /*!< TPI ITATBCTR2: ATREADY2 Position */ +#define TPI_ITATBCTR2_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY2_Pos*/) /*!< TPI ITATBCTR2: ATREADY2 Mask */ + +#define TPI_ITATBCTR2_ATREADY1_Pos 0U /*!< TPI ITATBCTR2: ATREADY1 Position */ +#define TPI_ITATBCTR2_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY1_Pos*/) /*!< TPI ITATBCTR2: ATREADY1 Mask */ + +/* TPI Integration ITM Data Register Definitions (FIFO1) */ +#define TPI_FIFO1_ITM_ATVALID_Pos 29U /*!< TPI FIFO1: ITM_ATVALID Position */ +#define TPI_FIFO1_ITM_ATVALID_Msk (0x1UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */ + +#define TPI_FIFO1_ITM_bytecount_Pos 27U /*!< TPI FIFO1: ITM_bytecount Position */ +#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */ + +#define TPI_FIFO1_ETM_ATVALID_Pos 26U /*!< TPI FIFO1: ETM_ATVALID Position */ +#define TPI_FIFO1_ETM_ATVALID_Msk (0x1UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */ + +#define TPI_FIFO1_ETM_bytecount_Pos 24U /*!< TPI FIFO1: ETM_bytecount Position */ +#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */ + +#define TPI_FIFO1_ITM2_Pos 16U /*!< TPI FIFO1: ITM2 Position */ +#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */ + +#define TPI_FIFO1_ITM1_Pos 8U /*!< TPI FIFO1: ITM1 Position */ +#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */ + +#define TPI_FIFO1_ITM0_Pos 0U /*!< TPI FIFO1: ITM0 Position */ +#define TPI_FIFO1_ITM0_Msk (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/) /*!< TPI FIFO1: ITM0 Mask */ + +/* TPI ITATBCTR0 Register Definitions */ +#define TPI_ITATBCTR0_ATREADY2_Pos 0U /*!< TPI ITATBCTR0: ATREADY2 Position */ +#define TPI_ITATBCTR0_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY2_Pos*/) /*!< TPI ITATBCTR0: ATREADY2 Mask */ + +#define TPI_ITATBCTR0_ATREADY1_Pos 0U /*!< TPI ITATBCTR0: ATREADY1 Position */ +#define TPI_ITATBCTR0_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY1_Pos*/) /*!< TPI ITATBCTR0: ATREADY1 Mask */ + +/* TPI Integration Mode Control Register Definitions */ +#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */ +#define TPI_ITCTRL_Mode_Msk (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_MinBufSz_Pos 6U /*!< TPI DEVID: MinBufSz Position */ +#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */ + +#define TPI_DEVID_AsynClkIn_Pos 5U /*!< TPI DEVID: AsynClkIn Position */ +#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */ + +#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */ +#define TPI_DEVID_NrTraceInput_Msk (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ + __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */ + __IOM uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */ + __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */ + __IOM uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */ + __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */ + __IOM uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */ +} MPU_Type; + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_ADDR_Pos 5U /*!< MPU RBAR: ADDR Position */ +#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ + +#define MPU_RBAR_VALID_Pos 4U /*!< MPU RBAR: VALID Position */ +#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ + +#define MPU_RBAR_REGION_Pos 0U /*!< MPU RBAR: REGION Position */ +#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ + +/* MPU Region Attribute and Size Register Definitions */ +#define MPU_RASR_ATTRS_Pos 16U /*!< MPU RASR: MPU Region Attribute field Position */ +#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ + +#define MPU_RASR_XN_Pos 28U /*!< MPU RASR: ATTRS.XN Position */ +#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ + +#define MPU_RASR_AP_Pos 24U /*!< MPU RASR: ATTRS.AP Position */ +#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ + +#define MPU_RASR_TEX_Pos 19U /*!< MPU RASR: ATTRS.TEX Position */ +#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ + +#define MPU_RASR_S_Pos 18U /*!< MPU RASR: ATTRS.S Position */ +#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ + +#define MPU_RASR_C_Pos 17U /*!< MPU RASR: ATTRS.C Position */ +#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ + +#define MPU_RASR_B_Pos 16U /*!< MPU RASR: ATTRS.B Position */ +#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ + +#define MPU_RASR_SRD_Pos 8U /*!< MPU RASR: Sub-Region Disable Position */ +#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ + +#define MPU_RASR_SIZE_Pos 1U /*!< MPU RASR: Region Size Field Position */ +#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ + +#define MPU_RASR_ENABLE_Pos 0U /*!< MPU RASR: Region enable bit Position */ +#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** + \brief Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register Definitions */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ +#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register Definitions */ +#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register Definitions */ +#define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< CoreDebug DEMCR: TRCENA Position */ +#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ + +#define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< CoreDebug DEMCR: MON_REQ Position */ +#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ + +#define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< CoreDebug DEMCR: MON_STEP Position */ +#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ + +#define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< CoreDebug DEMCR: MON_PEND Position */ +#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ + +#define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< CoreDebug DEMCR: MON_EN Position */ +#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< CoreDebug DEMCR: VC_INTERR Position */ +#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ + +#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< CoreDebug DEMCR: VC_BUSERR Position */ +#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ + +#define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< CoreDebug DEMCR: VC_STATERR Position */ +#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ + +#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< CoreDebug DEMCR: VC_CHKERR Position */ +#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ + +#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< CoreDebug DEMCR: VC_NOCPERR Position */ +#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ + +#define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< CoreDebug DEMCR: VC_MMERR Position */ +#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ +#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ +#define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ +#define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ +#define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ +#define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ +#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ +#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ +#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + +#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ +#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ +#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ +#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ +#define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ +#define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ +#define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ +#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ +#endif + +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Debug Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ + #define NVIC_GetActive __NVIC_GetActive + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* The following EXC_RETURN values are saved the LR on exception entry */ +#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */ +#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */ +#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */ + + +/** + \brief Set Priority Grouping + \details Sets the priority grouping field using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ + SCB->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping + \details Reads the priority grouping field from the NVIC Interrupt Controller. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) +{ + return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + __COMPILER_BARRIER(); + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __COMPILER_BARRIER(); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IP[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC->IP[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t vectors = (uint32_t )SCB->VTOR; + (* (int *) (vectors + ((int32_t)IRQn + NVIC_USER_IRQ_OFFSET) * 4)) = vector; + /* ARM Application Note 321 states that the M3 does not require the architectural barrier */ +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t vectors = (uint32_t )SCB->VTOR; + return (uint32_t)(* (int *) (vectors + ((int32_t)IRQn + NVIC_USER_IRQ_OFFSET) * 4)); +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +/*@} end of CMSIS_Core_NVICFunctions */ + + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + return 0U; /* No FPU */ +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + +/* ##################################### Debug In/Output function ########################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_core_DebugFunctions ITM Functions + \brief Functions that access the ITM debug interface. + @{ + */ + +extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ +#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ + + +/** + \brief ITM Send Character + \details Transmits a character via the ITM channel 0, and + \li Just returns when no debugger is connected that has booked the output. + \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. + \param [in] ch Character to transmit. + \returns Character to transmit. + */ +__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) +{ + if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ + ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ + { + while (ITM->PORT[0U].u32 == 0UL) + { + __NOP(); + } + ITM->PORT[0U].u8 = (uint8_t)ch; + } + return (ch); +} + + +/** + \brief ITM Receive Character + \details Inputs a character via the external variable \ref ITM_RxBuffer. + \return Received character. + \return -1 No character pending. + */ +__STATIC_INLINE int32_t ITM_ReceiveChar (void) +{ + int32_t ch = -1; /* no character available */ + + if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) + { + ch = ITM_RxBuffer; + ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ + } + + return (ch); +} + + +/** + \brief ITM Check Character + \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. + \return 0 No character available. + \return 1 Character available. + */ +__STATIC_INLINE int32_t ITM_CheckChar (void) +{ + + if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) + { + return (0); /* no character available */ + } + else + { + return (1); /* character available */ + } +} + +/*@} end of CMSIS_core_DebugFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_SC300_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/mpu_armv7.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/mpu_armv7.h new file mode 100644 index 0000000000..66ef59b4a0 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/mpu_armv7.h @@ -0,0 +1,272 @@ +/****************************************************************************** + * @file mpu_armv7.h + * @brief CMSIS MPU API for Armv7-M MPU + * @version V5.1.0 + * @date 08. March 2019 + ******************************************************************************/ +/* + * Copyright (c) 2017-2019 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef ARM_MPU_ARMV7_H +#define ARM_MPU_ARMV7_H + +#define ARM_MPU_REGION_SIZE_32B ((uint8_t)0x04U) ///!< MPU Region Size 32 Bytes +#define ARM_MPU_REGION_SIZE_64B ((uint8_t)0x05U) ///!< MPU Region Size 64 Bytes +#define ARM_MPU_REGION_SIZE_128B ((uint8_t)0x06U) ///!< MPU Region Size 128 Bytes +#define ARM_MPU_REGION_SIZE_256B ((uint8_t)0x07U) ///!< MPU Region Size 256 Bytes +#define ARM_MPU_REGION_SIZE_512B ((uint8_t)0x08U) ///!< MPU Region Size 512 Bytes +#define ARM_MPU_REGION_SIZE_1KB ((uint8_t)0x09U) ///!< MPU Region Size 1 KByte +#define ARM_MPU_REGION_SIZE_2KB ((uint8_t)0x0AU) ///!< MPU Region Size 2 KBytes +#define ARM_MPU_REGION_SIZE_4KB ((uint8_t)0x0BU) ///!< MPU Region Size 4 KBytes +#define ARM_MPU_REGION_SIZE_8KB ((uint8_t)0x0CU) ///!< MPU Region Size 8 KBytes +#define ARM_MPU_REGION_SIZE_16KB ((uint8_t)0x0DU) ///!< MPU Region Size 16 KBytes +#define ARM_MPU_REGION_SIZE_32KB ((uint8_t)0x0EU) ///!< MPU Region Size 32 KBytes +#define ARM_MPU_REGION_SIZE_64KB ((uint8_t)0x0FU) ///!< MPU Region Size 64 KBytes +#define ARM_MPU_REGION_SIZE_128KB ((uint8_t)0x10U) ///!< MPU Region Size 128 KBytes +#define ARM_MPU_REGION_SIZE_256KB ((uint8_t)0x11U) ///!< MPU Region Size 256 KBytes +#define ARM_MPU_REGION_SIZE_512KB ((uint8_t)0x12U) ///!< MPU Region Size 512 KBytes +#define ARM_MPU_REGION_SIZE_1MB ((uint8_t)0x13U) ///!< MPU Region Size 1 MByte +#define ARM_MPU_REGION_SIZE_2MB ((uint8_t)0x14U) ///!< MPU Region Size 2 MBytes +#define ARM_MPU_REGION_SIZE_4MB ((uint8_t)0x15U) ///!< MPU Region Size 4 MBytes +#define ARM_MPU_REGION_SIZE_8MB ((uint8_t)0x16U) ///!< MPU Region Size 8 MBytes +#define ARM_MPU_REGION_SIZE_16MB ((uint8_t)0x17U) ///!< MPU Region Size 16 MBytes +#define ARM_MPU_REGION_SIZE_32MB ((uint8_t)0x18U) ///!< MPU Region Size 32 MBytes +#define ARM_MPU_REGION_SIZE_64MB ((uint8_t)0x19U) ///!< MPU Region Size 64 MBytes +#define ARM_MPU_REGION_SIZE_128MB ((uint8_t)0x1AU) ///!< MPU Region Size 128 MBytes +#define ARM_MPU_REGION_SIZE_256MB ((uint8_t)0x1BU) ///!< MPU Region Size 256 MBytes +#define ARM_MPU_REGION_SIZE_512MB ((uint8_t)0x1CU) ///!< MPU Region Size 512 MBytes +#define ARM_MPU_REGION_SIZE_1GB ((uint8_t)0x1DU) ///!< MPU Region Size 1 GByte +#define ARM_MPU_REGION_SIZE_2GB ((uint8_t)0x1EU) ///!< MPU Region Size 2 GBytes +#define ARM_MPU_REGION_SIZE_4GB ((uint8_t)0x1FU) ///!< MPU Region Size 4 GBytes + +#define ARM_MPU_AP_NONE 0U ///!< MPU Access Permission no access +#define ARM_MPU_AP_PRIV 1U ///!< MPU Access Permission privileged access only +#define ARM_MPU_AP_URO 2U ///!< MPU Access Permission unprivileged access read-only +#define ARM_MPU_AP_FULL 3U ///!< MPU Access Permission full access +#define ARM_MPU_AP_PRO 5U ///!< MPU Access Permission privileged access read-only +#define ARM_MPU_AP_RO 6U ///!< MPU Access Permission read-only access + +/** MPU Region Base Address Register Value +* +* \param Region The region to be configured, number 0 to 15. +* \param BaseAddress The base address for the region. +*/ +#define ARM_MPU_RBAR(Region, BaseAddress) \ + (((BaseAddress) & MPU_RBAR_ADDR_Msk) | \ + ((Region) & MPU_RBAR_REGION_Msk) | \ + (MPU_RBAR_VALID_Msk)) + +/** +* MPU Memory Access Attributes +* +* \param TypeExtField Type extension field, allows you to configure memory access type, for example strongly ordered, peripheral. +* \param IsShareable Region is shareable between multiple bus masters. +* \param IsCacheable Region is cacheable, i.e. its value may be kept in cache. +* \param IsBufferable Region is bufferable, i.e. using write-back caching. Cacheable but non-bufferable regions use write-through policy. +*/ +#define ARM_MPU_ACCESS_(TypeExtField, IsShareable, IsCacheable, IsBufferable) \ + ((((TypeExtField) << MPU_RASR_TEX_Pos) & MPU_RASR_TEX_Msk) | \ + (((IsShareable) << MPU_RASR_S_Pos) & MPU_RASR_S_Msk) | \ + (((IsCacheable) << MPU_RASR_C_Pos) & MPU_RASR_C_Msk) | \ + (((IsBufferable) << MPU_RASR_B_Pos) & MPU_RASR_B_Msk)) + +/** +* MPU Region Attribute and Size Register Value +* +* \param DisableExec Instruction access disable bit, 1= disable instruction fetches. +* \param AccessPermission Data access permissions, allows you to configure read/write access for User and Privileged mode. +* \param AccessAttributes Memory access attribution, see \ref ARM_MPU_ACCESS_. +* \param SubRegionDisable Sub-region disable field. +* \param Size Region size of the region to be configured, for example 4K, 8K. +*/ +#define ARM_MPU_RASR_EX(DisableExec, AccessPermission, AccessAttributes, SubRegionDisable, Size) \ + ((((DisableExec) << MPU_RASR_XN_Pos) & MPU_RASR_XN_Msk) | \ + (((AccessPermission) << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk) | \ + (((AccessAttributes) & (MPU_RASR_TEX_Msk | MPU_RASR_S_Msk | MPU_RASR_C_Msk | MPU_RASR_B_Msk))) | \ + (((SubRegionDisable) << MPU_RASR_SRD_Pos) & MPU_RASR_SRD_Msk) | \ + (((Size) << MPU_RASR_SIZE_Pos) & MPU_RASR_SIZE_Msk) | \ + (((MPU_RASR_ENABLE_Msk)))) + +/** +* MPU Region Attribute and Size Register Value +* +* \param DisableExec Instruction access disable bit, 1= disable instruction fetches. +* \param AccessPermission Data access permissions, allows you to configure read/write access for User and Privileged mode. +* \param TypeExtField Type extension field, allows you to configure memory access type, for example strongly ordered, peripheral. +* \param IsShareable Region is shareable between multiple bus masters. +* \param IsCacheable Region is cacheable, i.e. its value may be kept in cache. +* \param IsBufferable Region is bufferable, i.e. using write-back caching. Cacheable but non-bufferable regions use write-through policy. +* \param SubRegionDisable Sub-region disable field. +* \param Size Region size of the region to be configured, for example 4K, 8K. +*/ +#define ARM_MPU_RASR(DisableExec, AccessPermission, TypeExtField, IsShareable, IsCacheable, IsBufferable, SubRegionDisable, Size) \ + ARM_MPU_RASR_EX(DisableExec, AccessPermission, ARM_MPU_ACCESS_(TypeExtField, IsShareable, IsCacheable, IsBufferable), SubRegionDisable, Size) + +/** +* MPU Memory Access Attribute for strongly ordered memory. +* - TEX: 000b +* - Shareable +* - Non-cacheable +* - Non-bufferable +*/ +#define ARM_MPU_ACCESS_ORDERED ARM_MPU_ACCESS_(0U, 1U, 0U, 0U) + +/** +* MPU Memory Access Attribute for device memory. +* - TEX: 000b (if shareable) or 010b (if non-shareable) +* - Shareable or non-shareable +* - Non-cacheable +* - Bufferable (if shareable) or non-bufferable (if non-shareable) +* +* \param IsShareable Configures the device memory as shareable or non-shareable. +*/ +#define ARM_MPU_ACCESS_DEVICE(IsShareable) ((IsShareable) ? ARM_MPU_ACCESS_(0U, 1U, 0U, 1U) : ARM_MPU_ACCESS_(2U, 0U, 0U, 0U)) + +/** +* MPU Memory Access Attribute for normal memory. +* - TEX: 1BBb (reflecting outer cacheability rules) +* - Shareable or non-shareable +* - Cacheable or non-cacheable (reflecting inner cacheability rules) +* - Bufferable or non-bufferable (reflecting inner cacheability rules) +* +* \param OuterCp Configures the outer cache policy. +* \param InnerCp Configures the inner cache policy. +* \param IsShareable Configures the memory as shareable or non-shareable. +*/ +#define ARM_MPU_ACCESS_NORMAL(OuterCp, InnerCp, IsShareable) ARM_MPU_ACCESS_((4U | (OuterCp)), IsShareable, ((InnerCp) & 2U), ((InnerCp) & 1U)) + +/** +* MPU Memory Access Attribute non-cacheable policy. +*/ +#define ARM_MPU_CACHEP_NOCACHE 0U + +/** +* MPU Memory Access Attribute write-back, write and read allocate policy. +*/ +#define ARM_MPU_CACHEP_WB_WRA 1U + +/** +* MPU Memory Access Attribute write-through, no write allocate policy. +*/ +#define ARM_MPU_CACHEP_WT_NWA 2U + +/** +* MPU Memory Access Attribute write-back, no write allocate policy. +*/ +#define ARM_MPU_CACHEP_WB_NWA 3U + + +/** +* Struct for a single MPU Region +*/ +typedef struct { + uint32_t RBAR; //!< The region base address register value (RBAR) + uint32_t RASR; //!< The region attribute and size register value (RASR) \ref MPU_RASR +} ARM_MPU_Region_t; + +/** Enable the MPU. +* \param MPU_Control Default access permissions for unconfigured regions. +*/ +__STATIC_INLINE void ARM_MPU_Enable(uint32_t MPU_Control) +{ + MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk; +#ifdef SCB_SHCSR_MEMFAULTENA_Msk + SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk; +#endif + __DSB(); + __ISB(); +} + +/** Disable the MPU. +*/ +__STATIC_INLINE void ARM_MPU_Disable(void) +{ + __DMB(); +#ifdef SCB_SHCSR_MEMFAULTENA_Msk + SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk; +#endif + MPU->CTRL &= ~MPU_CTRL_ENABLE_Msk; +} + +/** Clear and disable the given MPU region. +* \param rnr Region number to be cleared. +*/ +__STATIC_INLINE void ARM_MPU_ClrRegion(uint32_t rnr) +{ + MPU->RNR = rnr; + MPU->RASR = 0U; +} + +/** Configure an MPU region. +* \param rbar Value for RBAR register. +* \param rsar Value for RSAR register. +*/ +__STATIC_INLINE void ARM_MPU_SetRegion(uint32_t rbar, uint32_t rasr) +{ + MPU->RBAR = rbar; + MPU->RASR = rasr; +} + +/** Configure the given MPU region. +* \param rnr Region number to be configured. +* \param rbar Value for RBAR register. +* \param rsar Value for RSAR register. +*/ +__STATIC_INLINE void ARM_MPU_SetRegionEx(uint32_t rnr, uint32_t rbar, uint32_t rasr) +{ + MPU->RNR = rnr; + MPU->RBAR = rbar; + MPU->RASR = rasr; +} + +/** Memcopy with strictly ordered memory access, e.g. for register targets. +* \param dst Destination data is copied to. +* \param src Source data is copied from. +* \param len Amount of data words to be copied. +*/ +__STATIC_INLINE void ARM_MPU_OrderedMemcpy(volatile uint32_t* dst, const uint32_t* __RESTRICT src, uint32_t len) +{ + uint32_t i; + for (i = 0U; i < len; ++i) + { + dst[i] = src[i]; + } +} + +/** Load the given number of MPU regions from a table. +* \param table Pointer to the MPU configuration table. +* \param cnt Amount of regions to be configured. +*/ +__STATIC_INLINE void ARM_MPU_Load(ARM_MPU_Region_t const* table, uint32_t cnt) +{ + const uint32_t rowWordSize = sizeof(ARM_MPU_Region_t)/4U; + while (cnt > MPU_TYPE_RALIASES) { + ARM_MPU_OrderedMemcpy(&(MPU->RBAR), &(table->RBAR), MPU_TYPE_RALIASES*rowWordSize); + table += MPU_TYPE_RALIASES; + cnt -= MPU_TYPE_RALIASES; + } + ARM_MPU_OrderedMemcpy(&(MPU->RBAR), &(table->RBAR), cnt*rowWordSize); +} + +#endif diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/mpu_armv8.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/mpu_armv8.h new file mode 100644 index 0000000000..0041d4dc6f --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/mpu_armv8.h @@ -0,0 +1,346 @@ +/****************************************************************************** + * @file mpu_armv8.h + * @brief CMSIS MPU API for Armv8-M and Armv8.1-M MPU + * @version V5.1.0 + * @date 08. March 2019 + ******************************************************************************/ +/* + * Copyright (c) 2017-2019 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef ARM_MPU_ARMV8_H +#define ARM_MPU_ARMV8_H + +/** \brief Attribute for device memory (outer only) */ +#define ARM_MPU_ATTR_DEVICE ( 0U ) + +/** \brief Attribute for non-cacheable, normal memory */ +#define ARM_MPU_ATTR_NON_CACHEABLE ( 4U ) + +/** \brief Attribute for normal memory (outer and inner) +* \param NT Non-Transient: Set to 1 for non-transient data. +* \param WB Write-Back: Set to 1 to use write-back update policy. +* \param RA Read Allocation: Set to 1 to use cache allocation on read miss. +* \param WA Write Allocation: Set to 1 to use cache allocation on write miss. +*/ +#define ARM_MPU_ATTR_MEMORY_(NT, WB, RA, WA) \ + (((NT & 1U) << 3U) | ((WB & 1U) << 2U) | ((RA & 1U) << 1U) | (WA & 1U)) + +/** \brief Device memory type non Gathering, non Re-ordering, non Early Write Acknowledgement */ +#define ARM_MPU_ATTR_DEVICE_nGnRnE (0U) + +/** \brief Device memory type non Gathering, non Re-ordering, Early Write Acknowledgement */ +#define ARM_MPU_ATTR_DEVICE_nGnRE (1U) + +/** \brief Device memory type non Gathering, Re-ordering, Early Write Acknowledgement */ +#define ARM_MPU_ATTR_DEVICE_nGRE (2U) + +/** \brief Device memory type Gathering, Re-ordering, Early Write Acknowledgement */ +#define ARM_MPU_ATTR_DEVICE_GRE (3U) + +/** \brief Memory Attribute +* \param O Outer memory attributes +* \param I O == ARM_MPU_ATTR_DEVICE: Device memory attributes, else: Inner memory attributes +*/ +#define ARM_MPU_ATTR(O, I) (((O & 0xFU) << 4U) | (((O & 0xFU) != 0U) ? (I & 0xFU) : ((I & 0x3U) << 2U))) + +/** \brief Normal memory non-shareable */ +#define ARM_MPU_SH_NON (0U) + +/** \brief Normal memory outer shareable */ +#define ARM_MPU_SH_OUTER (2U) + +/** \brief Normal memory inner shareable */ +#define ARM_MPU_SH_INNER (3U) + +/** \brief Memory access permissions +* \param RO Read-Only: Set to 1 for read-only memory. +* \param NP Non-Privileged: Set to 1 for non-privileged memory. +*/ +#define ARM_MPU_AP_(RO, NP) (((RO & 1U) << 1U) | (NP & 1U)) + +/** \brief Region Base Address Register value +* \param BASE The base address bits [31:5] of a memory region. The value is zero extended. Effective address gets 32 byte aligned. +* \param SH Defines the Shareability domain for this memory region. +* \param RO Read-Only: Set to 1 for a read-only memory region. +* \param NP Non-Privileged: Set to 1 for a non-privileged memory region. +* \oaram XN eXecute Never: Set to 1 for a non-executable memory region. +*/ +#define ARM_MPU_RBAR(BASE, SH, RO, NP, XN) \ + ((BASE & MPU_RBAR_BASE_Msk) | \ + ((SH << MPU_RBAR_SH_Pos) & MPU_RBAR_SH_Msk) | \ + ((ARM_MPU_AP_(RO, NP) << MPU_RBAR_AP_Pos) & MPU_RBAR_AP_Msk) | \ + ((XN << MPU_RBAR_XN_Pos) & MPU_RBAR_XN_Msk)) + +/** \brief Region Limit Address Register value +* \param LIMIT The limit address bits [31:5] for this memory region. The value is one extended. +* \param IDX The attribute index to be associated with this memory region. +*/ +#define ARM_MPU_RLAR(LIMIT, IDX) \ + ((LIMIT & MPU_RLAR_LIMIT_Msk) | \ + ((IDX << MPU_RLAR_AttrIndx_Pos) & MPU_RLAR_AttrIndx_Msk) | \ + (MPU_RLAR_EN_Msk)) + +#if defined(MPU_RLAR_PXN_Pos) + +/** \brief Region Limit Address Register with PXN value +* \param LIMIT The limit address bits [31:5] for this memory region. The value is one extended. +* \param PXN Privileged execute never. Defines whether code can be executed from this privileged region. +* \param IDX The attribute index to be associated with this memory region. +*/ +#define ARM_MPU_RLAR_PXN(LIMIT, PXN, IDX) \ + ((LIMIT & MPU_RLAR_LIMIT_Msk) | \ + ((PXN << MPU_RLAR_PXN_Pos) & MPU_RLAR_PXN_Msk) | \ + ((IDX << MPU_RLAR_AttrIndx_Pos) & MPU_RLAR_AttrIndx_Msk) | \ + (MPU_RLAR_EN_Msk)) + +#endif + +/** +* Struct for a single MPU Region +*/ +typedef struct { + uint32_t RBAR; /*!< Region Base Address Register value */ + uint32_t RLAR; /*!< Region Limit Address Register value */ +} ARM_MPU_Region_t; + +/** Enable the MPU. +* \param MPU_Control Default access permissions for unconfigured regions. +*/ +__STATIC_INLINE void ARM_MPU_Enable(uint32_t MPU_Control) +{ + MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk; +#ifdef SCB_SHCSR_MEMFAULTENA_Msk + SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk; +#endif + __DSB(); + __ISB(); +} + +/** Disable the MPU. +*/ +__STATIC_INLINE void ARM_MPU_Disable(void) +{ + __DMB(); +#ifdef SCB_SHCSR_MEMFAULTENA_Msk + SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk; +#endif + MPU->CTRL &= ~MPU_CTRL_ENABLE_Msk; +} + +#ifdef MPU_NS +/** Enable the Non-secure MPU. +* \param MPU_Control Default access permissions for unconfigured regions. +*/ +__STATIC_INLINE void ARM_MPU_Enable_NS(uint32_t MPU_Control) +{ + MPU_NS->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk; +#ifdef SCB_SHCSR_MEMFAULTENA_Msk + SCB_NS->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk; +#endif + __DSB(); + __ISB(); +} + +/** Disable the Non-secure MPU. +*/ +__STATIC_INLINE void ARM_MPU_Disable_NS(void) +{ + __DMB(); +#ifdef SCB_SHCSR_MEMFAULTENA_Msk + SCB_NS->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk; +#endif + MPU_NS->CTRL &= ~MPU_CTRL_ENABLE_Msk; +} +#endif + +/** Set the memory attribute encoding to the given MPU. +* \param mpu Pointer to the MPU to be configured. +* \param idx The attribute index to be set [0-7] +* \param attr The attribute value to be set. +*/ +__STATIC_INLINE void ARM_MPU_SetMemAttrEx(MPU_Type* mpu, uint8_t idx, uint8_t attr) +{ + const uint8_t reg = idx / 4U; + const uint32_t pos = ((idx % 4U) * 8U); + const uint32_t mask = 0xFFU << pos; + + if (reg >= (sizeof(mpu->MAIR) / sizeof(mpu->MAIR[0]))) { + return; // invalid index + } + + mpu->MAIR[reg] = ((mpu->MAIR[reg] & ~mask) | ((attr << pos) & mask)); +} + +/** Set the memory attribute encoding. +* \param idx The attribute index to be set [0-7] +* \param attr The attribute value to be set. +*/ +__STATIC_INLINE void ARM_MPU_SetMemAttr(uint8_t idx, uint8_t attr) +{ + ARM_MPU_SetMemAttrEx(MPU, idx, attr); +} + +#ifdef MPU_NS +/** Set the memory attribute encoding to the Non-secure MPU. +* \param idx The attribute index to be set [0-7] +* \param attr The attribute value to be set. +*/ +__STATIC_INLINE void ARM_MPU_SetMemAttr_NS(uint8_t idx, uint8_t attr) +{ + ARM_MPU_SetMemAttrEx(MPU_NS, idx, attr); +} +#endif + +/** Clear and disable the given MPU region of the given MPU. +* \param mpu Pointer to MPU to be used. +* \param rnr Region number to be cleared. +*/ +__STATIC_INLINE void ARM_MPU_ClrRegionEx(MPU_Type* mpu, uint32_t rnr) +{ + mpu->RNR = rnr; + mpu->RLAR = 0U; +} + +/** Clear and disable the given MPU region. +* \param rnr Region number to be cleared. +*/ +__STATIC_INLINE void ARM_MPU_ClrRegion(uint32_t rnr) +{ + ARM_MPU_ClrRegionEx(MPU, rnr); +} + +#ifdef MPU_NS +/** Clear and disable the given Non-secure MPU region. +* \param rnr Region number to be cleared. +*/ +__STATIC_INLINE void ARM_MPU_ClrRegion_NS(uint32_t rnr) +{ + ARM_MPU_ClrRegionEx(MPU_NS, rnr); +} +#endif + +/** Configure the given MPU region of the given MPU. +* \param mpu Pointer to MPU to be used. +* \param rnr Region number to be configured. +* \param rbar Value for RBAR register. +* \param rlar Value for RLAR register. +*/ +__STATIC_INLINE void ARM_MPU_SetRegionEx(MPU_Type* mpu, uint32_t rnr, uint32_t rbar, uint32_t rlar) +{ + mpu->RNR = rnr; + mpu->RBAR = rbar; + mpu->RLAR = rlar; +} + +/** Configure the given MPU region. +* \param rnr Region number to be configured. +* \param rbar Value for RBAR register. +* \param rlar Value for RLAR register. +*/ +__STATIC_INLINE void ARM_MPU_SetRegion(uint32_t rnr, uint32_t rbar, uint32_t rlar) +{ + ARM_MPU_SetRegionEx(MPU, rnr, rbar, rlar); +} + +#ifdef MPU_NS +/** Configure the given Non-secure MPU region. +* \param rnr Region number to be configured. +* \param rbar Value for RBAR register. +* \param rlar Value for RLAR register. +*/ +__STATIC_INLINE void ARM_MPU_SetRegion_NS(uint32_t rnr, uint32_t rbar, uint32_t rlar) +{ + ARM_MPU_SetRegionEx(MPU_NS, rnr, rbar, rlar); +} +#endif + +/** Memcopy with strictly ordered memory access, e.g. for register targets. +* \param dst Destination data is copied to. +* \param src Source data is copied from. +* \param len Amount of data words to be copied. +*/ +__STATIC_INLINE void ARM_MPU_OrderedMemcpy(volatile uint32_t* dst, const uint32_t* __RESTRICT src, uint32_t len) +{ + uint32_t i; + for (i = 0U; i < len; ++i) + { + dst[i] = src[i]; + } +} + +/** Load the given number of MPU regions from a table to the given MPU. +* \param mpu Pointer to the MPU registers to be used. +* \param rnr First region number to be configured. +* \param table Pointer to the MPU configuration table. +* \param cnt Amount of regions to be configured. +*/ +__STATIC_INLINE void ARM_MPU_LoadEx(MPU_Type* mpu, uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt) +{ + const uint32_t rowWordSize = sizeof(ARM_MPU_Region_t)/4U; + if (cnt == 1U) { + mpu->RNR = rnr; + ARM_MPU_OrderedMemcpy(&(mpu->RBAR), &(table->RBAR), rowWordSize); + } else { + uint32_t rnrBase = rnr & ~(MPU_TYPE_RALIASES-1U); + uint32_t rnrOffset = rnr % MPU_TYPE_RALIASES; + + mpu->RNR = rnrBase; + while ((rnrOffset + cnt) > MPU_TYPE_RALIASES) { + uint32_t c = MPU_TYPE_RALIASES - rnrOffset; + ARM_MPU_OrderedMemcpy(&(mpu->RBAR)+(rnrOffset*2U), &(table->RBAR), c*rowWordSize); + table += c; + cnt -= c; + rnrOffset = 0U; + rnrBase += MPU_TYPE_RALIASES; + mpu->RNR = rnrBase; + } + + ARM_MPU_OrderedMemcpy(&(mpu->RBAR)+(rnrOffset*2U), &(table->RBAR), cnt*rowWordSize); + } +} + +/** Load the given number of MPU regions from a table. +* \param rnr First region number to be configured. +* \param table Pointer to the MPU configuration table. +* \param cnt Amount of regions to be configured. +*/ +__STATIC_INLINE void ARM_MPU_Load(uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt) +{ + ARM_MPU_LoadEx(MPU, rnr, table, cnt); +} + +#ifdef MPU_NS +/** Load the given number of MPU regions from a table to the Non-secure MPU. +* \param rnr First region number to be configured. +* \param table Pointer to the MPU configuration table. +* \param cnt Amount of regions to be configured. +*/ +__STATIC_INLINE void ARM_MPU_Load_NS(uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt) +{ + ARM_MPU_LoadEx(MPU_NS, rnr, table, cnt); +} +#endif + +#endif + diff --git a/bsp/hc32f4a0/Libraries/CMSIS/Include/tz_context.h b/bsp/hc32f4a0/Libraries/CMSIS/Include/tz_context.h new file mode 100644 index 0000000000..0d09749f3a --- /dev/null +++ b/bsp/hc32f4a0/Libraries/CMSIS/Include/tz_context.h @@ -0,0 +1,70 @@ +/****************************************************************************** + * @file tz_context.h + * @brief Context Management for Armv8-M TrustZone + * @version V1.0.1 + * @date 10. January 2018 + ******************************************************************************/ +/* + * Copyright (c) 2017-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef TZ_CONTEXT_H +#define TZ_CONTEXT_H + +#include + +#ifndef TZ_MODULEID_T +#define TZ_MODULEID_T +/// \details Data type that identifies secure software modules called by a process. +typedef uint32_t TZ_ModuleId_t; +#endif + +/// \details TZ Memory ID identifies an allocated memory slot. +typedef uint32_t TZ_MemoryId_t; + +/// Initialize secure context memory system +/// \return execution status (1: success, 0: error) +uint32_t TZ_InitContextSystem_S (void); + +/// Allocate context memory for calling secure software modules in TrustZone +/// \param[in] module identifies software modules called from non-secure mode +/// \return value != 0 id TrustZone memory slot identifier +/// \return value 0 no memory available or internal error +TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module); + +/// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S +/// \param[in] id TrustZone memory slot identifier +/// \return execution status (1: success, 0: error) +uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id); + +/// Load secure context (called on RTOS thread context switch) +/// \param[in] id TrustZone memory slot identifier +/// \return execution status (1: success, 0: error) +uint32_t TZ_LoadContext_S (TZ_MemoryId_t id); + +/// Store secure context (called on RTOS thread context switch) +/// \param[in] id TrustZone memory slot identifier +/// \return execution status (1: success, 0: error) +uint32_t TZ_StoreContext_S (TZ_MemoryId_t id); + +#endif // TZ_CONTEXT_H diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_adc.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_adc.h new file mode 100644 index 0000000000..7d5610fcbe --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_adc.h @@ -0,0 +1,601 @@ +/** + ******************************************************************************* + * @file hc32f4a0_adc.h + * @brief This file contains all the functions prototypes of the ADC driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Wuze First version + 2020-12-15 Wuze ADC_ComTriggerCmd() refine. + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_ADC_H__ +#define __HC32F4A0_ADC_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_ADC + * @{ + */ + +#if (DDL_ADC_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup ADC_Global_Types ADC Global Types + * @{ + */ + +/** + * @brief Structure definition of ADC initialization. + */ +typedef struct +{ + uint16_t u16ScanMode; /*!< Configures the scan convert mode of ADC. + This parameter can be a value of @ref ADC_Scan_Convert_Mode */ + uint16_t u16Resolution; /*!< Configures the ADC resolution. + This parameter can be a value of @ref ADC_Resolution */ + uint16_t u16AutoClrCmd; /*!< Configures whether the ADC data register is + automatically cleared after the data is read. + This parameter can be a value of @ref ADC_Data_Auto_Clear_Cmd */ + uint16_t u16DataAlign; /*!< Specifies ADC data alignment to right or to left. + This parameter can be a value of @ref ADC_Data_Alignment */ + uint16_t u16SAResumePos; /*!< Specifies the resume channel position of sequence A. + Sequence A can be interrupted by sequence B. After the + the ending of sequence B, sequence A resumes from the + specified channel position. + This parameter can be a value of @ref ADC_Sequence_A_Resume_Channel_Position */ +} stc_adc_init_t; + +/** + * @brief Structure definition of ADC trigger source configuration. + */ +typedef struct +{ + uint16_t u16TrigSrc; /*!< Specifies the trigger source type for the specified sequence. + This parameter can be a value of @ref ADC_Trigger_Source_Type */ + en_event_src_t enEvent0; /*!< An @ref en_event_src_t enumeration value. */ + en_event_src_t enEvent1; /*!< An @ref en_event_src_t enumeration value. */ +} stc_adc_trig_cfg_t; + +/** + * @brief Structure definition of AWD(analog watchdog) configuration. + */ +typedef struct +{ + uint8_t u8ChNum; /*!< The number of the ADC channel which to be configured as an AWD channel. + This parameter can be a value of range [ADC_CH_NUM_0, ADC_CH_NUM_15] of @ref ADC_Channel_Number */ + uint16_t u16CmpMode; /*!< The comparison mode of AWD. + This parameter can be a value of @ref ADC_AWD_Comparison_Mode */ + uint16_t u16LowerLimit; /*!< Threshold lower limit value(to register ADC_AWDxDR0). */ + uint16_t u16UpperLimit; /*!< Threshold upper limit value(to register ADC_AWDxDR1). */ +} stc_adc_awd_cfg_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup ADC_Global_Macros ADC Global Macros + * @{ + */ + +/** + * @defgroup ADC_Sequence ADC Sequence + * @{ + */ +#define ADC_SEQ_A (0U) +#define ADC_SEQ_B (1U) +/** + * @} + */ + +/** + * @defgroup ADC_AWD_Unit ADC Analog Watchdog Unit + * @{ + */ +#define ADC_AWD_0 (0U) +#define ADC_AWD_1 (1U) +/** + * @} + */ + +/** + * @defgroup ADC_Scan_Convert_Mode ADC Scan Convert Mode + * @{ + */ +#define ADC_MODE_SA_SSHOT (0x0U) /*!< Sequence A single shot. */ +#define ADC_MODE_SA_CONT (ADC_CR0_MS_0) /*!< Sequence A continuous. */ +#define ADC_MODE_SA_SB_SSHOT (ADC_CR0_MS_1) /*!< Sequence A and B both single shot. */ +#define ADC_MODE_SA_CONT_SB_SSHOT (ADC_CR0_MS_1 | \ + ADC_CR0_MS_0) /*!< Sequence A continuous and sequence B single shot. */ +/** + * @} + */ + +/** + * @defgroup ADC_Resolution ADC Resolution + * @{ + */ +#define ADC_RESOLUTION_12BIT (0x0U) /*!< Resolution is 12 bit. */ +#define ADC_RESOLUTION_10BIT (ADC_CR0_ACCSEL_0) /*!< Resolution is 10 bit. */ +#define ADC_RESOLUTION_8BIT (ADC_CR0_ACCSEL_1) /*!< Resolution is 8 bit. */ +/** + * @} + */ + +/** + * @defgroup ADC_Data_Auto_Clear_Cmd ADC Data Auto Clear Cmd + * @{ + */ +#define ADC_AUTO_CLR_DISABLE (0x0U) +#define ADC_AUTO_CLR_ENABLE (ADC_CR0_CLREN) /*!< ADC data register is automatically cleared after the data is read. */ +/** + * @} + */ + +/** + * @defgroup ADC_Data_Alignment ADC Data Alignment + * @{ + */ +#define ADC_DATA_ALIGN_RIGHT (0x0U) +#define ADC_DATA_ALIGN_LEFT (ADC_CR0_DFMT) +/** + * @} + */ + +/** + * @defgroup ADC_Average_Count ADC Average Count + * @{ + */ +#define ADC_AVG_CNT_2 (0x0U) +#define ADC_AVG_CNT_4 (ADC_CR0_AVCNT_0) +#define ADC_AVG_CNT_8 (ADC_CR0_AVCNT_1) +#define ADC_AVG_CNT_16 (ADC_CR0_AVCNT_1 | ADC_CR0_AVCNT_0) +#define ADC_AVG_CNT_32 (ADC_CR0_AVCNT_2) +#define ADC_AVG_CNT_64 (ADC_CR0_AVCNT_2 | ADC_CR0_AVCNT_0) +#define ADC_AVG_CNT_128 (ADC_CR0_AVCNT_2 | ADC_CR0_AVCNT_1) +#define ADC_AVG_CNT_256 (ADC_CR0_AVCNT_2 | ADC_CR0_AVCNT_1 | ADC_CR0_AVCNT_0) +/** + * @} + */ + +/** + * @defgroup ADC_Sequence_A_Resume_Channel_Position ADC Sequence A Resume Channel Position + * @{ + */ +#define ADC_SA_RESUME_POS_INT_CH (0x0U) /*!< Resumes from the interrupt channel of the sequence. */ +#define ADC_SA_RESUME_POS_FIRST_CH (ADC_CR1_RSCHSEL) /*!< Resumes from the first channel of the sequence. */ +/** + * @} + */ + +/** + * @defgroup ADC_Trigger_Source_Type ADC Trigger Source Type + * @{ + */ +#define ADC_TRIG_SRC_ADTRG (0x0U) /*!< The trigger source is the falling edge(the low level of the should \ + hold at least 1.5*PCLK cycle) of external pin ADTRGx(x=1, 2, 3). */ +#define ADC_TRIG_SRC_EVENT0 (ADC_TRGSR_TRGSELA_0) /*!< The trigger source is a internal event from other peripheral. \ + Only one event can be configured to trigger ADC. */ +#define ADC_TRIG_SRC_EVENT1 (ADC_TRGSR_TRGSELA_1) /*!< The trigger source is a internal event from other peripheral. \ + Only one event can be configured to trigger ADC. */ +#define ADC_TRIG_SRC_EVENT0_EVENT1 (ADC_TRGSR_TRGSELA_0 | \ + ADC_TRGSR_TRGSELA_1) /*!< The trigger source are two internal events from other peripheral(s). \ + Two events can be configured to trigger ADC and one of which can trigger the ADC. */ +/** + * @} + */ + +/** + * @defgroup ADC_Channel_Number ADC Channel Number + * @{ + */ +#define ADC_CH_NUM_0 (0U) +#define ADC_CH_NUM_1 (1U) +#define ADC_CH_NUM_2 (2U) +#define ADC_CH_NUM_3 (3U) +#define ADC_CH_NUM_4 (4U) +#define ADC_CH_NUM_5 (5U) +#define ADC_CH_NUM_6 (6U) +#define ADC_CH_NUM_7 (7U) +#define ADC_CH_NUM_8 (8U) +#define ADC_CH_NUM_9 (9U) +#define ADC_CH_NUM_10 (10U) +#define ADC_CH_NUM_11 (11U) +#define ADC_CH_NUM_12 (12U) +#define ADC_CH_NUM_13 (13U) +#define ADC_CH_NUM_14 (14U) +#define ADC_CH_NUM_15 (15U) +#define ADC_CH_NUM_16 (16U) +#define ADC_CH_NUM_17 (17U) +#define ADC_CH_NUM_18 (18U) +#define ADC_CH_NUM_19 (19U) +/** + * @} + */ + +/** + * @defgroup ADC_Channel ADC Channel + * @{ + */ +#define ADC_CH0 (0x1UL << ADC_CH_NUM_0) +#define ADC_CH1 (0x1UL << ADC_CH_NUM_1) +#define ADC_CH2 (0x1UL << ADC_CH_NUM_2) +#define ADC_CH3 (0x1UL << ADC_CH_NUM_3) +#define ADC_CH4 (0x1UL << ADC_CH_NUM_4) +#define ADC_CH5 (0x1UL << ADC_CH_NUM_5) +#define ADC_CH6 (0x1UL << ADC_CH_NUM_6) +#define ADC_CH7 (0x1UL << ADC_CH_NUM_7) +#define ADC_CH8 (0x1UL << ADC_CH_NUM_8) +#define ADC_CH9 (0x1UL << ADC_CH_NUM_9) +#define ADC_CH10 (0x1UL << ADC_CH_NUM_10) +#define ADC_CH11 (0x1UL << ADC_CH_NUM_11) +#define ADC_CH12 (0x1UL << ADC_CH_NUM_12) +#define ADC_CH13 (0x1UL << ADC_CH_NUM_13) +#define ADC_CH14 (0x1UL << ADC_CH_NUM_14) +#define ADC_CH15 (0x1UL << ADC_CH_NUM_15) +#define ADC_CH16 (0x1UL << ADC_CH_NUM_16) +#define ADC_CH17 (0x1UL << ADC_CH_NUM_17) +#define ADC_CH18 (0x1UL << ADC_CH_NUM_18) +#define ADC_CH19 (0x1UL << ADC_CH_NUM_19) +#define ADC_EXT_CH (ADC_CH15) +/** + * @} + */ + +/** + * @defgroup ADC_Pin_Number ADC Pin Number + * @{ + */ +#define ADC123_IN0 (0U) /*!< PA0 */ +#define ADC123_IN1 (1U) /*!< PA1 */ +#define ADC123_IN2 (2U) /*!< PA2 */ +#define ADC123_IN3 (3U) /*!< PA3 */ +#define ADC12_IN4 (4U) /*!< PA4 */ +#define ADC12_IN5 (5U) /*!< PA5 */ +#define ADC12_IN6 (6U) /*!< PA6 */ +#define ADC12_IN7 (7U) /*!< PA7 */ +#define ADC12_IN8 (8U) /*!< PB0 */ +#define ADC12_IN9 (9U) /*!< PB1 */ +#define ADC123_IN10 (10U) /*!< PC0 */ +#define ADC123_IN11 (11U) /*!< PC1 */ +#define ADC123_IN12 (12U) /*!< PC2 */ +#define ADC123_IN13 (13U) /*!< PC3 */ +#define ADC12_IN14 (14U) /*!< PC4 */ +#define ADC12_IN15 (15U) /*!< PC5 */ + +#define ADC3_IN4 (4U) /*!< PF6 */ +#define ADC3_IN5 (5U) /*!< PF7 */ +#define ADC3_IN6 (6U) /*!< PF8 */ +#define ADC3_IN7 (7U) /*!< PF9 */ +#define ADC3_IN8 (8U) /*!< PF10 */ +#define ADC3_IN9 (9U) /*!< PF3 */ +#define ADC3_IN14 (14U) /*!< PF4 */ +#define ADC3_IN15 (15U) /*!< PF5 */ +#define ADC3_IN16 (16U) /*!< PH2 */ +#define ADC3_IN17 (17U) /*!< PH3 */ +#define ADC3_IN18 (18U) /*!< PH4 */ +#define ADC3_IN19 (19U) /*!< PH5 */ +/** + * @} + */ + +/** + * @defgroup ADC_All_Channels_Mask ADC All Channels Mask + * @{ + */ +#define ADC1_CH_ALL (0xFFFFUL) +#define ADC2_CH_ALL (0xFFFFUL) +#define ADC3_CH_ALL (0xFFFFFUL) +#define ADC_CH_REMAP_ALL (0xFFFFUL) +/** + * @} + */ + +/** + * @defgroup ADC_Channel_Count ADC Channel Count + * @{ + */ +#define ADC1_CH_COUNT (16U) +#define ADC2_CH_COUNT (16U) +#define ADC3_CH_COUNT (20U) +/** + * @} + */ + +/** + * @defgroup ADC_Invalid_Value ADC Invalid Value + * @{ + */ +#define ADC_INVALID_VAL (0xFFFFU) +/** + * @} + */ + +/** + * @defgroup ADC_Extend_Channel_Source ADC Extend Channel Source + * @{ + */ +#define ADC_EXCH_SRC_ADC_PIN (0x0U) /*!< The input source of the extended channel is analog input pin. */ +#define ADC_EXCH_SRC_INTERNAL (ADC_EXCHSELR_EXCHSEL) /*!< The input source of the extended channel is internal analog signal. */ +/** + * @} + */ + +/** + * @defgroup ADC_Sequence_Status_Flag ADC Sequence Status Flag + * @{ + */ +#define ADC_SEQ_FLAG_EOCA (ADC_ISR_EOCAF) /*!< Status flag of the end of conversion of sequence A. */ +#define ADC_SEQ_FLAG_EOCB (ADC_ISR_EOCBF) /*!< Status flag of the end of conversion of sequence B. */ +#define ADC_SEQ_FLAG_NESTED (ADC_ISR_SASTPDF) /*!< Status flag of sequence A was interrupted by sequence B. */ + +#define ADC_SEQ_FLAG_ALL (ADC_SEQ_FLAG_EOCA | \ + ADC_SEQ_FLAG_EOCB | \ + ADC_SEQ_FLAG_NESTED) +/** + * @} + */ + +/** + * @defgroup ADC_Synchronous_Unit ADC Synchronous Unit + * @{ + */ +#define ADC_SYNC_ADC1_ADC2 (0U) /*!< ADC1 and ADC2 work synchronously. */ +#define ADC_SYNC_ADC1_ADC2_ADC3 (ADC_SYNCCR_SYNCMD_0) /*!< ADC1, ADC2 and ADC3 work synchronously. */ +/** + * @} + */ + +/** + * @defgroup ADC_Synchronous_Mode ADC Synchronous Mode + * @{ + */ +#define ADC_SYNC_SSHOT_SEQUENTIAL (0U) /*!< Single shot trigger, sequentially trigger. \ + When the trigger condition occurs, ADC1 starts before ADC2, \ + and ADC1 and ADC2 only perform one sample conversion. */ +#define ADC_SYNC_SSHOT_SIMULTANEOUS (ADC_SYNCCR_SYNCMD_1) /*!< Single shot trigger, simultaneously trigger. \ + When the trigger condition occurs, ADC1 and ADC2 start at the same time, \ + and ADC1 and ADC2 only perform one sample conversion. */ +#define ADC_SYNC_CONT_SEQUENTIAL (ADC_SYNCCR_SYNCMD_2) /*!< Continuously trigger, sequentially trigger. \ + When the trigger condition occurs, ADC1 starts before ADC2, \ + and ADC1 and ADC2 will continue to sample conversion until stoped by software. */ +#define ADC_SYNC_CONT_SIMULTANEOUS (ADC_SYNCCR_SYNCMD_2 | \ + ADC_SYNCCR_SYNCMD_1) /*!< Continuously trigger, simultaneously trigger. \ + When the trigger condition occurs, ADC1 and ADC2 start at the same time, \ + and ADC1 and ADC2 will continue to sample conversion until stoped by software. */ +/** + * @} + */ + +/** + * @defgroup ADC_AWD_Comparison_Mode ADC AWD(Analog Watchdog) Comparison Mode + * @{ + */ +#define ADC_AWD_CMP_OUT_RANGE (0x0U) /*!< ADCVal > UpperLimit or ADCVal < LowerLimit */ +#define ADC_AWD_CMP_IN_RANGE (0x1U) /*!< LowerLimit < ADCVal < UpperLimit */ +/** + * @} + */ + +/** + * @defgroup ADC_AWD_Combination_Mode ADC AWD(Analog Watchdog) Combination Mode + * @note If combination mode is valid(ADC_AWD_COMB_OR/ADC_AWD_COMB_AND/ADC_AWD_COMB_XOR) and + the Channels selected by the AWD0 and AWD1 are deferent, make sure that the channel + of AWD1 is converted after the channel conversion of AWD0 ends. + * @{ + */ +#define ADC_AWD_COMB_OR (ADC_AWDCR_AWDCM_0) /*!< The status of AWD0 is set or the status of AWD1 is set, the status of combination mode is set. */ +#define ADC_AWD_COMB_AND (ADC_AWDCR_AWDCM_1) /*!< The status of AWD0 is set and the status of AWD1 is set, the status of combination mode is set. */ +#define ADC_AWD_COMB_XOR (ADC_AWDCR_AWDCM_1 | \ + ADC_AWDCR_AWDCM_0) /*!< Only one of the status of AWD0 and AWD1 is set, the status of combination mode is set. */ +/** + * @} + */ + +/** + * @defgroup ADC_AWD_Status_Flag ADC AWD Status Flag + * @{ + */ +#define ADC_AWD_FLAG_AWD0 (ADC_AWDSR_AWD0F) /*!< Flag of AWD0. */ +#define ADC_AWD_FLAG_AWD1 (ADC_AWDSR_AWD1F) /*!< Flag of AWD1. */ +#define ADC_AWD_FLAG_COMB (ADC_AWDSR_AWDCMF) /*!< Flag of combination of mode. */ + +#define ADC_AWD_FLAG_ALL (ADC_AWD_FLAG_AWD0 | \ + ADC_AWD_FLAG_AWD1 | \ + ADC_AWD_FLAG_COMB) +/** + * @} + */ + +/** + * @defgroup ADC_PGA_Gain_Factor ADC PGA Gain Factor + * @{ + */ +#define ADC_PGA_GAIN_2 (0U) /*!< PGA gain factor is 2. */ +#define ADC_PGA_GAIN_2P133 (ADC_PGACR3_PGAGAIN_0) /*!< PGA gain factor is 2.133. */ +#define ADC_PGA_GAIN_2P286 (ADC_PGACR3_PGAGAIN_1) /*!< PGA gain factor is 2.286. */ +#define ADC_PGA_GAIN_2P667 (ADC_PGACR3_PGAGAIN_1 | \ + ADC_PGACR3_PGAGAIN_0) /*!< PGA gain factor is 2.667. */ +#define ADC_PGA_GAIN_2P909 (ADC_PGACR3_PGAGAIN_2) /*!< PGA gain factor is 2.909. */ +#define ADC_PGA_GAIN_3P2 (ADC_PGACR3_PGAGAIN_2 | \ + ADC_PGACR3_PGAGAIN_0) /*!< PGA gain factor is 3.2. */ +#define ADC_PGA_GAIN_3P556 (ADC_PGACR3_PGAGAIN_2 | \ + ADC_PGACR3_PGAGAIN_1) /*!< PGA gain factor is 2.556. */ +#define ADC_PGA_GAIN_4 (ADC_PGACR3_PGAGAIN_2 | \ + ADC_PGACR3_PGAGAIN_1 | \ + ADC_PGACR3_PGAGAIN_0) /*!< PGA gain factor is 4. */ +#define ADC_PGA_GAIN_4P571 (ADC_PGACR3_PGAGAIN_3) /*!< PGA gain factor is 4.571. */ +#define ADC_PGA_GAIN_5P333 (ADC_PGACR3_PGAGAIN_3 | \ + ADC_PGACR3_PGAGAIN_0) /*!< PGA gain factor is 5.333. */ +#define ADC_PGA_GAIN_6P4 (ADC_PGACR3_PGAGAIN_3 | \ + ADC_PGACR3_PGAGAIN_1) /*!< PGA gain factor is 6.4. */ +#define ADC_PGA_GAIN_8 (ADC_PGACR3_PGAGAIN_3 | \ + ADC_PGACR3_PGAGAIN_1 | \ + ADC_PGACR3_PGAGAIN_0) /*!< PGA gain factor is 8. */ +#define ADC_PGA_GAIN_10P667 (ADC_PGACR3_PGAGAIN_3 | \ + ADC_PGACR3_PGAGAIN_2) /*!< PGA gain factor is 10.667. */ +#define ADC_PGA_GAIN_16 (ADC_PGACR3_PGAGAIN_3 | \ + ADC_PGACR3_PGAGAIN_2 | \ + ADC_PGACR3_PGAGAIN_0) /*!< PGA gain factor is 16. */ +#define ADC_PGA_GAIN_32 (ADC_PGACR3_PGAGAIN_3 | \ + ADC_PGACR3_PGAGAIN_2 | \ + ADC_PGACR3_PGAGAIN_1) /*!< PGA gain factor is 32. */ +/** + * @} + */ + +/** + * @defgroup ADC_PGA_VSS ADC PGA VSS + * @{ + */ +#define ADC_PGA_VSS_PGAVSS (0U) /*!< Use pin PGAx_VSS as the reference GND of PGAx */ +#define ADC_PGA_VSS_AVSS (1U) /*!< Use AVSS as the reference GND of PGAx. */ +/** + * @} + */ + +/** + * @defgroup ADC_PGA_Unit ADC PGA Unit + * @{ + */ +#define ADC_PGA_1 (0U) /*!< PGA1, belongs to ADC1. Input pin is ADC123_IN0. */ +#define ADC_PGA_2 (1U) /*!< PGA2, belongs to ADC1. Input pin is ADC123_IN1. */ +#define ADC_PGA_3 (2U) /*!< PGA3, belongs to ADC1. Input pin is ADC123_IN2. */ +#define ADC_PGA_4 (3U) /*!< PGA4, belongs to ADC2. Input pin is ADC12_IN6. */ +/** + * @} + */ + +/** + * @defgroup ADC_Common_Trigger_Sel ADC Common Trigger Source Select + * @{ + */ +#define ADC_COM_TRIG1 (AOS_ADC_1_ITRGSELR_COMTRG_EN_0) +#define ADC_COM_TRIG2 (AOS_ADC_1_ITRGSELR_COMTRG_EN_1) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup ADC_Global_Functions + * @{ + */ +en_result_t ADC_Init(M4_ADC_TypeDef *ADCx, const stc_adc_init_t *pstcInit); +void ADC_DeInit(M4_ADC_TypeDef *ADCx); + +en_result_t ADC_StructInit(stc_adc_init_t *pstcInit); + +void ADC_SetScanMode(M4_ADC_TypeDef *ADCx, uint16_t u16Mode); +en_result_t ADC_ChannelCmd(M4_ADC_TypeDef *ADCx, uint8_t u8Seq, \ + uint32_t u32AdcCh, const uint8_t pu8SplTime[], \ + en_functional_state_t enNewState); + +void ADC_AvgChannelConfig(M4_ADC_TypeDef *ADCx, uint16_t u16AvgCnt); +void ADC_AvgChannelCmd(M4_ADC_TypeDef *ADCx, uint32_t u32AdcCh, en_functional_state_t enNewState); +void ADC_SetExChannelSrc(M4_ADC_TypeDef *ADCx, uint8_t u8ExChSrc); + +en_result_t ADC_TrigSrcStructInit(stc_adc_trig_cfg_t *pstcCfg); +en_result_t ADC_TrigSrcConfig(M4_ADC_TypeDef *ADCx, uint8_t u8Seq, const stc_adc_trig_cfg_t *pstcCfg); +void ADC_TrigSrcCmd(M4_ADC_TypeDef *ADCx, uint8_t u8Seq, en_functional_state_t enNewState); +void ADC_ComTriggerCmd(M4_ADC_TypeDef *ADCx, uint16_t u16TrigSrc, \ + uint32_t u32ComTrig, en_functional_state_t enNewState); + +void ADC_SeqIntCmd(M4_ADC_TypeDef *ADCx, uint8_t u8Seq, en_functional_state_t enNewState); +en_flag_status_t ADC_SeqGetStatus(const M4_ADC_TypeDef *ADCx, uint8_t u8Flag); +void ADC_SeqClrStatus(M4_ADC_TypeDef *ADCx, uint8_t u8Flag); + +en_result_t ADC_AWD_Config(M4_ADC_TypeDef *ADCx, uint8_t u8AWDx, const stc_adc_awd_cfg_t *pstcCfg); +void ADC_AWD_CombModeCmd(M4_ADC_TypeDef *ADCx, uint16_t u16CombMode, en_functional_state_t enNewState); +void ADC_AWD_Cmd(M4_ADC_TypeDef *ADCx, uint8_t u8AWDx, en_functional_state_t enNewState); +void ADC_AWD_IntCmd(M4_ADC_TypeDef *ADCx, uint8_t u8AWDx, en_functional_state_t enNewState); +en_flag_status_t ADC_AWD_GetStatus(const M4_ADC_TypeDef *ADCx, uint8_t u8Flag); +void ADC_AWD_ClrStatus(M4_ADC_TypeDef *ADCx, uint8_t u8Flag); + +void ADC_PGA_Config(uint8_t u8PGAx, uint8_t u8GainFactor, uint8_t u8PgaVss); +void ADC_PGA_Cmd(uint8_t u8PGAx, en_functional_state_t enNewState); + +void ADC_SYNC_Config(uint16_t u16SyncUnit, uint16_t u16SyncMode, uint8_t u8TrigDelay); +void ADC_SYNC_Cmd(en_functional_state_t enNewState); + +void ADC_SH_Config(uint8_t u8SplTime); +void ADC_SH_ChannelCmd(uint32_t u32AdcCh, en_functional_state_t enNewState); + +void ADC_ChannelRemap(M4_ADC_TypeDef *ADCx, uint32_t u32AdcCh, uint8_t u8AdcPinNum); +uint8_t ADC_GetChannelPinNum(const M4_ADC_TypeDef *ADCx, uint32_t u32AdcCh); + +en_result_t ADC_PollingSA(M4_ADC_TypeDef *ADCx, uint16_t pu16AdcVal[], uint8_t u8Length, uint32_t u32Timeout); + +void ADC_Start(M4_ADC_TypeDef *ADCx); +void ADC_Stop(M4_ADC_TypeDef *ADCx); +en_result_t ADC_GetAllData(const M4_ADC_TypeDef *ADCx, uint16_t pu16AdcVal[], uint8_t u8Length); +en_result_t ADC_GetChannelData(const M4_ADC_TypeDef *ADCx, uint32_t u32TargetCh, \ + uint16_t pu16AdcVal[], uint8_t u8Length); +uint16_t ADC_GetValue(const M4_ADC_TypeDef *ADCx, uint8_t u8ChNum); + +/** + * @} + */ + +#endif /* DDL_ADC_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_ADC_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_aes.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_aes.h new file mode 100644 index 0000000000..1802901603 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_aes.h @@ -0,0 +1,132 @@ +/** + ******************************************************************************* + * @file hc32f4a0_aes.h + * @brief This file contains all the functions prototypes of the AES driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Heqb First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_AES_H__ +#define __HC32F4A0_AES_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_AES + * @{ + */ + +#if (DDL_AES_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup AES_Global_Macros AES Global Macros + * @{ + */ + +/* AES key length in bytes is 16. */ +#define AES_BLOCK_LEN (16U) + +/** + * @defgroup AES_STATUS AES Start or Stop + * @{ + */ +#define AES_START (AES_CR_START) +#define AES_STOP (0x0UL) +/** + * @} + */ + +/** + * @defgroup AES_KEY_SIZE AES Key Size + * @{ + */ +#define AES_KEY_SIZE_128BIT (0UL << AES_CR_KEYSIZE_POS) +#define AES_KEY_SIZE_192BIT (1UL << AES_CR_KEYSIZE_POS) +#define AES_KEY_SIZE_256BIT (2UL << AES_CR_KEYSIZE_POS) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup AES_Global_Functions + * @{ + */ +en_result_t AES_Encrypt(uint8_t au8Plaintext[], + uint32_t u32PlaintextSize, + const uint8_t *pu8Key, + uint8_t u8KeyLength, + uint8_t au8Ciphertext[]); + +en_result_t AES_Decrypt(uint8_t au8Ciphertext[], + uint32_t u32CiphertextSize, + const uint8_t *pu8Key, + uint8_t u8KeyLength, + uint8_t au8Plaintext[]); +/** + * @} + */ + +#endif /* DDL_AES_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_AES_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_can.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_can.h new file mode 100644 index 0000000000..6895a6fb20 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_can.h @@ -0,0 +1,723 @@ +/** + ******************************************************************************* + * @file hc32f4a0_can.h + * @brief This file contains all the functions prototypes of the CAN driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Wuze First version + 2020-12-14 Wuze Modified comment of structure stc_can_bt_cfg_t + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_CAN_H__ +#define __HC32F4A0_CAN_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_CAN + * @{ + */ + +#if (DDL_CAN_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup CAN_Global_Types CAN Global Types + * @{ + */ + +/** + * @brief CAN bit timing configuration structure. See 11898-1 for details. + * @note 1. Restrictions: u32SEG1 >= u32SEG2 + 1, u32SEG2 >= u32SJW. + * @note 2. TQ = u32Prescaler / CANClock. + * @note 3. Bit time = (u32SEG2 + u32SEG2) x TQ. + * @note 4. Baudrate = CANClock/(u32Prescaler*(u32SEG1 + u32SEG2)) + */ +typedef struct +{ + uint32_t u32SEG1; /*!< TQs of segment 1. Contains synchronization segment, \ + propagation time segment and phase buffer segment 1. */ + uint32_t u32SEG2; /*!< TQs of segment 2. Phase buffer segment 2. */ + uint32_t u32SJW; /*!< TQs of synchronization jump width. */ + uint32_t u32Prescaler; /*!< Range [1, 256]. */ +} stc_can_bt_cfg_t; + +/** + * @brief CAN acceptance filter structure. + */ +typedef struct +{ + uint32_t u32ID; /*!< 11 bits standard ID or 29 bits extended ID, depending on IDE. */ + uint32_t u32IDMsk; /*!< ID mask. The mask bits of ID will be ignored by the acceptance filter. */ + uint32_t u32MskType; /*!< Acceptance filter mask type. This parameter can be a value of @ref CAN_AF_Mask_Type */ +} stc_can_af_cfg_t; + +/** + * @brief CAN FD configuration structure. + */ +typedef struct +{ + uint8_t u8CANFDMode; /*!< CAN-FD mode, Bosch CAN-FD or 11898-1:2015 CAN-FD. + This parameter can be a value of @ref CAN_FD_Mode */ + stc_can_bt_cfg_t stcFBT; /*!< Bit timing configuration of fast bit timing. */ + uint8_t u8TDCCmd; /*!< Transmiter delay compensation function control. + This parameter can be a value of @ref CAN_FD_TDC_Command */ + uint8_t u8TDCSSP; /*!< Specify secondary sample point(SSP) of transmitter delay compensatin(TDC). Number of TQ. */ +} stc_can_fd_cfg_t; + +/** + * @brief CAN time-triggered communication configuration structure. + */ +typedef struct +{ + uint8_t u8TransBufMode; /*!< TTCAN Transmit Buffer Mode. + This parameter can be a value of @ref CAN_TTC_Transmit_Buffer_Mode */ + uint8_t u8NTUPrescaler; /*!< Prescaler of NTU(network time unit). The source is the bit time which is defined by SBT. + This parameter can be a value of @ref CAN_TTC_NTU_Prescaler */ + uint32_t u32RefMsgIDE; /*!< Reference message identifier extension bit. + '1' to set the ID which is specified by parameter 'u32RefMsgID' as an extended ID while \ + '0' to set it as a standard ID. */ + uint32_t u32RefMsgID; /*!< Reference message identifier. */ + uint16_t u16TrigType; /*!< Trigger type of TTC. + This parameter can be a value of @ref CAN_TTC_Trigger_Type */ + uint16_t u16TxEnWindow; /*!< Tx_Enable window. Time period within which the transmission of a message may be started. Range is [1, 16U] */ + uint16_t u16TxTrigTime; /*!< Specifies for the referred message the time window of the matrix cycle at which it is to be transmitted. */ + uint16_t u16WatchTrigTime; /*!< Time mark used to check whether the time since the last valid reference message has been too long. */ +} stc_can_ttc_cfg_t; + +/** + * @brief CAN initialization structure. + */ +typedef struct +{ + uint8_t u8WorkMode; /*!< Specify the work mode of CAN. + This parameter can be a value of @ref CAN_Work_Mode */ + stc_can_bt_cfg_t stcSBT; /*!< Bit timing configuration of slow bit timing. */ + + en_functional_state_t enCANFDCmd; /*!< Enable or Disable CAN-FD. If Disable, the following configuration valuse will not \ + be written to the registers. */ + + stc_can_fd_cfg_t stcFDCfg; /*!< CAN-FD configuration structure. */ + + uint8_t u8TransMode; /*!< Transmission mode of PTB and STB. + This parameter can be a value of @ref CAN_Trans_Mode */ + uint8_t u8STBPrioMode; /*!< Priority mode of STB. First in first transmit. OR the priority is determined by ID. Smaller ID higher priority. + Whatever the priority mode of STB is, PTB always has the highest priority. + This parameter can be a value of @ref CAN_STB_Priority_Mode */ + uint8_t u8RBSWarnLimit; /*!< Specify receive buffer almost full warning limit. Rang is [1, 8]. \ + Each CAN unit has 8 receive buffer slots. When the number of received frames reaches \ + the set value of u8RBSWarnLimit, register bit RTIF.RAFIF is set and the interrupt occurred \ + if it was enabled. */ + uint8_t u8ErrWarnLimit; /*!< Specify programmable error warning limit. Range is [0, 15]. \ + Error warning limit = (u8ErrWarnLimit + 1) * 8. */ + stc_can_af_cfg_t *pstcAFCfg; /*!< Points to a stc_can_af_cfg_t structure type pointer value that + contains the configuration informations for the acceptance filters. */ + uint16_t u16AFSel; /*!< Specify acceptance filter for receive buffer. + This parameter can be values of @ref CAN_AF */ + uint8_t u8RBStoreSel; /*!< Receive buffer stores all data frames, includes error data. + This parameter can be a value of @ref CAN_RB_Store_Selection */ + uint8_t u8RBOvfOp; /*!< Operation when receive buffer overflow. + This parameter can be a value of @ref CAN_RB_Overflow_Operation */ + uint8_t u8SelfACKCmd; /*!< Self ACK. Only for external loopback mode. + This parameter can be a value of @ref CAN_Self_ACK_Command */ +} stc_can_init_t; + +/** + * @brief CAN transmit data structure. + */ +typedef struct +{ + uint32_t u32ID; /*!< 11 bits standard ID or 29 bits extended ID, depending on IDE. */ + union + { + uint32_t u32Ctrl; + struct + { + uint32_t DLC: 4; /*!< Data length code. Length of the data segment of data frame. \ + It should be zero while the frame is remote frame. \ + This parameter can be a value of @ref CAN_DLC */ + uint32_t BRS: 1; /*!< Bit rate switch. */ + uint32_t FDF: 1; /*!< CAN FD frame. */ + uint32_t RTR: 1; /*!< Remote transmission request bit. + It is used to distinguish between data frames and remote frames. */ + uint32_t IDE: 1; /*!< Identifier extension flag. + It is used to distinguish between standard format and extended format. + This parameter can be a 1 or 0. */ + uint32_t RSVD: 24; /*!< Reserved bits. */ + }; + }; + uint8_t *pu8Data; /*!< Pointer to data filed of data frame. */ +} stc_can_tx_t; + +/** + * @brief CAN receive data structure. + */ +typedef struct +{ + uint32_t u32ID; /*!< 11 bits standard ID or 29 bits extended ID, depending on IDE. */ + union + { + uint32_t u32Ctrl; + struct + { + uint32_t DLC: 4; /*!< Data length code. Length of the data segment of data frame. \ + It should be zero while the frame is remote frame. \ + This parameter can be a value of @ref CAN_DLC */ + uint32_t BRS: 1; /*!< Bit rate switch. */ + uint32_t FDF: 1; /*!< CAN FD frame. */ + uint32_t RTR: 1; /*!< Remote transmission request bit. + It is used to distinguish between data frames and remote frames. */ + uint32_t IDE: 1; /*!< Identifier extension flag. + It is used to distinguish between standard format and extended format. + This parameter can be 1 or 0. */ + uint32_t RSVD: 4; /*!< Reserved bits. */ + uint32_t TX: 1; /*!< This bit is set to 1 when receiving self-transmitted data in loopback mode. */ + uint32_t ERRT: 3; /*!< Error type. */ + uint32_t CYCLE_TIME: 16; /*!< Cycle time of time-triggered communication(TTC). */ + }; + }; + uint8_t *pu8Data; /*!< Pointer to data filed of data frame. */ +} stc_can_rx_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup CAN_Global_Macros CAN Global Macros + * @{ + */ + +/** + * @defgroup CAN_Work_Mode CAN Work Mode + * @{ + */ +#define CAN_MODE_NORMAL (0U) /*!< Normal work mode. */ +#define CAN_MODE_SILENT (1U) /*!< Silent work mode. Prohibit data transmission. */ +#define CAN_MODE_ILB (2U) /*!< Internal loopback mode, just for self-test while developing. */ +#define CAN_MODE_ELB (3U) /*!< External loopback mode, just for self-test while developing. */ +#define CAN_MODE_ELB_SILENT (4U) /*!< External loppback silent mode, just for self-test while developing. \ + It is forbidden to respond to received frames and error frames, but data can be transmitted. */ +/** + * @} + */ + +/** + * @defgroup CAN_Transmit_Buffer_Type CAN Transmit Buffer Type + * @{ + */ +#define CAN_BUF_PTB (0U) /*!< Primary transmit buffer. */ +#define CAN_BUF_STB (1U) /*!< Secondary transmit buffer. */ +/** + * @} + */ + +/** + * @defgroup CAN_DLC CAN Data_Length_Code + * @{ + */ +#define CAN_DLC_0 (0x0U) /*!< CAN2.0 and CAN FD: payload is 0 in bytes. */ +#define CAN_DLC_1 (0x1U) /*!< CAN2.0 and CAN FD: payload is 1 in bytes. */ +#define CAN_DLC_2 (0x2U) /*!< CAN2.0 and CAN FD: payload is 2 in bytes. */ +#define CAN_DLC_3 (0x3U) /*!< CAN2.0 and CAN FD: payload is 3 in bytes. */ +#define CAN_DLC_4 (0x4U) /*!< CAN2.0 and CAN FD: payload is 4 in bytes. */ +#define CAN_DLC_5 (0x5U) /*!< CAN2.0 and CAN FD: payload is 5 in bytes. */ +#define CAN_DLC_6 (0x6U) /*!< CAN2.0 and CAN FD: payload is 6 in bytes. */ +#define CAN_DLC_7 (0x7U) /*!< CAN2.0 and CAN FD: payload is 7 in bytes. */ +#define CAN_DLC_8 (0x8U) /*!< CAN2.0 and CAN FD: payload is 8 in bytes. */ +#define CAN_DLC_12 (0x9U) /*!< CAN FD: payload is 12 in bytes. CAN2.0: payload is 8 in bytes. */ +#define CAN_DLC_16 (0xAU) /*!< CAN FD: payload is 16 in bytes. CAN2.0: payload is 8 in bytes. */ +#define CAN_DLC_20 (0xBU) /*!< CAN FD: payload is 20 in bytes. CAN2.0: payload is 8 in bytes. */ +#define CAN_DLC_24 (0xCU) /*!< CAN FD: payload is 24 in bytes. CAN2.0: payload is 8 in bytes. */ +#define CAN_DLC_32 (0xDU) /*!< CAN FD: payload is 32 in bytes. CAN2.0: payload is 8 in bytes. */ +#define CAN_DLC_48 (0xEU) /*!< CAN FD: payload is 48 in bytes. CAN2.0: payload is 8 in bytes. */ +#define CAN_DLC_64 (0xFU) /*!< CAN FD: payload is 64 in bytes. CAN2.0: payload is 8 in bytes. */ +/** + * @} + */ + +/** + * @defgroup CAN_Trans_Mode CAN Transmission Mode + * @{ + */ +#define CAN_TRANS_PTB_STB_AUTO_RETX (0x0U) /*!< Both PTB and STB automatically retransmit. */ +#define CAN_TRANS_PTB_SSHOT (CAN_CFG_STAT_TPSS) /*!< PTB single shot transmission mode. */ +#define CAN_TRANS_STB_SSHOT (CAN_CFG_STAT_TSSS) /*!< STB single shot transmission mode. */ +#define CAN_TRANS_PTB_STB_SSHOT (CAN_CFG_STAT_TPSS | \ + CAN_CFG_STAT_TSSS) /*!< STB single shot, PTB single shot. */ +/** + * @} + */ + +/** + * @defgroup CAN_STB_Trans_Control CAN STB Transmission Control + * @{ + */ +#define CAN_STB_TRANS_ALL (0U) /*!< Transmit all of STB slots. */ +#define CAN_STB_TRANS_ONE (1U) /*!< Transmit one STB slot. */ +/** + * @} + */ + +/** + * @defgroup CAN_STB_Priority_Mode CAN STB Priority Mode + * @{ + */ +#define CAN_STB_PRIO_FIFO (0x0U) /*!< Data first in and first be transmitted. */ +#define CAN_STB_PRIO_ID (CAN_TCTRL_TSMODE) /*!< Data with smallest ID first be transmitted. */ +/** + * @} + */ + +/** + * @defgroup CAN_TB_Status CAN Transmit Buffer Status + * @{ + */ +#define CAN_TB_STAT_EMPTY (0x0U) /*!< TTCAN is disabled(TTEN == 0): STB is empty. \ + TTCAN is disabled(TTEN == 1) and transmit buffer is specified by TBPTR and TTPTR(TTTBM == 1): \ + PTB and STB are both empty. */ +#define CAN_TB_STAT_LESS_HALF (0x1U) /*!< TTEN == 0: STB is not less than half full; \ + TTEN == 1 && TTTBM == 1: PTB and STB are neither empty. */ +#define CAN_TB_STAT_MORE_HALF (0x2U) /*!< TTEN == 0: STB is more than half full; \ + TTEN == 1 && TTTBM == 1: reserved value. */ +#define CAN_TB_STAT_FULL (0x3U) /*!< TTEN == 0: STB is full; \ + TTEN == 1 && TTTBM == 1: PTB and STB are both full. */ +/** + * @} + */ + +/** + * @defgroup CAN_RB_Status CAN Receive Buffer Status + * @{ + */ +#define CAN_RB_STAT_EMPTY (0x0U) /*!< Receive buffer(RB) is empty. */ +#define CAN_RB_STAT_LESS_WARN_LIMIT (0x1U) /*!< RB is not empty, but is less than almost full warning limit. */ +#define CAN_RB_STAT_MORE_WARN_LIMIT (0x2U) /*!< RB is not full, but is more than or equal to almost full warning limit. */ +#define CAN_RB_STAT_FULL (0x3U) /*!< RB is full. */ +/** + * @} + */ + +/** + * @defgroup CAN_FD_Mode CAN FD Mode + * @{ + */ +#define CAN_FD_MODE_BOSCH (0x0U) +#define CAN_FD_MODE_ISO_11898 (CAN_TCTRL_FD_ISO) +/** + * @} + */ + +/** + * @defgroup CAN_RB_Store_Selection CAN Receive Buffer Store Selection + * @{ + */ +#define CAN_RB_STORE_CORRECT_DATA (0x0U) /*!< Receive buffer stores correct data frames only. */ +#define CAN_RB_STORE_ALL_DATA (CAN_RCTRL_RBALL) /*!< Receive buffer stores all data frames, includes error data. */ +/** + * @} + */ + +/** + * @defgroup CAN_RB_Overflow_Operation CAN Receive Buffer Overflow Operation + * @{ + */ +#define CAN_RB_OVF_SAVE_NEW (0x0U) /*!< Saves the newly received data and the first received data will be overwritten. */ +#define CAN_RB_OVF_DISCARD_NEW (CAN_RCTRL_ROM) /*!< Discard the newly received data. */ +/** + * @} + */ + +/** + * @defgroup CAN_Self_ACK_Command CAN Self ACK Command + * @{ + */ +#define CAN_SELF_ACK_DISABLE (0x0U) +#define CAN_SELF_ACK_ENABLE (CAN_RCTRL_SACK) +/** + * @} + */ + +/** + * @defgroup CAN_FD_TDC_Command CAN-FD Transmiter Delay Compensation Command + * @{ + */ +#define CAN_FD_TDC_DISABLE (0x0U) +#define CAN_FD_TDC_ENABLE (CAN_TDC_TDCEN) +/** + * @} + */ + +/** + * @defgroup CAN_Interrupt_Type CAN Interrupt Type + * @{ + */ +#define CAN_INT_ERR_INT (1UL << 1U) /*!< Register bit RTIE.EIE. Error interrupt. */ +#define CAN_INT_STB_TRANS_OK (1UL << 2U) /*!< Register bit RTIE.TSIE. Secondary transmit buffer was transmitted successfully. */ +#define CAN_INT_PTB_TRANS_OK (1UL << 3U) /*!< Register bit RTIE.TPIE. Primary transmit buffer was transmitted successfully. */ +#define CAN_INT_RB_ALMOST_FULL (1UL << 4U) /*!< Register bit RTIE.RAFIE. The number of filled RB slot is greater than or equal to the LIMIT.AFWL setting value. */ +#define CAN_INT_RB_FIFO_FULL (1UL << 5U) /*!< Register bit RTIE.RFIE. The FIFO of receive buffer is full. */ +#define CAN_INT_RX_OVERRUN (1UL << 6U) /*!< Register bit RTIE.ROIE. Receive buffers are full and there is a further message to be stored. */ +#define CAN_INT_RX (1UL << 7U) /*!< Register bit RTIE.RIE. Received a valid data frame or remote frame. */ +#define CAN_INT_BUS_ERR (1UL << 9U) /*!< Register bit ERRINT.BEIE. Arbitration lost caused bus error */ +#define CAN_INT_ARB_LOST (1UL << 11U) /*!< Register bit ERRINT.ALIE. Arbitration lost. */ +#define CAN_INT_ERR_PASSIVE (1UL << 13U) /*!< Register bit ERRINT.EPIE. A change from error-passive to error-active or error-active to error-passive has occurred. */ + +#define CAN_INT_ALL (CAN_INT_ERR_INT | \ + CAN_INT_STB_TRANS_OK | \ + CAN_INT_PTB_TRANS_OK | \ + CAN_INT_RB_ALMOST_FULL | \ + CAN_INT_RB_FIFO_FULL | \ + CAN_INT_RX_OVERRUN | \ + CAN_INT_RX | \ + CAN_INT_BUS_ERR | \ + CAN_INT_ARB_LOST | \ + CAN_INT_ERR_PASSIVE) +/** + * @} + */ + +/** + * @defgroup CAN_Common_Status_Flag CAN Common Status Flag + * @{ + */ +#define CAN_FLAG_BUS_OFF (1UL << 0U) /*!< Register bit CFG_STAT.BUSOFF. CAN bus off. */ +#define CAN_FLAG_BUS_TX (1UL << 1U) /*!< Register bit CFG_STAT.TACTIVE. CAN bus is transmitting. */ +#define CAN_FLAG_BUS_RX (1UL << 2U) /*!< Register bit CFG_STAT.RACTIVE. CAN bus is receiving. */ +#define CAN_FLAG_RB_OVF (1UL << 5U) /*!< Register bit RCTRL.ROV. Receive buffer is full and there is a further bit to be stored. At least one data is lost. */ +#define CAN_FLAG_TB_FULL (1UL << 8U) /*!< Register bit RTIE.TSFF. Transmit buffers are all full. \ + TTCFG.TTEN == 0 or TCTRL.TTTEM == 0: ALL STB slots are filled. \ + TTCFG.TTEN == 1 and TCTRL.TTTEM == 1: Transmit buffer that pointed by TBSLOT.TBPTR is filled.*/ +#define CAN_FLAG_TRANS_ABORTED (1UL << 16U) /*!< Register bit RTIF.AIF. Transmit messages requested via TCMD.TPA and TCMD.TSA were successfully canceled. */ +#define CAN_FLAG_ERR_INT (1UL << 17U) /*!< Register bit RTIF.EIF. The CFG_STAT.BUSOFF bit changes, or the relative relationship between the value of the error counter and the \ + set value of the ERROR warning limit changes. For example, the value of the error counter changes from less than \ + the set value to greater than the set value, or from greater than the set value to less than the set value. */ +#define CAN_FLAG_STB_TRANS_OK (1UL << 18U) /*!< Register bit RTIF.TSIF. STB was transmitted successfully. */ +#define CAN_FLAG_PTB_TRANS_OK (1UL << 19U) /*!< Register bit RTIF.TPIF. PTB was transmitted successfully. */ +#define CAN_FLAG_RB_ALMOST_FULL (1UL << 20U) /*!< Register bit RTIF.RAFIF. The number of filled RB slot is greater than or equal to the LIMIT.AFWL setting value. */ +#define CAN_FLAG_RB_FIFO_FULL (1UL << 21U) /*!< Register bit RTIF.RFIF. The FIFO of receive buffer is full. */ +#define CAN_FLAG_RX_OVERRUN (1UL << 22U) /*!< Register bit RTIF.ROIF. Receive buffers are all full and there is a further message to be stored. */ +#define CAN_FLAG_RX_OK (1UL << 23U) /*!< Register bit RTIF.RIF. Received a valid data frame or remote frame. */ +#define CAN_FLAG_BUS_ERR (1UL << 24U) /*!< Register bit ERRINT.BEIF. Arbitration lost caused bus error. */ +#define CAN_FLAG_ARB_LOST (1UL << 26U) /*!< Register bit ERRINT.ALIF. Arbitration lost. */ +#define CAN_FLAG_ERR_PASSIVE (1UL << 28U) /*!< Register bit ERRINT.EPIF. A change from error-passive to error-active or error-active to error-passive has occurred. */ +#define CAN_FLAG_ERR_PASSIVE_NODE (1UL << 30U) /*!< Register bit ERRINT.EPASS. The node is an error-passive node. */ +#define CAN_FLAG_REACH_WARN_LIMIT (1UL << 31U) /*!< Register bit ERRINT.EWARN. REC or TEC is greater than or equal to the LIMIT.EWL setting value. */ + +#define CAN_FLAG_ALL (CAN_FLAG_BUS_OFF | \ + CAN_FLAG_BUS_TX | \ + CAN_FLAG_BUS_RX | \ + CAN_FLAG_RB_OVF | \ + CAN_FLAG_TB_FULL | \ + CAN_FLAG_TRANS_ABORTED | \ + CAN_FLAG_ERR_INT | \ + CAN_FLAG_STB_TRANS_OK | \ + CAN_FLAG_PTB_TRANS_OK | \ + CAN_FLAG_RB_ALMOST_FULL | \ + CAN_FLAG_RB_FIFO_FULL | \ + CAN_FLAG_RX_OVERRUN | \ + CAN_FLAG_RX_OK | \ + CAN_FLAG_BUS_ERR | \ + CAN_FLAG_ARB_LOST | \ + CAN_FLAG_ERR_PASSIVE | \ + CAN_FLAG_ERR_PASSIVE_NODE | \ + CAN_FLAG_REACH_WARN_LIMIT) + +#define CAN_FLAG_CLR_MSK (CAN_FLAG_RB_OVF | \ + CAN_FLAG_TRANS_ABORTED | \ + CAN_FLAG_ERR_INT | \ + CAN_FLAG_STB_TRANS_OK | \ + CAN_FLAG_PTB_TRANS_OK | \ + CAN_FLAG_RB_ALMOST_FULL | \ + CAN_FLAG_RB_FIFO_FULL | \ + CAN_FLAG_RX_OVERRUN | \ + CAN_FLAG_RX_OK | \ + CAN_FLAG_BUS_ERR | \ + CAN_FLAG_ARB_LOST | \ + CAN_FLAG_ERR_PASSIVE | \ + CAN_FLAG_ERR_PASSIVE_NODE | \ + CAN_FLAG_REACH_WARN_LIMIT) + +#define CAN_FLAG_TX_ERR_MSK (CAN_FLAG_BUS_OFF | \ + CAN_FLAG_TB_FULL | \ + CAN_FLAG_ERR_INT | \ + CAN_FLAG_BUS_ERR | \ + CAN_FLAG_ARB_LOST | \ + CAN_FLAG_ERR_PASSIVE | \ + CAN_FLAG_ERR_PASSIVE_NODE | \ + CAN_FLAG_REACH_WARN_LIMIT) + +/** + * @} + */ + +/** + * @defgroup CAN_AF_Mask_Type CAN AF Mask Type + * @{ + */ +#define CAN_AF_MSK_STD_EXT (0x0U) /*!< Acceptance filter accept standard ID mask and extended ID mask. */ +#define CAN_AF_MSK_STD (CAN_ACF_AIDEE) /*!< Acceptance filter accept standard ID mask. */ +#define CAN_AF_MSK_EXT (CAN_ACF_AIDEE | \ + CAN_ACF_AIDE) /*!< Acceptance filter accept extended ID mask. */ +/** + * @} + */ + +/** + * @defgroup CAN_Error_Type CAN Error Type + * @{ + */ +#define CAN_ERR_NO (0U) /*!< No error. */ +#define CAN_ERR_BIT (CAN_EALCAP_KOER_0) /*!< Error is bit error. */ +#define CAN_ERR_FORM (CAN_EALCAP_KOER_1) /*!< Error is form error. */ +#define CAN_ERR_STUFF (CAN_EALCAP_KOER_1 | \ + CAN_EALCAP_KOER_0) /*!< Error is stuff error. */ +#define CAN_ERR_ACK (CAN_EALCAP_KOER_2) /*!< Error is ACK error. */ +#define CAN_ERR_CRC (CAN_EALCAP_KOER_2 | \ + CAN_EALCAP_KOER_0) /*!< Error is CRC error. */ +#define CAN_ERR_OTHER (CAN_EALCAP_KOER_2 | \ + CAN_EALCAP_KOER_1) /*!< Error is other error. */ +/** + * @} + */ + +/** + * @defgroup CAN_AF CAN Acceptance Filter + * @{ + */ +#define CAN_AF1 (CAN_ACFEN_AE_1) /*!< Acceptance filter 1 select bit. */ +#define CAN_AF2 (CAN_ACFEN_AE_2) /*!< Acceptance filter 2 select bit. */ +#define CAN_AF3 (CAN_ACFEN_AE_3) /*!< Acceptance filter 3 select bit. */ +#define CAN_AF4 (CAN_ACFEN_AE_4) /*!< Acceptance filter 4 select bit. */ +#define CAN_AF5 (CAN_ACFEN_AE_5) /*!< Acceptance filter 5 select bit. */ +#define CAN_AF6 (CAN_ACFEN_AE_6) /*!< Acceptance filter 6 select bit. */ +#define CAN_AF7 (CAN_ACFEN_AE_7) /*!< Acceptance filter 7 select bit. */ +#define CAN_AF8 (CAN_ACFEN_AE_8) /*!< Acceptance filter 8 select bit. */ +#define CAN_AF9 (CAN_ACFEN_AE_9) /*!< Acceptance filter 9 select bit. */ +#define CAN_AF10 (CAN_ACFEN_AE_10) /*!< Acceptance filter 10 select bit. */ +#define CAN_AF11 (CAN_ACFEN_AE_11) /*!< Acceptance filter 11 select bit. */ +#define CAN_AF12 (CAN_ACFEN_AE_12) /*!< Acceptance filter 12 select bit. */ +#define CAN_AF13 (CAN_ACFEN_AE_13) /*!< Acceptance filter 13 select bit. */ +#define CAN_AF14 (CAN_ACFEN_AE_14) /*!< Acceptance filter 14 select bit. */ +#define CAN_AF15 (CAN_ACFEN_AE_15) /*!< Acceptance filter 15 select bit. */ +#define CAN_AF16 (CAN_ACFEN_AE_16) /*!< Acceptance filter 16 select bit. */ +#define CAN_AF_ALL (0xFFFFU) +/** + * @} + */ + +/** + * @defgroup CAN_TTC_Transmit_Buffer_Mode CAN Time-triggered Communication Transmit Buffer Mode + * @{ + */ +#define CAN_TTC_TB_MODE_NORMAL (0x0U) /*!< TTC transmit buffer depends on the priority of STB which is defined by @ref CAN_STB_Priority_Mode */ +#define CAN_TTC_TB_MODE_PTR (CAN_TCTRL_TTTBM) /*!< TTC transmit buffer is pointed by TBSLOT.TBPTR(for data filling) and \ + TRG_CFG.TTPTR(for data transmission). */ +/** + * @} + */ + +/** + * @defgroup CAN_TTC_TBS_Pointer CAN Time-triggered Communication Transmit Buffer Slot Pointer + * @{ + */ +#define CAN_TTC_TBS_PTB (0x0U) /*!< Point to PTB. */ +#define CAN_TTC_TBS_STB1 (0x1U) /*!< Point to STB slot 1. */ +#define CAN_TTC_TBS_STB2 (0x2U) /*!< Point to STB slot 2. */ +#define CAN_TTC_TBS_STB3 (0x3U) /*!< Point to STB slot 3. */ +/** + * @} + */ + +/** + * @defgroup CAN_TTC_Status_Flag CAN Time-triggered Communication Status Flag + * @{ + */ +#define CAN_TTC_FLAG_TTI (CAN_TTCFG_TTIF) /*!< Time trigger interrupt flag. */ +#define CAN_TTC_FLAG_TEI (CAN_TTCFG_TEIF) /*!< Trigger error interrupt flag. */ +#define CAN_TTC_FLAG_WTI (CAN_TTCFG_WTIF) /*!< Watch trigger interrupt flag. */ + +#define CAN_TTC_FLAG_ALL (CAN_TTC_FLAG_TTI | \ + CAN_TTC_FLAG_TEI | \ + CAN_TTC_FLAG_WTI) +/** + * @} + */ + +/** + * @defgroup CAN_TTC_Interrupt_Type CAN Time-triggered Communication Interrupt Type + * @{ + */ +#define CAN_TTC_INT_TTI (CAN_TTCFG_TTIE) /*!< Time trigger interrupt. */ +#define CAN_TTC_INT_WTI (CAN_TTCFG_WTIE) /*!< Watch trigger interrupt. */ +#define CAN_TTC_INT_ALL (CAN_TTC_INT_TTI | CAN_TTC_INT_WTI) +/** + * @} + */ + +/** + * @defgroup CAN_TTC_NTU_Prescaler CAN Time-triggered Communication Network Time Unit Prescaler + * @{ + */ +#define CAN_TTC_NTU_PRESC_1 (0x0U) /*!< NTU is SBT bit time * 1. */ +#define CAN_TTC_NTU_PRESC_2 (CAN_TTCFG_T_PRESC_0) /*!< NTU is SBT bit time * 2. */ +#define CAN_TTC_NTU_PRESC_4 (CAN_TTCFG_T_PRESC_1) /*!< NTU is SBT bit time * 4. */ +#define CAN_TTC_NTU_PRESC_8 (CAN_TTCFG_T_PRESC_1 | \ + CAN_TTCFG_T_PRESC_0) /*!< NTU is SBT bit time * 8. */ +/** + * @} + */ + +/** + * @defgroup CAN_TTC_Trigger_Type CAN Time-triggered Communication Trigger Type + * @{ + */ +#define CAN_TTC_TRIG_IMMED_TRIG (0x0U) /*!< Immediate trigger for immediate transmission. */ +#define CAN_TTC_TRIG_TIME_TRIG (CAN_TRG_CFG_TTYPE_0) /*!< Time trigger for receive triggers. */ +#define CAN_TTC_TRIG_SSHOT_TRANS_TRIG (CAN_TRG_CFG_TTYPE_1) /*!< Single shot transmit trigger for exclusive time windows. */ +#define CAN_TTC_TRIG_TRANS_START_TRIG (CAN_TRG_CFG_TTYPE_1 | \ + CAN_TRG_CFG_TTYPE_0) /*!< Transmit start trigger for merged arbitrating time windows. */ +#define CAN_TTC_TRIG_TRANS_STOP_TRIG (CAN_TRG_CFG_TTYPE_2) /*!< Transmit stop trigger for merged arbitrating time windows. */ +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup CAN_Global_Functions + * @{ + */ + en_result_t CAN_Init(M4_CAN_TypeDef *CANx, const stc_can_init_t *pstcInit); + en_result_t CAN_StructInit(stc_can_init_t *pstcInit); + void CAN_DeInit(M4_CAN_TypeDef *CANx); + + void CAN_SWReset(M4_CAN_TypeDef *CANx); + void CAN_EnterNormalComm(M4_CAN_TypeDef *CANx); + + void CAN_SetWorkMode(M4_CAN_TypeDef *CANx, uint8_t u8WorkMode); + void CAN_SetTransMode(M4_CAN_TypeDef *CANx, uint8_t u8TransMode); + void CAN_SetSTBPrioMode(M4_CAN_TypeDef *CANx, uint8_t u8STBPrioMode); + void CAN_SetRBStoreSel(M4_CAN_TypeDef *CANx, uint8_t u8RBStoreSel); + void CAN_SetRBOvfOp(M4_CAN_TypeDef *CANx, uint8_t u8RBOvfOperation); + + void CAN_IntCmd(M4_CAN_TypeDef *CANx, uint32_t u32IntType, en_functional_state_t enNewState); + en_result_t CAN_SBTConfig(M4_CAN_TypeDef *CANx, const stc_can_bt_cfg_t *pstcCfg); + uint8_t CAN_GetArbLostPos(const M4_CAN_TypeDef *CANx); + uint8_t CAN_GetErrType(const M4_CAN_TypeDef *CANx); + void CAN_SetRBSWarnLimit(M4_CAN_TypeDef *CANx, uint8_t u8RBSWarnLimit); + void CAN_SetErrWarnLimit(M4_CAN_TypeDef *CANx, uint8_t u8ErrWarnLimit); + uint8_t CAN_GetREC(const M4_CAN_TypeDef *CANx); + uint8_t CAN_GetTEC(const M4_CAN_TypeDef *CANx); + void CAN_ClrErrCount(M4_CAN_TypeDef *CANx); + en_result_t CAN_AFConfig(M4_CAN_TypeDef *CANx, uint16_t u16AFSel, const stc_can_af_cfg_t pstcAFCfg[]); + void CAN_AFCmd(M4_CAN_TypeDef *CANx, uint16_t u16AFSel, en_functional_state_t enNewState); + + uint8_t CAN_GetTBType(const M4_CAN_TypeDef *CANx); + void CAN_AbortTrans(M4_CAN_TypeDef *CANx, uint8_t u8TBType); + +en_flag_status_t CAN_GetStatus(const M4_CAN_TypeDef *CANx, uint32_t u32Flag); + void CAN_ClrStatus(M4_CAN_TypeDef *CANx, uint32_t u32Flag); + uint32_t CAN_GetStatusVal(const M4_CAN_TypeDef *CANx); + uint8_t CAN_GetTBFullStatus(const M4_CAN_TypeDef *CANx); + uint8_t CAN_GetRBFullStatus(const M4_CAN_TypeDef *CANx); + + en_result_t CAN_FD_Config(M4_CAN_TypeDef *CANx, const stc_can_fd_cfg_t *pstcCfg); + en_result_t CAN_FD_StructInit(stc_can_fd_cfg_t *pstcCfg); + void CAN_FD_Cmd(const M4_CAN_TypeDef *CANx, en_functional_state_t enNewState); + + en_result_t CAN_TTC_StructInit(stc_can_ttc_cfg_t *pstcCfg); + en_result_t CAN_TTC_Config(M4_CAN_TypeDef *CANx, const stc_can_ttc_cfg_t *pstcCfg); + void CAN_TTC_Cmd(M4_CAN_TypeDef *CANx, en_functional_state_t enNewState); + + void CAN_TTC_SetTBSToBeFilled(M4_CAN_TypeDef *CANx, uint8_t u8SlotPtr); + void CAN_TTC_SetTBSFilled(M4_CAN_TypeDef *CANx); + void CAN_TTC_SetNTUPrescaler(M4_CAN_TypeDef *CANx, uint8_t u8NTUPrescaler); + void CAN_TTC_IntCmd(M4_CAN_TypeDef *CANx, uint8_t u8IntType, en_functional_state_t enNewState); +en_flag_status_t CAN_TTC_GetStatus(const M4_CAN_TypeDef *CANx, uint8_t u8Flag); + void CAN_TTC_ClrStatus(M4_CAN_TypeDef *CANx, uint8_t u8Flag); + uint8_t CAN_TTC_GetStatusVal(const M4_CAN_TypeDef *CANx); + void CAN_TTC_SetRefMsgID(M4_CAN_TypeDef *CANx, uint32_t u32ID); + void CAN_TTC_SetRefMsgIDE(M4_CAN_TypeDef *CANx, uint32_t u32IDE); + uint32_t CAN_TTC_GetRefMsgID(const M4_CAN_TypeDef *CANx); + uint32_t CAN_TTC_GetRefMsgIDE(const M4_CAN_TypeDef *CANx); + void CAN_TTC_SetTxTrigTBS(M4_CAN_TypeDef *CANx, uint8_t u8TBSlotPtr); + uint8_t CAN_TTC_GetTxTrigTBS(const M4_CAN_TypeDef *CANx); + void CAN_TTC_SetTrigType(M4_CAN_TypeDef *CANx, uint16_t u16TrigType); + uint16_t CAN_TTC_GetTrigType(const M4_CAN_TypeDef *CANx); + void CAN_TTC_SetTxEnableWindow(M4_CAN_TypeDef *CANx, uint16_t u16TxEnableWindow); + uint16_t CAN_TTC_GetTxEnableWindow(const M4_CAN_TypeDef *CANx); + void CAN_TTC_SetTxTrigTime(M4_CAN_TypeDef *CANx, uint16_t u16TxTrigTime); + uint16_t CAN_TTC_GetTxTrigTime(const M4_CAN_TypeDef *CANx); + void CAN_TTC_SetWatchTrigTime(M4_CAN_TypeDef *CANx, uint16_t u16WatchTrigTime); + uint16_t CAN_TTC_GetWatchTrigTime(const M4_CAN_TypeDef *CANx); + + en_result_t CAN_TransData(M4_CAN_TypeDef *CANx, const stc_can_tx_t *pstcTx, + uint8_t u8TxBufType, uint8_t u8STBTxCtrl, uint32_t u32Timeout); + en_result_t CAN_TTC_TransData(M4_CAN_TypeDef *CANx, const stc_can_tx_t *pstcTx, uint8_t u8TBSlot); + + en_result_t CAN_ReceiveData(M4_CAN_TypeDef *CANx, stc_can_rx_t *pstcRx, uint8_t *pu8RxFrameCnt, uint8_t u8RxFrameBufLength); + +/** + * @} + */ + +#endif /* DDL_CAN_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_CAN_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_clk.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_clk.h new file mode 100644 index 0000000000..471938bde6 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_clk.h @@ -0,0 +1,1003 @@ +/** + ******************************************************************************* + * @file hc32f4a0_clk.h + * @brief This file contains all the functions prototypes of the CLK driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Zhangxl First version + 2020-07-03 Zhangxl _DIV64 definition for BUS clock division + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_CLK_H__ +#define __HC32F4A0_CLK_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_CLK + * @{ + */ + +#if (DDL_CLK_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup CLK_Global_Types CLK Global Types + * @{ + */ +/** + * @brief CLK XTAL configuration structure definition + */ +typedef struct +{ + uint8_t u8XtalState; /*!< The new state of the XTAL. + This parameter can be a value of @ref CLK_XTAL_Config */ + + uint8_t u8XtalDrv; /*!< The XTAL drive ability. + This parameter can be a value of @ref CLK_XTAL_Config */ + + uint8_t u8XtalMode; /*!< The XTAL mode selection osc or exclk. + This parameter can be a value of @ref CLK_XTAL_Config */ + + uint8_t u8XtalStb; /*!< The XTAL stable time selection. + This parameter can be a value of @ref CLK_XTAL_Config */ +} stc_clk_xtal_init_t; + +/** + * @brief CLK XTALSTD configuration structure definition + */ +typedef struct +{ + uint8_t u8XtalStdState; /*!< Specifies the new state of XTALSTD. + This parameter can be a value of @ref CLK_XTALSTD_Config */ + + uint8_t u8XtalStdMode; /*!< Specifies the XTALSTD mode. + This parameter can be a value of @ref CLK_XTALSTD_Config */ + + uint8_t u8XtalStdInt; /*!< Specifies the XTALSTD interrupt on or off. + This parameter can be a value of @ref CLK_XTALSTD_Config */ + + uint8_t u8XtalStdRst; /*!< Specifies the XTALSTD reset on or off. + This parameter can be a value of @ref CLK_XTALSTD_Config */ +} stc_clk_xtalstd_init_t; + +/** + * @brief CLK XTAL32 configuration structure definition + */ +typedef struct +{ + uint8_t u8Xtal32State; /*!< Xtal32 new state, + @ref CLK_XTAL32_Config for details */ + + uint8_t u8Xtal32Drv; /*!< Xtal32 drive capacity setting, + @ref CLK_XTAL32_Config for details */ + + uint8_t u8Xtal32NF; /*!< Xtal32 noise filter setting, + @ref CLK_XTAL32_Config for details */ +} stc_clk_xtal32_init_t; + +/** + * @brief CLK PLLH configuration structure definition + */ +typedef struct +{ + uint8_t u8PLLState; /*!< PLLH new state, + @ref CLK_PLLH_Config for details */ + union + { + uint32_t PLLCFGR; /* PLLH config register */ + struct + { + uint32_t PLLM :2; /*! PLLH M divide */ + uint32_t resvd0 :5; /*! reserved */ + uint32_t PLLSRC :1; /*! PLLH/PLLA source clock select */ + uint32_t PLLN :8; /*! PLLH N multi- */ + uint32_t resvd1 :4; /*! reserved */ + uint32_t PLLR :4; /*! PLLH R divide */ + uint32_t PLLQ :4; /*! PLLH Q divide */ + uint32_t PLLP :4; /*! PLLH P divide */ + } PLLCFGR_f; + }; +} stc_clk_pllh_init_t; + +/** + * @brief CLK PLLA configuration structure definition + */ +typedef struct +{ + uint8_t u8PLLState; /*!< PLLA new state, + @ref CLK_PLLA_Config for details */ + union + { + uint32_t PLLCFGR; /* PLLA config register */ + struct + { + uint32_t PLLM :5; /*!< PLLA M divide */ + uint32_t resvd0 :3; /*! reserved */ + uint32_t PLLN :9; /*!< PLLA N multi- */ + uint32_t resvd1 :3; /*!< reserved */ + uint32_t PLLR :4; /*!< PLLA R divide */ + uint32_t PLLQ :4; /*!< PLLA Q divide */ + uint32_t PLLP :4; /*!< PLLA P divide */ + } PLLCFGR_f; + }; +} stc_clk_plla_init_t; + +/** + * @brief CLK bus frequency structure definition + */ +typedef struct +{ + uint32_t sysclkFreq; /*!< System clock frequency. */ + uint32_t hclkFreq; /*!< Hclk frequency. */ + uint32_t exckFreq; /*!< Exclk frequency. */ + uint32_t pclk0Freq; /*!< Pclk0 frequency. */ + uint32_t pclk1Freq; /*!< Pclk1 frequency. */ + uint32_t pclk2Freq; /*!< Pclk2 frequency. */ + uint32_t pclk3Freq; /*!< Pclk3 frequency. */ + uint32_t pclk4Freq; /*!< Pclk4 frequency. */ +} stc_clk_freq_t; + +/** + * @brief CLK PLL clock frequency structure definition + */ +typedef struct +{ + uint32_t pllhvcin; /*!< pllh vcin clock frequency. */ + uint32_t pllhvco; /*!< pllh vco clock frequency. */ + uint32_t pllhp; /*!< pllhp clock frequency. */ + uint32_t pllhq; /*!< pllhq clock frequency. */ + uint32_t pllhr; /*!< pllhr clock frequency. */ + uint32_t pllavcin; /*!< plla vcin clock frequency. */ + uint32_t pllavco; /*!< plla vco clock frequency. */ + uint32_t pllap; /*!< pllap clock frequency. */ + uint32_t pllaq; /*!< pllaq clock frequency. */ + uint32_t pllar; /*!< pllar clock frequency. */ +} stc_pll_clk_freq_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup CLK_Global_Macros CLK Global Macros + * @{ + */ +/** + * @defgroup CLK_PLLH_FREQ PLLH P/Q/R frequency range definition + * @{ + */ +#define CLK_PLLH_FREQ_MIN (40UL*1000UL*1000UL) +#define CLK_PLLH_FREQ_MAX (240UL*1000UL*1000UL) +/** + * @} + */ + +/** + * @defgroup CLK_PLLH_VCO_IN PLLH VCO in frequency range definition + * @{ + */ +#define CLK_PLLH_VCO_IN_MIN (8UL*1000UL*1000UL) +#define CLK_PLLH_VCO_IN_MAX (24UL*1000UL*1000UL) +/** + * @} + */ + +/** + * @defgroup CLK_PLLH_VCO_OUT PLLH VCO out frequency range definition + * @{ + */ +#define CLK_PLLH_VCO_OUT_MIN (600UL*1000UL*1000UL) +#define CLK_PLLH_VCO_OUT_MAX (1200UL*1000UL*1000UL) +/** + * @} + */ + +/** + * @defgroup CLK_PLLHM_Div_Sel PLLH M divide range definition + * @{ + */ +#define CLK_PLLHM_DIV_MIN (1UL) +#define CLK_PLLHM_DIV_MAX (4UL) +/** + * @} + */ + +/** + * @defgroup CLK_PLLHN_Div_Sel PLLH N multi- range definition + * @{ + */ +#define CLK_PLLHN_MULTI_MIN (25UL) +#define CLK_PLLHN_MULTI_MAX (150UL) +/** + * @} + */ + +/** + * @defgroup CLK_PLLHR_Div_Sel PLLH R divide range definition + * @{ + */ +#define CLK_PLLHR_DIV_MIN (2UL) +#define CLK_PLLHR_DIV_MAX (16UL) +/** + * @} + */ + +/** + * @defgroup CLK_PLLHQ_Div_Sel PLLH Q divide range definition + * @{ + */ +#define CLK_PLLHQ_DIV_MIN (2UL) +#define CLK_PLLHQ_DIV_MAX (16UL) +/** + * @} + */ + +/** + * @defgroup CLK_PLLHP_Div_Sel PLLH P divide range definition + * @{ + */ +#define CLK_PLLHP_DIV_MIN (2UL) +#define CLK_PLLHP_DIV_MAX (16UL) +/** + * @} + */ + +/** + * @defgroup CLK_PLLA_FREQ PLLA P/Q/R frequency range definition + * @{ + */ +#define CLK_PLLA_FREQ_MIN (15UL*1000UL*1000UL) +#define CLK_PLLA_FREQ_MAX (240UL*1000UL*1000UL) +/** + * @} + */ + +/** + * @defgroup CLK_PLLA_VCO_IN PLLA VCO in frequency range definition + * @{ + */ +#define CLK_PLLA_VCO_IN_MIN (1UL*1000UL*1000UL) +#define CLK_PLLA_VCO_IN_MAX (24UL*1000UL*1000UL) +/** + * @} + */ + +/** + * @defgroup CLK_PLLA_VCO_OUT PLLA VCO out frequency range definition + * @{ + */ +#define CLK_PLLA_VCO_OUT_MIN (240UL*1000UL*1000UL) +#define CLK_PLLA_VCO_OUT_MAX (480UL*1000UL*1000UL) +/** + * @} + */ + +/** + * @defgroup CLK_PLLAM_Div_Sel PLLA M divide range definition + * @{ + */ +#define CLK_PLLAM_DIV_MIN (1UL) +#define CLK_PLLAM_DIV_MAX (24UL) +/** + * @} + */ + +/** + * @defgroup CLK_PLLAN_Div_Sel PLLA N multi- range definition + * @{ + */ +#define CLK_PLLAN_MULTI_MIN (20UL) +#define CLK_PLLAN_MULTI_MAX (480UL) +/** + * @} + */ + +/** + * @defgroup CLK_PLLAR_Div_Sel PLLA R divide range definition + * @{ + */ +#define CLK_PLLAR_DIV_MIN (2UL) +#define CLK_PLLAR_DIV_MAX (16UL) +/** + * @} + */ + +/** + * @defgroup CLK_PLLAQ_Div_Sel PLLA Q divide range definition + * @{ + */ +#define CLK_PLLAQ_DIV_MIN (2UL) +#define CLK_PLLAQ_DIV_MAX (16UL) +/** + * @} + */ + +/** + * @defgroup CLK_PLLAP_Div_Sel PLLA P divide range definition + * @{ + */ +#define CLK_PLLAP_DIV_MIN (2UL) +#define CLK_PLLAP_DIV_MAX (16UL) +/** + * @} + */ + +/** + * @defgroup CLK_Switch_Config Congigureation for system clock switching + * @{ + */ +/** + * @brief Stable waiting time while switching system clock. + * @note Approx. 1us based on 168M frequency. + */ +#define CLK_SYSCLK_SW_STABLE (0xB0UL) + +/** + * @brief FCGx default value. + */ +#define CLK_FCG0_DEFAULT (0xFFFFFA0EUL) +#define CLK_FCG1_DEFAULT (0xFFFFFFFFUL) +#define CLK_FCG2_DEFAULT (0xFFFFFFFFUL) +#define CLK_FCG3_DEFAULT (0xFFFFFFFFUL) +/** + * @} + */ + +/** + * @defgroup CLK_PLLA_Config PLLA Config + * @{ + */ +/** + * @brief PLLH function config. + */ +#define CLK_PLLA_OFF (CMU_PLLACR_PLLAOFF) +#define CLK_PLLA_ON (0x00U) + +/** + * @brief PLLH default config. + */ +#define CLK_PLLAP_DFT (0x01UL) +#define CLK_PLLAQ_DFT (0x01UL) +#define CLK_PLLAR_DFT (0x01UL) +#define CLK_PLLAN_DFT (0x13UL) +#define CLK_PLLAM_DFT (0x01UL) +/** + * @} + */ + +/** + * @defgroup CLK_PLLH_Config PLLH Config + * @{ + */ +/** + * @brief PLLH function config. + */ +#define CLK_PLLH_OFF (CMU_PLLHCR_PLLHOFF) +#define CLK_PLLH_ON (0x00U) + +/** + * @brief PLLH default config. + */ +#define CLK_PLLHP_DFT (0x01UL) +#define CLK_PLLHQ_DFT (0x01UL) +#define CLK_PLLHR_DFT (0x01UL) +#define CLK_PLLHN_DFT (0x13UL) +#define CLK_PLLHM_DFT (0x01UL) + +/** + * @brief PLLH/A source clock selction. + */ +#define CLK_PLLSRC_XTAL (0x00UL) +#define CLK_PLLSRC_HRC (0x01UL) +/** + * @} + */ + +/** + * @defgroup CLK_XTAL_Config XTAL Config + * @{ + */ +/** + * @brief XTAL function config. + */ +#define CLK_XTAL_OFF (CMU_XTALCR_XTALSTP) +#define CLK_XTAL_ON (0x00U) + +/** + * @brief XTAL driver ability + * @note High: 20 ~ 24MHz, Mid: 16~20MHz, Low: 8~16MHz, ULow 4 ~ 8MHz. + */ +#define CLK_XTALDRV_HIGH (0x00U) +#define CLK_XTALDRV_MID (0x01U) +#define CLK_XTALDRV_LOW (0x02U) +#define CLK_XTALDRV_ULOW (0x03U) + +/** + * @brief XTAL mode selection osc or exclk + */ +#define CLK_XTALMODE_OSC (0x00U) +#define CLK_XTALMODE_EXCLK (0x01U) + +/** + * @brief XTAL stable time selection. + * @note a cycle of stable counter = a cycle of LRC divide by 8 + */ +#define CLK_XTALSTB_133US (0x01U) /*!< 35 stable count cycle, approx. 133us */ +#define CLK_XTALSTB_255US (0x02U) /*!< 67 stable count cycle, approx. 255us */ +#define CLK_XTALSTB_499US (0x03U) /*!< 131 stable count cycle, approx. 499us */ +#define CLK_XTALSTB_988US (0x04U) /*!< 259 stable count cycle, approx. 988us */ +#define CLK_XTALSTB_2MS (0x05U) /*!< 547 stable count cycle, approx. 2ms */ +#define CLK_XTALSTB_4MS (0x06U) /*!< 1059 stable count cycle, approx. 4ms */ +#define CLK_XTALSTB_8MS (0x07U) /*!< 2147 stable count cycle, approx. 8ms */ +#define CLK_XTALSTB_16MS (0x08U) /*!< 4291 stable count cycle, approx. 16ms */ +#define CLK_XTALSTB_31MS (0x09U) /*!< 8163 stable count cycle, approx. 32ms */ +/** + * @} + */ + +/** + * @defgroup CLK_XTALSTD_Config XTALSTD Config + * @{ + */ + +/** + * @brief XTAL error detection on or off + */ +#define CLK_XTALSTD_OFF (0x00U) +#define CLK_XTALSTD_ON (CMU_XTALSTDCR_XTALSTDE) + +/** + * @brief XTALSTD mode selection + */ +#define CLK_XTALSTD_MODE_RST (CMU_XTALSTDCR_XTALSTDRIS) +#define CLK_XTALSTD_MODE_INT (0x00U) + +/** + * @brief XTALSTD reset on or off + */ +#define CLK_XTALSTD_RST_OFF (0x00U) +#define CLK_XTALSTD_RST_ON (CMU_XTALSTDCR_XTALSTDRE) + +/** + * @brief XTALSTD interrupt on or off + */ +#define CLK_XTALSTD_INT_OFF (0x00U) +#define CLK_XTALSTD_INT_ON (CMU_XTALSTDCR_XTALSTDIE) +/** + * @} + */ + +/** + * @defgroup CLK_XTAL32_Config XTAL32 Config + * @{ + */ +/** + * @brief XTAL32 function config. + */ +#define CLK_XTAL32_OFF (CMU_XTAL32CR_XTAL32STP) +#define CLK_XTAL32_ON (0x00U) + +/** + * @brief XTAL32 driver ability. + */ +#define CLK_XTAL32DRV_MID (0x00U) +#define CLK_XTAL32DRV_HIGH (0x01U) + +/** + * @brief XTAL32 filtering seletion. + */ +#define CLK_XTAL32NF_FULL (0x00U) /*!< Valid in run,stop,power down mode. */ +#define CLK_XTAL32NF_PART (0x02U) /*!< Valid in run mode. */ +#define CLK_XTAL32NF_NONE (0x03U) /*!< Invalid in run,stop,power down mode. */ +/** + * @} + */ + +/** + * @defgroup CLK_HRC_Config HRC Config + * @{ + */ +#define CLK_HRC_OFF (CMU_HRCCR_HRCSTP) +#define CLK_HRC_ON (0x00U) +/** + * @} + */ + +/** + * @defgroup CLK_MRC_Config HRC Config + * @{ + */ +#define CLK_MRC_OFF (CMU_MRCCR_MRCSTP) +#define CLK_MRC_ON (0x00U) +/** + * @} + */ + +/** + * @defgroup CLK_LRC_Config LRC Config + * @{ + */ +#define CLK_LRC_OFF (CMU_LRCCR_LRCSTP) +#define CLK_LRC_ON (0x00U) +/** + * @} + */ + +/** + * @defgroup CLK_RTCLRC_Config LRC Config + * @{ + */ +#define CLK_RTCLRC_OFF (CMU_RTCLRCCR_RTCLRCSTP) +#define CLK_RTCLRC_ON (0x00U) +/** + * @} + */ + +/** + * @defgroup CLK_STB_Flag CLK stable Flags + * @{ + */ +#define CLK_STB_FLAG_HRCSTB (CMU_OSCSTBSR_HRCSTBF) +#define CLK_STB_FLAG_XTALSTB (CMU_OSCSTBSR_XTALSTBF) +#define CLK_STB_FLAG_PLLASTB (CMU_OSCSTBSR_PLLASTBF) +#define CLK_STB_FLAG_PLLHSTB (CMU_OSCSTBSR_PLLHSTBF) +#define CLK_STB_FLAG_MASK ((CMU_OSCSTBSR_HRCSTBF) | \ + (CMU_OSCSTBSR_XTALSTBF)| \ + (CMU_OSCSTBSR_PLLASTBF)| \ + (CMU_OSCSTBSR_PLLHSTBF)) + +/** + * @} + */ + +/** + * @defgroup CLK_System_Clock_Source System Clock Source + * @{ + */ +#define CLK_SYSCLKSOURCE_HRC (0x00U) +#define CLK_SYSCLKSOURCE_MRC (0x01U) +#define CLK_SYSCLKSOURCE_LRC (0x02U) +#define CLK_SYSCLKSOURCE_XTAL (0x03U) +#define CLK_SYSCLKSOURCE_XTAL32 (0x04U) +#define CLK_SYSCLKSOURCE_PLLH (0x05U) +/** + * @} + */ + +/** + * @defgroup CLK_CATE_Sel Clock category selection + * @{ + */ +#define CLK_CATE_PCLK0 (0x01U) +#define CLK_CATE_PCLK1 (0x02U) +#define CLK_CATE_PCLK2 (0x04U) +#define CLK_CATE_PCLK3 (0x08U) +#define CLK_CATE_PCLK4 (0x10U) +#define CLK_CATE_EXCLK (0x20U) +#define CLK_CATE_HCLK (0x40U) +#define CLK_CATE_ALL (CLK_CATE_PCLK0 | CLK_CATE_PCLK1 | \ + CLK_CATE_PCLK2 | CLK_CATE_PCLK3 | \ + CLK_CATE_PCLK4 | CLK_CATE_EXCLK | \ + CLK_CATE_HCLK) +/** + * @} + */ + +/** + * @defgroup CLK_HCLK_Divider HCLK divider + * @{ + */ +#define CLK_HCLK_DIV1 (0x00U << CMU_SCFGR_HCLKS_POS) +#define CLK_HCLK_DIV2 (0x01U << CMU_SCFGR_HCLKS_POS) +#define CLK_HCLK_DIV4 (0x02U << CMU_SCFGR_HCLKS_POS) +#define CLK_HCLK_DIV8 (0x03U << CMU_SCFGR_HCLKS_POS) +#define CLK_HCLK_DIV16 (0x04U << CMU_SCFGR_HCLKS_POS) +#define CLK_HCLK_DIV32 (0x05U << CMU_SCFGR_HCLKS_POS) +#define CLK_HCLK_DIV64 (0x06U << CMU_SCFGR_HCLKS_POS) +/** + * @} + */ + +/** + * @defgroup CLK_EXCLK_Divider EXCLK divider + * @{ + */ +#define CLK_EXCLK_DIV1 (0x00U << CMU_SCFGR_EXCKS_POS) +#define CLK_EXCLK_DIV2 (0x01U << CMU_SCFGR_EXCKS_POS) +#define CLK_EXCLK_DIV4 (0x02U << CMU_SCFGR_EXCKS_POS) +#define CLK_EXCLK_DIV8 (0x03U << CMU_SCFGR_EXCKS_POS) +#define CLK_EXCLK_DIV16 (0x04U << CMU_SCFGR_EXCKS_POS) +#define CLK_EXCLK_DIV32 (0x05U << CMU_SCFGR_EXCKS_POS) +#define CLK_EXCLK_DIV64 (0x06U << CMU_SCFGR_EXCKS_POS) +/** + * @} + */ + +/** + * @defgroup CLK_PCLK4_Divider PCLK4 divider + * @{ + */ +#define CLK_PCLK4_DIV1 (0x00U << CMU_SCFGR_PCLK4S_POS) +#define CLK_PCLK4_DIV2 (0x01U << CMU_SCFGR_PCLK4S_POS) +#define CLK_PCLK4_DIV4 (0x02U << CMU_SCFGR_PCLK4S_POS) +#define CLK_PCLK4_DIV8 (0x03U << CMU_SCFGR_PCLK4S_POS) +#define CLK_PCLK4_DIV16 (0x04U << CMU_SCFGR_PCLK4S_POS) +#define CLK_PCLK4_DIV32 (0x05U << CMU_SCFGR_PCLK4S_POS) +#define CLK_PCLK4_DIV64 (0x06U << CMU_SCFGR_PCLK4S_POS) +/** + * @} + */ + +/** + * @defgroup CLK_PCLK3_Divider PCLK3 divider + * @{ + */ +#define CLK_PCLK3_DIV1 (0x00U << CMU_SCFGR_PCLK3S_POS) +#define CLK_PCLK3_DIV2 (0x01U << CMU_SCFGR_PCLK3S_POS) +#define CLK_PCLK3_DIV4 (0x02U << CMU_SCFGR_PCLK3S_POS) +#define CLK_PCLK3_DIV8 (0x03U << CMU_SCFGR_PCLK3S_POS) +#define CLK_PCLK3_DIV16 (0x04U << CMU_SCFGR_PCLK3S_POS) +#define CLK_PCLK3_DIV32 (0x05U << CMU_SCFGR_PCLK3S_POS) +#define CLK_PCLK3_DIV64 (0x06U << CMU_SCFGR_PCLK3S_POS) +/** + * @} + */ + +/** + * @defgroup CLK_PCLK2_Divider PCLK2 divider + * @{ + */ +#define CLK_PCLK2_DIV1 (0x00U << CMU_SCFGR_PCLK2S_POS) +#define CLK_PCLK2_DIV2 (0x01U << CMU_SCFGR_PCLK2S_POS) +#define CLK_PCLK2_DIV4 (0x02U << CMU_SCFGR_PCLK2S_POS) +#define CLK_PCLK2_DIV8 (0x03U << CMU_SCFGR_PCLK2S_POS) +#define CLK_PCLK2_DIV16 (0x04U << CMU_SCFGR_PCLK2S_POS) +#define CLK_PCLK2_DIV32 (0x05U << CMU_SCFGR_PCLK2S_POS) +#define CLK_PCLK2_DIV64 (0x06U << CMU_SCFGR_PCLK2S_POS) +/** + * @} + */ + +/** + * @defgroup CLK_PCLK1_Divider PCLK1 divider + * @{ + */ +#define CLK_PCLK1_DIV1 (0x00U << CMU_SCFGR_PCLK1S_POS) +#define CLK_PCLK1_DIV2 (0x01U << CMU_SCFGR_PCLK1S_POS) +#define CLK_PCLK1_DIV4 (0x02U << CMU_SCFGR_PCLK1S_POS) +#define CLK_PCLK1_DIV8 (0x03U << CMU_SCFGR_PCLK1S_POS) +#define CLK_PCLK1_DIV16 (0x04U << CMU_SCFGR_PCLK1S_POS) +#define CLK_PCLK1_DIV32 (0x05U << CMU_SCFGR_PCLK1S_POS) +#define CLK_PCLK1_DIV64 (0x06U << CMU_SCFGR_PCLK1S_POS) +/** + * @} + */ + +/** + * @defgroup CLK_PCLK0_Divider PCLK0 divider + * @{ + */ +#define CLK_PCLK0_DIV1 (0x00U << CMU_SCFGR_PCLK0S_POS) +#define CLK_PCLK0_DIV2 (0x01U << CMU_SCFGR_PCLK0S_POS) +#define CLK_PCLK0_DIV4 (0x02U << CMU_SCFGR_PCLK0S_POS) +#define CLK_PCLK0_DIV8 (0x03U << CMU_SCFGR_PCLK0S_POS) +#define CLK_PCLK0_DIV16 (0x04U << CMU_SCFGR_PCLK0S_POS) +#define CLK_PCLK0_DIV32 (0x05U << CMU_SCFGR_PCLK0S_POS) +#define CLK_PCLK0_DIV64 (0x06U << CMU_SCFGR_PCLK0S_POS) +/** + * @} + */ + +/** + * @defgroup CLK_USB_CLK_Sel USB clock selection + * @{ + */ +#define CLK_USB_CLK_MCLK_DIV2 (0x01U << CMU_USBCKCFGR_USBCKS_POS) +#define CLK_USB_CLK_MCLK_DIV3 (0x02U << CMU_USBCKCFGR_USBCKS_POS) +#define CLK_USB_CLK_MCLK_DIV4 (0x03U << CMU_USBCKCFGR_USBCKS_POS) +#define CLK_USB_CLK_MCLK_DIV5 (0x04U << CMU_USBCKCFGR_USBCKS_POS) +#define CLK_USB_CLK_MCLK_DIV6 (0x05U << CMU_USBCKCFGR_USBCKS_POS) +#define CLK_USB_CLK_MCLK_DIV7 (0x06U << CMU_USBCKCFGR_USBCKS_POS) +#define CLK_USB_CLK_MCLK_DIV8 (0x07U << CMU_USBCKCFGR_USBCKS_POS) +#define CLK_USB_CLK_PLLHQ (0x08U << CMU_USBCKCFGR_USBCKS_POS) +#define CLK_USB_CLK_PLLHR (0x09U << CMU_USBCKCFGR_USBCKS_POS) +#define CLK_USB_CLK_PLLAP (0x0AU << CMU_USBCKCFGR_USBCKS_POS) +#define CLK_USB_CLK_PLLAQ (0x0BU << CMU_USBCKCFGR_USBCKS_POS) +#define CLK_USB_CLK_PLLAR (0x0CU << CMU_USBCKCFGR_USBCKS_POS) +/** + * @} + */ + +/** + * @defgroup CLK_CAN_CLK_Sel CAN clock selection + * @{ + */ +#define CLK_CAN_CLK_MCLK_DIV2 (0x01U) +#define CLK_CAN_CLK_MCLK_DIV3 (0x02U) +#define CLK_CAN_CLK_MCLK_DIV4 (0x03U) +#define CLK_CAN_CLK_MCLK_DIV5 (0x04U) +#define CLK_CAN_CLK_MCLK_DIV6 (0x05U) +#define CLK_CAN_CLK_MCLK_DIV7 (0x06U) +#define CLK_CAN_CLK_MCLK_DIV8 (0x07U) +#define CLK_CAN_CLK_PLLHQ (0x08U) +#define CLK_CAN_CLK_PLLHR (0x09U) +#define CLK_CAN_CLK_PLLAP (0x0AU) +#define CLK_CAN_CLK_PLLAQ (0x0BU) +#define CLK_CAN_CLK_PLLAR (0x0CU) +#define CLK_CAN_CLK_XTAL (0x0DU) +#define CLK_CAN1_CLK_MCLK_DIV2 (CLK_CAN_CLK_MCLK_DIV2) +#define CLK_CAN1_CLK_MCLK_DIV3 (CLK_CAN_CLK_MCLK_DIV3) +#define CLK_CAN1_CLK_MCLK_DIV4 (CLK_CAN_CLK_MCLK_DIV4) +#define CLK_CAN1_CLK_MCLK_DIV5 (CLK_CAN_CLK_MCLK_DIV5) +#define CLK_CAN1_CLK_MCLK_DIV6 (CLK_CAN_CLK_MCLK_DIV6) +#define CLK_CAN1_CLK_MCLK_DIV7 (CLK_CAN_CLK_MCLK_DIV7) +#define CLK_CAN1_CLK_MCLK_DIV8 (CLK_CAN_CLK_MCLK_DIV8) +#define CLK_CAN1_CLK_PLLHQ (CLK_CAN_CLK_PLLHQ) +#define CLK_CAN1_CLK_PLLHR (CLK_CAN_CLK_PLLHR) +#define CLK_CAN1_CLK_PLLAP (CLK_CAN_CLK_PLLAP) +#define CLK_CAN1_CLK_PLLAQ (CLK_CAN_CLK_PLLAQ) +#define CLK_CAN1_CLK_PLLAR (CLK_CAN_CLK_PLLAR) +#define CLK_CAN1_CLK_XTAL (CLK_CAN_CLK_XTAL) +#define CLK_CAN2_CLK_MCLK_DIV2 (CLK_CAN_CLK_MCLK_DIV2 << CMU_CANCKCFGR_CAN2CKS_POS) +#define CLK_CAN2_CLK_MCLK_DIV3 (CLK_CAN_CLK_MCLK_DIV3 << CMU_CANCKCFGR_CAN2CKS_POS) +#define CLK_CAN2_CLK_MCLK_DIV4 (CLK_CAN_CLK_MCLK_DIV4 << CMU_CANCKCFGR_CAN2CKS_POS) +#define CLK_CAN2_CLK_MCLK_DIV5 (CLK_CAN_CLK_MCLK_DIV5 << CMU_CANCKCFGR_CAN2CKS_POS) +#define CLK_CAN2_CLK_MCLK_DIV6 (CLK_CAN_CLK_MCLK_DIV6 << CMU_CANCKCFGR_CAN2CKS_POS) +#define CLK_CAN2_CLK_MCLK_DIV7 (CLK_CAN_CLK_MCLK_DIV7 << CMU_CANCKCFGR_CAN2CKS_POS) +#define CLK_CAN2_CLK_MCLK_DIV8 (CLK_CAN_CLK_MCLK_DIV8 << CMU_CANCKCFGR_CAN2CKS_POS) +#define CLK_CAN2_CLK_PLLHQ (CLK_CAN_CLK_PLLHQ << CMU_CANCKCFGR_CAN2CKS_POS) +#define CLK_CAN2_CLK_PLLHR (CLK_CAN_CLK_PLLHR << CMU_CANCKCFGR_CAN2CKS_POS) +#define CLK_CAN2_CLK_PLLAP (CLK_CAN_CLK_PLLAP << CMU_CANCKCFGR_CAN2CKS_POS) +#define CLK_CAN2_CLK_PLLAQ (CLK_CAN_CLK_PLLAQ << CMU_CANCKCFGR_CAN2CKS_POS) +#define CLK_CAN2_CLK_PLLAR (CLK_CAN_CLK_PLLAR << CMU_CANCKCFGR_CAN2CKS_POS) +#define CLK_CAN2_CLK_XTAL (CLK_CAN_CLK_XTAL << CMU_CANCKCFGR_CAN2CKS_POS) +/** + * @} + */ + +/** + * @defgroup CLK_CAN_CH_Sel CAN channel for clock selection + * @{ + */ +#define CLK_CAN_CH1 (0x01U) +#define CLK_CAN_CH2 (0x02U) +#define CLK_CAN_CH_ALL (CLK_CAN_CH1 | CLK_CAN_CH2) +/** + * @} + */ + +/** + * @defgroup CLK_I2S_CLK_Sel I2S clock selection + * @{ + */ +#define CLK_I2S_CLK_PCLK (0x0000U) +#define CLK_I2S_CLK_PLLHQ (0x0008U) +#define CLK_I2S_CLK_PLLHR (0x0009U) +#define CLK_I2S_CLK_PLLAP (0x000AU) +#define CLK_I2S_CLK_PLLAQ (0x000BU) +#define CLK_I2S_CLK_PLLAR (0x000CU) +#define CLK_I2S1_CLK_PCLK (CLK_I2S_CLK_PCLK) +#define CLK_I2S1_CLK_PLLHQ (CLK_I2S_CLK_PLLHQ) +#define CLK_I2S1_CLK_PLLHR (CLK_I2S_CLK_PLLHR) +#define CLK_I2S1_CLK_PLLAP (CLK_I2S_CLK_PLLAP) +#define CLK_I2S1_CLK_PLLAQ (CLK_I2S_CLK_PLLAQ) +#define CLK_I2S1_CLK_PLLAR (CLK_I2S_CLK_PLLAR) +#define CLK_I2S2_CLK_PCLK (CLK_I2S_CLK_PCLK << CMU_I2SCKSEL_I2S2CKSEL_POS) +#define CLK_I2S2_CLK_PLLHQ (CLK_I2S_CLK_PLLHQ << CMU_I2SCKSEL_I2S2CKSEL_POS) +#define CLK_I2S2_CLK_PLLHR (CLK_I2S_CLK_PLLHR << CMU_I2SCKSEL_I2S2CKSEL_POS) +#define CLK_I2S2_CLK_PLLAP (CLK_I2S_CLK_PLLAP << CMU_I2SCKSEL_I2S2CKSEL_POS) +#define CLK_I2S2_CLK_PLLAQ (CLK_I2S_CLK_PLLAQ << CMU_I2SCKSEL_I2S2CKSEL_POS) +#define CLK_I2S2_CLK_PLLAR (CLK_I2S_CLK_PLLAR << CMU_I2SCKSEL_I2S2CKSEL_POS) +#define CLK_I2S3_CLK_PCLK (CLK_I2S_CLK_PCLK << CMU_I2SCKSEL_I2S3CKSEL_POS) +#define CLK_I2S3_CLK_PLLHQ (CLK_I2S_CLK_PLLHQ << CMU_I2SCKSEL_I2S3CKSEL_POS) +#define CLK_I2S3_CLK_PLLHR (CLK_I2S_CLK_PLLHR << CMU_I2SCKSEL_I2S3CKSEL_POS) +#define CLK_I2S3_CLK_PLLAP (CLK_I2S_CLK_PLLAP << CMU_I2SCKSEL_I2S3CKSEL_POS) +#define CLK_I2S3_CLK_PLLAQ (CLK_I2S_CLK_PLLAQ << CMU_I2SCKSEL_I2S3CKSEL_POS) +#define CLK_I2S3_CLK_PLLAR (CLK_I2S_CLK_PLLAR << CMU_I2SCKSEL_I2S3CKSEL_POS) +#define CLK_I2S4_CLK_PCLK (CLK_I2S_CLK_PCLK << CMU_I2SCKSEL_I2S4CKSEL_POS) +#define CLK_I2S4_CLK_PLLHQ (CLK_I2S_CLK_PLLHQ << CMU_I2SCKSEL_I2S4CKSEL_POS) +#define CLK_I2S4_CLK_PLLHR (CLK_I2S_CLK_PLLHR << CMU_I2SCKSEL_I2S4CKSEL_POS) +#define CLK_I2S4_CLK_PLLAP (CLK_I2S_CLK_PLLAP << CMU_I2SCKSEL_I2S4CKSEL_POS) +#define CLK_I2S4_CLK_PLLAQ (CLK_I2S_CLK_PLLAQ << CMU_I2SCKSEL_I2S4CKSEL_POS) +#define CLK_I2S4_CLK_PLLAR (CLK_I2S_CLK_PLLAR << CMU_I2SCKSEL_I2S4CKSEL_POS) +/** + * @} + */ + +/** + * @defgroup CLK_I2S_CH_Sel I2S channel for clock selection + * @{ + */ +#define CLK_I2S_CH1 (0x01U) +#define CLK_I2S_CH2 (0x02U) +#define CLK_I2S_CH3 (0x04U) +#define CLK_I2S_CH4 (0x08U) +#define CLK_I2S_CH_ALL (CLK_I2S_CH1 | CLK_I2S_CH2 | CLK_I2S_CH3 | CLK_I2S_CH4) +/** + * @} + */ + +/** + * @defgroup CLK_PCLK24_Sel PCLK2/4 selection + * @{ + */ +#define CLK_PERI_CLK_PCLK (0x0000U) +#define CLK_PERI_CLK_PLLHQ (0x0008U) +#define CLK_PERI_CLK_PLLHR (0x0009U) +#define CLK_PERI_CLK_PLLAP (0x000AU) +#define CLK_PERI_CLK_PLLAQ (0x000BU) +#define CLK_PERI_CLK_PLLAR (0x000CU) +/** + * @} + */ + +/** + * @defgroup CLK_TPIU_Divider TPIU clock divider + * @{ + */ +#define CLK_TPIU_CLK_DIV1 (0x00U) +#define CLK_TPIU_CLK_DIV2 (0x01U) +#define CLK_TPIU_CLK_DIV4 (0x02U) +/** + * @} + */ + +/** + * @defgroup CLK_MCO_Clock_Source CLK MCO Clock Source + * @{ + */ +#define CLK_MCOSOURCCE_HRC (0x00U) +#define CLK_MCOSOURCCE_MRC (0x01U) +#define CLK_MCOSOURCCE_LRC (0x02U) +#define CLK_MCOSOURCCE_XTAL (0x03U) +#define CLK_MCOSOURCCE_XTAL32 (0x04U) +#define CLK_MCOSOURCCE_PLLHP (0x06U) +#define CLK_MCOSOURCCE_PLLAP (0x07U) +#define CLK_MCOSOURCCE_PLLHQ (0x08U) +#define CLK_MCOSOURCCE_PLLAQ (0x09U) +#define CLK_MCOSOURCCE_PLLAR (0x0AU) +#define CLK_MCOSOURCCE_SYSCLK (0x0BU) +/** + * @} + */ + +/** + * @defgroup CLK_MCO_Clock_Prescaler CLK MCO Clock Prescaler + * @{ + */ +#define CLK_MCO_DIV1 (0x00U << CMU_MCO2CFGR_MCO2DIV_POS) +#define CLK_MCO_DIV2 (0x01U << CMU_MCO2CFGR_MCO2DIV_POS) +#define CLK_MCO_DIV4 (0x02U << CMU_MCO2CFGR_MCO2DIV_POS) +#define CLK_MCO_DIV8 (0x03U << CMU_MCO2CFGR_MCO2DIV_POS) +#define CLK_MCO_DIV16 (0x04U << CMU_MCO2CFGR_MCO2DIV_POS) +#define CLK_MCO_DIV32 (0x05U << CMU_MCO2CFGR_MCO2DIV_POS) +#define CLK_MCO_DIV64 (0x06U << CMU_MCO2CFGR_MCO2DIV_POS) +#define CLK_MCO_DIV128 (0x07U << CMU_MCO2CFGR_MCO2DIV_POS) +/** + * @} + */ + + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup CLK_Global_Functions + * @{ + */ +en_result_t CLK_XtalStdStrucInit(stc_clk_xtalstd_init_t* pstcXtalStdInit); +en_result_t CLK_XtalStdInit(const stc_clk_xtalstd_init_t* pstcXtalStdInit); +void CLK_ClearXtalStdStatus(void); +en_flag_status_t CLK_GetXtalStdStatus(void); + +void CLK_HrcTrim(int8_t i8TrimVal); +void CLK_MrcTrim(int8_t i8TrimVal); +void CLK_LrcTrim(int8_t i8TrimVal); +void CLK_RtcLrcTrim(int8_t i8TrimVal); + +en_result_t CLK_XtalCmd(en_functional_state_t enNewState); +en_result_t CLK_Xtal32Cmd(en_functional_state_t enNewState); +en_result_t CLK_HrcCmd(en_functional_state_t enNewState); +en_result_t CLK_MrcCmd(en_functional_state_t enNewState); +en_result_t CLK_LrcCmd(en_functional_state_t enNewState); +en_result_t CLK_PLLACmd(en_functional_state_t enNewState); +en_result_t CLK_PLLHCmd(en_functional_state_t enNewState); + +en_result_t CLK_PLLAStrucInit(stc_clk_plla_init_t* pstcPLLAInit); +en_result_t CLK_PLLAInit(const stc_clk_plla_init_t *pstcPLLAInit); + +en_result_t CLK_PLLHStrucInit(stc_clk_pllh_init_t* pstcPLLHInit); +en_result_t CLK_PLLHInit(const stc_clk_pllh_init_t *pstcPLLHInit); + +en_result_t CLK_XtalStrucInit(stc_clk_xtal_init_t* pstcXtalInit); +en_result_t CLK_XtalInit(const stc_clk_xtal_init_t *pstcXtalInit); + +en_result_t CLK_Xtal32StrucInit(stc_clk_xtal32_init_t* pstcXtal32Init); +en_result_t CLK_Xtal32Init(const stc_clk_xtal32_init_t *pstcXtal32Init); + +en_flag_status_t CLK_GetStableStatus(uint8_t u8StableFlag); + +void CLK_SetSysClkSrc(uint8_t u8Src); +void CLK_ClkDiv(uint8_t u8ClkCate, uint32_t u32Div); + +void CLK_USB_ClkConfig(uint8_t u8UsbClk); +void CLK_CAN_ClkConfig(uint8_t u8CanCh, uint8_t u8CanClk); +void CLK_I2S_ClkConfig(uint8_t u8I2sCh, uint16_t u16I2sClk); +void CLK_PERI_ClkConfig(uint16_t u16Periclk); + +void CLK_TpiuClkCmd(en_functional_state_t enNewState); +void CLK_TpiuClkConfig(uint8_t u8TpiuDiv); + +void CLK_MCO1Config(uint8_t CLK_MCOSource, uint8_t CLK_MCODiv); +void CLK_MCO1Cmd(en_functional_state_t enNewState); +void CLK_MCO2Config(uint8_t CLK_MCOSource, uint8_t CLK_MCODiv); +void CLK_MCO2Cmd(en_functional_state_t enNewState); + +en_result_t CLK_GetClockFreq(stc_clk_freq_t *pstcClkFreq); +en_result_t CLK_GetPllClockFreq(stc_pll_clk_freq_t *pstcPllClkFreq); +void CLK_SetPLLSrc(uint32_t u32PllSrc); + + +/** + * @} + */ + +#endif /* DDL_CLK_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_CLK_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_cmp.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_cmp.h new file mode 100644 index 0000000000..6e4b1ec98f --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_cmp.h @@ -0,0 +1,374 @@ +/** + ******************************************************************************* + * @file hc32f4a0_cmp.h + * @brief Head file for CMP module. + * + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Heqb First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_CMP_H__ +#define __HC32F4A0_CMP_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_CMP + * @{ + */ + +#if (DDL_CMP_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup CMP_Global_Types CMP Global Types + * @{ + */ + +/** + * @brief CMP configuration structure + */ +typedef struct +{ + uint8_t u8CmpCh; /*!< Select the compare voltage channel for normal mode + @ref CMP_CVSL_Channal */ + uint16_t u16CmpVol; /*!< Select the compare voltage source for normal mode + (Config the parameter when use CMP1 or CMP3)@ref CMP1_3_CVSL_Source */ + uint8_t u8RefVol; /*!< Reference voltage for normal mode, @ref CMP_RVSL_Source*/ + + uint8_t u8OutPolarity; /*!< Output polarity select, @ref CMP_Out_Polarity_Select */ + + uint8_t u8OutDetectEdges; /*!< Output detecte edge, @ref CMP_Out_Detect_Edge */ + + uint8_t u8OutFilter; /*!< Output Filter, @ref CMP_Out_Filter */ +}stc_cmp_init_t; + +/** + * @brief CMP reference voltage for window mode configuration structure + */ +typedef struct +{ + uint8_t u8CmpCh1; /*!< Select the compare voltage channel for window mode + @ref CMP_CVSL_Channal */ + uint16_t u16CmpVol; /*!< Select the compare voltage source for window mode + (Config the parameter when use CMP1 or CMP3)@ref CMP1_3_CVSL_Source */ + uint8_t u8CmpCh2; /*!< Select the compare voltage channel for window mode + @ref CMP_CVSL_Channal */ + uint8_t u8WinVolLow; /*!< CMP reference low voltage for window mode + @ref CMP_RVSL_Source */ + uint8_t u8WinVolHigh; /*!< CMP reference high voltage for window mode + @ref CMP_RVSL_Source */ +}stc_cmp_win_ref_t; + +/** + * @brief CMP timer windows function configuration structure + */ +typedef struct +{ + uint16_t u16TWSelect; /*!< Timer window source select + @ref CMP_TimerWin_Select */ + uint8_t u8TWOutLevel; /*!< Timer window mode output level + @ref CMP_TimerWin_output_Level*/ + uint8_t u8TWInvalidLevel; /*!< Output level when timer window invalid + @ref CMP_TimerWin_Invalid_Level */ +}stc_cmp_timerwindow_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ + +/** + * @defgroup CMP_Global_Macros CMP Global Macros + * @{ + */ + +/** @defgroup CMP_Mode CMP compare mode + * @{ + */ +#define CMP_MODE_NORMAL (0x00U) /*!< Normal mode */ +#define CMP_MODE_WINDOW (CMP_MDR_CWDE) /*!< Window mode */ +/** + * @} + */ + +/** @defgroup CMP_CVSL_Channal CMP compare voltage channel selection + * @{ + */ +#define CMP_CVSL_NONE (0x0U) /*!< No input compare voltage */ +#define CMP_CVSL_INP1 (CMP_PMSR_CVSL_0) /*!< Select INP1 as compare voltage */ +#define CMP_CVSL_INP2 (CMP_PMSR_CVSL_1) /*!< Select INP2 as compare voltage */ +#define CMP_CVSL_INP3 (CMP_PMSR_CVSL_2) /*!< Select INP3 as compare voltage */ +#define CMP_CVSL_INP4 (CMP_PMSR_CVSL_3) /*!< Select INP4 as compare voltage */ +/** + * @} + */ + +/** @defgroup CMP_RVSL_Source CMP reference voltage selection + * @{ + */ +#define CMP_RVSL_NONE (0x0U) /*!< No input reference voltage */ +#define CMP_RVSL_INM1 (CMP_PMSR_RVSL_0) /*!< Select INM1 as reference voltage */ +#define CMP_RVSL_INM2 (CMP_PMSR_RVSL_1) /*!< Select INM2 as reference voltage */ +#define CMP_RVSL_INM3 (CMP_PMSR_RVSL_2) /*!< Select INM3 as reference voltage */ +#define CMP_RVSL_INM4 (CMP_PMSR_RVSL_3) /*!< Select INM4 as reference voltage */ +/** + * @} + */ + +/** @defgroup CMP1_3_CVSL_Source CMP1 CMP3 compare voltage selection + * @{ + */ +#define CMP1_INP3_NONE (0x0U) /*!< No input voltage to CMP1 INP3 */ +#define CMP1_INP3_CMP1_INP3 (CMP_VISR_P3SL_0) /*!< Select CMP1_INP3 as CMP1 INP3 input */ +#define CMP1_INP3_CMP2_INP3 (CMP_VISR_P3SL_1) /*!< Select CMP2_INP3 as CMP1 INP3 input */ +#define CMP1_INP2_NONE (0x0U) /*!< No input voltage to CMP1 INP2 */ +#define CMP1_INP2_PGA1 (CMP_VISR_P2SL_0) /*!< Select PGA1 as CMP1 INP2 input */ +#define CMP1_INP2_PGA2 (CMP_VISR_P2SL_1) /*!< Select PGA2 as CMP1 INP2 input */ +#define CMP1_INP2_CMP1_INP2 (CMP_VISR_P2SL_2) /*!< Select CMP1_INP2 as CMP1 INP2 input */ +#define CMP3_INP3_NONE (0x0U) /*!< No input voltage to CMP3 INP3 */ +#define CMP3_INP3_CMP3_INP3 (CMP_VISR_P3SL_0) /*!< Select CMP3_INP3 as CMP3 INP3 input */ +#define CMP3_INP3_CMP4_INP3 (CMP_VISR_P3SL_1) /*!< Select CMP4_INP3 as CMP3 INP3 input */ +#define CMP3_INP2_NONE (0x0U) /*!< No input voltage to CMP3 INP2 */ +#define CMP3_INP2_PGA3 (CMP_VISR_P2SL_0) /*!< Select PGA3 as CMP3 INP2 input */ +#define CMP3_INP2_PGA4 (CMP_VISR_P2SL_1) /*!< Select PGA4 as CMP3 INP2 input */ +#define CMP3_INP2_CMP3_INP2 (CMP_VISR_P2SL_2) /*!< Select CMP3_INP2 as CMp3 INP2 input */ +/** + * @} + */ + +/** @defgroup CMP_Out_Polarity_Select CMP output polarity selection + * @{ + */ +#define CMP_OUT_REVERSE_OFF (0x0U) /*!< CMP output don't reverse */ +#define CMP_OUT_REVERSE_ON (CMP_OCR_COPS) /*!< CMP output level reverse */ +/** + * @} + */ + +/** @defgroup CMP_Out_Detect_Edge CMP output detect edge selection + * @{ + */ +#define CMP_DETECT_EDGS_NONE (0U) /*!< Do not detect edge */ +#define CMP_DETECT_EDGS_RISING (1U << CMP_FIR_EDGS_POS) /*!< Detect rising edge */ +#define CMP_DETECT_EDGS_FALLING (2U << CMP_FIR_EDGS_POS) /*!< Detect falling edge */ +#define CMP_DETECT_EDGS_BOTH (3U << CMP_FIR_EDGS_POS) /*!< Detect rising and falling edges */ +/** + * @} + */ + +/** @defgroup CMP_Out_Filter CMP output filter configuration + * @{ + */ +#define CMP_OUT_FILTER_NONE (0U) /*!< Do not filter */ +#define CMP_OUT_FILTER_PCLK3 (1U) /*!< Use pclk3 */ +#define CMP_OUT_FILTER_PCLK3_DIV8 (2U) /*!< Use pclk3/8 */ +#define CMP_OUT_FILTER_PCLK3_DIV32 (3U) /*!< Use pclk3/32 */ +/** + * @} + */ + +/** @defgroup CMP_TimerWin_func CMP timer window function configuration + * @{ + */ +#define CMP_TIMERWIN_OFF (0x0U) /*!< Disable Timer Window function */ +#define CMP_TIMERWIN_ON (CMP_OCR_TWOE) /*!< Enable Timer Window function */ +/** + * @} + */ + +/** @defgroup CMP_TimerWin_Select CMP output timer window function control signal definition for CMP + * @{ + */ +#define CMP_1_TIMERWIN_TIMA_1_PWM1 (CMP_TWSR_CTWS0) /*!< Selection TIMA_1_PWM1 as timer window signal for CMP1 */ +#define CMP_2_TIMERWIN_TIMA_3_PWM1 (CMP_TWSR_CTWS0) /*!< Selection TIMA_3_PWM1 as timer window signal for CMP2*/ +#define CMP_3_TIMERWIN_TIMA_1_PWM1 (CMP_TWSR_CTWS0) /*!< Selection TIMA_1_PWM1 as timer window signal for CMP3*/ +#define CMP_4_TIMERWIN_TIMA_2_PWM1 (CMP_TWSR_CTWS0) /*!< Selection TIMA_2_PWM1 as timer window signal for CMP4*/ + +#define CMP_1_TIMERWIN_TIMA_1_PWM2 (CMP_TWSR_CTWS1) /*!< Selection TIMA_1_PWM2 as timer window signal for CMP1 */ +#define CMP_2_TIMERWIN_TIMA_3_PWM2 (CMP_TWSR_CTWS1) /*!< Selection TIMA_3_PWM2 as timer window signal for CMP2*/ +#define CMP_3_TIMERWIN_TIMA_1_PWM2 (CMP_TWSR_CTWS1) /*!< Selection TIMA_1_PWM2 as timer window signal for CMP3*/ +#define CMP_4_TIMERWIN_TIMA_2_PWM2 (CMP_TWSR_CTWS1) /*!< Selection TIMA_2_PWM2 as timer window signal for CMP4*/ + +#define CMP_1_TIMERWIN_TIMA_1_PWM3 (CMP_TWSR_CTWS2) /*!< Selection TIMA_1_PWM3 as timer window signal for CMP1 */ +#define CMP_2_TIMERWIN_TIMA_3_PWM3 (CMP_TWSR_CTWS2) /*!< Selection TIMA_3_PWM3 as timer window signal for CMP2*/ +#define CMP_3_TIMERWIN_TIMA_1_PWM3 (CMP_TWSR_CTWS2) /*!< Selection TIMA_1_PWM3 as timer window signal for CMP3*/ +#define CMP_4_TIMERWIN_TIMA_2_PWM3 (CMP_TWSR_CTWS2) /*!< Selection TIMA_2_PWM3 as timer window signal for CMP3*/ + +#define CMP_1_TIMERWIN_TIMA_2_PWM1 (CMP_TWSR_CTWS3) /*!< Selection TIMA_2_PWM1 as timer window signal for CMP1 */ +#define CMP_2_TIMERWIN_TIMA_4_PWM1 (CMP_TWSR_CTWS3) /*!< Selection TIMA_4_PWM1 as timer window signal for CMP2 */ +#define CMP_3_TIMERWIN_TIMA_3_PWM1 (CMP_TWSR_CTWS3) /*!< Selection TIMA_3_PWM1 as timer window signal for CMP3 */ +#define CMP_4_TIMERWIN_TIMA_4_PWM1 (CMP_TWSR_CTWS3) /*!< Selection TIMA_4_PWM1 as timer window signal for CMP4 */ + +#define CMP_1_TIMERWIN_TIMA_2_PWM2 (CMP_TWSR_CTWS4) /*!< Selection TIMA_2_PWM2 as timer window signal for CMP1 */ +#define CMP_2_TIMERWIN_TIMA_4_PWM2 (CMP_TWSR_CTWS4) /*!< Selection TIMA_4_PWM2 as timer window signal for CMP2 */ +#define CMP_3_TIMERWIN_TIMA_3_PWM2 (CMP_TWSR_CTWS4) /*!< Selection TIMA_3_PWM2 as timer window signal for CMP3 */ +#define CMP_4_TIMERWIN_TIMA_4_PWM2 (CMP_TWSR_CTWS4) /*!< Selection TIMA_4_PWM2 as timer window signal for CMP4 */ + +#define CMP_1_TIMERWIN_TIMA_2_PWM3 (CMP_TWSR_CTWS5) /*!< Selection TIMA_2_PWM3 as timer window signal for CMP1 */ +#define CMP_2_TIMERWIN_TIMA_4_PWM3 (CMP_TWSR_CTWS5) /*!< Selection TIMA_4_PWM3 as timer window signal for CMP2 */ +#define CMP_3_TIMERWIN_TIMA_3_PWM3 (CMP_TWSR_CTWS5) /*!< Selection TIMA_3_PWM3 as timer window signal for CMP3 */ +#define CMP_4_TIMERWIN_TIMA_4_PWM3 (CMP_TWSR_CTWS5) /*!< Selection TIMA_4_PWM3 as timer window signal for CMP4 */ + +#define CMP_1_TIMERWIN_TIM6_1_PWMA (CMP_TWSR_CTWS6) /*!< Selection TIM6_1_PWMA as timer window signal for CMP1 */ +#define CMP_2_TIMERWIN_TIM6_5_PWMA (CMP_TWSR_CTWS6) /*!< Selection TIM6_5_PWMA as timer window signal for CMP2 */ +#define CMP_3_TIMERWIN_TIM6_1_PWMB (CMP_TWSR_CTWS6) /*!< Selection TIM6_1_PWMB as timer window signal for CMP3 */ +#define CMP_4_TIMERWIN_TIM6_5_PWMB (CMP_TWSR_CTWS6) /*!< Selection TIM6_5_PWMB as timer window signal for CMP4 */ + +#define CMP_1_TIMERWIN_TIM6_2_PWMA (CMP_TWSR_CTWS7) /*!< Selection TIM6_2_PWMA as timer window signal for CMP1 */ +#define CMP_2_TIMERWIN_TIM6_6_PWMA (CMP_TWSR_CTWS7) /*!< Selection TIM6_6_PWMA as timer window signal for CMP2 */ +#define CMP_3_TIMERWIN_TIM6_2_PWMB (CMP_TWSR_CTWS7) /*!< Selection TIM6_2_PWMB as timer window signal for CMP3 */ +#define CMP_4_TIMERWIN_TIM6_6_PWMB (CMP_TWSR_CTWS7) /*!< Selection TIM6_6_PWMB as timer window signal for CMP4 */ + +#define CMP_1_TIMERWIN_TIM6_3_PWMA (CMP_TWSR_CTWS8) /*!< Selection TIM6_3_PWMA as timer window signal for CMP1 */ +#define CMP_2_TIMERWIN_TIM6_7_PWMA (CMP_TWSR_CTWS8) /*!< Selection TIM6_7_PWMA as timer window signal for CMP2 */ +#define CMP_3_TIMERWIN_TIM6_3_PWMB (CMP_TWSR_CTWS8) /*!< Selection TIM6_3_PWMB as timer window signal for CMP3 */ +#define CMP_4_TIMERWIN_TIM6_7_PWMB (CMP_TWSR_CTWS8) /*!< Selection TIM6_7_PWMB as timer window signal for CMP4 */ + +#define CMP_1_TIMERWIN_TIM6_4_PWMA (CMP_TWSR_CTWS9) /*!< Selection TIM6_4_PWMA as timer window signal for CMP1 */ +#define CMP_2_TIMERWIN_TIM6_8_PWMA (CMP_TWSR_CTWS9) /*!< Selection TIM6_8_PWMA as timer window signal for CMP2 */ +#define CMP_3_TIMERWIN_TIM6_4_PWMB (CMP_TWSR_CTWS9) /*!< Selection TIM6_4_PWMB as timer window signal for CMP3 */ +#define CMP_4_TIMERWIN_TIM6_8_PWMB (CMP_TWSR_CTWS9) /*!< Selection TIM6_8_PWMB as timer window signal for CMP4 */ + +#define CMP_1_TIMERWIN_TIM4_1_OUH (CMP_TWSR_CTWS10) /*!< Selection TIM4_1_OUH as timer window signal for CMP1 */ +#define CMP_2_TIMERWIN_TIM4_2_OUH (CMP_TWSR_CTWS10) /*!< Selection TIM4_2_OUH as timer window signal for CMP2 */ +#define CMP_3_TIMERWIN_TIM4_3_OUH (CMP_TWSR_CTWS10) /*!< Selection TIM4_3_OUH as timer window signal for CMP3 */ +#define CMP_4_TIMERWIN_TIM4_3_OUH (CMP_TWSR_CTWS10) /*!< Selection TIM4_4_OUH as timer window signal for CMP4 */ + +#define CMP_1_TIMERWIN_TIM4_1_OUL (CMP_TWSR_CTWS11) /*!< Selection TIM4_1_OUL as timer window signal for CMP1 */ +#define CMP_2_TIMERWIN_TIM4_2_OUL (CMP_TWSR_CTWS11) /*!< Selection TIM4_2_OUL as timer window signal for CMP2 */ +#define CMP_3_TIMERWIN_TIM4_3_OUL (CMP_TWSR_CTWS11) /*!< Selection TIM4_3_OUL as timer window signal for CMP3 */ +#define CMP_4_TIMERWIN_TIM4_3_OUL (CMP_TWSR_CTWS11) /*!< Selection TIM4_4_OUL as timer window signal for CMP4 */ + +#define CMP_1_TIMERWIN_TIM4_1_OVH (CMP_TWSR_CTWS12) /*!< Selection TIM4_1_OVH as timer window signal for CMP1 */ +#define CMP_2_TIMERWIN_TIM4_2_OVH (CMP_TWSR_CTWS12) /*!< Selection TIM4_2_OVH as timer window signal for CMP2 */ +#define CMP_3_TIMERWIN_TIM4_3_OVH (CMP_TWSR_CTWS12) /*!< Selection TIM4_3_OVH as timer window signal for CMP3 */ +#define CMP_4_TIMERWIN_TIM4_3_OVH (CMP_TWSR_CTWS12) /*!< Selection TIM4_4_OVH as timer window signal for CMP4 */ + +#define CMP_1_TIMERWIN_TIM4_1_OVL (CMP_TWSR_CTWS13) /*!< Selection TIM4_1_OVL as timer window signal for CMP1 */ +#define CMP_2_TIMERWIN_TIM4_2_OVL (CMP_TWSR_CTWS13) /*!< Selection TIM4_2_OVL as timer window signal for CMP2 */ +#define CMP_3_TIMERWIN_TIM4_3_OVL (CMP_TWSR_CTWS13) /*!< Selection TIM4_3_OVL as timer window signal for CMP3 */ +#define CMP_4_TIMERWIN_TIM4_3_OVL (CMP_TWSR_CTWS13) /*!< Selection TIM4_4_OVL as timer window signal for CMP4 */ + +#define CMP_1_TIMERWIN_TIM4_1_OWH (CMP_TWSR_CTWS14) /*!< Selection TIM4_1_OWH as timer window signal for CMP1 */ +#define CMP_2_TIMERWIN_TIM4_2_OWH (CMP_TWSR_CTWS14) /*!< Selection TIM4_2_OWH as timer window signal for CMP2 */ +#define CMP_3_TIMERWIN_TIM4_3_OWH (CMP_TWSR_CTWS14) /*!< Selection TIM4_3_OWH as timer window signal for CMP3 */ +#define CMP_4_TIMERWIN_TIM4_3_OWH (CMP_TWSR_CTWS14) /*!< Selection TIM4_4_OWH as timer window signal for CMP4 */ + +#define CMP_1_TIMERWIN_TIM4_1_OWL (CMP_TWSR_CTWS15) /*!< Selection TIM4_1_OWL as timer window signal for CMP1 */ +#define CMP_2_TIMERWIN_TIM4_2_OWL (CMP_TWSR_CTWS15) /*!< Selection TIM4_2_OWL as timer window signal for CMP2 */ +#define CMP_3_TIMERWIN_TIM4_3_OWL (CMP_TWSR_CTWS15) /*!< Selection TIM4_3_OWL as timer window signal for CMP3 */ +#define CMP_4_TIMERWIN_TIM4_3_OWL (CMP_TWSR_CTWS15) /*!< Selection TIM4_4_OWL as timer window signal for CMP4 */ +/** + * @} + */ + +/** @defgroup CMP_TimerWin_Invalid_Level CMP output level when timer window invalid + * @{ + */ +#define CMP_TIMERWIN_INVALID_LEVEL_LOW (0x0U) /*!< Output Low when timer window invalid */ +#define CMP_TIMERWIN_INVALID_LEVEL_HIGH (CMP_OCR_TWOL) /*!< Output High when timer window invalid */ +/** + * @} + */ + +/** @defgroup CMP_TimerWin_output_Level CMP output level in timer windows mode + * @{ + */ +#define CMP_TIMERWIN_OUT_LEVEL_LOW (0U) /*!< Output Low in timer windows mode */ +#define CMP_TIMERWIN_OUT_LEVEL_HIGH (1U) /*!< Output High in timer windows mode */ +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup CMP_Global_Functions + * @{ + */ +en_result_t CMP_StructInit(stc_cmp_init_t *pstcCMP_InitStruct); +en_result_t CMP_NormalModeInit(M4_CMP_TypeDef *CMPx, + const stc_cmp_init_t *pstcCmpInit); +en_result_t CMP_WindowModeInit(const M4_CMP_TypeDef *CMPx, + const stc_cmp_init_t *pstcCmpInit, + const stc_cmp_win_ref_t *pstcCmpWinRef); +en_result_t CMP_TimerWindowConfig(M4_CMP_TypeDef *CMPx, + const stc_cmp_timerwindow_t *pstcCMP_TimerWinStruct); + +void CMP_FuncCmd(M4_CMP_TypeDef *CMPx, en_functional_state_t enNewStatus); +void CMP_IntCmd(M4_CMP_TypeDef *CMPx, en_functional_state_t enNewStatus); +void CMP_OutputCmd(M4_CMP_TypeDef *CMPx, en_functional_state_t enNewStatus); +void CMP_VCOUTCmd(M4_CMP_TypeDef *CMPx, en_functional_state_t enNewStatus); +void CMP_SetOutDetectEdges(M4_CMP_TypeDef *CMPx, uint8_t u8CmpEdges); +void CMP_SetOutputFilter(M4_CMP_TypeDef *CMPx, uint8_t u8CmpFilter); +void CMP_SetOutputPolarity(M4_CMP_TypeDef *CMPx, uint8_t u8CmpPolarity); +void CMP_SetCompareVol(M4_CMP_TypeDef *CMPx, uint8_t u8CmpCh, uint8_t u8CmpVol); +void CMP_SetRefVol(M4_CMP_TypeDef *CMPx, uint8_t u8RefVol); +void CMP_DeInit(M4_CMP_TypeDef *CMPx); +void CMP_SetTimerWinSignal(M4_CMP_TypeDef *CMPx, \ + uint16_t u16TWSignal, en_functional_state_t enNewStatus); +en_flag_status_t CMP_GetResult(const M4_CMP_TypeDef *CMPx); +/** + * @} + */ + +#endif /* DDL_CMP_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_CMP_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_crc.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_crc.h new file mode 100644 index 0000000000..255866ecd4 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_crc.h @@ -0,0 +1,143 @@ +/** + ******************************************************************************* + * @file hc32f4a0_crc.h + * @brief This file contains all the functions prototypes of the CRC driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Heqb First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_CRC_H__ +#define __HC32F4A0_CRC_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_CRC + * @{ + */ + +#if (DDL_CRC_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/* Bits definitions of CRC control register(CRC_CR). */ +/** + * @defgroup CRC_Global_Macros CRC Global Macros + * @{ + */ + +/** + * @defgroup CRC_Protocol_Control_Bit CRC Protocol Control Bit + * @note: - CRC16 polynomial is X16 + X12 + X5 + 1 + * - CRC32 polynomial is X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10 + \ + * X8 + X7 + X5 + X4 + X2 + X + 1 + * @{ + */ +#define CRC_CRC16 (0x0UL) +#define CRC_CRC32 (CRC_CR_CR) +/** + * @} + */ + +/** + * @defgroup CRC_Flag_Bit_Mask CRC Flag Bit Mask + * @{ + */ +#define CRC_FLAG_MASK (CRC_CR_FLAG) +/** + * @} + */ + +/** + * @defgroup CRC_Bit_Width CRC Bit Width + * @{ + */ +#define CRC_BW_8 (8U) +#define CRC_BW_16 (16U) +#define CRC_BW_32 (32U) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup CRC_Global_Functions + * @{ + */ +uint32_t CRC_Calculate(uint32_t u32CrcProtocol, + const void *pvData, + uint32_t u32InitVal, + uint32_t u32Length, + uint8_t u8BitWidth); + +en_flag_status_t CRC_Check(uint32_t u32CrcProtocol, + uint32_t u32CheckSum, + const void *pvData, + uint32_t u32InitVal, + uint32_t u32Length, + uint8_t u8BitWidth); +/** + * @} + */ + +#endif /* DDL_CRC_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_CRC_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_ctc.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_ctc.h new file mode 100644 index 0000000000..d2c4cdc788 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_ctc.h @@ -0,0 +1,210 @@ +/** + ******************************************************************************* + * @file hc32f4a0_ctc.h + * @brief This file contains all the functions prototypes of the Clock Trimming + * Controller(CTC) driver library. + @verbatim + Change Logs: + Date Author Notes + 2020-09-01 Hongjh First version + 2020-10-30 Hongjh Refine CTC initialization structure + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_CTC_H__ +#define __HC32F4A0_CTC_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_CTC + * @{ + */ + +#if (DDL_CTC_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup CTC_Global_Types CTC Global Types + * @{ + */ + +/** + * @brief CTC initialization structure definition + */ +typedef struct +{ + uint32_t u32RefClockFreq; /*!< Reference clock frequency + This parameter should refer user manual recommended values */ + uint32_t u32RefClockSrc; /*!< Reference clock source selection + This parameter can be a value of @ref CTC_Reference_Clock_Source */ + uint32_t u32RefClockDiv; /*!< Reference clock division + This parameter can be a value of @ref CTC_Reference_Clock_Division */ + float32_t f32ToleranceDeviation; /*!< CTC Tolerance bias. + This parameter can be a value between Min_Data=0.0 and Max_Data=1.0(100%) */ + uint32_t u32TrimValue; /*!< CTC TRMVAL value + This parameter can be a value between Min_Data=0 and Max_Data=0x3F */ +} stc_ctc_init_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup CTC_Global_Macros CTC Global Macros + * @{ + */ + +/** + * @defgroup CTC_Reference_Clock_Source CTC Reference Clock Source + * @{ + */ +#define CTC_REF_CLK_CTCREF (0UL) /*!< Clock source: CTCREF */ +#define CTC_REF_CLK_XTAL32 (CTC_CR1_REFCKS_1) /*!< Clock source: XTAL32 */ +#define CTC_REF_CLK_XTAL (CTC_CR1_REFCKS) /*!< Clock source: XTAL */ +/** + * @} + */ + +/** + * @defgroup CTC_Tolerance_Deviation_Max CTC Tolerance Deviation Max + * @{ + */ +#define CTC_TOLERANCE_DEVIATION_MAX (1.0F) +/** + * @} + */ + +/** + * @defgroup CTC_Flag CTC Flag + * @{ + */ +#define CTC_FLAG_TRIM_OK (CTC_STR_TRIMOK) /*!< Trimming OK flag */ +#define CTC_FLAG_TRIM_OVF (CTC_STR_TRMOVF) /*!< Trimming overflow flag */ +#define CTC_FLAG_TRIM_UDF (CTC_STR_TRMUDF) /*!< Trimming underflow flag */ +#define CTC_FLAG_BUSY (CTC_STR_CTCBSY) /*!< CTC busy flag */ +#define CTC_FLAG_ALL (CTC_FLAG_TRIM_OK | \ + CTC_FLAG_TRIM_OVF | \ + CTC_FLAG_TRIM_UDF | \ + CTC_FLAG_BUSY) +/** + * @} + */ + +/** + * @defgroup CTC_Reference_Clock_Division CTC Reference Clock Division + * @{ + */ +#define CTC_REF_CLK_DIV8 (0UL) /*!< REFCLK/8 */ +#define CTC_REF_CLK_DIV32 (1UL) /*!< REFCLK/32 */ +#define CTC_REF_CLK_DIV128 (2UL) /*!< REFCLK/128 */ +#define CTC_REF_CLK_DIV256 (3UL) /*!< REFCLK/256 */ +#define CTC_REF_CLK_DIV512 (4UL) /*!< REFCLK/512 */ +#define CTC_REF_CLK_DIV1024 (5UL) /*!< REFCLK/1024 */ +#define CTC_REF_CLK_DIV2048 (6UL) /*!< REFCLK/2048 */ +#define CTC_REF_CLK_DIV4096 (7UL) /*!< REFCLK/4096 */ +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup CTC_Global_Functions + * @{ + */ + +/** + * @brief Start CTC trimming. + * @param None + * @retval None + */ +__STATIC_INLINE void CTC_Start(void) +{ + WRITE_REG32(bM4_CTC->CR1_b.CTCEN, 1UL); +} + +/** + * @brief Stop CTC trimming. + * @param None + * @retval None + */ +__STATIC_INLINE void CTC_Stop(void) +{ + WRITE_REG32(bM4_CTC->CR1_b.CTCEN, 0UL); +} + +en_result_t CTC_Init(const stc_ctc_init_t *pstcCtcInit); +en_result_t CTC_StructInit(stc_ctc_init_t *pstcCtcInit); +en_result_t CTC_DeInit(void); +void CTC_SetRefClockDiv(uint32_t u32Div); +void CTC_SetRefClockSrc(uint32_t u32ClockSrc); +void CTC_IntCmd(en_functional_state_t enNewState); +en_flag_status_t CTC_GetStatus(uint32_t u32Flag); +void CTC_SetTrimValue(uint32_t u32TrimValue); +uint32_t CTC_GetTrimValue(void); +void CTC_SetReloadValue(uint32_t u32ReloadValue); +uint16_t CTC_GetReloadValue(void); +void CTC_SetOffsetValue(uint32_t u32OffsetValue); +uint32_t CTC_GetOffsetValue(void); + +/** + * @} + */ + +#endif /* DDL_CTC_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_CTC_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_dac.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_dac.h new file mode 100644 index 0000000000..92be0b9121 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_dac.h @@ -0,0 +1,189 @@ +/** + ******************************************************************************* + * @file hc32f4a0_dac.h + * @brief This file contains all the functions prototypes of the DAC driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Hexiao First version + 2020-07-15 Hexiao 1. Modify DAC_ChannelCmd to DAC_Start and DAC_Stop + 2. Modify DAC_DualChannelCmd to DAC_DualChannelStart + and DAC_DualChannelStop + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_DAC_H__ +#define __HC32F4A0_DAC_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_DAC + * @{ + */ + +#if (DDL_DAC_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup DAC_Global_Types DAC Global Types + * @{ + */ + +/** + * @brief Structure definition of DAC initialization. + */ +typedef struct +{ + uint16_t u16Src; /*!< Data source to be converted + This parameter can be a value of @ref DAC_DATA_SRC */ + + en_functional_state_t enOutput; /*!< Enable or disable analog output + This parameter can be a value of @ref en_functional_state_t */ + +} stc_dac_init_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ + +/** + * @defgroup DAC_Global_Macros DAC Global Macros + * @{ + */ + +/** + * @defgroup DAC_CH DAC channel + * @{ + */ +#define DAC_CH_1 (0U) +#define DAC_CH_2 (1U) +/** + * @} + */ + +/** + * @defgroup DAC_DATA_SRC DAC data source + * @{ + */ +#define DAC_DATA_SRC_DATAREG (0U) +#define DAC_DATA_SRC_DCU (1U) +/** + * @} + */ + +/** + * @defgroup DAC_DATAREG_ALIGN_PATTERN DAC data register alignment pattern + * @{ + */ +#define DAC_DATA_ALIGN_L (DAC_DACR_DPSEL) +#define DAC_DATA_ALIGN_R (0U) +/** + * @} + */ + +#define DAC_DATAREG_VALUE_MAX (4096UL) + +/** + * @defgroup DAC_ADP_SELECT DAC ADCx priority select + * @{ + */ +#define DAC_ADP_SELECT_ADC1 (DAC_DAADPCR_ADPSL1) +#define DAC_ADP_SELECT_ADC2 (DAC_DAADPCR_ADPSL2) +#define DAC_ADP_SELECT_ADC3 (DAC_DAADPCR_ADPSL3) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup DAC_Global_Functions + * @{ + */ + +en_result_t DAC_StructInit(stc_dac_init_t * pstcInit); +en_result_t DAC_Init(M4_DAC_TypeDef *DACx, uint16_t u16Ch, const stc_dac_init_t *pstcInit); +void DAC_DeInit(M4_DAC_TypeDef *DACx); + +void DAC_SetDataSource(M4_DAC_TypeDef *DACx, uint16_t u16Ch, uint16_t u16Src); +void DAC_DataRegAlignConfig(M4_DAC_TypeDef *DACx, uint16_t u16Align); +void DAC_OutputCmd(M4_DAC_TypeDef *DACx, uint16_t u16Ch, en_functional_state_t enNewState); +en_result_t DAC_AMPCmd(M4_DAC_TypeDef *DACx, uint16_t u16Ch, en_functional_state_t enNewState); +void DAC_ADCPrioCmd(M4_DAC_TypeDef *DACx, en_functional_state_t enNewState); +void DAC_ADCPrioConfig(M4_DAC_TypeDef *DACx, uint16_t u16ADCxPrio, en_functional_state_t enNewState); + +en_result_t DAC_Start(M4_DAC_TypeDef *DACx, uint16_t u16Ch); +en_result_t DAC_Stop(M4_DAC_TypeDef *DACx, uint16_t u16Ch); +void DAC_DualChannelStart(M4_DAC_TypeDef *DACx); +void DAC_DualChannelStop(M4_DAC_TypeDef *DACx); + +void DAC_SetChannel1Data(M4_DAC_TypeDef *DACx, uint16_t data); +void DAC_SetChannel2Data(M4_DAC_TypeDef *DACx, uint16_t data); +void DAC_SetDualChannelData(M4_DAC_TypeDef *DACx, uint16_t data2, uint16_t data1); +en_result_t DAC_GetChannel1ConvState(const M4_DAC_TypeDef *DACx); +en_result_t DAC_GetChannel2ConvState(const M4_DAC_TypeDef *DACx); + +/** + * @} + */ + +#endif /* DDL_DAC_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_DAC_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_dcu.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_dcu.h new file mode 100644 index 0000000000..45d8f54b0a --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_dcu.h @@ -0,0 +1,347 @@ +/** + ******************************************************************************* + * @file hc32f4a0_dcu.h + * @brief This file contains all the functions prototypes of the DCU(Data + * Computing Unit) driver library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Hongjh First version + 2020-07-23 Hongjh 1. Correct the macro define: DCU_CMP_TRIG_DATA01; + 2. Refine the macro define for interrupt, flag and mode; + 3. Modify API: from DCU_IntFuncCmd to DCU_GlobalIntCmd; + 4. Delete API: DCU_SetCmpIntMode; + 5. Modify DCU DATA read/write API. + 2020-09-07 Hongjh Refine API: DCU_SetTriggerSrc + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_DCU_H__ +#define __HC32F4A0_DCU_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_DCU + * @{ + */ + +#if (DDL_DCU_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup DCU_Global_Types DCU Global Types + * @{ + */ + +/** + * @brief DCU initialization structure definition + */ +typedef struct +{ + uint32_t u32IntEn; /*!< Select DCU interrupt function. + This parameter can be a value of @ref DCU_Interrupt_Configure */ + + uint32_t u32DataSize; /*!< Specifies DCU data size. + This parameter can be a value of @ref DCU_Data_Size */ + + uint32_t u32Mode; /*!< Specifies DCU operation. + This parameter can be a value of @ref DCU_Mode */ + + uint32_t u32CmpTriggerMode; /*!< Specifies DCU compare operation trigger mode size. + This parameter can be a value of @ref DCU_Compare_Trigger_Mode */ +} stc_dcu_init_t; + +/** + * @brief DCU wave output configure structure definition + */ +typedef struct +{ + uint32_t u32LowerLimit; /*!< Defines the wave lower limit of the wave amplitude. + This parameter can be a value between Min_Data = 0 and Max_Data = 0xFFF */ + + uint32_t u32UpperLimit; /*!< Defines the upper limit of the wave amplitude. + This parameter can be a value between Min_Data = 0 and Max_Data = 0xFFF */ + + uint32_t u32Step; /*!< Defines the increasing/decreasing step. + This parameter can be a value between Min_Data = 0 and Max_Data = 0xFFF */ +} stc_dcu_wave_cfg_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup DCU_Global_Macros DCU Global Macros + * @{ + */ + +/** + * @defgroup DCU_Data_Size DCU Data Size + * @{ + */ +#define DCU_DATA_SIZE_8BIT (0UL) /*!< DCU data size: 8 bit */ +#define DCU_DATA_SIZE_16BIT (DCU_CTL_DATASIZE_0) /*!< DCU data size: 16 bit */ +#define DCU_DATA_SIZE_32BIT (DCU_CTL_DATASIZE_1) /*!< DCU data size: 32 bit */ +/** + * @} + */ + +/** + * @defgroup DCU_Compare_Trigger_Mode DCU Compare Trigger Mode + * @{ + */ +#define DCU_CMP_TRIG_DATA0 (0UL) /*!< DCU compare triggered by DATA0 */ +#define DCU_CMP_TRIG_DATA012 (DCU_CTL_COMP_TRG) /*!< DCU compare triggered by DATA0 or DATA1 or DATA2 */ +/** + * @} + */ + +/** + * @defgroup DCU_Mode DCU Mode + * @{ + */ +#define DCU_INVALID (0UL) /*!< DCU invalid */ +#define DCU_ADD (DCU_CTL_MODE_0) /*!< DCU add operation */ +#define DCU_SUB (DCU_CTL_MODE_1) /*!< DCU sub operation */ +#define DCU_HW_ADD (DCU_CTL_MODE_1 | \ + DCU_CTL_MODE_0) /*!< Hardware trigger DCU add */ +#define DCU_HW_SUB (DCU_CTL_MODE_2) /*!< Hardware trigger DCU sub */ +#define DCU_CMP (DCU_CTL_MODE_2 | \ + DCU_CTL_MODE_0) /*!< DCU compare */ +#define DCU_TRIANGLE_WAVE (DCU_CTL_MODE_3) /*!< DCU triangle wave output mode */ +#define DCU_SAWTOOTH_WAVE_INC (DCU_CTL_MODE_3 | \ + DCU_CTL_MODE_0) /*!< DCU increasing sawtooth wave output mode */ +#define DCU_SAWTOOTH_WAVE_DEC (DCU_CTL_MODE_3 | \ + DCU_CTL_MODE_1) /*!< DCU decreasing sawtooth wave output mode */ +/** + * @} + */ + +/** + * @defgroup DCU_Interrupt_Configure DCU Interrupt Configure + * @{ + */ +#define DCU_INT_DISABLE (0UL) /*!< Disable DCU interrupt */ +#define DCU_INT_ENABLE (DCU_CTL_INTEN) /*!< Enable DCU interrupt */ +/** + * @} + */ + +/** + * @defgroup DCU_Flag DCU Flag + * @{ + */ +#define DCU_FLAG_OPERATION (DCU_FLAG_FLAG_OP) /*!< DCU addition overflow or subtraction underflow flag */ +#define DCU_FLAG_DATA0_LS_DATA2 (DCU_FLAG_FLAG_LS2) /*!< DCU DATA0 < DATA2 flag */ +#define DCU_FLAG_DATA0_EQ_DATA2 (DCU_FLAG_FLAG_EQ2) /*!< DCU DATA0 = DATA2 flag */ +#define DCU_FLAG_DATA0_GT_DATA2 (DCU_FLAG_FLAG_GT2) /*!< DCU DATA0 > DATA2 flag */ +#define DCU_FLAG_DATA0_LS_DATA1 (DCU_FLAG_FLAG_LS1) /*!< DCU DATA0 < DATA1 flag */ +#define DCU_FLAG_DATA0_EQ_DATA1 (DCU_FLAG_FLAG_EQ1) /*!< DCU DATA0 = DATA1 flag */ +#define DCU_FLAG_DATA0_GT_DATA1 (DCU_FLAG_FLAG_GT1) /*!< DCU DATA0 > DATA1 flag */ +#define DCU_FLAG_WAVE_SAWTOOTH_RELOAD (DCU_FLAG_FLAG_RLD) /*!< DCU sawtooth wave mode reload interrupt */ +#define DCU_FLAG_WAVE_TRIANGLE_BOTTOM (DCU_FLAG_FLAG_BTM) /*!< DCU triangle wave mode bottom interrupt */ +#define DCU_FLAG_WAVE_TRIANGLE_TOP (DCU_FLAG_FLAG_TOP) /*!< DCU triangle wave mode top interrupt */ +/** + * @} + */ + +/** + * @defgroup DCU_Interrupt_Category DCU Interrupt Category + * @{ + */ +#define DCU_INT_OP (0UL) /*!< DCU operation result(overflow/underflow) interrupt */ +#define DCU_INT_WAVE_MD (1UL) /*!< DCU wave mode(sawtooth/triangle wave mode) interrupt */ +#define DCU_INT_CMP_WIN (2UL) /*!< DCU comparison(window) interrupt */ +#define DCU_INT_CMP_NON_WIN (3UL) /*!< DCU comparison(non-window) interrupt */ +/** + * @} + */ + +/** + * @defgroup DCU_Interrupt_Type DCU Interrupt Type + * @{ + */ +/** + * @defgroup DCU_Compare_Interrupt DCU Compare(Non-window) Interrupt + * @{ + * @note Compare interrupt selection is valid only when select DCU comparison(non-window) interrupt(DCU_INTSEL.INT_WIN=0) under DCU compare mode + */ +#define DCU_INT_CMP_DATA0_LS_DATA2 (DCU_INTEVTSEL_SEL_LS2) /*!< DCU DATA0 < DATA2 interrupt */ +#define DCU_INT_CMP_DATA0_EQ_DATA2 (DCU_INTEVTSEL_SEL_EQ2) /*!< DCU DATA0 = DATA2 interrupt */ +#define DCU_INT_CMP_DATA0_GT_DATA2 (DCU_INTEVTSEL_SEL_GT2) /*!< DCU DATA0 > DATA2 interrupt */ +#define DCU_INT_CMP_DATA0_LS_DATA1 (DCU_INTEVTSEL_SEL_LS1) /*!< DCU DATA0 < DATA1 interrupt */ +#define DCU_INT_CMP_DATA0_EQ_DATA1 (DCU_INTEVTSEL_SEL_EQ1) /*!< DCU DATA0 = DATA1 interrupt */ +#define DCU_INT_CMP_DATA0_GT_DATA1 (DCU_INTEVTSEL_SEL_GT1) /*!< DCU DATA0 > DATA1 interrupt */ +#define DCU_INT_CMP_NON_WIN_ALL (DCU_INT_CMP_DATA0_LS_DATA2 | \ + DCU_INT_CMP_DATA0_EQ_DATA2 | \ + DCU_INT_CMP_DATA0_GT_DATA2 | \ + DCU_INT_CMP_DATA0_LS_DATA1 | \ + DCU_INT_CMP_DATA0_EQ_DATA1 | \ + DCU_INT_CMP_DATA0_GT_DATA1) +/** + * @} + */ + +/** + * @defgroup DCU_Window_Compare_Interrupt DCU Window Compare Interrupt + * @{ + */ +#define DCU_INT_CMP_WIN_INSIDE (DCU_INTEVTSEL_SEL_WIN_0) /*!< DCU comparison(DATA2 <= DATA0 <= DATA1) interrupt */ +#define DCU_INT_CMP_WIN_OUTSIDE (DCU_INTEVTSEL_SEL_WIN_1) /*!< DCU comparison(DATA0 < DATA2 & DATA0 > DATA1 ) interrupt */ +#define DCU_INT_CMP_WIN_ALL (DCU_INT_CMP_WIN_INSIDE | \ + DCU_INT_CMP_WIN_OUTSIDE) +/** + * @} + */ + +/** + * @defgroup DCU_Wave_Mode_Interrupt DCU Wave Mode Interrupt + * @{ + */ +#define DCU_INT_WAVE_SAWTOOTH_RELOAD (DCU_INTEVTSEL_SEL_RLD) /*!< DCU sawtooth wave mode reload interrupt */ +#define DCU_INT_WAVE_TRIANGLE_BOTTOM (DCU_INTEVTSEL_SEL_BTM) /*!< DCU triangle wave mode bottom interrupt */ +#define DCU_INT_WAVE_TRIANGLE_TOP (DCU_INTEVTSEL_SEL_TOP) /*!< DCU triangle wave mode top interrupt */ +#define DCU_INT_WAVE_MD_ALL (DCU_INT_WAVE_TRIANGLE_TOP |\ + DCU_INT_WAVE_TRIANGLE_BOTTOM |\ + DCU_INT_WAVE_SAWTOOTH_RELOAD) +/** + * @} + */ + +/** + * @defgroup DCU_Operation_Interrupt DCU Operation Interrupt + * @{ + */ +#define DCU_INT_OP_UDF_OVF (DCU_INTEVTSEL_SEL_OP) /*!< DCU addition overflow or subtraction underflow interrupt */ +/** + * @} + */ +/** + * @} + */ + +/** + * @defgroup DCU_Data_Register_Index DCU Data Register Index + * @{ + */ +#define DCU_DATA0_IDX (0UL) /*!< DCU DATA0 */ +#define DCU_DATA1_IDX (1UL) /*!< DCU DATA1 */ +#define DCU_DATA2_IDX (2UL) /*!< DCU DATA2 */ +/** + * @} + */ + +/** + * @defgroup DCU_Common_Trigger_Source_Configure DCU common Trigger Source Configure + * @{ + */ +#define DCU_COM_TRIG1 (AOS_DCU_1_TRGSEL_COMTRG_EN_0) +#define DCU_COM_TRIG2 (AOS_DCU_1_TRGSEL_COMTRG_EN_1) +#define DCU_COM_TRIG_MASK (AOS_DCU_1_TRGSEL_COMTRG_EN) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup DCU_Global_Functions + * @{ + */ + +/* Initialization and configuration DCU functions */ +en_result_t DCU_Init(M4_DCU_TypeDef *DCUx, const stc_dcu_init_t *pstcInit); +en_result_t DCU_StructInit(stc_dcu_init_t *pstcInit); +void DCU_DeInit(M4_DCU_TypeDef *DCUx); + +en_result_t DCU_WaveCfg(M4_DCU_TypeDef *DCUx, const stc_dcu_wave_cfg_t *pstcCfg); +void DCU_SetMode(M4_DCU_TypeDef *DCUx, uint32_t u32Mode); +uint32_t DCU_GetMode(const M4_DCU_TypeDef *DCUx); +void DCU_SetDataSize(M4_DCU_TypeDef *DCUx, uint32_t u32DataSize); +uint32_t DCU_GetDataSize(const M4_DCU_TypeDef *DCUx); +en_flag_status_t DCU_GetStatus(const M4_DCU_TypeDef *DCUx, uint32_t u32Flag); +void DCU_ClearStatus(M4_DCU_TypeDef *DCUx, uint32_t u32Flag); +void DCU_IntCmd(M4_DCU_TypeDef *DCUx, + uint32_t u32IntCategory, + uint32_t u32IntType, + en_functional_state_t enNewState); +void DCU_GlobalIntCmd(M4_DCU_TypeDef *DCUx, en_functional_state_t enNewState); +void DCU_ComTriggerCmd(M4_DCU_TypeDef *DCUx, + uint32_t u32ComTrig, + en_functional_state_t enNewState); +void DCU_SetTriggerSrc(const M4_DCU_TypeDef *DCUx, en_event_src_t enEventSrc); + +uint8_t DCU_ReadData8(const M4_DCU_TypeDef *DCUx, uint32_t u32DataIndex); +void DCU_WriteData8(M4_DCU_TypeDef *DCUx, + uint32_t u32DataIndex, + uint8_t u8Data); +uint16_t DCU_ReadData16(const M4_DCU_TypeDef *DCUx, uint32_t u32DataIndex); +void DCU_WriteData16(M4_DCU_TypeDef *DCUx, + uint32_t u32DataIndex, + uint16_t u16Data); +uint32_t DCU_ReadData32(const M4_DCU_TypeDef *DCUx, uint32_t u32DataIndex); +void DCU_WriteData32(M4_DCU_TypeDef *DCUx, + uint32_t u32DataIndex, + uint32_t u32Data); + +/** + * @} + */ + +#endif /* DDL_DCU_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_DCU_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_dma.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_dma.h new file mode 100644 index 0000000000..72a19e274e --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_dma.h @@ -0,0 +1,553 @@ +/** + ******************************************************************************* + * @file hc32f4a0_dma.h + * @brief This file contains all the functions prototypes of the DMA driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Zhangxl First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_DMA_H__ +#define __HC32F4A0_DMA_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_DMA + * @{ + */ + +#if (DDL_DMA_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup DMA_Global_Types DMA Global Types + * @{ + */ + +/** + * @brief DMA basic configuration + */ +typedef struct +{ + uint32_t u32IntEn; /*!< Specifies the DMA interrupt function. + This parameter can be a value of @ref DMA_Int_Config */ + + uint32_t u32SrcAddr; /*!< Specifies the DMA source address. */ + + uint32_t u32DestAddr; /*!< Specifies the DMA destination address. */ + + uint32_t u32DataWidth; /*!< Specifies the DMA transfer data width. + This parameter can be a value of @ref DMA_DataWidth_Sel */ + + uint32_t u32BlockSize; /*!< Specifies the DMA block size. */ + + uint32_t u32TransCnt; /*!< Specifies the DMA transfer count. */ + + uint32_t u32SrcInc; /*!< Specifies the source address increment mode. + This parameter can be a value of @ref DMA_SrcAddr_Incremented_Mode */ + + uint32_t u32DestInc; /*!< Specifies the destination address increment mode. + This parameter can be a value of @ref DMA_DesAddr_Incremented_Mode */ + +} stc_dma_init_t; + +/** + * @brief DMA repeat mode configuration + */ +typedef struct +{ + uint32_t u32SrcRptEn; /*!< Specifies the DMA source repeat function. + This parameter can be a value of @ref DMA_Repeat_Config */ + + uint32_t u32SrcRptSize; /*!< Specifies the DMA source repeat size. */ + + uint32_t u32DestRptEn; /*!< Specifies the DMA destination repeat function. + This parameter can be a value of @ref DMA_Repeat_Config */ + + uint32_t u32DestRptSize; /*!< Specifies the DMA destination repeat size. */ + +} stc_dma_rpt_init_t; + +/** + * @brief DMA non-sequence mode configuration + */ +typedef struct +{ + uint32_t u32SrcNonSeqEn; /*!< Specifies the DMA source non-sequence function. + This parameter can be a value of @ref DMA_NonSeq_Config */ + + uint32_t u32SrcNonSeqCnt; /*!< Specifies the DMA source non-sequence function count. */ + + uint32_t u32SrcNonSeqOfs; /*!< Specifies the DMA source non-sequence function offset. */ + + uint32_t u32DestNonSeqEn; /*!< Specifies the DMA destination non-sequence function. + This parameter can be a value of @ref DMA_NonSeq_Config */ + + uint32_t u32DestNonSeqCnt; /*!< Specifies the DMA destination non-sequence function count. */ + + uint32_t u32DestNonSeqOfs; /*!< Specifies the DMA destination non-sequence function offset. */ + +} stc_dma_nonseq_init_t; + +/** + * @brief DMA Link List Pointer (LLP) mode configuration + */ +typedef struct +{ + uint32_t u32LlpEn; /*!< Specifies the DMA LLP function. + This parameter can be a value of @ref DMA_Llp_En */ + + uint32_t u32LlpRun; /*!< Specifies the DMA LLP auto or wait REQ. + This parameter can be a value of @ref DMA_Llp_Mode */ + + uint32_t u32LlpAddr; /*!< Specifies the DMA list pointer address for LLP function. */ + +} stc_dma_llp_init_t; + +/** + * @brief DMA re-config function configuration + */ +typedef struct +{ + uint32_t u32CntMode; /*!< Specifies the DMA reconfig function count mode. + This parameter can be a value of @ref DMA_ReConfig_Cnt_Sel */ + + uint32_t u32DestAddrMode; /*!< Specifies the DMA reconfig function destination address mode. + This parameter can be a value of @ref DMA_ReConfig_DestAddr_Sel */ + + uint32_t u32SrcAddrMode; /*!< Specifies the DMA reconfig function source address mode. + This parameter can be a value of @ref DMA_ReConfig_SrcAddr_Sel */ + +} stc_dma_reconfig_init_t; + +/** + * @brief Dma LLP(linked list pointer) descriptor structure definition + */ +typedef struct +{ + uint32_t SARx; /*!< LLP source address */ + uint32_t DARx; /*!< LLP destination address */ + uint32_t DTCTLx; /*!< LLP transfer count and block size */ + uint32_t RPTx; /*!< LLP source & destination repeat size */ + uint32_t SNSEQCTLx; /*!< LLP source non-seq count and offset */ + uint32_t DNSEQCTLx; /*!< LLP destination non-seq count and offset */ + uint32_t LLPx; /*!< LLP next list pointer */ + uint32_t CHCTLx; /*!< LLP channel control */ +} stc_dma_llp_descriptor_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup DMA_Global_Macros DMA Global Macros + * @{ + */ + +/** + * @defgroup DMA_Channel_selection DMA Channel Position selection + * @{ + */ +#define DMA_CH0 (0x00U) /*!< DMA Channel 0 */ +#define DMA_CH1 (0x01U) /*!< DMA Channel 1 */ +#define DMA_CH2 (0x02U) /*!< DMA Channel 2 */ +#define DMA_CH3 (0x03U) /*!< DMA Channel 3 */ +#define DMA_CH4 (0x04U) /*!< DMA Channel 4 */ +#define DMA_CH5 (0x05U) /*!< DMA Channel 5 */ +#define DMA_CH6 (0x06U) /*!< DMA Channel 6 */ +#define DMA_CH7 (0x07U) /*!< DMA Channel 7 */ +/** + * @} + */ + +/** + * @defgroup DMA_Mx_Channel_selection DMA Multiplex Channel selection + * @{ + */ +#define DMA_MX_CH0 (0x01UL) /*!< DMA Channel 0 position */ +#define DMA_MX_CH1 (0x02UL) /*!< DMA Channel 1 position */ +#define DMA_MX_CH2 (0x04UL) /*!< DMA Channel 2 position */ +#define DMA_MX_CH3 (0x08UL) /*!< DMA Channel 3 position */ +#define DMA_MX_CH4 (0x10UL) /*!< DMA Channel 4 position */ +#define DMA_MX_CH5 (0x20UL) /*!< DMA Channel 5 position */ +#define DMA_MX_CH6 (0x40UL) /*!< DMA Channel 6 position */ +#define DMA_MX_CH7 (0x80UL) /*!< DMA Channel 7 position */ +#define DMA_MX_CH_ALL (0xFFUL) /*!< DMA Channel mask position */ +/** + * @} + */ + +/** + * @defgroup DMA_ReqErrIrq_Sel DMA request error interrupt selection + * @{ + */ +#define DMA_REQ_ERR_CH0 (DMA_INTSTAT0_REQERR_0) /*!< DMA request error interrupt CH.0 */ +#define DMA_REQ_ERR_CH1 (DMA_INTSTAT0_REQERR_1) /*!< DMA request error interrupt CH.1 */ +#define DMA_REQ_ERR_CH2 (DMA_INTSTAT0_REQERR_2) /*!< DMA request error interrupt CH.2 */ +#define DMA_REQ_ERR_CH3 (DMA_INTSTAT0_REQERR_3) /*!< DMA request error interrupt CH.3 */ +#define DMA_REQ_ERR_CH4 (DMA_INTSTAT0_REQERR_4) /*!< DMA request error interrupt CH.4 */ +#define DMA_REQ_ERR_CH5 (DMA_INTSTAT0_REQERR_5) /*!< DMA request error interrupt CH.5 */ +#define DMA_REQ_ERR_CH6 (DMA_INTSTAT0_REQERR_6) /*!< DMA request error interrupt CH.6 */ +#define DMA_REQ_ERR_CH7 (DMA_INTSTAT0_REQERR_7) /*!< DMA request error interrupt CH.7 */ +/** + * @} + */ + +/** + * @defgroup DMA_TransErrIrq_Sel DMA transfer error interrupt selection + * @{ + */ +#define DMA_TRANS_ERR_CH0 (DMA_INTSTAT0_TRNERR_0) /*!< DMA transfer error interrupt CH.0 */ +#define DMA_TRANS_ERR_CH1 (DMA_INTSTAT0_TRNERR_1) /*!< DMA transfer error interrupt CH.1 */ +#define DMA_TRANS_ERR_CH2 (DMA_INTSTAT0_TRNERR_2) /*!< DMA transfer error interrupt CH.2 */ +#define DMA_TRANS_ERR_CH3 (DMA_INTSTAT0_TRNERR_3) /*!< DMA transfer error interrupt CH.3 */ +#define DMA_TRANS_ERR_CH4 (DMA_INTSTAT0_TRNERR_4) /*!< DMA transfer error interrupt CH.4 */ +#define DMA_TRANS_ERR_CH5 (DMA_INTSTAT0_TRNERR_5) /*!< DMA transfer error interrupt CH.5 */ +#define DMA_TRANS_ERR_CH6 (DMA_INTSTAT0_TRNERR_6) /*!< DMA transfer error interrupt CH.6 */ +#define DMA_TRANS_ERR_CH7 (DMA_INTSTAT0_TRNERR_7) /*!< DMA transfer error interrupt CH.7 */ +/** + * @} + */ + +/** + * @defgroup DMA_BtcIrq_Sel DMA block transfer completed interrupt selection + * @{ + */ +#define DMA_BTC_INT_CH0 (DMA_INTSTAT1_BTC_0) /*!< DMA block transfer completed interrupt CH.0 */ +#define DMA_BTC_INT_CH1 (DMA_INTSTAT1_BTC_1) /*!< DMA block transfer completed interrupt CH.1 */ +#define DMA_BTC_INT_CH2 (DMA_INTSTAT1_BTC_2) /*!< DMA block transfer completed interrupt CH.2 */ +#define DMA_BTC_INT_CH3 (DMA_INTSTAT1_BTC_3) /*!< DMA block transfer completed interrupt CH.3 */ +#define DMA_BTC_INT_CH4 (DMA_INTSTAT1_BTC_4) /*!< DMA block transfer completed interrupt CH.4 */ +#define DMA_BTC_INT_CH5 (DMA_INTSTAT1_BTC_5) /*!< DMA block transfer completed interrupt CH.5 */ +#define DMA_BTC_INT_CH6 (DMA_INTSTAT1_BTC_6) /*!< DMA block transfer completed interrupt CH.6 */ +#define DMA_BTC_INT_CH7 (DMA_INTSTAT1_BTC_7) /*!< DMA block transfer completed interrupt CH.7 */ +/** + * @} + */ + +/** + * @defgroup DMA_TcIrq_Sel DMA transfer completed interrupt selection + * @{ + */ +#define DMA_TC_INT_CH0 (DMA_INTSTAT1_TC_0) /*!< DMA transfer completed interrupt CH.0 */ +#define DMA_TC_INT_CH1 (DMA_INTSTAT1_TC_1) /*!< DMA transfer completed interrupt CH.1 */ +#define DMA_TC_INT_CH2 (DMA_INTSTAT1_TC_2) /*!< DMA transfer completed interrupt CH.2 */ +#define DMA_TC_INT_CH3 (DMA_INTSTAT1_TC_3) /*!< DMA transfer completed interrupt CH.3 */ +#define DMA_TC_INT_CH4 (DMA_INTSTAT1_TC_4) /*!< DMA transfer completed interrupt CH.4 */ +#define DMA_TC_INT_CH5 (DMA_INTSTAT1_TC_5) /*!< DMA transfer completed interrupt CH.5 */ +#define DMA_TC_INT_CH6 (DMA_INTSTAT1_TC_6) /*!< DMA transfer completed interrupt CH.6 */ +#define DMA_TC_INT_CH7 (DMA_INTSTAT1_TC_7) /*!< DMA transfer completed interrupt CH.7 */ +/** + * @} + */ + +/** + * @defgroup DMA_IntMsk_Sel DMA interrupt mask selection + * @{ + */ +#define DMA_ERR_INT_MASK (0x00FF00FFUL) /*!< DMA error interrupt mask */ +#define DMA_TRANS_INT_MASK (0x00FF00FFUL) /*!< DMA transfer interrupt mask */ +/** + * @} + */ + +/** + * @defgroup DMA_Req_Status_Sel DMA request status + * @{ + */ +#define DMA_REQ_CH0 (DMA_REQSTAT_CHREQ_0) /*!< DMA request from CH.0 */ +#define DMA_REQ_CH1 (DMA_REQSTAT_CHREQ_1) /*!< DMA request from CH.1 */ +#define DMA_REQ_CH2 (DMA_REQSTAT_CHREQ_2) /*!< DMA request from CH.2 */ +#define DMA_REQ_CH3 (DMA_REQSTAT_CHREQ_3) /*!< DMA request from CH.3 */ +#define DMA_REQ_CH4 (DMA_REQSTAT_CHREQ_4) /*!< DMA request from CH.4 */ +#define DMA_REQ_CH5 (DMA_REQSTAT_CHREQ_5) /*!< DMA request from CH.5 */ +#define DMA_REQ_CH6 (DMA_REQSTAT_CHREQ_6) /*!< DMA request from CH.6 */ +#define DMA_REQ_CH7 (DMA_REQSTAT_CHREQ_7) /*!< DMA request from CH.7 */ +#define DMA_REQ_RECONFIG (DMA_REQSTAT_RCFGREQ) /*!< DMA request from reconfig */ +#define DMA_REQ_STAT_MASK (0x000080FFUL) /*!< DMA request mask */ +/** + * @} + */ + +/** + * @defgroup DMA_Trans_Status_Sel DMA transfer status + * @{ + */ +#define DMA_TRANS_CH0 (DMA_CHSTAT_CHACT_0) /*!< DMA transfer status of CH.0 */ +#define DMA_TRANS_CH1 (DMA_CHSTAT_CHACT_1) /*!< DMA transfer status of CH.1 */ +#define DMA_TRANS_CH2 (DMA_CHSTAT_CHACT_2) /*!< DMA transfer status of CH.2 */ +#define DMA_TRANS_CH3 (DMA_CHSTAT_CHACT_3) /*!< DMA transfer status of CH.3 */ +#define DMA_TRANS_CH4 (DMA_CHSTAT_CHACT_4) /*!< DMA transfer status of CH.4 */ +#define DMA_TRANS_CH5 (DMA_CHSTAT_CHACT_5) /*!< DMA transfer status of CH.5 */ +#define DMA_TRANS_CH6 (DMA_CHSTAT_CHACT_6) /*!< DMA transfer status of CH.6 */ +#define DMA_TRANS_CH7 (DMA_CHSTAT_CHACT_7) /*!< DMA transfer status of CH.7 */ +#define DMA_TRANS_RECONFIG (DMA_CHSTAT_RCFGACT) /*!< DMA reconfig status */ +#define DMA_TRANS_DMA (DMA_CHSTAT_DMAACT) /*!< DMA transfer status of the DMA */ +#define DMA_TRANS_STAT_MASK (0x0000FF03UL) /*!< DMA request mask */ +/** + * @} + */ + +/** + * @defgroup DMA_DataWidth_Sel DMA transfer data width + * @{ + */ +#define DMA_DATAWIDTH_8BIT (0x00000000UL) /*!< DMA transfer data width 8bit */ +#define DMA_DATAWIDTH_16BIT (DMA_CHCTL_HSIZE_0) /*!< DMA transfer data width 16bit */ +#define DMA_DATAWIDTH_32BIT (DMA_CHCTL_HSIZE_1) /*!< DMA transfer data width 32bit */ +/** + * @} + */ + +/** + * @defgroup DMA_Llp_En DMA LLP(linked list pinter) enable or disable + * @{ + */ +#define DMA_LLP_ENABLE (DMA_CHCTL_LLPEN) /*!< DMA LLP(linked list pinter) enable */ +#define DMA_LLP_DISABLE (0x00000000UL) /*!< DMA LLP(linked list pinter) disable */ +/** + * @} + */ + +/** + * @defgroup DMA_Llp_Mode DMA linked list pinter mode while transferring complete + * @{ + */ +#define DMA_LLP_RUN (DMA_CHCTL_LLPRUN) /*!< DMA Llp run right now while transfering complete */ +#define DMA_LLP_WAIT (0x00000000UL) /*!< DMA Llp wait next request while transfering complete */ +/** + * @} + */ + +/** + * @defgroup DMA_SrcAddr_Incremented_Mode DMA source address increment mode + * @{ + */ +#define DMA_SRC_ADDR_FIX (0x00000000UL) /*!< DMA source address fix */ +#define DMA_SRC_ADDR_INC (DMA_CHCTL_SINC_0) /*!< DMA source address increment */ +#define DMA_SRC_ADDR_DEC (DMA_CHCTL_SINC_1) /*!< DMA source address decrement */ +/** + * @} + */ + +/** + * @defgroup DMA_DesAddr_Incremented_Mode DMA destination address increment mode + * @{ + */ +#define DMA_DEST_ADDR_FIX (0x00000000UL) /*!< DMA destination address fix */ +#define DMA_DEST_ADDR_INC (DMA_CHCTL_DINC_0) /*!< DMA destination address increment */ +#define DMA_DEST_ADDR_DEC (DMA_CHCTL_DINC_1) /*!< DMA destination address decrement */ +/** + * @} + */ + +/** + * @defgroup DMA_Int_Config DMA interrupt function config + * @{ + */ +#define DMA_INT_ENABLE (DMA_CHCTL_IE) /*!< DMA interrupt enable */ +#define DMA_INT_DISABLE (0x00000000UL) /*!< DMA interrupt disable */ +/** + * @} + */ + +/** + * @defgroup DMA_Repeat_Config DMA repeat mode function config + * @{ + */ +#define DMA_SRC_RPT_ENABLE (DMA_CHCTL_SRTPEN) /*!< DMA source repeat enable */ +#define DMA_SRC_RPT_DISABLE (0x00000000UL) /*!< DMA source repeat disable */ +#define DMA_DEST_RPT_ENABLE (DMA_CHCTL_DRPTEN) /*!< DMA destination repeat enable */ +#define DMA_DEST_RPT_DISABLE (0x00000000UL) /*!< DMA destination repeat disable */ +/** + * @} + */ + +/** + * @defgroup DMA_NonSeq_Config DMA non-sequence mode function config + * @{ + */ +#define DMA_SRC_NS_ENABLE (DMA_CHCTL_SNSEQEN) /*!< DMA source non-sequence enable */ +#define DMA_SRC_NS_DISABLE (0x00000000UL) /*!< DMA source non-sequence disable */ +#define DMA_DEST_NS_ENABLE (DMA_CHCTL_DNSEQEN) /*!< DMA destination non-sequence enable */ +#define DMA_DEST_NS_DISABLE (0x00000000UL) /*!< DMA destination non-sequence disable */ +/** + * @} + */ + +/** + * @defgroup DMA_ReConfig_Cnt_Sel DMA reconfig count mode selection + * @{ + */ +#define DMA_RC_CNT_FIX (0x00UL) /*!< Keep the original counting method */ +#define DMA_RC_CNT_SRC (DMA_RCFGCTL_CNTMD_0) /*!< Use source address counting method */ +#define DMA_RC_CNT_DEST (DMA_RCFGCTL_CNTMD_1) /*!< Use destination address counting method */ +/** + * @} + */ + +/** + * @defgroup DMA_ReConfig_DestAddr_Sel DMA reconfig destination address mode selection + * @{ + */ +#define DMA_RC_DA_FIX (0x00000000UL) /*!< Destination address fixed */ +#define DMA_RC_DA_NS (DMA_RCFGCTL_DARMD_0) /*!< Destination address non-sequence */ +#define DMA_RC_DA_RPT (DMA_RCFGCTL_DARMD_1) /*!< Destination address repeat */ +/** + * @} + */ + +/** + * @defgroup DMA_ReConfig_SrcAddr_Sel DMA reconfig source address mode selection + * @{ + */ +#define DMA_RC_SA_FIX (0x00000000UL) /*!< Source address fixed */ +#define DMA_RC_SA_NS (DMA_RCFGCTL_SARMD_0) /*!< Source address non-sequence */ +#define DMA_RC_SA_RPT (DMA_RCFGCTL_SARMD_1) /*!< Source address repeat */ +/** + * @} + */ + +/** + * @defgroup DMA_Common_Trigger_Source_Config DMA common Trigger Source Config + * @{ + */ +#define DMA_COM_TRIG1 (AOS_DMA_1_TRGSEL_COMTRG_EN_0) +#define DMA_COM_TRIG2 (AOS_DMA_1_TRGSEL_COMTRG_EN_1) +#define DMA_COM_TRIG_MASK (AOS_DMA_1_TRGSEL_COMTRG_EN) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup DMA_Global_Functions + * @{ + */ +void DMA_Cmd(M4_DMA_TypeDef *DMAx, en_functional_state_t enNewState); + +void DMA_ErrIntCmd(M4_DMA_TypeDef *DMAx, uint32_t u32ErrInt, en_functional_state_t enNewState); +en_flag_status_t DMA_GetErrIntStatus(const M4_DMA_TypeDef *DMAx, uint32_t u32ErrInt); +void DMA_ClearErrIntStatus(M4_DMA_TypeDef *DMAx, uint32_t u32ErrInt); + +void DMA_TransIntCmd(M4_DMA_TypeDef *DMAx, uint32_t u32TransInt, en_functional_state_t enNewState); +en_flag_status_t DMA_GetTransIntStatus(const M4_DMA_TypeDef *DMAx, uint32_t u32TransInt); +void DMA_ClearTransIntStatus(M4_DMA_TypeDef *DMAx, uint32_t u32TransInt); + +void DMA_MxChannelCmd(M4_DMA_TypeDef *DMAx, uint8_t u8MxCh, en_functional_state_t enNewState); +void DMA_ChannelCmd(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, en_functional_state_t enNewState); + +void DMA_SetReConfigTriggerSrc(en_event_src_t enSrc); +void DMA_RCComTriggerCmd(uint32_t u32ComTrig, en_functional_state_t enNewState); +void DMA_SetTriggerSrc(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch, en_event_src_t enSrc); +void DMA_ComTriggerCmd(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint32_t u32ComTrig, en_functional_state_t enNewState); + +en_flag_status_t DMA_GetReqStatus(const M4_DMA_TypeDef *DMAx, uint32_t u32Status); +en_flag_status_t DMA_GetTransStatus(const M4_DMA_TypeDef *DMAx, uint32_t u32Status); + +void DMA_SetSrcAddr(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint32_t u32Addr); +void DMA_SetDestAddr(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint32_t u32Addr); +void DMA_SetTransCnt(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint16_t u16Cnt); +void DMA_SetBlockSize(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint16_t u16Size); + +void DMA_SetSrcRptSize(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint16_t u16Size); +void DMA_SetDestRptSize(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint16_t u16Size); +void DMA_SetNonSeqSrcCnt(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint32_t u32Cnt); +void DMA_SetNonSeqDestCnt(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint32_t u32Cnt); +void DMA_SetNonSeqSrcOffset(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint32_t u32Ofs); +void DMA_SetNonSeqDestOffset(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint32_t u32Ofs); + +void DMA_SetLlpAddr(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint32_t u32LlpAddr); + +en_result_t DMA_Init(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, const stc_dma_init_t *pstcDmaInit); +en_result_t DMA_RepeatInit(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, const stc_dma_rpt_init_t *pstcDmaRptInit); +en_result_t DMA_NonSeqInit(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, const stc_dma_nonseq_init_t *pstcDmaNonSeqInit); +en_result_t DMA_LlpInit(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, const stc_dma_llp_init_t *pstcDmaLlpInit); +en_result_t DMA_ReConfigInit(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, const stc_dma_reconfig_init_t *pstcDmaRCInit); + +en_result_t DMA_StructInit(stc_dma_init_t *pstcDmaInit); +en_result_t DMA_RepeatStructInit(stc_dma_rpt_init_t *pstcDmaRptInit); +en_result_t DMA_NonSeqStructInit(stc_dma_nonseq_init_t *pstcDmaNonSeqInit); +en_result_t DMA_LlpStructInit(stc_dma_llp_init_t *pstcDmaLlpInit); +en_result_t DMA_ReConfigStructInit(stc_dma_reconfig_init_t *pstcDmaRCInit); + + +void DMA_LlpCmd(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, en_functional_state_t enNewState); +void DMA_ReConfigCmd(M4_DMA_TypeDef *DMAx, en_functional_state_t enNewState); +void DMA_ReConfigLlpCmd(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, en_functional_state_t enNewState); + +uint32_t DMA_GetSrcAddr(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch); +uint32_t DMA_GetDestAddr(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch); +uint32_t DMA_GetTransCnt(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch); +uint32_t DMA_GetBlockSize(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch); +uint32_t DMA_GetSrcRptSize(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch); +uint32_t DMA_GetDestRptSize(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch); +uint32_t DMA_GetNonSeqSrcCnt(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch); +uint32_t DMA_GetNonSeqDestCnt(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch); +uint32_t DMA_GetNonSeqSrcOffset(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch); +uint32_t DMA_GetNonSeqDestOffset(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch); +/** + * @} + */ + +#endif /* DDL_DMA_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_DMA_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_dmc.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_dmc.h new file mode 100644 index 0000000000..46dbf8b38c --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_dmc.h @@ -0,0 +1,439 @@ +/** + ******************************************************************************* + * @file hc32f4a0_dmc.h + * @brief This file contains all the functions prototypes of the EXMC DMC + * (External Memory Controller: Dynamic Memory Controller) driver library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Hongjh First version + 2020-07-14 Hongjh Merge API from EXMC_DMC_Enable/Disable to EXMC_DMC_Cmd + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_DMC_H__ +#define __HC32F4A0_DMC_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_EXMC_DMC + * @{ + */ + +#if (DDL_DMC_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup EXMC_DMC_Global_Types Dynamic Memory Controller Global Types + * @{ + */ + +/** + * @brief EXMC DMC CS Configuration Structure definition + */ +typedef struct +{ + uint32_t u32AddrMask; /*!< Defines the address mask. + This parameter can be a value of @ref EXMC_DMC_Mask_Address. */ + + uint32_t u32AddrMatch; /*!< Defines the address match. + This parameter can be a value of @ref EXMC_DMC_Match_Address. */ + + uint32_t u32AddrDecodeMode; /*!< Defines the address decode mode. + This parameter can be a value of @ref EXMC_DMC_CS_Decode_Mode. */ +} stc_exmc_dmc_cs_cfg_t; + +/** + * @brief EXMC DMC Chip Configuration Structure definition + */ +typedef struct +{ + + uint32_t u32ColumnBitsNumber; /*!< Defines the number of bits of column address. + This parameter can be a value of @ref EXMC_DMC_Column_Bits_Number. */ + + uint32_t u32RowBitsNumber; /*!< Defines the number of bits of row address. + This parameter can be a value of @ref EXMC_DMC_Row_Bits_Number. */ + + uint32_t u32AutoPrechargePin; /*!< Defines the auto-precharge pin. + This parameter can be a value of @ref EXMC_DMC_Auto_Precharge_Pin. */ + + uint32_t u32MemClkSel; /*!< Defines the memory clock selection. + This parameter can be a value of @ref EXMC_DMC_MemClock_Selection */ + + uint32_t u32CkeOutputSel; /*!< Defines the CKE output selection. + This parameter can be a value of @ref EXMC_DMC_CKE_Output_Selection */ + + uint32_t u32CkeDisablePeriod; /*!< Defines the CKE disable period. + This parameter can be a value between Min_Data = 0 and Max_Data = 0x3F */ + + uint32_t u32MemBurst; /*!< Defines the number of data accesses. + This parameter can be a value of @ref EXMC_DMC_Memory_Burst. */ + + uint32_t u32AutoRefreshChips; /*!< Defines the refresh command generation for the number of memory chips. + This parameter can be a value of @ref EXMC_DMC_Auto_Refresh_Chips. */ +}stc_exmc_dmc_chip_cfg_t; + +/** + * @brief EXMC DMC Timing Configuration Structure definition + */ +typedef struct +{ + uint32_t u32CASL; /*!< Defines the CAS latency in memory clock cycles. + This parameter can be a value between Min_Data = 0 and Max_Data = 7 */ + uint32_t u32DQSS; /*!< Defines the DQSS in memory clock cycles. + This parameter can be a value between Min_Data = 0 and Max_Data = 3 */ + uint32_t u32MRD; /*!< Defines the the mode register command time in memory clock cycles. + This parameter can be a value between Min_Data = 0 and Max_Data = 0x7F */ + uint32_t u32RAS; /*!< Defines the RAS in memory clock cycles. + This parameter can be a value between Min_Data = 0 and Max_Data = 0x0F */ + uint32_t u32RC; /*!< Defines the RC in memory clock cycles. + This parameter can be a value between Min_Data = 0 and Max_Data = 0x0F */ + uint32_t u32RCD; /*!< Defines the RCD in memory clock cycles. + This parameter can be a value between Min_Data = 0 and Max_Data = 7 */ + uint32_t u32RFC; /*!< Defines the RFC in memory clock cycles. + This parameter can be a value between Min_Data = 0 and Max_Data = 0x1F */ + uint32_t u32RP; /*!< Defines the RP in memory clock cycles. + This parameter can be a value between Min_Data = 0 and Max_Data = 7 */ + uint32_t u32RRD; /*!< Defines the RRD in memory clock cycles. + This parameter can be a value between Min_Data = 0 and Max_Data = 0x0F */ + uint32_t u32WR; /*!< Defines the WR in memory clock cycles. + This parameter can be a value between Min_Data = 0 and Max_Data = 7 */ + uint32_t u32WTR; /*!< Defines the WTR in memory clock cycles. + This parameter can be a value between Min_Data = 0 and Max_Data = 7 */ + uint32_t u32XP; /*!< Defines the XP in memory clock cycles. + This parameter can be a value between Min_Data = 0 and Max_Data = 0xFF */ + uint32_t u32XSR; /*!< Defines the XSR in memory clock cycles. + This parameter can be a value between Min_Data = 0 and Max_Data = 0xFF */ + uint32_t u32ESR; /*!< Defines the ESR in memory clock cycles. + This parameter can be a value between Min_Data = 0 and Max_Data = 0xFF */ +} stc_exmc_dmc_timing_cfg_t; + +/** + * @brief EXMC DMC Initialization Structure definition + */ +typedef struct +{ + uint32_t u32DmcMemWidth; /*!< DMC memory width. + This parameter can be a value of @ref EXMC_DMC_Memory_Width. */ + + uint32_t u32RefreshPeriod; /*!< DMC memory refresh period. + This parameter can be a value between Min_Data = 0 and Max_Data = 0x7FFF */ + + stc_exmc_dmc_chip_cfg_t stcChipCfg; /*!< DMC memory chip configure. + This structure details refer @ref stc_exmc_dmc_chip_cfg_t. */ + + stc_exmc_dmc_timing_cfg_t stcTimingCfg; /*!< DMC memory timing configure. + This structure details refer @ref stc_exmc_dmc_timing_cfg_t. */ +} stc_exmc_dmc_init_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup EXMC_DMC_Global_Macros Dynamic Memory Controller Global Macros + * @{ + */ + +/** + * @defgroup EXMC_DMC_Memory_Width EXMC DMC Memory Width + * @{ + */ +#define EXMC_DMC_MEMORY_WIDTH_16BIT (0UL) +#define EXMC_DMC_MEMORY_WIDTH_32BIT (DMC_BACR_DMCMW_0) +/** + * @} + */ + +/** + * @defgroup EXMC_DMC_Chip EXMC DMC Chip + * @{ + */ +#define EXMC_DMC_CHIP_0 (0UL) /*!< Chip 0 */ +#define EXMC_DMC_CHIP_1 (1UL) /*!< Chip 1 */ +#define EXMC_DMC_CHIP_2 (2UL) /*!< Chip 2 */ +#define EXMC_DMC_CHIP_3 (3UL) /*!< Chip 3 */ +/** + * @} + */ + +/** + * @defgroup EXMC_DMC_Bank EXMC DMC Bank + * @{ + */ +#define EXMC_DMC_BANK_0 (0UL) /*!< Bank 0 */ +#define EXMC_DMC_BANK_1 (1UL) /*!< Bank 1 */ +#define EXMC_DMC_BANK_2 (2UL) /*!< Bank 2 */ +#define EXMC_DMC_BANK_3 (3UL) /*!< Bank 3 */ +/** + * @} + */ + +/** + * @defgroup EXMC_DMC_Current_Status EXMC DMC Current Status + * @{ + */ +#define EXMC_DMC_CURR_STATUS_CONFIGURE (0UL) +#define EXMC_DMC_CURR_STATUS_READY (DMC_STSR_STATUS_0) +#define EXMC_DMC_CURR_STATUS_PAUSED (DMC_STSR_STATUS_1) +#define EXMC_DMC_CURR_STATUS_LOWPOWER (DMC_STSR_STATUS) +/** + * @} + */ + +/** + * @defgroup EXMC_DMC_Control_State EXMC DMC Control State + * @{ + */ +#define EXMC_DMC_CTL_STATE_GO (0UL) +#define EXMC_DMC_CTL_STATE_SLEEP (1UL) +#define EXMC_DMC_CTL_STATE_WAKEUP (2UL) +#define EXMC_DMC_CTL_STATE_PAUSE (3UL) +#define EXMC_DMC_CTL_STATE_CONFIGURE (4UL) +/** + * @} + */ + +/** + * @defgroup EXMC_DMC_Command EXMC DMC Command + * @{ + */ +#define EXMC_DMC_CMD_PRECHARGEALL (0UL) /*!< Precharge all */ +#define EXMC_DMC_CMD_AUTOREFRESH (DMC_CMDR_CMD_0) /*!< Auto refresh */ +#define EXMC_DMC_CMD_MDREGCONFIG (DMC_CMDR_CMD_1) /*!< Set memory device mode register */ +#define EXMC_DMC_CMD_NOP (DMC_CMDR_CMD) /*!< NOP */ +/** + * @} + */ + +/** + * @defgroup EXMC_DMC_Refresh_Period_Max EXMC DMC Refresh Period Max + * @{ + */ +#define EXMC_DMC_REFRESH_PERIOD_MAX (0x00007FFFUL) +/** + * @} + */ + +/** + * @defgroup EXMC_DMC_CS_Decode_Mode EXMC DMC CS Decode Mode + * @{ + */ +#define EXMC_DMC_CS_DECODE_ROWBANKCOL (0UL) /*!< Row -> Bank -> Column */ +#define EXMC_DMC_CS_DECODE_BANKROWCOL (DMC_CSCR_BRC) /*!< Bank -> Row -> Column */ +/** + * @} + */ + +/** + * @defgroup EXMC_DMC_Column_Bits_Number EXMC DMC Column Bits Number + * @{ + */ +#define EXMC_DMC_COLUMN_BITS_NUM_8 (0UL) +#define EXMC_DMC_COLUMN_BITS_NUM_9 (DMC_CPCR_COLBS_0) +#define EXMC_DMC_COLUMN_BITS_NUM_10 (DMC_CPCR_COLBS_1) +#define EXMC_DMC_COLUMN_BITS_NUM_11 (DMC_CPCR_COLBS_1 | \ + DMC_CPCR_COLBS_0) +#define EXMC_DMC_COLUMN_BITS_NUM_12 (DMC_CPCR_COLBS_2) +/** + * @} + */ + +/** + * @defgroup EXMC_DMC_Row_Bits_Number EXMC DMC Row Bits Number + * @{ + */ +#define EXMC_DMC_ROW_BITS_NUM_11 (0UL) +#define EXMC_DMC_ROW_BITS_NUM_12 (DMC_CPCR_ROWBS_0) +#define EXMC_DMC_ROW_BITS_NUM_13 (DMC_CPCR_ROWBS_1) +#define EXMC_DMC_ROW_BITS_NUM_14 (DMC_CPCR_ROWBS_1 | \ + DMC_CPCR_ROWBS_0) +#define EXMC_DMC_ROW_BITS_NUM_15 (DMC_CPCR_ROWBS_2) +#define EXMC_DMC_ROW_BITS_NUM_16 (DMC_CPCR_ROWBS_2 | \ + DMC_CPCR_ROWBS_0) +/** + * @} + */ + +/** + * @defgroup EXMC_DMC_Auto_Precharge_Pin EXMC DMC Auto Pre-charge Pin + * @{ + */ +#define EXMC_DMC_AUTO_PRECHARGE_A8 (DMC_CPCR_APBS) +#define EXMC_DMC_AUTO_PRECHARGE_A10 (0UL) +/** + * @} + */ + +/** + * @defgroup EXMC_DMC_CKE_Output_Selection EXMC DMC CKE Output Selection + * @{ + */ +#define EXMC_DMC_CKE_OUTPUT_ENABLE (0UL) +#define EXMC_DMC_CKE_OUTPUT_DISABLE (DMC_CPCR_CKEDIS) +/** + * @} + */ + +/** + * @defgroup EXMC_DMC_MemClock_Selection EXMC DMC MemClock Selection + * @{ + */ +#define EXMC_DMC_MEMCLK_NORMAL_OUTPUT (0UL) +#define EXMC_DMC_MEMCLK_NOP_STOP_OUTPUT (DMC_CPCR_CKSTOP) +/** + * @} + */ + +/** + * @defgroup EXMC_DMC_Memory_Burst EXMC DMC Memory Burst + * @{ + */ +#define EXMC_DMC_MEM_BURST_1 (0UL) +#define EXMC_DMC_MEM_BURST_2 (DMC_CPCR_BURST_0) +#define EXMC_DMC_MEM_BURST_4 (DMC_CPCR_BURST_1) +#define EXMC_DMC_MEM_BURST_8 (DMC_CPCR_BURST_1 | \ + DMC_CPCR_BURST_0) +#define EXMC_DMC_MEM_BURST_16 (DMC_CPCR_BURST_2) +/** + * @} + */ + +/** + * @defgroup EXMC_DMC_Auto_Refresh_Chips EXMC DMC Auto Refresh + * @{ + */ +#define EXMC_DMC_AUTO_REFRESH_CHIP_0 (0UL) +#define EXMC_DMC_AUTO_REFRESH_CHIPS_01 (DMC_CPCR_ACTCP_0) +#define EXMC_DMC_AUTO_REFRESH_CHIPS_012 (DMC_CPCR_ACTCP_1) +#define EXMC_DMC_AUTO_REFRESH_CHIPS_0123 (DMC_CPCR_ACTCP) +/** + * @} + */ + +/** + * @defgroup EXMC_DMC_Match_Address EXMC DMC Match Address + * @{ + */ +#define EXMC_DMC_ADDR_MATCH_0X80000000 (0x80UL << DMC_CSCR_ADDMAT_POS) +#define EXMC_DMC_ADDR_MATCH_0X81000000 (0x81UL << DMC_CSCR_ADDMAT_POS) +#define EXMC_DMC_ADDR_MATCH_0X82000000 (0x82UL << DMC_CSCR_ADDMAT_POS) +#define EXMC_DMC_ADDR_MATCH_0X83000000 (0x83UL << DMC_CSCR_ADDMAT_POS) +#define EXMC_DMC_ADDR_MATCH_0X84000000 (0x84UL << DMC_CSCR_ADDMAT_POS) +#define EXMC_DMC_ADDR_MATCH_0X85000000 (0x85UL << DMC_CSCR_ADDMAT_POS) +#define EXMC_DMC_ADDR_MATCH_0X86000000 (0x86UL << DMC_CSCR_ADDMAT_POS) +#define EXMC_DMC_ADDR_MATCH_0X87000000 (0x87UL << DMC_CSCR_ADDMAT_POS) +/** + * @} + */ + +/** + * @defgroup EXMC_DMC_Mask_Address EXMC DMC Mask Address + * @{ + */ +#define EXMC_DMC_ADDR_MASK_16MB (0xFFUL) +#define EXMC_DMC_ADDR_MASK_32MB (0xFEUL) +#define EXMC_DMC_ADDR_MASK_64MB (0xFCUL) +#define EXMC_DMC_ADDR_MASK_128MB (0xF8UL) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup EXMC_DMC_Global_Functions + * @{ + */ + +/** + * @brief Get DMC status. + * @param None + * @retval Returned value can be one of the following values: + * @arg EXMC_DMC_CURR_STATUS_CONFIGURE: Configure status + * @arg EXMC_DMC_CURR_STATUS_READY: Ready status + * @arg EXMC_DMC_CURR_STATUS_PAUSED: Pause status + * @arg EXMC_DMC_CURR_STATUS_LOWPOWER: Sleep for low power status + */ +__STATIC_INLINE uint32_t EXMC_DMC_GetStatus(void) +{ + return READ_REG32_BIT(M4_DMC->STSR, DMC_STSR_STATUS); +} + +/* Initialization and configuration EXMC DMC functions */ +en_result_t EXMC_DMC_Init(const stc_exmc_dmc_init_t *pstcInit); +void EXMC_DMC_DeInit(void); +en_result_t EXMC_DMC_StructInit(stc_exmc_dmc_init_t *pstcInit); +void EXMC_DMC_Cmd(en_functional_state_t enNewState); +en_result_t EXMC_DMC_CsConfig(uint32_t u32Chip, + const stc_exmc_dmc_cs_cfg_t *pstcCfg); +uint32_t EXMC_DMC_ChipStartAddress(uint32_t u32Chip); +uint32_t EXMC_DMC_ChipEndAddress(uint32_t u32Chip); +en_result_t EXMC_DMC_SetCommand(uint32_t u32Chip, + uint32_t u32Bank, + uint32_t u32Cmd, + uint32_t u32Address); +void EXMC_DMC_SetState(uint32_t u32State); + +/** + * @} + */ + +#endif /* DDL_DMC_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_DMC_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_dvp.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_dvp.h new file mode 100644 index 0000000000..572807f349 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_dvp.h @@ -0,0 +1,293 @@ +/** + ******************************************************************************* + * @file hc32f4a0_dvp.h + * @brief This file contains all the functions prototypes of the DVP(Digital + * Video Processor) driver library. + @verbatim + Change Logs: + Date Author Notes + 2020-08-20 Hongjh First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_DVP_H__ +#define __HC32F4A0_DVP_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_DVP + * @{ + */ + +#if (DDL_DVP_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup DVP_Global_Types DVP Global Types + * @{ + */ + +/** + * @brief DVP Initialization Structure definition + */ +typedef struct +{ + uint32_t u32SyncMode; /*!< The DVP sync mode. + This parameter can be a value of @ref DVP_Sync_Mode. */ + uint32_t u32DataWidth; /*!< The DVP data interface width. + This parameter can be a value of @ref DVP_Data_Width. */ + uint32_t u32CaptureMode; /*!< The DVP capture mode. + This parameter can be a value of @ref DVP_Capture_Mode. */ + uint32_t u32CaptureFreq; /*!< The DVP capture frequence. + This parameter can be a value of @ref DVP_Capture_Frequence. */ + uint32_t u32PIXCLKPolarity; /*!< The DVP_PIXCLK Polarity. + This parameter can be a value of @ref DVP_PIXCLK_Polarity. */ + uint32_t u32HSYNCPolarity; /*!< The DVP_HSYNC Polarity. + This parameter can be a value of @ref DVP_HSYNC_Polarity. */ + uint32_t u32VSYNCPolarity; /*!< The DVP_VSYNC Polarity. + This parameter can be a value of @ref DVP_VSYNC_Polarity. */ +} stc_dvp_init_t; + +/** + * @brief DVP Crop Window Configure definition + */ +typedef struct +{ + uint32_t u32X; /*!< The DVP window X offset + This parameter can be a value between 0x00 and 0x3FFF */ + uint32_t u32Y; /*!< The DVP window Y offset + This parameter can be a value between 0x00 and 0x3FFF */ + uint32_t u32XSize; /*!< The DVP window pixel per line + This parameter can be a value between 0x00 and 0x3FFF */ + uint32_t u32YSize; /*!< The DVP window line number. + This parameter can be a value between 0x00 and 0x3FFF */ +} stc_dvp_crop_window_config_t; + +/** + * @brief DVP Software Sync Code definition + */ +typedef struct +{ + uint32_t u32FrameStartSyncCode; /*!< The sync code of the frame start delimiter. + This parameter can be a value between 0x00 and 0xFF */ + uint32_t u32LineStartSyncCode; /*!< The sync code of the line start delimiter. + This parameter can be a value between 0x00 and 0xFF */ + uint32_t u32LineEndSyncCode; /*!< The sync code of the line end delimiter. + This parameter can be a value between 0x00 and 0xFF */ + uint32_t u32FrameEndSyncCode; /*!< The sync code of the frame end delimiter. + This parameter can be a value between 0x00 and 0xFF */ +} stc_dvp_sw_sync_code_t; + +/** + * @brief DVP Software Mask Code definition + */ +typedef struct +{ + uint32_t u32FrameStartMaskCode; /*!< The mask code of the frame start delimiter. + This parameter can be a value between between 0x00 and 0xFF */ + uint32_t u32LineStartMaskCode; /*!< The mask code of the line start delimiter. + This parameter can be a value between between 0x00 and 0xFF */ + uint32_t u32LineEndMaskCode; /*!< The mask code of the line end delimiter. + This parameter can be a value between between 0x00 and 0xFF */ + uint32_t u32FrameEndMaskCode; /*!< The mask code of the frame end delimiter. + This parameter can be a value between between 0x00 and 0xFF */ +} stc_dvp_sw_mask_code_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup DVP_Global_Macros DVP Global Macros + * @{ + */ + +/** @defgroup DVP_Capture_Mode DVP Capture Mode + * @{ + */ +#define DVP_CAPT_MD_CONTINUOS_FRAME (0UL) +#define DVP_CAPT_MD_SINGLE_FRAME (DVP_CTR_CAPMD) +/** + * @} + */ + +/** @defgroup DVP_Sync_Mode DVP Sync Mode + * @{ + */ +#define DVP_SYNC_MD_HW (0UL) /*!< Hardware sync */ +#define DVP_SYNC_MD_SW (DVP_CTR_SWSYNC) /*!< Software sync */ +/** + * @} + */ + +/** @defgroup DVP_PIXCLK_Polarity DVP PIXCLK Polarity + * @{ + */ +#define DVP_PIXCLK_FALLING (0UL) /*!< DVP_PIXCLK active on Falling edge */ +#define DVP_PIXCLK_RISING (DVP_CTR_PIXCKSEL) /*!< DVP_PIXCLK active on Rising edge */ +/** + * @} + */ + +/** @defgroup DVP_HSYNC_Polarity DVP HSYNC Polarity + * @{ + */ +#define DVP_HSYNC_LOW (0UL) /*!< DVP_HSYNC active Low */ +#define DVP_HSYNC_HIGH (DVP_CTR_HSYNCSEL) /*!< DVP_HSYNC active High */ +/** + * @} + */ + +/** @defgroup DVP_VSYNC_Polarity DVP VSYNC Polarity + * @{ + */ +#define DVP_VSYNC_LOW (0UL) /*!< DVP_VSYNC active Low */ +#define DVP_VSYNC_HIGH (DVP_CTR_VSYNCSEL) /*!< DVP_VSYNC active High */ +/** + * @} + */ + +/** + * @defgroup DVP_Capture_Frequence DVP Capture Frequence + * @{ + */ +#define DVP_CAPT_FREQ_ALL_FRAME (0UL) /*!< All frames are captured */ +#define DVP_CAPT_FREQ_ONT_TIME_2FRAME (DVP_CTR_CAPFRC_0) /*!< One frame per 2 frames captured */ +#define DVP_CAPT_FREQ_ONT_TIME_4FRAME (DVP_CTR_CAPFRC_1) /*!< One frame per 4 frames captured */ +/** + * @} + */ + +/** + * @defgroup DVP_Data_Width DVP Data Width + * @{ + */ +#define DVP_DATA_WIDTH_8BIT (0UL) /*!< DVP captures 8-bit data on every DVP_PIXCLK clock */ +#define DVP_DATA_WIDTH_10BIT (DVP_CTR_BITSEL_0) /*!< DVP captures 10-bit data on every DVP_PIXCLK clock */ +#define DVP_DATA_WIDTH_12BIT (DVP_CTR_BITSEL_1) /*!< DVP captures 12-bit data on every DVP_PIXCLK clock */ +#define DVP_DATA_WIDTH_14BIT (DVP_CTR_BITSEL) /*!< DVP captures 14-bit data on every DVP_PIXCLK clock */ +/** + * @} + */ + +/** + * @defgroup DVP_Flag DVP Flag + * @{ + */ +#define DVP_FLAG_FRAME_START (DVP_STR_FSF) /*!< Frame start flag */ +#define DVP_FLAG_LINE_START (DVP_STR_LSF) /*!< Line start flag */ +#define DVP_FLAG_LINE_END (DVP_STR_LEF) /*!< Line end flag */ +#define DVP_FLAG_FRAME_END (DVP_STR_FEF) /*!< Frame end flag */ +#define DVP_FLAG_FIFO_OVF (DVP_STR_FIFOERF) /*!< FIFO overflow error flag */ +#define DVP_FLAG_SYNC_ERR (DVP_STR_SQUERF) /*!< Sync error flag */ +#define DVP_FLAG_ALL (DVP_FLAG_SYNC_ERR | \ + DVP_FLAG_FIFO_OVF | \ + DVP_FLAG_LINE_END | \ + DVP_FLAG_LINE_START | \ + DVP_FLAG_FRAME_END | \ + DVP_FLAG_FRAME_START) +/** + * @} + */ + +/** + * @defgroup DVP_Interrupt DVP Interrupt + * @{ + */ +#define DVP_INT_FRAME_START (DVP_IER_FSIEN) /*!< Frame start interrupt */ +#define DVP_INT_LINE_START (DVP_IER_LSIEN) /*!< Line start interrupt */ +#define DVP_INT_LINE_END (DVP_IER_LEIEN) /*!< Line end interrupt */ +#define DVP_INT_FRAME_END (DVP_IER_FEIEN) /*!< Frame end interrupt */ +#define DVP_INT_FIFO_OVF (DVP_IER_FIFOERIEN) /*!< FIFO overflow error interrupt */ +#define DVP_INT_SYNC_ERR (DVP_IER_SQUERIEN) /*!< Sync error interrupt */ +#define DVP_INT_ALL (DVP_INT_SYNC_ERR | \ + DVP_INT_FIFO_OVF | \ + DVP_INT_LINE_END | \ + DVP_INT_LINE_START | \ + DVP_INT_FRAME_END | \ + DVP_INT_FRAME_START) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup DVP_Global_Functions + * @{ + */ +en_result_t DVP_Init(const stc_dvp_init_t *pstcDvpInit); +void DVP_DeInit(void); +en_result_t DVP_StructInit(stc_dvp_init_t *pstcDvpInit); +void DVP_Cmd(en_functional_state_t enNewState); +void DVP_IntCmd(uint32_t u32IntType, en_functional_state_t enNewState); +void DVP_CropCmd(en_functional_state_t enNewState); +void DVP_JPEGCmd(en_functional_state_t enNewState); +void DVP_CaptrueCmd(en_functional_state_t enNewState); +en_functional_state_t DVP_GetCaptrueCmdState(void); +en_flag_status_t DVP_GetStatus(uint32_t u32Flag); +void DVP_ClearStatus(uint32_t u32Flag); +en_result_t DVP_SetSWSyncCode(const stc_dvp_sw_sync_code_t *pstcSyncCode); +en_result_t DVP_SetSWMaskCode(const stc_dvp_sw_mask_code_t *pstcMaskCode); +en_result_t DVP_CropWindowConfig(const stc_dvp_crop_window_config_t *pstcConfig); +/** + * @} + */ + +#endif /* DDL_DVP_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_DVP_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_efm.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_efm.h new file mode 100644 index 0000000000..8d8b9dbc03 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_efm.h @@ -0,0 +1,1158 @@ +/** + ******************************************************************************* + * @file hc32f4a0_efm.h + * @brief This file contains all the functions prototypes of the EFM driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Heqb First version + 2020-07-03 Heqb Add flag judgment when operate SWAP + 2020-07-07 Heqb Modify the return value type of the function + EFM_SetOperateMode from void to en_result_t + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_EFM_H__ +#define __HC32F4A0_EFM_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_EFM + * @{ + */ + +#if (DDL_EFM_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup EFM_Global_Types EFM Global Types + * @{ + */ + +/** + * @brief EFM configure structure + */ +typedef struct +{ + uint32_t u32WaitCycle; /*!< Specifies the efm read wait cycles. + This parameter can be a value of @ref EFM_Wait_Cycle. */ + + uint32_t u32CacheRst; /*!< Specifies the data cache reset on or off. + This parameter can be a value of @ref EFM_CacheRst_Func. */ + + uint32_t u32Prefetch; /*!< Specifies the prefetch on or off. + This parameter can be a value of @ref EFM_Prefetch_Func. */ + + uint32_t u32InsCache; /*!< Specifies the instruction cache on or off. + This parameter can be a value of @ref EFM_INSCache_Func. */ + + uint32_t u32DataCache; /*!< Specifies the data cache on or off. + This parameter can be a value of @ref EFM_DCache_Func. */ + + uint32_t u32LowVolRead; /*!< Specifies the read of low-voltage mode on or off. + This parameter can be a value of @ref EFM_LowVolRead_Mode. */ + + uint32_t u32BusStatus; /*!< Specifies the bus status busy or release while program & erase. + This parameter can be a value of @ref EFM_Bus_Status. */ + + uint32_t u32OperateMode; /*!< Specifies the operate mode. + This parameter can be a value of @ref EFM_OperateMode_Definition. */ + + uint32_t u32FlashStatus; /*!< Specifies the Flash status. + This parameter can be a value of @ref EFM_Status. */ +} stc_efm_cfg_t; + +/** + * @brief EFM unique ID definition + */ +typedef struct +{ + uint32_t u32UniqueID0; /*!< unique ID 0. */ + uint32_t u32UniqueID1; /*!< unique ID 1. */ + uint32_t u32UniqueID2; /*!< unique ID 2. */ +} stc_efm_unique_id_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup EFM_Global_Macros EFM Global Macros + * @{ + */ +#define EFM_SWAP_ADDR (0x03002000UL) +#define EFM_SWAP_DATA (0x005A5A5AUL) +/** + * @defgroup EFM_Address EFM address area + * @{ + */ +#define EFM_START_ADDR (0x00000000UL) /*!< Flash start address */ +#define EFM_END_ADDR (0x001FFFFFUL) /*!< Flash end address */ +/** + * @} + */ + +/** + * @defgroup EFM_Sector_Address EFM Sector Address + * @{ + */ +#define EFM_ADDR_SECTOR0 (0x00000000UL) /*!< Sector 0 */ +#define EFM_ADDR_SECTOR1 (0x00002000UL) /*!< Sector 1 */ +#define EFM_ADDR_SECTOR2 (0x00004000UL) /*!< Sector 2 */ +#define EFM_ADDR_SECTOR3 (0x00006000UL) /*!< Sector 3 */ +#define EFM_ADDR_SECTOR4 (0x00008000UL) /*!< Sector 4 */ +#define EFM_ADDR_SECTOR5 (0x0000A000UL) /*!< Sector 5 */ +#define EFM_ADDR_SECTOR6 (0x0000C000UL) /*!< Sector 6 */ +#define EFM_ADDR_SECTOR7 (0x0000E000UL) /*!< Sector 7 */ +#define EFM_ADDR_SECTOR8 (0x00010000UL) /*!< Sector 8 */ +#define EFM_ADDR_SECTOR9 (0x00012000UL) /*!< Sector 9 */ +#define EFM_ADDR_SECTOR10 (0x00014000UL) /*!< Sector 10 */ +#define EFM_ADDR_SECTOR11 (0x00016000UL) /*!< Sector 11 */ +#define EFM_ADDR_SECTOR12 (0x00018000UL) /*!< Sector 12 */ +#define EFM_ADDR_SECTOR13 (0x0001A000UL) /*!< Sector 13 */ +#define EFM_ADDR_SECTOR14 (0x0001C000UL) /*!< Sector 14 */ +#define EFM_ADDR_SECTOR15 (0x0001E000UL) /*!< Sector 15 */ +#define EFM_ADDR_SECTOR16 (0x00020000UL) /*!< Sector 16 */ +#define EFM_ADDR_SECTOR17 (0x00022000UL) /*!< Sector 17 */ +#define EFM_ADDR_SECTOR18 (0x00024000UL) /*!< Sector 18 */ +#define EFM_ADDR_SECTOR19 (0x00026000UL) /*!< Sector 19 */ +#define EFM_ADDR_SECTOR20 (0x00028000UL) /*!< Sector 20 */ +#define EFM_ADDR_SECTOR21 (0x0002A000UL) /*!< Sector 21 */ +#define EFM_ADDR_SECTOR22 (0x0002C000UL) /*!< Sector 22 */ +#define EFM_ADDR_SECTOR23 (0x0002E000UL) /*!< Sector 23 */ +#define EFM_ADDR_SECTOR24 (0x00030000UL) /*!< Sector 24 */ +#define EFM_ADDR_SECTOR25 (0x00032000UL) /*!< Sector 25 */ +#define EFM_ADDR_SECTOR26 (0x00034000UL) /*!< Sector 26 */ +#define EFM_ADDR_SECTOR27 (0x00036000UL) /*!< Sector 27 */ +#define EFM_ADDR_SECTOR28 (0x00038000UL) /*!< Sector 28 */ +#define EFM_ADDR_SECTOR29 (0x0003A000UL) /*!< Sector 29 */ +#define EFM_ADDR_SECTOR30 (0x0003C000UL) /*!< Sector 30 */ +#define EFM_ADDR_SECTOR31 (0x0003E000UL) /*!< Sector 31 */ +#define EFM_ADDR_SECTOR32 (0x00040000UL) /*!< Sector 32 */ +#define EFM_ADDR_SECTOR33 (0x00042000UL) /*!< Sector 33 */ +#define EFM_ADDR_SECTOR34 (0x00044000UL) /*!< Sector 34 */ +#define EFM_ADDR_SECTOR35 (0x00046000UL) /*!< Sector 35 */ +#define EFM_ADDR_SECTOR36 (0x00048000UL) /*!< Sector 36 */ +#define EFM_ADDR_SECTOR37 (0x0004A000UL) /*!< Sector 37 */ +#define EFM_ADDR_SECTOR38 (0x0004C000UL) /*!< Sector 38 */ +#define EFM_ADDR_SECTOR39 (0x0004E000UL) /*!< Sector 39 */ +#define EFM_ADDR_SECTOR40 (0x00050000UL) /*!< Sector 40 */ +#define EFM_ADDR_SECTOR41 (0x00052000UL) /*!< Sector 41 */ +#define EFM_ADDR_SECTOR42 (0x00054000UL) /*!< Sector 42 */ +#define EFM_ADDR_SECTOR43 (0x00056000UL) /*!< Sector 43 */ +#define EFM_ADDR_SECTOR44 (0x00058000UL) /*!< Sector 44 */ +#define EFM_ADDR_SECTOR45 (0x0005A000UL) /*!< Sector 45 */ +#define EFM_ADDR_SECTOR46 (0x0005C000UL) /*!< Sector 46 */ +#define EFM_ADDR_SECTOR47 (0x0005E000UL) /*!< Sector 47 */ +#define EFM_ADDR_SECTOR48 (0x00060000UL) /*!< Sector 48 */ +#define EFM_ADDR_SECTOR49 (0x00062000UL) /*!< Sector 49 */ +#define EFM_ADDR_SECTOR50 (0x00064000UL) /*!< Sector 50 */ +#define EFM_ADDR_SECTOR51 (0x00066000UL) /*!< Sector 51 */ +#define EFM_ADDR_SECTOR52 (0x00068000UL) /*!< Sector 52 */ +#define EFM_ADDR_SECTOR53 (0x0006A000UL) /*!< Sector 53 */ +#define EFM_ADDR_SECTOR54 (0x0006C000UL) /*!< Sector 54 */ +#define EFM_ADDR_SECTOR55 (0x0006E000UL) /*!< Sector 55 */ +#define EFM_ADDR_SECTOR56 (0x00070000UL) /*!< Sector 56 */ +#define EFM_ADDR_SECTOR57 (0x00072000UL) /*!< Sector 57 */ +#define EFM_ADDR_SECTOR58 (0x00074000UL) /*!< Sector 58 */ +#define EFM_ADDR_SECTOR59 (0x00076000UL) /*!< Sector 59 */ +#define EFM_ADDR_SECTOR60 (0x00078000UL) /*!< Sector 60 */ +#define EFM_ADDR_SECTOR61 (0x0007A000UL) /*!< Sector 61 */ +#define EFM_ADDR_SECTOR62 (0x0007C000UL) /*!< Sector 62 */ +#define EFM_ADDR_SECTOR63 (0x0007E000UL) /*!< Sector 63 */ +#define EFM_ADDR_SECTOR64 (0x00080000UL) /*!< Sector 64 */ +#define EFM_ADDR_SECTOR65 (0x00082000UL) /*!< Sector 65 */ +#define EFM_ADDR_SECTOR66 (0x00084000UL) /*!< Sector 66 */ +#define EFM_ADDR_SECTOR67 (0x00086000UL) /*!< Sector 67 */ +#define EFM_ADDR_SECTOR68 (0x00088000UL) /*!< Sector 68 */ +#define EFM_ADDR_SECTOR69 (0x0008A000UL) /*!< Sector 69 */ +#define EFM_ADDR_SECTOR70 (0x0008C000UL) /*!< Sector 70 */ +#define EFM_ADDR_SECTOR71 (0x0008E000UL) /*!< Sector 71 */ +#define EFM_ADDR_SECTOR72 (0x00090000UL) /*!< Sector 72 */ +#define EFM_ADDR_SECTOR73 (0x00092000UL) /*!< Sector 73 */ +#define EFM_ADDR_SECTOR74 (0x00094000UL) /*!< Sector 74 */ +#define EFM_ADDR_SECTOR75 (0x00096000UL) /*!< Sector 75 */ +#define EFM_ADDR_SECTOR76 (0x00098000UL) /*!< Sector 76 */ +#define EFM_ADDR_SECTOR77 (0x0009A000UL) /*!< Sector 77 */ +#define EFM_ADDR_SECTOR78 (0x0009C000UL) /*!< Sector 78 */ +#define EFM_ADDR_SECTOR79 (0x0009E000UL) /*!< Sector 79 */ +#define EFM_ADDR_SECTOR80 (0x000A0000UL) /*!< Sector 80 */ +#define EFM_ADDR_SECTOR81 (0x000A2000UL) /*!< Sector 81 */ +#define EFM_ADDR_SECTOR82 (0x000A4000UL) /*!< Sector 82 */ +#define EFM_ADDR_SECTOR83 (0x000A6000UL) /*!< Sector 83 */ +#define EFM_ADDR_SECTOR84 (0x000A8000UL) /*!< Sector 84 */ +#define EFM_ADDR_SECTOR85 (0x000AA000UL) /*!< Sector 85 */ +#define EFM_ADDR_SECTOR86 (0x000AC000UL) /*!< Sector 86 */ +#define EFM_ADDR_SECTOR87 (0x000AE000UL) /*!< Sector 87 */ +#define EFM_ADDR_SECTOR88 (0x000B0000UL) /*!< Sector 88 */ +#define EFM_ADDR_SECTOR89 (0x000B2000UL) /*!< Sector 89 */ +#define EFM_ADDR_SECTOR90 (0x000B4000UL) /*!< Sector 90 */ +#define EFM_ADDR_SECTOR91 (0x000B6000UL) /*!< Sector 91 */ +#define EFM_ADDR_SECTOR92 (0x000B8000UL) /*!< Sector 92 */ +#define EFM_ADDR_SECTOR93 (0x000BA000UL) /*!< Sector 93 */ +#define EFM_ADDR_SECTOR94 (0x000BC000UL) /*!< Sector 94 */ +#define EFM_ADDR_SECTOR95 (0x000BE000UL) /*!< Sector 95 */ +#define EFM_ADDR_SECTOR96 (0x000C0000UL) /*!< Sector 96 */ +#define EFM_ADDR_SECTOR97 (0x000C2000UL) /*!< Sector 97 */ +#define EFM_ADDR_SECTOR98 (0x000C4000UL) /*!< Sector 98 */ +#define EFM_ADDR_SECTOR99 (0x000C6000UL) /*!< Sector 99 */ +#define EFM_ADDR_SECTOR100 (0x000C8000UL) /*!< Sector 100 */ +#define EFM_ADDR_SECTOR101 (0x000CA000UL) /*!< Sector 101 */ +#define EFM_ADDR_SECTOR102 (0x000CC000UL) /*!< Sector 102 */ +#define EFM_ADDR_SECTOR103 (0x000CE000UL) /*!< Sector 103 */ +#define EFM_ADDR_SECTOR104 (0x000D0000UL) /*!< Sector 104 */ +#define EFM_ADDR_SECTOR105 (0x000D2000UL) /*!< Sector 105 */ +#define EFM_ADDR_SECTOR106 (0x000D4000UL) /*!< Sector 106 */ +#define EFM_ADDR_SECTOR107 (0x000D6000UL) /*!< Sector 107 */ +#define EFM_ADDR_SECTOR108 (0x000D8000UL) /*!< Sector 108 */ +#define EFM_ADDR_SECTOR109 (0x000DA000UL) /*!< Sector 109 */ +#define EFM_ADDR_SECTOR110 (0x000DC000UL) /*!< Sector 110 */ +#define EFM_ADDR_SECTOR111 (0x000DE000UL) /*!< Sector 111 */ +#define EFM_ADDR_SECTOR112 (0x000E0000UL) /*!< Sector 112 */ +#define EFM_ADDR_SECTOR113 (0x000E2000UL) /*!< Sector 113 */ +#define EFM_ADDR_SECTOR114 (0x000E4000UL) /*!< Sector 114 */ +#define EFM_ADDR_SECTOR115 (0x000E6000UL) /*!< Sector 115 */ +#define EFM_ADDR_SECTOR116 (0x000E8000UL) /*!< Sector 116 */ +#define EFM_ADDR_SECTOR117 (0x000EA000UL) /*!< Sector 117 */ +#define EFM_ADDR_SECTOR118 (0x000EC000UL) /*!< Sector 118 */ +#define EFM_ADDR_SECTOR119 (0x000EE000UL) /*!< Sector 119 */ +#define EFM_ADDR_SECTOR120 (0x000F0000UL) /*!< Sector 120 */ +#define EFM_ADDR_SECTOR121 (0x000F2000UL) /*!< Sector 121 */ +#define EFM_ADDR_SECTOR122 (0x000F4000UL) /*!< Sector 122 */ +#define EFM_ADDR_SECTOR123 (0x000F6000UL) /*!< Sector 123 */ +#define EFM_ADDR_SECTOR124 (0x000F8000UL) /*!< Sector 124 */ +#define EFM_ADDR_SECTOR125 (0x000FA000UL) /*!< Sector 125 */ +#define EFM_ADDR_SECTOR126 (0x000FC000UL) /*!< Sector 126 */ +#define EFM_ADDR_SECTOR127 (0x000FE000UL) /*!< Sector 127 */ +#define EFM_ADDR_SECTOR128 (0x00100000UL) /*!< Sector 128 */ +#define EFM_ADDR_SECTOR129 (0x00102000UL) /*!< Sector 129 */ +#define EFM_ADDR_SECTOR130 (0x00104000UL) /*!< Sector 130 */ +#define EFM_ADDR_SECTOR131 (0x00106000UL) /*!< Sector 131 */ +#define EFM_ADDR_SECTOR132 (0x00108000UL) /*!< Sector 132 */ +#define EFM_ADDR_SECTOR133 (0x0010A000UL) /*!< Sector 133 */ +#define EFM_ADDR_SECTOR134 (0x0010C000UL) /*!< Sector 134 */ +#define EFM_ADDR_SECTOR135 (0x0010E000UL) /*!< Sector 135 */ +#define EFM_ADDR_SECTOR136 (0x00110000UL) /*!< Sector 136 */ +#define EFM_ADDR_SECTOR137 (0x00112000UL) /*!< Sector 137 */ +#define EFM_ADDR_SECTOR138 (0x00114000UL) /*!< Sector 138 */ +#define EFM_ADDR_SECTOR139 (0x00116000UL) /*!< Sector 139 */ +#define EFM_ADDR_SECTOR140 (0x00118000UL) /*!< Sector 140 */ +#define EFM_ADDR_SECTOR141 (0x0011A000UL) /*!< Sector 141 */ +#define EFM_ADDR_SECTOR142 (0x0011C000UL) /*!< Sector 142 */ +#define EFM_ADDR_SECTOR143 (0x0011E000UL) /*!< Sector 143 */ +#define EFM_ADDR_SECTOR144 (0x00120000UL) /*!< Sector 144 */ +#define EFM_ADDR_SECTOR145 (0x00122000UL) /*!< Sector 145 */ +#define EFM_ADDR_SECTOR146 (0x00124000UL) /*!< Sector 146 */ +#define EFM_ADDR_SECTOR147 (0x00126000UL) /*!< Sector 147 */ +#define EFM_ADDR_SECTOR148 (0x00128000UL) /*!< Sector 148 */ +#define EFM_ADDR_SECTOR149 (0x0012A000UL) /*!< Sector 149 */ +#define EFM_ADDR_SECTOR150 (0x0012C000UL) /*!< Sector 150 */ +#define EFM_ADDR_SECTOR151 (0x0012E000UL) /*!< Sector 151 */ +#define EFM_ADDR_SECTOR152 (0x00130000UL) /*!< Sector 152 */ +#define EFM_ADDR_SECTOR153 (0x00132000UL) /*!< Sector 153 */ +#define EFM_ADDR_SECTOR154 (0x00134000UL) /*!< Sector 154 */ +#define EFM_ADDR_SECTOR155 (0x00136000UL) /*!< Sector 155 */ +#define EFM_ADDR_SECTOR156 (0x00138000UL) /*!< Sector 156 */ +#define EFM_ADDR_SECTOR157 (0x0013A000UL) /*!< Sector 157 */ +#define EFM_ADDR_SECTOR158 (0x0013C000UL) /*!< Sector 158 */ +#define EFM_ADDR_SECTOR159 (0x0013E000UL) /*!< Sector 159 */ +#define EFM_ADDR_SECTOR160 (0x00140000UL) /*!< Sector 160 */ +#define EFM_ADDR_SECTOR161 (0x00142000UL) /*!< Sector 161 */ +#define EFM_ADDR_SECTOR162 (0x00144000UL) /*!< Sector 162 */ +#define EFM_ADDR_SECTOR163 (0x00146000UL) /*!< Sector 163 */ +#define EFM_ADDR_SECTOR164 (0x00148000UL) /*!< Sector 164 */ +#define EFM_ADDR_SECTOR165 (0x0014A000UL) /*!< Sector 165 */ +#define EFM_ADDR_SECTOR166 (0x0014C000UL) /*!< Sector 166 */ +#define EFM_ADDR_SECTOR167 (0x0014E000UL) /*!< Sector 167 */ +#define EFM_ADDR_SECTOR168 (0x00150000UL) /*!< Sector 168 */ +#define EFM_ADDR_SECTOR169 (0x00152000UL) /*!< Sector 169 */ +#define EFM_ADDR_SECTOR170 (0x00154000UL) /*!< Sector 170 */ +#define EFM_ADDR_SECTOR171 (0x00156000UL) /*!< Sector 171 */ +#define EFM_ADDR_SECTOR172 (0x00158000UL) /*!< Sector 172 */ +#define EFM_ADDR_SECTOR173 (0x0015A000UL) /*!< Sector 173 */ +#define EFM_ADDR_SECTOR174 (0x0015C000UL) /*!< Sector 174 */ +#define EFM_ADDR_SECTOR175 (0x0015E000UL) /*!< Sector 175 */ +#define EFM_ADDR_SECTOR176 (0x00160000UL) /*!< Sector 176 */ +#define EFM_ADDR_SECTOR177 (0x00162000UL) /*!< Sector 177 */ +#define EFM_ADDR_SECTOR178 (0x00164000UL) /*!< Sector 178 */ +#define EFM_ADDR_SECTOR179 (0x00166000UL) /*!< Sector 179 */ +#define EFM_ADDR_SECTOR180 (0x00168000UL) /*!< Sector 180 */ +#define EFM_ADDR_SECTOR181 (0x0016A000UL) /*!< Sector 181 */ +#define EFM_ADDR_SECTOR182 (0x0016C000UL) /*!< Sector 182 */ +#define EFM_ADDR_SECTOR183 (0x0016E000UL) /*!< Sector 183 */ +#define EFM_ADDR_SECTOR184 (0x00170000UL) /*!< Sector 184 */ +#define EFM_ADDR_SECTOR185 (0x00172000UL) /*!< Sector 185 */ +#define EFM_ADDR_SECTOR186 (0x00174000UL) /*!< Sector 186 */ +#define EFM_ADDR_SECTOR187 (0x00176000UL) /*!< Sector 187 */ +#define EFM_ADDR_SECTOR188 (0x00178000UL) /*!< Sector 188 */ +#define EFM_ADDR_SECTOR189 (0x0017A000UL) /*!< Sector 189 */ +#define EFM_ADDR_SECTOR190 (0x0017C000UL) /*!< Sector 190 */ +#define EFM_ADDR_SECTOR191 (0x0017E000UL) /*!< Sector 191 */ +#define EFM_ADDR_SECTOR192 (0x00180000UL) /*!< Sector 192 */ +#define EFM_ADDR_SECTOR193 (0x00182000UL) /*!< Sector 193 */ +#define EFM_ADDR_SECTOR194 (0x00184000UL) /*!< Sector 194 */ +#define EFM_ADDR_SECTOR195 (0x00186000UL) /*!< Sector 195 */ +#define EFM_ADDR_SECTOR196 (0x00188000UL) /*!< Sector 196 */ +#define EFM_ADDR_SECTOR197 (0x0018A000UL) /*!< Sector 197 */ +#define EFM_ADDR_SECTOR198 (0x0018C000UL) /*!< Sector 198 */ +#define EFM_ADDR_SECTOR199 (0x0018E000UL) /*!< Sector 199 */ +#define EFM_ADDR_SECTOR200 (0x00190000UL) /*!< Sector 200 */ +#define EFM_ADDR_SECTOR201 (0x00192000UL) /*!< Sector 201 */ +#define EFM_ADDR_SECTOR202 (0x00194000UL) /*!< Sector 202 */ +#define EFM_ADDR_SECTOR203 (0x00196000UL) /*!< Sector 203 */ +#define EFM_ADDR_SECTOR204 (0x00198000UL) /*!< Sector 204 */ +#define EFM_ADDR_SECTOR205 (0x0019A000UL) /*!< Sector 205 */ +#define EFM_ADDR_SECTOR206 (0x0019C000UL) /*!< Sector 206 */ +#define EFM_ADDR_SECTOR207 (0x0019E000UL) /*!< Sector 207 */ +#define EFM_ADDR_SECTOR208 (0x001A0000UL) /*!< Sector 208 */ +#define EFM_ADDR_SECTOR209 (0x001A2000UL) /*!< Sector 209 */ +#define EFM_ADDR_SECTOR210 (0x001A4000UL) /*!< Sector 210 */ +#define EFM_ADDR_SECTOR211 (0x001A6000UL) /*!< Sector 211 */ +#define EFM_ADDR_SECTOR212 (0x001A8000UL) /*!< Sector 212 */ +#define EFM_ADDR_SECTOR213 (0x001AA000UL) /*!< Sector 213 */ +#define EFM_ADDR_SECTOR214 (0x001AC000UL) /*!< Sector 214 */ +#define EFM_ADDR_SECTOR215 (0x001AE000UL) /*!< Sector 215 */ +#define EFM_ADDR_SECTOR216 (0x001B0000UL) /*!< Sector 216 */ +#define EFM_ADDR_SECTOR217 (0x001B2000UL) /*!< Sector 217 */ +#define EFM_ADDR_SECTOR218 (0x001B4000UL) /*!< Sector 218 */ +#define EFM_ADDR_SECTOR219 (0x001B6000UL) /*!< Sector 219 */ +#define EFM_ADDR_SECTOR220 (0x001B8000UL) /*!< Sector 220 */ +#define EFM_ADDR_SECTOR221 (0x001BA000UL) /*!< Sector 221 */ +#define EFM_ADDR_SECTOR222 (0x001BC000UL) /*!< Sector 222 */ +#define EFM_ADDR_SECTOR223 (0x001BE000UL) /*!< Sector 223 */ +#define EFM_ADDR_SECTOR224 (0x001C0000UL) /*!< Sector 224 */ +#define EFM_ADDR_SECTOR225 (0x001C2000UL) /*!< Sector 225 */ +#define EFM_ADDR_SECTOR226 (0x001C4000UL) /*!< Sector 226 */ +#define EFM_ADDR_SECTOR227 (0x001C6000UL) /*!< Sector 227 */ +#define EFM_ADDR_SECTOR228 (0x001C8000UL) /*!< Sector 228 */ +#define EFM_ADDR_SECTOR229 (0x001CA000UL) /*!< Sector 229 */ +#define EFM_ADDR_SECTOR230 (0x001CC000UL) /*!< Sector 230 */ +#define EFM_ADDR_SECTOR231 (0x001CE000UL) /*!< Sector 231 */ +#define EFM_ADDR_SECTOR232 (0x001D0000UL) /*!< Sector 232 */ +#define EFM_ADDR_SECTOR233 (0x001D2000UL) /*!< Sector 233 */ +#define EFM_ADDR_SECTOR234 (0x001D4000UL) /*!< Sector 234 */ +#define EFM_ADDR_SECTOR235 (0x001D6000UL) /*!< Sector 235 */ +#define EFM_ADDR_SECTOR236 (0x001D8000UL) /*!< Sector 236 */ +#define EFM_ADDR_SECTOR237 (0x001DA000UL) /*!< Sector 237 */ +#define EFM_ADDR_SECTOR238 (0x001DC000UL) /*!< Sector 238 */ +#define EFM_ADDR_SECTOR239 (0x001DE000UL) /*!< Sector 239 */ +#define EFM_ADDR_SECTOR240 (0x001E0000UL) /*!< Sector 240 */ +#define EFM_ADDR_SECTOR241 (0x001E2000UL) /*!< Sector 241 */ +#define EFM_ADDR_SECTOR242 (0x001E4000UL) /*!< Sector 242 */ +#define EFM_ADDR_SECTOR243 (0x001E6000UL) /*!< Sector 243 */ +#define EFM_ADDR_SECTOR244 (0x001E8000UL) /*!< Sector 244 */ +#define EFM_ADDR_SECTOR245 (0x001EA000UL) /*!< Sector 245 */ +#define EFM_ADDR_SECTOR246 (0x001EC000UL) /*!< Sector 246 */ +#define EFM_ADDR_SECTOR247 (0x001EE000UL) /*!< Sector 247 */ +#define EFM_ADDR_SECTOR248 (0x001F0000UL) /*!< Sector 248 */ +#define EFM_ADDR_SECTOR249 (0x001F2000UL) /*!< Sector 249 */ +#define EFM_ADDR_SECTOR250 (0x001F4000UL) /*!< Sector 250 */ +#define EFM_ADDR_SECTOR251 (0x001F6000UL) /*!< Sector 251 */ +#define EFM_ADDR_SECTOR252 (0x001F8000UL) /*!< Sector 252 */ +#define EFM_ADDR_SECTOR253 (0x001FA000UL) /*!< Sector 253 */ +#define EFM_ADDR_SECTOR254 (0x001FC000UL) /*!< Sector 254 */ +#define EFM_ADDR_SECTOR255 (0x001FE000UL) /*!< Sector 255 */ +/** + * @} + */ + +/** + * @defgroup EFM_OTP_Address EFM otp address + * @{ + */ +#define EFM_OTP_BLOCK0 (0x00000000UL) /*!< OTP block0 8K Bytes */ +#define EFM_OTP_BLOCK1 (0x00002000UL) /*!< OTP block1 8K Bytes */ +#define EFM_OTP_BLOCK2 (0x00004000UL) /*!< OTP block2 8K Bytes */ +#define EFM_OTP_BLOCK3 (0x00006000UL) /*!< OTP block3 8K Bytes */ +#define EFM_OTP_BLOCK4 (0x00008000UL) /*!< OTP block4 8K Bytes */ +#define EFM_OTP_BLOCK5 (0x0000A000UL) /*!< OTP block5 8K Bytes */ +#define EFM_OTP_BLOCK6 (0x0000C000UL) /*!< OTP block6 8K Bytes */ +#define EFM_OTP_BLOCK7 (0x0000E000UL) /*!< OTP block7 8K Bytes */ +#define EFM_OTP_BLOCK8 (0x00010000UL) /*!< OTP block8 8K Bytes */ +#define EFM_OTP_BLOCK9 (0x00012000UL) /*!< OTP block9 8K Bytes */ +#define EFM_OTP_BLOCK10 (0x00014000UL) /*!< OTP block10 8K Bytes */ +#define EFM_OTP_BLOCK11 (0x00016000UL) /*!< OTP block11 8K Bytes */ +#define EFM_OTP_BLOCK12 (0x00018000UL) /*!< OTP block12 8K Bytes */ +#define EFM_OTP_BLOCK13 (0x0001A000UL) /*!< OTP block13 8K Bytes */ +#define EFM_OTP_BLOCK14 (0x0001C000UL) /*!< OTP block14 8K Bytes */ +#define EFM_OTP_BLOCK15 (0x0001E000UL) /*!< OTP block15 8K Bytes */ + +#define EFM_OTP_BLOCK16 (0x03000000UL) /*!< OTP block16 2K Bytes */ +#define EFM_OTP_BLOCK17 (0x03000800UL) /*!< OTP block17 2K Bytes */ + +#define EFM_OTP_BLOCK18 (0x03001000UL) /*!< OTP block18 256 Bytes */ +#define EFM_OTP_BLOCK19 (0x03001100UL) /*!< OTP block19 256 Bytes */ +#define EFM_OTP_BLOCK20 (0x03001200UL) /*!< OTP block20 256 Bytes */ +#define EFM_OTP_BLOCK21 (0x03001300UL) /*!< OTP block21 256 Bytes */ + +#define EFM_OTP_BLOCK22 (0x03001400UL) /*!< OTP block22 16 Bytes */ +#define EFM_OTP_BLOCK23 (0x03001410UL) /*!< OTP block23 16 Bytes */ +#define EFM_OTP_BLOCK24 (0x03001420UL) /*!< OTP block24 16 Bytes */ +#define EFM_OTP_BLOCK25 (0x03001430UL) /*!< OTP block25 16 Bytes */ +#define EFM_OTP_BLOCK26 (0x03001440UL) /*!< OTP block26 16 Bytes */ +#define EFM_OTP_BLOCK27 (0x03001450UL) /*!< OTP block27 16 Bytes */ +#define EFM_OTP_BLOCK28 (0x03001460UL) /*!< OTP block28 16 Bytes */ +#define EFM_OTP_BLOCK29 (0x03001470UL) /*!< OTP block29 16 Bytes */ +#define EFM_OTP_BLOCK30 (0x03001480UL) /*!< OTP block30 16 Bytes */ +#define EFM_OTP_BLOCK31 (0x03001490UL) /*!< OTP block31 16 Bytes */ +#define EFM_OTP_BLOCK32 (0x030014A0UL) /*!< OTP block32 16 Bytes */ +#define EFM_OTP_BLOCK33 (0x030014B0UL) /*!< OTP block33 16 Bytes */ +#define EFM_OTP_BLOCK34 (0x030014C0UL) /*!< OTP block34 16 Bytes */ +#define EFM_OTP_BLOCK35 (0x030014D0UL) /*!< OTP block35 16 Bytes */ +#define EFM_OTP_BLOCK36 (0x030014E0UL) /*!< OTP block36 16 Bytes */ +#define EFM_OTP_BLOCK37 (0x030014F0UL) /*!< OTP block37 16 Bytes */ +#define EFM_OTP_BLOCK38 (0x03001500UL) /*!< OTP block38 16 Bytes */ +#define EFM_OTP_BLOCK39 (0x03001510UL) /*!< OTP block39 16 Bytes */ +#define EFM_OTP_BLOCK40 (0x03001520UL) /*!< OTP block40 16 Bytes */ +#define EFM_OTP_BLOCK41 (0x03001530UL) /*!< OTP block41 16 Bytes */ +#define EFM_OTP_BLOCK42 (0x03001540UL) /*!< OTP block42 16 Bytes */ +#define EFM_OTP_BLOCK43 (0x03001550UL) /*!< OTP block43 16 Bytes */ +#define EFM_OTP_BLOCK44 (0x03001560UL) /*!< OTP block44 16 Bytes */ +#define EFM_OTP_BLOCK45 (0x03001570UL) /*!< OTP block45 16 Bytes */ +#define EFM_OTP_BLOCK46 (0x03001580UL) /*!< OTP block46 16 Bytes */ +#define EFM_OTP_BLOCK47 (0x03001590UL) /*!< OTP block47 16 Bytes */ +#define EFM_OTP_BLOCK48 (0x030015A0UL) /*!< OTP block48 16 Bytes */ +#define EFM_OTP_BLOCK49 (0x030015B0UL) /*!< OTP block49 16 Bytes */ +#define EFM_OTP_BLOCK50 (0x030015C0UL) /*!< OTP block50 16 Bytes */ +#define EFM_OTP_BLOCK51 (0x030015D0UL) /*!< OTP block51 16 Bytes */ +#define EFM_OTP_BLOCK52 (0x030015E0UL) /*!< OTP block52 16 Bytes */ +#define EFM_OTP_BLOCK53 (0x030015F0UL) /*!< OTP block53 16 Bytes */ + +#define EFM_OTP_BLOCK54 (0x03001600UL) /*!< OTP block54 4 Bytes */ +#define EFM_OTP_BLOCK55 (0x03001604UL) /*!< OTP block55 4 Bytes */ +#define EFM_OTP_BLOCK56 (0x03001608UL) /*!< OTP block56 4 Bytes */ +#define EFM_OTP_BLOCK57 (0x0300160CUL) /*!< OTP block57 4 Bytes */ +#define EFM_OTP_BLOCK58 (0x03001610UL) /*!< OTP block58 4 Bytes */ +#define EFM_OTP_BLOCK59 (0x03001614UL) /*!< OTP block59 4 Bytes */ +#define EFM_OTP_BLOCK60 (0x03001618UL) /*!< OTP block60 4 Bytes */ +#define EFM_OTP_BLOCK61 (0x0300161CUL) /*!< OTP block61 4 Bytes */ +#define EFM_OTP_BLOCK62 (0x03001620UL) /*!< OTP block62 4 Bytes */ +#define EFM_OTP_BLOCK63 (0x03001624UL) /*!< OTP block63 4 Bytes */ +#define EFM_OTP_BLOCK64 (0x03001628UL) /*!< OTP block64 4 Bytes */ +#define EFM_OTP_BLOCK65 (0x0300162CUL) /*!< OTP block65 4 Bytes */ +#define EFM_OTP_BLOCK66 (0x03001630UL) /*!< OTP block66 4 Bytes */ +#define EFM_OTP_BLOCK67 (0x03001634UL) /*!< OTP block67 4 Bytes */ +#define EFM_OTP_BLOCK68 (0x03001638UL) /*!< OTP block68 4 Bytes */ +#define EFM_OTP_BLOCK69 (0x0300163CUL) /*!< OTP block69 4 Bytes */ +#define EFM_OTP_BLOCK70 (0x03001640UL) /*!< OTP block70 4 Bytes */ +#define EFM_OTP_BLOCK71 (0x03001644UL) /*!< OTP block71 4 Bytes */ +#define EFM_OTP_BLOCK72 (0x03001648UL) /*!< OTP block72 4 Bytes */ +#define EFM_OTP_BLOCK73 (0x0300164CUL) /*!< OTP block73 4 Bytes */ +#define EFM_OTP_BLOCK74 (0x03001650UL) /*!< OTP block74 4 Bytes */ +#define EFM_OTP_BLOCK75 (0x03001654UL) /*!< OTP block75 4 Bytes */ +#define EFM_OTP_BLOCK76 (0x03001658UL) /*!< OTP block76 4 Bytes */ +#define EFM_OTP_BLOCK77 (0x0300165CUL) /*!< OTP block77 4 Bytes */ +#define EFM_OTP_BLOCK78 (0x03001660UL) /*!< OTP block78 4 Bytes */ +#define EFM_OTP_BLOCK79 (0x03001664UL) /*!< OTP block79 4 Bytes */ +#define EFM_OTP_BLOCK80 (0x03001668UL) /*!< OTP block80 4 Bytes */ +#define EFM_OTP_BLOCK81 (0x0300166CUL) /*!< OTP block81 4 Bytes */ +#define EFM_OTP_BLOCK82 (0x03001670UL) /*!< OTP block82 4 Bytes */ +#define EFM_OTP_BLOCK83 (0x03001674UL) /*!< OTP block83 4 Bytes */ +#define EFM_OTP_BLOCK84 (0x03001678UL) /*!< OTP block84 4 Bytes */ +#define EFM_OTP_BLOCK85 (0x0300167CUL) /*!< OTP block85 4 Bytes */ +#define EFM_OTP_BLOCK86 (0x03001680UL) /*!< OTP block86 4 Bytes */ +#define EFM_OTP_BLOCK87 (0x03001684UL) /*!< OTP block87 4 Bytes */ +#define EFM_OTP_BLOCK88 (0x03001688UL) /*!< OTP block88 4 Bytes */ +#define EFM_OTP_BLOCK89 (0x0300168CUL) /*!< OTP block89 4 Bytes */ +#define EFM_OTP_BLOCK90 (0x03001690UL) /*!< OTP block90 4 Bytes */ +#define EFM_OTP_BLOCK91 (0x03001694UL) /*!< OTP block91 4 Bytes */ +#define EFM_OTP_BLOCK92 (0x03001698UL) /*!< OTP block92 4 Bytes */ +#define EFM_OTP_BLOCK93 (0x0300169CUL) /*!< OTP block93 4 Bytes */ +#define EFM_OTP_BLOCK94 (0x030016A0UL) /*!< OTP block94 4 Bytes */ +#define EFM_OTP_BLOCK95 (0x030016A4UL) /*!< OTP block95 4 Bytes */ +#define EFM_OTP_BLOCK96 (0x030016A8UL) /*!< OTP block96 4 Bytes */ +#define EFM_OTP_BLOCK97 (0x030016ACUL) /*!< OTP block97 4 Bytes */ +#define EFM_OTP_BLOCK98 (0x030016B0UL) /*!< OTP block98 4 Bytes */ +#define EFM_OTP_BLOCK99 (0x030016B4UL) /*!< OTP block99 4 Bytes */ +#define EFM_OTP_BLOCK100 (0x030016B8UL) /*!< OTP block100 4 Bytes */ +#define EFM_OTP_BLOCK101 (0x030016BCUL) /*!< OTP block101 4 Bytes */ +#define EFM_OTP_BLOCK102 (0x030016C0UL) /*!< OTP block102 4 Bytes */ +#define EFM_OTP_BLOCK103 (0x030016C4UL) /*!< OTP block103 4 Bytes */ +#define EFM_OTP_BLOCK104 (0x030016C8UL) /*!< OTP block104 4 Bytes */ +#define EFM_OTP_BLOCK105 (0x030016CCUL) /*!< OTP block105 4 Bytes */ +#define EFM_OTP_BLOCK106 (0x030016D0UL) /*!< OTP block106 4 Bytes */ +#define EFM_OTP_BLOCK107 (0x030016D4UL) /*!< OTP block107 4 Bytes */ +#define EFM_OTP_BLOCK108 (0x030016D8UL) /*!< OTP block108 4 Bytes */ +#define EFM_OTP_BLOCK109 (0x030016DCUL) /*!< OTP block109 4 Bytes */ +#define EFM_OTP_BLOCK110 (0x030016E0UL) /*!< OTP block110 4 Bytes */ +#define EFM_OTP_BLOCK111 (0x030016E4UL) /*!< OTP block111 4 Bytes */ +#define EFM_OTP_BLOCK112 (0x030016E8UL) /*!< OTP block112 4 Bytes */ +#define EFM_OTP_BLOCK113 (0x030016ECUL) /*!< OTP block113 4 Bytes */ +#define EFM_OTP_BLOCK114 (0x030016F0UL) /*!< OTP block114 4 Bytes */ +#define EFM_OTP_BLOCK115 (0x030016F4UL) /*!< OTP block115 4 Bytes */ +#define EFM_OTP_BLOCK116 (0x030016F8UL) /*!< OTP block116 4 Bytes */ +#define EFM_OTP_BLOCK117 (0x030016FCUL) /*!< OTP block117 4 Bytes */ +#define EFM_OTP_BLOCK118 (0x03001700UL) /*!< OTP block118 4 Bytes */ +#define EFM_OTP_BLOCK119 (0x03001704UL) /*!< OTP block119 4 Bytes */ +#define EFM_OTP_BLOCK120 (0x03001708UL) /*!< OTP block120 4 Bytes */ +#define EFM_OTP_BLOCK121 (0x0300170CUL) /*!< OTP block121 4 Bytes */ +#define EFM_OTP_BLOCK122 (0x03001710UL) /*!< OTP block122 4 Bytes */ +#define EFM_OTP_BLOCK123 (0x03001714UL) /*!< OTP block123 4 Bytes */ +#define EFM_OTP_BLOCK124 (0x03001718UL) /*!< OTP block124 4 Bytes */ +#define EFM_OTP_BLOCK125 (0x0300171CUL) /*!< OTP block125 4 Bytes */ +#define EFM_OTP_BLOCK126 (0x03001720UL) /*!< OTP block126 4 Bytes */ +#define EFM_OTP_BLOCK127 (0x03001724UL) /*!< OTP block127 4 Bytes */ +#define EFM_OTP_BLOCK128 (0x03001728UL) /*!< OTP block128 4 Bytes */ +#define EFM_OTP_BLOCK129 (0x0300172CUL) /*!< OTP block129 4 Bytes */ +#define EFM_OTP_BLOCK130 (0x03001730UL) /*!< OTP block130 4 Bytes */ +#define EFM_OTP_BLOCK131 (0x03001734UL) /*!< OTP block131 4 Bytes */ +#define EFM_OTP_BLOCK132 (0x03001738UL) /*!< OTP block132 4 Bytes */ +#define EFM_OTP_BLOCK133 (0x0300173CUL) /*!< OTP block133 4 Bytes */ +#define EFM_OTP_BLOCK134 (0x03001740UL) /*!< OTP block134 4 Bytes */ +#define EFM_OTP_BLOCK135 (0x03001744UL) /*!< OTP block135 4 Bytes */ +#define EFM_OTP_BLOCK136 (0x03001748UL) /*!< OTP block136 4 Bytes */ +#define EFM_OTP_BLOCK137 (0x0300174CUL) /*!< OTP block137 4 Bytes */ +#define EFM_OTP_BLOCK138 (0x03001750UL) /*!< OTP block138 4 Bytes */ +#define EFM_OTP_BLOCK139 (0x03001754UL) /*!< OTP block139 4 Bytes */ +#define EFM_OTP_BLOCK140 (0x03001758UL) /*!< OTP block140 4 Bytes */ +#define EFM_OTP_BLOCK141 (0x0300175CUL) /*!< OTP block141 4 Bytes */ +#define EFM_OTP_BLOCK142 (0x03001760UL) /*!< OTP block142 4 Bytes */ +#define EFM_OTP_BLOCK143 (0x03001764UL) /*!< OTP block143 4 Bytes */ +#define EFM_OTP_BLOCK144 (0x03001768UL) /*!< OTP block144 4 Bytes */ +#define EFM_OTP_BLOCK145 (0x0300176CUL) /*!< OTP block145 4 Bytes */ +#define EFM_OTP_BLOCK146 (0x03001770UL) /*!< OTP block146 4 Bytes */ +#define EFM_OTP_BLOCK147 (0x03001774UL) /*!< OTP block147 4 Bytes */ +#define EFM_OTP_BLOCK148 (0x03001778UL) /*!< OTP block148 4 Bytes */ +#define EFM_OTP_BLOCK149 (0x0300177CUL) /*!< OTP block149 4 Bytes */ +#define EFM_OTP_BLOCK150 (0x03001780UL) /*!< OTP block150 4 Bytes */ +#define EFM_OTP_BLOCK151 (0x03001784UL) /*!< OTP block151 4 Bytes */ +#define EFM_OTP_BLOCK152 (0x03001788UL) /*!< OTP block152 4 Bytes */ +#define EFM_OTP_BLOCK153 (0x0300178CUL) /*!< OTP block153 4 Bytes */ +#define EFM_OTP_BLOCK154 (0x03001790UL) /*!< OTP block154 4 Bytes */ +#define EFM_OTP_BLOCK155 (0x03001794UL) /*!< OTP block155 4 Bytes */ +#define EFM_OTP_BLOCK156 (0x03001798UL) /*!< OTP block156 4 Bytes */ +#define EFM_OTP_BLOCK157 (0x0300179CUL) /*!< OTP block157 4 Bytes */ +#define EFM_OTP_BLOCK158 (0x030017A0UL) /*!< OTP block158 4 Bytes */ +#define EFM_OTP_BLOCK159 (0x030017A4UL) /*!< OTP block159 4 Bytes */ +#define EFM_OTP_BLOCK160 (0x030017A8UL) /*!< OTP block160 4 Bytes */ +#define EFM_OTP_BLOCK161 (0x030017ACUL) /*!< OTP block161 4 Bytes */ +#define EFM_OTP_BLOCK162 (0x030017B0UL) /*!< OTP block162 4 Bytes */ +#define EFM_OTP_BLOCK163 (0x030017B4UL) /*!< OTP block163 4 Bytes */ +#define EFM_OTP_BLOCK164 (0x030017B8UL) /*!< OTP block164 4 Bytes */ +#define EFM_OTP_BLOCK165 (0x030017BCUL) /*!< OTP block165 4 Bytes */ +#define EFM_OTP_BLOCK166 (0x030017C0UL) /*!< OTP block166 4 Bytes */ +#define EFM_OTP_BLOCK167 (0x030017C4UL) /*!< OTP block167 4 Bytes */ +#define EFM_OTP_BLOCK168 (0x030017C8UL) /*!< OTP block168 4 Bytes */ +#define EFM_OTP_BLOCK169 (0x030017CCUL) /*!< OTP block169 4 Bytes */ +#define EFM_OTP_BLOCK170 (0x030017D0UL) /*!< OTP block170 4 Bytes */ +#define EFM_OTP_BLOCK171 (0x030017D4UL) /*!< OTP block171 4 Bytes */ +#define EFM_OTP_BLOCK172 (0x030017D8UL) /*!< OTP block172 4 Bytes */ +#define EFM_OTP_BLOCK173 (0x030017DCUL) /*!< OTP block173 4 Bytes */ +#define EFM_OTP_BLOCK174 (0x030017E0UL) /*!< OTP block174 4 Bytes */ +#define EFM_OTP_BLOCK175 (0x030017E4UL) /*!< OTP block175 4 Bytes */ +#define EFM_OTP_BLOCK176 (0x030017E8UL) /*!< OTP block176 4 Bytes */ +#define EFM_OTP_BLOCK177 (0x030017ECUL) /*!< OTP block177 4 Bytes */ +#define EFM_OTP_BLOCK178 (0x030017F0UL) /*!< OTP block178 4 Bytes */ +#define EFM_OTP_BLOCK179 (0x030017F4UL) /*!< OTP block179 4 Bytes */ +#define EFM_OTP_BLOCK180 (0x030017F8UL) /*!< OTP block180 4 Bytes */ +#define EFM_OTP_BLOCK181 (0x030017FCUL) /*!< OTP block181 4 Bytes */ +/** + * @} + */ + +/** + * @defgroup EFM_Sectot_Num Efm sector number + * @{ + */ +#define EFM_SECTOR_0 (0U) +#define EFM_SECTOR_1 (1U) +#define EFM_SECTOR_2 (2U) +#define EFM_SECTOR_3 (3U) +#define EFM_SECTOR_4 (4U) +#define EFM_SECTOR_5 (5U) +#define EFM_SECTOR_6 (6U) +#define EFM_SECTOR_7 (7U) +#define EFM_SECTOR_8 (8U) +#define EFM_SECTOR_9 (9U) +#define EFM_SECTOR_10 (10U) +#define EFM_SECTOR_11 (11U) +#define EFM_SECTOR_12 (12U) +#define EFM_SECTOR_13 (13U) +#define EFM_SECTOR_14 (14U) +#define EFM_SECTOR_15 (15U) +#define EFM_SECTOR_16 (16U) +#define EFM_SECTOR_17 (17U) +#define EFM_SECTOR_18 (18U) +#define EFM_SECTOR_19 (19U) +#define EFM_SECTOR_20 (20U) +#define EFM_SECTOR_21 (21U) +#define EFM_SECTOR_22 (22U) +#define EFM_SECTOR_23 (23U) +#define EFM_SECTOR_24 (24U) +#define EFM_SECTOR_25 (25U) +#define EFM_SECTOR_26 (26U) +#define EFM_SECTOR_27 (27U) +#define EFM_SECTOR_28 (28U) +#define EFM_SECTOR_29 (29U) +#define EFM_SECTOR_30 (30U) +#define EFM_SECTOR_31 (31U) +#define EFM_SECTOR_32 (32U) +#define EFM_SECTOR_33 (33U) +#define EFM_SECTOR_34 (34U) +#define EFM_SECTOR_35 (35U) +#define EFM_SECTOR_36 (36U) +#define EFM_SECTOR_37 (37U) +#define EFM_SECTOR_38 (38U) +#define EFM_SECTOR_39 (39U) +#define EFM_SECTOR_40 (40U) +#define EFM_SECTOR_41 (41U) +#define EFM_SECTOR_42 (42U) +#define EFM_SECTOR_43 (43U) +#define EFM_SECTOR_44 (44U) +#define EFM_SECTOR_45 (45U) +#define EFM_SECTOR_46 (46U) +#define EFM_SECTOR_47 (47U) +#define EFM_SECTOR_48 (48U) +#define EFM_SECTOR_49 (49U) +#define EFM_SECTOR_50 (50U) +#define EFM_SECTOR_51 (51U) +#define EFM_SECTOR_52 (52U) +#define EFM_SECTOR_53 (53U) +#define EFM_SECTOR_54 (54U) +#define EFM_SECTOR_55 (55U) +#define EFM_SECTOR_56 (56U) +#define EFM_SECTOR_57 (57U) +#define EFM_SECTOR_58 (58U) +#define EFM_SECTOR_59 (59U) +#define EFM_SECTOR_60 (60U) +#define EFM_SECTOR_61 (61U) +#define EFM_SECTOR_62 (62U) +#define EFM_SECTOR_63 (63U) +#define EFM_SECTOR_64 (64U) +#define EFM_SECTOR_65 (65U) +#define EFM_SECTOR_66 (66U) +#define EFM_SECTOR_67 (67U) +#define EFM_SECTOR_68 (68U) +#define EFM_SECTOR_69 (69U) +#define EFM_SECTOR_70 (70U) +#define EFM_SECTOR_71 (71U) +#define EFM_SECTOR_72 (72U) +#define EFM_SECTOR_73 (73U) +#define EFM_SECTOR_74 (74U) +#define EFM_SECTOR_75 (75U) +#define EFM_SECTOR_76 (76U) +#define EFM_SECTOR_77 (77U) +#define EFM_SECTOR_78 (78U) +#define EFM_SECTOR_79 (79U) +#define EFM_SECTOR_80 (80U) +#define EFM_SECTOR_81 (81U) +#define EFM_SECTOR_82 (82U) +#define EFM_SECTOR_83 (83U) +#define EFM_SECTOR_84 (84U) +#define EFM_SECTOR_85 (85U) +#define EFM_SECTOR_86 (86U) +#define EFM_SECTOR_87 (87U) +#define EFM_SECTOR_88 (88U) +#define EFM_SECTOR_89 (89U) +#define EFM_SECTOR_90 (90U) +#define EFM_SECTOR_91 (91U) +#define EFM_SECTOR_92 (92U) +#define EFM_SECTOR_93 (93U) +#define EFM_SECTOR_94 (94U) +#define EFM_SECTOR_95 (95U) +#define EFM_SECTOR_96 (96U) +#define EFM_SECTOR_97 (97U) +#define EFM_SECTOR_98 (98U) +#define EFM_SECTOR_99 (99U) +#define EFM_SECTOR_100 (100U) +#define EFM_SECTOR_101 (101U) +#define EFM_SECTOR_102 (102U) +#define EFM_SECTOR_103 (103U) +#define EFM_SECTOR_104 (104U) +#define EFM_SECTOR_105 (105U) +#define EFM_SECTOR_106 (106U) +#define EFM_SECTOR_107 (107U) +#define EFM_SECTOR_108 (108U) +#define EFM_SECTOR_109 (109U) +#define EFM_SECTOR_110 (110U) +#define EFM_SECTOR_111 (111U) +#define EFM_SECTOR_112 (112U) +#define EFM_SECTOR_113 (113U) +#define EFM_SECTOR_114 (114U) +#define EFM_SECTOR_115 (115U) +#define EFM_SECTOR_116 (116U) +#define EFM_SECTOR_117 (117U) +#define EFM_SECTOR_118 (118U) +#define EFM_SECTOR_119 (119U) +#define EFM_SECTOR_120 (120U) +#define EFM_SECTOR_121 (121U) +#define EFM_SECTOR_122 (122U) +#define EFM_SECTOR_123 (123U) +#define EFM_SECTOR_124 (124U) +#define EFM_SECTOR_125 (125U) +#define EFM_SECTOR_126 (126U) +#define EFM_SECTOR_127 (127U) +#define EFM_SECTOR_128 (128U) +#define EFM_SECTOR_129 (129U) +#define EFM_SECTOR_130 (130U) +#define EFM_SECTOR_131 (131U) +#define EFM_SECTOR_132 (132U) +#define EFM_SECTOR_133 (133U) +#define EFM_SECTOR_134 (134U) +#define EFM_SECTOR_135 (135U) +#define EFM_SECTOR_136 (136U) +#define EFM_SECTOR_137 (137U) +#define EFM_SECTOR_138 (138U) +#define EFM_SECTOR_139 (139U) +#define EFM_SECTOR_140 (140U) +#define EFM_SECTOR_141 (141U) +#define EFM_SECTOR_142 (142U) +#define EFM_SECTOR_143 (143U) +#define EFM_SECTOR_144 (144U) +#define EFM_SECTOR_145 (145U) +#define EFM_SECTOR_146 (146U) +#define EFM_SECTOR_147 (147U) +#define EFM_SECTOR_148 (148U) +#define EFM_SECTOR_149 (149U) +#define EFM_SECTOR_150 (150U) +#define EFM_SECTOR_151 (151U) +#define EFM_SECTOR_152 (152U) +#define EFM_SECTOR_153 (153U) +#define EFM_SECTOR_154 (154U) +#define EFM_SECTOR_155 (155U) +#define EFM_SECTOR_156 (156U) +#define EFM_SECTOR_157 (157U) +#define EFM_SECTOR_158 (158U) +#define EFM_SECTOR_159 (159U) +#define EFM_SECTOR_160 (160U) +#define EFM_SECTOR_161 (161U) +#define EFM_SECTOR_162 (162U) +#define EFM_SECTOR_163 (163U) +#define EFM_SECTOR_164 (164U) +#define EFM_SECTOR_165 (165U) +#define EFM_SECTOR_166 (166U) +#define EFM_SECTOR_167 (167U) +#define EFM_SECTOR_168 (168U) +#define EFM_SECTOR_169 (169U) +#define EFM_SECTOR_170 (170U) +#define EFM_SECTOR_171 (171U) +#define EFM_SECTOR_172 (172U) +#define EFM_SECTOR_173 (173U) +#define EFM_SECTOR_174 (174U) +#define EFM_SECTOR_175 (175U) +#define EFM_SECTOR_176 (176U) +#define EFM_SECTOR_177 (177U) +#define EFM_SECTOR_178 (178U) +#define EFM_SECTOR_179 (179U) +#define EFM_SECTOR_180 (180U) +#define EFM_SECTOR_181 (181U) +#define EFM_SECTOR_182 (182U) +#define EFM_SECTOR_183 (183U) +#define EFM_SECTOR_184 (184U) +#define EFM_SECTOR_185 (185U) +#define EFM_SECTOR_186 (186U) +#define EFM_SECTOR_187 (187U) +#define EFM_SECTOR_188 (188U) +#define EFM_SECTOR_189 (189U) +#define EFM_SECTOR_190 (190U) +#define EFM_SECTOR_191 (191U) +#define EFM_SECTOR_192 (192U) +#define EFM_SECTOR_193 (193U) +#define EFM_SECTOR_194 (194U) +#define EFM_SECTOR_195 (195U) +#define EFM_SECTOR_196 (196U) +#define EFM_SECTOR_197 (197U) +#define EFM_SECTOR_198 (198U) +#define EFM_SECTOR_199 (199U) +#define EFM_SECTOR_200 (200U) +#define EFM_SECTOR_201 (201U) +#define EFM_SECTOR_202 (202U) +#define EFM_SECTOR_203 (203U) +#define EFM_SECTOR_204 (204U) +#define EFM_SECTOR_205 (205U) +#define EFM_SECTOR_206 (206U) +#define EFM_SECTOR_207 (207U) +#define EFM_SECTOR_208 (208U) +#define EFM_SECTOR_209 (209U) +#define EFM_SECTOR_210 (210U) +#define EFM_SECTOR_211 (211U) +#define EFM_SECTOR_212 (212U) +#define EFM_SECTOR_213 (213U) +#define EFM_SECTOR_214 (214U) +#define EFM_SECTOR_215 (215U) +#define EFM_SECTOR_216 (216U) +#define EFM_SECTOR_217 (217U) +#define EFM_SECTOR_218 (218U) +#define EFM_SECTOR_219 (219U) +#define EFM_SECTOR_220 (220U) +#define EFM_SECTOR_221 (221U) +#define EFM_SECTOR_222 (222U) +#define EFM_SECTOR_223 (223U) +#define EFM_SECTOR_224 (224U) +#define EFM_SECTOR_225 (225U) +#define EFM_SECTOR_226 (226U) +#define EFM_SECTOR_227 (227U) +#define EFM_SECTOR_228 (228U) +#define EFM_SECTOR_229 (229U) +#define EFM_SECTOR_230 (230U) +#define EFM_SECTOR_231 (231U) +#define EFM_SECTOR_232 (232U) +#define EFM_SECTOR_233 (233U) +#define EFM_SECTOR_234 (234U) +#define EFM_SECTOR_235 (235U) +#define EFM_SECTOR_236 (236U) +#define EFM_SECTOR_237 (237U) +#define EFM_SECTOR_238 (238U) +#define EFM_SECTOR_239 (239U) +#define EFM_SECTOR_240 (240U) +#define EFM_SECTOR_241 (241U) +#define EFM_SECTOR_242 (242U) +#define EFM_SECTOR_243 (243U) +#define EFM_SECTOR_244 (244U) +#define EFM_SECTOR_245 (245U) +#define EFM_SECTOR_246 (246U) +#define EFM_SECTOR_247 (247U) +#define EFM_SECTOR_248 (248U) +#define EFM_SECTOR_249 (249U) +#define EFM_SECTOR_250 (250U) +#define EFM_SECTOR_251 (251U) +#define EFM_SECTOR_252 (252U) +#define EFM_SECTOR_253 (253U) +#define EFM_SECTOR_254 (254U) +#define EFM_SECTOR_255 (255U) +/** + * @} + */ + +/** + * @defgroup EFM_Wait_Cycle EFM Wait Cycle + * @{ + */ +#define EFM_WAIT_CYCLE_0 (0U) /*!< Don't insert read wait cycle */ +#define EFM_WAIT_CYCLE_1 (1U) /*!< Insert 1 read wait cycle */ +#define EFM_WAIT_CYCLE_2 (2U) /*!< Insert 2 read wait cycles */ +#define EFM_WAIT_CYCLE_3 (3U) /*!< Insert 3 read wait cycles */ +#define EFM_WAIT_CYCLE_4 (4U) /*!< Insert 4 read wait cycles */ +#define EFM_WAIT_CYCLE_5 (5U) /*!< Insert 5 read wait cycles */ +#define EFM_WAIT_CYCLE_6 (6U) /*!< Insert 6 read wait cycles */ +#define EFM_WAIT_CYCLE_7 (7U) /*!< Insert 7 read wait cycles */ +#define EFM_WAIT_CYCLE_8 (8U) /*!< Insert 8 read wait cycles */ +#define EFM_WAIT_CYCLE_9 (9U) /*!< Insert 9 read wait cycles */ +#define EFM_WAIT_CYCLE_10 (10U) /*!< Insert 10 read wait cycles */ +#define EFM_WAIT_CYCLE_11 (11U) /*!< Insert 11 read wait cycles */ +#define EFM_WAIT_CYCLE_12 (12U) /*!< Insert 12 read wait cycles */ +#define EFM_WAIT_CYCLE_13 (13U) /*!< Insert 13 read wait cycles */ +#define EFM_WAIT_CYCLE_14 (14U) /*!< Insert 14 read wait cycles */ +#define EFM_WAIT_CYCLE_15 (15U) /*!< Insert 15 read wait cycles */ +/** + * @} + */ + +/** + * @defgroup EFM_CacheRst_Func EFM data cache reset function + * @{ + */ +#define EFM_CACHERST_ON (EFM_FRMC_CRST) /*!< Enable data cache reset function */ +#define EFM_CACHERST_OFF (0x0UL) /*!< Disable data cache reset function */ +/** + * @} + */ + +/** + * @defgroup EFM_Prefetch_Func EFM prefetch function + * @{ + */ +#define EFM_PREFETCH_ON (EFM_FRMC_PREFE) /*!< Enable prefetch function */ +#define EFM_PREFETCH_OFF (0x0UL) /*!< Disable prefetch function */ +/** + * @} + */ + +/** + * @defgroup EFM_DCache_Func EFM data cache function + * @{ + */ +#define EFM_DATACACHE_ON (EFM_FRMC_DCACHE) /*!< Enable data cache function */ +#define EFM_DATACACHE_OFF (0x0UL) /*!< Disable data cache function */ +/** + * @} + */ + +/** + * @defgroup EFM_INSCache_Func EFM instruction cache function + * @{ + */ +#define EFM_INSCACHE_ON (EFM_FRMC_ICACHE) /*!< Enable instruction cache function */ +#define EFM_INSCACHE_OFF (0x0UL) /*!< Disable instruction cache function */ +/** + * @} + */ + +/** + * @defgroup EFM_LowVolRead_Mode EFM read of low-voltage mode + * @{ + */ +#define EFM_LOWVOLREAD_ON (EFM_FRMC_LVM) /*!< Read of low-voltage mode */ +#define EFM_LOWVOLREAD_OFF (0x0UL) +/** + * @} + */ + +/** + * @defgroup EFM_Key2Lock_Status EFM key2 lock status + * @{ + */ +#define EFM_KEY2_LOCK (EFM_FWMC_KEY2LOCK) +#define EFM_KEY2_UNLOCK (0x0UL) +/** + * @} + */ + +/** + * @defgroup EFM_Key1Lock_Status EFM key1 lock status + * @{ + */ +#define EFM_KEY1_LOCK (EFM_FWMC_KEY1LOCK) +#define EFM_KEY1_UNLOCK (0x0UL) +/** + * @} + */ + +/** + * @defgroup EFM_Bus_Status EFM Bus status while flash program or erase + * @{ + */ +#define EFM_BUS_BUSY (0x0UL) /*!< Bus busy while flash program or erase */ +#define EFM_BUS_RELEASE (EFM_FWMC_BUSHLDCTL) /*!< Bus release while flash program or erase */ +/** + * @} + */ + +/** + * @defgroup EFM_OperateMode_Definition EFM program or erase mode definition + * @{ + */ +#define EFM_MODE_PROGRAMSINGLE (0x1UL) /*!< Program single mode */ +#define EFM_MODE_PROGRAMREADBACK (0x2UL) /*!< Program and read back mode */ +#define EFM_MODE_PROGRAMSEQUENCE (0x3UL) /*!< Program sequence mode */ +#define EFM_MODE_ERASESECTOR (0x4UL) /*!< Sector erase mode */ +#define EFM_MODE_ERASECHIP1 (0x5UL) /*!< A flash Chip erase mode */ +#define EFM_MODE_ERASEFULL (0x6UL) /*!< Full erase mode */ +#define EFM_MODE_READONLY (0x0UL) /*!< Read only mode */ +/** + * @} + */ + +/** + * @defgroup EFM_Flag_definition EFM Flag definition + * @{ + */ +#define EFM_FLAG_OTPWERR0 (EFM_FSR_OTPWERR0) /*!< EFM Flash0 otp Programming/erase error flag. */ +#define EFM_FLAG_PRTWERR0 (EFM_FSR_PRTWERR0) /*!< EFM Flash0 write protect address error flag. */ +#define EFM_FLAG_PGSZERR0 (EFM_FSR_PGSZERR0) /*!< EFM Flash0 programming size error flag. */ +#define EFM_FLAG_MISMTCH0 (EFM_FSR_MISMTCH0) /*!< EFM Flash0 programming missing match error flag. */ +#define EFM_FLAG_OPTEND0 (EFM_FSR_OPTEND0) /*!< EFM Flash0 end of operation flag. */ +#define EFM_FLAG_CLOLERR0 (EFM_FSR_COLERR0) /*!< EFM Flash0 read collide error flag. */ +#define EFM_FLAG_RDY0 (EFM_FSR_RDY0) /*!< EFM Flash0 ready flag. */ +#define EFM_FLAG_PRTWERR1 (EFM_FSR_PRTWERR1) /*!< EFM Flash1 write protect address error flag. */ +#define EFM_FLAG_PGSZERR1 (EFM_FSR_PGSZERR1) /*!< EFM Flash1 programming size error flag. */ +#define EFM_FLAG_MISMTCH1 (EFM_FSR_MISMTCH1) /*!< EFM Flash1 programming missing match error flag. */ +#define EFM_FLAG_OPTEND1 (EFM_FSR_OPTEND1) /*!< EFM Flash1 end of operation flag. */ +#define EFM_FLAG_CLOLERR1 (EFM_FSR_COLERR1) /*!< EFM Flash1 read collide error flag. */ +#define EFM_FLAG_RDY1 (EFM_FSR_RDY1) /*!< EFM Flash1 ready flag. */ + +#define EFM_FLAG_CLR_OTPWERR0 (EFM_FSCLR_OTPWERRCLR0) /*!< EFM Clear Flash0 otp Programming/erase error flag. */ +#define EFM_FLAG_CLR_PRTWERR0 (EFM_FSCLR_PRTWERRCLR0) /*!< EFM Clear Flash0 write protect address error flag. */ +#define EFM_FLAG_CLR_PGSZERR0 (EFM_FSCLR_PGSZERRCLR0) /*!< EFM Clear Flash0 programming size error flag. */ +#define EFM_FLAG_CLR_MISMTCH0 (EFM_FSCLR_MISMTCHCLR0) /*!< EFM Clear Flash0 programming miss match error flag.*/ +#define EFM_FLAG_CLR_OPTEND0 (EFM_FSCLR_OPTENDCLR0) /*!< EFM Clear Flash0 end of operation flag. */ +#define EFM_FLAG_CLR_CLOLERR0 (EFM_FSCLR_COLERRCLR0) /*!< EFM Clear Flash0 read collide error flag. */ +#define EFM_FLAG_CLR_PRTWERR1 (EFM_FSCLR_PRTWERRCLR1) /*!< EFM Clear Flash1 write protect address error flag. */ +#define EFM_FLAG_CLR_PGSZERR1 (EFM_FSCLR_PGSZERRCLR1) /*!< EFM Clear Flash1 programming size error flag. */ +#define EFM_FLAG_CLR_MISMTCH1 (EFM_FSCLR_MISMTCHCLR1) /*!< EFM Clear Flash1 programming miss match error flag.*/ +#define EFM_FLAG_CLR_OPTEND1 (EFM_FSCLR_OPTENDCLR1) /*!< EFM Clear Flash1 end of operation flag. */ +#define EFM_FLAG_CLR_CLOLERR1 (EFM_FSCLR_COLERRCLR1) /*!< EFM Clear Flash1 read collide error flag. */ +/** + * @} + */ + +/** + * @defgroup EFM_Interrupt_definition EFM Interrupt definition + * @{ + */ +#define EFM_INT_PEERR (EFM_FITE_PEERRITE) /*!< Program/erase error Interrupt source */ +#define EFM_INT_OPTEND (EFM_FITE_OPTENDITE) /*!< End of EFM operation Interrupt source */ +#define EFM_INT_RDCOLERR (EFM_FITE_COLERRITE) /*!< Read collide error Interrupt source */ + +#define EFM_INT_MASK (EFM_FITE_PEERRITE | \ + EFM_FITE_OPTENDITE | \ + EFM_FITE_COLERRITE) /*!< Program/erase error and End of EFM operation \ + and Read collide error Interrupt source */ +/** + * @} + */ + +/** + * @defgroup EFM_WriteLock_Definition EFM Write protect lock definition + * @{ + */ +#define EFM_WRLOCK0 (EFM_WLOCK_WLOCK0) /*!< F0NWPRT0 controlled sector lock */ +#define EFM_WRLOCK1 (EFM_WLOCK_WLOCK1) /*!< F0NWPRT1 controlled sector lock */ +#define EFM_WRLOCK2 (EFM_WLOCK_WLOCK2) /*!< F0NWPRT2 controlled sector lock */ +#define EFM_WRLOCK3 (EFM_WLOCK_WLOCK3) /*!< F0NWPRT3 controlled sector lock */ +#define EFM_WRLOCK4 (EFM_WLOCK_WLOCK4) /*!< F1NWPRT0 controlled sector lock */ +#define EFM_WRLOCK5 (EFM_WLOCK_WLOCK5) /*!< F1NWPRT1 controlled sector lock */ +#define EFM_WRLOCK6 (EFM_WLOCK_WLOCK6) /*!< F1NWPRT2 controlled sector lock */ +#define EFM_WRLOCK7 (EFM_WLOCK_WLOCK7) /*!< F1NWPRT3 controlled sector lock */ +/** + * @} + */ + + +/** + * @defgroup EFM_Keys EFM Keys + * @{ + */ +#define EFM_SECRET_KEY1 (0x0123U) +#define EFM_SECRET_KEY2 (0x3210U) +/** + * @} + */ + +/** + * @defgroup EFM_Status EFM Status + * @{ + */ +#define EFM_FLASH0_ACT_FLASH1_ACT (0x00000000UL) /*!< Flash 0 and 1 activity */ +#define EFM_FLASH0_STP_FLASH1_ACT (0x00000001UL) /*!< Flash 0 stop,Flash 1 activity */ +#define EFM_FLASH0_ACT_FLASH1_STP (0x00000002UL) /*!< Flash 0 activity,Flash 1 stop */ +#define EFM_FLASH0_STP_FLASH1_STP (0x00000003UL) /*!< Flash 0 and 1 stop */ +/** + * @} + */ + +/** + * @defgroup EFM_ProtectReg_definition EFM Write protect for register definition + * @{ + */ +#define EFM_PROTECT_FWMC (0U) +#define EFM_PROTECT_OTP (1U) +/** + * @} + */ + + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup EFM_Global_Functions + * @{ + */ + +/** + * @brief EFM Protect Unlock. + * @param None + * @retval None + */ + +__STATIC_INLINE void EFM_Unlock(void) +{ + WRITE_REG16(M4_EFM->FAPRT, EFM_SECRET_KEY1); + WRITE_REG16(M4_EFM->FAPRT, EFM_SECRET_KEY2); +} + +/** + * @brief EFM Protect Lock. + * @param None + * @retval None + */ +__STATIC_INLINE void EFM_Lock(void) +{ + WRITE_REG16(M4_EFM->FAPRT, 0x1111U); +} + +void EFM_FWMC_Unlock(void); +void EFM_FWMC_Lock(void); +void EFM_OTP_WP_Unlock(void); +void EFM_OTP_WP_Lock(void); + +void EFM_Cmd(uint32_t u32EfmStatus); +void EFM_SetWaitCycle(uint32_t u32WaitCycle); +void EFM_SetBusStatus(uint32_t u32Status); +void EFM_DataCacheCmd(en_functional_state_t enNewState); +void EFM_InsCacheCmd(en_functional_state_t enNewState); +void EFM_DataCacheRstCmd(en_functional_state_t enNewState); +void EFM_PrefetchCmd(en_functional_state_t enNewState); +void EFM_InterruptCmd(uint32_t u32EfmInt, en_functional_state_t enNewState); +void EFM_LowVolReadCmd(en_functional_state_t enNewState); +void EFM_SectorRegLock(uint32_t u32EfmRegLock); +void EFM_ClearFlag(uint32_t u32Flag); +void EFM_SectorCmd_Single(uint8_t u8SectorNum, en_functional_state_t enNewState); +en_result_t EFM_StructInit(stc_efm_cfg_t *pstcEfmCfg); +en_result_t EFM_Init(const stc_efm_cfg_t *pstcEfmCfg); +en_result_t EFM_SectorCmd_Sequential(uint32_t u32StartAddr, uint16_t u16SectorCnt, + en_functional_state_t enNewState); +en_result_t EFM_SingleProgram(uint32_t u32Addr, uint32_t u32Data); +en_result_t EFM_ProgramReadBack(uint32_t u32Addr, uint32_t u32Data); +en_result_t EFM_SequenceProgram(uint32_t u32Addr, uint32_t u32Len, const uint32_t *pu32Buf); +en_result_t EFM_SectorErase(uint32_t u32Addr); +en_result_t EFM_OTPLock(uint32_t u32Addr); +en_result_t EFM_ChipErase(uint32_t EraseMode, uint32_t u32Addr); +en_result_t EFM_SwapCmd(en_functional_state_t enNewState); +en_result_t EFM_SetOperateMode(uint32_t u32PgmMode); + +en_flag_status_t EFM_GetFlagStatus(uint32_t u32Flag); +void EFM_GetUID(stc_efm_unique_id_t *stcUID); +uint32_t EFM_GetCID(void); +/** + * @} + */ + +#endif /* DDL_EFM_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_EFM_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_emb.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_emb.h new file mode 100644 index 0000000000..0091cb9fff --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_emb.h @@ -0,0 +1,722 @@ +/** + ******************************************************************************* + * @file hc32f4a0_emb.h + * @brief This file contains all the functions prototypes of the EMB + * (Emergency Brake) driver library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Hongjh First version + 2020-07-07 Hongjh 1. Modify structure member comments for + stc_emb_monitor_port_t/stc_emb_monitor_tmr_pwm_t + 2. Replace the word Timer with TMR abbreviation + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_EMB_H__ +#define __HC32F4A0_EMB_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_EMB + * @{ + */ + +#if (DDL_EMB_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup EMB_Global_Types EMB Global Types + * @{ + */ + +/** + * @brief EMB monitor EMB port configuration + */ +typedef struct +{ + uint32_t u32PortSel; /*!< Enable or disable EMB detect port in control function + This parameter can be a value of EMB_Portx_Selection(x=1~4) */ + + uint32_t u32PortLevel; /*!< EMB detect port level + This parameter can be a value of EMB_Detect_Portx_Level(x=1~4) */ + + uint32_t u32PortFilterDiv; /*!< EMB port filter division + This parameter can be a value of EMB_Portx_Filter_Clock_Division(x=1~4) */ +} stc_emb_monitor_port_t; + +/** + * @brief EMB monitor TMR4 or TMR6 PWM configuration + */ +typedef struct +{ + uint32_t u32PwmSel; /*!< Enable or disable EMB detect TMR4/6 PWM x channel same phase function + This parameter can be a value of EMB_TMR4_PWM_x_Selection(x=U/V/W) or + EMB_TMR6_x_PWM_Selection(x=1~8) */ + + uint32_t u32PwmLevel; /*!< Detect TMR4/6 PWM x channel polarity level + This parameter can be a value of EMB_Detect_TMR4_PWM_x_Level(x=U/V/W) or + EMB_Detect_TMR6_x_PWM_Level(x=1~8) */ +} stc_emb_monitor_tmr_pwm_t; + +/** + * @brief EMB control TMR4 initialization configuration + */ +typedef struct +{ + uint32_t u32Cmp1; /*!< Enable or disable EMB detect CMP1 result function + This parameter can be a value of @ref EMB_CMP1_Selection */ + + uint32_t u32Cmp2; /*!< Enable or disable EMB detect CMP2 result function + This parameter can be a value of @ref EMB_CMP2_Selection */ + + uint32_t u32Cmp3; /*!< Enable or disable EMB detect CMP3 result function + This parameter can be a value of @ref EMB_CMP3_Selection */ + + uint32_t u32Cmp4; /*!< Enable or disable EMB detect CMP4 result function + This parameter can be a value of @ref EMB_CMP4_Selection */ + + uint32_t u32Osc; /*!< EMB detect OSC failure function + This parameter can be a value of @ref EMB_OSC_Stop_Selection */ + + stc_emb_monitor_port_t stcPort1; /*!< EMB detect port EMBIN1 function + This parameter details refer @ref stc_emb_monitor_port_t structure */ + + stc_emb_monitor_port_t stcPort2; /*!< EMB detect port EMBIN1 function + This parameter details refer @ref stc_emb_monitor_port_t structure */ + + stc_emb_monitor_port_t stcPort3; /*!< EMB detect port EMBIN1 function + This parameter details refer @ref stc_emb_monitor_port_t structure */ + + stc_emb_monitor_port_t stcPort4; /*!< EMB detect port EMBIN1 function + This parameter details refer @ref stc_emb_monitor_port_t structure */ + + stc_emb_monitor_tmr_pwm_t stcTmr4PwmU; /*!< EMB detect TMR4 function + This parameter details refer @ref stc_emb_monitor_tmr_pwm_t structure */ + + stc_emb_monitor_tmr_pwm_t stcTmr4PwmV; /*!< EMB detect TMR4 function + This parameter details refer @ref stc_emb_monitor_tmr_pwm_t structure */ + + stc_emb_monitor_tmr_pwm_t stcTmr4PwmW; /*!< EMB detect TMR4 function + This parameter details refer @ref stc_emb_monitor_tmr_pwm_t structure */ +} stc_emb_tmr4_init_t; + +/** + * @brief EMB control TMR6 initialization configuration + */ +typedef struct +{ + uint32_t u32Cmp1; /*!< Enable or disable EMB detect CMP1 result function + This parameter can be a value of @ref EMB_CMP1_Selection */ + + uint32_t u32Cmp2; /*!< Enable or disable EMB detect CMP2 result function + This parameter can be a value of @ref EMB_CMP2_Selection */ + + uint32_t u32Cmp3; /*!< Enable or disable EMB detect CMP3 result function + This parameter can be a value of @ref EMB_CMP3_Selection */ + + uint32_t u32Cmp4; /*!< Enable or disable EMB detect CMP4 result function + This parameter can be a value of @ref EMB_CMP4_Selection */ + + uint32_t u32Osc; /*!< EMB detect OSC failure function + This parameter can be a value of @ref EMB_OSC_Stop_Selection */ + + stc_emb_monitor_port_t stcPort1; /*!< EMB detect port EMBIN1 function + This parameter details refer @ref stc_emb_monitor_port_t structure */ + + stc_emb_monitor_port_t stcPort2; /*!< EMB detect port EMBIN1 function + This parameter details refer @ref stc_emb_monitor_port_t structure */ + + stc_emb_monitor_port_t stcPort3; /*!< EMB detect port EMBIN1 function + This parameter details refer @ref stc_emb_monitor_port_t structure */ + + stc_emb_monitor_port_t stcPort4; /*!< EMB detect port EMBIN1 function + This parameter details refer @ref stc_emb_monitor_port_t structure */ + + stc_emb_monitor_tmr_pwm_t stcTmr6_1; /*!< EMB detect TMR6 function + This parameter details refer @ref stc_emb_monitor_tmr_pwm_t structure */ + + stc_emb_monitor_tmr_pwm_t stcTmr6_2; /*!< EMB detect TMR6 function + This parameter details refer @ref stc_emb_monitor_tmr_pwm_t structure */ + + stc_emb_monitor_tmr_pwm_t stcTmr6_3; /*!< EMB detect TMR6 function + This parameter details refer @ref stc_emb_monitor_tmr_pwm_t structure */ + + stc_emb_monitor_tmr_pwm_t stcTmr6_4; /*!< EMB detect TMR6 function + This parameter details refer @ref stc_emb_monitor_tmr_pwm_t structure */ + + stc_emb_monitor_tmr_pwm_t stcTmr6_5; /*!< EMB detect TMR6 function + This parameter details refer @ref stc_emb_monitor_tmr_pwm_t structure */ + + stc_emb_monitor_tmr_pwm_t stcTmr6_6; /*!< EMB detect TMR6 function + This parameter details refer @ref stc_emb_monitor_tmr_pwm_t structure */ + + stc_emb_monitor_tmr_pwm_t stcTmr6_7; /*!< EMB detect TMR6 function + This parameter details refer @ref stc_emb_monitor_tmr_pwm_t structure */ + + stc_emb_monitor_tmr_pwm_t stcTmr6_8; /*!< EMB detect TMR6 function + This parameter details refer @ref stc_emb_monitor_tmr_pwm_t structure */ +} stc_emb_tmr6_init_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup EMB_Global_Macros EMB Global Macros + * @{ + */ + +/** + * @defgroup EMB_CMP1_Selection EMB CMP1 Selection + * @{ + */ +#define EMB_CMP1_DISABLE (0UL) +#define EMB_CMP1_ENABLE (EMB_CTL1_CMPEN_0) +/** + * @} + */ + +/** + * @defgroup EMB_CMP2_Selection EMB CMP2 Selection + * @{ + */ +#define EMB_CMP2_DISABLE (0UL) +#define EMB_CMP2_ENABLE (EMB_CTL1_CMPEN_1) +/** + * @} + */ + +/** + * @defgroup EMB_CMP3_Selection EMB CMP3 Selection + * @{ + */ +#define EMB_CMP3_DISABLE (0UL) +#define EMB_CMP3_ENABLE (EMB_CTL1_CMPEN_2) +/** + * @} + */ + +/** + * @defgroup EMB_CMP4_Selection EMB CMP4 Selection + * @{ + */ +#define EMB_CMP4_DISABLE (0UL) +#define EMB_CMP4_ENABLE (EMB_CTL1_CMPEN_3) +/** + * @} + */ + +/** + * @defgroup EMB_OSC_Stop_Selection EMB OSC Stop Selection + * @{ + */ +#define EMB_OSC_DISABLE (0UL) +#define EMB_OSC_ENABLE (EMB_CTL1_OSCSTPEN) +/** + * @} + */ + +/** + * @defgroup EMB_TMR4_PWM_W_Selection EMB TMR4 PWM W Selection + * @{ + */ +#define EMB_TMR4_PWM_W_DISABLE (0UL) +#define EMB_TMR4_PWM_W_ENABLE (EMB_CTL1_PWMSEN_0) +/** + * @} + */ + +/** + * @defgroup EMB_TMR4_PWM_V_Selection EMB TMR4 PWM V Selection + * @{ + */ +#define EMB_TMR4_PWM_V_DISABLE (0UL) +#define EMB_TMR4_PWM_V_ENABLE (EMB_CTL1_PWMSEN_1) +/** + * @} + */ + +/** + * @defgroup EMB_TMR4_PWM_U_Selection EMB TMR4 PWM U Selection + * @{ + */ +#define EMB_TMR4_PWM_U_DISABLE (0UL) +#define EMB_TMR4_PWM_U_ENABLE (EMB_CTL1_PWMSEN_2) +/** + * @} + */ + +/** + * @defgroup EMB_TMR6_1_PWM_Selection EMB TMR6_1 PWM Selection + * @{ + */ +#define EMB_TMR6_1_PWM_DISABLE (0UL) +#define EMB_TMR6_1_PWM_ENABLE (EMB_CTL1_PWMSEN_0) +/** + * @} + */ + +/** + * @defgroup EMB_TMR6_2_PWM_Selection EMB TMR6_2 PWM Selection + * @{ + */ +#define EMB_TMR6_2_PWM_DISABLE (0UL) +#define EMB_TMR6_2_PWM_ENABLE (EMB_CTL1_PWMSEN_1) +/** + * @} + */ + +/** + * @defgroup EMB_TMR6_3_PWM_Selection EMB TMR6_3 PWM Selection + * @{ + */ +#define EMB_TMR6_3_PWM_DISABLE (0UL) +#define EMB_TMR6_3_PWM_ENABLE (EMB_CTL1_PWMSEN_2) +/** + * @} + */ + +/** + * @defgroup EMB_TMR6_4_PWM_Selection EMB TMR6_4 PWM Selection + * @{ + */ +#define EMB_TMR6_4_PWM_DISABLE (0UL) +#define EMB_TMR6_4_PWM_ENABLE (EMB_CTL1_PWMSEN_3) +/** + * @} + */ + +/** + * @defgroup EMB_TMR6_5_PWM_Selection EMB TMR6_5 PWM Selection + * @{ + */ +#define EMB_TMR6_5_PWM_DISABLE (0UL) +#define EMB_TMR6_5_PWM_ENABLE (EMB_CTL1_PWMSEN_4) +/** + * @} + */ + +/** + * @defgroup EMB_TMR6_6_PWM_Selection EMB TMR6_6 PWM Selection + * @{ + */ +#define EMB_TMR6_6_PWM_DISABLE (0UL) +#define EMB_TMR6_6_PWM_ENABLE (EMB_CTL1_PWMSEN_5) +/** + * @} + */ + +/** + * @defgroup EMB_TMR6_7_PWM_Selection EMB TMR6_7 PWM Selection + * @{ + */ +#define EMB_TMR6_7_PWM_DISABLE (0UL) +#define EMB_TMR6_7_PWM_ENABLE (EMB_CTL1_PWMSEN_6) +/** + * @} + */ + +/** + * @defgroup EMB_TMR6_8_PWM_Selection EMB TMR6_8 PWM Selection + * @{ + */ +#define EMB_TMR6_8_PWM_DISABLE (0UL) +#define EMB_TMR6_8_PWM_ENABLE (EMB_CTL1_PWMSEN_7) +/** + * @} + */ + +/** + * @defgroup EMB_Port1_Selection EMB Port1 Selection + * @{ + */ +#define EMB_PORT1_ENABLE (EMB_CTL1_PORTINEN1) +#define EMB_PORT1_DISABLE (0UL) +/** + * @} + */ + +/** + * @defgroup EMB_Port2_Selection EMB Port2 Selection + * @{ + */ +#define EMB_PORT2_ENABLE (EMB_CTL1_PORTINEN2) +#define EMB_PORT2_DISABLE (0UL) +/** + * @} + */ + +/** + * @defgroup EMB_Port3_Selection EMB Port3 Selection + * @{ + */ +#define EMB_PORT3_ENABLE (EMB_CTL1_PORTINEN3) +#define EMB_PORT3_DISABLE (0UL) +/** + * @} + */ + +/** + * @defgroup EMB_Port4_Selection EMB Port4 Selection + * @{ + */ +#define EMB_PORT4_ENABLE (EMB_CTL1_PORTINEN2) +#define EMB_PORT4_DISABLE (0UL) +/** + * @} + */ + +/** + * @defgroup EMB_Detect_Port1_Level EMB Detect Port1 Level + * @{ + */ +#define EMB_DETECT_PORT1_LEVEL_HIGH (0UL) +#define EMB_DETECT_PORT1_LEVEL_LOW (EMB_CTL1_INVSEL1) +/** + * @} + */ + +/** + * @defgroup EMB_Detect_Port2_Level EMB Detect Port2 Level + * @{ + */ +#define EMB_DETECT_PORT2_LEVEL_HIGH (0UL) +#define EMB_DETECT_PORT2_LEVEL_LOW (EMB_CTL1_INVSEL2) +/** + * @} + */ + +/** + * @defgroup EMB_Detect_Port3_Level EMB Detect Port3 Level + * @{ + */ +#define EMB_DETECT_PORT3_LEVEL_HIGH (0UL) +#define EMB_DETECT_PORT3_LEVEL_LOW (EMB_CTL1_INVSEL3) +/** + * @} + */ + +/** + * @defgroup EMB_Detect_Port4_Level EMB Detect Port4 Level + * @{ + */ +#define EMB_DETECT_PORT4_LEVEL_HIGH (0UL) +#define EMB_DETECT_PORT4_LEVEL_LOW (EMB_CTL1_INVSEL4) +/** + * @} + */ + +/** + * @defgroup EMB_Detect_TMR4_PWM_W_Level EMB Detect TMR4 PWM W Level + * @{ + */ +#define EMB_DETECT_TMR4_PWM_W_BOTH_LOW (0UL) +#define EMB_DETECT_TMR4_PWM_W_BOTH_HIGH (EMB_CTL2_PWMLV_0) +/** + * @} + */ + +/** + * @defgroup EMB_Detect_TMR4_PWM_V_Level EMB Detect TMR4 PWM V Level + * @{ + */ +#define EMB_DETECT_TMR4_PWM_V_BOTH_LOW (0UL) +#define EMB_DETECT_TMR4_PWM_V_BOTH_HIGH (EMB_CTL2_PWMLV_1) +/** + * @} + */ +/** + * @defgroup EMB_Detect_TMR4_PWM_U_Level EMB Detect TMR4 PWM U Level + * @{ + */ +#define EMB_DETECT_TMR4_PWM_U_BOTH_LOW (0UL) +#define EMB_DETECT_TMR4_PWM_U_BOTH_HIGH (EMB_CTL2_PWMLV_2) +/** + * @} + */ + +/** + * @defgroup EMB_Detect_TMR6_1_PWM_Level EMB Detect TMR6_1 PWM Level + * @{ + */ +#define EMB_DETECT_TMR6_1_PWM_BOTH_LOW (0UL) +#define EMB_DETECT_TMR6_1_PWM_BOTH_HIGH (EMB_CTL2_PWMLV_0) +/** + * @} + */ + +/** + * @defgroup EMB_Detect_TMR6_2_PWM_Level EMB Detect TMR6_2 PWM Level + * @{ + */ +#define EMB_DETECT_TMR6_2_PWM_BOTH_LOW (0UL) +#define EMB_DETECT_TMR6_2_PWM_BOTH_HIGH (EMB_CTL2_PWMLV_1) +/** + * @} + */ + +/** + * @defgroup EMB_Detect_TMR6_3_PWM_Level EMB Detect TMR6_3 PWM Level + * @{ + */ +#define EMB_DETECT_TMR6_3_PWM_BOTH_LOW (0UL) +#define EMB_DETECT_TMR6_3_PWM_BOTH_HIGH (EMB_CTL2_PWMLV_2) +/** + * @} + */ + +/** + * @defgroup EMB_Detect_TMR6_4_PWM_Level EMB Detect TMR6_4 PWM Level + * @{ + */ +#define EMB_DETECT_TMR6_4_PWM_BOTH_LOW (0UL) +#define EMB_DETECT_TMR6_4_PWM_BOTH_HIGH (EMB_CTL2_PWMLV_3) +/** + * @} + */ + +/** + * @defgroup EMB_Detect_TMR6_5_PWM_Level EMB Detect TMR6_5 PWM Level + * @{ + */ +#define EMB_DETECT_TMR6_5_PWM_BOTH_LOW (0UL) +#define EMB_DETECT_TMR6_5_PWM_BOTH_HIGH (EMB_CTL2_PWMLV_4) +/** + * @} + */ + +/** + * @defgroup EMB_Detect_TMR6_6_PWM_Level EMB Detect TMR6_6 PWM Level + * @{ + */ +#define EMB_DETECT_TMR6_6_PWM_BOTH_LOW (0UL) +#define EMB_DETECT_TMR6_6_PWM_BOTH_HIGH (EMB_CTL2_PWMLV_5) +/** + * @} + */ + +/** + * @defgroup EMB_Detect_TMR6_7_PWM_Level EMB Detect TMR6_7 PWM Level + * @{ + */ +#define EMB_DETECT_TMR6_7_PWM_BOTH_LOW (0UL) +#define EMB_DETECT_TMR6_7_PWM_BOTH_HIGH (EMB_CTL2_PWMLV_6) +/** + * @} + */ + +/** + * @defgroup EMB_Detect_TMR6_8_PWM_Level EMB Detect TMR6_8 PWM Level + * @{ + */ +#define EMB_DETECT_TMR6_8_PWM_BOTH_LOW (0UL) +#define EMB_DETECT_TMR6_8_PWM_BOTH_HIGH (EMB_CTL2_PWMLV_7) +/** + * @} + */ + +/** @defgroup EMB_Port1_Filter_Clock_Division EMB Port1 Filter Clock Division + * @{ + */ +#define EMB_PORT1_FILTER_NONE (0UL) +#define EMB_PORT1_FILTER_CLK_DIV1 (EMB_CTL2_NFEN1) +#define EMB_PORT1_FILTER_CLK_DIV8 (EMB_CTL2_NFEN1 | EMB_CTL2_NFSEL1_0) +#define EMB_PORT1_FILTER_CLK_DIV32 (EMB_CTL2_NFEN1 | EMB_CTL2_NFSEL1_1) +#define EMB_PORT1_FILTER_CLK_DIV128 (EMB_CTL2_NFEN1 | EMB_CTL2_NFSEL1) +/** + * @} + */ + +/** @defgroup EMB_Port2_Filter_Clock_Division EMB Port2 Filter Clock Division + * @{ + */ +#define EMB_PORT2_FILTER_NONE (0UL) +#define EMB_PORT2_FILTER_CLK_DIV1 (EMB_CTL2_NFEN2) +#define EMB_PORT2_FILTER_CLK_DIV8 (EMB_CTL2_NFEN2 | EMB_CTL2_NFSEL2_0) +#define EMB_PORT2_FILTER_CLK_DIV32 (EMB_CTL2_NFEN2 | EMB_CTL2_NFSEL2_1) +#define EMB_PORT2_FILTER_CLK_DIV128 (EMB_CTL2_NFEN2 | EMB_CTL2_NFSEL2) +/** + * @} + */ + +/** @defgroup EMB_Port3_Filter_Clock_Division EMB Port3 Filter Clock Division + * @{ + */ +#define EMB_PORT3_FILTER_NONE (0UL) +#define EMB_PORT3_FILTER_CLK_DIV1 (EMB_CTL2_NFEN3) +#define EMB_PORT3_FILTER_CLK_DIV8 (EMB_CTL2_NFEN3 | EMB_CTL2_NFSEL3_0) +#define EMB_PORT3_FILTER_CLK_DIV32 (EMB_CTL2_NFEN3 | EMB_CTL2_NFSEL3_1) +#define EMB_PORT3_FILTER_CLK_DIV128 (EMB_CTL2_NFEN3 | EMB_CTL2_NFSEL3) +/** + * @} + */ + +/** @defgroup EMB_Port4_Filter_Clock_Division EMB Port4 Filter Clock Division + * @{ + */ +#define EMB_PORT4_FILTER_NONE (0UL) +#define EMB_PORT4_FILTER_CLK_DIV1 (EMB_CTL2_NFEN4) +#define EMB_PORT4_FILTER_CLK_DIV8 (EMB_CTL2_NFEN4 | EMB_CTL2_NFSEL4_0) +#define EMB_PORT4_FILTER_CLK_DIV32 (EMB_CTL2_NFEN4 | EMB_CTL2_NFSEL4_1) +#define EMB_PORT4_FILTER_CLK_DIV128 (EMB_CTL2_NFEN4 | EMB_CTL2_NFSEL4) +/** + * @} + */ + +/** + * @defgroup EMB_Flag EMB Flag + * @{ + */ +#define EMB_FLAG_PWMS (EMB_STAT_PWMSF) +#define EMB_FLAG_CMP (EMB_STAT_CMPF) +#define EMB_FLAG_OSC (EMB_STAT_OSF) +#define EMB_FLAG_PORT1 (EMB_STAT_PORTINF1) +#define EMB_FLAG_PORT2 (EMB_STAT_PORTINF2) +#define EMB_FLAG_PORT3 (EMB_STAT_PORTINF3) +#define EMB_FLAG_PORT4 (EMB_STAT_PORTINF4) +/** + * @} + */ + +/** + * @defgroup EMB_State EMB State + * @{ + */ +#define EMB_STATE_PWMS (EMB_STAT_PWMST) +#define EMB_STATE_CMP (EMB_STAT_CMPST) +#define EMB_STATE_OSC (EMB_STAT_OSST) +#define EMB_STATE_PORT1 (EMB_STAT_PORTINST1) +#define EMB_STATE_PORT2 (EMB_STAT_PORTINST2) +#define EMB_STATE_PORT3 (EMB_STAT_PORTINST3) +#define EMB_STATE_PORT4 (EMB_STAT_PORTINST4) +/** + * @} + */ + +/** + * @defgroup EMB_Interrupt EMB Interrupt + * @{ + */ +#define EMB_INT_PWMS (EMB_INTEN_PWMSINTEN) +#define EMB_INT_CMP (EMB_INTEN_CMPINTEN) +#define EMB_INT_OSC (EMB_INTEN_OSINTEN) +#define EMB_INT_PORT1 (EMB_INTEN_PORTINTEN1) +#define EMB_INT_PORT2 (EMB_INTEN_PORTINTEN2) +#define EMB_INT_PORT3 (EMB_INTEN_PORTINTEN3) +#define EMB_INT_PORT4 (EMB_INTEN_PORTINTEN4) +/** + * @} + */ + +/** + * @defgroup EMB_Release_TMR_PWM_Selection EMB Release TMR PWM Selection + * @{ + */ +#define EMB_RELEASE_PWM_SEL_FLAG_ZERO (0UL) +#define EMB_RELEASE_PWM_SEL_STATE_ZERO (1UL) +/** + * @} + */ + +/** + * @defgroup EMB_Monitor_Event EMB Monitor Event + * @{ + */ +#define EMB_EVENT_PWMS (EMB_RLSSEL_PWMRSEL) +#define EMB_EVENT_CMP (EMB_RLSSEL_CMPRSEL) +#define EMB_EVENT_OSC (EMB_RLSSEL_OSRSEL) +#define EMB_EVENT_PORT1 (EMB_RLSSEL_PORTINRSEL1) +#define EMB_EVENT_PORT2 (EMB_RLSSEL_PORTINRSEL2) +#define EMB_EVENT_PORT3 (EMB_RLSSEL_PORTINRSEL3) +#define EMB_EVENT_PORT4 (EMB_RLSSEL_PORTINRSEL4) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup EMB_Global_Functions + * @{ + */ +en_result_t EMB_Tmr4Init(M4_EMB_TypeDef *EMBx, + const stc_emb_tmr4_init_t *pstcInit); +en_result_t EMB_Tmr4StructInit(stc_emb_tmr4_init_t *pstcInit); +en_result_t EMB_Tmr6Init(M4_EMB_TypeDef *EMBx, + const stc_emb_tmr6_init_t *pstcInit); +en_result_t EMB_Tmr6StructInit(stc_emb_tmr6_init_t *pstcInit); +void EMB_DeInit(M4_EMB_TypeDef *EMBx); +void EMB_IntCmd(M4_EMB_TypeDef *EMBx, + uint32_t u32IntSource, + en_functional_state_t enNewState); +void EMB_SetReleasePwmMode(M4_EMB_TypeDef *EMBx, + uint32_t u32Event, + uint32_t u32Mode); +en_flag_status_t EMB_GetFlag(const M4_EMB_TypeDef *EMBx, uint32_t u32Flag); +void EMB_ClearFlag(M4_EMB_TypeDef *EMBx, uint32_t u32Flag); +en_flag_status_t EMB_GetStatus(const M4_EMB_TypeDef *EMBx, + uint32_t u32Status); +void EMB_SwBrake(M4_EMB_TypeDef *EMBx, en_functional_state_t enNewState); + +/** + * @} + */ + +#endif /* DDL_EMB_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_EMB_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_eth.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_eth.h new file mode 100644 index 0000000000..0a127f79b2 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_eth.h @@ -0,0 +1,2506 @@ +/** + ******************************************************************************* + * @file hc32f4a0_eth.h + * @brief This file contains all the Macro Definitions of the ETH driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Yangjp First version + 2020-07-03 Yangjp Optimize stc_eth_mac_init_t structure + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_ETH_H__ +#define __HC32F4A0_ETH_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_ETH + * @{ + */ + +#if (DDL_ETH_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup ETH_Global_Types ETH Global Types + * @{ + */ + +/** + * @brief ETH Common Initialization Structure Definition + */ +typedef struct +{ + uint16_t u16AutoNegotiation; /*!< Specifies the Auto Negotiation mode for the external PHY. + This parameter can be a value of @ref ETH_Auto_Negotiation */ + + uint16_t u16PHYAddress; /*!< Specifies the Ethernet PHY address. + This parameter must be a number between Min_Data = 0 and Max_Data = 31 */ + + uint8_t au8MACAddr[6]; /*!< Specifies the MAC Address of used Hardware */ + + uint32_t u32MediaInterface; /*!< Specifies the media interface. + This parameter can be a value of @ref ETH_Media_Interface */ + + uint32_t u32Speed; /*!< Specifies the Ethernet speed. + This parameter can be a value of @ref ETH_Speed */ + + uint32_t u32DuplexMode; /*!< Specifies the MAC duplex mode. + This parameter can be a value of @ref ETH_Duplex_Mode */ + + uint32_t u32ChecksumMode; /*!< Specifies the checksum check by hardware or by software. + This parameter can be a value of @ref ETH_Checksum_Mode */ + + uint32_t u32RxMode; /*!< Specifies the Ethernet Rx mode. + This parameter can be a value of @ref ETH_Rx_Mode */ +} stc_eth_comm_init_t; + +/** + * @brief ETH MAC Initialization Structure Definition + */ +typedef struct +{ + uint32_t u32TxClkPolarity; /*!< Specifies the Tx clock polarity. + This parameter can be a value of @ref ETH_TX_CLK_POLARITY */ + + uint32_t u32RxRefClkPolarity; /*!< Specifies the Rx/Ref clock polarity. + This parameter can be a value of @ref ETH_RX_REF_CLK_POLARITY */ + + uint32_t u32SAInsertMode; /*!< Specifies the Source Address Insert or Replace Mode. + This parameter can be a value of @ref ETH_SA_Insert_Mode */ + + uint32_t u32TypeFrameStripFCS; /*!< Specifies the validity of stripping FCS for type frame. + This parameter can be a value of @ref ETH_TypeFrame_Strip_FCS */ + + uint32_t u32Watchdog; /*!< Specifies the validity of the Watchdog timer. + This parameter can be a value of @ref ETH_Watchdog */ + + uint32_t u32Jabber; /*!< Specifies the validity of the Jabber timer. + This parameter can be a value of @ref ETH_Jabber */ + + uint32_t u32InterFrameGap; /*!< Specifies the minimum gap between frames during transmission. + This parameter can be a value of @ref ETH_Inter_Frame_Gap */ + + uint32_t u32CarrierSense; /*!< Specifies the validity of the Carrier Sense (Half-Duplex mode). + This parameter can be a value of @ref ETH_Carrier_Sense */ + + uint32_t u32ReceiveOwn; /*!< Specifies the validity of the Receive Own (Half-Duplex mode). + This parameter can be a value of @ref ETH_Receive_Own */ + + uint32_t u32ChecksumOffload; /*!< Specifies the validity of the IPv4 checksum Offload. + This parameter can be a value of @ref ETH_Checksum_Offload */ + + uint32_t u32RetryTransmit; /*!< Specifies the validity of the MAC attempt to retry Transmit (Half-Duplex mode). + This parameter can be a value of @ref ETH_Retry_Transmit */ + + uint32_t u32AutoStripPadFCS; /*!< Specifies the validity of the Automatic Stripping Pad/FCS of MAC. + This parameter can be a value of @ref ETH_Auto_Strip_Pad_FCS */ + + uint32_t u32BackOffLimit; /*!< Specifies the BackOff limit value (Half-Duplex mode). + This parameter can be a value of @ref ETH_Back_Off_Limit */ + + uint32_t u32DeferralCheck; /*!< Specifies the validity of the deferral check (Half-Duplex mode). + This parameter can be a value of @ref ETH_Deferral_Check */ + + uint16_t u16PauseTime; /*!< Specifies the Pause Time in the transmit control frame. + This parameter must be a number between Min_Data = 0x0 and Max_Data = 0xFFFF */ + + uint32_t u32ZeroQuantaPause; /*!< Specifies the validity of the automatic generation Zero-Quanta Pause Control frame. + This parameter can be a value of @ref ETH_Zero_Quanta_Pause */ + + uint32_t u32PauseLowThreshold; /*!< Specifies the PAUSE Frame threshold. + This parameter can be a value of @ref ETH_Pause_Low_Threshold */ + + uint32_t u32UnicastPauseFrameDetect; /*!< Specifies the validity of the detection unicast Pause frame. + This parameter can be a value of @ref ETH_Unicast_Pause_Frame_Detect */ + + uint32_t u32ReceiveFlowControl; /*!< Specifies the validity of the decoding function that receive Pause frame. + This parameter can be a value of @ref ETH_Receive_Flow_Control */ + + uint32_t u32TransmitFlowControl; /*!< Specifies the validity of the MAC transmit Pause frame (Full-Duplex mode) or the MAC back-pressure operation (Half-Duplex mode). + This parameter can be a value of @ref ETH_Transmit_Flow_Control */ + + uint32_t u32ReceiveAll; /*!< Specifies the validity of the all frames reception by the MAC (No filtering). + This parameter can be a value of @ref ETH_Receive_All */ + + uint32_t u32DropNotTcpUdp; /*!< Specifies the validity of Dropping all IP datagram without TCP/UDP field. + This parameter can be a value of @ref ETH_Drop_Not_TcpUdp */ + + uint32_t u32VlanTagFilter; /*!< Specifies the validity of the VLAN Tag Filter. + This parameter can be a value of @ref ETH_VLAN_Tag_Filter */ + + uint32_t u32SAFilter; /*!< Specifies the Source Address Filter mode. + This parameter can be a value of @ref ETH_Source_Addr_Filter */ + + uint32_t u32PassControlFrame; /*!< Specifies the forwarding mode of the control frame. + This parameter can be a value of @ref ETH_Pass_Control_Frame */ + + uint32_t u32BroadcastFrameReception; /*!< Specifies the validity of the reception Broadcast Frame. + This parameter can be a value of @ref ETH_Broadcast_Frame_Reception */ + + uint32_t u32DAFilter; /*!< Specifies the destination filter mode for both unicast and multicast frame. + This parameter can be a value of @ref ETH_Destination_Addr_Filter */ + + uint32_t u32MulticastFrameFilter; /*!< Specifies the Multicast Frame filter mode. + This parameter can be a value of @ref ETH_Multicast_Frame_Filter */ + + uint32_t u32UnicastFrameFilter; /*!< Specifies the Unicast Frame filter mode. + This parameter can be a value of @ref ETH_Unicast_Frame_Filter */ + + uint32_t u32PromiscuousMode; /*!< Specifies the validity of the Promiscuous Mode. + This parameter can be a value of @ref ETH_Promiscuous_Mode */ + + uint32_t u32HashTableHigh; /*!< Specifies the higher 32 bits of Hash table. + This parameter must be a number between Min_Data = 0x0 and Max_Data = 0xFFFFFFFF */ + + uint32_t u32HashTableLow; /*!< Specifies the lower 32 bits of Hash table. + This parameter must be a number between Min_Data = 0x0 and Max_Data = 0xFFFFFFFF */ + + uint32_t u32TxVlanInsertMode; /*!< Specifies the VLAN insert mode in Transmit frame. + This parameter can be a value of @ref ETH_Tx_VLAN_Insert_Mode */ + + uint16_t u16TxVlanTag; /*!< Specifies the VLAN tag value. + This parameter must be a number between Min_Data = 0x0 and Max_Data = 0xFFFF */ + + uint32_t u32RxVlanFilter; /*!< Specifies the VLAN filter mode in Receive frame. + This parameter can be a value of @ref ETH_Rx_VLAN_Filter */ + + uint32_t u32RxVlanComparison; /*!< Specifies the bits for comparison VLAN tag. + This parameter can be a value of @ref ETH_Rx_VLAN_Comparison */ + + uint16_t u16RxVlanTag; /*!< Specifies the VLAN tag value. + This parameter must be a number between Min_Data = 0x0 and Max_Data = 0xFFFF */ + + uint16_t u16RxVlanHashTable; /*!< Specifies the lower 16 bits of VLAN Hash table. + This parameter must be a number between Min_Data = 0x0 and Max_Data = 0xFFFF */ +} stc_eth_mac_init_t; + +/** + * @brief ETH DMA Initialization Structure Definition + */ +typedef struct +{ + uint32_t u32BurstMode; /*!< Specifies the AHB Master interface burst transmission Mode. + This parameter can be a value of @ref ETH_Burst_Mode */ + + uint32_t u32AddressAlign; /*!< Specifies the validity of the Address Align. + This parameter can be a value of @ref ETH_Address_Align */ + + uint32_t u32RxDMABurstLength; /*!< Specifies the maximum number of beats to be transferred in one Rx DMA transaction. + This parameter can be a value of @ref ETH_Rx_DMA_Burst_Length */ + + uint32_t u32TxDMABurstLength; /*!< Specifies the maximum number of beats to be transferred in one Tx DMA transaction. + This parameter can be a value of @ref ETH_Tx_DMA_Burst_Length */ + + uint32_t u32EnhanceDescriptor; /*!< Specifies the validity of the enhance descriptor format. + This parameter can be a value of @ref ETH_DMA_Enhance_Descriptor */ + + uint32_t u32DescriptorSkipLength; /*!< Specifies the number of word to skip between two unchain descriptors (Ring mode) + This parameter must be a number between Min_Data = 0 and Max_Data = 31 */ + + uint32_t u32DMAArbitration; /*!< Specifies the DMA Tx/Rx arbitration. + This parameter can be a value of @ref ETH_DMA_Arbitration */ + + uint32_t u32DropChecksumErrorFrame; /*!< Specifies the validity of Dropping TCP/IP Checksum Error Frame. + This parameter can be a value of @ref ETH_Drop_TCPIP_Checksum_Error_Frame */ + + uint32_t u32ReceiveStoreForward; /*!< Specifies the validity of the Receive store and forward mode. + This parameter can be a value of @ref ETH_Receive_Store_Forward */ + + uint32_t u32FlushReceiveFrame; /*!< Specifies the validity of the flushing receive frame. + This parameter can be a value of @ref ETH_Flush_Receive_Frame */ + + uint32_t u32TransmitStoreForward; /*!< Specifies the validity of the Transmit store and forward mode. + This parameter can be a value of @ref ETH_Transmit_Store_Forward */ + + uint32_t u32TransmitThreshold; /*!< Specifies the Transmit Threshold. + This parameter can be a value of @ref ETH_Transmit_Threshold */ + + uint32_t u32ForwardErrorFrame; /*!< Specifies the validity of the forward erroneous frame. + This parameter can be a value of @ref ETH_Forward_Error_Frame */ + + uint32_t u32ForwardUndersizeGoodFrame; /*!< Specifies the validity of the Rx FIFO to forward Undersize frame. + This parameter can be a value of @ref ETH_Forward_Undersize_Good_Frame */ + + uint32_t u32DropJumboFrame; /*!< Specifies the validity of Dropping jumbo Frame. + This parameter can be a value of @ref ETH_Drop_Jumbo_Frame */ + + uint32_t u32ReceiveThreshold; /*!< Specifies the threshold level of the Receive FIFO. + This parameter can be a value of @ref ETH_Receive_Threshold */ + + uint32_t u32SecondFrameOperate; /*!< Specifies the validity of the Operate on second frame mode. + This parameter can be a value of @ref ETH_Second_Frame_Operate */ +} stc_eth_dma_init_t; + +/** + * @brief ETH MMC Initialization Structure Definition + */ +typedef struct +{ + uint32_t u32PresetMode; /*!< Specifies the MMC Counter preset mode. + This parameter can be a value of @ref ETH_MMC_Counter_Preset_Mode */ + + uint32_t u32ReadReset; /*!< Specifies the validity of the MMC Reset on read. + This parameter can be a value of @ref ETH_MMC_Read_Reset */ + + uint32_t u32ReloadMode; /*!< Specifies the validity of the MMC Counter reload. + This parameter can be a value of @ref ETH_MMC_Counter_Reload */ +} stc_eth_mmc_init_t; + +/** + * @brief ETH PTP Initialization Structure Definition + */ +typedef struct +{ + uint32_t u32DAFilter; /*!< Specifies the validity of the DA filter for the PTP frame. + This parameter can be a value of @ref ETH_PTP_Frame_DA_Filter */ + + uint32_t u32SnapDatagramType; /*!< Specifies the PTP snapshot datagram type. + This parameter can be a value of @ref ETH_PTP_Snapshot_Datagram_Type */ + + uint32_t u32SnapFrameType; /*!< Specifies the PTP snapshot frame type. + This parameter can be any combination of @ref ETH_PTP_Snapshot_Frame_Type */ + + uint32_t u32DatagramVersion; /*!< Specifies the PTP datagram version. + This parameter can be a value of @ref ETH_PTP_Datagram_Version */ + + uint32_t u32SubSecScale; /*!< Specifies the PTP Time Stamp subsecond scale. + This parameter can be a value of @ref ETH_PTP_Subsecond_Scale */ + + uint32_t u32CalibMode; /*!< Specifies the PTP Time Stamp calibration mode. + This parameter can be a value of @ref ETH_PTP_Calibration_Mode */ + + uint32_t u32IncValueBasic; /*!< Specifies the PTP Time Stamp Basic increase value. + This parameter must be a number between Min_Data = 0x0 and Max_Data = 0xFFFFFFFF */ + + uint8_t u8IncValueSubSec; /*!< Specifies the PTP Time Stamp Subsecond increase value. + This parameter must be a number between Min_Data = 0x0 and Max_Data = 0xFF */ + + uint32_t u32InitValueSec; /*!< Specifies the PTP Time Stamp Second Initial value. + This parameter must be a number between Min_Data = 0x0 and Max_Data = 0xFFFFFFFF */ + + uint32_t u32InitValueSubSec; /*!< Specifies the PTP Time Stamp Subsecond Initial value. + This parameter must be a number between Min_Data = 0x0 and Max_Data = 0x7FFFFFFF */ +} stc_eth_ptp_init_t; + +/** + * @brief ETH PPS Configuration Structure Definition + */ +typedef struct +{ + uint32_t u32TargetTimeFunc; /*!< Specifies the arrival time trigger the function. + This parameter can be a value of @ref ETH_PPS_Target_Time_Function */ + + uint32_t u32OutputMode; /*!< Specifies the PPS output mode. + This parameter can be a value of @ref ETH_PPS_Output_Mode */ + + uint32_t u32OutputFreq; /*!< Specifies the PPS outout frequency. + This parameter can be any combination of @ref ETH_PPS_Output_Frequency */ + + uint32_t u32TargetTimeSec; /*!< Specifies the PPS Target Time for Second. + This parameter must be a number between Min_Data = 0x0 and Max_Data = 0xFFFFFFFF */ + + uint32_t u32TargetTimeSubSec; /*!< Specifies the PPS Target Time for Subsecond. + This parameter must be a number between Min_Data = 0x0 and Max_Data = 0x7FFFFFFF */ +} stc_eth_pps_config_t; + +/** + * @brief ETH DMA Descriptor Structure Definition + */ +typedef struct +{ + __IO uint32_t u32ControlStatus; /*!< Control and Status */ + uint32_t u32ControlBufferSize; /*!< Control and Buffer1, Buffer2 lengths */ + uint32_t u32Buffer1Addr; /*!< Buffer1 address pointer */ + uint32_t u32Buffer2NextDescAddr; /*!< Buffer2 or next descriptor address pointer */ + /*!< Enhance Ethernet DMA Descriptors */ + __IO uint32_t u32ExtendStatus; /*!< Extend status */ + uint32_t Reserved; /*!< Reserved */ + uint32_t u32TimeStampLow; /*!< Time Stamp Low value for transmit and receive */ + uint32_t u32TimeStampHigh; /*!< Time Stamp High value for transmit and receive */ +} stc_eth_dma_desc_t; + +/** + * @brief ETH DMA Received Frame Structure Definition + */ +typedef struct +{ + stc_eth_dma_desc_t *pstcFSDesc; /*!< First Segment Rx Desc */ + stc_eth_dma_desc_t *pstcLSDesc; /*!< Last Segment Rx Desc */ + uint32_t u32SegCount; /*!< Segment count */ + uint32_t u32Length; /*!< Frame length */ + uint32_t u32Buffer; /*!< Frame buffer */ +} stc_eth_dma_rx_frame_t; + +/** + * @brief ETH Initialization Structure Definition + */ +typedef struct +{ + stc_eth_mac_init_t stcMacInit; /*!< Ethernet MAC Initialization */ + stc_eth_dma_init_t stcDmaInit; /*!< Ethernet DMA Initialization */ +} stc_eth_init_t; + +/** + * @brief ETH Handle Structure Definition + */ +typedef struct +{ + stc_eth_comm_init_t stcCommInit; /*!< ETH Common Initialization */ + stc_eth_dma_desc_t *stcRxDesc; /*!< Rx descriptor to Get */ + stc_eth_dma_desc_t *stcTxDesc; /*!< Tx descriptor to Set */ + stc_eth_dma_rx_frame_t stcRxFrame; /*!< last Rx frame */ +} stc_eth_handle_t; + +/** + * @brief ETH MAC Address Configuration Structure Definition + */ +typedef struct +{ + uint32_t u32MacAddrFilter; /*!< Specifies the MAC Address filter mode. + This parameter can be a value of @ref ETH_MAC_Address_Filter */ + + uint32_t u32MacAddrMask; /*!< Specifies the MAC Address filter Mask. + This parameter can be a value of @ref ETH_MAC_Address_Filter_Mask */ + + uint8_t au8MACAddr[6]; /*!< Specifies the MAC Address of used Hardware */ +} stc_eth_mac_addr_config_t; + +/** + * @brief ETH L3L4 Filter Configuration Structure Definition + */ +typedef struct +{ + uint32_t u32L4DestPortFilter; /*!< Specifies the L4 Destination port filter mode. + This parameter can be a value of @ref ETH_L4_Dest_Port_Filter */ + + uint32_t u32L4SourcePortFilter; /*!< Specifies the L4 Source port filter mode. + This parameter can be a value of @ref ETH_L4_Source_Port_Filter */ + + uint32_t u32L4PortFilterProtocol; /*!< Specifies the L4 protocol for port filter operation. + This parameter can be a value of @ref ETH_L4_Port_Filter_Protocol */ + + uint32_t u32L3Ipv4DAFilterMask; /*!< Specifies the L3 Destination Address filter mask in IPv4. + This parameter can be a value of @ref ETH_L3_Dest_Addr_Filter_Mask */ + + uint32_t u32L3Ipv4SAFilterMask; /*!< Specifies the L3 Source Address filter Mask in IPv4. + This parameter can be a value of @ref ETH_L3_Source_Addr_Filter_Mask */ + + uint32_t u32L3Ipv6AddrFilterMask; /*!< Specifies the L3 Destination/Source Address filter Mask in IPv6. + This parameter can be a value of @ref ETH_L3_DA_SA_Filter_Mask */ + + uint32_t u32L3DAFilter; /*!< Specifies the L3 Destination Address filter mode. + This parameter can be a value of @ref ETH_L3_Dest_Addr_Filter */ + + uint32_t u32L3SAFilter; /*!< Specifies the L3 Source Address filter mode. + This parameter can be a value of @ref ETH_L3_Source_Addr_Filter */ + + uint32_t u32L3AddrFilterProtocol; /*!< Specifies the L3 protocol for address filter operation. + This parameter can be a value of @ref ETH_L3_Addr_Filter_Protocol */ + + uint16_t u16L4DestProtFilterValue; /*!< Specifies the L4 Destination port filter value. + This parameter must be a number between Min_Data = 0x0 and Max_Data = 0xFFFF */ + + uint16_t u16L4SourceProtFilterValue; /*!< Specifies the L4 Source port filter value. + This parameter must be a number between Min_Data = 0x0 and Max_Data = 0xFFFF */ + + uint32_t u32L3Ipv4DAFilterValue; /*!< Specifies the L3 Destination Address filter value in IPv4. + This parameter must be a number between Min_Data = 0x0 and Max_Data = 0xFFFFFFFF */ + + uint32_t u32L3Ipv4SAFilterValue; /*!< Specifies the L3 Source Address filter value in IPv4. + This parameter must be a number between Min_Data = 0x0 and Max_Data = 0xFFFFFFFF */ + + uint32_t au32L3Ipv6AddrFilterValue[4]; /*!< Specifies the L3 Destination/Source Address filter value in IPv6. + This parameter must be a number between Min_Data = 0x0 and Max_Data = 0xFFFFFFFF */ +} stc_eth_l3l4_filter_config_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup ETH_Global_Macros ETH Global Macros + * @{ + */ + +/** + * @defgroup ETH_Buffer_Define ETH Buffer Define + * @{ + */ +#define ETH_PACKET_MAX_SIZE (1524U) /*!< ETH_HEADER + ETH_EXTRA + ETH_VLAN_TAG + ETH_MAX_PAYLOAD + ETH_CRC */ +#define ETH_HEADER (14U) /*!< 6 byte Dest addr, 6 byte Src addr, 2 byte length/type */ +#define ETH_CRC (4U) /*!< Ethernet CRC */ +#define ETH_EXTRA (2U) /*!< Extra bytes in some cases */ +#define ETH_VLAN_TAG (4U) /*!< Optional 802.1Q VLAN Tag */ +#define ETH_MIN_PAYLOAD (46U) /*!< Ethernet minimum payload size */ +#define ETH_MAX_PAYLOAD (1500U) /*!< Ethernet maximum payload size */ +#define ETH_JUMBO_FRAME_PAYLOAD (9000U) /*!< Jumbo frame payload size */ + +/* In below are defined the size of one Ethernet driver transmit buffer ETH_TXBUF_SIZE + and the total count of the driver transmit buffers ETH_TXBUF_NUMBER. + + The configured value for ETH_TXBUF_SIZE and ETH_TXBUF_NUMBER are only provided as + example, they can be reconfigured in the application layer to fit the application + needs */ + +/* Configure the transmit buffer size for each Ethernet driver */ +#ifndef ETH_TXBUF_SIZE + #define ETH_TXBUF_SIZE ETH_PACKET_MAX_SIZE +#endif + +/* Configure the number of Ethernet driver transmit buffers (in a chained linked list)*/ +#ifndef ETH_TXBUF_NUMBER + #define ETH_TXBUF_NUMBER (5U) /* 5 Tx buffers of size ETH_TXBUF_SIZE */ +#endif + +/* In below are defined the size of one Ethernet driver receive buffer ETH_RXBUF_SIZE + and the total count of the driver receive buffers ETH_RXBUF_NUMBER. + + The configured value for ETH_RXBUF_SIZE and ETH_RXBUF_NUMBER are only provided as + example, they can be reconfigured in the application layer to fit the application + needs */ + +/* Configure the receive buffer size for each Ethernet driver */ +#ifndef ETH_RXBUF_SIZE + #define ETH_RXBUF_SIZE ETH_PACKET_MAX_SIZE +#endif + +/* Configure the number of Ethernet drive receive buffers (in a chained linked list)*/ +#ifndef ETH_RXBUF_NUMBER + #define ETH_RXBUF_NUMBER (5U) /* 5 Rx buffers of size ETH_RXBUF_SIZE */ +#endif + +/** + * @} + */ + +/** + * @defgroup ETH_DMA_TX_Descriptor ETH DMA TX Descriptor + * @{ + */ + +/* + Normal DMA Tx Descriptor + ----------------------------------------------------------------------------------------------- + TDES0 | OWN(31) | CTRL[30:26] | TTSE(25) | CTRL[24:18] | TTSS(17) | Status[16:0] | + ----------------------------------------------------------------------------------------------- + TDES1 | CTRL[31:29] | Buffer2 ByteCount[28:16] | Reserved[15:13] | Buffer1 ByteCount[12:0] | + ----------------------------------------------------------------------------------------------- + TDES2 | Buffer1 Address [31:0] | + ----------------------------------------------------------------------------------------------- + TDES3 | Buffer2 Address [31:0] / Next Descriptor Address [31:0] | + ----------------------------------------------------------------------------------------------- + */ + +/** + * @brief Bit definition of TDES0 register + */ +#define ETH_DMATXDESC_OWN (0x80000000UL) /*!< OWN bit */ +#define ETH_DMATXDESC_IOC (0x40000000UL) /*!< Interrupt on Completion */ +#define ETH_DMATXDESC_TLS (0x20000000UL) /*!< Transmit Last Segment */ +#define ETH_DMATXDESC_TFS (0x10000000UL) /*!< Transmit First Segment */ +#define ETH_DMATXDESC_DCRC (0x08000000UL) /*!< Disable CRC */ +#define ETH_DMATXDESC_DPAD (0x04000000UL) /*!< Disable Padding */ +#define ETH_DMATXDESC_TTSE (0x02000000UL) /*!< Transmit Time Stamp Enable */ +#define ETH_DMATXDESC_CRCR (0x01000000UL) /*!< CRC Replace Control */ +#define ETH_DMATXDESC_CIC (0x00C00000UL) /*!< Checksum Insertion Control: 4 cases */ +#define ETH_DMATXDESC_CIC_BYPASS (0x00000000UL) /*!< Do Nothing: Checksum Engine is bypassed */ +#define ETH_DMATXDESC_CIC_IPV4HEADER (0x00400000UL) /*!< IPV4 header Checksum Insertion */ +#define ETH_DMATXDESC_CIC_TCPUDPICMP_SEGMENT (0x00800000UL) /*!< TCP/UDP/ICMP Checksum Insertion calculated over segment only */ +#define ETH_DMATXDESC_CIC_TCPUDPICMP_FULL (0x00C00000UL) /*!< TCP/UDP/ICMP Checksum Insertion fully calculated */ +#define ETH_DMATXDESC_TER (0x00200000UL) /*!< Transmit End of Ring */ +#define ETH_DMATXDESC_TSAC (0x00100000UL) /*!< Second Address Chained */ +#define ETH_DMATXDESC_VLANC (0x000C0000UL) /*!< VLAN Insertion Control: 4 cases */ +#define ETH_DMATXDESC_VLANC_BYPASS (0x00000000UL) /*!< Do Nothing: VLAN Insertion is bypassed */ +#define ETH_DMATXDESC_VLANC_REMOVE_TAG (0x00040000UL) /*!< Remove Tag and Type fields in VLAN frame */ +#define ETH_DMATXDESC_VLANC_INSERT_TAG (0x00080000UL) /*!< Insert VLAN Tag value in ETH_MAC_VTACTLR Register into transmit frame */ +#define ETH_DMATXDESC_VLANC_REPLACE_TAG (0x000C0000UL) /*!< Replace VLAN tag value in transmit frame with VLAN tag value in ETH_MAC_VTACTLR register */ +#define ETH_DMATXDESC_TTSS (0x00020000UL) /*!< Tx Time Stamp Status */ +#define ETH_DMATXDESC_IHE (0x00010000UL) /*!< IP Header Error */ +#define ETH_DMATXDESC_ETSUM (0x00008000UL) /*!< Tx Error summary: OR of the following bits: IHE || JTE || FFF || TPCE || LOCE || NCE || TLCE || ECE || EDE || UDE */ +#define ETH_DMATXDESC_JTE (0x00004000UL) /*!< Jabber Timeout Error */ +#define ETH_DMATXDESC_FFF (0x00002000UL) /*!< Frame Flushed */ +#define ETH_DMATXDESC_TPCE (0x00001000UL) /*!< Payload Checksum Error */ +#define ETH_DMATXDESC_LOCE (0x00000800UL) /*!< Loss Carrier Error */ +#define ETH_DMATXDESC_NCE (0x00000400UL) /*!< No Carrier Error */ +#define ETH_DMATXDESC_TLCE (0x00000200UL) /*!< Late Collision Error */ +#define ETH_DMATXDESC_ECE (0x00000100UL) /*!< Excessive Collision Error */ +#define ETH_DMATXDESC_VLF (0x00000080UL) /*!< VLAN Frame */ +#define ETH_DMATXDESC_COC (0x00000078UL) /*!< Collision Count */ +#define ETH_DMATXDESC_EDE (0x00000004UL) /*!< Excessive Deferral Error */ +#define ETH_DMATXDESC_UDE (0x00000002UL) /*!< Underflow Error */ +#define ETH_DMATXDESC_DEE (0x00000001UL) /*!< Deferred Error */ + +/** + * @brief Bit definition of TDES1 register + */ +#define ETH_DMATXDESC_SAIRC (0xE0000000UL) /*!< Source Address Insertion or Replace Control: 5 cases */ +#define ETH_DMATXDESC_SAIRC_BYPASS (0x00000000UL) /*!< Do Nothing: Source Address Insertion or Replace Control is bypassed */ +#define ETH_DMATXDESC_SAIRC_INSTER_MACADDR0 (0x20000000UL) /*!< Insert address value in MAC address register 0 into transmit frame as SA address */ +#define ETH_DMATXDESC_SAIRC_REPLACE_MACADDR0 (0x40000000UL) /*!< Replace SA address in transmit frame with address value in MAC address register 0 */ +#define ETH_DMATXDESC_SAIRC_INSTER_MACADDR1 (0xA0000000UL) /*!< Insert address value in MAC address register 1 into transmit frame as SA address */ +#define ETH_DMATXDESC_SAIRC_REPLACE_MACADDR1 (0xC0000000UL) /*!< Replace SA address in transmit frame with address value in MAC address register 1 */ +#define ETH_DMATXDESC_TBS2 (0x1FFF0000UL) /*!< Transmit Buffer2 Size */ +#define ETH_DMATXDESC_TBS1 (0x00001FFFUL) /*!< Transmit Buffer1 Size */ + +/** + * @brief Bit definition of TDES2 register + */ +#define ETH_DMATXDESC_TBAP1 (0xFFFFFFFFUL) /*!< Buffer1 Address Pointer */ + +/** + * @brief Bit definition of TDES3 register + */ +#define ETH_DMATXDESC_TBAP2 (0xFFFFFFFFUL) /*!< Buffer2 Address Pointer */ + +/* + Enhance DMA Tx Descriptor + ----------------------------------------------------------------------------------------------- + TDES4 | Reserved[31:0] | + ----------------------------------------------------------------------------------------------- + TDES5 | Reserved[31:0] | + ----------------------------------------------------------------------------------------------- + TDES6 | Transmit Time Stamp Low [31:0] | + ----------------------------------------------------------------------------------------------- + TDES7 | Transmit Time Stamp High [31:0] | + ----------------------------------------------------------------------------------------------- + */ + +/** + * @brief Bit definition of TDES6 register + */ + #define ETH_DMATXDESC_TTSL (0xFFFFFFFFUL) /*!< Transmit Time Stamp Low */ + +/** + * @brief Bit definition of TDES7 register + */ + #define ETH_DMATXDESC_TTSH (0xFFFFFFFFUL) /*!< Transmit Time Stamp High */ + +/** + * @} + */ + +/** + * @defgroup ETH_DMA_RX_Descriptor ETH DMA RX Descriptor + * @{ + */ + +/* + Normal DMA Rx Descriptor + -------------------------------------------------------------------------------------------------------------------- + RDES0 | OWN(31) | Status [30:0] | + --------------------------------------------------------------------------------------------------------------------- + RDES1 | CTRL(31) | Reserved[30:29] | Buffer2 ByteCount[28:16] | CTRL[15:14] | Reserved(13) | Buffer1 ByteCount[12:0] | + --------------------------------------------------------------------------------------------------------------------- + RDES2 | Buffer1 Address [31:0] | + --------------------------------------------------------------------------------------------------------------------- + RDES3 | Buffer2 Address [31:0] / Next Descriptor Address [31:0] | + --------------------------------------------------------------------------------------------------------------------- +*/ + +/** + * @brief Bit definition of RDES0 register + */ +#define ETH_DMARXDESC_OWN (0x80000000UL) /*!< OWN bit */ +#define ETH_DMARXDESC_DAF (0x40000000UL) /*!< DA Filter Fail for the received frame */ +#define ETH_DMARXDESC_FRAL (0x3FFF0000UL) /*!< Receive frame length */ +#define ETH_DMARXDESC_ERSUM (0x00008000UL) /*!< Rx Error summary: OR of the following bits: DPE || OVE || IPE_TSPA_GF || RLCE || WTE || REE || CRE in RDES0, or IPPE || IPHE in RDES4 */ +#define ETH_DMARXDESC_DPE (0x00004000UL) /*!< Descriptor Error: no more descriptors for receive frame */ +#define ETH_DMARXDESC_SAF (0x00002000UL) /*!< SA Filter Fail for the received frame */ +#define ETH_DMARXDESC_LEE (0x00001000UL) /*!< Length Error: Frame size not matching with length field */ +#define ETH_DMARXDESC_OVE (0x00000800UL) /*!< Overflow Error: Frame was damaged due to buffer overflow */ +#define ETH_DMARXDESC_VLAT (0x00000400UL) /*!< VLAN Tag: received frame is a VLAN frame */ +#define ETH_DMARXDESC_RFS (0x00000200UL) /*!< First descriptor */ +#define ETH_DMARXDESC_RLS (0x00000100UL) /*!< Last descriptor */ +#define ETH_DMARXDESC_IPE_TSPA_GF (0x00000080UL) /*!< COE Error or Time stamp valid or jumbo frame */ +#define ETH_DMARXDESC_RLCE (0x00000040UL) /*!< Late collision Error */ +#define ETH_DMARXDESC_FRAT (0x00000020UL) /*!< Frame type: Ethernet or PTP */ +#define ETH_DMARXDESC_WTE (0x00000010UL) /*!< Receive Watchdog Timeout */ +#define ETH_DMARXDESC_REE (0x00000008UL) /*!< Receive error: error reported by PHY RX_ER */ +#define ETH_DMARXDESC_DBE (0x00000004UL) /*!< Dribble bit error: frame contains non int multiple of 8 bits */ +#define ETH_DMARXDESC_CRE (0x00000002UL) /*!< CRC error */ +#define ETH_DMARXDESC_DAS_ESA (0x00000001UL) /*!< MAC Address Filter/Status bit extension */ + +/** + * @brief Bit definition of RDES1 register + */ +#define ETH_DMARXDESC_DIC (0x80000000UL) /*!< Disable Interrupt on Completion */ +#define ETH_DMARXDESC_RBS2 (0x1FFF0000UL) /*!< Receive Buffer2 Size */ +#define ETH_DMARXDESC_RER (0x00008000UL) /*!< Receive End of Ring */ +#define ETH_DMARXDESC_RSAC (0x00004000UL) /*!< Second Address Chained */ +#define ETH_DMARXDESC_RBS1 (0x00001FFFUL) /*!< Receive Buffer1 Size */ + +/** + * @brief Bit definition of RDES2 register + */ +#define ETH_DMARXDESC_RBAP1 (0xFFFFFFFFUL) /*!< Buffer1 Address Pointer */ + +/** + * @brief Bit definition of RDES3 register + */ +#define ETH_DMARXDESC_RBAP2 (0xFFFFFFFFUL) /*!< Buffer2 Address Pointer */ + +/* + Enhance DMA Rx Descriptor + ----------------------------------------------------------------------------------------------- + RDES4 | Reserved[31:26] | Extend Status [25:24] | Reserved[23:15] | Extend Status [14:0] | + ----------------------------------------------------------------------------------------------- + RDES5 | Reserved[31:0] | + ----------------------------------------------------------------------------------------------- + RDES6 | Receive Time Stamp Low [31:0] | + ----------------------------------------------------------------------------------------------- + RDES7 | Receive Time Stamp High [31:0] | + ----------------------------------------------------------------------------------------------- +*/ + +/** + * @brief Bit definition of RDES4 register + */ +#define ETH_DMARXDESC_L4FMS (0x02000000UL) /*!< L4 Port Filter Status */ +#define ETH_DMARXDESC_L3FMS (0x01000000UL) /*!< L3 Address Filter Status */ +#define ETH_DMARXDESC_TSPD (0x00004000UL) /*!< Discard Time Stamp */ +#define ETH_DMARXDESC_PTPV (0x00002000UL) /*!< PTP Version */ +#define ETH_DMARXDESC_PTPFT (0x00001000UL) /*!< PTP Frame Type */ +#define ETH_DMARXDESC_MTP (0x00000F00UL) /*!< PTP Datagram Type */ +#define ETH_DMARXDESC_MTP_NONE (0x00000000UL) /*!< No PTP messages */ +#define ETH_DMARXDESC_MTP_SYNC (0x00000100UL) /*!< SYNC message (all clock types) */ +#define ETH_DMARXDESC_MTP_FOLLOWUP (0x00000200UL) /*!< Follow_Up message (all clock types) */ +#define ETH_DMARXDESC_MTP_DELAYREQ (0x00000300UL) /*!< Delay_Req message (all clock types) */ +#define ETH_DMARXDESC_MTP_DELAYRESP (0x00000400UL) /*!< Delay_Resp message (all clock types) */ +#define ETH_DMARXDESC_MTP_PDELAYREQ (0x00000500UL) /*!< Pdelay_Req message (peer-to-peer transparent clock) */ +#define ETH_DMARXDESC_MTP_PDELAYRESP (0x00000600UL) /*!< Pdelay_Resp message (peer-to-peer transparent clock) */ +#define ETH_DMARXDESC_MTP_PDELAYRESP_FOLLOWUP (0x00000700UL) /*!< Pdelay_Resp_Follow_Up message (peer-to-peer transparent clock) */ +#define ETH_DMARXDESC_MTP_ANNOUNCE (0x00000800UL) /*!< Announce message (Ordinary or Boundary clock) */ +#define ETH_DMARXDESC_MTP_MANAGEMENT (0x00000900UL) /*!< Management message (Ordinary or Boundary clock) */ +#define ETH_DMARXDESC_MTP_SIGNALING (0x00000A00UL) /*!< Signaling message (Ordinary or Boundary clock) */ +#define ETH_DMARXDESC_MTP_DEFAULT (0x00000F00UL) /*!< Default Datagram Type */ +#define ETH_DMARXDESC_IPV6DR (0x00000080UL) /*!< IPv6 Packet Received */ +#define ETH_DMARXDESC_IPV4DR (0x00000040UL) /*!< IPv4 Packet Received */ +#define ETH_DMARXDESC_IPCB (0x00000020UL) /*!< COE engine Bypassed */ +#define ETH_DMARXDESC_IPPE (0x00000010UL) /*!< IP Payload Error */ +#define ETH_DMARXDESC_IPHE (0x00000008UL) /*!< IP Header Error */ +#define ETH_DMARXDESC_IPPT (0x00000007UL) /*!< IP Payload Type: 4 cases */ +#define ETH_DMARXDESC_IPPT_UNKNOWN (0x00000000UL) /*!< Unknown */ +#define ETH_DMARXDESC_IPPT_UDP (0x00000001UL) /*!< UDP */ +#define ETH_DMARXDESC_IPPT_TCP (0x00000002UL) /*!< TCP */ +#define ETH_DMARXDESC_IPPT_ICMP (0x00000003UL) /*!< ICMP */ + +/** + * @brief Bit definition of RDES6 register + */ +#define ETH_DMARXDESC_RTSL (0xFFFFFFFFUL) /*!< Receive Time Stamp Low */ + +/** + * @brief Bit definition of RDES7 register + */ +#define ETH_DMARXDESC_RTSH (0xFFFFFFFFUL) /*!< Receive Time Stamp High */ + +/** + * @} + */ + +/** + * @defgroup ETH_Auto_Negotiation ETH Auto Negotiation + * @{ + */ +#define ETH_AUTO_NEGOTIATION_DISABLE (0x0000U) +#define ETH_AUTO_NEGOTIATION_ENABLE (0x0001U) +/** + * @} + */ + +/** + * @defgroup ETH_Media_Interface ETH Media Interface + * @{ + */ +#define ETH_MAC_MEDIA_INTERFACE_MII (0UL) +#define ETH_MAC_MEDIA_INTERFACE_RMII (ETH_MAC_IFCONFR_IFSEL) +/** + * @} + */ + +/** + * @defgroup ETH_Speed ETH Speed + * @{ + */ +#define ETH_MAC_SPEED_10M (0UL) +#define ETH_MAC_SPEED_100M (ETH_MAC_CONFIGR_FES) +/** + * @} + */ + +/** + * @defgroup ETH_Duplex_Mode ETH Duplex Mode + * @{ + */ +#define ETH_MAC_MODE_HALFDUPLEX (0UL) +#define ETH_MAC_MODE_FULLDUPLEX (ETH_MAC_CONFIGR_DM) +/** + * @} + */ + +/** + * @defgroup ETH_Checksum_Mode ETH Checksum Mode + * @{ + */ +#define ETH_MAC_CHECKSUM_MODE_SOFTWARE (0UL) +#define ETH_MAC_CHECKSUM_MODE_HARDWARE (0x00000001UL) +/** + * @} + */ + +/** + * @defgroup ETH_Rx_Mode ETH Rx Mode + * @{ + */ +#define ETH_RX_MODE_POLLING (0UL) +#define ETH_RX_MODE_INTERRUPT (0x00000001UL) +/** + * @} + */ + +/** + * @defgroup ETH_TX_CLK_POLARITY ETH TX Clock Polarity + * @{ + */ +#define ETH_MAC_TX_CLK_POLARITY_KEEP (0UL) +#define ETH_MAC_TX_CLK_POLARITY_INVERSE (ETH_MAC_IFCONFR_TCKINV) +/** + * @} + */ + +/** + * @defgroup ETH_RX_REF_CLK_POLARITY ETH RX/REF Clock Polarity + * @{ + */ +#define ETH_MAC_RX_REF_CLK_POLARITY_KEEP (0UL) +#define ETH_MAC_RX_REF_CLK_POLARITY_INVERSE (ETH_MAC_IFCONFR_RCKINV) +/** + * @} + */ + +/** + * @defgroup ETH_SA_Insert_Mode ETH SA Insert Mode + * @{ + */ +#define ETH_MAC_SA_MODE_BY_DMATXDESC (0UL) /*!< Configure the Insert mode by Tx Descriptor of DMA */ +#define ETH_MAC_SA_MODE_INSTER_MACADDR0 (ETH_MAC_CONFIGR_SAIRC_1) /*!< Insert address value in MAC address register 0 into transmit frame as SA address */ +#define ETH_MAC_SA_MODE_REPLACE_MACADDR0 (ETH_MAC_CONFIGR_SAIRC_1 | ETH_MAC_CONFIGR_SAIRC_0) /*!< Replace SA address in transmit frame with address value in MAC address register 0 */ +#define ETH_MAC_SA_MODE_INSTER_MACADDR1 (ETH_MAC_CONFIGR_SAIRC_2 | ETH_MAC_CONFIGR_SAIRC_1) /*!< Insert address value in MAC address register 1 into transmit frame as SA address */ +#define ETH_MAC_SA_MODE_REPLACE_MACADDR1 (ETH_MAC_CONFIGR_SAIRC) /*!< Replace SA address in transmit frame with address value in MAC address register 1 */ +/** + * @} + */ + +/** + * @defgroup ETH_TypeFrame_Strip_FCS ETH Type Frame Strip FCS + * @{ + */ +#define ETH_MAC_TYPEFRAME_STRIP_FCS_DISABLE (0UL) +#define ETH_MAC_TYPEFRAME_STRIP_FCS_ENABLE (ETH_MAC_CONFIGR_CST) +/** + * @} + */ + +/** + * @defgroup ETH_Watchdog ETH Watchdog + * @{ + */ +#define ETH_MAC_WATCHDOG_DISABLE (ETH_MAC_CONFIGR_MWD) +#define ETH_MAC_WATCHDOG_ENABLE (0UL) +/** + * @} + */ + +/** + * @defgroup ETH_Jabber ETH Jabber + * @{ + */ +#define ETH_MAC_JABBER_DISABLE (ETH_MAC_CONFIGR_MJB) +#define ETH_MAC_JABBER_ENABLE (0UL) +/** + * @} + */ + +/** + * @defgroup ETH_Inter_Frame_Gap ETH Inter Frame Gap + * @{ + */ +#define ETH_MAC_INTERFRAME_GAP_96BIT (0UL) +#define ETH_MAC_INTERFRAME_GAP_88BIT (ETH_MAC_CONFIGR_IFG_0) +#define ETH_MAC_INTERFRAME_GAP_80BIT (ETH_MAC_CONFIGR_IFG_1) +#define ETH_MAC_INTERFRAME_GAP_72BIT (ETH_MAC_CONFIGR_IFG_1 | ETH_MAC_CONFIGR_IFG_0) +#define ETH_MAC_INTERFRAME_GAP_64BIT (ETH_MAC_CONFIGR_IFG_2) +#define ETH_MAC_INTERFRAME_GAP_56BIT (ETH_MAC_CONFIGR_IFG_2 | ETH_MAC_CONFIGR_IFG_0) +#define ETH_MAC_INTERFRAME_GAP_48BIT (ETH_MAC_CONFIGR_IFG_2 | ETH_MAC_CONFIGR_IFG_1) +#define ETH_MAC_INTERFRAME_GAP_40BIT (ETH_MAC_CONFIGR_IFG) +/** + * @} + */ + +/** + * @defgroup ETH_Carrier_Sense ETH Carrier Sense + * @{ + */ +#define ETH_MAC_CARRIER_SENCE_DISABLE (ETH_MAC_CONFIGR_DCRS) +#define ETH_MAC_CARRIER_SENCE_ENABLE (0UL) +/** + * @} + */ + +/** + * @defgroup ETH_Receive_Own ETH Receive Own + * @{ + */ +#define ETH_MAC_RECEIVE_OWN_DISABLE (ETH_MAC_CONFIGR_DO) +#define ETH_MAC_RECEIVE_OWN_ENABLE (0UL) +/** + * @} + */ + +/** + * @defgroup ETH_Checksum_Offload ETH Checksum Offload + * @{ + */ +#define ETH_MAC_CHECKSUM_OFFLAOD_DISABLE (0UL) +#define ETH_MAC_CHECKSUM_OFFLAOD_ENABLE (ETH_MAC_CONFIGR_IPCO) +/** + * @} + */ + +/** + * @defgroup ETH_Retry_Transmit ETH Retry Transmit + * @{ + */ +#define ETH_MAC_RETRY_TRANSMIT_DISABLE (ETH_MAC_CONFIGR_DRTY) +#define ETH_MAC_RETRY_TRANSMIT_ENABLE (0UL) +/** + * @} + */ + +/** + * @defgroup ETH_Auto_Strip_Pad_FCS ETH Auto Strip Pad FCS + * @{ + */ +#define ETH_MAC_AUTO_STRIP_PAD_FCS_DISABLE (0UL) +#define ETH_MAC_AUTO_STRIP_PAD_FCS_ENABLE (ETH_MAC_CONFIGR_ACS) +/** + * @} + */ + +/** + * @defgroup ETH_Back_Off_Limit ETH Back Off Limit + * @{ + */ +#define ETH_MAC_BACKOFF_LIMIT_10 (0UL) +#define ETH_MAC_BACKOFF_LIMIT_8 (ETH_MAC_CONFIGR_BL_0) +#define ETH_MAC_BACKOFF_LIMIT_4 (ETH_MAC_CONFIGR_BL_1) +#define ETH_MAC_BACKOFF_LIMIT_1 (ETH_MAC_CONFIGR_BL) +/**_ + * @} + */ + +/** + * @defgroup ETH_Deferral_Check ETH Deferral Check + * @{ + */ +#define ETH_MAC_DEFFERRAL_CHECK_DISABLE (0UL) +#define ETH_MAC_DEFFERRAL_CHECK_ENABLE (ETH_MAC_CONFIGR_DC) +/** + * @} + */ + +/** + * @defgroup ETH_Zero_Quanta_Pause ETH Zero Quanta Pause + * @{ + */ +#define ETH_MAC_ZERO_QUANTA_PAUSE_DISABLE (ETH_MAC_FLOCTLR_DZPQ) +#define ETH_MAC_ZERO_QUANTA_PAUSE_ENABLE (0UL) +/** + * @} + */ + +/** + * @defgroup ETH_Pause_Low_Threshold ETH Pause Low Threshold + * @{ + */ +#define ETH_MAC_PAUSE_LOWTHRESHOLD_MINUS4 (0UL) /*!< Pause time minus 4 slot times */ +#define ETH_MAC_PAUSE_LOWTHRESHOLD_MINUS28 (ETH_MAC_FLOCTLR_PLT_0) /*!< Pause time minus 28 slot times */ +#define ETH_MAC_PAUSE_LOWTHRESHOLD_MINUS144 (ETH_MAC_FLOCTLR_PLT_1) /*!< Pause time minus 144 slot times */ +#define ETH_MAC_PAUSE_LOWTHRESHOLD_MINUS256 (ETH_MAC_FLOCTLR_PLT) /*!< Pause time minus 256 slot times */ +/** + * @} + */ + +/** + * @defgroup ETH_Unicast_Pause_Frame_Detect ETH Unicast Pause Frame Detect + * @{ + */ +#define ETH_MAC_UNICAST_PAUSEFRAME_DETECT_DISABLE (0UL) +#define ETH_MAC_UNICAST_PAUSEFRAME_DETECT_ENABLE (ETH_MAC_FLOCTLR_UNP) +/** + * @} + */ + +/** + * @defgroup ETH_Receive_Flow_Control ETH Receive Flow Control + * @{ + */ +#define ETH_MAC_RECEIVE_FLOWCONTROL_DISABLE (0UL) +#define ETH_MAC_RECEIVE_FLOWCONTROL_ENABLE (ETH_MAC_FLOCTLR_RFE) +/** + * @} + */ + +/** + * @defgroup ETH_Transmit_Flow_Control ETH Transmit Flow Control + * @{ + */ +#define ETH_MAC_TRANSMIT_FLOWCONTROL_DISABLE (0UL) +#define ETH_MAC_TRANSMIT_FLOWCONTROL_ENABLE (ETH_MAC_FLOCTLR_TFE) +/** + * @} + */ + +/** + * @defgroup ETH_Receive_All ETH Receive All + * @{ + */ +#define ETH_MAC_RECEIVE_All_DISABLE (0UL) +#define ETH_MAC_RECEIVE_ALL_ENABLE (ETH_MAC_FLTCTLR_RA) +/** + * @} + */ + +/** + * @defgroup ETH_Drop_Not_TcpUdp ETH Drop Not TcpUdp + * @{ + */ +#define ETH_MAC_DROP_NOT_TCPUDP_DISABLE (0UL) +#define ETH_MAC_DROP_NOT_TCPUDP_ENABLE (ETH_MAC_FLTCTLR_DNTU) +/** + * @} + */ + +/** + * @defgroup ETH_VLAN_Tag_Filter ETH VLAN Tag Filter + * @{ + */ +#define ETH_MAC_VLAN_TAG_FILTER_DISABLE (0UL) +#define ETH_MAC_VLAN_TAG_FILTER_ENABLE (ETH_MAC_FLTCTLR_VTFE) +/** + * @} + */ + +/** + * @defgroup ETH_Source_Addr_Filter ETH Source Addr Filter + * @{ + */ +#define ETH_MAC_SOURCE_ADDR_FILTER_DISABLE (0UL) +#define ETH_MAC_SOURCE_ADDR_FILTER_NORMAL (ETH_MAC_FLTCTLR_SAF) +#define ETH_MAC_SOURCE_ADDR_FILTER_INVERSE (ETH_MAC_FLTCTLR_SAF | ETH_MAC_FLTCTLR_SAIF) +/** + * @} + */ + +/** + * @defgroup ETH_Pass_Control_Frame ETH Pass Control Frame + * @{ + */ +#define ETH_MAC_PASS_CTRLFRAME_BLOCK_ALL (0UL) /*!< MAC filter all control frame from reaching the application */ +#define ETH_MAC_PASS_CTRLFRAME_FORWARD_NOTPAUSE_ALL (ETH_MAC_FLTCTLR_PCF_0) /*!< MAC forward all control frame except pause control frame to application even if they fail the address filter */ +#define ETH_MAC_PASS_CTRLFRAME_FORWARD_ALL (ETH_MAC_FLTCTLR_PCF_1) /*!< MAC forward all control frame to application even if they fail the address filter */ +#define ETH_MAC_PASS_CTRLFRAME_FORWARD_PASSADDRFILTER (ETH_MAC_FLTCTLR_PCF) /*!< MAC forward control frame that pass the address filter. */ +/** + * @} + */ + +/** + * @defgroup ETH_Broadcast_Frame_Reception ETH Broadcast Frame Reception + * @{ + */ +#define ETH_MAC_BROADCASTFRAME_RECEPTION_DISABLE (ETH_MAC_FLTCTLR_DBF) +#define ETH_MAC_BROADCASTFRAME_RECEPTION_ENABLE (0UL) +/** + * @} + */ + +/** + * @defgroup ETH_Destination_Addr_Filter ETH Destination Addr Filter + * @{ + */ +#define ETH_MAC_DESTINATION_ADDR_FILTER_NORMAL (0UL) +#define ETH_MAC_DESTINATION_ADDR_FILTER_INVERSE (ETH_MAC_FLTCTLR_DAIF) +/** + * @} + */ + +/** + * @defgroup ETH_Multicast_Frame_Filter ETH Multicast Frame Filter + * @{ + */ +#define ETH_MAC_MULTICASTFRAME_FILTER_NONE (ETH_MAC_FLTCTLR_PMF) +#define ETH_MAC_MULTICASTFRAME_FILTER_PERFECT (0UL) +#define ETH_MAC_MULTICASTFRAME_FILTER_HASHTABLE (ETH_MAC_FLTCTLR_HMC) +#define ETH_MAC_MULTICASTFRAME_FILTER_PERFECTHASHTABLE (ETH_MAC_FLTCTLR_HPF | ETH_MAC_FLTCTLR_HMC) +/** + * @} + */ + +/** + * @defgroup ETH_Unicast_Frame_Filter ETH Unicast Frame Filter + * @{ + */ +#define ETH_MAC_UNICASTFRAME_FILTER_PERFECT (0UL) +#define ETH_MAC_UNICASTFRAME_FILTER_HASHTABLE (ETH_MAC_FLTCTLR_HUC) +#define ETH_MAC_UNICASTFRAME_FILTER_PERFECTHASHTABLE (ETH_MAC_FLTCTLR_HPF | ETH_MAC_FLTCTLR_HUC) +/** + * @} + */ + +/** + * @defgroup ETH_Promiscuous_Mode ETH Promiscuous Mode + * @{ + */ +#define ETH_MAC_PROMISCUOUS_MODE_DISABLE (0UL) +#define ETH_MAC_PROMISCUOUS_MODE_ENABLE (ETH_MAC_FLTCTLR_PR) +/** + * @} + */ + +/** + * @defgroup ETH_Tx_VLAN_Insert_Mode ETH Tx VLAN Insert Mode + * @{ + */ +#define ETH_MAC_TXVLAN_MODE_BY_DMATXDESC (0UL) /*!< Configure the Tx VLAN mode by Tx Descriptor of DMA */ +#define ETH_MAC_TXVLAN_MODE_BYPASS (ETH_MAC_VTACTLR_VLANS) /*!< Do Nothing: VLAN Insertion is bypassed */ +#define ETH_MAC_TXVLAN_MODE_REMOVE_TAG (ETH_MAC_VTACTLR_VLANS | ETH_MAC_VTACTLR_VLANC_0) /*!< Remove Tag and Type fields in VLAN frame */ +#define ETH_MAC_TXVLAN_MODE_INSERT_TAG (ETH_MAC_VTACTLR_VLANS | ETH_MAC_VTACTLR_VLANC_1) /*!< Insert VLAN Tag value in ETH_MAC_VTACTLR Register into transmit frame */ +#define ETH_MAC_TXVLAN_MODE_REPLACE_TAG (ETH_MAC_VTACTLR_VLANS | ETH_MAC_VTACTLR_VLANC) /*!< Replace VLAN tag value in transmit frame with VLAN tag value in ETH_MAC_VTACTLR register */ +/** + * @} + */ + +/** + * @defgroup ETH_Rx_VLAN_Filter ETH Rx VLAN Filter + * @{ + */ +#define ETH_MAC_RXVLAN_FILTER_NORMAL (0UL) +#define ETH_MAC_RXVLAN_FILTER_INVERSE (ETH_MAC_VTAFLTR_VTIM) +#define ETH_MAC_RXVLAN_FILTER_NORMAL_HASHTABLE (ETH_MAC_VTAFLTR_VTHM) +#define ETH_MAC_RXVLAN_FILTER_INVERSE_HASHTABLE (ETH_MAC_VTAFLTR_VTHM | ETH_MAC_VTAFLTR_VTIM) +/** + * @} + */ + +/** + * @defgroup ETH_Rx_VLAN_Comparison ETH Rx VLAN Comparison + * @{ + */ +#define ETH_MAC_RXVLAN_COMPARISON_16BIT (0UL) +#define ETH_MAC_RXVLAN_COMPARISON_12BIT (ETH_MAC_VTAFLTR_VTAL) +/** + * @} + */ + +/** + * @defgroup ETH_L4_Dest_Port_Filter ETH L4 Dest Port Filter + * @{ + */ +#define ETH_MAC_L4_DESTPORT_FILTER_DISABLE (0UL) +#define ETH_MAC_L4_DESTPORT_FILTER_NORMAL (ETH_MAC_L34CTLR_L4DPM) +#define ETH_MAC_L4_DESTPORT_FILTER_INVERSE (ETH_MAC_L34CTLR_L4DPIM | ETH_MAC_L34CTLR_L4DPM) +/** + * @} + */ + +/** + * @defgroup ETH_L4_Source_Port_Filter ETH L4 Source Port Filter + * @{ + */ +#define ETH_MAC_L4_SOURCEPORT_FILTER_DISABLE (0UL) +#define ETH_MAC_L4_SOURCEPORT_FILTER_NORMAL (ETH_MAC_L34CTLR_L4SPM) +#define ETH_MAC_L4_SOURCEPORT_FILTER_INVERSE (ETH_MAC_L34CTLR_L4SPIM | ETH_MAC_L34CTLR_L4SPM) +/** + * @} + */ + +/** + * @defgroup ETH_L4_Port_Filter_Protocol ETH L4 Port Filter Protocol + * @{ + */ +#define ETH_MAC_L4_PORT_FILTER_PROTOCOL_TCP (0UL) /*!< Port filter for TCP frame */ +#define ETH_MAC_L4_PORT_FILTER_PROTOCOL_UDP (ETH_MAC_L34CTLR_L4PEN) /*!< Port filter for UDP frame */ +/** + * @} + */ + +/** + * @defgroup ETH_L3_Dest_Addr_Filter_Mask ETH L3 Destination Addr Filter Mask + * @note The following definitions apply to IPv4 + * @{ + */ +#define ETH_MAC_L3_DA_FILTER_MASK_NONE (0x00000000UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT0 (0x00000800UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT1_0 (0x00001000UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT2_0 (0x00001800UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT3_0 (0x00002000UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT4_0 (0x00002800UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT5_0 (0x00003000UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT6_0 (0x00003800UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT7_0 (0x00004000UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT8_0 (0x00004800UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT9_0 (0x00005000UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT10_0 (0x00005800UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT11_0 (0x00006000UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT12_0 (0x00006800UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT13_0 (0x00007000UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT14_0 (0x00007800UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT15_0 (0x00008000UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT16_0 (0x00008800UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT17_0 (0x00009000UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT18_0 (0x00009800UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT19_0 (0x0000A000UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT20_0 (0x0000A800UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT21_0 (0x0000B000UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT22_0 (0x0000B800UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT23_0 (0x0000C000UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT24_0 (0x0000C800UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT25_0 (0x0000D000UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT26_0 (0x0000D800UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT27_0 (0x0000E000UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT28_0 (0x0000E800UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT29_0 (0x0000F000UL) +#define ETH_MAC_L3_DA_FILTER_MASK_BIT30_0 (0x0000F800UL) +/** + * @} + */ + +/** + * @defgroup ETH_L3_Source_Addr_Filter_Mask ETH L3 Source Addr Filter Mask + * @note The following definitions apply to IPv4 + * @{ + */ +#define ETH_MAC_L3_SA_FILTER_MASK_NONE (0x00000000UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT0 (0x00000040UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT1_0 (0x00000080UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT2_0 (0x000000C0UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT3_0 (0x00000100UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT4_0 (0x00000140UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT5_0 (0x00000180UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT6_0 (0x000001C0UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT7_0 (0x00000200UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT8_0 (0x00000240UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT9_0 (0x00000280UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT10_0 (0x000002C0UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT11_0 (0x00000300UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT12_0 (0x00000340UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT13_0 (0x00000380UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT14_0 (0x000003C0UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT15_0 (0x00000400UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT16_0 (0x00000440UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT17_0 (0x00000480UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT18_0 (0x000004C0UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT19_0 (0x00000500UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT20_0 (0x00000540UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT21_0 (0x00000580UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT22_0 (0x000005C0UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT23_0 (0x00000600UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT24_0 (0x00000640UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT25_0 (0x00000680UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT26_0 (0x000006C0UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT27_0 (0x00000700UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT28_0 (0x00000740UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT29_0 (0x00000780UL) +#define ETH_MAC_L3_SA_FILTER_MASK_BIT30_0 (0x000007C0UL) +/** + * @} + */ + +/** + * @defgroup ETH_L3_DA_SA_Filter_Mask ETH L3 DA SA Filter Mask + * @note The following definitions apply to IPv6. + * @{ + */ +#define ETH_MAC_L3_DA_SA_FILTER_MASK_NONE (0x00000000UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT0 (0x00000040UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT1_0 (0x00000080UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT2_0 (0x000000C0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT3_0 (0x00000100UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT4_0 (0x00000140UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT5_0 (0x00000180UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT6_0 (0x000001C0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT7_0 (0x00000200UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT8_0 (0x00000240UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT9_0 (0x00000280UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT10_0 (0x000002C0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT11_0 (0x00000300UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT12_0 (0x00000340UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT13_0 (0x00000380UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT14_0 (0x000003C0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT15_0 (0x00000400UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT16_0 (0x00000440UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT17_0 (0x00000480UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT18_0 (0x000004C0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT19_0 (0x00000500UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT20_0 (0x00000540UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT21_0 (0x00000580UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT22_0 (0x000005C0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT23_0 (0x00000600UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT24_0 (0x00000640UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT25_0 (0x00000680UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT26_0 (0x000006C0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT27_0 (0x00000700UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT28_0 (0x00000740UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT29_0 (0x00000780UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT30_0 (0x000007C0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT31_0 (0x00000800UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT32_0 (0x00000840UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT33_0 (0x00000880UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT34_0 (0x000008C0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT35_0 (0x00000900UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT36_0 (0x00000940UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT37_0 (0x00000980UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT38_0 (0x000009C0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT39_0 (0x00000A00UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT40_0 (0x00000A40UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT41_0 (0x00000A80UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT42_0 (0x00000AC0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT43_0 (0x00000B00UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT44_0 (0x00000B40UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT45_0 (0x00000B80UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT46_0 (0x00000BC0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT47_0 (0x00000C00UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT48_0 (0x00000C40UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT49_0 (0x00000C80UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT50_0 (0x00000CC0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT51_0 (0x00000D00UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT52_0 (0x00000D40UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT53_0 (0x00000D80UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT54_0 (0x00000DC0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT55_0 (0x00000E00UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT56_0 (0x00000E40UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT57_0 (0x00000E80UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT58_0 (0x00000EC0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT59_0 (0x00000F00UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT60_0 (0x00000F40UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT61_0 (0x00000F80UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT62_0 (0x00000FC0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT63_0 (0x00001000UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT64_0 (0x00001040UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT65_0 (0x00001080UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT66_0 (0x000010C0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT67_0 (0x00001100UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT68_0 (0x00001140UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT69_0 (0x00001180UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT70_0 (0x000011C0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT71_0 (0x00001200UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT72_0 (0x00001240UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT73_0 (0x00001280UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT74_0 (0x000012C0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT75_0 (0x00001300UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT76_0 (0x00001340UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT77_0 (0x00001380UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT78_0 (0x000013C0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT79_0 (0x00001400UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT80_0 (0x00001440UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT81_0 (0x00001480UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT82_0 (0x000014C0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT83_0 (0x00001500UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT84_0 (0x00001540UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT85_0 (0x00001580UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT86_0 (0x000015C0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT87_0 (0x00001600UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT88_0 (0x00001640UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT89_0 (0x00001680UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT90_0 (0x000016C0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT91_0 (0x00001700UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT92_0 (0x00001740UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT93_0 (0x00001780UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT94_0 (0x000017C0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT95_0 (0x00001800UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT96_0 (0x00001840UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT97_0 (0x00001880UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT98_0 (0x000018C0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT99_0 (0x00001900UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT100_0 (0x00001940UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT101_0 (0x00001980UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT102_0 (0x000019C0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT103_0 (0x00001A00UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT104_0 (0x00001A40UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT105_0 (0x00001A80UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT106_0 (0x00001AC0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT107_0 (0x00001B00UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT108_0 (0x00001B40UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT109_0 (0x00001B80UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT110_0 (0x00001BC0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT111_0 (0x00001C00UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT112_0 (0x00001C40UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT113_0 (0x00001C80UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT114_0 (0x00001CC0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT115_0 (0x00001D00UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT116_0 (0x00001D40UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT117_0 (0x00001D80UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT118_0 (0x00001DC0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT119_0 (0x00001E00UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT120_0 (0x00001E40UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT121_0 (0x00001E80UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT122_0 (0x00001EC0UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT123_0 (0x00001F00UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT124_0 (0x00001F40UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT125_0 (0x00001F80UL) +#define ETH_MAC_L3_DA_SA_FILTER_MASK_BIT126_0 (0x00001FC0UL) +/** + * @} + */ + +/** + * @defgroup ETH_L3_Dest_Addr_Filter ETH L3 Destination Addr Filter + * @{ + */ +#define ETH_MAC_L3_DA_FILTER_DISABLE (0UL) +#define ETH_MAC_L3_DA_FILTER_NORMAL (ETH_MAC_L34CTLR_L3DAM) +#define ETH_MAC_L3_DA_FILTER_INVERSE (ETH_MAC_L34CTLR_L3DAIM | ETH_MAC_L34CTLR_L3DAM) +/** + * @} + */ + +/** + * @defgroup ETH_L3_Source_Addr_Filter ETH L3 Source Addr Filter + * @{ + */ +#define ETH_MAC_L3_SA_FILTER_DISABLE (0UL) +#define ETH_MAC_L3_SA_FILTER_NORMAL (ETH_MAC_L34CTLR_L3SAM) +#define ETH_MAC_L3_SA_FILTER_INVERSE (ETH_MAC_L34CTLR_L3SAIM | ETH_MAC_L34CTLR_L3SAM) +/** + * @} + */ + +/** + * @defgroup ETH_L3_Addr_Filter_Protocol ETH L3 Addr Filter Protocol + * @{ + */ +#define ETH_MAC_L3_ADDR_FILTER_PROTOCOL_IPV4 (0UL) /*!< Ip Address filter for IPv4 */ +#define ETH_MAC_L3_ADDR_FILTER_PROTOCOL_IPV6 (ETH_MAC_L34CTLR_L3PEN) /*!< Ip Address filter for IPv6 */ +/** + * @} + */ + +/** + * @defgroup ETH_MAC_Address_Index ETH MAC Address Index + * @{ + */ +#define ETH_MAC_ADDRESS0 (0x00000000UL) +#define ETH_MAC_ADDRESS1 (0x00000008UL) +#define ETH_MAC_ADDRESS2 (0x00000010UL) +#define ETH_MAC_ADDRESS3 (0x00000018UL) +#define ETH_MAC_ADDRESS4 (0x00000020UL) +/** + * @} + */ + +/** + * @defgroup ETH_MAC_Address_Filter ETH MAC Address Filter + * @note The parameter is invalid in ETH_MAC_ADDRESS0. + * @{ + */ +#define ETH_MAC_ADDRESS_FILTER_DISABLE (0UL) /*!< Disable perfect filter with MAC address. */ +#define ETH_MAC_ADDRESS_FILTER_PERFECT_DA (ETH_MAC_MACADHR1_AE1) /*!< Filter the DA address of the received frame with MAC address. */ +#define ETH_MAC_ADDRESS_FILTER_PERFECT_SA (ETH_MAC_MACADHR1_AE1 | ETH_MAC_MACADHR1_SA1) /*!< Filter the SA address of the received frame with MAC address. */ +/** + * @} + */ + +/** + * @defgroup ETH_MAC_Address_Filter_Mask ETH MAC Address Filter Mask + * @note The parameter is invalid in ETH_MAC_ADDRESS0. + * @{ + */ +#define ETH_MAC_ADDRESS_MASK_DISABLE (0UL) /*!< Disable MAC Address Mask */ +#define ETH_MAC_ADDRESS_MASK_BYTE6 (ETH_MAC_MACADHR1_MBC1_5) /*!< Mask MAC Address high reg bits [15:8] */ +#define ETH_MAC_ADDRESS_MASK_BYTE5 (ETH_MAC_MACADHR1_MBC1_4) /*!< Mask MAC Address high reg bits [7:0] */ +#define ETH_MAC_ADDRESS_MASK_BYTE4 (ETH_MAC_MACADHR1_MBC1_3) /*!< Mask MAC Address low reg bits [31:24] */ +#define ETH_MAC_ADDRESS_MASK_BYTE3 (ETH_MAC_MACADHR1_MBC1_2) /*!< Mask MAC Address low reg bits [23:16] */ +#define ETH_MAC_ADDRESS_MASK_BYTE2 (ETH_MAC_MACADHR1_MBC1_1) /*!< Mask MAC Address low reg bits [15:8] */ +#define ETH_MAC_ADDRESS_MASK_BYTE1 (ETH_MAC_MACADHR1_MBC1_0) /*!< Mask MAC Address low reg bits [7:0] */ +#define ETH_MAC_ADDRESS_MASK_ALL (ETH_MAC_MACADHR1_MBC1) /*!< Mask MAC Address low reg bits [31:0] and low high bits [15:0] */ +/** + * @} + */ + +/** + * @defgroup ETH_MAC_INT_Flag ETH MAC Interrupt Flag + * @{ + */ +#define ETH_MAC_INT_FLAG_TSPIS (ETH_MAC_INTSTSR_TSPIS) /*!< Time stamp trigger flag (on MAC) */ +#define ETH_MAC_INT_FLAG_MMCTXIS (ETH_MAC_INTSTSR_MMCTXIS) /*!< MMC transmit flag */ +#define ETH_MAC_INT_FLAG_MMCRXIS (ETH_MAC_INTSTSR_MMCRXIS) /*!< MMC receive flag */ +#define ETH_MAC_INT_FLAG_MMCIS (ETH_MAC_INTSTSR_MMCIS) /*!< MMC flag (on MAC) */ +#define ETH_MAC_INT_FLAG_PMTIS (ETH_MAC_INTSTSR_PMTIS) /*!< PMT flag (on MAC) */ +/** + * @} + */ + +/** + * @defgroup ETH_MAC_Interrupt ETH MAC Interrupt + * @{ + */ +#define ETH_MAC_INT_TSPIM (ETH_MAC_INTMSKR_TSPIM) /*!< Time stamp trigger interrupt (on MAC) */ +#define ETH_MAC_INT_PMTIM (ETH_MAC_INTMSKR_PMTIM) /*!< PMT interrupt (on MAC) */ +/** + * @} + */ + +/** + * @defgroup ETH_Burst_Mode ETH Burst Mode + * @{ + */ +#define ETH_DMA_BURST_MODE_NORMAL (0UL) /*!< DMA master interface only use SINGLE and INCR access type */ +#define ETH_DMA_BURST_MODE_FIXED (ETH_DMA_BUSMODR_FBST) /*!< DMA master interface use SINGLE and INCR, INCR8, INCR16 access type */ +#define ETH_DMA_BURST_MODE_MIXED (ETH_DMA_BUSMODR_MBST) /*!< DMA master interface will start all burst transmission with INCR length greater than 16 */ +/** + * @} + */ + +/** + * @defgroup ETH_Address_Align ETH Address Align + * @{ + */ +#define ETH_DMA_ADDRESS_ALIGN_DISABLE (0UL) +#define ETH_DMA_ADDRESS_ALIGN_ENABLE (ETH_DMA_BUSMODR_AAL) +/** + * @} + */ + +/** + * @defgroup ETH_Rx_DMA_Burst_Length ETH Rx DMA Burst Length + * @{ + */ +#define ETH_DMA_RX_BURST_LENGTH_1BEAT (ETH_DMA_BUSMODR_RPBL_0) /*!< Maximum number of beats to be transferred in one RxDMA transaction is 1 */ +#define ETH_DMA_RX_BURST_LENGTH_2BEAT (ETH_DMA_BUSMODR_RPBL_1) /*!< Maximum number of beats to be transferred in one RxDMA transaction is 2 */ +#define ETH_DMA_RX_BURST_LENGTH_4BEAT (ETH_DMA_BUSMODR_RPBL_2) /*!< Maximum number of beats to be transferred in one RxDMA transaction is 4 */ +#define ETH_DMA_RX_BURST_LENGTH_8BEAT (ETH_DMA_BUSMODR_RPBL_3) /*!< Maximum number of beats to be transferred in one RxDMA transaction is 8 */ +#define ETH_DMA_RX_BURST_LENGTH_16BEAT (ETH_DMA_BUSMODR_RPBL_4) /*!< Maximum number of beats to be transferred in one RxDMA transaction is 16 */ +#define ETH_DMA_RX_BURST_LENGTH_32BEAT (ETH_DMA_BUSMODR_RPBL_5) /*!< Maximum number of beats to be transferred in one RxDMA transaction is 32 */ +#define ETH_DMA_RX_BURST_LENGTH_8XPBL_8BEAT (ETH_DMA_BUSMODR_M8PBL | ETH_DMA_BUSMODR_RPBL_0) /*!< Maximum number of beats to be transferred in one RxDMA transaction is 8 */ +#define ETH_DMA_RX_BURST_LENGTH_8XPBL_16BEAT (ETH_DMA_BUSMODR_M8PBL | ETH_DMA_BUSMODR_RPBL_1) /*!< Maximum number of beats to be transferred in one RxDMA transaction is 16 */ +#define ETH_DMA_RX_BURST_LENGTH_8XPBL_32BEAT (ETH_DMA_BUSMODR_M8PBL | ETH_DMA_BUSMODR_RPBL_2) /*!< Maximum number of beats to be transferred in one RxDMA transaction is 32 */ +#define ETH_DMA_RX_BURST_LENGTH_8XPBL_64BEAT (ETH_DMA_BUSMODR_M8PBL | ETH_DMA_BUSMODR_RPBL_3) /*!< Maximum number of beats to be transferred in one RxDMA transaction is 64 */ +#define ETH_DMA_RX_BURST_LENGTH_8XPBL_128BEAT (ETH_DMA_BUSMODR_M8PBL | ETH_DMA_BUSMODR_RPBL_4) /*!< Maximum number of beats to be transferred in one RxDMA transaction is 128 */ +#define ETH_DMA_RX_BURST_LENGTH_8XPBL_256BEAT (ETH_DMA_BUSMODR_M8PBL | ETH_DMA_BUSMODR_RPBL_5) /*!< Maximum number of beats to be transferred in one RxDMA transaction is 256 */ +/** + * @} + */ + +/** + * @defgroup ETH_Tx_DMA_Burst_Length ETH Tx DMA Burst Length + * @{ + */ +#define ETH_DMA_TX_BURST_LENGTH_1BEAT (ETH_DMA_BUSMODR_TPBL_0) /*!< Maximum number of beats to be transferred in one TxDMA (or both) transaction is 1 */ +#define ETH_DMA_TX_BURST_LENGTH_2BEAT (ETH_DMA_BUSMODR_TPBL_1) /*!< Maximum number of beats to be transferred in one TxDMA (or both) transaction is 2 */ +#define ETH_DMA_TX_BURST_LENGTH_4BEAT (ETH_DMA_BUSMODR_TPBL_2) /*!< Maximum number of beats to be transferred in one TxDMA (or both) transaction is 4 */ +#define ETH_DMA_TX_BURST_LENGTH_8BEAT (ETH_DMA_BUSMODR_TPBL_3) /*!< Maximum number of beats to be transferred in one TxDMA (or both) transaction is 8 */ +#define ETH_DMA_TX_BURST_LENGTH_16BEAT (ETH_DMA_BUSMODR_TPBL_4) /*!< Maximum number of beats to be transferred in one TxDMA (or both) transaction is 16 */ +#define ETH_DMA_TX_BURST_LENGTH_32BEAT (ETH_DMA_BUSMODR_TPBL_5) /*!< Maximum number of beats to be transferred in one TxDMA (or both) transaction is 32 */ +#define ETH_DMA_TX_BURST_LENGTH_8XPBL_8BEAT (ETH_DMA_BUSMODR_M8PBL | ETH_DMA_BUSMODR_TPBL_0) /*!< Maximum number of beats to be transferred in one TxDMA (or both) transaction is 8 */ +#define ETH_DMA_TX_BURST_LENGTH_8XPBL_16BEAT (ETH_DMA_BUSMODR_M8PBL | ETH_DMA_BUSMODR_TPBL_1) /*!< Maximum number of beats to be transferred in one TxDMA (or both) transaction is 16 */ +#define ETH_DMA_TX_BURST_LENGTH_8XPBL_32BEAT (ETH_DMA_BUSMODR_M8PBL | ETH_DMA_BUSMODR_TPBL_2) /*!< Maximum number of beats to be transferred in one TxDMA (or both) transaction is 32 */ +#define ETH_DMA_TX_BURST_LENGTH_8XPBL_64BEAT (ETH_DMA_BUSMODR_M8PBL | ETH_DMA_BUSMODR_TPBL_3) /*!< Maximum number of beats to be transferred in one TxDMA (or both) transaction is 64 */ +#define ETH_DMA_TX_BURST_LENGTH_8XPBL_128BEAT (ETH_DMA_BUSMODR_M8PBL | ETH_DMA_BUSMODR_TPBL_4) /*!< Maximum number of beats to be transferred in one TxDMA (or both) transaction is 128 */ +#define ETH_DMA_TX_BURST_LENGTH_8XPBL_256BEAT (ETH_DMA_BUSMODR_M8PBL | ETH_DMA_BUSMODR_TPBL_5) /*!< Maximum number of beats to be transferred in one TxDMA (or both) transaction is 256 */ +/** + * @} + */ + +/** + * @defgroup ETH_DMA_Enhance_Descriptor ETH DMA Enhance Descriptor + * @{ + */ +#define ETH_DMA_ENHANCE_DESCRIPTOR_DISABLE (0UL) +#define ETH_DMA_ENHANCE_DESCRIPTOR_ENABLE (ETH_DMA_BUSMODR_DSEN) +/** + * @} + */ + +/** + * @defgroup ETH_DMA_Arbitration ETH DMA Arbitration + * @{ + */ +#define ETH_DMA_ARBITRATION_LOOP_RXTX_1_1 (0UL) +#define ETH_DMA_ARBITRATION_LOOP_RXTX_2_1 (ETH_DMA_BUSMODR_PRAT_0) +#define ETH_DMA_ARBITRATION_LOOP_RXTX_3_1 (ETH_DMA_BUSMODR_PRAT_1) +#define ETH_DMA_ARBITRATION_LOOP_RXTX_4_1 (ETH_DMA_BUSMODR_PRAT) +#define ETH_DMA_ARBITRATION_LOOP_TXRX_1_1 (ETH_DMA_BUSMODR_TXPR) +#define ETH_DMA_ARBITRATION_LOOP_TXRX_2_1 (ETH_DMA_BUSMODR_TXPR | ETH_DMA_BUSMODR_PRAT_0) +#define ETH_DMA_ARBITRATION_LOOP_TXRX_3_1 (ETH_DMA_BUSMODR_TXPR | ETH_DMA_BUSMODR_PRAT_1) +#define ETH_DMA_ARBITRATION_LOOP_TXRX_4_1 (ETH_DMA_BUSMODR_TXPR | ETH_DMA_BUSMODR_PRAT) +#define ETH_DMA_ARBITRATION_FIXED_RXPRIORTX (ETH_DMA_BUSMODR_DMAA) +#define ETH_DMA_ARBITRATION_FIXED_TXPRIORRX (ETH_DMA_BUSMODR_TXPR | ETH_DMA_BUSMODR_DMAA) +/** + * @} + */ + +/** + * @defgroup ETH_Drop_TCPIP_Checksum_Error_Frame ETH Drop TCPIP Checksum Error Frame + * @{ + */ +#define ETH_DMA_DROP_CHECKSUM_ERRORFRAME_DISABLE (ETH_DMA_OPRMODR_DTCOE) +#define ETH_DMA_DROP_CHECKSUM_ERRORFRAME_ENABLE (0UL) +/** + * @} + */ + +/** + * @defgroup ETH_Receive_Store_Forward ETH Receive Store Forward + * @{ + */ +#define ETH_DMA_RECEIVE_STORE_FORWARD_DISABLE (0UL) +#define ETH_DMA_RECEIVE_STORE_FORWARD_ENABLE (ETH_DMA_OPRMODR_RSF) +/** + * @} + */ + +/** + * @defgroup ETH_Flush_Receive_Frame ETH Flush Receive Frame + * @{ + */ +#define ETH_DMA_FLUSH_RECEIVEDFRAME_DISABLE (ETH_DMA_OPRMODR_DFRF) +#define ETH_DMA_FLUSH_RECEIVEDFRAME_ENABLE (0UL) +/** + * @} + */ + +/** + * @defgroup ETH_Transmit_Store_Forward ETH Transmit Store Forward + * @{ + */ +#define ETH_DMA_TRANSMIT_STORE_FORWARD_DISABLE (0UL) +#define ETH_DMA_TRANSMIT_STORE_FORWARD_ENABLE (ETH_DMA_OPRMODR_TSF) +/** + * @} + */ + +/** + * @defgroup ETH_Transmit_Threshold ETH Transmit Threshold + * @{ + */ +#define ETH_DMA_TRANSMIT_THRESHOLD_64BYTE (0UL) /*!< Threshold level of the Transmit FIFO is 64 Bytes */ +#define ETH_DMA_TRANSMIT_THRESHOLD_128BYTE (ETH_DMA_OPRMODR_TTC_0) /*!< Threshold level of the Transmit FIFO is 128 Bytes */ +#define ETH_DMA_TRANSMIT_THRESHOLD_192BYTE (ETH_DMA_OPRMODR_TTC_1) /*!< Threshold level of the Transmit FIFO is 192 Bytes */ +#define ETH_DMA_TRANSMIT_THRESHOLD_256BYTE (ETH_DMA_OPRMODR_TTC_1 | ETH_DMA_OPRMODR_TTC_0) /*!< Threshold level of the Transmit FIFO is 256 Bytes */ +#define ETH_DMA_TRANSMIT_THRESHOLD_40BYTE (ETH_DMA_OPRMODR_TTC_2) /*!< Threshold level of the Transmit FIFO is 40 Bytes */ +#define ETH_DMA_TRANSMIT_THRESHOLD_32BYTE (ETH_DMA_OPRMODR_TTC_2 | ETH_DMA_OPRMODR_TTC_0) /*!< Threshold level of the Transmit FIFO is 32 Bytes */ +#define ETH_DMA_TRANSMIT_THRESHOLD_24BYTE (ETH_DMA_OPRMODR_TTC_2 | ETH_DMA_OPRMODR_TTC_1) /*!< Threshold level of the Transmit FIFO is 24 Bytes */ +#define ETH_DMA_TRANSMIT_THRESHOLD_16BYTE (ETH_DMA_OPRMODR_TTC) /*!< Threshold level of the Transmit FIFO is 16 Bytes */ +/** + * @} + */ + +/** + * @defgroup ETH_Forward_Error_Frame ETH Forward Error Frame + * @{ + */ +#define ETH_DMA_FORWARD_ERRORFRAME_DISABLE (0UL) +#define ETH_DMA_FORWARD_ERRORFRAME_ENABLE (ETH_DMA_OPRMODR_FEF) +/** + * @} + */ + +/** + * @defgroup ETH_Forward_Undersize_Good_Frame ETH Forward Undersize Good Frame + * @{ + */ +#define ETH_DMA_FORWARD_UNDERSIZE_GOODFRAME_DISABLE (0UL) +#define ETH_DMA_FORWARD_UNDERSIZE_GOODFRAME_ENABLE (ETH_DMA_OPRMODR_FUF) +/** + * @} + */ + +/** + * @defgroup ETH_Drop_Jumbo_Frame ETH Drop Jumbo Frame + * @{ + */ +#define ETH_DMA_DROP_JUMBO_FRAME_DISABLE (0UL) +#define ETH_DMA_DROP_JUMBO_FRAME_ENABLE (ETH_DMA_OPRMODR_DGF) +/** + * @} + */ + +/** + * @defgroup ETH_Receive_Threshold ETH Receive Threshold + * @{ + */ +#define ETH_DMA_RECEIVE_THRESHOLD_64BYTE (0UL) /*!< Threshold level of the Receive FIFO is 64 Bytes */ +#define ETH_DMA_RECEIVE_THRESHOLD_32BYTE (ETH_DMA_OPRMODR_RTC_0) /*!< Threshold level of the Receive FIFO is 32 Bytes */ +#define ETH_DMA_RECEIVE_THRESHOLD_96BYTE (ETH_DMA_OPRMODR_RTC_1) /*!< Threshold level of the Receive FIFO is 96 Bytes */ +#define ETH_DMA_RECEIVE_THRESHOLD_128BYTE (ETH_DMA_OPRMODR_RTC) /*!< Threshold level of the Receive FIFO is 128 Bytes */ +/** + * @} + */ + +/** + * @defgroup ETH_Second_Frame_Operate ETH Second Frame Operate + * @{ + */ +#define ETH_DMA_SECONDFRAME_OPERARTE_DISABLE (0UL) +#define ETH_DMA_SECONDFRAME_OPERARTE_ENABLE (ETH_DMA_OPRMODR_OSF) +/** + * @} + */ + +/** + * @defgroup ETH_DMA_Flag ETH DMA Flag + * @{ + */ +#define ETH_DMA_FLAG_PTPS (ETH_DMA_DMASTSR_PTPS) /*!< Time-stamp trigger status */ +#define ETH_DMA_FLAG_PMTS (ETH_DMA_DMASTSR_PMTS) /*!< PMT trigger status */ +#define ETH_DMA_FLAG_MMCS (ETH_DMA_DMASTSR_MMCS) /*!< MMC trigger status */ +#define ETH_DMA_FLAG_EBUS (ETH_DMA_DMASTSR_EBUS) /*!< Error state bits */ +#define ETH_DMA_FLAG_TSTS (ETH_DMA_DMASTSR_TSTS) /*!< Transmit state */ +#define ETH_DMA_FLAG_RSTS (ETH_DMA_DMASTSR_RSTS) /*!< Receive state */ +#define ETH_DMA_FLAG_NIS (ETH_DMA_DMASTSR_NIS) /*!< Normal interrupt summary flag */ +#define ETH_DMA_FLAG_AIS (ETH_DMA_DMASTSR_AIS) /*!< Abnormal interrupt summary flag */ +#define ETH_DMA_FLAG_ERS (ETH_DMA_DMASTSR_ERS) /*!< Early receive flag */ +#define ETH_DMA_FLAG_FBS (ETH_DMA_DMASTSR_FBS) /*!< Fatal bus error flag */ +#define ETH_DMA_FLAG_ETS (ETH_DMA_DMASTSR_ETS) /*!< Early transmit flag */ +#define ETH_DMA_FLAG_RWS (ETH_DMA_DMASTSR_RWS) /*!< Receive watchdog timeout flag */ +#define ETH_DMA_FLAG_RSS (ETH_DMA_DMASTSR_RSS) /*!< Receive stopped flag */ +#define ETH_DMA_FLAG_RUS (ETH_DMA_DMASTSR_RUS) /*!< Receive buffer unavailable flag */ +#define ETH_DMA_FLAG_RIS (ETH_DMA_DMASTSR_RIS) /*!< Receive flag */ +#define ETH_DMA_FLAG_UNS (ETH_DMA_DMASTSR_UNS) /*!< Transmit Underflow flag */ +#define ETH_DMA_FLAG_OVS (ETH_DMA_DMASTSR_OVS) /*!< Receive Overflow flag */ +#define ETH_DMA_FLAG_TJS (ETH_DMA_DMASTSR_TJS) /*!< Transmit jabber timeout flag */ +#define ETH_DMA_FLAG_TUS (ETH_DMA_DMASTSR_TUS) /*!< Transmit buffer unavailable flag */ +#define ETH_DMA_FLAG_TSS (ETH_DMA_DMASTSR_TSS) /*!< Transmit stopped flag */ +#define ETH_DMA_FLAG_TIS (ETH_DMA_DMASTSR_TIS) /*!< Transmit interrupt flag */ +/** + * @} + */ + +/** + * @defgroup ETH_DMA_Error_State ETH DMA Error State + * @{ + */ +#define ETH_DMA_ERRORSTATE_RX_WRITEDATA (0UL) /*!< RxDMA generates error while writing data */ +#define ETH_DMA_ERRORSTATE_TX_READDATA (ETH_DMA_DMASTSR_EBUS_1 | ETH_DMA_DMASTSR_EBUS_0) /*!< TxDMA generates error while reading data */ +#define ETH_DMA_ERRORSTATE_RX_WRITEDESC (ETH_DMA_DMASTSR_EBUS_2) /*!< RxDMA generates error while writing descriptor */ +#define ETH_DMA_ERRORSTATE_TX_WRITEDESC (ETH_DMA_DMASTSR_EBUS_2 | ETH_DMA_DMASTSR_EBUS_0) /*!< TxDMA generates error while writing descriptor */ +#define ETH_DMA_ERRORSTATE_RX_READDESC (ETH_DMA_DMASTSR_EBUS_2 | ETH_DMA_DMASTSR_EBUS_1) /*!< RxDMA generates error while reading descriptor */ +#define ETH_DMA_ERRORSTATE_TX_READDESC (ETH_DMA_DMASTSR_EBUS) /*!< TxDMA generates error while reading descriptor */ +/** + * @} + */ + +/** + * @defgroup ETH_DMA_Transmit_State ETH DMA Transmit State + * @{ + */ +#define ETH_DMA_TRANSMITSTATE_STOPPED (0UL) /*!< Stopped - Reset or Stop Tx Command issued */ +#define ETH_DMA_TRANSMITSTATE_FETCHING (ETH_DMA_DMASTSR_TSTS_0) /*!< Running - Fetching the Tx descriptor */ +#define ETH_DMA_TRANSMITSTATE_WAITING (ETH_DMA_DMASTSR_TSTS_1) /*!< Running - Waiting for status */ +#define ETH_DMA_TRANSMITSTATE_READING (ETH_DMA_DMASTSR_TSTS_1 | ETH_DMA_DMASTSR_TSTS_0) /*!< Running - Reading the data from host memory */ +#define ETH_DMA_TRANSMITSTATE_WRITING (ETH_DMA_DMASTSR_TSTS_2) /*!< Running - Writing the time stamp */ +#define ETH_DMA_TRANSMITSTATE_SUSPENDED (ETH_DMA_DMASTSR_TSTS_2 | ETH_DMA_DMASTSR_TSTS_1) /*!< Suspended - Tx Descriptor unavailable */ +#define ETH_DMA_TRANSMITSTATE_CLOSING (ETH_DMA_DMASTSR_TSTS) /*!< Running - Closing Rx descriptor */ +/** + * @} + */ + +/** + * @defgroup ETH_DMA_Receive_State ETH DMA Receive State + * @{ + */ +#define ETH_DMA_RECEIVESTATE_STOPPED (0UL) /*!< Stopped - Reset or Stop Rx Command issued */ +#define ETH_DMA_RECEIVESTATE_FETCHING (ETH_DMA_DMASTSR_RSTS_0) /*!< Running - Fetching the Rx descriptor */ +#define ETH_DMA_RECEIVESTATE_WAITING (ETH_DMA_DMASTSR_RSTS_1 | ETH_DMA_DMASTSR_RSTS_0) /*!< Running - Waiting for packet */ +#define ETH_DMA_RECEIVESTATE_SUSPENDED (ETH_DMA_DMASTSR_RSTS_2) /*!< Suspended - Rx Descriptor unavailable */ +#define ETH_DMA_RECEIVESTATE_CLOSING (ETH_DMA_DMASTSR_RSTS_2 | ETH_DMA_DMASTSR_RSTS_0) /*!< Running - Closing descriptor */ +#define ETH_DMA_RECEIVESTATE_WRITING (ETH_DMA_DMASTSR_RSTS_2 | ETH_DMA_DMASTSR_RSTS_1) /*!< Running - Writing the time stamp */ +#define ETH_DMA_RECEIVESTATE_QUEUING (ETH_DMA_DMASTSR_RSTS) /*!< Running - Queuing the receive frame into host memory */ +/** + * @} + */ + +/** + * @defgroup ETH_DMA_Interrupt ETH DMA Interrupt + * @{ + */ +#define ETH_DMA_INT_NIE (ETH_DMA_INTENAR_NIE) /*!< Normal interrupt summary */ +#define ETH_DMA_INT_AIE (ETH_DMA_INTENAR_AIE) /*!< Abnormal interrupt summary */ +#define ETH_DMA_INT_ERE (ETH_DMA_INTENAR_ERE) /*!< Early receive interrupt */ +#define ETH_DMA_INT_FBE (ETH_DMA_INTENAR_FBE) /*!< Fatal bus error interrupt */ +#define ETH_DMA_INT_ETE (ETH_DMA_INTENAR_ETE) /*!< Early transmit interrupt */ +#define ETH_DMA_INT_RWE (ETH_DMA_INTENAR_RWE) /*!< Receive watchdog timeout interrupt */ +#define ETH_DMA_INT_RSE (ETH_DMA_INTENAR_RSE) /*!< Receive process stopped interrupt */ +#define ETH_DMA_INT_RUE (ETH_DMA_INTENAR_RUE) /*!< Receive buffer unavailable interrupt */ +#define ETH_DMA_INT_RIE (ETH_DMA_INTENAR_RIE) /*!< Receive interrupt */ +#define ETH_DMA_INT_UNE (ETH_DMA_INTENAR_UNE) /*!< Transmit Underflow interrupt */ +#define ETH_DMA_INT_OVE (ETH_DMA_INTENAR_OVE) /*!< Receive Overflow interrupt */ +#define ETH_DMA_INT_TJE (ETH_DMA_INTENAR_TJE) /*!< Transmit jabber timeout interrupt */ +#define ETH_DMA_INT_TUE (ETH_DMA_INTENAR_TUE) /*!< Transmit buffer unavailable interrupt */ +#define ETH_DMA_INT_TSE (ETH_DMA_INTENAR_TSE) /*!< Transmit process stopped interrupt */ +#define ETH_DMA_INT_TIE (ETH_DMA_INTENAR_TIE) /*!< Transmit interrupt */ +/** + * @} + */ + +/** + * @defgroup ETH_DMA_Overflow ETH DMA Overflow + * @{ + */ +#define ETH_DMA_OVERFLOW_RXFIFO_COUNTER (ETH_DMA_RFRCNTR_OVFOVF) /*!< Overflow bit for FIFO overflow counter */ +#define ETH_DMA_OVERFLOW_MISSFRAME_COUNTER (ETH_DMA_RFRCNTR_UNAOVF) /*!< Overflow bit for miss frame counter */ +/** + * @} + */ + +/** + * @defgroup ETH_DMA_Descriptor_Own ETH DMA Descriptor Own + * @{ + */ +#define ETH_DMADESC_OWN_CPU (0UL) /*!< The descriptor is owned by CPU */ +#define ETH_DMADESC_OWN_DMA (ETH_DMATXDESC_OWN) /*!< The descriptor is owned by DMA */ +/** + * @} + */ + +/** + * @defgroup ETH_DMA_Descriptor_Buffer ETH DMA Descriptor Buffer + * @{ + */ +#define ETH_DMADESC_BUFFER1 ((uint8_t)0x00UL) /*!< DMA Desc Buffer1 */ +#define ETH_DMADESC_BUFFER2 ((uint8_t)0x01UL) /*!< DMA Desc Buffer2 */ +/** + * @} + */ + +/** + * @defgroup ETH_DMA_Tx_Descriptor_Checksum_Insertion_Control ETH DMA Tx Descriptor Checksum Insertion Control + * @{ + */ +#define ETH_DMATXDESC_CHECKSUM_BYPASS (ETH_DMATXDESC_CIC_BYPASS) /*!< Checksum Engine is bypassed */ +#define ETH_DMATXDESC_CHECKSUM_IPV4HEADER (ETH_DMATXDESC_CIC_IPV4HEADER) /*!< IPv4 header checksum insertion */ +#define ETH_DMATXDESC_CHECKSUM_TCPUDPICMP_SEGMENT (ETH_DMATXDESC_CIC_TCPUDPICMP_SEGMENT) /*!< TCP/UDP/ICMP Checksum Insertion calculated over segment only */ +#define ETH_DMATXDESC_CHECKSUM_TCPUDPICMP_FULL (ETH_DMATXDESC_CIC_TCPUDPICMP_FULL) /*!< TCP/UDP/ICMP Checksum Insertion fully calculated */ +/** + * @} + */ + +/** + * @defgroup ETH_DMA_Tx_Descriptor_VLAN_Insertion_Control ETH DMA Tx Descriptor VLAN Insertion Control + * @{ + */ +#define ETH_DMATXDESC_VLAN_BYPASS (ETH_DMATXDESC_VLANC_BYPASS) /*!< VLAN Insertion is bypassed */ +#define ETH_DMATXDESC_VLAN_REMOVE_TAG (ETH_DMATXDESC_VLANC_REMOVE_TAG) /*!< Remove Tag and Type fields in VLAN frame */ +#define ETH_DMATXDESC_VLAN_INSERT_TAG (ETH_DMATXDESC_VLANC_INSERT_TAG) /*!< Insert VLAN Tag value in ETH_MAC_VTACTLR Register into transmit frame */ +#define ETH_DMATXDESC_VLAN_REPLACE_TAG (ETH_DMATXDESC_VLANC_REPLACE_TAG) /*!< Replace VLAN tag value in transmit frame with VLAN tag value in ETH_MAC_VTACTLR register */ +/** + * @} + */ + +/** + * @defgroup ETH_DMA_Tx_Descriptor_SA_Insertion_Control ETH DMA Tx Descriptor SA Insertion Control + * @{ + */ +#define ETH_DMATXDESC_SA_BYPASS (ETH_DMATXDESC_SAIRC_BYPASS) /*!< Source Address Insertion or Replace Control is bypassed */ +#define ETH_DMATXDESC_SA_INSTER_MACADDR0 (ETH_DMATXDESC_SAIRC_INSTER_MACADDR0) /*!< Insert address value in MAC address register 0 into transmit frame as SA address */ +#define ETH_DMATXDESC_SA_REPLACE_MACADDR0 (ETH_DMATXDESC_SAIRC_REPLACE_MACADDR0) /*!< Replace SA address in transmit frame with address value in MAC address register 0 */ +#define ETH_DMATXDESC_SA_INSTER_MACADDR1 (ETH_DMATXDESC_SAIRC_INSTER_MACADDR1) /*!< Insert address value in MAC address register 1 into transmit frame as SA address */ +#define ETH_DMATXDESC_SA_REPLACE_MACADDR1 (ETH_DMATXDESC_SAIRC_REPLACE_MACADDR1) /*!< Replace SA address in transmit frame with address value in MAC address register 1 */ +/** + * @} + */ + +/** + * @defgroup ETH_PMT_Flag ETH PMT Flag + * @{ + */ +#define ETH_PMT_FLAG_RTWKFR (ETH_MAC_PMTCTLR_RTWKFR) /*!< Wake-Up Frame Filter Register Pointer Reset */ +#define ETH_PMT_FLAG_WKFR (ETH_MAC_PMTCTLR_WKFR) /*!< Wake-Up Frame Received */ +#define ETH_PMT_FLAG_MPFR (ETH_MAC_PMTCTLR_MPFR) /*!< Magic Packet Received */ +/** + * @} + */ + +/** + * @defgroup ETH_PMT_Wakeup_Source ETH PMT Wakeup Source + * @{ + */ +#define ETH_PMT_WAKEUP_GLOBAL_UNICAST (ETH_MAC_PMTCTLR_GLUB) /*!< Global unicast */ +#define ETH_PMT_WAKEUP_WAKEUP_FRAME (ETH_MAC_PMTCTLR_WKEN) /*!< Wake-Up Frame */ +#define ETH_PMT_WAKEUP_MAGIC_PACKET (ETH_MAC_PMTCTLR_MPEN) /*!< Magic Packet */ +/** + * @} + */ + +/** + * @defgroup ETH_MMC_Counter_Preset_Mode ETH MMC Counter Preset Mode + * @{ + */ +#define ETH_MMC_COUNTER_PRESETMODE_DISABLE (0UL) /*!< Disable preset */ +#define ETH_MMC_COUNTER_PRESETMODE_HALFVALUE (ETH_MMC_MMCCTLR_MCPSET) /*!< Half-Value preset: 0x7FF0 */ +#define ETH_MMC_COUNTER_PRESETMODE_FULLVALUE (ETH_MMC_MMCCTLR_MCPSEL | ETH_MMC_MMCCTLR_MCPSET) /*!< Full-Value preset: 0xFFF0 */ +/** + * @} + */ + +/** + * @defgroup ETH_MMC_Read_Reset ETH MMC Read Reset + * @{ + */ +#define ETH_MMC_READ_RESET_DISABLE (0UL) +#define ETH_MMC_READ_RESET_ENABLE (ETH_MMC_MMCCTLR_ROR) +/** + * @} + */ + +/** + * @defgroup ETH_MMC_Counter_Reload ETH MMC Counter Reload + * @{ + */ +#define ETH_MMC_COUNTER_RELOAD_DISABLE (ETH_MMC_MMCCTLR_COS) +#define ETH_MMC_COUNTER_RELOAD_ENABLE (0UL) +/** + * @} + */ + +/** + * @defgroup ETH_MMC_Tx_Flag ETH MMC Tx Flag + * @{ + */ +#define ETH_MMC_FLAG_TXEDEIS (ETH_MMC_TRSSTSR_TXEDEIS) /*!< When Tx excessive deferral error frame counter reaches half or all the maximum value */ +#define ETH_MMC_FLAG_TXUGIS (ETH_MMC_TRSSTSR_TXUGIS) /*!< When Tx unicast good frame counter reaches half or all the maximum value */ +#define ETH_MMC_FLAG_TXCAEIS (ETH_MMC_TRSSTSR_TXCAEIS) /*!< When Tx carrier error frame counter reaches half or all the maximum value */ +#define ETH_MMC_FLAG_TXECEIS (ETH_MMC_TRSSTSR_TXECEIS) /*!< When Tx excessive collision error frame counter reaches half or all the maximum value */ +#define ETH_MMC_FLAG_TXLCEIS (ETH_MMC_TRSSTSR_TXLCEIS) /*!< When Tx deferral collision error frame counter reaches half or all the maximum value */ +#define ETH_MMC_FLAG_TXDEEIS (ETH_MMC_TRSSTSR_TXDEEIS) /*!< When Tx deferral error frame counter reaches half or all the maximum value */ +#define ETH_MMC_FLAG_TXMGIS (ETH_MMC_TRSSTSR_TXMGIS) /*!< When Tx multicast good frame counter reaches half or all the maximum value */ +#define ETH_MMC_FLAG_TXBGIS (ETH_MMC_TRSSTSR_TXBGIS) /*!< When Tx broadcast good frame counter reaches half or all the maximum value */ +/** + * @} + */ + +/** + * @defgroup ETH_MMC_Rx_Flag ETH MMC Rx Flag + * @{ + */ +#define ETH_MMC_FLAG_RXOEIS (ETH_MMC_REVSTSR_RXOEIS) /*!< When Rx out of scope error frame counter reaches half or all the maximum value */ +#define ETH_MMC_FLAG_RXLEIS (ETH_MMC_REVSTSR_RXLEIS) /*!< When Rx length error frame counter reaches half or all the maximum value */ +#define ETH_MMC_FLAG_RXUGIS (ETH_MMC_REVSTSR_RXUGIS) /*!< When Rx unicast good frame counter reaches half or all the maximum value */ +#define ETH_MMC_FLAG_RXREIS (ETH_MMC_REVSTSR_RXREIS) /*!< When Rx short error frame counter reaches half or all the maximum value */ +#define ETH_MMC_FLAG_RXAEIS (ETH_MMC_REVSTSR_RXAEIS) /*!< When Rx alignment error frame counter reaches half or all the maximum value */ +#define ETH_MMC_FLAG_RXCEIS (ETH_MMC_REVSTSR_RXCEIS) /*!< When Rx crc error frame counter reaches half or all the maximum value */ +#define ETH_MMC_FLAG_RXMGIS (ETH_MMC_REVSTSR_RXMGIS) /*!< When Rx multicast good frame counter reaches half or all the maximum value */ +#define ETH_MMC_FLAG_RXBGIS (ETH_MMC_REVSTSR_RXBGIS) /*!< When Rx broadcast good frame counter reaches half or all the maximum value */ +/** + * @} + */ + +/** + * @defgroup ETH_MMC_Tx_Interrupt ETH MMC Tx Interrupt + * @{ + */ +#define ETH_MMC_INT_TXEDEIM (ETH_MMC_TITCTLR_TXEDEIM) /*!< Tx excessive deferral error frame interrupt */ +#define ETH_MMC_INT_TXUGIM (ETH_MMC_TITCTLR_TXUGIM) /*!< Tx unicast good frame interrupt */ +#define ETH_MMC_INT_TXCAEIM (ETH_MMC_TITCTLR_TXCAEIM) /*!< Tx carrier error frame interrupt */ +#define ETH_MMC_INT_TXECEIM (ETH_MMC_TITCTLR_TXECEIM) /*!< Tx excessive collision error frame interrupt */ +#define ETH_MMC_INT_TXLCEIM (ETH_MMC_TITCTLR_TXLCEIM) /*!< Tx deferral collision error frame interrupt */ +#define ETH_MMC_INT_TXDEEIM (ETH_MMC_TITCTLR_TXDEEIM) /*!< Tx deferral error frame interrupt */ +#define ETH_MMC_INT_TXMGIM (ETH_MMC_TITCTLR_TXMGIM) /*!< Tx multicast good frame interrupt */ +#define ETH_MMC_INT_TXBGIM (ETH_MMC_TITCTLR_TXBGIM) /*!< Tx broadcast good frame interrupt */ +/** + * @} + */ + +/** + * @defgroup ETH_MMC_Rx_Interrupt ETH MMC Rx Interrupt + * @{ + */ +#define ETH_MMC_INT_RXOEIM (ETH_MMC_RITCTLR_RXOEIM) /*!< Rx out of scope error frame interrupt */ +#define ETH_MMC_INT_RXLEIM (ETH_MMC_RITCTLR_RXLEIM) /*!< Rx length error frame interrupt */ +#define ETH_MMC_INT_RXUGIM (ETH_MMC_RITCTLR_RXUGIM) /*!< Rx unicast good frame interrupt */ +#define ETH_MMC_INT_RXREIM (ETH_MMC_RITCTLR_RXREIM) /*!< Rx short error frame interrupt */ +#define ETH_MMC_INT_RXAEIM (ETH_MMC_RITCTLR_RXAEIM) /*!< Rx alignment error frame interrupt */ +#define ETH_MMC_INT_RXCEIM (ETH_MMC_RITCTLR_RXCEIM) /*!< Rx crc error frame interrupt */ +#define ETH_MMC_INT_RXMGIM (ETH_MMC_RITCTLR_RXMGIM) /*!< Rx multicast good frame interrupt */ +#define ETH_MMC_INT_RXBGIM (ETH_MMC_RITCTLR_RXBGIM) /*!< Rx broadcast good frame interrupt */ +/** + * @} + */ + +/** + * @defgroup ETH_MMC_Statistical_Register ETH MMC Statistical Register + * @{ + */ +#define ETH_MMC_REG_TXBRGFR (0x011CU) /*!< Tx broadcast good frame Statistical Register */ +#define ETH_MMC_REG_TXMUGFR (0x0120U) /*!< Tx multicast good frame Statistical Register */ +#define ETH_MMC_REG_TXDEEFR (0x0154U) /*!< Tx deferral error frame Statistical Register */ +#define ETH_MMC_REG_TXLCEFR (0x0158U) /*!< Tx deferral collision error frame Statistical Register */ +#define ETH_MMC_REG_TXECEFR (0x015CU) /*!< Tx excessive collision error frame Statistical Register */ +#define ETH_MMC_REG_TXCAEFR (0x0160U) /*!< Tx carrier error frame Statistical Register */ +#define ETH_MMC_REG_TXUNGFR (0x0168U) /*!< Tx unicast good frame Statistical Register */ +#define ETH_MMC_REG_TXEDEFR (0x016CU) /*!< Tx excessive deferral error frame Statistical Register */ +#define ETH_MMC_REG_RXBRGFR (0x018CU) /*!< Rx broadcast good frame Statistical Register */ +#define ETH_MMC_REG_RXMUGFR (0x0190U) /*!< Rx multicast good frame Statistical Register */ +#define ETH_MMC_REG_RXCREFR (0x0194U) /*!< Rx crc error frame Statistical Register */ +#define ETH_MMC_REG_RXALEFR (0x0198U) /*!< Rx alignment error frame Statistical Register */ +#define ETH_MMC_REG_RXRUEFR (0x019CU) /*!< Rx short error frame Statistical Register */ +#define ETH_MMC_REG_RXUNGFR (0x01C4U) /*!< Rx unicast good frame Statistical Register */ +#define ETH_MMC_REG_RXLEEFR (0x01C8U) /*!< Rx length error frame Statistical Register */ +#define ETH_MMC_REG_RXOREFR (0x01CCU) /*!< Rx out of scope error frame Statistical Register */ +/** + * @} + */ + +/** + * @defgroup ETH_PTP_Frame_DA_Filter ETH PTP Frame DA Filter + * @{ + */ +#define ETH_PTP_FRAME_DA_FILTER_DISABLE (0x00800000UL) +#define ETH_PTP_FRAME_DA_FILTER_ENABLE (ETH_PTP_TSPCTLR_TSPADF) +/** + * @} + */ + +/** + * @defgroup ETH_PTP_Snapshot_Datagram_Type ETH PTP Snapshot Datagram Type + * @{ + */ +#define ETH_PTP_DATAGRAM_TYPE_SYNC_FOLLOW_DELAY (0UL) /*!< SYNC Follow_Up Delay_Req Delay_Resp */ +#define ETH_PTP_DATAGRAM_TYPE_SYNC (ETH_PTP_TSPCTLR_TSPMTSEL_0) /*!< SYNC */ +#define ETH_PTP_DATAGRAM_TYPE_DELAY (ETH_PTP_TSPCTLR_TSPMTSEL_1 | ETH_PTP_TSPCTLR_TSPMTSEL_0) /*!< Delay_Req */ +#define ETH_PTP_DATAGRAM_TYPE_SYNC_FOLLOW_DELAY_PDELAY (ETH_PTP_TSPCTLR_TSPMTSEL_2) /*!< SYNC Follow_Up Delay_Req Delay_Resp Pdelay_Req Pdelay_Resp Pdelay_Resp_Follow_Up */ +#define ETH_PTP_DATAGRAM_TYPE_SYNC_PDELAY (ETH_PTP_TSPCTLR_TSPMTSEL_2 | ETH_PTP_TSPCTLR_TSPMTSEL_0) /*!< SYNC Pdelay_Req Pdelay_Resp */ +#define ETH_PTP_DATAGRAM_TYPE_DELAY_PDEALY (ETH_PTP_TSPCTLR_TSPMTSEL_2 | ETH_PTP_TSPCTLR_TSPMTSEL_1 | ETH_PTP_TSPCTLR_TSPMTSEL_0) /*!< Delay_Req Pdelay_Req Pdelay_Resp */ +#define ETH_PTP_DATAGRAM_TYPE_SYNC_DELAY (ETH_PTP_TSPCTLR_TSPMTSEL_3) /*!< SYNC Delay_Req */ +#define ETH_PTP_DATAGRAM_TYPE_PDELAY (ETH_PTP_TSPCTLR_TSPMTSEL_3 | ETH_PTP_TSPCTLR_TSPMTSEL_2) /*!< Pdelay_Req Pdelay_Resp */ +/** + * @} + */ + +/** + * @defgroup ETH_PTP_Snapshot_Frame_Type ETH PTP Snapshot Frame Type + * @{ + */ +#define ETH_PTP_FRAME_TYPE_IPV4FRAME (ETH_PTP_TSPCTLR_TSPOVIPV4) /*!< Time stamp snapshot for IPv4 frame */ +#define ETH_PTP_FRAME_TYPE_IPV6FRAME (ETH_PTP_TSPCTLR_TSPOVIPV6) /*!< Time stamp snapshot for IPv6 frame */ +#define ETH_PTP_FRAME_TYPE_ETHERNETFRAME (ETH_PTP_TSPCTLR_TSPOVETH) /*!< Time stamp snapshot for PTP over ethernet frame */ +#define ETH_PTP_FRAME_TYPE_ALL_RECEIVEFRAME (ETH_PTP_TSPCTLR_TSPEALL) /*!< Time stamp snapshot for all received frame */ +/** + * @} + */ + +/** + * @defgroup ETH_PTP_Datagram_Version ETH PTP Datagram Version + * @{ + */ +#define ETH_PTP_DATAGRAM_VERSION_IEEE1588V1 (0UL) +#define ETH_PTP_DATAGRAM_VERSION_IEEE1588V2 (ETH_PTP_TSPCTLR_TSPVER) +/** + * @} + */ + +/** + * @defgroup ETH_PTP_Subsecond_Scale ETH PTP Subsecond Scale + * @{ + */ +#define ETH_PTP_SUBSECOND_SCALE_HEX (0UL) /*!< The Second register increase 1 when SubSecond count to 0x7FFFFFFFH */ +#define ETH_PTP_SUBSECOND_SCALE_DEC (ETH_PTP_TSPCTLR_TSPSSR) /*!< The Second register increase 1 when SubSecond count to 0x3B9AC9FFH */ +/** + * @} + */ + +/** + * @defgroup ETH_PTP_Calibration_Mode ETH PTP Calibration Mode + * @{ + */ +#define ETH_PTP_CALIBRATION_MODE_COARSE (0UL) /*!< Coarse calibration */ +#define ETH_PTP_CALIBRATION_MODE_FINE (ETH_PTP_TSPCTLR_TSPUPSEL) /*!< Fine calibration */ +/** + * @} + */ + +/** + * @defgroup ETH_PTP_Time_Update_Sign ETH PTP Time Update Sign + * @{ + */ +#define ETH_PTP_TIME_UPDATE_SIGN_MINUS (0UL) /*!< Minus for update register value */ +#define ETH_PTP_TIME_UPDATE_SIGN_PLUS (ETH_PTP_TMUNSER_TSPUPNS) /*!< Plus for update register value */ +/** + * @} + */ + +/** + * @defgroup ETH_PTP_Flag ETH PTP Flag + * @{ + */ +#define ETH_PTP_FLAG_TSERR1 (ETH_PTP_TSPSTSR_TSERR1) /*!< Target time 1 error */ +#define ETH_PTP_FLAG_TSTAR1 (ETH_PTP_TSPSTSR_TSTAR1) /*!< Target time 1 reached */ +#define ETH_PTP_FLAG_TSERR0 (ETH_PTP_TSPSTSR_TSERR0) /*!< Target time 0 error */ +#define ETH_PTP_FLAG_TSTAR0 (ETH_PTP_TSPSTSR_TSTAR0) /*!< Target time 0 reached */ +#define ETH_PTP_FLAG_TSOVF (ETH_PTP_TSPSTSR_TSOVF) /*!< System time overflow */ +/** + * @} + */ + +/** + * @defgroup ETH_PPS_Target_Channel ETH PPS Target Channel + * @{ + */ +#define ETH_PPS_TARGET_CH0 (0x00U) +#define ETH_PPS_TARGET_CH1 (0x01U) +/** + * @} + */ + +/** + * @defgroup ETH_PPS_Target_Time_Function ETH PPS Target Time Function + * @{ + */ +#define ETH_PPS_TARGET_TIME_FUNC_INT_EVENT (0UL) /*!< The Target register is used only for interrupt output event */ +#define ETH_PPS_TARGET_TIME_FUNC_INT_PPS_EVENT (ETH_PTP_PPSCTLR_TT0SEL_1) /*!< The Target register is used for interrupt out event and PPS single output event */ +#define ETH_PPS_TARGET_TIME_FUNC_PPS_EVENT (ETH_PTP_PPSCTLR_TT0SEL) /*!< The Target register is used for PPS single output event */ +/** + * @} + */ + +/** + * @defgroup ETH_PPS_Output_Mode ETH PPS Output Mode + * @note PPS1(ETH_PPS_TARGET_CH1) only supports single output mode(ETH_PPS_OUTPUT_MODE_SINGLE). + * @{ + */ +#define ETH_PPS_OUTPUT_MODE_CONTINUE (0UL) /*!< Continuous output mode */ +#define ETH_PPS_OUTPUT_MODE_SINGLE (ETH_PTP_PPSCTLR_PPSOMD) /*!< Single output mode */ +/** + * @} + */ + +/** + * @defgroup ETH_PPS_Output_Frequency ETH PPS Output Frequency + * @note PPS1(ETH_PPS_TARGET_CH1) only supports generate a pulse(ETH_PPS_OUTPUT_ONE_PULSE). + * @{ + */ +#define ETH_PPS_OUTPUT_FREQ_1HZ (0UL) /*!< Ouput pulse is 1HZ in continuous ouput mode */ +#define ETH_PPS_OUTPUT_FREQ_2HZ (ETH_PTP_PPSCTLR_PPSFRE0_0) /*!< Ouput pulse is 2HZ in continuous ouput mode */ +#define ETH_PPS_OUTPUT_FREQ_4HZ (ETH_PTP_PPSCTLR_PPSFRE0_1) /*!< Ouput pulse is 4HZ in continuous ouput mode */ +#define ETH_PPS_OUTPUT_FREQ_8HZ (ETH_PTP_PPSCTLR_PPSFRE0_1 | ETH_PTP_PPSCTLR_PPSFRE0_0) /*!< Ouput pulse is 8HZ in continuous ouput mode */ +#define ETH_PPS_OUTPUT_FREQ_16HZ (ETH_PTP_PPSCTLR_PPSFRE0_2) /*!< Ouput pulse is 16HZ in continuous ouput mode */ +#define ETH_PPS_OUTPUT_FREQ_32HZ (ETH_PTP_PPSCTLR_PPSFRE0_2 | ETH_PTP_PPSCTLR_PPSFRE0_0) /*!< Ouput pulse is 32HZ in continuous ouput mode */ +#define ETH_PPS_OUTPUT_FREQ_64HZ (ETH_PTP_PPSCTLR_PPSFRE0_2 | ETH_PTP_PPSCTLR_PPSFRE0_1) /*!< Ouput pulse is 64HZ in continuous ouput mode */ +#define ETH_PPS_OUTPUT_FREQ_128HZ (ETH_PTP_PPSCTLR_PPSFRE0_2 | ETH_PTP_PPSCTLR_PPSFRE0_1 | ETH_PTP_PPSCTLR_PPSFRE0_0) /*!< Ouput pulse is 128HZ in continuous ouput mode */ +#define ETH_PPS_OUTPUT_FREQ_256HZ (ETH_PTP_PPSCTLR_PPSFRE0_3) /*!< Ouput pulse is 256HZ in continuous ouput mode */ +#define ETH_PPS_OUTPUT_FREQ_512HZ (ETH_PTP_PPSCTLR_PPSFRE0_3 | ETH_PTP_PPSCTLR_PPSFRE0_0) /*!< Ouput pulse is 512HZ in continuous ouput mode */ +#define ETH_PPS_OUTPUT_FREQ_1024HZ (ETH_PTP_PPSCTLR_PPSFRE0_3 | ETH_PTP_PPSCTLR_PPSFRE0_1) /*!< Ouput pulse is 1024HZ in continuous ouput mode */ +#define ETH_PPS_OUTPUT_FREQ_2048HZ (ETH_PTP_PPSCTLR_PPSFRE0_3 | ETH_PTP_PPSCTLR_PPSFRE0_1 | ETH_PTP_PPSCTLR_PPSFRE0_0) /*!< Ouput pulse is 2048HZ in continuous ouput mode */ +#define ETH_PPS_OUTPUT_FREQ_4096HZ (ETH_PTP_PPSCTLR_PPSFRE0_3 | ETH_PTP_PPSCTLR_PPSFRE0_2) /*!< Ouput pulse is 4096HZ in continuous ouput mode */ +#define ETH_PPS_OUTPUT_FREQ_8192HZ (ETH_PTP_PPSCTLR_PPSFRE0_3 | ETH_PTP_PPSCTLR_PPSFRE0_2 | ETH_PTP_PPSCTLR_PPSFRE0_0) /*!< Ouput pulse is 8192HZ in continuous ouput mode */ +#define ETH_PPS_OUTPUT_FREQ_16384HZ (ETH_PTP_PPSCTLR_PPSFRE0_3 | ETH_PTP_PPSCTLR_PPSFRE0_2 | ETH_PTP_PPSCTLR_PPSFRE0_1) /*!< Ouput pulse is 16384HZ in continuous ouput mode */ +#define ETH_PPS_OUTPUT_FREQ_32768HZ (ETH_PTP_PPSCTLR_PPSFRE0) /*!< Ouput pulse is 32768HZ in continuous ouput mode */ +#define ETH_PPS_OUTPUT_ONE_PULSE (ETH_PTP_PPSCTLR_PPSFRE0_0) /*!< One pulse is generated in single ouput mode */ +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup ETH_Global_Functions + * @{ + */ + +/** + * @brief Generate MAC pause control frame. + * @param None + * @retval None + */ +__STATIC_INLINE void ETH_MAC_GeneratePauseCtrlFrame(void) +{ + WRITE_REG32(bM4_ETH->MAC_FLOCTLR_b.FCA_BPA, Enable); +} + +/** + * @brief Get MAC flow control status. + * @param None + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +__STATIC_INLINE en_flag_status_t ETH_MAC_GetFlowCtrlStatus(void) +{ + return ((en_flag_status_t)READ_REG32(bM4_ETH->MAC_FLOCTLR_b.FCA_BPA)); +} + +/** + * @brief Resume the DMA Transmit. + * @param None + * @retval None + */ +__STATIC_INLINE void ETH_DMA_ResumeTransmit(void) +{ + WRITE_REG32(M4_ETH->DMA_TXPOLLR, 0U); +} + +/** + * @brief Resume the DMA Receive. + * @param None + * @retval None + */ +__STATIC_INLINE void ETH_DMA_ResumeReceive(void) +{ + WRITE_REG32(M4_ETH->DMA_RXPOLLR, 0U); +} + +/** + * @brief Get DMA error status. + * @param None + * @retval uint32_t The new DMA error status + * The error status may be one of the following values: + * - ETH_DMA_ERRORSTATE_RX_WRITEDATA: TxDMA generates error while reading descriptor + * - ETH_DMA_ERRORSTATE_TX_READDATA: TxDMA generates error while reading descriptor + * - ETH_DMA_ERRORSTATE_RX_WRITEDESC: TxDMA generates error while reading descriptor + * - ETH_DMA_ERRORSTATE_TX_WRITEDESC: TxDMA generates error while reading descriptor + * - ETH_DMA_ERRORSTATE_RX_READDESC: TxDMA generates error while reading descriptor + * - ETH_DMA_ERRORSTATE_TX_READDESC: TxDMA generates error while reading descriptor + */ +__STATIC_INLINE uint32_t ETH_DMA_GetErrorStatus(void) +{ + return (READ_REG32_BIT(M4_ETH->DMA_DMASTSR, ETH_DMA_DMASTSR_EBUS)); +} + +/** + * @brief Get DMA transmit status. + * @param None + * @retval uint32_t The new DMA transmit status + * The transmit status may be one of the following values: + * - ETH_DMA_TRANSMITSTATE_STOPPED: Stopped - Reset or Stop Tx Command issued + * - ETH_DMA_TRANSMITSTATE_FETCHING: Running - Fetching the Tx descriptor + * - ETH_DMA_TRANSMITSTATE_WAITING: Running - Waiting for status + * - ETH_DMA_TRANSMITSTATE_READING: Running - Reading the data from host memory + * - ETH_DMA_TRANSMITSTATE_WRITING: Running - Writing the time stamp + * - ETH_DMA_TRANSMITSTATE_SUSPENDED: Suspended - Tx Descriptor unavailable + * - ETH_DMA_TRANSMITSTATE_CLOSING: Running - Closing Rx descriptor + */ +__STATIC_INLINE uint32_t ETH_DMA_GetTransmitStatus(void) +{ + return (READ_REG32_BIT(M4_ETH->DMA_DMASTSR, ETH_DMA_DMASTSR_TSTS)); +} + +/** + * @brief Get DMA receive status. + * @param None + * @retval uint32_t The new DMA receive status + * The receive status may be one of the following values: + * - ETH_DMA_RECEIVESTATE_STOPPED: Stopped - Reset or Stop Rx Command issued + * - ETH_DMA_RECEIVESTATE_FETCHING: Running - Fetching the Rx descriptor + * - ETH_DMA_RECEIVESTATE_WAITING: Running - Waiting for packet + * - ETH_DMA_RECEIVESTATE_SUSPENDED: Suspended - Rx Descriptor unavailable + * - ETH_DMA_RECEIVESTATE_CLOSING: Running - Closing descriptor + * - ETH_DMA_RECEIVESTATE_WRITING: Running - Writing the time stamp + * - ETH_DMA_RECEIVESTATE_QUEUING: Running - Queuing the receive frame into host memory + */ +__STATIC_INLINE uint32_t ETH_DMA_GetReceiveStatus(void) +{ + return (READ_REG32_BIT(M4_ETH->DMA_DMASTSR, ETH_DMA_DMASTSR_RSTS)); +} + +/** + * @brief Get DMA Rx Overflow Missed Frame Counter value. + * @param None + * @retval uint32_t Rx Overflow Missed Frame Counter value + */ +__STATIC_INLINE uint32_t ETH_DMA_GetRxOvfMissFrameCnt(void) +{ + return ((READ_REG32_BIT(M4_ETH->DMA_RFRCNTR, ETH_DMA_RFRCNTR_OVFCNT)) >> ETH_DMA_RFRCNTR_OVFCNT_POS); +} + +/** + * @brief Get DMA Buffer Unavailable Missed Frame Counter value. + * @param None + * @retval uint32_t Buffer Unavailable Missed Frame Counter value + */ +__STATIC_INLINE uint32_t ETH_DMA_GetBufferUnavaiMissFrameCnt(void) +{ + return (READ_REG32_BIT(M4_ETH->DMA_RFRCNTR, ETH_DMA_RFRCNTR_UNACNT)); +} + +/** + * @brief Get DMA current Tx descriptor start address. + * @param None + * @retval uint32_t Transmit descriptor start address + */ +__STATIC_INLINE uint32_t ETH_DMA_GetCurTxDescAddr(void) +{ + return (READ_REG32(M4_ETH->DMA_CHTXDER)); +} + +/** + * @brief Get DMA current Rx descriptor start address. + * @param None + * @retval uint32_t Receive descriptor start address + */ +__STATIC_INLINE uint32_t ETH_DMA_GetCurRxDescAddr(void) +{ + return (READ_REG32(M4_ETH->DMA_CHRXDER)); +} + +/** + * @brief Get DMA current Tx buffer address. + * @param None + * @retval uint32_t Transmit buffer address + */ +__STATIC_INLINE uint32_t ETH_DMA_GetCurTxBufferAddr(void) +{ + return (READ_REG32(M4_ETH->DMA_CHTXBFR)); +} + +/** + * @brief Get DMA current Rx buffer address. + * @param None + * @retval uint32_t Receive buffer address + */ +__STATIC_INLINE uint32_t ETH_DMA_GetCurRxBufferAddr(void) +{ + return (READ_REG32(M4_ETH->DMA_CHRXBFR)); +} + +/** + * @brief Get PMT wakeup frame filter register pointer index. + * @param None + * @retval uint8_t Filter register pointer index. + */ +__STATIC_INLINE uint8_t ETH_PMT_GetWakeupFramePointerIndex(void) +{ + return ((uint8_t)(READ_REG32_BIT(M4_ETH->MAC_PMTCTLR, ETH_MAC_PMTCTLR_RTWKPT) >> ETH_MAC_PMTCTLR_RTWKPT_POS)); +} + +/** + * @brief Get PTP snapshot frame type. + * @param None + * @retval uint32_t Receive frame type + */ +__STATIC_INLINE uint32_t ETH_PTP_GetSnapFrameType(void) +{ + return (READ_REG32_BIT(M4_ETH->PTP_TSPCTLR, + (ETH_PTP_TSPCTLR_TSPOVIPV4 | ETH_PTP_TSPCTLR_TSPOVIPV6 | + ETH_PTP_TSPCTLR_TSPOVETH | ETH_PTP_TSPCTLR_TSPEALL))); +} + +en_result_t ETH_DeInit(void); +en_result_t ETH_Init(stc_eth_handle_t *pstcEthHandle, stc_eth_init_t *pstcEthInit); +en_result_t ETH_CommStructInit(stc_eth_comm_init_t *pstcCommInit); +en_result_t ETH_StructInit(stc_eth_init_t *pstcEthInit); +en_result_t ETH_Start(void); +en_result_t ETH_Stop(void); + +/* PHY Functions */ +en_result_t ETH_PHY_WriteRegister(stc_eth_handle_t *pstcEthHandle, uint16_t u16Reg, uint16_t u16RegVal); +en_result_t ETH_PHY_ReadRegister(stc_eth_handle_t *pstcEthHandle, uint16_t u16Reg, uint16_t *pu16RegVal); +en_result_t ETH_PHY_LoopBackCmd(stc_eth_handle_t *pstcEthHandle, en_functional_state_t enNewSta); + +/* MAC Functions */ +void ETH_MAC_DeInit(void); +en_result_t ETH_MAC_Init(stc_eth_handle_t *pstcEthHandle, const stc_eth_mac_init_t *pstcMacInit); +en_result_t ETH_MAC_StructInit(stc_eth_mac_init_t *pstcMacInit); +void ETH_MAC_SetDuplexSpeed(uint32_t u32DuplexMode, uint32_t u32Speed); +void ETH_MAC_SetHashTable(uint32_t u32HashHigh, uint32_t u32HashLow); +void ETH_MAC_SetTxVlanTagVal(uint16_t u16TxTag); +void ETH_MAC_SetRxVlanTagVal(uint16_t u16RxTag); +void ETH_MAC_SetRxVlanHashTable(uint16_t u16HashVal); +void ETH_MAC_LoopBackCmd(en_functional_state_t enNewSta); +void ETH_MAC_GeneratePauseCtrlFrame(void); +void ETH_MAC_BackPressureCmd(en_functional_state_t enNewSta); +void ETH_MAC_TransmitCmd(en_functional_state_t enNewSta); +void ETH_MAC_ReceiveCmd(en_functional_state_t enNewSta); +void ETH_MAC_IntCmd(uint32_t u32IntSrc, en_functional_state_t enNewSta); +en_flag_status_t ETH_MAC_GetIntStatus(uint32_t u32Flag); +en_flag_status_t ETH_MAC_GetFlowCtrlStatus(void); + +/* MAC Address Functions */ +void ETH_MACADDR_DeInit(uint32_t u32Index); +en_result_t ETH_MACADDR_Init(uint32_t u32Index, const stc_eth_mac_addr_config_t *pstcMacAddrInit); +en_result_t ETH_MACADDR_StructInit(stc_eth_mac_addr_config_t *pstcMacAddrInit); +en_result_t ETH_MACADDR_SetAddress(uint32_t u32Index, uint8_t au8Addr[]); +en_result_t ETH_MACADDR_GetAddress(uint32_t u32Index, uint8_t au8Addr[]); +void ETH_MACADDR_SetFilterMode(uint32_t u32Index, uint32_t u32Mode); +void ETH_MACADDR_SetFilterMask(uint32_t u32Index, uint32_t u32Mask); + +/* MAC L3L4 Filter Functions */ +void ETH_MAC_L3L4FilterDeInit(void); +en_result_t ETH_MAC_L3L4FilterInit(const stc_eth_l3l4_filter_config_t *pstcL3L4FilterInit); +en_result_t ETH_MAC_L3L4FilterStructInit(stc_eth_l3l4_filter_config_t *pstcL3L4FilterInit); +void ETH_MAC_L3L4FilterCmd(en_functional_state_t enNewSta); +void ETH_MAC_SetPortFilterProtocol(uint32_t u32PortProtocol); +void ETH_MAC_SetDestPortFilterVal(uint16_t u16Port); +void ETH_MAC_SetSrcPortFilterVal(uint16_t u16Port); +void ETH_MAC_SetAddrFilterProtocol(uint32_t u32AddrProtocol); +void ETH_MAC_SetIpv4DestAddrFilterVal(uint32_t u32Addr); +void ETH_MAC_SetIpv4SrcAddrFilterVal(uint32_t u32Addr); +en_result_t ETH_MAC_SetIpv6AddrFilterVal(const uint32_t au32Addr[]); + +/* DMA Functions */ +void ETH_DMA_DeInit(void); +en_result_t ETH_DMA_Init(const stc_eth_dma_init_t *pstcDmaInit); +en_result_t ETH_DMA_StructInit(stc_eth_dma_init_t *pstcDmaInit); +en_result_t ETH_DMA_SoftwareReset(void); +void ETH_DMA_ResumeTransmit(void); +void ETH_DMA_ResumeReceive(void); +void ETH_DMA_SetTransPrioRatio(uint32_t u32PrioRatio); +void ETH_DMA_SetRxWatchdogCounter(uint8_t u8Value); +en_result_t ETH_DMA_FlushTransmitFIFO(void); +void ETH_DMA_TransmitCmd(en_functional_state_t enNewSta); +void ETH_DMA_ReceiveCmd(en_functional_state_t enNewSta); +void ETH_DMA_IntCmd(uint32_t u32IntSrc, en_functional_state_t enNewSta); +en_flag_status_t ETH_DMA_GetStatus(uint32_t u32Flag); +uint32_t ETH_DMA_GetErrorStatus(void); +uint32_t ETH_DMA_GetTransmitStatus(void); +uint32_t ETH_DMA_GetReceiveStatus(void); +en_flag_status_t ETH_DMA_GetOvfStatus(uint32_t u32Flag); +uint32_t ETH_DMA_GetRxOvfMissFrameCnt(void); +uint32_t ETH_DMA_GetBufferUnavaiMissFrameCnt(void); +uint32_t ETH_DMA_GetCurTxDescAddr(void); +uint32_t ETH_DMA_GetCurRxDescAddr(void); +uint32_t ETH_DMA_GetCurTxBufferAddr(void); +uint32_t ETH_DMA_GetCurRxBufferAddr(void); + +/* DMA descriptor Functions */ +en_result_t ETH_DMA_TxDescListInit(stc_eth_handle_t *pstcEthHandle, stc_eth_dma_desc_t astcTxDescTab[], const uint8_t au8TxBuffer[], uint32_t u32TxBufferCnt); +en_result_t ETH_DMA_RxDescListInit(stc_eth_handle_t *pstcEthHandle, stc_eth_dma_desc_t astcRxDescTab[], const uint8_t au8RxBuffer[], uint32_t u32RxBufferCnt); +en_result_t ETH_DMA_SetTransmitFrame(stc_eth_handle_t *pstcEthHandle, uint32_t u32FrameLength); +en_result_t ETH_DMA_GetReceiveFrame(stc_eth_handle_t *pstcEthHandle); +en_result_t ETH_DMA_GetReceiveFrame_Interrupt(stc_eth_handle_t *pstcEthHandle); +en_result_t ETH_DMA_SetTxDescOwn(stc_eth_dma_desc_t *pstcTxDesc, uint32_t u32Owner); +en_result_t ETH_DMA_SetTxDescBufferSize(stc_eth_dma_desc_t *pstcTxDesc, uint8_t u8BufferNum, uint32_t u32BufferSize); +en_result_t ETH_DMA_TxDescChecksumInsertConfig(stc_eth_dma_desc_t *pstcTxDesc, uint32_t u32ChecksumMode); +en_result_t ETH_DMA_TxDescVlanInsertConfig(stc_eth_dma_desc_t *pstcTxDesc, uint32_t u32VlanMode); +en_result_t ETH_DMA_TxDescSAInsertConfig(stc_eth_dma_desc_t *pstcTxDesc, uint32_t u32SAMode); +en_result_t ETH_DMA_TxDescCRCCmd(stc_eth_dma_desc_t *pstcTxDesc, en_functional_state_t enNewSta); +en_result_t ETH_DMA_TxDescPADCmd(stc_eth_dma_desc_t *pstcTxDesc, en_functional_state_t enNewSta); +en_result_t ETH_DMA_TxDescTimestamp(stc_eth_dma_desc_t *pstcTxDesc, en_functional_state_t enNewSta); +en_result_t ETH_DMA_TxDescReplaceCRCCmd(stc_eth_dma_desc_t *pstcTxDesc, en_functional_state_t enNewSta); +en_result_t ETH_DMA_TxDescIntCmd(stc_eth_dma_desc_t *pstcTxDesc, en_functional_state_t enNewSta); +en_flag_status_t ETH_DMA_GetTxDescStatus(const stc_eth_dma_desc_t *pstcTxDesc, uint32_t u32Flag); +en_result_t ETH_DMA_GetTxDescCollisionCnt(const stc_eth_dma_desc_t *pstcTxDesc, uint32_t *pu32ColliCnt); +en_result_t ETH_DMA_GetTxDescTimeStamp(const stc_eth_dma_desc_t *pstcTxDesc, uint32_t *pu32High, uint32_t *pu32Low); +en_result_t ETH_DMA_SetRxDescOwn(stc_eth_dma_desc_t *pstcRxDesc, uint32_t u32Owner); +en_result_t ETH_DMA_RxDescIntCmd(stc_eth_dma_desc_t *pstcRxDesc, en_functional_state_t enNewSta); +en_flag_status_t ETH_DMA_GetRxDescStatus(const stc_eth_dma_desc_t *pstcRxDesc, uint32_t u32Flag); +en_flag_status_t ETH_DMA_GetRxDescExtendStatus(const stc_eth_dma_desc_t *pstcRxDesc, uint32_t u32Flag); +en_result_t ETH_DMA_GetRxDescPayloadType(const stc_eth_dma_desc_t *pstcRxDesc, uint32_t *pu32PayloadType); +en_result_t ETH_DMA_GetRxDescDatagramType(const stc_eth_dma_desc_t *pstcRxDesc, uint32_t *pu32DatagramType); +en_result_t ETH_DMA_GetRxDescFrameLength(const stc_eth_dma_desc_t *pstcRxDesc, uint32_t *pu32FrameLength); +en_result_t ETH_DMA_GetRxDescBufferSize(const stc_eth_dma_desc_t *pstcRxDesc, uint8_t u8BufferNum, uint32_t *pu32BufferSize); +en_result_t ETH_DMA_GetRxDescTimeStamp(const stc_eth_dma_desc_t *pstcRxDesc, uint32_t *pu32High, uint32_t *pu32Low); + +/* MAC PMT Functions */ +en_result_t ETH_PMT_ResetWakeupFramePointer(void); +en_result_t ETH_PMT_WriteWakeupFrameRegister(const uint32_t au32RegBuffer[]); +void ETH_PMT_ForwardWakeupFrameCmd(en_functional_state_t enNewSta); +void ETH_PMT_WakeupSourceCmd(uint32_t u32WakeupSrc, en_functional_state_t enNewSta); +en_result_t ETH_PMT_EnterPowerDown(void); +en_flag_status_t ETH_PMT_GetStatus(uint32_t u32Flag); +uint8_t ETH_PMT_GetWakeupFramePointerIndex(void); + +/* MMC Functions */ +en_result_t ETH_MMC_DeInit(void); +en_result_t ETH_MMC_Init(const stc_eth_mmc_init_t *pstcMmcInit); +en_result_t ETH_MMC_StructInit(stc_eth_mmc_init_t *pstcMmcInit); +en_result_t ETH_MMC_CounterReset(void); +void ETH_MMC_ResetAfterReadCmd(en_functional_state_t enNewSta); +void ETH_MMC_Cmd(en_functional_state_t enNewSta); +void ETH_MMC_TxIntCmd(uint32_t u32IntSrc, en_functional_state_t enNewSta); +void ETH_MMC_RxIntCmd(uint32_t u32IntSrc, en_functional_state_t enNewSta); +en_flag_status_t ETH_MMC_GetTxStatus(uint32_t u32Flag); +en_flag_status_t ETH_MMC_GetRxStatus(uint32_t u32Flag); +uint32_t ETH_MMC_GetRegister(uint32_t u32Reg); + +/* PTP Functions */ +void ETH_PTP_DeInit(void); +en_result_t ETH_PTP_Init(const stc_eth_ptp_init_t *pstcPtpInit); +en_result_t ETH_PTP_StructInit(stc_eth_ptp_init_t *pstcPtpInit); +void ETH_PTP_SetSnapDatagramType(uint32_t u32DatagramType); +void ETH_PTP_SetSnapFrameType(uint32_t u32FrameType); +uint32_t ETH_PTP_GetSnapFrameType(void); +void ETH_PTP_SetCalibMode(uint32_t u32CalibMode); +en_result_t ETH_PTP_UpdateBasicIncValue(void); +en_result_t ETH_PTP_UpdateSystemTime(void); +en_result_t ETH_PTP_SystemTimeInit(void); +en_result_t ETH_PTP_GetSystemTime(uint32_t *pu32Sec, uint32_t *pu32SubSec); +void ETH_PTP_SetIncValue(uint32_t u32BasicVal, uint8_t u8SubSecVal); +en_result_t ETH_PTP_GetIncValue(uint32_t *pu32BasicVal, uint8_t *pu8SubSecVal); +void ETH_PTP_SetUpdateTime(uint32_t u32Sign, uint32_t u32Sec, uint32_t u32SubSec); +void ETH_PTP_Cmd(en_functional_state_t enNewSta); +void ETH_PTP_IntCmd(en_functional_state_t enNewSta); +en_flag_status_t ETH_PTP_GetStatus(uint32_t u32Flag); + +/* PTP PPS Functions */ +void ETH_PPS_DeInit(uint8_t u8Ch); +en_result_t ETH_PPS_Init(uint8_t u8Ch, const stc_eth_pps_config_t *pstcPpsInit); +en_result_t ETH_PPS_StructInit(stc_eth_pps_config_t *pstcPpsInit); +void ETH_PPS_SetTargetTime(uint8_t u8Ch, uint32_t u32Sec, uint32_t u32SubSec); +void ETH_PPS_SetTargetTimeFunc(uint8_t u8Ch, uint32_t u32Func); +void ETH_PPS_SetPps0OutputMode(uint32_t u32OutputMode); +void ETH_PPS_SetPps0OutputFreq(uint32_t u32OutputFreq); + +/** + * @} + */ + +#endif /* DDL_ETH_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_ETH_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_fcm.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_fcm.h new file mode 100644 index 0000000000..8bbd68176c --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_fcm.h @@ -0,0 +1,307 @@ +/** + ******************************************************************************* + * @file hc32f4a0_fcm.h + * @brief This file contains all the functions prototypes of the FCM driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Zhangxl First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_FCM_H__ +#define __HC32F4A0_FCM_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_FCM + * @{ + */ + +#if (DDL_FCM_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup FCM_Global_Types FCM Global Types + * @{ + */ +/** + * @brief FCM Init structure definition + */ +typedef struct +{ + uint16_t u16LowerLimit; /*!< FCM lower limit value*/ + + uint16_t u16UpperLimit; /*!< FCM upper limit value*/ + + uint32_t u32TarClk; /*!< FCM target clock source selection, \ + @ref FCM_Init_Config for details */ + + uint32_t u32TarClkDiv; /*!< FCM target clock source division selection,\ + @ref FCM_Init_Config for details */ + + uint32_t u32ExRefClkEn; /*!< FCM external reference clock function config, \ + @ref FCM_Init_Config for details */ + + uint32_t u32RefClkEdge; /*!< FCM reference clock trigger edge selection,\ + @ref FCM_Init_Config for details */ + + uint32_t u32DigFilter; /*!< FCM digital filter function config, \ + @ref FCM_Init_Config for details */ + + uint32_t u32RefClk; /*!< FCM reference clock source selection, \ + @ref FCM_Init_Config for details */ + + uint32_t u32RefClkDiv; /*!< FCM reference clock source division selection, \ + @ref FCM_Init_Config for details */ + + uint32_t u32RstEn; /*!< FCM abnormal reset function config, \ + @ref FCM_Init_Config for details */ + + uint32_t u32IntRstSel; /*!< FCM abnormal detecting behavior selection, \ + @ref FCM_Init_Config */ + + uint32_t u32IntType; /*!< FCM interrupt type selection, \ + @ref FCM_Init_Config for details. */ +} stc_fcm_init_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup FCM_Global_Macros FCM Global Macros + * @{ + */ + +/** + * @defgroup FCM_Registers_Reset_Value FCM Registers Reset Value + * @{ + */ +#define FCM_REG_RESET_VALUE (0x00000000UL) +/** + * @} + */ + +/** + * @defgroup FCM_Init_Config FCM init config + * @{ + */ + +/** + * @brief FCM target clock source selection + */ +#define FCM_TAR_CLK_XTAL (0x00UL << FCM_MCCR_MCKS_POS) +#define FCM_TAR_CLK_XTAL32 (0x01UL << FCM_MCCR_MCKS_POS) +#define FCM_TAR_CLK_HRC (0x02UL << FCM_MCCR_MCKS_POS) +#define FCM_TAR_CLK_LRC (0x03UL << FCM_MCCR_MCKS_POS) +#define FCM_TAR_CLK_SWDTLRC (0x04UL << FCM_MCCR_MCKS_POS) +#define FCM_TAR_CLK_PCLK1 (0x05UL << FCM_MCCR_MCKS_POS) +#define FCM_TAR_CLK_PLLAP (0x06UL << FCM_MCCR_MCKS_POS) +#define FCM_TAR_CLK_MRC (0x07UL << FCM_MCCR_MCKS_POS) +#define FCM_TAR_CLK_PLLHP (0x08UL << FCM_MCCR_MCKS_POS) +#define FCM_TAR_CLK_RTCLRC (0x09UL << FCM_MCCR_MCKS_POS) + +/** + * @brief FCM target clock division + */ +#define FCM_TAR_CLK_DIV1 (0x00UL) +#define FCM_TAR_CLK_DIV4 (0x01UL) +#define FCM_TAR_CLK_DIV8 (0x02UL) +#define FCM_TAR_CLK_DIV32 (0x03UL) + +/** + * @brief FCM external reference clock function config + */ +#define FCM_EX_REF_OFF (0x00UL) +#define FCM_EX_REF_ON (FCM_RCCR_EXREFE) + +/** + * @brief FCM reference clock edge config + */ +#define FCM_REF_CLK_RISING (0x00UL) +#define FCM_REF_CLK_FALLING (FCM_RCCR_EDGES_0) +#define FCM_REF_CLK_BOTH (FCM_RCCR_EDGES_1) + +/** + * @brief FCM digital filter function config + */ +#define FCM_DF_OFF (0x00UL) +#define FCM_DF_MCKS_DIV1 (FCM_RCCR_DNFS_0) +#define FCM_DF_MCKS_DIV4 (FCM_RCCR_DNFS_1) +#define FCM_DF_MCKS_DIV16 (FCM_RCCR_DNFS) + +/** + * @brief FCM reference clock source selection + */ +#define FCM_REF_CLK_EXINPUT (0x00UL << FCM_RCCR_RCKS_POS) +#define FCM_REF_CLK_XTAL (0x10UL << FCM_RCCR_RCKS_POS) +#define FCM_REF_CLK_XTAL32 (0x11UL << FCM_RCCR_RCKS_POS) +#define FCM_REF_CLK_HRC (0x12UL << FCM_RCCR_RCKS_POS) +#define FCM_REF_CLK_LRC (0x13UL << FCM_RCCR_RCKS_POS) +#define FCM_REF_CLK_SWDTLRC (0x14UL << FCM_RCCR_RCKS_POS) +#define FCM_REF_CLK_PCLK1 (0x15UL << FCM_RCCR_RCKS_POS) +#define FCM_REF_CLK_PCLKAP (0x16UL << FCM_RCCR_RCKS_POS) +#define FCM_REF_CLK_MRC (0x17UL << FCM_RCCR_RCKS_POS) +#define FCM_REF_CLK_PLLHP (0x18UL << FCM_RCCR_RCKS_POS) +#define FCM_REF_CLK_RTCLRC (0x19UL << FCM_RCCR_RCKS_POS) + +/** + * @brief FCM reference clock division + */ +#define FCM_REF_CLK_DIV32 (0x00UL) +#define FCM_REF_CLK_DIV128 (0x01UL) +#define FCM_REF_CLK_DIV1024 (0x02UL) +#define FCM_REF_CLK_DIV8192 (0x03UL) + +/** + * @brief FCM abnormal reset function config + */ +#define FCM_RST_OFF (0x00UL) +#define FCM_RST_ON (FCM_RIER_ERRE) + +/** + * @brief FCM abnormal behavior selection + */ +#define FCM_ERR_INT (0x00UL) +#define FCM_ERR_RESET (FCM_RIER_ERRINTRS) + +/** + * @brief FCM counter overflow interrupt config + */ +#define FCM_OVF_INT_OFF (0x00UL) +#define FCM_OVF_INT_ON (FCM_RIER_OVFIE) + +/** + * @brief FCM measure completed interrupt config + */ +#define FCM_END_INT_OFF (0x00UL) +#define FCM_END_INT_ON (FCM_RIER_MENDIE) + +/** + * @brief FCM error interrupt config + */ +#define FCM_ERR_INT_OFF (0x00UL) +#define FCM_ERR_INT_ON (FCM_RIER_ERRIE) + +/** + * @brief FCM interrupt mask + */ +#define FCM_INT_MSK (FCM_OVF_INT_ON | FCM_END_INT_ON | FCM_ERR_INT_ON) +/** + * @} + */ + +/** + * @defgroup FCM_Flag_Sel FCM status flag selection + * @{ + */ +#define FCM_FLAG_ERR (FCM_SR_ERRF) +#define FCM_FLAG_END (FCM_SR_MENDF) +#define FCM_FLAG_OVF (FCM_SR_OVF) +#define FCM_FLAG_MSK (FCM_SR_ERRF | FCM_SR_MENDF | FCM_SR_OVF) +/** + * @} + */ + +/** + * @} + */ + + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup FCM_Global_Functions + * @{ + */ +/** + * @brief Set FCM upper limit value. + * @param [in] u16Lmt + * @retval None. + */ +__STATIC_INLINE void FCM_SetUpLimit(uint16_t u16Lmt) +{ + WRITE_REG32(M4_FCM->UVR, u16Lmt); +} + +/** + * @brief Set FCM lower limit value. + * @param u16Lmt + * @retval None + */ +__STATIC_INLINE void FCM_SetLowLimit(uint16_t u16Lmt) +{ + WRITE_REG32(M4_FCM->LVR, u16Lmt); +} + +en_result_t FCM_Init(const stc_fcm_init_t *pstcFcmInit); +en_result_t FCM_StructInit(stc_fcm_init_t *pstcFcmInit); +void FCM_DeInit(void); +uint16_t FCM_GetCounter(void); +void FCM_SetUpLimit(uint16_t u16Lmt); +void FCM_SetLowLimit(uint16_t u16Lmt); +void FCM_SetTarClk(uint32_t u32Tar, uint32_t u32Div); +void FCM_SetRefClk(uint32_t u32Ref, uint32_t u32Div); +en_flag_status_t FCM_GetStatus(uint32_t u32Flag); +void FCM_ClearStatus(uint32_t u32Flag); +void FCM_Cmd(en_functional_state_t enNewState); + +/** + * @} + */ + +#endif /* DDL_FCM_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_FCM_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_fmac.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_fmac.h new file mode 100644 index 0000000000..4715b5498d --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_fmac.h @@ -0,0 +1,214 @@ +/** + ******************************************************************************* + * @file hc32f4a0_fmac.h + * @brief This file contains all the functions prototypes of the FMAC driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Heqb First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_FMAC_H__ +#define __HC32F4A0_FMAC_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_FMAC + * @{ + */ + +#if (DDL_FMAC_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup FMAC_Global_Types FMAC Global Types + * @{ + */ + +/** + * @brief FMAC configuration structure + */ +typedef struct +{ + uint32_t u32FiltStage; /*!< FMAC filter stage number config. + This parameter can be a value of @ref FMAC_Filter_stage.*/ + uint32_t u32FiltShift; /*!< FMAC filter result right shift bits. + This parameter can be a value of @ref FMAC_Filter_shift.*/ + int16_t i16FiltFactor; /*!< FMAC filter factor config. + This parameter can be set -32768~32767 */ + uint32_t u32IntCmd; /*!< Enable or disable FMAC interrupt. + This parameter can be a value of @ref FMAC_Interrupt_Definition.*/ +}stc_fmac_init_t; + +/** + * @brief FMAC result definition + */ +typedef struct +{ + uint32_t u32ResultHigh; /*!< The high value of the result. */ + uint32_t u32ResultLow; /*!< The low value of the result. */ + +} stc_fmac_result_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ + +/** + * @defgroup FMAC_Global_Macros FMAC Global Macros + * @{ + */ + +/** + * @defgroup FMAC_ENABLE FMAC Enable or Disable + * @{ + */ +#define FMAC_FUNC_ENABLE (FMAC_ENR_FMACEN) +#define FMAC_FUNC_DISABLE (0x0UL) +/** + * @} + */ + +/** + * @defgroup FMAC_Interrupt_Definition FMAC interrupt definition + * @{ + */ +#define FMAC_INT_ENABLE (FMAC_IER_INTEN) +#define FMAC_INT_DISABLE (0x0UL) +/** + * @} + */ + +/** @defgroup FMAC_Filter_shift FMAC filter shift times + * @{ + */ +#define FMAC_FILTER_SHIFT_0BIT (0U) +#define FMAC_FILTER_SHIFT_1BIT (1U) +#define FMAC_FILTER_SHIFT_2BIT (2U) +#define FMAC_FILTER_SHIFT_3BIT (3U) +#define FMAC_FILTER_SHIFT_4BIT (4U) +#define FMAC_FILTER_SHIFT_5BIT (5U) +#define FMAC_FILTER_SHIFT_6BIT (6U) +#define FMAC_FILTER_SHIFT_7BIT (7U) +#define FMAC_FILTER_SHIFT_8BIT (8U) +#define FMAC_FILTER_SHIFT_9BIT (9U) +#define FMAC_FILTER_SHIFT_10BIT (10U) +#define FMAC_FILTER_SHIFT_11BIT (11U) +#define FMAC_FILTER_SHIFT_12BIT (12U) +#define FMAC_FILTER_SHIFT_13BIT (13U) +#define FMAC_FILTER_SHIFT_14BIT (14U) +#define FMAC_FILTER_SHIFT_15BIT (15U) +#define FMAC_FILTER_SHIFT_16BIT (16U) +#define FMAC_FILTER_SHIFT_17BIT (17U) +#define FMAC_FILTER_SHIFT_18BIT (18U) +#define FMAC_FILTER_SHIFT_19BIT (19U) +#define FMAC_FILTER_SHIFT_20BIT (20U) +#define FMAC_FILTER_SHIFT_21BIT (21U) +/** + * @} + */ + +/** @defgroup FMAC_Filter_stage FMAC filter stage number + * @{ + */ +#define FMAC_FILTER_STAGE_0 (0U) +#define FMAC_FILTER_STAGE_1 (1U) +#define FMAC_FILTER_STAGE_2 (2U) +#define FMAC_FILTER_STAGE_3 (3U) +#define FMAC_FILTER_STAGE_4 (4U) +#define FMAC_FILTER_STAGE_5 (5U) +#define FMAC_FILTER_STAGE_6 (6U) +#define FMAC_FILTER_STAGE_7 (7U) +#define FMAC_FILTER_STAGE_8 (8U) +#define FMAC_FILTER_STAGE_9 (9U) +#define FMAC_FILTER_STAGE_10 (10U) +#define FMAC_FILTER_STAGE_11 (11U) +#define FMAC_FILTER_STAGE_12 (12U) +#define FMAC_FILTER_STAGE_13 (13U) +#define FMAC_FILTER_STAGE_14 (14U) +#define FMAC_FILTER_STAGE_15 (15U) +#define FMAC_FILTER_STAGE_16 (16U) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup FMAC_Global_Functions + * @{ + */ +en_result_t FMAC_StructInit(stc_fmac_init_t* pstcInitStruct); +void FMAC_DeInit(M4_FMAC_TypeDef* FMACx); +en_result_t FMAC_Init(M4_FMAC_TypeDef* FMACx, const stc_fmac_init_t *pstcFmacInit); +void FMAC_Cmd(M4_FMAC_TypeDef* FMACx, en_functional_state_t enNewState); +void FMAC_SetResultShift(M4_FMAC_TypeDef* FMACx, uint32_t u32ShiftNum); +void FMAC_SetStageFactor(M4_FMAC_TypeDef* FMACx, uint32_t u32FilterStage, int16_t i16Factor); +void FMAC_IntCmd(M4_FMAC_TypeDef* FMACx, en_functional_state_t enNewState); +void FMAC_FIRInput(M4_FMAC_TypeDef* FMACx, int16_t i16Factor); +en_flag_status_t FMAC_GetStatus(const M4_FMAC_TypeDef* FMACx); +en_result_t FMAC_GetResult(const M4_FMAC_TypeDef* FMACx, stc_fmac_result_t *stcResult); +/** + * @} + */ + +#endif /* DDL_FMAC_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_FMAC_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_gpio.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_gpio.h new file mode 100644 index 0000000000..b87f3a2b8f --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_gpio.h @@ -0,0 +1,1408 @@ +/** + ******************************************************************************* + * @file hc32f4a0_gpio.h + * @brief This file contains all the functions prototypes of the GPIO driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Zhangxl First version + 2020-09-21 Zhangxl Typo, missing FUNC_I2C3 defintion + 2020-10-27 Zhangxl Revise debug port definition + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_GPIO_H__ +#define __HC32F4A0_GPIO_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_GPIO + * @{ + */ + +#if (DDL_GPIO_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup GPIO_Global_Types GPIO Global Types + * @{ + */ + +/** + * @brief GPIO Pin Set and Reset enumeration + */ +typedef enum +{ + Pin_Reset = 0U, /*!< Pin reset */ + Pin_Set = 1U /*!< Pin set */ +} en_pin_state_t; + +/** + * @brief GPIO Init structure definition + */ +typedef struct +{ + uint16_t u16PinState; /*!< Set pin state to High or Low, @ref GPIO_PinState_Sel for details */ + uint16_t u16PinDir; /*!< Pin mode setting, @ref GPIO_PinDirection_Sel for details */ + uint16_t u16PinOType; /*!< Output type setting, @ref GPIO_PinOutType_Sel for details */ + uint16_t u16PinDrv; /*!< Pin drive capacity setting, @ref GPIO_PinDrv_Sel for details */ + uint16_t u16Latch; /*!< Pin latch setting, @ref GPIO_PinLatch_Sel for details */ + uint16_t u16PullUp; /*!< Internal pull-up resistor setting, @ref GPIO_PinPU_Sel for details */ + uint16_t u16Invert; /*!< Pin input/output invert setting, @ref GPIO_PinInvert_Sel */ + uint16_t u16PinIType; /*!< Input type setting, @ref GPIO_PinInType_Sel */ + uint16_t u16ExInt; /*!< External interrupt pin setting, @ref GPIO_PinExInt_Sel for details */ + uint16_t u16PinAttr; /*!< Digital or analog attribute setting, @ref GPIO_PinMode_Sel for details */ +} stc_gpio_init_t; +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup GPIO_Global_Macros GPIO Global Macros + * @{ + */ + +/** @defgroup GPIO_pins_define GPIO pin source + * @{ + */ +#define GPIO_PIN_00 (0x0001U) /*!< Pin 00 selected */ +#define GPIO_PIN_01 (0x0002U) /*!< Pin 01 selected */ +#define GPIO_PIN_02 (0x0004U) /*!< Pin 02 selected */ +#define GPIO_PIN_03 (0x0008U) /*!< Pin 03 selected */ +#define GPIO_PIN_04 (0x0010U) /*!< Pin 04 selected */ +#define GPIO_PIN_05 (0x0020U) /*!< Pin 05 selected */ +#define GPIO_PIN_06 (0x0040U) /*!< Pin 06 selected */ +#define GPIO_PIN_07 (0x0080U) /*!< Pin 07 selected */ +#define GPIO_PIN_08 (0x0100U) /*!< Pin 08 selected */ +#define GPIO_PIN_09 (0x0200U) /*!< Pin 09 selected */ +#define GPIO_PIN_10 (0x0400U) /*!< Pin 10 selected */ +#define GPIO_PIN_11 (0x0800U) /*!< Pin 11 selected */ +#define GPIO_PIN_12 (0x1000U) /*!< Pin 12 selected */ +#define GPIO_PIN_13 (0x2000U) /*!< Pin 13 selected */ +#define GPIO_PIN_14 (0x4000U) /*!< Pin 14 selected */ +#define GPIO_PIN_15 (0x8000U) /*!< Pin 15 selected */ +#define GPIO_PIN_ALL (0xFFFFU) /*!< All pins selected */ + +#define GPIO_PIN_MASK (0xFFFFU) /*!< PIN mask for assert test */ + +/** + * @} + */ + +/** @defgroup GPIO_Port_source GPIO port source + * @{ + */ +#define GPIO_PORT_A (0x00U) /*!< Port A selected */ +#define GPIO_PORT_B (0x01U) /*!< Port B selected */ +#define GPIO_PORT_C (0x02U) /*!< Port C selected */ +#define GPIO_PORT_D (0x03U) /*!< Port D selected */ +#define GPIO_PORT_E (0x04U) /*!< Port E selected */ +#define GPIO_PORT_F (0x05U) /*!< Port F selected */ +#define GPIO_PORT_G (0x06U) /*!< Port G selected */ +#define GPIO_PORT_H (0x07U) /*!< Port H selected */ +#define GPIO_PORT_I (0x08U) /*!< Port I selected */ +/** + * @} + */ + +/** @defgroup GPIO_Port_index GPIO port index + * @{ + */ +#define GPIO_PORTA_IDX (0x0001U) +#define GPIO_PORTB_IDX (0x0002U) +#define GPIO_PORTC_IDX (0x0004U) +#define GPIO_PORTD_IDX (0x0008U) +#define GPIO_PORTE_IDX (0x0010U) +#define GPIO_PORTF_IDX (0x0020U) +#define GPIO_PORTG_IDX (0x0040U) +#define GPIO_PORTH_IDX (0x0080U) +#define GPIO_PORTI_IDX (0x0100U) +#define GPIO_PORT_ALL (0x01FFU) + +#define GPIO_PORT_MASK (0x01FFU) +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup GPIO_function_selection_define GPIO function selection + * @{ + */ +/** @defgroup GPIO_PinFunction0 GPIO Function 0 selection + * @{ + */ +#define GPIO_FUNC_0 (0x00U) +#define GPIO_FUNC_0_GPO (GPIO_FUNC_0) /* GPO function */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction1 GPIO Function 1 selection + * @{ + */ +#define GPIO_FUNC_1 (0x01U) +#define GPIO_FUNC_1_FCMREF (GPIO_FUNC_1) /*!< Reference clock input for FCM */ +#define GPIO_FUNC_1_CTCREF (GPIO_FUNC_1) /*!< Reference clock input for internal CTC */ +#define GPIO_FUNC_1_RTCOUT (GPIO_FUNC_1) /*!< RTC 1Hz output */ +#define GPIO_FUNC_1_VCOUT (GPIO_FUNC_1) /*!< Voltage comparator output */ +#define GPIO_FUNC_1_ADTRG (GPIO_FUNC_1) /*!< ADC external trigger */ +#define GPIO_FUNC_1_MCO (GPIO_FUNC_1) /*!< Clock output */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction2 GPIO Function 2 selection + * @{ + */ +#define GPIO_FUNC_2 (0x02U) +#define GPIO_FUNC_2_TIM41 (GPIO_FUNC_2) /*!< TMR4 unit */ +#define GPIO_FUNC_2_TIM41_PCT (GPIO_FUNC_2) /*!< TMR4 unit 1 basetimer count direction indicator */ +#define GPIO_FUNC_2_TIM41_ADSM (GPIO_FUNC_2) /*!< TMR4 unit 1 special event */ +#define GPIO_FUNC_2_TIM41_CLK (GPIO_FUNC_2) /*!< TMR4 unit 1 clock input */ +#define GPIO_FUNC_2_TIM41_OUH (GPIO_FUNC_2) /*!< TMR4 unit 1 U-phase output high */ +#define GPIO_FUNC_2_TIM41_OUL (GPIO_FUNC_2) /*!< TMR4 unit 1 U-phase output low */ +#define GPIO_FUNC_2_TIM41_OVH (GPIO_FUNC_2) /*!< TMR4 unit 1 V-phase output high */ +#define GPIO_FUNC_2_TIM41_OVL (GPIO_FUNC_2) /*!< TMR4 unit 1 V-phase output low */ +#define GPIO_FUNC_2_TIM41_OWH (GPIO_FUNC_2) /*!< TMR4 unit 1 W-phase output high */ +#define GPIO_FUNC_2_TIM41_OWL (GPIO_FUNC_2) /*!< TMR4 unit 1 W-phase output low */ + +#define GPIO_FUNC_2_TIM42 (GPIO_FUNC_2) /*!< TMR4 unit */ +#define GPIO_FUNC_2_TIM42_PCT (GPIO_FUNC_2) /*!< TMR4 unit 2 basetimer count direction indicator */ +#define GPIO_FUNC_2_TIM42_ADSM (GPIO_FUNC_2) /*!< TMR4 unit 2 special event */ +#define GPIO_FUNC_2_TIM42_CLK (GPIO_FUNC_2) /*!< TMR4 unit 2 clock input */ +#define GPIO_FUNC_2_TIM42_OUH (GPIO_FUNC_2) /*!< TMR4 unit 2 U-phase output high */ +#define GPIO_FUNC_2_TIM42_OUL (GPIO_FUNC_2) /*!< TMR4 unit 2 U-phase output low */ +#define GPIO_FUNC_2_TIM42_OVH (GPIO_FUNC_2) /*!< TMR4 unit 2 V-phase output high */ +#define GPIO_FUNC_2_TIM42_OVL (GPIO_FUNC_2) /*!< TMR4 unit 2 V-phase output low */ +#define GPIO_FUNC_2_TIM42_OWH (GPIO_FUNC_2) /*!< TMR4 unit 2 W-phase output high */ +#define GPIO_FUNC_2_TIM42_OWL (GPIO_FUNC_2) /*!< TMR4 unit 2 W-phase output low */ + +#define GPIO_FUNC_2_TIM43 (GPIO_FUNC_2) /*!< TMR4 unit */ +#define GPIO_FUNC_2_TIM43_PCT (GPIO_FUNC_2) /*!< TMR4 unit 3 basetimer count direction indicator */ +#define GPIO_FUNC_2_TIM43_ADSM (GPIO_FUNC_2) /*!< TMR4 unit 3 special event */ +#define GPIO_FUNC_2_TIM43_CLK (GPIO_FUNC_2) /*!< TMR4 unit 3 clock input */ +#define GPIO_FUNC_2_TIM43_OUH (GPIO_FUNC_2) /*!< TMR4 unit 3 U-phase output high */ +#define GPIO_FUNC_2_TIM43_OUL (GPIO_FUNC_2) /*!< TMR4 unit 3 U-phase output low */ +#define GPIO_FUNC_2_TIM43_OVH (GPIO_FUNC_2) /*!< TMR4 unit 3 V-phase output high */ +#define GPIO_FUNC_2_TIM43_OVL (GPIO_FUNC_2) /*!< TMR4 unit 3 V-phase output low */ +#define GPIO_FUNC_2_TIM43_OWH (GPIO_FUNC_2) /*!< TMR4 unit 3 W-phase output high */ +#define GPIO_FUNC_2_TIM43_OWL (GPIO_FUNC_2) /*!< TMR4 unit 3 W-phase output low */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction3 GPIO Function 3 selection + * @{ + */ +#define GPIO_FUNC_3 (0x03U) +#define GPIO_FUNC_3_TIM6_TRIG (GPIO_FUNC_3) /*!< TMR6 trigger */ +#define GPIO_FUNC_3_TIM6_TRIGA (GPIO_FUNC_3) /*!< TMR6 trigger A */ +#define GPIO_FUNC_3_TIM6_TRIGB (GPIO_FUNC_3) /*!< TMR6 trigger B */ +#define GPIO_FUNC_3_TIM6_TRIGC (GPIO_FUNC_3) /*!< TMR6 trigger C */ +#define GPIO_FUNC_3_TIM6_TRIGD (GPIO_FUNC_3) /*!< TMR6 trigger D */ + +#define GPIO_FUNC_3_TIM61 (GPIO_FUNC_3) /*!< TMR6 unit 1 */ +#define GPIO_FUNC_3_TIM61_PWMA (GPIO_FUNC_3) /*!< TMR6 unit 1 channel A PWM output */ +#define GPIO_FUNC_3_TIM61_PWMB (GPIO_FUNC_3) /*!< TMR6 unit 1 channel B PWM output */ + +#define GPIO_FUNC_3_TIM62 (GPIO_FUNC_3) /*!< TMR6 unit 2 */ +#define GPIO_FUNC_3_TIM62_PWMA (GPIO_FUNC_3) /*!< TMR6 unit 2 channel A PWM output */ +#define GPIO_FUNC_3_TIM62_PWMB (GPIO_FUNC_3) /*!< TMR6 unit 2 channel B PWM output */ + +#define GPIO_FUNC_3_TIM63 (GPIO_FUNC_3) /*!< TMR6 unit 3 */ +#define GPIO_FUNC_3_TIM63_PWMA (GPIO_FUNC_3) /*!< TMR6 unit 3 channel A PWM output */ +#define GPIO_FUNC_3_TIM63_PWMB (GPIO_FUNC_3) /*!< TMR6 unit 3 channel B PWM output */ + +#define GPIO_FUNC_3_TIM64 (GPIO_FUNC_3) /*!< TMR6 unit 4 */ +#define GPIO_FUNC_3_TIM64_PWMA (GPIO_FUNC_3) /*!< TMR6 unit 4 channel A PWM output */ +#define GPIO_FUNC_3_TIM64_PWMB (GPIO_FUNC_3) /*!< TMR6 unit 4 channel B PWM output */ + +#define GPIO_FUNC_3_TIM65 (GPIO_FUNC_3) /*!< TMR6 unit 5 */ +#define GPIO_FUNC_3_TIM65_PWMA (GPIO_FUNC_3) /*!< TMR6 unit 5 channel A PWM output */ +#define GPIO_FUNC_3_TIM65_PWMB (GPIO_FUNC_3) /*!< TMR6 unit 5 channel B PWM output */ + +#define GPIO_FUNC_3_TIM66 (GPIO_FUNC_3) /*!< TMR6 unit 6 */ +#define GPIO_FUNC_3_TIM66_PWMA (GPIO_FUNC_3) /*!< TMR6 unit 6 channel A PWM output */ +#define GPIO_FUNC_3_TIM66_PWMB (GPIO_FUNC_3) /*!< TMR6 unit 6 channel B PWM output */ + +#define GPIO_FUNC_3_TIM67 (GPIO_FUNC_3) /*!< TMR6 unit 7 */ +#define GPIO_FUNC_3_TIM67_PWMA (GPIO_FUNC_3) /*!< TMR6 unit 7 channel A PWM output */ +#define GPIO_FUNC_3_TIM67_PWMB (GPIO_FUNC_3) /*!< TMR6 unit 7 channel B PWM output */ + +#define GPIO_FUNC_3_TIM68 (GPIO_FUNC_3) /*!< TMR6 unit 8 */ +#define GPIO_FUNC_3_TIM68_PWMA (GPIO_FUNC_3) /*!< TMR6 unit 8 channel A PWM output */ +#define GPIO_FUNC_3_TIM68_PWMB (GPIO_FUNC_3) /*!< TMR6 unit 8 channel B PWM output */ + +/** + * @} + */ + +/** @defgroup GPIO_PinFunction4 GPIO Function 4 selection + * @{ + */ +#define GPIO_FUNC_4 (0x04U) +#define GPIO_FUNC_4_TIMA1 (GPIO_FUNC_4) /*!< TMRA unit 1 */ +#define GPIO_FUNC_4_TIMA1_TRIG (GPIO_FUNC_4) /*!< TMRA unit 1 trigger */ +#define GPIO_FUNC_4_TIMA1_PWM1 (GPIO_FUNC_4) /*!< TMRA unit 1 channel 1 PWM output */ +#define GPIO_FUNC_4_TIMA1_PWM2 (GPIO_FUNC_4) /*!< TMRA unit 1 channel 2 PWM output */ +#define GPIO_FUNC_4_TIMA1_PWM3 (GPIO_FUNC_4) /*!< TMRA unit 1 channel 3 PWM output */ +#define GPIO_FUNC_4_TIMA1_PWM4 (GPIO_FUNC_4) /*!< TMRA unit 1 channel 4 PWM output */ + +#define GPIO_FUNC_4_TIMA2_PWM (GPIO_FUNC_4) /*!< TMRA unit 2 PWM */ +#define GPIO_FUNC_4_TIMA2_PWM1 (GPIO_FUNC_4) /*!< TMRA unit 2 channel 1 PWM output */ +#define GPIO_FUNC_4_TIMA2_PWM2 (GPIO_FUNC_4) /*!< TMRA unit 2 channel 2 PWM output */ +#define GPIO_FUNC_4_TIMA2_PWM3 (GPIO_FUNC_4) /*!< TMRA unit 2 channel 3 PWM output */ +#define GPIO_FUNC_4_TIMA2_PWM4 (GPIO_FUNC_4) /*!< TMRA unit 2 channel 4 PWM output */ + +#define GPIO_FUNC_4_TIMA3 (GPIO_FUNC_4) /*!< TMRA unit 3 */ +#define GPIO_FUNC_4_TIMA3_TRIG (GPIO_FUNC_4) /*!< TMRA unit 3 trigger */ +#define GPIO_FUNC_4_TIMA3_PWM1 (GPIO_FUNC_4) /*!< TMRA unit 3 channel 1 PWM output */ +#define GPIO_FUNC_4_TIMA3_PWM2 (GPIO_FUNC_4) /*!< TMRA unit 3 channel 2 PWM output */ +#define GPIO_FUNC_4_TIMA3_PWM3 (GPIO_FUNC_4) /*!< TMRA unit 3 channel 3 PWM output */ +#define GPIO_FUNC_4_TIMA3_PWM4 (GPIO_FUNC_4) /*!< TMRA unit 3 channel 4 PWM output */ + +#define GPIO_FUNC_4_TIMA4 (GPIO_FUNC_4) /*!< TMRA unit 4 */ +#define GPIO_FUNC_4_TIMA4_TRIG (GPIO_FUNC_4) /*!< TMRA unit 4 trigger */ +#define GPIO_FUNC_4_TIMA4_PWM1 (GPIO_FUNC_4) /*!< TMRA unit 4 channel 1 PWM output */ +#define GPIO_FUNC_4_TIMA4_PWM2 (GPIO_FUNC_4) /*!< TMRA unit 4 channel 2 PWM output */ +#define GPIO_FUNC_4_TIMA4_PWM3 (GPIO_FUNC_4) /*!< TMRA unit 4 channel 3 PWM output */ +#define GPIO_FUNC_4_TIMA4_PWM4 (GPIO_FUNC_4) /*!< TMRA unit 4 channel 4 PWM output */ + +#define GPIO_FUNC_4_TIMA6 (GPIO_FUNC_4) /*!< TMRA unit 6 */ +#define GPIO_FUNC_4_TIMA6_PWM1 (GPIO_FUNC_4) /*!< TMRA unit 6 channel 1 PWM output */ +#define GPIO_FUNC_4_TIMA6_PWM2 (GPIO_FUNC_4) /*!< TMRA unit 6 channel 2 PWM output */ +#define GPIO_FUNC_4_TIMA6_PWM3 (GPIO_FUNC_4) /*!< TMRA unit 6 channel 3 PWM output */ +#define GPIO_FUNC_4_TIMA6_PWM4 (GPIO_FUNC_4) /*!< TMRA unit 6 channel 4 PWM output */ + +#define GPIO_FUNC_4_TIMA7 (GPIO_FUNC_4) /*!< TMRA unit 7 */ +#define GPIO_FUNC_4_TIMA7_PWM1 (GPIO_FUNC_4) /*!< TMRA unit 7 channel 1 PWM output */ +#define GPIO_FUNC_4_TIMA7_PWM2 (GPIO_FUNC_4) /*!< TMRA unit 7 channel 2 PWM output */ +#define GPIO_FUNC_4_TIMA7_PWM3 (GPIO_FUNC_4) /*!< TMRA unit 7 channel 3 PWM output */ +#define GPIO_FUNC_4_TIMA7_PWM4 (GPIO_FUNC_4) /*!< TMRA unit 7 channel 4 PWM output */ + +#define GPIO_FUNC_4_TIMA8 (GPIO_FUNC_4) /*!< TMRA unit 8 */ +#define GPIO_FUNC_4_TIMA8_PWM1 (GPIO_FUNC_4) /*!< TMRA unit 8 channel 1 PWM output */ +#define GPIO_FUNC_4_TIMA8_PWM2 (GPIO_FUNC_4) /*!< TMRA unit 8 channel 2 PWM output */ +#define GPIO_FUNC_4_TIMA8_PWM3 (GPIO_FUNC_4) /*!< TMRA unit 8 channel 3 PWM output */ +#define GPIO_FUNC_4_TIMA8_PWM4 (GPIO_FUNC_4) /*!< TMRA unit 8 channel 4 PWM output */ + +#define GPIO_FUNC_4_TIMA9 (GPIO_FUNC_4) /*!< TMRA unit 9 */ +#define GPIO_FUNC_4_TIMA9_PWM1 (GPIO_FUNC_4) /*!< TMRA unit 9 channel 1 PWM output */ +#define GPIO_FUNC_4_TIMA9_PWM2 (GPIO_FUNC_4) /*!< TMRA unit 9 channel 2 PWM output */ +#define GPIO_FUNC_4_TIMA9_PWM3 (GPIO_FUNC_4) /*!< TMRA unit 9 channel 3 PWM output */ +#define GPIO_FUNC_4_TIMA9_PWM4 (GPIO_FUNC_4) /*!< TMRA unit 9 channel 4 PWM output */ + +#define GPIO_FUNC_4_TIMA10 (GPIO_FUNC_4) /*!< TMRA unit 10 */ +#define GPIO_FUNC_4_TIMA10_PWM1 (GPIO_FUNC_4) /*!< TMRA unit 10 channel 1 PWM output */ +#define GPIO_FUNC_4_TIMA10_PWM2 (GPIO_FUNC_4) /*!< TMRA unit 10 channel 2 PWM output */ +#define GPIO_FUNC_4_TIMA10_PWM3 (GPIO_FUNC_4) /*!< TMRA unit 10 channel 3 PWM output */ +#define GPIO_FUNC_4_TIMA10_PWM4 (GPIO_FUNC_4) /*!< TMRA unit 10 channel 4 PWM output */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction5 GPIO Function 5 selection + * @{ + */ +#define GPIO_FUNC_5 (0x05U) +#define GPIO_FUNC_5_TIMA2_TRIG (GPIO_FUNC_5) /*!< TMRA unit 2 trigger */ + +#define GPIO_FUNC_5_TIMA3 (GPIO_FUNC_5) /*!< TMRA unit 3 */ +#define GPIO_FUNC_5_TIMA3_TRIG (GPIO_FUNC_5) /*!< TMRA unit 3 trigger */ +#define GPIO_FUNC_5_TIMA3_PWM1 (GPIO_FUNC_5) /*!< TMRA unit 3 channel 1 PWM output */ +#define GPIO_FUNC_5_TIMA3_PWM2 (GPIO_FUNC_5) /*!< TMRA unit 3 channel 2 PWM output */ +#define GPIO_FUNC_5_TIMA3_PWM3 (GPIO_FUNC_5) /*!< TMRA unit 3 channel 3 PWM output */ +#define GPIO_FUNC_5_TIMA3_PWM4 (GPIO_FUNC_5) /*!< TMRA unit 3 channel 4 PWM output */ + +#define GPIO_FUNC_5_TIMA4 (GPIO_FUNC_5) /*!< TMRA unit 4 */ +#define GPIO_FUNC_5_TIMA4_PWM1 (GPIO_FUNC_5) /*!< TMRA unit 4 channel 1 PWM output */ +#define GPIO_FUNC_5_TIMA4_PWM2 (GPIO_FUNC_5) /*!< TMRA unit 4 channel 2 PWM output */ +#define GPIO_FUNC_5_TIMA4_PWM3 (GPIO_FUNC_5) /*!< TMRA unit 4 channel 3 PWM output */ +#define GPIO_FUNC_5_TIMA4_PWM4 (GPIO_FUNC_5) /*!< TMRA unit 4 channel 4 PWM output */ + +#define GPIO_FUNC_5_TIMA5 (GPIO_FUNC_5) /*!< TMRA unit 5 */ +#define GPIO_FUNC_5_TIMA5_TRIG (GPIO_FUNC_5) /*!< TMRA unit 5 trigger */ +#define GPIO_FUNC_5_TIMA5_PWM1 (GPIO_FUNC_5) /*!< TMRA unit 5 channel 1 PWM output */ +#define GPIO_FUNC_5_TIMA5_PWM2 (GPIO_FUNC_5) /*!< TMRA unit 5 channel 2 PWM output */ +#define GPIO_FUNC_5_TIMA5_PWM3 (GPIO_FUNC_5) /*!< TMRA unit 5 channel 3 PWM output */ +#define GPIO_FUNC_5_TIMA5_PWM4 (GPIO_FUNC_5) /*!< TMRA unit 5 channel 4 PWM output */ + +#define GPIO_FUNC_5_TIMA6 (GPIO_FUNC_5) /*!< TMRA unit 6 */ +#define GPIO_FUNC_5_TIMA6_TRIG (GPIO_FUNC_5) /*!< TMRA unit 6 trigger */ +#define GPIO_FUNC_5_TIMA6_PWM1 (GPIO_FUNC_5) /*!< TMRA unit 6 channel 1 PWM output */ +#define GPIO_FUNC_5_TIMA6_PWM2 (GPIO_FUNC_5) /*!< TMRA unit 6 channel 2 PWM output */ +#define GPIO_FUNC_5_TIMA6_PWM3 (GPIO_FUNC_5) /*!< TMRA unit 6 channel 3 PWM output */ +#define GPIO_FUNC_5_TIMA6_PWM4 (GPIO_FUNC_5) /*!< TMRA unit 6 channel 4 PWM output */ + +#define GPIO_FUNC_5_TIMA9 (GPIO_FUNC_5) /*!< TMRA unit 9 */ +#define GPIO_FUNC_5_TIMA9_TRIG (GPIO_FUNC_5) /*!< TMRA unit 9 trigger */ +#define GPIO_FUNC_5_TIMA9_PWM1 (GPIO_FUNC_5) /*!< TMRA unit 9 channel 1 PWM output */ +#define GPIO_FUNC_5_TIMA9_PWM2 (GPIO_FUNC_5) /*!< TMRA unit 9 channel 2 PWM output */ +#define GPIO_FUNC_5_TIMA9_PWM3 (GPIO_FUNC_5) /*!< TMRA unit 9 channel 3 PWM output */ +#define GPIO_FUNC_5_TIMA9_PWM4 (GPIO_FUNC_5) /*!< TMRA unit 9 channel 4 PWM output */ + +#define GPIO_FUNC_5_TIMA11_PWM (GPIO_FUNC_5) /*!< TMRA unit 11 PWM */ +#define GPIO_FUNC_5_TIMA11_PWM1 (GPIO_FUNC_5) /*!< TMRA unit 11 channel 1 PWM output */ +#define GPIO_FUNC_5_TIMA11_PWM2 (GPIO_FUNC_5) /*!< TMRA unit 11 channel 2 PWM output */ +#define GPIO_FUNC_5_TIMA11_PWM3 (GPIO_FUNC_5) /*!< TMRA unit 11 channel 3 PWM output */ +#define GPIO_FUNC_5_TIMA11_PWM4 (GPIO_FUNC_5) /*!< TMRA unit 11 channel 4 PWM output */ + +#define GPIO_FUNC_5_TIMA12_PWM (GPIO_FUNC_5) /*!< TMRA unit 12 PWM */ +#define GPIO_FUNC_5_TIMA12_PWM1 (GPIO_FUNC_5) /*!< TMRA unit 12 channel 1 PWM output */ +#define GPIO_FUNC_5_TIMA12_PWM2 (GPIO_FUNC_5) /*!< TMRA unit 12 channel 2 PWM output */ +#define GPIO_FUNC_5_TIMA12_PWM3 (GPIO_FUNC_5) /*!< TMRA unit 12 channel 3 PWM output */ +#define GPIO_FUNC_5_TIMA12_PWM4 (GPIO_FUNC_5) /*!< TMRA unit 12 channel 4 PWM output */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction6 GPIO Function 6 selection + * @{ + */ +#define GPIO_FUNC_6 (0x06U) +#define GPIO_FUNC_6_TIMA1_TRIG (GPIO_FUNC_6) /*!< TMRA unit 1 trigger */ +#define GPIO_FUNC_6_TIMA2_TRIG (GPIO_FUNC_6) /*!< TMRA unit 2 trigger */ +#define GPIO_FUNC_6_TIMA3_TRIG (GPIO_FUNC_6) /*!< TMRA unit 3 trigger */ +#define GPIO_FUNC_6_TIMA4_TRIG (GPIO_FUNC_6) /*!< TMRA unit 4 trigger */ +#define GPIO_FUNC_6_TIMA6_TRIG (GPIO_FUNC_6) /*!< TMRA unit 6 trigger */ +#define GPIO_FUNC_6_TIMA7_TRIG (GPIO_FUNC_6) /*!< TMRA unit 7 trigger */ +#define GPIO_FUNC_6_TIMA8_TRIG (GPIO_FUNC_6) /*!< TMRA unit 8 trigger */ +#define GPIO_FUNC_6_TIMA11_TRIG (GPIO_FUNC_6) /*!< TMRA unit 11 trigger */ +#define GPIO_FUNC_6_TIMA12_TRIG (GPIO_FUNC_6) /*!< TMRA unit 12 trigger */ + +#define GPIO_FUNC_6_TIMA5 (GPIO_FUNC_6) /*!< TMRA unit 5 */ +#define GPIO_FUNC_6_TIMA5_TRIG (GPIO_FUNC_6) /*!< TMRA unit 5 trigger */ +#define GPIO_FUNC_6_TIMA5_PWM1 (GPIO_FUNC_6) /*!< TMRA unit 5 channel 1 PWM output */ +#define GPIO_FUNC_6_TIMA5_PWM2 (GPIO_FUNC_6) /*!< TMRA unit 5 channel 2 PWM output */ +#define GPIO_FUNC_6_TIMA5_PWM3 (GPIO_FUNC_6) /*!< TMRA unit 5 channel 3 PWM output */ +#define GPIO_FUNC_6_TIMA5_PWM4 (GPIO_FUNC_6) /*!< TMRA unit 5 channel 4 PWM output */ + +#define GPIO_FUNC_6_TIMA9 (GPIO_FUNC_6) /*!< TMRA unit 9 */ +#define GPIO_FUNC_6_TIMA9_TRIG (GPIO_FUNC_6) /*!< TMRA unit 9 trigger */ +#define GPIO_FUNC_6_TIMA9_PWM1 (GPIO_FUNC_6) /*!< TMRA unit 9 channel 1 PWM output */ +#define GPIO_FUNC_6_TIMA9_PWM2 (GPIO_FUNC_6) /*!< TMRA unit 9 channel 2 PWM output */ +#define GPIO_FUNC_6_TIMA9_PWM3 (GPIO_FUNC_6) /*!< TMRA unit 9 channel 3 PWM output */ +#define GPIO_FUNC_6_TIMA9_PWM4 (GPIO_FUNC_6) /*!< TMRA unit 9 channel 4 PWM output */ + +#define GPIO_FUNC_6_TIMA10 (GPIO_FUNC_6) /*!< TMRA unit 10 */ +#define GPIO_FUNC_6_TIMA10_TRIG (GPIO_FUNC_6) /*!< TMRA unit 10 trigger */ +#define GPIO_FUNC_6_TIMA10_PWM1 (GPIO_FUNC_6) /*!< TMRA unit 10 channel 1 PWM output */ +#define GPIO_FUNC_6_TIMA10_PWM2 (GPIO_FUNC_6) /*!< TMRA unit 10 channel 2 PWM output */ +#define GPIO_FUNC_6_TIMA10_PWM3 (GPIO_FUNC_6) /*!< TMRA unit 10 channel 3 PWM output */ +#define GPIO_FUNC_6_TIMA10_PWM4 (GPIO_FUNC_6) /*!< TMRA unit 10 channel 4 PWM output */ + +#define GPIO_FUNC_6_TIM65_PWMA (GPIO_FUNC_6) /*!< TMR6 unit 5 channel A PWM output */ +#define GPIO_FUNC_6_TIM66_PWMA (GPIO_FUNC_6) /*!< TMR6 unit 6 channel A PWM output */ +#define GPIO_FUNC_6_TIM67_PWMA (GPIO_FUNC_6) /*!< TMR6 unit 7 channel A PWM output */ +#define GPIO_FUNC_6_TIM68_PWMA (GPIO_FUNC_6) /*!< TMR6 unit 8 channel A PWM output */ + +#define GPIO_FUNC_6_EMB_PORT (GPIO_FUNC_6) /*!< EMB port */ +#define GPIO_FUNC_6_EMB_PORT0 (GPIO_FUNC_6) /*!< EMB port 0 */ +#define GPIO_FUNC_6_EMB_PORT1 (GPIO_FUNC_6) /*!< EMB port 1 */ +#define GPIO_FUNC_6_EMB_PORT2 (GPIO_FUNC_6) /*!< EMB port 2 */ +#define GPIO_FUNC_6_EMB_PORT3 (GPIO_FUNC_6) /*!< EMB port 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction7 GPIO Function 7 selection + * @{ + */ +#define GPIO_FUNC_7 (0x07U) +#define GPIO_FUNC_7_USART1 (GPIO_FUNC_7) /*!< USART1 */ +#define GPIO_FUNC_7_USART1_CK (GPIO_FUNC_7) /*!< USART1 CK */ +#define GPIO_FUNC_7_USART1_CTS (GPIO_FUNC_7) /*!< USART1 CTS */ +#define GPIO_FUNC_7_USART1_RTS (GPIO_FUNC_7) /*!< USART1 RTS */ + +#define GPIO_FUNC_7_USART2 (GPIO_FUNC_7) /*!< USART2 */ +#define GPIO_FUNC_7_USART2_CK (GPIO_FUNC_7) /*!< USART2 CK */ +#define GPIO_FUNC_7_USART2_CTS (GPIO_FUNC_7) /*!< USART2 CTS */ +#define GPIO_FUNC_7_USART2_RTS (GPIO_FUNC_7) /*!< USART2 RTS */ + +#define GPIO_FUNC_7_USART3 (GPIO_FUNC_7) /*!< USART3 */ +#define GPIO_FUNC_7_USART3_CK (GPIO_FUNC_7) /*!< USART3 CK */ +#define GPIO_FUNC_7_USART3_CTS (GPIO_FUNC_7) /*!< USART3 CTS */ +#define GPIO_FUNC_7_USART3_RTS (GPIO_FUNC_7) /*!< USART3 RTS */ + +#define GPIO_FUNC_7_USART4 (GPIO_FUNC_7) /*!< USART4 */ +#define GPIO_FUNC_7_USART4_CK (GPIO_FUNC_7) /*!< USART4 CK */ +#define GPIO_FUNC_7_USART4_CTS (GPIO_FUNC_7) /*!< USART4 CTS */ +#define GPIO_FUNC_7_USART4_RTS (GPIO_FUNC_7) /*!< USART4 RTS */ + +#define GPIO_FUNC_7_USART5 (GPIO_FUNC_7) /*!< USART5 */ +#define GPIO_FUNC_7_USART5_CK (GPIO_FUNC_7) /*!< USART5 CK */ +#define GPIO_FUNC_7_USART5_CTS (GPIO_FUNC_7) /*!< USART5 CTS */ +#define GPIO_FUNC_7_USART5_RTS (GPIO_FUNC_7) /*!< USART5 RTS */ + +#define GPIO_FUNC_7_USART6 (GPIO_FUNC_7) /*!< USART6 */ +#define GPIO_FUNC_7_USART6_CK (GPIO_FUNC_7) /*!< USART6 CK */ +#define GPIO_FUNC_7_USART6_CTS (GPIO_FUNC_7) /*!< USART6 CTS */ +#define GPIO_FUNC_7_USART6_RTS (GPIO_FUNC_7) /*!< USART6 RTS */ + +#define GPIO_FUNC_7_USART7 (GPIO_FUNC_7) /*!< USART7 */ +#define GPIO_FUNC_7_USART7_CK (GPIO_FUNC_7) /*!< USART7 CK */ +#define GPIO_FUNC_7_USART7_CTS (GPIO_FUNC_7) /*!< USART7 CTS */ +#define GPIO_FUNC_7_USART7_RTS (GPIO_FUNC_7) /*!< USART7 RTS */ + +#define GPIO_FUNC_7_USART8 (GPIO_FUNC_7) /*!< USART8 */ +#define GPIO_FUNC_7_USART8_CK (GPIO_FUNC_7) /*!< USART8 CK */ +#define GPIO_FUNC_7_USART8_CTS (GPIO_FUNC_7) /*!< USART8 CTS */ +#define GPIO_FUNC_7_USART8_RTS (GPIO_FUNC_7) /*!< USART8 RTS */ + +#define GPIO_FUNC_7_USART9 (GPIO_FUNC_7) /*!< USART9 */ +#define GPIO_FUNC_7_USART9_CK (GPIO_FUNC_7) /*!< USART9 CK */ +#define GPIO_FUNC_7_USART9_CTS (GPIO_FUNC_7) /*!< USART9 CTS */ +#define GPIO_FUNC_7_USART9_RTS (GPIO_FUNC_7) /*!< USART9 RTS */ + +#define GPIO_FUNC_7_USART10 (GPIO_FUNC_7) /*!< USART10 */ +#define GPIO_FUNC_7_USART10_CK (GPIO_FUNC_7) /*!< USART10 CK */ +#define GPIO_FUNC_7_USART10_CTS (GPIO_FUNC_7) /*!< USART10 CTS */ +#define GPIO_FUNC_7_USART10_RTS (GPIO_FUNC_7) /*!< USART10 RTS */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction8 GPIO Function 8 selection + * @{ + */ +#define GPIO_FUNC_8 (0x08U) +#define GPIO_FUNC_8_KEYSCAN (GPIO_FUNC_8) /*!< KEYSCAN */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction9 GPIO Function 9 selection + * @{ + */ +#define GPIO_FUNC_9 (0x09U) +#define GPIO_FUNC_9_SDIO (GPIO_FUNC_9) /*!< SDIO */ +#define GPIO_FUNC_9_SDIO1 (GPIO_FUNC_9) /*!< SDIO1 */ +#define GPIO_FUNC_9_SDIO1_WP (GPIO_FUNC_9) /*!< SDIO1 WP */ +#define GPIO_FUNC_9_SDIO1_CD (GPIO_FUNC_9) /*!< SDIO1 CD */ +#define GPIO_FUNC_9_SDIO1_CMD (GPIO_FUNC_9) /*!< SDIO1 CMD */ +#define GPIO_FUNC_9_SDIO1_CK (GPIO_FUNC_9) /*!< SDIO1 CK */ +#define GPIO_FUNC_9_SDIO1_DATA (GPIO_FUNC_9) /*!< SDIO1 data bus */ + +#define GPIO_FUNC_9_SDIO2 (GPIO_FUNC_9) /*!< SDIO2 */ +#define GPIO_FUNC_9_SDIO2_WP (GPIO_FUNC_9) /*!< SDIO2 WP */ +#define GPIO_FUNC_9_SDIO2_CD (GPIO_FUNC_9) /*!< SDIO2 CD */ +#define GPIO_FUNC_9_SDIO2_CMD (GPIO_FUNC_9) /*!< SDIO2 CMD */ +#define GPIO_FUNC_9_SDIO2_CK (GPIO_FUNC_9) /*!< SDIO2 CK */ +#define GPIO_FUNC_9_SDIO2_DATA (GPIO_FUNC_9) /*!< SDIO2 data bus */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction10 GPIO Function 10 selection + * @{ + */ +#define GPIO_FUNC_10 (0x0AU) +#define GPIO_FUNC_10_USBF (GPIO_FUNC_10) /*!< USB Full-speed */ +#define GPIO_FUNC_10_USBF_DRVVBUS (GPIO_FUNC_10) /*!< USB Full-speed host VBUS ctrl */ +#define GPIO_FUNC_10_USBF_SOF (GPIO_FUNC_10) /*!< USB Full-speed SOF */ +#define GPIO_FUNC_10_USBF_VBUS (GPIO_FUNC_10) /*!< USB Full-speed slave VBUS */ +#define GPIO_FUNC_10_USBF_ID (GPIO_FUNC_10) /*!< USB Full-speed */ + +#define GPIO_FUNC_10_USBH (GPIO_FUNC_10) /*!< USB High-speed */ +#define GPIO_FUNC_10_USBH_ULPI_DIR (GPIO_FUNC_10) /*!< USB High-speed ULPI DIR */ +#define GPIO_FUNC_10_USBH_ULPI_STP (GPIO_FUNC_10) /*!< USB High-speed ULPI STP */ +#define GPIO_FUNC_10_USBH_ULPI_NXT (GPIO_FUNC_10) /*!< USB High-speed ULPI NXT */ +#define GPIO_FUNC_10_USBH_ULPI_CK (GPIO_FUNC_10) /*!< USB High-speed ULPI CK */ +#define GPIO_FUNC_10_USBH_ULPI_DRVVBUS (GPIO_FUNC_10) /*!< USB High-speed host VBUS ctrl */ +#define GPIO_FUNC_10_USBH_ULPI_DATA (GPIO_FUNC_10) /*!< USB High-speed ULPI data bus */ + +#define GPIO_FUNC_10_TIM22_PWM (GPIO_FUNC_10) /*!< TMR2 unit 2 PWM */ +#define GPIO_FUNC_10_TIM22_PWMA (GPIO_FUNC_10) /*!< TMR2 unit 2 channel A PWM */ +#define GPIO_FUNC_10_TIM22_PWMB (GPIO_FUNC_10) /*!< TMR2 unit 2 channel B PWM */ + +#define GPIO_FUNC_10_TIM24_PWM (GPIO_FUNC_10) /*!< TMR2 unit 4 PWM */ +#define GPIO_FUNC_10_TIM24_PWMA (GPIO_FUNC_10) /*!< TMR2 unit 4 channel A PWM */ +#define GPIO_FUNC_10_TIM24_PWMB (GPIO_FUNC_10) /*!< TMR2 unit 4 channel B PWM */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction11 GPIO Function 11 selection + * @{ + */ +#define GPIO_FUNC_11 (0x0BU) +#define GPIO_FUNC_11_ETH (GPIO_FUNC_11) /*!< Ethernet */ +#define GPIO_FUNC_11_ETH_TXD (GPIO_FUNC_11) /*!< ETH TXD */ +#define GPIO_FUNC_11_ETH_TXEN (GPIO_FUNC_11) /*!< ETH TX enable */ +#define GPIO_FUNC_11_ETH_TXCLK (GPIO_FUNC_11) /*!< ETH TX clock */ +#define GPIO_FUNC_11_ETH_RXD (GPIO_FUNC_11) /*!< ETH RXD */ +#define GPIO_FUNC_11_ETH_RXER (GPIO_FUNC_11) /*!< ETH RX error */ +#define GPIO_FUNC_11_ETH_RXCLK (GPIO_FUNC_11) /*!< ETH RX clock */ +#define GPIO_FUNC_11_ETH_RXDV (GPIO_FUNC_11) /*!< ETH RX data valid */ +#define GPIO_FUNC_11_ETH_SMI_MDIO (GPIO_FUNC_11) /*!< SMI data */ +#define GPIO_FUNC_11_ETH_SMI_MDC (GPIO_FUNC_11) /*!< SMI clock */ +#define GPIO_FUNC_11_ETH_CRS (GPIO_FUNC_11) /*!< ETH MII carrier sense */ +#define GPIO_FUNC_11_ETH_COL (GPIO_FUNC_11) /*!< ETH MII collisioin detected */ +#define GPIO_FUNC_11_ETH_PPS_OUT (GPIO_FUNC_11) /*!< ETH PPS out */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction12 GPIO Function 12 selection + * @{ + */ +#define GPIO_FUNC_12 (0x0CU) +#define GPIO_FUNC_12_EXMC (GPIO_FUNC_12) /*!< Ext. Bus */ +#define GPIO_FUNC_12_EXMC_CLE (GPIO_FUNC_12) /*!< Ext. Bus NAND CMD latch */ +#define GPIO_FUNC_12_EXMC_ALE (GPIO_FUNC_12) /*!< Ext. Bus NAND ADDR latch */ +#define GPIO_FUNC_12_EXMC_RB (GPIO_FUNC_12) /*!< Ext. Bus NAND busy or SRAM wait(RB0) input */ +#define GPIO_FUNC_12_EXMC_CE (GPIO_FUNC_12) /*!< Ext. Bus chip enable */ +#define GPIO_FUNC_12_EXMC_WE (GPIO_FUNC_12) /*!< Ext. Bus write enable */ +#define GPIO_FUNC_12_EXMC_OE (GPIO_FUNC_12) /*!< Ext. Bus output enable */ +#define GPIO_FUNC_12_EXMC_BAA (GPIO_FUNC_12) /*!< Ext. Bus SRAM BAA */ +#define GPIO_FUNC_12_EXMC_ADV (GPIO_FUNC_12) /*!< Ext. Bus SRAM ADDR latch */ +#define GPIO_FUNC_12_EXMC_CLK (GPIO_FUNC_12) /*!< Ext. Bus clock output */ +#define GPIO_FUNC_12_EXMC_ADDR (GPIO_FUNC_12) /*!< Ext. Bus Addr. Bus */ +#define GPIO_FUNC_12_EXMC_DATA (GPIO_FUNC_12) /*!< Ext. Bus data Bus */ + +#define GPIO_FUNC_12_USBH (GPIO_FUNC_12) /*!< USB High-speed */ +#define GPIO_FUNC_12_USBH_SOF (GPIO_FUNC_12) /*!< USB High-speed SOF */ +#define GPIO_FUNC_12_USBH_VBUS (GPIO_FUNC_12) /*!< USB High-speed slave VBUS */ +#define GPIO_FUNC_12_USBH_ID (GPIO_FUNC_12) /*!< USB High-speed ID */ + +#define GPIO_FUNC_12_I2S2_EXCK (GPIO_FUNC_12) /*!< I2S2 EXCK */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction13 GPIO Function 13 selection + * @{ + */ +#define GPIO_FUNC_13 (0x0DU) +#define GPIO_FUNC_13_DVP (GPIO_FUNC_13) /*!< DVP */ +#define GPIO_FUNC_13_DVP_DATA (GPIO_FUNC_13) /*!< DVP data bus */ +#define GPIO_FUNC_13_DVP_PIXCLK (GPIO_FUNC_13) /*!< DVP pix clock */ +#define GPIO_FUNC_13_DVP_HSYNC (GPIO_FUNC_13) /*!< DVP line sync */ +#define GPIO_FUNC_13_DVP_VSYNC (GPIO_FUNC_13) /*!< DVP frame sync */ + +#define GPIO_FUNC_13_EXMC (GPIO_FUNC_13) /*!< Ext. Bus */ +#define GPIO_FUNC_13_EXMC_A16 (GPIO_FUNC_13) /*!< Ext. Bus address 16 */ +#define GPIO_FUNC_13_EXMC_A17 (GPIO_FUNC_13) /*!< Ext. Bus address 17 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction14 GPIO Function 14 selection + * @{ + */ +#define GPIO_FUNC_14 (0x0EU) +#define GPIO_FUNC_14_EP (GPIO_FUNC_14) /*!< Event Port */ +#define GPIO_FUNC_14_EP1 (GPIO_FUNC_14) /*!< Event Port Group 1 */ +#define GPIO_FUNC_14_EP2 (GPIO_FUNC_14) /*!< Event Port Group 2 */ +#define GPIO_FUNC_14_EP3 (GPIO_FUNC_14) /*!< Event Port Group 3 */ +#define GPIO_FUNC_14_EP4 (GPIO_FUNC_14) /*!< Event Port Group 4 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction15 GPIO Function 15 selection + * @{ + */ +#define GPIO_FUNC_15 (0x0FU) +#define GPIO_FUNC_15_EVENTOUT (GPIO_FUNC_15) /*!< Event Out */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction16 GPIO Function 16 selection + * @{ + */ +#define GPIO_FUNC_16 (0x10U) +#define GPIO_FUNC_16_TIM21 (GPIO_FUNC_16) /*!< TMR2 unit 1 */ +#define GPIO_FUNC_16_TIM21_CLKA (GPIO_FUNC_16) /*!< TMR2 unit 1 channel A CLK input */ +#define GPIO_FUNC_16_TIM21_CLKB (GPIO_FUNC_16) /*!< TMR2 unit 1 channel B CLK input */ +#define GPIO_FUNC_16_TIM21_PWMA (GPIO_FUNC_16) /*!< TMR2 unit 1 channel A PWM output */ +#define GPIO_FUNC_16_TIM21_PWMB (GPIO_FUNC_16) /*!< TMR2 unit 1 channel B PWM output */ + +#define GPIO_FUNC_16_TIM22 (GPIO_FUNC_16) /*!< TMR2 unit 2 */ +#define GPIO_FUNC_16_TIM22_CLKA (GPIO_FUNC_16) /*!< TMR2 unit 2 channel A CLK input */ +#define GPIO_FUNC_16_TIM22_CLKB (GPIO_FUNC_16) /*!< TMR2 unit 2 channel B CLK input */ +#define GPIO_FUNC_16_TIM22_PWMA (GPIO_FUNC_16) /*!< TMR2 unit 2 channel A PWM output */ +#define GPIO_FUNC_16_TIM22_PWMB (GPIO_FUNC_16) /*!< TMR2 unit 2 channel B PWM output */ + +#define GPIO_FUNC_16_TIM23 (GPIO_FUNC_16) /*!< TMR2 unit 3 */ +#define GPIO_FUNC_16_TIM23_CLKA (GPIO_FUNC_16) /*!< TMR2 unit 3 channel A CLK input */ +#define GPIO_FUNC_16_TIM23_CLKB (GPIO_FUNC_16) /*!< TMR2 unit 3 channel B CLK input */ +#define GPIO_FUNC_16_TIM23_PWMA (GPIO_FUNC_16) /*!< TMR2 unit 3 channel A PWM output */ +#define GPIO_FUNC_16_TIM23_PWMB (GPIO_FUNC_16) /*!< TMR2 unit 3 channel B PWM output */ + +#define GPIO_FUNC_16_TIM24 (GPIO_FUNC_16) /*!< TMR2 unit 4 */ +#define GPIO_FUNC_16_TIM24_CLKA (GPIO_FUNC_16) /*!< TMR2 unit 4 channel A CLK input */ +#define GPIO_FUNC_16_TIM24_CLKB (GPIO_FUNC_16) /*!< TMR2 unit 4 channel B CLK input */ +#define GPIO_FUNC_16_TIM24_PWMA (GPIO_FUNC_16) /*!< TMR2 unit 4 channel A PWM output */ +#define GPIO_FUNC_16_TIM24_PWMB (GPIO_FUNC_16) /*!< TMR2 unit 4 channel B PWM output */ + +#define GPIO_FUNC_16_TIM41_CLK (GPIO_FUNC_16) /*!< TMR4 unit 1 CLK input */ + +#define GPIO_FUNC_16_TIM42_CLK (GPIO_FUNC_16) /*!< TMR4 unit 2 CLK input */ +#define GPIO_FUNC_16_TIM42_OUL (GPIO_FUNC_16) /*!< TMR4 unit 2 U-phase low output */ +#define GPIO_FUNC_16_TIM42_OVL (GPIO_FUNC_16) /*!< TMR4 unit 2 V-phase low output */ +#define GPIO_FUNC_16_TIM42_OWL (GPIO_FUNC_16) /*!< TMR4 unit 2 W-phase low output */ + +#define GPIO_FUNC_16_TIM43_ADSM (GPIO_FUNC_16) /*!< TMR4 unit 3 special event */ + +/** + * @} + */ + +/** @defgroup GPIO_PinFunction17 GPIO Function 17 selection + * @{ + */ +#define GPIO_FUNC_17 (0x11U) +#define GPIO_FUNC_17_I2S1 (GPIO_FUNC_17) /*!< I2S1 */ +#define GPIO_FUNC_17_I2S1_MCK (GPIO_FUNC_17) /*!< I2S1 MCK */ +#define GPIO_FUNC_17_I2S1_EXCK (GPIO_FUNC_17) /*!< I2S1 EXCK */ +#define GPIO_FUNC_17_I2S1_SDIN (GPIO_FUNC_17) /*!< I2S1 SDIN */ + +#define GPIO_FUNC_17_I2S2 (GPIO_FUNC_17) /*!< I2S2 */ +#define GPIO_FUNC_17_I2S2_CK (GPIO_FUNC_17) /*!< I2S2 CK */ +#define GPIO_FUNC_17_I2S2_MCK (GPIO_FUNC_17) /*!< I2S2 MCK */ +#define GPIO_FUNC_17_I2S2_EXCK (GPIO_FUNC_17) /*!< I2S2 EXCK */ +#define GPIO_FUNC_17_I2S2_SD (GPIO_FUNC_17) /*!< I2S2 SD */ +#define GPIO_FUNC_17_I2S2_SDIN (GPIO_FUNC_17) /*!< I2S2 SDIN */ + +#define GPIO_FUNC_17_I2S3 (GPIO_FUNC_17) /*!< I2S3 */ +#define GPIO_FUNC_17_I2S3_MCK (GPIO_FUNC_17) /*!< I2S3 MCK */ +#define GPIO_FUNC_17_I2S3_EXCK (GPIO_FUNC_17) /*!< I2S3 EXCK */ +#define GPIO_FUNC_17_I2S3_SDIN (GPIO_FUNC_17) /*!< I2S3 SDIN */ + +#define GPIO_FUNC_17_I2S4 (GPIO_FUNC_17) /*!< I2S4 */ +#define GPIO_FUNC_17_I2S4_MCK (GPIO_FUNC_17) /*!< I2S4 MCK */ +#define GPIO_FUNC_17_I2S4_EXCK (GPIO_FUNC_17) /*!< I2S4 EXCK */ +#define GPIO_FUNC_17_I2S4_SDIN (GPIO_FUNC_17) /*!< I2S4 SDIN */ +#define GPIO_FUNC_17_I2S4_SD (GPIO_FUNC_17) /*!< I2S4 SD */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction18 GPIO Function 18 selection + * @{ + */ +#define GPIO_FUNC_18 (0x12U) +#define GPIO_FUNC_18_SPI1 (GPIO_FUNC_18) /*!< SPI1 */ +#define GPIO_FUNC_18_SPI1_NSS1 (GPIO_FUNC_18) /*!< SPI1 NSS1 */ +#define GPIO_FUNC_18_SPI1_NSS2 (GPIO_FUNC_18) /*!< SPI1 NSS2 */ +#define GPIO_FUNC_18_SPI1_NSS3 (GPIO_FUNC_18) /*!< SPI1 NSS3 */ + +#define GPIO_FUNC_18_SPI2 (GPIO_FUNC_18) /*!< SPI2 */ +#define GPIO_FUNC_18_SPI2_NSS0 (GPIO_FUNC_18) /*!< SPI2 NSS0 */ +#define GPIO_FUNC_18_SPI2_NSS1 (GPIO_FUNC_18) /*!< SPI2 NSS1 */ +#define GPIO_FUNC_18_SPI2_NSS2 (GPIO_FUNC_18) /*!< SPI2 NSS2 */ +#define GPIO_FUNC_18_SPI2_NSS3 (GPIO_FUNC_18) /*!< SPI2 NSS3 */ + +#define GPIO_FUNC_18_SPI3 (GPIO_FUNC_18) /*!< SPI3 */ +#define GPIO_FUNC_18_SPI3_NSS1 (GPIO_FUNC_18) /*!< SPI3 NSS1 */ +#define GPIO_FUNC_18_SPI3_NSS2 (GPIO_FUNC_18) /*!< SPI3 NSS2 */ +#define GPIO_FUNC_18_SPI3_NSS3 (GPIO_FUNC_18) /*!< SPI3 NSS3 */ + +#define GPIO_FUNC_18_SPI4 (GPIO_FUNC_18) /*!< SPI4 */ +#define GPIO_FUNC_18_SPI4_NSS1 (GPIO_FUNC_18) /*!< SPI4 NSS1 */ +#define GPIO_FUNC_18_SPI4_NSS2 (GPIO_FUNC_18) /*!< SPI4 NSS2 */ +#define GPIO_FUNC_18_SPI4_NSS3 (GPIO_FUNC_18) /*!< SPI4 NSS3 */ + +#define GPIO_FUNC_18_SPI5 (GPIO_FUNC_18) /*!< SPI5 */ +#define GPIO_FUNC_18_SPI5_NSS0 (GPIO_FUNC_18) /*!< SPI5 NSS0 */ +#define GPIO_FUNC_18_SPI5_NSS1 (GPIO_FUNC_18) /*!< SPI5 NSS1 */ +#define GPIO_FUNC_18_SPI5_NSS2 (GPIO_FUNC_18) /*!< SPI5 NSS2 */ +#define GPIO_FUNC_18_SPI5_NSS3 (GPIO_FUNC_18) /*!< SPI5 NSS3 */ + +#define GPIO_FUNC_18_SPI6 (GPIO_FUNC_18) /*!< SPI6 */ +#define GPIO_FUNC_18_SPI6_NSS1 (GPIO_FUNC_18) /*!< SPI6 NSS1 */ +#define GPIO_FUNC_18_SPI6_NSS2 (GPIO_FUNC_18) /*!< SPI6 NSS2 */ +#define GPIO_FUNC_18_SPI6_NSS3 (GPIO_FUNC_18) /*!< SPI6 NSS3 */ + +#define GPIO_FUNC_18_QSPI (GPIO_FUNC_18) /*!< QSPI */ +#define GPIO_FUNC_18_QSPI_NSS (GPIO_FUNC_18) /*!< QSPI NSS */ +#define GPIO_FUNC_18_QSPI_SCK (GPIO_FUNC_18) /*!< QSPI SCK */ +#define GPIO_FUNC_18_QSPI_IO0 (GPIO_FUNC_18) /*!< QSPI IO0 */ +#define GPIO_FUNC_18_QSPI_IO1 (GPIO_FUNC_18) /*!< QSPI IO1 */ +#define GPIO_FUNC_18_QSPI_IO2 (GPIO_FUNC_18) /*!< QSPI IO2 */ +#define GPIO_FUNC_18_QSPI_IO3 (GPIO_FUNC_18) /*!< QSPI IO3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction19 GPIO Function 19 selection + * @{ + */ +#define GPIO_FUNC_19 (0x13U) +#define GPIO_FUNC_19_SPI1 (GPIO_FUNC_19) /*!< SPI1 */ +#define GPIO_FUNC_19_SPI1_NSS0 (GPIO_FUNC_19) /*!< SPI1 NSS0 */ + +#define GPIO_FUNC_19_SPI2 (GPIO_FUNC_19) /*!< SPI2 */ +#define GPIO_FUNC_19_SPI2_NSS0 (GPIO_FUNC_19) /*!< SPI2 NSS0 */ +#define GPIO_FUNC_19_SPI2_MOSI (GPIO_FUNC_19) /*!< SPI2 MOSI */ +#define GPIO_FUNC_19_SPI2_MISO (GPIO_FUNC_19) /*!< SPI2 MISO */ +#define GPIO_FUNC_19_SPI2_SCK (GPIO_FUNC_19) /*!< SPI2 SCK */ + +#define GPIO_FUNC_19_SPI3 (GPIO_FUNC_19) /*!< SPI3 */ +#define GPIO_FUNC_19_SPI3_NSS0 (GPIO_FUNC_19) /*!< SPI3 NSS0 */ +#define GPIO_FUNC_19_SPI3_MOSI (GPIO_FUNC_19) /*!< SPI3 MOSI */ +#define GPIO_FUNC_19_SPI3_MISO (GPIO_FUNC_19) /*!< SPI3 MISO */ +#define GPIO_FUNC_19_SPI3_SCK (GPIO_FUNC_19) /*!< SPI3 SCK */ + +#define GPIO_FUNC_19_SPI (GPIO_FUNC_19) /*!< SPI4 */ +#define GPIO_FUNC_19_SPI4_NSS0 (GPIO_FUNC_19) /*!< SPI4 NSS0 */ + +#define GPIO_FUNC_19_SPI5 (GPIO_FUNC_19) /*!< SPI5 */ +#define GPIO_FUNC_19_SPI5_NSS0 (GPIO_FUNC_19) /*!< SPI5 NSS0 */ +#define GPIO_FUNC_19_SPI5_MOSI (GPIO_FUNC_19) /*!< SPI5 MOSI */ +#define GPIO_FUNC_19_SPI5_MISO (GPIO_FUNC_19) /*!< SPI5 MISO */ +#define GPIO_FUNC_19_SPI5_SCK (GPIO_FUNC_19) /*!< SPI5 SCK */ + +#define GPIO_FUNC_19_SPI6 (GPIO_FUNC_19) /*!< SPI6 */ +#define GPIO_FUNC_19_SPI6_NSS0 (GPIO_FUNC_19) /*!< SPI6 NSS0 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction20 GPIO Function 20 selection + * @{ + */ +#define GPIO_FUNC_20 (0x14U) +#define GPIO_FUNC_20_USART1 (GPIO_FUNC_20) /*!< USART1 */ +#define GPIO_FUNC_20_USART1_TX (GPIO_FUNC_20) /*!< USART1 TX */ +#define GPIO_FUNC_20_USART1_RX (GPIO_FUNC_20) /*!< USART1 RX */ +#define GPIO_FUNC_20_USART1_CTS (GPIO_FUNC_20) /*!< USART1 CTS */ +#define GPIO_FUNC_20_USART1_RTS (GPIO_FUNC_20) /*!< USART1 RTS */ +#define GPIO_FUNC_20_USART1_CK (GPIO_FUNC_20) /*!< USART1 CK */ + +#define GPIO_FUNC_20_USART2 (GPIO_FUNC_20) /*!< USART2 */ +#define GPIO_FUNC_20_USART2_TX (GPIO_FUNC_20) /*!< USART2 TX */ +#define GPIO_FUNC_20_USART2_RX (GPIO_FUNC_20) /*!< USART2 RX */ +#define GPIO_FUNC_20_USART2_CTS (GPIO_FUNC_20) /*!< USART2 CTS */ +#define GPIO_FUNC_20_USART2_RTS (GPIO_FUNC_20) /*!< USART2 RTS */ +#define GPIO_FUNC_20_USART2_CK (GPIO_FUNC_20) /*!< USART2 CK */ + +#define GPIO_FUNC_20_USART4 (GPIO_FUNC_20) /*!< USART4 */ +#define GPIO_FUNC_20_USART4_TX (GPIO_FUNC_20) /*!< USART4 TX */ +#define GPIO_FUNC_20_USART4_RX (GPIO_FUNC_20) /*!< USART4 RX */ + +#define GPIO_FUNC_20_USART5 (GPIO_FUNC_20) /*!< USART5 */ +#define GPIO_FUNC_20_USART5_TX (GPIO_FUNC_20) /*!< USART5 TX */ +#define GPIO_FUNC_20_USART5_RX (GPIO_FUNC_20) /*!< USART5 RX */ + +#define GPIO_FUNC_20_USART6 (GPIO_FUNC_20) /*!< USART6 */ +#define GPIO_FUNC_20_USART6_TX (GPIO_FUNC_20) /*!< USART6 TX */ +#define GPIO_FUNC_20_USART6_RX (GPIO_FUNC_20) /*!< USART6 RX */ +#define GPIO_FUNC_20_USART6_CTS (GPIO_FUNC_20) /*!< USART6 CTS */ +#define GPIO_FUNC_20_USART6_RTS (GPIO_FUNC_20) /*!< USART6 RTS */ +#define GPIO_FUNC_20_USART6_CK (GPIO_FUNC_20) /*!< USART6 CK */ + +#define GPIO_FUNC_20_USART7 (GPIO_FUNC_20) /*!< USART7 */ +#define GPIO_FUNC_20_USART7_TX (GPIO_FUNC_20) /*!< USART7 TX */ +#define GPIO_FUNC_20_USART7_RX (GPIO_FUNC_20) /*!< USART7 RX */ + +#define GPIO_FUNC_20_USART8 (GPIO_FUNC_20) /*!< USART8 */ +#define GPIO_FUNC_20_USART8_TX (GPIO_FUNC_20) /*!< USART8 TX */ +#define GPIO_FUNC_20_USART8_RX (GPIO_FUNC_20) /*!< USART8 RX */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction32 GPIO Function 32 selection + * @{ + */ +#define GPIO_FUNC_32 (0x20U) +#define GPIO_FUNC_32_USART1_TX (GPIO_FUNC_32) /*!< USART1 TX in Function Group 1 */ +#define GPIO_FUNC_32_USART4_TX (GPIO_FUNC_32) /*!< USART4 TX in Function Group 2 */ +#define GPIO_FUNC_32_USART3_TX (GPIO_FUNC_32) /*!< USART3 TX in Function Group 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction33 GPIO Function 33 selection + * @{ + */ +#define GPIO_FUNC_33 (0x21U) +#define GPIO_FUNC_33_USART1_RX (GPIO_FUNC_33) /*!< USART1 RX in Function Group 1 */ +#define GPIO_FUNC_33_USART4_RX (GPIO_FUNC_33) /*!< USART4 RX in Function Group 2 */ +#define GPIO_FUNC_33_USART3_RX (GPIO_FUNC_33) /*!< USART3 RX in Function Group 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction34 GPIO Function 34 selection + * @{ + */ +#define GPIO_FUNC_34 (0x22U) +#define GPIO_FUNC_34_USART2_TX (GPIO_FUNC_34) /*!< USART2 TX in Function Group 1 */ +#define GPIO_FUNC_34_USART5_TX (GPIO_FUNC_34) /*!< USART5 TX in Function Group 2 */ +#define GPIO_FUNC_34_USART8_TX (GPIO_FUNC_34) /*!< USART8 TX in Function Group 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction35 GPIO Function 35 selection + * @{ + */ +#define GPIO_FUNC_35 (0x23U) +#define GPIO_FUNC_35_USART2_RX (GPIO_FUNC_35) /*!< USART2 RX in Function Group 1 */ +#define GPIO_FUNC_35_USART5_RX (GPIO_FUNC_35) /*!< USART5 RX in Function Group 2 */ +#define GPIO_FUNC_35_USART8_RX (GPIO_FUNC_35) /*!< USART8 RX in Function Group 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction36 GPIO Function 36 selection + * @{ + */ +#define GPIO_FUNC_36 (0x24U) +#define GPIO_FUNC_36_USART3_TX (GPIO_FUNC_36) /*!< USART3 TX in Function Group 1 */ +#define GPIO_FUNC_36_USART6_TX (GPIO_FUNC_36) /*!< USART6 TX in Function Group 2 */ +#define GPIO_FUNC_36_USART9_TX (GPIO_FUNC_36) /*!< USART9 TX in Function Group 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction37 GPIO Function 37 selection + * @{ + */ +#define GPIO_FUNC_37 (0x25U) +#define GPIO_FUNC_37_USART3_RX (GPIO_FUNC_37) /*!< USART3 RX in Function Group 1 */ +#define GPIO_FUNC_37_USART6_RX (GPIO_FUNC_37) /*!< USART6 RX in Function Group 2 */ +#define GPIO_FUNC_37_USART9_RX (GPIO_FUNC_37) /*!< USART9 RX in Function Group 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction38 GPIO Function 38 selection + * @{ + */ +#define GPIO_FUNC_38 (0x26U) +#define GPIO_FUNC_38_USART4_TX (GPIO_FUNC_38) /*!< USART4 TX in Function Group 1 */ +#define GPIO_FUNC_38_USART7_TX (GPIO_FUNC_38) /*!< USART7 TX in Function Group 2 */ +#define GPIO_FUNC_38_USART10_TX (GPIO_FUNC_38) /*!< USART10 TX in Function Group 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction39 GPIO Function 39 selection + * @{ + */ +#define GPIO_FUNC_39 (0x27U) +#define GPIO_FUNC_39_USART4_RX (GPIO_FUNC_39) /*!< USART4 RX in Function Group 1 */ +#define GPIO_FUNC_39_USART7_RX (GPIO_FUNC_39) /*!< USART7 RX in Function Group 2 */ +#define GPIO_FUNC_39_USART10_RX (GPIO_FUNC_39) /*!< USART10 RX in Function Group 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction40 GPIO Function 40 selection + * @{ + */ +#define GPIO_FUNC_40 (0x28U) +#define GPIO_FUNC_40_SPI1_SCK (GPIO_FUNC_40) /*!< SPI1 SCK in Function Group 1 & 3 */ +#define GPIO_FUNC_40_SPI4_SCK (GPIO_FUNC_40) /*!< SPI4 SCK in Function Group 2 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction41 GPIO Function 41 selection + * @{ + */ +#define GPIO_FUNC_41 (0x29U) +#define GPIO_FUNC_41_SPI1_MOSI (GPIO_FUNC_41) /*!< SPI1 MOSI in Function Group 1 & 3 */ +#define GPIO_FUNC_41_SPI4_MOSI (GPIO_FUNC_41) /*!< SPI4 MOSI in Function Group 2 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction42 GPIO Function 42 selection + * @{ + */ +#define GPIO_FUNC_42 (0x2AU) +#define GPIO_FUNC_42_SPI1_MISO (GPIO_FUNC_42) /*!< SPI1 MISO in Function Group 1 & 3 */ +#define GPIO_FUNC_42_SPI4_MISO (GPIO_FUNC_42) /*!< SPI4 MISO in Function Group 2 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction43 GPIO Function 43 selection + * @{ + */ +#define GPIO_FUNC_43 (0x2BU) +#define GPIO_FUNC_43_SPI2_SCK (GPIO_FUNC_43) /*!< SPI2 SCK in Function Group 1 */ +#define GPIO_FUNC_43_SPI5_SCK (GPIO_FUNC_43) /*!< SPI5 SCK in Function Group 2 */ +#define GPIO_FUNC_43_SPI4_SCK (GPIO_FUNC_43) /*!< SPI4 SCK in Function Group 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction44 GPIO Function 44 selection + * @{ + */ +#define GPIO_FUNC_44 (0x2CU) +#define GPIO_FUNC_44_SPI2_MOSI (GPIO_FUNC_44) /*!< SPI2 MOSI in Function Group 1 */ +#define GPIO_FUNC_44_SPI5_MOSI (GPIO_FUNC_44) /*!< SPI5 MOSI in Function Group 2 */ +#define GPIO_FUNC_44_SPI4_MOSI (GPIO_FUNC_44) /*!< SPI4 MOSI in Function Group 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction45 GPIO Function 45 selection + * @{ + */ +#define GPIO_FUNC_45 (0x2DU) +#define GPIO_FUNC_45_SPI2_MISO (GPIO_FUNC_45) /*!< SPI2 MISO in Function Group 1 */ +#define GPIO_FUNC_45_SPI5_MISO (GPIO_FUNC_45) /*!< SPI5 MISO in Function Group 2 */ +#define GPIO_FUNC_45_SPI4_MISO (GPIO_FUNC_45) /*!< SPI4 MISO in Function Group 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction46 GPIO Function 46 selection + * @{ + */ +#define GPIO_FUNC_46 (0x2EU) +#define GPIO_FUNC_46_SPI3_SCK (GPIO_FUNC_46) /*!< SPI3 SCK in Function Group 1 */ +#define GPIO_FUNC_46_SPI6_SCK (GPIO_FUNC_46) /*!< SPI6 SCK in Function Group 2 */ +#define GPIO_FUNC_46_SPI4_NSS0 (GPIO_FUNC_46) /*!< SPI4 NSS0 in Function Group 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction47 GPIO Function 47 selection + * @{ + */ +#define GPIO_FUNC_47 (0x2FU) +#define GPIO_FUNC_47_SPI3_MOSI (GPIO_FUNC_47) /*!< SPI3 MOSI in Function Group 1 */ +#define GPIO_FUNC_47_SPI6_MOSI (GPIO_FUNC_47) /*!< SPI6 MOSI in Function Group 2 */ +#define GPIO_FUNC_47_SPI1_NSS0 (GPIO_FUNC_47) /*!< SPI4 NSS0 in Function Group 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction48 GPIO Function 48 selection + * @{ + */ +#define GPIO_FUNC_48 (0x30U) +#define GPIO_FUNC_48_SPI3_MISO (GPIO_FUNC_48) /*!< SPI3 MISO in Function Group 1 */ +#define GPIO_FUNC_48_SPI6_MISO (GPIO_FUNC_48) /*!< SPI6 MISO in Function Group 2 */ +#define GPIO_FUNC_48_I2C1_SDA (GPIO_FUNC_48) /*!< I2C1 SDA in Function Group 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction49 GPIO Function 49 selection + * @{ + */ +#define GPIO_FUNC_49 (0x31U) +#define GPIO_FUNC_49_SPI3_NSS0 (GPIO_FUNC_49) /*!< SPI3 NSS0 in Function Group 1 */ +#define GPIO_FUNC_49_SPI6_NSS0 (GPIO_FUNC_49) /*!< SPI6 NSS0 in Function Group 2 */ +#define GPIO_FUNC_49_I2C1_SCL (GPIO_FUNC_49) /*!< I2C1 SCL in Function Group 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction50 GPIO Function 50 selection + * @{ + */ +#define GPIO_FUNC_50 (0x32U) +#define GPIO_FUNC_50_I2C1_SDA (GPIO_FUNC_50) /*!< I2C1 SDA in Function Group 1 */ +#define GPIO_FUNC_50_I2C2_SDA (GPIO_FUNC_50) /*!< I2C2 SDA in Function Group 2 & 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction51 GPIO Function 51 selection + * @{ + */ +#define GPIO_FUNC_51 (0x33U) +#define GPIO_FUNC_51_I2C1_SCL (GPIO_FUNC_51) /*!< I2C1 SCL in Function Group 1 */ +#define GPIO_FUNC_51_I2C2_SCL (GPIO_FUNC_51) /*!< I2C2 SCL in Function Group 2 & 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction52 GPIO Function 52 selection + * @{ + */ +#define GPIO_FUNC_52 (0x34U) +#define GPIO_FUNC_52_I2C3_SDA (GPIO_FUNC_52) /*!< I2C3 SDA in Function Group 1 */ +#define GPIO_FUNC_52_I2C4_SDA (GPIO_FUNC_52) /*!< I2C4 SDA in Function Group 2 */ +#define GPIO_FUNC_52_I2C6_SDA (GPIO_FUNC_52) /*!< I2C6 SDA in Function Group 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction53 GPIO Function 53 selection + * @{ + */ +#define GPIO_FUNC_53 (0x35U) +#define GPIO_FUNC_53_I2C3_SCL (GPIO_FUNC_53) /*!< I2C3 SCL in Function Group 1 */ +#define GPIO_FUNC_53_I2C4_SCL (GPIO_FUNC_53) /*!< I2C4 SCL in Function Group 2 */ +#define GPIO_FUNC_53_I2C6_SCL (GPIO_FUNC_53) /*!< I2C6 SCL in Function Group 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction54 GPIO Function 54 selection + * @{ + */ +#define GPIO_FUNC_54 (0x36U) +#define GPIO_FUNC_54_I2S1_CK (GPIO_FUNC_54) /*!< I2S1 CK in Function Group 1&3 */ +#define GPIO_FUNC_54_I2C5_SDA (GPIO_FUNC_54) /*!< I2C5 SDA in Function Group 2 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction55 GPIO Function 55 selection + * @{ + */ +#define GPIO_FUNC_55 (0x37U) +#define GPIO_FUNC_55_I2S1_WS (GPIO_FUNC_55) /*!< I2S1_WS in Function Group 1&3 */ +#define GPIO_FUNC_55_I2C5_SCL (GPIO_FUNC_55) /*!< I2C5_SCL in Function Group 2 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction56 GPIO Function 56 selection + * @{ + */ +#define GPIO_FUNC_56 (0x38U) +#define GPIO_FUNC_56_I2S1_SD (GPIO_FUNC_56) /*!< I2S1 SD in Function Group 1&3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction57 GPIO Function 57 selection + * @{ + */ +#define GPIO_FUNC_57 (0x39U) +#define GPIO_FUNC_57_I2S2_CK (GPIO_FUNC_57) /*!< I2S2 CK in Function Group 1 */ +#define GPIO_FUNC_57_I2S3_CK (GPIO_FUNC_57) /*!< I2S3 CK in Function Group 2 */ +#define GPIO_FUNC_57_I2S4_CK (GPIO_FUNC_57) /*!< I2S4 CK in Function Group 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction58 GPIO Function 58 selection + * @{ + */ +#define GPIO_FUNC_58 (0x3AU) +#define GPIO_FUNC_58_I2S2_WS (GPIO_FUNC_58) /*!< I2S2 WS in Function Group 1 */ +#define GPIO_FUNC_58_I2S3_WS (GPIO_FUNC_58) /*!< I2S3 WS in Function Group 2 */ +#define GPIO_FUNC_58_I2S4_WS (GPIO_FUNC_58) /*!< I2S4 WS in Function Group 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction59 GPIO Function 59 selection + * @{ + */ +#define GPIO_FUNC_59 (0x3BU) +#define GPIO_FUNC_59_I2S2_SD (GPIO_FUNC_59) /*!< I2S2 SD in Function Group 1 */ +#define GPIO_FUNC_59_I2S3_SD (GPIO_FUNC_59) /*!< I2S3 SD in Function Group 2 */ +#define GPIO_FUNC_59_I2S4_SD (GPIO_FUNC_59) /*!< I2S4 SD in Function Group 3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction60 GPIO Function 60 selection + * @{ + */ +#define GPIO_FUNC_60 (0x3CU) +#define GPIO_FUNC_60_CAN1_TX (GPIO_FUNC_60) /*!< CAN1 TX in Function Group 1~3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction61 GPIO Function 61 selection + * @{ + */ +#define GPIO_FUNC_61 (0x3DU) +#define GPIO_FUNC_61_CAN1_RX (GPIO_FUNC_61) /*!< CAN1 RX in Function Group 1~3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction62 GPIO Function 62 selection + * @{ + */ +#define GPIO_FUNC_62 (0x3EU) +#define GPIO_FUNC_62_CAN2_TX (GPIO_FUNC_62) /*!< CAN2 TX in Function Group 1~3 */ +/** + * @} + */ + +/** @defgroup GPIO_PinFunction63 GPIO Function 63 selection + * @{ + */ +#define GPIO_FUNC_63 (0x3FU) +#define GPIO_FUNC_63_CAN2_RX (GPIO_FUNC_63) /*!< CAN2 RX in Function Group 1~3 */ +/** + * @} + */ + +/** @defgroup GPIO_DebugPin_Sel GPIO Debug pin selection + * @{ + */ +#define GPIO_PIN_SWCLK (0x01U) +#define GPIO_PIN_SWDIO (0x02U) +#define GPIO_PIN_SWO (0x04U) +#define GPIO_PIN_DEBUG_SWD (0x07U) + +#define GPIO_PIN_TCK (0x01U) +#define GPIO_PIN_TMS (0x02U) +#define GPIO_PIN_TDO (0x04U) +#define GPIO_PIN_TDI (0x08U) +#define GPIO_PIN_TRST (0x10U) +#define GPIO_PIN_DEBUG_JTAG (0x1FU) +/** + * @} + */ + +/** @defgroup GPIO_ReadCycle_Sel GPIO pin read wait cycle selection + * @{ + */ +#define GPIO_READ_WAIT_0 ((uint16_t)(0x00UL << GPIO_PCCR_RDWT_POS)) +#define GPIO_READ_WAIT_1 ((uint16_t)(0x01UL << GPIO_PCCR_RDWT_POS)) +#define GPIO_READ_WAIT_2 ((uint16_t)(0x02UL << GPIO_PCCR_RDWT_POS)) +#define GPIO_READ_WAIT_3 ((uint16_t)(0x03UL << GPIO_PCCR_RDWT_POS)) +#define GPIO_READ_WAIT_4 ((uint16_t)(0x04UL << GPIO_PCCR_RDWT_POS)) +#define GPIO_READ_WAIT_5 ((uint16_t)(0x05UL << GPIO_PCCR_RDWT_POS)) +#define GPIO_READ_WAIT_6 ((uint16_t)(0x06UL << GPIO_PCCR_RDWT_POS)) +#define GPIO_READ_WAIT_7 ((uint16_t)(0x07UL << GPIO_PCCR_RDWT_POS)) +/** + * @} + */ + +/** + * @defgroup GPIO_PinState_Sel GPIO pin output state selection + * @{ + */ +#define PIN_STATE_RESET (0U) +#define PIN_STATE_SET (GPIO_PCR_POUT) +/** + * @} + */ + +/** + * @defgroup GPIO_PinDirection_Sel GPIO pin input/output direction selection + * @{ + */ +#define PIN_DIR_IN (0U) +#define PIN_DIR_OUT (GPIO_PCR_POUTE) +/** + * @} + */ + +/** + * @defgroup GPIO_PinOutType_Sel GPIO pin output type selection + * @{ + */ +#define PIN_OTYPE_CMOS (0U) +#define PIN_OTYPE_NMOS (GPIO_PCR_NOD) +/** + * @} + */ + +/** + * @defgroup GPIO_PinDrv_Sel GPIO Pin drive capacity selection + * @{ + */ +#define PIN_DRV_LOW (0U) +#define PIN_DRV_MID (GPIO_PCR_DRV_0) +#define PIN_DRV_HIGH (GPIO_PCR_DRV_1) +/** + * @} + */ + +/** + * @defgroup GPIO_PinLatch_Sel GPIO Pin output latch selection + * @{ + */ +#define PIN_LATCH_OFF (0U) +#define PIN_LATCH_ON (GPIO_PCR_LTE) +/** + * @} + */ + +/** + * @defgroup GPIO_PinPU_Sel GPIO Pin internal pull-up resistor selection + * @{ + */ +#define PIN_PU_OFF (0U) +#define PIN_PU_ON (GPIO_PCR_PUU) +/** + * @} + */ + +/** + * @defgroup GPIO_PinInvert_Sel GPIO Pin I/O invert selection + * @{ + */ +#define PIN_INVERT_OFF (0U) +#define PIN_INVERT_ON (GPIO_PCR_INVE) +/** + * @} + */ + +/** + * @defgroup GPIO_PinInType_Sel GPIO Pin input type selection + * @{ + */ +#define PIN_ITYPE_SMT (0U) +#define PIN_ITYPE_CMOS (GPIO_PCR_CINSEL) +/** + * @} + */ + +/** + * @defgroup GPIO_PinExInt_Sel GPIO Pin external interrupt selection + * @{ + */ +#define PIN_EXINT_OFF (0U) +#define PIN_EXINT_ON (GPIO_PCR_INTE) +/** + * @} + */ + +/** + * @defgroup GPIO_PinMode_Sel GPIO Pin mode selection + * @{ + */ +#define PIN_ATTR_DIGITAL (0U) +#define PIN_ATTR_ANALOG (GPIO_PCR_DDIS) +/** + * @} + */ + +/** + * @defgroup GPIO_PinSubFuncSet_Sel GPIO Pin sub-function enable or disable + * @{ + */ +#define PIN_SUBFUNC_DISABLE (0U) +#define PIN_SUBFUNC_ENABLE (GPIO_PFSR_BFE) +/** + * @} + */ + +/** + * @defgroup GPIO_Register_Protect GPIO Registers Protect Code + * @{ + */ +#define GPIO_REG_UNPROTECT (0xA501U) +#define GPIO_REG_PROTECT (0xA500U) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup GPIO_Global_Functions + * @{ + */ +/** + * @brief GPIO lock. PSPCR, PCCR, PINAER, PCRxy, PFSRxy write disable + * @param None + * @retval None + */ +__STATIC_INLINE void GPIO_Lock(void) +{ + WRITE_REG16(M4_GPIO->PWPR, GPIO_REG_PROTECT); +} + +/** + * @brief GPIO unlock. PSPCR, PCCR, PINAER, PCRxy, PFSRxy write enable + * @param None + * @retval None + */ +__STATIC_INLINE void GPIO_Unlock(void) +{ + WRITE_REG16(M4_GPIO->PWPR, GPIO_REG_UNPROTECT); +} + +en_result_t GPIO_Init(uint8_t u8Port, uint16_t u16Pin, const stc_gpio_init_t *pstcGpioInit); +void GPIO_DeInit(void); +void GPIO_Unlock(void); +void GPIO_Lock(void); +en_result_t GPIO_StructInit(stc_gpio_init_t *pstcGpioInit); +void GPIO_SetDebugPort(uint8_t u8DebugPort, en_functional_state_t enNewState); +void GPIO_SetFunc(uint8_t u8Port, uint16_t u16Pin, uint8_t u8Func, uint16_t u16BFE); +void GPIO_SetSubFunc(uint8_t u8Func); +void GPIO_SetReadWaitCycle(uint16_t u16ReadWait); +void GPIO_InMOSCmd(uint16_t u16PortIdx, en_functional_state_t enNewState); +void GPIO_OE(uint8_t u8Port, uint16_t u16Pin, en_functional_state_t enNewState); +//port pin +en_pin_state_t GPIO_ReadInputPins(uint8_t u8Port, uint16_t u16Pin); +uint16_t GPIO_ReadInputPort(uint8_t u8Port); +en_pin_state_t GPIO_ReadOutputPins(uint8_t u8Port, uint16_t u16Pin); +uint16_t GPIO_ReadOutputPort(uint8_t u8Port); +void GPIO_SetPins(uint8_t u8Port, uint16_t u16Pin); +void GPIO_ResetPins(uint8_t u8Port, uint16_t u16Pin); +void GPIO_TogglePins(uint8_t u8Port, uint16_t u16Pin); +void GPIO_WritePort(uint8_t u8Port, uint16_t u16PortVal); + +/** + * @} + */ + +#endif /* DDL_GPIO_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_GPIO_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_hash.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_hash.h new file mode 100644 index 0000000000..25ca2ee62c --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_hash.h @@ -0,0 +1,233 @@ +/** + ******************************************************************************* + * @file hc32f4a0_hash.h + * @brief This file contains all the functions prototypes of the HASH driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Heqb First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_HASH_H__ +#define __HC32F4A0_HASH_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_HASH + * @{ + */ + +#if (DDL_HASH_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ + +/** + * @defgroup HASH_Global_Macros HASH Global Macros + * @{ + */ + +#define HASH_GROUP_LEN (64U) +#define LAST_GROUP_MAX_LEN (56U) + +/** @defgroup HASH_Mode HASH Mode + * @{ + */ +#define HASH_MODE_SHA_256 (0x00000000UL) /*!< SHA_256 Operating mode */ +#define HASH_MODE_HMAC (0x00000010UL) /*!< HMAC Operating mode */ +/** + * @} + */ + +/** + * @defgroup HASH_Key_Len HASH Key Length + * @{ + */ +#define HASH_KEY_LEN_LONG (HASH_CR_LKEY) /*!< Key length > 64 Bytes */ +#define HASH_KEY_LEN_SHORT (0x0UL) /*!< Key length <= 64 Bytes */ +/** + * @} + */ + +/** + * @defgroup HASH_Interrupt_Definition HASH Interrupt Definition + * @{ + */ +#define HASH_INT_GROUP (HASH_CR_HEIE) /*!< A set of data operations complete interrupt */ +#define HASH_INT_ALL (HASH_CR_HCIE) /*!< All data operations complete interrupt */ +/** + * @} + */ + +/** + * @defgroup HASH_Msg_Group HASH Messages Group + * @{ + */ +#define HASH_MSG_GRP_FIRST (HASH_CR_FST_GRP) /*!< The first group of messages or keys */ +#define HASH_MSG_GRP_END (HASH_CR_KMSG_END) /*!< The last group of messages or keys */ +#define HASH_MSG_GRP_ONLY_ONE (HASH_CR_FST_GRP | \ + HASH_CR_KMSG_END) /*!< Only one set of message or key */ +/** + * @} + */ + +/** + * @defgroup HASH_Status HASH Status + * @{ + */ +#define HASH_FLAG_START (HASH_CR_START) /*!< Operation in progress */ +#define HASH_FLAG_BUSY (HASH_CR_BUSY) /*!< HASH in operation */ +#define HASH_FLAG_CYC_END (HASH_CR_CYC_END) /*!< key or message operation completed */ +#define HASH_FLAG_HMAC_END (HASH_CR_HMAC_END) /*!< HMAC operation completed */ +/** + * @} + */ + +/** + * @defgroup HASH_Common_Trigger_Sel HASH common trigger source select + * @{ + */ +#define HASH_COM_TRIG1 (AOS_HASH_ITRGSELA_COMTRG_EN_0) +#define HASH_COM_TRIG2 (AOS_HASH_ITRGSELA_COMTRG_EN_1) +#define HASH_COM_TRIG_MASk (AOS_HASH_ITRGSELA_COMTRG_EN) +/** + * @} + */ + +/** + * @defgroup HASH_Common_Trigger_Reg_Sel HASH common trigger cource select + * @{ + */ +#define HASH_TRIG_REG_BLKCOM (0U) /*!< DMA block transfer complete register */ +#define HASH_TRIG_REG_TRNCOM (1U) /*!< DMA transfer complete register*/ +/** + * @} + */ + +/** + * @defgroup HASH_Trigger_Source_Sel HASH Trigger Source Select + * @{ + */ +#define HASH_TRG_SRC_DMA1_BTC0 (EVT_DMA1_BTC0) /*!< Select the DMA1 ch0 block transfer complete */ +#define HASH_TRG_SRC_DMA1_BTC1 (EVT_DMA1_BTC1) /*!< Select the DMA1 ch1 block transfer complete */ +#define HASH_TRG_SRC_DMA1_BTC2 (EVT_DMA1_BTC2) /*!< Select the DMA1 ch2 block transfer complete */ +#define HASH_TRG_SRC_DMA1_BTC3 (EVT_DMA1_BTC3) /*!< Select the DMA1 ch3 block transfer complete */ +#define HASH_TRG_SRC_DMA1_BTC4 (EVT_DMA1_BTC4) /*!< Select the DMA1 ch4 block transfer complete */ +#define HASH_TRG_SRC_DMA1_BTC5 (EVT_DMA1_BTC5) /*!< Select the DMA1 ch5 block transfer complete */ +#define HASH_TRG_SRC_DMA1_BTC6 (EVT_DMA1_BTC6) /*!< Select the DMA1 ch6 block transfer complete */ +#define HASH_TRG_SRC_DMA1_BTC7 (EVT_DMA1_BTC7) /*!< Select the DMA1 ch7 block transfer complete */ +#define HASH_TRG_SRC_DMA1_TC0 (EVT_DMA1_TC0) /*!< Select the DMA1 ch0 transfer complete*/ +#define HASH_TRG_SRC_DMA1_TC1 (EVT_DMA1_TC1) /*!< Select the DMA1 ch1 transfer complete*/ +#define HASH_TRG_SRC_DMA1_TC2 (EVT_DMA1_TC2) /*!< Select the DMA1 ch2 transfer complete*/ +#define HASH_TRG_SRC_DMA1_TC3 (EVT_DMA1_TC3) /*!< Select the DMA1 ch3 transfer complete*/ +#define HASH_TRG_SRC_DMA1_TC4 (EVT_DMA1_TC4) /*!< Select the DMA1 ch4 transfer complete*/ +#define HASH_TRG_SRC_DMA1_TC5 (EVT_DMA1_TC5) /*!< Select the DMA1 ch5 transfer complete*/ +#define HASH_TRG_SRC_DMA1_TC6 (EVT_DMA1_TC6) /*!< Select the DMA1 ch6 transfer complete*/ +#define HASH_TRG_SRC_DMA1_TC7 (EVT_DMA1_TC7) /*!< Select the DMA1 ch7 transfer complete*/ +#define HASH_TRG_SRC_DMA2_BTC0 (EVT_DMA2_BTC0) /*!< Select the DMA2 ch0 block transfer complete */ +#define HASH_TRG_SRC_DMA2_BTC1 (EVT_DMA2_BTC1) /*!< Select the DMA2 ch1 block transfer complete */ +#define HASH_TRG_SRC_DMA2_BTC2 (EVT_DMA2_BTC2) /*!< Select the DMA2 ch2 block transfer complete */ +#define HASH_TRG_SRC_DMA2_BTC3 (EVT_DMA2_BTC3) /*!< Select the DMA2 ch3 block transfer complete */ +#define HASH_TRG_SRC_DMA2_BTC4 (EVT_DMA2_BTC4) /*!< Select the DMA2 ch4 block transfer complete */ +#define HASH_TRG_SRC_DMA2_BTC5 (EVT_DMA2_BTC5) /*!< Select the DMA2 ch5 block transfer complete */ +#define HASH_TRG_SRC_DMA2_BTC6 (EVT_DMA2_BTC6) /*!< Select the DMA2 ch6 block transfer complete */ +#define HASH_TRG_SRC_DMA2_BTC7 (EVT_DMA2_BTC7) /*!< Select the DMA2 ch7 block transfer complete */ +#define HASH_TRG_SRC_DMA2_TC0 (EVT_DMA2_TC0) /*!< Select the DMA2 ch0 transfer complete*/ +#define HASH_TRG_SRC_DMA2_TC1 (EVT_DMA2_TC1) /*!< Select the DMA2 ch1 transfer complete*/ +#define HASH_TRG_SRC_DMA2_TC2 (EVT_DMA2_TC2) /*!< Select the DMA2 ch2 transfer complete*/ +#define HASH_TRG_SRC_DMA2_TC3 (EVT_DMA2_TC3) /*!< Select the DMA2 ch3 transfer complete*/ +#define HASH_TRG_SRC_DMA2_TC4 (EVT_DMA2_TC4) /*!< Select the DMA2 ch4 transfer complete*/ +#define HASH_TRG_SRC_DMA2_TC5 (EVT_DMA2_TC5) /*!< Select the DMA2 ch5 transfer complete*/ +#define HASH_TRG_SRC_DMA2_TC6 (EVT_DMA2_TC6) /*!< Select the DMA2 ch6 transfer complete*/ +#define HASH_TRG_SRC_DMA2_TC7 (EVT_DMA2_TC7) /*!< Select the DMA2 ch7 transfer complete*/ +/** + * @} + */ +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup HASH_Global_Functions + * @{ + */ +en_result_t HASH_Calculate(const void *pvSrcData, + uint32_t u32SrcDataSize, + uint8_t au8MsgDigest[]); +en_result_t HMAC_Calculate(const void *pvSrcData, + uint32_t u32SrcDataSize, + const uint8_t au8Key[], + uint32_t u32KeyLength, + uint8_t au8MsgDigest[]); +en_result_t HASH_Start(void); +en_result_t HASH_IntCmd(uint32_t u32HashInt, en_functional_state_t enNewState); +en_result_t HASH_SetMode(uint32_t u32HashMode); +en_result_t HASH_SetKeyLength(uint32_t u32KeyLen); +en_result_t HASH_MsgGrpConfig(uint32_t u32MsgGroup); +en_result_t HASH_ClearStatus(uint32_t u32ClearFlag); +void HASH_SetTriggerSrc(en_event_src_t enSrc); +void HASH_ComTriggerCmd(uint8_t u8TrigReg, uint32_t u32ComTrig, \ + en_functional_state_t enNewState); +en_flag_status_t HASH_GetStatus(uint32_t u32HashFlag); +void HASH_GetResult(uint8_t au8MsgDigest[]); +/** + * @} + */ + +#endif /* DDL_HASH_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_HASH_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_hrpwm.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_hrpwm.h new file mode 100644 index 0000000000..385de0ef17 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_hrpwm.h @@ -0,0 +1,138 @@ +/** + ******************************************************************************* + * @file hc32f4a0_hrpwm.h + * @brief Head file for HRPWM module. + * + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Wangmin First version + 2020-09-07 Wangmin Modify channel delay configure function + parameter type. + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_HRPWM_H__ +#define __HC32F4A0_HRPWM_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_HRPWM + * @{ + */ + +#if (DDL_HRPWM_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup HRPWM_Global_Macros HRPWM Global Macros + * @{ + */ + +#define HRPWM_CH_MIN (1UL) +#define HRPWM_CH_MAX (16UL) + +#define HRPWM_CH_DELAY_NUM_MIN (1U) +#define HRPWM_CH_DELAY_NUM_MAX (256U) + +/** @defgroup HRPWM_Calibrate_Unit_Define HRPWM Calibrate unit define + * @{ + */ +#define HRPWM_CAL_UNIT0 (0x00UL) +#define HRPWM_CAL_UNIT1 (0x01UL) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup HRPWM_Global_Functions + * @{ + */ +/* HRPWM Judge the condition of calibration function */ +en_functional_state_t HRPWM_ConditionConfirm(void); + +/* Process for getting HRPWM Calibrate function code */ +en_result_t HRPWM_CalibrateProcess(uint32_t u32Unit, uint8_t* pu8Code); + +/* HRPWM Calibrate function enable or disable for specified unit */ +void HRPWM_CalibrateCmd(uint32_t u32Unit, en_functional_state_t enNewState); +/* HRPWM Calibrate function status get for specified unit */ +en_functional_state_t HRPWM_GetCalibrateStd(uint32_t u32Unit); +/* HRPWM Calibrate code get for specified unit */ +uint8_t HRPWM_GetCalCode(uint32_t u32Unit); + +/* HRPWM function enable or disable for specified channel */ +void HRPWM_CHCmd(uint32_t u32Ch, en_functional_state_t enNewState); +/* HRPWM positive edge adjust enable or disable for specified channel */ +void HRPWM_CHPositAdjCmd(uint32_t u32Ch, en_functional_state_t enNewState); +/* HRPWM negative edge adjust enable or disable for specified channel */ +void HRPWM_CHNegatAdjCmd(uint32_t u32Ch, en_functional_state_t enNewState); +/* HRPWM positive edge adjust delay counts configration for specified channel */ +void HRPWM_CHPositCfg(uint32_t u32Ch, uint8_t u8DelayNum); +/* HRPWM negative edge adjust delay counts configration for specified channel */ +void HRPWM_CHNegatCfg(uint32_t u32Ch, uint8_t u8DelayNum); + +/** + * @} + */ + +#endif /* DDL_HRPWM_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_HRPWM_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_i2c.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_i2c.h new file mode 100644 index 0000000000..5ea767610d --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_i2c.h @@ -0,0 +1,266 @@ +/** + ******************************************************************************* + * @file hc32f4a0_i2c.h + * @brief This file contains all the functions prototypes of the Inter-Integrated + * Circuit(I2C). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Hexiao First version + 2020-07-15 Hexiao Modify I2C_SmBusCmd to I2C_SetMode + 2020-08-31 Hexiao Remove invalid clock division value + 2020-10-30 Hexiao Optimize data transfer api,etc. + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_I2C_H__ +#define __HC32F4A0_I2C_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_I2C + * @{ + */ + +#if (DDL_I2C_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup I2C_Global_Types I2C Global Types + * @{ + */ + +/** + * @brief I2c configuration structure + */ +typedef struct +{ + uint32_t u32ClkDiv; /*!< I2C clock division for pclk3*/ + uint32_t u32Baudrate; /*!< I2C baudrate config*/ + uint32_t u32SclTime; /*!< The SCL rising and falling time, count of T(pclk3)*/ +}stc_i2c_init_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ + +/** + * @defgroup I2C_Global_Macros I2C Global Macros + * @{ + */ + +/** @defgroup I2C_Buadrate_Max I2C baudrate max value + * @{ + */ +#define I2C_BAUDRATE_MAX (400000UL) +/** + * @} + */ + +/** @defgroup I2C_Mode Peripheral Mode + * @{ + */ +#define I2C_MODE_I2C (0UL) +#define I2C_MODE_SMBUS (2UL) +/** + * @} + */ + +/** @defgroup I2C_Transfer_Direction I2C transfer direction + * @{ + */ +#define I2C_DIR_TX (0x0U) +#define I2C_DIR_RX (0x1U) +/** + * @} + */ + +/** @defgroup I2C_Addr_Config I2C address configuration + * @{ + */ +#define I2C_ADDR_MODE_7BIT (0x0U) +#define I2C_ADDR_MODE_10BIT (I2C_SLR0_ADDRMOD0) +/** + * @} + */ + +/** @defgroup I2C_Clock_division I2C clock division + * @{ + */ +#define I2C_CLK_DIV1 (0UL) +#define I2C_CLK_DIV2 (1UL) +#define I2C_CLK_DIV4 (2UL) +#define I2C_CLK_DIV8 (3UL) +#define I2C_CLK_DIV16 (4UL) +#define I2C_CLK_DIV32 (5UL) +#define I2C_CLK_DIV64 (6UL) +#define I2C_CLK_DIV128 (7UL) +/** + * @} + */ + +/** @defgroup I2C_Address_Num I2C address number + * @{ + */ +#define I2C_ADDR_0 (0UL) +#define I2C_ADDR_1 (1UL) +/** + * @} + */ + +/** @defgroup I2C_Ack_Type I2C ack type + * @{ + */ +#define I2C_ACK (0UL) +#define I2C_NACK (I2C_CR1_ACK) +/** + * @} + */ + +/** @defgroup I2C_Smbus_Match_Cfg I2C smbus address match configuration + * @{ + */ +#define I2C_SMBUS_MATCH_ALRT (I2C_CR1_SMBALRTEN) +#define I2C_SMBUS_MATCH_DEFAULT (I2C_CR1_SMBDEFAULTEN) +#define I2C_SMBUS_MATCH_HOST (I2C_CR1_SMBHOSTEN) +/** + * @} + */ + +/** @defgroup I2C_Smbus_clear_mask I2C smbus clear mask + * @{ + */ +#define I2C_SMBUS_CONFIG_CLEARMASK (I2C_CR1_SMBALRTEN|I2C_CR1_SMBDEFAULTEN|I2C_CR1_SMBHOSTEN) +/** + * @} + */ + +/** @defgroup I2C_Digital_Filter_mode I2C digital filter mode + * @{ + */ +#define I2C_DIG_FILTMODE_1CYCLE (0UL << I2C_FLTR_DNF_POS) +#define I2C_DIG_FILTMODE_2CYCLE (1UL << I2C_FLTR_DNF_POS) +#define I2C_DIG_FILTMODE_3CYCLE (2UL << I2C_FLTR_DNF_POS) +#define I2C_DIG_FILTMODE_4CYCLE (3UL << I2C_FLTR_DNF_POS) +/** + * @} + */ + + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup I2C_Global_Functions + * @{ + */ + +/* Initialization and Configuration **********************************/ +void I2C_DeInit(M4_I2C_TypeDef* I2Cx); +en_result_t I2C_StructInit(stc_i2c_init_t* pstcI2C_InitStruct); +en_result_t I2C_Init(M4_I2C_TypeDef* I2Cx, const stc_i2c_init_t *pstcI2C_InitStruct, float32_t *pf32Err); +en_result_t I2C_BaudrateConfig(M4_I2C_TypeDef* I2Cx, const stc_i2c_init_t *pstcI2C_InitStruct, float32_t *pf32Err); +void I2C_SlaveAddrCmd(M4_I2C_TypeDef* I2Cx, uint32_t u32AddrNum, en_functional_state_t enNewState); +void I2C_SlaveAddrConfig(M4_I2C_TypeDef* I2Cx, uint32_t u32AddrNum, uint32_t u32AddrMode, uint32_t u32Addr); +void I2C_SetMode(M4_I2C_TypeDef* I2Cx, uint32_t u32Mode); +void I2C_Cmd(M4_I2C_TypeDef* I2Cx, en_functional_state_t enNewState); +void I2C_FastAckCmd(M4_I2C_TypeDef* I2Cx, en_functional_state_t enNewState); +void I2C_BusWaitCmd(M4_I2C_TypeDef* I2Cx, en_functional_state_t enNewState); +void I2C_SoftwareResetCmd(M4_I2C_TypeDef* I2Cx, en_functional_state_t enNewState); +void I2C_IntCmd(M4_I2C_TypeDef* I2Cx, uint32_t u32IntEn, en_functional_state_t enNewState); + +void I2C_ClkHighTimeoutConfig(M4_I2C_TypeDef* I2Cx, uint16_t u16TimeoutH); +void I2C_ClkLowTimeoutConfig(M4_I2C_TypeDef* I2Cx, uint16_t u16TimeoutL); +void I2C_ClkHighTimeoutCmd(M4_I2C_TypeDef* I2Cx, en_functional_state_t enNewState); +void I2C_ClkLowTimeoutCmd(M4_I2C_TypeDef* I2Cx, en_functional_state_t enNewState); +void I2C_ClkTimeoutCmd(M4_I2C_TypeDef* I2Cx, en_functional_state_t enNewState); +void I2C_SmbusConfig(M4_I2C_TypeDef* I2Cx, uint32_t u32SmbusConfig, en_functional_state_t enNewState); +void I2C_DigitalFilterConfig(M4_I2C_TypeDef* I2Cx, uint32_t u32DigFilterMode); +void I2C_DigitalFilterCmd(M4_I2C_TypeDef* I2Cx, en_functional_state_t enNewState); +void I2C_AnalogFilterCmd(M4_I2C_TypeDef* I2Cx, en_functional_state_t enNewState); +void I2C_GeneralCallCmd(M4_I2C_TypeDef* I2Cx, en_functional_state_t enNewState); + +/* Start/Restart/Stop ************************************************/ +void I2C_GenerateStart(M4_I2C_TypeDef* I2Cx); +void I2C_GenerateReStart(M4_I2C_TypeDef* I2Cx); +void I2C_GenerateStop(M4_I2C_TypeDef* I2Cx); + +/* Status management *************************************************/ +en_flag_status_t I2C_GetStatus(const M4_I2C_TypeDef *I2Cx, uint32_t u32StatusBit); +void I2C_ClearStatus(M4_I2C_TypeDef* I2Cx, uint32_t u32StatusBit); + +/* Data transfer *****************************************************/ +void I2C_WriteDataReg(M4_I2C_TypeDef* I2Cx, uint8_t u8Data); +uint8_t I2C_ReadDataReg(const M4_I2C_TypeDef *I2Cx); +void I2C_AckConfig(M4_I2C_TypeDef* I2Cx, uint32_t u32AckConfig); + +/* High level functions for reference ********************************/ +en_result_t I2C_Start(M4_I2C_TypeDef* I2Cx, uint32_t u32Timeout); +en_result_t I2C_Restart(M4_I2C_TypeDef* I2Cx, uint32_t u32Timeout); +en_result_t I2C_TransAddr(M4_I2C_TypeDef* I2Cx, uint8_t u8Addr, uint8_t u8Dir, uint32_t u32Timeout); +en_result_t I2C_Trans10BitAddr(M4_I2C_TypeDef* I2Cx, uint16_t u16Addr, uint8_t u8Dir, uint32_t u32Timeout); +en_result_t I2C_TransData(M4_I2C_TypeDef* I2Cx, uint8_t const pau8TxData[], uint32_t u32Size, uint32_t u32Timeout); +en_result_t I2C_Receive(M4_I2C_TypeDef* I2Cx, uint8_t pau8RxData[], uint32_t u32Size, uint32_t u32Timeout); +en_result_t I2C_Stop(M4_I2C_TypeDef* I2Cx, uint32_t u32Timeout); +en_result_t I2C_MasterReceiveAndStop(M4_I2C_TypeDef* I2Cx, uint8_t au8RxData[], uint32_t u32Size, uint32_t u32Timeout); +/** + * @} + */ + +#endif /* DDL_I2C_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_I2C_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_i2s.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_i2s.h new file mode 100644 index 0000000000..00e7990c04 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_i2s.h @@ -0,0 +1,331 @@ +/** + ******************************************************************************* + * @file hc32f4a0_i2s.h + * @brief This file contains all the functions prototypes of the I2S driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Yangjp First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_I2S_H__ +#define __HC32F4A0_I2S_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_I2S + * @{ + */ + +#if (DDL_I2S_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup I2S_Global_Types I2S Global Types + * @{ + */ + +/** + * @brief I2S Init structure definition + */ +typedef struct +{ + uint32_t u32ClockSrc; /*!< Specifies the clock source of I2S. + This parameter can be a value of @ref I2S_Clock_Source */ + uint32_t u32Mode; /*!< Specifies the master/slave mode of I2S. + This parameter can be a value of @ref I2S_Mode */ + uint32_t u32ComProtocol; /*!< Specifies the communication protocol of I2S. + This parameter can be a value of @ref I2S_Com_Protocol */ + uint32_t u32TransMode; /*!< Specifies the transmission mode for the I2S communication. + This parameter can be a value of @ref I2S_Trans_Mode */ + uint32_t u32AudioFreq; /*!< Specifies the frequency selected for the I2S communication. + This parameter can be a value of @ref I2S_Audio_Frequency */ + uint32_t u32ChLen; /*!< Specifies the channel length for the I2S communication. + This parameter can be a value of @ref I2S_Channel_Length */ + uint32_t u32DataLen; /*!< Specifies the data length for the I2S communication. + This parameter can be a value of @ref I2S_Data_Length */ + uint32_t u32MCKOutput; /*!< Specifies the validity of the MCK output for I2S. + This parameter can be a value of @ref I2S_MCK_Output */ + uint32_t u32TransFIFOLevel; /*!< Specifies the level of transfer FIFO. + This parameter can be a value of @ref I2S_Trans_Level */ + uint32_t u32ReceiveFIFOLevel; /*!< Specifies the level of receive FIFO. + This parameter can be a value of @ref I2S_Receive_Level */ +} stc_i2s_init_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup I2S_Global_Macros I2S Global Macros + * @{ + */ + +/** + * @defgroup I2S_Clock_Source I2S Clock Source + * @{ + */ +#define I2S_CLK_SRC_PLL (I2S_CTRL_I2SPLLSEL) /*!< Internal PLL Clock */ +#define I2S_CLK_SRC_EXT (I2S_CTRL_CLKSEL) /*!< External Clock */ +/** + * @} + */ + +/** + * @defgroup I2S_Mode I2S Mode + * @{ + */ +#define I2S_MD_MASTER (0UL) /*!< Master mode */ +#define I2S_MD_SLAVE (I2S_CTRL_WMS) /*!< Slave mode */ +/** + * @} + */ + +/** + * @defgroup I2S_Com_Protocol I2S Communication Protocol + * @{ + */ +#define I2S_COM_PROTOCOL_PHILLIPS (0UL) /*!< Phillips protocol */ +#define I2S_COM_PROTOCOL_MSB (I2S_CFGR_I2SSTD_0) /*!< MSB justified protocol */ +#define I2S_COM_PROTOCOL_LSB (I2S_CFGR_I2SSTD_1) /*!< LSB justified protocol */ +#define I2S_COM_PROTOCOL_PCM_SHORT (I2S_CFGR_I2SSTD) /*!< PCM short-frame protocol */ +#define I2S_COM_PROTOCOL_PCM_LONG (I2S_CFGR_I2SSTD | I2S_CFGR_PCMSYNC) /*!< PCM long-frame protocol */ +/** + * @} + */ + +/** + * @defgroup I2S_Trans_Mode I2S Transfer Mode + * @{ + */ +#define I2S_TRANS_MD_HALF_DUPLEX_RX (0UL) /*!< Receive only and half duplex mode */ +#define I2S_TRANS_MD_HALF_DUPLEX_TX (I2S_CTRL_SDOE) /*!< Send only and half duplex mode */ +#define I2S_TRANS_MD_FULL_DUPLEX (I2S_CTRL_DUPLEX | I2S_CTRL_SDOE) /*!< Full duplex mode */ +/** + * @} + */ + +/** + * @defgroup I2S_Audio_Frequency I2S Audio Frequency + * @{ + */ +#define I2S_AUDIO_FREQ_192K (192000UL) /*!< FS = 192000Hz */ +#define I2S_AUDIO_FREQ_96K (96000UL) /*!< FS = 96000Hz */ +#define I2S_AUDIO_FREQ_48K (48000UL) /*!< FS = 48000Hz */ +#define I2S_AUDIO_FREQ_44K (44100UL) /*!< FS = 44100Hz */ +#define I2S_AUDIO_FREQ_32K (32000UL) /*!< FS = 32000Hz */ +#define I2S_AUDIO_FREQ_22K (22050UL) /*!< FS = 22050Hz */ +#define I2S_AUDIO_FREQ_16K (16000UL) /*!< FS = 16000Hz */ +#define I2S_AUDIO_FREQ_8K (8000UL) /*!< FS = 8000Hz */ +#define I2S_AUDIO_FREQ_DEFAULT (2UL) +/** + * @} + */ + +/** + * @defgroup I2S_Channel_Length I2S Channel Length + * @{ + */ +#define I2S_CH_LEN_16BIT (0UL) /*!< Channel length is 16bits */ +#define I2S_CH_LEN_32BIT (I2S_CFGR_CHLEN) /*!< Channel length is 32bits */ +/** + * @} + */ + +/** + * @defgroup I2S_Data_Length I2S Data Length + * @{ + */ +#define I2S_DATA_LEN_16BIT (0UL) /*!< Transfer data length is 16bits */ +#define I2S_DATA_LEN_24BIT (I2S_CFGR_DATLEN_0) /*!< Transfer data length is 24bits */ +#define I2S_DATA_LEN_32BIT (I2S_CFGR_DATLEN_1) /*!< Transfer data length is 32bits */ +/** + * @} + */ + +/** + * @defgroup I2S_MCK_Output I2S MCK Output + * @{ + */ +#define I2S_MCK_OUTPUT_DISABLE (0UL) /*!< Disable the drive clock(MCK) output */ +#define I2S_MCK_OUTPUT_ENABLE (I2S_CTRL_MCKOE) /*!< Enable the drive clock(MCK) output */ +/** + * @} + */ + +/** + * @defgroup I2S_Trans_Level I2S Transfer Level + * @{ + */ +#define I2S_TRANS_LVL0 (0x00UL << I2S_CTRL_TXBIRQWL_POS) /*!< Transfer FIFO level is 0 */ +#define I2S_TRANS_LVL1 (0x01UL << I2S_CTRL_TXBIRQWL_POS) /*!< Transfer FIFO level is 1 */ +#define I2S_TRANS_LVL2 (0x02UL << I2S_CTRL_TXBIRQWL_POS) /*!< Transfer FIFO level is 2 */ +#define I2S_TRANS_LVL3 (0x03UL << I2S_CTRL_TXBIRQWL_POS) /*!< Transfer FIFO level is 3 */ +#define I2S_TRANS_LVL4 (0x04UL << I2S_CTRL_TXBIRQWL_POS) /*!< Transfer FIFO level is 4 */ +/** + * @} + */ + +/** + * @defgroup I2S_Receive_Level I2S Receive Level + * @{ + */ +#define I2S_RECEIVE_LVL0 (0x00UL << I2S_CTRL_RXBIRQWL_POS) /*!< Receive FIFO level is 0 */ +#define I2S_RECEIVE_LVL1 (0x01UL << I2S_CTRL_RXBIRQWL_POS) /*!< Receive FIFO level is 1 */ +#define I2S_RECEIVE_LVL2 (0x02UL << I2S_CTRL_RXBIRQWL_POS) /*!< Receive FIFO level is 2 */ +#define I2S_RECEIVE_LVL3 (0x03UL << I2S_CTRL_RXBIRQWL_POS) /*!< Receive FIFO level is 3 */ +#define I2S_RECEIVE_LVL4 (0x04UL << I2S_CTRL_RXBIRQWL_POS) /*!< Receive FIFO level is 4 */ +/** + * @} + */ + +/** + * @defgroup I2S_Com_Func I2S Communication Function + * @{ + */ +#define I2S_FUNC_TXE (I2S_CTRL_TXE) /*!< Transfer function */ +#define I2S_FUNC_RXE (I2S_CTRL_RXE) /*!< Receive function */ +#define I2S_FUNC_ALL (I2S_FUNC_TXE | I2S_FUNC_RXE) +/** + * @} + */ + +/** + * @defgroup I2S_Reset_Type I2S Reset Type + * @{ + */ +#define I2S_RST_TYPE_SW (I2S_CTRL_SRST) /*!< I2S software reset */ +#define I2S_RST_TYPE_CODEC (I2S_CTRL_CODECRC) /*!< Reset codec of I2S */ +#define I2S_RST_TYPE_FIFO (I2S_CTRL_FIFOR) /*!< Reset FIFO of I2S */ +#define I2S_RST_TYPE_ALL (I2S_RST_TYPE_SW | I2S_RST_TYPE_CODEC | I2S_RST_TYPE_FIFO) +/** + * @} + */ + +/** + * @defgroup I2S_Interrupt I2S Interrupt + * @{ + */ +#define I2S_INT_TX (I2S_CTRL_TXIE) /*!< Transfer interrupt */ +#define I2S_INT_RX (I2S_CTRL_RXIE) /*!< Receive interrupt */ +#define I2S_INT_ERR (I2S_CTRL_EIE) /*!< Communication error interrupt */ +#define I2S_INT_ALL (I2S_INT_TX | I2S_INT_RX | I2S_INT_ERR) +/** + * @} + */ + +/** + * @defgroup I2S_Flag I2S Flag + * @{ + */ +#define I2S_FLAG_TX_ALARM (I2S_SR_TXBA) /*!< Transfer buffer alarm flag */ +#define I2S_FLAG_RX_ALARM (I2S_SR_RXBA) /*!< Receive buffer alarm flag */ +#define I2S_FLAG_TX_EMPTY (I2S_SR_TXBE) /*!< Transfer buffer empty flag */ +#define I2S_FLAG_TX_FULL (I2S_SR_TXBF) /*!< Transfer buffer full flag */ +#define I2S_FLAG_RX_EMPTY (I2S_SR_RXBE) /*!< Receive buffer empty flag */ +#define I2S_FLAG_RX_FULL (I2S_SR_RXBF) /*!< Receive buffer full flag */ +#define I2S_FLAG_TX_ERR (I2S_ER_TXERR << 16U) /*!< Transfer overflow or underflow flag */ +#define I2S_FLAG_RX_ERR (I2S_ER_RXERR << 16U) /*!< Receive overflow flag */ +#define I2S_FLAG_ALL (I2S_FLAG_TX_ALARM | I2S_FLAG_RX_ALARM | I2S_FLAG_TX_EMPTY | \ + I2S_FLAG_TX_FULL | I2S_FLAG_RX_EMPTY | I2S_FLAG_RX_FULL | \ + I2S_FLAG_TX_ERR | I2S_FLAG_RX_ERR) +#define I2S_CLR_FLAG_ALL (I2S_FLAG_TX_ERR | I2S_FLAG_RX_ERR) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup I2S_Global_Functions + * @{ + */ + +/* Initialization and configuration functions */ +void I2S_DeInit(M4_I2S_TypeDef *I2Sx); +en_result_t I2S_Init(M4_I2S_TypeDef *I2Sx, const stc_i2s_init_t *pstcI2sInit); +en_result_t I2S_StructInit(stc_i2s_init_t *pstcI2sInit); +void I2S_SetSWReset(M4_I2S_TypeDef *I2Sx, uint32_t u32ResetType); +void I2S_SetTransMode(M4_I2S_TypeDef *I2Sx, uint32_t u32Mode); +void I2S_SetTransFIFOLevel(M4_I2S_TypeDef *I2Sx, uint32_t u32Level); +void I2S_SetReceiveFIFOLevel(M4_I2S_TypeDef *I2Sx, uint32_t u32Level); +void I2S_SetComProtocol(M4_I2S_TypeDef *I2Sx, uint32_t u32Protocol); +en_result_t I2S_SetAudioFreq(M4_I2S_TypeDef *I2Sx, uint32_t u32Freq); +void I2S_MCKOutputCmd(M4_I2S_TypeDef *I2Sx, en_functional_state_t enNewState); +void I2S_FuncCmd(M4_I2S_TypeDef* I2Sx, uint32_t u32Func, en_functional_state_t enNewState); + +/* Transfer and receive data functions */ +void I2S_WriteData(M4_I2S_TypeDef *I2Sx, uint32_t u32Data); +uint32_t I2S_ReadData(const M4_I2S_TypeDef *I2Sx); +en_result_t I2S_Trans(M4_I2S_TypeDef *I2Sx, const void *pvTxBuf, uint32_t u32Len, uint32_t u32Timeout); +en_result_t I2S_Receive(const M4_I2S_TypeDef *I2Sx, void *pvRxBuf, uint32_t u32Len, uint32_t u32Timeout); +en_result_t I2S_TransReceive(M4_I2S_TypeDef *I2Sx, const void *pvTxBuf, void *pvRxBuf, uint32_t u32Len, uint32_t u32Timeout); + +/* Interrupt and flag management functions */ +void I2S_IntCmd(M4_I2S_TypeDef *I2Sx, uint32_t u32IntType, en_functional_state_t enNewState); +en_flag_status_t I2S_GetStatus(const M4_I2S_TypeDef *I2Sx, uint32_t u32Flag); +void I2S_ClearStatus(M4_I2S_TypeDef *I2Sx, uint32_t u32Flag); + +/** + * @} + */ + +#endif /* DDL_I2S_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_I2S_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_icg.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_icg.h new file mode 100644 index 0000000000..fa722a90d7 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_icg.h @@ -0,0 +1,441 @@ +/** + ******************************************************************************* + * @file hc32f4a0_icg.h + * @brief This file contains all the Macro Definitions of the ICG driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Yangjp First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_ICG_H__ +#define __HC32F4A0_ICG_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_ICG + * @{ + */ + +#if (DDL_ICG_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup ICG_Global_Macros ICG Global Macros + * @{ + */ + +/** + * @defgroup ICG_SWDT_Reset_State ICG SWDT Reset State + * @{ + */ +#define ICG_SWDT_RESET_AUTOSTART (0UL) /*!< SWDT Auto Start after reset */ +#define ICG_SWDT_RESET_STOP (ICG_ICG0_SWDTAUTS) /*!< SWDT stop after reset */ +/** + * @} + */ + +/** + * @defgroup ICG_SWDT_Trigger_Type ICG SWDT Trigger Type + * @{ + */ +#define ICG_SWDT_TRIG_INT (0UL) /*!< SWDT trigger interrupt */ +#define ICG_SWDT_TRIG_RESET (ICG_ICG0_SWDTITS) /*!< SWDT trigger reset */ +/** + * @} + */ + +/** + * @defgroup ICG_SWDT_Counter_Cycle ICG SWDT Counter Cycle + * @{ + */ +#define ICG_SWDT_COUNTER_CYCLE_256 (0UL) /*!< 256 clock cycle */ +#define ICG_SWDT_COUNTER_CYCLE_4096 (ICG_ICG0_SWDTPERI_0) /*!< 4096 clock cycle */ +#define ICG_SWDT_COUNTER_CYCLE_16384 (ICG_ICG0_SWDTPERI_1) /*!< 16384 clock cycle */ +#define ICG_SWDT_COUNTER_CYCLE_65536 (ICG_ICG0_SWDTPERI) /*!< 65536 clock cycle */ +/** + * @} + */ + +/** + * @defgroup ICG_SWDT_Clock_Division ICG SWDT Clock Division + * @{ + */ +#define ICG_SWDT_CLOCK_DIV1 (0UL) /*!< SWDTCLK */ +#define ICG_SWDT_CLOCK_DIV16 (ICG_ICG0_SWDTCKS_2) /*!< SWDTCLK/16 */ +#define ICG_SWDT_CLOCK_DIV32 (ICG_ICG0_SWDTCKS_2 | ICG_ICG0_SWDTCKS_0) /*!< SWDTCLK/32 */ +#define ICG_SWDT_CLOCK_DIV64 (ICG_ICG0_SWDTCKS_2 | ICG_ICG0_SWDTCKS_1) /*!< SWDTCLK/64 */ +#define ICG_SWDT_CLOCK_DIV128 (ICG_ICG0_SWDTCKS_2 | ICG_ICG0_SWDTCKS_1 | ICG_ICG0_SWDTCKS_0) /*!< SWDTCLK/128 */ +#define ICG_SWDT_CLOCK_DIV256 (ICG_ICG0_SWDTCKS_3) /*!< SWDTCLK/256 */ +#define ICG_SWDT_CLOCK_DIV2048 (ICG_ICG0_SWDTCKS_3 | ICG_ICG0_SWDTCKS_1 | ICG_ICG0_SWDTCKS_0) /*!< SWDTCLK/2048 */ +/** + * @} + */ + +/** + * @defgroup ICG_SWDT_Refresh_Range ICG SWDT Refresh Range + * @{ + */ +#define ICG_SWDT_RANGE_0TO100PCT (0UL) /*!< 0%~100% */ +#define ICG_SWDT_RANGE_0TO25PCT (ICG_ICG0_SWDTWDPT_0) /*!< 0%~25% */ +#define ICG_SWDT_RANGE_25TO50PCT (ICG_ICG0_SWDTWDPT_1) /*!< 25%~50% */ +#define ICG_SWDT_RANGE_0TO50PCT (ICG_ICG0_SWDTWDPT_1 | ICG_ICG0_SWDTWDPT_0)) /*!< 0%~50% */ +#define ICG_SWDT_RANGE_50TO75PCT (ICG_ICG0_SWDTWDPT_2) /*!< 50%~75% */ +#define ICG_SWDT_RANGE_0TO25PCT_50TO75PCT (ICG_ICG0_SWDTWDPT_2 | ICG_ICG0_SWDTWDPT_0)) /*!< 0%~25% & 50%~75% */ +#define ICG_SWDT_RANGE_25TO75PCT (ICG_ICG0_SWDTWDPT_2 | ICG_ICG0_SWDTWDPT_1)) /*!< 25%~75% */ +#define ICG_SWDT_RANGE_0TO75PCT (ICG_ICG0_SWDTWDPT_2 | ICG_ICG0_SWDTWDPT_1 | ICG_ICG0_SWDTWDPT_0)) /*!< 0%~75% */ +#define ICG_SWDT_RANGE_75TO100PCT (ICG_ICG0_SWDTWDPT_3) /*!< 75%~100% */ +#define ICG_SWDT_RANGE_0TO25PCT_75TO100PCT (ICG_ICG0_SWDTWDPT_3 | ICG_ICG0_SWDTWDPT_0)) /*!< 0%~25% & 75%~100% */ +#define ICG_SWDT_RANGE_25TO50PCT_75TO100PCT (ICG_ICG0_SWDTWDPT_3 | ICG_ICG0_SWDTWDPT_1)) /*!< 25%~50% & 75%~100% */ +#define ICG_SWDT_RANGE_0TO50PCT_75TO100PCT (ICG_ICG0_SWDTWDPT_3 | ICG_ICG0_SWDTWDPT_1 | ICG_ICG0_SWDTWDPT_0)) /*!< 0%~50% & 75%~100% */ +#define ICG_SWDT_RANGE_50TO100PCT (ICG_ICG0_SWDTWDPT_3 | ICG_ICG0_SWDTWDPT_2)) /*!< 50%~100% */ +#define ICG_SWDT_RANGE_0TO25PCT_50TO100PCT (ICG_ICG0_SWDTWDPT_3 | ICG_ICG0_SWDTWDPT_2 | ICG_ICG0_SWDTWDPT_0)) /*!< 0%~25% & 50%~100% */ +#define ICG_SWDT_RANGE_25TO100PCT (ICG_ICG0_SWDTWDPT_3 | ICG_ICG0_SWDTWDPT_2 | ICG_ICG0_SWDTWDPT_1)) /*!< 25%~100% */ +/** + * @} + */ + +/** + * @defgroup ICG_SWDT_LPM_Count ICG SWDT Low Power Mode Count + * @brief SWDT count control in the sleep/stop mode + * @{ + */ +#define ICG_SWDT_LPM_COUNT_CONTINUE (0UL) /*!< SWDT count continue in the sleep/stop mode */ +#define ICG_SWDT_LPM_COUNT_STOP (ICG_ICG0_SWDTSLPOFF) /*!< SWDT count stop in the sleep/stop mode */ +/** + * @} + */ + +/** + * @defgroup ICG_WDT_Reset_State ICG WDT Reset State + * @{ + */ +#define ICG_WDT_RESET_AUTOSTART (0UL) /*!< WDT Auto Start after reset */ +#define ICG_WDT_RESET_STOP (ICG_ICG0_WDTAUTS) /*!< WDT stop after reset */ +/** + * @} + */ + +/** + * @defgroup ICG_WDT_Trigger_Type ICG WDT Trigger Type + * @{ + */ +#define ICG_WDT_TRIG_INT (0UL) /*!< WDT trigger interrupt */ +#define ICG_WDT_TRIG_RESET (ICG_ICG0_WDTITS) /*!< WDT trigger reset */ +/** + * @} + */ + +/** + * @defgroup ICG_WDT_Counter_Cycle ICG WDT Counter Cycle + * @{ + */ +#define ICG_WDT_COUNTER_CYCLE_256 (0UL) /*!< 256 clock cycle */ +#define ICG_WDT_COUNTER_CYCLE_4096 (ICG_ICG0_WDTPERI_0) /*!< 4096 clock cycle */ +#define ICG_WDT_COUNTER_CYCLE_16384 (ICG_ICG0_WDTPERI_1) /*!< 16384 clock cycle */ +#define ICG_WDT_COUNTER_CYCLE_65536 (ICG_ICG0_WDTPERI) /*!< 65536 clock cycle */ +/** + * @} + */ + +/** + * @defgroup ICG_WDT_Clock_Division ICG WDT Clock Division + * @{ + */ +#define ICG_WDT_CLOCK_DIV4 (ICG_ICG0_WDTCKS_1) /*!< PCLK3/4 */ +#define ICG_WDT_CLOCK_DIV64 (ICG_ICG0_WDTCKS_2 | ICG_ICG0_WDTCKS_1) /*!< PCLK3/64 */ +#define ICG_WDT_CLOCK_DIV128 (ICG_ICG0_WDTCKS_2 | ICG_ICG0_WDTCKS_1 | ICG_ICG0_WDTCKS_0) /*!< PCLK3/128 */ +#define ICG_WDT_CLOCK_DIV256 (ICG_ICG0_WDTCKS_3) /*!< PCLK3/256 */ +#define ICG_WDT_CLOCK_DIV512 (ICG_ICG0_WDTCKS_3 | ICG_ICG0_WDTCKS_0) /*!< PCLK3/512 */ +#define ICG_WDT_CLOCK_DIV1024 (ICG_ICG0_WDTCKS_3 | ICG_ICG0_WDTCKS_1) /*!< PCLK3/1024 */ +#define ICG_WDT_CLOCK_DIV2028 (ICG_ICG0_WDTCKS_3 | ICG_ICG0_WDTCKS_1 | ICG_ICG0_WDTCKS_0) /*!< PCLK3/2048 */ +#define ICG_WDT_CLOCK_DIV8192 (ICG_ICG0_WDTCKS_3 | ICG_ICG0_WDTCKS_2 | ICG_ICG0_WDTCKS_0) /*!< PCLK3/8192 */ +/** + * @} + */ + +/** + * @defgroup ICG_WDT_Refresh_Range ICG WDT Refresh Range + * @{ + */ +#define ICG_WDT_RANGE_0TO100PCT (0UL) /*!< 0%~100% */ +#define ICG_WDT_RANGE_0TO25PCT (ICG_ICG0_WDTWDPT_0) /*!< 0%~25% */ +#define ICG_WDT_RANGE_25TO50PCT (ICG_ICG0_WDTWDPT_1) /*!< 25%~50% */ +#define ICG_WDT_RANGE_0TO50PCT (ICG_ICG0_WDTWDPT_1 | ICG_ICG0_WDTWDPT_0) /*!< 0%~50% */ +#define ICG_WDT_RANGE_50TO75PCT (ICG_ICG0_WDTWDPT_2) /*!< 50%~75% */ +#define ICG_WDT_RANGE_0TO25PCT_50TO75PCT (ICG_ICG0_WDTWDPT_2 | ICG_ICG0_WDTWDPT_0) /*!< 0%~25% & 50%~75% */ +#define ICG_WDT_RANGE_25TO75PCT (ICG_ICG0_WDTWDPT_2 | ICG_ICG0_WDTWDPT_1) /*!< 25%~75% */ +#define ICG_WDT_RANGE_0TO75PCT (ICG_ICG0_WDTWDPT_2 | ICG_ICG0_WDTWDPT_1 | ICG_ICG0_WDTWDPT_0) /*!< 0%~75% */ +#define ICG_WDT_RANGE_75TO100PCT (ICG_ICG0_WDTWDPT_3) /*!< 75%~100% */ +#define ICG_WDT_RANGE_0TO25PCT_75TO100PCT (ICG_ICG0_WDTWDPT_3 | ICG_ICG0_WDTWDPT_0) /*!< 0%~25% & 75%~100% */ +#define ICG_WDT_RANGE_25TO50PCT_75TO100PCT (ICG_ICG0_WDTWDPT_3 | ICG_ICG0_WDTWDPT_1) /*!< 25%~50% & 75%~100% */ +#define ICG_WDT_RANGE_0TO50PCT_75TO100PCT (ICG_ICG0_WDTWDPT_3 | ICG_ICG0_WDTWDPT_1 | ICG_ICG0_WDTWDPT_0) /*!< 0%~50% & 75%~100% */ +#define ICG_WDT_RANGE_50TO100PCT (ICG_ICG0_WDTWDPT_3 | ICG_ICG0_WDTWDPT_2) /*!< 50%~100% */ +#define ICG_WDT_RANGE_0TO25PCT_50TO100PCT (ICG_ICG0_WDTWDPT_3 | ICG_ICG0_WDTWDPT_2 | ICG_ICG0_WDTWDPT_0) /*!< 0%~25% & 50%~100% */ +#define ICG_WDT_RANGE_25TO100PCT (ICG_ICG0_WDTWDPT_3 | ICG_ICG0_WDTWDPT_2 | ICG_ICG0_WDTWDPT_1) /*!< 25%~100% */ +/** + * @} + */ + +/** + * @defgroup ICG_WDT_LPM_Count ICG WDT Low Power Mode Count + * @brief WDT count control in the sleep mode + * @{ + */ +#define ICG_WDT_LPM_COUNT_CONTINUE (0UL) /*!< WDT count continue in the sleep mode */ +#define ICG_WDT_LPM_COUNT_STOP (ICG_ICG0_WDTSLPOFF) /*!< WDT count stop in the sleep mode */ +/** + * @} + */ + +/** + * @defgroup ICG_HRC_Frequency_Select ICG HRC Frequency Select + * @{ + */ +#define ICG_HRC_FREQ_20MHZ (0UL) /*!< HRC frequency 20MHZ */ +#define ICG_HRC_FREQ_16MHZ (ICG_ICG1_HRCFREQSEL) /*!< HRC frequency 16MHZ */ +/** + * @} + */ + +/** + * @defgroup ICG_HRC_Reset_State ICG HRC Reset State + * @{ + */ +#define ICG_HRC_RESET_OSCILLATION (0UL) /*!< HRC Oscillation after reset */ +#define ICG_HRC_RESET_STOP (ICG_ICG1_HRCSTOP) /*!< HRC stop after reset */ +/** + * @} + */ + +/** + * @defgroup ICG_BOR_Voltage_Threshold ICG BOR Voltage Threshold + * @{ + */ +#define ICG_BOR_VOL_THRESHOLD_1P9 (0UL) /*!< BOR voltage threshold 1.9V */ +#define ICG_BOR_VOL_THRESHOLD_2P0 (ICG_ICG1_BOR_LEV_0) /*!< BOR voltage threshold 2.0V */ +#define ICG_BOR_VOL_THRESHOLD_2P1 (ICG_ICG1_BOR_LEV_1) /*!< BOR voltage threshold 2.1V */ +#define ICG_BOR_VOL_THRESHOLD_2P3 (ICG_ICG1_BOR_LEV) /*!< BOR voltage threshold 2.3V */ +/** + * @} + */ + +/** + * @defgroup ICG_BOR_Reset_State ICG BOR Reset State + * @{ + */ +#define ICG_BOR_RESET_ENABLE (0UL) /*!< Enable BOR voltage detection after reset */ +#define ICG_BOR_RESET_DISABLE (ICG_ICG1_BORDIS) /*!< Disable BOR voltage detection after reset */ +/** + * @} + */ + +/** + * @defgroup ICG_FLASH_Bank_Reset_State ICG FLASH Bank Reset State + * @{ + */ +#define ICG_FLASH_BANK_1 (0xFFFFFFFFUL) /*!< After reset, 1MBytes flash are provided by bank0 */ +#define ICG_FLASH_BANK_12 (0x004B4B4BUL) /*!< After reset, 1MBytes flash are provided by bank0 and bank1 with 512Bytes each */ +/** + * @} + */ + +/** + * @defgroup ICG_FLASH_Protect_Reset_State ICG FLASH Protect Reset State + * @brief Enable or disable D-BUS read protection for addresses 0x00000000 - 0x0001FFFF + * @{ + */ +#define ICG_FLASH_PROTECT_RESET_ENABLE (0x00004450UL) /*!< Enable D-BUS read protection after reset */ +#define ICG_FLASH_PROTECT_RESET_DISABLE (0xFFFFFFFFUL) /*!< Disable D-BUS read protection after reset */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @defgroup ICG_Register_Configuration ICG Register Configuration + * @{ + */ + +/** + ******************************************************************************* + * @defgroup ICG_SWDT_Preload_Configuration ICG SWDT Preload Configuration + * @{ + ******************************************************************************* + */ +/* SWDT register config */ +#define ICG0_RB_SWDT_AUTS (ICG_SWDT_RESET_STOP) +#define ICG0_RB_SWDT_ITS (ICG_SWDT_TRIG_INT) +#define ICG0_RB_SWDT_PERI (ICG_SWDT_COUNTER_CYCLE_65536) +#define ICG0_RB_SWDT_CKS (ICG_SWDT_CLOCK_DIV2048) +#define ICG0_RB_SWDT_WDPT (ICG_SWDT_RANGE_0TO100PCT) +#define ICG0_RB_SWDT_SLTPOFF (ICG_SWDT_LPM_COUNT_CONTINUE) + +/* SWDT register value */ +#define ICG0_RB_SWDT_CONFIG (ICG0_RB_SWDT_AUTS | ICG0_RB_SWDT_ITS | \ + ICG0_RB_SWDT_PERI | ICG0_RB_SWDT_CKS | \ + ICG0_RB_SWDT_WDPT | ICG0_RB_SWDT_SLTPOFF) +/** + * @} + */ + +/** + ******************************************************************************* + * @defgroup ICG_WDT_Preload_Configuration ICG WDT Preload Configuration + * @{ + ******************************************************************************* + */ +/* WDT register config */ +#define ICG0_RB_WDT_AUTS (ICG_WDT_RESET_STOP) +#define ICG0_RB_WDT_ITS (ICG_WDT_TRIG_INT) +#define ICG0_RB_WDT_PERI (ICG_WDT_COUNTER_CYCLE_65536) +#define ICG0_RB_WDT_CKS (ICG_WDT_CLOCK_DIV8192) +#define ICG0_RB_WDT_WDPT (ICG_WDT_RANGE_0TO100PCT) +#define ICG0_RB_WDT_SLTPOFF (ICG_WDT_LPM_COUNT_CONTINUE) + +/* WDT register value */ +#define ICG0_RB_WDT_CONFIG (ICG0_RB_WDT_AUTS | ICG0_RB_WDT_ITS | \ + ICG0_RB_WDT_PERI | ICG0_RB_WDT_CKS | \ + ICG0_RB_WDT_WDPT | ICG0_RB_WDT_SLTPOFF) +/** + * @} + */ + +/** + ******************************************************************************* + * @defgroup ICG_HRC_Preload_Configuration ICG HRC Preload Configuration + * @{ + ******************************************************************************* + */ +/* HRC register config */ +#define ICG1_RB_HRC_FREQSEL (ICG_HRC_FREQ_16MHZ) +#define ICG1_RB_HRC_STOP (ICG_HRC_RESET_STOP) + +/* HRC register value */ +#define ICG1_RB_HRC_CONFIG (ICG1_RB_HRC_FREQSEL | ICG1_RB_HRC_STOP) +/** + * @} + */ + +/** + ******************************************************************************* + * @defgroup ICG_BOR_Preload_Configuration ICG BOR Preload Configuration + * @{ + ******************************************************************************* + */ +/* BOR register config */ +#define ICG1_RB_BOR_LEV (ICG_BOR_VOL_THRESHOLD_2P3) +#define ICG1_RB_BOR_DIS (ICG_BOR_RESET_DISABLE) + +/* BOR register value */ +#define ICG1_RB_BOR_CONFIG (ICG1_RB_BOR_LEV | ICG1_RB_BOR_DIS) +/** + * @} + */ + +/** + ******************************************************************************* + * @defgroup ICG_FLASH_Bank_Preload_Configuration ICG FLASH Bank Preload Configuration + * @{ + ******************************************************************************* + */ +/* FLASH Bank register value */ +#define ICG2_RB_FLASH_BANK_CONFIG (ICG_FLASH_BANK_1) +/** + * @} + */ + +/** + ******************************************************************************* + * @defgroup ICG_FLASH_Protect_Preload_Configuration ICG FLASH Protect Preload Configuration + * @{ + ******************************************************************************* + */ +/* FLASH Read Protect register value */ +#define ICG3_RB_FLASH_PROTECT_CONFIG (ICG_FLASH_PROTECT_RESET_DISABLE) +/** + * @} + */ + +/** + * @} + */ + +/** + * @defgroup ICG_Register_Value ICG Register Value + * @{ + */ +/* ICG register value */ +#define ICG_REG_CFG0_CONSTANT (ICG0_RB_WDT_CONFIG | ICG0_RB_SWDT_CONFIG | 0xE000E000UL) +#define ICG_REG_CFG1_CONSTANT (ICG1_RB_BOR_CONFIG | ICG1_RB_HRC_CONFIG | 0xFFF8FEFEUL) +#define ICG_REG_CFG2_CONSTANT (ICG2_RB_FLASH_BANK_CONFIG | 0xFF000000UL) +#define ICG_REG_CFG3_CONSTANT (ICG3_RB_FLASH_PROTECT_CONFIG | 0xFFFF0000UL) +/* ICG reserved value */ +#define ICG_RESERVED_CONSTANT (0xFFFFFFFFUL) + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ + +#endif /* DDL_ICG_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_ICG_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_interrupts.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_interrupts.h new file mode 100644 index 0000000000..c8d13a81fe --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_interrupts.h @@ -0,0 +1,1033 @@ +/** + ******************************************************************************* + * @file hc32f4a0_interrupts.h + * @brief This file contains all the functions prototypes of the interrupt driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Zhangxl First version + 2020-08-25 Zhangxl Modify for MISRAC2012-8.4 + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_INTERRUPTS_H__ +#define __HC32F4A0_INTERRUPTS_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_INTERRUPTS + * @{ + */ + +#if (DDL_INTERRUPTS_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup INTC_Global_Types INTC Global Types + * @{ + */ +/** + * @brief Interrupt registration structure definition + */ +typedef struct +{ + en_int_src_t enIntSrc; /*!< Peripheral interrupt number, can be any value @ref en_int_src_t */ + IRQn_Type enIRQn; /*!< Peripheral IRQ type, can be Int000_IRQn~Int127_IRQn @ref IRQn_Type */ + func_ptr_t pfnCallback;/*!< Callback function for corresponding peripheral IRQ */ +} stc_irq_signin_config_t; + +/** + * @brief NMI initialize configuration structure definition + */ +typedef struct +{ + uint32_t u32NmiSrc; /*!< NMI trigger source, @ref NMI_TriggerSrc_Sel for details */ + func_ptr_t pfnNmiCallback; /*!< NMI Callback function pointers */ +}stc_nmi_init_t; + +/** + * @brief EXINT initialize configuration structure definition + */ +typedef struct +{ + uint32_t u32ExIntCh; /*!< ExInt CH.0~15 @ref EXINT_Channel_Sel */ + uint32_t u32ExIntFAE; /*!< ExInt filter A function setting, @ref EXINT_FilterAClock_Sel for details */ + uint32_t u32ExIntFAClk; /*!< ExInt filter A clock division, @ref EXINT_FilterAClock_Div for details */ + uint32_t u32ExIntFBE; /*!< ExInt filter B function setting, @ref EXINT_FilterBClock_Sel for details*/ + uint32_t u32ExIntFBTime; /*!< ExInt filter B time, @ref EXINT_FilterBTim_Sel for details*/ + uint32_t u32ExIntLvl; /*!< ExInt trigger edge, @ref EXINT_Trigger_Sel for details */ +}stc_exint_init_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup INTC_Global_Macros INTC Global Macros + * @{ + */ +/** + * @defgroup INTC_DefaultPriority_Sel Interrupt default priority level + * Possible values are 0 (high priority) to 15 (low priority) + * @{ + */ +#define DDL_IRQ_PRIORITY_DEFAULT (15U) +/** + * @} + */ + +/** + * @defgroup INTC_Priority_Sel Interrupt priority level 00 ~ 15 + * @{ + */ +#define DDL_IRQ_PRIORITY_00 (0U) +#define DDL_IRQ_PRIORITY_01 (1U) +#define DDL_IRQ_PRIORITY_02 (2U) +#define DDL_IRQ_PRIORITY_03 (3U) +#define DDL_IRQ_PRIORITY_04 (4U) +#define DDL_IRQ_PRIORITY_05 (5U) +#define DDL_IRQ_PRIORITY_06 (6U) +#define DDL_IRQ_PRIORITY_07 (7U) +#define DDL_IRQ_PRIORITY_08 (8U) +#define DDL_IRQ_PRIORITY_09 (9U) +#define DDL_IRQ_PRIORITY_10 (10U) +#define DDL_IRQ_PRIORITY_11 (11U) +#define DDL_IRQ_PRIORITY_12 (12U) +#define DDL_IRQ_PRIORITY_13 (13U) +#define DDL_IRQ_PRIORITY_14 (14U) +#define DDL_IRQ_PRIORITY_15 (15U) +/** + * @} + */ + +/** + * @defgroup INTC_Bit_mask definition Bit Mask + * @{ + */ +#define BIT_MASK_00 (1UL << 0U) +#define BIT_MASK_01 (1UL << 1U) +#define BIT_MASK_02 (1UL << 2U) +#define BIT_MASK_03 (1UL << 3U) +#define BIT_MASK_04 (1UL << 4U) +#define BIT_MASK_05 (1UL << 5U) +#define BIT_MASK_06 (1UL << 6U) +#define BIT_MASK_07 (1UL << 7U) +#define BIT_MASK_08 (1UL << 8U) +#define BIT_MASK_09 (1UL << 9U) +#define BIT_MASK_10 (1UL << 10U) +#define BIT_MASK_11 (1UL << 11U) +#define BIT_MASK_12 (1UL << 12U) +#define BIT_MASK_13 (1UL << 13U) +#define BIT_MASK_14 (1UL << 14U) +#define BIT_MASK_15 (1UL << 15U) +#define BIT_MASK_16 (1UL << 16U) +#define BIT_MASK_17 (1UL << 17U) +#define BIT_MASK_18 (1UL << 18U) +#define BIT_MASK_19 (1UL << 19U) +#define BIT_MASK_20 (1UL << 20U) +#define BIT_MASK_21 (1UL << 21U) +#define BIT_MASK_22 (1UL << 22U) +#define BIT_MASK_23 (1UL << 23U) +#define BIT_MASK_24 (1UL << 24U) +#define BIT_MASK_25 (1UL << 25U) +#define BIT_MASK_26 (1UL << 26U) +#define BIT_MASK_27 (1UL << 27U) +#define BIT_MASK_28 (1UL << 28U) +#define BIT_MASK_29 (1UL << 29U) +#define BIT_MASK_30 (1UL << 30U) +#define BIT_MASK_31 (1UL << 31U) +/** + * @} + */ + +/** + * @defgroup NMI_TriggerSrc_Sel NMI trigger source selection + * @{ + */ +#define NMI_SRC_SWDT (1UL << INTC_NMIFR_SWDTFR_POS) +#define NMI_SRC_PVD1 (1UL << INTC_NMIFR_PVD1FR_POS) +#define NMI_SRC_PVD2 (1UL << INTC_NMIFR_PVD2FR_POS) +#define NMI_SRC_XTAL (1UL << INTC_NMIFR_XTALSTPFR_POS) +#define NMI_SRC_SRAM_PARITY (1UL << INTC_NMIFR_REPFR_POS) +#define NMI_SRC_SRAM_ECC (1UL << INTC_NMIFR_RECCFR_POS) +#define NMI_SRC_BUS_ERR (1UL << INTC_NMIFR_BUSMFR_POS) +#define NMI_SRC_WDT (1UL << INTC_NMIFR_WDTFR_POS) +#define NMI_SRC_MASK (NMI_SRC_SWDT | NMI_SRC_PVD1 | \ + NMI_SRC_PVD2 | NMI_SRC_XTAL | \ + NMI_SRC_BUS_ERR | NMI_SRC_SRAM_PARITY | \ + NMI_SRC_WDT | NMI_SRC_SRAM_ECC) +/** + * @} + */ + +/** + * @defgroup NOCCR_Register_Msk Noise cancel register mask + * @{ + */ +#define INTC_NOCCR_MASK (INTC_NOCCR_NOCSEL) + +/** + * @} + */ + + +/** + * @defgroup MNI_Register_Msk NMI register mask + * @{ + */ +#define INTC_NMIENR_MASK (INTC_NMIENR_SWDTENR | INTC_NMIENR_PVD1ENR | \ + INTC_NMIENR_PVD2ENR | INTC_NMIENR_XTALSTPENR | \ + INTC_NMIENR_REPENR | INTC_NMIENR_RECCENR | \ + INTC_NMIENR_BUSMENR | INTC_NMIENR_WDTENR) + +#define INTC_NMIFR_MASK (INTC_NMIFR_SWDTFR | INTC_NMIFR_PVD1FR | \ + INTC_NMIFR_PVD2FR | INTC_NMIFR_XTALSTPFR | \ + INTC_NMIFR_REPFR | INTC_NMIFR_RECCFR | \ + INTC_NMIFR_BUSMFR | INTC_NMIFR_WDTFR) + +#define INTC_NMICLR_MASK (INTC_NMICFR_SWDTCFR | INTC_NMICFR_PVD1CFR | \ + INTC_NMICFR_PVD2CFR | INTC_NMICFR_XTALSTPCFR | \ + INTC_NMICFR_REPCFR | INTC_NMICFR_RECCCFR | \ + INTC_NMICFR_BUSMCFR | INTC_NMICFR_WDTCFR) +/** + * @} + */ + +/** + * @defgroup EXINT_Channel_Sel External interrupt channel selection + * @{ + */ +#define EXINT_CH00 (1UL << 0U) +#define EXINT_CH01 (1UL << 1U) +#define EXINT_CH02 (1UL << 2U) +#define EXINT_CH03 (1UL << 3U) +#define EXINT_CH04 (1UL << 4U) +#define EXINT_CH05 (1UL << 5U) +#define EXINT_CH06 (1UL << 6U) +#define EXINT_CH07 (1UL << 7U) +#define EXINT_CH08 (1UL << 8U) +#define EXINT_CH09 (1UL << 9U) +#define EXINT_CH10 (1UL <<10U) +#define EXINT_CH11 (1UL <<11U) +#define EXINT_CH12 (1UL <<12U) +#define EXINT_CH13 (1UL <<13U) +#define EXINT_CH14 (1UL <<14U) +#define EXINT_CH15 (1UL <<15U) +#define EXINT_CH_MASK (EXINT_CH00 | EXINT_CH01 | EXINT_CH02 | EXINT_CH03 | \ + EXINT_CH04 | EXINT_CH05 | EXINT_CH06 | EXINT_CH07 | \ + EXINT_CH08 | EXINT_CH09 | EXINT_CH10 | EXINT_CH11 | \ + EXINT_CH12 | EXINT_CH13 | EXINT_CH14 | EXINT_CH15) +/** + * @} + */ + +/** + * @defgroup EXINT_FilterAClock_Sel External interrupt filter A function selection + * @{ + */ +#define EXINT_FILTER_A_OFF (0UL) +#define EXINT_FILTER_A_ON (INTC_EIRQCR_EFEN) +/** + * @} + */ + +/** + * @defgroup EXINT_FilterBClock_Sel External interrupt filter B function selection + * @{ + */ +#define EXINT_FILTER_B_OFF (0UL) +#define EXINT_FILTER_B_ON (INTC_EIRQCR_NOCEN) +/** + * @} + */ + +/** + * @defgroup EXINT_FilterAClock_Div External interrupt filter A sampling clock division selection + * @{ + */ +#define EXINT_FACLK_HCLK_DIV1 (0UL) +#define EXINT_FACLK_HCLK_DIV8 (INTC_EIRQCR_EISMPCLK_0) +#define EXINT_FACLK_HCLK_DIV32 (INTC_EIRQCR_EISMPCLK_1) +#define EXINT_FACLK_HCLK_DIV64 (INTC_EIRQCR_EISMPCLK) +/** + * @} + */ + +/** + * @defgroup EXINT_FilterBTim_Sel External interrupt filter B time selection + * @{ + */ +#define EXINT_FBTIM_500NS (0UL << INTC_NOCCR_NOCSEL_POS) +#define EXINT_FBTIM_1US (1UL << INTC_NOCCR_NOCSEL_POS) +#define EXINT_FBTIM_2US (2UL << INTC_NOCCR_NOCSEL_POS) +#define EXINT_FBTIM_4US (3UL << INTC_NOCCR_NOCSEL_POS) +/** + * @} + */ + +/** + * @defgroup EXINT_Trigger_Sel External interrupt trigger method selection + * @{ + */ +#define EXINT_TRIGGER_FALLING (0UL) +#define EXINT_TRIGGER_RISING (INTC_EIRQCR_EIRQTRG_0) +#define EXINT_TRIGGER_BOTH (INTC_EIRQCR_EIRQTRG_1) +#define EXINT_TRIGGER_LOW (INTC_EIRQCR_EIRQTRG) + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup INTC_Global_Functions + * @{ + */ + +/** + * @brief AOS software trigger. + * @param None + * @retval None + */ +__STATIC_INLINE void AOS_SW_Trigger(void) +{ + WRITE_REG32(bM4_AOS->INT_SFTTRG_b.STRG, Set); +} + +/** + * @brief AOS common trigger source 1 config. + * @param [in] enTrig can be any value @ref en_event_src_t + * @retval None + */ +__STATIC_INLINE void AOS_COM_Trigger1(en_event_src_t enTrig) +{ + WRITE_REG32(M4_AOS->COMTRG1, enTrig); +} + +/** + * @brief AOS common trigger source 2 config. + * @param [in] enTrig can be any value @ref en_event_src_t + * @retval None + */ +__STATIC_INLINE void AOS_COM_Trigger2(en_event_src_t enTrig) +{ + WRITE_REG32(M4_AOS->COMTRG2, enTrig); +} + +en_result_t INTC_IrqSignIn(const stc_irq_signin_config_t *pstcIrqSignConfig); +en_result_t INTC_IrqSignOut(IRQn_Type enIRQn); +en_result_t INTC_ShareIrqCmd(en_int_src_t enIntSrc, en_functional_state_t enNewState); +void INTC_WakeupSrcCmd(uint32_t u32WakeupSrc, en_functional_state_t enNewState); +void INTC_EventCmd(uint32_t u32Event, en_functional_state_t enNewState); +void INTC_IntCmd(uint32_t u32Int, en_functional_state_t enNewState); +void INTC_SWICmd(uint32_t u32SWI, en_functional_state_t enNewState); + +en_result_t NMI_Init(const stc_nmi_init_t *pstcNmiInit); +en_result_t NMI_StructInit(stc_nmi_init_t *pstcNmiInit); +en_flag_status_t NMI_GetNmiSrc(uint32_t u32NmiSrc); +void NMI_SetNmiSrc(uint32_t u32NmiSrc); +void NMI_ClrNmiSrc(uint32_t u32NmiSrc); + +en_result_t EXINT_Init(const stc_exint_init_t *pstcExIntInit); +en_result_t EXINT_StructInit(stc_exint_init_t *pstcExIntInit); +en_flag_status_t EXINT_GetExIntSrc(uint32_t u32ExIntCh); +void EXINT_ClrExIntSrc(uint32_t u32ExIntCh); + +void NMI_Handler(void); +void HardFault_Handler(void); +void MemManage_Handler(void); +void BusFault_Handler(void); +void UsageFault_Handler(void); +void SVC_Handler(void); +void DebugMon_Handler(void); +void PendSV_Handler(void); +void SysTick_Handler(void); +void IRQ000_Handler(void); +void IRQ001_Handler(void); +void IRQ002_Handler(void); +void IRQ003_Handler(void); +void IRQ004_Handler(void); +void IRQ005_Handler(void); +void IRQ006_Handler(void); +void IRQ007_Handler(void); +void IRQ008_Handler(void); +void IRQ009_Handler(void); +void IRQ010_Handler(void); +void IRQ011_Handler(void); +void IRQ012_Handler(void); +void IRQ013_Handler(void); +void IRQ014_Handler(void); +void IRQ015_Handler(void); +void IRQ016_Handler(void); +void IRQ017_Handler(void); +void IRQ018_Handler(void); +void IRQ019_Handler(void); +void IRQ020_Handler(void); +void IRQ021_Handler(void); +void IRQ022_Handler(void); +void IRQ023_Handler(void); +void IRQ024_Handler(void); +void IRQ025_Handler(void); +void IRQ026_Handler(void); +void IRQ027_Handler(void); +void IRQ028_Handler(void); +void IRQ029_Handler(void); +void IRQ030_Handler(void); +void IRQ031_Handler(void); +void IRQ032_Handler(void); +void IRQ033_Handler(void); +void IRQ034_Handler(void); +void IRQ035_Handler(void); +void IRQ036_Handler(void); +void IRQ037_Handler(void); +void IRQ038_Handler(void); +void IRQ039_Handler(void); +void IRQ040_Handler(void); +void IRQ041_Handler(void); +void IRQ042_Handler(void); +void IRQ043_Handler(void); +void IRQ044_Handler(void); +void IRQ045_Handler(void); +void IRQ046_Handler(void); +void IRQ047_Handler(void); +void IRQ048_Handler(void); +void IRQ049_Handler(void); +void IRQ050_Handler(void); +void IRQ051_Handler(void); +void IRQ052_Handler(void); +void IRQ053_Handler(void); +void IRQ054_Handler(void); +void IRQ055_Handler(void); +void IRQ056_Handler(void); +void IRQ057_Handler(void); +void IRQ058_Handler(void); +void IRQ059_Handler(void); +void IRQ060_Handler(void); +void IRQ061_Handler(void); +void IRQ062_Handler(void); +void IRQ063_Handler(void); +void IRQ064_Handler(void); +void IRQ065_Handler(void); +void IRQ066_Handler(void); +void IRQ067_Handler(void); +void IRQ068_Handler(void); +void IRQ069_Handler(void); +void IRQ070_Handler(void); +void IRQ071_Handler(void); +void IRQ072_Handler(void); +void IRQ073_Handler(void); +void IRQ074_Handler(void); +void IRQ075_Handler(void); +void IRQ076_Handler(void); +void IRQ077_Handler(void); +void IRQ078_Handler(void); +void IRQ079_Handler(void); +void IRQ080_Handler(void); +void IRQ081_Handler(void); +void IRQ082_Handler(void); +void IRQ083_Handler(void); +void IRQ084_Handler(void); +void IRQ085_Handler(void); +void IRQ086_Handler(void); +void IRQ087_Handler(void); +void IRQ088_Handler(void); +void IRQ089_Handler(void); +void IRQ090_Handler(void); +void IRQ091_Handler(void); +void IRQ092_Handler(void); +void IRQ093_Handler(void); +void IRQ094_Handler(void); +void IRQ095_Handler(void); +void IRQ096_Handler(void); +void IRQ097_Handler(void); +void IRQ098_Handler(void); +void IRQ099_Handler(void); +void IRQ100_Handler(void); +void IRQ101_Handler(void); +void IRQ102_Handler(void); +void IRQ103_Handler(void); +void IRQ104_Handler(void); +void IRQ105_Handler(void); +void IRQ106_Handler(void); +void IRQ107_Handler(void); +void IRQ108_Handler(void); +void IRQ109_Handler(void); +void IRQ110_Handler(void); +void IRQ111_Handler(void); +void IRQ112_Handler(void); +void IRQ113_Handler(void); +void IRQ114_Handler(void); +void IRQ115_Handler(void); +void IRQ116_Handler(void); +void IRQ117_Handler(void); +void IRQ118_Handler(void); +void IRQ119_Handler(void); +void IRQ120_Handler(void); +void IRQ121_Handler(void); +void IRQ122_Handler(void); +void IRQ123_Handler(void); +void IRQ124_Handler(void); +void IRQ125_Handler(void); +void IRQ126_Handler(void); +void IRQ127_Handler(void); +void IRQ128_Handler(void); +void IRQ129_Handler(void); +void IRQ130_Handler(void); +void IRQ131_Handler(void); +void IRQ132_Handler(void); +void IRQ133_Handler(void); +void IRQ134_Handler(void); +void IRQ135_Handler(void); +void IRQ136_Handler(void); +void IRQ137_Handler(void); +void IRQ138_Handler(void); +void IRQ139_Handler(void); +void IRQ140_Handler(void); +void IRQ141_Handler(void); +void IRQ142_Handler(void); +void IRQ143_Handler(void); + +void NMI_IrqHandler(void); +void HardFault_IrqHandler(void); +void MemManage_IrqHandler(void); +void BusFault_IrqHandler(void); +void UsageFault_IrqHandler(void); +void SVC_IrqHandler(void); +void DebugMon_IrqHandler(void); +void PendSV_IrqHandler(void); +void SysTick_IrqHandler(void); +void EXTINT_00_IrqHandler(void); +void EXTINT_01_IrqHandler(void); +void EXTINT_02_IrqHandler(void); +void EXTINT_03_IrqHandler(void); +void EXTINT_04_IrqHandler(void); +void EXTINT_05_IrqHandler(void); +void EXTINT_06_IrqHandler(void); +void EXTINT_07_IrqHandler(void); +void EXTINT_08_IrqHandler(void); +void EXTINT_09_IrqHandler(void); +void EXTINT_10_IrqHandler(void); +void EXTINT_11_IrqHandler(void); +void EXTINT_12_IrqHandler(void); +void EXTINT_13_IrqHandler(void); +void EXTINT_14_IrqHandler(void); +void EXTINT_15_IrqHandler(void); +void DMA_1_Tc0_IrqHandler(void); +void DMA_1_Tc1_IrqHandler(void); +void DMA_1_Tc2_IrqHandler(void); +void DMA_1_Tc3_IrqHandler(void); +void DMA_1_Tc4_IrqHandler(void); +void DMA_1_Tc5_IrqHandler(void); +void DMA_1_Tc6_IrqHandler(void); +void DMA_1_Tc7_IrqHandler(void); +void DMA_1_Btc0_IrqHandler(void); +void DMA_1_Btc1_IrqHandler(void); +void DMA_1_Btc2_IrqHandler(void); +void DMA_1_Btc3_IrqHandler(void); +void DMA_1_Btc4_IrqHandler(void); +void DMA_1_Btc5_IrqHandler(void); +void DMA_1_Btc6_IrqHandler(void); +void DMA_1_Btc7_IrqHandler(void); +void DMA_1_Err0_IrqHandler(void); +void DMA_1_Err1_IrqHandler(void); +void DMA_1_Err2_IrqHandler(void); +void DMA_1_Err3_IrqHandler(void); +void DMA_1_Err4_IrqHandler(void); +void DMA_1_Err5_IrqHandler(void); +void DMA_1_Err6_IrqHandler(void); +void DMA_1_Err7_IrqHandler(void); +void DMA_2_Tc0_IrqHandler(void); +void DMA_2_Tc1_IrqHandler(void); +void DMA_2_Tc2_IrqHandler(void); +void DMA_2_Tc3_IrqHandler(void); +void DMA_2_Tc4_IrqHandler(void); +void DMA_2_Tc5_IrqHandler(void); +void DMA_2_Tc6_IrqHandler(void); +void DMA_2_Tc7_IrqHandler(void); +void DMA_2_Btc0_IrqHandler(void); +void DMA_2_Btc1_IrqHandler(void); +void DMA_2_Btc2_IrqHandler(void); +void DMA_2_Btc3_IrqHandler(void); +void DMA_2_Btc4_IrqHandler(void); +void DMA_2_Btc5_IrqHandler(void); +void DMA_2_Btc6_IrqHandler(void); +void DMA_2_Btc7_IrqHandler(void); +void DMA_2_Err0_IrqHandler(void); +void DMA_2_Err1_IrqHandler(void); +void DMA_2_Err2_IrqHandler(void); +void DMA_2_Err3_IrqHandler(void); +void DMA_2_Err4_IrqHandler(void); +void DMA_2_Err5_IrqHandler(void); +void DMA_2_Err6_IrqHandler(void); +void DMA_2_Err7_IrqHandler(void); +void EFM_PgmEraseErr_IrqHandler(void); +void EFM_ColErr_IrqHandler(void); +void EFM_OpEnd_IrqHandler(void); +void QSPI_Err_IrqHandler(void); +void MAU_Sqrt_IrqHandler(void); +void DVP_FrameStart_IrqHandler(void); +void DVP_FrameEnd_IrqHandler(void); +void DVP_LineStart_IrqHandler(void); +void DVP_LineEnd_IrqHandler(void); +void DVP_SwSyncErr_IrqHandler(void); +void DVP_FifoErr_IrqHandler(void); +void FMAC_1_IrqHandler(void); +void FMAC_2_IrqHandler(void); +void FMAC_3_IrqHandler(void); +void FMAC_4_IrqHandler(void); +void DCU_1_IrqHandler(void); +void DCU_2_IrqHandler(void); +void DCU_3_IrqHandler(void); +void DCU_4_IrqHandler(void); +void DCU_5_IrqHandler(void); +void DCU_6_IrqHandler(void); +void DCU_7_IrqHandler(void); +void DCU_8_IrqHandler(void); +void TMR0_1_CmpA_IrqHandler(void); +void TMR0_1_CmpB_IrqHandler(void); +void TMR0_2_CmpA_IrqHandler(void); +void TMR0_2_CmpB_IrqHandler(void); +void TMR2_1_CmpA_IrqHandler(void); +void TMR2_1_CmpB_IrqHandler(void); +void TMR2_1_OvfA_IrqHandler(void); +void TMR2_1_OvfB_IrqHandler(void); +void TMR2_2_CmpA_IrqHandler(void); +void TMR2_2_CmpB_IrqHandler(void); +void TMR2_2_OvfA_IrqHandler(void); +void TMR2_2_OvfB_IrqHandler(void); +void TMR2_3_CmpA_IrqHandler(void); +void TMR2_3_CmpB_IrqHandler(void); +void TMR2_3_OvfA_IrqHandler(void); +void TMR2_3_OvfB_IrqHandler(void); +void TMR2_4_CmpA_IrqHandler(void); +void TMR2_4_CmpB_IrqHandler(void); +void TMR2_4_OvfA_IrqHandler(void); +void TMR2_4_OvfB_IrqHandler(void); +void RTC_TimeStamp0_IrqHandler(void); +void RTC_TimeStamp1_IrqHandler(void); +void RTC_Alarm_IrqHandler(void); +void RTC_Period_IrqHandler(void); +void CLK_XtalStop_IrqHandler(void); +void SWDT_IrqHandler(void); +void WDT_IrqHandler(void); +void PWC_WakeupTimer_IrqHandler(void); +void TMR6_1_GCmpA_IrqHandler(void); +void TMR6_1_GCmpB_IrqHandler(void); +void TMR6_1_GCmpC_IrqHandler(void); +void TMR6_1_GCmpD_IrqHandler(void); +void TMR6_1_GCmpE_IrqHandler(void); +void TMR6_1_GCmpF_IrqHandler(void); +void TMR6_1_GOvf_IrqHandler(void); +void TMR6_1_GUdf_IrqHandler(void); +void TMR6_1_Gdte_IrqHandler(void); +void TMR6_1_SCmpUpA_IrqHandler(void); +void TMR6_1_SCmpDownA_IrqHandler(void); +void TMR6_1_SCmpUpB_IrqHandler(void); +void TMR6_1_SCmpDownB_IrqHandler(void); +void TMR6_2_GCmpA_IrqHandler(void); +void TMR6_2_GCmpB_IrqHandler(void); +void TMR6_2_GCmpC_IrqHandler(void); +void TMR6_2_GCmpD_IrqHandler(void); +void TMR6_2_GCmpE_IrqHandler(void); +void TMR6_2_GCmpF_IrqHandler(void); +void TMR6_2_GOvf_IrqHandler(void); +void TMR6_2_GUdf_IrqHandler(void); +void TMR6_2_Gdte_IrqHandler(void); +void TMR6_2_SCmpUpA_IrqHandler(void); +void TMR6_2_SCmpDownA_IrqHandler(void); +void TMR6_2_SCmpUpB_IrqHandler(void); +void TMR6_2_SCmpDownB_IrqHandler(void); +void TMR6_3_GCmpA_IrqHandler(void); +void TMR6_3_GCmpB_IrqHandler(void); +void TMR6_3_GCmpC_IrqHandler(void); +void TMR6_3_GCmpD_IrqHandler(void); +void TMR6_3_GCmpE_IrqHandler(void); +void TMR6_3_GCmpF_IrqHandler(void); +void TMR6_3_GOvf_IrqHandler(void); +void TMR6_3_GUdf_IrqHandler(void); +void TMR6_3_Gdte_IrqHandler(void); +void TMR6_3_SCmpUpA_IrqHandler(void); +void TMR6_3_SCmpDownA_IrqHandler(void); +void TMR6_3_SCmpUpB_IrqHandler(void); +void TMR6_3_SCmpDownB_IrqHandler(void); +void TMR6_4_GCmpA_IrqHandler(void); +void TMR6_4_GCmpB_IrqHandler(void); +void TMR6_4_GCmpC_IrqHandler(void); +void TMR6_4_GCmpD_IrqHandler(void); +void TMR6_4_GCmpE_IrqHandler(void); +void TMR6_4_GCmpF_IrqHandler(void); +void TMR6_4_GOvf_IrqHandler(void); +void TMR6_4_GUdf_IrqHandler(void); +void TMR6_4_Gdte_IrqHandler(void); +void TMR6_4_SCmpUpA_IrqHandler(void); +void TMR6_4_SCmpDownA_IrqHandler(void); +void TMR6_4_SCmpUpB_IrqHandler(void); +void TMR6_4_SCmpDownB_IrqHandler(void); +void TMR6_5_GCmpA_IrqHandler(void); +void TMR6_5_GCmpB_IrqHandler(void); +void TMR6_5_GCmpC_IrqHandler(void); +void TMR6_5_GCmpD_IrqHandler(void); +void TMR6_5_GCmpE_IrqHandler(void); +void TMR6_5_GCmpF_IrqHandler(void); +void TMR6_5_GOvf_IrqHandler(void); +void TMR6_5_GUdf_IrqHandler(void); +void TMR6_5_Gdte_IrqHandler(void); +void TMR6_5_SCmpUpA_IrqHandler(void); +void TMR6_5_SCmpDownA_IrqHandler(void); +void TMR6_5_SCmpUpB_IrqHandler(void); +void TMR6_5_SCmpDownB_IrqHandler(void); +void TMR6_6_GCmpA_IrqHandler(void); +void TMR6_6_GCmpB_IrqHandler(void); +void TMR6_6_GCmpC_IrqHandler(void); +void TMR6_6_GCmpD_IrqHandler(void); +void TMR6_6_GCmpE_IrqHandler(void); +void TMR6_6_GCmpF_IrqHandler(void); +void TMR6_6_GOvf_IrqHandler(void); +void TMR6_6_GUdf_IrqHandler(void); +void TMR6_6_Gdte_IrqHandler(void); +void TMR6_6_SCmpUpA_IrqHandler(void); +void TMR6_6_SCmpDownA_IrqHandler(void); +void TMR6_6_SCmpUpB_IrqHandler(void); +void TMR6_6_SCmpDownB_IrqHandler(void); +void TMR6_7_GCmpA_IrqHandler(void); +void TMR6_7_GCmpB_IrqHandler(void); +void TMR6_7_GCmpC_IrqHandler(void); +void TMR6_7_GCmpD_IrqHandler(void); +void TMR6_7_GCmpE_IrqHandler(void); +void TMR6_7_GCmpF_IrqHandler(void); +void TMR6_7_GOvf_IrqHandler(void); +void TMR6_7_GUdf_IrqHandler(void); +void TMR6_7_Gdte_IrqHandler(void); +void TMR6_7_SCmpUpA_IrqHandler(void); +void TMR6_7_SCmpDownA_IrqHandler(void); +void TMR6_7_SCmpUpB_IrqHandler(void); +void TMR6_7_SCmpDownB_IrqHandler(void); +void TMR6_8_GCmpA_IrqHandler(void); +void TMR6_8_GCmpB_IrqHandler(void); +void TMR6_8_GCmpC_IrqHandler(void); +void TMR6_8_GCmpD_IrqHandler(void); +void TMR6_8_GCmpE_IrqHandler(void); +void TMR6_8_GCmpF_IrqHandler(void); +void TMR6_8_GOvf_IrqHandler(void); +void TMR6_8_GUdf_IrqHandler(void); +void TMR6_8_Gdte_IrqHandler(void); +void TMR6_8_SCmpUpA_IrqHandler(void); +void TMR6_8_SCmpDownA_IrqHandler(void); +void TMR6_8_SCmpUpB_IrqHandler(void); +void TMR6_8_SCmpDownB_IrqHandler(void); +void TMR4_1_GCmpUH_IrqHandler(void); +void TMR4_1_GCmpUL_IrqHandler(void); +void TMR4_1_GCmpVH_IrqHandler(void); +void TMR4_1_GCmpVL_IrqHandler(void); +void TMR4_1_GCmpWH_IrqHandler(void); +void TMR4_1_GCmpWL_IrqHandler(void); +void TMR4_1_Ovf_IrqHandler(void); +void TMR4_1_Udf_IrqHandler(void); +void TMR4_1_ReloadU_IrqHandler(void); +void TMR4_1_ReloadV_IrqHandler(void); +void TMR4_1_ReloadW_IrqHandler(void); +void TMR4_2_GCmpUH_IrqHandler(void); +void TMR4_2_GCmpUL_IrqHandler(void); +void TMR4_2_GCmpVH_IrqHandler(void); +void TMR4_2_GCmpVL_IrqHandler(void); +void TMR4_2_GCmpWH_IrqHandler(void); +void TMR4_2_GCmpWL_IrqHandler(void); +void TMR4_2_Ovf_IrqHandler(void); +void TMR4_2_Udf_IrqHandler(void); +void TMR4_2_ReloadU_IrqHandler(void); +void TMR4_2_ReloadV_IrqHandler(void); +void TMR4_2_ReloadW_IrqHandler(void); +void TMR4_3_GCmpUH_IrqHandler(void); +void TMR4_3_GCmpUL_IrqHandler(void); +void TMR4_3_GCmpVH_IrqHandler(void); +void TMR4_3_GCmpVL_IrqHandler(void); +void TMR4_3_GCmpWH_IrqHandler(void); +void TMR4_3_GCmpWL_IrqHandler(void); +void TMR4_3_Ovf_IrqHandler(void); +void TMR4_3_Udf_IrqHandler(void); +void TMR4_3_ReloadU_IrqHandler(void); +void TMR4_3_ReloadV_IrqHandler(void); +void TMR4_3_ReloadW_IrqHandler(void); +void TMRA_1_Ovf_IrqHandler(void); +void TMRA_1_Udf_IrqHandler(void); +void TMRA_1_Cmp1_IrqHandler(void); +void TMRA_1_Cmp2_IrqHandler(void); +void TMRA_1_Cmp3_IrqHandler(void); +void TMRA_1_Cmp4_IrqHandler(void); +void TMRA_2_Ovf_IrqHandler(void); +void TMRA_2_Udf_IrqHandler(void); +void TMRA_2_Cmp1_IrqHandler(void); +void TMRA_2_Cmp2_IrqHandler(void); +void TMRA_2_Cmp3_IrqHandler(void); +void TMRA_2_Cmp4_IrqHandler(void); +void TMRA_3_Ovf_IrqHandler(void); +void TMRA_3_Udf_IrqHandler(void); +void TMRA_3_Cmp1_IrqHandler(void); +void TMRA_3_Cmp2_IrqHandler(void); +void TMRA_3_Cmp3_IrqHandler(void); +void TMRA_3_Cmp4_IrqHandler(void); +void TMRA_4_Ovf_IrqHandler(void); +void TMRA_4_Udf_IrqHandler(void); +void TMRA_4_Cmp1_IrqHandler(void); +void TMRA_4_Cmp2_IrqHandler(void); +void TMRA_4_Cmp3_IrqHandler(void); +void TMRA_4_Cmp4_IrqHandler(void); +void TMRA_5_Ovf_IrqHandler(void); +void TMRA_5_Udf_IrqHandler(void); +void TMRA_5_Cmp1_IrqHandler(void); +void TMRA_5_Cmp2_IrqHandler(void); +void TMRA_5_Cmp3_IrqHandler(void); +void TMRA_5_Cmp4_IrqHandler(void); +void TMRA_6_Ovf_IrqHandler(void); +void TMRA_6_Udf_IrqHandler(void); +void TMRA_6_Cmp1_IrqHandler(void); +void TMRA_6_Cmp2_IrqHandler(void); +void TMRA_6_Cmp3_IrqHandler(void); +void TMRA_6_Cmp4_IrqHandler(void); +void TMRA_7_Ovf_IrqHandler(void); +void TMRA_7_Udf_IrqHandler(void); +void TMRA_7_Cmp1_IrqHandler(void); +void TMRA_7_Cmp2_IrqHandler(void); +void TMRA_7_Cmp3_IrqHandler(void); +void TMRA_7_Cmp4_IrqHandler(void); +void TMRA_8_Ovf_IrqHandler(void); +void TMRA_8_Udf_IrqHandler(void); +void TMRA_8_Cmp1_IrqHandler(void); +void TMRA_8_Cmp2_IrqHandler(void); +void TMRA_8_Cmp3_IrqHandler(void); +void TMRA_8_Cmp4_IrqHandler(void); +void TMRA_9_Ovf_IrqHandler(void); +void TMRA_9_Udf_IrqHandler(void); +void TMRA_9_Cmp1_IrqHandler(void); +void TMRA_9_Cmp2_IrqHandler(void); +void TMRA_9_Cmp3_IrqHandler(void); +void TMRA_9_Cmp4_IrqHandler(void); +void TMRA_10_Ovf_IrqHandler(void); +void TMRA_10_Udf_IrqHandler(void); +void TMRA_10_Cmp1_IrqHandler(void); +void TMRA_10_Cmp2_IrqHandler(void); +void TMRA_10_Cmp3_IrqHandler(void); +void TMRA_10_Cmp4_IrqHandler(void); +void TMRA_11_Ovf_IrqHandler(void); +void TMRA_11_Udf_IrqHandler(void); +void TMRA_11_Cmp1_IrqHandler(void); +void TMRA_11_Cmp2_IrqHandler(void); +void TMRA_11_Cmp3_IrqHandler(void); +void TMRA_11_Cmp4_IrqHandler(void); +void TMRA_12_Ovf_IrqHandler(void); +void TMRA_12_Udf_IrqHandler(void); +void TMRA_12_Cmp1_IrqHandler(void); +void TMRA_12_Cmp2_IrqHandler(void); +void TMRA_12_Cmp3_IrqHandler(void); +void TMRA_12_Cmp4_IrqHandler(void); +void EMB_GR0_IrqHandler(void); +void EMB_GR1_IrqHandler(void); +void EMB_GR2_IrqHandler(void); +void EMB_GR3_IrqHandler(void); +void EMB_GR4_IrqHandler(void); +void EMB_GR5_IrqHandler(void); +void EMB_GR6_IrqHandler(void); +void USART_1_RxErr_IrqHandler(void); +void USART_1_RxEnd_IrqHandler(void); +void USART_1_TxEmpty_IrqHandler(void); +void USART_1_TxEnd_IrqHandler(void); +void USART_1_RxTO_IrqHandler(void); +void USART_2_RxErr_IrqHandler(void); +void USART_2_RxEnd_IrqHandler(void); +void USART_2_TxEmpty_IrqHandler(void); +void USART_2_TxEnd_IrqHandler(void); +void USART_2_RxTO_IrqHandler(void); +void USART_3_RxErr_IrqHandler(void); +void USART_3_RxEnd_IrqHandler(void); +void USART_3_TxEmpty_IrqHandler(void); +void USART_3_TxEnd_IrqHandler(void); +void USART_4_RxErr_IrqHandler(void); +void USART_4_RxEnd_IrqHandler(void); +void USART_4_TxEmpty_IrqHandler(void); +void USART_4_TxEnd_IrqHandler(void); +void USART_5_LinBreakField_IrqHandler(void); +void USART_5_LinWakeup_IrqHandler(void); +void USART_5_RxErr_IrqHandler(void); +void USART_5_RxEnd_IrqHandler(void); +void USART_5_TxEmpty_IrqHandler(void); +void USART_5_TxEnd_IrqHandler(void); +void USART_6_RxErr_IrqHandler(void); +void USART_6_RxEnd_IrqHandler(void); +void USART_6_TxEmpty_IrqHandler(void); +void USART_6_TxEnd_IrqHandler(void); +void USART_6_RxTO_IrqHandler(void); +void USART_7_RxErr_IrqHandler(void); +void USART_7_RxEnd_IrqHandler(void); +void USART_7_TxEmpty_IrqHandler(void); +void USART_7_TxEnd_IrqHandler(void); +void USART_7_RxTO_IrqHandler(void); +void USART_8_RxErr_IrqHandler(void); +void USART_8_RxEnd_IrqHandler(void); +void USART_8_TxEmpty_IrqHandler(void); +void USART_8_TxEnd_IrqHandler(void); +void USART_9_RxErr_IrqHandler(void); +void USART_9_RxEnd_IrqHandler(void); +void USART_9_TxEmpty_IrqHandler(void); +void USART_9_TxEnd_IrqHandler(void); +void USART_10_LinBreakField_IrqHandler(void); +void USART_10_LinWakeup_IrqHandler(void); +void USART_10_RxErr_IrqHandler(void); +void USART_10_RxEnd_IrqHandler(void); +void USART_10_TxEmpty_IrqHandler(void); +void USART_10_TxEnd_IrqHandler(void); +void SPI_1_RxEnd_IrqHandler(void); +void SPI_1_TxEmpty_IrqHandler(void); +void SPI_1_Err_IrqHandler(void); +void SPI_1_Idle_IrqHandler(void); +void SPI_2_RxEnd_IrqHandler(void); +void SPI_2_TxEmpty_IrqHandler(void); +void SPI_2_Err_IrqHandler(void); +void SPI_2_Idle_IrqHandler(void); +void SPI_3_RxEnd_IrqHandler(void); +void SPI_3_TxEmpty_IrqHandler(void); +void SPI_3_Err_IrqHandler(void); +void SPI_3_Idle_IrqHandler(void); +void SPI_4_RxEnd_IrqHandler(void); +void SPI_4_TxEmpty_IrqHandler(void); +void SPI_4_Err_IrqHandler(void); +void SPI_4_Idle_IrqHandler(void); +void SPI_5_RxEnd_IrqHandler(void); +void SPI_5_TxEmpty_IrqHandler(void); +void SPI_5_Err_IrqHandler(void); +void SPI_5_Idle_IrqHandler(void); +void SPI_6_RxEnd_IrqHandler(void); +void SPI_6_TxEmpty_IrqHandler(void); +void SPI_6_Err_IrqHandler(void); +void SPI_6_Idle_IrqHandler(void); +void CAN_1_IrqHandler(void); +void CAN_2_IrqHandler(void); +void I2S_1_Tx_IrqHandler(void); +void I2S_1_Rx_IrqHandler(void); +void I2S_1_Err_IrqHandler(void); +void I2S_2_Tx_IrqHandler(void); +void I2S_2_Rx_IrqHandler(void); +void I2S_2_Err_IrqHandler(void); +void I2S_3_Tx_IrqHandler(void); +void I2S_3_Rx_IrqHandler(void); +void I2S_3_Err_IrqHandler(void); +void I2S_4_Tx_IrqHandler(void); +void I2S_4_Rx_IrqHandler(void); +void I2S_4_Err_IrqHandler(void); +void USBFS_Global_IrqHandler(void); +void SDIOC_1_Normal_IrqHandler(void); +void SDIOC_1_Error_IrqHandler(void); +void SDIOC_2_Normal_IrqHandler(void); +void SDIOC_2_Error_IrqHandler(void); +void ETH_Global_IrqHandler(void); +void ETH_Wakeup_IrqHandler(void); +void I2C_1_RxEnd_IrqHandler(void); +void I2C_1_TxEnd_IrqHandler(void); +void I2C_1_TxEmpty_IrqHandler(void); +void I2C_1_Err_IrqHandler(void); +void I2C_2_RxEnd_IrqHandler(void); +void I2C_2_TxEnd_IrqHandler(void); +void I2C_2_TxEmpty_IrqHandler(void); +void I2C_2_Err_IrqHandler(void); +void I2C_3_RxEnd_IrqHandler(void); +void I2C_3_TxEnd_IrqHandler(void); +void I2C_3_TxEmpty_IrqHandler(void); +void I2C_3_Err_IrqHandler(void); +void I2C_4_RxEnd_IrqHandler(void); +void I2C_4_TxEnd_IrqHandler(void); +void I2C_4_TxEmpty_IrqHandler(void); +void I2C_4_Err_IrqHandler(void); +void I2C_5_RxEnd_IrqHandler(void); +void I2C_5_TxEnd_IrqHandler(void); +void I2C_5_TxEmpty_IrqHandler(void); +void I2C_5_Err_IrqHandler(void); +void I2C_6_RxEnd_IrqHandler(void); +void I2C_6_TxEnd_IrqHandler(void); +void I2C_6_TxEmpty_IrqHandler(void); +void I2C_6_Err_IrqHandler(void); +void PWC_Pvd1_IrqHandler(void); +void PWC_Pvd2_IrqHandler(void); +void FCM_Err_IrqHandler(void); +void FCM_End_IrqHandler(void); +void FCM_Ovf_IrqHandler(void); +void CTC_Udf_IrqHandler(void); +void CTC_Ovf_IrqHandler(void); +void ADC_1_SeqA_IrqHandler(void); +void ADC_1_SeqB_IrqHandler(void); +void ADC_1_Cmp0_IrqHandler(void); +void ADC_1_Cmp1Ind_IrqHandler(void); +void ADC_1_Cmp1Comb_IrqHandler(void); +void ADC_2_SeqA_IrqHandler(void); +void ADC_2_SeqB_IrqHandler(void); +void ADC_2_Cmp0_IrqHandler(void); +void ADC_2_Cmp1Ind_IrqHandler(void); +void ADC_2_Cmp1Comb_IrqHandler(void); +void ADC_3_SeqA_IrqHandler(void); +void ADC_3_SeqB_IrqHandler(void); +void ADC_3_Cmp0_IrqHandler(void); +void ADC_3_Cmp1Ind_IrqHandler(void); +void ADC_3_Cmp1Comb_IrqHandler(void); +void NFC_IrqHandler(void); + +/** + * @} + */ + +#endif /* DDL_INTERRUPTS_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_INTERRUPTS_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_keyscan.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_keyscan.h new file mode 100644 index 0000000000..b545ff2f0d --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_keyscan.h @@ -0,0 +1,239 @@ +/** + ******************************************************************************* + * @file hc32f4a0_keyscan.h + * @brief This file contains all the functions prototypes of the KEYSCAN driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Zhangxl First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_KEYSCAN_H__ +#define __HC32F4A0_KEYSCAN_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_KEYSCAN + * @{ + */ + +#if (DDL_KEYSCAN_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup KEYSCAN_Global_Types KEYSCAN Global Types + * @{ + */ + +/** + * @brief KEYSCAN configuration + */ +typedef struct +{ + uint32_t u32HizCycle; /*!< Specifies the KEYSCAN Hiz cycles. + This parameter can be a value of @ref KEYSCAN_Hiz_Cycle_Sel */ + + uint32_t u32LowCycle; /*!< Specifies the KEYSCAN low cycles. + This parameter can be a value of @ref KEYSCAN_Low_Cycle_Sel */ + + uint32_t u32KeyClk; /*!< Specifies the KEYSCAN low cycles. + This parameter can be a value of @ref KEYSCAN_Clock_Sel */ + + uint32_t u32KeyOut; /*!< Specifies the KEYSCAN low cycles. + This parameter can be a value of @ref KEYSCAN_Keyout_Sel */ + + uint32_t u32KeyIn; /*!< Specifies the KEYSCAN low cycles. + This parameter can be a value of @ref KEYSCAN_Keyin_Sel */ +} stc_keyscan_init_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup KEYSCAN_Global_Macros KEYSCAN Global Macros + * @{ + */ + +/** + * @defgroup KEYSCAN_Hiz_Cycle_Sel KEYSCAN Hiz cycles during low ouput selection + * @{ + */ +#define KEYSCAN_HIZ_CLC_4 (0x00UL << KEYSCAN_SCR_T_HIZ_POS) /*!< KEYSCAN HiZ keep 4 cycles during low ouput */ +#define KEYSCAN_HIZ_CLC_8 (0x01UL << KEYSCAN_SCR_T_HIZ_POS) /*!< KEYSCAN HiZ keep 8 cycles during low ouput */ +#define KEYSCAN_HIZ_CLC_16 (0x02UL << KEYSCAN_SCR_T_HIZ_POS) /*!< KEYSCAN HiZ keep 16 cycles during low ouput */ +#define KEYSCAN_HIZ_CLC_32 (0x03UL << KEYSCAN_SCR_T_HIZ_POS) /*!< KEYSCAN HiZ keep 32 cycles during low ouput */ +#define KEYSCAN_HIZ_CLC_64 (0x04UL << KEYSCAN_SCR_T_HIZ_POS) /*!< KEYSCAN HiZ keep 64 cycles during low ouput */ +#define KEYSCAN_HIZ_CLC_256 (0x05UL << KEYSCAN_SCR_T_HIZ_POS) /*!< KEYSCAN HiZ keep 256 cycles during low ouput */ +#define KEYSCAN_HIZ_CLC_512 (0x06UL << KEYSCAN_SCR_T_HIZ_POS) /*!< KEYSCAN HiZ keep 512 cycles during low ouput */ +#define KEYSCAN_HIZ_CLC_1024 (0x07UL << KEYSCAN_SCR_T_HIZ_POS) /*!< KEYSCAN HiZ keep 1024 cycles during low ouput */ +/** + * @} + */ + +/** + * @defgroup KEYSCAN_Low_Cycle_Sel KEYSCAN low level output cycles selection + * @{ + */ +#define KEYSCAN_LOW_CLC_4 (0x02UL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^2=4 cycles */ +#define KEYSCAN_LOW_CLC_8 (0x03UL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^3=8 cycles */ +#define KEYSCAN_LOW_CLC_16 (0x04UL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^4=16 cycles */ +#define KEYSCAN_LOW_CLC_32 (0x05UL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^5=32 cycles */ +#define KEYSCAN_LOW_CLC_64 (0x06UL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^6=64 cycles */ +#define KEYSCAN_LOW_CLC_128 (0x07UL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^7=128 cycles */ +#define KEYSCAN_LOW_CLC_256 (0x08UL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^8=256 cycles */ +#define KEYSCAN_LOW_CLC_512 (0x09UL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^9=512 cycles */ +#define KEYSCAN_LOW_CLC_1K (0x0AUL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^10=1K cycles */ +#define KEYSCAN_LOW_CLC_2K (0x0BUL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^11=2K cycles */ +#define KEYSCAN_LOW_CLC_4K (0x0CUL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^12=4K cycles */ +#define KEYSCAN_LOW_CLC_8K (0x0DUL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^13=8K cycles */ +#define KEYSCAN_LOW_CLC_16K (0x0EUL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^14=16K cycles */ +#define KEYSCAN_LOW_CLC_32K (0x0FUL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^15=32K cycles */ +#define KEYSCAN_LOW_CLC_64K (0x10UL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^16=64K cycles */ +#define KEYSCAN_LOW_CLC_128K (0x11UL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^17=128K cycles */ +#define KEYSCAN_LOW_CLC_256K (0x12UL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^18=256K cycles */ +#define KEYSCAN_LOW_CLC_512K (0x13UL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^19=512K cycles */ +#define KEYSCAN_LOW_CLC_1M (0x14UL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^20=1M cycles */ +#define KEYSCAN_LOW_CLC_2M (0x15UL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^21=2M cycles */ +#define KEYSCAN_LOW_CLC_4M (0x16UL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^22=4M cycles */ +#define KEYSCAN_LOW_CLC_8M (0x17UL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^23=8M cycles */ +#define KEYSCAN_LOW_CLC_16M (0x18UL << KEYSCAN_SCR_T_LLEVEL_POS) /*!< KEYSCAN low level output is 2^24=16M cycles */ +/** + * @} + */ + +/** + * @defgroup KEYSCAN_Clock_Sel KEYSCAN scan clock selection + * @{ + */ +#define KEYSCAN_CLK_HCLK (0x00UL) /*!< Use as HCLK KEYSCAN clock */ +#define KEYSCAN_CLK_LRC (KEYSCAN_SCR_CKSEL_0) /*!< Use as LRC KEYSCAN clock */ +#define KEYSCAN_CLK_XTAL32 (KEYSCAN_SCR_CKSEL_1) /*!< Use as XTAL32 KEYSCAN clock */ +/** + * @} + */ + +/** + * @defgroup KEYSCAN_Keyout_Sel KEYSCAN keyout pins selection + * @{ + */ +#define KEYSCAN_OUT_0T1 (0x01UL << KEYSCAN_SCR_KEYOUTSEL_POS) /*!< KEYOUT 0 ~ 1 are selected */ +#define KEYSCAN_OUT_0T2 (0x02UL << KEYSCAN_SCR_KEYOUTSEL_POS) /*!< KEYOUT 0 ~ 2 are selected */ +#define KEYSCAN_OUT_0T3 (0x03UL << KEYSCAN_SCR_KEYOUTSEL_POS) /*!< KEYOUT 0 ~ 3 are selected */ +#define KEYSCAN_OUT_0T4 (0x04UL << KEYSCAN_SCR_KEYOUTSEL_POS) /*!< KEYOUT 0 ~ 4 are selected */ +#define KEYSCAN_OUT_0T5 (0x05UL << KEYSCAN_SCR_KEYOUTSEL_POS) /*!< KEYOUT 0 ~ 5 are selected */ +#define KEYSCAN_OUT_0T6 (0x06UL << KEYSCAN_SCR_KEYOUTSEL_POS) /*!< KEYOUT 0 ~ 6 are selected */ +#define KEYSCAN_OUT_0T7 (0x07UL << KEYSCAN_SCR_KEYOUTSEL_POS) /*!< KEYOUT 0 ~ 7 are selected */ +/** + * @} + */ + +/** + * @defgroup KEYSCAN_Keyin_Sel KEYSCAN keyin pins selection + * @{ + */ +#define KEYSCAN_IN_0 (KEYSCAN_SCR_KEYINSEL_0) /*!< KEYIN(EIRQ) 0 is selected */ +#define KEYSCAN_IN_1 (KEYSCAN_SCR_KEYINSEL_1) /*!< KEYIN(EIRQ) 1 is selected */ +#define KEYSCAN_IN_2 (KEYSCAN_SCR_KEYINSEL_2) /*!< KEYIN(EIRQ) 2 is selected */ +#define KEYSCAN_IN_3 (KEYSCAN_SCR_KEYINSEL_3) /*!< KEYIN(EIRQ) 3 is selected */ +#define KEYSCAN_IN_4 (KEYSCAN_SCR_KEYINSEL_4) /*!< KEYIN(EIRQ) 4 is selected */ +#define KEYSCAN_IN_5 (KEYSCAN_SCR_KEYINSEL_5) /*!< KEYIN(EIRQ) 5 is selected */ +#define KEYSCAN_IN_6 (KEYSCAN_SCR_KEYINSEL_6) /*!< KEYIN(EIRQ) 6 is selected */ +#define KEYSCAN_IN_7 (KEYSCAN_SCR_KEYINSEL_7) /*!< KEYIN(EIRQ) 7 is selected */ +#define KEYSCAN_IN_8 (KEYSCAN_SCR_KEYINSEL_8) /*!< KEYIN(EIRQ) 8 is selected */ +#define KEYSCAN_IN_9 (KEYSCAN_SCR_KEYINSEL_9) /*!< KEYIN(EIRQ) 9 is selected */ +#define KEYSCAN_IN_10 (KEYSCAN_SCR_KEYINSEL_10) /*!< KEYIN(EIRQ) 10 is selected */ +#define KEYSCAN_IN_11 (KEYSCAN_SCR_KEYINSEL_11) /*!< KEYIN(EIRQ) 11 is selected */ +#define KEYSCAN_IN_12 (KEYSCAN_SCR_KEYINSEL_12) /*!< KEYIN(EIRQ) 12 is selected */ +#define KEYSCAN_IN_13 (KEYSCAN_SCR_KEYINSEL_13) /*!< KEYIN(EIRQ) 13 is selected */ +#define KEYSCAN_IN_14 (KEYSCAN_SCR_KEYINSEL_14) /*!< KEYIN(EIRQ) 14 is selected */ +#define KEYSCAN_IN_15 (KEYSCAN_SCR_KEYINSEL_15) /*!< KEYIN(EIRQ) 15 is selected */ +#define KEYSCAN_IN_MASK (KEYSCAN_SCR_KEYINSEL) /*!< KEYIN(EIRQ) mask */ + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup KEYSCAN_Global_Functions + * @{ + */ +/** + * @brief Get KEYOUT index. + * @param None. + * @retval uint32_t: KEYOUT index 0~7. + */ +__STATIC_INLINE uint32_t KEYSCAN_GetKeyoutIdx(void) +{ + return READ_REG32_BIT(M4_KEYSCAN->SSR, KEYSCAN_SSR_INDEX); +} + +en_result_t KEYSCAN_StructInit(stc_keyscan_init_t *pstcKeyscanInit); +en_result_t KEYSCAN_Init(const stc_keyscan_init_t *pstcKeyscanInit); +void KEYSCAN_Cmd(en_functional_state_t enNewState); + +/** + * @} + */ + +#endif /* DDL_KEYSCAN_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_KEYSCAN_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_mau.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_mau.h new file mode 100644 index 0000000000..d2e5652f28 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_mau.h @@ -0,0 +1,122 @@ +/** + ******************************************************************************* + * @file hc32f4a0_mau.h + * @brief This file contains all the functions prototypes of the MAU driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Hexiao First version + 2020-07-15 Hexiao Modify MAU_SqrtStartCmd to MAU_SqrtStart + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_MAU_H__ +#define __HC32F4A0_MAU_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_MAU + * @{ + */ + +#if (DDL_MAU_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ + + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ + +/** + * @defgroup MAU_Global_Macros MAU Global Macros + * @{ + */ + +#define MAU_SQRT_TIMEOUT (HCLK_VALUE / 10000UL)/* About 1mS timeout */ +#define MAU_SQRT_OUTPUT_LSHIFT_MAX (16U) +#define MAU_SIN_Q15_SCALAR (0x8000UL) +#define MAU_SIN_ANGIDX_TOTAL (0x1000UL) + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ + +/** + * @addtogroup MAU_Global_Functions + * @{ + */ + +void MAU_SqrtInit(M4_MAU_TypeDef *MAUx, uint8_t u8LShBitsNumber, en_functional_state_t enIntNewState); +void MAU_SqrtDeInit(M4_MAU_TypeDef *MAUx); + +void MAU_SqrtResultLShiftCfg(M4_MAU_TypeDef *MAUx, uint8_t u8LShBitsNumber); +void MAU_SqrtIntCmd(M4_MAU_TypeDef *MAUx, en_functional_state_t enNewState); +void MAU_SqrtWriteDataReg(M4_MAU_TypeDef *MAUx, uint32_t u32Radicand); +en_flag_status_t MAU_SqrtGetStatus(const M4_MAU_TypeDef *MAUx); +uint32_t MAU_SqrtReadDataReg(const M4_MAU_TypeDef *MAUx); +void MAU_SqrtStart(M4_MAU_TypeDef* MAUx); + +en_result_t MAU_Sqrt(M4_MAU_TypeDef *MAUx, uint32_t u32Radicand, uint32_t *pu32Result); + +int16_t MAU_Sin(M4_MAU_TypeDef *MAUx, uint16_t u16AngleIdx); + +/** + * @} + */ + +#endif /* DDL_MAU_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_MAU_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_mpu.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_mpu.h new file mode 100644 index 0000000000..89be765842 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_mpu.h @@ -0,0 +1,380 @@ +/** + ******************************************************************************* + * @file hc32f4a0_mpu.h + * @brief This file contains all the functions prototypes of the MPU driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Yangjp First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_MPU_H__ +#define __HC32F4A0_MPU_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_MPU + * @{ + */ + +#if (DDL_MPU_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup MPU_Global_Types MPU Global Types + * @{ + */ + +/** + * @brief MPU Unit configure structure definition + */ +typedef struct +{ + uint32_t u32ExceptionType; /*!< Specifies the type of exception that occurs when the unit accesses a protected region. + This parameter can be a value of @ref MPU_Exception_Type */ + uint32_t u32BackgroundWriteProtect; /*!< Specifies the unit's write protection for the background space. + This parameter can be a value of @ref MPU_Background_Write_Protect */ + uint32_t u32BackgroundReadProtect; /*!< Specifies the unit's read protection for the background space + This parameter can be a value of @ref MPU_Background_Read_Protect */ +} stc_mpu_unit_config_t; + +/** + * @brief MPU Init structure definition + */ +typedef struct +{ + stc_mpu_unit_config_t stcDma1; /*!< Configure storage protection unit of DMA1 */ + stc_mpu_unit_config_t stcDma2; /*!< Configure storage protection unit of DMA2 */ + stc_mpu_unit_config_t stcUsbFSDma; /*!< Configure storage protection unit of USBFS_DMA */ + stc_mpu_unit_config_t stcUsbHSDma; /*!< Configure storage protection unit of USBHS_DMA */ + stc_mpu_unit_config_t stcEthDma; /*!< Configure storage protection unit of ETH_DMA */ +} stc_mpu_init_t; + +/** + * @brief MPU Region Permission structure definition + */ +typedef struct +{ + uint32_t u32WriteProtect; /*!< Specifies the unit's write protection for the region. + This parameter can be a value of @ref MPU_Region_Write_Protect */ + uint32_t u32ReadProtect; /*!< Specifies the unit's read protection for the region. + This parameter can be a value of @ref MPU_Region_Read_Protect */ +} stc_mpu_region_permission_t; + +/** + * @brief MPU region initialization structure definition + * @note The effective bits of the 'u32BaseAddr' are related to the 'u32Size' of the region, + * and the low 'u32Size+1' bits are fixed at 0. + */ +typedef struct +{ + uint32_t u32BaseAddr; /*!< Specifies the base address of the region. + This parameter can be a number between 0UL and 0xFFFFFFE0UL */ + uint32_t u32Size; /*!< Specifies the size of the region. + This parameter can be a value of @ref MPU_Region_Size */ + stc_mpu_region_permission_t stcDma1; /*!< Specifies the DMA1 access permission for the region */ + stc_mpu_region_permission_t stcDma2; /*!< Specifies the DMA2 access permission for the region */ + stc_mpu_region_permission_t stcUsbFSDma; /*!< Specifies the USBFS_DMA access permission for the region */ + stc_mpu_region_permission_t stcUsbHSDma; /*!< Specifies the USBHS_DMA access permission for the region */ + stc_mpu_region_permission_t stcEthDma; /*!< Specifies the ETH_DMA access permission for the region */ +} stc_mpu_region_init_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup MPU_Global_Macros MPU Global Macros + * @{ + */ + +/** + * @defgroup MPU_Unit_Type MPU Unit Type + * @{ + */ +#define MPU_UNIT_DMA1 (0x01UL) /*!< System DMA_1 MPU */ +#define MPU_UNIT_DMA2 (0x02UL) /*!< System DMA_2 MPU */ +#define MPU_UNIT_USBFS_DMA (0x04UL) /*!< USBFS_DMA MPU */ +#define MPU_UNIT_USBHS_DMA (0x08UL) /*!< USBHS_DMA MPU */ +#define MPU_UNIT_ETH_DMA (0x10UL) /*!< ETH_DMA MPU */ +#define MPU_UNIT_ALL (0x1FUL) +/** + * @} + */ + +/** + * @defgroup MPU_Region_Number MPU Region Number + * @note 'MPU_REGION_NUM8' to 'MPU_REGION_NUM15' are only valid when the MPU unit is 'MPU_UNIT_DMA1' or 'MPU_UNIT_DMA2'. + * @{ + */ +#define MPU_REGION_NUM0 (0x00UL) /*!< MPU region number 0 */ +#define MPU_REGION_NUM1 (0x01UL) /*!< MPU region number 1 */ +#define MPU_REGION_NUM2 (0x02UL) /*!< MPU region number 2 */ +#define MPU_REGION_NUM3 (0x03UL) /*!< MPU region number 3 */ +#define MPU_REGION_NUM4 (0x04UL) /*!< MPU region number 4 */ +#define MPU_REGION_NUM5 (0x05UL) /*!< MPU region number 5 */ +#define MPU_REGION_NUM6 (0x06UL) /*!< MPU region number 6 */ +#define MPU_REGION_NUM7 (0x07UL) /*!< MPU region number 7 */ +#define MPU_REGION_NUM8 (0x08UL) /*!< MPU region number 8 */ +#define MPU_REGION_NUM9 (0x09UL) /*!< MPU region number 9 */ +#define MPU_REGION_NUM10 (0x0AUL) /*!< MPU region number 10 */ +#define MPU_REGION_NUM11 (0x0BUL) /*!< MPU region number 11 */ +#define MPU_REGION_NUM12 (0x0CUL) /*!< MPU region number 12 */ +#define MPU_REGION_NUM13 (0x0DUL) /*!< MPU region number 13 */ +#define MPU_REGION_NUM14 (0x0EUL) /*!< MPU region number 14 */ +#define MPU_REGION_NUM15 (0x0FUL) /*!< MPU region number 15 */ +/** + * @} + */ + +/** + * @defgroup MPU_Background_Write_Protect MPU Background Write Protect + * @{ + */ +#define MPU_BKGRD_WR_PROTECT_DISABLE (0UL) /*!< Disable write protection of background space */ +#define MPU_BKGRD_WR_PROTECT_ENABLE (MPU_S1CR_SMPU1BWP) /*!< Enable write protection of background space */ +/** + * @} + */ + +/** + * @defgroup MPU_Background_Read_Protect MPU Background Read Protect + * @{ + */ +#define MPU_BKGRD_RD_PROTECT_DISABLE (0UL) /*!< Disable read protection of background space */ +#define MPU_BKGRD_RD_PROTECT_ENABLE (MPU_S1CR_SMPU1BRP) /*!< Enable read protection of background space */ +/** + * @} + */ + +/** + * @defgroup MPU_Exception_Type MPU Exception Type + * @{ + */ +#define MPU_EXP_TYPE_NONE (0UL) /*!< The host unit access protection regions will be ignored */ +#define MPU_EXP_TYPE_BUS_ERR (MPU_S1CR_SMPU1ACT_0) /*!< The host unit access protection regions will be ignored and a bus error will be triggered */ +#define MPU_EXP_TYPE_NMI (MPU_S1CR_SMPU1ACT_1) /*!< The host unit access protection regions will be ignored and a NMI interrupt will be triggered */ +#define MPU_EXP_TYPE_RST (MPU_S1CR_SMPU1ACT) /*!< The host unit access protection regions will trigger the reset */ +/** + * @} + */ + +/** + * @defgroup MPU_Region_Write_Protect MPU Region Write Protect + * @{ + */ +#define MPU_REGION_WR_PROTECT_DISABLE (0UL) /*!< Disable write protection of the region */ +#define MPU_REGION_WR_PROTECT_ENABLE (MPU_S1RGWP_S1RG0WP) /*!< Enable write protection of the region */ +/** + * @} + */ + +/** + * @defgroup MPU_Region_Read_Protect MPU Region Read Protect + * @{ + */ +#define MPU_REGION_RD_PROTECT_DISABLE (0UL) /*!< Disable read protection of the region */ +#define MPU_REGION_RD_PROTECT_ENABLE (MPU_S1RGRP_S1RG0RP) /*!< Enable read protection of the region */ +/** + * @} + */ + +/** + * @defgroup MPU_Region_Size MPU Region Size + * @{ + */ +#define MPU_REGION_SIZE_32BYTE (0x04UL) /*!< 32 Byte */ +#define MPU_REGION_SIZE_64BYTE (0x05UL) /*!< 64 Byte */ +#define MPU_REGION_SIZE_128BYTE (0x06UL) /*!< 126 Byte */ +#define MPU_REGION_SIZE_256BYTE (0x07UL) /*!< 256 Byte */ +#define MPU_REGION_SIZE_512BYTE (0x08UL) /*!< 512 Byte */ +#define MPU_REGION_SIZE_1KBYTE (0x09UL) /*!< 1K Byte */ +#define MPU_REGION_SIZE_2KBYTE (0x0AUL) /*!< 2K Byte */ +#define MPU_REGION_SIZE_4KBYTE (0x0BUL) /*!< 4K Byte */ +#define MPU_REGION_SIZE_8KBYTE (0x0CUL) /*!< 8K Byte */ +#define MPU_REGION_SIZE_16KBYTE (0x0DUL) /*!< 16K Byte */ +#define MPU_REGION_SIZE_32KBYTE (0x0EUL) /*!< 32K Byte */ +#define MPU_REGION_SIZE_64KBYTE (0x0FUL) /*!< 64K Byte */ +#define MPU_REGION_SIZE_128KBYTE (0x10UL) /*!< 128K Byte */ +#define MPU_REGION_SIZE_256KBYTE (0x11UL) /*!< 256K Byte */ +#define MPU_REGION_SIZE_512KBYTE (0x12UL) /*!< 512K Byte */ +#define MPU_REGION_SIZE_1MBYTE (0x13UL) /*!< 1M Byte */ +#define MPU_REGION_SIZE_2MBYTE (0x14UL) /*!< 2M Byte */ +#define MPU_REGION_SIZE_4MBYTE (0x15UL) /*!< 4M Byte */ +#define MPU_REGION_SIZE_8MBYTE (0x16UL) /*!< 8M Byte */ +#define MPU_REGION_SIZE_16MBYTE (0x17UL) /*!< 16M Byte */ +#define MPU_REGION_SIZE_32MBYTE (0x18UL) /*!< 32M Byte */ +#define MPU_REGION_SIZE_64MBYTE (0x19UL) /*!< 64M Byte */ +#define MPU_REGION_SIZE_128MBYTE (0x1AUL) /*!< 128M Byte */ +#define MPU_REGION_SIZE_256MBYTE (0x1BUL) /*!< 256M Byte */ +#define MPU_REGION_SIZE_512MBYTE (0x1CUL) /*!< 512M Byte */ +#define MPU_REGION_SIZE_1GBYTE (0x1DUL) /*!< 1G Byte */ +#define MPU_REGION_SIZE_2GBYTE (0x1EUL) /*!< 2G Byte */ +#define MPU_REGION_SIZE_4GBYTE (0x1FUL) /*!< 4G Byte */ +/** + * @} + */ + +/** + * @defgroup MPU_Flag MPU Flag + * @{ + */ +#define MPU_FLAG_SMPU1EAF (MPU_SR_SMPU1EAF) /*!< System DMA_1 error flag */ +#define MPU_FLAG_SMPU2EAF (MPU_SR_SMPU2EAF) /*!< System DMA_2 error flag */ +#define MPU_FLAG_FMPUEAF (MPU_SR_FMPUEAF) /*!< USBFS_DMA error flag */ +#define MPU_FLAG_HMPUEAF (MPU_SR_HMPUEAF) /*!< USBHS_DMA error flag */ +#define MPU_FLAG_EMPUEAF (MPU_SR_EMPUEAF) /*!< ETH_DMA error flag */ +#define MPU_FLAG_ALL (0x0000001FUL) +/** + * @} + */ + +/** + * @defgroup MPU_IP_Type MPU IP Type + * @note IP access protection is not available in privileged mode. + * @{ + */ +#define MPU_IP_AES (MPU_IPPR_AESRDP) /*!< AES module */ +#define MPU_IP_HASH (MPU_IPPR_HASHRDP) /*!< HASH module */ +#define MPU_IP_TRNG (MPU_IPPR_TRNGRDP) /*!< TRNG module */ +#define MPU_IP_CRC (MPU_IPPR_CRCRDP) /*!< CRC module */ +#define MPU_IP_FMC (MPU_IPPR_FMCRDP) /*!< FMC module */ +#define MPU_IP_WDT (MPU_IPPR_WDTRDP) /*!< WDT module */ +#define MPU_IP_SWDT (MPU_IPPR_SWDTRDP) /*!< SWDT module */ +#define MPU_IP_BKSRAM (MPU_IPPR_BKSRAMRDP) /*!< BKSRAM module */ +#define MPU_IP_RTC (MPU_IPPR_RTCRDP) /*!< RTC module */ +#define MPU_IP_DMPU (MPU_IPPR_DMPURDP) /*!< DMPU module */ +#define MPU_IP_SRAMC (MPU_IPPR_SRAMCRDP) /*!< SRAMC module */ +#define MPU_IP_INTC (MPU_IPPR_INTCRDP) /*!< INTC module */ +#define MPU_IP_SYSC (MPU_IPPR_SYSCRDP) /*!< SYSC module */ +#define MPU_IP_MSTP (MPU_IPPR_MSTPRDP) /*!< MSTP module */ +#define MPU_IP_ALL (0x15555155UL) +/** + * @} + */ + +/** + * @defgroup MPU_IP_Exception_Type MPU IP Exception Type + * @{ + */ +#define MPU_IP_EXP_TYPE_NONE (0UL) /*!< Access to the protected IP will be ignored */ +#define MPU_IP_EXP_TYPE_BUS_ERR (MPU_IPPR_BUSERRE) /*!< Access to the protected IP will trigger a bus error */ +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup MPU_Global_Functions + * @{ + */ + +/** + * @brief MPU write protect unlock. + * @param None + * @retval None + */ +__STATIC_INLINE void MPU_Unlock(void) +{ + WRITE_REG32(M4_MPU->WP, 0x96A5UL); +} + +/** + * @brief MPU write protect lock. + * @param None + * @retval None + */ +__STATIC_INLINE void MPU_Lock(void) +{ + WRITE_REG32(M4_MPU->WP, 0x96A4UL); +} + +void MPU_Unlock(void); +void MPU_Lock(void); + +void MPU_DeInit(void); +en_result_t MPU_Init(const stc_mpu_init_t *pstcMpuInit); +en_result_t MPU_StructInit(stc_mpu_init_t *pstcMpuInit); +void MPU_SetExceptionType(uint32_t u32Unit, uint32_t u32ExceptionType); +void MPU_BackgroundWriteProtectCmd(uint32_t u32Unit, en_functional_state_t enNewState); +void MPU_BackgroundReadProtectCmd(uint32_t u32Unit, en_functional_state_t enNewState); +void MPU_UnitCmd(uint32_t u32Unit, en_functional_state_t enNewState); +en_flag_status_t MPU_GetStatus(uint32_t u32Flag); +void MPU_ClearStatus(uint32_t u32Flag); + +en_result_t MPU_RegionInit(uint32_t u32Num, const stc_mpu_region_init_t *pstcRegionInit); +en_result_t MPU_RegionStructInit(stc_mpu_region_init_t *pstcRegionInit); +void MPU_SetRegionBaseAddr(uint32_t u32Num, uint32_t u32Addr); +void MPU_SetRegionSize(uint32_t u32Num, uint32_t u32Size); +void MPU_RegionWriteProtectCmd(uint32_t u32Num, uint32_t u32Unit, en_functional_state_t enNewState); +void MPU_RegionReadProtectCmd(uint32_t u32Num, uint32_t u32Unit, en_functional_state_t enNewState); +void MPU_RegionCmd(uint32_t u32Num, uint32_t u32Unit, en_functional_state_t enNewState); + +void MPU_IP_SetExceptionType(uint32_t u32ExceptionType); +void MPU_IP_WriteProtectCmd(uint32_t u32Peripheral, en_functional_state_t enNewState); +void MPU_IP_ReadProtectCmd(uint32_t u32Peripheral, en_functional_state_t enNewState); + +/** + * @} + */ + +#endif /* DDL_MPU_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_MPU_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_nfc.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_nfc.h new file mode 100644 index 0000000000..6fbd2cd375 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_nfc.h @@ -0,0 +1,635 @@ +/** + ******************************************************************************* + * @file hc32f4a0_nfc.h + * @brief This file contains all the functions prototypes of the EXMC NFC + * (External Memory Controller: NAND Flash Controller) driver library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Hongjh First version + 2020-07-14 Hongjh 1. Merge API from EXMC_NFC_Enable/Disable to EXMC_NFC_Cmd + 2. Merge API from EXMC_NFC_Enable/DisableEcc + to EXMC_NFC_EccCmd + 3. Merge API from EXMC_NFC_Enable/DisableWriteProtect + to EXMC_NFC_WriteProtectCmd + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_NFC_H__ +#define __HC32F4A0_NFC_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_EXMC_NFC + * @{ + */ + +#if (DDL_NFC_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup EXMC_NFC_Global_Types NAND Flash Controller Global Types + * @{ + */ + +/** + * @brief EXMC SMC Chip Configuration Structure definition + */ +typedef struct +{ + uint32_t u32CapacitySize; /*!< Defines the capacity size. + This parameter can be a value of @ref EXMC_NFC_BANK_Memory_Capacity. */ + + uint32_t u32MemWidth; /*!< Defines the memory width. + This parameter can be a value of @ref EXMC_NFC_Memory_Width. */ + + uint32_t u32BankNum; /*!< Defines the bank number. + This parameter can be a value of @ref EXMC_NFC_Bank_Number */ + + uint32_t u32PageSize; /*!< Defines the page size. + This parameter can be a value of @ref EXMC_NFC_Page_Size. */ + + uint32_t u32WrProtect; /*!< Defines the write protect. + This parameter can be a value of @ref EXMC_NFC_Write_Protect. */ + + uint32_t u32EccMode; /*!< Defines the ECC mode. + This parameter can be a value of @ref EXMC_NFC_ECC_Mode. */ + + uint32_t u32RowAddrCycle; /*!< Defines the row address cycle. + This parameter can be a value of @ref EXMC_NFC_Row_Address_Cycle. */ + + uint8_t u8SpareSizeForUserData; /*!< Defines the spare column size for user data. + This parameter can be a value between Min_Data = 0 and Max_Data = 0xFF */ +}stc_exmc_nfc_base_cfg_t; + +/** + * @brief EXMC NFC Timing Register 0 Configuration Structure definition + */ +typedef struct +{ + uint32_t u32TS; /*!< Defines the CLE/ALE/CE setup time in memory clock cycles(tALS/tCS/tCLS). + This parameter can be a value between Min_Data = 0 and Max_Data = 0xFF */ + + uint32_t u32TWP; /*!< Defines the WE# pulse width time in memory clock cycles(tWP). + This parameter can be a value between Min_Data = 0 and Max_Data = 0xFF */ + + uint32_t u32TRP; /*!< Defines the RE# pulse width time in memory clock cycles(tRP). + This parameter can be a value between Min_Data = 0 and Max_Data = 0xFF */ + + uint32_t u32TH; /*!< Defines the CLE/ALE/CE hold time in memory clock cycles(tALH/tCH/tCLH). + This parameter can be a value between Min_Data = 0 and Max_Data = 0xFF */ +} stc_exmc_nfc_cfg_timing_reg0_t; + +/** + * @brief EXMC NFC Timing Register 1 Configuration Structure definition + */ +typedef struct +{ + uint32_t u32TWH; /*!< Defines the WE# pulse width HIGH time in memory clock cycles(tWH). + This parameter can be a value between Min_Data = 0 and Max_Data = 0xFF */ + + uint32_t u32TRH; /*!< Defines the RE# HIGH hold time in memory clock cycles(tREH). + This parameter can be a value between Min_Data = 0 and Max_Data = 0xFF */ + + uint32_t u32TRR; /*!< Defines the Ready to RE# LOW time in memory clock cycles(tRR). + This parameter can be a value between Min_Data = 0 and Max_Data = 0xFF */ + + uint32_t u32TWB; /*!< Defines the WE# HIGH to busy time in memory clock cycles(tWB). + This parameter can be a value between Min_Data = 0 and Max_Data = 0xFF */ +} stc_exmc_nfc_cfg_timing_reg1_t; + +/** + * @brief EXMC NFC Timing Register 2 Configuration Structure definition + */ +typedef struct +{ + uint32_t u32TCCS; /*!< Defines the command(change read/write column) delay time in memory clock cycles. + This parameter can be a value between Min_Data = 0 and Max_Data = 0xFF */ + + uint32_t u32TWTR; /*!< Defines the WE# HIGH to RE# LOW time in memory clock cycles(tWHR). + This parameter can be a value between Min_Data = 0 and Max_Data = 0xFF */ + + uint32_t u32TRTW; /*!< Defines the RE# HIGH to WE# LOW time in memory clock cycles(tRHW). + This parameter can be a value between Min_Data = 0 and Max_Data = 0xFF */ + + uint32_t u32TADL; /*!< Defines the Address to Data Loading time in memory clock cycles(tADL). + This parameter can be a value between Min_Data = 0 and Max_Data = 0xFF */ +} stc_exmc_nfc_cfg_timing_reg2_t; + +/** + * @brief EXMC NFC Initialization Structure definition + */ +typedef struct +{ + uint32_t u32OpenPage; /*!< NFC memory open-page selection. + This structure details refer @ref EXMC_NFC_Open_Page. */ + + stc_exmc_nfc_base_cfg_t stcBaseCfg; /*!< NFC memory base configure. + This structure details refer @ref stc_exmc_nfc_base_cfg_t. */ + + stc_exmc_nfc_cfg_timing_reg0_t stcTimingReg0; /*!< NFC memory timing configure 0. + This structure details refer @ref stc_exmc_nfc_cfg_timing_reg0_t. */ + + stc_exmc_nfc_cfg_timing_reg1_t stcTimingReg1; /*!< NFC memory timing configure 1. + This structure details refer @ref stc_exmc_nfc_cfg_timing_reg1_t. */ + + stc_exmc_nfc_cfg_timing_reg2_t stcTimingReg2; /*!< NFC memory timing configure 2. + This structure details refer @ref stc_exmc_nfc_cfg_timing_reg2_t. */ +} stc_exmc_nfc_init_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup EXMC_NFC_Global_Macros NAND Flash Controller Global Macros + * @{ + */ + +/** + * @defgroup EXMC_NFC_Bank EXMC NFC Bank + * @{ + */ +#define EXMC_NFC_BANK_0 (0UL) /*!< Bank 0 */ +#define EXMC_NFC_BANK_1 (1UL) /*!< Bank 1 */ +#define EXMC_NFC_BANK_2 (2UL) /*!< Bank 2 */ +#define EXMC_NFC_BANK_3 (3UL) /*!< Bank 3 */ +#define EXMC_NFC_BANK_4 (4UL) /*!< Bank 4 */ +#define EXMC_NFC_BANK_5 (5UL) /*!< Bank 5 */ +#define EXMC_NFC_BANK_6 (6UL) /*!< Bank 6 */ +#define EXMC_NFC_BANK_7 (7UL) /*!< Bank 7 */ +/** + * @} + */ + +/** + * @defgroup EXMC_NFC_Memory_Command EXMC NFC Memory Command + * @{ + */ +#define EXMC_NFC_CMD_READ_1ST (0x00UL) +#define EXMC_NFC_CMD_READ_2ND (0xE0UL) + +#define EXMC_NFC_CMD_COPYBACK_READ_1ST (0x00UL) +#define EXMC_NFC_CMD_COPYBACK_READ_2ND (0x35UL) + +#define EXMC_NFC_CMD_CHANGE_RD_COL_1ST (0x05UL) +#define EXMC_NFC_CMD_CHANGE_RD_COL_2ND (0xE0UL) + +#define EXMC_NFC_CMD_CHANGE_RD_COL_ENHANCED_1ST (0x06UL) +#define EXMC_NFC_CMD_CHANGE_RD_COL_ENHANCED_2ND (0xE0UL) + +#define EXMC_NFC_CMD_READ_CACHE_RANDOM_1ST (0x00UL) +#define EXMC_NFC_CMD_READ_CACHE_RANDOM_2ND (0x31UL) + +#define EXMC_NFC_CMD_CALCULATE_ECC (0x23UL) + +#define EXMC_NFC_CMD_READ_CACHE_SEQ (0x31UL) + +#define EXMC_NFC_CMD_READ_CACHE_END (0x3FUL) + +#define EXMC_NFC_CMD_BLK_ERASE_1ST (0x60UL) +#define EXMC_NFC_CMD_BLK_ERASE_2ND (0xD0UL) + +#define EXMC_NFC_CMD_BLK_ERASE_INTERLEAVED_1ST (0x60UL) +#define EXMC_NFC_CMD_BLK_ERASE_INTERLEAVED_2ND (0xD1UL) + +#define EXMC_NFC_CMD_READ_STATUS (0x70UL) + +#define EXMC_NFC_CMD_READ_STATUS_ENHANCED (0x78UL) + +#define EXMC_NFC_CMD_PAGE_PROGRAM_1ST (0x80UL) +#define EXMC_NFC_CMD_PAGE_PROGRAM_2ND (0x10UL) + +#define EXMC_NFC_CMD_PAGE_PROGRAM_INTERLEAVED_1ST (0x80UL) +#define EXMC_NFC_CMD_PAGE_PROGRAM_INTERLEAVED_2ND (0x11UL) + +#define EXMC_NFC_CMD_PAGE_CACHE_PROGRAM_1ST (0x80UL) +#define EXMC_NFC_CMD_PAGE_CACHE_PROGRAM_2ND (0x15UL) + +#define EXMC_NFC_CMD_COPYBACK_PROGRAM_1ST (0x85UL) +#define EXMC_NFC_CMD_COPYBACK_PROGRAM_2ND (0x10UL) + +#define EXMC_NFC_CMD_COPYBACK_PROGRAM_INTERLEAVED_1ST (0x85UL) +#define EXMC_NFC_CMD_COPYBACK_PROGRAM_INTERLEAVED_2ND (0x11UL) + +#define EXMC_NFC_CMD_CHANGE_WR_COL (0x85UL) + +#define EXMC_NFC_CMD_CHANGE_ROW_ADDRESS (0x85UL) + +#define EXMC_NFC_CMD_READ_ID (0x90UL) + +#define EXMC_NFC_CMD_READ_PARAMETER_PAGE (0xECUL) + +#define EXMC_NFC_CMD_READ_UNIQUE_ID (0xEDUL) + +#define EXMC_NFC_CMD_GET_FEATURES (0xEEUL) + +#define EXMC_NFC_CMD_SET_FEATURES (0xEFUL) + +#define EXMC_NFC_CMD_RESET_LUN (0xFAUL) + +#define EXMC_NFC_CMD_ASYNCHRONOUS_RESSET (0xFCUL) + +#define EXMC_NFC_CMD_DESELECT_CHIP (0xFEUL) + +#define EXMC_NFC_CMD_RESET (0xFFUL) +/** + * @} + */ + +/** + * @defgroup EXMC_NFC_Page_Size EXMC NFC Page Size + * @{ + */ +#define EXMC_NFC_PAGE_SIZE_2KBYTES (NFC_BACR_PAGE_0) +#define EXMC_NFC_PAGE_SIZE_4KBYTES (NFC_BACR_PAGE_1) +#define EXMC_NFC_PAGE_SIZE_8KBYTES (NFC_BACR_PAGE) +/** + * @} + */ + +/** + * @defgroup EXMC_NFC_BANK_Memory_Capacity EXMC NFC BANK Memory Capacity + * @{ + */ +#define EXMC_NFC_BANK_CAPACITY_512MBIT (NFC_BACR_SIZE_1 | NFC_BACR_SIZE_0) +#define EXMC_NFC_BANK_CAPACITY_1GBIT (NFC_BACR_SIZE_2) +#define EXMC_NFC_BANK_CAPACITY_2GBIT (NFC_BACR_SIZE_2 | NFC_BACR_SIZE_0) +#define EXMC_NFC_BANK_CAPACITY_4GBIT (NFC_BACR_SIZE_2 | NFC_BACR_SIZE_1) +#define EXMC_NFC_BANK_CAPACITY_8GBIT (NFC_BACR_SIZE) +#define EXMC_NFC_BANK_CAPACITY_16GBIT (0UL) +#define EXMC_NFC_BANK_CAPACITY_32GBIT (NFC_BACR_SIZE_0) +#define EXMC_NFC_BANK_CAPACITY_64GBIT (NFC_BACR_SIZE_1) +/** + * @} + */ + +/** + * @defgroup EXMC_NFC_Memory_Width EXMC NFC Memory Width + * @{ + */ +#define EXMC_NFC_MEMORY_WIDTH_8BIT (0UL) +#define EXMC_NFC_MEMORY_WIDTH_16BIT (NFC_BACR_B16BIT) +/** + * @} + */ + +/** + * @defgroup EXMC_NFC_Bank_Number EXMC NFC Bank Number + * @{ + */ +#define EXMC_NFC_1_BANK (0UL) +#define EXMC_NFC_2_BANKS (NFC_BACR_BANK_0) +#define EXMC_NFC_4_BANKS (NFC_BACR_BANK_1) +#define EXMC_NFC_8_BANKS (NFC_BACR_BANK) +/** + * @} + */ + +/** + * @defgroup EXMC_NFC_Open_Page EXMC NFC Open Page + * @{ + */ +#define EXMC_NFC_OPEN_PAGE_DISABLE (0UL) +#define EXMC_NFC_OPEN_PAGE_ENABLE (PERIC_NFC_SYCTLREG_OPO) +/** + * @} + */ + +/** + * @defgroup EXMC_NFC_Write_Protect EXMC NFC Write Protect + * @{ + */ +#define EXMC_NFC_WR_PROTECT_ENABLE (0UL) +#define EXMC_NFC_WR_PROTECT_DISABLE (NFC_BACR_WP) +/** + * @} + */ + +/** + * @defgroup EXMC_NFC_ECC_Mode EXMC NFC ECC Mode + * @{ + */ +#define EXMC_NFC_ECC_1BIT (0UL) +#define EXMC_NFC_ECC_4BITS (NFC_BACR_ECCM_0) +/** + * @} + */ + +/** + * @defgroup EXMC_NFC_Row_Address_Cycle EXMC NFC Row Address Cycle + * @{ + */ +#define EXMC_NFC_2_ROW_ADDRESS_CYCLES (0UL) +#define EXMC_NFC_3_ROW_ADDRESS_CYCLES (NFC_BACR_RAC) +/** + * @} + */ + +/** + * @defgroup EXMC_NFC_Interrupt EXMC NFC Interrupt + * @{ + */ +#define EXMC_NFC_INT_ECC_UNCORRECTABLE_ERROR (NFC_IENR_ECCEUEN) +#define EXMC_NFC_INT_ECC_CORRECTABLE_ERROR (NFC_IENR_ECCECEN) +#define EXMC_NFC_INT_ECC_CALC_COMPLETION (NFC_IENR_ECCCEN) +#define EXMC_NFC_INT_ECC_ERROR (NFC_IENR_ECCEEN) +#define EXMC_NFC_INT_RB_BANK0 (NFC_IENR_RBEN_0) +#define EXMC_NFC_INT_RB_BANK1 (NFC_IENR_RBEN_1) +#define EXMC_NFC_INT_RB_BANK2 (NFC_IENR_RBEN_2) +#define EXMC_NFC_INT_RB_BANK3 (NFC_IENR_RBEN_3) +#define EXMC_NFC_INT_RB_BANK4 (NFC_IENR_RBEN_4) +#define EXMC_NFC_INT_RB_BANK5 (NFC_IENR_RBEN_5) +#define EXMC_NFC_INT_RB_BANK6 (NFC_IENR_RBEN_6) +#define EXMC_NFC_INT_RB_BANK7 (NFC_IENR_RBEN_7) +/** + * @} + */ + +/** + * @defgroup EXMC_NFC_Flag EXMC NFC Flag + * @{ + */ +#define EXMC_NFC_FLAG_ECC_UNCORRECTABLE_ERROR (NFC_ISTR_ECCEUST) +#define EXMC_NFC_FLAG_ECC_CORRECTABLE_ERROR (NFC_ISTR_ECCECST) +#define EXMC_NFC_FLAG_ECC_CALC_COMPLETION (NFC_ISTR_ECCCST) +#define EXMC_NFC_FLAG_ECC_ERROR (NFC_ISTR_ECCEST) +#define EXMC_NFC_FLAG_RB_BANK0 (NFC_ISTR_RBST_0) +#define EXMC_NFC_FLAG_RB_BANK1 (NFC_ISTR_RBST_1) +#define EXMC_NFC_FLAG_RB_BANK2 (NFC_ISTR_RBST_2) +#define EXMC_NFC_FLAG_RB_BANK3 (NFC_ISTR_RBST_3) +#define EXMC_NFC_FLAG_RB_BANK4 (NFC_ISTR_RBST_4) +#define EXMC_NFC_FLAG_RB_BANK5 (NFC_ISTR_RBST_5) +#define EXMC_NFC_FLAG_RB_BANK6 (NFC_ISTR_RBST_6) +#define EXMC_NFC_FLAG_RB_BANK7 (NFC_ISTR_RBST_7) +#define EXMC_NFC_FLAG_ECC_CALCULATING (NFC_ISTR_RESV) +/** + * @} + */ + +/** + * @defgroup EXMC_NFC_ECC_Calculate_Bytes EXMC NFC ECC Calculate Bytes + * @{ + */ +#define EXMC_NFC_ECC_CALCULATE_BLOCK_BYTES (512UL) +/** + * @} + */ + +/** + * @defgroup EXMC_NFC_ECC_Value_Bytes EXMC NFC ECC Value Bytes + * @{ + */ +#define EXMC_NFC_1BIT_ECC_VALUE_BYTES (0x03UL) +/** + * @} + */ + +/** + * @defgroup EXMC_NFC_1Bit_ECC_Result EXMC NFC 1Bit ECC Result + * @{ + */ +#define EXMC_NFC_1BIT_ECC_SINGLE_BIT_ERR (NFC_ECCR_SE) +#define EXMC_NFC_1BIT_ECC_MULTIPLE_BITS_ERR (NFC_ECCR_ME) +#define EXMC_NFC_1BIT_ECC_ERR_LOCATION (NFC_ECCR_ERRLOC) +/** + * @} + */ + +/** + * @defgroup EXMC_NFC_1Bit_ECC_Error_Location_Position EXMC NFC 1Bit ECC Error Location Position + * @{ + */ +#define EXMC_NFC_1BIT_ECC_ERR_BIT_POS (NFC_ECCR_ERRLOC_POS) +#define EXMC_NFC_1BIT_ECC_ERR_BYTE_POS (NFC_ECCR_ERRLOC_POS + 3UL) +/** + * @} + */ + +/** + * @defgroup EXMC_NFC_ECC_Section EXMC NFC ECC Section + * @{ + */ +#define EXMC_NFC_ECC_SECTION0 (0UL) +#define EXMC_NFC_ECC_SECTION1 (1UL) +#define EXMC_NFC_ECC_SECTION2 (2UL) +#define EXMC_NFC_ECC_SECTION3 (3UL) +#define EXMC_NFC_ECC_SECTION4 (4UL) +#define EXMC_NFC_ECC_SECTION5 (5UL) +#define EXMC_NFC_ECC_SECTION6 (6UL) +#define EXMC_NFC_ECC_SECTION7 (7UL) +#define EXMC_NFC_ECC_SECTION8 (8UL) +#define EXMC_NFC_ECC_SECTION9 (9UL) +#define EXMC_NFC_ECC_SECTION10 (10UL) +#define EXMC_NFC_ECC_SECTION11 (11UL) +#define EXMC_NFC_ECC_SECTION12 (12UL) +#define EXMC_NFC_ECC_SECTION13 (13UL) +#define EXMC_NFC_ECC_SECTION14 (14UL) +#define EXMC_NFC_ECC_SECTION15 (15UL) +/** + * @} + */ + +/** + * @defgroup EXMC_NFC_Operation_Timeout EXMC NFC Operation Timeout + * @{ + */ +#define EXMC_NFC_MAX_TIMEOUT (0xFFFFFFFFUL) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup EXMC_NFC_Global_Functions + * @{ + */ + +/** + * @brief Set EXMC NFC command register value. + * @param [in] u32Val The combination value of command and arguments. + * @retval None + */ +__STATIC_INLINE void EXMC_NFC_WriteCmdReg(uint32_t u32Val) +{ + WRITE_REG32(M4_NFC->CMDR, u32Val); +} + +/** + * @brief Set EXMC NFC Index register value. + * @param [in] u32Val The value of NFC_IDXR0. + * This parameter can be a value between Min_Data = 0 and Max_Data = 0xFFFFFFFF + * @retval None + */ +__STATIC_INLINE void EXMC_NFC_WriteIDXR0(uint32_t u32Val) +{ + WRITE_REG32(M4_NFC->IDXR0, u32Val); +} + +/** + * @brief Set EXMC NFC Index register value. + * @param [in] u32Val The value of NFC_IDXR1. + * This parameter can be a value between Min_Data = 0 and Max_Data = 0xFF + * @retval None + */ +__STATIC_INLINE void EXMC_NFC_WriteIDXR1(uint32_t u32Val) +{ + WRITE_REG32(M4_NFC->IDXR1, u32Val); +} + +/** + * @brief De-select NFC bank. + * @param None + * @retval None + */ +__STATIC_INLINE void EXMC_NFC_DeselectChip(void) +{ + WRITE_REG32(M4_NFC->CMDR, EXMC_NFC_CMD_DESELECT_CHIP); +} + +/** + * @brief Get the 4BIT ECC error section. + * @param None + * @retval The register value + */ +__STATIC_INLINE uint32_t EXMC_NFC_GetEcc4BitsErrSection(void) +{ + return READ_REG32(M4_NFC->ECC_STAT); +} + +/* Initialization and configuration EXMC NFC functions */ +en_result_t EXMC_NFC_Init(const stc_exmc_nfc_init_t *pstcInit); +void EXMC_NFC_DeInit(void); +en_result_t EXMC_NFC_StructInit(stc_exmc_nfc_init_t *pstcInit); +void EXMC_NFC_Cmd(en_functional_state_t enNewState); +void EXMC_NFC_EccCmd(en_functional_state_t enNewState); +void EXMC_NFC_WriteProtectCmd(en_functional_state_t enNewState); +void EXMC_NFC_IntCmd(uint16_t u16IntSource, en_functional_state_t enNewState); +en_flag_status_t EXMC_NFC_GetStatus(uint32_t u32Flag); +void EXMC_NFC_ClearStatus(uint32_t u32Flag); +en_flag_status_t EXMC_NFC_GetIntResultStatus(uint32_t u32Flag); +uint32_t EXMC_NFC_GetEcc1BitResult(uint32_t u32Section); +en_result_t EXMC_NFC_GetSyndrome(uint32_t u32Section, + uint16_t au16Synd[], + uint8_t u8Length); +void EXMC_NFC_SetSpareAreaSize(uint8_t u8SpareSizeForUserData); +void EXMC_NFC_SetEccMode(uint32_t u32EccMode); + +/* EXMC NFC command functions */ +uint32_t EXMC_NFC_ReadStatus(uint32_t u32Bank); +uint32_t EXMC_NFC_ReadStatusEnhanced(uint32_t u32Bank, + uint32_t u32RowAddress); +en_result_t EXMC_NFC_Reset(uint32_t u32Bank, uint32_t u32Timeout); +en_result_t EXMC_NFC_AsyncReset(uint32_t u32Bank, uint32_t u32Timeout); +en_result_t EXMC_NFC_ResetLun(uint32_t u32Bank, + uint32_t u32RowAddress, + uint32_t u32Timeout); +en_result_t EXMC_NFC_ReadId(uint32_t u32Bank, + uint32_t u32IdAddr, + uint8_t au8DevId[], + uint32_t u32NumBytes, + uint32_t u32Timeout); +en_result_t EXMC_NFC_ReadUniqueId(uint32_t u32Bank, + uint32_t u32IdAddr, + uint32_t au32UniqueId[], + uint8_t u8NumWords, + uint32_t u32Timeout); +en_result_t EXMC_NFC_ReadParameterPage(uint32_t u32Bank, + uint32_t au32Data[], + uint16_t u16NumWords, + uint32_t u32Timeout); +en_result_t EXMC_NFC_SetFeature(uint32_t u32Bank, + uint8_t u8FeatrueAddr, + const uint32_t au32Data[], + uint8_t u8NumWords, + uint32_t u32Timeout); +en_result_t EXMC_NFC_GetFeature(uint32_t u32Bank, + uint8_t u8FeatrueAddr, + uint32_t au32Data[], + uint8_t u8NumWords, + uint32_t u32Timeout); +en_result_t EXMC_NFC_EraseBlock(uint32_t u32Bank, + uint32_t u32RowAddress, + uint32_t u32Timeout); +en_result_t EXMC_NFC_ReadPageMeta(uint32_t u32Bank, + uint32_t u32Page, + uint8_t *pu8Data, + uint32_t u32NumBytes, + uint32_t u32Timeout); +en_result_t EXMC_NFC_WritePageMeta(uint32_t u32Bank, + uint32_t u32Page, + const uint8_t *pu8Data, + uint32_t u32NumBytes, + uint32_t u32Timeout); +en_result_t EXMC_NFC_ReadPageHwEcc(uint32_t u32Bank, + uint32_t u32Page, + uint8_t *pu8Data, + uint32_t u32NumBytes, + uint32_t u32Timeout); +en_result_t EXMC_NFC_WritePageHwEcc(uint32_t u32Bank, + uint32_t u32Page, + const uint8_t *pu8Data, + uint32_t u32NumBytes, + uint32_t u32Timeout); +/** + * @} + */ + +#endif /* DDL_NFC_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_NFC_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_ots.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_ots.h new file mode 100644 index 0000000000..dcc05dfcee --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_ots.h @@ -0,0 +1,212 @@ +/** + ******************************************************************************* + * @file hc32f4a0_ots.h + * @brief This file contains all the functions prototypes of the OTS driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Wuze First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_OTS_H__ +#define __HC32F4A0_OTS_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_OTS + * @{ + */ + +#if (DDL_OTS_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup OTS_Global_Types OTS Global Types + * @{ + */ + +/** + * @brief Conditions for default parameters(slope K and offset M). + * @note 'u8T1' CANNOT equal 'u8T2'. + */ +typedef struct +{ + uint16_t u16ClkFreq; /*!< Frequency(MHz) of clock sources that OTS is going to use. */ + uint8_t u8T1; /*!< Temperature value T1 for the default parameter. + This parameter can be a value of @ref OTS_Temp_Condition */ + uint8_t u8T2; /*!< Temperature value T2 for the default parameter. + This parameter can be a value of @ref OTS_Temp_Condition */ +} stc_para_cond_t; + +/** + * @brief OTS initialization structure. + */ +typedef struct +{ + uint16_t u16ClkSrc; /*!< Specifies clock source for OTS. + This parameter can be a value of @ref OTS_Clock_Source */ + float32_t f32SlopeK; /*!< K: Temperature slope (calculated by calibration experiment). \ + When you want to use the default parameters(slope K and offset M), specify it as ZERO. */ + float32_t f32OffsetM; /*!< M: Temperature offset (calculated by calibration experiment). \ + When you want to use the default parameters(slope K and offset M), specify it as ZERO. */ + uint16_t u16AutoOffEn; /*!< OTS automatic-off function control. + This parameter can be a value of @ref OTS_Automatic_Off_Ctrl */ + stc_para_cond_t stcParaCond; /*!< Specify the conditions when you want to use the default parameters(slope K and offset M). */ +} stc_ots_init_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup OTS_Global_Macros OTS Global Macros + * @{ + */ + +/** + * @defgroup OTS_Clock_Source OTS Clock Source + * @{ + */ +#define OTS_CLK_XTAL (0x0U) /*!< Select XTAL as OTS clock. */ +#define OTS_CLK_HRC (OTS_CTL_OTSCK) /*!< Select HRC as OTS clock */ +/** + * @} + */ + +/** + * @defgroup OTS_Automatic_Off_Ctrl OTS Automatic Off Control + * @{ + */ +#define OTS_AUTO_OFF_DISABLE (0x0U) +#define OTS_AUTO_OFF_ENABLE (OTS_CTL_TSSTP) +/** + * @} + */ + +/** + * @defgroup OTS_Temp_Condition OTS Temperature Condition For Default Parameters(slope K and offset M) + * @{ + */ +#define OTS_COND_TN40 (0U) /*!< -40 degrees Celsius. */ +#define OTS_COND_T25 (1U) /*!< 25 degrees Celsius. */ +#define OTS_COND_T125 (2U) /*!< 125 degrees Celsius. */ +/** + * @} + */ + +/** + * @defgroup OTS_Common_Trigger_Sel OTS Common Trigger Source Select + * @{ + */ +#define OTS_COM_TRIG1 (AOS_OTS_TRG_COMTRG_EN_0) +#define OTS_COM_TRIG2 (AOS_OTS_TRG_COMTRG_EN_1) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup OTS_Global_Functions + * @{ + */ + +/** + * @brief Start OTS. + * @param None + * @retval None + */ +__STATIC_INLINE void OTS_Start(void) +{ + bM4_OTS->CTL_b.OTSST = (uint32_t)1U; +} + +/** + * @brief Stop OTS. + * @param None + * @retval None + */ +__STATIC_INLINE void OTS_Stop(void) +{ + bM4_OTS->CTL_b.OTSST = (uint32_t)0U; +} + +en_result_t OTS_Init(const stc_ots_init_t *pstcInit); +en_result_t OTS_StructInit(stc_ots_init_t *pstcInit); +void OTS_DeInit(void); + +en_result_t OTS_Polling(float32_t *pf32Temp, uint32_t u32Timeout); + +void OTS_IntCmd(en_functional_state_t enNewState); +void OTS_SetTriggerSrc(en_event_src_t enEvent); +void OTS_ComTriggerCmd(uint32_t u32ComTrig, en_functional_state_t enNewState); + +en_result_t OTS_ScalingExperiment(uint16_t *pu16Dr1, uint16_t *pu16Dr2, \ + uint16_t *pu16Ecr, float32_t *pf32A, \ + uint32_t u32Timeout); + +float OTS_CalculateTemp(void); + +/** + * @} + */ + +#endif /* DDL_OTS_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_OTS_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_pwc.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_pwc.h new file mode 100644 index 0000000000..4d40971440 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_pwc.h @@ -0,0 +1,630 @@ +/** + ******************************************************************************* + * @file hc32f4a0_pwc.h + * @brief This file contains all the functions prototypes of the PWC driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Zhangxl First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_PWC_H__ +#define __HC32F4A0_PWC_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_PWC + * @{ + */ + +#if (DDL_PWC_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup PWC_Global_Types PWC Global Types + * @{ + */ +typedef struct +{ + uint32_t u32RamCtrl; /*!< Internal RAM power setting. */ + uint32_t u32PRamCtrl; /*!< Peripheral RAM power setting. */ + uint16_t u16RamMode; /*!< RAM setting for Operating mode, @ref PWC_RAM_Config for details */ +} stc_pwc_ram_config_t; + +typedef struct +{ + uint8_t u8PvdEn; /*!< PVD function setting, @ref PWC_PVD_Config for details */ + uint8_t u8Pvd2ExtInEn; /*!< PVD2 ext. pin input function setting, @ref PWC_PVD2_ExtIn_Config */ + uint8_t u8PvdCmpOutEn; /*!< PVD compare output function setting, @ref PWC_PVD_CMP_Config for details */ + uint8_t u8PvdIntRstSel; /*!< PVD interrupt or reset selection, @ref PWC_PVD_IntRst_Sel for details */ + uint8_t u8PvdIntRstEn; /*!< PVD interrupt or reset function setting, @ref PWC_PVD_IR_Config for details */ + uint8_t u8FilterEn; /*!< PVD digital filter function setting, @ref PWC_PVD_DF_Config for details */ + uint8_t u8FilterClk; /*!< PVD digital filter clock setting, @ref PWC_PVD_DFS_Clk_Sel for details */ + uint8_t u8PvdVoltage; /*!< PVD detect voltage setting, @ref PWC_PVD_detection_Vol for details */ + uint8_t u8PvdNmiEn; /*!< PVD NMI function setting, @ref PWC_PVD_Int_Mode_Config for details */ + uint8_t u8PvdTrigger; /*!< PVD trigger setting, @ref PWC_PVD_Trigger_Sel for details */ +} stc_pwc_pvd_config_t; + +typedef struct +{ + uint8_t u8PDMode; /*!< Power down mode, @ref PWC_PDMode_Sel for details. */ + uint8_t u8IOState; /*!< IO state in power down mode, @ref PWC_PDMode_IO_Sel for details. */ + uint8_t u8WkUpSpeed; /*!< Wakeup speed selection, @ref PWC_PDMode_WKUP_TIME_Sel for details. */ +}stc_pwc_pd_mode_config_t; + +typedef struct +{ + uint8_t u8StopDrv; /*!< Stop mode drive capacity, @ref PWC_STOP_DRV_Sel for details. */ + uint16_t u16ExBusHold; /*!< Exbus status in stop mode, @ref PWC_STOP_EXBUS_Sel for details. */ + uint16_t u16ClkKeep; /*!< System clock setting after wake-up from stop mode, + @ref PWC_STOP_CLK_Sel for details. */ + uint16_t u16FlashWait; /*!< Waiting flash stable after wake-up from stop mode, + @ref STOP_FLASH_WAIT_Sel for details. */ +} stc_pwc_stop_mode_config; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup PWC_Global_Macros PWC Global Macros + * @{ + */ + +/** + * @defgroup PWC_PDMode_Sel Power down mode selection + * @{ + */ +#define PWC_PD_MODE1 (0x00U) /*!< Power down mode 0 */ +#define PWC_PD_MODE2 (0x01U) /*!< Power down mode 1 */ +#define PWC_PD_MODE3 (0x02U) /*!< Power down mode 2 */ +#define PWC_PD_MODE4 (0x03U) /*!< Power down mode 3 */ +/** + * @} + */ + +/** + * @defgroup PWC_PDMode_IO_Sel IO state config in Power down mode + * @{ + */ +#define PWC_PD_IO_STATE1 (0x00U) /*!< IO state retain in PD mode and configurable after wakeup */ +#define PWC_PD_IO_STATE2 (PWC_PWRC0_IORTN_0) /*!< IO state retain in PD mode and configurable after wakeup & set IORTN[1:0]=00b */ +#define PWC_PD_IO_STATE3 (PWC_PWRC0_IORTN_1) /*!< IO state switch to HiZ */ +/** + * @} + */ + +/** + * @defgroup PWC_STOP_DRV_Sel Drive capacity while enter stop mode + * @{ + */ +#define PWC_STOP_DRV_HIGH (0x00U) /*!< Enter stop mode from high speed mode */ +#define PWC_STOP_DRV_LOW (PWC_PWRC1_STPDAS) /*!< Enter stop mode from ultra low speed mode */ +/** + * @} + */ + +/** + * @defgroup PWC_STOP_EXBUS_Sel ExBus status while enter stop mode + * @{ + */ +#define PWC_STOP_EXBUS_HIZ (0x00U) /*!< Ex-Bus Hiz in stop mode */ +#define PWC_STOP_EXBUS_HOLD (PWC_STPMCR_EXBUSOE) /*!< Ex-Bus keep in stop mode */ +/** + * @} + */ + +/** + * @defgroup PWC_STOP_CLK_Sel System clock setting after wake-up from stop mode + * @{ + */ +#define PWC_STOP_CLK_KEEP (0x00U) /*!< Keep System clock setting after wake-up from stop mode */ +#define PWC_STOP_CLK_MRC (PWC_STPMCR_CKSMRC) /*!< System clock switch to MRC after wake-up from stop mode */ +/** + * @} + */ + +/** + * @defgroup STOP_FLASH_WAIT_Sel Whether wait flash stable or not after wake-up from stop mode + * @{ + */ +#define PWC_STOP_FLASH_WAIT (0x00U) /*!< Wait flash stable after wake-up from stop mode */ +#define PWC_STOP_FLASH_NOWAIT (PWC_STPMCR_FLNWT) /*!< Don't wait flash stable after wake-up from stop mode */ +/** + * @} + */ + +/** + * @defgroup PWC_PWR_DRV_Sel Drive capacity selection + * @{ + */ +#define PWC_NOR_DRV_HIGH (PWC_PWRC2_DVS) /*!< Drive capacity in high speed operation */ +#define PWC_NOR_DRV_LOW (PWC_PWRC2_DVS_1) /*!< Drive capacity in ultra low speed operation */ +/** + * @} + */ + +/** + * @defgroup PWC_PDMode_WKUP_TIME_Sel Wakeup speed config in Power down mode + * @{ + */ +#define PWC_PD_WKUP_SLOW (0x00U) /*!< VCAP1/VCAP2 = 0.1uF x2 or 0.22uF x1 */ +#define PWC_PD_WKUP_FAST (0x01U) /*!< VCAP1/VCAP2 = 0.047uF x2 or 0.1uF x1 */ +/** + * @} + */ + +/** + * @defgroup PWC_RAM_Config Operating mode for RAM Config + * @{ + */ +#define PWC_RAM_HIGH (0x8043U) /*!< MCU operating under high frequency (lower than 240MHz) */ +#define PWC_RAM_LOW (0x9062U) /*!< MCU operating under ultra low frequency (lower than 8MHz) */ +/** + * @} + */ + +/** + * @defgroup PWC_PWMON_Config PWC Power Monitor Config + * @{ + */ +#define PWC_PWRMON_ON (PWC_PWRC_PWMONE) +#define PWC_PWRMON_OFF (0x00U) +/** + * @} + */ + +/** + * @defgroup PWC_PWMON_Sel PWC Power Monitor Selection + * @{ + */ +#define PWC_PWRMON_VINREF (0x00U) /*!< Internal reference voltage */ +#define PWC_PWRMON_VOTS (PWC_PWRC_PWMONSEL) /*!< temperature sensor voltage */ +/** + * @} + */ + +/** + * @defgroup PWC_DRV_Sel PWC Driver ability selection + * @{ + */ +#define PWC_DRV_LOW (0x00U) /*!< system clock = 32kHz */ +#define PWC_DRV_HIGH (0x07U) /*!< system clock < 48Mhz */ +/** + * @} + */ + +/** + * @defgroup PWC_PVD_Channel PWC PVD channel + * @{ + */ +#define PWC_PVD_CH1 (0x00U) +#define PWC_PVD_CH2 (0x01U) +/** + * @} + */ + +/** + * @defgroup PWC_PVD_Config PWC PVD Config + * @{ + */ +#define PWC_PVD_ON (0x01U) +#define PWC_PVD_OFF (0x00U) +/** + * @} + */ + +/** + * @defgroup PWC_PVD2_ExtIn_Config PWC PVD2 external input Config + * @{ + */ +#define PWC_PVD2_EXINP_ON (PWC_PVDCR0_EXVCCINEN) +#define PWC_PVD2_EXINP_OFF (0x00U) +/** + * @} + */ + +/** + * @defgroup PWC_PVD_IR_Config PWC PVD Interrupt/Reset Config + * @{ + */ +#define PWC_PVD_IR_ON (PWC_PVDCR1_PVD1IRE) +#define PWC_PVD_IR_OFF (0x00U) +/** + * @} + */ + +/** + * @defgroup PWC_PVD_IntRst_Sel set PVD to interrupt or reset + * @{ + */ +#define PWC_PVD_INT (0x00U) +#define PWC_PVD_RST (PWC_PVDCR1_PVD1IRS) +/** + * @} + */ + +/** + * @defgroup PWC_PVD_CMP_Config PWC PVD Compare Config + * @{ + */ +#define PWC_PVD_CMP_ON (PWC_PVDCR1_PVD1CMPOE) +#define PWC_PVD_CMP_OFF (0x00U) +/** + * @} + */ + +/** + * @defgroup PWC_PVD_DF_Config PVD digital filter ON or OFF + * @{ + */ +#define PWC_PVD_DF_ON (0x00U) +#define PWC_PVD_DF_OFF (PWC_PVDFCR_PVD1NFDIS) +/** + * @} + */ + +/** + * @defgroup PWC_PVD_DFS_Clk_Sel PVD digital filter sample ability + * @note modified this value must when PWC_PVD_DF_OFF + * @{ + */ +#define PWC_PVD_DFS_DIV4 (0x00U) /*!< 0.25 LRC cycle */ +#define PWC_PVD_DFS_DIV2 (PWC_PVDFCR_PVD1NFCKS_0) /*!< 0.5 LRC cycle */ +#define PWC_PVD_DFS_DIV1 (PWC_PVDFCR_PVD1NFCKS_1) /*!< 1 LRC cycle */ +#define PWC_PVD_DFS_MUL2 (PWC_PVDFCR_PVD1NFCKS) /*!< 2 LRC cycles */ +/** + * @} + */ + +/** + * @defgroup PWC_PVD_detection_Vol PWC PVD Detection voltage + * @{ + */ +#define PWC_PVD1_2V0_PVD2_2V1 (0x00U) /*!< Specifies the voltage of PVD1 is 2.0V or PVD2 is 2.0V. */ +#define PWC_PVD1_2V1_PVD2_2V3 (0x01U) /*!< Specifies the voltage of PVD1 is 2.1V or PVD2 is 2.1V. */ +#define PWC_PVD1_2V3_PVD2_2V5 (0x02U) /*!< Specifies the voltage of PVD1 is 2.3V or PVD2 is 2.3V. */ +#define PWC_PVD1_2V5_PVD2_2V6 (0x03U) /*!< Specifies the voltage of PVD1 is 2.5V or PVD2 is 2.5V. */ +#define PWC_PVD1_2V6_PVD2_2V7 (0x04U) /*!< Specifies the voltage of PVD1 is 2.6V or PVD2 is 2.6V. */ +#define PWC_PVD1_2V7_PVD2_2V8 (0x05U) /*!< Specifies the voltage of PVD1 is 2.7V or PVD2 is 2.7V. */ +#define PWC_PVD1_2V8_PVD2_2V9 (0x06U) /*!< Specifies the voltage of PVD1 is 2.8V or PVD2 is 2.8V. */ +#define PWC_PVD1_2V9_PVD2_1V1 (0x07U) /*!< Specifies the voltage of PVD1 is 2.9V or PVD2 is 1.1V (only ext. input). */ +/** + * @} + */ + +/** + * @defgroup PWC_PVD_Int_Mode_Config PVD interrupt set to maskable or non_maskable + * @{ + */ +#define PWC_PVD_INT_MASK (PWC_PVDICR_PVD1NMIS) +#define PWC_PVD_INT_NONMASK (0x00U) +/** + * @} + */ + +/** + * @defgroup PWC_PVD_Trigger_Sel PVD trigger setting + * @{ + */ +#define PWC_PVD_TRIGGER_FALLING (0x00U) +#define PWC_PVD_TRIGGER_RISING (PWC_PVDICR_PVD1EDGS_0) +#define PWC_PVD_TRIGGER_BOTH (PWC_PVDICR_PVD1EDGS_1) +/** + * @} + */ + +/** + * @defgroup PWC_WKUP_Event_Sel Power down mode wakeup event selection + * @{ + */ +#define PWC_PD_WKUP_TRIG_PVD1 (PWC_PDWKES_VD1EGS) +#define PWC_PD_WKUP_TRIG_PVD2 (PWC_PDWKES_VD2EGS) +#define PWC_PD_WKUP_TRIG_WKP0 (PWC_PDWKES_WK0EGS) +#define PWC_PD_WKUP_TRIG_WKP1 (PWC_PDWKES_WK1EGS) +#define PWC_PD_WKUP_TRIG_WKP2 (PWC_PDWKES_WK2EGS) +#define PWC_PD_WKUP_TRIG_WKP3 (PWC_PDWKES_WK3EGS) +#define PWC_PD_WKUP_TRIG_MASK (PWC_PDWKES_VD1EGS | PWC_PDWKES_VD2EGS | \ + PWC_PDWKES_WK0EGS | PWC_PDWKES_WK1EGS | \ + PWC_PDWKES_WK2EGS | PWC_PDWKES_WK3EGS) +/** + * @} + */ + +/** + * @defgroup PWC_WKUP_Trigger_Edge_Sel Power down mode wakeup trigger edge selection + * @{ + */ +#define PWC_PD_WKUP_FALLING (0x00U) +#define PWC_PD_WKUP_RISING (0x01U) +/** + * @} + */ + +/** + * @defgroup PWC_DBGC_config PWC Debug Config + * @{ + */ +#define PWC_AD_INTERN_REF (0x00U) +#define PWC_AD_VBAT_DIV2 (0x01U) +/** + * @} + */ + +/** + * @defgroup PWC_VBAT_Voltage_Status PWC VBAT Voltage Status + * @{ + */ +#define PWC_VOL_VBAT_MORE_THAN_VBATREF (0x00U) /*!< Vbat > VbatREF */ +#define PWC_VOL_VBAT_LESS_THAN_VBATREF (0x01U) /*!< Vbat < VbatREF */ +/** + * @} + */ + +/** + * @defgroup PWC_VBAT_Reference_Voltage PWC VBAT Reference Voltage + * @{ + */ +#define PWC_VBAT_REF_VOL_1P8V (0x00U) /*!< Vbat reference voltage is 1.8V */ +#define PWC_VBAT_REF_VOL_2P0V (0x01U) /*!< Vbat reference voltage is 2.0V */ +/** + * @} + */ + +/** + * @defgroup PWC_BACKUP_RAM_Flag PWC Backup RAM Flag + * @{ + */ +#define PWC_BACKUP_RAM_FLAG_RAMPDF (PWC_VBATCR_RAMPDF) /*!< Backup RAM power down flag */ +#define PWC_BACKUP_RAM_FLAG_RAMVALID (PWC_VBATCR_RAMVALID) /*!< Backup RAM read/write flag */ +/** + * @} + */ + +/** + * @defgroup PWC_WKT_Clock_Source PWC WKT Clock Source + * @{ + */ +#define PWC_WKT_CLK_SRC_64HZ (0U) /*!< 64Hz Clock */ +#define PWC_WKT_CLK_SRC_XTAL32 (PWC_WKTC2_WKCKS_0) /*!< XTAL32 Clock */ +#define PWC_WKT_CLK_SRC_RTCLRC (PWC_WKTC2_WKCKS_1) /*!< RTCLRC Clock */ +/** + * @} + */ + +/** + * @defgroup PWC_REG_Write_Unlock_Code PWC register unlock code. + * @brief Lock/unlock Code for each module + * PWC_UNLOCK_CODE_0: + * Below registers are locked in CLK module. + * XTALCFGR, XTALSTBCR, XTALCR, XTALSTDCR, XTALSTDSR, HRCTRM, HRCCR, + * MRCTRM, MRCCR, PLLCFGR, PLLCR, UPLLCFGR, UPLLCR, OSCSTBSR, CKSWR, + * SCFGR, UFSCKCFGR, TPIUCKCFGR, MCO1CFGR, MCO2CFGR, XTAL32CR, + * XTALC32CFGR, XTAL32NFR, LRCCR, LRCTRM. + * PWC_UNLOCK_CODE_1: + * Below registers are locked in PWC module. + * PWRC0, PWRC1, PWRC2, PWRC3, PDWKE0, PDWKE1, PDWKE2, PDWKES, PDWKF0, + * PDWKF1, PWCMR, PWR_STPMCR, RAMPC0, RAMOPM. + * Below registers are locked in CLK module. + * PERICKSEL, I2SCKSEL, + * Below register is locked in RMU module. + * RSTF0 + * PWC_UNLOCK_CODE_2: + * Below registers are locked in PWC module. + * PVDCR0, PVDCR1, PVDFCR, PVDLCR, PVDICR, PVDDSR + * @{ + */ +#define PWC_UNLOCK_CODE_0 (0xA501U) +#define PWC_UNLOCK_CODE_1 (0xA502U) +#define PWC_UNLOCK_CODE_2 (0xA508U) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup PWC_Global_Functions + * @{ + */ +/** + * @brief Lock PWC, CLK, RMU register. + * @param [in] u16Module Lock code for each module. + * @arg PWC_UNLOCK_CODE_0: + * Below registers are locked in CLK module. + * XTALCFGR, XTALSTBCR, XTALCR, XTALSTDCR, XTALSTDSR, HRCTRM, HRCCR, + * MRCTRM, MRCCR, PLLCFGR, PLLCR, UPLLCFGR, UPLLCR, OSCSTBSR, CKSWR, + * SCFGR, UFSCKCFGR, TPIUCKCFGR, MCO1CFGR, MCO2CFGR, XTAL32CR, + * XTALC32CFGR, XTAL32NFR, LRCCR, LRCTRM. + * @arg PWC_UNLOCK_CODE_1: + * Below registers are locked in PWC module. + * PWRC0, PWRC1, PWRC2, PWRC3, PDWKE0, PDWKE1, PDWKE2, PDWKES, PDWKF0, + * PDWKF1, PWCMR, PWR_STPMCR, RAMPC0, RAMOPM. + * Below registers are locked in VBAT module. + * RSTR, BATCR0, VBTBKR0~VBTBK127. + * Below registers are locked in CLK module. + * PERICKSEL, I2SCKSEL, + * Below register is locked in RMU module. + * RSTF0 + * @arg PWC_UNLOCK_CODE_2: + * Below registers are locked in PWC module. + * PVDCR0, PVDCR1, PVDFCR, PVDLCR, PVDICR, PVDDSR + * @retval None + */ +__STATIC_INLINE void PWC_Lock(uint16_t u16Module) +{ + M4_PWC->FPRC = (0xA500U | (uint16_t)((uint16_t)(~u16Module) & (M4_PWC->FPRC))); +} + +/** + * @brief Unlock PWC, CLK, RMU register. + * @param [in] u16Module Unlock code for each module. + * @arg PWC_UNLOCK_CODE_0: + * Below registers are unlocked in CLK module. + * XTALCFGR, XTALSTBCR, XTALCR, XTALSTDCR, XTALSTDSR, HRCTRM, HRCCR, + * MRCTRM, MRCCR, PLLCFGR, PLLCR, UPLLCFGR, UPLLCR, OSCSTBSR, CKSWR, + * SCFGR, UFSCKCFGR, TPIUCKCFGR, MCO1CFGR, MCO2CFGR, XTAL32CR, + * XTALC32CFGR, XTAL32NFR, LRCCR, LRCTRM. + * @arg PWC_UNLOCK_CODE_1: + * Below registers are unlocked in PWC module. + * PWRC0, PWRC1, PWRC2, PWRC3, PDWKE0, PDWKE1, PDWKE2, PDWKES, PDWKF0, + * PDWKF1, PWCMR, PWR_STPMCR, RAMPC0, RAMOPM. + * Below registers are unlocked in VBAT module. + * RSTR, BATCR0, VBTBKR0~VBTBK127. + * Below registers are unlocked in CLK module. + * PERICKSEL, I2SCKSEL, + * Below register is unlocked in RMU module. + * RSTF0 + * @arg PWC_UNLOCK_CODE_2: + * Below registers are unlocked in PWC module. + * PVDCR0, PVDCR1, PVDFCR, PVDLCR, PVDICR, PVDDSR + * @retval None + */ +__STATIC_INLINE void PWC_Unlock(uint16_t u16Module) +{ + SET_REG16_BIT(M4_PWC->FPRC, u16Module); +} + +/** + * @brief Lock PWC_FCG0 register . + * @param None + * @retval None + */ +__STATIC_INLINE void PWC_FCG0_Lock(void) +{ + WRITE_REG32(M4_PWC->FCG0PC, 0xA5A50000UL); +} + +/** + * @brief Unlock PWR_FCG0 register. + * @param None + * @retval None + * @note Call this function before PWC_Fcg0PeriphClockCmd() + */ +__STATIC_INLINE void PWC_FCG0_Unlock(void) +{ + WRITE_REG32(M4_PWC->FCG0PC, 0xA5A50001UL); +} + +en_result_t PWC_PowerDownStructInit(stc_pwc_pd_mode_config_t *pstcPDModeConfig); +en_result_t PWC_PowerDownConfig(const stc_pwc_pd_mode_config_t *pstcPDModeConfig); +void PWC_EnterPowerDownMode(void); +void PWC_EnterStopMode(void); +void PWC_EnterSleepMode(void); + +en_result_t PWC_StopStructInit(stc_pwc_stop_mode_config *pstcStopConfig); +en_result_t PWC_StopConfig(const stc_pwc_stop_mode_config *pstcStopConfig); +void PWC_StopDrvConfig(uint8_t u8StopDrv); +void PWC_StopClockKeepConfig(uint16_t u16ClkKeep); +void PWC_StopFlashWaitConfig(uint16_t u16FlashWait); +void PWC_StopExBusHoldConfig(uint16_t u16ExBusHold); + +en_result_t PWC_HighSpeedToLowSpeed(void); +en_result_t PWC_LowSpeedToHighSpeed(void); + +void PWC_HrcPwrCmd(en_functional_state_t enNewState); +void PWC_PllPwrCmd(en_functional_state_t enNewState); + +void PWC_Fcg0PeriphClockCmd(uint32_t u32Fcg0Periph, en_functional_state_t enNewState); +void PWC_Fcg1PeriphClockCmd(uint32_t u32Fcg1Periph, en_functional_state_t enNewState); +void PWC_Fcg2PeriphClockCmd(uint32_t u32Fcg2Periph, en_functional_state_t enNewState); +void PWC_Fcg3PeriphClockCmd(uint32_t u32Fcg3Periph, en_functional_state_t enNewState); + +en_result_t PWC_RamConfig(const stc_pwc_ram_config_t *pstcRamConfig); +en_result_t PWC_PVD_Init(uint8_t u8Ch, const stc_pwc_pvd_config_t *pstcPvdConfig); +en_result_t PWC_PVD_StructInit(stc_pwc_pvd_config_t *pstcPvdConfig); +en_flag_status_t PWC_PVD_GetStatus(uint8_t u8Flag); +void PWC_PVD_ClearStatus(void); + +void PWC_PdWakeup0Cmd(uint8_t u8Wkup0Evt, en_functional_state_t enNewState); +void PWC_PdWakeup1Cmd(uint8_t u8Wkup1Evt, en_functional_state_t enNewState); +void PWC_PdWakeup2Cmd(uint8_t u8Wkup2Evt, en_functional_state_t enNewState); +void PWC_PdWakeupTrigConfig(uint8_t u8WkupEvt, uint8_t u8TrigEdge); +en_flag_status_t PWC_GetWakeup0Status(uint8_t u8Flag); +en_flag_status_t PWC_GetWakeup1Status(uint8_t u8Flag); + +void PWC_AdcBufCmd(en_functional_state_t enNewState); +void PWC_AdcInternVolSel(uint8_t u8AdcInternVol); + +void PWC_VBAT_MonitorVolSel(uint8_t u8RefVol); +void PWC_VBAT_MonitorCmd(en_functional_state_t enNewState); +uint8_t PWC_VBAT_GetVolStatus(void); +void PWC_VBAT_MeasureVolCmd(en_functional_state_t enNewState); +void PWC_VBAT_Reset(void); +void PWC_VBAT_PwrCmd(en_functional_state_t enNewState); + +void PWC_BkRamPwrCmd(en_functional_state_t enNewState); +en_flag_status_t PWC_GetBkRamStatus(uint8_t u8Flag); +void PWC_WriteBackupReg(uint8_t u8RegNum, uint8_t u8RegVal); +uint8_t PWC_ReadBackupReg(uint8_t u8RegNum); + +void PWC_WKT_Init(uint8_t u8ClkSrc, uint16_t u16CmpVal); +void PWC_WKT_SetCompareValue(uint16_t u16CmpVal); +uint16_t PWC_WKT_GetCompareValue(void); +void PWC_WKT_Cmd(en_functional_state_t enNewState); +en_flag_status_t PWC_WKT_GetStatus(void); +void PWC_WKT_ClearStatus(void); + +/** + * @} + */ + +#endif /* DDL_PWC_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_PWC_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_qspi.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_qspi.h new file mode 100644 index 0000000000..d1c435fd99 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_qspi.h @@ -0,0 +1,430 @@ +/** + ******************************************************************************* + * @file hc32f4a0_qspi.h + * @brief This file contains all the functions prototypes of the QSPI driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Wuze First version + 2020-07-15 Wuze Corrected the definition of 'QSPI_4BIC_ENABLE'. + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_QSPI_H__ +#define __HC32F4A0_QSPI_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_QSPI + * @{ + */ + +#if (DDL_QSPI_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup QSPI_Global_Types QSPI Global Types + * @{ + */ + +/** + * @brief QSPI initialization structure. + */ +typedef struct +{ + uint32_t u32ClkDiv; /*!< Specifies the clock divider for QSCK. QSCK = HCLK / u32ClkDiv. + This parameter can be a value between 2U and 64U, inclusive. */ + uint32_t u32CSSetupTiming; /*!< Specifies the setup timing of CS. + This parameter can be a value of @ref QSPI_CS_Setup_Timing */ + uint32_t u32CSReleaseTiming; /*!< Specifies the hold timing of CS. + This parameter can be a value of @ref QSPI_CS_Release_Timing */ + uint32_t u32CSIdleTime; /*!< Specifies the minimum idle time for CS. CS needs idle(stay high) for several cycles between commands. + This parameter can be a value of between 1U and 16U, inclusive. */ + uint32_t u32CSExtendTime; /*!< Extend the time of chip-select signal after SPI bus access. + This parameter can be a value of @ref QSPI_CS_Extend_Time */ + uint32_t u32SPIMode; /*!< Specifies the SPI mode. The difference between SPI modes 0 and 3 is the standby level of the QSCK signal. + The standby level of the QSCK signal in SPI mode 0 is low, and high in SPI mode 3. + This parameter can be a value of @ref QSPI_SPI_Mode */ + uint32_t u32PrefetchCmd; /*!< Enable or disable prefeth function. + This parameter can be a value of @ref QSPI_Prefetch_Cmd */ + uint32_t u32PrefetchStopPos; /*!< Specifies the position of prefetch stop. + This parameter can be a value of @ref QSPI_Prefetch_Stop_Position */ + uint32_t u32WPLevel; /*!< Specifies the level of pin WP(IO2). + This parameter can be a value of @ref QSPI_WP_Level */ + uint32_t u32CommMode; /*!< Specifies the communication mode. + This parameter can be a value of @ref QSPI_Communication_Mode */ + uint32_t u32AddrWidth; /*!< Specifies the address width. + This parameter can be a value of @ref QSPI_Addr_Width */ + uint32_t u32InstrMode; /*!< Specifies the instruction mode. + This parameter can be a value of @ref QSPI_Instruction_Mode */ + uint32_t u32AddrMode; /*!< Specifies the address mode. + This parameter can be a value of @ref QSPI_Addr_Mode */ + uint32_t u32DataMode; /*!< Specifies the data mode (used for dummy cycles and data phases) + This parameter can be a value of @ref QSPI_Data_Mode */ + uint32_t u32ReadMode; /*!< Specifies the read mode. + This parameter can be a value of @ref QSPI_Read_Mode */ + uint8_t u8RomAccessInstr; /*!< Rom access instruction. This parameter only supports read instruction of QSPI flash now. + Tis instruction must correspond to the read mode that specified by parameter 'u32ReadMode'. */ + uint32_t u32DummyCycles; /*!< Specifies the number of dummy cycles for fast read. + This parameter can be a value between 3U and 18U. */ +} stc_qspi_init_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup QSPI_Global_Macros QSPI Global Macros + * @{ + */ + +/** + * @defgroup QSPI_Read_Mode QSPI Read Mode + * @{ + */ +#define QSPI_READ_STANDARD_READ (0x0U) /*!< Standard read mode (no dummy cycles). */ +#define QSPI_READ_FAST_READ (QSPI_CR_MDSEL_0) /*!< Fast read mode (dummy cycles between address and data). */ +#define QSPI_READ_FAST_READ_DUAL_OUTPUT (QSPI_CR_MDSEL_1) /*!< Fast read dual output mode (data on 2 lines). */ +#define QSPI_READ_FAST_READ_DUAL_IO (QSPI_CR_MDSEL_1 | \ + QSPI_CR_MDSEL_0) /*!< Fast read dual I/O mode (address and data on 2 lines). */ +#define QSPI_READ_FAST_READ_QUAD_OUTPUT (QSPI_CR_MDSEL_2) /*!< Fast read quad output mode (data on 4 lines). */ +#define QSPI_READ_FAST_READ_QUAD_IO (QSPI_CR_MDSEL_2 | \ + QSPI_CR_MDSEL_0) /*!< Fast read quad I/O mode (address and data on 4 lines). */ +#define QSPI_READ_CUSTOM_STANDARD_READ (QSPI_CR_MDSEL_2 | \ + QSPI_CR_MDSEL_1) /*!< Custom standard read mode. */ +#define QSPI_READ_CUSTOM_FAST_READ (QSPI_CR_MDSEL_2 | \ + QSPI_CR_MDSEL_1 | \ + QSPI_CR_MDSEL_0) /*!< Custom fast read mode. */ +/** + * @} + */ + +/** + * @defgroup QSPI_Prefetch_Cmd QSPI Prefetch Cmd + * @{ + */ +#define QSPI_PREFETCH_DISABLE (0x0U) /*!< Disable prefetch. */ +#define QSPI_PREFETCH_ENABLE (QSPI_CR_PFE) /*!< Enable prefetch. */ +/** + * @} + */ + +/** + * @defgroup QSPI_Prefetch_Stop_Position QSPI Prefetch Stop Position + * @{ + */ +#define QSPI_PREFETCH_STOP_BYTE_EDGE (0x0U) /*!< Stop prefetch at the edge of byte. */ +#define QSPI_PREFETCH_STOP_IMMED (QSPI_CR_PFSAE) /*!< Stop prefetch at current position immediately. */ +/** + * @} + */ + +/** + * @defgroup QSPI_Communication_Mode QSPI Communication Mode + * @{ + */ +#define QSPI_COMM_ROM_ACCESS (0x0U) /*!< ROM access mode. */ +#define QSPI_COMM_DIRECT_COMM (QSPI_CR_DCOME) /*!< Direct communication mode. */ +/** + * @} + */ + +/** + * @defgroup QSPI_XIP_Mode_Command QSPI XIP Mode Command + * @{ + */ +#define QSPI_XIP_DISABLE (0x0U) /*!< XIP mode disable. */ +#define QSPI_XIP_ENABLE (QSPI_CR_XIPE) /*!< XIP mode enable. */ +/** + * @} + */ + +/** + * @defgroup QSPI_SPI_Mode QSPI SPI Mode + * @{ + */ +#define QSPI_SPI_MODE_0 (0x0U) /*!< Selects SPI mode 0. */ +#define QSPI_SPI_MODE_3 (QSPI_CR_SPIMD3) /*!< Selects SPI mode 3. */ +/** + * @} + */ + +/** + * @defgroup QSPI_Instruction_Mode QSPI Instruction Mode + * @{ + */ +#define QSPI_INSTR_1LINE (0x0U) /*!< Instruction on a single line. */ +#define QSPI_INSTR_2LINE (QSPI_CR_IPRSL_0) /*!< Instruction on 2 lines. */ +#define QSPI_INSTR_4LINE (QSPI_CR_IPRSL_1) /*!< Instruction on 4 lines. */ +/** + * @} + */ + +/** + * @defgroup QSPI_Addr_Mode QSPI Address Mode + * @{ + */ +#define QSPI_ADDR_1LINE (0x0U) /*!< Address on a single line. */ +#define QSPI_ADDR_2LINE (QSPI_CR_APRSL_0) /*!< Address on 2 lines. */ +#define QSPI_ADDR_4LINE (QSPI_CR_APRSL_1) /*!< Address on 4 lines. */ +/** + * @} + */ + +/** + * @defgroup QSPI_Data_Mode QSPI Data Mode + * @{ + */ +#define QSPI_DATA_1LINE (0x0U) /*!< Data on a single line. */ +#define QSPI_DATA_2LINE (QSPI_CR_DPRSL_0) /*!< Data on 2 lines. */ +#define QSPI_DATA_4LINE (QSPI_CR_DPRSL_1) /*!< Data on 4 lines. */ +/** + * @} + */ + +/** + * @defgroup QSPI_CS_Extend_Time QSPI Chip-select Extend Time + * @{ + */ +#define QSPI_CS_EXTEND_0CYCLE (0x0U) /*!< Do not extend chip-select signal time. */ +#define QSPI_CS_EXTEND_32CYCLE (QSPI_CSCR_SSNW_0) /*!< Extend chip-select time by 32 QSCK cycles. */ +#define QSPI_CS_EXTEND_128CYCLE (QSPI_CSCR_SSNW_1) /*!< Extend chip-select time by 128 QSCK cycles. */ +#define QSPI_CS_EXTEND_INFINITE (QSPI_CSCR_SSNW_1 | \ + QSPI_CSCR_SSNW_0) /*!< Extend chip-select time infinitely. */ +/** + * @} + */ + +/** + * @defgroup QSPI_Addr_Width QSPI Address Width + * @{ + */ +#define QSPI_ADDR_WIDTH_1BYTE (0x0U) /*!< QSPI address width is 1 byte. */ +#define QSPI_ADDR_WIDTH_2BYTE (QSPI_FCR_AWSL_0) /*!< QSPI address width is 2 bytes. */ +#define QSPI_ADDR_WIDTH_3BYTE (QSPI_FCR_AWSL_1) /*!< QSPI address width is 3 bytes. */ +#define QSPI_ADDR_WIDTH_4BYTE (QSPI_FCR_AWSL_1 | \ + QSPI_FCR_AWSL_0) /*!< QSPI address width is 4 bytes. */ +/** + * @} + */ + +/** + * @defgroup QSPI_4BIC_Command QSPI 4-Byte Address Instruction Read Code Command + * @note Valid when the serial interface address width is 4 bytes. + * @{ + */ +#define QSPI_4BIC_DISABLE (0x0U) /*!< Do not use 4-byte address read instruction code. */ +#define QSPI_4BIC_ENABLE (QSPI_FCR_FOUR_BIC) /*!< Use 4-byte address read instruction code. */ +/** + * @} + */ + +/** + * @defgroup QSPI_CS_Release_Timing QSPI Chip-select Hold Timing + * @{ + */ +#define QSPI_CS_RELEASE_AFTER_0P5_CYCLE (0x0U) /*!< Release chip-select signal 0.5 QSCK cycles after the last rising edge of QSCK. */ +#define QSPI_CS_RELEASE_AFTER_1P5_CYCLE (QSPI_FCR_SSNHD) /*!< Release chip-select signal 1.5 QSCK cycles after the last rising edge of QSCK. */ +/** + * @} + */ + +/** + * @defgroup QSPI_CS_Setup_Timing QSPI Chip-select Setup Timing + * @{ + */ +#define QSPI_CS_SETUP_BEFORE_0P5_CYCLE (0x0U) /*!< Output chip-select signal 0.5 QSCK cycles before the first rising edge of QSCK. */ +#define QSPI_CS_SETUP_BEFORE_1P5_CYCLE (QSPI_FCR_SSNLD) /*!< Output chip-select signal 1.5 QSCK cycles before the first rising edge of QSCK. */ +/** + * @} + */ + +/** + * @defgroup QSPI_WP_Level QSPI Write Protect Pin Level + * @{ + */ +#define QSPI_WP_LOW (0x0U) /*!< WP(QIO2) output low. */ +#define QSPI_WP_HIGH (QSPI_FCR_WPOL) /*!< WP(QIO2) output high. */ +/** + * @} + */ + +/** + * @defgroup QSPI_QSCK_Duty_Correction_Command QSPI QSCK Duty Correction Command + * @{ + */ +#define QSPI_DUTY_CORRECTION_DISABLE (0x0U) /*!< Make no duty ratio correction on QSCK. */ +#define QSPI_DUTY_CORRECTION_ENABLE (QSPI_FCR_DUTY) /*!< Delay the rising of the QSCK signal by 0.5 HCLK cycles. \ + (Valid when HCLK is multiplied by an odd number.) */ +/** + * @} + */ + +/** + * @defgroup QSPI_Status_Flag QSPI Status Flag + * @{ + */ +#define QSPI_FLAG_DIRECT_COMM_BUSY (QSPI_SR_BUSY) /*!< Serial transfer being processed. */ +#define QSPI_FLAG_XIP_MODE (QSPI_SR_XIPF) /*!< XIP mode. */ +#define QSPI_FLAG_ROM_ACCESS_ERR (QSPI_SR_RAER) /*!< ROM access detection status in direct communication mode. */ +#define QSPI_FLAG_PREFETCH_BUF_FULL (QSPI_SR_PFFUL) /*!< Prefetch buffer is full. */ +#define QSPI_FLAG_PREFETCH_ACTIVE (QSPI_SR_PFAN) /*!< Prefetch function operating. */ + +#define QSPI_FLAG_ALL (QSPI_FLAG_DIRECT_COMM_BUSY | \ + QSPI_FLAG_XIP_MODE | \ + QSPI_FLAG_ROM_ACCESS_ERR | \ + QSPI_FLAG_PREFETCH_BUF_FULL | \ + QSPI_FLAG_PREFETCH_ACTIVE) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup QSPI_Global_Functions + * @{ + */ + +/** + * @brief Enter direct communication mode. + * @param None + * @retval None + */ +__STATIC_INLINE void QSPI_EnterDirectCommMode(void) +{ + /* Set standard read mode. */ + CLEAR_REG32_BIT(M4_QSPI->CR, QSPI_CR_MDSEL); + /* Enter direct communication mode. */ + SET_REG32_BIT(M4_QSPI->CR, QSPI_CR_DCOME); +} + +/** + * @brief Exit direct communication mode. + * @param None + * @retval None + */ +__STATIC_INLINE void QSPI_ExitDirectCommMode(void) +{ + CLEAR_REG32_BIT(M4_QSPI->CR, QSPI_CR_DCOME); +} + +/** + * @brief Write data in direct communication mode. + * @param [in] u8Val Byte data. + * @retval None + */ +__STATIC_INLINE void QSPI_WriteDirectCommValue(uint8_t u8Val) +{ + WRITE_REG32(M4_QSPI->DCOM, u8Val); +} + +/** + * @brief Read data in communication mode. + * @param None + * @retval Byte data. + */ +__STATIC_INLINE uint8_t QSPI_ReadDirectCommValue(void) +{ + return (uint8_t)M4_QSPI->DCOM; +} + +/** + * @brief Set ROM access instruction. + * @param [in] u8Instr ROM access instruction. + * @retval None + */ +__STATIC_INLINE void QSPI_SetRomAccressInstr(uint8_t u8Instr) +{ + WRITE_REG32(M4_QSPI->CCMD, u8Instr); +} + + +en_result_t QSPI_Init(const stc_qspi_init_t *pstcInit); +void QSPI_DeInit(void); +en_result_t QSPI_StructInit(stc_qspi_init_t *pstcInit); + +en_result_t QSPI_WriteData(uint32_t u32Instr, uint32_t u32Address, \ + const uint8_t pu8Src[], uint32_t u32SrcSize); +en_result_t QSPI_ReadData(uint32_t u32Address, uint8_t pu8Dest[], uint32_t u32DestSize); + +void QSPI_SetReadMode(uint32_t u32ReadMode, uint8_t u8ReadInstr, uint32_t u32DummyCycles); +void QSPI_DutyCorrectCmd(en_functional_state_t enNewState); +void QSPI_PrefetchCmd(en_functional_state_t enNewState); +void QSPI_XIPModeCmd(en_functional_state_t enNewState); +void QSPI_SetWPPinLevel(uint32_t u32Level); +void QSPI_4ByteAddrModeCmd(en_functional_state_t enNewState); +void QSPI_SelectBlock(uint32_t u32Block); + +uint32_t QSPI_GetPrefetchedSize(void); +en_flag_status_t QSPI_GetStatus(uint32_t u32Flag); +void QSPI_ClrStatus(uint32_t u32Flag); + +void QSPI_EnterDirectCommMode(void); +void QSPI_ExitDirectCommMode(void); +void QSPI_WriteDirectCommValue(uint8_t u8Val); +uint8_t QSPI_ReadDirectCommValue(void); +void QSPI_SetRomAccressInstr(uint8_t u8Instr); + +/** + * @} + */ + +#endif /* DDL_QSPI_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_QSPI_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_rmu.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_rmu.h new file mode 100644 index 0000000000..0c6d45f1f6 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_rmu.h @@ -0,0 +1,124 @@ +/** + ******************************************************************************* + * @file hc32f4a0_rmu.h + * @brief This file contains all the functions prototypes of the RMU driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Heqb First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_RMU_H__ +#define __HC32F4A0_RMU_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_RMU + * @{ + */ +#if (DDL_RMU_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup RMU_Global_Macros RMU Global Macros + * @{ + */ + +/** + * @defgroup RMU_ResetCause Rmu reset cause + * @{ + */ +#define RMU_RST_POWER_ON (RMU_RSTF0_PORF) /*!< Power on reset */ +#define RMU_RST_RESET_PIN (RMU_RSTF0_PINRF) /*!< Reset pin reset */ +#define RMU_RST_BROWN_OUT (RMU_RSTF0_BORF) /*!< Brown-out reset */ +#define RMU_RST_PVD1 (RMU_RSTF0_PVD1RF) /*!< Program voltage Detection 1 reset */ +#define RMU_RST_PVD2 (RMU_RSTF0_PVD2RF) /*!< Program voltage Detection 2 reset */ +#define RMU_RST_WDT (RMU_RSTF0_WDRF) /*!< Watchdog timer reset */ +#define RMU_RST_SWDT (RMU_RSTF0_SWDRF) /*!< Special watchdog timer reset */ +#define RMU_RST_POWER_DOWN (RMU_RSTF0_PDRF) /*!< Power down reset */ +#define RMU_RST_SOFTWARE (RMU_RSTF0_SWRF) /*!< Software reset */ +#define RMU_RST_MPU_ERR (RMU_RSTF0_MPUERF) /*!< Mpu error reset */ +#define RMU_RST_RAM_PARITY_ERR (RMU_RSTF0_RAPERF) /*!< Ram parity error reset */ +#define RMU_RST_RAM_ECC (RMU_RSTF0_RAECRF) /*!< Ram ECC reset */ +#define RMU_RST_CLK_ERR (RMU_RSTF0_CKFERF) /*!< Clk frequence error reset */ +#define RMU_RST_XTAL_ERR (RMU_RSTF0_XTALERF) /*!< Xtal error reset */ +#define RMU_RST_LOCKUP (RMU_RSTF0_LKUPRF) /*!< M4 Lockup reset */ +#define RMU_RST_MULTI (RMU_RSTF0_MULTIRF) /*!< Multiply reset cause */ +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup RMU_Global_Functions + * @{ + */ + +en_flag_status_t RMU_GetStatus(uint32_t u32RmuResetCause); +void RMU_ClrStatus(void); +void RMU_CPULockUpCmd(en_functional_state_t enNewState); + +/** + * @} + */ + +#endif /* DDL_RMU_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_RMU_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ + diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_rtc.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_rtc.h new file mode 100644 index 0000000000..fc4850935b --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_rtc.h @@ -0,0 +1,458 @@ +/** + ******************************************************************************* + * @file hc32f4a0_rtc.h + * @brief This file contains all the functions prototypes of the RTC driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Yangjp First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_RTC_H__ +#define __HC32F4A0_RTC_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_RTC + * @{ + */ + +#if (DDL_RTC_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup RTC_Global_Types RTC Global Types + * @{ + */ + +/** + * @brief RTC Init structure definition + */ +typedef struct +{ + uint8_t u8ClockSource; /*!< Specifies the RTC clock source. + This parameter can be a value of @ref RTC_Clock_Source */ + + uint8_t u8HourFormat; /*!< Specifies the RTC hour format. + This parameter can be a value of @ref RTC_Hour_Format */ + + uint8_t u8PeriodInterrupt; /*!< Specifies the RTC period interrupt. + This parameter can be a value of @ref RTC_Period_Interrupt */ + + uint8_t u8ClkCompenEn; /*!< Specifies the validity of RTC clock compensation. + This parameter can be a value of @ref RTC_Clock_Compensation */ + + uint16_t u16ClkCompenValue; /*!< Specifies the value of RTC clock compensation. + This parameter can be a number between Min_Data = 0 and Max_Data = 0x1FF */ + + uint8_t u8CompenMode; /*!< Specifies the compensation mode of one Hz output. + This parameter can be a value of @ref RTC_Output_Compen_Mode */ +} stc_rtc_init_t; + +/** + * @brief RTC Date structure definition + */ +typedef struct +{ + uint8_t u8Year; /*!< Specifies the RTC Year. + This parameter can be a number between Min_Data = 0 and Max_Data = 99 */ + + uint8_t u8Month; /*!< Specifies the RTC Month (in Decimal format). + This parameter can be a value of @ref RTC_Month */ + + uint8_t u8Day; /*!< Specifies the RTC Day. + This parameter can be a number between Min_Data = 1 and Max_Data = 31 */ + + uint8_t u8Weekday; /*!< Specifies the RTC Weekday. + This parameter can be a value of @ref RTC_Weekday */ +} stc_rtc_date_t; + +/** + * @brief RTC Time structure definition + */ +typedef struct +{ + uint8_t u8Hour; /*!< Specifies the RTC Hour. + This parameter can be a number between Min_Data = 1 and Max_Data = 12 if the RTC_HOUR_FORMAT_12 is selected. + This parameter can be a number between Min_Data = 0 and Max_Data = 23 if the RTC_HOUR_FORMAT_24 is selected */ + + uint8_t u8Minute; /*!< Specifies the RTC Minute. + This parameter can be a number between Min_Data = 0 and Max_Data = 59 */ + + uint8_t u8Second; /*!< Specifies the RTC Second. + This parameter can be a number between Min_Data = 0 and Max_Data = 59 */ + + uint8_t u8AmPm; /*!< Specifies the RTC Am/Pm Time (in RTC_HOUR_FORMAT_12 mode). + This parameter can be a value of @ref RTC_Hour12_AM_PM */ +} stc_rtc_time_t; + +/** + * @brief RTC Alarm structure definition + */ +typedef struct +{ + uint8_t u8AlarmHour; /*!< Specifies the RTC Alarm Hour. + This parameter can be a number between Min_Data = 1 and Max_Data = 12 if the RTC_HOUR_FORMAT_12 is selected. + This parameter can be a number between Min_Data = 0 and Max_Data = 23 if the RTC_HOUR_FORMAT_24 is selected */ + + uint8_t u8AlarmMinute; /*!< Specifies the RTC Alarm Minute. + This parameter can be a number between Min_Data = 0 and Max_Data = 59 */ + + uint8_t u8AlarmWeekday; /*!< Specifies the RTC Alarm Weekday. + This parameter can be a value of @ref RTC_Alarm_Weekday */ + + uint8_t u8AlarmAmPm; /*!< Specifies the RTC Alarm Am/Pm Time (in RTC_HOUR_FORMAT_12 mode). + This parameter can be a value of @ref RTC_Hour12_AM_PM */ +} stc_rtc_alarm_t; + +/** + * @brief RTC Intrusion structure definition + */ +typedef struct +{ + uint8_t u8TimeStampEn; /*!< Specifies the validity of RTC intrusion timestemp. + This parameter can be a value of @ref RTC_Intrusion_Timestamp */ + + uint8_t u8ResetBackupRegEn; /*!< Specifies the validity of RTC intrusion event that trigger backup registers reset. + This parameter can be a value of @ref RTC_Reset_Backup_Register */ + + uint8_t u8Filter; /*!< Specifies the RTC intrusion pin filter. + This parameter can be a value of @ref RTC_Intrusion_Filter */ + + uint8_t u8TrigEdge; /*!< Specifies the RTC intrusion detect edge. + This parameter can be a value of @ref RTC_Intrusion_Detect_Edge */ +} stc_rtc_intrusion_t; + +/** + * @brief RTC Timestamp structure definition + */ +typedef struct +{ + stc_rtc_time_t stcTSTime; /*!< Specifies the RTC Intrusion Timestamp Time members */ + + uint8_t u8TSMonth; /*!< Specifies the Month of RTC timestamp (in Decimal format). + This parameter can be a value of @ref RTC_Month */ + + uint8_t u8TSDay; /*!< Specifies the Day of RTC timestamp. + This parameter can be a number between Min_Data = 1 and Max_Data = 31 */ +} stc_rtc_timestamp_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup RTC_Global_Macros RTC Global Macros + * @{ + */ + +/** + * @defgroup RTC_Data_Format RTC Data Format + * @{ + */ +#define RTC_DATA_FORMAT_DEC (0x00U) /*!< Decimal data format */ +#define RTC_DATA_FORMAT_BCD (0x01U) /*!< BCD data format */ +/** + * @} + */ + +/** + * @defgroup RTC_Clock_Source RTC Clock Source + * @{ + */ +#define RTC_CLOCK_SOURCE_XTAL32 (0U) /*!< XTAL32 Clock */ +#define RTC_CLOCK_SOURCE_RTCLRC (RTC_CR3_RCKSEL | RTC_CR3_LRCEN) /*!< RTC LRC Clock */ +/** + * @} + */ + +/** + * @defgroup RTC_Hour_Format RTC Hour Format + * @{ + */ +#define RTC_HOUR_FORMAT_12 (0U) /*!< 12 hour time system */ +#define RTC_HOUR_FORMAT_24 (RTC_CR1_AMPM) /*!< 24 hour time system */ +/** + * @} + */ + +/** + * @defgroup RTC_Period_Interrupt RTC Period Interrupt + * @{ + */ +#define RTC_PERIOD_INT_INVALID (0U) /*!< Periodic interrupt invalid */ +#define RTC_PERIOD_INT_HALF_SECOND (RTC_CR1_PRDS_0) /*!< Periodic interrupt per half second */ +#define RTC_PERIOD_INT_ONE_SECOND (RTC_CR1_PRDS_1) /*!< Periodic interrupt per second */ +#define RTC_PERIOD_INT_ONE_MINUTE (RTC_CR1_PRDS_0 | RTC_CR1_PRDS_1) /*!< Periodic interrupt per minute */ +#define RTC_PERIOD_INT_ONE_HOUR (RTC_CR1_PRDS_2) /*!< Periodic interrupt per hour */ +#define RTC_PERIOD_INT_ONE_DAY (RTC_CR1_PRDS_0 | RTC_CR1_PRDS_2) /*!< Periodic interrupt per day */ +#define RTC_PERIOD_INT_ONE_MONTH (RTC_CR1_PRDS_1 | RTC_CR1_PRDS_2) /*!< Periodic interrupt per month */ +/** + * @} + */ + +/** + * @defgroup RTC_Clock_Compensation RTC Clock Compensation + * @{ + */ +#define RTC_CLOCK_COMPEN_DISABLE (0U) +#define RTC_CLOCK_COMPEN_ENABLE (RTC_ERRCRH_COMPEN) +/** + * @} + */ + +/** + * @defgroup RTC_Output_Compen_Mode RTC Output Compensation Mode + * @{ + */ +#define RTC_OUTPUT_COMPEN_MODE_DISTRIBUTED (0U) /*!< Distributed compensation 1Hz output */ +#define RTC_OUTPUT_COMPEN_MODE_UNIFORM (RTC_CR1_ONEHZSEL) /*!< Uniform compensation 1Hz output */ +/** + * @} + */ + +/** + * @defgroup RTC_Hour12_AM_PM RTC Hour12 AM/PM + * @{ + */ +#define RTC_HOUR12_AM_HOUR24 (0U) /*!< AM or 24-hour format */ +#define RTC_HOUR12_PM (RTC_HOUR_HOURD_1) /*!< PM */ +/** + * @} + */ + +/** + * @defgroup RTC_Month RTC Month + * @{ + */ +#define RTC_MONTH_JANUARY (0x01U) +#define RTC_MONTH_FEBRUARY (0x02U) +#define RTC_MONTH_MARCH (0x03U) +#define RTC_MONTH_APRIL (0x04U) +#define RTC_MONTH_MAY (0x05U) +#define RTC_MONTH_JUNE (0x06U) +#define RTC_MONTH_JULY (0x07U) +#define RTC_MONTH_AUGUST (0x08U) +#define RTC_MONTH_SEPTEMBER (0x09U) +#define RTC_MONTH_OCTOBER (0x0AU) +#define RTC_MONTH_NOVEMBER (0x0BU) +#define RTC_MONTH_DECEMBER (0x0CU) +/** + * @} + */ + +/** + * @defgroup RTC_Weekday RTC Weekday + * @{ + */ +#define RTC_WEEKDAY_SUNDAY (0x00U) +#define RTC_WEEKDAY_MONDAY (0x01U) +#define RTC_WEEKDAY_TUESDAY (0x02U) +#define RTC_WEEKDAY_WEDNESDAY (0x03U) +#define RTC_WEEKDAY_THURSDAY (0x04U) +#define RTC_WEEKDAY_FRIDAY (0x05U) +#define RTC_WEEKDAY_SATURDAY (0x06U) +/** + * @} + */ + +/** + * @defgroup RTC_Alarm_Weekday RTC Alarm Weekday + * @{ + */ +#define RTC_ALARM_WEEKDAY_SUNDAY (0x01U) +#define RTC_ALARM_WEEKDAY_MONDAY (0x02U) +#define RTC_ALARM_WEEKDAY_TUESDAY (0x04U) +#define RTC_ALARM_WEEKDAY_WEDNESDAY (0x08U) +#define RTC_ALARM_WEEKDAY_THURSDAY (0x10U) +#define RTC_ALARM_WEEKDAY_FRIDAY (0x20U) +#define RTC_ALARM_WEEKDAY_SATURDAY (0x40U) +/** + * @} + */ + +/** + * @defgroup RTC_Intrusion_Channel RTC Intrustion Channel + * @{ + */ +#define RTC_INTRU_CH0 (0x00U) +#define RTC_INTRU_CH1 (0x04U) +/** + * @} + */ + +/** + * @defgroup RTC_Intrusion_Timestamp RTC Intrustion Timestamp + * @{ + */ +#define RTC_INTRU_TIMESTAMP_DISABLE (0U) +#define RTC_INTRU_TIMESTAMP_ENABLE (RTC_TPCR0_TSTPE0) +/** + * @} + */ + +/** + * @defgroup RTC_Reset_Backup_Register RTC Reset Backup Register + * @{ + */ +#define RTC_RESET_BACKUP_REG_DISABLE (0U) +#define RTC_RESET_BACKUP_REG_ENABLE (RTC_TPCR0_TPRSTE0) +/** + * @} + */ + +/** + * @defgroup RTC_Intrusion_Filter RTC Intrusion Filter + * @{ + */ +#define RTC_INTRU_FILTER_INVALID (0U) /*!< Invalid filter function */ +#define RTC_INTRU_FILTER_THREE_TIME (RTC_TPCR0_TPNF0_1) /*!< The filter detection is consistent with the timing clock for 3 times */ +#define RTC_INTRU_FILTER_THREE_TIME_CLK_DIV32 (RTC_TPCR0_TPNF0) /*!< The filter detection is consistent with the 32 frequency division of the timing clock for 3 times */ +/** + * @} + */ + +/** + * @defgroup RTC_Intrusion_Detect_Edge RTC Intrusion Detect Edge + * @{ + */ +#define RTC_DETECT_EDGE_NONE (0U) /*!< No detect */ +#define RTC_DETECT_EDGE_RISING (RTC_TPCR0_TPCT0_0) /*!< Detect rising edge */ +#define RTC_DETECT_EDGE_FALLING (RTC_TPCR0_TPCT0_1) /*!< Detect falling edge */ +#define RTC_DETECT_EDGE_RISING_FALLING (RTC_TPCR0_TPCT0) /*!< Detect rising and falling edge */ +/** + * @} + */ + +/** + * @defgroup RTC_Flag RTC Flag + * @{ + */ +#define RTC_FLAG_PRDF (RTC_CR2_PRDF) /*!< Period flag */ +#define RTC_FLAG_ALMF (RTC_CR2_ALMF) /*!< Alarm flag */ +#define RTC_FLAG_RWEN (RTC_CR2_RWEN) /*!< Read and write permission flag */ +#define RTC_FLAG_TPOVF ((uint32_t)RTC_TPSR_TPOVF << 16U) /*!< Intrusion overflow flag */ +#define RTC_FLAG_TPF0 ((uint32_t)RTC_TPSR_TPF0 << 16U) /*!< RTCIC0 intrusion flag */ +#define RTC_FLAG_TPF1 ((uint32_t)RTC_TPSR_TPF1 << 16U) /*!< RTCIC1 intrusion flag */ +/** + * @} + */ + +/** + * @defgroup RTC_Interrupt RTC Interrupt + * @{ + */ +#define RTC_INT_PRDIE (RTC_CR2_PRDIE) /*!< Period interrupt */ +#define RTC_INT_ALMIE (RTC_CR2_ALMIE) /*!< Alarm interrupt */ +#define RTC_INT_TPIE0 ((uint32_t)RTC_TPCR0_TPIE0 << 8U) /*!< RTCIC0 intrusion interrupt */ +#define RTC_INT_TPIE1 ((uint32_t)RTC_TPCR1_TPIE1 << 16U) /*!< RTCIC1 intrusion interrupt */ +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup RTC_Global_Functions + * @{ + */ + +/* Initialization and configuration functions */ +en_result_t RTC_DeInit(void); +en_result_t RTC_Init(const stc_rtc_init_t *pstcRtcInit); +en_result_t RTC_StructInit(stc_rtc_init_t *pstcRtcInit); +en_result_t RTC_EnterRwMode(void); +en_result_t RTC_ExitRwMode(void); +void RTC_PeriodIntConfig(uint8_t u8IntCond); +en_result_t RTC_LowPowerCheck(void); +void RTC_SetClkCompenValue(uint16_t u16CompenVal); +void RTC_Cmd(en_functional_state_t enNewSta); +void RTC_LrcCmd(en_functional_state_t enNewSta); +en_functional_state_t RTC_GetCounterState(void); +void RTC_OneHzOutputCmd(en_functional_state_t enNewSta); +void RTC_ClkCompenCmd(en_functional_state_t enNewSta); + +/* Date and time functions */ +en_result_t RTC_SetDate(uint8_t u8Format, stc_rtc_date_t *pstcRtcDate); +en_result_t RTC_GetDate(uint8_t u8Format, stc_rtc_date_t *pstcRtcDate); +en_result_t RTC_SetTime(uint8_t u8Format, stc_rtc_time_t *pstcRtcTime); +en_result_t RTC_GetTime(uint8_t u8Format, stc_rtc_time_t *pstcRtcTime); + +/* Alarm configuration functions */ +en_result_t RTC_SetAlarm(uint8_t u8Format, stc_rtc_alarm_t *pstcRtcAlarm); +en_result_t RTC_GetAlarm(uint8_t u8Format, stc_rtc_alarm_t *pstcRtcAlarm); +void RTC_AlarmCmd(en_functional_state_t enNewSta); + +/* Intrusion timestamp functions */ +en_result_t RTC_IntrusionConfig(uint8_t u8Ch, const stc_rtc_intrusion_t *pstcIntru); +en_result_t RTC_GetIntrusionTimestamp(uint8_t u8Format, stc_rtc_timestamp_t *pstcTimestamp); +void RTC_IntrusionCmd(uint8_t u8Ch, en_functional_state_t enNewSta); + +/* Interrupt and flag management functions */ +void RTC_IntCmd(uint32_t u32IntSrc, en_functional_state_t enNewSta); +en_flag_status_t RTC_GetStatus(uint32_t u32Flag); +void RTC_ClearStatus(uint32_t u32Flag); + +/** + * @} + */ + +#endif /* DDL_RTC_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_RTC_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_sdioc.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_sdioc.h new file mode 100644 index 0000000000..eeb92d52a8 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_sdioc.h @@ -0,0 +1,753 @@ +/** + ******************************************************************************* + * @file hc32f4a0_sdioc.h + * @brief This file contains all the functions prototypes of the SDIOC driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Yangjp First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_SDIOC_H__ +#define __HC32F4A0_SDIOC_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_SDIOC + * @{ + */ + +#if (DDL_SDIOC_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup SDIOC_Global_Types SDIOC Global Types + * @{ + */ + +/** + * @brief SDIOC Init structure definition + */ +typedef struct +{ + uint32_t u32Mode; /*!< Specifies the SDIOC work mode. + This parameter can be a value of @ref SDIOC_Mode */ + + uint8_t u8CardDetectSelect; /*!< Specifies the SDIOC card detect source select. + This parameter can be a value of @ref SDIOC_Card_Detect_Select */ + + uint8_t u8SpeedMode; /*!< Specifies the SDIOC speed mode. + This parameter can be a value of @ref SDIOC_Speed_Mode */ + + uint8_t u8BusWidth; /*!< Specifies the SDIOC bus width. + This parameter can be a value of @ref SDIOC_Bus_Width */ + + uint16_t u16ClockDiv; /*!< Specifies the SDIOC clock division. + This parameter can be a value of @ref SDIOC_Clock_Division */ +} stc_sdioc_init_t; + +/** + * @brief SDIOC Command Init structure definition + */ +typedef struct +{ + uint32_t u32Argument; /*!< Specifies the SDIOC command argument. */ + + uint16_t u16CmdIndex; /*!< Specifies the SDIOC command index. + This parameter must be a number between Min_Data = 0 and Max_Data = 63 */ + + uint16_t u16CmdType; /*!< Specifies the SDIOC command type. + This parameter can be a value of @ref SDIOC_Command_Type */ + + uint16_t u16DataLineEn; /*!< Specifies whether SDIOC uses data lines in current command. + This parameter can be a value of @ref SDIOC_Data_Line_Valid */ + + uint16_t u16RespType; /*!< Specifies the SDIOC response type. + This parameter can be a value of @ref SDIOC_Response_Type */ +} stc_sdioc_cmd_init_t; + +/** + * @brief SDIOC Data Init structure definition + */ +typedef struct +{ + uint16_t u16BlockSize; /*!< Specifies the SDIOC data block size. + This parameter must be a number between Min_Data = 1 and Max_Data = 512 */ + + uint16_t u16BlockCount; /*!< Specifies the SDIOC data block count. + This parameter must be a number between Min_Data = 0 and Max_Data = 0xFFFF */ + + uint16_t u16TransferDir; /*!< Specifies the SDIOC data transfer direction. + This parameter can be a value of @ref SDIOC_Transfer_Direction */ + + uint16_t u16AutoCMD12En; /*!< Specifies the validity of the SDIOC Auto Send CMD12. + This parameter can be a value of @ref SDIOC_Auto_Send_CMD12 */ + + uint16_t u16TransferMode; /*!< Specifies the SDIOC data transfer mode. + This parameter can be a value of @ref SDIOC_Transfer_Mode */ + + uint8_t u16DataTimeout; /*!< Specifies the SDIOC data timeout time. + This parameter can be a value of @ref SDIOC_Data_Timeout_Time */ +} stc_sdioc_data_init_t; + + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup SDIOC_Global_Macros SDIOC Global Macros + * @{ + */ + +/** + * @defgroup SDIOC_Mode SDIOC Mode + * @{ + */ +#define SDIOC_MODE_SD (0x00UL) /*!< SDIOCx selects SD mode */ +#define SDIOC_MODE_MMC (0x01UL) /*!< SDIOCx selects MMC mode */ +/** + * @} + */ + +/** + * @defgroup SDIOC_Card_Detect_Select SDIOC Card Detect Select + * @{ + */ +#define SDIOC_CARD_DETECT_CD_PIN_LEVEL (0x00U) /*!< SDIOCx_CD(x=1~2) line is selected (for normal use) */ +#define SDIOC_CARD_DETECT_TEST_SIGNAL (SDIOC_HOSTCON_CDSS) /*!< The Card Detect Test Level is selected(for test purpose) */ +/** + * @} + */ + +/** + * @defgroup SDIOC_Card_Detect_Test_Level SDIOC Card Detect Test Level + * @{ + */ +#define SDIOC_CARD_DETECT_TEST_LEVEL_LOW (0x00U) /*!< Card identification test signal is low level (with device insertion) */ +#define SDIOC_CARD_DETECT_TEST_LEVEL_HIGH (SDIOC_HOSTCON_CDTL) /*!< Card identification test signal is high level (no device insertion) */ +/** + * @} + */ + +/** + * @defgroup SDIOC_Speed_Mode SDIOC Speed Mode + * @{ + */ +#define SDIOC_SPEED_MODE_NORMAL (0x00U) /*!< Normal speed mode */ +#define SDIOC_SPEED_MODE_HIGH (SDIOC_HOSTCON_HSEN) /*!< High speed mode */ +/** + * @} + */ + +/** + * @defgroup SDIOC_Bus_Width SDIOC Bus Width + * @{ + */ +#define SDIOC_BUS_WIDTH_1BIT (0x00U) /*!< The Bus width is 1 bit */ +#define SDIOC_BUS_WIDTH_4BIT (SDIOC_HOSTCON_DW) /*!< The Bus width is 4 bit */ +#define SDIOC_BUS_WIDTH_8BIT (SDIOC_HOSTCON_EXDW) /*!< The Bus width is 8 bit */ +/** + * @} + */ + +/** + * @defgroup SDIOC_Clock_Division SDIOC Clock Division + * @{ + */ +#define SDIOC_CLOCK_DIV_1 (0x00U) /*!< PCLK1/1 */ +#define SDIOC_CLOCK_DIV_2 (SDIOC_CLKCON_FS_0) /*!< PCLK1/2 */ +#define SDIOC_CLOCK_DIV_4 (SDIOC_CLKCON_FS_1) /*!< PCLK1/4 */ +#define SDIOC_CLOCK_DIV_8 (SDIOC_CLKCON_FS_2) /*!< PCLK1/8 */ +#define SDIOC_CLOCK_DIV_16 (SDIOC_CLKCON_FS_3) /*!< PCLK1/16 */ +#define SDIOC_CLOCK_DIV_32 (SDIOC_CLKCON_FS_4) /*!< PCLK1/32 */ +#define SDIOC_CLOCK_DIV_64 (SDIOC_CLKCON_FS_5) /*!< PCLK1/64 */ +#define SDIOC_CLOCK_DIV_128 (SDIOC_CLKCON_FS_6) /*!< PCLK1/128 */ +#define SDIOC_CLOCK_DIV_256 (SDIOC_CLKCON_FS_7) /*!< PCLK1/256 */ +/** + * @} + */ + +/** + * @defgroup SDIOC_Command_Type SDIOC Command Type + * @{ + */ +#define SDIOC_CMD_TYPE_NORMAL (0x00U) /*!< Other commands */ +#define SDIOC_CMD_TYPE_SUSPEND (SDIOC_CMD_TYP_0) /*!< CMD52 for writing "Bus Suspend" in CCCR */ +#define SDIOC_CMD_TYPE_RESUME (SDIOC_CMD_TYP_1) /*!< CMD52 for writing "Function Select" in CCCR */ +#define SDIOC_CMD_TYPE_ABORT (SDIOC_CMD_TYP) /*!< CMD12, CMD52 for writing "I/O Abort" in CCCR */ +/** + * @} + */ + +/** + * @defgroup SDIOC_Data_Line_Valid SDIOC Data Line Valid + * @{ + */ +#define SDIOC_DATA_LINE_DISABLE (0x00U) /*!< The current command uses only SDIOCx_CMD(x=1~2) command line */ +#define SDIOC_DATA_LINE_ENABLE (SDIOC_CMD_DAT) /*!< The current command requires the use of SDIOCx_Dy(x=1~2) data line */ +/** + * @} + */ + +/** + * @defgroup SDIOC_Transfer_Direction SDIOC Transfer Direction + * @{ + */ +#define SDIOC_TRANSFER_DIR_TO_CARD (0x00U) /*!< Write (Host to Card) */ +#define SDIOC_TRANSFER_DIR_TO_HOST (SDIOC_TRANSMODE_DDIR) /*!< Read (Card to Host) */ +/** + * @} + */ + +/** + * @defgroup SDIOC_Auto_Send_CMD12 SDIOC Auto Send CMD12 + * @{ + */ +#define SDIOC_AUTO_SEND_CMD12_DISABLE (0x00U) /*!< Do not send autocommands */ +#define SDIOC_AUTO_SEND_CMD12_ENABLE (SDIOC_TRANSMODE_ATCEN_0) /*!< CMD12 is automatically sent after multiple block transfers */ +/** + * @} + */ + +/** + * @defgroup SDIOC_Transfer_Mode SDIOC Transfer Mode + * @{ + */ +#define SDIOC_TRANSFER_MODE_SINGLE (0x00U) /*!< Single Block transfer */ +#define SDIOC_TRANSFER_MODE_INFINITE (SDIOC_TRANSMODE_MULB) /*!< Infinite Block transfer */ +#define SDIOC_TRANSFER_MODE_MULTIPLE (SDIOC_TRANSMODE_MULB | SDIOC_TRANSMODE_BCE) /*!< Multiple Block transfer */ +#define SDIOC_TRANSFER_MODE_STOP_MULTIPLE (0x8000U | SDIOC_TRANSFER_MODE_MULTIPLE) /*!< Stop Multiple Block transfer */ +/** + * @} + */ + +/** + * @defgroup SDIOC_Data_Timeout_Time SDIOC Data Timeout Time + * @{ + */ +#define SDIOC_DATA_TIMEOUT_CLK_2_13 (0x00U) /*!< Timeout time: PCLK1*2^13 */ +#define SDIOC_DATA_TIMEOUT_CLK_2_14 (0x01U) /*!< Timeout time: PCLK1*2^14 */ +#define SDIOC_DATA_TIMEOUT_CLK_2_15 (0x02U) /*!< Timeout time: PCLK1*2^15 */ +#define SDIOC_DATA_TIMEOUT_CLK_2_16 (0x03U) /*!< Timeout time: PCLK1*2^16 */ +#define SDIOC_DATA_TIMEOUT_CLK_2_17 (0x04U) /*!< Timeout time: PCLK1*2^17 */ +#define SDIOC_DATA_TIMEOUT_CLK_2_18 (0x05U) /*!< Timeout time: PCLK1*2^18 */ +#define SDIOC_DATA_TIMEOUT_CLK_2_19 (0x06U) /*!< Timeout time: PCLK1*2^19 */ +#define SDIOC_DATA_TIMEOUT_CLK_2_20 (0x07U) /*!< Timeout time: PCLK1*2^20 */ +#define SDIOC_DATA_TIMEOUT_CLK_2_21 (0x08U) /*!< Timeout time: PCLK1*2^21 */ +#define SDIOC_DATA_TIMEOUT_CLK_2_22 (0x09U) /*!< Timeout time: PCLK1*2^22 */ +#define SDIOC_DATA_TIMEOUT_CLK_2_23 (0x0AU) /*!< Timeout time: PCLK1*2^23 */ +#define SDIOC_DATA_TIMEOUT_CLK_2_24 (0x0BU) /*!< Timeout time: PCLK1*2^24 */ +#define SDIOC_DATA_TIMEOUT_CLK_2_25 (0x0CU) /*!< Timeout time: PCLK1*2^25 */ +#define SDIOC_DATA_TIMEOUT_CLK_2_26 (0x0DU) /*!< Timeout time: PCLK1*2^26 */ +#define SDIOC_DATA_TIMEOUT_CLK_2_27 (0x0EU) /*!< Timeout time: PCLK1*2^27 */ +/** + * @} + */ + +/** + * @defgroup SDIOC_Response_Register SDIOC Response Register + * @{ + */ +#define SDIOC_RESPONSE_REG_BIT0_31 (0x00U) /*!< Command Response Register 0-31bit */ +#define SDIOC_RESPONSE_REG_BIT32_63 (0x04U) /*!< Command Response Register 32-63bit */ +#define SDIOC_RESPONSE_REG_BIT64_95 (0x08U) /*!< Command Response Register 64-95bit */ +#define SDIOC_RESPONSE_REG_BIT96_127 (0x0CU) /*!< Command Response Register 96-127bit */ +/** + * @} + */ + +/** + * @defgroup SDIOC_Software_Reset_Type SDIOC_Software_Reset_Type + * @{ + */ +#define SDIOC_SW_RESET_DATA_LINE (SDIOC_SFTRST_RSTD) /*!< Only part of data circuit is reset */ +#define SDIOC_SW_RESET_CMD_LINE (SDIOC_SFTRST_RSTC) /*!< Only part of command circuit is reset */ +#define SDIOC_SW_RESET_ALL (SDIOC_SFTRST_RSTA) /*!< Reset the entire Host Controller except for the card detection circuit */ +/** + * @} + */ + +/** + * @defgroup SDIOC_Output_Clock_Frequency SDIOC Output Clock Frequency + * @{ + */ +#define SDIOC_OUTPUT_CLK_FREQ_400K (400000UL) /*!< SDIOC clock: 400KHz */ +#define SDIOC_OUTPUT_CLK_FREQ_25M (25000000UL) /*!< SDIOC clock: 25MHz */ +#define SDIOC_OUTPUT_CLK_FREQ_26M (26000000UL) /*!< SDIOC clock: 26MHz */ +#define SDIOC_OUTPUT_CLK_FREQ_50M (50000000UL) /*!< SDIOC clock: 50MHz */ +#define SDIOC_OUTPUT_CLK_FREQ_52M (52000000UL) /*!< SDIOC clock: 52MHz */ +/** + * @} + */ + +/** + * @defgroup SDIOC_Host_Status SDIOC Host Status + * @{ + */ +#define SDIOC_HOST_FLAG_CMDL (SDIOC_PSTAT_CMDL) /*!< CMD Line Level status */ +#define SDIOC_HOST_FLAG_DATL (SDIOC_PSTAT_DATL) /*!< DAT[3:0] Line Level status */ +#define SDIOC_HOST_FLAG_DATL_D0 (SDIOC_PSTAT_DATL_0) /*!< DAT[0] Line Level status */ +#define SDIOC_HOST_FLAG_DATL_D1 (SDIOC_PSTAT_DATL_1) /*!< DAT[1] Line Level status */ +#define SDIOC_HOST_FLAG_DATL_D2 (SDIOC_PSTAT_DATL_2) /*!< DAT[2] Line Level status */ +#define SDIOC_HOST_FLAG_DATL_D3 (SDIOC_PSTAT_DATL_3) /*!< DAT[3] Line Level status */ +#define SDIOC_HOST_FLAG_WPL (SDIOC_PSTAT_WPL) /*!< Write Protect Line Level status */ +#define SDIOC_HOST_FLAG_CDL (SDIOC_PSTAT_CDL) /*!< Card Detect Line Level status */ +#define SDIOC_HOST_FLAG_CSS (SDIOC_PSTAT_CSS) /*!< Device Stable Status */ +#define SDIOC_HOST_FLAG_CIN (SDIOC_PSTAT_CIN) /*!< Device Inserted status */ +#define SDIOC_HOST_FLAG_BRE (SDIOC_PSTAT_BRE) /*!< Data buffer full status */ +#define SDIOC_HOST_FLAG_BWE (SDIOC_PSTAT_BWE) /*!< Data buffer empty status */ +#define SDIOC_HOST_FLAG_RTA (SDIOC_PSTAT_RTA) /*!< Read operation status */ +#define SDIOC_HOST_FLAG_WTA (SDIOC_PSTAT_WTA) /*!< Write operation status */ +#define SDIOC_HOST_FLAG_DA (SDIOC_PSTAT_DA) /*!< DAT Line transfer status */ +#define SDIOC_HOST_FLAG_CID (SDIOC_PSTAT_CID) /*!< Command Inhibit with data status */ +#define SDIOC_HOST_FLAG_CIC (SDIOC_PSTAT_CIC) /*!< Command Inhibit status */ +/** + * @} + */ + +/** + * @defgroup SDIOC_Normal_Error_Interrupt_Status SDIOC Normal Error Interrupt Status + * @{ + */ +#define SDIOC_NORMAL_INT_FLAG_EI (SDIOC_NORINTST_EI) /*!< Error Interrupt Status */ +#define SDIOC_NORMAL_INT_FLAG_CINT (SDIOC_NORINTST_CINT) /*!< Card Interrupt status */ +#define SDIOC_NORMAL_INT_FLAG_CRM (SDIOC_NORINTST_CRM) /*!< Card Removal status */ +#define SDIOC_NORMAL_INT_FLAG_CIST (SDIOC_NORINTST_CIST) /*!< Card Insertion status */ +#define SDIOC_NORMAL_INT_FLAG_BRR (SDIOC_NORINTST_BRR) /*!< Buffer Read Ready status */ +#define SDIOC_NORMAL_INT_FLAG_BWR (SDIOC_NORINTST_BWR) /*!< Buffer Write Ready status */ +#define SDIOC_NORMAL_INT_FLAG_BGE (SDIOC_NORINTST_BGE) /*!< Block Gap Event status */ +#define SDIOC_NORMAL_INT_FLAG_TC (SDIOC_NORINTST_TC) /*!< Transfer Complete status */ +#define SDIOC_NORMAL_INT_FLAG_CC (SDIOC_NORINTST_CC) /*!< Command Complete status */ +#define SDIOC_ERROR_INT_FLAG_ACE ((uint32_t)SDIOC_ERRINTST_ACE << 16U) /*!< Auto CMD12 Error Status */ +#define SDIOC_ERROR_INT_FLAG_DEBE ((uint32_t)SDIOC_ERRINTST_DEBE << 16U) /*!< Data End Bit Error status */ +#define SDIOC_ERROR_INT_FLAG_DCE ((uint32_t)SDIOC_ERRINTST_DCE << 16U) /*!< Data CRC Error status */ +#define SDIOC_ERROR_INT_FLAG_DTOE ((uint32_t)SDIOC_ERRINTST_DTOE << 16U) /*!< Data Timeout Error status */ +#define SDIOC_ERROR_INT_FLAG_CIE ((uint32_t)SDIOC_ERRINTST_CIE << 16U) /*!< Command Index Error status */ +#define SDIOC_ERROR_INT_FLAG_CEBE ((uint32_t)SDIOC_ERRINTST_CEBE << 16U) /*!< Command End Bit Error status */ +#define SDIOC_ERROR_INT_FLAG_CCE ((uint32_t)SDIOC_ERRINTST_CCE << 16U) /*!< Command CRC Error status */ +#define SDIOC_ERROR_INT_FLAG_CTOE ((uint32_t)SDIOC_ERRINTST_CTOE << 16U) /*!< Command Timeout Error status */ +#define SDIOC_ERROR_INT_STATIC_FLAGS ((uint32_t)SDIOC_ERROR_INT_FLAG_ACE | SDIOC_ERROR_INT_FLAG_DEBE | \ + SDIOC_ERROR_INT_FLAG_DCE | SDIOC_ERROR_INT_FLAG_DTOE | \ + SDIOC_ERROR_INT_FLAG_CIE | SDIOC_ERROR_INT_FLAG_CEBE | \ + SDIOC_ERROR_INT_FLAG_CCE | SDIOC_ERROR_INT_FLAG_CTOE | \ + SDIOC_NORMAL_INT_FLAG_TC | SDIOC_NORMAL_INT_FLAG_CC) +/** + * @} + */ + +/** + * @defgroup SDIOC_Normal_Error_Interrupt SDIOC Normal Error Interrupt + * @{ + */ +#define SDIOC_NORMAL_INT_CINTSEN (SDIOC_NORINTSGEN_CINTSEN) /*!< Card Interrupt */ +#define SDIOC_NORMAL_INT_CRMSEN (SDIOC_NORINTSGEN_CRMSEN) /*!< Card Removal Interrupt */ +#define SDIOC_NORMAL_INT_CISTSEN (SDIOC_NORINTSGEN_CISTSEN) /*!< Card Insertion Interrupt */ +#define SDIOC_NORMAL_INT_BRRSEN (SDIOC_NORINTSGEN_BRRSEN) /*!< Buffer Read Ready Interrupt */ +#define SDIOC_NORMAL_INT_BWRSEN (SDIOC_NORINTSGEN_BWRSEN) /*!< Buffer Write Ready Interrupt */ +#define SDIOC_NORMAL_INT_BGESEN (SDIOC_NORINTSGEN_BGESEN) /*!< Block Gap Event Interrupt */ +#define SDIOC_NORMAL_INT_TCSEN (SDIOC_NORINTSGEN_TCSEN) /*!< Transfer Complete Interrupt */ +#define SDIOC_NORMAL_INT_CCSEN (SDIOC_NORINTSGEN_CCSEN) /*!< Command Complete Interrupt */ +#define SDIOC_ERROR_INT_ACESEN ((uint32_t)SDIOC_ERRINTSGEN_ACESEN << 16U) /*!< Auto CMD12 Error Interrupt */ +#define SDIOC_ERROR_INT_DEBESEN ((uint32_t)SDIOC_ERRINTSGEN_DEBESEN << 16U) /*!< Data End Bit Error Interrupt */ +#define SDIOC_ERROR_INT_DCESEN ((uint32_t)SDIOC_ERRINTSGEN_DCESEN << 16U) /*!< Data CRC Error Interrupt */ +#define SDIOC_ERROR_INT_DTOESEN ((uint32_t)SDIOC_ERRINTSGEN_DTOESEN << 16U) /*!< Data Timeout Error Interrupt */ +#define SDIOC_ERROR_INT_CIESEN ((uint32_t)SDIOC_ERRINTSGEN_CIESEN << 16U) /*!< Command Index Error Interrupt */ +#define SDIOC_ERROR_INT_CEBESEN ((uint32_t)SDIOC_ERRINTSGEN_CEBESEN << 16U) /*!< Command End Bit Error Interrupt */ +#define SDIOC_ERROR_INT_CCESEN ((uint32_t)SDIOC_ERRINTSGEN_CCESEN << 16U) /*!< Command CRC Error Interrupt */ +#define SDIOC_ERROR_INT_CTOESEN ((uint32_t)SDIOC_ERRINTSGEN_CTOESEN << 16U) /*!< Command Timeout Error Interrupt */ +/** + * @} + */ + +/** + * @defgroup SDIOC_Auto_CMD_Error_Status SDIOC Auto CMD Error Status + * @{ + */ +#define SDIOC_AUTO_CMD_ERROR_FLAG_CMDE (SDIOC_ATCERRST_CMDE) /*!< Command Not Issued By Auto CMD12 Error Status */ +#define SDIOC_AUTO_CMD_ERROR_FLAG_IE (SDIOC_ATCERRST_IE) /*!< Auto CMD12 Index Error status */ +#define SDIOC_AUTO_CMD_ERROR_FLAG_EBE (SDIOC_ATCERRST_EBE) /*!< Auto CMD12 End Bit Error status */ +#define SDIOC_AUTO_CMD_ERROR_FLAG_CE (SDIOC_ATCERRST_CE) /*!< Auto CMD12 CRC Error status */ +#define SDIOC_AUTO_CMD_ERROR_FLAG_TOE (SDIOC_ATCERRST_TOE) /*!< Auto CMD12 Timeout Error status */ +#define SDIOC_AUTO_CMD_ERROR_FLAG_NE (SDIOC_ATCERRST_NE) /*!< Auto CMD12 Not Executed status */ +/** + * @} + */ + +/** + * @defgroup SDIOC_Force_Auto_CMD_Error SDIOC Force Auto CMD Error + * @{ + */ +#define SDIOC_FORCE_AUTO_CMD_ERROR_FCMDE (SDIOC_FEA_FCMDE) /*!< Force Event for Command Not Issued By Auto CMD12 Error */ +#define SDIOC_FORCE_AUTO_CMD_ERROR_FIE (SDIOC_FEA_FIE) /*!< Force Event for Auto CMD12 Index Error */ +#define SDIOC_FORCE_AUTO_CMD_ERROR_FEBE (SDIOC_FEA_FEBE) /*!< Force Event for Auto CMD12 End Bit Error */ +#define SDIOC_FORCE_AUTO_CMD_ERROR_FCE (SDIOC_FEA_FCE) /*!< Force Event for Auto CMD12 CRC Error */ +#define SDIOC_FORCE_AUTO_CMD_ERROR_FTOE (SDIOC_FEA_FTOE) /*!< Force Event for Auto CMD12 Timeout Error */ +#define SDIOC_FORCE_AUTO_CMD_ERROR_FNE (SDIOC_FEA_FNE) /*!< Force Event for Auto CMD12 Not Executed */ +/** + * @} + */ + +/** + * @defgroup SDIOC_Force_Error_Interrupt SDIOC Force Error Interrupt + * @{ + */ +#define SDIOC_FORCE_ERROR_INT_FACE (SDIOC_FEE_FACE) /*!< Force Event for Auto CMD12 Error */ +#define SDIOC_FORCE_ERROR_INT_FDEBE (SDIOC_FEE_FDEBE) /*!< Force Event for Data End Bit Error */ +#define SDIOC_FORCE_ERROR_INT_FDCE (SDIOC_FEE_FDCE) /*!< Force Event for Data CRC Error */ +#define SDIOC_FORCE_ERROR_INT_FDTOE (SDIOC_FEE_FDTOE) /*!< Force Event for Data Timeout Error */ +#define SDIOC_FORCE_ERROR_INT_FCIE (SDIOC_FEE_FCIE) /*!< Force Event for Command Index Error */ +#define SDIOC_FORCE_ERROR_INT_FCEBE (SDIOC_FEE_FCEBE) /*!< Force Event for Command End Bit Error */ +#define SDIOC_FORCE_ERROR_INT_FCCE (SDIOC_FEE_FCCE) /*!< Force Event for Command CRC Error */ +#define SDIOC_FORCE_ERROR_INT_FCTOE (SDIOC_FEE_FCTOE) /*!< Force Event for Command Timeout Error */ +/** + * @} + */ + +/** + * @defgroup SDIOC_Response_Type SDIOC Response Type + * @{ + */ +#define SDIOC_RESOPNE_TYPE_NO (0x00U) /*!< No Response */ +#define SDIOC_RESOPNE_TYPE_R2 (SDIOC_CMD_RESTYP_0 | SDIOC_CMD_CCE) /*!< Command Response 2 */ +#define SDIOC_RESOPNE_TYPE_R3_R4 (SDIOC_CMD_RESTYP_1) /*!< Command Response 3, 4 */ +#define SDIOC_RESOPNE_TYPE_R1_R5_R6_R7 (SDIOC_CMD_RESTYP_1 | SDIOC_CMD_ICE | SDIOC_CMD_CCE) /*!< Command Response 1, 5, 6, 7 */ +#define SDIOC_RESOPNE_TYPE_R1B_R5B (SDIOC_CMD_RESTYP | SDIOC_CMD_ICE | SDIOC_CMD_CCE) /*!< Command Response 1 and 5 with busy */ +/** + * @} + */ + +/** + * @defgroup SDIOC_Commands_Index SDIOC Commands Index + * @{ + */ +#define SDIOC_CMD0_GO_IDLE_STATE (0U) /*!< Resets the SD memory card. */ +#define SDIOC_CMD1_SEND_OP_COND (1U) /*!< Sends host capacity support information and activates the card's initialization process. */ +#define SDIOC_CMD2_ALL_SEND_CID (2U) /*!< Asks any card connected to the host to send the CID numbers on the CMD line. */ +#define SDIOC_CMD3_SEND_RELATIVE_ADDR (3U) /*!< Asks the card to publish a new relative address (RCA). */ +#define SDIOC_CMD4_SET_DSR (4U) /*!< Programs the DSR of all cards. */ +#define SDIOC_CMD5_IO_SEND_OP_COND (5U) /*!< Sends host capacity support information (HCS) and asks the accessed card to send its \ + operating condition register (OCR) content in the response on the CMD line. */ +#define SDIOC_CMD6_SWITCH_FUNC (6U) /*!< Checks switchable function (mode 0) and switch card function (mode 1). */ +#define SDIOC_CMD7_SELECT_DESELECT_CARD (7U) /*!< Selects the card by its own relative address and gets deselected by any other address */ +#define SDIOC_CMD8_SEND_IF_COND (8U) /*!< Sends SD Memory Card interface condition, which includes host supply voltage information \ + and asks the card whether card supports voltage. */ +#define SDIOC_CMD9_SEND_CSD (9U) /*!< Addressed card sends its card specific data (CSD) on the CMD line. */ +#define SDIOC_CMD10_SEND_CID (10U) /*!< Addressed card sends its card identification (CID) on the CMD line. */ +#define SDIOC_CMD11_READ_DAT_UNTIL_STOP (11U) /*!< SD card doesn't support it. */ +#define SDIOC_CMD12_STOP_TRANSMISSION (12U) /*!< Forces the card to stop transmission. */ +#define SDIOC_CMD13_SEND_STATUS (13U) /*!< Addressed card sends its status register. */ +#define SDIOC_CMD14_HS_BUSTEST_READ (14U) /*!< Reserved */ +#define SDIOC_CMD15_GO_INACTIVE_STATE (15U) /*!< Sends an addressed card into the inactive state. */ +#define SDIOC_CMD16_SET_BLOCKLEN (16U) /*!< Sets the block length (in bytes for SDSC) for all following block commands(read, write). \ + Default block length is fixed to 512 Bytes. Not effective for SDHS and SDXC. */ +#define SDIOC_CMD17_READ_SINGLE_BLOCK (17U) /*!< Reads single block of size selected by SET_BLOCKLEN in case of SDSC, and a block of fixed \ + 512 bytes in case of SDHC and SDXC. */ +#define SDIOC_CMD18_READ_MULTIPLE_BLOCK (18U) /*!< Continuously transfers data blocks from card to host until interrupted by \ + STOP_TRANSMISSION command. */ +#define SDIOC_CMD19_HS_BUSTEST_WRITE (19U) /*!< 64 bytes tuning pattern is sent for SDR50 and SDR104. */ +#define SDIOC_CMD20_WRITE_DAT_UNTIL_STOP (20U) /*!< Speed class control command. */ +#define SDIOC_CMD23_SET_BLOCK_COUNT (23U) /*!< Specify block count for CMD18 and CMD25. */ +#define SDIOC_CMD24_WRITE_SINGLE_BLOCK (24U) /*!< Writes single block of size selected by SET_BLOCKLEN in case of SDSC, and a block of fixed\ + 512 bytes in case of SDHC and SDXC. */ +#define SDIOC_CMD25_WRITE_MULTIPLE_BLOCK (25U) /*!< Continuously writes blocks of data until a STOP_TRANSMISSION follows. */ +#define SDIOC_CMD26_PROGRAM_CID (26U) /*!< Reserved for manufacturers. */ +#define SDIOC_CMD27_PROGRAM_CSD (27U) /*!< Programming of the programmable bits of the CSD. */ +#define SDIOC_CMD28_SET_WRITE_PROT (28U) /*!< Sets the write protection bit of the addressed group. */ +#define SDIOC_CMD29_CLR_WRITE_PROT (29U) /*!< Clears the write protection bit of the addressed group. */ +#define SDIOC_CMD30_SEND_WRITE_PROT (30U) /*!< Asks the card to send the status of the write protection bits. */ +#define SDIOC_CMD32_ERASE_WR_BLK_START (32U) /*!< Sets the address of the first write block to be erased. (For SD card only). */ +#define SDIOC_CMD33_ERASE_WR_BLK_END (33U) /*!< Sets the address of the last write block of the continuous range to be erased. */ +#define SDIOC_CMD35_ERASE_GRP_START (35U) /*!< Sets the address of the first write block to be erased. Reserved for each command system \ + set by switch function command (CMD6). */ +#define SDIOC_CMD36_ERASE_GRP_END (36U) /*!< Sets the address of the last write block of the continuous range to be erased. \ + Reserved for each command system set by switch function command (CMD6). */ +#define SDIOC_CMD38_ERASE (38U) /*!< Reserved for SD security applications. */ +#define SDIOC_CMD39_FAST_IO (39U) /*!< SD card doesn't support it (Reserved). */ +#define SDIOC_CMD40_GO_IRQ_STATE (40U) /*!< SD card doesn't support it (Reserved). */ +#define SDIOC_CMD42_LOCK_UNLOCK (42U) /*!< Sets/resets the password or lock/unlock the card. The size of the data block is set by \ + the SET_BLOCK_LEN command. */ +#define SDIOC_CMD55_APP_CMD (55U) /*!< Indicates to the card that the next command is an application specific command rather \ + than a standard command. */ +#define SDIOC_CMD56_GEN_CMD (56U) /*!< Used either to transfer a data block to the card or to get a data block from the card \ + for general purpose/application specific commands. */ +#define SDIOC_CMD64_NO_CMD (64U) /*!< No command */ + +/** + * @brief Following commands are SD Card Specific commands. + * CMD55_APP_CMD should be sent before sending these commands. + */ +#define SDIOC_ACMD6_SET_BUS_WIDTH (6U) /*!< (ACMD6) Defines the data bus width to be used for data transfer. The allowed data bus \ + widths are given in SCR register. */ +#define SDIOC_ACMD13_SD_STATUS (13U) /*!< (ACMD13) Sends the SD status. */ +#define SDIOC_ACMD22_SEND_NUM_WR_BLOCKS (22U) /*!< (ACMD22) Sends the number of the written (without errors) write blocks. Responds with \ + 32bit+CRC data block. */ +#define SDIOC_ACMD41_SD_APP_OP_COND (41U) /*!< (ACMD41) Sends host capacity support information (HCS) and asks the accessed card to \ + send its operating condition register (OCR) content in the response on the CMD line. */ +#define SDIOC_ACMD42_SET_CLR_CARD_DETECT (42U) /*!< (ACMD42) Connect/Disconnect the 50 KOhm pull-up resistor on CD/DAT3 (pin 1) of the card */ +#define SDIOC_ACMD51_SEND_SCR (51U) /*!< Reads the SD Configuration Register (SCR). */ +#define SDIOC_ACMD52_RW_DIRECT (52U) /*!< For SD I/O card only, reserved for security specification. */ +#define SDIOC_ACMD53_RW_EXTENDED (53U) /*!< For SD I/O card only, reserved for security specification. */ + +/** + * @brief Following commands are SD Card Specific security commands. + * CMD55_APP_CMD should be sent before sending these commands. + */ +#define SDIOC_ACMD43_GET_MKB (43U) +#define SDIOC_ACMD44_GET_MID (44U) +#define SDIOC_ACMD45_SET_CER_RN1 (45U) +#define SDIOC_ACMD46_GET_CER_RN2 (46U) +#define SDIOC_ACMD47_SET_CER_RES2 (47U) +#define SDIOC_ACMD48_GET_CER_RES1 (48U) +#define SDIOC_ACMD18_SECURE_READ_MULTIPLE_BLOCK (18U) +#define SDIOC_ACMD25_SECURE_WRITE_MULTIPLE_BLOCK (25U) +#define SDIOC_ACMD38_SECURE_ERASE (38U) +#define SDIOC_ACMD49_CHANGE_SECURE_AREA (49U) +#define SDIOC_ACMD48_SECURE_WRITE_MKB (48U) +/** + * @} + */ + +/** + * @defgroup SDMMC_Error_Code SDMMC Error Code + * @{ + */ +#define SDMMC_ERROR_NONE (0x00000000UL) /*!< No error */ +#define SDMMC_ERROR_ADDR_OUT_OF_RANGE (0x80000000UL) /*!< Error when addressed block is out of range */ +#define SDMMC_ERROR_ADDR_MISALIGNED (0x40000000UL) /*!< Misaligned address */ +#define SDMMC_ERROR_BLOCK_LEN_ERR (0x20000000UL) /*!< Transferred block length is not allowed for the card or the \ + number of transferred bytes does not match the block length */ +#define SDMMC_ERROR_ERASE_SEQ_ERR (0x10000000UL) /*!< An error in the sequence of erase command occurs */ +#define SDMMC_ERROR_BAD_ERASE_PARAM (0x08000000UL) /*!< An invalid selection for erase groups */ +#define SDMMC_ERROR_WRITE_PROT_VIOLATION (0x04000000UL) /*!< Attempt to program a write protect block */ +#define SDMMC_ERROR_LOCK_UNLOCK_FAILED (0x01000000UL) /*!< Sequence or password error has been detected in unlock command \ + or if there was an attempt to access a locked card */ +#define SDMMC_ERROR_COM_CRC_FAILED (0x00800000UL) /*!< CRC check of the previous command failed */ +#define SDMMC_ERROR_ILLEGAL_CMD (0x00400000UL) /*!< Command is not legal for the card state */ +#define SDMMC_ERROR_CARD_ECC_FAILED (0x00200000UL) /*!< Card internal ECC was applied but failed to correct the data */ +#define SDMMC_ERROR_CC_ERR (0x00100000UL) /*!< Internal card controller error */ +#define SDMMC_ERROR_GENERAL_UNKNOWN_ERR (0x00080000UL) /*!< General or unknown error */ +#define SDMMC_ERROR_STREAM_READ_UNDERRUN (0x00040000UL) /*!< The card could not sustain data reading in stream rmode */ +#define SDMMC_ERROR_STREAM_WRITE_OVERRUN (0x00020000UL) /*!< The card could not sustain data programming in stream mode */ +#define SDMMC_ERROR_CID_CSD_OVERWRITE (0x00010000UL) /*!< CID/CSD overwrite error */ +#define SDMMC_ERROR_WP_ERASE_SKIP (0x00008000UL) /*!< Only partial address space was erased */ +#define SDMMC_ERROR_CARD_ECC_DISABLED (0x00004000UL) /*!< Command has been executed without using internal ECC */ +#define SDMMC_ERROR_ERASE_RESET (0x00002000UL) /*!< Erase sequence was cleared before executing because an out of \ + erase sequence command was received */ +#define SDMMC_ERROR_CMD_AUTO_SEND (0x00001000UL) /*!< An error occurred in sending the command automatically */ +#define SDMMC_ERROR_CMD_INDEX (0x00000800UL) /*!< The received response contains a command number error */ +#define SDMMC_ERROR_CMD_STOP_BIT (0x00000400UL) /*!< Command line detects low level at stop bit */ +#define SDMMC_ERROR_CMD_CRC_FAIL (0x00000200UL) /*!< Command response received (but CRC check failed) */ +#define SDMMC_ERROR_CMD_TIMEOUT (0x00000100UL) /*!< Command response timeout */ +#define SDMMC_ERROR_SWITCH_ERROR (0x00000080UL) /*!< The card did not switch to the expected mode as requested by \ + the SWITCH command */ +#define SDMMC_ERROR_DATA_STOP_BIT (0x00000040UL) /*!< Data line detects low level at stop bit */ +#define SDMMC_ERROR_DATA_CRC_FAIL (0x00000020UL) /*!< Data block sent/received (CRC check failed) */ +#define SDMMC_ERROR_DATA_TIMEOUT (0x00000010UL) /*!< Data timeout */ +#define SDMMC_ERROR_AKE_SEQ_ERR (0x00000008UL) /*!< Error in sequence of authentication */ +#define SDMMC_ERROR_INVALID_VOLTRANGE (0x00000004UL) /*!< Error in case of invalid voltage range */ +#define SDMMC_ERROR_REQUEST_NOT_APPLICABLE (0x00000002UL) /*!< Error when command request is not applicable */ +#define SDMMC_ERROR_UNSUPPORTED_FEATURE (0x00000001UL) /*!< Error when feature is not insupported */ + +#define SDMMC_CARD_ERROR_BITS_MASK (0xFDFFE048UL) /*!< SD/MMC Error status bits mask */ +/** + * @} + */ + +/** + * @defgroup SDMMC_Card_Status_Bit SDMMC Card Status Bit + * @{ + */ +#define SDMMC_STATUS_CARD_IS_LOCKED_POS (24U) +#define SDMMC_STATUS_CARD_IS_LOCKED (0x02000000UL) /*!< When set, signals that the card is locked by the host */ +#define SDMMC_STATUS_CURRENT_STATE_POS (9U) +#define SDMMC_STATUS_CURRENT_STATE (0x00001E00UL) /*!< The state of the card when receiving the command */ +#define SDMMC_STATUS_READY_FOR_DATA_POS (8U) +#define SDMMC_STATUS_READY_FOR_DATA (0x00000100UL) /*!< Corresponds to buffer empty signaling on the bus */ +#define SDMMC_STATUS_APP_CMD_POS (5U) +#define SDMMC_STATUS_APP_CMD (0x00000020UL) /*!< The card will expect ACMD, or an indication that the command has been interpreted as ACMD */ +/** + * @} + */ + +/** + * @defgroup SDMMC_SCR_Register SDMMC SCR Register + * @{ + */ +#define SDMMC_SCR_PHY_SPEC_VER_1P0 (0x00000000UL) +#define SDMMC_SCR_PHY_SPEC_VER_1P1 (0x01000000UL) +#define SDMMC_SCR_PHY_SPEC_VER_2P0 (0x02000000UL) +#define SDMMC_SCR_BUS_WIDTH_4BIT (0x00040000UL) +#define SDMMC_SCR_BUS_WIDTH_1BIT (0x00010000UL) +/** + * @} + */ + +/** + * @defgroup SDMMC_OCR_Register SDMMC OCR Register + * @{ + */ +#define SDMMC_OCR_HIGH_CAPACITY (0x40000000UL) +#define SDMMC_OCR_STD_CAPACITY (0x00000000UL) +/** + * @} + */ + +/** + * @defgroup SDMMC_CSD_Register SDMMC CSD Register + * @{ + */ +/* Command Class supported */ +#define SDMMC_CSD_SUPPORT_CLASS5_ERASE (0x00000020UL) +/** + * @} + */ + +/** + * @defgroup SDMMC_Common_Parameter SDMMC Common Parameter + * @{ + */ +#define SDMMC_DATA_TIMEOUT (0x0000FFFFUL) +#define SDMMC_MAX_VOLTAGE_TRIAL (0x0000FFFFUL) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup SDIOC_Global_Functions + * @{ + */ +en_result_t SDIOC_DeInit(M4_SDIOC_TypeDef *SDIOCx); +en_result_t SDIOC_Init(M4_SDIOC_TypeDef *SDIOCx, const stc_sdioc_init_t *pstcSdiocInit); +en_result_t SDIOC_StructInit(stc_sdioc_init_t *pstcSdiocInit); +en_result_t SDIOC_SoftwareReset(M4_SDIOC_TypeDef *SDIOCx, uint8_t u8ResetType); +void SDIOC_PowerCmd(M4_SDIOC_TypeDef *SDIOCx, en_functional_state_t enNewSta); +en_functional_state_t SDIOC_GetPowerState(const M4_SDIOC_TypeDef *SDIOCx); +uint32_t SDIOC_GetMode(const M4_SDIOC_TypeDef *SDIOCx); +void SDIOC_ClockCmd(M4_SDIOC_TypeDef *SDIOCx, en_functional_state_t enNewSta); +void SDIOC_SetClockDiv(M4_SDIOC_TypeDef *SDIOCx, uint16_t u16ClkDiv); +en_result_t SDIOC_GetOptimumClockDiv(uint32_t u32ClkFreq, uint16_t *pu16ClkDiv); +en_result_t SDIOC_VerifyClockDiv(uint32_t u32Mode, uint8_t u8SpeedMode, uint16_t u16ClkDiv); +en_functional_state_t SDIOC_GetDeviceInsertState(const M4_SDIOC_TypeDef *SDIOCx); +void SDIOC_SetSpeedMode(M4_SDIOC_TypeDef *SDIOCx, uint8_t u8SpeedMode); +void SDIOC_SetBusWidth(M4_SDIOC_TypeDef *SDIOCx, uint8_t u8BusWidth); +void SDIOC_SetCardDetectSource(M4_SDIOC_TypeDef *SDIOCx, uint8_t u8Src); +void SDIOC_SetCardDetectTestLevel(M4_SDIOC_TypeDef *SDIOCx, uint8_t u8Level); + +en_result_t SDIOC_SendCommand(M4_SDIOC_TypeDef *SDIOCx, const stc_sdioc_cmd_init_t *pstcCmd); +en_result_t SDIOC_CmdStructInit(stc_sdioc_cmd_init_t *pstcCmd); +en_result_t SDIOC_GetResponse(M4_SDIOC_TypeDef *SDIOCx, uint8_t u8RespReg, uint32_t *pu32RespVal); +en_result_t SDIOC_ConfigData(M4_SDIOC_TypeDef *SDIOCx, const stc_sdioc_data_init_t *pstcData); +en_result_t SDIOC_DataStructInit(stc_sdioc_data_init_t *pstcData); +en_result_t SDIOC_ReadBuffer(M4_SDIOC_TypeDef *SDIOCx, uint8_t au8Data[], uint32_t u32Len); +en_result_t SDIOC_WriteBuffer(M4_SDIOC_TypeDef *SDIOCx, const uint8_t au8Data[], uint32_t u32Len); + +void SDIOC_BlockGapStopCmd(M4_SDIOC_TypeDef *SDIOCx, en_functional_state_t enNewSta); +void SDIOC_RestartTransfer(M4_SDIOC_TypeDef *SDIOCx); +void SDIOC_ReadWaitCmd(M4_SDIOC_TypeDef *SDIOCx, en_functional_state_t enNewSta); +void SDIOC_BlockGapInterruptCmd(M4_SDIOC_TypeDef *SDIOCx, en_functional_state_t enNewSta); + +void SDIOC_IntCmd(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32IntSrc, en_functional_state_t enNewSta); +en_functional_state_t SDIOC_GetIntEnableState(const M4_SDIOC_TypeDef *SDIOCx, uint32_t u32IntSrc); +en_flag_status_t SDIOC_GetIntStatus(const M4_SDIOC_TypeDef *SDIOCx, uint32_t u32Flag); +void SDIOC_ClearIntStatus(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32Flag); +void SDIOC_IntStatusCmd(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32IntSrc, en_functional_state_t enNewSta); +en_flag_status_t SDIOC_GetHostStatus(const M4_SDIOC_TypeDef *SDIOCx, uint32_t u32Flag); +en_flag_status_t SDIOC_GetAutoCmdErrorStatus(const M4_SDIOC_TypeDef *SDIOCx, uint16_t u16Flag); +void SDIOC_ForceAutoCmdErrorEvent(M4_SDIOC_TypeDef *SDIOCx, uint16_t u16CmdFlag); +void SDIOC_ForceErrorInterruptEvent(M4_SDIOC_TypeDef *SDIOCx, uint16_t u16IntFlag); + +/* SDMMC Commands management functions */ +en_result_t SDMMC_CMD0_GoIdleState(M4_SDIOC_TypeDef *SDIOCx, uint32_t *pu32ErrSta); +en_result_t SDMMC_CMD2_AllSendCID(M4_SDIOC_TypeDef *SDIOCx, uint32_t *pu32ErrSta); +en_result_t SDMMC_CMD3_SendRelativeAddr(M4_SDIOC_TypeDef *SDIOCx, uint16_t *pu16RCA, uint32_t *pu32ErrSta); +en_result_t SDMMC_CMD6_SwitchFunc(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32Argument, uint32_t *pu32ErrSta); +en_result_t SDMMC_CMD7_SelectDeselectCard(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32RCA, uint32_t *pu32ErrSta); +en_result_t SDMMC_CMD8_SendInterfaceCond(M4_SDIOC_TypeDef *SDIOCx, uint32_t *pu32ErrSta); +en_result_t SDMMC_CMD9_SendCSD(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32RCA, uint32_t *pu32ErrSta); +en_result_t SDMMC_CMD12_StopTransmission(M4_SDIOC_TypeDef *SDIOCx, uint32_t *pu32ErrSta); +en_result_t SDMMC_CMD13_SendStatus(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32RCA, uint32_t *pu32ErrSta); +en_result_t SDMMC_CMD16_SetBlockLength(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32BlockLen, uint32_t *pu32ErrSta); +en_result_t SDMMC_CMD17_ReadSingleBlock(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32ReadAddr, uint32_t *pu32ErrSta); +en_result_t SDMMC_CMD18_ReadMultipleBlock(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32ReadAddr, uint32_t *pu32ErrSta); +en_result_t SDMMC_CMD24_WriteSingleBlock(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32WriteAddr, uint32_t *pu32ErrSta); +en_result_t SDMMC_CMD25_WriteMultipleBlock(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32WriteAddr, uint32_t *pu32ErrSta); +en_result_t SDMMC_CMD32_EraseBlockStartAddr(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32StartAddr, uint32_t *pu32ErrSta); +en_result_t SDMMC_CMD33_EraseBlockEndAddr(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32EndAddr, uint32_t *pu32ErrSta); +en_result_t SDMMC_CMD38_Erase(M4_SDIOC_TypeDef *SDIOCx, uint32_t *pu32ErrSta); +en_result_t SDMMC_CMD55_AppCmd(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32Argument, uint32_t *pu32ErrSta); + +en_result_t SDMMC_ACMD6_SetBusWidth(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32BusWidth, uint32_t *pu32ErrSta); +en_result_t SDMMC_ACMD13_SendStatus(M4_SDIOC_TypeDef *SDIOCx, uint32_t *pu32ErrSta); +en_result_t SDMMC_ACMD41_SendOperatCond(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32Argument, uint32_t *pu32ErrSta); +en_result_t SDMMC_ACMD51_SendSCR(M4_SDIOC_TypeDef *SDIOCx, uint32_t *pu32ErrSta); + +en_result_t SDMMC_CMD1_SendOperatCond(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32Argument, uint32_t *pu32ErrSta); +en_result_t SDMMC_CMD35_EraseGroupStartAddr(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32StartAddr, uint32_t *pu32ErrSta); +en_result_t SDMMC_CMD36_EraseGroupEndAddr(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32EndAddr, uint32_t *pu32ErrSta); + +/** + * @} + */ + +#endif /* DDL_SDIOC_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_SDIOC_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_smc.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_smc.h new file mode 100644 index 0000000000..d6f4013aee --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_smc.h @@ -0,0 +1,379 @@ +/** + ******************************************************************************* + * @file hc32f4a0_smc.h + * @brief This file contains all the functions prototypes of the EXMC SMC + * (External Memory Controller: Static Memory Controller) driver library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Hongjh First version + 2020-07-14 Hongjh Merge API from EXMC_SMC_Enable/Disable to EXMC_SMC_Cmd + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_SMC_H__ +#define __HC32F4A0_SMC_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_EXMC_SMC + * @{ + */ + +#if (DDL_SMC_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup EXMC_SMC_Global_Types Static Memory Controller Global Types + * @{ + */ + +/** + * @brief EXMC SMC Chip Configuration Structure definition + */ +typedef struct +{ + uint32_t u32ReadMode; /*!< Defines the read sync enable. + This parameter can be a value of @ref EXMC_SMC_Memory_Read_Mode */ + + uint32_t u32WriteMode; /*!< Defines the write sync enable. + This parameter can be a value of @ref EXMC_SMC_Memory_Write_Mode */ + + uint32_t u32ReadBurstLen; /*!< Defines the number of read data access. + This parameter can be a value of @ref EXMC_SMC_Memory_Read_Burst_Length. */ + + uint32_t u32WriteBurstLen; /*!< Defines the number of write data access. + This parameter can be a value of @ref EXMC_SMC_Memory_Write_Burst_Length. */ + + uint32_t u32SmcMemWidth; /*!< Defines the SMC memory width. + This parameter can be a value of @ref EXMC_SMC_Memory_Width. */ + + uint32_t u32BAA; /*!< Defines the SMC BAA signal enable. + This parameter can be a value of @ref EXMC_SMC_BAA_Port_Selection. */ + + uint32_t u32ADV; /*!< Defines the SMC ADVS signal enable. + This parameter can be a value of @ref EXMC_SMC_ADV_Port_Selection. */ + + uint32_t u32BLS; /*!< Defines the SMC BLS signal selection. + This parameter can be a value of @ref EXMC_SMC_BLS_Synchronization_Selection. */ + + uint32_t u32AddressMask; /*!< Defines the address mask. + This parameter can be a value between Min_Data = 0 and Max_Data = 0xFF */ + + uint32_t u32AddressMatch; /*!< Defines the address match. + This parameter can be a value between Min_Data = 0x60 and Max_Data = 0x7F */ +}stc_exmc_smc_chip_cfg_t; + +/** + * @brief EXMC SMC Timing Configuration Structure definition + */ +typedef struct +{ + uint32_t u32RC; /*!< Defines the RC in memory clock cycles. + This parameter can be a value between Min_Data = 0 and Max_Data = 0x0F */ + + uint32_t u32WC; /*!< Defines the WC in memory clock cycles. + This parameter can be a value between Min_Data = 0 and Max_Data = 0x0F */ + + uint32_t u32CEOE; /*!< Defines the CEOE in memory clock cycles. + This parameter can be a value between Min_Data = 0 and Max_Data = 7 */ + + uint32_t u32WP; /*!< Defines the WP in memory clock cycles. + This parameter can be a value between Min_Data = 0 and Max_Data = 7 */ + + uint32_t u32PC; /*!< Defines the PC in memory clock cycles. + This parameter can be a value between Min_Data = 0 and Max_Data = 7 */ + + uint32_t u32TR; /*!< Defines the TR in memory clock cycles. + This parameter can be a value between Min_Data = 0 and Max_Data = 7 */ +} stc_exmc_smc_timing_cfg_t; + +/** + * @brief EXMC SMC Initialization Structure definition + */ +typedef struct +{ + stc_exmc_smc_chip_cfg_t stcChipCfg; /*!< SMC memory chip configure. + This structure details refer @ref stc_exmc_smc_chip_cfg_t. */ + + stc_exmc_smc_timing_cfg_t stcTimingCfg; /*!< SMC memory timing configure. + This structure details refer @ref stc_exmc_smc_timing_cfg_t. */ +} stc_exmc_smc_init_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup EXMC_SMC_Global_Macros Static Memory Controller Global Macros + * @{ + */ + +/** + * @defgroup EXMC_SMC_Chip EXMC SMC Chip + * @{ + */ +#define EXMC_SMC_CHIP_0 (0UL) /*!< Chip 0 */ +#define EXMC_SMC_CHIP_1 (1UL) /*!< Chip 1 */ +#define EXMC_SMC_CHIP_2 (2UL) /*!< Chip 2 */ +#define EXMC_SMC_CHIP_3 (3UL) /*!< Chip 3 */ +/** + * @} + */ + +/** + * @defgroup EXMC_SMC_Memory_Read_Mode EXMC SMC Memory Read Mode + * @{ + */ +#define EXMC_SMC_MEM_READ_ASYNC (0UL) +#define EXMC_SMC_MEM_READ_SYNC (SMC_CPCR_RSYN) +/** + * @} + */ + +/** + * @defgroup EXMC_SMC_Memory_Write_Mode EXMC SMC Memory Write Mode + * @{ + */ +#define EXMC_SMC_MEM_WRITE_ASYNC (0UL) +#define EXMC_SMC_MEM_WRITE_SYNC (SMC_CPCR_WSYN) +/** + * @} + */ + +/** + * @defgroup EXMC_SMC_Memory_Read_Burst_Length EXMC SMC Memory Read Burst Length + * @{ + */ +#define EXMC_SMC_MEM_READ_BURST_1 (0UL) /*!< 1 beat */ +#define EXMC_SMC_MEM_READ_BURST_4 (SMC_CPCR_RBL_0) /*!< 4 beats */ +#define EXMC_SMC_MEM_READ_BURST_8 (SMC_CPCR_RBL_1) /*!< 8 beats */ +#define EXMC_SMC_MEM_READ_BURST_16 (SMC_CPCR_RBL_1 | \ + SMC_CPCR_RBL_0) /*!< 16 beats */ +#define EXMC_SMC_MEM_READ_BURST_32 (SMC_CPCR_RBL_2) /*!< 32 beats */ +#define EXMC_SMC_MEM_READ_BURST_CONTINUOUS (SMC_CPCR_RBL_2 | \ + SMC_CPCR_RBL_0) /*!< continuous */ +/** + * @} + */ + +/** + * @defgroup EXMC_SMC_Memory_Write_Burst_Length EXMC SMC Memory Write Burst Length + * @{ + */ +#define EXMC_SMC_MEM_WRITE_BURST_1 (0UL) /*!< 1 beat */ +#define EXMC_SMC_MEM_WRITE_BURST_4 (SMC_CPCR_WBL_0) /*!< 4 beats */ +#define EXMC_SMC_MEM_WRITE_BURST_8 (SMC_CPCR_WBL_1) /*!< 8 beats */ +#define EXMC_SMC_MEM_WRITE_BURST_16 (SMC_CPCR_WBL_1 | \ + SMC_CPCR_WBL_0) /*!< 16 beats */ +#define EXMC_SMC_MEM_WRITE_BURST_32 (SMC_CPCR_WBL_2) /*!< 32 beats */ +#define EXMC_SMC_MEM_WRITE_BURST_CONTINUOUS (SMC_CPCR_WBL_2 | \ + SMC_CPCR_WBL_0) /*!< continuous */ +/** + * @} + */ + +/** + * @defgroup EXMC_SMC_Memory_Width EXMC SMC Memory Width + * @{ + */ +#define EXMC_SMC_MEMORY_WIDTH_16BIT (SMC_CPCR_MW_0) +#define EXMC_SMC_MEMORY_WIDTH_32BIT (SMC_CPCR_MW_1) +/** + * @} + */ + +/** + * @defgroup EXMC_SMC_BAA_Port_Selection EXMC SMC BAA Port Selection + * @{ + */ +#define EXMC_SMC_BAA_PORT_DISABLE (0UL) +#define EXMC_SMC_BAA_PORT_ENABLE (SMC_CPCR_BAAS) +/** + * @} + */ + +/** + * @defgroup EXMC_SMC_ADV_Port_Selection EXMC SMC ADV Port Selection + * @{ + */ +#define EXMC_SMC_ADV_PORT_DISABLE (0UL) +#define EXMC_SMC_ADV_PORT_ENABLE (SMC_CPCR_ADVS) +/** + * @} + */ + +/** + * @defgroup EXMC_SMC_BLS_Synchronization_Selection EXMC SMC BLS Synchronization Selection + * @{ + */ +#define EXMC_SMC_BLS_SYNC_CS (0UL) +#define EXMC_SMC_BLS_SYNC_WE (SMC_CPCR_BLSS) +/** + * @} + */ + +/** + * @defgroup EXMC_SMC_Command EXMC SMC Command + * @{ + */ +#define EXMC_SMC_CMD_MDREGCONFIG (SMC_CMDR_CMD_0) /*!< Command: MdRetConfig */ +#define EXMC_SMC_CMD_UPDATEREGS (SMC_CMDR_CMD_1) /*!< Command: UpdateRegs */ +#define EXMC_SMC_CMD_MDREGCONFIG_AND_UPDATEREGS (SMC_CMDR_CMD) /*!< Command: MdRetConfig & UpdateRegs */ +/** + * @} + */ + +/** + * @defgroup EXMC_SMC_CRE_Polarity EXMC SMC CRE Polarity + * @{ + */ +#define EXMC_SMC_CRE_POLARITY_LOW (0UL) /*!< CRE is LOW */ +#define EXMC_SMC_CRE_POLARITY_HIGH (SMC_CMDR_CRES) /*!< CRE is HIGH when ModeReg write occurs */ +/** + * @} + */ + +/** + * @defgroup EXMC_SMC_Status EXMC SMC Status + * @{ + */ +#define EXMC_SMC_READY (0UL) /*!< SMC is ready */ +#define EXMC_SMC_LOWPOWER (SMC_STSR_STATUS) /*!< SMC is low power */ +/** + * @} + */ + +/** + * @brief SMC device memory address shifting. + * @param [in] mem_base_address SMC base address + * @param [in] mem_width SMC memory width + * @param [in] address SMC device memory address + * @retval SMC device shifted address value + */ +#define SMC_ADDR_SHIFT(mem_base_address, mem_width, address) \ +( ((EXMC_SMC_MEMORY_WIDTH_16BIT == (mem_width))? (((mem_base_address) + ((address) << 1UL))):\ + (((mem_base_address) + ((address) << 2UL))))) + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup EXMC_SMC_Global_Functions + * @{ + */ + +/** + * @brief SMC entry low power state + * @param None + * @retval None + */ +__STATIC_INLINE void EXMC_SMC_EntryLowPower(void) +{ + WRITE_REG32(M4_SMC->STCR0, SMC_STCR0_LPWIR); +} + +/** + * @brief SMC exit low power state + * @param None + * @retval None + */ +__STATIC_INLINE void EXMC_SMC_ExitLowPower(void) +{ + WRITE_REG32(M4_SMC->STCR1, SMC_STCR1_LPWOR); +} + +/** + * @brief Get SMC status + * @param None + * @retval Returned value can be one of the following values: + * @arg EXMC_SMC_READY: SMC is ready + * @arg EXMC_SMC_LOWPOWER: SMC is low power + */ +__STATIC_INLINE uint32_t EXMC_SMC_GetStatus(void) +{ + return READ_REG32_BIT(M4_SMC->STSR, SMC_STSR_STATUS); +} + +/* Initialization and configuration EXMC SMC functions */ +en_result_t EXMC_SMC_Init(uint32_t u32Chip, const stc_exmc_smc_init_t *pstcInit); +void EXMC_SMC_DeInit(void); +en_result_t EXMC_SMC_StructInit(stc_exmc_smc_init_t *pstcInit); + +void EXMC_SMC_Cmd(en_functional_state_t enNewState); +void EXMC_SMC_SetCommand(uint32_t u32Chip, + uint32_t u32Cmd, + uint32_t u32CrePolarity, + uint32_t u32Address); + +uint32_t EXMC_SMC_ChipStartAddress(uint32_t u32Chip); +uint32_t EXMC_SMC_ChipEndAddress(uint32_t u32Chip); + +en_result_t EXMC_SMC_CheckChipStatus(uint32_t u32Chip, + const stc_exmc_smc_chip_cfg_t *pstcChipCfg); +en_result_t EXMC_SMC_CheckTimingStatus(uint32_t u32Chip, + const stc_exmc_smc_timing_cfg_t *pstcTimingCfg); + +void EXMC_SMC_PinMuxCmd(en_functional_state_t enNewState); +void EXMC_SMC_SetRefreshPeriod(uint32_t u32PeriodVal); + +/** + * @} + */ + +#endif /* DDL_SMC_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_SMC_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_spi.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_spi.h new file mode 100644 index 0000000000..2e372bb3ec --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_spi.h @@ -0,0 +1,446 @@ +/** + ******************************************************************************* + * @file hc32f4a0_spi.h + * @brief This file contains all the functions prototypes of the SPI driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Wangmin First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_SPI_H__ +#define __HC32F4A0_SPI_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_SPI + * @{ + */ + +#if (DDL_SPI_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup SPI_Global_Types SPI Global Types + * @{ + */ + +/** + * @brief Structure definition of SPI initialization. + */ +typedef struct +{ + uint32_t u32WireMode; /*!< SPI wire mode, 3 wire mode or 4 wire mode. + This parameter can be a value of @ref SPI_Wire_Mode_Define */ + uint32_t u32TransMode; /*!< SPI transfer mode, send only or full duplex. + This parameter can be a value of @ref SPI_Transfer_Mode_Define */ + uint32_t u32MasterSlave; /*!< SPI master/slave mode. + This parameter can be a value of @ref SPI_Master_Slave_Mode_Define */ + uint32_t u32SuspMode; /*!< SPI communication suspend function. + This parameter can be a value of @ref SPI_Communication_Suspend_Function_Define */ + uint32_t u32Modfe; /*!< SPI mode fault detect command. + This parameter can be a value of @ref SPI_Mode_Fault_Dectet_Command_Define */ + uint32_t u32Parity; /*!< SPI parity check selection. + This parameter can be a value of @ref SPI_Parity_Check_Define */ + uint32_t u32SpiMode; /*!< SPI mode. + This parameter can be a value of @ref SPI_Mode_Define */ + uint32_t u32BaudRatePrescaler; /*!< SPI baud rate prescaler. + This parameter can be a value of @ref SPI_Baud_Rate_Prescaler_Define */ + uint32_t u32DataBits; /*!< SPI data bits, 4 bits ~ 32 bits. + This parameter can be a value of @ref SPI_Data_Size_Define */ + uint32_t u32FirstBit; /*!< MSB first or LSB first. + This parameter can be a value of @ref SPI_First_Bit_Define */ + uint32_t u32FrameLevel; /*!< SPI frame level, SPI_FRAME_1 ~ SPI_FRAME_4. + This parameter can be a value of @ref SPI_Frame_Level_Define */ +} stc_spi_init_t; + +/** + * @brief Structure definition of SPI delay time configuration. + */ +typedef struct +{ + uint32_t u32IntervalDelay; /*!< SPI interval time delay (Next access delay time) + This parameter can be a value of @ref SPI_Interval_Delay_Time_define */ + uint32_t u32ReleaseDelay; /*!< SPI release time delay (SCK invalid delay time) + This parameter can be a value of @ref SPI_Release_Delay_Time_define */ + uint32_t u32SetupDelay; /*!< SPI Setup time delay (SCK valid delay time) define + This parameter can be a value of @ref SPI_Setup_Delay_Time_define */ +} stc_spi_delay_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup SPI_Global_Macros SPI Global Macros + * @{ + */ + +/** + * @defgroup SPI_Wire_Mode_Define SPI wire mode define + * @{ + */ +#define SPI_WIRE_4 (0UL) +#define SPI_WIRE_3 (SPI_CR1_SPIMDS) +/** + * @} + */ + +/** + * @defgroup SPI_Transfer_Mode_Define SPI transfer mode define + * @{ + */ +#define SPI_FULL_DUPLEX (0UL) /*!< Full duplex. */ +#define SPI_SEND_ONLY (SPI_CR1_TXMDS) /*!< Send only. */ +/** + * @} + */ + +/** + * @defgroup SPI_Master_Slave_Mode_Define SPI master slave mode define + * @{ + */ +#define SPI_SLAVE (0UL) +#define SPI_MASTER (SPI_CR1_MSTR) +/** + * @} + */ + +/** + * @defgroup SPI_Loopback_Selection_Define SPI loopback selection define + * @note Loopback mode is mainly used for parity self-diagnosis in 4-wire full-duplex mode. + * @{ + */ +#define SPI_SPLPBK_INVALID (0UL) +#define SPI_SPLPBK_MOSI_INVERT (SPI_CR1_SPLPBK) /*!< MISO data is the inverse of the data output by MOSI. */ +#define SPI_SPLPBK_MOSI (SPI_CR1_SPLPBK2) /*!< MISO data is the data output by MOSI. */ +/** + * @} + */ + +/** + * @defgroup SPI_Communication_Suspend_Function_Define SPI communication suspend function define + * @{ + */ +#define SPI_COM_SUSP_FUNC_OFF (0UL) +#define SPI_COM_SUSP_FUNC_ON (SPI_CR1_CSUSPE) +/** + * @} + */ + +/** + * @defgroup SPI_Interrupt_Type_Define SPI interrupt type define + * @{ + */ +#define SPI_INT_ERROR (SPI_CR1_EIE) /*!< Including overload, underload and parity error. */ +#define SPI_INT_TX_BUFFER_EMPTY (SPI_CR1_TXIE) +#define SPI_INT_RX_BUFFER_FULL (SPI_CR1_RXIE) +#define SPI_INT_IDLE (SPI_CR1_IDIE) +/** + * @} + */ + +/** + * @defgroup SPI_Mode_Fault_Dectet_Command_Define SPI mode fault dectect command define + * @{ + */ +#define SPI_MODFE_DISABLE (0UL) /*!< Disable mode fault detection. */ +#define SPI_MODFE_ENABLE (SPI_CR1_MODFE) /*!< Enable mode fault detection. */ +/** + * @} + */ + +/** + * @defgroup SPI_Parity_Check_Error_Self_Diagnosis_Define SPI parity check error self diagnosis define + * @{ + */ +#define SPI_PATE_DISABLE (0UL) /*!< Disable self diagnosis of parity check. */ +#define SPI_PATE_ENABLE (SPI_CR1_PATE) /*!< Enable self diagnosis of parity check. */ +/** + * @} + */ + +/** + * @defgroup SPI_Parity_Check_Define SPI parity check mode define + * @{ + */ +#define SPI_PARITY_INVALID (0UL) /*!< Parity check invalid. */ +#define SPI_PARITY_EVEN (SPI_CR1_PAE) /*!< Parity check selection even parity. */ +#define SPI_PARITY_ODD (SPI_CR1_PAE | SPI_CR1_PAOE) /*!< Parity check selection odd parity. */ +/** + * @} + */ + +/** + * @defgroup SPI_Interval_Delay_Time_define SPI interval time delay (Next access delay time) define + * @{ + */ +#define SPI_INTERVAL_TIME_1SCK_2PCLK1 (0UL) +#define SPI_INTERVAL_TIME_2SCK_2PCLK1 (SPI_CFG1_MIDI_0) +#define SPI_INTERVAL_TIME_3SCK_2PCLK1 (SPI_CFG1_MIDI_1) +#define SPI_INTERVAL_TIME_4SCK_2PCLK1 (SPI_CFG1_MIDI_1 | SPI_CFG1_MIDI_0) +#define SPI_INTERVAL_TIME_5SCK_2PCLK1 (SPI_CFG1_MIDI_2) +#define SPI_INTERVAL_TIME_6SCK_2PCLK1 (SPI_CFG1_MIDI_2 | SPI_CFG1_MIDI_0) +#define SPI_INTERVAL_TIME_7SCK_2PCLK1 (SPI_CFG1_MIDI_2 | SPI_CFG1_MIDI_1) +#define SPI_INTERVAL_TIME_8SCK_2PCLK1 (SPI_CFG1_MIDI_2 | SPI_CFG1_MIDI_1 | SPI_CFG1_MIDI_0) +/** + * @} + */ + +/** + * @defgroup SPI_Release_Delay_Time_define SPI release time delay (SCK invalid delay time) define + * @{ + */ +#define SPI_RELEASE_TIME_1SCK (0UL) +#define SPI_RELEASE_TIME_2SCK (SPI_CFG1_MSSDL_0) +#define SPI_RELEASE_TIME_3SCK (SPI_CFG1_MSSDL_1) +#define SPI_RELEASE_TIME_4SCK (SPI_CFG1_MSSDL_1 | SPI_CFG1_MSSDL_0) +#define SPI_RELEASE_TIME_5SCK (SPI_CFG1_MSSDL_2) +#define SPI_RELEASE_TIME_6SCK (SPI_CFG1_MSSDL_2 | SPI_CFG1_MSSDL_0) +#define SPI_RELEASE_TIME_7SCK (SPI_CFG1_MSSDL_2 | SPI_CFG1_MSSDL_1) +#define SPI_RELEASE_TIME_8SCK (SPI_CFG1_MSSDL_2 | SPI_CFG1_MSSDL_1 | SPI_CFG1_MSSDL_0) +/** + * @} + */ + +/** + * @defgroup SPI_Setup_Delay_Time_define SPI Setup time delay (SCK valid delay time) define + * @{ + */ +#define SPI_SETUP_TIME_1SCK (0UL) +#define SPI_SETUP_TIME_2SCK (SPI_CFG1_MSSI_0) +#define SPI_SETUP_TIME_3SCK (SPI_CFG1_MSSI_1) +#define SPI_SETUP_TIME_4SCK (SPI_CFG1_MSSI_1 | SPI_CFG1_MSSI_0) +#define SPI_SETUP_TIME_5SCK (SPI_CFG1_MSSI_2) +#define SPI_SETUP_TIME_6SCK (SPI_CFG1_MSSI_2 | SPI_CFG1_MSSI_0) +#define SPI_SETUP_TIME_7SCK (SPI_CFG1_MSSI_2 | SPI_CFG1_MSSI_1) +#define SPI_SETUP_TIME_8SCK (SPI_CFG1_MSSI_2 | SPI_CFG1_MSSI_1 | SPI_CFG1_MSSI_0) +/** + * @} + */ + +/** + * @defgroup SPI_SS_Pin_Define SPI SSx define + * @{ + */ +#define SPI_PIN_SS0 (SPI_CFG1_SS0PV) +#define SPI_PIN_SS1 (SPI_CFG1_SS1PV) +#define SPI_PIN_SS2 (SPI_CFG1_SS2PV) +#define SPI_PIN_SS3 (SPI_CFG1_SS3PV) +/** + * @} + */ + +/** + * @defgroup SPI_SS_Active_Level_Define SPI SSx Active Level define + * @{ + */ +#define SPI_SS_ACTIVE_LOW (0UL) /*!< SS pin active low. */ +#define SPI_SS_ACTIVE_HIGH (1UL) /*!< SS pin active high. */ +/** + * @} + */ + +/** + * @defgroup SPI_Read_Target_Buffer_Define SPI read data register target buffer define + * @{ + */ +#define SPI_RD_TARGET_RD_BUF (0UL) /*!< Read RX buffer. */ +#define SPI_RD_TARGET_WR_BUF (SPI_CFG1_SPRDTD) /*!< Read TX buffer. */ +/** + * @} + */ + +/** + * @defgroup SPI_Frame_Level_Define SPI data frame level define, The Data in the + * SPI_DR register will be send to TX_BUFF after + * enough data frame write to the SPI_DR + * @{ + */ +#define SPI_FRAME_1 (0UL) /*!< Data 1 frame */ +#define SPI_FRAME_2 (SPI_CFG1_FTHLV_0) /*!< Data 2 frame.*/ +#define SPI_FRAME_3 (SPI_CFG1_FTHLV_1) /*!< Data 3 frame.*/ +#define SPI_FRAME_4 (SPI_CFG1_FTHLV_0 | SPI_CFG1_FTHLV_1) /*!< Data 4 frame.*/ +/** + * @} + */ + +/** + * @defgroup SPI_Mode_Define SPI Mode define + * @{ + */ +/* SCK pin output low in idle state; MOSI/MISO pin data valid in odd edge , MOSI/MISO pin data change in even edge */ +#define SPI_MODE_0 (0UL) +/* SCK pin output low in idle state; MOSI/MISO pin data valid in even edge , MOSI/MISO pin data change in odd edge */ +#define SPI_MODE_1 (SPI_CFG2_CPHA) +/* SCK pin output high in idle state; MOSI/MISO pin data valid in odd edge , MOSI/MISO pin data change in even edge */ +#define SPI_MODE_2 (SPI_CFG2_CPOL) +/* SCK pin output high in idle state; MOSI/MISO pin data valid in even edge , MOSI/MISO pin data change in odd edge */ +#define SPI_MODE_3 (SPI_CFG2_CPOL | SPI_CFG2_CPHA) +/** + * @} + */ + +/** + * @defgroup SPI_Baud_Rate_Prescaler_Define SPI baudrate prescaler define + * @{ + */ +#define SPI_BR_PCLK1_DIV2 (0UL) /*!< SPI baud rate is the pclk1 divided by 2. */ +#define SPI_BR_PCLK1_DIV4 (SPI_CFG2_MBR_0) /*!< SPI baud rate is the pclk1 clock divided by 4. */ +#define SPI_BR_PCLK1_DIV8 (SPI_CFG2_MBR_1) /*!< SPI baud rate is the pclk1 clock divided by 8. */ +#define SPI_BR_PCLK1_DIV16 (SPI_CFG2_MBR_1 | SPI_CFG2_MBR_0) /*!< SPI baud rate is the pclk1 clock divided by 16. */ +#define SPI_BR_PCLK1_DIV32 (SPI_CFG2_MBR_2) /*!< SPI baud rate is the pclk1 clock divided by 32. */ +#define SPI_BR_PCLK1_DIV64 (SPI_CFG2_MBR_2 | SPI_CFG2_MBR_0) /*!< SPI baud rate is the pclk1 clock divided by 64. */ +#define SPI_BR_PCLK1_DIV128 (SPI_CFG2_MBR_2 | SPI_CFG2_MBR_1) /*!< SPI baud rate is the pclk1 clock divided by 128. */ +#define SPI_BR_PCLK1_DIV256 (SPI_CFG2_MBR_2 | SPI_CFG2_MBR_1 | SPI_CFG2_MBR_0) /*!< SPI baud rate is the pclk1 divided by 256. */ +/** + * @} + */ + +/** + * @defgroup SPI_Data_Size_Define SPI data size define + * @{ + */ +#define SPI_DATA_SIZE_4BIT (0UL) +#define SPI_DATA_SIZE_5BIT (SPI_CFG2_DSIZE_0) +#define SPI_DATA_SIZE_6BIT (SPI_CFG2_DSIZE_1) +#define SPI_DATA_SIZE_7BIT (SPI_CFG2_DSIZE_0 | SPI_CFG2_DSIZE_1) +#define SPI_DATA_SIZE_8BIT (SPI_CFG2_DSIZE_2) +#define SPI_DATA_SIZE_9BIT (SPI_CFG2_DSIZE_2 | SPI_CFG2_DSIZE_0) +#define SPI_DATA_SIZE_10BIT (SPI_CFG2_DSIZE_2 | SPI_CFG2_DSIZE_1) +#define SPI_DATA_SIZE_11BIT (SPI_CFG2_DSIZE_2 | SPI_CFG2_DSIZE_1 | SPI_CFG2_DSIZE_0) +#define SPI_DATA_SIZE_12BIT (SPI_CFG2_DSIZE_3) +#define SPI_DATA_SIZE_13BIT (SPI_CFG2_DSIZE_3 | SPI_CFG2_DSIZE_0) +#define SPI_DATA_SIZE_14BIT (SPI_CFG2_DSIZE_3 | SPI_CFG2_DSIZE_1) +#define SPI_DATA_SIZE_15BIT (SPI_CFG2_DSIZE_3 | SPI_CFG2_DSIZE_1 | SPI_CFG2_DSIZE_0) +#define SPI_DATA_SIZE_16BIT (SPI_CFG2_DSIZE_3 | SPI_CFG2_DSIZE_2) +#define SPI_DATA_SIZE_20BIT (SPI_CFG2_DSIZE_3 | SPI_CFG2_DSIZE_2 | SPI_CFG2_DSIZE_0) +#define SPI_DATA_SIZE_24BIT (SPI_CFG2_DSIZE_3 | SPI_CFG2_DSIZE_2 | SPI_CFG2_DSIZE_1) +#define SPI_DATA_SIZE_32BIT (SPI_CFG2_DSIZE_3 | SPI_CFG2_DSIZE_2 | SPI_CFG2_DSIZE_1 | SPI_CFG2_DSIZE_0) +/** + * @} + */ + +/** + * @defgroup SPI_First_Bit_Define SPI first bit define + * @{ + */ +#define SPI_FIRST_MSB (0UL) +#define SPI_FIRST_LSB (SPI_CFG2_LSBF) +/** + * @} + */ + +/** + * @defgroup SPI_State_Flag_Define SPI state flag define + * @{ + */ +#define SPI_FLAG_OVERLOAD (SPI_SR_OVRERF) +#define SPI_FLAG_IDLE (SPI_SR_IDLNF) +#define SPI_FLAG_MODE_FAULT (SPI_SR_MODFERF) +#define SPI_FLAG_PARITY_ERROR (SPI_SR_PERF) +#define SPI_FLAG_UNDERLOAD (SPI_SR_UDRERF) +#define SPI_FLAG_TX_BUFFER_EMPTY (SPI_SR_TDEF) /*!< This flag is set when the data in the data register \ + is copied into the shift register, but the transmission \ + of the data bit may not have been completed. */ +#define SPI_FLAG_RX_BUFFER_FULL (SPI_SR_RDFF) /*!< When this flag is set, it indicates that a data was received. */ + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup SPI_Global_Functions + * @{ + */ +en_result_t SPI_StructInit(stc_spi_init_t *pstcInit); +en_result_t SPI_DelayStructInit(stc_spi_delay_t *pstcDelayCfg); + +en_result_t SPI_Init(M4_SPI_TypeDef *SPIx, const stc_spi_init_t *pstcInit); +void SPI_DeInit(M4_SPI_TypeDef *SPIx); + +void SPI_IntCmd(M4_SPI_TypeDef *SPIx, uint32_t u32IntType, en_functional_state_t enNewState); +void SPI_FunctionCmd(M4_SPI_TypeDef *SPIx, en_functional_state_t enNewState); + +void SPI_WriteDataReg(M4_SPI_TypeDef *SPIx, uint32_t u32Data); +uint32_t SPI_ReadDataReg(const M4_SPI_TypeDef *SPIx); + +en_flag_status_t SPI_GetStatus(const M4_SPI_TypeDef *SPIx, uint32_t u32Flag); +void SPI_ClearFlag(M4_SPI_TypeDef *SPIx, uint32_t u32Flag); + +void SPI_LoopbackModeCfg(M4_SPI_TypeDef *SPIx, uint32_t u32Mode); +void SPI_PateCmd(M4_SPI_TypeDef *SPIx, en_functional_state_t enNewState); +en_result_t SPI_DelayTimeCfg(M4_SPI_TypeDef *SPIx, const stc_spi_delay_t *pstcDelayCfg); +void SPI_SSValidLevelCfg(M4_SPI_TypeDef *SPIx, uint32_t u32SSPin, en_functional_state_t enNewState); +void SPI_SSPinSel(M4_SPI_TypeDef *SPIx, uint32_t u32SSPin); +void SPI_ReadBufCfg(M4_SPI_TypeDef *SPIx, uint32_t u32ReadBuf); + +en_result_t SPI_Transmit(M4_SPI_TypeDef *SPIx, const void *pvTxBuf, uint32_t u32TxLength); +en_result_t SPI_Receive(M4_SPI_TypeDef *SPIx, void *pvRxBuf, uint32_t u32RxLength); +en_result_t SPI_TransmitReceive(M4_SPI_TypeDef *SPIx, const void *pvTxBuf, void *pvRxBuf, uint32_t u32Length); + +/** + * @} + */ + +#endif /* DDL_SPI_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_SPI_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_sram.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_sram.h new file mode 100644 index 0000000000..87d223ceb7 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_sram.h @@ -0,0 +1,252 @@ +/** + ******************************************************************************* + * @file hc32f4a0_sram.h + * @brief This file contains all the functions prototypes of the SRAM driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Wuze First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_SRAM_H__ +#define __HC32F4A0_SRAM_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_SRAM + * @{ + */ + +#if (DDL_SRAM_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup SRAM_Global_Macros SRAM Global Macros + * @{ + */ + +/** + * @defgroup SRAM_Index_Bit_Mask SRAM Index Bit Mask + * @{ + */ +#define SRAM_SRAMH (1UL << 2U) /*!< 0x1FFE0000~0x1FFFFFFF, 128KB */ +#define SRAM_SRAM123 (1UL << 0U) /*!< SRAM1: 0x20000000~0x2001FFFF, 128KB \ + SRAM2: 0x20020000~0x2003FFFF, 128KB \ + SRAM3: 0x20040000~0x20057FFF, 96KB */ +#define SRAM_SRAM4 (1UL << 1U) /*!< 0x20058000~0x2005FFFF, 32KB */ +#define SRAM_SRAMB (1UL << 3U) /*!< 0x200F0000~0x200F0FFF, 4KB */ +#define SRAM_SRAM_ALL (SRAM_SRAMH | SRAM_SRAM123 | SRAM_SRAM4 | SRAM_SRAMB) +/** + * @} + */ + +/** + * @defgroup SRAM_Access_Wait_Cycle SRAM Access Wait Cycle + * @{ + */ +#define SRAM_WAIT_CYCLE_0 (0U) /*!< Wait 0 CPU cycle. */ +#define SRAM_WAIT_CYCLE_1 (1U) /*!< Wait 1 CPU cycle. */ +#define SRAM_WAIT_CYCLE_2 (2U) /*!< Wait 2 CPU cycles. */ +#define SRAM_WAIT_CYCLE_3 (3U) /*!< Wait 3 CPU cycles. */ +#define SRAM_WAIT_CYCLE_4 (4U) /*!< Wait 4 CPU cycles. */ +#define SRAM_WAIT_CYCLE_5 (5U) /*!< Wait 5 CPU cycles. */ +#define SRAM_WAIT_CYCLE_6 (6U) /*!< Wait 6 CPU cycles. */ +#define SRAM_WAIT_CYCLE_7 (7U) /*!< Wait 7 CPU cycles. */ +/** + * @} + */ + +/** + * @defgroup SRAM_Operation_After_Check_Error SRAM Operation After Check Error + * @note For: Even-parity check error of SRAM1, SRAM2, SRAM3 and SRAMH. ECC check error of SRAM4 and SRAMB. + * @{ + */ +#define SRAM_ERR_OP_NMI (0U) /*!< Non-maskable interrupt occurres while check error occurres. */ +#define SRAM_ERR_OP_RESET (SRAMC_CKCR_PYOAD) /*!< System reset occurres while check error occurres. */ +/** + * @} + */ + +/** + * @defgroup SRAM_ECC_Mode SRAM ECC Mode + * @note For: SRAM4 and SRAMB. + * @{ + */ +#define SRAM_ECC_MODE_INVALID (0U) /*!< The ECC mode is invalid. */ +#define SRAM_ECC_MODE_1 (SRAMC_CKCR_ECCMOD_0) /*!< When 1-bit error occurres: \ + ECC error corrects. \ + No 1-bit-error status flag setting, no interrupt or reset. \ + When 2-bit error occurres: \ + ECC error detects. \ + 2-bit-error status flag sets and interrupt or reset occurres. */ +#define SRAM_ECC_MODE_2 (SRAMC_CKCR_ECCMOD_1) /*!< When 1-bit error occurres: \ + ECC error corrects. \ + 1-bit-error status flag sets, no interrupt or reset. \ + When 2-bit error occurres: \ + ECC error detects. \ + 2-bit-error status flag sets and interrupt or reset occurres. */ +#define SRAM_ECC_MODE_3 (SRAMC_CKCR_ECCMOD_1 | \ + SRAMC_CKCR_ECCMOD_0) /*!< When 1-bit error occurres: \ + ECC error corrects. \ + 1-bit-error status flag sets and interrupt or reset occurres. \ + When 2-bit error occurres: \ + ECC error detects. \ + 2-bit-error status flag sets and interrupt or reset occurres. */ +/** + * @} + */ + +/** + * @defgroup SRAM_Check_Status_Flag SRAM Check Status Flag + * @{ + */ +#define SRAM_FLAG_SRAM1_PYERR (SRAMC_CKSR_SRAM1_PYERR) /*!< SRAM1 parity error. */ +#define SRAM_FLAG_SRAM2_PYERR (SRAMC_CKSR_SRAM2_PYERR) /*!< SRAM2 parity error. */ +#define SRAM_FLAG_SRAM3_PYERR (SRAMC_CKSR_SRAM3_PYERR) /*!< SRAM3 parity error. */ +#define SRAM_FLAG_SRAMH_PYERR (SRAMC_CKSR_SRAMH_PYERR) /*!< SRAMH parity error. */ +#define SRAM_FLAG_SRAM4_1ERR (SRAMC_CKSR_SRAM4_1ERR) /*!< SRAM4 ECC 1-bit error. */ +#define SRAM_FLAG_SRAM4_2ERR (SRAMC_CKSR_SRAM4_2ERR) /*!< SRAM4 ECC 2-bit error. */ +#define SRAM_FLAG_SRAMB_1ERR (SRAMC_CKSR_SRAMB_1ERR) /*!< SRAMB ECC 1-bit error. */ +#define SRAM_FLAG_SRAMB_2ERR (SRAMC_CKSR_SRAMB_2ERR) /*!< SRAMB ECC 2-bit error. */ +#define SRAM_FLAG_CACHE_PYERR (SRAMC_CKSR_CACHE_PYERR) /*!< Cache RAM parity error. */ +#define SRAM_FLAG_ALL (0x1FFUL) +/** + * @} + */ + +/** + * @defgroup SRAM_Register_Protect_Command SRAM Register Protect Command + * @{ + */ +#define SRAM_LOCK_CMD (0x76U) +#define SRAM_UNLOCK_CMD (0x77U) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup SRAM_Global_Functions + * @{ + */ + +/** + * @brief Lock access wait cycle control register. + * @param None + * @retval None + */ +__STATIC_INLINE void SRAM_WTCR_Lock(void) +{ + WRITE_REG32(M4_SRAMC->WTPR, SRAM_LOCK_CMD); +} + +/** + * @brief Unlock access wait cycle control register. + * @param None + * @retval None + */ +__STATIC_INLINE void SRAM_WTCR_Unlock(void) +{ + WRITE_REG32(M4_SRAMC->WTPR, SRAM_UNLOCK_CMD); +} + +/** + * @brief Lock check control register. + * @param None + * @retval None + */ +__STATIC_INLINE void SRAM_CKCR_Lock(void) +{ + WRITE_REG32(M4_SRAMC->CKPR, SRAM_LOCK_CMD); +} + +/** + * @brief Unlock check control register. + * @param None + * @retval None + */ +__STATIC_INLINE void SRAM_CKCR_Unlock(void) +{ + WRITE_REG32(M4_SRAMC->CKPR, SRAM_UNLOCK_CMD); +} + +void SRAM_Init(void); +void SRAM_DeInit(void); + +void SRAM_WTCR_Lock(void); +void SRAM_WTCR_Unlock(void); +void SRAM_CKCR_Lock(void); +void SRAM_CKCR_Unlock(void); + +void SRAM_SetWaitCycle(uint32_t u32SramIndex, uint32_t u32WriteCycle, uint32_t u32ReadCycle); +void SRAM_SetEccMode(uint32_t u32SramIndex, uint32_t u32EccMode); +void SRAM_SetErrOperation(uint32_t u32SramIndex, uint32_t u32OpAfterError); + +en_flag_status_t SRAM_GetStatus(uint32_t u32Flag); +void SRAM_ClrStatus(uint32_t u32Flag); + +/** + * @} + */ + +#endif /* DDL_SRAM_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_SRAM_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_swdt.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_swdt.h new file mode 100644 index 0000000000..f6d4b4f0dd --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_swdt.h @@ -0,0 +1,227 @@ +/** + ******************************************************************************* + * @file hc32f4a0_swdt.h + * @brief This file contains all the functions prototypes of the SWDT driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Yangjp First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_SWDT_H__ +#define __HC32F4A0_SWDT_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_SWDT + * @{ + */ + +#if (DDL_SWDT_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup SWDT_Global_Types SWDT Global Types + * @{ + */ + +/** + * @brief SWDT Init structure definition + */ +typedef struct +{ + uint32_t u32CountCycle; /*!< Specifies the SWDT Count Cycle. + This parameter can be a value of @ref SWDT_Counter_Cycle */ + + uint32_t u32ClockDivision; /*!< Specifies the SWDT Clock Division. + This parameter can be a value of @ref SWDT_Clock_Division */ + + uint32_t u32RefreshRange; /*!< Specifies the SWDT Allow Refresh Range. + This parameter can be a value of @ref SWDT_Refresh_Percent_Range */ + + uint32_t u32LPModeCountEn; /*!< Specifies the SWDT Count Enable/Disable In Low Power Mode(Sleep/Stop Mode). + This parameter can be a value of @ref SWDT_LPW_Mode_Count */ + + uint32_t u32TrigType; /*!< Specifies the SWDT Refresh Error or Count Underflow trigger event Type. + This parameter can be a value of @ref SWDT_Trigger_Event_Type */ +} stc_swdt_init_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup SWDT_Global_Macros SWDT Global Macros + * @{ + */ + +/** + * @defgroup SWDT_Counter_Cycle SWDT Counter Cycle + * @{ + */ +#define SWDT_COUNTER_CYCLE_256 (0UL) /*!< 256 clock cycle */ +#define SWDT_COUNTER_CYCLE_4096 (SWDT_CR_PERI_0) /*!< 4096 clock cycle */ +#define SWDT_COUNTER_CYCLE_16384 (SWDT_CR_PERI_1) /*!< 16384 clock cycle */ +#define SWDT_COUNTER_CYCLE_65536 (SWDT_CR_PERI) /*!< 65536 clock cycle */ +/** + * @} + */ + +/** + * @defgroup SWDT_Clock_Division SWDT Clock Division + * @{ + */ +#define SWDT_CLOCK_DIV1 (0UL) /*!< SWDTCLK */ +#define SWDT_CLOCK_DIV16 (SWDT_CR_CKS_2) /*!< SWDTCLK/16 */ +#define SWDT_CLOCK_DIV32 (SWDT_CR_CKS_2 | SWDT_CR_CKS_0) /*!< SWDTCLK/32 */ +#define SWDT_CLOCK_DIV64 (SWDT_CR_CKS_2 | SWDT_CR_CKS_1) /*!< SWDTCLK/64 */ +#define SWDT_CLOCK_DIV128 (SWDT_CR_CKS_2 | SWDT_CR_CKS_1 | SWDT_CR_CKS_0) /*!< SWDTCLK/128 */ +#define SWDT_CLOCK_DIV256 (SWDT_CR_CKS_3) /*!< SWDTCLK/256 */ +#define SWDT_CLOCK_DIV2048 (SWDT_CR_CKS_3 | SWDT_CR_CKS_1 | SWDT_CR_CKS_0) /*!< SWDTCLK/2048 */ +/** + * @} + */ + +/** + * @defgroup SWDT_Refresh_Percent_Range SWDT Refresh Percent Range + * @{ + */ +#define SWDT_RANGE_0TO100PCT (0UL) /*!< 0%~100% */ +#define SWDT_RANGE_0TO25PCT (SWDT_CR_WDPT_0) /*!< 0%~25% */ +#define SWDT_RANGE_25TO50PCT (SWDT_CR_WDPT_1) /*!< 25%~50% */ +#define SWDT_RANGE_0TO50PCT (SWDT_CR_WDPT_1 | SWDT_CR_WDPT_0) /*!< 0%~50% */ +#define SWDT_RANGE_50TO75PCT (SWDT_CR_WDPT_2) /*!< 50%~75% */ +#define SWDT_RANGE_0TO25PCT_50TO75PCT (SWDT_CR_WDPT_2 | SWDT_CR_WDPT_0) /*!< 0%~25% & 50%~75% */ +#define SWDT_RANGE_25TO75PCT (SWDT_CR_WDPT_2 | SWDT_CR_WDPT_1) /*!< 25%~75% */ +#define SWDT_RANGE_0TO75PCT (SWDT_CR_WDPT_2 | SWDT_CR_WDPT_1 | SWDT_CR_WDPT_0) /*!< 0%~75% */ +#define SWDT_RANGE_75TO100PCT (SWDT_CR_WDPT_3) /*!< 75%~100% */ +#define SWDT_RANGE_0TO25PCT_75TO100PCT (SWDT_CR_WDPT_3 | SWDT_CR_WDPT_0) /*!< 0%~25% & 75%~100% */ +#define SWDT_RANGE_25TO50PCT_75TO100PCT (SWDT_CR_WDPT_3 | SWDT_CR_WDPT_1) /*!< 25%~50% & 75%~100% */ +#define SWDT_RANGE_0TO50PCT_75TO100PCT (SWDT_CR_WDPT_3 | SWDT_CR_WDPT_1 | SWDT_CR_WDPT_0) /*!< 0%~50% & 75%~100% */ +#define SWDT_RANGE_50TO100PCT (SWDT_CR_WDPT_3 | SWDT_CR_WDPT_2) /*!< 50%~100% */ +#define SWDT_RANGE_0TO25PCT_50TO100PCT (SWDT_CR_WDPT_3 | SWDT_CR_WDPT_2 | SWDT_CR_WDPT_0) /*!< 0%~25% & 50%~100% */ +#define SWDT_RANGE_25TO100PCT (SWDT_CR_WDPT_3 | SWDT_CR_WDPT_2 | SWDT_CR_WDPT_1) /*!< 25%~100% */ +/** + * @} + */ + +/** + * @defgroup SWDT_LPW_Mode_Count SWDT Low Power Mode Count + * @brief SWDT count control in the sleep/stop mode + * @{ + */ +#define SWDT_LPM_COUNT_CONTINUE (0UL) /*!< SWDT count continue in the sleep/stop mode */ +#define SWDT_LPM_COUNT_STOP (SWDT_CR_SLPOFF) /*!< SWDT count stop in the sleep/stop mode */ +/** + * @} + */ + +/** +* @defgroup SWDT_Trigger_Event_Type SWDT Trigger Event Type +* @{ +*/ +#define SWDT_TRIG_EVENT_INT (0UL) /*!< SWDT trigger interrupt */ +#define SWDT_TRIG_EVENT_RESET (SWDT_CR_ITS) /*!< SWDT trigger reset */ +/** + * @} + */ + +/** + * @defgroup SWDT_Flag SWDT Flag + * @{ + */ +#define SWDT_FLAG_UDF (SWDT_SR_UDF) /*!< Count underflow flag */ +#define SWDT_FLAG_REF (SWDT_SR_REF) /*!< Refresh error flag */ +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup SWDT_Global_Functions + * @{ + */ + +/** + * @brief Get SWDT count value. + * @param None + * @retval Count value + */ +__STATIC_INLINE uint16_t SWDT_GetCountValue(void) +{ + return (uint16_t)(READ_REG32(M4_SWDT->SR) & SWDT_SR_CNT); +} + +/* Initialization and configuration functions */ +en_result_t SWDT_Init(const stc_swdt_init_t *pstcSwdtInit); +void SWDT_Feed(void); +uint16_t SWDT_GetCountValue(void); + +/* Flags management functions */ +en_flag_status_t SWDT_GetStatus(uint32_t u32Flag); +en_result_t SWDT_ClearStatus(uint32_t u32Flag); + +/** + * @} + */ + +#endif /* DDL_SWDT_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_SWDT_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_tmr0.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_tmr0.h new file mode 100644 index 0000000000..46c94ee169 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_tmr0.h @@ -0,0 +1,243 @@ +/** + ******************************************************************************* + * @file hc32f4a0_tmr0.h + * @brief This file contains all the functions prototypes of the TMR0 driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Heqb First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_TMR0_H__ +#define __HC32F4A0_TMR0_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_TMR0 + * @{ + */ + +#if (DDL_TMR0_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup TMR0_Global_Types TMR0 Global Types + * @{ + */ + +/** + * @brief Tmr0 base counter function init structrue definition + */ +typedef struct +{ + uint32_t u32ClockDivision; /*!< Specifies the TMR0 clock division, + and this parameter can be a value of + @ref TMR0_Clock_Division_define */ + + uint32_t u32ClockSource; /*!< Specifies the TMR0 clock source, + and this parameter can be a value of + @ref TMR0_Clock_Source_define*/ + + uint32_t u32Tmr0Func; /*!< Specifies the TMR0 function, + compare output or capture input + @ref TMR0_Function_define */ + + uint32_t u32HwTrigFunc; /*!< Specifies the TMR0 compare + function hardware trigger function, and + this parameter can be a value of @ref + TMR0_HardwareTrigger_Func_define */ + + uint16_t u16CmpValue; /*!< Specifies the TMR0 compare value + This value can be set 0-0xFFFF */ + + uint16_t u16CntValue; /*!< Specifies the TMR0 count value + This value can be set 0-0xFFFF */ +}stc_tmr0_init_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup TMR0_Global_Macros TMR0 Global Macros + * @{ + */ + +/** @defgroup TMR0_Clock_Division_define TMR0 clock division define + * @{ + */ +#define TMR0_CLK_DIV1 (0UL<_OxH port output mode + This parameter can be a value of @ref TMR4_PWM_Port_Output_Mode */ + + uint32_t u32EmbOxHPortState; /*!< TIM4__OxH port state + This parameter can be a value of @ref TMR4_PWM_EMB_Port_State */ + + uint32_t u32OxLPortOutMode; /*!< TIM4__OxL port output mode + This parameter can be a value of @ref TMR4_PWM_Port_Output_Mode */ + + uint32_t u32EmbOxLPortState; /*!< TIM4__OxL port state + This parameter can be a value of @ref TMR4_PWM_EMB_Port_State */ +} stc_tmr4_pwm_init_t; + +/** + * @brief TMR4 Special-EVT initialization configuration + */ +typedef struct +{ + uint16_t u16CompareVal; /*!< TMR4 Special-EVT compare match value. + This parameter can be a value of half-word */ + + uint16_t u16Mode; /*!< Configure TMR4 Special-EVT Running mode + This parameter can be a value of @ref TMR4_SEVT_Mode */ + + uint16_t u16OutpuEvent; /*!< TMR4 Special-EVT output event + This parameter can be a value of @ref TMR4_SEVT_Output_Event */ + + uint16_t u16BufMode; /*!< Buffer mode + This parameter can be a value of @ref TMR4_SEVT_Buffer_Mode */ + + uint16_t u16LinkTransfer; /*!< Enable or disable the buffer linked transfer with the CNT interrupt mask counter + This parameter can be a value of @ref TMR4_SEVT_Link_Transfer */ + + uint16_t u16UpMatchCmd; /*!< Enable or disable trigger signal when match with SCCR&SCMR and TMR4 CNT count up + This parameter can be a value of @ref TMR4_SEVT_Up_Selection */ + + uint16_t u16DownMatchCmd; /*!< Enable or disable trigger signal when match with SCCR&SCMR and TMR4 CNT count down + This parameter can be a value of @ref TMR4_SEVT_Down_Selection */ + + uint16_t u16PeakMatchCmd; /*!< Enable or disable trigger signal when match with SCCR&SCMR and TMR4 CNT count peak + This parameter can be a value of @ref TMR4_SEVT_Peak_Selection */ + + uint16_t u16ZeroMatchCmd; /*!< Enable or disable trigger signal when match with SCCR&SCMR and TMR4 CNT count zero + This parameter can be a value of @ref TMR4_SEVT_Zero_Selection */ + + uint16_t u16ZeroMatchMaskCmd; /*!< Enable or disable perform to compare with the CNT zero interrupt mask counter + This parameter can be a value of @ref TMR4_SEVT_Zero_Match_Mask_Selection */ + + uint16_t u16PeakMatchMaskCmd; /*!< Enable or disable perform to compare with the CNT peak interrupt mask counter + This parameter can be a value of @ref TMR4_SEVT_Peak_Match_Mask_Selection */ + + uint16_t u16MaskTimes; /*!< Specifies start time by the value to be compared with the CNT interrupt mask counter */ +} stc_tmr4_sevt_init_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup TMR4_Global_Macros TMR4 Global Macros + * @{ + */ + +/** + * @defgroup TMR4_CNT_Macros TMR4 Counter Macros + * @{ + */ + +/** @defgroup TMR4_CNT_PCLK_Division TMR4 Counter PCLK Clock Division + * @{ + */ +#define TMR4_CNT_PCLK_DIV1 (0U) /*!< PCLK */ +#define TMR4_CNT_PCLK_DIV2 (TMR4_CCSR_CKDIV_0) /*!< PCLK/2 */ +#define TMR4_CNT_PCLK_DIV4 (TMR4_CCSR_CKDIV_1) /*!< PCLK/4 */ +#define TMR4_CNT_PCLK_DIV8 (TMR4_CCSR_CKDIV_1 | \ + TMR4_CCSR_CKDIV_0) /*!< PCLK/8 */ +#define TMR4_CNT_PCLK_DIV16 (TMR4_CCSR_CKDIV_2) /*!< PCLK/16 */ +#define TMR4_CNT_PCLK_DIV32 (TMR4_CCSR_CKDIV_2 | \ + TMR4_CCSR_CKDIV_0) /*!< PCLK/32 */ +#define TMR4_CNT_PCLK_DIV64 (TMR4_CCSR_CKDIV_2 | \ + TMR4_CCSR_CKDIV_1) /*!< PCLK/64 */ +#define TMR4_CNT_PCLK_DIV128 (TMR4_CCSR_CKDIV_2 | \ + TMR4_CCSR_CKDIV_1 | \ + TMR4_CCSR_CKDIV_0) /*!< PCLK/128 */ +#define TMR4_CNT_PCLK_DIV256 (TMR4_CCSR_CKDIV_3) /*!< PCLK/256 */ +#define TMR4_CNT_PCLK_DIV512 (TMR4_CCSR_CKDIV_3 | \ + TMR4_CCSR_CKDIV_0) /*!< PCLK/512 */ +#define TMR4_CNT_PCLK_DIV1024 (TMR4_CCSR_CKDIV_3 | \ + TMR4_CCSR_CKDIV_1) /*!< PCLK/1024 */ +/** + * @} + */ + +/** + * @defgroup TMR4_CNT_Mode TMR4 Counter Mode + * @{ + */ +#define TMR4_CNT_MODE_SAWTOOTH_WAVE (0U) +#define TMR4_CNT_MODE_TRIANGLE_WAVE (TMR4_CCSR_MODE) +/** + * @} + */ + +/** + * @defgroup TMR4_CNT_Flag TMR4 Counter Flag + * @{ + */ +#define TMR4_CNT_FLAG_PEAK (TMR4_CCSR_IRQPF) +#define TMR4_CNT_FLAG_ZERO (TMR4_CCSR_IRQZF) +#define TMR4_CNT_FLAG_MASK (TMR4_CCSR_IRQPF | TMR4_CCSR_IRQZF) +/** + * @} + */ + +/** + * @defgroup TMR4_CNT_Interrupt TMR4 Counter Interrupt + * @{ + */ +#define TMR4_CNT_INT_PEAK (TMR4_CCSR_IRQPEN) +#define TMR4_CNT_INT_ZERO (TMR4_CCSR_IRQZEN) +#define TMR4_CNT_INT_MASK (TMR4_CCSR_IRQPEN | TMR4_CCSR_IRQZEN) +/** + * @} + */ + +/** + * @defgroup TMR4_CNT_Buffer_State TMR4 CNT Buffer State + * @{ + */ +#define TMR4_CNT_BUFFER_DISABLE (0U) /*!< Disable TMR4 counter buffer function */ +#define TMR4_CNT_BUFFER_ENABLE (TMR4_CCSR_BUFEN) /*!< Enable TMR4 counter buffer function */ +/** + * @} + */ + +/** + * @defgroup TMR4_CNT_Clock_Source TMR4 Count Clock Source + * @{ + */ +#define TMR4_CNT_PCLK (0U) +#define TMR4_CNT_EXTCLK (TMR4_CCSR_ECKEN) +/** + * @} + */ + +/** @defgroup TMR4_CNT_Interrupt_Mask_Times TMR4 Counter Interrupt Mask Times + * @{ + */ +#define TMR4_CNT_INT_MASK_0 (0U) /*!< Counter interrupt flag is always set(not masked) for every counter count at "0x0000" */ +#define TMR4_CNT_INT_MASK_1 (1U) /*!< Counter interrupt flag is set once for 2 for every counter counts at "0x0000" (skiping 1 count) */ +#define TMR4_CNT_INT_MASK_2 (2U) /*!< Counter interrupt flag is set once for 3 for every counter counts at "0x0000" (skiping 2 count) */ +#define TMR4_CNT_INT_MASK_3 (3U) /*!< Counter interrupt flag is set once for 4 for every counter counts at "0x0000" (skiping 3 count) */ +#define TMR4_CNT_INT_MASK_4 (4U) /*!< Counter interrupt flag is set once for 5 for every counter counts at "0x0000" (skiping 4 count) */ +#define TMR4_CNT_INT_MASK_5 (5U) /*!< Counter interrupt flag is set once for 6 for every counter counts at "0x0000" (skiping 5 count) */ +#define TMR4_CNT_INT_MASK_6 (6U) /*!< Counter interrupt flag is set once for 7 for every counter counts at "0x0000" (skiping 6 count) */ +#define TMR4_CNT_INT_MASK_7 (7U) /*!< Counter interrupt flag is set once for 8 for every counter counts at "0x0000" (skiping 7 count) */ +#define TMR4_CNT_INT_MASK_8 (8U) /*!< Counter interrupt flag is set once for 9 for every counter counts at "0x0000" (skiping 8 count) */ +#define TMR4_CNT_INT_MASK_9 (9U) /*!< Counter interrupt flag is set once for 10 for every counter counts at "0x0000" (skiping 9 count) */ +#define TMR4_CNT_INT_MASK_10 (10U) /*!< Counter interrupt flag is set once for 11 for every counter counts at "0x0000" (skiping 10 count) */ +#define TMR4_CNT_INT_MASK_11 (11U) /*!< Counter interrupt flag is set once for 12 for every counter counts at "0x0000" (skiping 11 count) */ +#define TMR4_CNT_INT_MASK_12 (12U) /*!< Counter interrupt flag is set once for 13 for every counter counts at "0x0000" (skiping 12 count) */ +#define TMR4_CNT_INT_MASK_13 (13U) /*!< Counter interrupt flag is set once for 14 for every counter counts at "0x0000" (skiping 13 count) */ +#define TMR4_CNT_INT_MASK_14 (14U) /*!< Counter interrupt flag is set once for 15 for every counter counts at "0x0000" (skiping 14 count) */ +#define TMR4_CNT_INT_MASK_15 (15U) /*!< Counter interrupt flag is set once for 16 for every counter counts at "0x0000" (skiping 15 count) */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @defgroup TMR4_OCO_Macros TMR4 Output Compare Macros + * @{ + */ + +/** @defgroup TMR4_OCO_Channel TMR4 OCO Channel + * @{ + */ +#define TMR4_OCO_UH (0UL) /*!< TMR4 OCO channel:UH */ +#define TMR4_OCO_UL (1UL) /*!< TMR4 OCO channel:UL */ +#define TMR4_OCO_VH (2UL) /*!< TMR4 OCO channel:VH */ +#define TMR4_OCO_VL (3UL) /*!< TMR4 OCO channel:VL */ +#define TMR4_OCO_WH (4UL) /*!< TMR4 OCO channel:WH */ +#define TMR4_OCO_WL (5UL) /*!< TMR4 OCO channel:WL */ +/** + * @} + */ + +/** + * @defgroup TMR4_OCO_State TMR4 OCO State + * @{ + */ +#define TMR4_OCO_DISABLE (0U) /*!< Disable TMR4 OCO output */ +#define TMR4_OCO_ENABLE (TMR4_OCSR_OCEH) /*!< Enable TMR4 OCO output */ +/** + * @} + */ + +/** + * @defgroup TMR4_OCO_Invalid_Output_Polarity TMR4 OCO Invalid Output Polarity + * @{ + */ +#define TMR4_OCO_INVAILD_OP_LOW (0U) /*!< TMR4 OCO Output low level when OCO is invalid */ +#define TMR4_OCO_INVAILD_OP_HIGH (TMR4_OCSR_OCPH) /*!< TMR4 OCO Output high level when OCO is invalid */ +/** + * @} + */ + +/** @defgroup TMR4_OCO_Extend_Match_Condtion TMR4 OCO Extend Match Condtion + * @{ + */ +#define TMR4_OCO_EXTEND_MATCH_DISABLE (0U) /*!< Disable TMR4 OCO extend match function */ +#define TMR4_OCO_EXTEND_MATCH_ENABLE (TMR4_OCER_MCECH) /*!< Enable TMR4 OCO extend match function */ +/** + * @} + */ + +/** @defgroup TMR4_OCO_OCCR_Link_Transfer TMR4 OCO OCCR Link Transfer + * @{ + */ +#define TMR4_OCO_OCCR_LINK_TRANSFER_DISABLE (0U) /*!< Disable the register OCCR buffer link transfer function */ +#define TMR4_OCO_OCCR_LINK_TRANSFER_ENABLE (TMR4_OCER_LMCH) /*!< Register OCCR buffer transfer when the value is both 0 and CPSR and ZIC/PIC is 0 */ +/** + * @} + */ + +/** @defgroup TMR4_OCO_OCCR_Buffer_Mode TMR4 OCO OCCR Buffer Mode + * @{ + */ +#define TMR4_OCO_OCCR_BUF_DISABLE (0U) /*!< Disable the register OCCR buffer function */ +#define TMR4_OCO_OCCR_BUF_CNT_ZERO (TMR4_OCER_CHBUFEN_0) /*!< Register OCCR buffer transfer when counter value is 0x0000 */ +#define TMR4_OCO_OCCR_BUF_CNT_PEAK (TMR4_OCER_CHBUFEN_1) /*!< Register OCCR buffer transfer when counter value is CPSR */ +#define TMR4_OCO_OCCR_BUF_CNT_ZERO_OR_PEAK (TMR4_OCER_CHBUFEN) /*!< Register OCCR buffer transfer when the value is both 0 and CPSR */ +/** + * @} + */ + +/** @defgroup TMR4_OCO_OCMR_Link_Transfer TMR4 OCO OCMR Link Transfer + * @{ + */ +#define TMR4_OCO_OCMR_LINK_TRANSFER_DISABLE (0x0000U) /*!< Disable the register OCMR buffer link transfer function */ +#define TMR4_OCO_OCMR_LINK_TRANSFER_ENABLE (TMR4_OCER_LMMH) /*!< Register OCMR buffer transfer when the value is both 0 and CPSR and ZIC/PIC is 0 */ +/** + * @} + */ + +/** @defgroup TMR4_OCO_OCMR_Buffer_Mode TMR4 OCO OCMR Buffer Mode + * @{ + */ +#define TMR4_OCO_OCMR_BUF_DISABLE (0U) /*!< Disable the register OCCR buffer function */ +#define TMR4_OCO_OCMR_BUF_CNT_ZERO (TMR4_OCER_MHBUFEN_0) /*!< Register OCMR buffer transfer when counter value is 0x0000 */ +#define TMR4_OCO_OCMR_BUF_CNT_PEAK (TMR4_OCER_MHBUFEN_1) /*!< Register OCMR buffer transfer when counter value is CPSR */ +#define TMR4_OCO_OCMR_BUF_CNT_ZERO_OR_PEAK (TMR4_OCER_MHBUFEN) /*!< Register OCMR buffer transfer when the value is both 0 and CPSR */ +/** + * @} + */ + +/** @defgroup TMR4_OCO_Cnt_Match_OCF_State TMR4 OCO Cnt Match OCF State + * @{ + */ +#define TMR4_OCO_OCF_HOLD (0U) /*!< Hold OCF */ +#define TMR4_OCO_OCF_SET (TMR4_OCMRH_OCFDCH) /*!< Set OCF */ +/** + * @} + */ + +/** @defgroup TMR4_OCO_Cnt_Match_Output_Polarity TMR4 OCO Cnt Match Output Polarity + * @{ + */ +#define TMR4_OCO_OP_HOLD (0U) /*!< Hold output when the TMR4 OCO count match */ +#define TMR4_OCO_OP_HIGH (1U) /*!< Output high when the TMR4 OCO count match */ +#define TMR4_OCO_OP_LOW (2U) /*!< Output low when the TMR4 OCO count match */ +#define TMR4_OCO_OP_INVERT (3U) /*!< Invert output when the TMR4 OCO count match */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @defgroup TMR4_PWM_Macros TMR4 PWM Macros + * @{ + */ + +/** @defgroup TMR4_PWM_Channel TMR4 PWM Channel + * @{ + */ +#define TMR4_PWM_U (0UL) /*!< TMR4 PWM couple channel: U */ +#define TMR4_PWM_V (1UL) /*!< TMR4 PWM couple channel: V */ +#define TMR4_PWM_W (2UL) /*!< TMR4 PWM couple channel: W */ +/** + * @} + */ + +/** @defgroup TMR4_PWM_Port TMR4 PWM Port + * @{ + */ +#define TMR4_PWM_PORT_OUH (0UL) /*!< TMR4 PWM port: TIM4__OUH */ +#define TMR4_PWM_PORT_OUL (1UL) /*!< TMR4 PWM port: TIM4__OUL */ +#define TMR4_PWM_PORT_OVH (2UL) /*!< TMR4 PWM port: TIM4__OVH */ +#define TMR4_PWM_PORT_OVL (3UL) /*!< TMR4 PWM port: TIM4__OVL */ +#define TMR4_PWM_PORT_OWH (4UL) /*!< TMR4 PWM port: TIM4__OWH */ +#define TMR4_PWM_PORT_OWL (5UL) /*!< TMR4 PWM port: TIM4__OWL */ +/** + * @} + */ + +/** @defgroup TMR4_PWM_PCLK_Division TMR4 PWM PCLK Clock Division + * @{ + */ +#define TMR4_PWM_PCLK_DIV1 (0U) /*!< PCLK */ +#define TMR4_PWM_PCLK_DIV2 (TMR4_POCR_DIVCK_0) /*!< PCLK/2 */ +#define TMR4_PWM_PCLK_DIV4 (TMR4_POCR_DIVCK_1) /*!< PCLK/4 */ +#define TMR4_PWM_PCLK_DIV8 (TMR4_POCR_DIVCK_1 | \ + TMR4_POCR_DIVCK_0) /*!< PCLK/8 */ +#define TMR4_PWM_PCLK_DIV16 (TMR4_POCR_DIVCK_2) /*!< PCLK/16 */ +#define TMR4_PWM_PCLK_DIV32 (TMR4_POCR_DIVCK_2 | \ + TMR4_POCR_DIVCK_0) /*!< PCLK/32 */ +#define TMR4_PWM_PCLK_DIV64 (TMR4_POCR_DIVCK_2 | \ + TMR4_POCR_DIVCK_1) /*!< PCLK/64 */ +#define TMR4_PWM_PCLK_DIV128 (TMR4_POCR_DIVCK_2 | \ + TMR4_POCR_DIVCK_1 | \ + TMR4_POCR_DIVCK_0) /*!< PCLK/128 */ +/** + * @} + */ + +/** + * @defgroup TMR4_PWM_Mode TMR4 PWM Mode + * @{ + */ +#define TMR4_PWM_THROUGH_MODE (0U) /*!< Through mode */ +#define TMR4_PWM_DEAD_TIMER_MODE (TMR4_POCR_PWMMD_0) /*!< Dead timer mode */ +#define TMR4_PWM_DEAD_TIMER_FILTER_MODE (TMR4_POCR_PWMMD_1) /*!< Dead timer filter mode */ +/** + * @} + */ + +/** + * @defgroup TMR4_PWM_Transform_OCO_Polarity TMR4 PWM Transform OCO Polarity + * @{ + */ +#define TMR4_PWM_OP_OXH_HOLD_OXL_HOLD (0U) /*!< Output PWML and PWMH signals without changing the level */ +#define TMR4_PWM_OP_OXH_INVERT_OXL_INVERT (TMR4_POCR_LVLS_0) /*!< Output both PWML and PWMH signals reversed */ +#define TMR4_PWM_OP_OXH_INVERT_OXL_HOLD (TMR4_POCR_LVLS_1) /*!< Output the PWMH signal reversed, outputs the PWML signal without changing the level. */ +#define TMR4_PWM_OP_OXH_HOLD_OXL_INVERT (TMR4_POCR_LVLS) /*!< Output the PWMH signal without changing the level, Outputs the PWML signal reversed. */ +/** + * @} + */ + +/** + * @defgroup TMR4_PWM_Port_Output_Mode TMR4 PWM Port Mode + * @{ + */ +#define TMR4_PWM_PORT_OUTPUT_OSxy (0UL) /*!< TIM4__Oxy output polarity by specified OSxy */ +#define TMR4_PWM_PORT_OUTPUT_NORMAL (TMR4_PSCR_OEUH) /*!< TIM4__Oxy output normal PWM */ +/** + * @} + */ + +/** + * @defgroup TMR4_PWM_EMB_Port_State TMR4 PWM EMB Port State + * @{ + */ +#define TMR4_PWM_EMB_PORT_OUTPUT_NORMAL (0UL) /*!< TIM4__Oxy output normal */ +#define TMR4_PWM_EMB_PORT_OUTPUT_HIZ (TMR4_PSCR_OSUH_0) /*!< TIM4__Oxy output Hi-z */ +#define TMR4_PWM_EMB_PORT_OUTPUT_LOW (TMR4_PSCR_OSUH_1) /*!< TIM4__Oxy output low level */ +#define TMR4_PWM_EMB_PORT_OUTPUT_HIGH (TMR4_PSCR_OSUH) /*!< TIM4__Oxy output high level */ +/** + * @} + */ + +/** + * @defgroup TMR4_PWM_Port_Enable_Bit_Effective_Time TMR4 PWM Port Enable Bit Effective Time + * @{ + */ +#define TMR4_PWM_PORT_ENBIT_EFFECT_IMMEDIATE (0UL) /*!< TMR4 PWM Port Enable Bit Effective Time: immediate */ +#define TMR4_PWM_PORT_ENBIT_EFFECT_CNTUVF (TMR4_PSCR_ODT_1) /*!< TMR4 PWM Port Enable Bit Effective Time: TMR4 counter underflow */ +#define TMR4_PWM_PORT_ENBIT_EFFECT_CNTOVF (TMR4_PSCR_ODT) /*!< TMR4 PWM Port Enable Bit Effective Time: TMR4 counter overflow */ + /** + * @} + */ + +/** + * @} + */ + +/** + * @defgroup TMR4_SEVT_Macros TMR4 Special Event Macros + * @{ + */ + +/** @defgroup TMR4_SEVT_Channel TMR4 SEVT Channel + * @{ + */ +#define TMR4_SEVT_UH (0UL) /*!< TMR4 SEVT channel:UH */ +#define TMR4_SEVT_UL (1UL) /*!< TMR4 SEVT channel:UL */ +#define TMR4_SEVT_VH (2UL) /*!< TMR4 SEVT channel:VH */ +#define TMR4_SEVT_VL (3UL) /*!< TMR4 SEVT channel:VL */ +#define TMR4_SEVT_WH (4UL) /*!< TMR4 SEVT channel:WH */ +#define TMR4_SEVT_WL (5UL) /*!< TMR4 SEVT channel:WL */ +/** + * @} + */ + +/** @defgroup TMR4_SEVT_Link_Transfer TMR4 SEVT Link Transfer + * @{ + */ +#define TMR4_SEVT_LINK_TRANSFER_DISABLE (0U) /*!< Disable the SEVT Link Transfer function */ +#define TMR4_SEVT_LINK_TRANSFER_ENABLE (TMR4_SCSR_LMC) /*!< Enable the SEVT Link Transfer function */ +/** + * @} + */ + +/** @defgroup TMR4_SEVT_Down_Selection TMR4 SEVT Down Selection + * @{ + */ +#define TMR4_SEVT_DOWN_DISABLE (0U) /*!< Disable trigger signal when match with SCCR&SCMR and TMR4 CNT count zero */ +#define TMR4_SEVT_DOWN_ENABLE (TMR4_SCSR_DEN) /*!< Enable trigger signal when match with SCCR&SCMR and TMR4 CNT count down */ +/** + * @} + */ + +/** @defgroup TMR4_SEVT_Up_Selection TMR4 SEVT Up Selection + * @{ + */ +#define TMR4_SEVT_UP_DISABLE (0U) /*!< Disable trigger signal when match with SCCR&SCMR and TMR4 CNT count up */ +#define TMR4_SEVT_UP_ENABLE (TMR4_SCSR_UEN) /*!< Enable trigger signal when match with SCCR&SCMR and TMR4 CNT count up */ +/** + * @} + */ + +/** @defgroup TMR4_SEVT_Peak_Selection TMR4 SEVT Peak Selection + * @{ + */ +#define TMR4_SEVT_PEAK_DISABLE (0U) /*!< Disable trigger signal when match with SCCR&SCMR and TMR4 CNT count peak */ +#define TMR4_SEVT_PEAK_ENABLE (TMR4_SCSR_PEN) /*!< Enable trigger signal when match with SCCR&SCMR and TMR4 CNT count peak */ +/** + * @} + */ + +/** @defgroup TMR4_SEVT_Zero_Selection TMR4 SEVT Zero Selection + * @{ + */ +#define TMR4_SEVT_ZERO_DISABLE (0U) /*!< Disable trigger signal when match with SCCR&SCMR and TMR4 CNT count zero */ +#define TMR4_SEVT_ZERO_ENABLE (TMR4_SCSR_ZEN) /*!< Enable trigger signal when match with SCCR&SCMR and TMR4 CNT count zero */ +/** + * @} + */ + +/** @defgroup TMR4_SEVT_Zero_Match_Mask_Selection TMR4 SEVT Zero Match Mask Selection + * @{ + */ +#define TMR4_SEVT_ZERO_MATCH_MASK_DISABLE (0U) /*!< Disable perform to compare with the CNT zero interrupt mask counter */ +#define TMR4_SEVT_ZERO_MATCH_MASK_ENABLE (TMR4_SCMR_MZCE) /*!< Enable perform to compare with the CNT zero interrupt mask counter */ +/** + * @} + */ + +/** @defgroup TMR4_SEVT_Peak_Match_Mask_Selection TMR4 SEVT Peak Match Mask Selection + * @{ + */ +#define TMR4_SEVT_PEAK_MATCH_MASK_DISABLE (0U) /*!< Disable perform to compare with the CNT peak interrupt mask counter */ +#define TMR4_SEVT_PEAK_MATCH_MASK_ENABLE (TMR4_SCMR_MPCE) /*!< Enable perform to compare with the CNT peak interrupt mask counter */ +/** + * @} + */ + +/** @defgroup TMR4_SEVT_Buffer_Mode TMR4 SEVT Buffer Mode + * @{ + */ +#define TMR4_SEVT_BUF_DISABLE (0U) /*!< Disable the register SCCR&SCMR buffer function */ +#define TMR4_SEVT_BUF_CNT_ZERO (TMR4_SCSR_BUFEN_0) /*!< Register SCCR&SCMR buffer transfer when counter value is 0x0000 */ +#define TMR4_SEVT_BUF_CNT_PEAK (TMR4_SCSR_BUFEN_1) /*!< Register SCCR&SCMR buffer transfer when counter value is CPSR */ +#define TMR4_SEVT_BUF_CNT_ZERO_OR_PEAK (TMR4_SCSR_BUFEN) /*!< Register SCCR&SCMR buffer transfer when the value is both 0 and CPSR */ +/** + * @} + */ + +/** @defgroup TMR4_SEVT_Output_Event TMR4 SEVT Output Event + * @{ + */ +#define TMR4_SEVT_OUTPUT_EVENT0 (0U) /*!< TMR4 SEVT output special event 0 */ +#define TMR4_SEVT_OUTPUT_EVENT1 (TMR4_SCSR_EVTOS_0) /*!< TMR4 SEVT output special event 1 */ +#define TMR4_SEVT_OUTPUT_EVENT2 (TMR4_SCSR_EVTOS_1) /*!< TMR4 SEVT output special event 2 */ +#define TMR4_SEVT_OUTPUT_EVENT3 (TMR4_SCSR_EVTOS_1 | \ + TMR4_SCSR_EVTOS_0) /*!< TMR4 SEVT output special event 3 */ +#define TMR4_SEVT_OUTPUT_EVENT4 (TMR4_SCSR_EVTOS_2) /*!< TMR4 SEVT output special event 4 */ +#define TMR4_SEVT_OUTPUT_EVENT5 (TMR4_SCSR_EVTOS_2 | \ + TMR4_SCSR_EVTOS_0) /*!< TMR4 SEVT output special event 5 */ +/** + * @} + */ + +/** @defgroup TMR4_SEVT_Mode TMR4 SEVT Mode + * @{ + */ +#define TMR4_SEVT_MODE_COMPARE_TRIGGER (0U) +#define TMR4_SEVT_MODE_DELAY_TRIGGER (TMR4_SCSR_EVTMS) +/** + * @} + */ + +/** @defgroup TMR4_SEVT_Delay_Object TMR4 SEVT Delay Object + * @{ + */ +#define TMR4_SEVT_DELAY_OCCRXH (0U) /*!< TMR4 SEVT delay object: OCCRxh */ +#define TMR4_SEVT_DELAY_OCCRXL (TMR4_SCSR_EVTDS) /*!< TMR4 SEVT delay object: OCCRxl */ +/** + * @} + */ + +/** @defgroup TMR4_SEVT_Mask_Times TMR4 SEVT Mask Times + * @{ + */ +#define TMR4_SEVT_MASK_0 (0U) /*!< Mask 0 time */ +#define TMR4_SEVT_MASK_1 (1U) /*!< Mask 1 times */ +#define TMR4_SEVT_MASK_2 (2U) /*!< Mask 2 times */ +#define TMR4_SEVT_MASK_3 (3U) /*!< Mask 3 times */ +#define TMR4_SEVT_MASK_4 (4U) /*!< Mask 4 times */ +#define TMR4_SEVT_MASK_5 (5U) /*!< Mask 5 times */ +#define TMR4_SEVT_MASK_6 (6U) /*!< Mask 6 times */ +#define TMR4_SEVT_MASK_7 (7U) /*!< Mask 7 times */ +#define TMR4_SEVT_MASK_8 (8U) /*!< Mask 8 times */ +#define TMR4_SEVT_MASK_9 (9U) /*!< Mask 9 times */ +#define TMR4_SEVT_MASK_10 (10U) /*!< Mask 10 times */ +#define TMR4_SEVT_MASK_11 (11U) /*!< Mask 11 times */ +#define TMR4_SEVT_MASK_12 (12U) /*!< Mask 12 times */ +#define TMR4_SEVT_MASK_13 (13U) /*!< Mask 13 times */ +#define TMR4_SEVT_MASK_14 (14U) /*!< Mask 14 times */ +#define TMR4_SEVT_MASK_15 (15U) /*!< Mask 15 times */ +/** + * @} + */ + +/** @defgroup TMR4_SEVT_Port_Output_Event_Signal TMR4 SEVT Port Output Event Signal + * @{ + */ +#define TMR4_SEVT_PORT_OUTPUT_NONE (0U) /*!< Disable output event signal of TMR4 Special-EVT */ +#define TMR4_SEVT_PORT_OUTPUT_EVENT0_SIGNAL (TMR4_SCER_EVTRS_0 ) /*!< Output the specified event 0 signal of TMR4 Special-EVT */ +#define TMR4_SEVT_PORT_OUTPUT_EVENT1_SIGNAL (TMR4_SCER_EVTRS_1) /*!< Output the specified event 1 signal of TMR4 Special-EVT */ +#define TMR4_SEVT_PORT_OUTPUT_EVENT2_SIGNAL (TMR4_SCER_EVTRS_1 | \ + TMR4_SCER_EVTRS_0) /*!< Output the specified event 2 signal of TMR4 Special-EVT */ +#define TMR4_SEVT_PORT_OUTPUT_EVENT3_SIGNAL (TMR4_SCER_EVTRS_2) /*!< Output the specified event 3 signal of TMR4 Special-EVT */ +#define TMR4_SEVT_PORT_OUTPUT_EVENT4_SIGNAL (TMR4_SCER_EVTRS_2 | \ + TMR4_SCER_EVTRS_0) /*!< Output the specified event 4 signal of TMR4 Special-EVT */ +#define TMR4_SEVT_PORT_OUTPUT_EVENT5_SIGNAL (TMR4_SCER_EVTRS_2 | \ + TMR4_SCER_EVTRS_1) /*!< Output the specified event 5 signal of TMR4 Special-EVT */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup TMR4_Global_Functions + * @{ + */ + +/** + * @addtogroup TMR4_CNT_Global_Functions + * @{ + */ + +/* Initialization and configuration TMR4 counter functions */ +en_result_t TMR4_CNT_Init(M4_TMR4_TypeDef *TMR4x, + const stc_tmr4_cnt_init_t *pstcInit); +en_result_t TMR4_CNT_StructInit(stc_tmr4_cnt_init_t *pstcInit); +void TMR4_CNT_DeInit(M4_TMR4_TypeDef *TMR4x); +void TMR4_CNT_SetClock(M4_TMR4_TypeDef *TMR4x, uint16_t u16ClkSrc); +uint16_t TMR4_CNT_GetClock(const M4_TMR4_TypeDef *TMR4x); +void TMR4_CNT_SetPclkDiv(M4_TMR4_TypeDef *TMR4x, uint16_t u16Div); +uint16_t TMR4_CNT_GetPclkDiv(const M4_TMR4_TypeDef *TMR4x); +void TMR4_CNT_SetMode(M4_TMR4_TypeDef *TMR4x, uint16_t u16Mode); +uint16_t TMR4_CNT_GetMode(const M4_TMR4_TypeDef *TMR4x); +en_flag_status_t TMR4_CNT_GetStatus(const M4_TMR4_TypeDef *TMR4x, uint16_t u16Flag); +void TMR4_CNT_ClearStatus(M4_TMR4_TypeDef *TMR4x, uint16_t u16Flag); +void TMR4_CNT_IntCmd(M4_TMR4_TypeDef *TMR4x, + uint16_t u16IntSource, + en_functional_state_t enNewState); +void TMR4_CNT_Start(M4_TMR4_TypeDef *TMR4x); +void TMR4_CNT_Stop(M4_TMR4_TypeDef *TMR4x); +void TMR4_CNT_SetCycleVal(M4_TMR4_TypeDef *TMR4x, uint16_t u16CycleVal); +uint16_t TMR4_CNT_GetCycleVal(const M4_TMR4_TypeDef *TMR4x); +void TMR4_CNT_ClearCountVal(M4_TMR4_TypeDef *TMR4x); +void TMR4_CNT_SetCountVal(M4_TMR4_TypeDef *TMR4x, uint16_t u16CountVal); +uint16_t TMR4_CNT_GetCountVal(const M4_TMR4_TypeDef *TMR4x); +en_result_t TMR4_CNT_SetIntMaskTimes(M4_TMR4_TypeDef *TMR4x, + uint16_t u16IntSource, + uint16_t u16MaskTimes); +en_result_t TMR4_CNT_GetIntMaskTimes(const M4_TMR4_TypeDef *TMR4x, + uint16_t u16IntSource, + uint16_t *pu16MaskTimes); +en_result_t TMR4_CNT_GetIntMaskCurrentTimes(const M4_TMR4_TypeDef *TMR4x, + uint16_t u16IntSource, + uint16_t *pu16MaskTimes); +void TMR4_CNT_PortOutputDirSigCmd(M4_TMR4_TypeDef *TMR4x, + en_functional_state_t enNewState); +/** + * @} + */ + +/** + * @addtogroup TMR4_OCO_Global_Functions + * @{ + */ + +/* Initialization and configuration TMR4 OCO functions */ +en_result_t TMR4_OCO_Init(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + const stc_tmr4_oco_init_t *pstcInit); +en_result_t TMR4_OCO_StructInit(stc_tmr4_oco_init_t *pstcInit); +void TMR4_OCO_DeInit(M4_TMR4_TypeDef *TMR4x, uint32_t u32Ch); +void TMR4_OCO_SetOccrBufMode(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16OccrBufMode); +uint16_t TMR4_OCO_GetOccrBufMode(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch); +void TMR4_OCO_SetOccrLinkTransfer(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16TransferState); +void TMR4_OCO_SetOcmrBufMode(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16OcmrBufMode); +uint16_t TMR4_OCO_GetOcmrBufMode(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch); +void TMR4_OCO_SetOcmrLinkTransfer(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16TransferState); +void TMR4_OCO_SetExtMatchCond(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16ExtMatch); +en_result_t TMR4_OCO_SetHighChCompareMode(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + const stc_oco_high_ch_compare_mode_t *pstcMode); +en_result_t TMR4_OCO_SetLowChCompareMode(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + const stc_oco_low_ch_compare_mode_t *pstcMode); +void TMR4_OCO_SetOutputCompare(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16OcoCmd); +void TMR4_OCO_IntCmd(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + en_functional_state_t enNewState); +en_flag_status_t TMR4_OCO_GetStatus(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch); +void TMR4_OCO_ClearStatus(M4_TMR4_TypeDef *TMR4x, uint32_t u32Ch); +void TMR4_OCO_SetOcoInvalidOp(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16OutputPolarity); +uint16_t TMR4_OCO_GetOutputPolarity(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch); +void TMR4_OCO_SetCompareVal(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16CompareVal); +uint16_t TMR4_OCO_GetCompareVal(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch); +/** + * @} + */ + +/** + * @addtogroup TMR4_PWM_Global_Functions + * @{ + */ + +/* Initialization and configuration TMR4 PWM functions */ +en_result_t TMR4_PWM_Init(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + const stc_tmr4_pwm_init_t *pstcInit); +en_result_t TMR4_PWM_StructInit(stc_tmr4_pwm_init_t *pstcInit); +void TMR4_PWM_DeInit(M4_TMR4_TypeDef *TMR4x, uint32_t u32Ch); +void TMR4_PWM_SetPclkDiv(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16Div); +uint16_t TMR4_PWM_GetPclkDiv(const M4_TMR4_TypeDef *TMR4x, uint32_t u32Ch); +void TMR4_PWM_SetOcoPolarityTransform(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16OcoPolTransform); +uint16_t TMR4_PWM_GetOcoPolarityTransform(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch); +void TMR4_PWM_StartReloadTimer(M4_TMR4_TypeDef *TMR4x, uint32_t u32Ch); +void TMR4_PWM_StopReloadTimer(M4_TMR4_TypeDef *TMR4x, uint32_t u32Ch); +void TMR4_PWM_IntCmd(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + en_functional_state_t enNewState); +en_flag_status_t TMR4_PWM_GetStatus(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch); +void TMR4_PWM_ClearStatus(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch); +void TMR4_PWM_SetDeadRegionValue(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16PDAR, + uint16_t u16PDBR); +void TMR4_PWM_GetDeadRegionValue(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t *pu16PDAR, + uint16_t *pu16PDBR); +void TMR4_PWM_SetFilterCountValue(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16Count); +void TMR4_PWM_AutoOutputCmd(M4_TMR4_TypeDef *TMR4x, + en_functional_state_t enNewState); +void TMR4_PWM_MasterOutputCmd(M4_TMR4_TypeDef *TMR4x, + en_functional_state_t enNewState); +void TMR4_PWM_PortOutputMode(M4_TMR4_TypeDef *TMR4x, + uint32_t u32PwmPort, + uint32_t u32Mode); +void TMR4_PWM_SetPortEnBitEffectTime(M4_TMR4_TypeDef *TMR4x, + uint32_t u32EffectTime); +uint32_t TMR4_PWM_GetPortEnBitEffectTime(const M4_TMR4_TypeDef *TMR4x); +void TMR4_PWM_EmbPwmPortOutputState(M4_TMR4_TypeDef *TMR4x, + uint32_t u32PwmPort, + uint32_t u32State); +/** + * @} + */ + +/** + * @addtogroup TMR4_SEVT_Global_Functions + * @{ + */ + +/* Initialization and configuration TMR4 SEVT functions */ +en_result_t TMR4_SEVT_Init(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + const stc_tmr4_sevt_init_t *pstcInit); +en_result_t TMR4_SEVT_StructInit(stc_tmr4_sevt_init_t *pstcInit); +void TMR4_SEVT_DeInit(M4_TMR4_TypeDef *TMR4x, uint32_t u32Ch); +void TMR4_SEVT_SetOutpuEvent(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16Event); +uint16_t TMR4_SEVT_GetOutpuEvent(M4_TMR4_TypeDef *TMR4x, uint32_t u32Ch); +void TMR4_SEVT_SetDelayObject(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16DelayObject); +uint16_t TMR4_SEVT_GetDelayObject(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch); +void TMR4_SEVT_SetCompareVal(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16CompareVal); +uint16_t TMR4_SEVT_GetCompareVal(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch); +void TMR4_SEVT_SetMaskTimes(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16MaskTimes); +uint16_t TMR4_SEVT_GetMaskTimes(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch); +void TMR4_SEVT_SetPortOutputEventSig(M4_TMR4_TypeDef *TMR4x, + uint16_t u16EvtSignal); +uint16_t TMR4_SEVT_GetPortOutputEventSig(const M4_TMR4_TypeDef *TMR4x); +/** + * @} + */ + +/** + * @} + */ + +#endif /* DDL_TMR4_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_TMR4_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_tmr6.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_tmr6.h new file mode 100644 index 0000000000..4606c5af68 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_tmr6.h @@ -0,0 +1,895 @@ +/** + ******************************************************************************* + * @file hc32f4a0_tmr6.h + * @brief Head file for TMR6 module. + * + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Wangmin First version + 2020-07-15 Wangmin Refine macro define + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_TMR6_H__ +#define __HC32F4A0_TMR6_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_TMR6 + * @{ + */ + +#if (DDL_TMR6_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup TMR6_Global_Types TMR6 Global Types + * @{ + */ + +/** + * @brief Timer6 base counter function structure definition + */ +typedef struct +{ + uint32_t u32CntMode; /*!< Count mode, @ref TMR6_Count_Mode_define */ + uint32_t u32CntDir; /*!< Count direction, @ref TMR6_Count_Direction_define */ + uint32_t u32CntClkDiv; /*!< Count clock division select, @ref TMR6_Count_Clock_define */ + uint32_t u32CntStpAftOvf; /*!< Count stop after overflow @ref TMR6_Count_Stop_After_Overflow_define*/ +}stc_tmr6_basecnt_cfg_t; + +/** + * @brief Timer6 buffer function configuration structure definition + */ +typedef struct +{ + uint32_t u32BufFunCmd; /*!< specifies the buffer function status, + and this parameter can be a value of + @ref TMR6_Buffer_Function_sta_Define */ + uint32_t u32BufNum; /*!< specifies the buffer number, + and this parameter can be a value of + @ref TMR6_Buffer_Number_Chose_Define */ + uint32_t u32BufTransTim; /*!< specifies the buffer send time, + and this parameter can be a value of + @ref TMR6_Buffer_Transfer_Time_Cfg_Define */ +}stc_tmr6_buf_func_cfg_t; + +/** + * @brief Timer6 Valid period function configuration structure definition + */ +typedef struct +{ + uint32_t u32StatChA; /*!< specifies the valid period function status for channel A, + and this parameter can be a value of + @ref TMR6_Valid_Period_CHA_STAT_Define */ + uint32_t u32StatChB; /*!< specifies the valid period function status for channel B, + and this parameter can be a value of + @ref TMR6_Valid_Period_CHB_STAT_Define */ + uint32_t u32CntCond; /*!< specifies the count condition, + and this parameter can be a value of + @ref TMR6_Valid_Period_Count_Condition_Define */ + uint32_t u32PeriodInterval; /*!< specifies the interval of the valid period, + @ref TMR6_Valid_Period_Count_Define */ +}stc_tmr6_valid_period_func_cfg_t; + +/** + * @brief Timer6 port input configuration structure definition + */ +typedef struct +{ + uint32_t u32PortMode; /*!< Port function mode @ref TMR6_Port_Mode_Func */ + uint32_t u32FilterSta; /*!< trig source capture input filter status + @ref TMR6_Port_Input_Filter_Sta*/ + uint32_t u32FltClk; /*!< Filter clock @ref TMR6_Input_Port_Filter_Clk*/ +}stc_tmr6_port_input_cfg_t; + +/** + * @brief Timer6 port output configuration structure definition + */ +typedef struct +{ + uint32_t u32PortMode; /*!< Port function mode @ref TMR6_Port_Mode_Func */ + uint32_t u32NextPeriodForceSta; /*!< Port State Next period @ref TMR6_Force_Port_Output_Sta */ + uint32_t u32DownCntMatchAnotherCmpRegSta; /*!< Port state when counter match another compare register + (CHA matched GCMBR, CHB matched GCMAR) in count-down mode + @ref TMR6_Port_Output_Sta */ + uint32_t u32UpCntMatchAnotherCmpRegSta; /*!< Port state when counter match another compare register + (CHA matched GCMBR, CHB matched GCMAR) in count-up mode + @ref TMR6_Port_Output_Sta*/ + uint32_t u32DownCntMatchCmpRegSta; /*!< Port state when counter match compare register + (CHA matched GCMAR, CHB matched GCMBR) in count-down mode + @ref TMR6_Port_Output_Sta */ + uint32_t u32UpCntMatchCmpRegSta; /*!< Port state when counter match compare register + (CHA matched GCMAR, CHB matched GCMBR) in count-up mode + @ref TMR6_Port_Output_Sta */ + uint32_t u32UnderflowSta; /*!< Port State when counter underflow @ref TMR6_Port_Output_Sta */ + uint32_t u32OverflowSta; /*!< Port State when counter overflow @ref TMR6_Port_Output_Sta */ + uint32_t u32StopSta; /*!< Port State when count stop @ref TMR6_Port_Output_Sta */ + uint32_t u32StartSta; /*!< Port State when count start @ref TMR6_Port_Output_Sta */ +}stc_tmr6_port_output_cfg_t; + +/** + * @brief Timer6 EMB configuration structure definition + */ +typedef struct +{ + uint32_t u32ValidCh; /*!< Valid EMB event channel @ref TMR6_Emb_channel */ + uint32_t u32ReleaseMode; /*!< Port release mode when EMB event invalid @ref TMR6_Emb_Release_Mode */ + uint32_t u32PortSta; /*!< Port Output status when EMB event valid @ref TMR6_Emb_Port_Sta */ +}stc_tmr6_emb_cfg_t; + +/** + * @brief Timer6 Dead time function configuration structure definition + */ +typedef struct +{ + uint32_t u32DtEqualUpDwn; /*!< Enable down count dead time register equal to up count DT register + @ref TMR6_Deadtime_Reg_Equal_Func_define */ + uint32_t u32EnDtBufUp; /*!< Enable buffer transfer for up count dead time register + (DTUBR-->DTUAR) @ref TMR6_Deadtime_CountUp_Buf_Func_define*/ + uint32_t u32EnDtBufDwn; /*!< Enable buffer transfer for down count dead time register + (DTDBR-->DTDAR) @ref TMR6_Deadtime_CountDown_Buf_Func_define*/ + uint32_t u32DtUpdCond; /*!< Buffer transfer condition for triangular wave mode + @ref TMR6_Deadtime_Buf_Transfer_Condition_define */ +}stc_tmr6_deadtime_cfg_t; + +/** + * @brief Timer6 Dead time function configuration structure definition + */ +typedef struct +{ + uint32_t u32ZMaskCycle; /*!< Z phase input mask periods selection @ref TMR6_Zmask_Cycle_define*/ + uint32_t u32PosCntMaskEn; /*!< As position count timer, clear function enable(TRUE) or disable(FALSE) + during the time of Z phase input mask @ref TMR6_Zmask_Position_Unit_Clear_Func_define*/ + uint32_t u32RevCntMaskEn; /*!< As revolution count timer, the counter function enable(TRUE) or + disable(FALSE) during the time of Z phase input mask @ref TMR6_Zmask_Revolution_Unit_Count_Func_define*/ +}stc_tmr6_zmask_cfg_t; + + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup TMR6_Global_Macros TMR6 Global Macros + * @{ + */ + + +/** @defgroup TMR6_Sta_Bit_Get_Define TMR6 status bit define + * @{ + */ +/* Status bit indicate that GCMAR register matched with counter register */ +#define TMR6_STAT_CNT_MATCH_A (TMR6_STFLR_CMAF) +/* Status bit indicate that GCMBR register matched with counter register */ +#define TMR6_STAT_CNT_MATCH_B (TMR6_STFLR_CMBF) +/* Status bit indicate that GCMCR register matched with counter register */ +#define TMR6_STAT_CNT_MATCH_C (TMR6_STFLR_CMCF) +/* Status bit indicate that GCMDR register matched with counter register */ +#define TMR6_STAT_CNT_MATCH_D (TMR6_STFLR_CMDF) +/* Status bit indicate that GCMER register matched with counter register */ +#define TMR6_STAT_CNT_MATCH_E (TMR6_STFLR_CMEF) +/* Status bit indicate that GCMFR register matched with counter register */ +#define TMR6_STAT_CNT_MATCH_F (TMR6_STFLR_CMFF) +/* Status bit indicate that counter register overflow */ +#define TMR6_STAT_OVERFLOW (TMR6_STFLR_OVFF) +/* Status bit indicate that counter register underflow */ +#define TMR6_STAT_UNDERFLOW (TMR6_STFLR_UDFF) +/* Status bit indicate that dead time error */ +#define TMR6_STAT_DEAD_TIME_ERR (TMR6_STFLR_DTEF) +/* Status bit indicate that SCMAR register matched with counter register during count-up */ +#define TMR6_STAT_UPCNT_SP_MATCH_A (TMR6_STFLR_CMSAUF) +/* Status bit indicate that SCMAR register matched with counter register during count-down */ +#define TMR6_STAT_DOWNCNT_SP_MATCH_A (TMR6_STFLR_CMSADF) +/* Status bit indicate that SCMBR register matched with counter register during count-up */ +#define TMR6_STAT_UPCNT_SP_MATCH_B (TMR6_STFLR_CMSBUF) +/* Status bit indicate that SCMBR register matched with counter register during count-down */ +#define TMR6_STAT_DOWNCNT_SP_MATCH_B (TMR6_STFLR_CMSBDF) +/* Counter direction flag */ +#define TMR6_STAT_CNT_DIR (TMR6_STFLR_DIRF) +/** + * @} + */ + +/** @defgroup TMR6_Interrupt_Enable_Bit_Define TMR6 interrupt configuration bit define + * @{ + */ +/* Interrupt enable bit for GCMAR register matched */ +#define TMR6_IRQ_EN_CNT_MATCH_A (TMR6_ICONR_INTENA) +/* Interrupt enable bit for GCMBR register matched */ +#define TMR6_IRQ_EN_CNT_MATCH_B (TMR6_ICONR_INTENB) +/* Interrupt enable bit for GCMCR register matched */ +#define TMR6_IRQ_EN_CNT_MATCH_C (TMR6_ICONR_INTENC) +/* Interrupt enable bit for GCMDR register matched */ +#define TMR6_IRQ_EN_CNT_MATCH_D (TMR6_ICONR_INTEND) +/* Interrupt enable bit for GCMER register matched */ +#define TMR6_IRQ_EN_CNT_MATCH_E (TMR6_ICONR_INTENE) +/* Interrupt enable bit for GCMFR register matched */ +#define TMR6_IRQ_EN_CNT_MATCH_F (TMR6_ICONR_INTENF) +/* Interrupt enable bit for counter register overflow */ +#define TMR6_IRQ_EN_OVERFLOW (TMR6_ICONR_INTENOVF) +/* Interrupt enable bit for counter register underflow */ +#define TMR6_IRQ_EN_UNDERFLOW (TMR6_ICONR_INTENUDF) +/* Interrupt enable bit for dead time */ +#define TMR6_IRQ_EN_DEAD_TIME_ERR (TMR6_ICONR_INTENDTE) +/* Interrupt enable bit for SCMAR register matched during count-up*/ +#define TMR6_IRQ_EN_UPCNT_SP_MATCH_A (TMR6_ICONR_INTENSAU) +/* Interrupt enable bit for SCMAR register matched during count-down*/ +#define TMR6_IRQ_EN_DOWNCNT_SP_MATCH_A (TMR6_ICONR_INTENSAD) +/* Interrupt enable bit for SCMBR register matched during count-up*/ +#define TMR6_IRQ_EN_UPCNT_SP_MATCH_B (TMR6_ICONR_INTENSBU) +/* Interrupt enable bit for SCMBR register matched during count-down*/ +#define TMR6_IRQ_EN_DOWNCNT_SP_MATCH_B (TMR6_ICONR_INTENSBD) +/** + * @} + */ + +/** @defgroup TMR6_Period_Register_Index_Define TMR6 period register Index define + * @{ + */ +#define TMR6_PERIOD_REG_A (0x00UL) +#define TMR6_PERIOD_REG_B (0x01UL) +#define TMR6_PERIOD_REG_C (0x02UL) +/** + * @} + */ + +/** @defgroup TMR6_Compare_Register_Index_Define TMR6 compare register Index define + * @{ + */ +#define TMR6_CMP_REG_A (0x00UL) +#define TMR6_CMP_REG_B (0x01UL) +#define TMR6_CMP_REG_C (0x02UL) +#define TMR6_CMP_REG_D (0x03UL) +#define TMR6_CMP_REG_E (0x04UL) +#define TMR6_CMP_REG_F (0x05UL) +/** + * @} + */ + +/** @defgroup TMR6_Compare_channel_Define TMR6 general/special compare channel index define + * @{ + */ +#define TMR6_CH_A (0x00UL) +#define TMR6_CH_B (0x01UL) +/** + * @} + */ + +/** @defgroup TMR6_Buffer_Function_sta_Define TMR6 buffer function status define + * @{ + */ +#define TMR6_BUF_FUNC_OFF (0x00000000UL) +#define TMR6_BUF_FUNC_ON (TMR6_BCONR_BENA) +/** + * @} + */ + +/** @defgroup TMR6_Buffer_Number_Chose_Define TMR6 buffer number configuration define + * @{ + */ +#define TMR6_BUF_FUNC_SINGLE (0x00000000UL) +#define TMR6_BUF_FUNC_DOUBLE (TMR6_BCONR_BSEA) +/** + * @} + */ + +/** @defgroup TMR6_Buffer_Transfer_Time_Cfg_Define TMR6 buffer transfer time configuration define + * @{ + */ +#define TMR6_BUF_TRANS_TIM_NONE (0x00000000UL) +#define TMR6_BUF_TRANS_TIM_OVERFLOW (TMR6_BCONR_BTRUA) +#define TMR6_BUF_TRANS_TIM_UNDERFLOW (TMR6_BCONR_BTRDA) +#define TMR6_BUF_TRANS_TIM_BOTH (TMR6_BCONR_BTRUA | TMR6_BCONR_BTRDA) +/** + * @} + */ + +/** @defgroup TMR6_Valid_Period_Count_Condition_Define TMR6 valid period function count condition define + * @{ + */ +/* Valid period function off */ +#define TMR6_VALID_PERIOD_FUNC_OFF (0x00000000UL) +/* Counted when Sawtooth waveform overflow and underflow, triangular wave underflow */ +#define TMR6_VALID_PERIOD_CNT_COND_UNDERFLOW (TMR6_VPERR_PCNTE_0) +/* Counted when Sawtooth waveform overflow and underflow, triangular wave overflow */ +#define TMR6_VALID_PERIOD_CNT_COND_OVERFLOW (TMR6_VPERR_PCNTE_1) +/* Counted when Sawtooth waveform overflow and underflow, triangular wave overflow and underflow */ +#define TMR6_VALID_PERIOD_CNT_COND_BOTH (TMR6_VPERR_PCNTE_0 | TMR6_VPERR_PCNTE_1) +/** + * @} + */ + +/** @defgroup TMR6_Valid_Period_Count_Define TMR6 valid period function count define + * @{ + */ +/* Valid period count function invalid */ +#define TMR6_VALID_PERIOD_CNT_INVALID (0x00000000UL) +/* Interrupt and event valid every other 1 period */ +#define TMR6_VALID_PERIOD_CNT_1 (TMR6_VPERR_PCNTS_0) +/* Interrupt and event valid every other 2 period */ +#define TMR6_VALID_PERIOD_CNT_2 (TMR6_VPERR_PCNTS_1) +/* Interrupt and event valid every other 3 period */ +#define TMR6_VALID_PERIOD_CNT_3 (TMR6_VPERR_PCNTS_0 | TMR6_VPERR_PCNTS_1) +/* Interrupt and event valid every other 4 period */ +#define TMR6_VALID_PERIOD_CNT_4 (TMR6_VPERR_PCNTS_2) +/* Interrupt and event valid every other 5 period */ +#define TMR6_VALID_PERIOD_CNT_5 (TMR6_VPERR_PCNTS_2 | TMR6_VPERR_PCNTS_0) +/* Interrupt and event valid every other 6 period */ +#define TMR6_VALID_PERIOD_CNT_6 (TMR6_VPERR_PCNTS_2 | TMR6_VPERR_PCNTS_1) +/* Interrupt and event valid every other 7 period */ +#define TMR6_VALID_PERIOD_CNT_7 (TMR6_VPERR_PCNTS_2 | TMR6_VPERR_PCNTS_1 | TMR6_VPERR_PCNTS_0) +/** + * @} + */ + +/** @defgroup TMR6_Valid_Period_CHA_STAT_Define TMR6 valid period function channel A status define + * @{ + */ +#define TMR6_VALID_PERIOD_FUNC_CHA_OFF (0x00000000UL) +#define TMR6_VALID_PERIOD_FUNC_CHA_ON (TMR6_VPERR_SPPERIA) +/** + * @} + */ + +/** @defgroup TMR6_Valid_Period_CHB_STAT_Define TMR6 valid period function channel B status define + * @{ + */ +#define TMR6_VALID_PERIOD_FUNC_CHB_OFF (0x00000000UL) +#define TMR6_VALID_PERIOD_FUNC_CHB_ON (TMR6_VPERR_SPPERIB) +/** + * @} + */ + +/** @defgroup TMR6_DeadTime_Reg_Define TMR6 dead time register define + * @{ + */ +/* Register DTUAR */ +#define TMR6_DEADTIME_REG_UP_A (0x00U) +/* Register DTDAR */ +#define TMR6_DEADTIME_REG_DOWN_A (0x01U) +/* Register DTUBR */ +#define TMR6_DEADTIME_REG_UP_B (0x02U) +/* Register DTDBR */ +#define TMR6_DEADTIME_REG_DOWN_B (0x03U) +/** + * @} + */ + +/** @defgroup TMR6_Port_Define TMR6 input and output port define + * @{ + */ +/* port TIM6__PWMA */ +#define TMR6_IO_PWMA (0x00U) +/* port TIM6__PWMB */ +#define TMR6_IO_PWMB (0x01U) +/* Input port TIM6_TRIGA */ +#define TMR6_INPUT_TRIGA (0x02U) +/* Input port TIM6_TRIGB */ +#define TMR6_INPUT_TRIGB (0x03U) +/* Input port TIM6_TRIGC */ +#define TMR6_INPUT_TRIGC (0x04U) +/* Input port TIM6_TRIGD */ +#define TMR6_INPUT_TRIGD (0x05U) +/** + * @} + */ + +/** @defgroup TMR6_Input_Port_Filter_Clk TMR6 input port define + * @{ + */ +#define TMR6_INPUT_FILTER_PCLK0_DIV1 (0x00U) +#define TMR6_INPUT_FILTER_PCLK0_DIV4 (0x01U) +#define TMR6_INPUT_FILTER_PCLK0_DIV16 (0x02U) +#define TMR6_INPUT_FILTER_PCLK0_DIV64 (0x03U) +/** + * @} + */ + +/** @defgroup TMR6_Port_Mode_Func TMR6 port function mode selection + * @{ + */ +#define TMR6_PORT_COMPARE_OUTPUT (0x00U) +#define TMR6_PORT_CAPTURE_INPUT (TMR6_PCNAR_CAPMDA) +/** + * @} + */ + +/** @defgroup TMR6_Port_Input_Filter_Sta TMR6 port input filter function status + * @{ + */ +#define TMR6_PORT_INPUT_FILTER_OFF (0x00U) +#define TMR6_PORT_INPUT_FILTER_ON (0x01U) +/** + * @} + */ + +/** @defgroup TMR6_Port_Output_Sta TMR6 port output status + * @{ + */ +#define TMR6_PORT_OUTPUT_STA_LOW (0x00U) +#define TMR6_PORT_OUTPUT_STA_HIGH (0x01U) +#define TMR6_PORT_OUTPUT_STA_HOLD (0x02U) +#define TMR6_PORT_OUTPUT_STA_REVERSE (0x03U) +/** + * @} + */ + +/** @defgroup TMR6_Force_Port_Output_Sta TMR6 force port output status next period + * @{ + */ +#define TMR6_FORCE_PORT_OUTPUT_INVALID (0x00U) +#define TMR6_FORCE_PORT_OUTPUT_STA_LOW (0x02U) +#define TMR6_FORCE_PORT_OUTPUT_STA_HIGH (0x03U) +/** + * @} + */ + +/** @defgroup TMR6_Emb_channel TMR6 EMB event valid channel + * @{ + */ +#define TMR6_EMB_EVENT_VALID_CH0 (0x00U) +#define TMR6_EMB_EVENT_VALID_CH1 (TMR6_PCNAR_EMBSA_0) +#define TMR6_EMB_EVENT_VALID_CH2 (TMR6_PCNAR_EMBSA_1) +#define TMR6_EMB_EVENT_VALID_CH3 (TMR6_PCNAR_EMBSA_0 | TMR6_PCNAR_EMBSA_1) +/** + * @} + */ + +/** @defgroup TMR6_Emb_Release_Mode TMR6 EMB function release mode when EMB event invalid + * @{ + */ +#define TMR6_EMB_RELEASE_IMMEDIATE (0x00U) +#define TMR6_EMB_RELEASE_OVERFLOW (TMR6_PCNAR_EMBRA_0) +#define TMR6_EMB_RELEASE_UNDERFLOW (TMR6_PCNAR_EMBRA_1) +#define TMR6_EMB_RELEASE_OVERFLOW_UNDERFLOW (TMR6_PCNAR_EMBRA_0 | TMR6_PCNAR_EMBRA_1) +/** + * @} + */ + +/** @defgroup TMR6_Emb_Port_Sta TMR6 EMB port output status when EMB event valid + * @{ + */ +#define TMR6_EMB_PORTSTA_NORMAL (0x00U) +#define TMR6_EMB_PORTSTA_HIZ (TMR6_PCNAR_EMBCA_0) +#define TMR6_EMB_PORTSTA_LOW (TMR6_PCNAR_EMBCA_1) +#define TMR6_EMB_PORTSTA_HIGH (TMR6_PCNAR_EMBCA_0 | TMR6_PCNAR_EMBCA_1) +/** + * @} + */ + +/** @defgroup TMR6_Deadtime_CountUp_Buf_Func_define TMR6 Dead time buffer function for count up stage + * @{ + */ +#define TMR6_DEADTIME_CNT_UP_BUF_OFF (0x00U) +#define TMR6_DEADTIME_CNT_UP_BUF_ON (TMR6_DCONR_DTBENU) +/** + * @} + */ + +/** @defgroup TMR6_Deadtime_CountDown_Buf_Func_define TMR6 Dead time buffer function for count down stage + * @{ + */ +#define TMR6_DEADTIME_CNT_DOWN_BUF_OFF (0x00U) +#define TMR6_DEADTIME_CNT_DOWN_BUF_ON (TMR6_DCONR_DTBEND) +/** + * @} + */ + +/** @defgroup TMR6_Deadtime_Buf_Transfer_Condition_define TMR6 Dead time buffer transfer condition define for triangular count mode + * @{ + */ +#define TMR6_DEADTIME_TRANS_COND_NONE (0x00U) +#define TMR6_DEADTIME_TRANS_COND_OVERFLOW (TMR6_DCONR_DTBTRU) +#define TMR6_DEADTIME_TRANS_COND_UNDERFLOW (TMR6_DCONR_DTBTRD) +#define TMR6_DEADTIME_TRANS_COND_BOTH (TMR6_DCONR_DTBTRU | TMR6_DCONR_DTBTRD) +/** + * @} + */ + +/** @defgroup TMR6_Deadtime_Reg_Equal_Func_define TMR6 Dead time function DTDAR equal DTUAR + * @{ + */ +#define TMR6_DEADTIME_EQUAL_OFF (0x00U) +#define TMR6_DEADTIME_EQUAL_ON (TMR6_DCONR_SEPA) +/** + * @} + */ + +/** @defgroup TMR6_Soft_Sync_Ctrl_Unit_Number_define TMR6 Software synchronization start/stop/clear/update unit number define + * @{ + */ +#define TMR6_SOFT_SYNC_CTRL_U1 (TMR6_SSTAR_SSTA1) +#define TMR6_SOFT_SYNC_CTRL_U2 (TMR6_SSTAR_SSTA2) +#define TMR6_SOFT_SYNC_CTRL_U3 (TMR6_SSTAR_SSTA3) +#define TMR6_SOFT_SYNC_CTRL_U4 (TMR6_SSTAR_SSTA4) +#define TMR6_SOFT_SYNC_CTRL_U5 (TMR6_SSTAR_SSTA5) +#define TMR6_SOFT_SYNC_CTRL_U6 (TMR6_SSTAR_SSTA6) +#define TMR6_SOFT_SYNC_CTRL_U7 (TMR6_SSTAR_SSTA7) +#define TMR6_SOFT_SYNC_CTRL_U8 (TMR6_SSTAR_SSTA8) +/** + * @} + */ + +/** @defgroup TMR6_hardware_control_event_define TMR6 hardware start/stop/clear/update/capture events define + * @{ + */ +#define TMR6_HW_CTRL_PWMA_RISING (TMR6_HSTAR_HSTA0) +#define TMR6_HW_CTRL_PWMA_FAILLING (TMR6_HSTAR_HSTA1) +#define TMR6_HW_CTRL_PWMB_RISING (TMR6_HSTAR_HSTA2) +#define TMR6_HW_CTRL_PWMB_FAILLING (TMR6_HSTAR_HSTA3) +#define TMR6_HW_CTRL_INTER_EVENT0 (TMR6_HSTAR_HSTA8) +#define TMR6_HW_CTRL_INTER_EVENT1 (TMR6_HSTAR_HSTA9) +#define TMR6_HW_CTRL_INTER_EVENT2 (TMR6_HSTAR_HSTA10) +#define TMR6_HW_CTRL_INTER_EVENT3 (TMR6_HSTAR_HSTA11) +#define TMR6_HW_CTRL_TRIGEA_RISING (TMR6_HSTAR_HSTA16) +#define TMR6_HW_CTRL_TRIGEA_FAILLING (TMR6_HSTAR_HSTA17) +#define TMR6_HW_CTRL_TRIGEB_RISING (TMR6_HSTAR_HSTA18) +#define TMR6_HW_CTRL_TRIGEB_FAILLING (TMR6_HSTAR_HSTA19) +#define TMR6_HW_CTRL_TRIGEC_RISING (TMR6_HSTAR_HSTA20) +#define TMR6_HW_CTRL_TRIGEC_FAILLING (TMR6_HSTAR_HSTA21) +#define TMR6_HW_CTRL_TRIGED_RISING (TMR6_HSTAR_HSTA22) +#define TMR6_HW_CTRL_TRIGED_FAILLING (TMR6_HSTAR_HSTA23) +/** + * @} + */ + +/** @defgroup TMR6_hardware_count_event_define TMR6 hardware increase/decrease events define + * @{ + */ +#define TMR6_HW_CNT_PWMAL_PWMBRISING (TMR6_HCUPR_HCUP0) +#define TMR6_HW_CNT_PWMAL_PWMBFAILLING (TMR6_HCUPR_HCUP1) +#define TMR6_HW_CNT_PWMAH_PWMBRISING (TMR6_HCUPR_HCUP2) +#define TMR6_HW_CNT_PWMAH_PWMBFAILLING (TMR6_HCUPR_HCUP3) +#define TMR6_HW_CNT_PWMBL_PWMARISING (TMR6_HCUPR_HCUP4) +#define TMR6_HW_CNT_PWMBL_PWMAFAILLING (TMR6_HCUPR_HCUP5) +#define TMR6_HW_CNT_PWMBH_PWMARISING (TMR6_HCUPR_HCUP6) +#define TMR6_HW_CNT_PWMBH_PWMAFAILLING (TMR6_HCUPR_HCUP7) +#define TMR6_HW_CNT_INTER_EVENT0 (TMR6_HCUPR_HCUP8) +#define TMR6_HW_CNT_INTER_EVENT1 (TMR6_HCUPR_HCUP9) +#define TMR6_HW_CNT_INTER_EVENT2 (TMR6_HCUPR_HCUP10) +#define TMR6_HW_CNT_INTER_EVENT3 (TMR6_HCUPR_HCUP11) +#define TMR6_HW_CNT_TRIGEA_RISING (TMR6_HCUPR_HCUP16) +#define TMR6_HW_CNT_TRIGEA_FAILLING (TMR6_HCUPR_HCUP17) +#define TMR6_HW_CNT_TRIGEB_RISING (TMR6_HCUPR_HCUP18) +#define TMR6_HW_CNT_TRIGEB_FAILLING (TMR6_HCUPR_HCUP19) +#define TMR6_HW_CNT_TRIGEC_RISING (TMR6_HCUPR_HCUP20) +#define TMR6_HW_CNT_TRIGEC_FAILLING (TMR6_HCUPR_HCUP21) +#define TMR6_HW_CNT_TRIGED_RISING (TMR6_HCUPR_HCUP22) +#define TMR6_HW_CNT_TRIGED_FAILLING (TMR6_HCUPR_HCUP23) +/** + * @} + */ + +/** @defgroup TMR6_Count_Direction_define TMR6 base counter function direction define + * @{ + */ +#define TMR6_CNT_INCREASE (TMR6_GCONR_DIR) +#define TMR6_CNT_DECREASE (0x00U) +/** + * @} + */ + +/** @defgroup TMR6_Count_Mode_define TMR6 base counter function mode define + * @{ + */ +#define TMR6_MODE_SAWTOOTH (0x00U) +#define TMR6_MODE_TRIANGLE (TMR6_GCONR_MODE) +/** + * @} + */ + +/** @defgroup TMR6_Count_Clock_define TMR6 base counter clock source define + * @{ + */ +#define TMR6_CLK_PCLK0_DIV1 (0x00UL) +#define TMR6_CLK_PCLK0_DIV2 (0x01UL << TMR6_GCONR_CKDIV_POS) +#define TMR6_CLK_PCLK0_DIV4 (0x02UL << TMR6_GCONR_CKDIV_POS) +#define TMR6_CLK_PCLK0_DIV8 (0x03UL << TMR6_GCONR_CKDIV_POS) +#define TMR6_CLK_PCLK0_DIV16 (0x04UL << TMR6_GCONR_CKDIV_POS) +#define TMR6_CLK_PCLK0_DIV32 (0x05UL << TMR6_GCONR_CKDIV_POS) +#define TMR6_CLK_PCLK0_DIV64 (0x06UL << TMR6_GCONR_CKDIV_POS) +#define TMR6_CLK_PCLK0_DIV128 (0x07UL << TMR6_GCONR_CKDIV_POS) +#define TMR6_CLK_PCLK0_DIV256 (0x08UL << TMR6_GCONR_CKDIV_POS) +#define TMR6_CLK_PCLK0_DIV512 (0x09UL << TMR6_GCONR_CKDIV_POS) +#define TMR6_CLK_PCLK0_DIV1024 (0x0AUL << TMR6_GCONR_CKDIV_POS) +/** + * @} + */ + +/** @defgroup TMR6_Count_Stop_After_Overflow_define TMR6 count stop after overflow function define + * @{ + */ +#define TMR6_CNT_CONTINUOUS (0x00U) +#define TMR6_STOP_AFTER_OVF (TMR6_GCONR_OVSTP) +/** + * @} + */ + +/** @defgroup TMR6_Zmask_Cycle_define TMR6 Z Mask input function mask cycles number define + * @{ + */ +#define TMR6_ZMASK_CYCLE_FUNC_INVALID (0x00U) +#define TMR6_ZMASK_CYCLE_4 (TMR6_GCONR_ZMSKVAL_0) +#define TMR6_ZMASK_CYCLE_8 (TMR6_GCONR_ZMSKVAL_1) +#define TMR6_ZMASK_CYCLE_16 (TMR6_GCONR_ZMSKVAL_0 | TMR6_GCONR_ZMSKVAL_1) +/** + * @} + */ + +/** @defgroup TMR6_Zmask_Position_Unit_Clear_Func_define TMR6 unit as position timer, z phase input mask function define for clear action + * @{ + */ +#define TMR6_POS_CLR_ZMASK_FUNC_INVALID (0x00U) +#define TMR6_POS_CLR_ZMASK_FUNC_VALID (TMR6_GCONR_ZMSKPOS) +/** + * @} + */ + +/** @defgroup TMR6_Zmask_Revolution_Unit_Count_Func_define TMR6 unit as revolution timer, z phase input mask function define for count action + * @{ + */ +#define TMR6_REVO_CNT_ZMASK_FUNC_INVALID (0x00U) +#define TMR6_REVO_CNT_ZMASK_FUNC_VALID (TMR6_GCONR_ZMSKREV) +/** + * @} + */ + +/** @defgroup TMR6_Hardware_Trigger_Index_define TMR6 hardware trigger index define + * @{ + */ +#define TMR6_HW_TRIG_0 (0x00U) +#define TMR6_HW_TRIG_1 (0x01U) +#define TMR6_HW_TRIG_2 (0x02U) +#define TMR6_HW_TRIG_3 (0x03U) +/** + * @} + */ + +/** @defgroup TMR6_Common_Trigger_Source_Cfg_define TMR6 common Trigger Source Config + * @{ + */ +#define TMR6_COM_TRIG1 (AOS_TMR6_HTSSR_COMTRG_EN_0) +#define TMR6_COM_TRIG2 (AOS_TMR6_HTSSR_COMTRG_EN_1) +#define TMR6_COM_TRIG_MASK (AOS_TMR6_HTSSR_COMTRG_EN) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup TMR6_Global_Functions + * @{ + */ +/** + * @brief Get Software Sync start status + * @param None + * @retval An uint32_t data indicate the read status. + */ +__STATIC_INLINE uint32_t TMR6_GetSwSyncStaState(void) +{ + return READ_REG32(M4_TMR6_1->SSTAR); +} + +/* TMR6 interrupt request enable or disable */ +void TMR6_IntCmd(M4_TMR6_TypeDef *TMR6x, uint32_t u32Tmr6Irq, en_functional_state_t enNewState); +/* Get Timer6 status flag */ +en_flag_status_t TMR6_GetSta(const M4_TMR6_TypeDef *TMR6x, uint32_t u32StaBit); +/* Get Timer6 period number when valid period function enable */ +uint32_t TMR6_GetPeriodNum(const M4_TMR6_TypeDef *TMR6x); +/* De-initialize the timer6 unit */ +void TMR6_DeInit(M4_TMR6_TypeDef *TMR6x); +/* Initialize the timer6 unit */ +en_result_t TMR6_Init(M4_TMR6_TypeDef *TMR6x, const stc_tmr6_basecnt_cfg_t* pstcTmr6BaseCntCfg); +/* Timer6 counter function command */ +void TMR6_CountCmd(M4_TMR6_TypeDef *TMR6x, en_functional_state_t enNewState); + +/* Timer6 counter register set */ +void TMR6_SetCntReg(M4_TMR6_TypeDef *TMR6x, uint32_t u32Value); +/* Timer6 update register set */ +void TMR6_SetUpdateReg(M4_TMR6_TypeDef *TMR6x, uint32_t u32Value); +/* Timer6 set period register(A~C) */ +void TMR6_SetPeriodReg(M4_TMR6_TypeDef *TMR6x, uint32_t u32PeriodReg, uint32_t u32PeriodVal); +/* Timer6 set general compare register(A~F) */ +void TMR6_SetGenCmpReg(M4_TMR6_TypeDef *TMR6x, uint32_t u32GenCmpReg, uint32_t u32CmpVal); +/* Timer6 set special compare register(A~F) */ +void TMR6_SetSpecialCmpReg(M4_TMR6_TypeDef *TMR6x, uint32_t u32SpecialCmpReg, uint32_t u32CmpVal); +/* Timer6 set dead time registerr */ +void TMR6_SetDeadTimeReg(M4_TMR6_TypeDef *TMR6x, uint32_t u32DeadTimeReg, uint32_t u32CmpVal); + +/* Timer6 get counter register value */ +uint32_t TMR6_GetCntReg(const M4_TMR6_TypeDef *TMR6x); +/* Timer6 get update register value */ +uint32_t TMR6_GetUpdateReg(const M4_TMR6_TypeDef *TMR6x); +/* Timer6 Get period register(A~C) */ +uint32_t TMR6_GetPeriodReg(const M4_TMR6_TypeDef *TMR6x, uint32_t u32PeriodReg); +/* Timer6 get general compare registers value(A~F) */ +uint32_t TMR6_GetGenCmpReg(const M4_TMR6_TypeDef *TMR6x, uint32_t u32GenCmpReg); +/* Timer6 get special compare registers value(A~F) */ +uint32_t TMR6_GetSpecialCmpReg(const M4_TMR6_TypeDef *TMR6x, uint32_t u32SpecialCmpReg); +/* Timer6 get dead time register */ +uint32_t TMR6_GetDeadTimeReg(const M4_TMR6_TypeDef *TMR6x, uint32_t u32DeadTimeReg); + +/* Timer6 general compare buffer function configuration */ +en_result_t TMR6_GenCmpBufCfg(M4_TMR6_TypeDef *TMR6x, uint32_t u32CmpChIdx, const stc_tmr6_buf_func_cfg_t* pstcGenBufCfg); +/* Timer6 special compare buffer function configuration */ +en_result_t TMR6_SpecialCmpBufCfg(M4_TMR6_TypeDef *TMR6x, uint32_t u32CmpChIdx, const stc_tmr6_buf_func_cfg_t* pstcSpecialBufCfg); +/* Timer6 period buffer function configuration */ +en_result_t TMR6_PeriodBufCfg(M4_TMR6_TypeDef *TMR6x, const stc_tmr6_buf_func_cfg_t* pstcPeriodBufCfg); + +/* Timer6 valid period function configuration for special compare function */ +en_result_t TMR6_ValidPeriodCfg(M4_TMR6_TypeDef *TMR6x, const stc_tmr6_valid_period_func_cfg_t* pstcValidPeriodCfg); +/* Port input configuration(Trig) */ +en_result_t TMR6_PortInputConfig(M4_TMR6_TypeDef *TMR6x, + uint32_t u32PortSel, + const stc_tmr6_port_input_cfg_t* pstcTmr6PortInputCfg); +/* Port output configuration(Trig) */ +en_result_t TMR6_PortOutputConfig(M4_TMR6_TypeDef *TMR6x, + uint32_t u32PortSel, + const stc_tmr6_port_output_cfg_t* pstcTmr6PortOutputCfg); +/* EMB function configuration */ +en_result_t TMR6_EMBConfig(M4_TMR6_TypeDef *TMR6x, + uint32_t u32PortSel, + const stc_tmr6_emb_cfg_t* pstcTmr6EmbCfg); + +/* Timer6 dead time function command */ +void TMR6_DeadTimeFuncCmd(M4_TMR6_TypeDef *TMR6x, en_functional_state_t enNewState); +/* DeadTime function configuration */ +en_result_t TMR6_DeadTimeCfg(M4_TMR6_TypeDef *TMR6x, const stc_tmr6_deadtime_cfg_t* pstcTmr6DTCfg); + +/* Timer6 unit Z phase input mask config */ +en_result_t TMR6_ZMaskCfg(M4_TMR6_TypeDef *TMR6x, const stc_tmr6_zmask_cfg_t* pstcTmr6ZMaskCfg); + +/* Software Sync Start */ +void TMR6_SwSyncStart(uint32_t u32UnitCombine); +/* Software Sync Stop */ +void TMR6_SwSyncStop(uint32_t u32UnitCombine); +/* Software Sync clear */ +void TMR6_SwSyncClr(uint32_t u32UnitCombine); +/* Software Sync update */ +void TMR6_SwSyncUpdate(uint32_t u32UnitCombine); + +/* Hardware start function command */ +void TMR6_HwStartFuncCmd(M4_TMR6_TypeDef *TMR6x, en_functional_state_t enNewState); +/* Hardware stop function command */ +void TMR6_HwStopFuncCmd(M4_TMR6_TypeDef *TMR6x, en_functional_state_t enNewState); +/* Hardware clear function command */ +void TMR6_HwClrFuncCmd(M4_TMR6_TypeDef *TMR6x, en_functional_state_t enNewState); +/* Hardware update function command */ +void TMR6_HwUpdateFuncCmd(M4_TMR6_TypeDef *TMR6x, en_functional_state_t enNewState); + +/* Hardware start condtion command */ +void TMR6_HwStartCondCmd(M4_TMR6_TypeDef *TMR6x, + uint32_t u32CondSrc, + en_functional_state_t enNewState); +/* Hardware stop condtion command */ +void TMR6_HwStopCondCmd(M4_TMR6_TypeDef *TMR6x, + uint32_t u32CondSrc, + en_functional_state_t enNewState); +/* Hardware clear condtion command */ +void TMR6_HwClrCondCmd(M4_TMR6_TypeDef *TMR6x, + uint32_t u32CondSrc, + en_functional_state_t enNewState); +/* Hardware update condtion command */ +void TMR6_HwUpdCondCmd(M4_TMR6_TypeDef *TMR6x, + uint32_t u32CondSrc, + en_functional_state_t enNewState); +/* Hardware capture condtion command for channel A */ +void TMR6_HwCaptureChACondCmd(M4_TMR6_TypeDef *TMR6x, + uint32_t u32CondSrc, + en_functional_state_t enNewState); +/* Hardware capture condtion command for channel B */ +void TMR6_HwCaptureChBCondCmd(M4_TMR6_TypeDef *TMR6x, + uint32_t u32CondSrc, + en_functional_state_t enNewState); +/* Hardware increase conditon command */ +void TMR6_HwIncreaseCondCmd(M4_TMR6_TypeDef *TMR6x, + uint32_t u32CondSrc, + en_functional_state_t enNewState); +/* Hardware decrease conditon command */ +void TMR6_HwDecreaseCondCmd(M4_TMR6_TypeDef *TMR6x, + uint32_t u32CondSrc, + en_functional_state_t enNewState); + +/* Hardware start function condition clear */ +void TMR6_HwStartCondClr(M4_TMR6_TypeDef *TMR6x); +/* Hardware stop function condition clear */ +void TMR6_HwStopCondClr(M4_TMR6_TypeDef *TMR6x); +/* Hardware clear function condition clear */ +void TMR6_HwClrCondClr(M4_TMR6_TypeDef *TMR6x); +/* Hardware update function condition clear */ +void TMR6_HwUpdCondClr(M4_TMR6_TypeDef *TMR6x); +/* Hardware capture condition clear for channel A */ +void TMR6_HwCaptureChACondClr(M4_TMR6_TypeDef *TMR6x); +/* Hardware capture condition clear for channel B */ +void TMR6_HwCaptureChBCondClr(M4_TMR6_TypeDef *TMR6x); +/* Hardware increase condition clear */ +void TMR6_HwIncreaseCondClr(M4_TMR6_TypeDef *TMR6x); +/* Hardware decrease condition clear */ +void TMR6_HwDecreaseCondClr(M4_TMR6_TypeDef *TMR6x); + +/* Timer6 Hardware trigger event configuration for(trigger0~trigger3) */ +void TMR6_SetTriggerSrc(uint32_t u32TrigIndex, en_event_src_t enEvent); +/* Timer6 Hardware trigger common event function command for(trigger0~trigger3) */ +void TMR6_ComTriggerCmd(uint32_t u32TrigIndex, uint32_t u32ComTrig, en_functional_state_t enNewState); + +/* Set the fields of structure stc_timer4_pwm_init_t to default values */ +en_result_t TMR6_BaseCntStructInit(stc_tmr6_basecnt_cfg_t *pstcInit); +/* Set the fields of structure stc_tmr6_buf_func_cfg_t to default values */ +en_result_t TMR6_BufFuncStructInit(stc_tmr6_buf_func_cfg_t *pstcInit); +/* Set the fields of structure stc_tmr6_valid_period_func_cfg_t to default values */ +en_result_t TMR6_ValidPeriodStructInit(stc_tmr6_valid_period_func_cfg_t *pstcInit); +/* Set the fields of structure stc_tmr6_port_input_cfg_t to default values */ +en_result_t TMR6_PortInputStructInit(stc_tmr6_port_input_cfg_t *pstcInit); +/* Set the fields of structure stc_tmr6_port_output_cfg_t to default values */ +en_result_t TMR6_PortOutputStructInit(stc_tmr6_port_output_cfg_t *pstcInit); +/* Set the fields of structure stc_tmr6_emb_cfg_t to default values */ +en_result_t TMR6_EMBCfgStructInit(stc_tmr6_emb_cfg_t *pstcInit); +/* Set the fields of structure stc_tmr6_deadtime_cfg_t to default values */ +en_result_t TMR6_DeadTimeCfgStructInit(stc_tmr6_deadtime_cfg_t *pstcInit); +/* Set the fields of structure stc_tmr6_zmask_cfg_t to default values */ +en_result_t TMR6_ZMaskCfgStructInit(stc_tmr6_zmask_cfg_t *pstcInit); + +/** + * @} + */ + +#endif /* DDL_TMR6_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_TMR6_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_tmra.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_tmra.h new file mode 100644 index 0000000000..37809887f5 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_tmra.h @@ -0,0 +1,616 @@ +/** + ******************************************************************************* + * @file hc32f4a0_tmra.h + * @brief This file contains all the functions prototypes of the TMRA(TimerA) + * driver library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Wuze First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_TMRA_H__ +#define __HC32F4A0_TMRA_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_TMRA + * @{ + */ + +#if (DDL_TMRA_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup TMRA_Global_Types TMRA Global Types + * @{ + */ +/** + * @brief TMRA initialization structure. + * @note 'u32PCLKDiv', 'u32CntDir' and 'u32CntMode' are valid only when the clock source is PCLK(PCLK0 for unit1 ~ uint4. PCLK1 for unit5 ~ uint12). + */ +typedef struct +{ + uint32_t u32ClkSrc; /*!< Specify the counting clock source of TMRA. + This parameter can be a value of @ref TMRA_Clock_Source */ + uint32_t u32PCLKDiv; /*!< Specify the divider of clock source while the clock source is PCLK. + This parameter can be a value of @ref TMRA_PCLK_Divider */ + uint32_t u32CntDir; /*!< Specify the direction of counting. + This parameter can be a value of @ref TMRA_Count_Direction */ + uint32_t u32CntMode; /*!< Specify the mode of counting. + This parameter can be a value of @ref TMRA_Count_Mode */ + uint32_t u32CntOvfOp; /*!< Specify the operation when counting overflow/underflow. + This parameter can be a value of @ref TMRA_Count_Overflow_Operation */ + uint32_t u32PeriodVal; /*!< Specify the period reference value. + This parameter can be a number between 0U and 0xFFFFU, inclusive. */ + uint32_t u32CntVal; /*!< Specify the initial value of count register. + This parameter can be a number between 0U and 0xFFFFU, inclusive. */ +} stc_tmra_init_t; + +/** + * @brief TMRA PWM configuration structure. + */ +typedef struct +{ + uint32_t u32StartPolarity; /*!< Specify the polarity when the specified TMRA channel start counting. + This parameter can be a value of @ref TMRA_PWM_Start_Polarity */ + uint32_t u32StopPolarity; /*!< Specify the polarity when the specified TMRA channel stop counting. + This parameter can be a value of @ref TMRA_PWM_Stop_Polarity */ + uint32_t u32CmpPolarity; /*!< Specify the polarity when the specified TMRA channel counting matches the compare register. + This parameter can be a value of @ref TMRA_PWM_Match_Cmp_Polarity */ + uint32_t u32PeriodPolarity; /*!< Specify the polarity when the specified TMRA channel counting matches the period register. + This parameter can be a value of @ref TMRA_PWM_Match_Period_Polarity */ + uint32_t u32ForcePolarity; /*!< Specify the polarity when the specified TMRA channel at the beginning of the next cycle. + This parameter can be a value of @ref TMRA_PWM_Force_Polarity */ +} stc_tmra_pwm_cfg_t; + +/** + * @brief TMRA hardware trigger condition configuration structure. + */ +typedef struct +{ + uint32_t u32StartCond; /*!< Specify the condition to start the specified TMRA unit. + This parameter can be a value of @ref TMRA_Hardware_Start_Condition */ + uint32_t u32StopCond; /*!< Specify the condition to stop the specified TMRA unit. + This parameter can be a value of @ref TMRA_Hardware_Stop_Condition */ + uint32_t u32ClrCond; /*!< Specify the condition to clear the specified TMRA unit's count register. + This parameter can be a value of @ref TMRA_Hardware_Clear_Condition */ +} stc_tmra_trig_cond_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup TMRA_Global_Macros TMRA Global Macros + * @{ + */ + +/** + * @defgroup TMRA_Channel TMRA Channel + * @{ + */ +#define TMRA_CH_1 (0U) /*!< Channel 1 of TMRA. */ +#define TMRA_CH_2 (1U) /*!< Channel 2 of TMRA. */ +#define TMRA_CH_3 (2U) /*!< Channel 3 of TMRA. */ +#define TMRA_CH_4 (3U) /*!< Channel 4 of TMRA. */ +/** + * @} + */ + +/** + * @defgroup TMRA_Input_Pin TMRA Input Pin + * @{ + */ +#define TMRA_PIN_TRIG (1UL << 0U) /*!< Pin TIMA__TRIG. */ +#define TMRA_PIN_CLKA (1UL << 1U) /*!< Pin TIMA__CLKA. */ +#define TMRA_PIN_CLKB (1UL << 2U) /*!< Pin TIMA__CLKB. */ +#define TMRA_PIN_PWM1 (1UL << 3U) /*!< Pin TIMA__PWM1. */ +#define TMRA_PIN_PWM2 (1UL << 4U) /*!< Pin TIMA__PWM2. */ +#define TMRA_PIN_PWM3 (1UL << 5U) /*!< Pin TIMA__PWM3. */ +#define TMRA_PIN_PWM4 (1UL << 6U) /*!< Pin TIMA__PWM4. */ +#define TMRA_PIN_ALL (TMRA_PIN_TRIG | \ + TMRA_PIN_CLKA | \ + TMRA_PIN_CLKB | \ + TMRA_PIN_PWM1 | \ + TMRA_PIN_PWM2 | \ + TMRA_PIN_PWM3 | \ + TMRA_PIN_PWM4) +/** + * @} + */ + +/** + * @defgroup TMRA_Count_Direction TMRA Counting Direction + * @{ + */ +#define TMRA_DIR_DOWN (0x0U) /*!< TMRA count down. */ +#define TMRA_DIR_UP (TMRA_BCSTR_DIR) /*!< TMRA count up. */ +/** + * @} + */ + +/** + * @defgroup TMRA_Count_Mode TMRA Counting Mode + * @{ + */ +#define TMRA_MODE_SAWTOOTH (0x0U) /*!< Count mode is sawtooth wave. */ +#define TMRA_MODE_TRIANGLE (TMRA_BCSTR_MODE) /*!< Count mode is triangle wave. */ +/** + * @} + */ + +/** + * @defgroup TMRA_Clock_Source TMRA Counting Clock Source + * @note PCLK is automatically disabled when other clock is selected. + * @note Symmetric units: uint 1 and 2; uint 3 and 4; ...; uint 11 and 12. + * @{ + */ +#define TMRA_CLK_PCLK (0x0U) /*!< PCLK. PCLK0 for unit1 ~ uint4. PCLK1 for unit5 ~ uint12. */ + +#define TMRA_CLK_HW_UP_CLKAL_CLKBR (1UL << 0U) /*!< When CLKA is low, a rising edge is sampled on CLKB, the counter register counts up. */ +#define TMRA_CLK_HW_UP_CLKAL_CLKBF (1UL << 1U) /*!< When CLKA is low, a falling edge is sampled on CLKB, the counter register counts up. */ +#define TMRA_CLK_HW_UP_CLKAH_CLKBR (1UL << 2U) /*!< When CLKA is high, a rising edge is sampled on CLKB, the counter register counts up. */ +#define TMRA_CLK_HW_UP_CLKAH_CLKBF (1UL << 3U) /*!< When CLKA is high, a falling edge is sampled on CLKB, the counter register counts up. */ +#define TMRA_CLK_HW_UP_CLKBL_CLKAR (1UL << 4U) /*!< When CLKB is low, a rising edge is sampled on CLKA, the counter register counts up. */ +#define TMRA_CLK_HW_UP_CLKBL_CLKAF (1UL << 5U) /*!< When CLKB is low, a falling edge is sampled on CLKA, the counter register counts up. */ +#define TMRA_CLK_HW_UP_CLKBH_CLKAR (1UL << 6U) /*!< When CLKB is high, a rising edge is sampled on CLKA, the counter register counts up. */ +#define TMRA_CLK_HW_UP_CLKBH_CLKAF (1UL << 7U) /*!< When CLKB is high, a falling edge is sampled on CLKA, the counter register counts up. */ +#define TMRA_CLK_HW_UP_TRIGR (1UL << 8U) /*!< When a rising edge occurred on TRIG, the counter register counts up. */ +#define TMRA_CLK_HW_UP_TRIGF (1UL << 9U) /*!< When a falling edge occurred on TRIG, the counter register counts up. */ +#define TMRA_CLK_HW_UP_EVENT (1UL << 10U) /*!< When the event specified by TMRA_HTSSR occurred, the counter register counts up. */ +#define TMRA_CLK_HW_UP_SYM_OVF (1UL << 11U) /*!< When the symmetric unit overflow, the counter register counts up. */ +#define TMRA_CLK_HW_UP_SYM_UNF (1UL << 12U) /*!< When the symmetric unit underflow, the counter register counts up. */ +#define TMRA_CLK_HW_UP_ALL (0x1FFFUL) + +#define TMRA_CLK_HW_DOWN_CLKAL_CLKBR (1UL << 16U) /*!< When CLKA is low, a rising edge is sampled on CLKB, the counter register counts down. */ +#define TMRA_CLK_HW_DOWN_CLKAL_CLKBF (1UL << 17U) /*!< When CLKA is low, a falling edge is sampled on CLKB, the counter register counts down. */ +#define TMRA_CLK_HW_DOWN_CLKAH_CLKBR (1UL << 18U) /*!< When CLKA is high, a rising edge is sampled on CLKB, the counter register counts down. */ +#define TMRA_CLK_HW_DOWN_CLKAH_CLKBF (1UL << 19U) /*!< When CLKA is high, a falling edge is sampled on CLKB, the counter register counts down. */ +#define TMRA_CLK_HW_DOWN_CLKBL_CLKAR (1UL << 20U) /*!< When CLKB is low, a rising edge is sampled on CLKA, the counter register counts down. */ +#define TMRA_CLK_HW_DOWN_CLKBL_CLKAF (1UL << 21U) /*!< When CLKB is low, a falling edge is sampled on CLKA, the counter register counts down. */ +#define TMRA_CLK_HW_DOWN_CLKBH_CLKAR (1UL << 22U) /*!< When CLKB is high, a rising edge is sampled on CLKA, the counter register counts down. */ +#define TMRA_CLK_HW_DOWN_CLKBH_CLKAF (1UL << 23U) /*!< When CLKB is high, a falling edge is sampled on CLKA, the counter register counts down. */ +#define TMRA_CLK_HW_DOWN_TRIGR (1UL << 24U) /*!< When a rising edge occurred on TRIG, the counter register counts down. */ +#define TMRA_CLK_HW_DOWN_TRIGF (1UL << 25U) /*!< When a falling edge occurred on TRIG, the counter register counts down. */ +#define TMRA_CLK_HW_DOWN_EVENT (1UL << 26U) /*!< When the event specified by TMRA_HTSSR occurred, the counter register counts down. */ +#define TMRA_CLK_HW_DOWN_SYM_OVF (1UL << 27U) /*!< When the symmetric unit overflow, the counter register counts down. */ +#define TMRA_CLK_HW_DOWN_SYM_UNF (1UL << 28U) /*!< When the symmetric unit underflow, the counter register counts down. */ +#define TMRA_CLK_HW_DOWN_ALL (0x1FFF0000UL) +/** + * @} + */ + +/** + * @defgroup TMRA_PCLK_Divider TMRA PCLK Divider + * @note Clock divider is only valid for PCLK(PCLK0 for unit1 ~ uint4. PCLK1 for unit5 ~ uint12). + * @{ + */ +#define TMRA_PCLK_DIV1 (0x0U) /*!< The clock source of TMRA is PCLK. */ +#define TMRA_PCLK_DIV2 (TMRA_BCSTR_CKDIV_0) /*!< The clock source of TMRA is PCLK / 2. */ +#define TMRA_PCLK_DIV4 (TMRA_BCSTR_CKDIV_1) /*!< The clock source of TMRA is PCLK / 4. */ +#define TMRA_PCLK_DIV8 (TMRA_BCSTR_CKDIV_1 | \ + TMRA_BCSTR_CKDIV_0) /*!< The clock source of TMRA is PCLK / 8. */ +#define TMRA_PCLK_DIV16 (TMRA_BCSTR_CKDIV_2) /*!< The clock source of TMRA is PCLK / 16. */ +#define TMRA_PCLK_DIV32 (TMRA_BCSTR_CKDIV_2 | \ + TMRA_BCSTR_CKDIV_0) /*!< The clock source of TMRA is PCLK / 32. */ +#define TMRA_PCLK_DIV64 (TMRA_BCSTR_CKDIV_2 | \ + TMRA_BCSTR_CKDIV_1) /*!< The clock source of TMRA is PCLK / 64. */ +#define TMRA_PCLK_DIV128 (TMRA_BCSTR_CKDIV_2 | \ + TMRA_BCSTR_CKDIV_1 | \ + TMRA_BCSTR_CKDIV_0) /*!< The clock source of TMRA is PCLK / 128. */ +#define TMRA_PCLK_DIV256 (TMRA_BCSTR_CKDIV_3) /*!< The clock source of TMRA is PCLK / 256. */ +#define TMRA_PCLK_DIV512 (TMRA_BCSTR_CKDIV_3 | \ + TMRA_BCSTR_CKDIV_0) /*!< The clock source of TMRA is PCLK / 512. */ +#define TMRA_PCLK_DIV1024 (TMRA_BCSTR_CKDIV_3 | \ + TMRA_BCSTR_CKDIV_1) /*!< The clock source of TMRA is PCLK / 1024. */ +/** + * @} + */ + +/** + * @defgroup TMRA_Count_Overflow_Operation TMRA Count Overflow Operation + * @note Count up corresponds to overflow, counter zeroing when counting value overflow period value. + * @note Count down corresponds to underflow, counter reload period value when counting value underflow 0. + * @{ + */ +#define TMRA_OVF_CNT_CONTINUE (0x0U) /*!< When counting overflow(or underflow), counting continue. */ +#define TMRA_OVF_CNT_STOP (TMRA_BCSTR_OVSTP) /*!< When counting overflow(or underflow), counting stop. */ +/** + * @} + */ + +/** + * @defgroup TMRA_Interrupt_Type TMRA Interrupt Type + * @{ + */ +#define TMRA_INT_OVF (1UL << 12U) /*!< The interrupt of counting overflow. */ +#define TMRA_INT_UNF (1UL << 13U) /*!< The interrupt of counting underflow. */ +#define TMRA_INT_CMP_CH1 (1UL << 16U) /*!< The interrupt of compare-match of channel 1. */ +#define TMRA_INT_CMP_CH2 (1UL << 17U) /*!< The interrupt of compare-match of channel 2. */ +#define TMRA_INT_CMP_CH3 (1UL << 18U) /*!< The interrupt of compare-match of channel 3. */ +#define TMRA_INT_CMP_CH4 (1UL << 19U) /*!< The interrupt of compare-match of channel 4. */ +#define TMRA_INT_ALL (TMRA_INT_OVF | \ + TMRA_INT_UNF | \ + TMRA_INT_CMP_CH1 | \ + TMRA_INT_CMP_CH2 | \ + TMRA_INT_CMP_CH3 | \ + TMRA_INT_CMP_CH4) +/** + * @} + */ + +/** + * @defgroup TMRA_Event_Type TMRA Event Type + * @{ + */ +#define TMRA_EVENT_CMP_CH1 (TMRA_ECONR_ETEN1) /*!< The event of compare-match of channel 1. */ +#define TMRA_EVENT_CMP_CH2 (TMRA_ECONR_ETEN2) /*!< The event of compare-match of channel 2. */ +#define TMRA_EVENT_CMP_CH3 (TMRA_ECONR_ETEN3) /*!< The event of compare-match of channel 3. */ +#define TMRA_EVENT_CMP_CH4 (TMRA_ECONR_ETEN4) /*!< The event of compare-match of channel 4. */ +#define TMRA_EVENT_ALL (TMRA_EVENT_CMP_CH1 | \ + TMRA_EVENT_CMP_CH2 | \ + TMRA_EVENT_CMP_CH3 | \ + TMRA_EVENT_CMP_CH4) +/** + * @} + */ + +/** + * @defgroup TMRA_Status_Flag TMRA Status Flag + * @{ + */ +#define TMRA_FLAG_OVF (1UL << 14U) /*!< The flag of counting overflow. */ +#define TMRA_FLAG_UNF (1UL << 15U) /*!< The flag of counting underflow. */ +#define TMRA_FLAG_CMP_CH1 (1UL << 16U) /*!< The flag of compare-match of channel 1. */ +#define TMRA_FLAG_CMP_CH2 (1UL << 17U) /*!< The flag of compare-match of channel 2. */ +#define TMRA_FLAG_CMP_CH3 (1UL << 18U) /*!< The flag of compare-match of channel 3. */ +#define TMRA_FLAG_CMP_CH4 (1UL << 19U) /*!< The flag of compare-match of channel 4. */ +#define TMRA_FLAG_ALL (TMRA_FLAG_OVF | \ + TMRA_FLAG_UNF | \ + TMRA_FLAG_CMP_CH1 | \ + TMRA_FLAG_CMP_CH2 | \ + TMRA_FLAG_CMP_CH3 | \ + TMRA_FLAG_CMP_CH4) +/** + * @} + */ + +/** + * @defgroup TMRA_Cmp_Value_Cache_Condition TMRA Compare Value Cache Condition + * @{ + */ +#define TMRA_CACHE_COND_OVF_CLR (0x0U) /*!< This configuration value applies to non-triangular wave counting mode. \ + When counting overflow or underflow or counting register was cleared, \ + transfer CMPARm(m=2, 4) to CMPARn(n=1, 3). */ +#define TMRA_CACHE_COND_TW_PEAK (TMRA_BCONR_BSE0) /*!< In triangle wave count mode, when count reached peak, \ + transfer CMPARm(m=2, 4) to CMPARn(n=1, 3). */ +#define TMRA_CACHE_COND_TW_VALLEY (TMRA_BCONR_BSE1) /*!< In triangle wave count mode, when count reached valley, \ + transfer CMPARm(m=2, 4) to CMPARn(n=1, 3). */ +/** + * @} + */ + +/** + * @defgroup TMRA_Function_Mode TMRA Function Mode + * @{ + */ +#define TMRA_FUNC_COMPARE (0x0U) /*!< The function mode of TMRA is comparison ouput. */ +#define TMRA_FUNC_CAPTURE (TMRA_CCONR_CAPMD) /*!< The function mode of TMRA is capture the input. */ +/** + * @} + */ + +/** + * @defgroup TMRA_Channel_Capture_Condition TMRA Capturing Condition Of Channel + * @note 'TMRA_CAPT_COND_TRIGR' and 'TMRA_CAPT_COND_TRIGF' are only valid for channel 4. + * @{ + */ +#define TMRA_CAPT_COND_INVALID (0x0U) /*!< The condition of capture is INVALID. */ +#define TMRA_CAPT_COND_PWMR (TMRA_CCONR_HICP0) /*!< The condition of capture is a rising edge is sampled on pin TIMA__PWMn. */ +#define TMRA_CAPT_COND_PWMF (TMRA_CCONR_HICP1) /*!< The condition of capture is a falling edge is sampled on pin TIMA__PWMn. */ +#define TMRA_CAPT_COND_EVENT (TMRA_CCONR_HICP2) /*!< The condition of capture is the specified event occurred. */ +#define TMRA_CAPT_COND_TRIGR (TMRA_CCONR_HICP3) /*!< The condition of capture is a rising edge is sampled on pin TIMA__TRIG. \ + This condition is only valid for channel 4. */ +#define TMRA_CAPT_COND_TRIGF (TMRA_CCONR_HICP4) /*!< The condition of capture is a falling edge is sampled on pin TIMA__TRIG. \ + This condition is only valid for channel 4. */ +#define TMRA_CAPT_COND_ALL (TMRA_CAPT_COND_PWMR | \ + TMRA_CAPT_COND_PWMF | \ + TMRA_CAPT_COND_EVENT | \ + TMRA_CAPT_COND_TRIGR | \ + TMRA_CAPT_COND_TRIGF) +/** + * @} + */ + +/** + * @defgroup TMRA_Filter_Clock_Divider TMRA Filter Clock Divider + * @{ + */ +#define TMRA_FILTER_CLK_DIV1 (0x0U) /*!< The filter clock is PCLK / 1. */ +#define TMRA_FILTER_CLK_DIV4 (0x1U) /*!< The filter clock is PCLK / 4. */ +#define TMRA_FILTER_CLK_DIV16 (0x2U) /*!< The filter clock is PCLK / 16. */ +#define TMRA_FILTER_CLK_DIV64 (0x3U) /*!< The filter clock is PCLK / 64. */ +/** + * @} + */ + +/** + * @defgroup TMRA_PWM_Out_Command TMRA PWM Out Command + * @{ + */ +#define TMRA_PWM_DISABLE (0x0U) /*!< Disable PWM output. */ +#define TMRA_PWM_ENABLE (TMRA_PCONR_OUTEN) /*!< Enable PWM output. */ +/** + * @} + */ + +/** + * @defgroup TMRA_PWM_Start_Polarity TMRA PWM Start Polarity + * @note The 'START' in the following macros is the state 'counting start'. + * @{ + */ +#define TMRA_PWM_START_LOW (0x0U) /*!< PWM output low. */ +#define TMRA_PWM_START_HIGH (TMRA_PCONR_STAC_0) /*!< PWM output high. */ +#define TMRA_PWM_START_KEEP (TMRA_PCONR_STAC_1) /*!< PWM output keeps the current polarity. */ +/** + * @} + */ + +/** + * @defgroup TMRA_PWM_Stop_Polarity TMRA PWM Stop Polarity + * @note The 'STOP' in the following macros is the state 'counting stop'. + * @{ + */ +#define TMRA_PWM_STOP_LOW (0x0U) /*!< PWM output low. */ +#define TMRA_PWM_STOP_HIGH (TMRA_PCONR_STPC_0) /*!< PWM output high. */ +#define TMRA_PWM_STOP_KEEP (TMRA_PCONR_STPC_1) /*!< PWM output keeps the current polarity. */ +/** + * @} + */ + +/** + * @defgroup TMRA_PWM_Match_Cmp_Polarity TMRA PWM Polarity When Counting Matchs Compare Reference Value + * @{ + */ +#define TMRA_PWM_CMP_LOW (0x0U) /*!< PWM output low. */ +#define TMRA_PWM_CMP_HIGH (TMRA_PCONR_CMPC_0) /*!< PWM output high. */ +#define TMRA_PWM_CMP_KEEP (TMRA_PCONR_CMPC_1) /*!< PWM output keeps the current polarity. */ +#define TMRA_PWM_CMP_REVERSE (TMRA_PCONR_CMPC_1 | \ + TMRA_PCONR_CMPC_0) /*!< PWM output reverses the current polarity. */ +/** + * @} + */ + +/** + * @defgroup TMRA_PWM_Match_Period_Polarity TMRA PWM Polarity When Counting Matchs Period Reference Value + * @{ + */ +#define TMRA_PWM_PERIOD_LOW (0x0U) /*!< PWM output low. */ +#define TMRA_PWM_PERIOD_HIGH (TMRA_PCONR_PERC_0) /*!< PWM output high. */ +#define TMRA_PWM_PERIOD_KEEP (TMRA_PCONR_PERC_1) /*!< PWM output keeps the current polarity. */ +#define TMRA_PWM_PERIOD_REVERSE (TMRA_PCONR_PERC_1 | \ + TMRA_PCONR_PERC_0) /*!< PWM output reverses the current polarity. */ +/** + * @} + */ + +/** + * @defgroup TMRA_PWM_Force_Polarity TMRA PWM Force Polarity + * @{ + */ +#define TMRA_PWM_FORCE_INVALID (0x0U) /*!< Force polarity is invalid. */ +#define TMRA_PWM_FORCE_LOW (TMRA_PCONR_FORC_1) /*!< Force the PWM output low at the beginning of the next cycle. \ + The beginning of the next cycle: overflow position or underflow position \ + of sawtooth wave; valley position of triangle wave. */ +#define TMRA_PWM_FORCE_HIGH (TMRA_PCONR_FORC_1 | \ + TMRA_PCONR_FORC_0) /*!< Force the PWM output high at the beginning of the next cycle. \ + The beginning of the next cycle: overflow position or underflow position \ + of sawtooth wave; valley position of triangle wave. */ +/** + * @} + */ + +/** + * @defgroup TMRA_Hardware_Start_Condition TMRA Hardware Start Condition + * @{ + */ +#define TMRA_START_COND_INVALID (0x0U) /*!< The condition of start is INVALID. */ +#define TMRA_START_COND_TRIGR (TMRA_HCONR_HSTA0) /*!< 1. Sync start is invalid: The condition is that a rising edge is sampled on TRIG of the current TMRA unit. \ + 2. Sync start is valid: The condition is that a rising edge is sampled on TRIG of the symmetric TMRA unit. */ +#define TMRA_START_COND_TRIGF (TMRA_HCONR_HSTA1) /*!< 1. Sync start is invalid: The condition is that a falling edge is sampled on TRIG of the current TMRA unit. \ + 2. Sync start is valid: The condition is that a falling edge is sampled on TRIG of the symmetric TMRA unit. */ +#define TMRA_START_COND_EVENT (TMRA_HCONR_HSTA2) /*!< The condition is that the event which is set in register TMRA_HTSSR0 has occurred. */ +#define TMRA_START_COND_ALL (TMRA_START_COND_TRIGR | \ + TMRA_START_COND_TRIGF | \ + TMRA_START_COND_EVENT) +/** + * @} + */ + +/** + * @defgroup TMRA_Hardware_Stop_Condition TMRA Hardware Stop Condition + * @{ + */ +#define TMRA_STOP_COND_INVALID (0x0U) /*!< The condition of stop is INVALID. */ +#define TMRA_STOP_COND_TRIGR (TMRA_HCONR_HSTP0) /*!< The condition is that a rising edge is sampled on pin TRIG of the current TMRA unit. */ +#define TMRA_STOP_COND_TRIGF (TMRA_HCONR_HSTP1) /*!< The condition is that a falling edge is sampled on pin TRIG of the current TMRA unit. */ +#define TMRA_STOP_COND_EVENT (TMRA_HCONR_HSTP2) /*!< The condition is that the event which is set in register TMRA_HTSSR0 has occurred. */ +#define TMRA_STOP_COND_ALL (TMRA_STOP_COND_TRIGR | \ + TMRA_STOP_COND_TRIGF | \ + TMRA_STOP_COND_EVENT) +/** + * @} + */ + +/** + * @defgroup TMRA_Hardware_Clear_Condition TMRA Hardware Clear Condition + * @note Symmetric units: uint 1 and 2; uint 3 and 4; ... ; uint 11 and 12. + * @{ + */ +#define TMRA_CLR_COND_INVALID (0x0U) /*!< The condition of clear is INVALID. */ +#define TMRA_CLR_COND_TRIGR (TMRA_HCONR_HCLE0) /*!< The condition is that a rising edge is sampled on TRIG of the current TMRA unit. */ +#define TMRA_CLR_COND_TRIGF (TMRA_HCONR_HCLE1) /*!< The condition is that a falling edge is sampled on TRIG of the current TMRA unit. */ +#define TMRA_CLR_COND_EVENT (TMRA_HCONR_HCLE2) /*!< The condition is that the event which is set in register TMRA_HTSSR0 has occurred. */ +#define TMRA_CLR_COND_SYM_TRIGR (TMRA_HCONR_HCLE3) /*!< The condition is that a rising edge is sampled on TRIG of the symmetric unit. */ +#define TMRA_CLR_COND_SYM_TRIGF (TMRA_HCONR_HCLE4) /*!< The condition is that a falling edge is sampled on TRIG of the symmetric unit. */ +#define TMRA_CLR_COND_PWM3R (TMRA_HCONR_HCLE5) /*!< The condition is that a rising edge is sampled on PWM3 of the current TMRA unit. */ +#define TMRA_CLR_COND_PWM3F (TMRA_HCONR_HCLE6) /*!< The condition is that a falling edge is sampled on PWM3 of the current TMRA unit. */ +#define TMRA_CLR_COND_ALL (TMRA_CLR_COND_TRIGR | \ + TMRA_CLR_COND_TRIGF | \ + TMRA_CLR_COND_EVENT | \ + TMRA_CLR_COND_SYM_TRIGR | \ + TMRA_CLR_COND_SYM_TRIGF | \ + TMRA_CLR_COND_PWM3R | \ + TMRA_CLR_COND_PWM3F) +/** + * @} + */ + +/** + * @defgroup TMRA_Event_Usage TMRA Event Usage + * @{ + */ +#define TMRA_EVENT_USAGE_CNT (0U) /*!< The specified event is used for counting. */ +#define TMRA_EVENT_USAGE_CAPT (1U) /*!< The specified event is used for capturing. */ +/** + * @} + */ + +/** + * @defgroup TMRA_Common_Trigger_Sel TMRA Common Trigger Source Select + * @{ + */ +#define TMRA_COM_TRIG1 (AOS_TMRA_HTSSR_COMTRG_EN_0) +#define TMRA_COM_TRIG2 (AOS_TMRA_HTSSR_COMTRG_EN_1) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup TMRA_Global_Functions + * @{ + */ + en_result_t TMRA_Init(M4_TMRA_TypeDef *TMRAx, const stc_tmra_init_t *pstcInit); + en_result_t TMRA_StructInit(stc_tmra_init_t *pstcInit); + void TMRA_DeInit(M4_TMRA_TypeDef *TMRAx); + + void TMRA_SetCntVal(M4_TMRA_TypeDef *TMRAx, uint32_t u32Val); + uint32_t TMRA_GetCntVal(const M4_TMRA_TypeDef *TMRAx); + void TMRA_SetPeriodVal(M4_TMRA_TypeDef *TMRAx, uint32_t u32Val); + uint32_t TMRA_GetPeriodVal(const M4_TMRA_TypeDef *TMRAx); + + void TMRA_SetFuncMode(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32FuncMode); + + void TMRA_SetCmpVal(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32Val); + uint32_t TMRA_GetCmpVal(const M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh); + + en_result_t TMRA_PWM_Config(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, const stc_tmra_pwm_cfg_t *pstcCfg); + en_result_t TMRA_PWM_StructInit(stc_tmra_pwm_cfg_t *pstcCfg); + void TMRA_PWM_Cmd(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, en_functional_state_t enNewState); + + void TMRA_FilterConfig(M4_TMRA_TypeDef *TMRAx, uint8_t u8InputPin, uint32_t u32ClkDiv); + void TMRA_FilterCmd(M4_TMRA_TypeDef *TMRAx, uint8_t u8InputPin, en_functional_state_t enNewState); + + void TMRA_SetCaptCond(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32Cond); + en_result_t TMRA_SetTrigCond(M4_TMRA_TypeDef *TMRAx, const stc_tmra_trig_cond_t *pstcCond); + en_result_t TMRA_TrigCondStructInit(stc_tmra_trig_cond_t *pstcCond); + void TMRA_SetTriggerSrc(M4_TMRA_TypeDef *TMRAx, uint8_t u8EvtUsage, en_event_src_t enEvent); + void TMRA_ComTriggerCmd(M4_TMRA_TypeDef *TMRAx, uint8_t u8EvtUsage, \ + uint32_t u32ComTrig, en_functional_state_t enNewState); + + void TMRA_CmpValCacheConfig(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32CacheCond); + void TMRA_CmpValCacheCmd(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, en_functional_state_t enNewState); + + void TMRA_SetOvfOperation(M4_TMRA_TypeDef *TMRAx, uint32_t u32OvfOp); + void TMRA_SyncStartCmd(M4_TMRA_TypeDef *TMRAx, en_functional_state_t enNewState); + + void TMRA_IntCmd(M4_TMRA_TypeDef *TMRAx, uint32_t u32IntType, en_functional_state_t enNewState); + void TMRA_EventCmd(M4_TMRA_TypeDef *TMRAx, uint32_t u32EvtType, en_functional_state_t enNewState); + +en_flag_status_t TMRA_GetStatus(const M4_TMRA_TypeDef *TMRAx, uint32_t u32Flag); + void TMRA_ClrStatus(M4_TMRA_TypeDef *TMRAx, uint32_t u32Flag); + + void TMRA_Start(M4_TMRA_TypeDef *TMRAx); + void TMRA_Stop(M4_TMRA_TypeDef *TMRAx); + + void TMRA_SetCntDir(M4_TMRA_TypeDef *TMRAx, uint32_t u32CntDir); + void TMRA_SetCntMode(M4_TMRA_TypeDef *TMRAx, uint32_t u32CntMode); + void TMRA_SetPCLKDiv(M4_TMRA_TypeDef *TMRAx, uint32_t u32ClkDiv); + uint32_t TMRA_GetCntDir(const M4_TMRA_TypeDef *TMRAx); + + void TMRA_SetClkSrc(M4_TMRA_TypeDef *TMRAx, uint32_t u32ClkSrc); + void TMRA_HwClkSrcCmd(M4_TMRA_TypeDef *TMRAx, uint32_t u32HwClkSrc, en_functional_state_t enNewState); + + void TMRA_PWM_SetStartPolarity(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32Polarity); + void TMRA_PWM_SetStopPolarity(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32Polarity); + void TMRA_PWM_SetMatchCmpPolarity(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32Polarity); + void TMRA_PWM_SetMatchPeriodPolarity(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32Polarity); + void TMRA_PWM_SetForcePolarity(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32Polarity); + + void TMRA_CaptCondCmd(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32CaptCond, en_functional_state_t enNewState); + void TMRA_TrigCondCmd(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32TrigCond, en_functional_state_t enNewState); +/** + * @} + */ + +#endif /* DDL_TMRA_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_TMRA_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_trng.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_trng.h new file mode 100644 index 0000000000..c4e6e44408 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_trng.h @@ -0,0 +1,124 @@ +/** + ******************************************************************************* + * @file hc32f4a0_trng.h + * @brief This file contains all the functions prototypes of the TRNG driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Heqb First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_TRNG_H__ +#define __HC32F4A0_TRNG_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_TRNG + * @{ + */ + +#if (DDL_TRNG_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ + +/** + * @defgroup TRNG_Global_Macros TRNG Global Macros + * @{ + */ + +/** + * @defgroup TRNG_Load_New_Value TRNG load new value + * @{ + */ +#define TRNG_RELOAD_ENABLE (TRNG_MR_LOAD) /* Enable load new initial values. */ +#define TRNG_RELOAD_DISABLE (0x00000000UL) /* Disable load new initial values. */ +/** + * @} + */ + +/** + * @defgroup TRNG_Shift_Control TRNG Shift Control + * @{ + */ +#define TRNG_SHIFT_COUNT_32 (0x0000000CUL) /* Shift 32 times when capturing random noise. */ +#define TRNG_SHIFT_COUNT_64 (0x00000010UL) /* Shift 64 times when capturing random noise. */ +#define TRNG_SHIFT_COUNT_128 (0x00000014UL) /* Shift 128 times when capturing random noise. */ +#define TRNG_SHIFT_COUNT_256 (0x00000018UL) /* Shift 256 times when capturing random noise. */ +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup TRNG_Global_Functions + * @{ + */ +void TRNG_SetShiftCnt(uint32_t u32ShiftCount); +void TRNG_ReloadCmd(uint32_t u32ReloadCmd); + +en_result_t TRNG_Generate(uint32_t au32Random[]); +/** + * @} + */ + +#endif /* DDL_TRNG_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_TRNG_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_usart.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_usart.h new file mode 100644 index 0000000000..66987adf8a --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_usart.h @@ -0,0 +1,611 @@ +/** + ******************************************************************************* + * @file hc32f4a0_usart.h + * @brief This file contains all the functions prototypes of the USART(Universal + * Synchronous/Asynchronous Receiver Transmitter) driver library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Hongjh First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_USART_H__ +#define __HC32F4A0_USART_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_USART + * @{ + */ + +#if (DDL_USART_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup USART_Global_Types USART Global Types + * @{ + */ + +/** + * @brief UART mode initialization structure definition + */ +typedef struct +{ + uint32_t u32Baudrate; /*!< UART baudrate. The baudrate is valid when clock source is PCLK. */ + + uint32_t u32ClkMode; /*!< Clock mode. + This parameter can be a value of @ref USART_Clock_Mode */ + + uint32_t u32PclkDiv; /*!< PCLK division. The PCLK division function is valid when clock source is PCLK. + This parameter can be a value of @ref USART_PCLK_Division */ + + uint32_t u32Parity; /*!< Parity format. + This parameter can be a value of @ref USART_Parity_Control */ + + uint32_t u32DataWidth; /*!< Data width. + This parameter can be a value of @ref USART_Data_Length_Bits */ + + uint32_t u32StopBit; /*!< Stop Bits. + This parameter can be a value of @ref USART_Stop_Bits */ + + uint32_t u32OversamplingBits; /*!< Oversampling Bits. + This parameter can be a value of @ref USART_Oversampling_Bits */ + + uint32_t u32BitDirection; /*!< Significant bit. + This parameter can be a value of @ref USART_Significant_Bit */ + + uint32_t u32NoiseFilterState; /*!< RX pin noise filter state. + This parameter can be a value of @ref USART_Noise_Filter_State */ + + uint32_t u32SbDetectPolarity; /*!< Start Bit Detect Polarity. + This parameter can be a value of @ref USART_Start_Bit_Detect_Polarity */ + + uint32_t u32HwFlowCtrl; /*!< Hardware flow control. + This parameter can be a value of @ref USART_Hardware_Flow_Control */ +} stc_usart_uart_init_t; + +/** + * @brief UART multiple-processor initialization structure definition + */ +typedef struct +{ + uint32_t u32Baudrate; /*!< UART baudrate. The baudrate is valid when clock source is PCLK. */ + + uint32_t u32ClkMode; /*!< Clock mode. + This parameter can be a value of @ref USART_Clock_Mode */ + + uint32_t u32PclkDiv; /*!< PCLK division. The PCLK division function is valid when clock source is PCLK. + This parameter can be a value of @ref USART_PCLK_Division */ + + uint32_t u32DataWidth; /*!< Data width. + This parameter can be a value of @ref USART_Data_Length_Bits */ + + uint32_t u32StopBit; /*!< Stop Bits. + This parameter can be a value of @ref USART_Stop_Bits */ + + uint32_t u32OversamplingBits; /*!< Oversampling Bits. + This parameter can be a value of @ref USART_Oversampling_Bits */ + + uint32_t u32BitDirection; /*!< Significant bit. + This parameter can be a value of @ref USART_Significant_Bit */ + + uint32_t u32NoiseFilterState; /*!< RX pin noise filter state. + This parameter can be a value of @ref USART_Noise_Filter_State */ + + uint32_t u32SbDetectPolarity; /*!< Start Bit Detect Polarity. + This parameter can be a value of @ref USART_Start_Bit_Detect_Polarity */ + + uint32_t u32HwFlowCtrl; /*!< Hardware flow control. + This parameter can be a value of @ref USART_Hardware_Flow_Control */ +} stc_usart_multiprocessor_init_t; + +/** + * @brief LIN mode initialization structure definition + */ +typedef struct +{ + uint32_t u32Baudrate; /*!< UART baudrate. The baudrate is valid when clock source is PCLK. */ + + uint32_t u32ClkMode; /*!< Clock mode. + This parameter can be a value of @ref USART_Clock_Mode */ + + uint32_t u32PclkDiv; /*!< PCLK division. The PCLK division function is valid when clock source is PCLK. + This parameter can be a value of @ref USART_PCLK_Division */ + + uint32_t u32BmcPclkDiv; /*!< BMC PCLK division. The PCLK division function is valid when clock source is PCLK. + This parameter can be a value of @ref USART_LIN_BMC_PCLK_Division */ + + uint32_t u32OversamplingBits; /*!< Oversampling Bits. + This parameter can be a value of @ref USART_Oversampling_Bits */ + + uint32_t u32DetectBreakLen; /*!< Detect break length. + This parameter can be a value of @ref USART_LIN_Detect_Break_Length */ + + uint32_t u32SendBreakLen; /*!< Send break length. + This parameter can be a value of @ref USART_LIN_Send_Break_Length */ + + uint32_t u32SendBreakMode; /*!< Send break mode. + This parameter can be a value of @ref USART_LIN_Send_Break_Mode */ +} stc_usart_lin_init_t; + +/** + * @brief Smart card mode initialization structure definition + */ +typedef struct +{ + uint32_t u32Baudrate; /*!< UART baudrate */ + + uint32_t u32ClkMode; /*!< Clock mode. + This parameter can be a value of @ref USART_Clock_Mode */ + + uint32_t u32PclkDiv; /*!< PCLK division. The PCLK division function is valid when clock source is PCLK. + This parameter can be a value of @ref USART_PCLK_Division */ + + uint32_t u32StopBit; /*!< Stop Bits. + This parameter can be a value of @ref USART_Stop_Bits */ + + uint32_t u32BitDirection; /*!< Significant bit. + This parameter can be a value of @ref USART_Significant_Bit */ +} stc_usart_smartcard_init_t; + +/** + * @brief clock synchronization mode initialization structure definition + */ +typedef struct +{ + uint32_t u32Baudrate; /*!< UART baudrate. The baudrate is valid when clock source is PCLK. */ + + uint32_t u32ClkMode; /*!< Clock mode. + This parameter can be a value of @ref USART_Clock_Mode */ + + uint32_t u32PclkDiv; /*!< PCLK division. The PCLK division function is valid when clock source is PCLK. + This parameter can be a value of @ref USART_PCLK_Division */ + + uint32_t u32BitDirection; /*!< Significant bit. + This parameter can be a value of @ref USART_Significant_Bit */ + + uint32_t u32HwFlowCtrl; /*!< Hardware flow control. + This parameter can be a value of @ref USART_Hardware_Flow_Control */ +} stc_usart_clksync_init_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup USART_Global_Macros USART Global Macros + * @{ + */ + +/** + * @defgroup USART_Flag USART Flag + * @{ + */ +#define USART_FLAG_PE (USART_SR_PE) /*!< Parity error flag */ +#define USART_FLAG_FE (USART_SR_FE) /*!< Framing error flag */ +#define USART_FLAG_ORE (USART_SR_ORE) /*!< Overrun error flag */ +#define USART_FLAG_BE (USART_SR_BE) /*!< LIN bus error flag */ +#define USART_FLAG_RXNE (USART_SR_RXNE) /*!< Receive data register not empty flag */ +#define USART_FLAG_TC (USART_SR_TC) /*!< Transmission complete flag */ +#define USART_FLAG_TXE (USART_SR_TXE) /*!< Transmit data register empty flag */ +#define USART_FLAG_RTOF (USART_SR_RTOF) /*!< Receive timeout flag */ +#define USART_FLAG_LBD (USART_SR_LBD) /*!< LIN break signal detection flag */ +#define USART_FLAG_WKUP (USART_SR_WKUP) /*!< LIN wakeup signal detection flag */ +#define USART_FLAG_MPB (USART_SR_MPB) /*!< Receive processor ID flag */ +/** + * @} + */ + +/** + * @defgroup USART_Transmission_Type USART Transmission Type + * @{ + */ +#define USART_TRANSMISSION_ID (USART_DR_MPID) +#define USART_TRANSMISSION_DATA (0UL) +/** + * @} + */ + +/** + * @defgroup USART_Clear_Flag USART Clear Flag + * @{ + */ +#define USART_CLEAR_FLAG_PE (USART_CR1_CPE) /*!< Clear Parity error flag */ +#define USART_CLEAR_FLAG_FE (USART_CR1_CFE) /*!< Clear Framing error flag */ +#define USART_CLEAR_FLAG_ORE (USART_CR1_CORE) /*!< Clear Overrun error flag */ +#define USART_CLEAR_FLAG_RTOF (USART_CR1_CRTOF) /*!< Clear RX timeout flag */ +#define USART_CLEAR_FLAG_BE (USART_CR1_CBE) /*!< Clear LIN bus error flag */ +#define USART_CLEAR_FLAG_WKUP (USART_CR1_CWKUP) /*!< Clear LIN wakeup signal flag */ +#define USART_CLEAR_FLAG_LBD (USART_CR1_CLBD) /*!< Clear LIN break detection flag */ +/** + * @} + */ + +/** + * @defgroup USART_Transmit_Receive_Function USART Transmit/Receive Function + * @{ + */ +#define USART_RX (USART_CR1_RE) /*!< USART RX function */ +#define USART_TX (USART_CR1_TE) /*!< USART TX function */ +#define USART_RTO (USART_CR1_RTOE) /*!< USART RX timerout function */ +#define USART_INT_RX (USART_CR1_RIE) /*!< USART receive data register not empty && receive error interrupt */ +#define USART_INT_TXE (USART_CR1_TXEIE) /*!< USART transmit data register empty interrupt */ +#define USART_INT_TC (USART_CR1_TCIE) /*!< USART transmission complete interrupt */ +#define USART_INT_RTO (USART_CR1_RTOIE) /*!< USART RX timerout interrupt */ +/** + * @} + */ + +/** + * @defgroup USART_LIN_Function USART LIN Function + * @{ + */ +#define USART_LIN (USART_CR2_LINEN) /*!< USART LIN function */ +#define USART_LIN_WKUP (USART_CR2_WKUPE) /*!< USART LIN wakeup signal detect function */ +#define USART_LIN_INT_WKUP (USART_CR2_WKUPIE) /*!< USART LIN wakeup signal detect interrupt function */ +#define USART_LIN_BUSERR (USART_CR2_BEE) /*!< USART LIN bus error detect function */ +#define USART_LIN_INT_BUSERR (USART_CR2_BEIE) /*!< USART LIN bus error detect interrupt function */ +#define USART_LIN_INT_BREAK (USART_CR2_LBDIE) /*!< USART LIN break field detect interrupt function */ +/** + * @} + */ + +/** + * @defgroup USART_Parity_Control USART Parity Control + * @{ + */ +#define USART_PARITY_NONE (0UL) /*!< Parity control disabled */ +#define USART_PARITY_EVEN (USART_CR1_PCE) /*!< Parity control enabled and Even Parity is selected */ +#define USART_PARITY_ODD (USART_CR1_PCE | \ + USART_CR1_PS) /*!< Parity control enabled and Odd Parity is selected */ +/** + * @} + */ + +/** + * @defgroup USART_Data_Length_Bits Data Length Bits + * @{ + */ +#define USART_DATA_LENGTH_8BIT (0UL) /*!< 8 bits */ +#define USART_DATA_LENGTH_9BIT (USART_CR1_M) /*!< 9 bits */ +/** + * @} + */ + +/** + * @defgroup USART_Oversampling_Bits USART Oversampling Bits + * @{ + */ +#define USART_OVERSAMPLING_16BIT (0UL) /*!< Oversampling by 16 bits */ +#define USART_OVERSAMPLING_8BIT (USART_CR1_OVER8) /*!< Oversampling by 8 bits */ +/** + * @} + */ + +/** + * @defgroup USART_Significant_Bit USART Significant Bit + * @{ + */ +#define USART_LSB (0UL) /*!< LSB(Least Significant Bit) */ +#define USART_MSB (USART_CR1_ML) /*!< MSB(Most Significant Bit) */ +/** + * @} + */ + +/** + * @defgroup USART_Noise_Filter_State USART Noise Filter State + * @{ + */ +#define USART_NOISE_FILTER_DISABLE (0UL) /*!< Disable noise filter */ +#define USART_NOISE_FILTER_ENABLE (USART_CR1_NFE) /*!< Enable noise filter */ +/** + * @} + */ + +/** + * @defgroup USART_Start_Bit_Detect_Polarity USART Start Bit Detect Polarity + * @{ + */ +#define USART_SB_DETECT_LOW (0UL) /*!< Detect RX pin low level */ +#define USART_SB_DETECT_FALLING (USART_CR1_SBS) /*!< Detect RX pin falling edge */ +/** + * @} + */ + +/** + * @defgroup USART_LIN_Send_Break_Mode USART LIN Send Break Mode + * @{ + */ +#define USART_LIN_SEND_BREAK_MODE_SBK (0UL) /*!< Start send break after USART_CR2 SBK bit set 1 value */ +#define USART_LIN_SEND_BREAK_MODE_TDR (USART_CR2_SBKM) /*!< Start send break after USART_DR TDR write 0x00 value */ +/** + * @} + */ + +/** + * @defgroup USART_Multiple_Processor_State USART Multiple Processor State + * @{ + */ +#define USART_MULTIPLE_PROCESSOR_DISABLE (0UL) /*!< Disable multiple processor function */ +#define USART_MULTIPLE_PROCESSOR_ENABLE (USART_CR2_MPE) /*!< Enable multiple processor function */ +/** + * @} + */ + +/** + * @defgroup USART_LIN_Detect_Break_Length USART LIN Detect Break Length + * @{ + */ +#define USART_LIN_DETECT_BREAK_10BIT (0UL) /*!< Detect break 10-bit */ +#define USART_LIN_DETECT_BREAK_11BIT (USART_CR2_LBDL) /*!< Detect break 11-bit */ +/** + * @} + */ + +/** + * @defgroup USART_LIN_Send_Break_Length USART LIN Send Break Length + * @{ + */ +#define USART_LIN_SEND_BREAK_10BIT (0UL) /*!< Send break 10-bit */ +#define USART_LIN_SEND_BREAK_11BIT (USART_CR2_SBKL_0) /*!< Send break 11-bit */ +#define USART_LIN_SEND_BREAK_13BIT (USART_CR2_SBKL_1) /*!< Send break 13-bit */ +#define USART_LIN_SEND_BREAK_14BIT (USART_CR2_SBKL) /*!< Send break 14-bit */ +/** + * @} + */ + +/** + * @defgroup USART_Clock_Mode USART Clock Mode Selection + * @{ + */ +#define USART_EXTCLK (USART_CR2_CLKC_1) /*!< Select external clock source. */ +#define USART_INTERNCLK_OUTPUT (USART_CR2_CLKC_0) /*!< Select internal clock source and output clock. */ +#define USART_INTERNCLK_NONE_OUTPUT (0UL) /*!< Select internal clock source and don't output clock */ +/** + * @} + */ + +/** + * @defgroup USART_Stop_Bits USART Stop Bits + * @{ + */ +#define USART_STOPBIT_1BIT (0UL) /*!< 1 stop bit */ +#define USART_STOPBIT_2BIT (USART_CR2_STOP) /*!< 2 stop bit */ +/** + * @} + */ + +/** + * @defgroup USART_DUPLEX_SEL USART Half-duplex/Full-duplex Selection + * @{ + */ +#define USART_FULLDUPLEX_MODE (0UL) /*!< USART full-duplex mode */ +#define USART_HALFDUPLEX_MODE (USART_CR3_HDSEL) /*!< USART half-duplex mode */ +/** + * @} + */ + +/** + * @defgroup USART_Hardware_Flow_Control USART Hardware Flow Control RTS/CTS + * @{ + */ +#define USART_HWFLOWCTRL_NONE (0UL) /*!< Disable USART hardware flow controle */ +#define USART_HWFLOWCTRL_RTS (USART_CR3_RTSE) /*!< USART hardware flow control RTS mode */ +#define USART_HWFLOWCTRL_CTS (USART_CR3_CTSE) /*!< USART hardware flow control CTS mode */ +#define USART_HWFLOWCTRL_RTS_CTS (USART_CR3_RTSE | \ + USART_CR3_CTSE) /*!< USART hardware flow control RTS and CTS mode */ +/** + * @} + */ + +/** + * @defgroup USART_Smartcard_ETU_Clock USART Smartcard ETU Clock + * @{ + */ +#define USART_SC_ETU_CLK_32 (0UL) /*!< 1 etu = 32/f */ +#define USART_SC_ETU_CLK_64 (USART_CR3_BCN_0) /*!< 1 etu = 64/f */ +#define USART_SC_ETU_CLK_128 (USART_CR3_BCN_1 | \ + USART_CR3_BCN_0) /*!< 1 etu = 128/f */ +#define USART_SC_ETU_CLK_256 (USART_CR3_BCN_2 | \ + USART_CR3_BCN_0) /*!< 1 etu = 256/f */ +#define USART_SC_ETU_CLK_372 (USART_CR3_BCN_2 | \ + USART_CR3_BCN_1) /*!< 1 etu = 372/f */ +/** + * @} + */ + +/** + * @defgroup USART_PCLK_Division USART PCLK Clock Prescaler Division + * @{ + */ +#define USART_PCLK_DIV1 (0UL) /*!< PCLK */ +#define USART_PCLK_DIV4 (USART_PR_PSC_0) /*!< PCLK/4 */ +#define USART_PCLK_DIV16 (USART_PR_PSC_1) /*!< PCLK/16 */ +#define USART_PCLK_DIV64 (USART_PR_PSC) /*!< PCLK/64 */ +/** + * @} + */ + +/** + * @defgroup USART_LIN_BMC_PCLK_Division USART LIN Baudrate Measure Counter PCLK Division + * @{ + */ +#define USART_LIN_BMC_PCLK_DIV1 (0UL) /*!< PCLK */ +#define USART_LIN_BMC_PCLK_DIV2 (USART_PR_LBMPSC_0) /*!< PCLK/2 */ +#define USART_LIN_BMC_PCLK_DIV4 (USART_PR_LBMPSC_1) /*!< PCLK/4 */ +#define USART_LIN_BMC_PCLK_DIV8 (USART_PR_LBMPSC) /*!< PCLK/8 */ +/** + * @} + */ + +/** + * @defgroup USART_Stop_Mode_Noise_Filter USART Stop Mode Noise_Filter + * @{ + */ +#define USART_STOP_MODE_FILTER_NONE (0UL) /*!< Disable noise filter */ +#define USART_STOP_MODE_FILTER_WIDTH_LEVEL_1 (PERIC_USART1_NFC_NFE) /*!< Filter width level 1 */ +#define USART_STOP_MODE_FILTER_WIDTH_LEVEL_2 (PERIC_USART1_NFC_NFE | \ + PERIC_USART1_NFC_NFS_0) /*!< Filter width level 2 */ +#define USART_STOP_MODE_FILTER_WIDTH_LEVEL_3 (PERIC_USART1_NFC_NFE | \ + PERIC_USART1_NFC_NFS_1) /*!< Filter width level 3 */ +#define USART_STOP_MODE_FILTER_WIDTH_LEVEL_4 (PERIC_USART1_NFC_NFE | \ + PERIC_USART1_NFC_NFS) /*!< Filter width level 4 */ +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup USART_Global_Functions + * @{ + */ +en_result_t USART_UartInit(M4_USART_TypeDef *USARTx, + const stc_usart_uart_init_t *pstcInit); +en_result_t USART_HalfduplexInit(M4_USART_TypeDef *USARTx, + const stc_usart_uart_init_t *pstcInit); +en_result_t USART_UartStructInit(stc_usart_uart_init_t *pstcInit); +en_result_t USART_MultiProcessorInit(M4_USART_TypeDef *USARTx, + const stc_usart_multiprocessor_init_t *pstcInit); +en_result_t USART_MultiProcessorStructInit(stc_usart_multiprocessor_init_t *pstcInit); +en_result_t USART_LinInit(M4_USART_TypeDef *USARTx, + const stc_usart_lin_init_t *pstcInit); +en_result_t USART_LinStructInit(stc_usart_lin_init_t *pstcInit); +en_result_t USART_SmartcardInit(M4_USART_TypeDef *USARTx, + const stc_usart_smartcard_init_t *pstcInit); +en_result_t USART_SmartcardStructInit(stc_usart_smartcard_init_t *pstcInit); +en_result_t USART_ClkSyncInit(M4_USART_TypeDef *USARTx, + const stc_usart_clksync_init_t *pstcInit); +en_result_t USART_ClkSyncStructInit(stc_usart_clksync_init_t *pstcInit); +void USART_DeInit(M4_USART_TypeDef *USARTx); +void USART_FuncCmd(M4_USART_TypeDef *USARTx, + uint32_t u32Func, + en_functional_state_t enNewState); +en_functional_state_t USART_GetFuncState(const M4_USART_TypeDef *USARTx, + uint32_t u32Func); +en_flag_status_t USART_GetStatus(const M4_USART_TypeDef *USARTx, + uint32_t u32Flag); +void USART_ClearStatus(M4_USART_TypeDef *USARTx, uint32_t u32Flag); +void USART_SetTransmissionType(M4_USART_TypeDef *USARTx, uint32_t u32Type); +uint32_t USART_GetTransmissionType(const M4_USART_TypeDef *USARTx); +void USART_SetParity(M4_USART_TypeDef *USARTx, uint32_t u32Parity); +uint32_t USART_GetParity(const M4_USART_TypeDef *USARTx); +void USART_SetDataWidth(M4_USART_TypeDef *USARTx, uint32_t u32DataWidth); +uint32_t USART_GetDataWidth(const M4_USART_TypeDef *USARTx); +void USART_SetOversmaplingBits(M4_USART_TypeDef *USARTx, + uint32_t u32OversamplingBits); +uint32_t USART_GetOversmaplingBits(const M4_USART_TypeDef *USARTx); +void USART_SetBitDirection(M4_USART_TypeDef *USARTx, uint32_t u32BitDir); +uint32_t USART_GetBitDirection(const M4_USART_TypeDef *USARTx); +void USART_SetSbDetectPolarity(M4_USART_TypeDef *USARTx, + uint32_t u32Polarity); +uint32_t USART_GetSbDetectPolarity(const M4_USART_TypeDef *USARTx); +void USART_SetClockMode(M4_USART_TypeDef *USARTx, uint32_t u32ClkMode); +uint32_t USART_GetClockMode(const M4_USART_TypeDef *USARTx); +void USART_SetStopBits(M4_USART_TypeDef *USARTx, uint32_t u32StopBits); +uint32_t USART_GetStopBits(const M4_USART_TypeDef *USARTx); +uint16_t USART_RecData(const M4_USART_TypeDef *USARTx); +void USART_SendData(M4_USART_TypeDef *USARTx, uint16_t u16Data); +void USART_SendId(M4_USART_TypeDef *USARTx, uint16_t u16ID); +void USART_SilenceCmd(M4_USART_TypeDef *USARTx, + en_functional_state_t enNewState); +void USART_LinLoopCmd(M4_USART_TypeDef *USARTx, + en_functional_state_t enNewState); +void USART_LinRequestBreakSending(M4_USART_TypeDef *USARTx); +en_flag_status_t USART_GetLinRequestBreakStatus(const M4_USART_TypeDef *USARTx); +void USART_SetLinBreakMode(M4_USART_TypeDef *USARTx, uint32_t u32Mode); +uint32_t USART_GetLinBreakMode(const M4_USART_TypeDef *USARTx); +void USART_SetDuplexMode(M4_USART_TypeDef *USARTx, uint32_t u32Mode); +uint32_t USART_GetDuplexMode(const M4_USART_TypeDef *USARTx); +void USART_SetHwFlowCtrl(M4_USART_TypeDef *USARTx, uint32_t u32HwFlowCtrl); +uint32_t USART_GetHwFlowCtrl(const M4_USART_TypeDef *USARTx); +void USART_SetSmartcardEtuClk(M4_USART_TypeDef *USARTx, + uint32_t u32EtuClk); +uint32_t USART_GetSmartcardEtuClk(const M4_USART_TypeDef *USARTx); +void USART_SetPclkDiv(M4_USART_TypeDef *USARTx, + uint32_t u32PclkDiv); +uint32_t USART_GetPclkDiv(const M4_USART_TypeDef *USARTx); +void USART_SetLinBmcPclkDiv(M4_USART_TypeDef *USARTx, + uint32_t u32PclkDiv); +uint32_t USART_GetLinBmcPclkDiv(const M4_USART_TypeDef *USARTx); +void USART_SetStopModeNoiseFilter(const M4_USART_TypeDef *USARTx, + uint32_t u32Filter); +uint32_t USART_GetStopModeNoiseFilter(const M4_USART_TypeDef *USARTx); +void USART_LinFuncCmd(M4_USART_TypeDef *USARTx, + uint32_t u32Func, + en_functional_state_t enNewState); +en_functional_state_t USART_GetLinFuncState(const M4_USART_TypeDef *USARTx, + uint32_t u32Func); +uint32_t USART_GetLinMeasureCnt(const M4_USART_TypeDef *USARTx); +uint32_t USART_GetLinMeasureBaudrate(const M4_USART_TypeDef *USARTx); +void USART_SetLinDetectBreakLen(M4_USART_TypeDef *USARTx, + uint32_t u32Len); +uint32_t USART_GetLinDetectBreakLen(const M4_USART_TypeDef *USARTx); +void USART_SetLinSendBreakLen(M4_USART_TypeDef *USARTx, uint32_t u32Len); +uint32_t USART_GetLinSendBreakLen(const M4_USART_TypeDef *USARTx); +en_result_t USART_SetBaudrate(M4_USART_TypeDef *USARTx, + uint32_t u32Baudrate, + float32_t *pf32Err); + +/** + * @} + */ + +#endif /* DDL_USART_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_USART_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_utility.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_utility.h new file mode 100644 index 0000000000..5fe838fef0 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_utility.h @@ -0,0 +1,120 @@ +/** + ******************************************************************************* + * @file hc32f4a0_utility.h + * @brief This file contains all the functions prototypes of the DDL utility. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Yangjp First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_UTILITY_H__ +#define __HC32F4A0_UTILITY_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_UTILITY + * @{ + */ + +#if (DDL_UTILITY_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + * Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup UTILITY_Global_Functions + * @{ + */ + +/* Imprecise delay */ +void DDL_DelayMS(uint32_t u32Cnt); +void DDL_DelayUS(uint32_t u32Cnt); + +/* Systick functions */ +en_result_t SysTick_Init(uint32_t u32Freq); +void SysTick_Delay(uint32_t u32Delay); +void SysTick_IncTick(void); +uint32_t SysTick_GetTick(void); +void SysTick_Suspend(void); +void SysTick_Resume(void); + +/* You can add your own assert functions by implement the function DDL_AssertHandler + definition follow the function DDL_AssertHandler declaration */ +#ifdef __DEBUG + #define DDL_ASSERT(x) \ + do{ \ + ((x) ? (void)0 : DDL_AssertHandler(__FILE__, __LINE__)); \ + }while(0) + /* Exported function */ + void DDL_AssertHandler(const char *file, int line); +#else + #define DDL_ASSERT(x) ((void)0U) +#endif /* __DEBUG */ + +#if (DDL_PRINT_ENABLE == DDL_ON) +#include + +en_result_t DDL_PrintfInit(void); +#endif + +/** + * @} + */ + +#endif /* DDL_UTILITY_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_UTILITY_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_wdt.h b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_wdt.h new file mode 100644 index 0000000000..a4cfc10f29 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/inc/hc32f4a0_wdt.h @@ -0,0 +1,228 @@ +/** + ******************************************************************************* + * @file hc32f4a0_wdt.h + * @brief This file contains all the functions prototypes of the WDT driver + * library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Yangjp First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ +#ifndef __HC32F4A0_WDT_H__ +#define __HC32F4A0_WDT_H__ + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_common.h" +#include "ddl_config.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @addtogroup DDL_WDT + * @{ + */ + +#if (DDL_WDT_ENABLE == DDL_ON) + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +/** + * @defgroup WDT_Global_Types WDT Global Types + * @{ + */ + +/** + * @brief WDT Init structure definition + */ +typedef struct +{ + uint32_t u32CountCycle; /*!< Specifies the WDT Count Cycle. + This parameter can be a value of @ref WDT_Counter_Cycle */ + + uint32_t u32ClockDivision; /*!< Specifies the WDT Clock Division. + This parameter can be a value of @ref WDT_Clock_Division */ + + uint32_t u32RefreshRange; /*!< Specifies the WDT Allow Refresh Range. + This parameter can be a value of @ref WDT_Refresh_Percent_Range */ + + uint32_t u32LPModeCountEn; /*!< Specifies the WDT Count Enable/Disable In Low Power Mode(Sleep Mode). + This parameter can be a value of @ref WDT_LPW_Mode_Count */ + + uint32_t u32TrigType; /*!< Specifies the WDT Refresh Error or Count Underflow trigger event Type. + This parameter can be a value of @ref WDT_Trigger_Event_Type */ +} stc_wdt_init_t; + +/** + * @} + */ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup WDT_Global_Macros WDT Global Macros + * @{ + */ + +/** + * @defgroup WDT_Counter_Cycle WDT Counter Cycle + * @{ + */ +#define WDT_COUNTER_CYCLE_256 (0UL) /*!< 256 clock cycle */ +#define WDT_COUNTER_CYCLE_4096 (WDT_CR_PERI_0) /*!< 4096 clock cycle */ +#define WDT_COUNTER_CYCLE_16384 (WDT_CR_PERI_1) /*!< 16384 clock cycle */ +#define WDT_COUNTER_CYCLE_65536 (WDT_CR_PERI) /*!< 65536 clock cycle */ +/** + * @} + */ + +/** + * @defgroup WDT_Clock_Division WDT Clock Division + * @{ + */ +#define WDT_CLOCK_DIV4 (WDT_CR_CKS_1) /*!< PLCK3/4 */ +#define WDT_CLOCK_DIV64 (WDT_CR_CKS_2 | WDT_CR_CKS_1) /*!< PLCK3/64 */ +#define WDT_CLOCK_DIV128 (WDT_CR_CKS_2 | WDT_CR_CKS_1 | WDT_CR_CKS_0) /*!< PLCK3/128 */ +#define WDT_CLOCK_DIV256 (WDT_CR_CKS_3) /*!< PLCK3/256 */ +#define WDT_CLOCK_DIV512 (WDT_CR_CKS_3 | WDT_CR_CKS_0) /*!< PLCK3/512 */ +#define WDT_CLOCK_DIV1024 (WDT_CR_CKS_3 | WDT_CR_CKS_1) /*!< PLCK3/1024 */ +#define WDT_CLOCK_DIV2048 (WDT_CR_CKS_3 | WDT_CR_CKS_1 | WDT_CR_CKS_0) /*!< PLCK3/2048 */ +#define WDT_CLOCK_DIV8192 (WDT_CR_CKS_3 | WDT_CR_CKS_2 | WDT_CR_CKS_0) /*!< PLCK3/8192 */ +/** + * @} + */ + +/** + * @defgroup WDT_Refresh_Percent_Range WDT Refresh Percent Range + * @{ + */ +#define WDT_RANGE_0TO100PCT (0UL) /*!< 0%~100% */ +#define WDT_RANGE_0TO25PCT (WDT_CR_WDPT_0) /*!< 0%~25% */ +#define WDT_RANGE_25TO50PCT (WDT_CR_WDPT_1) /*!< 25%~50% */ +#define WDT_RANGE_0TO50PCT (WDT_CR_WDPT_1 | WDT_CR_WDPT_0) /*!< 0%~50% */ +#define WDT_RANGE_50TO75PCT (WDT_CR_WDPT_2) /*!< 50%~75% */ +#define WDT_RANGE_0TO25PCT_50TO75PCT (WDT_CR_WDPT_2 | WDT_CR_WDPT_0) /*!< 0%~25% & 50%~75% */ +#define WDT_RANGE_25TO75PCT (WDT_CR_WDPT_2 | WDT_CR_WDPT_1) /*!< 25%~75% */ +#define WDT_RANGE_0TO75PCT (WDT_CR_WDPT_2 | WDT_CR_WDPT_1 | WDT_CR_WDPT_0) /*!< 0%~75% */ +#define WDT_RANGE_75TO100PCT (WDT_CR_WDPT_3) /*!< 75%~100% */ +#define WDT_RANGE_0TO25PCT_75TO100PCT (WDT_CR_WDPT_3 | WDT_CR_WDPT_0) /*!< 0%~25% & 75%~100% */ +#define WDT_RANGE_25TO50PCT_75TO100PCT (WDT_CR_WDPT_3 | WDT_CR_WDPT_1) /*!< 25%~50% & 75%~100% */ +#define WDT_RANGE_0TO50PCT_75TO100PCT (WDT_CR_WDPT_3 | WDT_CR_WDPT_1 | WDT_CR_WDPT_0) /*!< 0%~50% & 75%~100% */ +#define WDT_RANGE_50TO100PCT (WDT_CR_WDPT_3 | WDT_CR_WDPT_2) /*!< 50%~100% */ +#define WDT_RANGE_0TO25PCT_50TO100PCT (WDT_CR_WDPT_3 | WDT_CR_WDPT_2 | WDT_CR_WDPT_0) /*!< 0%~25% & 50%~100% */ +#define WDT_RANGE_25TO100PCT (WDT_CR_WDPT_3 | WDT_CR_WDPT_2 | WDT_CR_WDPT_1) /*!< 25%~100% */ +/** + * @} + */ + +/** + * @defgroup WDT_LPW_Mode_Count WDT Low Power Mode Count + * @brief WDT count control in the sleep mode + * @{ + */ +#define WDT_LPM_COUNT_CONTINUE (0UL) /*!< WDT count continue in the sleep mode */ +#define WDT_LPM_COUNT_STOP (WDT_CR_SLPOFF) /*!< WDT count stop in the sleep mode */ +/** + * @} + */ + +/** +* @defgroup WDT_Trigger_Event_Type WDT Trigger Event Type +* @{ +*/ +#define WDT_TRIG_EVENT_INT (0UL) /*!< WDT trigger interrupt */ +#define WDT_TRIG_EVENT_RESET (WDT_CR_ITS) /*!< WDT trigger reset */ +/** + * @} + */ + +/** + * @defgroup WDT_Flag WDT Flag + * @{ + */ +#define WDT_FLAG_UDF (WDT_SR_UDF) /*!< Count underflow flag */ +#define WDT_FLAG_REF (WDT_SR_REF) /*!< Refresh error flag */ +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + Global function prototypes (definition in C source) + ******************************************************************************/ +/** + * @addtogroup WDT_Global_Functions + * @{ + */ + +/** + * @brief Get WDT count value. + * @param None + * @retval Count value + */ +__STATIC_INLINE uint16_t WDT_GetCountValue(void) +{ + return (uint16_t)(READ_REG32(M4_WDT->SR) & WDT_SR_CNT); +} + +/* Initialization and configuration functions */ +en_result_t WDT_Init(const stc_wdt_init_t *pstcWdtInit); +void WDT_Feed(void); +uint16_t WDT_GetCountValue(void); + +/* Flags management functions */ +en_flag_status_t WDT_GetStatus(uint32_t u32Flag); +en_result_t WDT_ClearStatus(uint32_t u32Flag); + +/** + * @} + */ + +#endif /* DDL_WDT_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __HC32F4A0_WDT_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_adc.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_adc.c new file mode 100644 index 0000000000..07b74cb870 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_adc.c @@ -0,0 +1,1588 @@ +/** + ******************************************************************************* + * @file hc32f4a0_adc.c + * @brief This file provides firmware functions to manage the Analog-to-Digital + * Converter(ADC). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Wuze First version + 2020-07-02 Wuze 1. API ADC_SH_ChannelCmd() refine. + 2. Some other optimizations. + 2020-08-10 Wuze ADC_SeqClrStatus(): ADC_SEQ_FLAG_NESTED can be cleared. + 2020-12-15 Wuze ADC_ComTriggerCmd() refine. + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_adc.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_ADC ADC + * @brief Analog-to-Digital Converter Driver Library + * @{ + */ + +#if (DDL_ADC_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup ADC_Local_Macros ADC Local Macros + * @{ + */ + +/** + * @defgroup ADC_Unit_Base_Address ADC Unit Base Address + * @{ + */ +#define ADC1_BASE (0x40040000UL) +#define ADC2_BASE (0x40040400UL) +#define ADC3_BASE (0x40040800UL) +/** + * @} + */ + +/** + * @defgroup ADC_Configuration_Bit_Mask ADC Configuration Bit Mask + * @{ + */ +#define ADC_TRIG_SRC_MSK (ADC_TRGSR_TRGSELA) +#define ADC_AWD_COMB_MODE_MSK (ADC_AWDCR_AWDCM) +#define ADC_PGA_CMD_MSK (ADC_PGACR1_PGACTL) +#define ADC_PGA_GAIN_MSK (ADC_PGACR1_PGAGAIN) +#define ADC_SYNC_CFG_MSK (ADC_SYNCCR_SYNCMD | ADC_SYNCCR_SYNCDLY) +#define ADC_CH_MAP_PIN_MSK (ADC_CHMUXR0_CH00MUX) +#define ADC_SH_CFG_MSK (ADC_SHCR_SHSST) +#define ADC_SH_CH_MSK (ADC_SHCR_SHSEL) +#define ADC_COM_TRIG_MSK (ADC_COM_TRIG1 | ADC_COM_TRIG2) +#define ADC_TRIG_EVENT_MSK (AOS_ADC_1_ITRGSELR_TRGSEL) +/** + * @} + */ + +/** + * @defgroup ADC_PGA_Command ADC PGA Command + * @{ + */ +#define ADC_PGA_DISABLE (0x0U) +#define ADC_PGA_ENABLE (0xEU) +/** + * @} + */ + +/** + * @defgroup ADC_Unit_Number ADC Unit Number + * @{ + */ +#define __ADC_BASE (ADC1_BASE) +#define __ADC_UNIT_SIZE (0x400UL) +#define ADC_IDX(__ADCx__) ((uint8_t)(((uint32_t)&(__ADCx__)->STR - __ADC_BASE) / __ADC_UNIT_SIZE)) +/** + * @} + */ + +/** + * @defgroup ADC_Register_Bit_Band ADC Register Bit Band + * @{ + */ +#define __BIT_BAND_BASE (0x42000000UL) +#define __PERIP_BASE (0x40000000UL) +#define __REG_OFS(regAddr) ((regAddr) - __PERIP_BASE) +#define __BIT_BAND_ADDR(regAddr, pos) ((__REG_OFS(regAddr) << 5U) + ((uint32_t)(pos) << 2U) + __BIT_BAND_BASE) +#define BIT_BAND(regAddr, pos) (*(__IO uint32_t *)__BIT_BAND_ADDR((regAddr), (pos))) +/** + * @} + */ + +/** + * @defgroup ADC_Sequence_Configuration_Bit_Field_Offset ADC Sequence Configuration Bit Field Offset + * @{ + */ +#define ADC_OFS_TRGSR(__seq__) ((uint32_t)(__seq__) * ADC_TRGSR_TRGSELB_POS) +#define ADC_OFS_AWDCR(__num__) ((uint32_t)(__num__) * ADC_AWDCR_AWD1EN) +/** + * @} + */ + +/** + * @defgroup ADC_Register_Configuration_Value ADC Register Configuration Value + * @{ + */ +#define ADC_TRGSR_VAL(__seq__, __val__) ((uint32_t)(__val__) << ADC_OFS_TRGSR(__seq__)) +#define ADC_AWDCR_VAL(__num__, __val__) ((uint32_t)(__val__) << ADC_OFS_AWDCR(__num__)) +/** + * @} + */ + +/** + * @defgroup ADC_AWD_DR ADC AWD DR + * @{ + */ +#define ADC_AWDx_DR(__base__, __awdNum__) (*(__IO uint32_t *)((uint32_t)(__base__) + ((uint32_t)(__awdNum__) << 3U))) +/** + * @} + */ + +/** + * @defgroup ADC_AWD_CHSR ADC AWD CHSR + * @{ + */ +#define ADC_AWDx_CHSR(__base__, __awdNum__) (*(__IO uint32_t *)((uint32_t)(__base__) + ((uint32_t)(__awdNum__) << 3U))) +/** + * @} + */ + +/** + * @defgroup ADC_Check_Parameters_Validity ADC check parameters validity + * @{ + */ +#define IS_ADC_UNIT(x) \ +( ((x) == M4_ADC1) || \ + ((x) == M4_ADC2) || \ + ((x) == M4_ADC3)) + +#define IS_ADC_SEQ(x) \ +( ((x) == ADC_SEQ_A) || \ + ((x) == ADC_SEQ_B)) + +#define IS_ADC_SCAN_MODE(x) \ +( ((x) == ADC_MODE_SA_SSHOT) || \ + ((x) == ADC_MODE_SA_CONT) || \ + ((x) == ADC_MODE_SA_SB_SSHOT) || \ + ((x) == ADC_MODE_SA_CONT_SB_SSHOT)) + +#define IS_ADC_RESOLUTION(x) \ +( ((x) == ADC_RESOLUTION_8BIT) || \ + ((x) == ADC_RESOLUTION_10BIT) || \ + ((x) == ADC_RESOLUTION_12BIT)) + +#define IS_ADC_TRIG_SRC(x) \ +( ((x) == ADC_TRIG_SRC_ADTRG) || \ + ((x) == ADC_TRIG_SRC_EVENT0) || \ + ((x) == ADC_TRIG_SRC_EVENT1) || \ + ((x) == ADC_TRIG_SRC_EVENT0_EVENT1)) + +#define IS_ADC_AUTO_CLEAR_CMD(x) \ +( ((x) == ADC_AUTO_CLR_DISABLE) || \ + ((x) == ADC_AUTO_CLR_ENABLE)) + +#define IS_ADC_DATA_ALIGN(x) \ +( ((x) == ADC_DATA_ALIGN_RIGHT) || \ + ((x) == ADC_DATA_ALIGN_LEFT)) + +#define IS_ADC_SA_RESUME_POS(x) \ +( ((x) == ADC_SA_RESUME_POS_INT_CH) || \ + ((x) == ADC_SA_RESUME_POS_FIRST_CH)) + +#define IS_ADC_SAMPLE_TIME(x) \ +( ((x) >= 5U)) + +#define IS_ADC_AVG_CNT(x) \ +( ((x) == ADC_AVG_CNT_2) || \ + ((x) == ADC_AVG_CNT_4) || \ + ((x) == ADC_AVG_CNT_8) || \ + ((x) == ADC_AVG_CNT_16) || \ + ((x) == ADC_AVG_CNT_32) || \ + ((x) == ADC_AVG_CNT_64) || \ + ((x) == ADC_AVG_CNT_128) || \ + ((x) == ADC_AVG_CNT_256)) + +#define IS_ADC_EXCH_SRC(x) \ +( ((x) == ADC_EXCH_SRC_ADC_PIN) || \ + ((x) == ADC_EXCH_SRC_INTERNAL)) + +#define IS_AWD_UNIT(x) \ +( ((x) == ADC_AWD_0) || \ + ((x) == ADC_AWD_1)) + +#define IS_AWD_CH_NUM(x) \ +( ((x) <= ADC_CH_NUM_15)) + +#define IS_AWD_CMP_MODE(x) \ +( ((x) == ADC_AWD_CMP_OUT_RANGE) || \ + ((x) == ADC_AWD_CMP_IN_RANGE)) + +#define IS_AWD_COMB_MODE(x) \ +( ((x) == ADC_AWD_COMB_OR) || \ + ((x) == ADC_AWD_COMB_AND) || \ + ((x) == ADC_AWD_COMB_XOR)) + +#define IS_PGA_UNIT(x) \ +( ((x) <= ADC_PGA_4)) + +#define IS_PGA_GAIN(x) \ +( ((x) <= ADC_PGA_GAIN_32)) + +#define IS_PGA_VSS(x) \ +( ((x) == ADC_PGA_VSS_PGAVSS) || \ + ((x) == ADC_PGA_VSS_AVSS)) + +#define IS_ADC_SYNC_MODE(x) \ +( ((x) == ADC_SYNC_SSHOT_SEQUENTIAL) || \ + ((x) == ADC_SYNC_SSHOT_SIMULTANEOUS) || \ + ((x) == ADC_SYNC_CONT_SEQUENTIAL) || \ + ((x) == ADC_SYNC_CONT_SIMULTANEOUS)) + +#define IS_ADC_SYNC_UNIT(x) \ +( ((x) == ADC_SYNC_ADC1_ADC2) || \ + ((x) == ADC_SYNC_ADC1_ADC2_ADC3)) + +#define IS_ADC_SYNC_TRIG_DLY(x) \ +( ((x) != 0U)) + +#define IS_ADC_REMAP_PIN_NUM(x) \ +( ((x) <= ADC12_IN15)) + +#define IS_ADC1_DR_LENGTH(x) \ +( ((x) >= ADC1_CH_COUNT)) + +#define IS_ADC2_DR_LENGTH(x) \ +( ((x) >= ADC2_CH_COUNT)) + +#define IS_ADC3_DR_LENGTH(x) \ +( ((x) >= ADC3_CH_COUNT)) + +#define IS_ADC_1_BIT_MSK(x) \ +( ((x) != 0U) && \ + (((x) & ((x) - 1U)) == 0U)) + +#define IS_ADC_BIT_MSK(x, msk) \ +( ((x) != 0U) && \ + (((x) | (msk)) == (msk))) + +/** + * @} + */ + +/** + * @defgroup ADC_Miscellaneous_Macros ADC Miscellaneous Macros + * @{ + */ +#define ADC_UNIT_COUNT (3U) +#define ADC_IND_SPL_TIME_COUNT (16U) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup ADC_Global_Functions ADC Global Functions + * @{ + */ + +/** + * @brief Initializes the specified ADC peripheral according to the specified parameters + * in the structure stc_adc_init_t. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [in] pstcInit Pointer to a stc_adc_init_t structure value that + * contains the configuration information for the ADC. + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg ErrorInvalidParameter: pstcInit == NULL. + */ +en_result_t ADC_Init(M4_ADC_TypeDef *ADCx, const stc_adc_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (pstcInit != NULL) + { + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + DDL_ASSERT(IS_ADC_SCAN_MODE(pstcInit->u16ScanMode)); + DDL_ASSERT(IS_ADC_RESOLUTION(pstcInit->u16Resolution)); + DDL_ASSERT(IS_ADC_AUTO_CLEAR_CMD(pstcInit->u16AutoClrCmd)); + DDL_ASSERT(IS_ADC_DATA_ALIGN(pstcInit->u16DataAlign)); + DDL_ASSERT(IS_ADC_SA_RESUME_POS(pstcInit->u16SAResumePos)); + + /* Configures scan convert mode, resolution, data automatically clear command + and data alignment. */ + WRITE_REG16(ADCx->CR0, \ + (pstcInit->u16ScanMode | \ + pstcInit->u16Resolution | \ + pstcInit->u16AutoClrCmd | \ + pstcInit->u16DataAlign)); + + /* Configures the channel sequence A restart from. */ + WRITE_REG16(ADCx->CR1, pstcInit->u16SAResumePos); + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief De-initializes the ADC peripheral. Reset the registers of the specified ADC unit. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @retval None + */ +void ADC_DeInit(M4_ADC_TypeDef *ADCx) +{ + uint8_t i; + uint32_t u32SSTRAddr; + + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + + /* Stop the ADC. */ + WRITE_REG8(ADCx->STR, 0U); + + /* Set the registers to reset value. */ + WRITE_REG16(ADCx->CR0, 0x0U); + WRITE_REG16(ADCx->CR1, 0x0U); + WRITE_REG16(ADCx->TRGSR, 0x0U); + + WRITE_REG32(ADCx->CHSELRA, 0x0U); + WRITE_REG32(ADCx->CHSELRB, 0x0U); + WRITE_REG32(ADCx->AVCHSELR, 0x0U); + WRITE_REG8(ADCx->EXCHSELR, 0x0U); + + WRITE_REG16(ADCx->CHMUXR0, 0x3210U); + WRITE_REG16(ADCx->CHMUXR1, 0x7654U); + WRITE_REG16(ADCx->CHMUXR2, 0xBA98U); + WRITE_REG16(ADCx->CHMUXR3, 0xFEDCU); + + WRITE_REG8(ADCx->ICR, 0x03U); + WRITE_REG8(ADCx->ISCLRR, 0x13U); + + WRITE_REG16(ADCx->AWDCR, 0x0U); + WRITE_REG8(ADCx->AWDSCLRR, 0x13U); + + WRITE_REG16(ADCx->AWD0DR0, 0x0U); + WRITE_REG16(ADCx->AWD0DR1, 0xFFFFU); + WRITE_REG16(ADCx->AWD1DR0, 0x0U); + WRITE_REG16(ADCx->AWD1DR1, 0xFFFFU); + + WRITE_REG8(ADCx->AWD0CHSR, 0x0U); + WRITE_REG8(ADCx->AWD1CHSR, 0x0U); + + u32SSTRAddr = (uint32_t)&ADCx->SSTR0; + for (i=0U; iSYNCCR, 0x0C00U); + WRITE_REG16(ADCx->SHCR, 0x18U); + WRITE_REG8(ADCx->PGACR1, 0x0U); + WRITE_REG8(ADCx->PGACR2, 0x0U); + WRITE_REG8(ADCx->PGACR3, 0x0U); + WRITE_REG8(ADCx->PGAVSSENR, 0x0U); + } + else if (ADCx == M4_ADC2) + { + WRITE_REG8(ADCx->PGACR1, 0x0U); + WRITE_REG8(ADCx->PGAVSSENR, 0x0U); + } + else if (ADCx == M4_ADC3) + { + WRITE_REG8(ADCx->SSTRL, 0x0BU); + } + else + { + /* rsvd */ + } +} + +/** + * @brief Set a default value for the ADC initialization structure. + * @param [in] pstcInit Pointer to a stc_adc_init_t structure that + * contains configuration information. + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg ErrorInvalidParameter: pstcInit == NULL. + */ +en_result_t ADC_StructInit(stc_adc_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (pstcInit != NULL) + { + pstcInit->u16ScanMode = ADC_MODE_SA_SSHOT; + pstcInit->u16Resolution = ADC_RESOLUTION_12BIT; + pstcInit->u16AutoClrCmd = ADC_AUTO_CLR_DISABLE; + pstcInit->u16DataAlign = ADC_DATA_ALIGN_RIGHT; + pstcInit->u16SAResumePos = ADC_SA_RESUME_POS_INT_CH; + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set scan convert mode for the specified ADC unit. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [in] u16Mode ADC san convert mode. + * This parameter can be a value of @ref ADC_Scan_Convert_Mode. + * @arg ADC_MODE_SA_SSHOT: Sequence A single shot. + * @arg ADC_MODE_SA_CONT: Sequence A continuous. + * @arg ADC_MODE_SA_SB_SSHOT: Sequence A and B both single shot. + * @arg ADC_MODE_SA_CONT_SB_SSHOT: Sequence A continuous and sequence B single shot. + * @retval None + */ +void ADC_SetScanMode(M4_ADC_TypeDef *ADCx, uint16_t u16Mode) +{ + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + DDL_ASSERT(IS_ADC_SCAN_MODE(u16Mode)); + MODIFY_REG16(ADCx->CR0, ADC_CR0_MS, u16Mode); +} + +/** + * @brief Enable or disable the specified sequence's channels. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [in] u8Seq The sequence that it's specified channels will be enabled or disabled. + * This parameter can be a value of @ref ADC_Sequence + * @arg ADC_SEQ_A: Sequence A. + * @arg ADC_SEQ_B: Sequence B. + * @param [in] u32AdcCh The ADC channels. + * This parameter can be values of @ref ADC_Channel + * @arg ADC_CH0 ~ ADC_CH15: For M4_ADC1 and M4_ADC2. + * @arg ADC_CH0 ~ ADC_CH19: For M4_ADC3. + * @param [in] pu8SplTime: Pointer to an uint8_t type array which contains sampling time of the specified channels. + * @param [in] enNewState: An en_functional_state_t value. + * @arg Enable: Enable the specified sequence's specified channels. + * @arg Disable: Disable the specified sequence's specified channels. + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg ErrorInvalidParameter: pu8SplTime == NULL. + * @note Sequence A and Sequence B CAN NOT include the same channel! + * @note ADC_CH16 ~ ADC_CH19 of ADC3 share the same sampling time. + */ +en_result_t ADC_ChannelCmd(M4_ADC_TypeDef *ADCx, uint8_t u8Seq, \ + uint32_t u32AdcCh, const uint8_t pu8SplTime[], \ + en_functional_state_t enNewState) +{ + uint8_t i = 0U; + uint8_t j = 0U; + uint32_t u32CHSELAddr; + uint32_t u32SSTRAddr; + uint32_t au32ChMsk[] = {ADC1_CH_ALL, ADC2_CH_ALL, ADC3_CH_ALL}; + en_result_t enRet = ErrorInvalidParameter; + + if (pu8SplTime != NULL) + { + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + DDL_ASSERT(IS_ADC_SEQ(u8Seq)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32CHSELAddr = (uint32_t)&ADCx->CHSELRA + ((uint32_t)u8Seq * 4U); + u32SSTRAddr = (uint32_t)&ADCx->SSTR0; + u32AdcCh &= au32ChMsk[ADC_IDX(ADCx)]; + + if (enNewState == Enable) + { + RW_MEM32(u32CHSELAddr) |= u32AdcCh; + + while (u32AdcCh != 0U) + { + if ((u32AdcCh & 0x1UL) != 0U) + { + DDL_ASSERT(IS_ADC_SAMPLE_TIME(pu8SplTime[j])); + RW_MEM8(u32SSTRAddr+i) = pu8SplTime[j]; + if (i < ADC_IND_SPL_TIME_COUNT) + { + j++; + } + } + u32AdcCh >>= 1U; + if (i < ADC_IND_SPL_TIME_COUNT) + { + i++; + } + } + } + else + { + RW_MEM32(u32CHSELAddr) &= (uint32_t)(~u32AdcCh); + } + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set average count for the specified ADC unit. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [in] u16AvgCnt The average count to be set for the specified ADC unit. + * This parameter can be a value of @ref ADC_Average_Count + * @arg ADC_AVG_CNT_2 + * @arg ADC_AVG_CNT_4 + * @arg ADC_AVG_CNT_8 + * @arg ADC_AVG_CNT_16 + * @arg ADC_AVG_CNT_32 + * @arg ADC_AVG_CNT_64 + * @arg ADC_AVG_CNT_128 + * @arg ADC_AVG_CNT_256 + * @retval None + */ +void ADC_AvgChannelConfig(M4_ADC_TypeDef *ADCx, uint16_t u16AvgCnt) +{ + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + DDL_ASSERT(IS_ADC_AVG_CNT(u16AvgCnt)); + MODIFY_REG16(ADCx->CR0, ADC_CR0_AVCNT, u16AvgCnt); +} + +/** + * @brief Enable or disable the specified ADC unit's average channels. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [in] u32AdcCh The ADC channels. + * This parameter can be values of @ref ADC_Channel + * @arg ADC_CH0 ~ ADC_CH15: For M4_ADC1 and M4_ADC2. + * @arg ADC_CH0 ~ ADC_CH19: For M4_ADC3. + * @param [in] enNewState: An en_functional_state_t value. + * @arg Enable: Enable the specified ADC unit's average channels. + * @arg Disable: Disable the specified ADC unit's average channels. + * @retval None + */ +void ADC_AvgChannelCmd(M4_ADC_TypeDef *ADCx, uint32_t u32AdcCh, en_functional_state_t enNewState) +{ + uint32_t u32SACh; + uint32_t u32SBCh; + + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32SACh = ADCx->CHSELRA; + u32SBCh = ADCx->CHSELRB; + u32AdcCh &= (u32SACh | u32SBCh); + if (enNewState == Enable) + { + SET_REG32_BIT(ADCx->AVCHSELR, u32AdcCh); + } + else + { + CLEAR_REG32_BIT(ADCx->AVCHSELR, u32AdcCh); + } +} + +/** + * @brief Set analog input source for the specified ADC unit's extend channel. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [in] u8ExChSrc The analog input source for the extend channel. + * This parameter can be a value of @ref ADC_Extend_Channel_Source + * @arg ADC_EXCH_SRC_ADC_PIN: The analog input source of extend channel is ADC analog input pin, + * ADC12_IN15 of ADC1/ADC2 and ADC3_IN15 of ADC3. + * @arg ADC_EXCH_SRC_INTERNAL: The analog input source of extend channels is internal reference voltage or + * the partial voltage of VBAT. + * @retval None + */ +void ADC_SetExChannelSrc(M4_ADC_TypeDef *ADCx, uint8_t u8ExChSrc) +{ + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + DDL_ASSERT(IS_ADC_EXCH_SRC(u8ExChSrc)); + WRITE_REG8(ADCx->EXCHSELR, u8ExChSrc); +} + +/** + * @brief Set a default value for the trigger source configuration structure. + * @param [in] pstcCfg Pointer to a stc_adc_trig_cfg_t structure that + * contains configuration information. + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg ErrorInvalidParameter: pstcCfg == NULL. + */ +en_result_t ADC_TrigSrcStructInit(stc_adc_trig_cfg_t *pstcCfg) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (pstcCfg != NULL) + { + pstcCfg->u16TrigSrc = ADC_TRIG_SRC_ADTRG; + pstcCfg->enEvent0 = EVT_MAX; + pstcCfg->enEvent1 = EVT_MAX; + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Configures the trigger source for the specified sequence of the specified ADC unit. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [in] u8Seq The sequence to be configured. + * This parameter can be a value of @ref ADC_Sequence + * @arg ADC_SEQ_A: Sequence A. + * @arg ADC_SEQ_B: Sequence B. + * @param [in] pstcCfg Pointer to a stc_adc_trig_cfg_t structure that contains + * the configuration information of the trigger source. + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg ErrorInvalidParameter: pstcCfg == NULL. + * @note ADC must be stopped while calling this function. + * @note The trigger source CANNOT be an event that generated by the sequence itself. + */ +en_result_t ADC_TrigSrcConfig(M4_ADC_TypeDef *ADCx, uint8_t u8Seq, const stc_adc_trig_cfg_t *pstcCfg) +{ + uint32_t u32AdcIdx; + uint32_t u32ITRGSELRAddr; + en_result_t enRet = ErrorInvalidParameter; + + if (pstcCfg != NULL) + { + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + DDL_ASSERT(IS_ADC_SEQ(u8Seq)); + DDL_ASSERT(IS_ADC_TRIG_SRC(pstcCfg->u16TrigSrc)); + + u32AdcIdx = ADC_IDX(ADCx); + u32ITRGSELRAddr = (uint32_t)&M4_AOS->ADC_1_ITRGSELR0 + u32AdcIdx * 8U; + if ((pstcCfg->u16TrigSrc & ADC_TRIG_SRC_EVENT0) != 0U) + { + MODIFY_REG32(RW_MEM32(u32ITRGSELRAddr), ADC_TRIG_EVENT_MSK, pstcCfg->enEvent0); + } + + if ((pstcCfg->u16TrigSrc & ADC_TRIG_SRC_EVENT1) != 0U) + { + u32ITRGSELRAddr += 4U; + MODIFY_REG32(RW_MEM32(u32ITRGSELRAddr), ADC_TRIG_EVENT_MSK, pstcCfg->enEvent1); + } + + MODIFY_REG16(ADCx->TRGSR, \ + ADC_TRGSR_VAL(u8Seq, ADC_TRIG_SRC_MSK), \ + ADC_TRGSR_VAL(u8Seq, pstcCfg->u16TrigSrc)); + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Enable or disable the trigger source of the specified sequence. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [in] u8Seq The sequence to be configured. + * This parameter can be a value of @ref ADC_Sequence + * @arg ADC_SEQ_A: Sequence A. + * @arg ADC_SEQ_B: Sequence B. + * @param [in] enNewState An en_functional_state_t enumeration value. + * @arg Enable: Enable the trigger source of the specified sequence. + * @arg Disable: Disable the trigger source of the specified sequence. + * @retval None + * @note ADC must be stopped while calling this function. + */ +void ADC_TrigSrcCmd(M4_ADC_TypeDef *ADCx, uint8_t u8Seq, en_functional_state_t enNewState) +{ + uint32_t u32Addr; + uint8_t au8CmdPos[] = {ADC_TRGSR_TRGENA_POS, ADC_TRGSR_TRGENB_POS}; + + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + DDL_ASSERT(IS_ADC_SEQ(u8Seq)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32Addr = (uint32_t)&ADCx->TRGSR; + BIT_BAND(u32Addr, au8CmdPos[u8Seq]) = (uint32_t)enNewState; +} + +/** + * @brief Enable or disable common trigger event to start ADC. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [in] u16TrigSrc ADC trigger source type. + * This parameter can be a value of @ref ADC_Trigger_Source_Type except ADC_TRIG_SRC_ADTRG. + * @arg ADC_TRIG_SRC_EVENT0: The trigger source is a internal event from other peripheral. \ + * Only one event can be configured to trigger ADC. + * @arg ADC_TRIG_SRC_EVENT1: The trigger source is a internal event from other peripheral. \ + * Only one event can be configured to trigger ADC. + * @arg ADC_TRIG_SRC_EVENT0_EVENT1: The trigger source are two internal events from other peripheral(s). \ + * Two events can be configured to trigger ADC and one of which can trigger the ADC. + * @param [in] u32ComTrig Common trigger event enable bit mask. + * This parameter can be a value of @ref ADC_Common_Trigger_Sel + * @arg ADC_COM_TRIG1: Common trigger 1. + * @arg ADC_COM_TRIG2: Common trigger 2. + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable the specified common trigger. + * @arg Disable: Disable the specified common trigger. + * @retval None + */ +void ADC_ComTriggerCmd(M4_ADC_TypeDef *ADCx, uint16_t u16TrigSrc, \ + uint32_t u32ComTrig, en_functional_state_t enNewState) +{ + uint32_t u32AdcIdx; + uint32_t u32ITRGSELRAddr; + + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + DDL_ASSERT(IS_ADC_BIT_MSK(u32ComTrig, ADC_COM_TRIG_MSK)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32AdcIdx = ADC_IDX(ADCx); + u32ITRGSELRAddr = (uint32_t)&M4_AOS->ADC_1_ITRGSELR0 + u32AdcIdx * 8U; + + if ((u16TrigSrc & ADC_TRIG_SRC_EVENT0) != 0U) + { + if (enNewState == Enable) + { + SET_REG32_BIT(RW_MEM32(u32ITRGSELRAddr), u32ComTrig); + } + else + { + CLEAR_REG32_BIT(RW_MEM32(u32ITRGSELRAddr), u32ComTrig); + } + } + + if ((u16TrigSrc & ADC_TRIG_SRC_EVENT1) != 0U) + { + u32ITRGSELRAddr += 4UL; + if (enNewState == Enable) + { + SET_REG32_BIT(RW_MEM32(u32ITRGSELRAddr), u32ComTrig); + } + else + { + CLEAR_REG32_BIT(RW_MEM32(u32ITRGSELRAddr), u32ComTrig); + } + } +} + +/** + * @brief Enable or disable the interrupt of the specified ADC unit's specified sequence. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [in] u8Seq The sequence to be configured. + * This parameter can be a value of @ref ADC_Sequence + * @arg ADC_SEQ_A: Sequence A. + * @arg ADC_SEQ_B: Sequence B. + * @param [in] enNewState An en_functional_state_t enumeration value. + * @arg Enable: Enable the interrupt of the specified sequence. + * @arg Disable: Disable the interrupt of the specified sequence. + * @retval None + */ +void ADC_SeqIntCmd(M4_ADC_TypeDef *ADCx, uint8_t u8Seq, en_functional_state_t enNewState) +{ + uint32_t u32Addr; + + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + DDL_ASSERT(IS_ADC_SEQ(u8Seq)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32Addr = (uint32_t)&ADCx->ICR; + BIT_BAND(u32Addr, u8Seq) = (uint32_t)enNewState; +} + +/** + * @brief Get the status flag of the specified ADC unit's specified sequence. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [in] u8Flag Status flag type. + * This parameter can be valueS of @ref ADC_Sequence_Status_Flag + * @arg ADC_SEQ_FLAG_EOCA: Status flag of the end of conversion of sequence A. + * @arg ADC_SEQ_FLAG_EOCB: Status flag of the end of conversion of sequence B. + * @arg ADC_SEQ_FLAG_NESTED: Status flag of sequence A was interrupted by sequence B. + * @retval An en_flag_status_t enumeration type value. + * @arg Set: At least one of the specified flags is set. + * @arg Reset: The specified flags are not set. + */ +en_flag_status_t ADC_SeqGetStatus(const M4_ADC_TypeDef *ADCx, uint8_t u8Flag) +{ + en_flag_status_t enRet = Reset; + + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + + if (READ_REG8_BIT(ADCx->ISR, (u8Flag & (uint8_t)ADC_SEQ_FLAG_ALL)) != 0U) + { + enRet = Set; + } + + return enRet; +} + +/** + * @brief Clear the status flag of the specified ADC unit's specified sequence. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [in] u8Flag Status flag type. + * This parameter can be values of @ref ADC_Sequence_Status_Flag + * @arg ADC_SEQ_FLAG_EOCA: Status flag of the end of conversion of sequence A. + * @arg ADC_SEQ_FLAG_EOCB: Status flag of the end of conversion of sequence B. + * @arg ADC_SEQ_FLAG_NESTED: Status flag of sequence A was interrupted by sequence B. + * @retval None + */ +void ADC_SeqClrStatus(M4_ADC_TypeDef *ADCx, uint8_t u8Flag) +{ + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + SET_REG8_BIT(ADCx->ISCLRR, (u8Flag & (uint8_t)ADC_SEQ_FLAG_ALL)); +} + +/** + * @brief Configures analog watchdog(AWD). + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [in] u8AWDx AWD unit that is going to be configured. + * This parameter can be a value of @ref ADC_AWD_Unit + * @arg ADC_AWD_0: AWD unit 0 of the specified ADC. + * @arg ADC_AWD_1: AWD unit 1 of the specified ADC. + * @param [in] pstcCfg Pointer to a stc_adc_awd_cfg_t structure value that + * contains the configuration information for the AWD. + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg ErrorInvalidParameter: pstcCfg == NULL. + */ +en_result_t ADC_AWD_Config(M4_ADC_TypeDef *ADCx, uint8_t u8AWDx, const stc_adc_awd_cfg_t *pstcCfg) +{ + uint32_t u32AwdCr; + uint32_t u32AwdDr0; + uint32_t u32AwdDr1; + uint32_t u32AwdChsr; + uint32_t u32Pos; + en_result_t enRet = ErrorInvalidParameter; + + if (pstcCfg != NULL) + { + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + DDL_ASSERT(IS_AWD_UNIT(u8AWDx)); + DDL_ASSERT(IS_AWD_CH_NUM(pstcCfg->u8ChNum)); + DDL_ASSERT(IS_AWD_CMP_MODE(pstcCfg->u16CmpMode)); + + u32Pos = ((uint32_t)u8AWDx << 2U) + ADC_AWDCR_AWD0MD_POS; + u32AwdCr = (uint32_t)&ADCx->AWDCR; + u32AwdDr0 = (uint32_t)&ADCx->AWD0DR0; + u32AwdDr1 = (uint32_t)&ADCx->AWD0DR1; + u32AwdChsr = (uint32_t)&ADCx->AWD0CHSR; + + BIT_BAND(u32AwdCr, u32Pos) = (uint32_t)pstcCfg->u16CmpMode; + ADC_AWDx_DR(u32AwdDr0, u8AWDx) = pstcCfg->u16LowerLimit; + ADC_AWDx_DR(u32AwdDr1, u8AWDx) = pstcCfg->u16UpperLimit; + ADC_AWDx_CHSR(u32AwdChsr, u8AWDx) = pstcCfg->u8ChNum; + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Enable or disable combination mode of analog watchdog(AWD). + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [in] u16CombMode Combination mode of analog watchdog. + * This parameter can be a value of @ref ADC_AWD_Combination_Mode + * @arg ADC_AWD_COMB_OR: The status of AWD0 is set or the status of AWD1 is set, the status of combination mode is set. + * @arg ADC_AWD_COMB_AND: The status of AWD0 is set and the status of AWD1 is set, the status of combination mode is set. + * @arg ADC_AWD_COMB_XOR: Only one of the status of AWD0 and AWD1 is set, the status of combination mode is set. + * @param [in] enNewState: An en_functional_state_t value. + * @arg Enable: Enable the combination mode of specified ADC unit's AWD. + * @arg Disable: Disable the combination mode of specified ADC unit's AWD. + * @retval None + */ +void ADC_AWD_CombModeCmd(M4_ADC_TypeDef *ADCx, uint16_t u16CombMode, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + DDL_ASSERT(IS_AWD_COMB_MODE(u16CombMode)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + CLEAR_REG16_BIT(ADCx->AWDCR, ADC_AWD_COMB_MODE_MSK); + if (enNewState == Enable) + { + SET_REG16_BIT(ADCx->AWDCR, u16CombMode); + } +} + +/** + * @brief Enable or disable the specified analog watchdog(AWD). + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [in] u8AWDx AWD unit that is going to be enabled or disabled. + * This parameter can be a value of @ref ADC_AWD_Unit + * @arg ADC_AWD_0: AWD unit 0 of the specified ADC. + * @arg ADC_AWD_1: AWD unit 1 of the specified ADC. + * @param [in] enNewState: An en_functional_state_t value. + * @arg Enable: Enable the specified AWD. + * @arg Disable: Disable the specified AWD. + * @retval None + */ +void ADC_AWD_Cmd(M4_ADC_TypeDef *ADCx, uint8_t u8AWDx, en_functional_state_t enNewState) +{ + uint32_t u32Addr; + uint32_t u32Pos; + + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + DDL_ASSERT(IS_AWD_UNIT(u8AWDx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32Pos = ((uint32_t)u8AWDx << 2U) + ADC_AWDCR_AWD0EN_POS; + u32Addr = (uint32_t)&ADCx->AWDCR; + BIT_BAND(u32Addr, u32Pos) = (uint32_t)enNewState; +} + +/** + * @brief Enable or disable the specified analog watchdog's interrupt. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [in] u8AWDx AWD unit. + * This parameter can be a value of @ref ADC_AWD_Unit + * @arg ADC_AWD_0: AWD unit 0 of the specified ADC. + * @arg ADC_AWD_1: AWD unit 1 of the specified ADC. + * @param [in] enNewState: An en_functional_state_t value. + * @arg Enable: Enable the specified AWD's interrupt. + * @arg Disable: Disable the specified AWD's interrupt. + * @retval None + */ +void ADC_AWD_IntCmd(M4_ADC_TypeDef *ADCx, uint8_t u8AWDx, en_functional_state_t enNewState) +{ + uint32_t u32Addr; + uint32_t u32Pos; + + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + DDL_ASSERT(IS_AWD_UNIT(u8AWDx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32Pos = ((uint32_t)u8AWDx << 2U) + ADC_AWDCR_AWD0IEN_POS; + u32Addr = (uint32_t)&ADCx->AWDCR; + BIT_BAND(u32Addr, u32Pos) = (uint32_t)enNewState; +} + +/** + * @brief Get the analog watchdog's flag status of the specified ADC unit. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [in] u8Flag AWD status flag type. + * This parameter can be values of @ref ADC_AWD_Status_Flag + * @arg ADC_AWD_FLAG_AWD0: Flag of AWD0. + * @arg ADC_AWD_FLAG_AWD1: Flag of AWD1. + * @arg ADC_AWD_FLAG_COMB: Flag of combination mode. + * @retval An en_flag_status_t enumeration type value. + * @arg Set: At least one of the specified flags is set. + * @arg Reset: The specified flags are not set. + */ +en_flag_status_t ADC_AWD_GetStatus(const M4_ADC_TypeDef *ADCx, uint8_t u8Flag) +{ + en_flag_status_t enRet = Reset; + + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + + if (READ_REG8_BIT(ADCx->AWDSR, (u8Flag & (uint8_t)ADC_AWD_FLAG_ALL)) != 0U) + { + enRet = Set; + } + + return enRet; +} + +/** + * @brief Clear the analog watchdog's flag status of the specified ADC unit. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [in] u8Flag AWD status flag type. + * This parameter can be values of @ref ADC_AWD_Status_Flag + * @arg ADC_AWD_FLAG_AWD0: Flag of AWD0. + * @arg ADC_AWD_FLAG_AWD1: Flag of AWD1. + * @arg ADC_AWD_FLAG_COMB: Flag of combination mode. + * @retval None + */ +void ADC_AWD_ClrStatus(M4_ADC_TypeDef *ADCx, uint8_t u8Flag) +{ + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + u8Flag &= (uint8_t)ADC_AWD_FLAG_ALL; + SET_REG8_BIT(ADCx->AWDSCLRR, u8Flag); +} + +/** + * @brief Configures the specified programmable gain amplifier(PGA). + * @param [in] u8PGAx The PGA unit that is going to be configured. + * This parameter can be a value of @ref ADC_PGA_Unit + * @arg ADC_PGA_1: PGA1, belongs to ADC1. Input pin is ADC123_IN0. + * @arg ADC_PGA_2: PGA2, belongs to ADC1. Input pin is ADC123_IN1. + * @arg ADC_PGA_3: PGA3, belongs to ADC1. Input pin is ADC123_IN2. + * @arg ADC_PGA_4: PGA4, belongs to ADC2. Input pin is ADC12_IN7. + * @param [in] u8GainFactor Gain factor for the specified PGA. + * This parameter can be a value of @ref ADC_PGA_Gain_Factor + * @arg ADC_PGA_GAIN_2: PGA gain factor is 2. + * @arg ADC_PGA_GAIN_2P133: PGA gain factor is 2.133. + * @arg ADC_PGA_GAIN_2P286: PGA gain factor is 2.286. + * @arg ADC_PGA_GAIN_2P667: PGA gain factor is 2.667. + * @arg ADC_PGA_GAIN_2P909: PGA gain factor is 2.909. + * @arg ADC_PGA_GAIN_3P2: PGA gain factor is 3.2. + * @arg ADC_PGA_GAIN_3P556: PGA gain factor is 2.556. + * @arg ADC_PGA_GAIN_4: PGA gain factor is 4. + * @arg ADC_PGA_GAIN_4P571: PGA gain factor is 4.571. + * @arg ADC_PGA_GAIN_5P333: PGA gain factor is 5.333. + * @arg ADC_PGA_GAIN_6P4: PGA gain factor is 6.4. + * @arg ADC_PGA_GAIN_8: PGA gain factor is 8. + * @arg ADC_PGA_GAIN_10P667: PGA gain factor is 10.667. + * @arg ADC_PGA_GAIN_16: PGA gain factor is 16. + * @arg ADC_PGA_GAIN_32: PGA gain factor is 32. + * @param [in] u8PgaVss VSS for the specified PGA. + * This parameter can be a value of @ref ADC_PGA_VSS + * @arg ADC_PGA_VSS_PGAVSS: Use pin PGA123_VSS as the reference GND of PGA1, PGA2 and PGA3. + * @arg ADC_PGA_VSS_AVSS: Use AVSS as the reference GND of PGA1, PGA2 and PGA3. + * @retval None + */ +void ADC_PGA_Config(uint8_t u8PGAx, uint8_t u8GainFactor, uint8_t u8PgaVss) +{ + uint32_t u32Addr; + uint32_t u32PGACRAddr; + M4_ADC_TypeDef *ADCx; + uint32_t au32AdcBase[] = {ADC1_BASE, ADC1_BASE, ADC1_BASE, ADC2_BASE}; + + DDL_ASSERT(IS_PGA_GAIN(u8GainFactor)); + DDL_ASSERT(IS_PGA_VSS(u8PgaVss)); + DDL_ASSERT(IS_PGA_UNIT(u8PGAx)); + + ADCx = (M4_ADC_TypeDef *)au32AdcBase[u8PGAx]; + u8PGAx %= 3U; + u32PGACRAddr = (uint32_t)&ADCx->PGACR1 + u8PGAx; + MODIFY_REG8(RW_MEM8(u32PGACRAddr), ADC_PGA_GAIN_MSK, u8GainFactor); + u32Addr = (uint32_t)&ADCx->PGAVSSENR; + BIT_BAND(u32Addr, u8PGAx) = (uint32_t)u8PgaVss; +} + +/** + * @brief Enable the specified programmable gain amplifier(PGA). + * @param [in] u8PGAx The PGA unit which is going to be enabled or disabled. + * This parameter can be a value of @ref ADC_PGA_Unit + * @arg ADC_PGA_1: PGA1, belongs to ADC1. Input pin is ADC123_IN0. + * @arg ADC_PGA_2: PGA2, belongs to ADC1. Input pin is ADC123_IN1. + * @arg ADC_PGA_3: PGA3, belongs to ADC1. Input pin is ADC123_IN2. + * @arg ADC_PGA_4: PGA4, belongs to ADC2. Input pin is ADC12_IN7. + * @param [in] enNewState: An en_functional_state_t value. + * @arg Enable: Enable the specified PGA. + * @arg Disable: Disable the specified PGA. + * @retval None + */ +void ADC_PGA_Cmd(uint8_t u8PGAx, en_functional_state_t enNewState) +{ + uint32_t u32PGACRAddr; + M4_ADC_TypeDef *ADCx; + uint32_t au32AdcBase[] = {ADC1_BASE, ADC1_BASE, ADC1_BASE, ADC2_BASE}; + uint8_t au8Cmd[] = {ADC_PGA_DISABLE, ADC_PGA_ENABLE}; + + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_PGA_UNIT(u8PGAx)); + + ADCx = (M4_ADC_TypeDef *)au32AdcBase[u8PGAx]; + u8PGAx %= 3U; + u32PGACRAddr = (uint32_t)&ADCx->PGACR1 + u8PGAx; + MODIFY_REG8(RW_MEM8(u32PGACRAddr), ADC_PGA_CMD_MSK, au8Cmd[(uint8_t)enNewState]); +} + +/** + * @brief Configures synchronous mode. + * @param [in] u16SyncUnit Specify the ADC units which work synchronously. + * This parameter can be a value of @ref ADC_Synchronous_Unit + * @arg ADC_SYNC_ADC1_ADC2: ADC1 and ADC2 work synchronously. + * @arg ADC_SYNC_ADC1_ADC2_ADC3: ADC1, ADC2 and ADC3 work synchronously. + * @param [in] u16SyncMode Synchronous mode. + * This parameter can be a value of @ref ADC_Synchronous_Mode + * @arg ADC_SYNC_SSHOT_SEQUENTIAL: Single shot trigger, sequentially trigger. \ + * When the trigger condition occurs, ADC1 starts before ADC2, \ + * and ADC1 and ADC2 only perform one sample conversion. + * @arg ADC_SYNC_SSHOT_SIMULTANEOUS: Single shot trigger, simultaneously trigger. \ + * When the trigger condition occurs, ADC1 and ADC2 start at the same time, \ + * and ADC1 and ADC2 only perform one sample conversion. + * @arg ADC_SYNC_CONT_SEQUENTIAL: Continuously trigger, sequentially trigger. \ + * When the trigger condition occurs, ADC1 starts before ADC2, \ + * and ADC1 and ADC2 will continue to sample conversion until stopped by software. + * @arg ADC_SYNC_CONT_SIMULTANEOUS: Continuously trigger, simultaneously trigger. \ + * When the trigger condition occurs, ADC1 and ADC2 start at the same time, \ + * and ADC1 and ADC2 will continue to sample conversion until stopped by software. + * @param [in] u8TrigDelay Trigger delay time(PCLK2 cycle), range is [1, 255]. + * @retval None + */ +void ADC_SYNC_Config(uint16_t u16SyncUnit, uint16_t u16SyncMode, uint8_t u8TrigDelay) +{ + DDL_ASSERT(IS_ADC_SYNC_UNIT(u16SyncUnit)); + DDL_ASSERT(IS_ADC_SYNC_MODE(u16SyncMode)); + DDL_ASSERT(IS_ADC_SYNC_TRIG_DLY(u8TrigDelay)); + + u16SyncMode |= ((uint16_t)((uint32_t)u8TrigDelay << ADC_SYNCCR_SYNCDLY_POS)) | u16SyncUnit; + MODIFY_REG16(M4_ADC1->SYNCCR, ADC_SYNC_CFG_MSK, u16SyncMode); +} + +/** + * @brief Enable or disable synchronous mode. + * @param [in] enNewState: An en_functional_state_t value. + * @arg Enable: Enable synchronous mode. + * @arg Disable: Disable synchronous mode. + * @retval None + */ +void ADC_SYNC_Cmd(en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + WRITE_REG32(bM4_ADC1->SYNCCR_b.SYNCEN, enNewState); +} + +/** + * @brief Configures sample-hold. Specifies the sample time of sample-hold. + * @param [in] u8SplTime Sample time(ADCLK cycles) for sample-hold. \ + * It should be more than 0.4 microseconds. + * @retval None + */ +void ADC_SH_Config(uint8_t u8SplTime) +{ + MODIFY_REG16(M4_ADC1->SHCR, ADC_SH_CFG_MSK, u8SplTime); +} + +/** + * @brief Enable or disable sample-hold channels. + * @param [in] u32AdcCh ADC channels. + * This parameter be values of the following that from @ref ADC_Channel + * @arg ADC_CH0: Channel 0 of ADC1. + * @arg ADC_CH1: Channel 1 of ADC1. + * @arg ADC_CH2: Channel 2 of ADC1. + * @param [in] enNewState: An en_functional_state_t value. + * @arg Enable: Enable the specified sample-hold channels. + * @arg Disable: Disable the specified sample-hold channels. + * @retval None + */ +void ADC_SH_ChannelCmd(uint32_t u32AdcCh, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_ADC_BIT_MSK(u32AdcCh, ADC_CH0|ADC_CH1|ADC_CH2)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32AdcCh <<= ADC_SHCR_SHSEL_POS; + if (enNewState == Enable) + { + SET_REG16_BIT(M4_ADC1->SHCR, u32AdcCh); + } + else + { + CLEAR_REG16_BIT(M4_ADC1->SHCR, u32AdcCh); + } +} + +/** + * @brief Remap the correspondence between ADC channels and analog input pins. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [in] u32AdcCh This parameter be values of the following that from @ref ADC_Channel + * @arg ADC_CH0 ~ ADC_CH15 For all of ADC units. + * @param [in] u8AdcPinNum This parameter be a value of @ref ADC_Pin_Number + * @arg ADC123_xxx: Pin number belongs to all of ADC units. + * @arg ADC12_xxx: Pin number belongs to ADC1 and ADC2. + * @arg ADC3_xxx: Pin number belongs to ADC3. + * @note The pin number is from 0 to 15 can be remaped. + * @retval None + */ +void ADC_ChannelRemap(M4_ADC_TypeDef *ADCx, uint32_t u32AdcCh, uint8_t u8AdcPinNum) +{ + uint8_t u8FieldOfs; + uint32_t u32RegIdx; + uint32_t u32CHMUXRAddr; + uint32_t u32ChNum = 0U; + + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + DDL_ASSERT(IS_ADC_REMAP_PIN_NUM(u8AdcPinNum)); + DDL_ASSERT(IS_ADC_BIT_MSK(u32AdcCh, ADC_CH_REMAP_ALL)); + + u32CHMUXRAddr = (uint32_t)&ADCx->CHMUXR0; + while (u32AdcCh != 0U) + { + if ((u32AdcCh & 0x1UL) != 0U) + { + u32RegIdx = u32ChNum / 4U; + u8FieldOfs = (uint8_t)((u32ChNum % 4U) << 2U); + MODIFY_REG16(RW_MEM16(u32CHMUXRAddr + u32RegIdx * 2U), \ + ((uint32_t)ADC_CH_MAP_PIN_MSK << u8FieldOfs), \ + ((uint32_t)u8AdcPinNum << u8FieldOfs)); + } + + u32AdcCh >>= 1U; + u32ChNum++; + } +} + +/** + * @brief Get the number of the analog input pin corresponding to the specified ADC unit's channel. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [in] u32AdcCh ADC channel. + * This parameter can be one of the following values of @ref ADC_Channel + * @arg ADC_CH0 ~ ADC_CH15 + * @retval An uint8_t type value of ADC pin number that corresponding to the specified channel number. + * This parameter can be one of the following values of @ref ADC_Pin_Number + * @arg ADC123_xxx: Pin number belongs to all of ADC units. + * @arg ADC12_xxx: Pin number belongs to ADC1 and ADC2. + * @arg ADC3_xxx: Pin number belongs to ADC3. + */ +uint8_t ADC_GetChannelPinNum(const M4_ADC_TypeDef *ADCx, uint32_t u32AdcCh) +{ + uint32_t u32RegIdx; + uint32_t u32CHMUXRAddr; + uint32_t u32ChNum = 0U; + uint8_t u8RetPinNum; + uint8_t u8FieldOfs; + + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + DDL_ASSERT(IS_ADC_BIT_MSK(u32AdcCh, ADC_CH_REMAP_ALL)); + DDL_ASSERT(IS_ADC_1_BIT_MSK(u32AdcCh)); + + while ((u32AdcCh & (1UL << u32ChNum)) == 0U) + { + u32ChNum++; + } + + u32RegIdx = u32ChNum / 4U; + u8FieldOfs = (uint8_t)((u32ChNum % 4U) << 2U); + u32CHMUXRAddr = (uint32_t)&ADCx->CHMUXR0 + (u32RegIdx * 2U); + u8RetPinNum = (uint8_t)((RW_MEM16(u32CHMUXRAddr) >> u8FieldOfs) & 0xFU); + + return u8RetPinNum; +} + +/** + * @brief Basic usage of ADC sampling. Get the ADC values of the pins + * corresponding to the channels enabled in sequence A. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [out] pu16AdcVal Pointer to an uint16_t type memory which the ADC values to be stored. + * The location of the value store depends on the parameter u8Length. + * u8Length >= ADCx_CH_COUNT, all of the ADC data registers will be read: + * pu16AdcVal[0] = value of Channel 0, + * pu16AdcVal[1] = value of Channel 1, + * pu16AdcVal[2] = value of Channel 2, + * ... + * u8Length < ADCx_CH_COUNT(ADC1_CH_COUNT or ADC2_CH_COUNT), + * only the value of the enabled channels will be read: + * pu16AdcVal[0] = value of the 1st enabled channel, + * pu16AdcVal[1] = value of the 2nd enabled channel, + * pu16AdcVal[2] = value of the 3rd enabled channel, + * @param [in] u8Length The length of the ADC value to be got. + * @param [in] u32Timeout Timeout value(millisecond). + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg ErrorInvalidParameter: -pu16AdcVal == NULL. + * -u8Length == 0. + * -u32Timeout == 0. + * -The base address of 'pu16AdcVal' is not 2-byte aligned. + */ +en_result_t ADC_PollingSA(M4_ADC_TypeDef *ADCx, uint16_t pu16AdcVal[], uint8_t u8Length, uint32_t u32Timeout) +{ + uint32_t u32Ch; + uint32_t u32TimeCnt; + uint8_t au8DrLen[ADC_UNIT_COUNT] = {ADC1_CH_COUNT, ADC2_CH_COUNT, ADC3_CH_COUNT}; + en_result_t enRet = ErrorInvalidParameter; + + if ((pu16AdcVal != NULL) && \ + (u8Length != 0U) && (u32Timeout != 0U) && \ + IS_ADDRESS_ALIGN_HALFWORD(&pu16AdcVal[0U])) + { + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + + u32TimeCnt = u32Timeout * (HCLK_VALUE / 10U / 1000U); + enRet = ErrorTimeout; + /* Start ADC.*/ + WRITE_REG8(ADCx->STR, ADC_STR_STRT); + while (u32TimeCnt-- != 0U) + { + if (READ_REG8_BIT(ADCx->ISR, ADC_SEQ_FLAG_EOCA) != 0U) + { + if (u8Length < au8DrLen[ADC_IDX(ADCx)]) + { + u32Ch = ADCx->CHSELRA; + (void)ADC_GetChannelData(ADCx, u32Ch, pu16AdcVal, u8Length); + } + else + { + (void)ADC_GetAllData(ADCx, pu16AdcVal, u8Length); + } + /* Clear EOC flag. */ + SET_REG8_BIT(ADCx->ISCLRR, ADC_ISCLRR_CLREOCAF); + enRet = Ok; + break; + } + } + if (enRet != Ok) + { + /* Stop ADC if timeout. */ + WRITE_REG8(ADCx->STR, 0U); + } + } + + return enRet; +} + +/** + * @brief Start the specified ADC unit. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @retval None + */ +void ADC_Start(M4_ADC_TypeDef *ADCx) +{ + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + WRITE_REG8(ADCx->STR, ADC_STR_STRT); +} + +/** + * @brief Stop the specified ADC unit. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @retval None + */ +void ADC_Stop(M4_ADC_TypeDef *ADCx) +{ + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + WRITE_REG8(ADCx->STR, 0U); +} + +/** + * @brief Get all of the channels' value of the specified ADC unit. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [out] pu16AdcVal Pointer to an uint16_t type memory which the ADC values to be stored. + * pu16AdcVal[0] = value of Channel 0, + * pu16AdcVal[1] = value of Channel 1, + * pu16AdcVal[2] = value of Channel 2, + * @param [in] u8Length The length of the ADC value to be got. + * It CAN NOT be less than the number of channels of the ADC unit. + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg ErrorInvalidParameter: -pu16AdcVal == NULL. + * -The base address of 'pu16AdcVal' is not 2-byte aligned. + */ +en_result_t ADC_GetAllData(const M4_ADC_TypeDef *ADCx, uint16_t pu16AdcVal[], uint8_t u8Length) +{ + uint8_t u8AdcIdx; + uint32_t i; + uint32_t u32DRAddr; + uint8_t au8DrLen[ADC_UNIT_COUNT] = {ADC1_CH_COUNT, ADC2_CH_COUNT, ADC3_CH_COUNT}; + en_result_t enRet = ErrorInvalidParameter; + + if ((pu16AdcVal != NULL) && IS_ADDRESS_ALIGN_HALFWORD(&pu16AdcVal[0U])) + { + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + + u8AdcIdx = ADC_IDX(ADCx); + DDL_ASSERT(u8Length >= au8DrLen[u8AdcIdx]); + + if (u8Length > au8DrLen[u8AdcIdx]) + { + u8Length = au8DrLen[u8AdcIdx]; + } + u32DRAddr = (uint32_t)&ADCx->DR0; + for (i=0U; iDR0; + while ((u32TargetCh != 0U) && (u8Length != 0U)) + { + if ((u32TargetCh & 0x1UL) != 0U) + { + pu16AdcVal[j++] = RW_MEM16(u32DRAddr + i * 2U); + u8Length--; + } + u32TargetCh >>= 1U; + i++; + } + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Get a specified channel's value of the specified ADC unit. + * @param [in] ADCx Pointer to ADC instance register base. + * This parameter can be a value of the following: + * @arg M4_ADC1: ADC unit 1 instance register base. + * @arg M4_ADC2: ADC unit 2 instance register base. + * @arg M4_ADC3: ADC unit 3 instance register base. + * @param [in] u8ChNum The index number of ADC channel. + * The following parameters that from @ref ADC_Channel_Number can be used: + * @arg ADC_CH_NUM_0 ~ ADC_CH_NUM_15: For ADC1 and ADC2. + * @arg ADC_CH_NUM_0 ~ ADC_CH_NUM_19: For ADC3. + * @retval An uint16_t type value between 0 ~ 4095. + */ +uint16_t ADC_GetValue(const M4_ADC_TypeDef *ADCx, uint8_t u8ChNum) +{ + uint32_t u32DRAddr; +#ifdef __DEBUG + uint8_t au8DrLen[ADC_UNIT_COUNT] = {ADC1_CH_COUNT, ADC2_CH_COUNT, ADC3_CH_COUNT}; + DDL_ASSERT(u8ChNum < au8DrLen[ADC_IDX(ADCx)]); +#endif + DDL_ASSERT(IS_ADC_UNIT(ADCx)); + + u32DRAddr = (uint32_t)&ADCx->DR0 + ((uint32_t)u8ChNum * 2U); + return RW_MEM16(u32DRAddr); +} + +/** + * @} + */ + +#endif /* DDL_ADC_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_aes.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_aes.c new file mode 100644 index 0000000000..7f9c0efc3a --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_aes.c @@ -0,0 +1,376 @@ +/** + ******************************************************************************* + * @file hc32f4a0_aes.c + * @brief This file provides firmware functions to manage the Advanced Encryption + * Standard(AES). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Heqb First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_aes.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_AES AES + * @brief AES Driver Library + * @{ + */ + +#if (DDL_AES_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup AES_Local_Macros AES Local Macros + * @{ + */ +/* Delay count for timeout */ +#define AES_TIMEOUT (30000UL) + +/** + * @defgroup AES_KEY_LENGTH AES key length in bytes + * @{ + */ +#define AES_KEY_LEN_128BIT (16U) +#define AES_KEY_LEN_192BIT (24U) +#define AES_KEY_LEN_256BIT (32U) +/** + * @} + */ + +/** + * @defgroup AES_Check_Parameters_Validity AES Check Parameters Validity + * @{ + */ +#define IS_AES_KEYLENGTH(x) \ +( ((x) == AES_KEY_LEN_128BIT) || \ + ((x) == AES_KEY_LEN_192BIT) || \ + ((x) == AES_KEY_LEN_256BIT)) +/** + * @} + */ +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ +static void AES_WriteData(const uint8_t *pu8Srcdata); +static void AES_ReadData(const uint8_t *pu8Result); +static void AES_WriteKey(const uint8_t *pu8Key, uint8_t u8KeyLength); + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup AES_Global_Functions AES Global Functions + * @{ + */ + +/** + * @brief AES encryption. + * @param [in] au8Plaintext Buffer of the plaintext(the source data which will be encrypted). + * @param [in] u32PlaintextSize Length of plaintext in bytes. + * @param [in] pu8Key Pointer to the AES key. + * @param [in] u8KeyLength Buffer of the key in bytes. + * @param [out] au8Ciphertext Buffer of the ciphertext. + * @retval An en_result_t enumeration value: + * Ok: Encryption successfully. + * ErrorInvalidParameter: Invalid parameter + * ErrorTimeout: Encryption error timeout + */ +en_result_t AES_Encrypt(uint8_t au8Plaintext[], + uint32_t u32PlaintextSize, + const uint8_t *pu8Key, + uint8_t u8KeyLength, + uint8_t au8Ciphertext[]) +{ + en_result_t enRet = ErrorInvalidParameter; + uint32_t u32TimeCount = 0UL; + uint32_t u32Index = 0UL; + uint8_t au8FillBuffer[16U] = {0U}; + if((au8Plaintext != NULL) && (u32PlaintextSize != 0UL) \ + && (pu8Key != NULL) && (u8KeyLength != 0U) \ + && (au8Ciphertext != NULL)) + { + DDL_ASSERT(IS_AES_KEYLENGTH(u8KeyLength)); + enRet = Ok; + while(u32PlaintextSize > 0UL) + { + /* Wait for AES to stop */ + while(READ_REG32_BIT(M4_AES->CR, AES_CR_START) == 1U) + { + if(u32TimeCount++ >= AES_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + if (enRet == Ok) + { + if (u32PlaintextSize >= AES_BLOCK_LEN) + { + AES_WriteData(&au8Plaintext[u32Index]); + } + else + { + (void)memcpy(au8FillBuffer, &au8Plaintext[u32Index], u32PlaintextSize); + AES_WriteData(&au8FillBuffer[0U]); + } + AES_WriteKey(pu8Key, u8KeyLength); + switch (u8KeyLength) + { + case AES_KEY_LEN_128BIT: + MODIFY_REG32(M4_AES->CR, AES_CR_KEYSIZE, AES_KEY_SIZE_128BIT); + break; + + case AES_KEY_LEN_192BIT: + MODIFY_REG32(M4_AES->CR, AES_CR_KEYSIZE, AES_KEY_SIZE_192BIT); + break; + + case AES_KEY_LEN_256BIT: + MODIFY_REG32(M4_AES->CR, AES_CR_KEYSIZE, AES_KEY_SIZE_256BIT); + break; + + default: + break; + } + /* Set AES encrypt. */ + CLEAR_REG32_BIT(M4_AES->CR, AES_CR_MODE); + /* Start AES calculating. */ + SET_REG32_BIT(M4_AES->CR, AES_CR_START); + /* Wait for AES to stop */ + u32TimeCount = 0UL; + while(READ_REG32_BIT(M4_AES->CR, AES_CR_START) == 1U) + { + if(u32TimeCount++ > AES_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + if (enRet == Ok) + { + AES_ReadData(&au8Ciphertext[u32Index]); + if (u32PlaintextSize < AES_BLOCK_LEN) + { + u32PlaintextSize = 0UL; + } + else + { + u32PlaintextSize -= AES_BLOCK_LEN; + } + u32Index += AES_BLOCK_LEN; + } + } + } + } + return enRet; +} + +/** + * @brief AES decryption. + * @param [in] au8Ciphertext Buffer of the Ciphertext(the source data which will be decrypted). + * @param [in] u32CiphertextSize Length of ciphertext in bytes. + * @param [in] pu8Key Pointer to the AES key. + * @param [in] u8KeyLength Length of key in bytes. + * @param [out] au8Plaintext Buffer of the plaintext. + * @retval An en_result_t enumeration value: + * Ok: Decryption successfully. + * ErrorInvalidParameter: Invalid parameter + * ErrorTimeout: Decryption error timeout + */ +en_result_t AES_Decrypt(uint8_t au8Ciphertext[], + uint32_t u32CiphertextSize, + const uint8_t *pu8Key, + uint8_t u8KeyLength, + uint8_t au8Plaintext[]) +{ + en_result_t enRet = Ok; + uint32_t u32TimeCount = 0UL; + uint32_t u32Index = 0UL; + if((au8Plaintext != NULL) && (u32CiphertextSize != 0UL) \ + && (pu8Key != NULL) && (u8KeyLength != 0U) \ + && (au8Ciphertext != NULL)) + { + DDL_ASSERT(IS_AES_KEYLENGTH(u8KeyLength)); + enRet = Ok; + while(u32CiphertextSize > 0UL) + { + /* Wait for AES to stop */ + while(READ_REG32_BIT(M4_AES->CR, AES_CR_START) == 1U) + { + if(u32TimeCount++ > AES_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + if (enRet == Ok) + { + AES_WriteData(&au8Ciphertext[u32Index]); + AES_WriteKey(pu8Key, u8KeyLength); + switch (u8KeyLength) + { + case AES_KEY_LEN_128BIT: + MODIFY_REG32(M4_AES->CR, AES_CR_KEYSIZE, AES_KEY_SIZE_128BIT); + break; + + case AES_KEY_LEN_192BIT: + MODIFY_REG32(M4_AES->CR, AES_CR_KEYSIZE, AES_KEY_SIZE_192BIT); + break; + + case AES_KEY_LEN_256BIT: + MODIFY_REG32(M4_AES->CR, AES_CR_KEYSIZE, AES_KEY_SIZE_256BIT); + break; + + default: + break; + } + /* Set AES decrypt. */ + SET_REG32_BIT(M4_AES->CR, AES_CR_MODE); + /* Start AES calculating. */ + SET_REG32_BIT(M4_AES->CR, AES_CR_START); + /* Wait for AES to stop */ + u32TimeCount = 0UL; + while(READ_REG32_BIT(M4_AES->CR, AES_CR_START) == 1UL) + { + if(u32TimeCount++ >= AES_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + if (enRet == Ok) + { + AES_ReadData(&au8Plaintext[u32Index]); + u32CiphertextSize -= AES_BLOCK_LEN; + u32Index += AES_BLOCK_LEN; + } + } + } + } + return enRet; +} + +/** + * @brief Write the input buffer in data register. + * @param [in] pu8Srcdata Point to the source data buffer. + * @retval None + */ +static void AES_WriteData(const uint8_t *pu8Srcdata) +{ + uint8_t i; + uint32_t u32DrAddr = (uint32_t)&(M4_AES->DR0); + uint32_t u32SrcAddr = (uint32_t)pu8Srcdata; + + for(i = 0U; i < 4U; i++) + { + RW_MEM32(u32DrAddr) = RW_MEM32(u32SrcAddr); + u32SrcAddr += 4UL; + u32DrAddr += 4UL; + } +} + +/** + * @brief Read the from data register. + * @param [out] pu8Result Point to the result buffer. + * @retval None + */ +static void AES_ReadData(const uint8_t *pu8Result) +{ + uint8_t i; + uint32_t u32DrAddr = (uint32_t)&(M4_AES->DR0); + uint32_t u32ResultAddr = (uint32_t)pu8Result; + for(i = 0U; i < 4U; i++) + { + RW_MEM32(u32ResultAddr) = RW_MEM32(u32DrAddr); + u32DrAddr += 4U; + u32ResultAddr += 4UL; + } +} + +/** + * @brief Write the input buffer in key register. + * @param [in] pu8Key Pointer to the kry buffer. + * @param [in] u8KeyLength Length of key in bytes. + * @retval None + */ +static void AES_WriteKey(const uint8_t *pu8Key, uint8_t u8KeyLength) +{ + uint8_t i; + uint8_t Length = 0U; + uint32_t u32KeyAddr = (uint32_t)&(M4_AES->KR0); + uint32_t u32DataAddr = (uint32_t)pu8Key; + switch (u8KeyLength) + { + case AES_KEY_LEN_128BIT: + Length = 4U; + break; + case AES_KEY_LEN_192BIT: + Length = 6U; + break; + case AES_KEY_LEN_256BIT: + Length = 8U; + break; + default: + break; + } + for(i = 0U; i < Length; i++) + { + RW_MEM32(u32KeyAddr) = RW_MEM32(u32DataAddr); + u32DataAddr += 4UL; + u32KeyAddr += 4UL; + } +} +/** + * @} + */ + +#endif /* DDL_AES_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ + diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_can.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_can.c new file mode 100644 index 0000000000..d8160d9f4e --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_can.c @@ -0,0 +1,2107 @@ +/** + ******************************************************************************* + * @file hc32f4a0_can.c + * @brief This file provides firmware functions to manage the CAN. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Wuze First version + 2020-08-10 Wuze Refined CAN_GetStatusVal() + 2020-12-14 Wuze 1. Fixed a bug of CAN_TTC_TransData(); Refined CAN_SBTConfig() + 2. Modified comment of structure stc_can_bt_cfg_t + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_can.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_CAN CAN + * @brief CAN Driver Library + * @{ + */ + +#if (DDL_CAN_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup CAN_Local_Macros CAN Local Macros + * @{ + */ + +/** + * @defgroup CAN_Configuration_Bit_Mask CAN Configuration Bit Mask + * @{ + */ +#define CAN_LB_MODE_MSK (CAN_CFG_STAT_LBMI | CAN_CFG_STAT_LBME) +#define CAN_TRANS_MODE_MSK (CAN_CFG_STAT_TPSS | CAN_CFG_STAT_TSSS) +#define CAN_TTC_FLAG_CLR_MSK (CAN_TTC_FLAG_TTI | CAN_TTC_FLAG_WTI) +/** + * @} + */ + +/** + * @defgroup CAN_Register_Bit_Band CAN Register Bit Band + * @{ + */ +#define __BIT_BAND_BASE (0x42000000UL) +#define __PERIP_BASE (0x40000000UL) +#define __REG_OFS(regAddr) ((regAddr) - __PERIP_BASE) +#define __BIT_BAND_ADDR(regAddr, pos) ((__REG_OFS(regAddr) << 5U) + ((uint32_t)(pos) << 2U) + __BIT_BAND_BASE) +#define BIT_BAND(regAddr, pos) (*(__IO uint32_t *)__BIT_BAND_ADDR((regAddr), (pos))) +/** + * @} + */ + +/** + * @defgroup CAN_Check_Parameters_Validity CAN check parameters validity + * @{ + */ +#define IS_CAN_UNIT(x) \ +( ((x) == M4_CAN1) || \ + ((x) == M4_CAN2)) + +#define IS_CAN_SBT_SEG1(x) \ +( ((x) >= 2U) && \ + ((x) <= 65U)) + +#define IS_CAN_SBT_SEG2(x) \ +( ((x) >= 1U) && \ + ((x) <= 8U)) + +#define IS_CAN_FD_SBT_SEG2(x) \ +( ((x) >= 1U) && \ + ((x) <= 32U)) + +#define IS_CAN_SBT_SJW(x) \ +( ((x) >= 1U) && \ + ((x) <= 16U)) + +#define IS_CAN_SBT_PRESC(x) \ +( ((x) >= 1U) && \ + ((x) <= 256U)) + +#define IS_CAN_FBT_SEG1(x) \ +( ((x) >= 2U) && \ + ((x) <= 17U)) + +#define IS_CAN_FBT_SEG2(x) \ +( ((x) >= 1U) && \ + ((x) <= 8U)) + +#define IS_CAN_FBT_SJW(x) \ +( ((x) >= 1U) && \ + ((x) <= 8U)) + +#define IS_CAN_FBT_PRESC(x) \ +( ((x) >= 1U) && \ + ((x) <= 256U)) + +#define IS_CAN_SBT_PRIO_MODE(x) \ +( ((x) == CAN_STB_PRIO_FIFO) || \ + ((x) == CAN_STB_PRIO_ID)) + +#define IS_CAN_IDE(x) \ +( ((x) == 0U) || \ + ((x) == 1U)) + +#define IS_CAN_SELF_ACK_CMD(x) \ +( ((x) == CAN_SELF_ACK_DISABLE) || \ + ((x) == CAN_SELF_ACK_ENABLE)) + +#define IS_CAN_TB_TYPE(x) \ +( ((x) == CAN_BUF_PTB) || \ + ((x) == CAN_BUF_STB)) + +#define IS_CAN_STB_TX_CTRL(x) \ +( ((x) == CAN_STB_TRANS_ALL) || \ + ((x) == CAN_STB_TRANS_ONE)) + +#define IS_CAN_WORK_MODE(x) \ +( ((x) <= CAN_MODE_ELB_SILENT)) + +#define IS_CAN_TRANS_MODE(x) \ +( ((x) == CAN_TRANS_PTB_STB_AUTO_RETX) || \ + ((x) == CAN_TRANS_PTB_SSHOT) || \ + ((x) == CAN_TRANS_STB_SSHOT) || \ + ((x) == CAN_TRANS_PTB_STB_SSHOT)) + +#define IS_CAN_RB_STORE_SEL(x) \ +( ((x) == CAN_RB_STORE_CORRECT_DATA) || \ + ((x) == CAN_RB_STORE_ALL_DATA)) + +#define IS_CAN_RB_OVF_OP(x) \ +( ((x) == CAN_RB_OVF_SAVE_NEW) || \ + ((x) == CAN_RB_OVF_DISCARD_NEW)) + +#define IS_CAN_RBS_FULL_WARN_LIMIT(x) \ +( ((x) >= CAN_RBS_WARN_LIMIT_MIN) && \ + ((x) <= CAN_RBS_WARN_LIMIT_MAX)) + +#define IS_CAN_ERR_WARN_LIMIT(x) \ +( ((x) < 16U)) + +#define IS_CAN_AF_MSK_TYPE(x) \ +( ((x) == CAN_AF_MSK_STD_EXT) || \ + ((x) == CAN_AF_MSK_STD) || \ + ((x) == CAN_AF_MSK_EXT)) + +#define IS_CAN_1_BIT_MSK(x) \ +( ((x) != 0U) && \ + (((x) & ((x) - 1U)) == 0U)) + +#define IS_CAN_BIT_MSK(x, msk) \ +( ((x) != 0U) && \ + (((x) | (msk)) == (msk))) + +#define IS_CAN_FD_MODE(x) \ +( ((x) == CAN_FD_MODE_BOSCH) || \ + ((x) == CAN_FD_MODE_ISO_11898)) + +#define IS_CAN_FD_SSP(x) \ +( ((x) < 128U)) + +#define IS_CAN_TDC_CMD(x) \ +( ((x) == CAN_FD_TDC_DISABLE) || \ + ((x) == CAN_FD_TDC_ENABLE)) + +#define IS_CAN_TTC_TB_MODE(x) \ +( ((x) == CAN_TTC_TB_MODE_NORMAL) || \ + ((x) == CAN_TTC_TB_MODE_PTR)) + +#define IS_CAN_TTC_TBS(x) \ +( ((x) <= CAN_TTC_TBS_STB3)) + +#define IS_CAN_TTC_TRIG_TYPE(x) \ +( ((x) == CAN_TTC_TRIG_IMMED_TRIG) || \ + ((x) == CAN_TTC_TRIG_TIME_TRIG) || \ + ((x) == CAN_TTC_TRIG_SSHOT_TRANS_TRIG) || \ + ((x) == CAN_TTC_TRIG_TRANS_START_TRIG) || \ + ((x) == CAN_TTC_TRIG_TRANS_STOP_TRIG)) + +#define IS_CAN_TTC_NTU_PRESC(x) \ +( ((x) == CAN_TTC_NTU_PRESC_1) || \ + ((x) == CAN_TTC_NTU_PRESC_2) || \ + ((x) == CAN_TTC_NTU_PRESC_4) || \ + ((x) == CAN_TTC_NTU_PRESC_8)) + +#define IS_CAN_TTC_TX_EN_WINDOW(x) \ +( (x) <= 16U) + +/** + * @} + */ + +/** + * @defgroup CAN_Miscellaneous_Macros CAN Miscellaneous Macros + * @{ + */ +#define CAN_RBS_CNT (8U) /*!< Each CAN unit has 8 receive buffer slots. */ +#define CAN_RBS_WARN_LIMIT_MIN (1U) +#define CAN_RBS_WARN_LIMIT_MAX (CAN_RBS_CNT) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup CAN_Global_Functions CAN Global Functions + * @{ + */ + +/** + * @brief Initializes the specified CAN peripheral according to the specified parameters + * in the stc_can_init_t type structure. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] pstcInit Pointer to a stc_can_init_t structure value that + * contains the configuration information for the CAN. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcInit == NULL + */ +en_result_t CAN_Init(M4_CAN_TypeDef *CANx, const stc_can_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (pstcInit != NULL) + { +#ifdef __DEBUG + DDL_ASSERT(IS_FUNCTIONAL_STATE(pstcInit->enCANFDCmd)); + if (pstcInit->enCANFDCmd == Disable) + { + DDL_ASSERT(IS_CAN_SBT_SEG2(pstcInit->stcSBT.u32SEG2)); + } + else + { + DDL_ASSERT(IS_CAN_FD_SBT_SEG2(pstcInit->stcSBT.u32SEG2)); + } +#endif + /* Software reset. */ + CAN_SWReset(CANx); + /* Defines slow bit time. */ + (void)CAN_SBTConfig(CANx, &pstcInit->stcSBT); + /* Specifies STB priority mode. */ + CAN_SetSTBPrioMode(CANx, pstcInit->u8STBPrioMode); + /* Configures acceptance filters. */ + (void)CAN_AFConfig(CANx, pstcInit->u16AFSel, pstcInit->pstcAFCfg); + /* Configures CAN-FD if enabled. */ + CAN_FD_Cmd(CANx, Disable); + if (pstcInit->enCANFDCmd == Enable) + { + (void)CAN_FD_Config(CANx, &pstcInit->stcFDCfg); + CAN_FD_Cmd(CANx, Enable); + } + + /* CAN bus enters normal communication mode. */ + CAN_EnterNormalComm(CANx); + /* Specifies work mode. */ + CAN_SetWorkMode(CANx, pstcInit->u8WorkMode); + /* Specifies transmission mode. */ + CAN_SetTransMode(CANx, pstcInit->u8TransMode); + + CAN_SetRBStoreSel(CANx, pstcInit->u8RBStoreSel); + CAN_SetRBSWarnLimit(CANx, pstcInit->u8RBSWarnLimit); + CAN_SetErrWarnLimit(CANx, pstcInit->u8ErrWarnLimit); + /* Specifies the operation when receiving buffer overflow. */ + CAN_SetRBOvfOp(CANx, pstcInit->u8RBOvfOp); + /* Enable acceptance filters that configured before. */ + SET_REG16_BIT(CANx->ACFEN, pstcInit->u16AFSel); + + /* Enable or disable self-ACK. */ + DDL_ASSERT(IS_CAN_SELF_ACK_CMD(pstcInit->u8SelfACKCmd)); + MODIFY_REG8(CANx->RCTRL, CAN_RCTRL_SACK, pstcInit->u8SelfACKCmd); + + /* Clear all status flags. */ + CAN_ClrStatus(CANx, CAN_FLAG_ALL); + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set a default value for CAN initialization structure. \ + * Slow bit time configuration: + * Based on 40MHz CAN clock, TQ clock is CAN clock divided by 4. \ + * Bit rate 500Kbps, 1 bit time is 20TQs, sample point is 80%. + * CAN-FD bit time configuration: + * Based on 40MHz CAN clock, TQ clock is CAN clock divided by 1. \ + * Bit rate 2Mbps, 1 bit time is 20TQs, primary sample point is 80%, \ + * secondary sample point is 80%. + * @param [in] pstcInit Pointer to a stc_can_init_t structure value that + * contains the configuration information for the CAN unit. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcInit == NULL. + */ +en_result_t CAN_StructInit(stc_can_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (pstcInit != NULL) + { + pstcInit->u8WorkMode = CAN_MODE_NORMAL; + pstcInit->u8TransMode = CAN_TRANS_PTB_STB_AUTO_RETX; + pstcInit->u8STBPrioMode = CAN_STB_PRIO_FIFO; + pstcInit->u8RBSWarnLimit = 6U; + pstcInit->u8ErrWarnLimit = 7U; + pstcInit->u16AFSel = CAN_AF1; + pstcInit->u8RBStoreSel = CAN_RB_STORE_CORRECT_DATA; + pstcInit->u8RBOvfOp = CAN_RB_OVF_DISCARD_NEW; + pstcInit->u8SelfACKCmd = CAN_SELF_ACK_DISABLE; + pstcInit->pstcAFCfg = NULL; + /* + * Synchronization Segment(SS): Fixed as 1TQ + * Propagation Time Segment(PTS) and Phase Buffer Segment 1(PBS1): 15TQs + * Phase Buffer Segment 2(PBS2): 4TQs + * + * Field 'S_SEG_1' in register CAN_SBT contains SS, PTS and PBS1. + * Field 'S_SEG_2' in register CAN_SBT only contains PBS2. + * Sample point = (SS + PTS + PBS1) / (SS + PTS + PBS1 + PBS2) + * = (1 + 15) / (1 + 15 + 4) + * = 80%. + */ + pstcInit->stcSBT.u32SEG1 = 1U + 15U; + pstcInit->stcSBT.u32SEG2 = 4U; + pstcInit->stcSBT.u32SJW = 2U; + pstcInit->stcSBT.u32Prescaler = 4U; + + /* + * Set enCANFDCmd as Enable if CAN-FD is needed. + * + * u8TDCCmd: Enalbe(CAN_FD_TDC_ENABLE) or disable(CAN_FD_TDC_DISABLE) transmitter delay compensation. + * u8TDCSSP: The position(TQs) of secondary sample point. + * + * Primary sample point: u32SEG1 / (u32SEG1 + u32SEG2) = 80% + * Secondary sample point: u8TDCSSP / (u32SEG1 + u32SEG2) = 80% + */ + pstcInit->enCANFDCmd = Disable; + (void)CAN_FD_StructInit(&pstcInit->stcFDCfg); + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief De-initializes the CAN peripheral. Reset the registers of the specified CAN unit. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @retval None + */ +void CAN_DeInit(M4_CAN_TypeDef *CANx) +{ + uint8_t i; + + DDL_ASSERT(IS_CAN_UNIT(CANx)); + + CLEAR_REG8_BIT(CANx->CFG_STAT, CAN_CFG_STAT_RESET); + for (i=0U; i<2U; i++) + { + WRITE_REG8(CANx->CFG_STAT, 0x80U); + WRITE_REG8(CANx->TCMD, 0x00U); + WRITE_REG8(CANx->TCTRL, 0x90U); + WRITE_REG8(CANx->RCTRL, 0x10U); + WRITE_REG8(CANx->RTIE, 0xFEU); + WRITE_REG8(CANx->RTIF, 0xFFU); + WRITE_REG8(CANx->ERRINT, 0xD5U); + WRITE_REG8(CANx->LIMIT, 0x1BU); + WRITE_REG32(CANx->SBT, 0x01020203U); + WRITE_REG32(CANx->FBT, 0x01020203U); + WRITE_REG8(CANx->EALCAP, 0x00U); + WRITE_REG8(CANx->TDC, 0x00U); + WRITE_REG8(CANx->RECNT, 0x00U); + WRITE_REG8(CANx->TECNT, 0x00U); + WRITE_REG8(CANx->ACFCTRL, 0x00U); + WRITE_REG8(CANx->ACFEN, 0x01U); + WRITE_REG8(CANx->TBSLOT, 0x00U); + WRITE_REG8(CANx->TTCFG, 0xD8U); + WRITE_REG16(CANx->TRG_CFG, 0x00U); + WRITE_REG16(CANx->TT_TRIG, 0x00U); + WRITE_REG16(CANx->TT_WTRIG, 0x00U); + SET_REG8_BIT(CANx->CFG_STAT, CAN_CFG_STAT_RESET); + } +} + +/** + * @brief Software reset the specified CAN unit. \ + Software reset is a partial reset and CANNOT reset all registers. \ + Some registers need software reset before written. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @retval None + */ +void CAN_SWReset(M4_CAN_TypeDef *CANx) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + SET_REG8_BIT(CANx->CFG_STAT, CAN_CFG_STAT_RESET); +} + +/** + * @brief Set the CAN node to enter the normal communication mode. + * When this state is set, it takes 11 CAN bit time for this node to participate in communication. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @retval None + */ +void CAN_EnterNormalComm(M4_CAN_TypeDef *CANx) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + CLEAR_REG8_BIT(CANx->CFG_STAT, CAN_CFG_STAT_RESET); +} + +/** + * @brief Specifies work mode for the specified CAN unit. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u8WorkMode Work mode of CAN. + * This parameter can be a value of @ref CAN_Work_Mode + * @arg CAN_MODE_NORMAL: Normal work mode. + * @arg CAN_MODE_SILENT: Silent work mode. Prohibit data transmission. + * @arg CAN_MODE_ILB: Internal loopback mode, just for self-test while developing. + * @arg CAN_MODE_ELB: External loopback mode, just for self-test while developing. + * @arg CAN_MODE_ELB_SILENT: External loppback silent mode, just for self-test while developing. \ + * It is forbidden to respond to received frames and error frames, but data can be transmitted. + * @retval None + * @note Call this function when CFG_STAT.RESET is 0. + */ +void CAN_SetWorkMode(M4_CAN_TypeDef *CANx, uint8_t u8WorkMode) +{ + uint8_t u8CFGSTAT = 0U; + uint8_t u8TCMD = 0U; + + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_CAN_WORK_MODE(u8WorkMode)); + + switch (u8WorkMode) + { + case CAN_MODE_SILENT: + u8TCMD = CAN_TCMD_LOM; + break; + case CAN_MODE_ILB: + u8CFGSTAT = CAN_CFG_STAT_LBMI; + break; + case CAN_MODE_ELB: + u8CFGSTAT = CAN_CFG_STAT_LBME; + break; + case CAN_MODE_ELB_SILENT: + u8TCMD = CAN_TCMD_LOM; + u8CFGSTAT = CAN_CFG_STAT_LBME; + break; + case CAN_MODE_NORMAL: + default: + break; + } + + MODIFY_REG8(CANx->CFG_STAT, CAN_LB_MODE_MSK, u8CFGSTAT); + MODIFY_REG8(CANx->TCMD, CAN_TCMD_LOM, u8TCMD); +} + +/** + * @brief Specifies transmission mode for the specified CAN unit. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u8TransMode PTB/STB transmission mode. + * This parameter can be a value of @ref CAN_Trans_Mode + * @arg CAN_TRANS_PTB_STB_AUTO_RETX: Both PTB and STB automatically retransmit. + * @arg CAN_TRANS_PTB_SSHOT: PTB single shot transmit. + * @arg CAN_TRANS_STB_SSHOT: STB single shot transmit. + * @arg CAN_TRANS_PTB_STB_SSHOT: STB and PTB both single shot transmit. + * @retval None + * @note Call this function when CFG_STAT.RESET is 0. + */ +void CAN_SetTransMode(M4_CAN_TypeDef *CANx, uint8_t u8TransMode) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_CAN_TRANS_MODE(u8TransMode)); + MODIFY_REG8(CANx->CFG_STAT, CAN_TRANS_MODE_MSK, u8TransMode); +} + +/** + * @brief Specifies STB transmission priority mode for the specified CAN unit. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u8STBPrioMode STB transmission priority mode. + * This parameter can be a value of @ref CAN_STB_Priority_Mode + * @arg CAN_STB_PRIO_FIFO: Data first in first be transmitted. + * @arg CAN_STB_PRIO_ID : Data with smallest ID first be transmitted. + * @retval None + * @note Whatever the priority mode of STB is, PTB always has the highest priority. + */ +void CAN_SetSTBPrioMode(M4_CAN_TypeDef *CANx, uint8_t u8STBPrioMode) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_CAN_SBT_PRIO_MODE(u8STBPrioMode)); + MODIFY_REG8(CANx->TCTRL, CAN_TCTRL_TSMODE, u8STBPrioMode); +} + +/** + * @brief Specifies the receive buffer store selection for specified CAN unit. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u8RBStoreSel Receive buffer store selection. + * This parameter can be a value of @ref CAN_RB_Store_Selection + * @arg CAN_RB_STORE_CORRECT_DATA: Receive buffer stores correct data frames only. + * @arg CAN_RB_STORE_ALL_DATA: Receive buffer stores all data frames, includes error data. + * @retval None + * @note Call this function when CFG_STAT.RESET is 0. + */ +void CAN_SetRBStoreSel(M4_CAN_TypeDef *CANx, uint8_t u8RBStoreSel) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_CAN_RB_STORE_SEL(u8RBStoreSel)); + MODIFY_REG8(CANx->RCTRL, CAN_RCTRL_RBALL, u8RBStoreSel); +} + +/** + * @brief Specifies the operation when receiving buffer overflow. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u8RBOvfOperation Operation when receive buffer overflow. + * This parameter can be a value of @ref CAN_RB_Overflow_Operation + * @arg CAN_RB_OVF_SAVE_NEW: Saves the newly received data and the first received data will be overwritten. + * @arg CAN_RB_OVF_DISCARD_NEW: Discard the newly received data. + * @retval None + */ +void CAN_SetRBOvfOp(M4_CAN_TypeDef *CANx, uint8_t u8RBOvfOperation) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_CAN_RB_OVF_OP(u8RBOvfOperation)); + MODIFY_REG8(CANx->RCTRL, CAN_RCTRL_ROM, u8RBOvfOperation); +} + +/** + * @brief Enable or disable the specified interrupts of the specified CAN unit. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u32IntType Interrupt type of CAN. Set this parameter to 0xFFFFFFFF to select all the interrupts of CAN. + * This parameter can be values of @ref CAN_Interrupt_Type + * @arg CAN_INT_ERR_INT: Register bit RTIE.EIE. Error interrupt. + * @arg CAN_INT_STB_TRANS_OK: Register bit RTIE.TSIE. Secondary transmit buffer was transmitted successfully. + * @arg CAN_INT_PTB_TRANS_OK: Register bit RTIE.TPIE. Primary transmit buffer was transmitted successfully. + * @arg CAN_INT_RB_ALMOST_FULL: Register bit RTIE.RAFIE. The number of filled RB slot is greater than or equal to the LIMIT.AFWL setting value. + * @arg CAN_INT_RB_FIFO_FULL: Register bit RTIE.RFIE. The FIFO of receive buffer is full. + * @arg CAN_INT_RX_OVERRUN: Register bit RTIE.ROIE. Receive buffers are full and there is a further message to be stored. + * @arg CAN_INT_RX: Register bit RTIE.RIE. Received a valid data frame or remote frame. + * @arg CAN_INT_BUS_ERR: Register bit ERRINT.BEIE. Arbitration lost caused bus error + * @arg CAN_INT_ARB_LOST: Register bit ERRINT.ALIE. Arbitration lost. + * @arg CAN_INT_ERR_PASSIVE: Register bit ERRINT.EPIE. A change from error-passive to error-active or error-active to error-passive has occurred. + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable the specified interrupts. + * @arg Disable: Disable the specified interrupts. + * @retval None + */ +void CAN_IntCmd(M4_CAN_TypeDef *CANx, uint32_t u32IntType, en_functional_state_t enNewState) +{ + uint8_t u8RTIE; + uint8_t u8ERRINT; + + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32IntType &= CAN_INT_ALL; + u8RTIE = (uint8_t)u32IntType; + u8ERRINT = (uint8_t)(u32IntType >> 8U); + + if (enNewState == Enable) + { + SET_REG8_BIT(CANx->RTIE, u8RTIE); + SET_REG8_BIT(CANx->ERRINT, u8ERRINT); + } + else + { + CLEAR_REG8_BIT(CANx->RTIE, u8RTIE); + CLEAR_REG8_BIT(CANx->ERRINT, u8ERRINT); + } +} + +/** + * @brief Configures slow bit timing(SBT). + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] pstcCfg Pointer to a stc_can_bt_cfg_t structure value that + * contains the configuration information for SBT. + * @arg u32SEG1: TQs of segment 1. Contains synchronization segment, \ + * propagation time segment and phase buffer segment 1. + * @arg u32SEG2: TQs of segment 2. Phase buffer segment 2. + * @arg u32SJW: TQs of synchronization jump width. + * @arg u32Prescaler: Range [1, 256]. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcCfg == NULL. + * @note 1. Restrictions: u32SEG1 >= u32SEG2 + 1, u32SEG2 >= u32SJW. + * @note 2. TQ = u32Prescaler / CANClock. + * @note 3. Slow bit time = (u32SEG1 + u32SEG2) * TQ. + * @note 4. Call this function when CFG_STAT.RESET is 1. + */ +en_result_t CAN_SBTConfig(M4_CAN_TypeDef *CANx, const stc_can_bt_cfg_t *pstcCfg) +{ + en_result_t enRet = ErrorInvalidParameter; +#ifdef __DEBUG + uint32_t u32Addr; + uint32_t u32BitPos = 0U; +#endif + if (pstcCfg != NULL) + { + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_CAN_SBT_SEG1(pstcCfg->u32SEG1)); + DDL_ASSERT(IS_CAN_SBT_SJW(pstcCfg->u32SJW)); + DDL_ASSERT(IS_CAN_SBT_PRESC(pstcCfg->u32Prescaler)); +#ifdef __DEBUG + if (CANx == M4_CAN2) + { + u32BitPos = 1U; + } + /* If CAN-FD enabled. */ + u32Addr = (uint32_t)&M4_PERIC->CAN_SYCTLREG; + if (BIT_BAND(u32Addr, u32BitPos) == (uint32_t)Disable) + { + DDL_ASSERT(IS_CAN_SBT_SEG2(pstcCfg->u32SEG2)); + } + else + { + DDL_ASSERT(IS_CAN_FD_SBT_SEG2(pstcCfg->u32SEG2)); + } +#endif + WRITE_REG32(CANx->SBT, ((pstcCfg->u32SEG1 - 2U) | \ + ((pstcCfg->u32SEG2 - 1U) << CAN_SBT_S_SEG_2_POS) | \ + ((pstcCfg->u32SJW - 1U) << CAN_SBT_S_SJW_POS) | \ + ((pstcCfg->u32Prescaler - 1U) << CAN_SBT_S_PRESC_POS))); + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Get arbitration lost position of a frame. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @retval A uint8_t type value of arbitration lost position. + */ +uint8_t CAN_GetArbLostPos(const M4_CAN_TypeDef *CANx) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + return (READ_REG8_BIT(CANx->EALCAP, CAN_EALCAP_ALC)); +} + +/** + * @brief Get error type. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @retval An uint8_t value of error type. It's can be a value of @ref CAN_Error_Type + * @arg CAN_ERR_NO: No error. + * @arg CAN_ERR_BIT: Error is bit error. + * @arg CAN_ERR_FORM: Error is form error. + * @arg CAN_ERR_STUFF: Error is stuff error. + * @arg CAN_ERR_ACK: Error is ACK error. + * @arg CAN_ERR_CRC: Error is CRC error. + * @arg CAN_ERR_OTHER: Error is other error. + */ +uint8_t CAN_GetErrType(const M4_CAN_TypeDef *CANx) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + return (READ_REG8_BIT(CANx->EALCAP, CAN_EALCAP_KOER)); +} + +/** + * @brief Set receive buffer slots full warning limit. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u8RBSWarnLimit: Receive buffer slots full warning limit. Rang is [1, 8]. + * Each CAN unit has 8 receive buffer slots. When the number of received frames \ + * reaches the value specified by parameter 'u8RBSWarnLimit', register bit RTIF.RAFIF is set and \ + * the interrupt occurred if it was enabled. + * @retval None + */ +void CAN_SetRBSWarnLimit(M4_CAN_TypeDef *CANx, uint8_t u8RBSWarnLimit) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_CAN_RBS_FULL_WARN_LIMIT(u8RBSWarnLimit)); + + u8RBSWarnLimit <<= CAN_LIMIT_AFWL_POS; + MODIFY_REG8(CANx->LIMIT, CAN_LIMIT_AFWL, u8RBSWarnLimit); +} + +/** + * @brief Set error warning limit. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u8ErrWarnLimit Programmable error warning limit. Range is [0, 15]. + * Error warning limit = (u8ErrWarnLimit + 1) * 8. + * @retval None + */ +void CAN_SetErrWarnLimit(M4_CAN_TypeDef *CANx, uint8_t u8ErrWarnLimit) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_CAN_ERR_WARN_LIMIT(u8ErrWarnLimit)); + MODIFY_REG8(CANx->LIMIT, CAN_LIMIT_EWL, u8ErrWarnLimit); +} + +/** + * @brief Get receive error count(REC). + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @retval An uint8_t type value of REC. + */ +uint8_t CAN_GetREC(const M4_CAN_TypeDef *CANx) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + return (CANx->RECNT); +} + +/** + * @brief Get transmission error count(TEC). + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @retval An uint8_t type value of TEC. + */ +uint8_t CAN_GetTEC(const M4_CAN_TypeDef *CANx) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + return (CANx->TECNT); +} + +/** + * @brief Clear receive error count(REC) and transmission error count(TEC). + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @retval None + * @note Set CFG_STAT.BUSOFF to 1 to clear REC and TEC. ONLY for TEST mode! + */ +void CAN_ClrErrCount(M4_CAN_TypeDef *CANx) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + SET_REG8_BIT(CANx->CFG_STAT, CAN_CFG_STAT_BUSOFF); +} + +/** + * @brief Configures acceptance filter. Set ID and ID mask for the specified acceptance filters. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u16AFSel Acceptance filter enable bit. + * This parameter can be values of @ref CAN_AF + * @arg CAN_AF1 ~ CAN_AF16 + * @param [in] pstcAFCfg Points to a stc_can_af_cfg_t structure type array which contains ID and ID mask + * values for the acceptance filters specified by parameter u16AFSel. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: -u16AFSel == 0U. + * -pstcAFCfg == NULL. + * @note Call this function when CFG_STAT.RESET is 1. + */ +en_result_t CAN_AFConfig(M4_CAN_TypeDef *CANx, uint16_t u16AFSel, const stc_can_af_cfg_t pstcAFCfg[]) +{ + uint8_t u8AFAddr = 0U; + uint8_t i = 0U; + en_result_t enRet = ErrorInvalidParameter; + + if ((u16AFSel != 0U) && (pstcAFCfg != NULL)) + { + DDL_ASSERT(IS_CAN_UNIT(CANx)); + + while (u16AFSel != 0U) + { + if ((u16AFSel & (uint16_t)0x1U) != 0U) + { + DDL_ASSERT(IS_CAN_AF_MSK_TYPE(pstcAFCfg[i].u32MskType)); + + WRITE_REG8(CANx->ACFCTRL, u8AFAddr); + WRITE_REG32(CANx->ACF, pstcAFCfg[i].u32ID); + SET_REG8_BIT(CANx->ACFCTRL, CAN_ACFCTRL_SELMASK); + WRITE_REG32(CANx->ACF, pstcAFCfg[i].u32IDMsk | pstcAFCfg[i].u32MskType); + i++; + } + + u16AFSel >>= 1U; + u8AFAddr++; + } + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Enable or disable acceptance filter. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u16AFSel Acceptance filter enable bit. + * This parameter can be values of @ref CAN_AF + * @arg CAN_AF1 ~ CAN_AF16 + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable the acceptance filters that specified by parameter u16AFSel. + * @arg Disable: Disable the acceptance filters that specified by parameter u16AFSel. + * @retval None + */ +void CAN_AFCmd(M4_CAN_TypeDef *CANx, uint16_t u16AFSel, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (enNewState == Enable) + { + SET_REG16_BIT(CANx->ACFEN, u16AFSel); + } + else + { + CLEAR_REG16_BIT(CANx->ACFEN, u16AFSel); + } +} + +/** + * @brief Get the transmit buffer which is being transmitted. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @retval An uint8_t type value of transmit buffer type. It can be a value of @ref CAN_Transmit_Buffer_Type + * @arg CAN_BUF_PTB: The transmit buffer which is being transmitted is PTB. + * @arg CAN_BUF_STB: The transmit buffer which is being transmitted is STB. + * @arg 0xFFU: No transmit buffer is being transmitted. + */ +uint8_t CAN_GetTBType(const M4_CAN_TypeDef *CANx) +{ + uint8_t u8Tmp; + uint8_t u8Ret; + + u8Tmp = CANx->TCMD; + if ((u8Tmp & CAN_TCMD_TPE) != 0U) + { + u8Ret = CAN_BUF_PTB; + } + else if ((u8Tmp & (CAN_TCMD_TSALL | CAN_TCMD_TSONE)) != 0U) + { + u8Ret = CAN_BUF_STB; + } + else + { + u8Ret = 0xFFU; + } + + return u8Ret; +} + +/** + * @brief Abort the transmission of the specified transmit buffer that ready but not started. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u8TBType The transmit buffer to be aborted. + * This parameter can be a value of @ref CAN_Transmit_Buffer_Type + * @arg CAN_BUF_PTB: Abort PTB transmission that ready but not started. + * @arg CAN_BUF_STB: Abort STB transmission that ready but not started. + * @retval None + * @note Call this function when CFG_STAT.RESET is 0. + */ +void CAN_AbortTrans(M4_CAN_TypeDef *CANx, uint8_t u8TBType) +{ + uint8_t au8Abort[] = {CAN_TCMD_TPA, CAN_TCMD_TSA}; + + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_CAN_TB_TYPE(u8TBType)); + SET_REG8_BIT(CANx->TCMD, au8Abort[u8TBType]); +} + +/** + * @brief Get the common flag's status. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u32Flag Status flag. + * This parameter can be a value of @ref CAN_Common_Status_Flag + * @arg CAN_FLAG_BUS_OFF: Register bit CFG_STAT.BUSOFF. CAN bus off. + * @arg CAN_FLAG_BUS_TX: Register bit CFG_STAT.TACTIVE. CAN bus is transmitting. + * @arg CAN_FLAG_BUS_RX: Register bit CFG_STAT.RACTIVE. CAN bus is receiving. + * @arg CAN_FLAG_RB_OVF: Register bit RCTRL.ROV. Receive buffer is full and there is a further bit to be stored. At least one data is lost. + * @arg CAN_FLAG_TB_FULL: Register bit RTIE.TSFF. Transmit buffers are all full: \ + * TTCFG.TTEN == 0 or TCTRL.TTTEM == 0: ALL STB slots are filled. \ + * TTCFG.TTEN == 1 and TCTRL.TTTEM == 1: Transmit buffer that pointed by TBSLOT.TBPTR is filled. + * @arg CAN_FLAG_TRANS_ABORTED: Register bit RTIF.AIF. Transmit messages requested via TCMD.TPA and TCMD.TSA were successfully canceled. + * @arg CAN_FLAG_ERR_INT: Register bit RTIF.EIF. The CFG_STAT.BUSOFF bit changes, or the relative relationship between the value of the error counter and the \ + * set value of the ERROR warning limit changes. For example, the value of the error counter changes from less than \ + * the set value to greater than the set value, or from greater than the set value to less than the set value. + * @arg CAN_FLAG_STB_TRANS_OK: Register bit RTIF.TSIF. STB was transmitted successfully. + * @arg CAN_FLAG_PTB_TRANS_OK: Register bit RTIF.TPIF. PTB was transmitted successfully. + * @arg CAN_FLAG_RB_ALMOST_FULL: Register bit RTIF.RAFIF. The number of filled RB slot is greater than or equal to the LIMIT.AFWL setting value. + * @arg CAN_FLAG_RB_FIFO_FULL: Register bit RTIF.RFIF. The FIFO of receive buffer is full. + * @arg CAN_FLAG_RX_OVERRUN: Register bit RTIF.ROIF. Receive buffers are all full and there is a further message to be stored. + * @arg CAN_FLAG_RX_OK: Register bit RTIF.RIF. Received a valid data frame or remote frame. + * @arg CAN_FLAG_BUS_ERR: Register bit ERRINT.BEIF. Arbitration lost caused bus error. + * @arg CAN_FLAG_ARB_LOST: Register bit ERRINT.ALIF. Arbitration lost. + * @arg CAN_FLAG_ERR_PASSIVE: Register bit ERRINT.EPIF. A change from error-passive to error-active or error-active to error-passive has occurred. + * @arg CAN_FLAG_ERR_PASSIVE_NODE: Register bit ERRINT.EPASS. The node is an error-passive node. + * @arg CAN_FLAG_REACH_WARN_LIMIT: Register bit ERRINT.EWARN. REC or TEC is greater than or equal to the LIMIT.EWL setting value. + * @retval An en_flag_status_t enumeration type value. + * @arg Set: At least one of the specified status flags is set. + * @arg Reset: None of the specified status flags is set. + */ +en_flag_status_t CAN_GetStatus(const M4_CAN_TypeDef *CANx, uint32_t u32Flag) +{ + uint8_t u8CFGSTAT; + uint8_t u8RCTRL; + uint8_t u8RTIE; + uint8_t u8RTIF; + uint8_t u8ERRINT; + en_flag_status_t enFlag = Reset; + + DDL_ASSERT(IS_CAN_UNIT(CANx)); + + u32Flag &= CAN_FLAG_ALL; + + u8CFGSTAT = (uint8_t)(u32Flag); + u8RCTRL = (uint8_t)(u32Flag & CAN_FLAG_RB_OVF); + u8RTIE = (uint8_t)(u32Flag >> 8U); + u8RTIF = (uint8_t)(u32Flag >> 16U); + u8ERRINT = (uint8_t)(u32Flag >> 24U); + + u8CFGSTAT = READ_REG8_BIT(CANx->CFG_STAT, u8CFGSTAT); + u8RCTRL = READ_REG8_BIT(CANx->RCTRL, u8RCTRL); + u8RTIE = READ_REG8_BIT(CANx->RTIE, u8RTIE); + u8RTIF = READ_REG8_BIT(CANx->RTIF, u8RTIF); + u8ERRINT = READ_REG8_BIT(CANx->ERRINT, u8ERRINT); + + if ((u8CFGSTAT != 0U) || (u8RCTRL != 0U) || \ + (u8RTIE != 0U) || (u8RTIF != 0U) || (u8ERRINT != 0U)) + { + enFlag = Set; + } + + return enFlag; +} + +/** + * @brief Clear the common flag's status. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u32Flag Status flag. Set this parameter to 0xFFFFFFFF to select all sataus flags of CAN. + * This parameter can be a value of @ref CAN_Common_Status_Flag + * @arg CAN_FLAG_RB_OVF: Register bit RCTRL.ROV. Receive buffer is full and there is a further bit to be stored. At least one data is lost. + * @arg CAN_FLAG_TRANS_ABORTED: Register bit RTIF.AIF. Transmit messages requested via TCMD.TPA and TCMD.TSA were successfully canceled. + * @arg CAN_FLAG_ERR_INT: Register bit RTIF.EIF. The CFG_STAT.BUSOFF bit changes, or the relative relationship between the value of the error counter \ + * and the set value of the ERROR warning limit changes. For example, the value of the error counter changes from less than \ + * the set value to greater than the set value, or from greater than the set value to less than the set value. + * @arg CAN_FLAG_STB_TRANS_OK: Register bit RTIF.TSIF. STB was transmitted successfully. + * @arg CAN_FLAG_PTB_TRANS_OK: Register bit RTIF.TPIF. PTB was transmitted successfully. + * @arg CAN_FLAG_RB_ALMOST_FULL: Register bit RTIF.RAFIF. The number of filled RB slot is greater than or equal to the LIMIT.AFWL setting value. + * @arg CAN_FLAG_RB_FIFO_FULL: Register bit RTIF.RFIF. The FIFO of receive buffer is full. + * @arg CAN_FLAG_RX_OVERRUN: Register bit RTIF.ROIF. Receive buffers are all full and there is a further message to be stored. + * @arg CAN_FLAG_RX_OK: Register bit RTIF.RIF. Received a valid data frame or remote frame. + * @arg CAN_FLAG_BUS_ERR: Register bit ERRINT.BEIF. Arbitration lost caused bus error. + * @arg CAN_FLAG_ARB_LOST: Register bit ERRINT.ALIF. Arbitration lost. + * @arg CAN_FLAG_ERR_PASSIVE: Register bit ERRINT.EPIF. A change from error-passive to error-active or error-active to error-passive has occurred. + * @arg CAN_FLAG_ERR_PASSIVE_NODE: Register bit ERRINT.EPASS. The node is an error-passive node. + * @arg CAN_FLAG_REACH_WARN_LIMIT: Register bit ERRINT.EWARN. REC or TEC is greater than or equal to the LIMIT.EWL setting value. + * @retval None + */ +void CAN_ClrStatus(M4_CAN_TypeDef *CANx, uint32_t u32Flag) +{ + uint8_t u8RTIF; + uint8_t u8ERRINT; + + DDL_ASSERT(IS_CAN_UNIT(CANx)); + + u32Flag &= CAN_FLAG_CLR_MSK; + u8RTIF = (uint8_t)(u32Flag >> 16U); + u8ERRINT = (uint8_t)(u32Flag >> 24U); + + if ((u32Flag & CAN_FLAG_RB_OVF) != 0U) + { + SET_REG8_BIT(CANx->RCTRL, CAN_RCTRL_RREL); + } + SET_REG8_BIT(CANx->RTIF, u8RTIF); + SET_REG8_BIT(CANx->ERRINT, u8ERRINT); +} + +/** + * @brief Get the value of status. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @retval An uint32_t type value that includes the flowing status flags. + * @arg CAN_FLAG_BUS_OFF: Register bit CFG_STAT.BUSOFF. CAN bus off. + * @arg CAN_FLAG_BUS_TX: Register bit CFG_STAT.TACTIVE. CAN bus is transmitting. + * @arg CAN_FLAG_BUS_RX: Register bit CFG_STAT.RACTIVE. CAN bus is receiving. + * @arg CAN_FLAG_RB_OVF: Register bit RCTRL.ROV. Receive buffer is full and there is a further bit to be stored. At least one data is lost. + * @arg CAN_FLAG_TB_FULL: Register bit RTIE.TSFF. Transmit buffers are all full: \ + * TTCFG.TTEN == 0 or TCTRL.TTTEM == 0: ALL STB slots are filled. \ + * TTCFG.TTEN == 1 and TCTRL.TTTEM == 1: Transmit buffer that pointed by TBSLOT.TBPTR is filled. + * @arg CAN_FLAG_TRANS_ABORTED: Register bit RTIF.AIF. Transmit messages requested via TCMD.TPA and TCMD.TSA were successfully canceled. + * @arg CAN_FLAG_ERR_INT: Register bit RTIF.EIF. The CFG_STAT.BUSOFF bit changes, or the relative relationship between the value of the error counter and the \ + * set value of the ERROR warning limit changes. For example, the value of the error counter changes from less than \ + * the set value to greater than the set value, or from greater than the set value to less than the set value. + * @arg CAN_FLAG_STB_TRANS_OK: Register bit RTIF.TSIF. STB was transmitted successfully. + * @arg CAN_FLAG_PTB_TRANS_OK: Register bit RTIF.TPIF. PTB was transmitted successfully. + * @arg CAN_FLAG_RB_ALMOST_FULL: Register bit RTIF.RAFIF. The number of filled RB slot is greater than or equal to the LIMIT.AFWL setting value. + * @arg CAN_FLAG_RB_FIFO_FULL: Register bit RTIF.RFIF. The FIFO of receive buffer is full. + * @arg CAN_FLAG_RX_OVERRUN: Register bit RTIF.ROIF. Receive buffers are all full and there is a further message to be stored. + * @arg CAN_FLAG_RX_OK: Register bit RTIF.RIF. Received a valid data frame or remote frame. + * @arg CAN_FLAG_BUS_ERR: Register bit ERRINT.BEIF. Arbitration lost caused bus error. + * @arg CAN_FLAG_ARB_LOST: Register bit ERRINT.ALIF. Arbitration lost. + * @arg CAN_FLAG_ERR_PASSIVE: Register bit ERRINT.EPIF. A change from error-passive to error-active or error-active to error-passive has occurred. + * @arg CAN_FLAG_ERR_PASSIVE_NODE: Register bit ERRINT.EPASS. The node is an error-passive node. + * @arg CAN_FLAG_REACH_WARN_LIMIT: Register bit ERRINT.EWARN. REC or TEC is greater than or equal to the LIMIT.EWL setting value. + */ +uint32_t CAN_GetStatusVal(const M4_CAN_TypeDef *CANx) +{ + uint32_t u32RCTRL; + uint32_t u32RTIE; + uint32_t u32RTIF; + uint32_t u32ERRINT; + uint32_t u32RetVal; + + DDL_ASSERT(IS_CAN_UNIT(CANx)); + + u32RetVal = CANx->CFG_STAT; + u32RCTRL = CANx->RCTRL; + u32RCTRL &= CAN_FLAG_RB_OVF; + u32RTIE = CANx->RTIE; + u32RTIF = CANx->RTIF; + u32ERRINT = CANx->ERRINT; + + u32RetVal |= (u32RCTRL | (u32RTIE << 8U) | (u32RTIF << 16U) | (u32ERRINT << 24U)); + u32RetVal &= CAN_FLAG_ALL; + + return u32RetVal; +} + +/** + * @brief Get status(full or empty) of transmit buffer. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @retval An uint8_t type value of status of transmit buffer. It's can be a value of @ref CAN_TB_Status + * @arg CAN_TB_STAT_EMPTY: TTCAN is disabled(TTEN == 0): STB is empty. + * TTCAN is disabled(TTEN == 1) and transmit buffer is specified by TBPTR and TTPTR(TTTBM == 1): + * PTB and STB are both empty. + * @arg CAN_TB_STAT_LESS_HALF: TTEN == 0: STB is not less than half full; + * TTEN == 1 && TTTBM == 1: PTB and STB are neither empty. + * @arg CAN_TB_STAT_MORE_HALF: TTEN == 0: STB is more than half full; + * TTEN == 1 && TTTBM == 1: reserved value. + * @arg CAN_TB_STAT_FULL TTEN == 0: STB is full; + * TTEN == 1 && TTTBM == 1: PTB and STB are both full. + */ +uint8_t CAN_GetTBFullStatus(const M4_CAN_TypeDef *CANx) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + return (READ_REG8_BIT(CANx->TCTRL, CAN_TCTRL_TSSTAT)); +} + +/** + * @brief Get status(full or empty) of receive buffer. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @retval An uint8_t type value of status of receive buffer. It's can be a value of @ref CAN_RB_Status + * @arg CAN_RB_STAT_EMPTY: Receive buffer(RB) is empty. + * @arg CAN_RB_STAT_LESS_WARN_LIMIT: RB is not empty, but is less than almost full warning limit. + * @arg CAN_RB_STAT_MORE_WARN_LIMIT: RB is not full, but is more than or equal to almost full warning limit. + * @arg CAN_RB_STAT_FULL: RB is full. + */ +uint8_t CAN_GetRBFullStatus(const M4_CAN_TypeDef *CANx) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + return (READ_REG8_BIT(CANx->TCTRL, CAN_RCTRL_RSTAT)); +} + +/** + * @brief Configures the specified CAN FD according to the specified parameters + * in the stc_can_fd_cfg_t type structure. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] pstcCfg Pointer to a stc_can_fd_cfg_t structure value that + * contains the configuration information for the CAN FD. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcCfg == NULL. + * @note Call this function when CFG_STAT.RESET is 1. + */ +en_result_t CAN_FD_Config(M4_CAN_TypeDef *CANx, const stc_can_fd_cfg_t *pstcCfg) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (pstcCfg != NULL) + { + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_CAN_FD_MODE(pstcCfg->u8CANFDMode)); + DDL_ASSERT(IS_CAN_TDC_CMD(pstcCfg->u8TDCCmd)); + DDL_ASSERT(IS_CAN_FD_SSP(pstcCfg->u8TDCSSP)); + + DDL_ASSERT(IS_CAN_FBT_SEG1(pstcCfg->stcFBT.u32SEG1)); + DDL_ASSERT(IS_CAN_FBT_SEG2(pstcCfg->stcFBT.u32SEG2)); + DDL_ASSERT(IS_CAN_FBT_SJW(pstcCfg->stcFBT.u32SJW)); + DDL_ASSERT(IS_CAN_FBT_PRESC(pstcCfg->stcFBT.u32Prescaler)); + + /* Specifies CAN FD ISO mode. */ + MODIFY_REG8(CANx->TCTRL, CAN_TCTRL_FD_ISO, pstcCfg->u8CANFDMode); + + /* + * Configures fast bit time. + * Restrictions: u32SEG1 >= u32SEG2 + 1, u32SEG2 >= u32SJW. + * TQ = u32Prescaler / CANClock. + * Fast bit time = (u32SEG1 + u32SEG2) * TQ. + */ + WRITE_REG32(CANx->FBT, ((pstcCfg->stcFBT.u32SEG1 - 2U) | \ + ((pstcCfg->stcFBT.u32SEG2 - 1U) << CAN_FBT_F_SEG_2_POS) | \ + ((pstcCfg->stcFBT.u32SJW - 1U) << CAN_FBT_F_SJW_POS) | \ + ((pstcCfg->stcFBT.u32Prescaler - 1U) << CAN_FBT_F_PRESC_POS))); + + /* Specifies the secondary sample point. Number of TQ. */ + MODIFY_REG8(CANx->TDC, CAN_TDC_SSPOFF, pstcCfg->u8TDCSSP); + + /* Enable or disable TDC. */ + MODIFY_REG8(CANx->TDC, CAN_TDC_TDCEN, pstcCfg->u8TDCCmd); + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set a default value for the CAN FD configuration structure. + * Based on 40MHz CAN clock, TQ clock is CAN clock divided by 1. \ + * Bit rate 2Mbps, 1 bit time is 20TQs, primary sample point is 80%, \ + * secondary sample point is 80%. + * @param [in] pstcCfg Pointer to a stc_can_fd_cfg_t structure value that + * contains the configuration information for the CAN FD. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcCfg == NULL. + */ +en_result_t CAN_FD_StructInit(stc_can_fd_cfg_t *pstcCfg) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (pstcCfg != NULL) + { + /* + * u8TDCCmd: Enalbe(CAN_FD_TDC_ENABLE) or disable(CAN_FD_TDC_DISABLE) transmitter delay compensation. + * u8TDCSSP: The position(TQs) of secondary sample point. + * + * Primary sample point: u32SEG1 / (u32SEG1 + u32SEG2) = 80% + * Secondary sample point: u8TDCSSP / (u32SEG1 + u32SEG2) = 80% + * + * u32SEG1: TQs of segment 1. Contains synchronization segment, \ + * propagation time segment and phase buffer segment 1. + * u32SEG2: TQs of segment 2. Phase buffer segment 2. + * u32SJW: TQs of synchronization jump width. + * u32Prescaler: Range [1, 256]. + */ + pstcCfg->u8CANFDMode = CAN_FD_MODE_BOSCH; + pstcCfg->u8TDCCmd = CAN_FD_TDC_ENABLE; + pstcCfg->u8TDCSSP = 16U; + pstcCfg->stcFBT.u32SEG1 = 1U + 15U; + pstcCfg->stcFBT.u32SEG2 = 4U; + pstcCfg->stcFBT.u32SJW = 4U; + pstcCfg->stcFBT.u32Prescaler = 1U; + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Enable or disable CAN FD. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable CAN FD. + * @arg Disable: Disable CAN FD. + * @retval None + */ +void CAN_FD_Cmd(const M4_CAN_TypeDef *CANx, en_functional_state_t enNewState) +{ + uint32_t u32Addr; + uint32_t u32BitPos = 0U; + + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (CANx == M4_CAN2) + { + u32BitPos = 1U; + } + u32Addr = (uint32_t)&M4_PERIC->CAN_SYCTLREG; + BIT_BAND(u32Addr, u32BitPos) = (uint32_t)enNewState; +} + +/** + * @brief Set a default value for the CAN TTC(time-triggered communication) configuration structure. + * @param [in] pstcCfg Pointer to a stc_can_ttc_cfg_t structure value that + * contains the configuration information for the CAN TTC. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcCfg == NULL. + */ +en_result_t CAN_TTC_StructInit(stc_can_ttc_cfg_t *pstcCfg) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (pstcCfg != NULL) + { + pstcCfg->u8TransBufMode = CAN_TTC_TB_MODE_PTR; + pstcCfg->u8NTUPrescaler = CAN_TTC_NTU_PRESC_1; + pstcCfg->u32RefMsgIDE = 0U; + pstcCfg->u32RefMsgID = 0x0U; + pstcCfg->u16TrigType = CAN_TTC_TRIG_SSHOT_TRANS_TRIG; + pstcCfg->u16TxEnWindow = 16U; + pstcCfg->u16TxTrigTime = 0xFFFFU; + pstcCfg->u16WatchTrigTime = 0xFFFFU; + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Configures the specified CAN TTC(time-triggered communication) according to the specified parameters + * in the stc_can_ttc_cfg_t type structure. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] pstcCfg Pointer to a stc_can_ttc_cfg_t structure value that + * contains the configuration information for the CAN TTC. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcCfg == NULL. + */ +en_result_t CAN_TTC_Config(M4_CAN_TypeDef *CANx, const stc_can_ttc_cfg_t *pstcCfg) +{ + uint32_t u32RefMsgID; + en_result_t enRet = ErrorInvalidParameter; + + if (pstcCfg != NULL) + { + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_CAN_TTC_TB_MODE(pstcCfg->u8TransBufMode)); + DDL_ASSERT(IS_CAN_TTC_NTU_PRESC(pstcCfg->u8NTUPrescaler)); + DDL_ASSERT(IS_CAN_IDE(pstcCfg->u32RefMsgIDE)); + DDL_ASSERT(IS_CAN_TTC_TRIG_TYPE(pstcCfg->u16TrigType)); + DDL_ASSERT(IS_CAN_TTC_TX_EN_WINDOW(pstcCfg->u16TxEnWindow)); + + u32RefMsgID = pstcCfg->u32RefMsgID & ((uint32_t)(~CAN_REF_MSG_REF_IDE)); + + /* Specifies transmission buffer mode. */ + MODIFY_REG8(CANx->TCTRL, CAN_TCTRL_TTTBM, pstcCfg->u8TransBufMode); + /* Specifies Tx_Enable window and trigger type. */ + WRITE_REG16(CANx->TRG_CFG, ((((uint32_t)pstcCfg->u16TxEnWindow-1U) << CAN_TRG_CFG_TEW_POS) | pstcCfg->u16TrigType)); + /* Specifies ID of reference message and its extension bit. */ + WRITE_REG32(CANx->REF_MSG, (((pstcCfg->u32RefMsgIDE << CAN_REF_MSG_REF_IDE_POS) | u32RefMsgID))); + /* Specifies transmission trigger time. */ + WRITE_REG16(CANx->TT_TRIG, pstcCfg->u16TxTrigTime); + /* Specifies watch trigger time. */ + WRITE_REG16(CANx->TT_WTRIG, pstcCfg->u16WatchTrigTime); + /* Specifies NTU prescaler. */ + WRITE_REG8(CANx->TTCFG, pstcCfg->u8NTUPrescaler); + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Enable or disable time-triggered communication(TTC) of the specified CAN unit. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable TTC. + * @arg Disable: Disable TTC. + * @retval None + * @note Call this function when CFG_STAT.RESET is 0. + */ +void CAN_TTC_Cmd(M4_CAN_TypeDef *CANx, en_functional_state_t enNewState) +{ + uint32_t u32Addr; + + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + u32Addr = (uint32_t)&CANx->TTCFG; + BIT_BAND(u32Addr, CAN_TTCFG_TTEN_POS) = (uint32_t)enNewState; +} + +/** + * @brief Specifies transmission buffer slot(TBS) which is going to be filled. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u8SlotPtr Transmit-trigger transmit buffer slot. + * This parameter can be a value of @ref CAN_TTC_TBS_Pointer + * @arg CAN_TTC_TBS_PTB: TBS pointer points to PTB. + * @arg CAN_TTC_TBS_STB1: TBS pointer points to STB slot 1. + * @arg CAN_TTC_TBS_STB2: TBS pointer points to STB slot 2. + * @arg CAN_TTC_TBS_STB3: TBS pointer points to STB slot 3. + * @retval None + */ +void CAN_TTC_SetTBSToBeFilled(M4_CAN_TypeDef *CANx, uint8_t u8SlotPtr) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_CAN_TTC_TBS(u8SlotPtr)); + MODIFY_REG8(CANx->TBSLOT, CAN_TBSLOT_TBPTR, u8SlotPtr); +} + +/** + * @brief Marks the transmission buffer slot(TBS) as filled. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @retval None + */ +void CAN_TTC_SetTBSFilled(M4_CAN_TypeDef *CANx) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + SET_REG8_BIT(CANx->TBSLOT, CAN_TBSLOT_TBF); +} + +/** + * @brief Specifies time-triggered communication(TTC) timer prescaler. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u8NTUPrescaler Time-triggered communication timer prescaler. + * This parameter can be a value of @ref CAN_TTC_NTU_Prescaler + * @arg CAN_TTC_NTU_PRESC_1: NTU is SBT bit time * 1. + * @arg CAN_TTC_NTU_PRESC_2: NTU is SBT bit time * 2. + * @arg CAN_TTC_NTU_PRESC_4: NTU is SBT bit time * 4. + * @arg CAN_TTC_NTU_PRESC_8: NTU is SBT bit time * 8. + * @retval None + */ +void CAN_TTC_SetNTUPrescaler(M4_CAN_TypeDef *CANx, uint8_t u8NTUPrescaler) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_CAN_TTC_NTU_PRESC(u8NTUPrescaler)); + MODIFY_REG8(CANx->TTCFG, CAN_TTCFG_T_PRESC, u8NTUPrescaler); +} + +/** + * @brief Enable or disable the specified interrupts of time-triggered communication(TTC). + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u8IntType Interrupt type of TTC. + * This parameter can be values of @ref CAN_TTC_Interrupt_Type + * @arg CAN_TTC_INT_TTI: Time trigger interrupt. + * @arg CAN_TTC_INT_WTI: Watch trigger interrupt. + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable the specified interrupts. + * @arg Disable: Disable the specified interrupts. + * @retval None + */ +void CAN_TTC_IntCmd(M4_CAN_TypeDef *CANx, uint8_t u8IntType, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u8IntType &= CAN_TTC_INT_ALL; + if (enNewState == Enable) + { + SET_REG8_BIT(CANx->TTCFG, u8IntType); + } + else + { + CLEAR_REG8_BIT(CANx->TTCFG, u8IntType); + } +} + +/** + * @brief Get flag status of time-triggered communication(TTC). + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u8Flag Status flag of TTC. + * This parameter can be values of @ref CAN_TTC_Status_Flag + * @arg CAN_TTC_FLAG_TTI: Time trigger interrupt flag. + * @arg CAN_TTC_FLAG_TEI: Trigger error interrupt flag. + * @arg CAN_TTC_FLAG_WTI: Watch trigger interrupt flag. + * @retval An en_flag_status_t enumeration type value. + * @arg Set: At least one of the specified flags is set. + * @arg Reset: None of the specified flags is reset. + */ +en_flag_status_t CAN_TTC_GetStatus(const M4_CAN_TypeDef *CANx, uint8_t u8Flag) +{ + en_flag_status_t enFlag = Reset; + + DDL_ASSERT(IS_CAN_UNIT(CANx)); + if (READ_REG8_BIT(CANx->TTCFG, (u8Flag & (uint8_t)CAN_TTC_FLAG_ALL)) != 0U) + { + enFlag = Set; + } + + return enFlag; +} + +/** + * @brief Clear flag status of time-triggered communication(TTC). + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u8Flag Status flag of TTC. + * This parameter can be a value of @ref CAN_TTC_Status_Flag except CAN_TTC_FLAG_TEI. + * @arg CAN_TTC_FLAG_TTI: Time trigger interrupt flag. + * @arg CAN_TTC_FLAG_WTI: Watch trigger interrupt flag. + * @retval None + */ +void CAN_TTC_ClrStatus(M4_CAN_TypeDef *CANx, uint8_t u8Flag) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + SET_REG8_BIT(CANx->TTCFG, (u8Flag & CAN_TTC_FLAG_CLR_MSK)); +} + +/** + * @brief Get the value of status of TTC. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @retval An uint8_t type value that includes the flowing status flags. + * @arg CAN_TTC_FLAG_TTI: Time trigger interrupt flag. + * @arg CAN_TTC_FLAG_TEI: Trigger error interrupt flag. + * @arg CAN_TTC_FLAG_WTI: Watch trigger interrupt flag. + */ +uint8_t CAN_TTC_GetStatusVal(const M4_CAN_TypeDef *CANx) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + return READ_REG8_BIT(CANx->TTCFG, CAN_TTC_FLAG_ALL); +} + +/** + * @brief Specifies reference message ID and IDE for time-triggered communication(TTC). + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u32ID Reference message ID. + * @retval None + */ +void CAN_TTC_SetRefMsgID(M4_CAN_TypeDef *CANx, uint32_t u32ID) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + u32ID &= (uint32_t)(~CAN_REF_MSG_REF_IDE); + MODIFY_REG32(CANx->REF_MSG, CAN_REF_MSG_REF_ID, u32ID); +} + +/** + * @brief Specifiy IDE of TTC(time-triggered communication) reference message. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u32IDE IDE bit. + * @arg 0: Standard ID. + * @arg 1: Extended ID. + * @retval None + */ +void CAN_TTC_SetRefMsgIDE(M4_CAN_TypeDef *CANx, uint32_t u32IDE) +{ + uint32_t u32Addr; + + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_CAN_IDE(u32IDE)); + u32Addr = (uint32_t)&CANx->REF_MSG; + BIT_BAND(u32Addr, CAN_REF_MSG_REF_IDE_POS) = u32IDE; +} + +/** + * @brief Get reference message ID of time-triggered communication(TTC). + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @retval An uint32_t value of reference message ID. + */ +uint32_t CAN_TTC_GetRefMsgID(const M4_CAN_TypeDef *CANx) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + return (READ_REG32_BIT(CANx->REF_MSG, CAN_REF_MSG_REF_ID)); +} + +/** + * @brief Get reference message ID extension bit of time-triggered communication(TTC). + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @retval An uint32_t value of reference message IDE. + * @arg 0: Standard ID. + * @arg 1: Extended ID. + */ +uint32_t CAN_TTC_GetRefMsgIDE(const M4_CAN_TypeDef *CANx) +{ + uint32_t u32Addr; + + DDL_ASSERT(IS_CAN_UNIT(CANx)); + u32Addr = (uint32_t)&CANx->REF_MSG; + return BIT_BAND(u32Addr, CAN_REF_MSG_REF_IDE_POS); +} + +/** + * @brief Specifies transmit-trigger transmit buffer slot(TBS) for time-triggered communication(TTC) of specified CAN unit. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u8TBSlotPtr Transmit-trigger transmit buffer slot. + * This parameter can be a value of @ref CAN_TTC_TBS_Pointer + * @arg CAN_TTC_TBS_PTB: TBS pointer points to PTB. + * @arg CAN_TTC_TBS_STB_S1: TBS pointer points to STB slot 1. + * @arg CAN_TTC_TBS_STB_S2: TBS pointer points to STB slot 2. + * @arg CAN_TTC_TBS_STB_S3: TBS pointer points to STB slot 3. + * @retval None + */ +void CAN_TTC_SetTxTrigTBS(M4_CAN_TypeDef *CANx, uint8_t u8TBSlotPtr) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_CAN_TTC_TBS(u8TBSlotPtr)); + MODIFY_REG16(CANx->TRG_CFG, CAN_TRG_CFG_TTPTR, u8TBSlotPtr); +} + +/** + * @brief Get transmit-trigger transmit buffer slot(TBS) of specified CAN unit's time-triggered communication(TTC). + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @retval An uint8_t type value of transmit buffer slot pointer. It is can be a value of @ref CAN_TTC_TBS_Pointer + * @arg CAN_TTC_TBS_PTB: TBS pointer points to PTB. + * @arg CAN_TTC_TBS_STB1: TBS pointer points to STB slot 1. + * @arg CAN_TTC_TBS_STB2: TBS pointer points to STB slot 2. + * @arg CAN_TTC_TBS_STB3: TBS pointer points to STB slot 3. + */ +uint8_t CAN_TTC_GetTxTrigTBS(const M4_CAN_TypeDef *CANx) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + return (uint8_t)(READ_REG16_BIT(CANx->TRG_CFG, CAN_TRG_CFG_TTPTR)); +} + +/** + * @brief Specifies trigger type for time-triggered communication(TTC) of specified CAN unit. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u16TrigType Time-triggered communication trigger type. + * This parameter can be a value of @ref CAN_TTC_Trigger_Type + * @arg CAN_TTC_TRIG_IMMED_TRIG: Immediate trigger for immediate transmission. + * @arg CAN_TTC_TRIG_TIME_TRIG: Time trigger for receive triggers. + * @arg CAN_TTC_TRIG_SSHOT_TRANS_TRIG: Single shot transmit trigger for exclusive time windows. + * @arg CAN_TTC_TRIG_TRANS_START_TRIG: Transmit start trigger for merged arbitrating time windows. + * @arg CAN_TTC_TRIG_TRANS_STOP_TRIG: Transmit stop trigger for merged arbitrating time windows. + * @retval None + */ +void CAN_TTC_SetTrigType(M4_CAN_TypeDef *CANx, uint16_t u16TrigType) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_CAN_TTC_TRIG_TYPE(u16TrigType)); + MODIFY_REG16(CANx->TRG_CFG, CAN_TRG_CFG_TTYPE, u16TrigType); +} + +/** + * @brief Get trigger type of specified CAN unit's time-triggered communication(TTC). + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @retval An uint16_t type value of TTC trigger type. + * @arg CAN_TTC_TRIG_IMMED_TRIG: Immediate trigger for immediate transmission. + * @arg CAN_TTC_TRIG_TIME_TRIG: Time trigger for receive triggers. + * @arg CAN_TTC_TRIG_SSHOT_TRANS_TRIG: Single shot transmit trigger for exclusive time windows. + * @arg CAN_TTC_TRIG_TRANS_START_TRIG: Transmit start trigger for merged arbitrating time windows. + * @arg CAN_TTC_TRIG_TRANS_STOP_TRIG: Transmit stop trigger for merged arbitrating time windows. + */ +uint16_t CAN_TTC_GetTrigType(const M4_CAN_TypeDef *CANx) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + return READ_REG16_BIT(CANx->TRG_CFG, CAN_TRG_CFG_TTYPE); +} + +/** + * @brief Specifies transmission enable window for single shot transmit trigger. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u16TxEnableWindow Number of NTU. Time period within which the transmission of a message may be started. + * @retval None + */ +void CAN_TTC_SetTxEnableWindow(M4_CAN_TypeDef *CANx, uint16_t u16TxEnableWindow) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_CAN_TTC_TX_EN_WINDOW(u16TxEnableWindow)); + u16TxEnableWindow -= 1U; + u16TxEnableWindow = (uint16_t)((uint32_t)u16TxEnableWindow << CAN_TRG_CFG_TEW_POS); + MODIFY_REG16(CANx->TRG_CFG, CAN_TRG_CFG_TEW, u16TxEnableWindow); +} + +/** + * @brief Get transmit enable window of single shot transmit trigger. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @retval An uint16_t type value of Tx_Enable window. + */ +uint16_t CAN_TTC_GetTxEnableWindow(const M4_CAN_TypeDef *CANx) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + return ((CANx->TRG_CFG >> CAN_TRG_CFG_TEW_POS) + 1U); +} + +/** + * @brief Set transmission trigger time for timer-trigger communication(TTC). + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u16TxTrigTime Transmission trigger time. Number of NTU. + * @retval None + */ +void CAN_TTC_SetTxTrigTime(M4_CAN_TypeDef *CANx, uint16_t u16TxTrigTime) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + WRITE_REG16(CANx->TT_TRIG, u16TxTrigTime); +} + +/** + * @brief Get watch trigger time of timer-trigger communication(TTC). + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @retval An uint16_t type value of cycle time. + */ +uint16_t CAN_TTC_GetTxTrigTime(const M4_CAN_TypeDef *CANx) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + return (CANx->TT_TRIG); +} + +/** + * @brief Set cycle time for timer-trigger communication(TTC) watch-trigger. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] u16WatchTrigTime Watch trigger time. Number of NTU. + * @retval None + */ +void CAN_TTC_SetWatchTrigTime(M4_CAN_TypeDef *CANx, uint16_t u16WatchTrigTime) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + WRITE_REG16(CANx->TT_WTRIG, u16WatchTrigTime); +} + +/** + * @brief Get cycle time of timer-trigger communication(TTC) watch-trigger. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @retval An uint16_t type value of cycle time. + */ +uint16_t CAN_TTC_GetWatchTrigTime(const M4_CAN_TypeDef *CANx) +{ + DDL_ASSERT(IS_CAN_UNIT(CANx)); + return (CANx->TT_WTRIG); +} + +/** + * @brief CAN bus transmits data. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] pstcTx Points to a stc_can_tx_t structure type data which stores the frames to be transmitted. + * @param [in] u8TxBufType CAN transmit buffer type. + * This parameter can be a value of @ref CAN_Transmit_Buffer_Type + * @arg CAN_BUF_PTB: Primary transmit buffer. + * @arg CAN_BUF_STB: Secondary transmit buffer. + * @param [in] u8STBTxCtrl STB transmission control. If transmit via PTB, set u8STBTxCtrl to 0. + * This parameter can be a value of @ref CAN_STB_Trans_Control + * @arg CAN_STB_TRANS_ALL: Transmit all of STB slots. + * @arg CAN_STB_TRANS_ONE: Transmit one STB slot. + * @param [in] u32Timeout Timeout value. Set it as zero for transmit in interrupt-mode. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcTx == NULL. + * @arg ErrorBufferFull: The target transmit buffer is full. + * @arg ErrorOperationInProgress: The target transmit buffer is being transmitted. + * @arg ErrorAddressAlignment: Data address is not 4-byte aligned. + * @arg ErrorTimeout: Transmit timeout. + * @arg Error: CAN bus transmission error. + */ +en_result_t CAN_TransData(M4_CAN_TypeDef *CANx, const stc_can_tx_t *pstcTx, + uint8_t u8TxBufType, uint8_t u8STBTxCtrl, uint32_t u32Timeout) +{ + uint32_t i; + uint8_t u8DataSize; + uint8_t u8WordLen; + uint32_t u32Addr; + uint32_t u32TimeCnt; + uint32_t u32SrcDataAddr; + uint32_t u32TBAddr; + uint8_t au8TxEn[2U][2U] = {{CAN_TCMD_TPE, CAN_TCMD_TPE}, \ + {CAN_TCMD_TSALL, CAN_TCMD_TSONE}}; + uint8_t au8Check[2U] = {CAN_RTIF_TPIF, CAN_RTIF_TSIF}; + uint8_t au8DLC2Size[2U][16U] = + { + {0U, 1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 8U, 8U, 8U, 8U, 8U, 8U, 8U}, + {0U, 1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 12U, 16U, 20U, 24U, 32U, 48U, 64U}, + }; + en_result_t enRet = ErrorInvalidParameter; + + if (pstcTx != NULL) + { + DDL_ASSERT(IS_CAN_UNIT(CANx)); + DDL_ASSERT(IS_CAN_TB_TYPE(u8TxBufType)); + DDL_ASSERT(IS_CAN_STB_TX_CTRL(u8STBTxCtrl)); + + u32SrcDataAddr = (uint32_t)pstcTx->pu8Data; + + if ((READ_REG8_BIT(CANx->TCTRL, CAN_TB_STAT_FULL) == CAN_TB_STAT_FULL) && \ + (u8TxBufType == CAN_BUF_STB)) + { + /* All STBs are full. */ + enRet = ErrorBufferFull; + } + else if ((READ_REG8_BIT(CANx->TCMD, CAN_TCMD_TPE) != 0U) && \ + (u8TxBufType == CAN_BUF_PTB)) + { + /* PTB is being transmitted. */ + enRet = ErrorOperationInProgress; + } + else if ((u32SrcDataAddr & 0x03UL) != 0U) + { + enRet = ErrorAddressAlignment; + } + else + { + u8DataSize = au8DLC2Size[pstcTx->FDF][pstcTx->DLC]; + u8WordLen = u8DataSize / 4U; + if ((u8DataSize % 4U) != 0U) + { + u8WordLen += 1U; + } + + /* Specifies the transmit buffer, PTB or STB. */ + u32Addr = (uint32_t)&CANx->TCMD; + BIT_BAND(u32Addr, CAN_TCMD_TBSEL_POS) = (uint32_t)u8TxBufType; + + u32TBAddr = (uint32_t)&CANx->TBUF; + RW_MEM32(u32TBAddr) = pstcTx->u32ID; + RW_MEM32(u32TBAddr + 4U) = pstcTx->u32Ctrl; + + i = 0U; + u32TBAddr += 8U; + while (i < u8WordLen) + { + RW_MEM32(u32TBAddr + i * 4U) = *(uint32_t *)u32SrcDataAddr; + u32SrcDataAddr += 4U; + i++; + } + + if (u8TxBufType == CAN_BUF_STB) + { + /* After writes the data in transmit buffer(TB), sets the TSNEXT bit to indicate that the current \ + STB slot has been filled, so that the hardware will point TB to the next STB slot. */ + SET_REG8_BIT(CANx->TCTRL, CAN_TCTRL_TSNEXT); + } + + /* Enable transmission. */ + SET_REG8_BIT(CANx->TCMD, au8TxEn[u8TxBufType][u8STBTxCtrl]); + + if (u32Timeout == 0U) + { + enRet = Ok; + } + else + { + /* Check transmission. */ + u32TimeCnt = u32Timeout * (HCLK_VALUE / 10U / 1000U); + enRet = ErrorTimeout; + while (u32TimeCnt-- != 0U) + { + if ((CAN_GetStatusVal(CANx) & CAN_FLAG_TX_ERR_MSK) != 0U) + { + enRet = Error; + } + else if (READ_REG8_BIT(CANx->RTIF, au8Check[u8TxBufType]) != 0U) + { + /* Clear the transmit-OK status flag. */ + CANx->RTIF |= au8Check[u8TxBufType]; + enRet = Ok; + } + else + { + /* rsvd */ + } + if (enRet != ErrorTimeout) + { + break; + } + } + } + } + } + + return enRet; +} + +/** + * @brief TTCAN transmits data. For single shot transmit trigger. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [in] pstcTx Points to a stc_can_tx_t structure type data which stores the frames to be transmitted. + * @param [in] u8TBSlot Transmit buffer pointer. + * This parameter can be a value of @ref CAN_TTC_TBS_Pointer + * @arg CAN_TTC_TBS_PTB: Point to PTB. + * @arg CAN_TTC_TBS_STB1: Point to STB slot 1. + * @arg CAN_TTC_TBS_STB2: Point to STB slot 2. + * @arg CAN_TTC_TBS_STB3: Point to STB slot 3. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcTx == NULL. + * @arg ErrorBufferFull: The target transmit buffer is full. + * @arg ErrorAddressAlignment: Data address is not 4-byte aligned. + */ +en_result_t CAN_TTC_TransData(M4_CAN_TypeDef *CANx, const stc_can_tx_t *pstcTx, uint8_t u8TBSlot) +{ + uint32_t i; + uint8_t u8Tmp; + uint8_t u8DataSize; + uint8_t u8WordLen; + uint32_t u32SrcDataAddr; + uint32_t u32TBAddr; + uint8_t au8DLC2Size[2U][16U] = + { + {0U, 1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 8U, 8U, 8U, 8U, 8U, 8U, 8U}, + {0U, 1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 12U, 16U, 20U, 24U, 32U, 48U, 64U}, + }; + en_result_t enRet = ErrorInvalidParameter; + + if (pstcTx != NULL) + { + DDL_ASSERT(IS_CAN_UNIT(CANx)); + + u32SrcDataAddr = (uint32_t)pstcTx->pu8Data; + u8Tmp = CANx->TBSLOT; + WRITE_REG8(CANx->TBSLOT, u8TBSlot); + if (READ_REG8_BIT(CANx->TCTRL, CAN_TB_STAT_FULL) == CAN_TB_STAT_FULL) + { + enRet = ErrorBufferFull; + } + else if (READ_REG8_BIT(CANx->RTIE, CAN_RTIE_TSFF) != 0U) + { + WRITE_REG8(CANx->TBSLOT, CAN_TBSLOT_TBF|u8Tmp); + WRITE_REG16(CANx->TT_TRIG, CANx->TT_TRIG); + enRet = ErrorBufferFull; + } + else if ((u32SrcDataAddr & 0x03UL) != 0U) + { + enRet = ErrorAddressAlignment; + } + else + { + u8DataSize = au8DLC2Size[pstcTx->FDF][pstcTx->DLC]; + u8WordLen = u8DataSize / 4U; + if ((u8DataSize % 4U) != 0U) + { + u8WordLen += 1U; + } + + u32TBAddr = (uint32_t)&CANx->TBUF; + MODIFY_REG16(CANx->TRG_CFG, CAN_TRG_CFG_TTPTR, u8TBSlot); + + RW_MEM32(u32TBAddr) = pstcTx->u32ID; + RW_MEM32(u32TBAddr + 4U) = pstcTx->u32Ctrl; + + i = 0U; + u32TBAddr += 8U; + while (i < u8WordLen) + { + RW_MEM32(u32TBAddr + i * 4U) = *(uint32_t *)u32SrcDataAddr; + u32SrcDataAddr += 4U; + i++; + } + /* Set buffer as filled. */ + SET_REG8_BIT(CANx->TBSLOT, CAN_TBSLOT_TBF); + + /* Write MSB of TT_TRIG to transmit. */ + WRITE_REG16(CANx->TT_TRIG, CANx->TT_TRIG); + + enRet = Ok; + } + } + + return enRet; +} + +/** + * @brief CAN bus receives data. + * @param [in] CANx Pointer to CAN instance register base. + * This parameter can be a value of the following: + * @arg M4_CAN1: CAN unit 1 instance register base. + * @arg M4_CAN2: CAN unit 2 instance register base. + * @param [out] pstcRx Points to a stc_can_rx_t structure type array which is used to \ + * store the received frames. + * @param [out] pu8RxFrameCnt Address to store the number of frames received. + * If you do not need it, set it as NULL.\ + * @param [in] u8RxFrameBufLength The length of the buffer which is used to store the received frames. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: -pstcRx == NULL. + * -u8RxFrameBufLength == 0U. + */ +en_result_t CAN_ReceiveData(M4_CAN_TypeDef *CANx, stc_can_rx_t pstcRx[], uint8_t *pu8RxFrameCnt, uint8_t u8RxFrameBufLength) +{ + uint32_t i; + uint8_t u8DataSize; + uint8_t u8WordLen; + uint8_t u8RxFrameCnt = 0U; + uint32_t u32DestDataAddr; + uint32_t u32RBAddr; + en_result_t enRet; + uint8_t au8DLC2Size[2U][16U] = + { + {0U, 1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 8U, 8U, 8U, 8U, 8U, 8U, 8U}, + {0U, 1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 12U, 16U, 20U, 24U, 32U, 48U, 64U}, + }; + + if ((pstcRx == NULL) || (u8RxFrameBufLength == 0U)) + { + enRet = ErrorInvalidParameter; + } + else + { + enRet = Ok; + while (READ_REG8_BIT(CANx->RCTRL, CAN_RCTRL_RSTAT) != CAN_RB_STAT_EMPTY) + { + u32RBAddr = (uint32_t)&CANx->RBUF; + pstcRx[u8RxFrameCnt].u32ID = RW_MEM32(u32RBAddr); + pstcRx[u8RxFrameCnt].u32Ctrl = RW_MEM32(u32RBAddr + 4U); + + u8DataSize = au8DLC2Size[pstcRx[u8RxFrameCnt].FDF][pstcRx[u8RxFrameCnt].DLC]; + u8WordLen = u8DataSize / 4U; + if ((u8DataSize % 4U) != 0U) + { + u8WordLen += 1U; + } + + u32DestDataAddr = (uint32_t)pstcRx[u8RxFrameCnt].pu8Data; + if (!IS_ADDRESS_ALIGN_WORD(u32DestDataAddr)) + { + enRet = ErrorAddressAlignment; + break; + } + i = 0U; + u32RBAddr += 8U; + while (i < u8WordLen) + { + *(uint32_t *)u32DestDataAddr = RW_MEM32(u32RBAddr + i * 4U); + u32DestDataAddr += 4U; + i++; + } + + /* Set RB to point to the next RB slot. */ + SET_REG8_BIT(CANx->RCTRL, CAN_RCTRL_RREL); + u8RxFrameCnt++; + if (u8RxFrameCnt >= u8RxFrameBufLength) + { + break; + } + } + + if (pu8RxFrameCnt != NULL) + { + *pu8RxFrameCnt = u8RxFrameCnt; + } + } + + return enRet; +} + +/** + * @} + */ + +#endif /* DDL_CAN_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_clk.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_clk.c new file mode 100644 index 0000000000..79efb51eb9 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_clk.c @@ -0,0 +1,1990 @@ +/** + ******************************************************************************* + * @file hc32f4a0_clk.c + * @brief This file provides firmware functions to manage the Clock(CLK). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Zhangxl First version + 2020-07-03 Zhangxl 1. Tpyo + 2. API CLK_SetSysClkSrc() refine + 2020-08-19 Zhangxl 1. Modify formula of PLL clock get API + 2. Zero structure for CLK_PLLxStrucInit() + 2020-08-25 Zhangxl Modify for MISRAC2012-10.1, 10.3 + 2020-10-13 Chengy Add VBAT init at head of CLK_Xtal32Init() + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_clk.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_CLK CLK + * @brief Clock Driver Library + * @{ + */ + +#if (DDL_CLK_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup CLK_Local_Macros CLK Local Macros + * @brief Be able to modify TIMEOUT according to board condition. + * @{ + */ +#define CLK_XTAL_TIMEOUT ((uint32_t)0x1000UL) +#define CLK_XTAL32_TIMEOUT ((uint32_t)0x1000UL) +#define CLK_HRC_TIMEOUT ((uint32_t)0x1000UL) +#define CLK_MRC_TIMEOUT ((uint32_t)0x1000UL) +#define CLK_LRC_TIMEOUT ((uint32_t)0x1000UL) +#define CLK_PLLH_TIMEOUT ((uint32_t)0x1000UL) +#define CLK_PLLA_TIMEOUT ((uint32_t)0x1000UL) + +/** + * @defgroup CLK_Check_Parameters_Validity CLK Check Parameters Validity + * @{ + */ + +/* Check CLK register lock status. */ +#define IS_CLK_UNLOCKED() ((M4_PWC->FPRC & PWC_FPRC_FPRCB0) == PWC_FPRC_FPRCB0) + +/* Check CLK register lock status. */ +#define IS_CLK_SEL_UNLOCKED() ((M4_PWC->FPRC & PWC_FPRC_FPRCB1) == PWC_FPRC_FPRCB1) + +/*! Parameter valid check for XTAL state */ +#define IS_CLK_XTAL_STATE(sta) \ +( ((sta) == CLK_XTAL_OFF) || \ + ((sta) == CLK_XTAL_ON)) + +/*! Parameter valid check for XTAL mode */ +#define IS_CLK_XTAL_MODE(MODE) \ +( ((MODE) == CLK_XTALMODE_OSC) || \ + ((MODE) == CLK_XTALMODE_EXCLK)) + +/*! Parameter valid check for XTAL driver ability mode */ +#define IS_CLK_XTALDRV_MODE(drv) \ +( ((drv) == CLK_XTALDRV_HIGH) || \ + ((drv) == CLK_XTALDRV_MID) || \ + ((drv) == CLK_XTALDRV_LOW) || \ + ((drv) == CLK_XTALDRV_ULOW)) + +/*! Parameter valid check for XTAL stable time selection */ +#define IS_CLK_XTALSTB_SEL(stb) \ +( ((stb) == CLK_XTALSTB_133US) || \ + ((stb) == CLK_XTALSTB_255US) || \ + ((stb) == CLK_XTALSTB_499US) || \ + ((stb) == CLK_XTALSTB_988US) || \ + ((stb) == CLK_XTALSTB_2MS) || \ + ((stb) == CLK_XTALSTB_4MS) || \ + ((stb) == CLK_XTALSTB_8MS) || \ + ((stb) == CLK_XTALSTB_16MS) || \ + ((stb) == CLK_XTALSTB_31MS)) + +/*! Parameter valid check for XTALSTD state */ +#define IS_CLK_XTALSTD_STATE(sta) \ +( ((sta) == CLK_XTALSTD_OFF) || \ + ((sta) == CLK_XTALSTD_ON)) + +/*! Parameter valid check for XTALSTD mode */ +#define IS_CLK_XTALSTD_MODE(mode) \ +( ((mode) == CLK_XTALSTD_MODE_RST) || \ + ((mode) == CLK_XTALSTD_MODE_INT)) + +/*! Parameter valid check for XTALSTD interrupt state */ +#define IS_CLK_XTALSTD_INT_STATE(sta) \ +( ((sta) == CLK_XTALSTD_INT_OFF) || \ + ((sta) == CLK_XTALSTD_INT_ON)) + +/*! Parameter valid check for XTALSTD reset state */ +#define IS_CLK_XTALSTD_RST_STATE(sta) \ +( ((sta) == CLK_XTALSTD_RST_OFF) || \ + ((sta) == CLK_XTALSTD_RST_ON)) + +/*! Parameter valid check for PLLA state */ +#define IS_CLK_PLLA_STATE(sta) \ +( ((sta) == CLK_PLLA_OFF) || \ + ((sta) == CLK_PLLA_ON)) + +/*! Parameter valid check for PLLH state */ +#define IS_CLK_PLLH_STATE(sta) \ +( ((sta) == CLK_PLLH_OFF) || \ + ((sta) == CLK_PLLH_ON)) + +/*! Parameter valid check for XTAL32 state */ +#define IS_CLK_XTAL32_STATE(sta) \ +( ((sta) == CLK_XTAL32_OFF) || \ + ((sta) == CLK_XTAL32_ON)) + +/*! Parameter valid check for XTAL32 driver ability mode */ +#define IS_CLK_XTAL32DRV_MODE(mode) \ +( ((mode) == CLK_XTAL32DRV_MID) || \ + ((mode) == CLK_XTAL32DRV_HIGH)) + +/*! Parameter valid check for XTAL32 filtering selection */ +#define IS_CLK_XTAL32_FILT_SEL(sel) \ +( ((sel) == CLK_XTAL32NF_FULL) || \ + ((sel) == CLK_XTAL32NF_PART) || \ + ((sel) == CLK_XTAL32NF_NONE)) + +/*! Parameter valid check for system clock source */ +#define IS_CLK_SYSCLK_SRC(src) \ +( ((src) == CLK_SYSCLKSOURCE_HRC) || \ + ((src) == CLK_SYSCLKSOURCE_MRC) || \ + ((src) == CLK_SYSCLKSOURCE_LRC) || \ + ((src) == CLK_SYSCLKSOURCE_XTAL) || \ + ((src) == CLK_SYSCLKSOURCE_XTAL32) || \ + ((src) == CLK_SYSCLKSOURCE_PLLH)) + +/*! Parameter validity check for PLL input source */ +#define IS_CLK_PLL_SRC(src) \ +( ((src) == CLK_PLLSRC_XTAL) || \ + ((src) == CLK_PLLSRC_HRC)) + +/*! Parameter validity check for PLLH frequency range */ +#define IS_CLK_PLLH_FREQ(freq) \ +( (CLK_PLLH_FREQ_MIN <= (freq)) && \ + (CLK_PLLH_FREQ_MAX >= (freq))) + +/*! Parameter validity check for PLLH M divide */ +#define IS_CLK_PLLHM_DIV(m) \ +( (CLK_PLLHM_DIV_MIN <= (m)) && \ + (CLK_PLLHM_DIV_MAX >= (m))) + +/*! Parameter validity check for PLLH N multi- */ +#define IS_CLK_PLLHN_MULTI(n) \ +( (CLK_PLLHN_MULTI_MIN <= (n)) && \ + (CLK_PLLHN_MULTI_MAX >= (n))) + +/*! Parameter validity check for PLLH R divide */ +#define IS_CLK_PLLHR_DIV(r) \ +( (CLK_PLLHR_DIV_MIN <= (r)) && \ + (CLK_PLLHR_DIV_MAX >= (r))) + +/*! Parameter validity check for PLLH Q divede */ +#define IS_CLK_PLLHQ_DIV(q) \ +( (CLK_PLLHQ_DIV_MIN <= (q)) && \ + (CLK_PLLHQ_DIV_MAX >= (q))) + +/*! Parameter validity check for PLLH P divide */ +#define IS_CLK_PLLHP_DIV(p) \ +( (CLK_PLLHP_DIV_MIN <= (p)) && \ + (CLK_PLLHP_DIV_MAX >= (p))) + +/*! Parameter validity check for PLLH_input freq./PLLM(vco_in) */ +#define IS_CLK_PLLH_VCO_IN(vco_in) \ +( (CLK_PLLH_VCO_IN_MIN <= (vco_in)) && \ + (CLK_PLLH_VCO_IN_MAX >= (vco_in))) + +/*! Parameter validity check for PLLH vco_in*PLLN(vco_out) */ +#define IS_CLK_PLLH_VCO_OUT(vco_out) \ +( (CLK_PLLH_VCO_OUT_MIN <= (vco_out)) && \ + (CLK_PLLH_VCO_OUT_MAX >= (vco_out))) + +/*! Parameter validity check for PLLA frequency range */ +#define IS_CLK_PLLA_FREQ(freq) \ +( (CLK_PLLA_FREQ_MIN <= (freq)) && \ + (CLK_PLLA_FREQ_MAX >= (freq))) + +/*! Parameter validity check for PLLA M divide */ +#define IS_CLK_PLLAM_DIV(m) \ +( (CLK_PLLAM_DIV_MIN <= (m)) && \ + (CLK_PLLAM_DIV_MAX >= (m))) + +/*! Parameter validity check for PLLA N multi- */ +#define IS_CLK_PLLAN_MULTI(n) \ +( (CLK_PLLAN_MULTI_MIN <= (n)) && \ + (CLK_PLLAN_MULTI_MAX >= (n))) + +/*! Parameter validity check for PLLA R divide */ +#define IS_CLK_PLLAR_DIV(r) \ +( (CLK_PLLAR_DIV_MIN <= (r)) && \ + (CLK_PLLAR_DIV_MAX >= (r))) + +/*! Parameter validity check for PLLA Q divede */ +#define IS_CLK_PLLAQ_DIV(q) \ +( (CLK_PLLAQ_DIV_MIN <= (q)) && \ + (CLK_PLLAQ_DIV_MAX >= (q))) + +/*! Parameter validity check for PLLA P divide */ +#define IS_CLK_PLLAP_DIV(p) \ +( (CLK_PLLAP_DIV_MIN <= (p)) && \ + (CLK_PLLAP_DIV_MAX >= (p))) + +/*! Parameter validity check for PLLA_input freq./PLLM(vco_in) */ +#define IS_CLK_PLLA_VCO_IN(vco_in) \ +( (CLK_PLLA_VCO_IN_MIN <= (vco_in)) && \ + (CLK_PLLA_VCO_IN_MAX >= (vco_in))) + +/*! Parameter validity check for PLLA vco_in*PLLN(vco_out) */ +#define IS_CLK_PLLA_VCO_OUT(vco_out) \ +( (CLK_PLLA_VCO_OUT_MIN <= (vco_out)) && \ + (CLK_PLLA_VCO_OUT_MAX >= (vco_out))) + +/*! Parameter valid check for CLK stable flag. */ +#define IS_CLK_STB_FLAG(flag) \ +( ((flag) != 0x00U) && \ + (((flag) | CLK_STB_FLAG_MASK) == CLK_STB_FLAG_MASK)) + +/*! Parameter valid check for clock category */ +#define IS_CLK_CATE(cate) (((cate) & CLK_CATE_ALL) != (uint8_t)(0x00U)) + +/*! Parameter valid check for HCLK divider */ +#define IS_CLK_HCLK_DIV(div) \ +( ((div) == CLK_HCLK_DIV1) || \ + ((div) == CLK_HCLK_DIV2) || \ + ((div) == CLK_HCLK_DIV4) || \ + ((div) == CLK_HCLK_DIV8) || \ + ((div) == CLK_HCLK_DIV16) || \ + ((div) == CLK_HCLK_DIV32) || \ + ((div) == CLK_HCLK_DIV64)) + +/*! Parameter valid check for EXCLK divider */ +#define IS_CLK_EXCLK_DIV(div) \ +( ((div) == CLK_EXCLK_DIV1) || \ + ((div) == CLK_EXCLK_DIV2) || \ + ((div) == CLK_EXCLK_DIV4) || \ + ((div) == CLK_EXCLK_DIV8) || \ + ((div) == CLK_EXCLK_DIV16) || \ + ((div) == CLK_EXCLK_DIV32) || \ + ((div) == CLK_EXCLK_DIV64)) + +/*! Parameter valid check for PCLK0 divider */ +#define IS_CLK_PCLK0_DIV(div) \ +( ((div) == CLK_PCLK0_DIV1) || \ + ((div) == CLK_PCLK0_DIV2) || \ + ((div) == CLK_PCLK0_DIV4) || \ + ((div) == CLK_PCLK0_DIV8) || \ + ((div) == CLK_PCLK0_DIV16) || \ + ((div) == CLK_PCLK0_DIV32) || \ + ((div) == CLK_PCLK0_DIV64)) + +/*! Parameter valid check for PCLK1 divider */ +#define IS_CLK_PCLK1_DIV(div) \ +( ((div) == CLK_PCLK1_DIV1) || \ + ((div) == CLK_PCLK1_DIV2) || \ + ((div) == CLK_PCLK1_DIV4) || \ + ((div) == CLK_PCLK1_DIV8) || \ + ((div) == CLK_PCLK1_DIV16) || \ + ((div) == CLK_PCLK1_DIV32) || \ + ((div) == CLK_PCLK1_DIV64)) + +/*! Parameter valid check for PCLK2 divider */ +#define IS_CLK_PCLK2_DIV(div) \ +( ((div) == CLK_PCLK2_DIV1) || \ + ((div) == CLK_PCLK2_DIV2) || \ + ((div) == CLK_PCLK2_DIV4) || \ + ((div) == CLK_PCLK2_DIV8) || \ + ((div) == CLK_PCLK2_DIV16) || \ + ((div) == CLK_PCLK2_DIV32) || \ + ((div) == CLK_PCLK2_DIV64)) + +/*! Parameter valid check for PCLK3 divider */ +#define IS_CLK_PCLK3_DIV(div) \ +( ((div) == CLK_PCLK3_DIV1) || \ + ((div) == CLK_PCLK3_DIV2) || \ + ((div) == CLK_PCLK3_DIV4) || \ + ((div) == CLK_PCLK3_DIV8) || \ + ((div) == CLK_PCLK3_DIV16) || \ + ((div) == CLK_PCLK3_DIV32) || \ + ((div) == CLK_PCLK3_DIV64)) + +/*! Parameter valid check for PCLK4 divider */ +#define IS_CLK_PCLK4_DIV(div) \ +( ((div) == CLK_PCLK4_DIV1) || \ + ((div) == CLK_PCLK4_DIV2) || \ + ((div) == CLK_PCLK4_DIV4) || \ + ((div) == CLK_PCLK4_DIV8) || \ + ((div) == CLK_PCLK4_DIV16) || \ + ((div) == CLK_PCLK4_DIV32) || \ + ((div) == CLK_PCLK4_DIV64)) + +/*! Parameter valid check for USB clock source */ +#define IS_CLK_USB_CLK(src) \ +( ((src) == CLK_USB_CLK_MCLK_DIV2) || \ + ((src) == CLK_USB_CLK_MCLK_DIV3) || \ + ((src) == CLK_USB_CLK_MCLK_DIV4) || \ + ((src) == CLK_USB_CLK_MCLK_DIV5) || \ + ((src) == CLK_USB_CLK_MCLK_DIV6) || \ + ((src) == CLK_USB_CLK_MCLK_DIV7) || \ + ((src) == CLK_USB_CLK_MCLK_DIV8) || \ + ((src) == CLK_USB_CLK_PLLHQ) || \ + ((src) == CLK_USB_CLK_PLLHR) || \ + ((src) == CLK_USB_CLK_PLLAP) || \ + ((src) == CLK_USB_CLK_PLLAQ) || \ + ((src) == CLK_USB_CLK_PLLAR)) + +/*! Parameter valid check for CAN clock source */ +#define IS_CLK_CAN_CLK(src) \ +( ((src) == CLK_CAN1_CLK_MCLK_DIV2) || \ + ((src) == CLK_CAN1_CLK_MCLK_DIV3) || \ + ((src) == CLK_CAN1_CLK_MCLK_DIV4) || \ + ((src) == CLK_CAN1_CLK_MCLK_DIV5) || \ + ((src) == CLK_CAN1_CLK_MCLK_DIV6) || \ + ((src) == CLK_CAN1_CLK_MCLK_DIV7) || \ + ((src) == CLK_CAN1_CLK_MCLK_DIV8) || \ + ((src) == CLK_CAN1_CLK_PLLHQ) || \ + ((src) == CLK_CAN1_CLK_PLLHR) || \ + ((src) == CLK_CAN1_CLK_PLLAP) || \ + ((src) == CLK_CAN1_CLK_PLLAQ) || \ + ((src) == CLK_CAN1_CLK_PLLAR) || \ + ((src) == CLK_CAN1_CLK_XTAL) || \ + ((src) == CLK_CAN2_CLK_MCLK_DIV2) || \ + ((src) == CLK_CAN2_CLK_MCLK_DIV3) || \ + ((src) == CLK_CAN2_CLK_MCLK_DIV4) || \ + ((src) == CLK_CAN2_CLK_MCLK_DIV5) || \ + ((src) == CLK_CAN2_CLK_MCLK_DIV6) || \ + ((src) == CLK_CAN2_CLK_MCLK_DIV7) || \ + ((src) == CLK_CAN2_CLK_MCLK_DIV8) || \ + ((src) == CLK_CAN2_CLK_PLLHQ) || \ + ((src) == CLK_CAN2_CLK_PLLHR) || \ + ((src) == CLK_CAN2_CLK_PLLAP) || \ + ((src) == CLK_CAN2_CLK_PLLAQ) || \ + ((src) == CLK_CAN2_CLK_PLLAR) || \ + ((src) == CLK_CAN2_CLK_XTAL)) + +/*! Parameter valid check for CAN channel for clock source config */ +#define IS_CLK_CAN_CH(ch) (((ch) & CLK_CAN_CH_ALL) != (uint8_t)(0x00U)) + +/*! Parameter valid check for I2S clock source */ +#define IS_CLK_I2S_CLK(src) \ +( ((src) == CLK_I2S1_CLK_PCLK) || \ + ((src) == CLK_I2S1_CLK_PLLHQ) || \ + ((src) == CLK_I2S1_CLK_PLLHR) || \ + ((src) == CLK_I2S1_CLK_PLLAP) || \ + ((src) == CLK_I2S1_CLK_PLLAQ) || \ + ((src) == CLK_I2S1_CLK_PLLAR) || \ + ((src) == CLK_I2S2_CLK_PCLK) || \ + ((src) == CLK_I2S2_CLK_PLLHQ) || \ + ((src) == CLK_I2S2_CLK_PLLHR) || \ + ((src) == CLK_I2S2_CLK_PLLAP) || \ + ((src) == CLK_I2S2_CLK_PLLAQ) || \ + ((src) == CLK_I2S2_CLK_PLLAR) || \ + ((src) == CLK_I2S3_CLK_PCLK) || \ + ((src) == CLK_I2S3_CLK_PLLHQ) || \ + ((src) == CLK_I2S3_CLK_PLLHR) || \ + ((src) == CLK_I2S3_CLK_PLLAP) || \ + ((src) == CLK_I2S3_CLK_PLLAQ) || \ + ((src) == CLK_I2S3_CLK_PLLAR) || \ + ((src) == CLK_I2S4_CLK_PCLK) || \ + ((src) == CLK_I2S4_CLK_PLLHQ) || \ + ((src) == CLK_I2S4_CLK_PLLHR) || \ + ((src) == CLK_I2S4_CLK_PLLAP) || \ + ((src) == CLK_I2S4_CLK_PLLAQ) || \ + ((src) == CLK_I2S4_CLK_PLLAR)) + +/*! Parameter valid check for I2S channel for clock source config */ +#define IS_CLK_I2S_CH(ch) (((ch) & CLK_I2S_CH_ALL) != (uint8_t)(0x00U)) + +/*! Parameter valid check for PCLK2/PCLK4 source */ +#define IS_CLK_PERI_CLK(src) \ +( ((src) == CLK_PERI_CLK_PCLK) || \ + ((src) == CLK_PERI_CLK_PLLHQ) || \ + ((src) == CLK_PERI_CLK_PLLHR) || \ + ((src) == CLK_PERI_CLK_PLLAP) || \ + ((src) == CLK_PERI_CLK_PLLAQ) || \ + ((src) == CLK_PERI_CLK_PLLAR)) + +/*! Parameter valid check for TPIU clock divider */ +#define IS_CLK_TPIU_CLK_DIV(div) \ +( ((div) == CLK_TPIU_CLK_DIV1) || \ + ((div) == CLK_TPIU_CLK_DIV2) || \ + ((div) == CLK_TPIU_CLK_DIV4)) + +/*! Parameter valid check for CLK MCO clock source. */ +#define IS_CLK_MCOSOURCE(src) \ +( ((src) == CLK_MCOSOURCCE_HRC) || \ + ((src) == CLK_MCOSOURCCE_MRC) || \ + ((src) == CLK_MCOSOURCCE_LRC) || \ + ((src) == CLK_MCOSOURCCE_XTAL) || \ + ((src) == CLK_MCOSOURCCE_XTAL32) || \ + ((src) == CLK_MCOSOURCCE_PLLHP) || \ + ((src) == CLK_MCOSOURCCE_PLLHQ) || \ + ((src) == CLK_MCOSOURCCE_PLLAP) || \ + ((src) == CLK_MCOSOURCCE_PLLAQ) || \ + ((src) == CLK_MCOSOURCCE_PLLAR) || \ + ((src) == CLK_MCOSOURCCE_SYSCLK)) + +/*! Parameter valid check for CLK MCO clock divider. */ +#define IS_CLK_MCODIV(div) \ +( ((div) == CLK_MCO_DIV1) || \ + ((div) == CLK_MCO_DIV2) || \ + ((div) == CLK_MCO_DIV4) || \ + ((div) == CLK_MCO_DIV8) || \ + ((div) == CLK_MCO_DIV16) || \ + ((div) == CLK_MCO_DIV32) || \ + ((div) == CLK_MCO_DIV64) || \ + ((div) == CLK_MCO_DIV128)) + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup CLK_Global_Functions CLK Global Functions + * @{ + */ +/** + * @brief Set PLLH/A source clock. + * @param [in] u32PllSrc PLLH/A source clock. + * @arg CLK_PLLSRC_XTAL + * @arg CLK_PLLSRC_HRC + * @retval None + */ +void CLK_SetPLLSrc(uint32_t u32PllSrc) +{ + DDL_ASSERT(IS_CLK_PLL_SRC(u32PllSrc)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + + WRITE_REG32(bM4_CMU->PLLHCFGR_b.PLLSRC, u32PllSrc); +} + +/** + * @brief Init PLLA initial structure with default value. + * @param [in] pstcPLLAInit specifies the Parameter of PLLA. + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: NULL pointer + */ +en_result_t CLK_PLLAStrucInit(stc_clk_plla_init_t* pstcPLLAInit) +{ + en_result_t enRet = Ok; + + /* Check if pointer is NULL */ + if (NULL == pstcPLLAInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Configure to default value */ + pstcPLLAInit->PLLCFGR = 0UL; + pstcPLLAInit->u8PLLState = CLK_PLLA_OFF; + pstcPLLAInit->PLLCFGR_f.PLLP = CLK_PLLAP_DFT; + pstcPLLAInit->PLLCFGR_f.PLLQ = CLK_PLLAQ_DFT; + pstcPLLAInit->PLLCFGR_f.PLLR = CLK_PLLAR_DFT; + pstcPLLAInit->PLLCFGR_f.PLLN = CLK_PLLAN_DFT; + pstcPLLAInit->PLLCFGR_f.PLLM = CLK_PLLAM_DFT; + } + return enRet; +} + +/** + * @brief PLLA Initialize. + * @param [in] pstcPLLAInit specifies the structure of PLLA initial config. + * @arg u8PLLState : The new state of the PLLA. + * @arg PLLCFGR : PLLA config. + * @retval en_result_t + * OK, PLLA initial successfully + * ErrorTimeout, PLLA initial timeout + * ErrorInvalidParameter, NULL pointer + * @note The pll_input/PLLM (VCOIN) must between 1 ~ 24MHz. + * The VCOIN*PLLN (VCOOUT) is between 240 ~ 480MHz. + * The PLLA frequency (VCOOUT/PLLAP_Q_R) is between 15 ~ 240MHz. + */ +en_result_t CLK_PLLAInit(const stc_clk_plla_init_t *pstcPLLAInit) +{ + en_result_t enRet; + +#ifdef __DEBUG + uint32_t vcoIn; + uint32_t vcoOut; +#endif + + if (NULL == pstcPLLAInit) + { + enRet = ErrorInvalidParameter; + } + else + { +#ifdef __DEBUG + DDL_ASSERT(IS_CLK_PLLAM_DIV(pstcPLLAInit->PLLCFGR_f.PLLM + 1UL)); + DDL_ASSERT(IS_CLK_PLLAN_MULTI(pstcPLLAInit->PLLCFGR_f.PLLN + 1UL)); + DDL_ASSERT(IS_CLK_PLLAR_DIV(pstcPLLAInit->PLLCFGR_f.PLLR + 1UL)); + DDL_ASSERT(IS_CLK_PLLAQ_DIV(pstcPLLAInit->PLLCFGR_f.PLLQ + 1UL)); + DDL_ASSERT(IS_CLK_PLLAP_DIV(pstcPLLAInit->PLLCFGR_f.PLLP + 1UL)); + + vcoIn = ((CLK_PLLSRC_XTAL == bM4_CMU->PLLHCFGR_b.PLLSRC ? + XTAL_VALUE : HRC_VALUE) / (pstcPLLAInit->PLLCFGR_f.PLLM + 1UL)); + vcoOut = vcoIn * (pstcPLLAInit->PLLCFGR_f.PLLN + 1UL); + + DDL_ASSERT(IS_CLK_PLLA_VCO_IN(vcoIn)); + DDL_ASSERT(IS_CLK_PLLA_VCO_OUT(vcoOut)); + DDL_ASSERT(IS_CLK_PLLA_FREQ(vcoOut/(pstcPLLAInit->PLLCFGR_f.PLLR + 1UL))); + DDL_ASSERT(IS_CLK_PLLA_FREQ(vcoOut/(pstcPLLAInit->PLLCFGR_f.PLLQ + 1UL))); + DDL_ASSERT(IS_CLK_PLLA_FREQ(vcoOut/(pstcPLLAInit->PLLCFGR_f.PLLP + 1UL))); +#endif + DDL_ASSERT(IS_CLK_PLLA_STATE(pstcPLLAInit->u8PLLState)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + + WRITE_REG32(M4_CMU->PLLACFGR, pstcPLLAInit->PLLCFGR); + + if (CLK_PLLA_ON == pstcPLLAInit->u8PLLState) + { + enRet = CLK_PLLACmd(Enable); + } + else + { + enRet = CLK_PLLACmd(Disable); + } + } + return enRet; +} + +/** + * @brief Init PLLH initial structure with default value. + * @param [in] pstcPLLHInit specifies the Parameter of PLLH. + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: NULL pointer + */ +en_result_t CLK_PLLHStrucInit(stc_clk_pllh_init_t* pstcPLLHInit) +{ + en_result_t enRet = Ok; + + /* Check if pointer is NULL */ + if (NULL == pstcPLLHInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Configure to default value */ + pstcPLLHInit->PLLCFGR = 0UL; + pstcPLLHInit->u8PLLState = CLK_PLLH_OFF; + pstcPLLHInit->PLLCFGR_f.PLLP = CLK_PLLHP_DFT; + pstcPLLHInit->PLLCFGR_f.PLLQ = CLK_PLLHQ_DFT; + pstcPLLHInit->PLLCFGR_f.PLLR = CLK_PLLHR_DFT; + pstcPLLHInit->PLLCFGR_f.PLLN = CLK_PLLHN_DFT; + pstcPLLHInit->PLLCFGR_f.PLLM = CLK_PLLHM_DFT; + pstcPLLHInit->PLLCFGR_f.PLLSRC = CLK_PLLSRC_XTAL; + } + return enRet; +} + +/** + * @brief PLLH initialize. + * @param [in] pstcPLLHInit specifies the structure of PLLH initial config. + * @arg u8PLLState : The new state of the PLLH. + * @arg PLLCFGR : PLLH config. + * @retval en_result_t + * OK, PLLH initial successfully + * ErrorTimeout, PLLH initial timeout + * ErrorNotReady, PLLH is the source clock, CANNOT stop it. + * ErrorInvalidParameter, NULL pointer + * @note The pll_input/PLLM (VCOIN) must between 8 ~ 24MHz. + * The VCOIN*PLLN (VCOOUT) is between 600 ~ 1200MHz. + * The PLLH frequency (VCOOUT/PLLHP_Q_R) is between 40 ~ 240MHz. + */ +en_result_t CLK_PLLHInit(const stc_clk_pllh_init_t *pstcPLLHInit) +{ + en_result_t enRet; + +#ifdef __DEBUG + uint32_t vcoIn; + uint32_t vcoOut; +#endif + + if (NULL == pstcPLLHInit) + { + enRet = ErrorInvalidParameter; + } + else + { +#ifdef __DEBUG + DDL_ASSERT(IS_CLK_PLLHM_DIV(pstcPLLHInit->PLLCFGR_f.PLLM + 1UL)); + DDL_ASSERT(IS_CLK_PLLHN_MULTI(pstcPLLHInit->PLLCFGR_f.PLLN + 1UL)); + DDL_ASSERT(IS_CLK_PLLHR_DIV(pstcPLLHInit->PLLCFGR_f.PLLR + 1UL)); + DDL_ASSERT(IS_CLK_PLLHQ_DIV(pstcPLLHInit->PLLCFGR_f.PLLQ + 1UL)); + DDL_ASSERT(IS_CLK_PLLHP_DIV(pstcPLLHInit->PLLCFGR_f.PLLP + 1UL)); + DDL_ASSERT(IS_CLK_PLL_SRC(pstcPLLHInit->PLLCFGR_f.PLLSRC)); + + vcoIn = ((CLK_PLLSRC_XTAL == pstcPLLHInit->PLLCFGR_f.PLLSRC ? + XTAL_VALUE : HRC_VALUE) / (pstcPLLHInit->PLLCFGR_f.PLLM + 1UL)); + vcoOut = vcoIn * (pstcPLLHInit->PLLCFGR_f.PLLN + 1UL); + + DDL_ASSERT(IS_CLK_PLLH_VCO_IN(vcoIn)); + DDL_ASSERT(IS_CLK_PLLH_VCO_OUT(vcoOut)); + DDL_ASSERT(IS_CLK_PLLH_FREQ(vcoOut/(pstcPLLHInit->PLLCFGR_f.PLLR + 1UL))); + DDL_ASSERT(IS_CLK_PLLH_FREQ(vcoOut/(pstcPLLHInit->PLLCFGR_f.PLLQ + 1UL))); + DDL_ASSERT(IS_CLK_PLLH_FREQ(vcoOut/(pstcPLLHInit->PLLCFGR_f.PLLP + 1UL))); +#endif + DDL_ASSERT(IS_CLK_PLLH_STATE(pstcPLLHInit->u8PLLState)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + + /* set PLL source in advance */ + WRITE_REG32(bM4_CMU->PLLHCFGR_b.PLLSRC, pstcPLLHInit->PLLCFGR_f.PLLSRC); + WRITE_REG32(M4_CMU->PLLHCFGR, pstcPLLHInit->PLLCFGR); + + if (CLK_PLLH_ON == pstcPLLHInit->u8PLLState) + { + enRet = CLK_PLLHCmd(Enable); + } + else + { + enRet = CLK_PLLHCmd(Disable); + } + } + + return enRet; +} + +/** + * @brief Init Xtal initial structure with default value. + * @param [in] pstcXtalInit specifies the Parameter of XTAL. + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: NULL pointer + */ +en_result_t CLK_XtalStrucInit(stc_clk_xtal_init_t* pstcXtalInit) +{ + en_result_t enRet = Ok; + + /* Check if pointer is NULL */ + if (NULL == pstcXtalInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Configure to default value */ + pstcXtalInit->u8XtalState = CLK_XTAL_OFF; + pstcXtalInit->u8XtalMode = CLK_XTALMODE_OSC; + pstcXtalInit->u8XtalDrv = CLK_XTALDRV_HIGH; + pstcXtalInit->u8XtalStb = CLK_XTALSTB_2MS; + } + + return enRet; +} + +/** + * @brief XTAL initialize. + * @param [in] pstcXtalInit specifies the XTAL initial config. + * @arg u8XtalState : The new state of the XTAL. + * @arg u8XtalDrv : The XTAL drive ability. + * @arg u8XtalMode : The XTAL mode selection osc or exclk. + * @arg u8XtalStb : The XTAL stable time selection. + * @retval en_result_t + * OK, XTAL intial successfully. + * ErrorTimeout, XTAL operate timeout. + * ErrorNotReady, XTAL is the system clock, CANNOT stop it. + * ErrorInvalidParameter, NULL pointer. + * @note DO NOT STOP XTAL while using it as system clock. + */ +en_result_t CLK_XtalInit(const stc_clk_xtal_init_t *pstcXtalInit) +{ + en_result_t enRet; + + if (NULL == pstcXtalInit) + { + enRet = ErrorInvalidParameter; + } + else + { + DDL_ASSERT(IS_CLK_XTAL_STATE(pstcXtalInit->u8XtalState)); + DDL_ASSERT(IS_CLK_XTALDRV_MODE(pstcXtalInit->u8XtalDrv)); + DDL_ASSERT(IS_CLK_XTAL_MODE(pstcXtalInit->u8XtalMode)); + DDL_ASSERT(IS_CLK_XTALSTB_SEL(pstcXtalInit->u8XtalStb)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + + WRITE_REG8(M4_CMU->XTALSTBCR, pstcXtalInit->u8XtalStb); + WRITE_REG8(M4_CMU->XTALCFGR, (0x80U | pstcXtalInit->u8XtalDrv | pstcXtalInit->u8XtalMode)); + + if (CLK_XTAL_ON == pstcXtalInit->u8XtalState) + { + enRet = CLK_XtalCmd(Enable); + } + else + { + enRet = CLK_XtalCmd(Disable); + } + } + + return enRet; +} + +/** + * @brief Init Xtal32 initial structure with default value. + * @param [in] pstcXtal32Init specifies the Parameter of XTAL32. + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: NULL pointer + */ +en_result_t CLK_Xtal32StrucInit(stc_clk_xtal32_init_t* pstcXtal32Init) +{ + en_result_t enRet = Ok; + + /* Check if pointer is NULL */ + if (NULL == pstcXtal32Init) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Configure to default value */ + pstcXtal32Init->u8Xtal32State = CLK_XTAL32_OFF; + pstcXtal32Init->u8Xtal32Drv = CLK_XTAL32DRV_MID; + pstcXtal32Init->u8Xtal32NF = CLK_XTAL32NF_FULL; + } + + return enRet; +} + +/** + * @brief XTAL32 initialize. + * @param [in] pstcXtal32Init specifies the XTAL32 initial config. + * @arg u8Xtal32State : The new state of the XTAL32. + * @arg u8Xtal32Drv : The XTAL32 drive capacity. + * @arg u8Xtal32NF : The XTAL32 nosie filter on or off. + * @retval en_result_t + * OK, XTAL32 intial successfully. + * ErrorNotReady, XTAL32 is the system clock, CANNOT stop it. + * ErrorInvalidParameter, NULL pointer. + * @note DO NOT STOP XTAL32 while using it as system clock. + */ +en_result_t CLK_Xtal32Init(const stc_clk_xtal32_init_t *pstcXtal32Init) +{ + en_result_t enRet; + + if (NULL == pstcXtal32Init) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Parameters check */ + DDL_ASSERT(IS_CLK_XTAL32DRV_MODE(pstcXtal32Init->u8Xtal32Drv)); + DDL_ASSERT(IS_CLK_XTAL32_FILT_SEL(pstcXtal32Init->u8Xtal32NF)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + DDL_ASSERT(IS_CLK_SEL_UNLOCKED()); + + WRITE_REG8(M4_PWC->VBATRSTR, 0xA5U); + WRITE_REG8(M4_CMU->XTAL32CFGR, pstcXtal32Init->u8Xtal32Drv); + WRITE_REG8(M4_CMU->XTAL32NFR, pstcXtal32Init->u8Xtal32NF); + + if (CLK_XTAL32_ON == pstcXtal32Init->u8Xtal32State) + { + enRet = CLK_Xtal32Cmd(Enable); + } + else + { + enRet = CLK_Xtal32Cmd(Disable); + } + } + + return enRet; +} + +/** + * @brief XTAL function enable/disbale. + * @param [in] enNewState specifies the new state of XTAL. + * @arg Enable + * @arg Disable + * @retval en_result_t + * OK, XTAL operate successfully + * ErrorNotReady, XTAL is the system clock or as the PLL source clock, + * CANNOT stop it. + * ErrorTimeout, XTAL operate timeout. + * @note DO NOT STOP XTAL while using it as system clock or as the PLL source clock. + */ +en_result_t CLK_XtalCmd(en_functional_state_t enNewState) +{ + + en_result_t enRet = Ok; + __IO uint32_t timeout = 0UL; + + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + + if (Disable == enNewState) + { + if (CLK_SYSCLKSOURCE_XTAL == READ_REG8_BIT(M4_CMU->CKSWR, CMU_CKSWR_CKSW)) + { + enRet = ErrorNotReady; + } + /* XTAL as PLL clock source and PLL is working */ + else if (0UL == bM4_CMU->PLLHCFGR_b.PLLSRC) + { + if (0UL == bM4_CMU->PLLHCR_b.PLLHOFF) + { + enRet = ErrorNotReady; + } + else + { + WRITE_REG32(bM4_CMU->XTALCR_b.XTALSTP, CLK_XTAL_OFF); + } + } + else + { + WRITE_REG32(bM4_CMU->XTALCR_b.XTALSTP, CLK_XTAL_OFF); + } + } + else + { + WRITE_REG32(bM4_CMU->XTALCR_b.XTALSTP, CLK_XTAL_ON); + + enRet = ErrorTimeout; + while (timeout <= CLK_XTAL_TIMEOUT) + { + if (Set == CLK_GetStableStatus(CMU_OSCSTBSR_XTALSTBF)) + { + enRet = Ok; + break; + } + timeout++; + } + } + + return enRet; +} + +/** + * @brief XTAL32 function enable/disbale. + * @param [in] enNewState specifies the new state of XTAL32. + * @arg Enable + * @arg Disable + * @retval en_result_t + * OK, XTAL32 operate successfully + * ErrorNotReady, XTAL32 is the system clock, CANNOT stop it. + * @note DO NOT STOP XTAL32 while using it as system clock. + */ +en_result_t CLK_Xtal32Cmd(en_functional_state_t enNewState) +{ + en_result_t enRet = Ok; + __IO uint32_t timeout = 0UL; + + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + + if (Disable == enNewState) + { + if (CLK_SYSCLKSOURCE_XTAL32 == READ_REG8_BIT(M4_CMU->CKSWR, CMU_CKSWR_CKSW)) + { + enRet = ErrorNotReady; + } + else + { + WRITE_REG32(bM4_CMU->XTAL32CR_b.XTAL32STP, CLK_XTAL32_OFF); + } + } + else + { + WRITE_REG32(bM4_CMU->XTAL32CR_b.XTAL32STP, CLK_XTAL32_ON); + + while (timeout <= CLK_XTAL32_TIMEOUT) + { + timeout++; + } + } + + return enRet; +} + +/** + * @brief HRC function enable/disbale. + * @param [in] enNewState specifies the new state of HRC. + * @arg Enable + * @arg Disable + * @retval en_result_t + * OK, HRC operate successfully + * ErrorNotReady, HRC is the system clock or as the PLL source clock, + * CANNOT stop it. + * ErrorTimeout, HRC operate timeout + * @note DO NOT STOP HRC while using it as system clock or as the PLL source clock. + */ +en_result_t CLK_HrcCmd(en_functional_state_t enNewState) +{ + en_result_t enRet = Ok; + __IO uint32_t timeout = 0UL; + + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + + if (Disable == enNewState) + { + if (CLK_SYSCLKSOURCE_HRC == READ_REG8_BIT(M4_CMU->CKSWR, CMU_CKSWR_CKSW)) + { + enRet = ErrorNotReady; + } + /* HRC as PLL clock source and PLL is working */ + else if (1UL == bM4_CMU->PLLHCFGR_b.PLLSRC) + { + if (0UL == bM4_CMU->PLLHCR_b.PLLHOFF) + { + enRet = ErrorNotReady; + } + else + { + WRITE_REG32(bM4_CMU->HRCCR_b.HRCSTP, CLK_HRC_OFF); + } + } + else + { + WRITE_REG32(bM4_CMU->HRCCR_b.HRCSTP, CLK_HRC_OFF); + } + } + else + { + WRITE_REG32(bM4_CMU->HRCCR_b.HRCSTP, CLK_HRC_ON); + + enRet = ErrorTimeout; + while (timeout <= CLK_HRC_TIMEOUT) + { + if (Set == CLK_GetStableStatus(CMU_OSCSTBSR_HRCSTBF)) + { + enRet = Ok; + break; + } + timeout++; + } + } + + return enRet; +} + +/** + * @brief MRC function enable/disbale. + * @param [in] enNewState specifies the new state of MRC. + * @arg Enable + * @arg Disable + * @retval en_result_t + * OK, MRC operate successfully + * ErrorNotReady, MRC is the system clock, CANNOT stop it. + * @note DO NOT STOP MRC while using it as system clock. + */ +en_result_t CLK_MrcCmd(en_functional_state_t enNewState) +{ + en_result_t enRet = Ok; + __IO uint32_t timeout = 0UL; + + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + + if (Disable == enNewState) + { + if (CLK_SYSCLKSOURCE_MRC == READ_REG8_BIT(M4_CMU->CKSWR, CMU_CKSWR_CKSW)) + { + enRet = ErrorNotReady; + } + else + { + WRITE_REG32(bM4_CMU->MRCCR_b.MRCSTP, CLK_MRC_OFF); + } + } + else + { + WRITE_REG32(bM4_CMU->MRCCR_b.MRCSTP, CLK_MRC_ON); + + while (timeout <= CLK_MRC_TIMEOUT) + { + timeout++; + } + } + + return enRet; +} + +/** + * @brief LRC function enable/disbale. + * @param [in] enNewState specifies the new state of LRC. + * @arg Enable + * @arg Disable + * @retval en_result_t + * OK, LRC operate successfully + * ErrorNotReady, LRC is the system clock, CANNOT stop it. + * @note DO NOT STOP LRC while using it as system clock. + */ +en_result_t CLK_LrcCmd(en_functional_state_t enNewState) +{ + en_result_t enRet = Ok; + __IO uint32_t timeout = 0UL; + + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + + if (Disable == enNewState) + { + if (CLK_SYSCLKSOURCE_LRC == READ_REG8_BIT(M4_CMU->CKSWR, CMU_CKSWR_CKSW)) + { + enRet = ErrorNotReady; + } + else + { + WRITE_REG32(bM4_CMU->LRCCR_b.LRCSTP, CLK_LRC_OFF); + } + } + else + { + WRITE_REG32(bM4_CMU->LRCCR_b.LRCSTP, CLK_LRC_ON); + + while (timeout <= CLK_LRC_TIMEOUT) + { + timeout++; + } + } + + return enRet; +} + +/** + * @brief PLLA function enable/disbale. + * @param [in] enNewState specifies the new state of PLLA. + * @arg Enable + * @arg Disable + * @retval en_result_t + * OK, PLLA operate successfully + * ErrorTimeout, PLLA operate timeout + * @note + */ +en_result_t CLK_PLLACmd(en_functional_state_t enNewState) +{ + en_result_t enRet = Ok; + __IO uint32_t timeout = 0UL; + + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + + if (Disable == enNewState) + { + WRITE_REG32(bM4_CMU->PLLACR_b.PLLAOFF, CLK_PLLA_OFF); + } + else + { + WRITE_REG32(bM4_CMU->PLLACR_b.PLLAOFF, CLK_PLLA_ON); + + enRet = ErrorTimeout; + while (timeout <= CLK_PLLA_TIMEOUT) + { + if (Set == CLK_GetStableStatus(CMU_OSCSTBSR_PLLASTBF)) + { + enRet = Ok; + break; + } + timeout++; + } + } + + return enRet; +} + +/** + * @brief PLLH function enable/disbale. + * @param [in] enNewState specifies the new state of PLLH. + * @arg Enable + * @arg Disable + * @retval en_result_t + * OK, PLLH operate successfully + * ErrorNotReady, PLLH is the system clock, CANNOT stop it. + * ErrorTimeout, PLLH operate timeout + * @note DO NOT STOP PLLH while using it as system clock. + */ +en_result_t CLK_PLLHCmd(en_functional_state_t enNewState) +{ + en_result_t enRet = Ok; + __IO uint32_t timeout = 0UL; + + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + + if (Disable == enNewState) + { + if (CLK_SYSCLKSOURCE_PLLH == READ_REG8_BIT(M4_CMU->CKSWR, CMU_CKSWR_CKSW)) + { + enRet = ErrorNotReady; + } + else + { + WRITE_REG32(bM4_CMU->PLLHCR_b.PLLHOFF, CLK_PLLH_OFF); + } + } + else + { + WRITE_REG32(bM4_CMU->PLLHCR_b.PLLHOFF, CLK_PLLH_ON); + + enRet = ErrorTimeout; + while (timeout <= CLK_PLLH_TIMEOUT) + { + if (Set == CLK_GetStableStatus(CMU_OSCSTBSR_PLLHSTBF)) + { + enRet = Ok; + break; + } + timeout++; + } + } + + return enRet; +} + +/** + * @brief Init XtalStd initial structure with default value. + * @param [in] pstcXtalStdInit specifies the Parameter of XTALSTD. + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: Invalid parameter + */ +en_result_t CLK_XtalStdStrucInit(stc_clk_xtalstd_init_t* pstcXtalStdInit) +{ + en_result_t enRet = Ok; + + /* Check if pointer is NULL */ + if (NULL == pstcXtalStdInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Configure to default value */ + pstcXtalStdInit->u8XtalStdState = CLK_XTALSTD_OFF; + pstcXtalStdInit->u8XtalStdMode = CLK_XTALSTD_MODE_INT; + pstcXtalStdInit->u8XtalStdInt = CLK_XTALSTD_RST_OFF; + pstcXtalStdInit->u8XtalStdRst = CLK_XTALSTD_INT_OFF; + } + + return enRet; +} + +/** + * @brief Initialise the XTAL status detection. + * @param [in] pstcXtalStdInit specifies the Parameter of XTALSTD. + * @arg u8XtalStdState: The new state of the XTALSTD. + * @arg u8XtalStdMode: The XTAL status detection occur interrupt or reset. + * @arg u8XtalStdInt: The XTAL status detection interrupt on or off. + * @arg u8XtalStdRst: The XTAL status detection reset on or off. + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: Invalid parameter + */ +en_result_t CLK_XtalStdInit(const stc_clk_xtalstd_init_t* pstcXtalStdInit) +{ + en_result_t enRet = Ok; + + /* Check if pointer is NULL */ + if (NULL == pstcXtalStdInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Parameter valid check */ + DDL_ASSERT(IS_CLK_XTALSTD_STATE(pstcXtalStdInit->u8XtalStdState)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + + if(CLK_XTALSTD_OFF == pstcXtalStdInit->u8XtalStdState) + { + /* Disbale XTAL status detection */ + WRITE_REG32(bM4_CMU->XTALSTDCR_b.XTALSTDE, (uint32_t)CLK_XTALSTD_OFF); + } + else + { + /* Parameter valid check */ + DDL_ASSERT(IS_CLK_XTALSTD_MODE(pstcXtalStdInit->u8XtalStdMode)); + DDL_ASSERT(IS_CLK_XTALSTD_INT_STATE(pstcXtalStdInit->u8XtalStdInt)); + DDL_ASSERT(IS_CLK_XTALSTD_RST_STATE(pstcXtalStdInit->u8XtalStdRst)); + + /* Configure and enable XTALSTD */ + WRITE_REG8(M4_CMU->XTALSTDCR, (pstcXtalStdInit->u8XtalStdState | \ + pstcXtalStdInit->u8XtalStdMode | \ + pstcXtalStdInit->u8XtalStdInt | \ + pstcXtalStdInit->u8XtalStdRst)); + } + } + + return enRet; +} + +/** + * @brief Clear the XTAL error flag. + * @param None + * @retval None + * @note The system clock should not be XTAL before call this function. + */ +void CLK_ClearXtalStdStatus(void) +{ + DDL_ASSERT(IS_CLK_UNLOCKED()); + + if(1UL == READ_REG32(bM4_CMU->XTALSTDSR_b.XTALSTDF)) + { + /* Clear the XTAL STD flag */ + WRITE_REG32(bM4_CMU->XTALSTDSR_b.XTALSTDF, 0UL); + } +} + +/** + * @brief Get the XTAL error flag. + * @param None + * @retval en_flag_status_t + */ +en_flag_status_t CLK_GetXtalStdStatus(void) +{ + return ((0UL != READ_REG32(bM4_CMU->XTALSTDSR_b.XTALSTDF)) ? Set : Reset); +} + +/** + * @brief Set HRC trimming value. + * @param [in] i8TrimVal specifies the trimming value for HRC. + * @retval None + */ +void CLK_HrcTrim(int8_t i8TrimVal) +{ + DDL_ASSERT(IS_CLK_UNLOCKED()); + + WRITE_REG8(M4_CMU->HRCTRM, i8TrimVal); +} + +/** + * @brief Set MRC trimming value. + * @param [in] i8TrimVal specifies the trimming value for MRC. + * @retval None + */ +void CLK_MrcTrim(int8_t i8TrimVal) +{ + DDL_ASSERT(IS_CLK_UNLOCKED()); + + WRITE_REG8(M4_CMU->MRCTRM, i8TrimVal); +} + +/** + * @brief Set LRC trimming value. + * @param [in] i8TrimVal specifies the trimming value for LRC. + * @retval None + */ +void CLK_LrcTrim(int8_t i8TrimVal) +{ + DDL_ASSERT(IS_CLK_UNLOCKED()); + + WRITE_REG8(M4_CMU->LRCTRM, i8TrimVal); +} + +/** + * @brief Set RTC LRC trimming value. + * @param [in] i8TrimVal specifies the trimming value for RTC LRC. + * @retval None + */ +void CLK_RtcLrcTrim(int8_t i8TrimVal) +{ + DDL_ASSERT(IS_CLK_UNLOCKED()); + + WRITE_REG8(M4_CMU->RTCLRCTRM, i8TrimVal); +} + +/** + * @brief PLL/XTAL/HRC stable flag read. + * @param [in] u8StableFlag specifies the stable flag to be read. + * @arg CLK_STB_FLAG_HRCSTB + * @arg CLK_STB_FLAG_XTALSTB + * @arg CLK_STB_FLAG_PLLASTB + * @arg CLK_STB_FLAG_PLLHSTB + * @retval en_flag_status_t + */ +en_flag_status_t CLK_GetStableStatus(uint8_t u8StableFlag) +{ + DDL_ASSERT(IS_CLK_STB_FLAG(u8StableFlag)); + + return ((READ_REG8_BIT(M4_CMU->OSCSTBSR, u8StableFlag))? Set : Reset); +} + +/** + * @brief Set the system clock source. + * @param [in] u8Src specifies the source of system clock. + * This parameter can be one of the following values: + * @arg CLK_SYSCLKSOURCE_HRC : select HRC as system clock source + * @arg CLK_SYSCLKSOURCE_MRC : select MHRC as system clock source + * @arg CLK_SYSCLKSOURCE_LRC : select LRC as system clock source + * @arg CLK_SYSCLKSOURCE_XTAL : select XTAL as system clock source + * @arg CLK_SYSCLKSOURCE_XTAL32 : select XTAL32 as system clock source + * @arg CLK_SYSCLKSOURCE_PLLH : select PLLH as system clock source + * @retval None + */ +void CLK_SetSysClkSrc(uint8_t u8Src) +{ + __IO uint32_t timeout = 0UL; + /* backup FCGx setting */ + __IO uint32_t fcg0 = M4_PWC->FCG0; + __IO uint32_t fcg1 = M4_PWC->FCG1; + __IO uint32_t fcg2 = M4_PWC->FCG2; + __IO uint32_t fcg3 = M4_PWC->FCG3; + uint8_t u8TmpFlag = 0U; + + DDL_ASSERT(IS_CLK_SYSCLK_SRC(u8Src)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + + /* Only current system clock source or target system clock source is PLLH + need to close fcg0~fcg3 and open fcg0~fcg3 during switch system clock source. + We need to backup fcg0~fcg3 before close them. */ + if (CLK_SYSCLKSOURCE_PLLH == READ_REG8_BIT(M4_CMU->CKSWR, CMU_CKSWR_CKSW) || \ + (CLK_SYSCLKSOURCE_PLLH == u8Src)) + { + u8TmpFlag = 1U; + /* FCG0 protect judgment */ + DDL_ASSERT((M4_PWC->FCG0PC & PWC_FCG0PC_PRT0) == PWC_FCG0PC_PRT0); + /* Close FCGx. */ + M4_PWC->FCG0 = CLK_FCG0_DEFAULT; + M4_PWC->FCG1 = CLK_FCG1_DEFAULT; + M4_PWC->FCG2 = CLK_FCG2_DEFAULT; + M4_PWC->FCG3 = CLK_FCG3_DEFAULT; + + /* Wait stable after close FCGx. */ + do + { + timeout++; + } while(timeout < CLK_SYSCLK_SW_STABLE); + } + + /* Set system clock source */ + WRITE_REG8(M4_CMU->CKSWR, u8Src); + + if (1U == u8TmpFlag) + { + M4_PWC->FCG0 = fcg0; + M4_PWC->FCG1 = fcg1; + M4_PWC->FCG2 = fcg2; + M4_PWC->FCG3 = fcg3; + /* Wait stable after open fcg. */ + timeout = 0UL; + do + { + timeout++; + } while(timeout < CLK_SYSCLK_SW_STABLE); + } + + /* Update system clock */ + SystemCoreClockUpdate(); +} + +/** + * @brief Get bus clock frequency. + * @param [out] pstcClkFreq specifies the pointer to get bus frequency. + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: NULL pointer + */ +en_result_t CLK_GetClockFreq(stc_clk_freq_t *pstcClkFreq) +{ + en_result_t enRet = Ok; + uint32_t plln; + uint32_t pllp; + uint32_t pllm; + + if (NULL == pstcClkFreq) + { + enRet = ErrorInvalidParameter; + } + else + { + switch (READ_REG8_BIT(M4_CMU->CKSWR, CMU_CKSWR_CKSW)) + { + case CLK_SYSCLKSOURCE_HRC: + /* HRC is used to system clock */ + pstcClkFreq->sysclkFreq = HRC_VALUE; + break; + case CLK_SYSCLKSOURCE_MRC: + /* MRC is used to system clock */ + pstcClkFreq->sysclkFreq = MRC_VALUE; + break; + case CLK_SYSCLKSOURCE_LRC: + /* LRC is used to system clock */ + pstcClkFreq->sysclkFreq = LRC_VALUE; + break; + case CLK_SYSCLKSOURCE_XTAL: + /* XTAL is used to system clock */ + pstcClkFreq->sysclkFreq = XTAL_VALUE; + break; + case CLK_SYSCLKSOURCE_XTAL32: + /* XTAL32 is used to system clock */ + pstcClkFreq->sysclkFreq = HRC_VALUE; + break; + case CLK_SYSCLKSOURCE_PLLH: + /* PLLHP is used as system clock. */ + pllp = (uint32_t)((M4_CMU->PLLHCFGR >> CMU_PLLHCFGR_PLLHP_POS) & 0x0FUL); + plln = (uint32_t)((M4_CMU->PLLHCFGR >> CMU_PLLHCFGR_PLLHN_POS) & 0xFFUL); + pllm = (uint32_t)((M4_CMU->PLLHCFGR >> CMU_PLLHCFGR_PLLHM_POS) & 0x03UL); + + /* fpll = ((pllin / pllm) * plln) / pllp */ + if (CLK_PLLSRC_XTAL == READ_REG32_BIT(M4_CMU->PLLHCFGR, CMU_PLLHCFGR_PLLSRC)) + { + pstcClkFreq->sysclkFreq = ((XTAL_VALUE/(pllm + 1UL))*(plln + 1UL))/(pllp + 1UL); + } + else + { + pstcClkFreq->sysclkFreq = ((HRC_VALUE/(pllm + 1UL))*(plln + 1UL))/(pllp + 1UL); + } + break; + default: + break; + } + + /* Get hclk. */ + pstcClkFreq->hclkFreq = pstcClkFreq->sysclkFreq >> \ + (READ_REG32_BIT(M4_CMU->SCFGR, CMU_SCFGR_HCLKS) >> CMU_SCFGR_HCLKS_POS); + + /* Get exck. */ + pstcClkFreq->exckFreq = pstcClkFreq->sysclkFreq >> \ + (READ_REG32_BIT(M4_CMU->SCFGR, CMU_SCFGR_EXCKS) >> CMU_SCFGR_EXCKS_POS); + + /* Get pclk0. */ + pstcClkFreq->pclk0Freq = pstcClkFreq->sysclkFreq >> \ + (READ_REG32_BIT(M4_CMU->SCFGR, CMU_SCFGR_PCLK0S) >> CMU_SCFGR_PCLK0S_POS); + + /* Get pclk1. */ + pstcClkFreq->pclk1Freq = pstcClkFreq->sysclkFreq >> \ + (READ_REG32_BIT(M4_CMU->SCFGR, CMU_SCFGR_PCLK1S) >> CMU_SCFGR_PCLK1S_POS); + + /* Get pclk2. */ + pstcClkFreq->pclk2Freq = pstcClkFreq->sysclkFreq >> \ + (READ_REG32_BIT(M4_CMU->SCFGR, CMU_SCFGR_PCLK2S) >> CMU_SCFGR_PCLK2S_POS); + + /* Get pclk3. */ + pstcClkFreq->pclk3Freq = pstcClkFreq->sysclkFreq >> \ + (READ_REG32_BIT(M4_CMU->SCFGR, CMU_SCFGR_PCLK3S) >> CMU_SCFGR_PCLK3S_POS); + + /* Get pclk4. */ + pstcClkFreq->pclk4Freq = pstcClkFreq->sysclkFreq >> \ + (READ_REG32_BIT(M4_CMU->SCFGR, CMU_SCFGR_PCLK4S) >> CMU_SCFGR_PCLK4S_POS); + } + return enRet; +} + +/** + * @brief Get PLLH/PLLA P/Q/R clock frequency. + * @param [out] pstcPllClkFreq specifies the pointer to get PLLH/PLLA frequency. + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: NULL pointer + */ +en_result_t CLK_GetPllClockFreq(stc_pll_clk_freq_t *pstcPllClkFreq) +{ + en_result_t enRet = Ok; + uint32_t pllhn; + uint32_t pllhm; + uint32_t pllhp; + uint32_t pllhq; + uint32_t pllhr; + uint32_t pllan; + uint32_t pllam; + uint32_t pllap; + uint32_t pllaq; + uint32_t pllar; + uint32_t pllin; + + if (NULL == pstcPllClkFreq) + { + enRet = ErrorInvalidParameter; + } + else + { + pllhp = (uint32_t)((M4_CMU->PLLHCFGR >> CMU_PLLHCFGR_PLLHP_POS) & 0x0FUL); + pllhq = (uint32_t)((M4_CMU->PLLHCFGR >> CMU_PLLHCFGR_PLLHQ_POS) & 0x0FUL); + pllhr = (uint32_t)((M4_CMU->PLLHCFGR >> CMU_PLLHCFGR_PLLHR_POS) & 0x0FUL); + pllhn = (uint32_t)((M4_CMU->PLLHCFGR >> CMU_PLLHCFGR_PLLHN_POS) & 0xFFUL); + pllhm = (uint32_t)((M4_CMU->PLLHCFGR >> CMU_PLLHCFGR_PLLHM_POS) & 0x03UL); + + pllap = (uint32_t)((M4_CMU->PLLACFGR >> CMU_PLLHCFGR_PLLHP_POS) & 0x0FUL); + pllaq = (uint32_t)((M4_CMU->PLLACFGR >> CMU_PLLHCFGR_PLLHQ_POS) & 0x0FUL); + pllar = (uint32_t)((M4_CMU->PLLACFGR >> CMU_PLLHCFGR_PLLHR_POS) & 0x0FUL); + pllan = (uint32_t)((M4_CMU->PLLACFGR >> CMU_PLLHCFGR_PLLHN_POS) & 0x1FFUL); + pllam = (uint32_t)((M4_CMU->PLLACFGR >> CMU_PLLHCFGR_PLLHM_POS) & 0x1FUL); + + /* PLLHP is used as system clock. */ + if (CLK_PLLSRC_XTAL == READ_REG32_BIT(M4_CMU->PLLHCFGR, CMU_PLLHCFGR_PLLSRC)) + { + pllin = XTAL_VALUE; + } + else + { + pllin = HRC_VALUE; + } + pstcPllClkFreq->pllhvcin = (pllin/(pllhm + 1UL)); + pstcPllClkFreq->pllhvco = ((pllin/(pllhm + 1UL))*(pllhn + 1UL)); + pstcPllClkFreq->pllhp = ((pllin/(pllhm + 1UL))*(pllhn + 1UL))/(pllhp + 1UL); + pstcPllClkFreq->pllhq = ((pllin/(pllhm + 1UL))*(pllhn + 1UL))/(pllhq + 1UL); + pstcPllClkFreq->pllhr = ((pllin/(pllhm + 1UL))*(pllhn + 1UL))/(pllhr + 1UL); + + pstcPllClkFreq->pllavcin = (pllin/(pllam + 1UL)); + pstcPllClkFreq->pllavco = ((pllin/(pllam + 1UL))*(pllan + 1UL)); + pstcPllClkFreq->pllap = ((pllin/(pllam + 1UL))*(pllan + 1UL))/(pllap + 1UL); + pstcPllClkFreq->pllaq = ((pllin/(pllam + 1UL))*(pllan + 1UL))/(pllaq + 1UL); + pstcPllClkFreq->pllar = ((pllin/(pllam + 1UL))*(pllan + 1UL))/(pllar + 1UL); + } + return enRet; +} + +/** + * @brief HCLK/PCLK divide setting. + * @param [in] u8ClkCate specifies the clock to be divided. + * @arg CLK_CATE_PCLK0: Select PCLK0 to be divided + * @arg CLK_CATE_PCLK1: Select PCLK1 to be divided + * @arg CLK_CATE_PCLK2: Select PCLK2 to be divided + * @arg CLK_CATE_PCLK3: Select PCLK3 to be divided + * @arg CLK_CATE_PCLK4: Select PCLK4 to be divided + * @arg CLK_CATE_EXCLK: Select EXCLK to be divided + * @arg CLK_CATE_HCLK : Select HCLK to be divided + * @arg CLK_CATE_ALL : Select all to be divided + * @param [in] u32Div specifies the clock divide factor. + * @arg CLK_HCLK_DIV1 : HCLK no divide + * @arg CLK_HCLK_DIV2 : HCLK divided by 2 + * @arg CLK_HCLK_DIV4 : HCLK divided by 4 + * @arg CLK_HCLK_DIV8 : HCLK divided by 8 + * @arg CLK_HCLK_DIV16: HCLK divided by 16 + * @arg CLK_HCLK_DIV32: HCLK divided by 32 + * @arg CLK_HCLK_DIV64: HCLK divided by 64 + * @arg CLK_EXCLK_DIV1 : EXCLK no divide + * @arg CLK_EXCLK_DIV2 : EXCLK divided by 2 + * @arg CLK_EXCLK_DIV4 : EXCLK divided by 4 + * @arg CLK_EXCLK_DIV8 : EXCLK divided by 8 + * @arg CLK_EXCLK_DIV16: EXCLK divided by 16 + * @arg CLK_EXCLK_DIV32: EXCLK divided by 32 + * @arg CLK_EXCLK_DIV64: EXCLK divided by 64 + * @arg CLK_PCLKx_DIV1 : PCLKx no divide + * @arg CLK_PCLKx_DIV2 : PCLKx divided by 2 + * @arg CLK_PCLKx_DIV4 : PCLKx divided by 4 + * @arg CLK_PCLKx_DIV8 : PCLKx divided by 8 + * @arg CLK_PCLKx_DIV16: PCLKx divided by 16 + * @arg CLK_PCLKx_DIV32: PCLKx divided by 32 + * @arg CLK_PCLKx_DIV64: PCLKx divided by 64 + * @retval None + * @note 'x' is 0~4 in CLK_PCLKx_DIVy + */ +void CLK_ClkDiv(uint8_t u8ClkCate, uint32_t u32Div) +{ + __IO uint32_t timeout = 0UL; + /* backup FCGx setting */ + __IO uint32_t fcg0 = M4_PWC->FCG0; + __IO uint32_t fcg1 = M4_PWC->FCG1; + __IO uint32_t fcg2 = M4_PWC->FCG2; + __IO uint32_t fcg3 = M4_PWC->FCG3; + uint8_t u8TmpFlag = 0U; + + DDL_ASSERT(IS_CLK_HCLK_DIV(u32Div & CMU_SCFGR_HCLKS)); + DDL_ASSERT(IS_CLK_EXCLK_DIV(u32Div & CMU_SCFGR_EXCKS)); + DDL_ASSERT(IS_CLK_PCLK0_DIV(u32Div & CMU_SCFGR_PCLK0S)); + DDL_ASSERT(IS_CLK_PCLK1_DIV(u32Div & CMU_SCFGR_PCLK1S)); + DDL_ASSERT(IS_CLK_PCLK2_DIV(u32Div & CMU_SCFGR_PCLK2S)); + DDL_ASSERT(IS_CLK_PCLK3_DIV(u32Div & CMU_SCFGR_PCLK3S)); + DDL_ASSERT(IS_CLK_PCLK4_DIV(u32Div & CMU_SCFGR_PCLK4S)); + DDL_ASSERT(IS_CLK_CATE(u8ClkCate)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + + /* Only current system clock source or target system clock source is PLLH + need to close fcg0~fcg3 and open fcg0~fcg3 during switch system clock source. + We need to backup fcg0~fcg3 before close them. */ + if (CLK_SYSCLKSOURCE_PLLH == READ_REG8_BIT(M4_CMU->CKSWR, CMU_CKSWR_CKSW)) + { + DDL_ASSERT((M4_PWC->FCG0PC & PWC_FCG0PC_PRT0) == PWC_FCG0PC_PRT0); + + u8TmpFlag = 1U; + + /* Close FCGx. */ + M4_PWC->FCG0 = CLK_FCG0_DEFAULT; + M4_PWC->FCG1 = CLK_FCG1_DEFAULT; + M4_PWC->FCG2 = CLK_FCG2_DEFAULT; + M4_PWC->FCG3 = CLK_FCG3_DEFAULT; + + /* Wait stable after close FCGx. */ + do + { + timeout++; + } while(timeout < CLK_SYSCLK_SW_STABLE); + } + + /* PCLK0 div */ + if (0U != (CLK_CATE_PCLK0 & u8ClkCate)) + { + MODIFY_REG32(M4_CMU->SCFGR, CMU_SCFGR_PCLK0S, u32Div); + } + /* PCLK1 div */ + if (0U != (CLK_CATE_PCLK1 & u8ClkCate)) + { + MODIFY_REG32(M4_CMU->SCFGR, CMU_SCFGR_PCLK1S, u32Div); + } + /* PCLK2 div */ + if (0U != (CLK_CATE_PCLK2 & u8ClkCate)) + { + MODIFY_REG32(M4_CMU->SCFGR, CMU_SCFGR_PCLK2S, u32Div); + } + /* PCLK3 div */ + if (0U != (CLK_CATE_PCLK3 & u8ClkCate)) + { + MODIFY_REG32(M4_CMU->SCFGR, CMU_SCFGR_PCLK3S, u32Div); + } + /* PCLK4 div */ + if (0U != (CLK_CATE_PCLK4 & u8ClkCate)) + { + MODIFY_REG32(M4_CMU->SCFGR, CMU_SCFGR_PCLK4S, u32Div); + } + /* Ext. bus clock div */ + if (0U != (CLK_CATE_EXCLK & u8ClkCate)) + { + MODIFY_REG32(M4_CMU->SCFGR, CMU_SCFGR_EXCKS, u32Div); + } + /* HCLK div */ + if (0U != (CLK_CATE_HCLK & u8ClkCate)) + { + MODIFY_REG32(M4_CMU->SCFGR, CMU_SCFGR_HCLKS, u32Div); + } + if (1U == u8TmpFlag) + { + M4_PWC->FCG0 = fcg0; + M4_PWC->FCG1 = fcg1; + M4_PWC->FCG2 = fcg2; + M4_PWC->FCG3 = fcg3; + + /* Wait stable after open fcg. */ + timeout = 0UL; + do + { + timeout++; + } while(timeout < CLK_SYSCLK_SW_STABLE); + } +} + +/** + * @brief USB clock source config. + * @param [in] u8UsbClk specifies the USB clock source. + * @arg CLK_USB_CLK_MCLK_DIV2: Select PCLK1 divide by 2 as USB clock + * @arg CLK_USB_CLK_MCLK_DIV3: Select PCLK1 divide by 3 as USB clock + * @arg CLK_USB_CLK_MCLK_DIV4: Select PCLK1 divide by 4 as USB clock + * @arg CLK_USB_CLK_MCLK_DIV5: Select PCLK1 divide by 5 as USB clock + * @arg CLK_USB_CLK_MCLK_DIV6: Select PCLK1 divide by 6 as USB clock + * @arg CLK_USB_CLK_MCLK_DIV7: Select PCLK1 divide by 7 as USB clock + * @arg CLK_USB_CLK_MCLK_DIV8: Select PCLK1 divide by 8 as USB clock + * @arg CLK_USB_CLK_PLLHQ: Select PLLHQ as USB clock + * @arg CLK_USB_CLK_PLLHR: Select PLLHR as USB clock + * @arg CLK_USB_CLK_PLLAP: Select PLLAP as USB clock + * @arg CLK_USB_CLK_PLLAQ: Select PLLAQ as USB clock + * @arg CLK_USB_CLK_PLLAR: Select PLLAR as USB clock + * @retval None + */ +void CLK_USB_ClkConfig(uint8_t u8UsbClk) +{ + DDL_ASSERT(IS_CLK_USB_CLK(u8UsbClk)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + + WRITE_REG8(M4_CMU->USBCKCFGR, u8UsbClk); +} + +/** + * @brief CAN clock source config. + * @param [in] u8CanCh specifies the CAN channel for clock source. + * @arg CLK_CAN_CH1: CAN Channel 1 + * @arg CLK_CAN_CH2: CAN Channel 2 + * @param [in] u8CanClk specifies the CAN clock source. + * @arg CLK_CAN1_CLK_MCLK_DIV2: Select system clock divide by 2 as CAN clock + * @arg CLK_CAN1_CLK_MCLK_DIV3: Select system clock divide by 3 as CAN clock + * @arg CLK_CAN1_CLK_MCLK_DIV4: Select system clock divide by 4 as CAN clock + * @arg CLK_CAN1_CLK_MCLK_DIV5: Select system clock divide by 5 as CAN clock + * @arg CLK_CAN1_CLK_MCLK_DIV6: Select system clock divide by 6 as CAN clock + * @arg CLK_CAN1_CLK_MCLK_DIV7: Select system clock divide by 7 as CAN clock + * @arg CLK_CAN1_CLK_MCLK_DIV8: Select system clock divide by 8 as CAN clock + * @arg CLK_CAN1_CLK_PLLHQ: Select PLLHQ as CAN clock + * @arg CLK_CAN1_CLK_PLLHR: Select PLLHR as CAN clock + * @arg CLK_CAN1_CLK_PLLAP: Select PLLAP as CAN clock + * @arg CLK_CAN1_CLK_PLLAQ: Select PLLAQ as CAN clock + * @arg CLK_CAN1_CLK_PLLAR: Select PLLAR as CAN clock + * @arg CLK_CAN_CLK_XTAL: Select PLLAR as CAN clock + * @arg CLK_CAN2_CLK_MCLK_DIV2: Select system clock divide by 2 as CAN clock + * @arg CLK_CAN2_CLK_MCLK_DIV3: Select system clock divide by 3 as CAN clock + * @arg CLK_CAN2_CLK_MCLK_DIV4: Select system clock divide by 4 as CAN clock + * @arg CLK_CAN2_CLK_MCLK_DIV5: Select system clock divide by 5 as CAN clock + * @arg CLK_CAN2_CLK_MCLK_DIV6: Select system clock divide by 6 as CAN clock + * @arg CLK_CAN2_CLK_MCLK_DIV7: Select system clock divide by 7 as CAN clock + * @arg CLK_CAN2_CLK_MCLK_DIV8: Select system clock divide by 8 as CAN clock + * @arg CLK_CAN2_CLK_PLLHQ: Select PLLHQ as CAN clock + * @arg CLK_CAN2_CLK_PLLHR: Select PLLHR as CAN clock + * @arg CLK_CAN2_CLK_PLLAP: Select PLLAP as CAN clock + * @arg CLK_CAN2_CLK_PLLAQ: Select PLLAQ as CAN clock + * @arg CLK_CAN2_CLK_PLLAR: Select PLLAR as CAN clock + * @arg CLK_CAN2_CLK_XTAL: Select PLLAR as CAN clock + * @retval None + */ +void CLK_CAN_ClkConfig(uint8_t u8CanCh, uint8_t u8CanClk) +{ + DDL_ASSERT(IS_CLK_CAN_CH(u8CanCh)); + DDL_ASSERT(IS_CLK_CAN_CLK(u8CanClk)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + + if (0U != (CLK_CAN_CH1 & u8CanCh)) + { + MODIFY_REG8(M4_CMU->CANCKCFGR, CMU_CANCKCFGR_CAN1CKS, u8CanClk); + } + if (0U != (CLK_CAN_CH2 & u8CanCh)) + { + MODIFY_REG8(M4_CMU->CANCKCFGR, CMU_CANCKCFGR_CAN2CKS, u8CanClk); + } +} + +/** + * @brief I2S clock source config. + * @param [in] u8I2sCh specifies the I2S channel for clock source. + * @arg CLK_I2S_CH1: I2S Channel 1 + * @arg CLK_I2S_CH2: I2S Channel 2 + * @arg CLK_I2S_CH3: I2S Channel 3 + * @arg CLK_I2S_CH4: I2S Channel 4 + * @param [in] u16I2sClk specifies the I2S clock source. + * @arg CLK_I2S1_CLK_PCLK: Select PCLK3 as I2S clock + * @arg CLK_I2S1_CLK_PLLHQ: Select PLLHQ as I2S clock + * @arg CLK_I2S1_CLK_PLLHR: Select PLLHR as I2S clock + * @arg CLK_I2S1_CLK_PLLAP: Select PLLAP as I2S clock + * @arg CLK_I2S1_CLK_PLLAQ: Select PLLAQ as I2S clock + * @arg CLK_I2S1_CLK_PLLAR: Select PLLAR as I2S clock + * @arg CLK_I2S2_CLK_PCLK: Select PCLK3 as I2S clock + * @arg CLK_I2S2_CLK_PLLHQ: Select PLLHQ as I2S clock + * @arg CLK_I2S2_CLK_PLLHR: Select PLLHR as I2S clock + * @arg CLK_I2S2_CLK_PLLAP: Select PLLAP as I2S clock + * @arg CLK_I2S2_CLK_PLLAQ: Select PLLAQ as I2S clock + * @arg CLK_I2S2_CLK_PLLAR: Select PLLAR as I2S clock + * @arg CLK_I2S3_CLK_PCLK: Select PCLK3 as I2S clock + * @arg CLK_I2S3_CLK_PLLHQ: Select PLLHQ as I2S clock + * @arg CLK_I2S3_CLK_PLLHR: Select PLLHR as I2S clock + * @arg CLK_I2S3_CLK_PLLAP: Select PLLAP as I2S clock + * @arg CLK_I2S3_CLK_PLLAQ: Select PLLAQ as I2S clock + * @arg CLK_I2S3_CLK_PLLAR: Select PLLAR as I2S clock + * @arg CLK_I2S4_CLK_PCLK: Select PCLK3 as I2S clock + * @arg CLK_I2S4_CLK_PLLHQ: Select PLLHQ as I2S clock + * @arg CLK_I2S4_CLK_PLLHR: Select PLLHR as I2S clock + * @arg CLK_I2S4_CLK_PLLAP: Select PLLAP as I2S clock + * @arg CLK_I2S4_CLK_PLLAQ: Select PLLAQ as I2S clock + * @arg CLK_I2S4_CLK_PLLAR: Select PLLAR as I2S clock + * @retval None + */ +void CLK_I2S_ClkConfig(uint8_t u8I2sCh, uint16_t u16I2sClk) +{ + DDL_ASSERT(IS_CLK_I2S_CH(u8I2sCh)); + DDL_ASSERT(IS_CLK_I2S_CLK(u16I2sClk)); + DDL_ASSERT(IS_CLK_SEL_UNLOCKED()); + + if (0U != (CLK_I2S_CH1 & u8I2sCh)) + { + MODIFY_REG16(M4_CMU->I2SCKSEL, CMU_I2SCKSEL_I2S1CKSEL, u16I2sClk); + } + if (0U != (CLK_I2S_CH2 & u8I2sCh)) + { + MODIFY_REG16(M4_CMU->I2SCKSEL, CMU_I2SCKSEL_I2S2CKSEL, u16I2sClk); + } + if (0U != (CLK_I2S_CH3 & u8I2sCh)) + { + MODIFY_REG16(M4_CMU->I2SCKSEL, CMU_I2SCKSEL_I2S3CKSEL, u16I2sClk); + } + if (0U != (CLK_I2S_CH4 & u8I2sCh)) + { + MODIFY_REG16(M4_CMU->I2SCKSEL, CMU_I2SCKSEL_I2S4CKSEL, u16I2sClk); + } +} + +/** + * @brief ADC/DAC/TRNG clock source config. + * @param [in] u16Periclk specifies the ADC/DAC/TRNG clock source. + * @arg CLK_PERI_CLK_PCLK: Select default setting for PCLK2/PCLK4 clock + * @arg CLK_PERI_CLK_PLLHQ: Select PLLHQ as PCLK2/PCLK4 clock + * @arg CLK_PERI_CLK_PLLHR: Select PLLHR as PCLK2/PCLK4 clock + * @arg CLK_PERI_CLK_PLLAP: Select PLLAP as PCLK2/PCLK4 clock + * @arg CLK_PERI_CLK_PLLAQ: Select PLLAQ as PCLK2/PCLK4 clock + * @arg CLK_PERI_CLK_PLLAR: Select PLLAR as PCLK2/PCLK4 clock + * @retval None + * @note PCLK2 is used for ADC clock, PCLK4 is used for DAC/TRANG clock + */ +void CLK_PERI_ClkConfig(uint16_t u16Periclk) +{ + DDL_ASSERT(IS_CLK_PERI_CLK(u16Periclk)); + DDL_ASSERT(IS_CLK_SEL_UNLOCKED()); + + WRITE_REG16(M4_CMU->PERICKSEL, u16Periclk); +} + +/** + * @brief Enable or disable the TPIU clock. + * @param [in] enNewState specifies the new state of the TPIU clock. + * @arg Enable: Enable clock output. + * @arg Disable: Disable clock output. + * @retval None + */ +void CLK_TpiuClkCmd(en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + + WRITE_REG32(bM4_CMU->TPIUCKCFGR_b.TPIUCKOE, enNewState); +} + +/** + * @brief TPIU clock divider config. + * @param [in] u8TpiuDiv specifies the TPIU clock divide factor. + * @arg CLK_TPIU_CLK_DIV1: TPIU clock no divide + * @arg CLK_TPIU_CLK_DIV2: TPIU clock divide by 2 + * @arg CLK_TPIU_CLK_DIV4: TPIU clock divide by 4 + * @retval None + */ +void CLK_TpiuClkConfig(uint8_t u8TpiuDiv) +{ + DDL_ASSERT(IS_CLK_TPIU_CLK_DIV(u8TpiuDiv)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + + MODIFY_REG8(M4_CMU->TPIUCKCFGR, CMU_TPIUCKCFGR_TPIUCKS, u8TpiuDiv); +} + +/** + * @brief Selects the clock source to output on MCO1 pin. + * @param [in] CLK_MCOSource specifies the clock source to output. + * @arg CLK_MCOSOURCCE_HRC HRC clock selected as MCOx source + * @arg CLK_MCOSOURCCE_MRC MRC clock selected as MCOx source + * @arg CLK_MCOSOURCCE_LRC LRC clock selected as MCOx source + * @arg CLK_MCOSOURCCE_XTAL XTAL clock selected as MCOx source + * @arg CLK_MCOSOURCCE_XTAL32 XTAL32 clock selected as MCOx source + * @arg CLK_MCOSOURCCE_PLLHP PLLHP clock selected as MCOx source + * @arg CLK_MCOSOURCCE_PLLAP PLLAP clock selected as MCOx source + * @arg CLK_MCOSOURCCE_PLLHQ PLLHQ clock selected as MCOx source + * @arg CLK_MCOSOURCCE_PLLAQ PLLAQ clock selected as MCOx source + * @arg CLK_MCOSOURCCE_PLLAR PLLAR clock selected as MCOx source + * @arg CLK_MCOSOURCCE_SYSCLK System clock selected as MCOx source + * @param [in] CLK_MCODiv specifies the MCOx prescaler. + * @arg CLK_MCO_DIV1: no division applied to MCOx clock + * @arg CLK_MCO_DIV2: division by 2 applied to MCOx clock + * @arg CLK_MCO_DIV4: division by 4 applied to MCOx clock + * @arg CLK_MCO_DIV8: division by 8 applied to MCOx clock + * @arg CLK_MCO_DIV16: division by 16 applied to MCOx clock + * @arg CLK_MCO_DIV32: division by 32 applied to MCOx clock + * @arg CLK_MCO_DIV64: division by 64 applied to MCOx clock + * @arg CLK_MCO_DIV128: division by 128 applied to MCOx clock + * @retval None + * @note MCO pin should be configured in alternate function 1 mode. + */ +void CLK_MCO1Config(uint8_t CLK_MCOSource, uint8_t CLK_MCODiv) +{ + /* Check the parameters. */ + DDL_ASSERT(IS_CLK_MCOSOURCE(CLK_MCOSource)); + DDL_ASSERT(IS_CLK_MCODIV(CLK_MCODiv)); + + /* Enable register write. */ + DDL_ASSERT(IS_CLK_UNLOCKED()); + + /* Config the MCO1 */ + MODIFY_REG8(M4_CMU->MCO1CFGR, (CMU_MCO1CFGR_MCO1SEL | CMU_MCO1CFGR_MCO1DIV), (CLK_MCODiv | CLK_MCOSource)); +} + +/** + * @brief Enable or disable the MCO1 output. + * @param [in] enNewState specifies the new state of the clock output. + * @arg Enable: Enable clock output. + * @arg Disable: Disable clock output. + * @retval None + */ +void CLK_MCO1Cmd(en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + + /* Enable or disable clock output. */ + WRITE_REG32(bM4_CMU->MCO1CFGR_b.MCO1EN, enNewState); +} + +/** + * @brief Selects the clock source to output on MCO2 pin. + * @param [in] CLK_MCOSource specifies the clock source to output. + * @arg CLK_MCOSOURCCE_HRC HRC clock selected as MCOx source + * @arg CLK_MCOSOURCCE_MRC MRC clock selected as MCOx source + * @arg CLK_MCOSOURCCE_LRC LRC clock selected as MCOx source + * @arg CLK_MCOSOURCCE_XTAL XTAL clock selected as MCOx source + * @arg CLK_MCOSOURCCE_XTAL32 XTAL32 clock selected as MCOx source + * @arg CLK_MCOSOURCCE_PLLHP PLLHP clock selected as MCOx source + * @arg CLK_MCOSOURCCE_PLLAP PLLAP clock selected as MCOx source + * @arg CLK_MCOSOURCCE_PLLHQ PLLHQ clock selected as MCOx source + * @arg CLK_MCOSOURCCE_PLLAQ PLLAQ clock selected as MCOx source + * @arg CLK_MCOSOURCCE_PLLAR PLLAR clock selected as MCOx source + * @arg CLK_MCOSOURCCE_SYSCLK System clock selected as MCOx source + * @param [in] CLK_MCODiv specifies the MCOx prescaler. + * @arg CLK_MCO_DIV1: no division applied to MCOx clock + * @arg CLK_MCO_DIV2: division by 2 applied to MCOx clock + * @arg CLK_MCO_DIV4: division by 4 applied to MCOx clock + * @arg CLK_MCO_DIV8: division by 8 applied to MCOx clock + * @arg CLK_MCO_DIV16: division by 16 applied to MCOx clock + * @arg CLK_MCO_DIV32: division by 32 applied to MCOx clock + * @arg CLK_MCO_DIV64: division by 64 applied to MCOx clock + * @arg CLK_MCO_DIV128: division by 128 applied to MCOx clock + * @retval None + * @note MCO2 pin should be configured in alternate function 1 mode. + */ +void CLK_MCO2Config(uint8_t CLK_MCOSource, uint8_t CLK_MCODiv) +{ + /* Check the parameters. */ + DDL_ASSERT(IS_CLK_MCOSOURCE(CLK_MCOSource)); + DDL_ASSERT(IS_CLK_MCODIV(CLK_MCODiv)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + + /* Config the MCO */ + MODIFY_REG8(M4_CMU->MCO2CFGR, (CMU_MCO2CFGR_MCO2SEL | CMU_MCO2CFGR_MCO2DIV), (CLK_MCODiv | CLK_MCOSource)); +} + +/** + * @brief Enable or disable the MCO2 output. + * @param [in] enNewState specifies the new state of the clock output. + * @arg Enable: Enable clock output. + * @arg Disable: Disable clock output. + * @retval None + */ +void CLK_MCO2Cmd(en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_CLK_UNLOCKED()); + + /* Enable or disable clock output. */ + WRITE_REG32(bM4_CMU->MCO2CFGR_b.MCO2EN, enNewState); +} + +/** + * @} + */ + +#endif /* DDL_CLK_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_cmp.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_cmp.c new file mode 100644 index 0000000000..4d94b67e45 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_cmp.c @@ -0,0 +1,782 @@ +/** + ******************************************************************************* + * @file hc32f4a0_cmp.c + * @brief This file provides firmware functions to manage the Comparator(CMP). + * + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Heqb First version + 2020-08-31 Heqb Replace CMP_Delay300ns() with the function DDL_DelayUS() + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_cmp.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_CMP CMP + * @brief CMP Driver Library + * @{ + */ + +#if (DDL_CMP_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup CMP_Local_Macros CMP Local Macros + * @{ + */ + +/** + * @defgroup CMP_Check_Parameters_Validity CMP Check Parameters Validity + * @{ + */ + +#define IS_CMP_INSTANCE(x) \ +( ((x) == M4_CMP1) || \ + ((x) == M4_CMP2) || \ + ((x) == M4_CMP3) || \ + ((x) == M4_CMP4)) + +#define IS_CMP_MODE(x) \ +( ((x) == CMP_MODE_NORMAL) || \ + ((x) == CMP_MODE_WINDOW)) + +#define IS_CMP_CVSL_CH(x) \ +( ((x) == CMP_CVSL_NONE) || \ + ((x) == CMP_CVSL_INP1) || \ + ((x) == CMP_CVSL_INP2) || \ + ((x) == CMP_CVSL_INP3) || \ + ((x) == CMP_CVSL_INP4)) + +#define IS_CMP1_CVSL_SOURCE(x) \ +( ((x) == CMP1_INP3_NONE) || \ + ((x) == CMP1_INP3_CMP1_INP3) || \ + ((x) == CMP1_INP3_CMP2_INP3) || \ + ((x) == CMP1_INP2_NONE) || \ + ((x) == CMP1_INP2_PGA1) || \ + ((x) == CMP1_INP2_PGA2) || \ + ((x) == CMP1_INP2_CMP1_INP2)) + +#define IS_CMP3_CVSL_SOURCE(x) \ +( ((x) == CMP3_INP3_NONE) || \ + ((x) == CMP3_INP3_CMP3_INP3) || \ + ((x) == CMP3_INP3_CMP4_INP3) || \ + ((x) == CMP3_INP2_NONE) || \ + ((x) == CMP3_INP2_PGA3) || \ + ((x) == CMP3_INP2_PGA4) || \ + ((x) == CMP3_INP2_CMP3_INP2)) + +#define IS_CMP_RVSL(x) \ +( ((x) == CMP_RVSL_NONE) || \ + ((x) == CMP_RVSL_INM1) || \ + ((x) == CMP_RVSL_INM2) || \ + ((x) == CMP_RVSL_INM3) || \ + ((x) == CMP_RVSL_INM4)) + +#define IS_CMP_OUT_POLARITY(x) \ +( ((x) == CMP_OUT_REVERSE_OFF) || \ + ((x) == CMP_OUT_REVERSE_ON)) + +#define IS_CMP_OUT_DETECT_EDGE(x) \ +( ((x) == CMP_DETECT_EDGS_NONE) || \ + ((x) == CMP_DETECT_EDGS_RISING) || \ + ((x) == CMP_DETECT_EDGS_FALLING) || \ + ((x) == CMP_DETECT_EDGS_BOTH)) + +#define IS_CMP_OUT_FILTER(x) \ +( ((x) == CMP_OUT_FILTER_NONE) || \ + ((x) == CMP_OUT_FILTER_PCLK3) || \ + ((x) == CMP_OUT_FILTER_PCLK3_DIV8) || \ + ((x) == CMP_OUT_FILTER_PCLK3_DIV32)) + +#define IS_CMP_TIMWIN_FUNC(x) \ +( ((x) == CMP_TIMERWIN_OFF) || \ + ((x) == CMP_TIMERWIN_ON)) + +#define IS_CMP_TIMWIN_INVALIDLEVEL(x) \ +( ((x) == CMP_TIMERWIN_INVALID_LEVEL_LOW) || \ + ((x) == CMP_TIMERWIN_INVALID_LEVEL_HIGH)) + +#define IS_CMP_TIMWIN_OUT_LEVEL(x) \ +( ((x) == CMP_TIMERWIN_OUT_LEVEL_LOW) || \ + ((x) == CMP_TIMERWIN_OUT_LEVEL_HIGH)) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ + +/** + * @defgroup CMP_Global_Functions CMP Global Functions + * @{ + */ + +/** + * @brief Initialize structure stc_cmp_init_t variable with default value. + * @param [in] pstcCMP_InitStruct Pointer to a stc_cmp_init_t structure variable which will be initialized. + * @arg See the struct @ref stc_cmp_init_t. + * @retval Ok: Success + * ErrorInvalidParameter: Parameter error + */ +en_result_t CMP_StructInit(stc_cmp_init_t *pstcCMP_InitStruct) +{ + en_result_t enRet = ErrorInvalidParameter; + if (pstcCMP_InitStruct != NULL) + { + pstcCMP_InitStruct->u8CmpCh = CMP_CVSL_NONE; + pstcCMP_InitStruct->u8RefVol = CMP_RVSL_NONE; + pstcCMP_InitStruct->u8OutDetectEdges = CMP_DETECT_EDGS_NONE; + pstcCMP_InitStruct->u8OutFilter = CMP_OUT_FILTER_NONE; + pstcCMP_InitStruct->u8OutPolarity = CMP_OUT_REVERSE_OFF; + enRet = Ok; + } + return enRet; +} + +/** + * @brief De-initialize CMP unit + * @param [in] CMPx Pointer to CMP instance register base,This + * parameter can be one of the following values: + * @arg M0P_CMP1: CMP unit 1 instance register base + * @arg M0P_CMP2: CMP unit 2 instance register base + * @arg M0P_CMP3: CMP unit 3 instance register base + * @arg M0P_CMP4: CMP unit 4 instance register base + * @retval None + */ +void CMP_DeInit(M4_CMP_TypeDef *CMPx) +{ + DDL_ASSERT(IS_CMP_INSTANCE(CMPx)); + CLEAR_REG8(CMPx->MDR); + CLEAR_REG8(CMPx->FIR); + CLEAR_REG8(CMPx->OCR); + CLEAR_REG8(CMPx->PMSR); + CLEAR_REG16(CMPx->VISR); + CLEAR_REG16(CMPx->TWSR); + CLEAR_REG16(CMPx->TWPR); +} + +/** + * @brief CMP normal mode initialize + * @param [in] CMPx Pointer to CMP instance register base + * This parameter can be one of the following values: + * @arg M4_CMP1: CMP unit 1 instance register base + * @arg M4_CMP2: CMP unit 2 instance register base + * @arg M4_CMP3: CMP unit 3 instance register base + * @arg M4_CMP4: CMP unit 4 instance register base + * @param [in] pstcCmpInit CMP function base parameter structure + * @arg See the structure definition for @ref stc_cmp_init_t + * @retval Ok: Success + * ErrorInvalidParameter: Parameter error + */ +en_result_t CMP_NormalModeInit(M4_CMP_TypeDef *CMPx, + const stc_cmp_init_t *pstcCmpInit) +{ + en_result_t enRet = ErrorInvalidParameter; + /* Check CMPx instance and configuration structure*/ + if (NULL != pstcCmpInit) + { + /* Check parameters */ + DDL_ASSERT(IS_CMP_INSTANCE(CMPx)); + DDL_ASSERT(IS_CMP_CVSL_CH(pstcCmpInit->u8CmpCh)); + DDL_ASSERT(IS_CMP_RVSL(pstcCmpInit->u8RefVol)); + DDL_ASSERT(IS_CMP_OUT_DETECT_EDGE(pstcCmpInit->u8OutDetectEdges)); + DDL_ASSERT(IS_CMP_OUT_FILTER(pstcCmpInit->u8OutFilter)); + DDL_ASSERT(IS_CMP_OUT_POLARITY(pstcCmpInit->u8OutPolarity)); + + /* Stop CMP compare */ + CLEAR_REG8_BIT(CMPx->MDR, CMP_MDR_CENB); + /* Set compare voltage */ + WRITE_REG8(CMPx->PMSR, pstcCmpInit->u8CmpCh); + if((M4_CMP1 == CMPx) && ((pstcCmpInit->u8CmpCh == CMP_CVSL_INP2) || + (pstcCmpInit->u8CmpCh == CMP_CVSL_INP3))) + { + DDL_ASSERT(IS_CMP1_CVSL_SOURCE(pstcCmpInit->u16CmpVol)); + WRITE_REG8(CMPx->VISR, pstcCmpInit->u16CmpVol); + } + if((M4_CMP3 == CMPx) && ((pstcCmpInit->u8CmpCh == CMP_CVSL_INP2) || + (pstcCmpInit->u8CmpCh == CMP_CVSL_INP3))) + { + DDL_ASSERT(IS_CMP3_CVSL_SOURCE(pstcCmpInit->u16CmpVol)); + WRITE_REG8(CMPx->VISR, pstcCmpInit->u16CmpVol); + } + /* Set reference voltage */ + MODIFY_REG8(CMPx->PMSR, CMP_PMSR_RVSL, pstcCmpInit->u8RefVol); + /* Delay 1us*/ + DDL_DelayUS(1U); + /* Start CMP compare */ + SET_REG8_BIT(CMPx->MDR, CMP_MDR_CENB); + /* Delay 1us*/ + DDL_DelayUS(1U); + /* Set output filter and output detect edge and output polarity */ + WRITE_REG8(CMPx->FIR, (pstcCmpInit->u8OutFilter | pstcCmpInit->u8OutDetectEdges)); + WRITE_REG8(CMPx->OCR, pstcCmpInit->u8OutPolarity); + enRet = Ok; + } + return enRet; +} + +/** + * @brief CMP window mode initialize + * @param [in] CMPx Pointer to CMP instance register base + * This parameter can be one of the following values: + * @arg M4_CMP1: Select CMP1 and CMP2 for window comparison + * @arg M4_CMP2: Select CMP1 and CMP2 for window comparison + * @arg M4_CMP3: Select CMP3 and CMP4 for window comparison + * @arg M4_CMP4: Select CMP3 and CMP4 for window comparison + * @param [in] pstcCmpInit Configuration structure for window mode initialize + * @arg See the structure definition for @ref stc_cmp_init_t + * @param [in] pstcCmpWinRef Configuration structure for window mode reference voltage + * @arg See the structure definition for @ref stc_cmp_win_ref_t + * @retval Ok: Success + * ErrorInvalidParameter: Parameter error + */ +en_result_t CMP_WindowModeInit(const M4_CMP_TypeDef *CMPx, + const stc_cmp_init_t *pstcCmpInit, + const stc_cmp_win_ref_t *pstcCmpWinRef) +{ + en_result_t enRet = ErrorInvalidParameter; + /* Check configuration structure */ + if (NULL != pstcCmpInit) + { + /* Check parameters */ + DDL_ASSERT(IS_CMP_INSTANCE(CMPx)); + DDL_ASSERT(IS_CMP_CVSL_CH(pstcCmpWinRef->u8CmpCh1)); + DDL_ASSERT(IS_CMP_CVSL_CH(pstcCmpWinRef->u8CmpCh2)); + DDL_ASSERT(IS_CMP_RVSL(pstcCmpWinRef->u8WinVolLow)); + DDL_ASSERT(IS_CMP_RVSL(pstcCmpWinRef->u8WinVolHigh)); + DDL_ASSERT(IS_CMP_OUT_DETECT_EDGE(pstcCmpInit->u8OutDetectEdges)); + DDL_ASSERT(IS_CMP_OUT_FILTER(pstcCmpInit->u8OutFilter)); + DDL_ASSERT(IS_CMP_OUT_POLARITY(pstcCmpInit->u8OutPolarity)); + if((CMPx == M4_CMP1) || (CMPx == M4_CMP2)) + { + /* Stop CMP1 CMP2 compare */ + CLEAR_REG8_BIT(M4_CMP1->MDR, CMP_MDR_CENB); + CLEAR_REG8_BIT(M4_CMP2->MDR, CMP_MDR_CENB); + /* Set compare voltage */ + WRITE_REG8(M4_CMP1->PMSR, pstcCmpWinRef->u8CmpCh1); + WRITE_REG8(M4_CMP1->VISR, pstcCmpWinRef->u16CmpVol); + WRITE_REG8(M4_CMP2->PMSR, pstcCmpWinRef->u8CmpCh2); + /* Set reference Voltage */ + MODIFY_REG8(M4_CMP1->PMSR, CMP_PMSR_RVSL, pstcCmpWinRef->u8WinVolLow); + MODIFY_REG8(M4_CMP2->PMSR, CMP_PMSR_RVSL, pstcCmpWinRef->u8WinVolHigh); + /* Select window compare mode */ + SET_REG8_BIT(M4_CMP2->MDR, CMP_MDR_CWDE); + /* Start CMP compare function */ + SET_REG8_BIT(M4_CMP1->MDR, CMP_MDR_CENB); + SET_REG8_BIT(M4_CMP2->MDR, CMP_MDR_CENB); + /* Delay 1us*/ + DDL_DelayUS(1U); + /* Set output filter and output detect edge and output polarity */ + WRITE_REG8(M4_CMP2->FIR, pstcCmpInit->u8OutFilter | pstcCmpInit->u8OutDetectEdges); + WRITE_REG8(M4_CMP2->OCR, pstcCmpInit->u8OutPolarity); + } + else + { + /* Stop CMP3 CMP4 compare */ + CLEAR_REG8_BIT(M4_CMP3->MDR, CMP_MDR_CENB); + CLEAR_REG8_BIT(M4_CMP4->MDR, CMP_MDR_CENB); + /* Set compare voltage */ + WRITE_REG8(M4_CMP3->PMSR, pstcCmpWinRef->u8CmpCh1); + WRITE_REG8(M4_CMP3->VISR, pstcCmpWinRef->u16CmpVol); + WRITE_REG8(M4_CMP4->PMSR, pstcCmpWinRef->u8CmpCh2); + /* Set reference Voltage */ + MODIFY_REG8(M4_CMP3->PMSR, CMP_PMSR_RVSL, pstcCmpWinRef->u8WinVolLow); + MODIFY_REG8(M4_CMP4->PMSR, CMP_PMSR_RVSL, pstcCmpWinRef->u8WinVolHigh); + /* Select window compare mode */ + SET_REG8_BIT(M4_CMP4->MDR, CMP_MDR_CWDE); + /* Start CMP compare function */ + SET_REG8_BIT(M4_CMP3->MDR, CMP_MDR_CENB); + SET_REG8_BIT(M4_CMP4->MDR, CMP_MDR_CENB); + /* Delay 1us*/ + DDL_DelayUS(1U); + /* Set output filter and output detect edge and output polarity */ + WRITE_REG8(M4_CMP4->FIR, pstcCmpInit->u8OutFilter | pstcCmpInit->u8OutDetectEdges); + WRITE_REG8(M4_CMP4->OCR, pstcCmpInit->u8OutPolarity); + } + enRet = Ok; + } + return enRet; +} + +/** + * @brief Voltage compare function command + * @param [in] CMPx Pointer to CMP instance register base + * This parameter can be one of the following values: + * @arg M4_CMP1: CMP unit 1 instance register base + * @arg M4_CMP2: CMP unit 2 instance register base + * @arg M4_CMP3: CMP unit 3 instance register base + * @arg M4_CMP4: CMP unit 4 instance register base + * @param [in] enNewStatus The function new status. + * This parameter can be: Enable or Disable. + * @retval None + */ +void CMP_FuncCmd(M4_CMP_TypeDef *CMPx, en_functional_state_t enNewStatus) +{ + /* Check CMPx instance */ + DDL_ASSERT(IS_CMP_INSTANCE(CMPx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewStatus)); + + if(Enable == enNewStatus) + { + SET_REG8_BIT(CMPx->MDR, CMP_MDR_CENB); + /* Delay 1us*/ + DDL_DelayUS(1U); + } + else + { + CLEAR_REG8_BIT(CMPx->MDR, CMP_MDR_CENB); + } +} + +/** + * @brief Voltage compare interrupt function command + * @param [in] CMPx Pointer to CMP instance register base + * This parameter can be one of the following values: + * @arg M4_CMP1: CMP unit 1 instance register base + * @arg M4_CMP2: CMP unit 2 instance register base + * @arg M4_CMP3: CMP unit 3 instance register base + * @arg M4_CMP4: CMP unit 4 instance register base + * @param [in] enNewStatus The function new status. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void CMP_IntCmd(M4_CMP_TypeDef *CMPx, en_functional_state_t enNewStatus) +{ + /* Check parameters */ + DDL_ASSERT(IS_CMP_INSTANCE(CMPx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewStatus)); + if(Enable == enNewStatus) + { + SET_REG8_BIT(CMPx->FIR, CMP_FIR_CIEN); + } + else + { + CLEAR_REG8_BIT(CMPx->FIR, CMP_FIR_CIEN); + } +} + +/** + * @brief Voltage compare output command + * @param [in] CMPx Pointer to CMP instance register base + * This parameter can be one of the following values: + * @arg M4_CMP1: CMP unit 1 instance register base + * @arg M4_CMP2: CMP unit 2 instance register base + * @arg M4_CMP3: CMP unit 3 instance register base + * @arg M4_CMP4: CMP unit 4 instance register base + * @param [in] enNewStatus The function new status. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void CMP_OutputCmd(M4_CMP_TypeDef *CMPx, en_functional_state_t enNewStatus) +{ + /* Check parameters */ + DDL_ASSERT(IS_CMP_INSTANCE(CMPx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewStatus)); + if(Enable == enNewStatus) + { + SET_REG8_BIT(CMPx->OCR, CMP_OCR_COEN); + } + else + { + CLEAR_REG8_BIT(CMPx->OCR, CMP_OCR_COEN); + } +} + +/** + * @brief Voltage compare output port VCOUT function command + * @param [in] CMPx Pointer to CMP instance register base + * This parameter can be one of the following values: + * @arg M4_CMP1: CMP unit 1 instance register base + * @arg M4_CMP2: CMP unit 2 instance register base + * @arg M4_CMP3: CMP unit 3 instance register base + * @arg M4_CMP4: CMP unit 4 instance register base + * @param [in] enNewStatus The function new status. + * This parameter can be: Enable or Disable. + * @retval None + */ +void CMP_VCOUTCmd(M4_CMP_TypeDef *CMPx, en_functional_state_t enNewStatus) +{ + /* Check parameters */ + DDL_ASSERT(IS_CMP_INSTANCE(CMPx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewStatus)); + if(Enable == enNewStatus) + { + SET_REG8_BIT(CMPx->OCR, CMP_OCR_CPOE); + } + else + { + CLEAR_REG8_BIT(CMPx->OCR, CMP_OCR_CPOE); + } +} + +/** + * @brief Voltage compare result flag read + * @param [in] CMPx Pointer to CMP instance register base + * This parameter can be one of the following values: + * @arg M4_CMP1: CMP unit 1 instance register base + * @arg M4_CMP2: CMP unit 2 instance register base + * @arg M4_CMP3: CMP unit 3 instance register base + * @arg M4_CMP4: CMP unit 4 instance register base + * @retval In normal mode: + * Reset: compare voltage < reference voltage + * Set: compare voltage > reference voltage + * In Window mode: + * Reset: compare voltage < reference low voltage or + * compare voltage > reference high voltage + * Set: reference low voltage < compare voltage < reference high voltage + */ +en_flag_status_t CMP_GetResult(const M4_CMP_TypeDef *CMPx) +{ + en_flag_status_t enRet; + /* Check CMPx instance */ + DDL_ASSERT(IS_CMP_INSTANCE(CMPx)); + enRet = READ_REG8_BIT(CMPx->MDR, CMP_MDR_CMON) ? Set : Reset; + return enRet; +} + +/** + * @brief Voltage compare timer window function configuration + * @param [in] CMPx Pointer to CMP instance register base + * This parameter can be one of the following values: + * @arg M4_CMP1: CMP unit 1 instance register base + * @arg M4_CMP2: CMP unit 2 instance register base + * @arg M4_CMP3: CMP unit 3 instance register base + * @arg M4_CMP4: CMP unit 4 instance register base + * @param [in] pstcCMP_TimerWinStruct Configuration structure for Timer window mode. + * @retval Ok: Successfully + * ErrorInvalidParameter: Parameter error + */ +en_result_t CMP_TimerWindowConfig(M4_CMP_TypeDef *CMPx, + const stc_cmp_timerwindow_t *pstcCMP_TimerWinStruct) +{ + en_result_t enRet = ErrorInvalidParameter; + /* Check CMPx instance and configuration structure*/ + if (NULL != pstcCMP_TimerWinStruct) + { + enRet = Ok; + /* Check parameters */ + DDL_ASSERT(IS_CMP_INSTANCE(CMPx)); + DDL_ASSERT(IS_CMP_TIMWIN_INVALIDLEVEL(pstcCMP_TimerWinStruct->u8TWInvalidLevel)); + DDL_ASSERT(IS_CMP_TIMWIN_OUT_LEVEL(pstcCMP_TimerWinStruct->u8TWOutLevel)); + /* Select timer window mode */ + SET_REG8_BIT(CMPx->OCR, CMP_OCR_TWOE); + /* Select output level when timer window invalid */ + MODIFY_REG8(CMPx->OCR, CMP_OCR_TWOL, pstcCMP_TimerWinStruct->u8TWInvalidLevel); + /* Select Timer window source */ + WRITE_REG16(CMPx->TWSR, pstcCMP_TimerWinStruct->u16TWSelect); + /* Select timer window mode output level */ + if(CMP_TIMERWIN_OUT_LEVEL_HIGH == pstcCMP_TimerWinStruct->u8TWOutLevel) + { + SET_REG16_BIT(CMPx->TWPR, pstcCMP_TimerWinStruct->u16TWSelect); + } + else + { + CLEAR_REG16_BIT(CMPx->TWPR, pstcCMP_TimerWinStruct->u16TWSelect); + } + } + return enRet; +} + +/** + * @brief Set output detect edge + * @param [in] CMPx Pointer to CMP instance register base + * This parameter can be one of the following values: + * @arg M4_CMP1: CMP unit 1 instance register base + * @arg M4_CMP2: CMP unit 2 instance register base + * @arg M4_CMP3: CMP unit 3 instance register base + * @arg M4_CMP4: CMP unit 4 instance register base + * @param [in] u8CmpEdges CMP output detect edge selection. + * This parameter can be one of the following values: + * @arg CMP_DETECT_EDGS_NONE: Do not detect edge + * @arg CMP_DETECT_EDGS_RISING: Detect rising edge + * @arg CMP_DETECT_EDGS_FALLING: Detect falling edge + * @arg CMP_DETECT_EDGS_BOTH: Detect rising and falling edges + * @retval None + */ +void CMP_SetOutDetectEdges(M4_CMP_TypeDef *CMPx, uint8_t u8CmpEdges) +{ + uint8_t u8temp; + /* Check parameters */ + DDL_ASSERT(IS_CMP_INSTANCE(CMPx)); + DDL_ASSERT(IS_CMP_OUT_DETECT_EDGE(u8CmpEdges)); + /* Read CMP status */ + u8temp = READ_REG8_BIT(CMPx->MDR, CMP_MDR_CENB); + /* Stop CMP function */ + CLEAR_REG8_BIT(CMPx->MDR, CMP_MDR_CENB); + /* CMP output detect edge selection */ + MODIFY_REG8(CMPx->FIR, CMP_FIR_EDGS, u8CmpEdges); + if(u8temp != 0U) + { + /* Recover CMP status */ + MODIFY_REG8(CMPx->MDR, CMP_MDR_CENB, u8temp); + /* Delay 1us */ + DDL_DelayUS(1U); + } +} + +/** + * @brief Set output filter + * @param [in] CMPx Pointer to CMP instance register base + * This parameter can be one of the following values: + * @arg M4_CMP1: CMP unit 1 instance register base + * @arg M4_CMP2: CMP unit 2 instance register base + * @arg M4_CMP3: CMP unit 3 instance register base + * @arg M4_CMP4: CMP unit 4 instance register base + * @param [in] u8CmpFilter CMP output filter selection. + * This parameter can be one of the following values: + * @arg CMP_OUT_FILTER_NONE: Don't filter + * @arg CMP_OUT_FILTER_PCLK3: Use PCLK3 + * @arg CMP_OUT_FILTER_PCLK3_DIV8: Use PCLK3 / 8 + * @arg CMP_OUT_FILTER_PCLK3_DIV32: Use PCLK3 / 32 + * @retval None + */ +void CMP_SetOutputFilter(M4_CMP_TypeDef *CMPx, uint8_t u8CmpFilter) +{ + uint8_t u8temp; + /* Check parameters */ + DDL_ASSERT(IS_CMP_INSTANCE(CMPx)); + DDL_ASSERT(IS_CMP_OUT_FILTER(u8CmpFilter)); + /* Read CMP status */ + u8temp = READ_REG8_BIT(CMPx->MDR, CMP_MDR_CENB); + /* Stop CMP function */ + CLEAR_REG8_BIT(CMPx->MDR, CMP_MDR_CENB); + /* CMP output filter selection */ + MODIFY_REG8(CMPx->FIR, CMP_FIR_FCKS, u8CmpFilter); + if(u8temp != 0U) + { + /* Recover CMP status */ + MODIFY_REG8(CMPx->MDR, CMP_MDR_CENB, u8temp); + /* Delay 1us */ + DDL_DelayUS(1U); + } +} + +/** + * @brief Set output polarity + * @param [in] CMPx Pointer to CMP instance register base + * This parameter can be one of the following values: + * @arg M4_CMP1: CMP unit 1 instance register base + * @arg M4_CMP2: CMP unit 2 instance register base + * @arg M4_CMP3: CMP unit 3 instance register base + * @arg M4_CMP4: CMP unit 4 instance register base + * @param [in] u8CmpPolarity CMP output polarity selection. + * This parameter can be one of the following values: + * @arg CMP_OUT_REVERSE_OFF: CMP output don't reverse + * @arg CMP_OUT_REVERSE_ON: CMP output level reverse + * @retval None + */ +void CMP_SetOutputPolarity(M4_CMP_TypeDef *CMPx, uint8_t u8CmpPolarity) +{ + uint8_t u8temp; + /* Check parameters */ + DDL_ASSERT(IS_CMP_INSTANCE(CMPx)); + DDL_ASSERT(IS_CMP_OUT_POLARITY(u8CmpPolarity)); + /* Read CMP status */ + u8temp = READ_REG8_BIT(CMPx->MDR, CMP_MDR_CENB); + /* Stop CMP function */ + CLEAR_REG8_BIT(CMPx->MDR, CMP_MDR_CENB); + /* CMP output polarity selection */ + MODIFY_REG8(CMPx->OCR, CMP_OCR_COPS, u8CmpPolarity); + if(u8temp != 0U) + { + /* Recover CMP status */ + MODIFY_REG8(CMPx->MDR, CMP_MDR_CENB, u8temp); + /* Delay 1us */ + DDL_DelayUS(1U); + } +} + +/** + * @brief Set compare voltage + * @param [in] CMPx Pointer to CMP instance register base + * This parameter can be one of the following values: + * @arg M4_CMP1: CMP unit 1 instance register base + * @arg M4_CMP2: CMP unit 2 instance register base + * @arg M4_CMP3: CMP unit 3 instance register base + * @arg M4_CMP4: CMP unit 4 instance register base + * @param [in] u8CmpCh Select the compare voltage. + * This parameter can be one of the following values: + * @arg CMP_CVSL_NONE: Don't input compare voltage + * @arg CMP_CVSL_INP1: Select INP1 as compare voltage + * @arg CMP_CVSL_INP2: Select INP2 as compare voltage + * @arg CMP_CVSL_INP3: Select INP3 as compare voltage + * @arg CMP_CVSL_INP4: Select INP4 as compare voltage + * @param [in] u8CmpVol Select the compare voltage source (Config the parameter when use CMP1 or CMP3) + * This parameter can be one of the following values: + * When use CMP1: + * @arg CMP1_INP3_NONE: Don't input voltage to CMP1 INP3 + * @arg CMP1_INP3_CMP1_INP3: Select CMP1_INP3 as CMP1 INP3 input + * @arg CMP1_INP3_CMP2_INP3: Select CMP2_INP3 as CMP1 INP3 input + * @arg CMP1_INP2_NONE: Don't input voltage to CMP1 INP2 + * @arg CMP1_INP2_PGA1: Select PGA1 as CMP1 INP2 input + * @arg CMP1_INP2_PGA2: Select PGA2 as CMP1 INP2 input + * @arg CMP1_INP2_CMP1_INP2: Select CMP1_INP2 as CMP1 INP2 input + * When use CMP3: + * @arg CMP3_INP3_NONE: Don't input voltage to CMP3 INP3 + * @arg CMP3_INP3_CMP3_INP3: Select CMP3_INP3 as CMP3 INP3 input + * @arg CMP3_INP3_CMP4_INP3: Select CMP4_INP3 as CMP3 INP3 input + * @arg CMP3_INP2_NONE: Don't input voltage to CMP3 INP2 + * @arg CMP3_INP2_PGA3: Select PGA3 as CMP3 INP2 input + * @arg CMP3_INP2_PGA4: Select PGA4 as CMP3 INP2 input + * @arg CMP3_INP2_CMP3_INP2: Select CMP3_INP2 as CMp3 INP2 input + * @retval None + * @note When use INP1 or INP4, please set u8CmpVol to 0 + */ +void CMP_SetCompareVol(M4_CMP_TypeDef *CMPx, uint8_t u8CmpCh, uint8_t u8CmpVol) +{ + uint8_t u8temp; + /* Check parameters */ + DDL_ASSERT(IS_CMP_INSTANCE(CMPx)); + DDL_ASSERT(IS_CMP_CVSL_CH(u8CmpCh)); + /* Read CMP status */ + u8temp = READ_REG8_BIT(CMPx->MDR, CMP_MDR_CENB); + /* Stop CMP function */ + CLEAR_REG8_BIT(CMPx->MDR, CMP_MDR_CENB); + /* Set compare voltage */ + MODIFY_REG8(CMPx->PMSR, CMP_PMSR_CVSL, u8CmpCh); + if((M4_CMP1 == CMPx) && ((u8CmpCh == CMP_CVSL_INP2) || (u8CmpCh == CMP_CVSL_INP3))) + { + DDL_ASSERT(IS_CMP1_CVSL_SOURCE(u8CmpVol)); + WRITE_REG8(CMPx->VISR, u8CmpVol); + } + if((M4_CMP3 == CMPx) && ((u8CmpCh == CMP_CVSL_INP2) || (u8CmpCh == CMP_CVSL_INP3))) + { + DDL_ASSERT(IS_CMP3_CVSL_SOURCE(u8CmpVol)); + WRITE_REG8(CMPx->VISR, u8CmpVol); + } + if(u8temp != 0U) + { + /* Recover CMP status */ + MODIFY_REG8(CMPx->MDR, CMP_MDR_CENB, u8temp); + /* Delay 1us */ + DDL_DelayUS(1U); + } +} + +/** + * @brief Set reference voltage + * @param [in] CMPx Pointer to CMP instance register base + * This parameter can be one of the following values: + * @arg M4_CMP1: CMP unit 1 instance register base + * @arg M4_CMP2: CMP unit 2 instance register base + * @arg M4_CMP3: CMP unit 3 instance register base + * @arg M4_CMP4: CMP unit 4 instance register base + * @param [in] u8RefVol Select the reference voltage. + * This parameter can be one of the following values: + * @arg CMP_RVSL_NONE: Don't input reference voltage + * @arg CMP_RVSL_INM1: Select INM1 as reference voltage + * @arg CMP_RVSL_INM2: Select INM2 as reference voltage + * @arg CMP_RVSL_INM3: Select INM3 as reference voltage + * @arg CMP_RVSL_INM4: Select INM4 as reference voltage + * @retval None + */ +void CMP_SetRefVol(M4_CMP_TypeDef *CMPx, uint8_t u8RefVol) +{ + uint8_t u8temp; + /* Check parameters */ + DDL_ASSERT(IS_CMP_INSTANCE(CMPx)); + DDL_ASSERT(IS_CMP_RVSL(u8RefVol)); + /* Read CMP status */ + u8temp = READ_REG8_BIT(CMPx->MDR, CMP_MDR_CENB); + /* Stop CMP function */ + CLEAR_REG8_BIT(CMPx->MDR, CMP_MDR_CENB); + /* Set reference voltage */ + MODIFY_REG8(CMPx->PMSR, CMP_PMSR_RVSL, u8RefVol); + if(u8temp != 0U) + { + /* Recover CMP status */ + MODIFY_REG8(CMPx->MDR, CMP_MDR_CENB, u8temp); + /* Delay 1us */ + DDL_DelayUS(1U); + } +} + +/** + * @brief Ste CMP Timer window signal. + * @param [in] CMPx Pointer to CMP instance register base + * This parameter can be one of the following values: + * @arg M4_CMP1: CMP unit 1 instance register base + * @arg M4_CMP2: CMP unit 2 instance register base + * @arg M4_CMP3: CMP unit 3 instance register base + * @arg M4_CMP4: CMP unit 4 instance register base + * @param [in] u16TWSignal Selection timer window signal + * This parameter can be value of @ref CMP_TimerWin_Select + * @param [in] enNewStatus The function new status. + * This parameter can be: Enable or Disable. + * @retval None + */ +void CMP_SetTimerWinSignal(M4_CMP_TypeDef *CMPx, \ + uint16_t u16TWSignal, en_functional_state_t enNewStatus) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewStatus)); + DDL_ASSERT(IS_CMP_INSTANCE(CMPx)); + if (enNewStatus == Enable) + { + MODIFY_REG16(CMPx->TWSR, u16TWSignal, u16TWSignal); + } + else + { + CLEAR_REG16_BIT(CMPx->TWSR, u16TWSignal); + } +} + +/** + * @} + */ + +#endif /* DDL_CMP_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_crc.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_crc.c new file mode 100644 index 0000000000..38939a6bb5 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_crc.c @@ -0,0 +1,317 @@ +/** + ******************************************************************************* + * @file hc32f4a0_crc.c + * @brief This file provides firmware functions to manage the Cyclic Redundancy + * Check(CRC). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Heqb First version + 2020-07-21 Heqb Fixed a bug for CRC_Check function + 2020-08-11 Heqb Modify macro definition name IS_CRC_PROCOTOL + to IS_CRC_PROTOCOL + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_crc.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_CRC CRC + * @brief Cyclic Redundancy Check Driver Library + * @{ + */ + +#if (DDL_CRC_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup CRC_Local_Macros CRC Local Macros + * @{ + */ + +/** + * @defgroup CRC_Check_Parameters_Validity CRC check parameters validity + * @{ + */ +#define IS_CRC_PROTOCOL(x) \ +( ((x) == CRC_CRC16) || \ + ((x) == CRC_CRC32)) + +#define IS_CRC_BIT_WIDTH(x) \ +( ((x) == CRC_BW_8) || \ + ((x) == CRC_BW_16) || \ + ((x) == CRC_BW_32)) + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ +/** + * @defgroup CRC_Local_Functions CRC Local Functions + * @{ + */ +static void CRC_8BitWrite(const uint8_t au8Data[], uint32_t u32Length); +static void CRC_16BitWrite(const uint16_t au16Data[], uint32_t u32Length); +static void CRC_32BitWrite(const uint32_t au32Data[], uint32_t u32Length); +/** + * @} + */ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup CRC_Global_Functions CRC Global Functions + * @{ + */ + +/** + * @brief CRC16 calculation. + * @param [in] u32CrcProtocol CRC protocol control bit. + * This parameter can be a value of @ref CRC_Protocol_Control_Bit + * @param [in] pvData Pointer to the buffer containing the data to be computed. + * @param [in] u32InitVal Initialize the CRC calculation. + * @param [in] u32Length The length(countted in bytes or half word or word, depending on + * the bit width) of the data to be computed. + * @param [in] u8BitWidth Bit width of the data. + * @arg CRC_BW_8: 8 Bit. + * @arg CRC_BW_16: 16 Bit. + * @arg CRC_BW_32: 32 Bit. + * @retval CRC checksum. + */ +uint32_t CRC_Calculate(uint32_t u32CrcProtocol, + const void *pvData, + uint32_t u32InitVal, + uint32_t u32Length, + uint8_t u8BitWidth) +{ + uint32_t u32CheckSum = 0UL; + + if ((pvData != NULL) && (u32Length != 0U)) + { + DDL_ASSERT(IS_CRC_PROTOCOL(u32CrcProtocol)); + DDL_ASSERT(IS_CRC_BIT_WIDTH(u8BitWidth)); + /* Set operation mode (CRC16 or CRC32) */ + WRITE_REG32(M4_CRC->CR, u32CrcProtocol); + /* Set initial value */ + if (u32CrcProtocol == CRC_CRC32) + { + WRITE_REG32(M4_CRC->RESLT, u32InitVal); + } + else + { + WRITE_REG16(M4_CRC->RESLT, u32InitVal); + } + /* Write data */ + if (u8BitWidth == CRC_BW_8) + { + CRC_8BitWrite(pvData, u32Length); + } + else if (u8BitWidth == CRC_BW_16) + { + CRC_16BitWrite(pvData, u32Length); + } + else + { + CRC_32BitWrite(pvData, u32Length); + } + /* Get checksum */ + if (u32CrcProtocol == CRC_CRC32) + { + u32CheckSum = READ_REG32(M4_CRC->RESLT); + } + else + { + u32CheckSum = READ_REG16(M4_CRC->RESLT); + } + } + return u32CheckSum; +} + +/** + * @brief CRC check. + * @param [in] u32CrcProtocol CRC protocol control bit. + * This parameter can be a value of @ref CRC_Protocol_Control_Bit + * @param [in] u32CheckSum The checksum of the data pointed by pointer pvData. + * @param [in] pvData Pointer to the buffer containing the data to be checked. + * @param [in] u32InitVal Initialize the CRC calculation. + * @param [in] u32Length The length(countted in bytes or half word or word, depending on + * the bit width) of the data to be computed. + * @param [in] u8BitWidth Bit width of the data. + * @arg CRC_BW_8: 8 Bit. + * @arg CRC_BW_16: 16 Bit. + * @arg CRC_BW_32: 32 Bit. + * @retval A en_flag_status_t value. + * @arg Set: CRC checks successfully. + * @arg Reset: CRC checks unsuccessfully. + */ +en_flag_status_t CRC_Check(uint32_t u32CrcProtocol, + uint32_t u32CheckSum, + const void *pvData, + uint32_t u32InitVal, + uint32_t u32Length, + uint8_t u8BitWidth) +{ + en_flag_status_t enFlag = Reset; + uint32_t u32DataAddr = (uint32_t)&M4_CRC->DAT0; + DDL_ASSERT(IS_CRC_PROTOCOL(u32CrcProtocol)); + DDL_ASSERT(IS_CRC_BIT_WIDTH(u8BitWidth)); + if ((pvData != NULL) && (u32Length != 0UL)) + { + /* Set operation mode (CRC16 or CRC32) */ + WRITE_REG32(M4_CRC->CR, u32CrcProtocol); + /* Set initial value */ + if (u32CrcProtocol == CRC_CRC32) + { + WRITE_REG32(M4_CRC->RESLT, u32InitVal); + } + else + { + WRITE_REG16(M4_CRC->RESLT, u32InitVal); + } + /* Write data */ + if (u8BitWidth == CRC_BW_8) + { + CRC_8BitWrite(pvData, u32Length); + } + else if (u8BitWidth == CRC_BW_16) + { + CRC_16BitWrite(pvData, u32Length); + } + else + { + CRC_32BitWrite(pvData, u32Length); + } + /* Write checksum */ + if (u32CrcProtocol == CRC_CRC32) + { + RW_MEM32(u32DataAddr) = u32CheckSum; + } + else + { + + RW_MEM16(u32DataAddr) = (uint16_t)u32CheckSum; + } + /* Get flag */ + if (READ_REG32_BIT(M4_CRC->CR, CRC_CR_FLAG) != 0UL) + { + enFlag = Set; + } + } + return enFlag; +} + +/** + * @} + */ + +/** + * @addtogroup CRC_Local_Functions CRC Local Functions + * @{ + */ + +/** + * @brief Write CRC data register in bytes. + * @param [in] au8Data The buffer for writing. + * @param [in] u32Length The length of data the in bytes. + * @retval None + */ +static void CRC_8BitWrite(const uint8_t au8Data[], uint32_t u32Length) +{ + uint32_t i; + const uint32_t u32DataAddr = (uint32_t)(&M4_CRC->DAT0); + for (i = 0UL; i < u32Length; i++) + { + RW_MEM8(u32DataAddr) = au8Data[i]; + + } +} + +/** + * @brief Write CRC data register in half words. + * @param [in] au16Data The buffer for writing. + * @param [in] u32Length The length of the data in half words. + * @retval None + */ +static void CRC_16BitWrite(const uint16_t au16Data[], uint32_t u32Length) +{ + uint32_t i; + const uint32_t u32DataAddr = (uint32_t)(&M4_CRC->DAT0); + for (i = 0UL; i < u32Length; i++) + { + RW_MEM16(u32DataAddr) = au16Data[i]; + } +} + +/** + * @brief Write CRC data register in words. + * @param [in] au32Data The buffer for writing. + * @param [in] u32Length The length of the data in words. + * @retval None + */ +static void CRC_32BitWrite(const uint32_t au32Data[], uint32_t u32Length) +{ + uint32_t i; + const uint32_t u32DataAddr = (uint32_t)(&M4_CRC->DAT0); + for (i = 0UL; i < u32Length; i++) + { + RW_MEM32(u32DataAddr) = au32Data[i]; + } +} + +/** + * @} + */ + +#endif /* DDL_CRC_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_ctc.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_ctc.c new file mode 100644 index 0000000000..ff6fe6e001 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_ctc.c @@ -0,0 +1,399 @@ +/** + ******************************************************************************* + * @file hc32f4a0_ctc.c + * @brief This file provides firmware functions to manage the Clock Trimming + * Controller(CTC). + @verbatim + Change Logs: + Date Author Notes + 2020-09-01 Hongjh First version + 2020-10-30 Hongjh Modify for refining CTC initialization structure + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_ctc.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_CTC CTC + * @brief CTC Driver Library + * @{ + */ + +#if (DDL_CTC_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup CTC_Local_Macros CTC Local Macros + * @{ + */ + +/** + * @defgroup CTC_Check_Parameters_Validity CTC Check Parameters Validity + * @{ + */ + +#define IS_CTC_REF_CLK_SRC(x) \ +( ((x) == CTC_REF_CLK_XTAL) || \ + ((x) == CTC_REF_CLK_XTAL32) || \ + ((x) == CTC_REF_CLK_CTCREF)) + +#define IS_CTC_REF_CLK_DIV(x) \ +( ((x) == CTC_REF_CLK_DIV8) || \ + ((x) == CTC_REF_CLK_DIV32) || \ + ((x) == CTC_REF_CLK_DIV128) || \ + ((x) == CTC_REF_CLK_DIV256) || \ + ((x) == CTC_REF_CLK_DIV512) || \ + ((x) == CTC_REF_CLK_DIV1024) || \ + ((x) == CTC_REF_CLK_DIV2048) || \ + ((x) == CTC_REF_CLK_DIV4096)) + +#define IS_CTC_OFFSET_VALUE(x) ((x) <= 0xFFUL) + +#define IS_CTC_RELOAD_VALUE(x) ((x) <= 0xFFFFUL) + +#define IS_CTC_TRIM_VALUE(x) ((x) <= 0x3FUL) + +#define IS_CTC_TOLERANCE_DEVIATION(x) (((x) >= 0.0F) && \ + ((x) <= CTC_TOLERANCE_DEVIATION_MAX)) + +#define IS_CTC_FLAG(x) \ +( ((x) != 0UL) && \ + (((x) | CTC_FLAG_ALL) == CTC_FLAG_ALL)) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup CTC_Global_Functions CTC Global Functions + * @{ + */ + +/** + * @brief Initialize CTC function. + * @param [in] pstcCtcInit Pointer to a @ref stc_ctc_init_t structure. + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorNotReady: CTC state is busy + * - ErrorInvalidParameter: If one of following cases matches: + * - pstcCtcInit is NULL + * - Reference frequency is out of range + * - Calculate reload & offset value out of range + */ +en_result_t CTC_Init(const stc_ctc_init_t *pstcCtcInit) +{ + float f32OffsetValue; + uint32_t u32RegValue; + uint32_t u32ReloadValue; + uint32_t u32OffsetValue; + uint32_t u32RefClockDiv; + uint32_t u32Multiplier; + uint64_t u64InterClock; + uint32_t u32HrcFreq = HRC_VALUE; + en_result_t enRet = ErrorNotReady; + + /* Check CTC status */ + if (CTC_FLAG_BUSY != (READ_REG32_BIT(M4_CTC->STR, CTC_FLAG_BUSY))) + { + if ((NULL == pstcCtcInit) || (0UL == pstcCtcInit->u32RefClockFreq)) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_CTC_REF_CLK_SRC(pstcCtcInit->u32RefClockSrc)); + DDL_ASSERT(IS_CTC_REF_CLK_DIV(pstcCtcInit->u32RefClockDiv)); + DDL_ASSERT(IS_CTC_TRIM_VALUE(pstcCtcInit->u32TrimValue)); + DDL_ASSERT(IS_CTC_TOLERANCE_DEVIATION(pstcCtcInit->f32ToleranceDeviation)); + + if (pstcCtcInit->u32RefClockDiv < CTC_REF_CLK_DIV128) + { + u32RefClockDiv = (8UL << (2UL * pstcCtcInit->u32RefClockDiv)); + } + else + { + u32RefClockDiv = (32UL << pstcCtcInit->u32RefClockDiv); + } + u64InterClock = ((uint64_t)u32HrcFreq) * ((uint64_t)(u32RefClockDiv)); + u32Multiplier = (uint32_t)(u64InterClock / pstcCtcInit->u32RefClockFreq); + + /* Calculate offset value formula: OFSVAL = (Fhrc / (Fref * Fref_divsion)) * TA */ + f32OffsetValue = ((float)u32Multiplier) * (pstcCtcInit->f32ToleranceDeviation); + u32OffsetValue = (uint32_t)(f32OffsetValue); + + /* Calculate reload value formula: RLDVAL = (Fhrc / (Fref * Fref_divsion)) + OFSVAL */ + u32ReloadValue = u32Multiplier + u32OffsetValue; + + if ((IS_CTC_OFFSET_VALUE(u32OffsetValue)) && (IS_CTC_RELOAD_VALUE(u32ReloadValue))) + { + /* Set CR1 */ + u32RegValue = (pstcCtcInit->u32RefClockDiv | \ + pstcCtcInit->u32RefClockSrc | \ + (pstcCtcInit->u32TrimValue << CTC_CR1_TRMVAL_POS)); + WRITE_REG32(M4_CTC->CR1, u32RegValue); + + /* Set CR2 */ + u32RegValue = ((u32ReloadValue << CTC_CR2_RLDVAL_POS) | u32OffsetValue); + WRITE_REG32(M4_CTC->CR2, u32RegValue); + enRet = Ok; + } + } + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_uart_init_t to default values. + * @param [out] pstcCtcInit Pointer to a @ref stc_ctc_init_t structure. + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: pstcCtcInit is NULL + */ +en_result_t CTC_StructInit(stc_ctc_init_t *pstcCtcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check parameters */ + if (NULL != pstcCtcInit) + { + pstcCtcInit->u32RefClockFreq = 0UL; + pstcCtcInit->u32RefClockSrc = CTC_REF_CLK_CTCREF; + pstcCtcInit->u32RefClockDiv = CTC_REF_CLK_DIV8; + pstcCtcInit->f32ToleranceDeviation = 0.0F; + pstcCtcInit->u32TrimValue = 0UL; + enRet = Ok; + } + + return enRet; +} + +/** + * @brief De-Initialize CTC function. + * @param None + * @retval An en_result_t enumeration value: + * - Ok: De-Initialize success + * - ErrorNotReady: CTC state is busy + */ +en_result_t CTC_DeInit(void) +{ + en_result_t enRet = ErrorNotReady; + + /* Check CTC status */ + if (CTC_FLAG_BUSY != (READ_REG32_BIT(M4_CTC->STR, CTC_FLAG_BUSY))) + { + /* Configures the registers to reset value. */ + WRITE_REG32(M4_CTC->CR1, 0UL); + WRITE_REG32(M4_CTC->CR2, 0UL); + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set CTC reference clock division. + * @param [in] u32Div CTC reference clock prescaler + * This parameter can be one of the following values: + * @arg CTC_REF_CLK_DIV8: REFCLK/8 + * @arg CTC_REF_CLK_DIV32: REFCLK/32 + * @arg CTC_REF_CLK_DIV128: REFCLK/128 + * @arg CTC_REF_CLK_DIV256: REFCLK/256 + * @arg CTC_REF_CLK_DIV512: REFCLK/512 + * @arg CTC_REF_CLK_DIV1024: REFCLK/1024 + * @arg CTC_REF_CLK_DIV2048: REFCLK/2048 + * @arg CTC_REF_CLK_DIV4096: REFCLK/4096 + * @retval None + */ +void CTC_SetRefClockDiv(uint32_t u32Div) +{ + /* Check parameters */ + DDL_ASSERT(IS_CTC_REF_CLK_DIV(u32Div)); + + MODIFY_REG32(M4_CTC->CR1, CTC_CR1_REFPSC, u32Div); +} + +/** + * @brief Set CTC reference clock source. + * @param [in] u32ClockSrc CTC reference clock source + * This parameter can be one of the following values: + * @arg CTC_REF_CLK_CTCREF: Clock source CTCREF + * @arg CTC_REF_CLK_XTAL: Clock source XTAL + * @retval None + */ +void CTC_SetRefClockSrc(uint32_t u32ClockSrc) +{ + /* Check parameters */ + DDL_ASSERT(IS_CTC_REF_CLK_SRC(u32ClockSrc)); + + MODIFY_REG32(M4_CTC->CR1, CTC_CR1_REFCKS, u32ClockSrc); +} + +/** + * @brief Enable or disable CTC error interrupt function. + * @param [in] enNewState The function new state. + * This parameter can be one of the following values: + * @arg Enable: Enable CTC error interrupt function. + * @arg Disable: Disable CTC error interrupt function. + * @retval None + */ +void CTC_IntCmd(en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + WRITE_REG32(bM4_CTC->CR1_b.ERRIE, enNewState); +} + +/** + * @brief Get CTC flag. + * @param [in] u32Flag CTC flag + * This parameter can be any composed value of the following values:: + * @arg CTC_FLAG_TRIM_OK: Trimming OK flag + * @arg CTC_FLAG_TRIM_OVF: Trimming overflow flag + * @arg CTC_FLAG_TRIM_UDF: Trimming underflow flag + * @arg CTC_FLAG_BUSY: CTC busy flag + * @retval Returned value can be one of the following values: + * - Set: Any bit of the composed flag is set. + * - Reset: All bit of the composed flag is reset. + */ +en_flag_status_t CTC_GetStatus(uint32_t u32Flag) +{ + /* Check parameters */ + DDL_ASSERT(IS_CTC_FLAG(u32Flag)); + + return ((0UL == READ_REG32_BIT(M4_CTC->STR, u32Flag)) ? Reset : Set); +} + +/** + * @brief Set CTC trimming value. + * @param [in] u32TrimValue CTC trimming value + * This parameter can be min=0 && max=0x3F + * @retval None + */ +void CTC_SetTrimValue(uint32_t u32TrimValue) +{ + /* Check parameters */ + DDL_ASSERT(IS_CTC_TRIM_VALUE(u32TrimValue)); + + MODIFY_REG32(M4_CTC->CR1, CTC_CR1_TRMVAL, (u32TrimValue << CTC_CR1_TRMVAL_POS)); +} + +/** + * @brief Get CTC trimming value. + * @param None + * @retval CTC trimming value(between Min_Data=0 and Max_Data=0x3F) + */ +uint32_t CTC_GetTrimValue(void) +{ + return (READ_REG32_BIT(M4_CTC->CR1, CTC_CR1_TRMVAL) >> CTC_CR1_TRMVAL_POS); +} + +/** + * @brief Set CTC reload value. + * @param [in] u32ReloadValue CTC reload value + * This parameter can be between Min_Data=0 and Max_Data=0xFFFF + * @retval None + */ +void CTC_SetReloadValue(uint32_t u32ReloadValue) +{ + /* Check parameters */ + DDL_ASSERT(IS_CTC_RELOAD_VALUE(u32ReloadValue)); + + MODIFY_REG32(M4_CTC->CR2, CTC_CR2_RLDVAL, (u32ReloadValue << CTC_CR2_RLDVAL_POS)); +} + +/** + * @brief Get CTC reload value. + * @param None + * @retval CTC reload value (between Min_Data=0 and Max_Data=0xFFFF) + */ +uint16_t CTC_GetReloadValue(void) +{ + return (uint16_t)(READ_REG32_BIT(M4_CTC->CR2, CTC_CR2_RLDVAL) >> CTC_CR2_RLDVAL_POS); +} + +/** + * @brief Set CTC offset value. + * @param [in] u32OffsetValue CTC offset value + * This parameter can be between Min_Data=0 and Max_Data=0xFF + * @retval None + */ +void CTC_SetOffsetValue(uint32_t u32OffsetValue) +{ + /* Check parameters */ + DDL_ASSERT(IS_CTC_OFFSET_VALUE(u32OffsetValue)); + + MODIFY_REG32(M4_CTC->CR2, CTC_CR2_OFSVAL, (u32OffsetValue << CTC_CR2_OFSVAL_POS)); +} + +/** + * @brief Get CTC offset value. + * @param None + * @retval CTC offset value (between Min_Data=0 and Max_Data=0xFF) + */ +uint32_t CTC_GetOffsetValue(void) +{ + return (READ_REG32_BIT(M4_CTC->CR2, CTC_CR2_OFSVAL) >> CTC_CR2_OFSVAL_POS); +} + +/** + * @} + */ + +#endif /* DDL_CTC_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_dac.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_dac.c new file mode 100644 index 0000000000..138a429b84 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_dac.c @@ -0,0 +1,636 @@ +/** + ******************************************************************************* + * @file hc32f4a0_dac.c + * @brief This file provides firmware functions to manage the Digital-to-Analog + * Converter(DAC). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Hexiao First version + 2020-07-15 Hexiao 1. Modify DAC_ChannelCmd to DAC_Start and DAC_Stop + 2. Modify DAC_DualChannelCmd to DAC_DualChannelStart + and DAC_DualChannelStop + 2020-08-31 Hexiao Refine DAC_AMPCmd + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_dac.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_DAC DAC + * @brief DAC Driver Library + * @{ + */ + +#if (DDL_DAC_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup DAC_Local_Macros DAC Local Macros + * @{ + */ +#define DAC_ADP_SELECT_ALL (DAC_DAADPCR_ADPSL1 | DAC_DAADPCR_ADPSL2 | DAC_DAADPCR_ADPSL3) + +/** + * @defgroup DAC_Check_Parameters_Validity DAC Check Parameters Validity + * @{ + */ + +#define IS_VALID_UNIT(x) \ +( ((x) == M4_DAC1) || \ + ((x) == M4_DAC2)) + +#define IS_VALID_CH(x) \ +( ((x) == DAC_CH_1) || \ + ((x) == DAC_CH_2)) + +#define IS_VALID_DATA_ALIGN(x) \ +( ((x) == DAC_DATA_ALIGN_L) || \ + ((x) == DAC_DATA_ALIGN_R)) + +#define IS_VALID_DATA_SRC(x) \ +( ((x) == DAC_DATA_SRC_DATAREG) || \ + ((x) == DAC_DATA_SRC_DCU)) + +#define IS_VALID_ADCPRIO_CONFIG(x) \ +( (0U != (x)) && \ + (DAC_ADP_SELECT_ALL == ((x) | DAC_ADP_SELECT_ALL))) + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ + +/** + * @defgroup DAC_Global_Functions DAC Global Functions + * @{ + */ + +/** + * @brief Set DAC data source for specified channel + * @param [in] DACx Pointer to the DAC peripheral register. + * This parameter can be one of the following values: + * @arg M4_DAC1 + * @arg M4_DAC2 + * @param [in] u16Ch Specify the DAC channel @ref DAC_CH. + * This parameter can be one of the following values: + * @arg DAC_CH_1 + * @arg DAC_CH_2 + * @param [in] u16Src Specify the data source. + * This parameter can be a value of @ref DAC_DATA_SRC + * - DAC_DATA_SRC_DATAREG: convert source is from data register + * - DAC_DATA_SRC_DCU: convert source is from DCU + * @retval None + */ +void DAC_SetDataSource(M4_DAC_TypeDef *DACx, uint16_t u16Ch, uint16_t u16Src) +{ + DDL_ASSERT(IS_VALID_UNIT(DACx)); + DDL_ASSERT(IS_VALID_CH(u16Ch)); + DDL_ASSERT(IS_VALID_DATA_SRC(u16Src)); + + SET_REG16_BIT(DACx->DACR, u16Src << (DAC_DACR_EXTDSL1_POS + u16Ch)); +} + +/** + * @brief DAC data register's data alignment pattern configuration + * @param [in] DACx Pointer to the DAC peripheral register. + * This parameter can be one of the following values: + * @arg M4_DAC1 + * @arg M4_DAC2 + * @param [in] u16Align Specify the data alignment. + * This parameter can be a value of @ref DAC_DATAREG_ALIGN_PATTERN + * - DAC_DATA_ALIGN_L: left alignment + * - DAC_DATA_ALIGN_R: right alignment + * @retval None + */ +void DAC_DataRegAlignConfig(M4_DAC_TypeDef *DACx, uint16_t u16Align) +{ + DDL_ASSERT(IS_VALID_UNIT(DACx)); + DDL_ASSERT(IS_VALID_DATA_ALIGN(u16Align)); + + SET_REG16_BIT(DACx->DACR, u16Align); +} + +/** + * @brief DAC output function command + * @param [in] DACx Pointer to the DAC peripheral register. + * This parameter can be one of the following values: + * @arg M4_DAC1 + * @arg M4_DAC2 + * @param [in] u16Ch Specify DAC channel @ref DAC_CH. + * This parameter can be one of the following values: + * @arg DAC_CH_1 + * @arg DAC_CH_2 + * @param [in] enNewState New state of the DAC output function, + * @ref en_functional_state_t + * @retval None + */ +void DAC_OutputCmd(M4_DAC_TypeDef *DACx, uint16_t u16Ch, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_UNIT(DACx)); + DDL_ASSERT(IS_VALID_CH(u16Ch)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + const uint16_t u16Cmd = (uint16_t)1U << (DAC_DAOCR_DAODIS1_POS + u16Ch); + + if(Enable == enNewState) + { + CLEAR_REG16_BIT(DACx->DAOCR, u16Cmd); + } + else + { + SET_REG16_BIT(DACx->DAOCR, u16Cmd); + } +} + +/** + * @brief DAC AMP function command + * @param [in] DACx Pointer to the DAC peripheral register. + * This parameter can be one of the following values: + * @arg M4_DAC1 + * @arg M4_DAC2 + * @param [in] u16Ch Specify DAC channel @ref DAC_CH. + * This parameter can be one of the following values: + * @arg DAC_CH_1 + * @arg DAC_CH_2 + * @param [in] enNewState New state of the AMP function, + * @ref en_functional_state_t + * @retval An en_result_t enumeration value: + * - Ok: No errors occurred + * - ErrorInvalidMode: cannot enable AMP when data source is from DCU + */ +en_result_t DAC_AMPCmd(M4_DAC_TypeDef *DACx, uint16_t u16Ch, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_UNIT(DACx)); + DDL_ASSERT(IS_VALID_CH(u16Ch)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + en_result_t ret = Ok; + uint16_t u16Cmd = (uint16_t)1U << (DAC_DACR_EXTDSL1_POS + u16Ch); + + if((0U != (READ_REG16_BIT(DACx->DACR, u16Cmd))) && (Enable == enNewState)) + { + ret = ErrorInvalidMode; + } + else + { + u16Cmd = (uint16_t)1U << (DAC_DACR_DAAMP1_POS + u16Ch); + + if(Enable == enNewState) + { + SET_REG16_BIT(DACx->DACR, u16Cmd); + } + else + { + CLEAR_REG16_BIT(DACx->DACR, u16Cmd); + } + } + + return ret; +} + +/** + * @brief DAC ADC priority function command + * @param [in] DACx Pointer to the DAC peripheral register. + * This parameter can be one of the following values: + * @arg M4_DAC1 + * @arg M4_DAC2 + * @param [in] enNewState New state of the ADC priority function, + * @ref en_functional_state_t + * @retval None + * @note please make sure ADC is in stoped status before calling DAC_ADCPrioCmd + */ +void DAC_ADCPrioCmd(M4_DAC_TypeDef *DACx, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_UNIT(DACx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if(Enable == enNewState) + { + SET_REG16_BIT(DACx->DAADPCR, DAC_DAADPCR_ADPEN); + } + else + { + CLEAR_REG16_BIT(DACx->DAADPCR, DAC_DAADPCR_ADPEN); + } +} + +/** + * @brief Enable or Disable the ADP priority for the selected ADCx + * @param [in] DACx Pointer to the DAC peripheral register. + * This parameter can be one of the following values: + * @arg M4_DAC1 + * @arg M4_DAC2 + * @param [in] u16ADCxPrio ADCx priority to be enabled or disabled. + * This parameter can be one or any combination of the following values: + * @arg DAC_ADP_SELECT_ADC1 + * @arg DAC_ADP_SELECT_ADC2 + * @arg DAC_ADP_SELECT_ADC3 + * @param [in] enNewState New state of ADCx priority + * @ref en_functional_state_t + * @retval None + * @note please make sure ADC is in stoped status before calling DAC_ADCPrioConfig + */ +void DAC_ADCPrioConfig(M4_DAC_TypeDef *DACx, uint16_t u16ADCxPrio, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_UNIT(DACx)); + DDL_ASSERT(IS_VALID_ADCPRIO_CONFIG(u16ADCxPrio)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if(Enable == enNewState) + { + SET_REG16_BIT(DACx->DAADPCR, u16ADCxPrio); + } + else + { + CLEAR_REG16_BIT(DACx->DAADPCR, u16ADCxPrio); + } +} + +/** + * @brief Start the specified DAC channel + * @param [in] DACx Pointer to the DAC peripheral register. + * This parameter can be one of the following values: + * @arg M4_DAC1 + * @arg M4_DAC2 + * @param [in] u16Ch Specify DAC channel @ref DAC_CH. + * This parameter can be one of the following values: + * @arg DAC_CH_1 + * @arg DAC_CH_2 + * @retval An en_result_t enumeration value: + * - Ok: No errors occurred + * - ErrorInvalidMode: cannot start single channel when \n + * this channel have already been started by \n + * @ref DAC_DualChannelStart + */ +en_result_t DAC_Start(M4_DAC_TypeDef *DACx, uint16_t u16Ch) +{ + en_result_t enRet = Ok; + + DDL_ASSERT(IS_VALID_UNIT(DACx)); + DDL_ASSERT(IS_VALID_CH(u16Ch)); + + if((DACx->DACR & DAC_DACR_DAE) != 0U) + { + enRet = ErrorInvalidMode; + } + else + { + const uint16_t u16Cmd = (uint16_t)1U << (DAC_DACR_DA1E_POS + u16Ch); + SET_REG16_BIT(DACx->DACR, u16Cmd); + } + + return enRet; +} + +/** + * @brief Stop the specified DAC channel + * @param [in] DACx Pointer to the DAC peripheral register. + * This parameter can be one of the following values: + * @arg M4_DAC1 + * @arg M4_DAC2 + * @param [in] u16Ch Specify DAC channel @ref DAC_CH. + * This parameter can be one of the following values: + * @arg DAC_CH_1 + * @arg DAC_CH_2 + * @retval An en_result_t enumeration value: + * - Ok: No errors occurred + * - ErrorInvalidMode: cannot stop single channel when \n + * this channel is started by \n + * @ref DAC_DualChannelStart + */ +en_result_t DAC_Stop(M4_DAC_TypeDef *DACx, uint16_t u16Ch) +{ + en_result_t enRet = Ok; + + DDL_ASSERT(IS_VALID_UNIT(DACx)); + DDL_ASSERT(IS_VALID_CH(u16Ch)); + + if((DACx->DACR & DAC_DACR_DAE) != 0U) + { + enRet = ErrorInvalidMode; + } + else + { + const uint16_t u16Cmd = (uint16_t)1U << (DAC_DACR_DA1E_POS + u16Ch); + CLEAR_REG16_BIT(DACx->DACR, u16Cmd); + } + + return enRet; +} + +/** + * @brief Start DAC channel 1 and channel 2 + * @param [in] DACx Pointer to the DAC peripheral register. + * This parameter can be one of the following values: + * @arg M4_DAC1 + * @arg M4_DAC2 + * @retval None + */ +void DAC_DualChannelStart(M4_DAC_TypeDef *DACx) +{ + DDL_ASSERT(IS_VALID_UNIT(DACx)); + + SET_REG16_BIT(DACx->DACR, DAC_DACR_DAE); +} + +/** + * @brief Stop DAC channel 1 and channel 2 + * @param [in] DACx Pointer to the DAC peripheral register. + * This parameter can be one of the following values: + * @arg M4_DAC1 + * @arg M4_DAC2 + * @retval None + */ +void DAC_DualChannelStop(M4_DAC_TypeDef *DACx) +{ + DDL_ASSERT(IS_VALID_UNIT(DACx)); + + CLEAR_REG16_BIT(DACx->DACR, DAC_DACR_DAE); +} + +/** + * @brief Set the specified data holding register value for DAC channel 1 + * @param [in] DACx Pointer to the DAC peripheral register. + * This parameter can be one of the following values: + * @arg M4_DAC1 + * @arg M4_DAC2 + * @param [in] data Data to be loaded into data holding register of channel 1 + * @retval None + */ +void DAC_SetChannel1Data(M4_DAC_TypeDef *DACx, uint16_t data) +{ + DDL_ASSERT(IS_VALID_UNIT(DACx)); + + if(READ_REG16_BIT(DACx->DACR, DAC_DACR_DPSEL) == DAC_DATA_ALIGN_L) + { + DDL_ASSERT(0U == (data & 0xFU)); + } + else + { + DDL_ASSERT(0U == (data & 0xF000U)); + } + + WRITE_REG16(DACx->DADR1,data); +} + +/** + * @brief Set the specified data holding register value for DAC channel 2 + * @param [in] DACx Pointer to the DAC peripheral register. + * This parameter can be one of the following values: + * @arg M4_DAC1 + * @arg M4_DAC2 + * @param [in] data Data to be loaded into data holding register of channel 2 + * @retval None + */ +void DAC_SetChannel2Data(M4_DAC_TypeDef *DACx, uint16_t data) +{ + DDL_ASSERT(IS_VALID_UNIT(DACx)); + + if(READ_REG16_BIT(DACx->DACR, DAC_DACR_DPSEL) == DAC_DATA_ALIGN_L) + { + DDL_ASSERT(0U == (data & 0xFU)); + } + else + { + DDL_ASSERT(0U == (data & 0xF000U)); + } + + WRITE_REG16(DACx->DADR2,data); +} + +/** + * @brief Set the specified data holding register value for channel 1 and channel 2 + * @param [in] DACx Pointer to the DAC peripheral register. + * This parameter can be one of the following values: + * @arg M4_DAC1 + * @arg M4_DAC2 + * @param data2: Data to be loaded into data holding register of channel 2 + * @param data1: Data to be loaded into data holding register of channel 1 + * @retval None + */ +void DAC_SetDualChannelData(M4_DAC_TypeDef *DACx, uint16_t data2, uint16_t data1) +{ + DDL_ASSERT(IS_VALID_UNIT(DACx)); + + if(READ_REG16_BIT(DACx->DACR, DAC_DACR_DPSEL) == DAC_DATA_ALIGN_L) + { + DDL_ASSERT(0U == (data1 & 0xFU)); + DDL_ASSERT(0U == (data2 & 0xFU)); + } + else + { + DDL_ASSERT(0U == (data1 & 0xF000U)); + DDL_ASSERT(0U == (data2 & 0xF000U)); + } + + WRITE_REG16(DACx->DADR1,data1); + WRITE_REG16(DACx->DADR2,data2); +} + +/** + * @brief Get convert status of channel 1 in ADC priority mode + * @param [in] DACx Pointer to the DAC peripheral register. + * This parameter can be one of the following values: + * @arg M4_DAC1 + * @arg M4_DAC2 + * @retval An en_dac_conv_sate_t enumeration value: + * - ErrorInvalidMode: Could not get convert status when adc priority is not enabled + * - Ok: Data convert completed + * - OperationInProgress: Data convert is ongoing + */ +en_result_t DAC_GetChannel1ConvState(const M4_DAC_TypeDef *DACx) +{ + en_result_t enStat = ErrorInvalidMode; + + DDL_ASSERT(IS_VALID_UNIT(DACx)); + + if(0U != READ_REG16_BIT(DACx->DAADPCR, DAC_DAADPCR_ADPEN)) + { + enStat = OperationInProgress; + + if(READ_REG16_BIT(DACx->DAADPCR, DAC_DAADPCR_DA1SF) == 0U) + { + enStat = Ok; + } + } + + return enStat; +} + +/** + * @brief Get convert status of channel 2 in ADC priority mode + * @param [in] DACx Pointer to the DAC peripheral register. + * This parameter can be one of the following values: + * @arg M4_DAC1 + * @arg M4_DAC2 + * @retval An en_dac_conv_sate_t enumeration value: + * - ErrorInvalidMode: Could not get convert status when adc priority is not enabled + * - Ok: Data convert completed + * - OperationInProgress: Data convert is ongoing + */ +en_result_t DAC_GetChannel2ConvState(const M4_DAC_TypeDef *DACx) +{ + en_result_t enStat = ErrorInvalidMode; + + DDL_ASSERT(IS_VALID_UNIT(DACx)); + + if(0U != READ_REG16_BIT(DACx->DAADPCR, DAC_DAADPCR_ADPEN)) + { + enStat = OperationInProgress; + + if(READ_REG16_BIT(DACx->DAADPCR, DAC_DAADPCR_DA2SF) == 0U) + { + enStat = Ok; + } + } + + return enStat; +} + +/** + * @brief Fills each pstcInit member with its default value + * @param [in] pstcInit pointer to a stc_dac_init_t structure which will + * be initialized. + * @retval An en_result_t enumeration value. + * - Ok: No errors occurred. + * - ErrorInvalidParameter: pstcInit = NULL + */ +en_result_t DAC_StructInit(stc_dac_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + if(pstcInit != NULL) + { + pstcInit->u16Src = DAC_DATA_SRC_DATAREG; + pstcInit->enOutput = Enable; + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Initialize the DAC peripheral according to the specified parameters + * in the stc_dac_init_t + * @param [in] DACx Pointer to the DAC peripheral register. + * This parameter can be one of the following values: + * @arg M4_DAC1 + * @arg M4_DAC2 + * @param [in] u16Ch Specify the DAC channel @ref DAC_CH. + * This parameter can be one of the following values: + * @arg DAC_CH_1 + * @arg DAC_CH_2 + * @param [in] pstcInit pointer to a stc_dac_init_t structure that contains + * the configuration information for the specified DAC channel. + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: pstcInit = NULL + */ +en_result_t DAC_Init(M4_DAC_TypeDef *DACx, uint16_t u16Ch, const stc_dac_init_t *pstcInit) +{ + DDL_ASSERT(IS_VALID_UNIT(DACx)); + DDL_ASSERT(IS_VALID_CH(u16Ch)); + + en_result_t enRet = ErrorInvalidParameter; + + if(pstcInit != NULL) + { + DDL_ASSERT(IS_VALID_DATA_SRC(pstcInit->u16Src)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(pstcInit->enOutput)); + + DAC_SetDataSource(DACx, u16Ch, pstcInit->u16Src); + DAC_OutputCmd(DACx, u16Ch, pstcInit->enOutput); + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Deinitialize the DAC peripheral registers to their default reset values. + * @param [in] DACx Pointer to the DAC peripheral register. + * This parameter can be one of the following values: + * @arg M4_DAC1 + * @arg M4_DAC2 + * @retval None + */ +void DAC_DeInit(M4_DAC_TypeDef *DACx) +{ + DAC_DualChannelStop(DACx); + + DAC_SetDataSource(DACx, DAC_CH_1, DAC_DATA_SRC_DATAREG); + DAC_SetDataSource(DACx, DAC_CH_2, DAC_DATA_SRC_DATAREG); + + DAC_DataRegAlignConfig(DACx, DAC_DATA_ALIGN_R); + + (void)DAC_AMPCmd(DACx, DAC_CH_1,Disable); + (void)DAC_AMPCmd(DACx, DAC_CH_2,Disable); + + DAC_OutputCmd(DACx, DAC_CH_1, Enable); + DAC_OutputCmd(DACx, DAC_CH_2, Enable); + + DAC_ADCPrioConfig(DACx, DAC_ADP_SELECT_ALL, Disable); + DAC_ADCPrioCmd(DACx, Disable); +} + +/** + * @} + */ + +#endif /* DDL_DAC_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_dcu.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_dcu.c new file mode 100644 index 0000000000..7817362a6f --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_dcu.c @@ -0,0 +1,1015 @@ +/** + ******************************************************************************* + * @file hc32f4a0_dcu.c + * @brief This file provides firmware functions to manage the DCU(Data Computing + * Unit). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Hongjh First version + 2020-07-23 Hongjh 1. Modify macro define for interrupt, flag and mode; + 2. Rename API: from DCU_IntFuncCmd to DCU_GlobalIntCmd; + 3. Refine API: DCU_IntCmd and delete DCU_SetCmpIntMode; + 4. Refine API: DCU DATA read/write. + 2020-09-07 Hongjh Refine API: DCU_SetTriggerSrc + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_dcu.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_DCU DCU + * @brief DCU Driver Library + * @{ + */ + +#if (DDL_DCU_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup DCU_Local_Macros DCU Local Macros + * @{ + */ + +/** + * @defgroup DCU_Check_Parameters_Validity DCU Check Parameters Validity + * @{ + */ +#define IS_DCU_BASE_FUNC_UNIT(x) \ +( (M4_DCU5 == (x)) || \ + (M4_DCU6 == (x)) || \ + (M4_DCU7 == (x)) || \ + (M4_DCU8 == (x))) + +#define IS_DCU_WAVE_FUNC_UNIT(x) \ +( (M4_DCU1 == (x)) || \ + (M4_DCU2 == (x)) || \ + (M4_DCU3 == (x)) || \ + (M4_DCU4 == (x))) + +#define IS_DCU_UNIT(x) \ +( (IS_DCU_BASE_FUNC_UNIT(x)) || \ + (IS_DCU_WAVE_FUNC_UNIT(x))) + +#define IS_DCU_BASE_FUNC_UNIT_MODE(x) \ +( (DCU_CMP == (x)) || \ + (DCU_ADD == (x)) || \ + (DCU_SUB == (x)) || \ + (DCU_HW_ADD == (x)) || \ + (DCU_HW_SUB == (x))) + +#define IS_DCU_WAVE_FUNC_UNIT_MODE(x) \ +( (DCU_CMP == (x)) || \ + (DCU_ADD == (x)) || \ + (DCU_SUB == (x)) || \ + (DCU_HW_ADD == (x)) || \ + (DCU_HW_SUB == (x)) || \ + (DCU_TRIANGLE_WAVE == (x)) || \ + (DCU_SAWTOOTH_WAVE_INC == (x)) || \ + (DCU_SAWTOOTH_WAVE_DEC == (x))) + +#define IS_DCU_BASE_FUNC_UNIT_INT(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & (~DCU_BASE_FUNC_UNIT_INT_MASK)))) + +#define IS_DCU_WAVE_FUNC_UNIT_INT(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & (~DCU_WAVE_FUNC_UNIT_INT_MASK)))) + +#define IS_DCU_BASE_FUNC_UNIT_FLAG(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & (~DCU_BASE_FUNC_UNIT_FLAG_MASK)))) + +#define IS_DCU_WAVE_FUNC_UNIT_FLAG(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & (~DCU_WAVE_FUNC_UNIT_FLAG_MASK)))) + +#define IS_DCU_INTERRUPT_STATE(x) \ +( (DCU_INT_ENABLE == (x)) || \ + (DCU_INT_DISABLE == (x))) + +#define IS_DCU_CMP_TRIG_MODE(x) \ +( (DCU_CMP_TRIG_DATA0 == (x)) || \ + (DCU_CMP_TRIG_DATA012 == (x))) + +#define IS_DCU_DATA_SIZE(x) \ +( (DCU_DATA_SIZE_8BIT == (x)) || \ + (DCU_DATA_SIZE_16BIT == (x)) || \ + (DCU_DATA_SIZE_32BIT == (x))) + +#define IS_DCU_INT_CATEGORY(x) \ +( ((x) == DCU_INT_OP) || \ + ((x) == DCU_INT_WAVE_MD) || \ + ((x) == DCU_INT_CMP_WIN) || \ + ((x) == DCU_INT_CMP_NON_WIN)) + +#define IS_DCU_INT_OP(x) ((x) == DCU_INT_OP_UDF_OVF) + +#define IS_DCU_INT_CMP_WIN(x) \ +( ((x) != 0UL) && \ + (((x) | DCU_INT_CMP_WIN_ALL) == DCU_INT_CMP_WIN_ALL)) + +#define IS_DCU_INT_WAVE_MD(x) \ +( ((x) != 0UL) && \ + (((x) | DCU_INT_WAVE_MD_ALL) == DCU_INT_WAVE_MD_ALL)) + +#define IS_DCU_INT_CMP_NON_WIN(x) \ +( ((x) != 0UL) || \ + (((x) | DCU_INT_CMP_NON_WIN_ALL) == DCU_INT_CMP_NON_WIN_ALL)) + +#define IS_DCU_DATA_REG(x) \ +( ((x) == DCU_DATA0_IDX) || \ + ((x) == DCU_DATA1_IDX) || \ + ((x) == DCU_DATA2_IDX)) + +#define IS_DCU_COM_TRIG(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & (~DCU_COM_TRIG_MASK)))) + +#define IS_DCU_WAVE_UPPER_LIMIT(x) ((x) <= 0xFFFUL) + +#define IS_DCU_WAVE_LOWER_LIMIT(x) ((x) <= 0xFFFUL) + +#define IS_DCU_WAVE_STEP(x) ((x) <= 0xFFFUL) +/** + * @} + */ + +/** + * @defgroup DCU_Flag_Mask DCU Flag Mask + * @{ + */ +#define DCU_BASE_FUNC_UNIT_FLAG_MASK \ +( DCU_FLAG_DATA0_LS_DATA2 | \ + DCU_FLAG_DATA0_EQ_DATA2 | \ + DCU_FLAG_DATA0_GT_DATA2 | \ + DCU_FLAG_DATA0_LS_DATA1 | \ + DCU_FLAG_DATA0_EQ_DATA1 | \ + DCU_FLAG_DATA0_GT_DATA1) + +#define DCU_WAVE_FUNC_UNIT_FLAG_MASK \ +( DCU_FLAG_OPERATION | \ + DCU_FLAG_DATA0_LS_DATA2 | \ + DCU_FLAG_DATA0_EQ_DATA2 | \ + DCU_FLAG_DATA0_GT_DATA2 | \ + DCU_FLAG_DATA0_LS_DATA1 | \ + DCU_FLAG_DATA0_EQ_DATA1 | \ + DCU_FLAG_DATA0_GT_DATA1 | \ + DCU_FLAG_WAVE_SAWTOOTH_RELOAD | \ + DCU_FLAG_WAVE_TRIANGLE_BOTTOM | \ + DCU_FLAG_WAVE_TRIANGLE_TOP) +/** + * @} + */ + +#define DCU_DATA1_LOWER_LIMIT_POS (0UL) +#define DCU_DATA1_LOWER_LIMIT (0x00000FFFUL) + +#define DCU_DATA1_UPPER_LIMIT_POS (16UL) +#define DCU_DATA1_UPPER_LIMIT (0x0FFF0000UL) + +/** + * @defgroup DCU_Register_Address Get DCU register address + * @{ + */ +#define REG_ADDR(__REG__) ((uint32_t)(&(__REG__))) +#define DATA_REG_ADDR(__DCUx__, __IDX__) (REG_ADDR((__DCUx__)->DATA0) + ((__IDX__) << 2UL)) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/** + * @addtogroup DCU_Local_Functions + * @{ + */ +static __IO uint32_t* DCU_TRGSELx(const M4_DCU_TypeDef *DCUx); +/** + * @} + */ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup DCU_Global_Functions DCU Global Functions + * @{ + */ + +/** + * @brief Initialize DCU function. + * @param [in] DCUx Pointer to DCU instance register base + * This parameter can be one of the following values: + * @arg M4_DCU1: DCU unit 1 instance register base + * @arg M4_DCU2: DCU unit 2 instance register base + * @arg M4_DCU3: DCU unit 3 instance register base + * @arg M4_DCU4: DCU unit 4 instance register base + * @arg M4_DCU5: DCU unit 5 instance register base + * @arg M4_DCU6: DCU unit 6 instance register base + * @arg M4_DCU7: DCU unit 7 instance register base + * @arg M4_DCU8: DCU unit 8 instance register base + * @param [in] pstcInit Pointer to a @ref stc_dcu_init_t structure (DCU function configuration data structure). + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: pstcInit is NULL pointer + */ +en_result_t DCU_Init(M4_DCU_TypeDef *DCUx, const stc_dcu_init_t *pstcInit) +{ + uint32_t u32RegVal; + en_result_t enRet = ErrorInvalidParameter; + + if (NULL != pstcInit) + { + DDL_ASSERT((IS_DCU_WAVE_FUNC_UNIT(DCUx) && IS_DCU_WAVE_FUNC_UNIT_MODE(pstcInit->u32Mode)) || \ + (IS_DCU_BASE_FUNC_UNIT(DCUx) && IS_DCU_BASE_FUNC_UNIT_MODE(pstcInit->u32Mode))); + DDL_ASSERT(IS_DCU_DATA_SIZE(pstcInit->u32DataSize)); + DDL_ASSERT(IS_DCU_INTERRUPT_STATE(pstcInit->u32IntEn)); + DDL_ASSERT(IS_DCU_CMP_TRIG_MODE(pstcInit->u32CmpTriggerMode)); + + /* De-initialize DCU */ + WRITE_REG32(DCUx->CTL, 0x00000000UL); + WRITE_REG32(DCUx->INTEVTSEL, 0x00000000UL); + WRITE_REG32(DCUx->FLAGCLR, (IS_DCU_WAVE_FUNC_UNIT(DCUx)) ? 0x00000E7FUL:0x0000007FUL); + + /* Set register: CTL */ + u32RegVal = (pstcInit->u32Mode | \ + pstcInit->u32DataSize | \ + pstcInit->u32CmpTriggerMode | \ + pstcInit->u32IntEn); + WRITE_REG32(DCUx->CTL, u32RegVal); + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_uart_init_t to default values. + * @param [out] pstcInit Pointer to a @ref stc_dcu_init_t structure (DCU function configuration data structure). + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: pstcInit is NULL pointer + */ +en_result_t DCU_StructInit(stc_dcu_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check parameters */ + if (NULL != pstcInit) + { + pstcInit->u32Mode = DCU_SUB; + pstcInit->u32DataSize = DCU_DATA_SIZE_8BIT; + pstcInit->u32CmpTriggerMode = DCU_CMP_TRIG_DATA0; + pstcInit->u32IntEn = DCU_INT_DISABLE; + enRet = Ok; + } + + return enRet; +} + +/** + * @brief De-Initialize DCU function. + * @param [in] DCUx Pointer to DCU instance register base + * This parameter can be one of the following values: + * @arg M4_DCU1: DCU unit 1 instance register base + * @arg M4_DCU2: DCU unit 2 instance register base + * @arg M4_DCU3: DCU unit 3 instance register base + * @arg M4_DCU4: DCU unit 4 instance register base + * @arg M4_DCU5: DCU unit 5 instance register base + * @arg M4_DCU6: DCU unit 6 instance register base + * @arg M4_DCU7: DCU unit 7 instance register base + * @arg M4_DCU8: DCU unit 8 instance register base + * @retval None + */ +void DCU_DeInit(M4_DCU_TypeDef *DCUx) +{ + /* Configures the registers to reset value. */ + WRITE_REG32(DCUx->CTL, 0x00000000UL); + WRITE_REG32(DCUx->INTEVTSEL, 0x00000000UL); + WRITE_REG32(DCUx->FLAGCLR, 0x0000007FUL); + WRITE_REG32(DCUx->DATA0, 0x00000000UL); + WRITE_REG32(DCUx->DATA1, 0x00000000UL); + WRITE_REG32(DCUx->DATA2, 0x00000000UL); +} + +/** + * @brief Initialize DCU function. + * @param [in] DCUx Pointer to DCU instance register base + * This parameter can be one of the following values: + * @arg M4_DCU1: DCU unit 1 instance register base + * @arg M4_DCU2: DCU unit 2 instance register base + * @arg M4_DCU3: DCU unit 3 instance register base + * @arg M4_DCU4: DCU unit 4 instance register base + * @param [in] pstcCfg Pointer to a @ref stc_dcu_wave_cfg_t structure (DCU wave function configuration data structure). + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: pstcCfg is NULL pointer + * @note The DCU sawtooth/triangle wave mode is supported by M4_DCU1/2/3/4. + */ +en_result_t DCU_WaveCfg(M4_DCU_TypeDef *DCUx, + const stc_dcu_wave_cfg_t *pstcCfg) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (NULL != pstcCfg) + { + DDL_ASSERT(IS_DCU_WAVE_FUNC_UNIT(DCUx)); + DDL_ASSERT(IS_DCU_WAVE_LOWER_LIMIT(pstcCfg->u32LowerLimit)); + DDL_ASSERT(IS_DCU_WAVE_UPPER_LIMIT(pstcCfg->u32UpperLimit)); + DDL_ASSERT(IS_DCU_WAVE_STEP(pstcCfg->u32Step)); + + WRITE_REG32(DCUx->DATA0, 0x00000000UL); + WRITE_REG32(DCUx->DATA1, ((pstcCfg->u32LowerLimit << DCU_DATA1_LOWER_LIMIT_POS) | \ + (pstcCfg->u32UpperLimit << DCU_DATA1_UPPER_LIMIT_POS))); + WRITE_REG32(DCUx->DATA2, pstcCfg->u32Step); + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set DCU operation mode. + * @param [in] DCUx Pointer to DCU instance register base + * This parameter can be one of the following values: + * @arg M4_DCU1: DCU unit 1 instance register base + * @arg M4_DCU2: DCU unit 2 instance register base + * @arg M4_DCU3: DCU unit 3 instance register base + * @arg M4_DCU4: DCU unit 4 instance register base + * @arg M4_DCU5: DCU unit 5 instance register base + * @arg M4_DCU6: DCU unit 6 instance register base + * @arg M4_DCU7: DCU unit 7 instance register base + * @arg M4_DCU8: DCU unit 8 instance register base + * @param [in] u32Mode DCU mode + * This parameter can be one of the following values: + * @arg DCU_INVALID: DCU invalid + * @arg DCU_ADD: DCU add operation + * @arg DCU_SUB: DCU sub operation + * @arg DCU_HW_ADD: DCU hardware trigger add + * @arg DCU_HW_SUB: DCU hardware trigger sub + * @arg DCU_CMP: DCU compare + * @arg DCU_TRIANGLE_WAVE: DCU triangle wave output mode + * @arg DCU_SAWTOOTH_WAVE_INC:DCU increasing sawtooth wave output mode + * @arg DCU_SAWTOOTH_WAVE_DEC:DCU decreasing sawtooth wave output mode + * @retval None + * @note The DCU sawtooth/triangle wave mode is supported by M4_DCU1/2/3/4. + */ +void DCU_SetMode(M4_DCU_TypeDef *DCUx, uint32_t u32Mode) +{ + /* Check for parameters */ + DDL_ASSERT((IS_DCU_WAVE_FUNC_UNIT(DCUx) && IS_DCU_WAVE_FUNC_UNIT_MODE(u32Mode)) || \ + (IS_DCU_BASE_FUNC_UNIT(DCUx) && IS_DCU_BASE_FUNC_UNIT_MODE(u32Mode))); + + MODIFY_REG32(DCUx->CTL, DCU_CTL_MODE, u32Mode); +} + +/** + * @brief Get DCU operation mode. + * @param [in] DCUx Pointer to DCU instance register base + * This parameter can be one of the following values: + * @arg M4_DCU1: DCU unit 1 instance register base + * @arg M4_DCU2: DCU unit 2 instance register base + * @arg M4_DCU3: DCU unit 3 instance register base + * @arg M4_DCU4: DCU unit 4 instance register base + * @arg M4_DCU5: DCU unit 5 instance register base + * @arg M4_DCU6: DCU unit 6 instance register base + * @arg M4_DCU7: DCU unit 7 instance register base + * @arg M4_DCU8: DCU unit 8 instance register base + * @retval Returned value can be one of the following values: + * @arg DCU_INVALID: DCU invalid + * @arg DCU_ADD: DCU add operation + * @arg DCU_SUB: DCU sub operation + * @arg DCU_HW_ADD: DCU hardware trigger add + * @arg DCU_HW_SUB: DCU hardware trigger sub + * @arg DCU_CMP: DCU compare + * @arg DCU_TRIANGLE_WAVE: DCU triangle wave output mode + * @arg DCU_SAWTOOTH_WAVE_INC:DCU increasing sawtooth wave output mode + * @arg DCU_SAWTOOTH_WAVE_DEC:DCU decreasing sawtooth wave output mode + * @note The DCU sawtooth/triangle wave mode is supported by M4_DCU1/2/3/4. + */ +uint32_t DCU_GetMode(const M4_DCU_TypeDef *DCUx) +{ + /* Check for DCUx pointer */ + DDL_ASSERT(IS_DCU_UNIT(DCUx)); + + return READ_REG32_BIT(DCUx->CTL, DCU_CTL_MODE); +} + +/** + * @brief Set DCU data size. + * @param [in] DCUx Pointer to DCU instance register base + * This parameter can be one of the following values: + * @arg M4_DCU1: DCU unit 1 instance register base + * @arg M4_DCU2: DCU unit 2 instance register base + * @arg M4_DCU3: DCU unit 3 instance register base + * @arg M4_DCU4: DCU unit 4 instance register base + * @arg M4_DCU5: DCU unit 5 instance register base + * @arg M4_DCU6: DCU unit 6 instance register base + * @arg M4_DCU7: DCU unit 7 instance register base + * @arg M4_DCU8: DCU unit 8 instance register base + * @param [in] u32DataSize DCU data size + * This parameter can be one of the following values: + * @arg DCU_DATA_SIZE_8BIT: DCU data size 8 bits + * @arg DCU_DATA_SIZE_16BIT: DCU data size 16 bits + * @arg DCU_DATA_SIZE_32BIT: DCU data size 32 bits + * @retval None + */ +void DCU_SetDataSize(M4_DCU_TypeDef *DCUx, uint32_t u32DataSize) +{ + /* Check for DCUx pointer */ + DDL_ASSERT(IS_DCU_UNIT(DCUx)); + DDL_ASSERT(IS_DCU_DATA_SIZE(u32DataSize)); + + MODIFY_REG32(DCUx->CTL, DCU_CTL_DATASIZE, u32DataSize); +} + +/** + * @brief Get DCU data size. + * @param [in] DCUx Pointer to DCU instance register base + * @arg M4_DCU1: DCU unit 1 instance register base + * @arg M4_DCU2: DCU unit 2 instance register base + * @arg M4_DCU3: DCU unit 3 instance register base + * @arg M4_DCU4: DCU unit 4 instance register base + * @arg M4_DCU5: DCU unit 5 instance register base + * @arg M4_DCU6: DCU unit 6 instance register base + * @arg M4_DCU7: DCU unit 7 instance register base + * @arg M4_DCU8: DCU unit 8 instance register base + * @retval Returned value can be one of the following values: + * @arg DCU_DATA_SIZE_8BIT: DCU data size 8 bits + * @arg DCU_DATA_SIZE_16BIT: DCU data size 16 bits + * @arg DCU_DATA_SIZE_32BIT: DCU data size 32 bits + */ +uint32_t DCU_GetDataSize(const M4_DCU_TypeDef *DCUx) +{ + /* Check for DCUx pointer */ + DDL_ASSERT(IS_DCU_UNIT(DCUx)); + + return READ_REG32_BIT(DCUx->CTL, DCU_CTL_DATASIZE); +} + +/** + * @brief Get DCU flag. + * @param [in] DCUx Pointer to DCU instance register base + * This parameter can be one of the following values: + * @arg M4_DCU1: DCU unit 1 instance register base + * @arg M4_DCU2: DCU unit 2 instance register base + * @arg M4_DCU3: DCU unit 3 instance register base + * @arg M4_DCU4: DCU unit 4 instance register base + * @arg M4_DCU5: DCU unit 5 instance register base + * @arg M4_DCU6: DCU unit 6 instance register base + * @arg M4_DCU7: DCU unit 7 instance register base + * @arg M4_DCU8: DCU unit 8 instance register base + * @param [in] u32Flag The specified DCU flag + * This parameter can be one of the following values: + * @arg DCU_FLAG_OPERATION: DCU addition overflow or subtraction underflow flag + * @arg DCU_FLAG_DATA0_LS_DATA2: DCU DATA0 < DATA2 flag + * @arg DCU_FLAG_DATA0_EQ_DATA2: DCU DATA0 = DATA2 flag + * @arg DCU_FLAG_DATA0_GT_DATA2: DCU DATA0 > DATA2 flag + * @arg DCU_FLAG_DATA0_LS_DATA1: DCU DATA0 < DATA1 flag + * @arg DCU_FLAG_DATA0_EQ_DATA1: DCU DATA0 = DATA1 flag + * @arg DCU_FLAG_DATA0_GT_DATA1: DCU DATA0 > DATA1 flag + * @arg DCU_FLAG_SAWTOOTH_WAVE_RELOAD: DCU sawtooth wave mode reload flag + * @arg DCU_FLAG_TRIANGLE_WAVE_BOTTOM: DCU triangle wave mode bottom flag + * @arg DCU_FLAG_TRIANGLE_WAVE_TOP: DCU triangle wave mode top flag + * @retval Returned value can be one of the following values: + * @arg Set Flag is set. + * @arg Reset Flag is reset or enStatus is invalid. + */ +en_flag_status_t DCU_GetStatus(const M4_DCU_TypeDef *DCUx, uint32_t u32Flag) +{ + /* Check parameters */ + DDL_ASSERT((IS_DCU_WAVE_FUNC_UNIT(DCUx) && IS_DCU_WAVE_FUNC_UNIT_FLAG(u32Flag)) || \ + (IS_DCU_BASE_FUNC_UNIT(DCUx) && IS_DCU_BASE_FUNC_UNIT_FLAG(u32Flag))); + + return READ_REG32_BIT(DCUx->FLAG, u32Flag) ? Set : Reset; +} + +/** + * @brief Clear DCU flag. + * @param [in] DCUx Pointer to DCU instance register base + * This parameter can be one of the following values: + * @arg M4_DCU1: DCU unit 1 instance register base + * @arg M4_DCU2: DCU unit 2 instance register base + * @arg M4_DCU3: DCU unit 3 instance register base + * @arg M4_DCU4: DCU unit 4 instance register base + * @arg M4_DCU5: DCU unit 5 instance register base + * @arg M4_DCU6: DCU unit 6 instance register base + * @arg M4_DCU7: DCU unit 7 instance register base + * @arg M4_DCU8: DCU unit 8 instance register base + * @param [in] u32Flag The specified DCU flag + * This parameter can be one of the following values: + * @arg DCU_FLAG_OPERATION: DCU addition overflow or subtraction underflow flag + * @arg DCU_FLAG_DATA0_LS_DATA2: DCU DATA0 < DATA2 flag + * @arg DCU_FLAG_DATA0_EQ_DATA2: DCU DATA0 = DATA2 flag + * @arg DCU_FLAG_DATA0_GT_DATA2: DCU DATA0 > DATA2 flag + * @arg DCU_FLAG_DATA0_LS_DATA1: DCU DATA0 < DATA1 flag + * @arg DCU_FLAG_DATA0_EQ_DATA1: DCU DATA0 = DATA1 flag + * @arg DCU_FLAG_DATA0_GT_DATA1: DCU DATA0 > DATA1 flag + * @arg DCU_FLAG_SAWTOOTH_WAVE_RELOAD: DCU sawtooth wave mode reload flag + * @arg DCU_FLAG_TRIANGLE_WAVE_BOTTOM: DCU triangle wave mode bottom flag + * @arg DCU_FLAG_TRIANGLE_WAVE_TOP: DCU triangle wave mode top flag + * @retval None + */ +void DCU_ClearStatus(M4_DCU_TypeDef *DCUx, uint32_t u32Flag) +{ + /* Check parameters */ + DDL_ASSERT((IS_DCU_WAVE_FUNC_UNIT(DCUx) && IS_DCU_WAVE_FUNC_UNIT_FLAG(u32Flag)) || \ + (IS_DCU_BASE_FUNC_UNIT(DCUx) && IS_DCU_BASE_FUNC_UNIT_FLAG(u32Flag))); + + WRITE_REG32(DCUx->FLAGCLR, u32Flag); +} + +/** + * @brief Enable/disable DCU the specified interrupt source. + * @param [in] DCUx Pointer to DCU instance register base + * This parameter can be one of the following values: + * @arg M4_DCU1: DCU unit 1 instance register base + * @arg M4_DCU2: DCU unit 2 instance register base + * @arg M4_DCU3: DCU unit 3 instance register base + * @arg M4_DCU4: DCU unit 4 instance register base + * @arg M4_DCU5: DCU unit 5 instance register base + * @arg M4_DCU6: DCU unit 6 instance register base + * @arg M4_DCU7: DCU unit 7 instance register base + * @arg M4_DCU8: DCU unit 8 instance register base + * @param [in] u32IntCategory DCU interrupt categorye + * This parameter can be one of the following values: + * @arg DCU_INT_OP: DCU operation result(overflow/underflow) interrupt + * @arg DCU_INT_WAVE_MD: DCU wave mode(sawtooth/triangle wave mode) interrupt + * @arg DCU_INT_CMP_WIN: DCU comparison(window) interrupt + * @arg DCU_INT_CMP_NON_WIN: DCU comparison(non-window) interrupt + * @param [in] u32IntType DCU interrupt type + * This parameter can be one of the following case: + * a. this parameter can be one of the following values when u16IntType = DCU_INT_OP: + * @arg DCU_INT_OP_UDF_OVF: DCU addition overflow or subtraction underflow interrupt + * b. this parameter can be any composed value of the following values when u16IntType = DCU_INT_CMP_WIN: + * @arg DCU_INT_CMP_WIN_INSIDE:DCU comparison(DATA2 <= DATA0 <= DATA1) interrupt + * @arg DCU_INT_CMP_WIN_OUTSIDE: DCU comparison(DATA0 < DATA2 & DATA0 > DATA1 ) interrupt + * @note Only one of the window inside and outside interrupt is valid. + * @note Both of the window inside and outside interrupt is disabled and the window interrupt is invalid. + * @note Both of the window inside and outside interrupt is enabled and the compare mode interrupt is invalid. + * c. this parameter can be any composed value of the following values when u16IntType = DCU_INT_CMP_NON_WIN: + * @arg DCU_INT_CMP_DATA0_LS_DATA2: DCU DATA0 < DATA2 interrupt + * @arg DCU_INT_CMP_DATA0_EQ_DATA2: DCU DATA0 = DATA2 interrupt + * @arg DCU_INT_CMP_DATA0_GT_DATA2: DCU DATA0 > DATA2 interrupt + * @arg DCU_INT_CMP_DATA0_LS_DATA1: DCU DATA0 < DATA1 interrupt + * @arg DCU_INT_CMP_DATA0_EQ_DATA1: DCU DATA0 = DATA1 interrupt + * @arg DCU_INT_CMP_DATA0_GT_DATA1: DCU DATA0 > DATA1 interrupt + * @note Both of the window inside and outside interrupt is disabled and the compare non-window interrupt is valid. + * d. this parameter can be any composed value of the following values when u16IntType = DCU_INT_WAVE_MD: + * @arg DCU_INT_WAVE_SAWTOOTH_RELOAD: DCU sawtooth wave mode reload interrupt + * @arg DCU_INT_WAVE_TRIANGLE_BOTTOM: DCU triangle wave mode bottom interrupt + * @arg DCU_INT_WAVE_TRIANGLE_TOP: DCU triangle wave mode top interrupt + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + * @note The DCU sawtooth/triangle wave mode is supported by M4_DCU1/2/3/4. + */ +void DCU_IntCmd(M4_DCU_TypeDef *DCUx, + uint32_t u32IntCategory, + uint32_t u32IntType, + en_functional_state_t enNewState) +{ + uint32_t u32Type; + + /* Check parameters */ + DDL_ASSERT(IS_DCU_UNIT(DCUx)); + DDL_ASSERT(IS_DCU_INT_CATEGORY(u32IntCategory)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (DCU_INT_OP == u32IntCategory) + { + DDL_ASSERT(IS_DCU_INT_OP(u32IntType)); + u32Type = (u32IntType & DCU_INT_OP_UDF_OVF); + } + else if (DCU_INT_CMP_WIN == u32IntCategory) + { + DDL_ASSERT(IS_DCU_INT_CMP_WIN(u32IntType)); + u32Type = (u32IntType & DCU_INT_CMP_WIN_ALL); + } + else if (DCU_INT_CMP_NON_WIN == u32IntCategory) + { + DDL_ASSERT(IS_DCU_INT_CMP_NON_WIN(u32IntType)); + u32Type = (u32IntType & DCU_INT_CMP_NON_WIN_ALL); + } + else + { + DDL_ASSERT(IS_DCU_WAVE_FUNC_UNIT(DCUx)); + DDL_ASSERT(IS_DCU_INT_WAVE_MD(u32IntType)); + u32Type = (u32IntType & DCU_INT_WAVE_MD_ALL); + } + + if (Enable == enNewState) + { + SET_REG32_BIT(DCUx->INTEVTSEL, u32Type); + } + else + { + CLEAR_REG32_BIT(DCUx->INTEVTSEL, u32Type); + } +} + +/** + * @brief Enable or disable DCU interrupt funtion. + * @param [in] DCUx Pointer to DCU instance register base + * This parameter can be one of the following values: + * @arg M4_DCU1: DCU unit 1 instance register base + * @arg M4_DCU2: DCU unit 2 instance register base + * @arg M4_DCU3: DCU unit 3 instance register base + * @arg M4_DCU4: DCU unit 4 instance register base + * @arg M4_DCU5: DCU unit 5 instance register base + * @arg M4_DCU6: DCU unit 6 instance register base + * @arg M4_DCU7: DCU unit 7 instance register base + * @arg M4_DCU8: DCU unit 8 instance register base + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void DCU_GlobalIntCmd(M4_DCU_TypeDef *DCUx, en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_DCU_UNIT(DCUx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(DCUx->CTL, DCU_CTL_INTEN); + } + else + { + CLEAR_REG32_BIT(DCUx->CTL, DCU_CTL_INTEN); + } +} + +/** + * @brief AOS common trigger function config for DCU + * @param [in] DCUx Pointer to DCU instance register base + * This parameter can be one of the following values: + * @arg M4_DCU1: DCU unit 1 instance register base + * @arg M4_DCU2: DCU unit 2 instance register base + * @arg M4_DCU3: DCU unit 3 instance register base + * @arg M4_DCU4: DCU unit 4 instance register base + * @arg M4_DCU5: DCU unit 5 instance register base + * @arg M4_DCU6: DCU unit 6 instance register base + * @arg M4_DCU7: DCU unit 7 instance register base + * @arg M4_DCU8: DCU unit 8 instance register base + * @param [in] u32ComTrig Common trigger event. + * This parameter can be one of the following values: + * @arg DCU_COM_TRIG1: Common trigger event 1. + * @arg DCU_COM_TRIG2: Common trigger event 2. + * @param [in] enNewState New state of common trigger function. + * @retval None + * @note This register belongs to AOS module, please ensure enable it in advance. + */ +void DCU_ComTriggerCmd(M4_DCU_TypeDef *DCUx, + uint32_t u32ComTrig, + en_functional_state_t enNewState) +{ + __IO uint32_t *const TRGSELx = DCU_TRGSELx(DCUx); + + if (NULL != TRGSELx) + { + DDL_ASSERT(IS_DCU_COM_TRIG(u32ComTrig)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(*TRGSELx, u32ComTrig); + } + else + { + CLEAR_REG32_BIT(*TRGSELx, u32ComTrig); + } + } +} + +/** + * @brief Set the specified event trigger source for DCU. + * @param [in] DCUx Pointer to DCU instance register base + * This parameter can be one of the following values: + * @arg M4_DCU1: DCU unit 1 instance register base + * @arg M4_DCU2: DCU unit 2 instance register base + * @arg M4_DCU3: DCU unit 3 instance register base + * @arg M4_DCU4: DCU unit 4 instance register base + * @arg M4_DCU5: DCU unit 5 instance register base + * @arg M4_DCU6: DCU unit 6 instance register base + * @arg M4_DCU7: DCU unit 7 instance register base + * @arg M4_DCU8: DCU unit 8 instance register base + * @param [in] enEventSrc The trigger external event source source. + * @arg This parameter can be any value of @ref en_event_src_t + * @retval None + * @note This register belongs to AOS module, please ensure enable it in advance. + */ +void DCU_SetTriggerSrc(const M4_DCU_TypeDef *DCUx, en_event_src_t enEventSrc) +{ + __IO uint32_t *const TRGSELx = DCU_TRGSELx(DCUx); + + if (NULL != TRGSELx) + { + MODIFY_REG32(*TRGSELx, AOS_DCU_1_TRGSEL_TRGSEL, enEventSrc); + } +} + +/** + * @brief Read DCU register DATA for byte. + * @param [in] DCUx Pointer to DCU instance register base + * This parameter can be one of the following values: + * @arg M4_DCU1: DCU unit 1 instance register base + * @arg M4_DCU2: DCU unit 2 instance register base + * @arg M4_DCU3: DCU unit 3 instance register base + * @arg M4_DCU4: DCU unit 4 instance register base + * @arg M4_DCU5: DCU unit 5 instance register base + * @arg M4_DCU6: DCU unit 6 instance register base + * @arg M4_DCU7: DCU unit 7 instance register base + * @arg M4_DCU8: DCU unit 8 instance register base + * @param [in] u32DataIndex DCU data register index + * This parameter can be one of the following values: + * @arg DCU_DATA0_IDX: DCU DATA0 + * @arg DCU_DATA1_IDX: DCU DATA1 + * @arg DCU_DATA2_IDX: DCU DATA2 + * @retval DCU register DATA value for byte + */ +uint8_t DCU_ReadData8(const M4_DCU_TypeDef *DCUx, uint32_t u32DataIndex) +{ + __IO uint8_t *DATA; + + /* Check parameters */ + DDL_ASSERT(IS_DCU_UNIT(DCUx)); + DDL_ASSERT(IS_DCU_DATA_REG(u32DataIndex)); + + DATA = (__IO uint8_t *)DATA_REG_ADDR(DCUx, u32DataIndex); + return READ_REG8(*DATA); +} + +/** + * @brief Write DCU register DATA for byte. + * @param [in] DCUx Pointer to DCU instance register base + * This parameter can be one of the following values: + * @arg M4_DCU1: DCU unit 1 instance register base + * @arg M4_DCU2: DCU unit 2 instance register base + * @arg M4_DCU3: DCU unit 3 instance register base + * @arg M4_DCU4: DCU unit 4 instance register base + * @arg M4_DCU5: DCU unit 5 instance register base + * @arg M4_DCU6: DCU unit 6 instance register base + * @arg M4_DCU7: DCU unit 7 instance register base + * @arg M4_DCU8: DCU unit 8 instance register base + * @param [in] u32DataIndex DCU data register index + * This parameter can be one of the following values: + * @arg DCU_DATA0_IDX: DCU DATA0 + * @arg DCU_DATA1_IDX: DCU DATA1 + * @arg DCU_DATA2_IDX: DCU DATA2 + * @param [in] u8Data The data to write. + * @retval None + */ +void DCU_WriteData8(M4_DCU_TypeDef *DCUx, + uint32_t u32DataIndex, + uint8_t u8Data) +{ + __IO uint8_t *DATA; + + /* Check parameters */ + DDL_ASSERT(IS_DCU_UNIT(DCUx)); + DDL_ASSERT(IS_DCU_DATA_REG(u32DataIndex)); + + DATA = (__IO uint8_t *)DATA_REG_ADDR(DCUx, u32DataIndex); + WRITE_REG8(*DATA, u8Data); +} + +/** + * @brief Read DCU register DATA for half-word. + * @param [in] DCUx Pointer to DCU instance register base + * This parameter can be one of the following values: + * @arg M4_DCU1: DCU unit 1 instance register base + * @arg M4_DCU2: DCU unit 2 instance register base + * @arg M4_DCU3: DCU unit 3 instance register base + * @arg M4_DCU4: DCU unit 4 instance register base + * @arg M4_DCU5: DCU unit 5 instance register base + * @arg M4_DCU6: DCU unit 6 instance register base + * @arg M4_DCU7: DCU unit 7 instance register base + * @arg M4_DCU8: DCU unit 8 instance register base + * @param [in] u32DataIndex DCU data register index + * This parameter can be one of the following values: + * @arg DCU_DATA0_IDX: DCU DATA0 + * @arg DCU_DATA1_IDX: DCU DATA1 + * @arg DCU_DATA2_IDX: DCU DATA2 + * @retval DCU register DATA value for half-word + */ +uint16_t DCU_ReadData16(const M4_DCU_TypeDef *DCUx, uint32_t u32DataIndex) +{ + __IO uint16_t *DATA; + + /* Check parameters */ + DDL_ASSERT(IS_DCU_UNIT(DCUx)); + DDL_ASSERT(IS_DCU_DATA_REG(u32DataIndex)); + + DATA = (__IO uint16_t *)DATA_REG_ADDR(DCUx, u32DataIndex); + return READ_REG16(*DATA); +} + +/** + * @brief Write DCU register DATA for half-word. + * @param [in] DCUx Pointer to DCU instance register base + * This parameter can be one of the following values: + * @arg M4_DCU1: DCU unit 1 instance register base + * @arg M4_DCU2: DCU unit 2 instance register base + * @arg M4_DCU3: DCU unit 3 instance register base + * @arg M4_DCU4: DCU unit 4 instance register base + * @arg M4_DCU5: DCU unit 5 instance register base + * @arg M4_DCU6: DCU unit 6 instance register base + * @arg M4_DCU7: DCU unit 7 instance register base + * @arg M4_DCU8: DCU unit 8 instance register base + * @param [in] u32DataIndex DCU data register index + * This parameter can be one of the following values: + * @arg DCU_DATA0_IDX: DCU DATA0 + * @arg DCU_DATA1_IDX: DCU DATA1 + * @arg DCU_DATA2_IDX: DCU DATA2 + * @param [in] u16Data The data to write. + * @retval None + */ +void DCU_WriteData16(M4_DCU_TypeDef *DCUx, + uint32_t u32DataIndex, + uint16_t u16Data) +{ + __IO uint16_t *DATA; + + /* Check parameters */ + DDL_ASSERT(IS_DCU_UNIT(DCUx)); + DDL_ASSERT(IS_DCU_DATA_REG(u32DataIndex)); + + DATA = (__IO uint16_t *)DATA_REG_ADDR(DCUx, u32DataIndex); + WRITE_REG16(*DATA, u16Data); +} + +/** + * @brief Read DCU register DATA for word. + * @param [in] DCUx Pointer to DCU instance register base + * This parameter can be one of the following values: + * @arg M4_DCU1: DCU unit 1 instance register base + * @arg M4_DCU2: DCU unit 2 instance register base + * @arg M4_DCU3: DCU unit 3 instance register base + * @arg M4_DCU4: DCU unit 4 instance register base + * @arg M4_DCU5: DCU unit 5 instance register base + * @arg M4_DCU6: DCU unit 6 instance register base + * @arg M4_DCU7: DCU unit 7 instance register base + * @arg M4_DCU8: DCU unit 8 instance register base + * @param [in] u32DataIndex DCU data register index + * This parameter can be one of the following values: + * @arg DCU_DATA0_IDX: DCU DATA0 + * @arg DCU_DATA1_IDX: DCU DATA1 + * @arg DCU_DATA2_IDX: DCU DATA2 + * @retval DCU register DATA value for word + */ +uint32_t DCU_ReadData32(const M4_DCU_TypeDef *DCUx, uint32_t u32DataIndex) +{ + __IO uint32_t *DATA; + + /* Check parameters */ + DDL_ASSERT(IS_DCU_UNIT(DCUx)); + DDL_ASSERT(IS_DCU_DATA_REG(u32DataIndex)); + + DATA = (__IO uint32_t *)DATA_REG_ADDR(DCUx, u32DataIndex); + return READ_REG32(*DATA); +} + +/** + * @brief Write DCU register DATA0 for word. + * @param [in] DCUx Pointer to DCU instance register base + * This parameter can be one of the following values: + * @arg M4_DCU1: DCU unit 1 instance register base + * @arg M4_DCU2: DCU unit 2 instance register base + * @arg M4_DCU3: DCU unit 3 instance register base + * @arg M4_DCU4: DCU unit 4 instance register base + * @arg M4_DCU5: DCU unit 5 instance register base + * @arg M4_DCU6: DCU unit 6 instance register base + * @arg M4_DCU7: DCU unit 7 instance register base + * @arg M4_DCU8: DCU unit 8 instance register base + * @param [in] u32DataIndex DCU data register index + * This parameter can be one of the following values: + * @arg DCU_DATA0_IDX: DCU DATA0 + * @arg DCU_DATA1_IDX: DCU DATA1 + * @arg DCU_DATA2_IDX: DCU DATA2 + * @param [in] u32Data The data to write. + * @retval None + */ +void DCU_WriteData32(M4_DCU_TypeDef *DCUx, + uint32_t u32DataIndex, + uint32_t u32Data) +{ + __IO uint32_t *DATA; + + /* Check parameters */ + DDL_ASSERT(IS_DCU_UNIT(DCUx)); + DDL_ASSERT(IS_DCU_DATA_REG(u32DataIndex)); + + DATA = (__IO uint32_t *)DATA_REG_ADDR(DCUx, u32DataIndex); + WRITE_REG32(*DATA, u32Data); +} + +/** + * @} + */ + +/** + * @defgroup DCU_Local_Functions DCU Local Functions + * @{ + */ + +/** + * @brief Get DCU trigger selection register of the specified DCU unit. + * @param [in] DCUx Pointer to DCU instance register base + * This parameter can be one of the following values: + * @arg M4_DCU1: DCU unit 1 instance register base + * @arg M4_DCU2: DCU unit 2 instance register base + * @arg M4_DCU3: DCU unit 3 instance register base + * @arg M4_DCU4: DCU unit 4 instance register base + * @arg M4_DCU5: DCU unit 5 instance register base + * @arg M4_DCU6: DCU unit 6 instance register base + * @arg M4_DCU7: DCU unit 7 instance register base + * @arg M4_DCU8: DCU unit 8 instance register base + * @retval DCU trigger selection register + */ +static __IO uint32_t* DCU_TRGSELx(const M4_DCU_TypeDef *DCUx) +{ + __IO uint32_t *TRGSELx; + + if ((M4_DCU1 == DCUx) || (M4_DCU5 == DCUx)) + { + TRGSELx = &M4_AOS->DCU_1_TRGSEL; + } + else if ((M4_DCU2 == DCUx) || (M4_DCU6 == DCUx)) + { + TRGSELx = &M4_AOS->DCU_2_TRGSEL; + } + else if ((M4_DCU3 == DCUx) || (M4_DCU7 == DCUx)) + { + TRGSELx = &M4_AOS->DCU_3_TRGSEL; + } + else if ((M4_DCU4 == DCUx) || (M4_DCU8 == DCUx)) + { + TRGSELx = &M4_AOS->DCU_4_TRGSEL; + } + else + { + TRGSELx = NULL; + } + + return TRGSELx; +} + +/** + * @} + */ + +#endif /* DDL_DCU_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_dma.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_dma.c new file mode 100644 index 0000000000..702fdf900e --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_dma.c @@ -0,0 +1,1712 @@ +/** + ******************************************************************************* + * @file hc32f4a0_dma.c + * @brief This file provides firmware functions to manage the Direct Memory + * Access (DMA). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Zhangxl First version + 2020-09-04 Chengy Typo revise in DMA_ReConfigInit() + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_dma.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_DMA DMA + * @brief Direct Memory Access Driver Library + * @{ + */ + +#if (DDL_DMA_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup DMA_Local_Macros DMA Local Macros + * @{ + */ +#define DMA_CH_REG(reg_base, ch) (*(uint32_t *)((uint32_t)(&(reg_base)) + ((ch) * 0x40UL))) + +/** + * @defgroup DMA_Check_Parameters_Validity DMA Check Parameters Validity + * @{ + */ +/*! Parameter valid check for DMA unit. */ +#define IS_DMA_UNIT(unit) \ +( ((unit) == M4_DMA1) || \ + ((unit) == M4_DMA2)) + +/*! Parameter valid check for DMA channel. */ +#define IS_DMA_CH(ch) ((ch) <= DMA_CH7) + +/*! Parameter valid check for DMA multiplex channel. */ +#define IS_DMA_MX_CH(ch) \ +( ((ch) != 0x00UL) && \ + (((ch) | DMA_MX_CH_ALL) == DMA_MX_CH_ALL)) + +/*! Parameter valid check for DMA block size. */ +#define IS_DMA_BLKSZ(bc) ((bc) <= 1024U) + +/*! Parameter valid check for DMA non-sequence transfer count. */ +#define IS_DMA_NS_TRANSCNT(tc) ((tc) <= 4096U) + +/*! Parameter valid check for DMA non-sequence offset. */ +#define IS_DMA_NS_OFFSET(ofs) ((ofs) <= ((1UL <<20U) - 1UL)) + +/*! Parameter valid check for DMA LLP pointer address. */ +#define IS_DMA_LLP_ADDR(llp) (((llp) & 0x03UL) == 0x00UL) + +/*! Parameter valid check for DMA LLP function. */ +#define IS_DMA_LLP_EN(en) \ +( ((en) == DMA_LLP_ENABLE) || \ + ((en) == DMA_LLP_DISABLE)) + +/*! Parameter valid check for DMA linked-list-pointer mode. */ +#define IS_DMA_LLP_MODE(mode) \ +( ((mode) == DMA_LLP_RUN) || \ + ((mode) == DMA_LLP_WAIT)) + +/*! Parameter valid check for DMA error interrupt. */ +#define IS_DMA_ERR_INT(it) \ +( ((it) != 0x00000000UL) && \ + (((it) | DMA_ERR_INT_MASK) == DMA_ERR_INT_MASK)) + +/*! Parameter valid check for DMA transfer interrupt. */ +#define IS_DMA_TRANS_INT(it) \ +( ((it) != 0x00000000UL) && \ + (((it) | DMA_TRANS_INT_MASK) == DMA_TRANS_INT_MASK)) + +/*! Parameter valid check for DMA request status. */ +#define IS_DMA_REQ_STAT(stat) \ +( ((stat) != 0x00000000UL) && \ + (((stat) | DMA_REQ_STAT_MASK) == DMA_REQ_STAT_MASK)) + +/*! Parameter valid check for DMA channel status. */ +#define IS_DMA_TRANS_STAT(stat) \ +( ((stat) != 0x00000000UL) && \ + (((stat) | DMA_TRANS_STAT_MASK) == DMA_TRANS_STAT_MASK)) + +/*! Parameter valid check for DMA transfer data width. */ +#define IS_DMA_DATA_WIDTH(dw) \ +( ((dw) == DMA_DATAWIDTH_8BIT) || \ + ((dw) == DMA_DATAWIDTH_16BIT) || \ + ((dw) == DMA_DATAWIDTH_32BIT)) + +/*! Parameter valid check for DMA source address mode. */ +#define IS_DMA_SADDR_MODE(mode) \ +( ((mode) == DMA_SRC_ADDR_FIX) || \ + ((mode) == DMA_SRC_ADDR_INC) || \ + ((mode) == DMA_SRC_ADDR_DEC)) + +/*! Parameter valid check for DMA destination address mode. */ +#define IS_DMA_DADDR_MODE(mode) \ +( ((mode) == DMA_DEST_ADDR_FIX) || \ + ((mode) == DMA_DEST_ADDR_INC) || \ + ((mode) == DMA_DEST_ADDR_DEC)) + +/*! Parameter valid check for DMA source address repeat selection. */ +#define IS_DMA_SRC_RPT(rpt) \ +( ((rpt) == DMA_SRC_RPT_ENABLE) || \ + ((rpt) == DMA_SRC_RPT_DISABLE)) + +/*! Parameter valid check for DMA destination address repeat selection. */ +#define IS_DMA_DEST_RPT(rpt) \ +( ((rpt) == DMA_DEST_RPT_ENABLE) || \ + ((rpt) == DMA_DEST_RPT_DISABLE)) + +/*! Parameter valid check for DMA source non-sequence selection. */ +#define IS_DMA_SRC_NS(ns) \ +( ((ns) == DMA_SRC_NS_ENABLE) || \ + ((ns) == DMA_SRC_NS_DISABLE)) + +/*! Parameter valid check for DMA destination non-sequence selection. */ +#define IS_DMA_DEST_NS(ns) \ +( ((ns) == DMA_DEST_NS_ENABLE) || \ + ((ns) == DMA_DEST_NS_DISABLE)) + +/*! Parameter valid check for DMA global interrupt function. */ +#define IS_DMA_INT_FUNC(func) \ +( ((func) == DMA_INT_ENABLE) || \ + ((func) == DMA_INT_DISABLE)) + +/*! Parameter valid check for DMA reconfig count mode. */ +#define IS_DMA_RC_CNT_MODE(mode) \ +( ((mode) == DMA_RC_CNT_FIX) || \ + ((mode) == DMA_RC_CNT_SRC) || \ + ((mode) == DMA_RC_CNT_DEST)) + +/*! Parameter valid check for DMA reconfig destination address mode. */ +#define IS_DMA_RC_DA_MODE(mode) \ +( ((mode) == DMA_RC_DA_FIX) || \ + ((mode) == DMA_RC_DA_NS ) || \ + ((mode) == DMA_RC_DA_RPT)) + +/*! Parameter valid check for DMA reconfig source address mode. */ +#define IS_DMA_RC_SA_MODE(mode) \ +( ((mode) == DMA_RC_SA_FIX) || \ + ((mode) == DMA_RC_SA_NS ) || \ + ((mode) == DMA_RC_SA_RPT)) + +/*! Parameter valid check for DMA common trigger config. */ +#define IS_DMA_COM_TRIG(trig) \ +( ((trig) != 0x00UL) && \ + (((trig) | DMA_COM_TRIG_MASK) == DMA_COM_TRIG_MASK)) + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup DMA_Global_Functions DMA Global Functions + * @{ + */ + +/** + * @brief DMA global function config. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void DMA_Cmd(M4_DMA_TypeDef *DMAx, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + /* Global setting, Enable or Disable DMA */ + WRITE_REG32(DMAx->EN, enNewState); +} + +/** + * @brief DMA error IRQ function config. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u32ErrInt DMA error IRQ flag. + * @arg DMA_REQ_ERR_CH0. + * @arg DMA_REQ_ERR_CH1. + * @arg DMA_REQ_ERR_CH2. + * @arg DMA_REQ_ERR_CH3. + * @arg DMA_REQ_ERR_CH4. + * @arg DMA_REQ_ERR_CH5. + * @arg DMA_REQ_ERR_CH6. + * @arg DMA_REQ_ERR_CH7. + * @arg DMA_TRANS_ERR_CH0. + * @arg DMA_TRANS_ERR_CH1. + * @arg DMA_TRANS_ERR_CH2. + * @arg DMA_TRANS_ERR_CH3. + * @arg DMA_TRANS_ERR_CH4. + * @arg DMA_TRANS_ERR_CH5. + * @arg DMA_TRANS_ERR_CH6. + * @arg DMA_TRANS_ERR_CH7. + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void DMA_ErrIntCmd(M4_DMA_TypeDef *DMAx, uint32_t u32ErrInt, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_ERR_INT(u32ErrInt)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Disable == enNewState) + { + SET_REG32_BIT(DMAx->INTMASK0, u32ErrInt); + } + else + { + CLEAR_REG32_BIT(DMAx->INTMASK0, u32ErrInt); + } +} + +/** + * @brief Get DMA error IRQ status. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u32ErrInt DMA error IRQ flag. + * @arg DMA_REQ_ERR_CH0. + * @arg DMA_REQ_ERR_CH1. + * @arg DMA_REQ_ERR_CH2. + * @arg DMA_REQ_ERR_CH3. + * @arg DMA_REQ_ERR_CH4. + * @arg DMA_REQ_ERR_CH5. + * @arg DMA_REQ_ERR_CH6. + * @arg DMA_REQ_ERR_CH7. + * @arg DMA_TRANS_ERR_CH0. + * @arg DMA_TRANS_ERR_CH1. + * @arg DMA_TRANS_ERR_CH2. + * @arg DMA_TRANS_ERR_CH3. + * @arg DMA_TRANS_ERR_CH4. + * @arg DMA_TRANS_ERR_CH5. + * @arg DMA_TRANS_ERR_CH6. + * @arg DMA_TRANS_ERR_CH7. + * @retval en_flag_status_t + */ +en_flag_status_t DMA_GetErrIntStatus(const M4_DMA_TypeDef *DMAx, uint32_t u32ErrInt) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_ERR_INT(u32ErrInt)); + + return (READ_REG32_BIT(DMAx->INTSTAT0, u32ErrInt) ? Set : Reset); +} + +/** + * @brief Clear DMA error IRQ status. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u32ErrInt DMA error IRQ flag. + * @arg DMA_REQ_ERR_CH0. + * @arg DMA_REQ_ERR_CH1. + * @arg DMA_REQ_ERR_CH2. + * @arg DMA_REQ_ERR_CH3. + * @arg DMA_REQ_ERR_CH4. + * @arg DMA_REQ_ERR_CH5. + * @arg DMA_REQ_ERR_CH6. + * @arg DMA_REQ_ERR_CH7. + * @arg DMA_TRANS_ERR_CH0. + * @arg DMA_TRANS_ERR_CH1. + * @arg DMA_TRANS_ERR_CH2. + * @arg DMA_TRANS_ERR_CH3. + * @arg DMA_TRANS_ERR_CH4. + * @arg DMA_TRANS_ERR_CH5. + * @arg DMA_TRANS_ERR_CH6. + * @arg DMA_TRANS_ERR_CH7. + * @retval None + */ +void DMA_ClearErrIntStatus(M4_DMA_TypeDef *DMAx, uint32_t u32ErrInt) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_ERR_INT(u32ErrInt)); + + SET_REG32_BIT(DMAx->INTCLR0, u32ErrInt); +} + +/** + * @brief DMA transfer IRQ function config. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u32TransInt DMA transfer IRQ flag. + * @arg DMA_BTC_INT_CH0 + * @arg DMA_BTC_INT_CH1 + * @arg DMA_BTC_INT_CH2 + * @arg DMA_BTC_INT_CH3 + * @arg DMA_BTC_INT_CH4 + * @arg DMA_BTC_INT_CH5 + * @arg DMA_BTC_INT_CH6 + * @arg DMA_BTC_INT_CH7 + * @arg DMA_TC_INT_CH0 + * @arg DMA_TC_INT_CH1 + * @arg DMA_TC_INT_CH2 + * @arg DMA_TC_INT_CH3 + * @arg DMA_TC_INT_CH4 + * @arg DMA_TC_INT_CH5 + * @arg DMA_TC_INT_CH6 + * @arg DMA_TC_INT_CH7 + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void DMA_TransIntCmd(M4_DMA_TypeDef *DMAx, uint32_t u32TransInt, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_TRANS_INT(u32TransInt)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Disable == enNewState) + { + SET_REG32_BIT(DMAx->INTMASK1, u32TransInt); + } + else + { + CLEAR_REG32_BIT(DMAx->INTMASK1, u32TransInt); + } +} + +/** + * @brief Get DMA transfer IRQ status. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u32TransInt DMA transfer IRQ flag. + * @arg DMA_BTC_INT_CH0 + * @arg DMA_BTC_INT_CH1 + * @arg DMA_BTC_INT_CH2 + * @arg DMA_BTC_INT_CH3 + * @arg DMA_BTC_INT_CH4 + * @arg DMA_BTC_INT_CH5 + * @arg DMA_BTC_INT_CH6 + * @arg DMA_BTC_INT_CH7 + * @arg DMA_TC_INT_CH0 + * @arg DMA_TC_INT_CH1 + * @arg DMA_TC_INT_CH2 + * @arg DMA_TC_INT_CH3 + * @arg DMA_TC_INT_CH4 + * @arg DMA_TC_INT_CH5 + * @arg DMA_TC_INT_CH6 + * @arg DMA_TC_INT_CH7 + * @retval en_flag_status_t + */ +en_flag_status_t DMA_GetTransIntStatus(const M4_DMA_TypeDef *DMAx, uint32_t u32TransInt) +{ + DDL_ASSERT(IS_DMA_TRANS_INT(u32TransInt)); + return (READ_REG32_BIT(DMAx->INTSTAT1, u32TransInt) ? Set : Reset); +} + +/** + * @brief Clear DMA transfer IRQ status. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u32TransInt DMA transfer IRQ flag. + * @arg DMA_BTC_INT_CH0 + * @arg DMA_BTC_INT_CH1 + * @arg DMA_BTC_INT_CH2 + * @arg DMA_BTC_INT_CH3 + * @arg DMA_BTC_INT_CH4 + * @arg DMA_BTC_INT_CH5 + * @arg DMA_BTC_INT_CH6 + * @arg DMA_BTC_INT_CH7 + * @arg DMA_TC_INT_CH0 + * @arg DMA_TC_INT_CH1 + * @arg DMA_TC_INT_CH2 + * @arg DMA_TC_INT_CH3 + * @arg DMA_TC_INT_CH4 + * @arg DMA_TC_INT_CH5 + * @arg DMA_TC_INT_CH6 + * @arg DMA_TC_INT_CH7 + * @retval None + */ +void DMA_ClearTransIntStatus(M4_DMA_TypeDef *DMAx, uint32_t u32TransInt) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_TRANS_INT(u32TransInt)); + + SET_REG32_BIT(DMAx->INTCLR1, u32TransInt); +} + +/** + * @brief DMA multiplex channel function config. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8MxCh DMA multiplex channel. + * @arg DMA_MX_CH0. + * @arg DMA_MX_CH1. + * @arg DMA_MX_CH2. + * @arg DMA_MX_CH3. + * @arg DMA_MX_CH4. + * @arg DMA_MX_CH5. + * @arg DMA_MX_CH6. + * @arg DMA_MX_CH7. + * @arg DMA_MX_CH_ALL. + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void DMA_MxChannelCmd(M4_DMA_TypeDef *DMAx, uint8_t u8MxCh, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_MX_CH(u8MxCh)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(DMAx->CHEN, u8MxCh); + } + else + { + SET_REG32_BIT(DMAx->CHENCLR, u8MxCh); + } +} + +/** + * @brief DMA channel function config. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void DMA_ChannelCmd(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(DMAx->CHEN, ((1UL << u8Ch) & 0xFFUL)); + } + else + { + SET_REG32_BIT(DMAx->CHENCLR, ((1UL << u8Ch) & 0xFFUL)); + } +} + +/** + * @brief Get DMA request status. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u32Status DMA request status. + * @arg DMA_REQ_CH0. + * @arg DMA_REQ_CH1. + * @arg DMA_REQ_CH2. + * @arg DMA_REQ_CH3. + * @arg DMA_REQ_CH4. + * @arg DMA_REQ_CH5. + * @arg DMA_REQ_CH6. + * @arg DMA_REQ_CH7. + * @arg DMA_REQ_RECONFIG. + * @retval en_flag_status_t + */ +en_flag_status_t DMA_GetReqStatus(const M4_DMA_TypeDef *DMAx, uint32_t u32Status) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_REQ_STAT(u32Status)); + + return (READ_REG32_BIT(DMAx->REQSTAT, u32Status) ? Set : Reset); +} + +/** + * @brief Get DMA transfer status. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u32Status DMA transfer status. + * @arg DMA_TRANS_CH0. + * @arg DMA_TRANS_CH1. + * @arg DMA_TRANS_CH2. + * @arg DMA_TRANS_CH3. + * @arg DMA_TRANS_CH4. + * @arg DMA_TRANS_CH5. + * @arg DMA_TRANS_CH6. + * @arg DMA_TRANS_CH7. + * @arg DMA_TRANS_RECONFIG. + * @arg DMA_TRANS_DMA. + * @retval en_flag_status_t + */ +en_flag_status_t DMA_GetTransStatus(const M4_DMA_TypeDef *DMAx, uint32_t u32Status) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_TRANS_STAT(u32Status)); + + return (READ_REG32_BIT(DMAx->CHSTAT, u32Status) ? Set : Reset); +} + +/** + * @brief DMA re-config mode trigger source. + * @param [in] enSrc DMA transfer trigger source. + * @arg This parameter can be @ref en_event_src_t + * @retval None + * @note This register belongs to AOS module, please ensure enable it in advance. + * DMA1 and DMA2 share this register. + */ +void DMA_SetReConfigTriggerSrc(en_event_src_t enSrc) +{ + MODIFY_REG32(M4_AOS->DMA_TRGSELRC, AOS_DMA_TRGSELRC_TRGSEL, enSrc); +} + +/** + * @brief AOS common trigger function config for DMA re-config mode. + * @param [in] u32ComTrig Common trigger event enable. + * This parameter can be one of the following values: + * @arg DMA_COM_TRIG1: Common trigger event 1 . + * @arg DMA_COM_TRIG2: Common trigger event 2. + * @param [in] enNewState New state of common trigger function. + * @retval None + * @note This register belongs to AOS module, please ensure enable it in advance. + */ +void DMA_RCComTriggerCmd(uint32_t u32ComTrig, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_DMA_COM_TRIG(u32ComTrig)); + + if (Enable == enNewState) + { + SET_REG32_BIT(M4_AOS->DMA_TRGSELRC, u32ComTrig); + } + else + { + CLEAR_REG32_BIT(M4_AOS->DMA_TRGSELRC, u32ComTrig); + } +} + +/** + * @brief Config DMA transfer trigger source. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @param [in] enSrc DMA transfer trigger source. + * @arg This parameter can be @ref en_event_src_t + * @retval None + * @note This register belongs to AOS module, please ensure enable it in advance. + */ +void DMA_SetTriggerSrc(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch, en_event_src_t enSrc) +{ + __IO uint32_t *TRGSELx; + + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + + if (M4_DMA1 == DMAx) + { + TRGSELx = (uint32_t *)((uint32_t)(&M4_AOS->DMA_1_TRGSEL0) + u8Ch*4UL); + } + else + { + TRGSELx = (uint32_t *)((uint32_t)(&M4_AOS->DMA_2_TRGSEL0) + u8Ch*4UL); + } + MODIFY_REG32(*TRGSELx, AOS_DMA_1_TRGSEL_TRGSEL, enSrc); +} + +/** + * @brief AOS common trigger function config for DMA + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @param [in] u32ComTrig Common trigger event enable. + * This parameter can be one of the following values: + * @arg DMA_COM_TRIG1: Common trigger event 1 . + * @arg DMA_COM_TRIG2: Common trigger event 2. + * @param [in] enNewState New state of common trigger function. + * @retval None + * @note This register belongs to AOS module, please ensure enable it in advance. + */ +void DMA_ComTriggerCmd(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint32_t u32ComTrig, en_functional_state_t enNewState) +{ + __IO uint32_t *TRGSELx; + + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_DMA_COM_TRIG(u32ComTrig)); + + if (M4_DMA1 == DMAx) + { + TRGSELx = (uint32_t *)((uint32_t)(&M4_AOS->DMA_1_TRGSEL0) + u8Ch*4UL); + } + else + { + TRGSELx = (uint32_t *)((uint32_t)(&M4_AOS->DMA_2_TRGSEL0) + u8Ch*4UL); + } + + if (Enable == enNewState) + { + SET_REG32_BIT(*TRGSELx, u32ComTrig); + } + else + { + CLEAR_REG32_BIT(*TRGSELx, u32ComTrig); + } +} + +/** + * @brief Config DMA source address. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @param [in] u32Addr DMA source address. + * @retval None + */ +void DMA_SetSrcAddr(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint32_t u32Addr) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + + WRITE_REG32(DMA_CH_REG(DMAx->SAR0, u8Ch), u32Addr); +} + +/** + * @brief Config DMA destination address. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @param [in] u32Addr DMA destination address. + * @retval None + */ +void DMA_SetDestAddr(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint32_t u32Addr) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + + WRITE_REG32(DMA_CH_REG(DMAx->DAR0, u8Ch), u32Addr); +} + +/** + * @brief Config DMA transfer count. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @param [in] u16Cnt DMA transfer count (0: infinite, 1 ~ 65535). + * @retval None + */ +void DMA_SetTransCnt(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint16_t u16Cnt) +{ + __IO uint32_t *DTCTLx; + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + + DTCTLx = &DMA_CH_REG(DMAx->DTCTL0, u8Ch); + MODIFY_REG32(*DTCTLx, DMA_DTCTL_CNT, ((uint32_t)(u16Cnt) << DMA_DTCTL_CNT_POS)); +} + +/** + * @brief Config DMA block size per transfer. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @param [in] u16Size DMA block size (0, 1024: 1024, 1 ~ 1023). + * @retval None + */ +void DMA_SetBlockSize(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint16_t u16Size) +{ + __IO uint32_t *DTCTLx; + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + DDL_ASSERT(IS_DMA_BLKSZ(u16Size)); + + DTCTLx = &DMA_CH_REG(DMAx->DTCTL0, u8Ch); + MODIFY_REG32(*DTCTLx, DMA_DTCTL_BLKSIZE, ((uint32_t)u16Size << DMA_DTCTL_BLKSIZE_POS)); +} + +/** + * @brief Config DMA source repeat size. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @param [in] u16Size DMA source repeat size (0, 1024: 1024, 1 ~ 1023). + * @retval None + */ +void DMA_SetSrcRptSize(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint16_t u16Size) +{ + __IO uint32_t *RPTx; + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + DDL_ASSERT(IS_DMA_BLKSZ(u16Size)); + + RPTx = &DMA_CH_REG(DMAx->RPT0, u8Ch); + MODIFY_REG32(*RPTx, DMA_RPT_SRPT, ((uint32_t)(u16Size) << DMA_RPT_SRPT_POS)); +} + +/** + * @brief Config DMA destination repeat size. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @param [in] u16Size DMA destination repeat size (0, 1024: 1024, 1 ~ 1023). + * @retval None + */ +void DMA_SetDestRptSize(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint16_t u16Size) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + DDL_ASSERT(IS_DMA_BLKSZ(u16Size)); + + MODIFY_REG32(DMA_CH_REG(DMAx->RPT0, u8Ch), DMA_RPT_DRPT, ((uint32_t)(u16Size) << DMA_RPT_DRPT_POS)); +} + +/** + * @brief Config DMA source transfter count under non-sequence mode. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @param [in] u32Cnt DMA source transfer count (0, 4096: 4096, 1 ~ 4095). + * @retval None + */ +void DMA_SetNonSeqSrcCnt(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint32_t u32Cnt) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + DDL_ASSERT(IS_DMA_NS_TRANSCNT(u32Cnt)); + + MODIFY_REG32(DMA_CH_REG(DMAx->SNSEQCTL0, u8Ch), DMA_SNSEQCTLB_SNSCNTB, (u32Cnt << DMA_SNSEQCTLB_SNSCNTB_POS)); +} + +/** + * @brief Config DMA destination transfter count under non-sequence mode. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @param [in] u32Cnt DMA destination transfer count (0, 4096: 4096, 1 ~ 4095). + * @retval None + */ +void DMA_SetNonSeqDestCnt(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint32_t u32Cnt) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + DDL_ASSERT(IS_DMA_NS_TRANSCNT(u32Cnt)); + + MODIFY_REG32(DMA_CH_REG(DMAx->DNSEQCTL0, u8Ch), DMA_DNSEQCTL_DNSCNT, (u32Cnt << DMA_DNSEQCTL_DNSCNT_POS)); +} + +/** + * @brief Config DMA source offset number under non-sequence mode. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @param [in] u32Ofs DMA source offset (0 ~ 2^20 - 1). + * @retval None + */ +void DMA_SetNonSeqSrcOffset(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint32_t u32Ofs) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + DDL_ASSERT(IS_DMA_NS_OFFSET(u32Ofs)); + + MODIFY_REG32(DMA_CH_REG(DMAx->SNSEQCTL0, u8Ch), DMA_SNSEQCTL_SOFFSET, u32Ofs); +} + +/** + * @brief Config DMA destination offset number under non-sequence mode. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @param [in] u32Ofs DMA destination offset (0 ~ 2^20 - 1). + * @retval None + */ +void DMA_SetNonSeqDestOffset(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint32_t u32Ofs) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + DDL_ASSERT(IS_DMA_NS_OFFSET(u32Ofs)); + + MODIFY_REG32(DMA_CH_REG(DMAx->DNSEQCTL0, u8Ch), DMA_DNSEQCTL_DOFFSET, u32Ofs); +} + +/** + * @brief Initialize DMA config structure. Fill each pstcDmaInit with default value + * @param [in] pstcDmaInit Pointer to a stc_dma_init_t structure that + * contains configuration information. + * @retval Ok: DMA structure initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t DMA_StructInit(stc_dma_init_t *pstcDmaInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcDmaInit) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcDmaInit->u32IntEn = DMA_INT_ENABLE; + pstcDmaInit->u32SrcAddr = 0x00UL; + pstcDmaInit->u32DestAddr = 0x00UL; + pstcDmaInit->u32DataWidth = DMA_DATAWIDTH_8BIT; + pstcDmaInit->u32BlockSize = 0x00UL; + pstcDmaInit->u32TransCnt = 0x01UL; + pstcDmaInit->u32SrcInc = DMA_SRC_ADDR_FIX; + pstcDmaInit->u32DestInc = DMA_DEST_ADDR_FIX; + } + return enRet; +} + +/** + * @brief DMA basic function initialize. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @param [in] pstcDmaInit DMA config structure. + * @arg u32IntEn DMA interrupt enable or disable. + * @arg u32SrcAddr DMA source address. + * @arg u32DestAddr DMA destination address. + * @arg u32DataWidth DMA data width. + * @arg u32BlockSize DMA block size. + * @arg u32TransferCnt DMA transfer count. + * @arg u32SrcInc DMA source address direction. + * @arg u32DestInc DMA destination address direction. + * @retval Ok: DMA basic function initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t DMA_Init(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, const stc_dma_init_t *pstcDmaInit) +{ + en_result_t enRet = Ok; + __IO uint32_t *CHCTLx; + + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + + if (NULL == pstcDmaInit) + { + enRet = ErrorInvalidParameter; + } + else + { + DDL_ASSERT(IS_DMA_INT_FUNC(pstcDmaInit->u32IntEn)); + DDL_ASSERT(IS_DMA_DATA_WIDTH(pstcDmaInit->u32DataWidth)); + DDL_ASSERT(IS_DMA_SADDR_MODE(pstcDmaInit->u32SrcInc)); + DDL_ASSERT(IS_DMA_DADDR_MODE(pstcDmaInit->u32DestInc)); + DDL_ASSERT(IS_DMA_BLKSZ(pstcDmaInit->u32BlockSize)); + + WRITE_REG32(DMA_CH_REG(DMAx->SAR0, u8Ch), pstcDmaInit->u32SrcAddr); + WRITE_REG32(DMA_CH_REG(DMAx->DAR0, u8Ch), pstcDmaInit->u32DestAddr); + WRITE_REG32(DMA_CH_REG(DMAx->DTCTL0, u8Ch), (pstcDmaInit->u32BlockSize| \ + (pstcDmaInit->u32TransCnt << DMA_DTCTL_CNT_POS))); + + CHCTLx = &DMA_CH_REG(DMAx->CHCTL0, u8Ch); + MODIFY_REG32(*CHCTLx, \ + (DMA_CHCTL_SINC | DMA_CHCTL_DINC | DMA_CHCTL_HSIZE | DMA_CHCTL_IE), \ + (pstcDmaInit->u32IntEn | pstcDmaInit->u32DataWidth | \ + pstcDmaInit->u32SrcInc | pstcDmaInit->u32DestInc)); + } + return enRet; +} + +/** + * @brief Initialize DMA repeat mode config structure. + * Fill each pstcDmaInit with default value + * @param [in] pstcDmaRptInit Pointer to a stc_dma_rpt_init_t structure that + * contains configuration information. + * @retval Ok: DMA repeat mode config structure initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t DMA_RepeatStructInit(stc_dma_rpt_init_t *pstcDmaRptInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcDmaRptInit) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcDmaRptInit->u32SrcRptEn = DMA_SRC_RPT_DISABLE; + pstcDmaRptInit->u32SrcRptSize = 0x00UL; + pstcDmaRptInit->u32DestRptEn = DMA_DEST_RPT_DISABLE; + pstcDmaRptInit->u32DestRptSize = 0x00UL; + } + return enRet; +} + +/** + * @brief DMA repeat mode initialize. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @param [in] pstcDmaRptInit DMA repeat mode config structure. + * @arg u32SrcRptEn DMA source repeat enable or disable. + * @arg u32SrcRptSize DMA source repeat size. + * @arg u32DestRptEn DMA destination repeat enable or disable. + * @arg u32DestRptSize DMA destination repeat size. + * @retval Ok: DMA repeat function initialize successful + * ErrorInvalidParameter: NULL pointer + * @note Call this function after DMA_Init(); + */ +en_result_t DMA_RepeatInit(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, const stc_dma_rpt_init_t *pstcDmaRptInit) +{ + en_result_t enRet = Ok; + __IO uint32_t *CHCTLx; + + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + + if (NULL == pstcDmaRptInit) + { + enRet = ErrorInvalidParameter; + } + else + { + DDL_ASSERT(IS_DMA_SRC_RPT(pstcDmaRptInit->u32SrcRptEn)); + DDL_ASSERT(IS_DMA_DEST_RPT(pstcDmaRptInit->u32DestRptEn)); + DDL_ASSERT(IS_DMA_BLKSZ(pstcDmaRptInit->u32DestRptSize)); + DDL_ASSERT(IS_DMA_BLKSZ(pstcDmaRptInit->u32SrcRptSize)); + + CHCTLx = &DMA_CH_REG(DMAx->CHCTL0, u8Ch); + MODIFY_REG32(*CHCTLx, \ + (DMA_CHCTL_SRTPEN | DMA_CHCTL_DRPTEN), \ + (pstcDmaRptInit->u32SrcRptEn | pstcDmaRptInit->u32DestRptEn)); + + WRITE_REG32(DMA_CH_REG(DMAx->RPT0, u8Ch), \ + ((pstcDmaRptInit->u32DestRptSize << DMA_RPT_DRPT_POS) | \ + pstcDmaRptInit->u32SrcRptSize)); + } + return enRet; +} + +/** + * @brief Initialize DMA non-sequence mode config structure. + * Fill each pstcDmaInit with default value + * @param [in] pstcDmaNonSeqInit Pointer to a stc_dma_nonseq_init_t structure that + * contains configuration information. + * @retval Ok: DMA non-sequence mode structure initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t DMA_NonSeqStructInit(stc_dma_nonseq_init_t *pstcDmaNonSeqInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcDmaNonSeqInit) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcDmaNonSeqInit->u32SrcNonSeqEn = DMA_SRC_NS_DISABLE; + pstcDmaNonSeqInit->u32SrcNonSeqCnt = 0x00UL; + pstcDmaNonSeqInit->u32SrcNonSeqOfs = 0x00UL; + pstcDmaNonSeqInit->u32DestNonSeqEn = DMA_DEST_NS_DISABLE; + pstcDmaNonSeqInit->u32DestNonSeqCnt = 0x00UL; + pstcDmaNonSeqInit->u32DestNonSeqOfs = 0x00UL; + } + return enRet; +} + +/** + * @brief DMA non-sequence mode initialize. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @param [in] pstcDmaNonSeqInit DMA non-sequence mode config structure. + * @arg u32SrcNonSeqEn DMA source non-sequence enable or disable. + * @arg u32SrcNonSeqCnt DMA source non-sequence count. + * @arg u32SrcNonSeqOfs DMA source non-sequence offset. + * @arg u32DestNonSeqEn DMA destination non-sequence enable or disable. + * @arg u32DestNonSeqCnt DMA destination non-sequence count. + * @arg u32DestNonSeqOfs DMA destination non-sequence offset. + * @retval Ok: DMA non-sequence function initialize successful + * ErrorInvalidParameter: NULL pointer + * @note Call this function after DMA_Init(); + */ +en_result_t DMA_NonSeqInit(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, const stc_dma_nonseq_init_t *pstcDmaNonSeqInit) +{ + en_result_t enRet = Ok; + __IO uint32_t *CHCTLx; + + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + + if (NULL == pstcDmaNonSeqInit) + { + enRet = ErrorInvalidParameter; + } + else + { + DDL_ASSERT(IS_DMA_SRC_NS(pstcDmaNonSeqInit->u32SrcNonSeqEn)); + DDL_ASSERT(IS_DMA_DEST_NS(pstcDmaNonSeqInit->u32DestNonSeqEn)); + DDL_ASSERT(IS_DMA_NS_TRANSCNT(pstcDmaNonSeqInit->u32SrcNonSeqCnt)); + DDL_ASSERT(IS_DMA_NS_TRANSCNT(pstcDmaNonSeqInit->u32DestNonSeqCnt)); + DDL_ASSERT(IS_DMA_NS_OFFSET(pstcDmaNonSeqInit->u32SrcNonSeqOfs)); + DDL_ASSERT(IS_DMA_NS_OFFSET(pstcDmaNonSeqInit->u32DestNonSeqOfs)); + + CHCTLx = &DMA_CH_REG(DMAx->CHCTL0, u8Ch); + MODIFY_REG32(*CHCTLx, \ + (DMA_CHCTL_SNSEQEN | DMA_CHCTL_DNSEQEN), \ + (pstcDmaNonSeqInit->u32SrcNonSeqEn | pstcDmaNonSeqInit->u32DestNonSeqEn)); + + WRITE_REG32(DMA_CH_REG(DMAx->SNSEQCTL0, u8Ch), \ + ((pstcDmaNonSeqInit->u32SrcNonSeqCnt << DMA_SNSEQCTL_SNSCNT_POS) | \ + pstcDmaNonSeqInit->u32SrcNonSeqOfs)); + } + return enRet; +} + +/** + * @brief Initialize DMA Linked List Pointer (hereafter, LLP) mode config structure. + * Fill each pstcDmaInit with default value + * @param [in] pstcDmaLlpInit Pointer to a stc_dma_llp_init_t structure that + * contains configuration information. + * @retval Ok: DMA LLP mode config structure initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t DMA_LlpStructInit(stc_dma_llp_init_t *pstcDmaLlpInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcDmaLlpInit) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcDmaLlpInit->u32LlpEn = DMA_LLP_DISABLE; + pstcDmaLlpInit->u32LlpRun = DMA_LLP_WAIT; + pstcDmaLlpInit->u32LlpAddr = 0x00UL; + } + return enRet; +} + +/** + * @brief DMA LLP mode initialize. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @param [in] pstcDmaLlpInit DMA LLP config structure. + * @arg u32LlpEn DMA LLP enable or disable. + * @arg u32LlpRun DMA LLP auto-run or wait request. + * @arg u32LlpAddr DMA LLP next list pointer address. + * @retval Ok: DMA LLP function initialize successful + * ErrorInvalidParameter: NULL pointer + * @note Call this function after DMA_Init(); + */ +en_result_t DMA_LlpInit(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, const stc_dma_llp_init_t *pstcDmaLlpInit) +{ + en_result_t enRet = Ok; + __IO uint32_t *CHCTLx; + + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + + if (NULL == pstcDmaLlpInit) + { + enRet = ErrorInvalidParameter; + } + else + { + DDL_ASSERT(IS_DMA_LLP_EN(pstcDmaLlpInit->u32LlpEn)); + DDL_ASSERT(IS_DMA_LLP_ADDR(pstcDmaLlpInit->u32LlpAddr)); + DDL_ASSERT(IS_DMA_LLP_MODE(pstcDmaLlpInit->u32LlpRun)); + + CHCTLx = &DMA_CH_REG(DMAx->CHCTL0, u8Ch); + MODIFY_REG32(*CHCTLx, \ + (DMA_CHCTL_LLPEN | DMA_CHCTL_LLPRUN), \ + (pstcDmaLlpInit->u32LlpEn | pstcDmaLlpInit->u32LlpRun)); + + WRITE_REG32(DMA_CH_REG(DMAx->LLP0, u8Ch), pstcDmaLlpInit->u32LlpAddr); + } + + return enRet; +} + +/** + * @brief Config DMA LLP value. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @param [in] u32LlpAddr Next link pointer address for DMA LLP mode. + * @retval None + */ +void DMA_SetLlpAddr(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, uint32_t u32LlpAddr) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + DDL_ASSERT(IS_DMA_LLP_ADDR(u32LlpAddr)); + + WRITE_REG32(DMA_CH_REG(DMAx->LLP0, u8Ch), (u32LlpAddr & 0xFFFFFFFCUL)); +} + +/** + * @brief DMA LLP enable or disable. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @param [in] enNewState New state of LLP function. + * @retval None + */ +void DMA_LlpCmd(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(DMA_CH_REG(DMAx->CHCTL0, u8Ch), DMA_CHCTL_LLPEN); + } + else + { + CLEAR_REG32_BIT(DMA_CH_REG(DMAx->CHCTL0, u8Ch), DMA_CHCTL_LLPEN); + } +} + +/** + * @brief DMA reconfig function enable or disable. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] enNewState New state of reconfig function. + * @retval None + */ +void DMA_ReConfigCmd(M4_DMA_TypeDef *DMAx, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(DMAx->RCFGCTL, 1UL); + } + else + { + CLEAR_REG32_BIT(DMAx->RCFGCTL, 1UL); + } +} + +/** + * @brief DMA LLP enable or disable for reconfig function. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @param [in] enNewState New state of LLP function in reconfig case. + * @retval None + */ +void DMA_ReConfigLlpCmd(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + MODIFY_REG32(DMAx->RCFGCTL, DMA_RCFGCTL_RCFGCHS, ((uint32_t)(u8Ch) << DMA_RCFGCTL_RCFGCHS_POS)); + WRITE_REG32(DMAx->RCFGCTL, enNewState); +} + +/** + * @brief Initialize DMA re-config mode config structure. + * Fill each pstcDmaRCInit with default value + * @param [in] pstcDmaRCInit Pointer to a stc_dma_reconfig_init_t structure that + * contains configuration information. + * @retval Ok: DMA reconfig mode config structure initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t DMA_ReConfigStructInit(stc_dma_reconfig_init_t *pstcDmaRCInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcDmaRCInit) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcDmaRCInit->u32CntMode = DMA_RC_CNT_FIX; + pstcDmaRCInit->u32DestAddrMode = DMA_RC_DA_FIX; + pstcDmaRCInit->u32SrcAddrMode = DMA_RC_SA_FIX; + } + return enRet; +} + +/** + * @brief DMA reconfig mode initialize. + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @param [in] pstcDmaRCInit DMA reconfig mode config structure + * @arg u32CntMode DMA reconfig count mode. + * @arg u32DestAddrMode DMA reconfig destination address mode. + * @arg u32SrcAddrMode DMA reconfig source address mode. + * @retval Ok: DMA reconfig function initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t DMA_ReConfigInit(M4_DMA_TypeDef *DMAx, uint8_t u8Ch, const stc_dma_reconfig_init_t *pstcDmaRCInit) +{ + en_result_t enRet = Ok; + + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + + if (NULL == pstcDmaRCInit) + { + enRet = ErrorInvalidParameter; + } + else + { + DDL_ASSERT(IS_DMA_RC_CNT_MODE(pstcDmaRCInit->u32CntMode)); + DDL_ASSERT(IS_DMA_RC_DA_MODE(pstcDmaRCInit->u32DestAddrMode)); + DDL_ASSERT(IS_DMA_RC_SA_MODE(pstcDmaRCInit->u32SrcAddrMode)); + + MODIFY_REG32(DMAx->RCFGCTL, \ + (DMA_RCFGCTL_RCFGCHS | DMA_RCFGCTL_SARMD | DMA_RCFGCTL_DARMD | \ + DMA_RCFGCTL_CNTMD), \ + (pstcDmaRCInit->u32CntMode | pstcDmaRCInit->u32SrcAddrMode | \ + pstcDmaRCInit->u32DestAddrMode | ((uint32_t)(u8Ch) << DMA_RCFGCTL_RCFGCHS_POS))); + } + return enRet; +} + +/** + * @brief DMA get current source address + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @retval Current source address. + */ +uint32_t DMA_GetSrcAddr(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + + return READ_REG32(DMA_CH_REG(DMAx->MONSAR0, u8Ch)); +} + +/** + * @brief DMA get current destination address + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @retval Current destination address. + */ +uint32_t DMA_GetDestAddr(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + + return READ_REG32(DMA_CH_REG(DMAx->MONDAR0, u8Ch)); +} + +/** + * @brief DMA get current transfer count + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @retval Current transfer count. + */ +uint32_t DMA_GetTransCnt(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + + return ((READ_REG32(DMA_CH_REG(DMAx->MONDTCTL0, u8Ch)) >> DMA_DTCTL_CNT_POS) & 0xFFFFUL); +} + +/** + * @brief DMA get current block size + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @retval Current block size. + */ +uint32_t DMA_GetBlockSize(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + + return (READ_REG32_BIT(DMA_CH_REG(DMAx->MONDTCTL0, u8Ch), DMA_DTCTL_BLKSIZE)); +} + +/** + * @brief DMA get current source repeat size + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @retval Current source repeat size. + */ +uint32_t DMA_GetSrcRptSize(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + + return (READ_REG32_BIT(DMA_CH_REG(DMAx->MONRPT0, u8Ch), DMA_RPT_SRPT)); +} + +/** + * @brief DMA get current destination repeat size + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @retval Current destination repeat size. + */ +uint32_t DMA_GetDestRptSize(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + + return ((READ_REG32(DMA_CH_REG(DMAx->MONRPT0, u8Ch)) >> DMA_RPT_DRPT_POS) & 0x3FFUL); +} + +/** + * @brief DMA get current source count in non-sequence mode + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @retval Current source count in non-sequence mode. + */ +uint32_t DMA_GetNonSeqSrcCnt(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + + return ((READ_REG32(DMA_CH_REG(DMAx->MONSNSEQCTL0, u8Ch)) >> DMA_SNSEQCTLB_SNSCNTB_POS) & 0xFFFUL); +} + +/** + * @brief DMA get current destination count in non-sequence mode + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @retval Current destination count in non-sequence mode. + */ +uint32_t DMA_GetNonSeqDestCnt(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + + return ((READ_REG32(DMA_CH_REG(DMAx->MONDNSEQCTL0, u8Ch)) >> DMA_DNSEQCTL_DNSCNT_POS) & 0xFFFUL); +} + +/** + * @brief DMA get current source offset in non-sequence mode + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @retval Current source offset in non-sequence mode. + */ +uint32_t DMA_GetNonSeqSrcOffset(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + + return (READ_REG32_BIT(DMA_CH_REG(DMAx->MONSNSEQCTL0, u8Ch), DMA_SNSEQCTL_SOFFSET)); +} + +/** + * @brief DMA get current destination offset in non-sequence mode + * @param [in] DMAx DMA unit instance. + * @arg M4_DMA1 Unit1. + * @arg M4_DMA2 Unit2. + * @param [in] u8Ch DMA channel. + * @arg DMA_CH0. + * @arg DMA_CH1. + * @arg DMA_CH2. + * @arg DMA_CH3. + * @arg DMA_CH4. + * @arg DMA_CH5. + * @arg DMA_CH6. + * @arg DMA_CH7. + * @retval Current destination offset in non-sequence mode. + */ +uint32_t DMA_GetNonSeqDestOffset(const M4_DMA_TypeDef *DMAx, uint8_t u8Ch) +{ + DDL_ASSERT(IS_DMA_UNIT(DMAx)); + DDL_ASSERT(IS_DMA_CH(u8Ch)); + + return (READ_REG32_BIT(DMA_CH_REG(DMAx->MONDNSEQCTL0, u8Ch), DMA_DNSEQCTL_DOFFSET)); +} + +/** + * @} + */ + +#endif /* DDL_DMA_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_dmc.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_dmc.c new file mode 100644 index 0000000000..c5a813b135 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_dmc.c @@ -0,0 +1,561 @@ +/** + ******************************************************************************* + * @file hc32f4a0_dmc.c + * @brief This file provides firmware functions to manage the EXMC DMC + * (External Memory Controller: Dynamic Memory Controller) driver library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Hongjh First version + 2020-07-14 Hongjh Merge API from EXMC_DMC_Enable/Disable to EXMC_DMC_Cmd + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_dmc.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_EXMC_DMC EXMC_DMC + * @brief Dynamic Memory Controller Driver Library + * @{ + */ + +#if (DDL_DMC_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup EXMC_DMC_Local_Macros Dynamic Memory Controller Local Macros + * @{ + */ + +/** + * @defgroup EXMC_DMC_Check_Parameters_Validity EXMC DMC Check Parameters Validity + * @{ + */ + +#define IS_EXMC_DMC_MEM_WIDTH(x) \ +( (EXMC_DMC_MEMORY_WIDTH_16BIT == (x)) || \ + (EXMC_DMC_MEMORY_WIDTH_32BIT == (x))) + +#define IS_EXMC_DMC_CHIP(x) \ +( (EXMC_DMC_CHIP_0 == (x)) || \ + (EXMC_DMC_CHIP_1 == (x)) || \ + (EXMC_DMC_CHIP_2 == (x)) || \ + (EXMC_DMC_CHIP_3 == (x))) + +#define IS_EXMC_DMC_BANK(x) \ +( (EXMC_DMC_BANK_0 == (x)) || \ + (EXMC_DMC_BANK_1 == (x)) || \ + (EXMC_DMC_BANK_2 == (x)) || \ + (EXMC_DMC_BANK_3 == (x))) + +#define IS_EXMC_DMC_CMD(x) \ +( (EXMC_DMC_CMD_PRECHARGEALL == (x)) || \ + (EXMC_DMC_CMD_AUTOREFRESH == (x)) || \ + (EXMC_DMC_CMD_MDREGCONFIG == (x)) || \ + (EXMC_DMC_CMD_NOP == (x))) + +#define IS_EXMC_DMC_CS_DECODE_MODE(x) \ +( (EXMC_DMC_CS_DECODE_ROWBANKCOL == (x)) || \ + (EXMC_DMC_CS_DECODE_BANKROWCOL == (x))) + +#define IS_EXMC_DMC_COLUMN_BITS_NUM(x) \ +( (EXMC_DMC_COLUMN_BITS_NUM_8 == (x)) || \ + (EXMC_DMC_COLUMN_BITS_NUM_9 == (x)) || \ + (EXMC_DMC_COLUMN_BITS_NUM_10 == (x)) || \ + (EXMC_DMC_COLUMN_BITS_NUM_11 == (x)) || \ + (EXMC_DMC_COLUMN_BITS_NUM_12 == (x))) + +#define IS_EXMC_DMC_ROW_BITS_NUM(x) \ +( (EXMC_DMC_ROW_BITS_NUM_11 == (x)) || \ + (EXMC_DMC_ROW_BITS_NUM_12 == (x)) || \ + (EXMC_DMC_ROW_BITS_NUM_13 == (x)) || \ + (EXMC_DMC_ROW_BITS_NUM_14 == (x)) || \ + (EXMC_DMC_ROW_BITS_NUM_15 == (x)) || \ + (EXMC_DMC_ROW_BITS_NUM_16 == (x))) + +#define IS_EXMC_DMC_AUTO_PRECHARGE_PIN(x) \ +( (EXMC_DMC_AUTO_PRECHARGE_A8 == (x)) || \ + (EXMC_DMC_AUTO_PRECHARGE_A10 == (x))) + +#define IS_EXMC_DMC_CKE_OUTPUT_SEL(x) \ +( (EXMC_DMC_CKE_OUTPUT_ENABLE == (x)) || \ + (EXMC_DMC_CKE_OUTPUT_DISABLE == (x))) + +#define EXMC_DMC_MEMCLK_SEL(x) \ +( (EXMC_DMC_MEMCLK_NORMAL_OUTPUT == (x)) || \ + (EXMC_DMC_MEMCLK_NOP_STOP_OUTPUT == (x))) + +#define IS_EXMC_DMC_MEM_BURST(x) \ +( (EXMC_DMC_MEM_BURST_1 == (x)) || \ + (EXMC_DMC_MEM_BURST_2 == (x)) || \ + (EXMC_DMC_MEM_BURST_4 == (x)) || \ + (EXMC_DMC_MEM_BURST_8 == (x)) || \ + (EXMC_DMC_MEM_BURST_16 == (x))) + +#define IS_EXMC_DMC_AUTO_REFRESH_CHIPS(x) \ +( (EXMC_DMC_AUTO_REFRESH_CHIP_0 == (x)) || \ + (EXMC_DMC_AUTO_REFRESH_CHIPS_01 == (x)) || \ + (EXMC_DMC_AUTO_REFRESH_CHIPS_012 == (x)) || \ + (EXMC_DMC_AUTO_REFRESH_CHIPS_0123 == (x))) + +#define IS_EXMC_DMC_CS_ADDRESS_MASK(x) \ +( (EXMC_DMC_ADDR_MASK_16MB == (x)) || \ + (EXMC_DMC_ADDR_MASK_32MB == (x)) || \ + (EXMC_DMC_ADDR_MASK_64MB == (x)) || \ + (EXMC_DMC_ADDR_MASK_128MB == (x))) + +#define IS_EXMC_DMC_CS_ADDRESS_MATCH(x) \ +( (EXMC_DMC_ADDR_MATCH_0X80000000 == (x)) || \ + (EXMC_DMC_ADDR_MATCH_0X81000000 == (x)) || \ + (EXMC_DMC_ADDR_MATCH_0X82000000 == (x)) || \ + (EXMC_DMC_ADDR_MATCH_0X83000000 == (x)) || \ + (EXMC_DMC_ADDR_MATCH_0X84000000 == (x)) || \ + (EXMC_DMC_ADDR_MATCH_0X85000000 == (x)) || \ + (EXMC_DMC_ADDR_MATCH_0X86000000 == (x)) || \ + (EXMC_DMC_ADDR_MATCH_0X87000000 == (x))) + +#define IS_EXMC_DMC_ADDRESS(match, mask) \ +( (~((((mask) >> DMC_CSCR_ADDMSK_POS) ^ ((match) >> DMC_CSCR_ADDMAT_POS)) << 24UL)) <= 0x87FFFFFFUL) + +#define IS_EXMC_DMC_STATE(x) \ +( (EXMC_DMC_CTL_STATE_GO == (x)) || \ + (EXMC_DMC_CTL_STATE_SLEEP == (x)) || \ + (EXMC_DMC_CTL_STATE_WAKEUP == (x)) || \ + (EXMC_DMC_CTL_STATE_PAUSE == (x)) || \ + (EXMC_DMC_CTL_STATE_CONFIGURE == (x))) + +#define IS_EXMC_DMC_TIMING_CASL_CYCLE(x) ((x) <= 7UL) + +#define IS_EXMC_DMC_TIMING_DQSS_CYCLE(x) ((x) <= 3UL) + +#define IS_EXMC_DMC_TIMING_MRD_CYCLE(x) ((x) <= 0x7FUL) + +#define IS_EXMC_DMC_TIMING_RAS_CYCLE(x) ((x) <= 0x0FUL) + +#define IS_EXMC_DMC_TIMING_RC_CYCLE(x) ((x) <= 0x0FUL) + +#define IS_EXMC_DMC_TIMING_RCD_CYCLE(x) ((x) <= 7UL) + +#define IS_EXMC_DMC_TIMING_RFC_CYCLE(x) ((x) <= 0x1FUL) + +#define IS_EXMC_DMC_TIMING_RP_CYCLE(x) ((x) <= 7UL) + +#define IS_EXMC_DMC_TIMING_RRD_CYCLE(x) ((x) <= 0x0FUL) + +#define IS_EXMC_DMC_TIMING_WR_CYCLE(x) ((x) <= 7UL) + +#define IS_EXMC_DMC_TIMING_WTR_CYCLE(x) ((x) <= 7UL) + +#define IS_EXMC_DMC_TIMING_XP_CYCLE(x) ((x) <= 0xFFUL) + +#define IS_EXMC_DMC_TIMING_XSR_CYCLE(x) ((x) <= 0xFFUL) + +#define IS_EXMC_DMC_TIMING_ESR_CYCLE(x) ((x) <= 0xFFUL) + +#define IS_EXMC_DMC_CKE_DISABLE_PERIOD(x) ((x) <= 0x3FUL) + +#define IS_EXMC_DMC_CMDADD(x) ((x) <= 0x7FFFUL) + +#define IS_EXMC_DMC_REFRESH_PERIOD(x) ((x) <= 0x7FFFUL) + +/** + * @} + */ + +/** + * @defgroup EXMC_DMC_Register EXMC DMC Register + * @{ + */ +#define EXMC_DMC_CSCRx(__CHIPx__) ((__IO uint32_t *)(((uint32_t)(&M4_DMC->CSCR0)) + (4UL * (__CHIPx__)))) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup EXMC_DMC_Global_Functions Dynamic Memory Controller Global Functions + * @{ + */ + +/** + * @brief Initialize EXMC DMC function. + * @param [in] pstcInit Pointer to a @ref stc_exmc_dmc_init_t structure (EXMC DMC function configuration structure). + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: pstcInit = NULL + */ +en_result_t EXMC_DMC_Init(const stc_exmc_dmc_init_t *pstcInit) +{ + uint32_t u32RegVal; + en_result_t enRet = ErrorInvalidParameter; + + /* Check the pointer pstcInit */ + if (NULL != pstcInit) + { + /* Check parameters */ + DDL_ASSERT(IS_EXMC_DMC_MEM_WIDTH(pstcInit->u32DmcMemWidth)); + DDL_ASSERT(IS_EXMC_DMC_REFRESH_PERIOD(pstcInit->u32RefreshPeriod)); + DDL_ASSERT(IS_EXMC_DMC_COLUMN_BITS_NUM(pstcInit->stcChipCfg.u32ColumnBitsNumber)); + DDL_ASSERT(IS_EXMC_DMC_ROW_BITS_NUM(pstcInit->stcChipCfg.u32RowBitsNumber)); + DDL_ASSERT(IS_EXMC_DMC_AUTO_PRECHARGE_PIN(pstcInit->stcChipCfg.u32AutoPrechargePin)); + DDL_ASSERT(IS_EXMC_DMC_CKE_OUTPUT_SEL(pstcInit->stcChipCfg.u32CkeOutputSel)); + DDL_ASSERT(EXMC_DMC_MEMCLK_SEL(pstcInit->stcChipCfg.u32MemClkSel)); + DDL_ASSERT(IS_EXMC_DMC_CKE_DISABLE_PERIOD(pstcInit->stcChipCfg.u32CkeDisablePeriod)); + DDL_ASSERT(IS_EXMC_DMC_MEM_BURST(pstcInit->stcChipCfg.u32MemBurst)); + DDL_ASSERT(IS_EXMC_DMC_AUTO_REFRESH_CHIPS(pstcInit->stcChipCfg.u32AutoRefreshChips)); + DDL_ASSERT(IS_EXMC_DMC_TIMING_CASL_CYCLE(pstcInit->stcTimingCfg.u32CASL)); + DDL_ASSERT(IS_EXMC_DMC_TIMING_DQSS_CYCLE(pstcInit->stcTimingCfg.u32DQSS)); + DDL_ASSERT(IS_EXMC_DMC_TIMING_MRD_CYCLE(pstcInit->stcTimingCfg.u32MRD)); + DDL_ASSERT(IS_EXMC_DMC_TIMING_RAS_CYCLE(pstcInit->stcTimingCfg.u32RAS)); + DDL_ASSERT(IS_EXMC_DMC_TIMING_RC_CYCLE(pstcInit->stcTimingCfg.u32RC)); + DDL_ASSERT(IS_EXMC_DMC_TIMING_RCD_CYCLE(pstcInit->stcTimingCfg.u32RCD)); + DDL_ASSERT(IS_EXMC_DMC_TIMING_RFC_CYCLE(pstcInit->stcTimingCfg.u32RFC)); + DDL_ASSERT(IS_EXMC_DMC_TIMING_RP_CYCLE(pstcInit->stcTimingCfg.u32RP)); + DDL_ASSERT(IS_EXMC_DMC_TIMING_RRD_CYCLE(pstcInit->stcTimingCfg.u32RRD)); + DDL_ASSERT(IS_EXMC_DMC_TIMING_WR_CYCLE(pstcInit->stcTimingCfg.u32WR)); + DDL_ASSERT(IS_EXMC_DMC_TIMING_WTR_CYCLE(pstcInit->stcTimingCfg.u32WTR)); + DDL_ASSERT(IS_EXMC_DMC_TIMING_XP_CYCLE(pstcInit->stcTimingCfg.u32XP)); + DDL_ASSERT(IS_EXMC_DMC_TIMING_XSR_CYCLE(pstcInit->stcTimingCfg.u32XSR)); + DDL_ASSERT(IS_EXMC_DMC_TIMING_ESR_CYCLE(pstcInit->stcTimingCfg.u32ESR)); + + /* Set memrory width(16bit or 32bit) for DMC.*/ + MODIFY_REG32(M4_DMC->BACR, DMC_BACR_DMCMW, pstcInit->u32DmcMemWidth); + + /* set auto refresh period*/ + WRITE_REG32(M4_DMC->RFTR, pstcInit->u32RefreshPeriod); + + /* Set timing parameters for DMC.*/ + WRITE_REG32(M4_DMC->TMCR_T_CASL, pstcInit->stcTimingCfg.u32CASL); + WRITE_REG32(M4_DMC->TMCR_T_DQSS, pstcInit->stcTimingCfg.u32DQSS); + WRITE_REG32(M4_DMC->TMCR_T_MRD, pstcInit->stcTimingCfg.u32MRD); + WRITE_REG32(M4_DMC->TMCR_T_RAS, pstcInit->stcTimingCfg.u32RAS); + WRITE_REG32(M4_DMC->TMCR_T_RC, pstcInit->stcTimingCfg.u32RC); + WRITE_REG32(M4_DMC->TMCR_T_RRD, pstcInit->stcTimingCfg.u32RRD); + WRITE_REG32(M4_DMC->TMCR_T_WR, pstcInit->stcTimingCfg.u32WR); + WRITE_REG32(M4_DMC->TMCR_T_WTR, pstcInit->stcTimingCfg.u32WTR); + WRITE_REG32(M4_DMC->TMCR_T_XP, pstcInit->stcTimingCfg.u32XP); + WRITE_REG32(M4_DMC->TMCR_T_XSR, pstcInit->stcTimingCfg.u32XSR); + WRITE_REG32(M4_DMC->TMCR_T_ESR, pstcInit->stcTimingCfg.u32ESR); + MODIFY_REG32(M4_DMC->TMCR_T_RP, DMC_TMCR_T_RP_T_RP, pstcInit->stcTimingCfg.u32RP); + MODIFY_REG32(M4_DMC->TMCR_T_RCD, DMC_TMCR_T_RCD_T_RCD, pstcInit->stcTimingCfg.u32RCD); + MODIFY_REG32(M4_DMC->TMCR_T_RFC, DMC_TMCR_T_RFC_T_RFC, pstcInit->stcTimingCfg.u32RFC); + + /* Set base parameters for DMC: burst lenth, Rowbitwidth,ColbitWidth etc.*/ + u32RegVal = (pstcInit->stcChipCfg.u32ColumnBitsNumber | \ + pstcInit->stcChipCfg.u32RowBitsNumber | \ + pstcInit->stcChipCfg.u32AutoPrechargePin | \ + pstcInit->stcChipCfg.u32CkeOutputSel | \ + pstcInit->stcChipCfg.u32MemClkSel | \ + (pstcInit->stcChipCfg.u32CkeDisablePeriod << DMC_CPCR_CKEDISPRD_POS) | \ + pstcInit->stcChipCfg.u32MemBurst | \ + pstcInit->stcChipCfg.u32AutoRefreshChips); + WRITE_REG32(M4_DMC->CPCR, u32RegVal); + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief De-Initialize EXMC DMC function. + * @param None + * @retval None + */ +void EXMC_DMC_DeInit(void) +{ + /* Disable */ + WRITE_REG32(bM4_PERIC->EXMC_ENAR_b.DMCEN, 0UL); + + /* Configures the registers to reset value. */ + WRITE_REG32(M4_DMC->CPCR, 0x00020040UL); + + WRITE_REG32(M4_DMC->TMCR_T_CASL, 0x00000003UL); + WRITE_REG32(M4_DMC->TMCR_T_DQSS, 0x00000001UL); + WRITE_REG32(M4_DMC->TMCR_T_MRD, 0x00000002UL); + WRITE_REG32(M4_DMC->TMCR_T_RAS, 0x00000007UL); + WRITE_REG32(M4_DMC->TMCR_T_RC, 0x0000000BUL); + WRITE_REG32(M4_DMC->TMCR_T_RCD, 0x00000035UL); + WRITE_REG32(M4_DMC->TMCR_T_RFC, 0x00001012UL); + WRITE_REG32(M4_DMC->TMCR_T_RP, 0x00000035UL); + WRITE_REG32(M4_DMC->TMCR_T_RRD, 0x00000002UL); + WRITE_REG32(M4_DMC->TMCR_T_WR, 0x00000003UL); + WRITE_REG32(M4_DMC->TMCR_T_WTR, 0x00000002UL); + WRITE_REG32(M4_DMC->TMCR_T_XP, 0x00000001UL); + WRITE_REG32(M4_DMC->TMCR_T_XSR, 0x0000000AUL); + WRITE_REG32(M4_DMC->TMCR_T_ESR, 0x00000014UL); +} + +/** + * @brief Set the fields of structure stc_exmc_dmc_init_t to default values + * @param [out] pstcInit Pointer to a @ref stc_exmc_dmc_init_t structure (EXMC DMC function configuration structure) + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: pstcInit = NULL + */ +en_result_t EXMC_DMC_StructInit(stc_exmc_dmc_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (NULL != pstcInit) + { + pstcInit->u32DmcMemWidth = EXMC_DMC_MEMORY_WIDTH_16BIT; + pstcInit->u32RefreshPeriod = 0xA60UL; + pstcInit->stcChipCfg.u32ColumnBitsNumber = EXMC_DMC_COLUMN_BITS_NUM_8; + pstcInit->stcChipCfg.u32RowBitsNumber = EXMC_DMC_ROW_BITS_NUM_15; + pstcInit->stcChipCfg.u32AutoPrechargePin = EXMC_DMC_AUTO_PRECHARGE_A10; + pstcInit->stcChipCfg.u32CkeOutputSel = EXMC_DMC_CKE_OUTPUT_ENABLE; + pstcInit->stcChipCfg.u32MemClkSel = EXMC_DMC_MEMCLK_NORMAL_OUTPUT; + pstcInit->stcChipCfg.u32CkeDisablePeriod = 0UL; + pstcInit->stcChipCfg.u32MemBurst = EXMC_DMC_MEM_BURST_4; + pstcInit->stcChipCfg.u32AutoRefreshChips = EXMC_DMC_AUTO_REFRESH_CHIP_0; + + pstcInit->stcTimingCfg.u32CASL = 0x3UL; + pstcInit->stcTimingCfg.u32DQSS = 0x1UL; + pstcInit->stcTimingCfg.u32MRD = 0x02UL; + pstcInit->stcTimingCfg.u32RAS = 0x07UL; + pstcInit->stcTimingCfg.u32RC = 0x0BUL; + pstcInit->stcTimingCfg.u32RCD = 0x05UL; + pstcInit->stcTimingCfg.u32RFC = 0x12UL; + pstcInit->stcTimingCfg.u32RP = 0x05UL; + pstcInit->stcTimingCfg.u32RRD = 0x02UL; + pstcInit->stcTimingCfg.u32WR = 0x03UL; + pstcInit->stcTimingCfg.u32WTR = 0x02UL; + pstcInit->stcTimingCfg.u32XP = 0x01UL; + pstcInit->stcTimingCfg.u32XSR = 0x0AUL; + pstcInit->stcTimingCfg.u32ESR = 0x14UL; + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Enable/disable DMC. + * @param [in] enNewState An en_functional_state_t enumeration value. + * This parameter can be one of the following values: + * @arg Enable: Enable function. + * @arg Disable: Disable function. + * @retval None + */ +void EXMC_DMC_Cmd(en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + WRITE_REG32(bM4_PERIC->EXMC_ENAR_b.DMCEN, enNewState); +} + +/** + * @brief Configure EXMC DMC CS function. + * @param [in] u32Chip The command chip number. + * This parameter can be one of the following values: + * @arg EXMC_DMC_CHIP_0: Chip 0 + * @arg EXMC_DMC_CHIP_1: Chip 1 + * @arg EXMC_DMC_CHIP_2: Chip 2 + * @arg EXMC_DMC_CHIP_3: Chip 3 + * @param [in] pstcCfg Pointer to a @ref stc_exmc_dmc_cs_cfg_t structure (EXMC DMC CS function configuration structure). + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: pstcCfg = NULL + */ +en_result_t EXMC_DMC_CsConfig(uint32_t u32Chip, + const stc_exmc_dmc_cs_cfg_t *pstcCfg) +{ + uint32_t u32RegVal; + __IO uint32_t *DMC_CSCRx; + en_result_t enRet = ErrorInvalidParameter; + + /* Check the pointer pstcInit */ + if (NULL != pstcCfg) + { + /* Check parameters */ + DDL_ASSERT(IS_EXMC_DMC_CHIP(u32Chip)); + DDL_ASSERT(IS_EXMC_DMC_CS_ADDRESS_MASK(pstcCfg->u32AddrMask)); + DDL_ASSERT(IS_EXMC_DMC_CS_ADDRESS_MATCH(pstcCfg->u32AddrMatch)); + DDL_ASSERT(IS_EXMC_DMC_CS_DECODE_MODE(pstcCfg->u32AddrDecodeMode)); + DDL_ASSERT(IS_EXMC_DMC_ADDRESS(pstcCfg->u32AddrMatch, pstcCfg->u32AddrMask)); + + /* Set chip selection for DMC.*/ + DMC_CSCRx = EXMC_DMC_CSCRx(u32Chip); + u32RegVal = (pstcCfg->u32AddrMask | pstcCfg->u32AddrMatch | pstcCfg->u32AddrDecodeMode); + WRITE_REG32(*DMC_CSCRx, u32RegVal); + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Get the start address of the specified DMC chip. + * @param [in] u32Chip The chip number. + * This parameter can be one of the following values: + * @arg EXMC_DMC_CHIP_0: Chip 0 + * @arg EXMC_DMC_CHIP_1: Chip 1 + * @arg EXMC_DMC_CHIP_2: Chip 2 + * @arg EXMC_DMC_CHIP_3: Chip 3 + * @retval The start address of the specified DMC chip. + */ +uint32_t EXMC_DMC_ChipStartAddress(uint32_t u32Chip) +{ + __IO uint32_t *DMC_CSCRx; + + /* Check parameters */ + DDL_ASSERT(IS_EXMC_DMC_CHIP(u32Chip)); + + DMC_CSCRx = EXMC_DMC_CSCRx(u32Chip); + return (READ_REG32_BIT(*DMC_CSCRx, DMC_CSCR_ADDMAT) << 16UL); +} + +/** + * @brief Get the end address of the specified DMC chip. + * @param [in] u32Chip The chip number. + * This parameter can be one of the following values: + * @arg EXMC_DMC_CHIP_0: Chip 0 + * @arg EXMC_DMC_CHIP_1: Chip 1 + * @arg EXMC_DMC_CHIP_2: Chip 2 + * @arg EXMC_DMC_CHIP_3: Chip 3 + * @retval The end address of the specified DMC chip + */ +uint32_t EXMC_DMC_ChipEndAddress(uint32_t u32Chip) +{ + uint32_t u32Mask; + uint32_t u32Match; + __IO uint32_t *DMC_CSCRx; + + /* Check parameters */ + DDL_ASSERT(IS_EXMC_DMC_CHIP(u32Chip)); + + DMC_CSCRx = EXMC_DMC_CSCRx(u32Chip); + u32Mask = (READ_REG32_BIT(*DMC_CSCRx, DMC_CSCR_ADDMSK) >> DMC_CSCR_ADDMSK_POS); + u32Match = (READ_REG32_BIT(*DMC_CSCRx, DMC_CSCR_ADDMAT) >> DMC_CSCR_ADDMAT_POS); + + return (~((u32Match ^ u32Mask) << 24UL)); +} + +/** + * @brief Set EXMC SMC command. + * @param [in] u32Chip The command chip number. + * This parameter can be one of the following values: + * @arg EXMC_DMC_CHIP_0: Chip 0 + * @arg EXMC_DMC_CHIP_1: Chip 1 + * @arg EXMC_DMC_CHIP_2: Chip 2 + * @arg EXMC_DMC_CHIP_3: Chip 3 + * @param [in] u32Bank The command bank. + * This parameter can be one of the following values: + * @arg EXMC_DMC_BANK_0: Bank 0 + * @arg EXMC_DMC_BANK_1: Bank 1 + * @arg EXMC_DMC_BANK_2: Bank 2 + * @arg EXMC_DMC_BANK_3: Bank 3 + * @param [in] u32Cmd The command. + * This parameter can be one of the following values: + * @arg EXMC_DMC_CMD_PRECHARGEALL:Precharge all + * @arg EXMC_DMC_CMD_AUTOREFRESH: Auto refresh + * @arg EXMC_DMC_CMD_MDREGCONFIG: Set memory device mode register + * @arg EXMC_DMC_CMD_NOP: NOP + * @param [in] u32Address The address parameter for CMD MdRegConfig only. + * This parameter can be a value between Min_Data = 0 and Max_Data = 0x7FFFUL + * @retval An en_result_t enumeration value: + * - Ok: Command success + */ +en_result_t EXMC_DMC_SetCommand(uint32_t u32Chip, + uint32_t u32Bank, + uint32_t u32Cmd, + uint32_t u32Address) +{ + uint32_t u32DmcCmdr; + + /* Check parameters */ + DDL_ASSERT(IS_EXMC_DMC_CHIP(u32Chip)); + DDL_ASSERT(IS_EXMC_DMC_BANK(u32Bank)); + DDL_ASSERT(IS_EXMC_DMC_CMD(u32Cmd)); + DDL_ASSERT(IS_EXMC_DMC_CMDADD(u32Address)); + + /* Set DMC_CMDR register for DMC.*/ + u32DmcCmdr = (u32Address | \ + (u32Bank << DMC_CMDR_CMDBA_POS) | \ + u32Cmd | \ + (u32Chip << DMC_CMDR_CMDCHIP_POS)); + WRITE_REG32(M4_DMC->CMDR, u32DmcCmdr); + + return Ok; +} + +/** + * @brief Set EXMC DMC state. + * @param [in] u32State The command chip number. + * @arg EXMC_DMC_CTL_STATE_GO: Go + * @arg EXMC_DMC_CTL_STATE_SLEEP: Sleep for low power + * @arg EXMC_DMC_CTL_STATE_WAKEUP: Wake up + * @arg EXMC_DMC_CTL_STATE_PAUSE: Pause + * @arg EXMC_DMC_CTL_STATE_CONFIGURE: Configure + * @retval None + */ +void EXMC_DMC_SetState(uint32_t u32State) +{ + DDL_ASSERT(IS_EXMC_DMC_STATE(u32State)); + + WRITE_REG32(M4_DMC->STCR, u32State); +} + +/** + * @} + */ + +#endif /* DDL_DMC_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_dvp.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_dvp.c new file mode 100644 index 0000000000..d40516d8c4 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_dvp.c @@ -0,0 +1,484 @@ +/** + ******************************************************************************* + * @file hc32f4a0_dvp.c + * @brief This file provides firmware functions to manage the DVP(Digital Video + * Processor) driver library. + @verbatim + Change Logs: + Date Author Notes + 2020-08-20 Hongjh First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_dvp.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_DVP DVP + * @brief Digital Video Processor Driver Library + * @{ + */ + +#if (DDL_DVP_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup DVP_Local_Macros DVP Local Macros + * @{ + */ + +/** + * @defgroup DVP_Check_Parameters_Validity DVP Check Parameters Validity + * @{ + */ + +#define IS_DVP_CAPT_MD(x) \ +( ((x) == DVP_CAPT_MD_CONTINUOS_FRAME) || \ + ((x) == DVP_CAPT_MD_SINGLE_FRAME)) + +#define IS_DVP_SYNC_MD(x) \ +( ((x) == DVP_SYNC_MD_HW) || \ + ((x) == DVP_SYNC_MD_SW)) + +#define IS_DVP_PIXCLK_POLARITY(x) \ +( ((x) == DVP_PIXCLK_RISING) || \ + ((x) == DVP_PIXCLK_FALLING)) + +#define IS_DVP_HSYNC_POLARITY(x) \ +( ((x) == DVP_HSYNC_LOW) || \ + ((x) == DVP_HSYNC_HIGH)) + +#define IS_DVP_VSYNC_POLARITY(x) \ +( ((x) == DVP_VSYNC_LOW) || \ + ((x) == DVP_VSYNC_HIGH)) + +#define IS_DVP_CAPT_FREQ(x) \ +( ((x) == DVP_CAPT_FREQ_ALL_FRAME) || \ + ((x) == DVP_CAPT_FREQ_ONT_TIME_2FRAME) || \ + ((x) == DVP_CAPT_FREQ_ONT_TIME_4FRAME)) + +#define IS_DVP_DATA_WIDTH(x) \ +( ((x) == DVP_DATA_WIDTH_8BIT) || \ + ((x) == DVP_DATA_WIDTH_10BIT) || \ + ((x) == DVP_DATA_WIDTH_12BIT) || \ + ((x) == DVP_DATA_WIDTH_14BIT)) + +#define IS_DVP_FLAG(x) \ +( ((x) != 0UL) || \ + (((x) | DVP_FLAG_ALL) == DVP_FLAG_ALL)) + +#define IS_DVP_INT(x) \ +( ((x) != 0UL) || \ + (((x) | DVP_INT_ALL) == DVP_INT_ALL)) + +#define IS_DVP_CROP_WIN_X(x) ((x) <= 0x3FFFUL) + +#define IS_DVP_CROP_WIN_Y(x) ((x) <= 0x3FFFUL) + +#define IS_DVP_CROP_WIN_XSIZE(x) ((x) <= 0x3FFFUL) + +#define IS_DVP_CROP_WIN_YSIZE(x) ((x) <= 0x3FFFUL) + +#define IS_DVP_SYNC_CODE(x) ((x) <= 0xFFUL) + +#define IS_DVP_MASK_CODE(x) ((x) <= 0xFFUL) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup DVP_Global_Functions DVP Global Functions + * @{ + */ + +/** + * @brief Initialize DVP function. + * @param [in] pstcDvpInit Pointer to a @ref stc_dvp_init_t structure. + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: The parameter pstcDvpInit is NULL + */ +en_result_t DVP_Init(const stc_dvp_init_t *pstcDvpInit) +{ + uint32_t u32RegValue; + en_result_t enRet = ErrorInvalidParameter; + + if (NULL != pstcDvpInit) + { + /* Check parameters */ + DDL_ASSERT(IS_DVP_SYNC_MD(pstcDvpInit->u32SyncMode)); + DDL_ASSERT(IS_DVP_DATA_WIDTH(pstcDvpInit->u32DataWidth)); + DDL_ASSERT(IS_DVP_CAPT_MD(pstcDvpInit->u32CaptureMode)); + DDL_ASSERT(IS_DVP_CAPT_FREQ(pstcDvpInit->u32CaptureFreq)); + DDL_ASSERT(IS_DVP_PIXCLK_POLARITY(pstcDvpInit->u32PIXCLKPolarity)); + DDL_ASSERT(IS_DVP_HSYNC_POLARITY(pstcDvpInit->u32HSYNCPolarity)); + DDL_ASSERT(IS_DVP_VSYNC_POLARITY(pstcDvpInit->u32VSYNCPolarity)); + + /* De-init DVP*/ + WRITE_REG32(M4_DVP->CTR, 0UL); + WRITE_REG32(M4_DVP->STR, 0UL); + WRITE_REG32(M4_DVP->IER, 0UL); + WRITE_REG32(M4_DVP->SSYNDR, 0UL); + WRITE_REG32(M4_DVP->SSYNMR, 0xFFFFFFFFUL); + WRITE_REG32(M4_DVP->CPSFTR, 0UL); + WRITE_REG32(M4_DVP->CPSZER, 0UL); + + u32RegValue = (pstcDvpInit->u32SyncMode | \ + pstcDvpInit->u32DataWidth | \ + pstcDvpInit->u32CaptureMode | \ + pstcDvpInit->u32CaptureFreq | \ + pstcDvpInit->u32PIXCLKPolarity | \ + pstcDvpInit->u32HSYNCPolarity | \ + pstcDvpInit->u32VSYNCPolarity); + + /* Configure DVP */ + WRITE_REG32(M4_DVP->CTR, u32RegValue); + enRet = Ok; + } + + return enRet; +} + +/** + * @brief De-Initialize DVP function. + * @param None + * @retval None + */ +void DVP_DeInit(void) +{ + WRITE_REG32(M4_DVP->CTR, 0UL); + WRITE_REG32(M4_DVP->STR, 0UL); + WRITE_REG32(M4_DVP->IER, 0UL); + WRITE_REG32(M4_DVP->SSYNDR, 0UL); + WRITE_REG32(M4_DVP->SSYNMR, 0xFFFFFFFFUL); + WRITE_REG32(M4_DVP->CPSFTR, 0UL); + WRITE_REG32(M4_DVP->CPSZER, 0UL); +} + +/** + * @brief Set the fields of structure stc_dvp_init_t to default values + * @param [out] pstcDvpInit Pointer to a @ref stc_dvp_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: The parameter pstcDvpInit is NULL + */ +en_result_t DVP_StructInit(stc_dvp_init_t *pstcDvpInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (NULL != pstcDvpInit) + { + pstcDvpInit->u32SyncMode = DVP_SYNC_MD_HW; + pstcDvpInit->u32DataWidth = DVP_DATA_WIDTH_8BIT; + pstcDvpInit->u32CaptureMode = DVP_CAPT_MD_CONTINUOS_FRAME; + pstcDvpInit->u32CaptureFreq = DVP_CAPT_FREQ_ALL_FRAME; + pstcDvpInit->u32PIXCLKPolarity = DVP_PIXCLK_FALLING; + pstcDvpInit->u32HSYNCPolarity = DVP_HSYNC_LOW; + pstcDvpInit->u32VSYNCPolarity = DVP_VSYNC_LOW; + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Enable/disable DVP. + * @param [in] enNewState An en_functional_state_t enumeration value. + * This parameter can be one of the following values: + * @arg Enable: Enable function. + * @arg Disable: Disable function. + * @retval None + */ +void DVP_Cmd(en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + WRITE_REG32(bM4_DVP->CTR_b.DVPEN, enNewState); +} + +/** + * @brief Enable/disable the specified DVP interrupt. + * @param [in] u32IntType DVP interrupt type + * This parameter can be any composed value of the following values: + * @arg DVP_INT_FRAME_START: Frame start interrupt + * @arg DVP_INT_LINE_START: Line start interrupt + * @arg DVP_INT_LINE_END: Line end interrupt + * @arg DVP_INT_FRAME_END: Frame end interrupt + * @arg DVP_INT_FIFO_OVF: FIFO overflow error interrupt + * @arg DVP_INT_SYNC_ERR: Sync error interrupt + * @param [in] enNewState An en_functional_state_t enumeration value. + * This parameter can be one of the following values: + * @arg Enable: Enable function. + * @arg Disable: Disable function. + * @retval None + */ +void DVP_IntCmd(uint32_t u32IntType, en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_DVP_INT(u32IntType)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(M4_DVP->IER, u32IntType); + } + else + { + CLEAR_REG32_BIT(M4_DVP->IER, u32IntType); + } +} + +/** + * @brief Enable/disable DVP crop. + * @param [in] enNewState An en_functional_state_t enumeration value. + * This parameter can be one of the following values: + * @arg Enable: Enable function. + * @arg Disable: Disable function. + * @retval None + */ +void DVP_CropCmd(en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + WRITE_REG32(bM4_DVP->CTR_b.CROPEN, enNewState); +} + +/** + * @brief Enable/disable DVP JPEG format. + * @param [in] enNewState An en_functional_state_t enumeration value. + * This parameter can be one of the following values: + * @arg Enable: Enable function. + * @arg Disable: Disable function. + * @retval None + */ +void DVP_JPEGCmd(en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + WRITE_REG32(bM4_DVP->CTR_b.JPEGEN, enNewState); +} + +/** + * @brief Enable/disable DVP capture. + * @param [in] enNewState An en_functional_state_t enumeration value. + * This parameter can be one of the following values: + * @arg Enable: Enable function. + * @arg Disable: Disable function. + * @retval None + */ +void DVP_CaptrueCmd(en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + WRITE_REG32(bM4_DVP->CTR_b.CAPEN, enNewState); +} + +/** + * @brief Get DVP capture function state. + * @param None + * @retval An en_flag_status_t enumeration value: + * - Enable: Capture function is enabled. + * - Disable: Capture function is disabled. + */ +en_functional_state_t DVP_GetCaptrueCmdState(void) +{ + return ((0UL == READ_REG32(bM4_DVP->CTR_b.CAPEN)) ? Disable : Enable); +} + +/** + * @brief Get the specified DVP flag status. + * @param [in] u32Flag DVP flag + * This parameter can be any composed value of the following values: + * @arg DVP_FLAG_FRAME_START: Frame start flag + * @arg DVP_FLAG_LINE_START: Line start flag + * @arg DVP_FLAG_LINE_END: Line end flag + * @arg DVP_FLAG_FRAME_END: Frame end flag + * @arg DVP_FLAG_FIFO_OVF: FIFO overflow error flag + * @arg DVP_FLAG_SYNC_ERR: Sync error interrupt + * @retval An en_flag_status_t enumeration value: + * - Set: Any bit of the composed flag is set. + * - Reset: All bit of the composed flag is reset. + */ +en_flag_status_t DVP_GetStatus(uint32_t u32Flag) +{ + /* Check parameters */ + DDL_ASSERT(IS_DVP_FLAG(u32Flag)); + + return ((READ_REG32_BIT(M4_DVP->STR, u32Flag) == 0UL) ? Reset : Set); +} + +/** + * @brief Clear the specified DVP flag status. + * @param [in] u32Flag DVP flag + * This parameter can be any composed value of the following values: + * @arg DVP_FLAG_FRAME_START: Frame start flag + * @arg DVP_FLAG_LINE_START: Line start flag + * @arg DVP_FLAG_LINE_END: Line end flag + * @arg DVP_FLAG_FRAME_END: Frame end flag + * @arg DVP_FLAG_FIFO_OVF: FIFO overflow error flag + * @arg DVP_FLAG_SYNC_ERR: Sync error interrupt + * @retval None + */ +void DVP_ClearStatus(uint32_t u32Flag) +{ + /* Check parameters */ + DDL_ASSERT(IS_DVP_FLAG(u32Flag)); + + CLEAR_REG32_BIT(M4_DVP->STR, u32Flag); +} + +/** + * @brief Set DVP software sync code. + * @param [in] pstcSyncCode Pointer to a @ref stc_dvp_sw_sync_code_t structure. + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: The parameter pstcSyncCode is NULL + */ +en_result_t DVP_SetSWSyncCode(const stc_dvp_sw_sync_code_t *pstcSyncCode) +{ + uint32_t u32RegValue; + en_result_t enRet = ErrorInvalidParameter; + + if (NULL != pstcSyncCode) + { + /* Check parameters */ + DDL_ASSERT(IS_DVP_SYNC_CODE(pstcSyncCode->u32FrameStartSyncCode)); + DDL_ASSERT(IS_DVP_SYNC_CODE(pstcSyncCode->u32LineStartSyncCode)); + DDL_ASSERT(IS_DVP_SYNC_CODE(pstcSyncCode->u32LineEndSyncCode)); + DDL_ASSERT(IS_DVP_SYNC_CODE(pstcSyncCode->u32FrameEndSyncCode)); + + /* Set sync code. */ + u32RegValue = ((pstcSyncCode->u32FrameStartSyncCode << DVP_SSYNDR_FSDAT_POS) | \ + (pstcSyncCode->u32LineStartSyncCode << DVP_SSYNDR_LSDAT_POS) | \ + (pstcSyncCode->u32LineEndSyncCode << DVP_SSYNDR_LEDAT_POS) | \ + (pstcSyncCode->u32FrameEndSyncCode << DVP_SSYNDR_FEDAT_POS)); + WRITE_REG32(M4_DVP->SSYNDR, u32RegValue); + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set DVP software sync mask code. + * @param [in] pstcMaskCode Pointer to a @ref stc_dvp_sw_mask_code_t structure. + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: The parameter pstcMaskCode is NULL + */ +en_result_t DVP_SetSWMaskCode(const stc_dvp_sw_mask_code_t *pstcMaskCode) +{ + uint32_t u32RegValue; + en_result_t enRet = ErrorInvalidParameter; + + if (NULL != pstcMaskCode) + { + /* Check parameters */ + DDL_ASSERT(IS_DVP_MASK_CODE(pstcMaskCode->u32FrameStartMaskCode)); + DDL_ASSERT(IS_DVP_MASK_CODE(pstcMaskCode->u32LineStartMaskCode)); + DDL_ASSERT(IS_DVP_MASK_CODE(pstcMaskCode->u32LineEndMaskCode)); + DDL_ASSERT(IS_DVP_MASK_CODE(pstcMaskCode->u32FrameEndMaskCode)); + + /* Set sync code. */ + u32RegValue = ((pstcMaskCode->u32FrameStartMaskCode << DVP_SSYNMR_FSMSK_POS) | \ + (pstcMaskCode->u32LineStartMaskCode << DVP_SSYNMR_LSMSK_POS) | \ + (pstcMaskCode->u32LineEndMaskCode << DVP_SSYNMR_LEMSK_POS) | \ + (pstcMaskCode->u32FrameEndMaskCode << DVP_SSYNMR_FEMSK_POS)); + WRITE_REG32(M4_DVP->SSYNMR, u32RegValue); + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set DVP software sync mask code. + * @param [in] pstcConfig Pointer to a @ref stc_dvp_crop_window_config_t structure. + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: The parameter pstcConfig is NULL + */ +en_result_t DVP_CropWindowConfig(const stc_dvp_crop_window_config_t *pstcConfig) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (NULL != pstcConfig) + { + /* Check parameters */ + DDL_ASSERT(IS_DVP_CROP_WIN_X(pstcConfig->u32X)); + DDL_ASSERT(IS_DVP_CROP_WIN_Y(pstcConfig->u32Y)); + DDL_ASSERT(IS_DVP_CROP_WIN_XSIZE(pstcConfig->u32XSize)); + DDL_ASSERT(IS_DVP_CROP_WIN_YSIZE(pstcConfig->u32YSize)); + + /* Configure crop window */ + WRITE_REG32(M4_DVP->CPSFTR, (pstcConfig->u32X | (pstcConfig->u32Y << DVP_CPSFTR_CSHIFT_POS))); + WRITE_REG32(M4_DVP->CPSZER, (pstcConfig->u32XSize | (pstcConfig->u32YSize << DVP_CPSZER_CSIZE_POS))); + enRet = Ok; + } + + return enRet; +} + +/** + * @} + */ + +#endif /* DDL_DVP_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_efm.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_efm.c new file mode 100644 index 0000000000..444407e41c --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_efm.c @@ -0,0 +1,1329 @@ +/** + ******************************************************************************* + * @file hc32f4a0_efm.c + * @brief This file provides firmware functions to manage the Embedded Flash + * Memory unit (EFM). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Heqb First version + 2020-07-03 Heqb Add flag judgment when operate SWAP + 2020-07-07 Heqb Add flag judgment for EFM_SetOperateMode function + 2020-08-11 Heqb 1.Refine function EFM_SequenceProgram() + 2.Typo + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_efm.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_EFM EFM + * @brief Embedded Flash Management Driver Library + * @{ + */ + +#if (DDL_EFM_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup EFM_Local_Macros EFM Local Macros + * @{ + */ +#define SECTOR_SIZE (0x2000UL) +#define REG_LENGTH (32U) +#define OTP_LOCK_ADDR_START (0x03001800UL) +#define OTP_LOCK_ADDR_END (0x03001AD7UL) +#define OTP_ENABLE_ADDR (0x03001AD8UL) +#define EFM_PGM_TIMEOUT (HCLK_VALUE / 20000UL) /* EFM Program timeout */ +#define EFM_ERASE_TIMEOUT (HCLK_VALUE / 20UL) /* EFM Erase timeout */ +#define EFM_SEQ_PGM_TIMEOUT (HCLK_VALUE / 2000000UL) /* EFM Sequence Program timeout */ +/** + * @defgroup EFM_Configuration_Bit_Mask EFM Configuration Bit Mask + * @{ + */ +#define EFM_CLR_FLAG_MASK (EFM_FLAG_CLR_OTPWERR0 | EFM_FLAG_CLR_PRTWERR0 | EFM_FLAG_CLR_PGSZERR0 | \ + EFM_FLAG_CLR_MISMTCH0 | EFM_FLAG_CLR_OPTEND0 | EFM_FLAG_CLR_CLOLERR0 | \ + EFM_FLAG_CLR_PRTWERR1 | EFM_FLAG_CLR_PGSZERR1 | EFM_FLAG_CLR_MISMTCH1 | \ + EFM_FLAG_CLR_OPTEND1 | EFM_FLAG_CLR_CLOLERR1) + +#define EFM_CACHE_MASK (EFM_FRMC_CRST | EFM_FRMC_PREFE | EFM_FRMC_DCACHE | EFM_FRMC_ICACHE) + +#define EFM_FLAG_MASK (EFM_FLAG_OTPWERR0 | EFM_FLAG_PRTWERR0 | EFM_FLAG_PGSZERR0 | \ + EFM_FLAG_MISMTCH0 | EFM_FLAG_OPTEND0 | EFM_FLAG_CLOLERR0 | \ + EFM_FLAG_PRTWERR1 | EFM_FLAG_PGSZERR1 | EFM_FLAG_MISMTCH1 | \ + EFM_FLAG_OPTEND1 | EFM_FLAG_CLOLERR1 | EFM_FLAG_RDY0 | EFM_FLAG_RDY1) + +/** + * @} + */ + +/** + * @defgroup EFM_Check_Parameters_Validity EFM Check Parameters Validity + * @{ + */ + +/*! Parameter validity check for flash latency. */ +#define IS_VALID_EFM_WAIT_CYCLE(x) ((x) <= EFM_WAIT_CYCLE_15) + +/*! Parameter validity check for operate mode. */ +#define IS_VALID_EFM_OPERATE_MD(x) \ +( ((x) == EFM_MODE_PROGRAMSINGLE) || \ + ((x) == EFM_MODE_PROGRAMREADBACK) || \ + ((x) == EFM_MODE_PROGRAMSEQUENCE) || \ + ((x) == EFM_MODE_ERASESECTOR) || \ + ((x) == EFM_MODE_ERASECHIP1) || \ + ((x) == EFM_MODE_ERASEFULL) || \ + ((x) == EFM_MODE_READONLY)) + +/*! Parameter validity check for flash interrupt select. */ +#define IS_VALID_EFM_INT_SEL(x) (((x) | EFM_INT_MASK) == EFM_INT_MASK) + +/*! Parameter validity check for flash flag. */ +#define IS_VALID_EFM_FLAG(x) (((x) | EFM_FLAG_MASK) == EFM_FLAG_MASK) + +/*! Parameter validity check for flash clear flag. */ +#define IS_VALID_EFM_CLRFLAG(x) (((x) | EFM_CLR_FLAG_MASK) == EFM_CLR_FLAG_MASK) + +/*! Parameter validity check for bus status while flash program or erase. */ +#define IS_VALID_EFM_BUS_STATUS(x) \ +( ((x) == EFM_BUS_BUSY) || \ + ((x) == EFM_BUS_RELEASE)) + +/*! Parameter validity check for efm data cache reset function. */ +#define IS_VALID_EFM_CACHERST_FUNC(x) \ +( ((x) == EFM_CACHERST_ON) || \ + ((x) == EFM_CACHERST_OFF)) + +/*! Parameter validity check for efm prefetch function. */ +#define IS_VALID_EFM_PREFETCH_FUNC(x) \ +( ((x) == EFM_PREFETCH_ON) || \ + ((x) == EFM_PREFETCH_OFF)) + +/*! Parameter validity check for efm data cache function. */ +#define IS_VALID_EFM_DCHEEN_FUNC(x) \ +( ((x) == EFM_DATACACHE_ON) || \ + ((x) == EFM_DATACACHE_OFF)) + +/*! Parameter validity check for efm instruction cache function. */ +#define IS_VALID_EFM_ICHEEN_FUNC(x) \ +( ((x) == EFM_INSCACHE_ON) || \ + ((x) == EFM_INSCACHE_OFF)) + +/*! Parameter validity check for efm status. */ +#define IS_VALID_EFM_STATUS(x) \ +( ((x) == EFM_FLASH0_ACT_FLASH1_ACT) || \ + ((x) == EFM_FLASH0_STP_FLASH1_ACT) || \ + ((x) == EFM_FLASH0_ACT_FLASH1_STP) || \ + ((x) == EFM_FLASH0_STP_FLASH1_STP)) + +/*! Parameter validity check for efm address. */ +#define IS_VALID_EFM_ADDR(x) \ +( ((x) <= EFM_END_ADDR) || \ + (((x) >= EFM_OTP_BLOCK16) && ((x) <= EFM_OTP_BLOCK181))) + +/*! Parameter validity check for efm chip erase address. */ +#define IS_VALID_EFM_CHIP_ERASE_ADDR(x) ((x) <= EFM_END_ADDR) + +/*! Parameter validity check for sector protected register locking. */ +#define IS_VALID_EFM_REG_LOCK(x) ((x) <= 0xFFU) + +/*! Parameter validity check for efm protect register . */ +#define IS_VALID_EFM_PRTREG(x) \ +( ((x) == EFM_PROTECT_FWMC) || \ + ((x) == EFM_PROTECT_OTP)) + +/*! Parameter validity check for efm chip . */ +#define IS_VALID_EFM_CHIP(x) (((x) | EFM_FLASH0_STP_FLASH1_STP) == EFM_FLASH0_STP_FLASH1_STP) + +/*! Parameter validity check for efm read mode . */ +#define IS_VALID_EFM_LVREAD_MODE(x) \ +( ((x) == EFM_LOWVOLREAD_ON) || \ + ((x) == EFM_LOWVOLREAD_OFF)) + +/*! Parameter validity check for efm erase mode . */ +#define IS_VALID_EFM_ERASE_MODE(x) \ +( ((x) == EFM_MODE_ERASECHIP1) || \ + ((x) == EFM_MODE_ERASEFULL)) + +/*! Parameter validity check for efm address alignment . */ +#define IS_VALID_EFM_ADDR_ALIGNMENT(x) (((x) | 0xFFFFFFFCUL) == 0xFFFFFFFCUL) + +/*! Parameter validity check for efm sector . */ +#define IS_VALID_EFM_SECTOR(x) ((x) <= EFM_SECTOR_255) + +/*! Parameter validity check for EFM lock status. */ +#define IS_VALID_EFM_UNLOCK() (M4_EFM->FAPRT == 0x00000001UL) + +/*! Parameter validity check for EFM_FWMC register lock status. */ +#define IS_VALID_EFM_FWMC_UNLOCK() (bM4_EFM->FWMC_b.KEY1LOCK == 0U) + +/*! Parameter validity check for OTP lock status. */ +#define IS_VALID_EFM_OTP_UNLOCK() (bM4_EFM->FWMC_b.KEY2LOCK == 0U) + +/*! Parameter validity check for EFM sector number */ +#define IS_VALID_EFM_SECTOR_NUM(x) ((x) <= 256U) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup EFM_Global_Functions EFM Global Functions + * @{ + */ + +/** + * @brief EFM_FWMC register unlock. + * @param None + * @retval None + * @note Call EFM_Unlock() unlock EFM register first. + */ +void EFM_FWMC_Unlock(void) +{ + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + + WRITE_REG32(M4_EFM->KEY1, 0x01234567UL); + WRITE_REG32(M4_EFM->KEY1, 0xFEDCBA98UL); +} + +/** + * @brief EFM_FWMC register lock. + * @param None + * @retval None + * @note Call EFM_Unlock() and EFM_FWMC_Unlock() unlock EFM_FWMC register first. + */ +void EFM_FWMC_Lock(void) +{ + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + DDL_ASSERT(IS_VALID_EFM_FWMC_UNLOCK()); + + SET_REG32_BIT(M4_EFM->FWMC, EFM_FWMC_KEY1LOCK); +} + +/** + * @brief EFM OTP operate unlock. + * @param None + * @retval None + * @note Call EFM_Unlock() unlock EFM register first. + */ +void EFM_OTP_WP_Unlock(void) +{ + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + + WRITE_REG32(M4_EFM->KEY2, 0x10325476UL); + WRITE_REG32(M4_EFM->KEY2, 0xEFCDAB89UL); +} + +/** + * @brief EFM OTP write protect lock. + * @param None + * @retval None + * @note Call EFM_Unlock() and EFM_FWMC_Unlock() unlock OTP write protect first. + */ +void EFM_OTP_WP_Lock(void) +{ + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + DDL_ASSERT(IS_VALID_EFM_FWMC_UNLOCK()); + + SET_REG32_BIT(M4_EFM->FWMC, EFM_FWMC_KEY2LOCK); +} + +/** + * @brief Enable or disable EFM. + * @param [in] u32EfmStatus Specifies the flash Chip. + * @arg EFM_FLASH0_ACT_FLASH1_ACT: Flash 0 and 1 activity 0 + * @arg EFM_FLASH0_STP_FLASH1_ACT: Flash 0 stop,Flash 1 activity + * @arg EFM_FLASH0_ACT_FLASH1_STP: Flash 0 activity,Flash 1 stop + * @arg EFM_FLASH0_STP_FLASH1_STP: Flash 0 and 1 stop + * @retval None + * @note Call EFM_Unlock() unlock EFM register first. + */ +void EFM_Cmd(uint32_t u32EfmStatus) +{ + DDL_ASSERT(IS_VALID_EFM_STATUS(u32EfmStatus)); + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + WRITE_REG32(M4_EFM->FSTP, u32EfmStatus); +} + +/** + * @brief Init efm config structure with default value. + * @param [in] pstcEfmCfg The pointer of efm config structure. + * @arg u32WaitCycle: Specifies the efm read wait cycles. + * @arg u32Prefetch: Specifies the prefetch on or off. + * @arg u32CacheRst: Specifies the data cache reset on or off. + * @arg u32InsCache: Specifies the instruction cache on or off. + * @arg u32DataCache: Specifies the data cache on or off. + * @arg u32LowVolRead: Specifies the read of low-voltage mode on or off. + * @arg u32BusStatus: Specifies the bus status busy or release while program & erase. + * @arg u32OperateMode: Specifies the operate mode. + * @arg u32FlashStatus: Specifies the Flash status. + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: Invalid parameter + */ +en_result_t EFM_StructInit(stc_efm_cfg_t *pstcEfmCfg) +{ + en_result_t enRet = Ok; + + /* Check if pointer is NULL */ + if (NULL == pstcEfmCfg) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Configure to default value */ + pstcEfmCfg->u32WaitCycle = EFM_WAIT_CYCLE_0; + pstcEfmCfg->u32Prefetch = EFM_PREFETCH_OFF; + pstcEfmCfg->u32CacheRst = EFM_CACHERST_OFF; + pstcEfmCfg->u32InsCache = EFM_INSCACHE_OFF; + pstcEfmCfg->u32DataCache = EFM_DATACACHE_OFF; + pstcEfmCfg->u32LowVolRead = EFM_LOWVOLREAD_OFF; + pstcEfmCfg->u32BusStatus = EFM_BUS_BUSY; + pstcEfmCfg->u32OperateMode = EFM_MODE_READONLY; + pstcEfmCfg->u32FlashStatus = EFM_FLASH0_ACT_FLASH1_ACT; + } + + return enRet; +} + + +/** + * @brief Efm initialize. + * @param [in] pstcEfmCfg The pointer of efm config structure. + * @arg u32WaitCycle: Specifies the efm read wait cycles. + * @arg u32Prefetch: Specifies the prefetch on or off. + * @arg u32CacheRst: Specifies the data cache reset on or off. + * @arg u32InsCache: Specifies the instruction cache on or off. + * @arg u32DataCache: Specifies the data cache on or off. + * @arg u32LowVolRead: Specifies the read of low-voltage mode on or off. + * @arg u32BusStatus: Specifies the bus status busy or release while program & erase. + * @arg u32OperateMode: Specifies the operate mode. + * @arg u32FlashStatus: Specifies the Flash status. + * @retval An en_result_t enumeration value: + * - Ok: Configure success + * - ErrorInvalidParameter: Invalid parameter + * @note Call EFM_Unlock() and EFM_FWMC_Unlock() unlock EFM_FWMC register first. + */ +en_result_t EFM_Init(const stc_efm_cfg_t *pstcEfmCfg) +{ + en_result_t enRet = Ok; + uint32_t u32Temp; + /* Check if pointer is NULL */ + if (NULL == pstcEfmCfg) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Param valid check */ + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + DDL_ASSERT(IS_VALID_EFM_FWMC_UNLOCK()); + DDL_ASSERT(IS_VALID_EFM_WAIT_CYCLE(pstcEfmCfg->u32WaitCycle)); + DDL_ASSERT(IS_VALID_EFM_BUS_STATUS(pstcEfmCfg->u32BusStatus)); + DDL_ASSERT(IS_VALID_EFM_CACHERST_FUNC(pstcEfmCfg->u32CacheRst)); + DDL_ASSERT(IS_VALID_EFM_PREFETCH_FUNC(pstcEfmCfg->u32Prefetch)); + DDL_ASSERT(IS_VALID_EFM_DCHEEN_FUNC(pstcEfmCfg->u32DataCache)); + DDL_ASSERT(IS_VALID_EFM_ICHEEN_FUNC(pstcEfmCfg->u32InsCache)); + DDL_ASSERT(IS_VALID_EFM_LVREAD_MODE(pstcEfmCfg->u32LowVolRead)); + DDL_ASSERT(IS_VALID_EFM_OPERATE_MD(pstcEfmCfg->u32OperateMode)); + DDL_ASSERT(IS_VALID_EFM_STATUS(pstcEfmCfg->u32FlashStatus)); + + u32Temp = pstcEfmCfg->u32WaitCycle | pstcEfmCfg->u32InsCache | pstcEfmCfg->u32DataCache | \ + pstcEfmCfg->u32Prefetch | pstcEfmCfg->u32CacheRst | pstcEfmCfg->u32LowVolRead; + /* Config efm. */ + MODIFY_REG32(M4_EFM->FRMC, EFM_FRMC_FLWT | EFM_FRMC_PREFE | EFM_FRMC_LVM | \ + EFM_FRMC_ICACHE | EFM_FRMC_DCACHE | EFM_FRMC_CRST, u32Temp); + MODIFY_REG32(M4_EFM->FWMC, EFM_FWMC_BUSHLDCTL | EFM_FWMC_PEMOD, \ + pstcEfmCfg->u32BusStatus | pstcEfmCfg->u32OperateMode); + MODIFY_REG32(M4_EFM->FSTP, EFM_FSTP_F0STP | EFM_FSTP_F1STP, pstcEfmCfg->u32FlashStatus); + } + + return enRet; +} + +/** + * @brief Set the efm read wait cycles. + * @param [in] u32WaitCycle Specifies the efm read wait cycles. + * This parameter can be one of the following values: + * @arg EFM_WAIT_CYCLE_0: Don't insert read wait cycle + * @arg EFM_WAIT_CYCLE_1: Insert 1 read wait cycles + * @arg EFM_WAIT_CYCLE_2: Insert 2 read wait cycles + * @arg EFM_WAIT_CYCLE_3: Insert 3 read wait cycles + * @arg EFM_WAIT_CYCLE_4: Insert 4 read wait cycles + * @arg EFM_WAIT_CYCLE_5: Insert 5 read wait cycles + * @arg EFM_WAIT_CYCLE_6: Insert 6 read wait cycles + * @arg EFM_WAIT_CYCLE_7: Insert 7 read wait cycles + * @arg EFM_WAIT_CYCLE_8: Insert 8 read wait cycles + * @arg EFM_WAIT_CYCLE_9: Insert 9 read wait cycles + * @arg EFM_WAIT_CYCLE_10: Insert 10 read wait cycles + * @arg EFM_WAIT_CYCLE_11: Insert 11 read wait cycles + * @arg EFM_WAIT_CYCLE_12: Insert 12 read wait cycles + * @arg EFM_WAIT_CYCLE_13: Insert 13 read wait cycles + * @arg EFM_WAIT_CYCLE_14: Insert 14 read wait cycles + * @arg EFM_WAIT_CYCLE_15: Insert 15 read wait cycles + * @retval None + * @note Call EFM_Unlock() unlock EFM register first. + */ +void EFM_SetWaitCycle(uint32_t u32WaitCycle) +{ + /* Param valid check */ + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + DDL_ASSERT(IS_VALID_EFM_WAIT_CYCLE(u32WaitCycle)); + /* Set the code latency value. */ + MODIFY_REG32(M4_EFM->FRMC, EFM_FRMC_FLWT, u32WaitCycle); +} + +/** + * @brief Enable or disable the flash data cache reset. + * @param [in] enNewState The new status of the flash data cache reset. + * @arg This parameter can be: Enable or Disable. + * @retval None + * @note Call EFM_Unlock() unlock EFM register first. + */ +void EFM_DataCacheRstCmd(en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + + WRITE_REG32(bM4_EFM->FRMC_b.CRST, enNewState); +} + +/** + * @brief Enable or disable the flash prefetch. + * @param [in] enNewState The new state of the flash prefetch. + * @arg This parameter can be: Enable or Disable. + * @retval None + * @note Call EFM_Unlock() unlock EFM register first. + */ +void EFM_PrefetchCmd(en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + + WRITE_REG32(bM4_EFM->FRMC_b.PREFE, enNewState); +} + +/** + * @brief Enable or disable the flash data cache. + * @param [in] enNewState The new state of the flash data cache. + * @arg This parameter can be: Enable or Disable. + * @retval None + * @note Call EFM_Unlock() unlock EFM register first. + */ +void EFM_DataCacheCmd(en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + + WRITE_REG32(bM4_EFM->FRMC_b.DCACHE, enNewState); +} + +/** + * @brief Enable or disable the flash instruction cache. + * @param [in] enNewState The new state of the flash instruction cache. + * @arg This parameter can be: Enable or Disable. + * @retval None + * @note Call EFM_Unlock() unlock EFM register first. + */ +void EFM_InsCacheCmd(en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + + WRITE_REG32(bM4_EFM->FRMC_b.ICACHE, enNewState); +} + +/** + * @brief Enable or disable the Read of low-voltage mode. + * @param [in] enNewState The new state of the flash Low voltage read mode. + * @arg This parameter can be: Enable or Disable. + * @retval None + * @note Call EFM_Unlock() unlock EFM register first. + */ +void EFM_LowVolReadCmd(en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + + WRITE_REG32(bM4_EFM->FRMC_b.LVM, enNewState); +} + +/** + * @brief Set the FLASH erase program mode . + * @param [in] u32PgmMode Specifies the FLASH erase program mode. + * This parameter can be one of the following values: + * @arg EFM_MODE_PROGRAMSINGLE: Program single at a specified address + * @arg EFM_MODE_PROGRAMREADBACK: Program and read back at a specified address + * @arg EFM_MODE_PROGRAMSEQUENCE: Program sequence at sequence address + * @arg EFM_MODE_ERASESECTOR: Sector erase + * @arg EFM_MODE_ERASECHIP1: A flash Chip erase + * @arg EFM_MODE_ERASEFULL: Two flash Chip erase + * @arg EFM_MODE_READONLY: Read only + * @retval An en_result_t enumeration value: + * - Ok: Success + * - ErrorTimeout: Process timeout + * @note Call EFM_Unlock() and EFM_FWMC_Unlock() unlock EFM_FWMC register first. + */ +en_result_t EFM_SetOperateMode(uint32_t u32PgmMode) +{ + en_result_t enRet = Ok; + uint32_t u32Timeout = 0UL; + DDL_ASSERT(IS_VALID_EFM_OPERATE_MD(u32PgmMode)); + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + DDL_ASSERT(IS_VALID_EFM_FWMC_UNLOCK()); + while ((READ_REG32(M4_EFM->FSR) & 0x01000100UL) != 0x01000100UL) + { + u32Timeout ++; + if (u32Timeout > EFM_SEQ_PGM_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + if (enRet == Ok) + { + /* Set the program or erase mode. */ + MODIFY_REG32(M4_EFM->FWMC, EFM_FWMC_PEMOD, u32PgmMode); + } + return enRet; +} + +/** + * @brief Enable or Disable EFM interrupt. + * @param [in] u32EfmInt Specifies the FLASH interrupt source and status. + * @arg EFM_INT_OPTEND: End of EFM Operation Interrupt source + * @arg EFM_INT_PEERR: Program/erase error Interrupt source + * @arg EFM_INT_RDCOLERR: Read collide error Interrupt source + * @param [in] enNewState The new state of specified interrupt. + * This parameter can be: Enable or Disable. + * @retval None + * @note Call EFM_Unlock() unlock EFM register first. + */ +void EFM_InterruptCmd(uint32_t u32EfmInt, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_EFM_INT_SEL(u32EfmInt)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + if(Enable == enNewState) + { + SET_REG32_BIT(M4_EFM->FITE, u32EfmInt); + } + else + { + CLEAR_REG32_BIT(M4_EFM->FITE, u32EfmInt); + } +} + +/** + * @brief Checks whether the specified FLASH flag is set or not. + * @param [in] u32Flag Specifies the FLASH flag to check. + * @arg EFM_FLAG_OTPWERR0: Flash0 otp Programming/erase error flag. + * @arg EFM_FLAG_PRTWERR0: Flash0 write protect address error flag. + * @arg EFM_FLAG_PGSZERR0: Flash0 programming size error flag. + * @arg EFM_FLAG_MISMTCH0: Flash0 programming missing match error flag. + * @arg EFM_FLAG_OPTEND0: Flash0 end of operation flag. + * @arg EFM_FLAG_CLOLERR0: Flash0 read write error flag. + * @arg EFM_FLAG_RDY0: Flash0 ready flag. + * @arg EFM_FLAG_PRTWERR1: Flash1 write protect address error flag. + * @arg EFM_FLAG_PGSZERR1: Flash1 programming size error flag. + * @arg EFM_FLAG_MISMTCH1: Flash1 programming missing match error flag. + * @arg EFM_FLAG_OPTEND1: Flash1 end of operation flag. + * @arg EFM_FLAG_CLOLERR1: Flash1 read write error flag. + * @arg EFM_FLAG_RDY1: Flash1 ready flag. + * @retval An en_flag_status_t enumeration value: + * - Set: flag is set + * - Reset: flag is reset + */ +en_flag_status_t EFM_GetFlagStatus(uint32_t u32Flag) +{ + DDL_ASSERT(IS_VALID_EFM_FLAG(u32Flag)); + return ((0UL == READ_REG32_BIT(M4_EFM->FSR, u32Flag)) ? Reset :Set); +} + +/** + * @brief Clear the flash flag. + * @param [in] u32Flag Specifies the FLASH flag to clear. + * @arg EFM_FLAG_CLR_OTPWERR0: Clear Flash0 otp Programming/erase error flag + * @arg EFM_FLAG_CLR_PRTWERR0: Clear Flash0 write protect address error flag + * @arg EFM_FLAG_CLR_PGSZERR0: Clear Flash0 programming size error flag + * @arg EFM_FLAG_CLR_MISMTCH0: Clear Flash0 programming miss match error flag + * @arg EFM_FLAG_CLR_OPTEND0: Clear Flash0 end of operation flag + * @arg EFM_FLAG_CLR_CLOLERR0: Clear Flash0 read collide error flag + * @arg EFM_FLAG_CLR_PRTWERR1: Clear Flash1 write protect address error flag + * @arg EFM_FLAG_CLR_PGSZERR1: Clear Flash1 programming size error flag + * @arg EFM_FLAG_CLR_MISMTCH1: Clear Flash1 programming miss match error flag + * @arg EFM_FLAG_CLR_OPTEND1: Clear Flash1 end of operation flag + * @arg EFM_FLAG_CLR_CLOLERR1: Clear Flash1 read collide error flag + * @retval None + * @note Call EFM_Unlock() unlock EFM register first. + */ +void EFM_ClearFlag(uint32_t u32Flag) +{ + DDL_ASSERT(IS_VALID_EFM_CLRFLAG(u32Flag)); + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + + SET_REG32_BIT(M4_EFM->FSCLR, u32Flag); +} + +/** + * @brief Sector protected register lock. + * @param [in] u32EfmRegLock Specifies sector protected register locking. + * @arg EFM_WRLOCK0: F0NWPRT0 controlled sector lock + * @arg EFM_WRLOCK1: F0NWPRT1 controlled sector lock + * @arg EFM_WRLOCK2: F0NWPRT2 controlled sector lock + * @arg EFM_WRLOCK3: F0NWPRT3 controlled sector lock + * @arg EFM_WRLOCK4: F1NWPRT0 controlled sector lock + * @arg EFM_WRLOCK5: F1NWPRT1 controlled sector lock + * @arg EFM_WRLOCK6: F1NWPRT2 controlled sector lock + * @arg EFM_WRLOCK7: F1NWPRT3 controlled sector lock + * @retval None + * @note Call EFM_Unlock() unlock EFM register first. + */ +void EFM_SectorRegLock(uint32_t u32EfmRegLock) +{ + DDL_ASSERT(IS_VALID_EFM_REG_LOCK(u32EfmRegLock)); + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + + SET_REG32_BIT(M4_EFM->WLOCK, u32EfmRegLock); +} + +/** + * @brief Set sector lock or unlock (Single). + * @param [in] u8SectorNum Specifies sector for unlock. + * This parameter can be set 0~255 + * @param [in] enNewState The new status of specified sector lock or unlock. + * This parameter can be: Enable or Disable. + * @retval None + * @note Call EFM_Unlock() unlock EFM register first. + * If you want to unlock sequential sectors,Please call EFM_SectorCmd_Sequential function + */ +void EFM_SectorCmd_Single(uint8_t u8SectorNum, en_functional_state_t enNewState) +{ + __IO uint32_t *EFM_FxNWPRTy; + const uint8_t u8RegIndex = u8SectorNum / REG_LENGTH; + const uint8_t u8BitPos = u8SectorNum % REG_LENGTH; + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + EFM_FxNWPRTy = (__IO uint32_t*)((uint32_t)(&M4_EFM->F0NWPRT0) + ((uint32_t)u8RegIndex << 2UL)); + MODIFY_REG32(*EFM_FxNWPRTy, 1UL<F0NWPRT0) + ((uint32_t)StartRegIndex << 2UL)); + + if(StartRegIndex == EndRegIndex) + { + for(Num = StartBitPos; Num <= EndBitPos; Num++) + { + MODIFY_REG32(*EFM_FxNWPRTy,(uint32_t)1UL<F0NWPRT0) + ((uint32_t)EndRegIndex << 2U)); + for(Num = 0U;Num <= EndBitPos;Num++) + { + MODIFY_REG32(*EFM_FxNWPRTy, (uint32_t)1UL<F0NWPRT0) + ((uint32_t)StartRegIndex << 2U)); + if(enNewState == Enable) + { + WRITE_REG32(*EFM_FxNWPRTy, 0xFFFFFFFFUL); + } + else + { + WRITE_REG32(*EFM_FxNWPRTy, 0x0UL); + } + StartRegIndex += 1U; + } + enRet = Ok; + } + } + return enRet; +} + +/** + * @brief Set bus status while flash program or erase. + * @param [in] u32Status Specifies the new bus status while flash program or erase. + * This parameter can be one of the following values: + * @arg EFM_BUS_BUSY: Bus busy while flash program or erase. + * @arg EFM_BUS_RELEASE: Bus releas while flash program or erase. + * @retval None + * @note Call EFM_Unlock() and EFM_FWMC_Unlock() unlock EFM_FWMC register first. + */ +void EFM_SetBusStatus(uint32_t u32Status) +{ + DDL_ASSERT(IS_VALID_EFM_BUS_STATUS(u32Status)); + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + DDL_ASSERT(IS_VALID_EFM_FWMC_UNLOCK()); + + MODIFY_REG32(M4_EFM->FWMC, EFM_FWMC_BUSHLDCTL, u32Status); +} + +/** + * @brief Flash single program mode. + * @param [in] u32Addr The specified program address. + * @param [in] u32Data The specified program data. + * @retval An en_result_t enumeration value: + * - Ok: program success + * - Error: program error + * - ErrorTimeout: program error timeout + * @note The address should be word align. + * Call EFM_Unlock() unlock EFM register first. + */ +en_result_t EFM_SingleProgram(uint32_t u32Addr, uint32_t u32Data) +{ + en_result_t enRet = Ok; + uint32_t u32Timeout = 0UL; + uint32_t u32tmp; + uint32_t u32EfmFlag = EFM_FLAG_RDY1; + uint32_t u32EfmClrFlag = EFM_FLAG_CLR_OPTEND1; + + DDL_ASSERT(IS_VALID_EFM_ADDR(u32Addr)); + DDL_ASSERT(IS_VALID_EFM_ADDR_ALIGNMENT(u32Addr)); + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + + /* Clear the error flag. */ + EFM_ClearFlag(EFM_CLR_FLAG_MASK); + /* Get CACHE status */ + u32tmp = READ_REG32_BIT(M4_EFM->FRMC, EFM_CACHE_MASK); + /* Disable CACHE function */ + CLEAR_REG32_BIT(M4_EFM->FRMC, EFM_CACHE_MASK); + /* Set single program mode. */ + MODIFY_REG32(M4_EFM->FWMC, EFM_FWMC_PEMOD, EFM_MODE_PROGRAMSINGLE); + /* Program data. */ + RW_MEM32(u32Addr) = (uint32_t)u32Data; + if((u32Addr < EFM_ADDR_SECTOR128) || (u32Addr >= EFM_OTP_BLOCK16)) + { + u32EfmFlag = EFM_FLAG_RDY0; + u32EfmClrFlag = EFM_FLAG_CLR_OPTEND0; + } + /* Wait for operation end */ + while(Set != EFM_GetFlagStatus(u32EfmFlag)) + { + u32Timeout ++; + if(u32Timeout >= EFM_PGM_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + if(u32Data != RW_MEM32(u32Addr)) + { + enRet = Error; + } + /* CLear the end of operate flag */ + EFM_ClearFlag(u32EfmClrFlag); + /* Set read only mode. */ + MODIFY_REG32(M4_EFM->FWMC, EFM_FWMC_PEMOD, EFM_MODE_READONLY); + /* Recover CACHE function */ + MODIFY_REG32(M4_EFM->FRMC, EFM_CACHE_MASK, u32tmp); + + return enRet; +} + +/** + * @brief Flash single program with read back. + * @param [in] u32Addr The specified program address. + * @param [in] u32Data The specified program data. + * @retval An en_result_t enumeration value: + * - Ok: program success + * - Error: program error + * - ErrorTimeout: program error timeout + * @note The address should be word align. + * Call EFM_Unlock() unlock EFM register first. + */ +en_result_t EFM_ProgramReadBack(uint32_t u32Addr, uint32_t u32Data) +{ + en_result_t enRet = Ok; + uint32_t u32Timeout = 0UL; + uint32_t u32tmp; + uint32_t u32EfmFlag = EFM_FLAG_RDY1; + uint32_t u32EfmClrFlag = EFM_FLAG_CLR_OPTEND1; + uint32_t u32EfmFlag1 = EFM_FLAG_MISMTCH1; + uint32_t u32EfmClrFlag1 = EFM_FLAG_CLR_MISMTCH1; + + DDL_ASSERT(IS_VALID_EFM_ADDR(u32Addr)); + DDL_ASSERT(IS_VALID_EFM_ADDR_ALIGNMENT(u32Addr)); + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + + /* Clear the error flag. */ + EFM_ClearFlag(EFM_CLR_FLAG_MASK); + /* Get CACHE status */ + u32tmp = READ_REG32_BIT(M4_EFM->FRMC, EFM_CACHE_MASK); + /* Disable CACHE */ + CLEAR_REG32_BIT(M4_EFM->FRMC, EFM_CACHE_MASK); + /* Set Program and read back mode. */ + MODIFY_REG32(M4_EFM->FWMC, EFM_FWMC_PEMOD, EFM_MODE_PROGRAMREADBACK); + /* Program data. */ + RW_MEM32(u32Addr) = (uint32_t)u32Data; + if((u32Addr < EFM_ADDR_SECTOR128) || (u32Addr >= EFM_OTP_BLOCK16)) + { + u32EfmFlag = EFM_FLAG_RDY0; + u32EfmClrFlag = EFM_FLAG_CLR_OPTEND0; + u32EfmFlag1 = EFM_FLAG_MISMTCH0; + u32EfmClrFlag1 = EFM_FLAG_CLR_MISMTCH0; + } + while(Set != EFM_GetFlagStatus(u32EfmFlag)) + { + u32Timeout ++; + if(u32Timeout >= EFM_PGM_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + /* Get the flag MISMTCH0*/ + if(Set == EFM_GetFlagStatus(u32EfmFlag1)) + { + /* Clear flag PGMISMTCH */ + EFM_ClearFlag(u32EfmClrFlag1); + enRet = Error; + } + /* CLear the end of operate flag */ + EFM_ClearFlag(u32EfmClrFlag); + /* Set read only mode. */ + MODIFY_REG32(M4_EFM->FWMC, EFM_FWMC_PEMOD, EFM_MODE_READONLY); + /* recover CACHE function */ + MODIFY_REG32(M4_EFM->FRMC, EFM_CACHE_MASK, u32tmp); + + return enRet; +} + +/** + * @brief Flash sequence program. + * @param [in] u32Addr The specified program address. + * @param [in] u32Len The len of specified program data. + * @param [in] pu32Buf The pointer of specified program data. + * @retval An en_result_t enumeration value: + * - Ok: program success + * - ErrorTimeout: program error timeout + * @note The address should be word align. + * Call EFM_Unlock() unlock EFM register first. + */ +en_result_t EFM_SequenceProgram(uint32_t u32Addr, uint32_t u32Len, const uint32_t *pu32Buf) +{ + en_result_t enRet = Ok; + uint32_t u32Timeout; + uint32_t u32tmp; + uint32_t u32LoopWords = u32Len >> 2UL; + uint32_t u32EfmFlag = EFM_FLAG_OPTEND0; + uint32_t u32EfmFlag1 = EFM_FLAG_RDY0; + uint32_t u32EfmClrFlag = EFM_FLAG_CLR_OPTEND0; + uint32_t u32SrcDataAddr = (uint32_t)pu32Buf; + DDL_ASSERT(IS_VALID_EFM_ADDR(u32Addr)); + DDL_ASSERT(IS_VALID_EFM_ADDR_ALIGNMENT(u32Addr)); + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + + /* CLear the error flag. */ + EFM_ClearFlag(EFM_CLR_FLAG_MASK); + /* Get CACHE status */ + u32tmp = READ_REG32_BIT(M4_EFM->FRMC, EFM_CACHE_MASK); + /* Disable CACHE */ + CLEAR_REG32_BIT(M4_EFM->FRMC, EFM_CACHE_MASK); + /* Set sequence program mode. */ + MODIFY_REG32(M4_EFM->FWMC, EFM_FWMC_PEMOD, EFM_MODE_PROGRAMSEQUENCE); + /* program data. */ + while((u32LoopWords--) > 0UL) + { + RW_MEM32(u32Addr) = RW_MEM32(u32SrcDataAddr); + /* wait operate end. */ + if((u32Addr >= EFM_ADDR_SECTOR128) && (u32Addr < EFM_END_ADDR)) + { + u32EfmFlag = EFM_FLAG_OPTEND1; + u32EfmFlag1 = EFM_FLAG_RDY1; + u32EfmClrFlag = EFM_FLAG_CLR_OPTEND1; + } + u32Timeout = 0UL; + while(Set != EFM_GetFlagStatus(u32EfmFlag)) + { + if(u32Timeout++ >= EFM_PGM_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + u32Timeout = 0UL; + /* Clear operation end flag */ + while(Reset != EFM_GetFlagStatus(u32EfmFlag)) + { + if(u32Timeout++ >= EFM_SEQ_PGM_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + /* clear end flag. */ + EFM_ClearFlag(u32EfmClrFlag); + } + if (enRet != Ok) + { + break; + } + u32Addr += 4UL; + u32SrcDataAddr += 4UL; + if (u32Addr == EFM_ADDR_SECTOR128) + { + /* Set read only mode. */ + MODIFY_REG32(M4_EFM->FWMC, EFM_FWMC_PEMOD, EFM_MODE_READONLY); + u32Timeout = 0UL; + /* wait for flash ready . */ + while(Set != EFM_GetFlagStatus(u32EfmFlag1)) + { + u32Timeout ++; + if(u32Timeout >= EFM_PGM_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + if (enRet == Ok) + { + /* Set sequence program mode. */ + MODIFY_REG32(M4_EFM->FWMC, EFM_FWMC_PEMOD, EFM_MODE_PROGRAMSEQUENCE); + } + } + } + /* Set read only mode. */ + MODIFY_REG32(M4_EFM->FWMC, EFM_FWMC_PEMOD, EFM_MODE_READONLY); + u32Timeout = 0UL; + /* wait for flash ready . */ + while(Set != EFM_GetFlagStatus(u32EfmFlag1)) + { + u32Timeout ++; + if(u32Timeout >= EFM_PGM_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + /* Recover CACHE */ + MODIFY_REG32(M4_EFM->FRMC, EFM_CACHE_MASK, u32tmp); + return enRet; +} + +/** + * @brief Flash sector erase. + * @param [in] u32Addr The address in the specified sector. + * @retval An en_result_t enumeration value: + * - Ok: erase success + * - ErrorTimeout: program error timeout + * @note The address should be word align. + * Call EFM_Unlock() unlock EFM register first. + */ +en_result_t EFM_SectorErase(uint32_t u32Addr) +{ + en_result_t enRet = Ok; + uint32_t u32Timeout = 0UL; + uint32_t u32tmp; + uint32_t u32EfmFlag = EFM_FLAG_RDY1; + uint32_t u32EfmClrFlag = EFM_FLAG_CLR_OPTEND1; + + DDL_ASSERT(IS_VALID_EFM_ADDR(u32Addr)); + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + + /* CLear the error flag. */ + EFM_ClearFlag(EFM_CLR_FLAG_MASK); + /* Get CACHE status */ + u32tmp = READ_REG32_BIT(M4_EFM->FRMC, EFM_CACHE_MASK); + /* Disable CACHE */ + CLEAR_REG32_BIT(M4_EFM->FRMC, EFM_CACHE_MASK); + /* Set sector erase mode. */ + MODIFY_REG32(M4_EFM->FWMC, EFM_FWMC_PEMOD, EFM_MODE_ERASESECTOR); + /* Erase */ + RW_MEM32(u32Addr & 0xFFFFFFFCUL) = (uint32_t)0UL; + if((u32Addr < EFM_ADDR_SECTOR128) || (u32Addr >= EFM_OTP_BLOCK16)) + { + u32EfmFlag = EFM_FLAG_RDY0; + u32EfmClrFlag = EFM_FLAG_CLR_OPTEND0; + } + while(Set != EFM_GetFlagStatus(u32EfmFlag)) + { + u32Timeout ++; + if(u32Timeout >= EFM_ERASE_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + /* Clear the end of operate flag */ + EFM_ClearFlag(u32EfmClrFlag); + /* Set read only mode. */ + MODIFY_REG32(M4_EFM->FWMC, EFM_FWMC_PEMOD, EFM_MODE_READONLY); + /* Recover CACHE */ + MODIFY_REG32(M4_EFM->FRMC, EFM_CACHE_MASK, u32tmp); + + return enRet; +} + +/** + * @brief Flash OTP lock. + * @param [in] u32Addr Specifies the OTP block + * @retval An en_result_t enumeration value: + * - Ok: program success + * - ErrorInvalidParameter: Invalid parameter + * @note The address should be word align. + * Call EFM_Unlock() and EFM_OTP_WP_Unlock() unlock EFM_FWMC register first. + */ +en_result_t EFM_OTPLock(uint32_t u32Addr) +{ + en_result_t enRet = ErrorInvalidParameter; + uint32_t u32Timeout = 0UL; + + if((u32Addr >= OTP_LOCK_ADDR_START) && (u32Addr < OTP_LOCK_ADDR_END )) + { + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + DDL_ASSERT(IS_VALID_EFM_OTP_UNLOCK()); + + enRet = Ok; + /* Set single program mode. */ + MODIFY_REG32(M4_EFM->FWMC, EFM_FWMC_PEMOD, EFM_MODE_PROGRAMSINGLE); + /* Enable OTP */ + RW_MEM32(OTP_ENABLE_ADDR) = (uint32_t)0UL; + /* Wait for operation end */ + while(Set != EFM_GetFlagStatus(EFM_FLAG_RDY0)) + { + u32Timeout ++; + if(u32Timeout >= EFM_PGM_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + /* CLear the end of operate flag */ + EFM_ClearFlag(EFM_FLAG_CLR_OPTEND0); + if (enRet == Ok) + { + /* OTP latch */ + RW_MEM32(u32Addr & 0xFFFFFFFCUL) = (uint32_t)0UL; + /* Wait for operation end */ + u32Timeout = 0UL; + while(Set != EFM_GetFlagStatus(EFM_FLAG_RDY0)) + { + u32Timeout ++; + if(u32Timeout >= EFM_PGM_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + } + /* CLear the end of operate flag */ + EFM_ClearFlag(EFM_FLAG_CLR_OPTEND0); + /* Set read only mode. */ + MODIFY_REG32(M4_EFM->FWMC, EFM_FWMC_PEMOD, EFM_MODE_READONLY); + } + + return enRet; +} + +/** + * @brief Flash chip erase. + * @param [in] EraseMode Specifies the FLASH erase mode. + * @arg EFM_MODE_ERASECHIP1 A flash Chip erase mode + * @arg EFM_MODE_ERASECHIP1 Two flash Chip erase mode + * @param [in] u32Addr Specifies the FLASH block + * @retval An en_result_t enumeration value: + * - Ok: program success + * - ErrorTimeout: program error timeout + * @note The address should be word align. + * Call EFM_Unlock() unlock EFM register first. + */ +en_result_t EFM_ChipErase(uint32_t EraseMode, uint32_t u32Addr) +{ + en_result_t enRet = Ok; + uint32_t u32Timeout = 0UL; + uint32_t u32tmp; + uint32_t u32EfmFlag; + uint32_t u32EfmClrFlag; + + DDL_ASSERT(IS_VALID_EFM_ERASE_MODE(EraseMode)); + DDL_ASSERT(IS_VALID_EFM_CHIP_ERASE_ADDR(u32Addr)); + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + + /* CLear the error flag. */ + EFM_ClearFlag(EFM_CLR_FLAG_MASK); + /* Get CACHE status */ + u32tmp = READ_REG32_BIT(M4_EFM->FRMC, EFM_CACHE_MASK); + /* Disable CACHE */ + CLEAR_REG32_BIT(M4_EFM->FRMC, EFM_CACHE_MASK); + /* If wsap enable, Disable it */ + if (RW_MEM32(EFM_SWAP_ADDR) == EFM_SWAP_DATA) + { + /* Set Sector erase mode. */ + MODIFY_REG32(M4_EFM->FWMC, EFM_FWMC_PEMOD, EFM_MODE_ERASESECTOR); + /* Disable flash switch function */ + RW_MEM32(EFM_SWAP_ADDR) = 0x0UL; + while(Set != EFM_GetFlagStatus(EFM_FLAG_OPTEND0)) + { + u32Timeout ++; + if(u32Timeout >= EFM_ERASE_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + /* CLear the end of operate flag */ + EFM_ClearFlag(EFM_FLAG_CLR_OPTEND0); + } + /* Set chip erase mode. */ + MODIFY_REG32(M4_EFM->FWMC, EFM_FWMC_PEMOD, EraseMode); + if(EraseMode == EFM_MODE_ERASECHIP1) + { + if (u32Addr >= EFM_ADDR_SECTOR128) + { + u32EfmFlag = EFM_FLAG_RDY1; + u32EfmClrFlag = EFM_FLAG_CLR_OPTEND1; + /* Flash1 disables write protection */ + WRITE_REG32(M4_EFM->F1NWPRT0, 0xFFFFFFFFUL); + WRITE_REG32(M4_EFM->F1NWPRT1, 0xFFFFFFFFUL); + WRITE_REG32(M4_EFM->F1NWPRT2, 0xFFFFFFFFUL); + WRITE_REG32(M4_EFM->F1NWPRT3, 0xFFFFFFFFUL); + } + else + { + u32EfmFlag = EFM_FLAG_RDY0; + u32EfmClrFlag = EFM_FLAG_CLR_OPTEND0; + /* Flash0 disables write protection */ + WRITE_REG32(M4_EFM->F0NWPRT0, 0xFFFFFFFFUL); + WRITE_REG32(M4_EFM->F0NWPRT1, 0xFFFFFFFFUL); + WRITE_REG32(M4_EFM->F0NWPRT2, 0xFFFFFFFFUL); + WRITE_REG32(M4_EFM->F0NWPRT3, 0xFFFFFFFFUL); + } + + /* Erase */ + RW_MEM32(u32Addr & 0xFFFFFFFCUL) = (uint32_t)0UL; + while(Set != EFM_GetFlagStatus(u32EfmFlag)) + { + u32Timeout ++; + if(u32Timeout >= EFM_ERASE_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + /* CLear the end of operate flag */ + EFM_ClearFlag(u32EfmClrFlag); + } + else + { + /* Flash0 and Flash1 disables write protection */ + WRITE_REG32(M4_EFM->F0NWPRT0, 0xFFFFFFFFUL); + WRITE_REG32(M4_EFM->F0NWPRT1, 0xFFFFFFFFUL); + WRITE_REG32(M4_EFM->F0NWPRT2, 0xFFFFFFFFUL); + WRITE_REG32(M4_EFM->F0NWPRT3, 0xFFFFFFFFUL); + WRITE_REG32(M4_EFM->F1NWPRT0, 0xFFFFFFFFUL); + WRITE_REG32(M4_EFM->F1NWPRT1, 0xFFFFFFFFUL); + WRITE_REG32(M4_EFM->F1NWPRT2, 0xFFFFFFFFUL); + WRITE_REG32(M4_EFM->F1NWPRT3, 0xFFFFFFFFUL); + /* Erase */ + RW_MEM32(u32Addr & 0xFFFFFFFCUL) = (uint32_t)0UL; + while(Set != EFM_GetFlagStatus(EFM_FLAG_RDY0)) + { + u32Timeout ++; + if(u32Timeout >= EFM_ERASE_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + /* CLear the end of operate flag */ + EFM_ClearFlag(EFM_FLAG_CLR_OPTEND0); + EFM_ClearFlag(EFM_FLAG_CLR_OPTEND1); + } + /* Set read only mode. */ + MODIFY_REG32(M4_EFM->FWMC, EFM_FWMC_PEMOD, EFM_MODE_READONLY); + /* recover CACHE */ + MODIFY_REG32(M4_EFM->FRMC, EFM_CACHE_MASK, u32tmp); + return enRet; +} + +/** + * @brief Enable or disable the EFM swap function. + * @param [in] enNewState The new state of the flash swap function. + * @arg This parameter can be: Enable or Disable. + * @retval An en_result_t enumeration value: + * - Ok: program success + * - ErrorTimeout: program error timeout + * @note Call EFM_Unlock() unlock EFM register first. + */ +en_result_t EFM_SwapCmd(en_functional_state_t enNewState) +{ + en_result_t enRet = Ok; + uint32_t u32Timeout = 0UL; + + DDL_ASSERT(IS_VALID_EFM_UNLOCK()); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + if (enNewState ==Enable) + { + /* Set Program single mode. */ + MODIFY_REG32(M4_EFM->FWMC, EFM_FWMC_PEMOD, EFM_MODE_PROGRAMSINGLE); + /* Enable flash swap function */ + RW_MEM32(EFM_SWAP_ADDR) = EFM_SWAP_DATA; + while(Set != EFM_GetFlagStatus(EFM_FLAG_OPTEND0)) + { + u32Timeout ++; + if(u32Timeout >= EFM_PGM_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + /* CLear the end of operate flag */ + EFM_ClearFlag(EFM_FLAG_CLR_OPTEND0); + } + else{ + /* Set Sector erase mode. */ + MODIFY_REG32(M4_EFM->FWMC, EFM_FWMC_PEMOD, EFM_MODE_ERASESECTOR); + /* Disable flash switch function */ + RW_MEM32(EFM_SWAP_ADDR) = 0x0UL; + while(Set != EFM_GetFlagStatus(EFM_FLAG_OPTEND0)) + { + u32Timeout ++; + if(u32Timeout >= EFM_ERASE_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + /* CLear the end of operate flag */ + EFM_ClearFlag(EFM_FLAG_CLR_OPTEND0); + } + /* Set read only mode. */ + MODIFY_REG32(M4_EFM->FWMC, EFM_FWMC_PEMOD, EFM_MODE_READONLY); + + return enRet; +} + +/** + * @brief Get chip ID. + * @param None + * @retval Returns the value of the Chip ID + */ +uint32_t EFM_GetCID(void) +{ + uint32_t u32CID; + u32CID = M4_EFM->FHDFG; + return u32CID; +} + +/** + * @brief Get unique ID. + * @param [out] stcUID Unique ID struct + * @retval Returns the value of the unique ID + */ +void EFM_GetUID(stc_efm_unique_id_t *stcUID) +{ + stcUID->u32UniqueID0 = READ_REG32(M4_EFM->UQID0); + stcUID->u32UniqueID1 = READ_REG32(M4_EFM->UQID1); + stcUID->u32UniqueID2 = READ_REG32(M4_EFM->UQID2); +} + +/** + * @} + */ + +#endif /* DDL_EFM_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_emb.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_emb.c new file mode 100644 index 0000000000..dadd1a91e7 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_emb.c @@ -0,0 +1,923 @@ +/** + ******************************************************************************* + * @file hc32f4a0_emb.c + * @brief This file provides firmware functions to manage the EMB + * (Emergency Brake). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Hongjh First version + 2020-07-07 Hongjh Replace the word Timer with TMR abbreviation + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_emb.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_EMB EMB + * @brief Emergency Brake Driver Library + * @{ + */ + +#if (DDL_EMB_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup EMB_Local_Macros EMB Local Macros + * @{ + */ + +/** + * @defgroup EMB_Check_Parameters_Validity EMB Check Parameters Validity + * @{ + */ + +#define IS_VALID_EMB(x) \ +( ((x) == M4_EMB0) || \ + ((x) == M4_EMB1) || \ + ((x) == M4_EMB2) || \ + ((x) == M4_EMB3) || \ + ((x) == M4_EMB4) || \ + ((x) == M4_EMB5) || \ + ((x) == M4_EMB6)) + +#define IS_VALID_EMB_TMR6(x) \ +( ((x) == M4_EMB0) || \ + ((x) == M4_EMB1) || \ + ((x) == M4_EMB2) || \ + ((x) == M4_EMB3)) + +#define IS_VALID_EMB_TIMER4(x) \ +( ((x) == M4_EMB4) || \ + ((x) == M4_EMB5) || \ + ((x) == M4_EMB6)) + +#define IS_VALID_EMB_CMP1_SEL(x) \ +( ((x) == EMB_CMP1_ENABLE) || \ + ((x) == EMB_CMP1_DISABLE)) + +#define IS_VALID_EMB_CMP2_SEL(x) \ +( ((x) == EMB_CMP2_ENABLE) || \ + ((x) == EMB_CMP2_DISABLE)) + +#define IS_VALID_EMB_CMP3_SEL(x) \ +( ((x) == EMB_CMP3_ENABLE) || \ + ((x) == EMB_CMP3_DISABLE)) + +#define IS_VALID_EMB_CMP4_SEL(x) \ +( ((x) == EMB_CMP4_ENABLE) || \ + ((x) == EMB_CMP4_DISABLE)) + +#define IS_VALID_EMB_PORT1_SEL(x) \ +( ((x) == EMB_PORT1_ENABLE) || \ + ((x) == EMB_PORT1_DISABLE)) + +#define IS_VALID_EMB_PORT2_SEL(x) \ +( ((x) == EMB_PORT2_ENABLE) || \ + ((x) == EMB_PORT2_DISABLE)) + +#define IS_VALID_EMB_PORT3_SEL(x) \ +( ((x) == EMB_PORT3_ENABLE) || \ + ((x) == EMB_PORT3_DISABLE)) + +#define IS_VALID_EMB_PORT4_SEL(x) \ +( ((x) == EMB_PORT4_ENABLE) || \ + ((x) == EMB_PORT4_DISABLE)) + +#define IS_VALID_EMB_OSC_SEL(x) \ +( ((x) == EMB_OSC_ENABLE) || \ + ((x) == EMB_OSC_DISABLE)) + +#define IS_VALID_EMB_TMR4_PWM_W_SEL(x) \ +( ((x) == EMB_TMR4_PWM_W_ENABLE) || \ + ((x) == EMB_TMR4_PWM_W_DISABLE)) + +#define IS_VALID_EMB_TMR4_PWM_V_SEL(x) \ +( ((x) == EMB_TMR4_PWM_V_ENABLE) || \ + ((x) == EMB_TMR4_PWM_V_DISABLE)) + +#define IS_VALID_EMB_TMR4_PWM_U_SEL(x) \ +( ((x) == EMB_TMR4_PWM_U_ENABLE) || \ + ((x) == EMB_TMR4_PWM_U_DISABLE)) + +#define IS_VALID_EMB_TMR6_1_PWM_SEL(x) \ +( ((x) == EMB_TMR6_1_PWM_ENABLE) || \ + ((x) == EMB_TMR6_1_PWM_DISABLE)) + +#define IS_VALID_EMB_TMR6_2_PWM_SEL(x) \ +( ((x) == EMB_TMR6_2_PWM_ENABLE) || \ + ((x) == EMB_TMR6_2_PWM_DISABLE)) + +#define IS_VALID_EMB_TMR6_3_PWM_SEL(x) \ +( ((x) == EMB_TMR6_3_PWM_ENABLE) || \ + ((x) == EMB_TMR6_3_PWM_DISABLE)) + +#define IS_VALID_EMB_TMR6_4_PWM_SEL(x) \ +( ((x) == EMB_TMR6_4_PWM_ENABLE) || \ + ((x) == EMB_TMR6_4_PWM_DISABLE)) + +#define IS_VALID_EMB_TMR6_5_PWM_SEL(x) \ +( ((x) == EMB_TMR6_5_PWM_ENABLE) || \ + ((x) == EMB_TMR6_5_PWM_DISABLE)) + +#define IS_VALID_EMB_TMR6_6_PWM_SEL(x) \ +( ((x) == EMB_TMR6_6_PWM_ENABLE) || \ + ((x) == EMB_TMR6_6_PWM_DISABLE)) + +#define IS_VALID_EMB_TMR6_7_PWM_SEL(x) \ +( ((x) == EMB_TMR6_7_PWM_ENABLE) || \ + ((x) == EMB_TMR6_7_PWM_DISABLE)) + +#define IS_VALID_EMB_TMR6_8_PWM_SEL(x) \ +( ((x) == EMB_TMR6_8_PWM_ENABLE) || \ + ((x) == EMB_TMR6_8_PWM_DISABLE)) + +#define IS_VALID_EMB_DETECT_PORT1_LEVEL(x) \ +( ((x) == EMB_DETECT_PORT1_LEVEL_LOW) || \ + ((x) == EMB_DETECT_PORT1_LEVEL_HIGH)) + +#define IS_VALID_EMB_DETECT_PORT2_LEVEL(x) \ +( ((x) == EMB_DETECT_PORT2_LEVEL_LOW) || \ + ((x) == EMB_DETECT_PORT2_LEVEL_HIGH)) + +#define IS_VALID_EMB_DETECT_PORT3_LEVEL(x) \ +( ((x) == EMB_DETECT_PORT3_LEVEL_LOW) || \ + ((x) == EMB_DETECT_PORT3_LEVEL_HIGH)) + +#define IS_VALID_EMB_DETECT_PORT4_LEVEL(x) \ +( ((x) == EMB_DETECT_PORT4_LEVEL_LOW) || \ + ((x) == EMB_DETECT_PORT4_LEVEL_HIGH)) + +#define IS_VALID_EMB_DETECT_TMR4_PWM_W_LEVEL(x) \ +( ((x) == EMB_DETECT_TMR4_PWM_W_BOTH_LOW) || \ + ((x) == EMB_DETECT_TMR4_PWM_W_BOTH_HIGH)) + +#define IS_VALID_EMB_DETECT_TMR4_PWM_V_LEVEL(x) \ +( ((x) == EMB_DETECT_TMR4_PWM_V_BOTH_LOW) || \ + ((x) == EMB_DETECT_TMR4_PWM_V_BOTH_HIGH)) + +#define IS_VALID_EMB_DETECT_TMR4_PWM_U_LEVEL(x) \ +( ((x) == EMB_DETECT_TMR4_PWM_U_BOTH_LOW) || \ + ((x) == EMB_DETECT_TMR4_PWM_U_BOTH_HIGH)) + +#define IS_VALID_EMB_DETECT_TMR6_1_PWM_LEVEL(x) \ +( ((x) == EMB_DETECT_TMR6_1_PWM_BOTH_LOW) || \ + ((x) == EMB_DETECT_TMR6_1_PWM_BOTH_HIGH)) + +#define IS_VALID_EMB_DETECT_TMR6_2_PWM_LEVEL(x) \ +( ((x) == EMB_DETECT_TMR6_2_PWM_BOTH_LOW) || \ + ((x) == EMB_DETECT_TMR6_2_PWM_BOTH_HIGH)) + +#define IS_VALID_EMB_DETECT_TMR6_3_PWM_LEVEL(x) \ +( ((x) == EMB_DETECT_TMR6_3_PWM_BOTH_LOW) || \ + ((x) == EMB_DETECT_TMR6_3_PWM_BOTH_HIGH)) + +#define IS_VALID_EMB_DETECT_TMR6_4_PWM_LEVEL(x) \ +( ((x) == EMB_DETECT_TMR6_4_PWM_BOTH_LOW) || \ + ((x) == EMB_DETECT_TMR6_4_PWM_BOTH_HIGH)) + +#define IS_VALID_EMB_DETECT_TMR6_5_PWM_LEVEL(x) \ +( ((x) == EMB_DETECT_TMR6_5_PWM_BOTH_LOW) || \ + ((x) == EMB_DETECT_TMR6_5_PWM_BOTH_HIGH)) + +#define IS_VALID_EMB_DETECT_TMR6_6_PWM_LEVEL(x) \ +( ((x) == EMB_DETECT_TMR6_6_PWM_BOTH_LOW) || \ + ((x) == EMB_DETECT_TMR6_6_PWM_BOTH_HIGH)) + +#define IS_VALID_EMB_DETECT_TMR6_7_PWM_LEVEL(x) \ +( ((x) == EMB_DETECT_TMR6_7_PWM_BOTH_LOW) || \ + ((x) == EMB_DETECT_TMR6_7_PWM_BOTH_HIGH)) + +#define IS_VALID_EMB_DETECT_TMR6_8_PWM_LEVEL(x) \ +( ((x) == EMB_DETECT_TMR6_8_PWM_BOTH_LOW) || \ + ((x) == EMB_DETECT_TMR6_8_PWM_BOTH_HIGH)) + +#define IS_VALID_EMB_INT(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & (~IS_EMB_INT_MASK)))) + +#define IS_VALID_EMB_FLAG(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & (~IS_EMB_FLAG_MASK)))) + +#define IS_VALID_EMB_STATUS(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & (~IS_EMB_STATUS_MASK)))) + +#define IS_VALID_EMB_PORT1_FILTER_DIV(x) \ +( ((x) == EMB_PORT1_FILTER_NONE) || \ + ((x) == EMB_PORT1_FILTER_CLK_DIV1) || \ + ((x) == EMB_PORT1_FILTER_CLK_DIV8) || \ + ((x) == EMB_PORT1_FILTER_CLK_DIV32) || \ + ((x) == EMB_PORT1_FILTER_CLK_DIV128)) + +#define IS_VALID_EMB_PORT2_FILTER_DIV(x) \ +( ((x) == EMB_PORT2_FILTER_NONE) || \ + ((x) == EMB_PORT2_FILTER_CLK_DIV1) || \ + ((x) == EMB_PORT2_FILTER_CLK_DIV8) || \ + ((x) == EMB_PORT2_FILTER_CLK_DIV32) || \ + ((x) == EMB_PORT2_FILTER_CLK_DIV128)) + +#define IS_VALID_EMB_PORT3_FILTER_DIV(x) \ +( ((x) == EMB_PORT3_FILTER_NONE) || \ + ((x) == EMB_PORT3_FILTER_CLK_DIV1) || \ + ((x) == EMB_PORT3_FILTER_CLK_DIV8) || \ + ((x) == EMB_PORT3_FILTER_CLK_DIV32) || \ + ((x) == EMB_PORT3_FILTER_CLK_DIV128)) + +#define IS_VALID_EMB_PORT4_FILTER_DIV(x) \ +( ((x) == EMB_PORT4_FILTER_NONE) || \ + ((x) == EMB_PORT4_FILTER_CLK_DIV1) || \ + ((x) == EMB_PORT4_FILTER_CLK_DIV8) || \ + ((x) == EMB_PORT4_FILTER_CLK_DIV32) || \ + ((x) == EMB_PORT4_FILTER_CLK_DIV128)) + +#define IS_VALID_EMB_RELEASE_PWM_SEL(x) \ +( ((x) == EMB_RELEASE_PWM_SEL_FLAG_ZERO) || \ + ((x) == EMB_RELEASE_PWM_SEL_STATE_ZERO)) + +#define IS_VALID_EMB_MONITOR_EVENT(x) \ +( ((x) == EMB_EVENT_PWMS) || \ + ((x) == EMB_EVENT_CMP) || \ + ((x) == EMB_EVENT_OSC) || \ + ((x) == EMB_EVENT_PORT1) || \ + ((x) == EMB_EVENT_PORT2) || \ + ((x) == EMB_EVENT_PORT3) || \ + ((x) == EMB_EVENT_PORT4)) +/** + * @} + */ + +/** + * @defgroup EMB_INT_Mask EMB interrupt mask definition + * @{ + */ +#define IS_EMB_INT_MASK (EMB_INT_PWMS | \ + EMB_INT_CMP | \ + EMB_INT_OSC | \ + EMB_INT_PORT1 | \ + EMB_INT_PORT2 | \ + EMB_INT_PORT3 | \ + EMB_INT_PORT4) +/** + * @} + */ + +/** + * @defgroup EMB_Flag_Mask EMB flag mask definition + * @{ + */ +#define IS_EMB_FLAG_MASK (EMB_FLAG_PWMS | \ + EMB_FLAG_CMP | \ + EMB_FLAG_OSC | \ + EMB_FLAG_PORT1 | \ + EMB_FLAG_PORT2 | \ + EMB_FLAG_PORT3 | \ + EMB_FLAG_PORT4) +/** + * @} + */ + +/** + * @defgroup EMB_Status_Mask EMB status mask definition + * @{ + */ +#define IS_EMB_STATUS_MASK (EMB_STATE_PWMS | \ + EMB_STATE_CMP | \ + EMB_STATE_OSC | \ + EMB_STATE_PORT1 | \ + EMB_STATE_PORT2 | \ + EMB_STATE_PORT3 | \ + EMB_STATE_PORT4) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ + +/** + * @defgroup EMB_Global_Functions EMB Global Functions + * @{ + */ + +/** + * @brief Initialize EMB for TMR4. + * @param [in] EMBx Pointer to EMB instance register base + * This parameter can be one of the following values: + * @arg M4_EMB4: EMB group 4 instance register base + * @arg M4_EMB5: EMB group 5 instance register base + * @arg M4_EMB6: EMB group 6 instance register base + * @param [in] pstcInit Pointer to a @ref stc_emb_tmr4_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: pstcInit = NULL + * @note TMR4 feature is supported by M4_EMB4/M4_EMB5/M4_EMB6 + */ +en_result_t EMB_Tmr4Init(M4_EMB_TypeDef *EMBx, + const stc_emb_tmr4_init_t *pstcInit) +{ + uint32_t u32RegVal; + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + /* Check parameters */ + DDL_ASSERT(IS_VALID_EMB_TIMER4(EMBx)); + DDL_ASSERT(IS_VALID_EMB_CMP1_SEL(pstcInit->u32Cmp1)); + DDL_ASSERT(IS_VALID_EMB_CMP2_SEL(pstcInit->u32Cmp2)); + DDL_ASSERT(IS_VALID_EMB_CMP3_SEL(pstcInit->u32Cmp3)); + DDL_ASSERT(IS_VALID_EMB_CMP4_SEL(pstcInit->u32Cmp4)); + DDL_ASSERT(IS_VALID_EMB_OSC_SEL(pstcInit->u32Osc)); + DDL_ASSERT(IS_VALID_EMB_PORT1_SEL(pstcInit->stcPort1.u32PortSel)); + DDL_ASSERT(IS_VALID_EMB_DETECT_PORT1_LEVEL(pstcInit->stcPort1.u32PortLevel)); + DDL_ASSERT(IS_VALID_EMB_PORT1_FILTER_DIV(pstcInit->stcPort1.u32PortFilterDiv)); + DDL_ASSERT(IS_VALID_EMB_PORT2_SEL(pstcInit->stcPort2.u32PortSel)); + DDL_ASSERT(IS_VALID_EMB_DETECT_PORT2_LEVEL(pstcInit->stcPort2.u32PortLevel)); + DDL_ASSERT(IS_VALID_EMB_PORT2_FILTER_DIV(pstcInit->stcPort2.u32PortFilterDiv)); + DDL_ASSERT(IS_VALID_EMB_PORT3_SEL(pstcInit->stcPort3.u32PortSel)); + DDL_ASSERT(IS_VALID_EMB_DETECT_PORT3_LEVEL(pstcInit->stcPort3.u32PortLevel)); + DDL_ASSERT(IS_VALID_EMB_PORT3_FILTER_DIV(pstcInit->stcPort3.u32PortFilterDiv)); + DDL_ASSERT(IS_VALID_EMB_PORT4_SEL(pstcInit->stcPort4.u32PortSel)); + DDL_ASSERT(IS_VALID_EMB_DETECT_PORT4_LEVEL(pstcInit->stcPort4.u32PortLevel)); + DDL_ASSERT(IS_VALID_EMB_PORT4_FILTER_DIV(pstcInit->stcPort4.u32PortFilterDiv)); + DDL_ASSERT(IS_VALID_EMB_TMR4_PWM_U_SEL(pstcInit->stcTmr4PwmU.u32PwmSel)); + DDL_ASSERT(IS_VALID_EMB_DETECT_TMR4_PWM_U_LEVEL(pstcInit->stcTmr4PwmU.u32PwmLevel)); + DDL_ASSERT(IS_VALID_EMB_TMR4_PWM_V_SEL(pstcInit->stcTmr4PwmV.u32PwmSel)); + DDL_ASSERT(IS_VALID_EMB_DETECT_TMR4_PWM_V_LEVEL(pstcInit->stcTmr4PwmV.u32PwmLevel)); + DDL_ASSERT(IS_VALID_EMB_TMR4_PWM_W_SEL(pstcInit->stcTmr4PwmW.u32PwmSel)); + DDL_ASSERT(IS_VALID_EMB_DETECT_TMR4_PWM_W_LEVEL(pstcInit->stcTmr4PwmW.u32PwmLevel)); + + /* Set default value && clear flag */ + WRITE_REG32(EMBx->SOE, 0x00UL); + WRITE_REG32(EMBx->RLSSEL, 0x00UL); + WRITE_REG32(EMBx->INTEN, 0x00UL); + WRITE_REG32(EMBx->STATCLR, (EMB_STATCLR_PWMSFCLR | \ + EMB_STATCLR_CMPFCLR | \ + EMB_STATCLR_OSFCLR | \ + EMB_STATCLR_PORTINFCLR1 | \ + EMB_STATCLR_PORTINFCLR2 | \ + EMB_STATCLR_PORTINFCLR3 | \ + EMB_STATCLR_PORTINFCLR4)); + + /* Set EMB_CTL register */ + u32RegVal = (pstcInit->u32Cmp1 | \ + pstcInit->u32Cmp2 | \ + pstcInit->u32Cmp3 | \ + pstcInit->u32Cmp4 | \ + pstcInit->u32Osc | \ + pstcInit->stcTmr4PwmW.u32PwmSel | \ + pstcInit->stcTmr4PwmV.u32PwmSel | \ + pstcInit->stcTmr4PwmU.u32PwmSel | \ + pstcInit->stcPort1.u32PortSel | \ + pstcInit->stcPort2.u32PortSel | \ + pstcInit->stcPort3.u32PortSel | \ + pstcInit->stcPort4.u32PortSel | \ + pstcInit->stcPort1.u32PortLevel | \ + pstcInit->stcPort2.u32PortLevel | \ + pstcInit->stcPort3.u32PortLevel | \ + pstcInit->stcPort4.u32PortLevel); + WRITE_REG32(EMBx->CTL1, u32RegVal); + + /* Check writing EMB_CTL1 because EMB_CTL1 can write once only after reset */ + if (READ_REG32(EMBx->CTL1) == u32RegVal) + { + u32RegVal = (pstcInit->stcTmr4PwmW.u32PwmLevel | \ + pstcInit->stcTmr4PwmV.u32PwmLevel | \ + pstcInit->stcTmr4PwmU.u32PwmLevel | \ + pstcInit->stcPort1.u32PortFilterDiv | \ + pstcInit->stcPort2.u32PortFilterDiv | \ + pstcInit->stcPort3.u32PortFilterDiv | \ + pstcInit->stcPort4.u32PortFilterDiv); + WRITE_REG32(EMBx->CTL2, u32RegVal); + + /* Check writing EMB_CTL2 because EMB_CTL2 can write once only after reset */ + if (READ_REG32(EMBx->CTL2) == u32RegVal) + { + enRet = Ok; + } + } + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_emb_tmr4_init_t to default values + * @param [out] pstcInit Pointer to a @ref stc_emb_tmr4_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: pstcInit = NULL + */ +en_result_t EMB_Tmr4StructInit(stc_emb_tmr4_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + pstcInit->u32Cmp1 = EMB_CMP1_DISABLE; + pstcInit->u32Cmp2 = EMB_CMP2_DISABLE; + pstcInit->u32Cmp3 = EMB_CMP3_DISABLE; + pstcInit->u32Cmp4 = EMB_CMP4_DISABLE; + pstcInit->u32Osc = EMB_OSC_DISABLE; + pstcInit->stcPort1.u32PortSel = EMB_PORT1_DISABLE; + pstcInit->stcPort1.u32PortLevel = EMB_DETECT_PORT1_LEVEL_HIGH; + pstcInit->stcPort1.u32PortFilterDiv = EMB_PORT1_FILTER_NONE; + pstcInit->stcPort2.u32PortSel = EMB_PORT2_DISABLE; + pstcInit->stcPort2.u32PortLevel = EMB_DETECT_PORT2_LEVEL_HIGH; + pstcInit->stcPort2.u32PortFilterDiv = EMB_PORT2_FILTER_NONE; + pstcInit->stcPort3.u32PortSel = EMB_PORT3_DISABLE; + pstcInit->stcPort3.u32PortLevel = EMB_DETECT_PORT3_LEVEL_HIGH; + pstcInit->stcPort3.u32PortFilterDiv = EMB_PORT3_FILTER_NONE; + pstcInit->stcPort4.u32PortSel = EMB_PORT4_DISABLE; + pstcInit->stcPort4.u32PortLevel = EMB_DETECT_PORT4_LEVEL_HIGH; + pstcInit->stcPort4.u32PortFilterDiv = EMB_PORT4_FILTER_NONE; + pstcInit->stcTmr4PwmU.u32PwmSel = EMB_TMR4_PWM_U_DISABLE; + pstcInit->stcTmr4PwmU.u32PwmLevel = EMB_DETECT_TMR4_PWM_U_BOTH_LOW; + pstcInit->stcTmr4PwmV.u32PwmSel = EMB_TMR4_PWM_V_DISABLE; + pstcInit->stcTmr4PwmV.u32PwmLevel = EMB_DETECT_TMR4_PWM_V_BOTH_LOW; + pstcInit->stcTmr4PwmW.u32PwmSel = EMB_TMR4_PWM_W_DISABLE; + pstcInit->stcTmr4PwmW.u32PwmLevel = EMB_DETECT_TMR4_PWM_W_BOTH_LOW; + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Initialize EMB for TMR6. + * @param [in] EMBx Pointer to EMB instance register base + * This parameter can be one of the following values: + * @arg M4_EMB0: EMB group 0 instance register base + * @arg M4_EMB1: EMB group 1 instance register base + * @arg M4_EMB2: EMB group 2 instance register base + * @arg M4_EMB3: EMB group 3 instance register base + * @param [in] pstcInit Pointer to a @ref stc_emb_tmr6_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: pstcInit = NULL + * @note TMR6 feature is supported by M4_EMB0/M4_EMB1/M4_EMB2/M4_EMB3 + */ +en_result_t EMB_Tmr6Init(M4_EMB_TypeDef *EMBx, + const stc_emb_tmr6_init_t *pstcInit) +{ + uint32_t u32RegVal; + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + /* Check parameters */ + DDL_ASSERT(IS_VALID_EMB_TMR6(EMBx)); + DDL_ASSERT(IS_VALID_EMB_CMP1_SEL(pstcInit->u32Cmp1)); + DDL_ASSERT(IS_VALID_EMB_CMP2_SEL(pstcInit->u32Cmp2)); + DDL_ASSERT(IS_VALID_EMB_CMP3_SEL(pstcInit->u32Cmp3)); + DDL_ASSERT(IS_VALID_EMB_CMP4_SEL(pstcInit->u32Cmp4)); + DDL_ASSERT(IS_VALID_EMB_OSC_SEL(pstcInit->u32Osc)); + DDL_ASSERT(IS_VALID_EMB_PORT1_SEL(pstcInit->stcPort1.u32PortSel)); + DDL_ASSERT(IS_VALID_EMB_DETECT_PORT1_LEVEL(pstcInit->stcPort1.u32PortLevel)); + DDL_ASSERT(IS_VALID_EMB_PORT1_FILTER_DIV(pstcInit->stcPort1.u32PortFilterDiv)); + DDL_ASSERT(IS_VALID_EMB_PORT2_SEL(pstcInit->stcPort2.u32PortSel)); + DDL_ASSERT(IS_VALID_EMB_DETECT_PORT2_LEVEL(pstcInit->stcPort2.u32PortLevel)); + DDL_ASSERT(IS_VALID_EMB_PORT2_FILTER_DIV(pstcInit->stcPort2.u32PortFilterDiv)); + DDL_ASSERT(IS_VALID_EMB_PORT3_SEL(pstcInit->stcPort3.u32PortSel)); + DDL_ASSERT(IS_VALID_EMB_DETECT_PORT3_LEVEL(pstcInit->stcPort3.u32PortLevel)); + DDL_ASSERT(IS_VALID_EMB_PORT3_FILTER_DIV(pstcInit->stcPort3.u32PortFilterDiv)); + DDL_ASSERT(IS_VALID_EMB_PORT4_SEL(pstcInit->stcPort4.u32PortSel)); + DDL_ASSERT(IS_VALID_EMB_DETECT_PORT4_LEVEL(pstcInit->stcPort4.u32PortLevel)); + DDL_ASSERT(IS_VALID_EMB_PORT4_FILTER_DIV(pstcInit->stcPort4.u32PortFilterDiv)); + DDL_ASSERT(IS_VALID_EMB_TMR6_1_PWM_SEL(pstcInit->stcTmr6_1.u32PwmSel)); + DDL_ASSERT(IS_VALID_EMB_DETECT_TMR6_1_PWM_LEVEL(pstcInit->stcTmr6_1.u32PwmLevel)); + DDL_ASSERT(IS_VALID_EMB_TMR6_2_PWM_SEL(pstcInit->stcTmr6_2.u32PwmSel)); + DDL_ASSERT(IS_VALID_EMB_DETECT_TMR6_2_PWM_LEVEL(pstcInit->stcTmr6_2.u32PwmLevel)); + DDL_ASSERT(IS_VALID_EMB_TMR6_3_PWM_SEL(pstcInit->stcTmr6_3.u32PwmSel)); + DDL_ASSERT(IS_VALID_EMB_DETECT_TMR6_3_PWM_LEVEL(pstcInit->stcTmr6_3.u32PwmLevel)); + DDL_ASSERT(IS_VALID_EMB_TMR6_4_PWM_SEL(pstcInit->stcTmr6_4.u32PwmSel)); + DDL_ASSERT(IS_VALID_EMB_DETECT_TMR6_4_PWM_LEVEL(pstcInit->stcTmr6_4.u32PwmLevel)); + DDL_ASSERT(IS_VALID_EMB_TMR6_5_PWM_SEL(pstcInit->stcTmr6_5.u32PwmSel)); + DDL_ASSERT(IS_VALID_EMB_DETECT_TMR6_5_PWM_LEVEL(pstcInit->stcTmr6_5.u32PwmLevel)); + DDL_ASSERT(IS_VALID_EMB_TMR6_6_PWM_SEL(pstcInit->stcTmr6_6.u32PwmSel)); + DDL_ASSERT(IS_VALID_EMB_DETECT_TMR6_6_PWM_LEVEL(pstcInit->stcTmr6_6.u32PwmLevel)); + DDL_ASSERT(IS_VALID_EMB_TMR6_7_PWM_SEL(pstcInit->stcTmr6_7.u32PwmSel)); + DDL_ASSERT(IS_VALID_EMB_DETECT_TMR6_7_PWM_LEVEL(pstcInit->stcTmr6_7.u32PwmLevel)); + DDL_ASSERT(IS_VALID_EMB_TMR6_8_PWM_SEL(pstcInit->stcTmr6_8.u32PwmSel)); + DDL_ASSERT(IS_VALID_EMB_DETECT_TMR6_8_PWM_LEVEL(pstcInit->stcTmr6_8.u32PwmLevel)); + + /* Set default value && clear flag */ + WRITE_REG32(EMBx->SOE, 0x00UL); + WRITE_REG32(EMBx->RLSSEL, 0x00UL); + WRITE_REG32(EMBx->INTEN, 0x00UL); + WRITE_REG32(EMBx->STATCLR, (EMB_STATCLR_PWMSFCLR | \ + EMB_STATCLR_CMPFCLR | \ + EMB_STATCLR_OSFCLR | \ + EMB_STATCLR_PORTINFCLR1 | \ + EMB_STATCLR_PORTINFCLR2 | \ + EMB_STATCLR_PORTINFCLR3 | \ + EMB_STATCLR_PORTINFCLR4)); + + /* Set EMB_CTL register */ + u32RegVal = (pstcInit->u32Cmp1 | \ + pstcInit->u32Cmp2 | \ + pstcInit->u32Cmp3 | \ + pstcInit->u32Cmp4 | \ + pstcInit->u32Osc | \ + pstcInit->stcTmr6_1.u32PwmSel | \ + pstcInit->stcTmr6_2.u32PwmSel | \ + pstcInit->stcTmr6_3.u32PwmSel | \ + pstcInit->stcTmr6_4.u32PwmSel | \ + pstcInit->stcTmr6_5.u32PwmSel | \ + pstcInit->stcTmr6_6.u32PwmSel | \ + pstcInit->stcTmr6_7.u32PwmSel | \ + pstcInit->stcTmr6_8.u32PwmSel | \ + pstcInit->stcPort1.u32PortSel | \ + pstcInit->stcPort2.u32PortSel | \ + pstcInit->stcPort3.u32PortSel | \ + pstcInit->stcPort4.u32PortSel | \ + pstcInit->stcPort1.u32PortLevel | \ + pstcInit->stcPort2.u32PortLevel | \ + pstcInit->stcPort3.u32PortLevel | \ + pstcInit->stcPort4.u32PortLevel); + WRITE_REG32(EMBx->CTL1, u32RegVal); + + /* Check writing EMB_CTL1 because EMB_CTL1 can write once only after reset */ + if (READ_REG32(EMBx->CTL1) == u32RegVal) + { + u32RegVal = (pstcInit->stcTmr6_1.u32PwmLevel | \ + pstcInit->stcTmr6_2.u32PwmLevel | \ + pstcInit->stcTmr6_3.u32PwmLevel | \ + pstcInit->stcTmr6_4.u32PwmLevel | \ + pstcInit->stcTmr6_5.u32PwmLevel | \ + pstcInit->stcTmr6_6.u32PwmLevel | \ + pstcInit->stcTmr6_7.u32PwmLevel | \ + pstcInit->stcTmr6_8.u32PwmLevel | \ + pstcInit->stcPort1.u32PortFilterDiv | \ + pstcInit->stcPort2.u32PortFilterDiv | \ + pstcInit->stcPort3.u32PortFilterDiv | \ + pstcInit->stcPort4.u32PortFilterDiv); + WRITE_REG32(EMBx->CTL2, u32RegVal); + + /* Check writing EMB_CTL2 because EMB_CTL2 can write once only after reset */ + if (READ_REG32(EMBx->CTL2) == u32RegVal) + { + enRet = Ok; + } + } + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_emb_tmr6_init_t to default values + * @param [out] pstcInit Pointer to a @ref stc_emb_tmr6_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: pstcInit = NULL + */ +en_result_t EMB_Tmr6StructInit(stc_emb_tmr6_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + pstcInit->u32Cmp1 = EMB_CMP1_DISABLE; + pstcInit->u32Cmp2 = EMB_CMP2_DISABLE; + pstcInit->u32Cmp3 = EMB_CMP3_DISABLE; + pstcInit->u32Cmp4 = EMB_CMP4_DISABLE; + pstcInit->u32Osc = EMB_OSC_DISABLE; + pstcInit->stcPort1.u32PortSel = EMB_PORT1_DISABLE; + pstcInit->stcPort1.u32PortLevel = EMB_DETECT_PORT1_LEVEL_HIGH; + pstcInit->stcPort1.u32PortFilterDiv = EMB_PORT1_FILTER_NONE; + pstcInit->stcPort2.u32PortSel = EMB_PORT2_DISABLE; + pstcInit->stcPort2.u32PortLevel = EMB_DETECT_PORT2_LEVEL_HIGH; + pstcInit->stcPort2.u32PortFilterDiv = EMB_PORT2_FILTER_NONE; + pstcInit->stcPort3.u32PortSel = EMB_PORT3_DISABLE; + pstcInit->stcPort3.u32PortLevel = EMB_DETECT_PORT3_LEVEL_HIGH; + pstcInit->stcPort3.u32PortFilterDiv = EMB_PORT3_FILTER_NONE; + pstcInit->stcPort4.u32PortSel = EMB_PORT4_DISABLE; + pstcInit->stcPort4.u32PortLevel = EMB_DETECT_PORT4_LEVEL_HIGH; + pstcInit->stcPort4.u32PortFilterDiv = EMB_PORT4_FILTER_NONE; + pstcInit->stcTmr6_1.u32PwmSel = EMB_TMR6_1_PWM_DISABLE; + pstcInit->stcTmr6_1.u32PwmLevel = EMB_DETECT_TMR6_1_PWM_BOTH_LOW; + pstcInit->stcTmr6_2.u32PwmSel = EMB_TMR6_2_PWM_DISABLE; + pstcInit->stcTmr6_2.u32PwmLevel = EMB_DETECT_TMR6_2_PWM_BOTH_LOW; + pstcInit->stcTmr6_3.u32PwmSel = EMB_TMR6_3_PWM_DISABLE; + pstcInit->stcTmr6_3.u32PwmLevel = EMB_DETECT_TMR6_3_PWM_BOTH_LOW; + pstcInit->stcTmr6_4.u32PwmSel = EMB_TMR6_4_PWM_DISABLE; + pstcInit->stcTmr6_4.u32PwmLevel = EMB_DETECT_TMR6_4_PWM_BOTH_LOW; + pstcInit->stcTmr6_5.u32PwmSel = EMB_TMR6_5_PWM_DISABLE; + pstcInit->stcTmr6_5.u32PwmLevel = EMB_DETECT_TMR6_5_PWM_BOTH_LOW; + pstcInit->stcTmr6_6.u32PwmSel = EMB_TMR6_6_PWM_DISABLE; + pstcInit->stcTmr6_6.u32PwmLevel = EMB_DETECT_TMR6_6_PWM_BOTH_LOW; + pstcInit->stcTmr6_7.u32PwmSel = EMB_TMR6_7_PWM_DISABLE; + pstcInit->stcTmr6_7.u32PwmLevel = EMB_DETECT_TMR6_7_PWM_BOTH_LOW; + pstcInit->stcTmr6_8.u32PwmSel = EMB_TMR6_8_PWM_DISABLE; + pstcInit->stcTmr6_8.u32PwmLevel = EMB_DETECT_TMR6_8_PWM_BOTH_LOW; + enRet = Ok; + } + + return enRet; +} + +/** + * @brief De-Initialize EMB function + * @param [in] EMBx Pointer to EMB instance register base + * This parameter can be one of the following values: + * @arg M4_EMB0: EMB group 0 instance register base + * @arg M4_EMB1: EMB group 1 instance register base + * @arg M4_EMB2: EMB group 2 instance register base + * @arg M4_EMB3: EMB group 3 instance register base + * @arg M4_EMB4: EMB group 4 instance register base + * @arg M4_EMB5: EMB group 5 instance register base + * @arg M4_EMB6: EMB group 6 instance register base + * @retval None + */ +void EMB_DeInit(M4_EMB_TypeDef *EMBx) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_EMB(EMBx)); + + /* Configures the registers to reset value. */ + WRITE_REG32(EMBx->SOE, 0x00UL); + WRITE_REG32(EMBx->RLSSEL, 0x00UL); + WRITE_REG32(EMBx->INTEN, 0x00UL); + WRITE_REG32(EMBx->STATCLR, (EMB_STATCLR_PWMSFCLR | \ + EMB_STATCLR_CMPFCLR | \ + EMB_STATCLR_OSFCLR | \ + EMB_STATCLR_PORTINFCLR1 | \ + EMB_STATCLR_PORTINFCLR2 | \ + EMB_STATCLR_PORTINFCLR3 | \ + EMB_STATCLR_PORTINFCLR4)); +} + +/** + * @brief Set the EMB interrupt function + * @param [in] EMBx Pointer to EMB instance register base + * This parameter can be one of the following values: + * @arg M4_EMB0: EMB group 0 instance register base + * @arg M4_EMB1: EMB group 1 instance register base + * @arg M4_EMB2: EMB group 2 instance register base + * @arg M4_EMB3: EMB group 3 instance register base + * @arg M4_EMB4: EMB group 4 instance register base + * @arg M4_EMB5: EMB group 5 instance register base + * @arg M4_EMB6: EMB group 6 instance register base + * @param [in] u32IntSource EMB interrupt source + * This parameter can be one of the following values: + * @arg EMB_INT_PWMS: PWM same phase event interrupt + * @arg EMB_INT_CMP: CMP result event interrupt + * @arg EMB_INT_OSC: OSC stop event interrupt + * @arg EMB_INT_PORT1: Port1 input event interrupt + * @arg EMB_INT_PORT2: Port2 input event interrupt + * @arg EMB_INT_PORT3: Port3 input event interrupt + * @arg EMB_INT_PORT4: Port4 input event interrupt + * @param [in] enNewState The function new state + * @arg This parameter can be: Enable or Disable + * @retval None + */ +void EMB_IntCmd(M4_EMB_TypeDef *EMBx, + uint32_t u32IntSource, + en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_EMB(EMBx)); + DDL_ASSERT(IS_VALID_EMB_INT(u32IntSource)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(EMBx->INTEN, u32IntSource); + } + else + { + CLEAR_REG32_BIT(EMBx->INTEN, u32IntSource); + } +} + +/** + * @brief Set EMB release PWM mode + * @param [in] EMBx Pointer to EMB instance register base + * This parameter can be one of the following values: + * @arg M4_EMB0: EMB group 0 instance register base + * @arg M4_EMB1: EMB group 1 instance register base + * @arg M4_EMB2: EMB group 2 instance register base + * @arg M4_EMB3: EMB group 3 instance register base + * @arg M4_EMB4: EMB group 4 instance register base + * @arg M4_EMB5: EMB group 5 instance register base + * @arg M4_EMB6: EMB group 6 instance register base + * @param [in] u32Event Monitor event + * This parameter can be any composed value of the following values: + * @arg EMB_EVENT_PWMS: PWM same phase event + * @arg EMB_EVENT_CMP: CMP result event + * @arg EMB_EVENT_OSC: OSC stop event + * @arg EMB_EVENT_PORT1: Port1 input event + * @arg EMB_EVENT_PORT2: Port2 input event + * @arg EMB_EVENT_PORT3: Port3 input event + * @arg EMB_EVENT_PORT4: Port4 input event + * @param [in] u32Mode Release mode + * This parameter can be one of the following values: + * @arg EMB_RELEASE_PWM_SEL_FLAG_ZERO: Release PWM when flag bit is zero + * @arg EMB_RELEASE_PWM_SEL_STATE_ZERO: Release PWM when state bit is zero + * @retval None + */ +void EMB_SetReleasePwmMode(M4_EMB_TypeDef *EMBx, + uint32_t u32Event, + uint32_t u32Mode) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_EMB(EMBx)); + DDL_ASSERT(IS_VALID_EMB_MONITOR_EVENT(u32Event)); + DDL_ASSERT(IS_VALID_EMB_RELEASE_PWM_SEL(u32Mode)); + + if (EMB_RELEASE_PWM_SEL_FLAG_ZERO == u32Mode) + { + CLEAR_REG32_BIT(EMBx->RLSSEL, u32Event); + } + else + { + SET_REG32_BIT(EMBx->RLSSEL, u32Event); + } +} + +/** + * @brief Get EMB status + * @param [in] EMBx Pointer to EMB instance register base + * This parameter can be one of the following values: + * @arg M4_EMB0: EMB group 0 instance register base + * @arg M4_EMB1: EMB group 1 instance register base + * @arg M4_EMB2: EMB group 2 instance register base + * @arg M4_EMB3: EMB group 3 instance register base + * @arg M4_EMB4: EMB group 4 instance register base + * @arg M4_EMB5: EMB group 5 instance register base + * @arg M4_EMB6: EMB group 6 instance register base + * @param [in] u32Flag EMB flag + * This parameter can be one of the following values: + * @arg EMB_FLAG_PWMS: PWM same phase trigger stop PWM + * @arg EMB_FLAG_CMP: CMP trigger stop PWM + * @arg EMB_FLAG_OSC: OSC trigger stop PWM + * @arg EMB_FLAG_PORT1: EMB Port1 input trigger stop PWM + * @arg EMB_FLAG_PORT2: EMB Port2 input trigger stop PWM + * @arg EMB_FLAG_PORT3: EMB Port3 input trigger stop PWM + * @arg EMB_FLAG_PORT4: EMB Port4 input trigger stop PWM + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t EMB_GetFlag(const M4_EMB_TypeDef *EMBx, uint32_t u32Flag) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_EMB(EMBx)); + DDL_ASSERT(IS_VALID_EMB_FLAG(u32Flag)); + + return READ_REG32_BIT(EMBx->STAT, u32Flag) ? Set : Reset; +} + +/** + * @brief Get EMB status + * @param [in] EMBx Pointer to EMB instance register base + * This parameter can be one of the following values: + * @arg M4_EMB0: EMB group 0 instance register base + * @arg M4_EMB1: EMB group 1 instance register base + * @arg M4_EMB2: EMB group 2 instance register base + * @arg M4_EMB3: EMB group 3 instance register base + * @arg M4_EMB4: EMB group 4 instance register base + * @arg M4_EMB5: EMB group 5 instance register base + * @arg M4_EMB6: EMB group 6 instance register base + * @param [in] u32Flag EMB flag + * This parameter can be one of the following values: + * @arg EMB_FLAG_PWMS: PWM same phase trigger stop PWM + * @arg EMB_FLAG_CMP: CMP trigger stop PWM + * @arg EMB_FLAG_OSC: OSC trigger stop PWM + * @arg EMB_FLAG_PORT1: EMB Port1 input trigger stop PWM + * @arg EMB_FLAG_PORT2: EMB Port2 input trigger stop PWM + * @arg EMB_FLAG_PORT3: EMB Port3 input trigger stop PWM + * @arg EMB_FLAG_PORT4: EMB Port4 input trigger stop PWM + * @retval None + */ +void EMB_ClearFlag(M4_EMB_TypeDef *EMBx, uint32_t u32Flag) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_EMB(EMBx)); + DDL_ASSERT(IS_VALID_EMB_FLAG(u32Flag)); + + SET_REG32_BIT(EMBx->STATCLR, u32Flag); +} + +/** + * @brief Get EMB status + * @param [in] EMBx Pointer to EMB instance register base + * This parameter can be one of the following values: + * @arg M4_EMB0: EMB group 0 instance register base + * @arg M4_EMB1: EMB group 1 instance register base + * @arg M4_EMB2: EMB group 2 instance register base + * @arg M4_EMB3: EMB group 3 instance register base + * @arg M4_EMB4: EMB group 4 instance register base + * @arg M4_EMB5: EMB group 5 instance register base + * @arg M4_EMB6: EMB group 6 instance register base + * @param [in] u32Status EMB state + * This parameter can be one of the following values: + * @arg EMB_STATE_PWMS: PWM same phase occur + * @arg EMB_STATE_CMP: CMP comapre event occur + * @arg EMB_STATE_OSC: OSC stop event occur + * @arg EMB_STATE_PORT1: EMB Port1 input control state + * @arg EMB_STATE_PORT2: EMB Port2 input control state + * @arg EMB_STATE_PORT3: EMB Port3 input control state + * @arg EMB_STATE_PORT4: EMB Port4 input control state + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t EMB_GetStatus(const M4_EMB_TypeDef *EMBx, + uint32_t u32Status) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_EMB(EMBx)); + DDL_ASSERT(IS_VALID_EMB_STATUS(u32Status)); + + return READ_REG32_BIT(EMBx->STAT, u32Status) ? Set : Reset; +} + +/** + * @brief Start/stop EMB software brake + * @param [in] EMBx Pointer to EMB instance register base + * This parameter can be one of the following values: + * @arg M4_EMB0: EMB group 0 instance register base + * @arg M4_EMB1: EMB group 1 instance register base + * @arg M4_EMB2: EMB group 2 instance register base + * @arg M4_EMB3: EMB group 3 instance register base + * @arg M4_EMB4: EMB group 4 instance register base + * @arg M4_EMB5: EMB group 5 instance register base + * @arg M4_EMB6: EMB group 6 instance register base + * @param [in] enNewState The function new state + * @arg This parameter can be: Enable or Disable + * @retval None + */ +void EMB_SwBrake(M4_EMB_TypeDef *EMBx, en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_EMB(EMBx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + WRITE_REG32(EMBx->SOE, enNewState); +} + +/** + * @} + */ + +#endif /* DDL_EMB_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_eth.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_eth.c new file mode 100644 index 0000000000..61da6d2442 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_eth.c @@ -0,0 +1,4709 @@ +/** + ******************************************************************************* + * @file hc32f4a0_eth.c + * @brief This file provides firmware functions to manage the Ethernet MAC + * Controller(ETH). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Yangjp First version + 2020-07-03 Yangjp Optimize stc_eth_mac_init_t structure + 2020-08-11 Yangjp Fixed a known potential risk in ETH_Init function + 2020-09-04 Yangjp Optimize timeout handling in functions + 2020-11-26 Yangjp Fixed a known potential risk in ETH_DMA_GetReceiveFrame_Interrupt function + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_eth.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_ETH ETH + * @brief Initial Configuration Driver Library + * @{ + */ + +#if (DDL_ETH_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup ETH_Local_Macros ETH Local Macros + * @{ + */ + +/* Ethernet MAC_IFCONFR register Mask */ +#define ETH_MAC_IFCONFR_CLEAR_MASK (ETH_MAC_IFCONFR_RCKINV | ETH_MAC_IFCONFR_TCKINV) + +/* Ethernet MAC_CONFIGR register Mask */ +#define ETH_MAC_CONFIGR_CLEAR_MASK (0x72CF7EF0UL) + +/* Ethernet MAC_FLOCTLR register Mask */ +#define ETH_MAC_FLOCTLR_CLEAR_MASK (0xFFFF00BEUL) + +/* Ethernet MAC_FLTCTLR register Mask */ +#define ETH_MAC_FLTCTLR_CLEAR_MASK (0x802107FFUL) + +/* Ethernet MAC_SMIADDR register Mask */ +#define ETH_MAC_SMIADDR_CLEAR_MASK (0x0000FFC3UL) + +/* Ethernet DMA_BUSMODR register Mask */ +#define ETH_DMA_BUSMODR_CLEAR_MASK (0x0FFFFFFEUL) + +/* Ethernet DMA_OPRMODR register Mask */ +#define ETH_DMA_OPRMODR_CLEAR_MASK (0x0721C0FCUL) + +/* Ethernet PTP_TSPCTLR register Mask */ +#define ETH_PTP_TSPCTLR_CLEAR_MASK (0x0007FE02UL) + +/* Ethernet MAC Address byte length */ +#define ETH_MAC_ADDRESS_BYTE_LENGTH (6U) + +/* Ethernet DMA Tx descriptors Collision Count Shift */ +#define ETH_DMATXDESC_COLLISION_COUNTSHIFT (3UL) + +/* Ethernet DMA Rx descriptors Frame Length Shift */ +#define ETH_DMARXDESC_FRAME_LENGTHSHIFT (16UL) + +/* Ethernet DMA Tx/Rx descriptors Buffer2 Size Shift */ +#define ETH_DMADESC_BUFFER2_SIZESHIFT (16UL) + +/* Ethernet Remote Wake-up frame register length */ +#define ETH_WAKEUP_REGISTER_LENGTH (8U) + +/* Ethernet PTP PPS channel 1 time register address Shift */ +#define ETH_PTP_PPS1_TIME_REG_ADDRSHIFT (0x64U) + +/* Wait timeout(ms) */ +#define ETH_TIMEOUT_WRITE_REGISTER (50UL) +#define ETH_TIMEOUT_SOFTWARE_RESET (200UL) +#define ETH_TIMEOUT_LINK_STATUS (500UL) +#define ETH_TIMEOUT_AUTONEGO_COMPLETE (1000UL) + + +/** + * @defgroup ETH_MAC_Address_Register ETH MAC Address Register + * @brief Get the specified register address of the ETH MAC Address + * @{ + */ +#define ETH_MAC_MACADHRx(__SHIFT__) ((uint32_t)(&(M4_ETH->MAC_MACADHR0)) + (uint32_t)(__SHIFT__)) +#define ETH_MAC_MACADLRx(__SHIFT__) ((uint32_t)(&(M4_ETH->MAC_MACADLR0)) + (uint32_t)(__SHIFT__)) +/** + * @} + */ + +/** + * @defgroup ETH_PTP_Register ETH PTP Register + * @brief Get the specified register address of the ETH PTP PPS channel + * @{ + */ +#define ETH_PTP_TMTSECRx(__SHIFT__) ((uint32_t)(&(M4_ETH->PTP_TMTSECR0)) + (uint32_t)(__SHIFT__)) +#define ETH_PTP_TMTNSERx(__SHIFT__) ((uint32_t)(&(M4_ETH->PTP_TMTNSER0)) + (uint32_t)(__SHIFT__)) +/** + * @} + */ + +/** + * @defgroup ETH_Check_Parameters_Validity ETH Check Parameters Validity + * @{ + */ +#define IS_ETH_PHY_ADDRESS(x) ((x) < 0x20U) + +#define IS_ETH_PHY_REGISTER(x) ((x) < 0x20U) + +#define IS_ETH_AUTO_NEGOTIATION(x) \ +( ((x) == ETH_AUTO_NEGOTIATION_DISABLE) || \ + ((x) == ETH_AUTO_NEGOTIATION_ENABLE)) + +#define IS_ETH_MAC_CHECKSUM_MODE(x) \ +( ((x) == ETH_MAC_CHECKSUM_MODE_SOFTWARE) || \ + ((x) == ETH_MAC_CHECKSUM_MODE_HARDWARE)) + +#define IS_ETH_RX_MODE(x) \ +( ((x) == ETH_RX_MODE_POLLING) || \ + ((x) == ETH_RX_MODE_INTERRUPT)) + +#define IS_ETH_MAC_MEDIA_INTERFACE(x) \ +( ((x) == ETH_MAC_MEDIA_INTERFACE_MII) || \ + ((x) == ETH_MAC_MEDIA_INTERFACE_RMII)) + +#define IS_ETH_MAC_SPEED(x) \ +( ((x) == ETH_MAC_SPEED_10M) || \ + ((x) == ETH_MAC_SPEED_100M)) + +#define IS_ETH_MAC_DUPLEX_MODE(x) \ +( ((x) == ETH_MAC_MODE_HALFDUPLEX) || \ + ((x) == ETH_MAC_MODE_FULLDUPLEX)) + +#define IS_ETH_MAC_TX_CLK_POLARITY(x) \ +( ((x) == ETH_MAC_TX_CLK_POLARITY_KEEP) || \ + ((x) == ETH_MAC_TX_CLK_POLARITY_INVERSE)) + +#define IS_ETH_MAC_RX_REF_CLK_POLARITY(x) \ +( ((x) == ETH_MAC_RX_REF_CLK_POLARITY_KEEP) || \ + ((x) == ETH_MAC_RX_REF_CLK_POLARITY_INVERSE)) + +#define IS_ETH_MAC_SA_MODE(x) \ +( ((x) == ETH_MAC_SA_MODE_BY_DMATXDESC) || \ + ((x) == ETH_MAC_SA_MODE_INSTER_MACADDR0) || \ + ((x) == ETH_MAC_SA_MODE_REPLACE_MACADDR0) || \ + ((x) == ETH_MAC_SA_MODE_INSTER_MACADDR1) || \ + ((x) == ETH_MAC_SA_MODE_REPLACE_MACADDR1)) + +#define IS_ETH_MAC_TYPEFRAME_STRIP_FCS(x) \ +( ((x) == ETH_MAC_TYPEFRAME_STRIP_FCS_DISABLE) || \ + ((x) == ETH_MAC_TYPEFRAME_STRIP_FCS_ENABLE)) + +#define IS_ETH_MAC_WATCHDOG(x) \ +( ((x) == ETH_MAC_WATCHDOG_DISABLE) || \ + ((x) == ETH_MAC_WATCHDOG_ENABLE)) + +#define IS_ETH_MAC_JABBER(x) \ +( ((x) == ETH_MAC_JABBER_DISABLE) || \ + ((x) == ETH_MAC_JABBER_ENABLE)) + +#define IS_ETH_MAC_INTERFRAME_GAP(x) \ +( ((x) == ETH_MAC_INTERFRAME_GAP_96BIT) || \ + ((x) == ETH_MAC_INTERFRAME_GAP_88BIT) || \ + ((x) == ETH_MAC_INTERFRAME_GAP_80BIT) || \ + ((x) == ETH_MAC_INTERFRAME_GAP_72BIT) || \ + ((x) == ETH_MAC_INTERFRAME_GAP_64BIT) || \ + ((x) == ETH_MAC_INTERFRAME_GAP_56BIT) || \ + ((x) == ETH_MAC_INTERFRAME_GAP_48BIT) || \ + ((x) == ETH_MAC_INTERFRAME_GAP_40BIT)) + +#define IS_ETH_MAC_CARRIER_SENCE(x) \ +( ((x) == ETH_MAC_CARRIER_SENCE_DISABLE) || \ + ((x) == ETH_MAC_CARRIER_SENCE_ENABLE)) + +#define IS_ETH_MAC_RECEIVE_OWN(x) \ +( ((x) == ETH_MAC_RECEIVE_OWN_DISABLE) || \ + ((x) == ETH_MAC_RECEIVE_OWN_ENABLE)) + +#define IS_ETH_MAC_CHECKSUM_OFFLAOD(x) \ +( ((x) == ETH_MAC_CHECKSUM_OFFLAOD_DISABLE) || \ + ((x) == ETH_MAC_CHECKSUM_OFFLAOD_ENABLE)) + +#define IS_ETH_MAC_RETRY_TRANSMIT(x) \ +( ((x) == ETH_MAC_RETRY_TRANSMIT_DISABLE) || \ + ((x) == ETH_MAC_RETRY_TRANSMIT_ENABLE)) + +#define IS_ETH_MAC_AUTO_STRIP_PAD_FCS(x) \ +( ((x) == ETH_MAC_AUTO_STRIP_PAD_FCS_DISABLE) || \ + ((x) == ETH_MAC_AUTO_STRIP_PAD_FCS_ENABLE)) + +#define IS_ETH_MAC_BACKOFF_LIMIT(x) \ +( ((x) == ETH_MAC_BACKOFF_LIMIT_10) || \ + ((x) == ETH_MAC_BACKOFF_LIMIT_8) || \ + ((x) == ETH_MAC_BACKOFF_LIMIT_4) || \ + ((x) == ETH_MAC_BACKOFF_LIMIT_1)) + +#define IS_ETH_MAC_DEFFERRAL_CHECK(x) \ +( ((x) == ETH_MAC_DEFFERRAL_CHECK_DISABLE) || \ + ((x) == ETH_MAC_DEFFERRAL_CHECK_ENABLE)) + +#define IS_ETH_MAC_ZERO_QUANTA_PAUSE(x) \ +( ((x) == ETH_MAC_ZERO_QUANTA_PAUSE_DISABLE) || \ + ((x) == ETH_MAC_ZERO_QUANTA_PAUSE_ENABLE)) + +#define IS_ETH_MAC_PAUSE_LOWTHRESHOLD(x) \ +( ((x) == ETH_MAC_PAUSE_LOWTHRESHOLD_MINUS4) || \ + ((x) == ETH_MAC_PAUSE_LOWTHRESHOLD_MINUS28) || \ + ((x) == ETH_MAC_PAUSE_LOWTHRESHOLD_MINUS144) || \ + ((x) == ETH_MAC_PAUSE_LOWTHRESHOLD_MINUS256)) + +#define IS_ETH_MAC_UNICAST_PAUSEFRAME_DETECT(x) \ +( ((x) == ETH_MAC_UNICAST_PAUSEFRAME_DETECT_DISABLE) || \ + ((x) == ETH_MAC_UNICAST_PAUSEFRAME_DETECT_ENABLE)) + +#define IS_ETH_MAC_RECEIVE_FLOWCONTROL(x) \ +( ((x) == ETH_MAC_RECEIVE_FLOWCONTROL_DISABLE) || \ + ((x) == ETH_MAC_RECEIVE_FLOWCONTROL_ENABLE)) + +#define IS_ETH_MAC_TRANSMIT_FLOWCONTROL(x) \ +( ((x) == ETH_MAC_TRANSMIT_FLOWCONTROL_DISABLE) || \ + ((x) == ETH_MAC_TRANSMIT_FLOWCONTROL_ENABLE)) + +#define IS_ETH_MAC_RECEIVE_All(x) \ +( ((x) == ETH_MAC_RECEIVE_All_DISABLE) || \ + ((x) == ETH_MAC_RECEIVE_ALL_ENABLE)) + +#define IS_ETH_MAC_DROP_NOT_TCPUDP(x) \ +( ((x) == ETH_MAC_DROP_NOT_TCPUDP_DISABLE) || \ + ((x) == ETH_MAC_DROP_NOT_TCPUDP_ENABLE)) + +#define IS_ETH_MAC_VLAN_TAG_FILTER(x) \ +( ((x) == ETH_MAC_VLAN_TAG_FILTER_DISABLE) || \ + ((x) == ETH_MAC_VLAN_TAG_FILTER_ENABLE)) + +#define IS_ETH_MAC_SOURCE_ADDR_FILTER(x) \ +( ((x) == ETH_MAC_SOURCE_ADDR_FILTER_DISABLE) || \ + ((x) == ETH_MAC_SOURCE_ADDR_FILTER_NORMAL) || \ + ((x) == ETH_MAC_SOURCE_ADDR_FILTER_INVERSE)) + +#define IS_ETH_MAC_PASS_CTRLFRAME(x) \ +( ((x) == ETH_MAC_PASS_CTRLFRAME_BLOCK_ALL) || \ + ((x) == ETH_MAC_PASS_CTRLFRAME_FORWARD_NOTPAUSE_ALL) || \ + ((x) == ETH_MAC_PASS_CTRLFRAME_FORWARD_ALL) || \ + ((x) == ETH_MAC_PASS_CTRLFRAME_FORWARD_PASSADDRFILTER)) + +#define IS_ETH_MAC_BROADCASTFRAME_RECEPTION(x) \ +( ((x) == ETH_MAC_BROADCASTFRAME_RECEPTION_DISABLE) || \ + ((x) == ETH_MAC_BROADCASTFRAME_RECEPTION_ENABLE)) + +#define IS_ETH_MAC_DESTINATION_ADDR_FILTER(x) \ +( ((x) == ETH_MAC_DESTINATION_ADDR_FILTER_NORMAL) || \ + ((x) == ETH_MAC_DESTINATION_ADDR_FILTER_INVERSE)) + +#define IS_ETH_MAC_MULTICASTFRAME_FILTER(x) \ +( ((x) == ETH_MAC_MULTICASTFRAME_FILTER_NONE) || \ + ((x) == ETH_MAC_MULTICASTFRAME_FILTER_PERFECT) || \ + ((x) == ETH_MAC_MULTICASTFRAME_FILTER_HASHTABLE) || \ + ((x) == ETH_MAC_MULTICASTFRAME_FILTER_PERFECTHASHTABLE)) + +#define IS_ETH_MAC_UNICASTFRAME_FILTER(x) \ +( ((x) == ETH_MAC_UNICASTFRAME_FILTER_PERFECT) || \ + ((x) == ETH_MAC_UNICASTFRAME_FILTER_HASHTABLE) || \ + ((x) == ETH_MAC_UNICASTFRAME_FILTER_PERFECTHASHTABLE)) + +#define IS_ETH_MAC_PROMISCUOUS_MODE(x) \ +( ((x) == ETH_MAC_PROMISCUOUS_MODE_DISABLE) || \ + ((x) == ETH_MAC_PROMISCUOUS_MODE_ENABLE)) + +#define IS_ETH_MAC_TXVLAN_MODE(x) \ +( ((x) == ETH_MAC_TXVLAN_MODE_BY_DMATXDESC) || \ + ((x) == ETH_MAC_TXVLAN_MODE_BYPASS) || \ + ((x) == ETH_MAC_TXVLAN_MODE_REMOVE_TAG) || \ + ((x) == ETH_MAC_TXVLAN_MODE_INSERT_TAG) || \ + ((x) == ETH_MAC_TXVLAN_MODE_REPLACE_TAG)) + +#define IS_ETH_MAC_RXVLAN_FILTER(x) \ +( ((x) == ETH_MAC_RXVLAN_FILTER_NORMAL) || \ + ((x) == ETH_MAC_RXVLAN_FILTER_INVERSE) || \ + ((x) == ETH_MAC_RXVLAN_FILTER_NORMAL_HASHTABLE) || \ + ((x) == ETH_MAC_RXVLAN_FILTER_INVERSE_HASHTABLE)) + +#define IS_ETH_MAC_RXVLAN_COMPARISON(x) \ +( ((x) == ETH_MAC_RXVLAN_COMPARISON_16BIT) || \ + ((x) == ETH_MAC_RXVLAN_COMPARISON_12BIT)) + +#define IS_ETH_MAC_L4_DESTPORT_FILTER(x) \ +( ((x) == ETH_MAC_L4_DESTPORT_FILTER_DISABLE) || \ + ((x) == ETH_MAC_L4_DESTPORT_FILTER_NORMAL) || \ + ((x) == ETH_MAC_L4_DESTPORT_FILTER_INVERSE)) + +#define IS_ETH_MAC_L4_SOURCEPORT_FILTER(x) \ +( ((x) == ETH_MAC_L4_SOURCEPORT_FILTER_DISABLE) || \ + ((x) == ETH_MAC_L4_SOURCEPORT_FILTER_NORMAL) || \ + ((x) == ETH_MAC_L4_SOURCEPORT_FILTER_INVERSE)) + +#define IS_ETH_MAC_L4_PORT_FILTER_PROTOCOL(x) \ +( ((x) == ETH_MAC_L4_PORT_FILTER_PROTOCOL_TCP) || \ + ((x) == ETH_MAC_L4_PORT_FILTER_PROTOCOL_UDP)) + +#define IS_ETH_MAC_L3_DA_FILTER_MASK(x) \ +( ((x) | ETH_MAC_L34CTLR_L3HDBM) == ETH_MAC_L34CTLR_L3HDBM) + +#define IS_ETH_MAC_L3_SA_FILTER_MASK(x) \ +( ((x) | ETH_MAC_L34CTLR_L3HSBM) == ETH_MAC_L34CTLR_L3HSBM) + +#define IS_ETH_MAC_L3_DA_SA_FILTER_MASK(x) \ +( 0UL == ((x) & ((uint32_t)(~(ETH_MAC_L34CTLR_L3HSBM | \ + ETH_MAC_L34CTLR_L3HDBM_0 | \ + ETH_MAC_L34CTLR_L3HDBM_1))))) + +#define IS_ETH_MAC_L3_DA_FILTER(x) \ +( ((x) == ETH_MAC_L3_DA_FILTER_DISABLE) || \ + ((x) == ETH_MAC_L3_DA_FILTER_NORMAL) || \ + ((x) == ETH_MAC_L3_DA_FILTER_INVERSE)) + +#define IS_ETH_MAC_L3_SA_FILTER(x) \ +( ((x) == ETH_MAC_L3_SA_FILTER_DISABLE) || \ + ((x) == ETH_MAC_L3_SA_FILTER_NORMAL) || \ + ((x) == ETH_MAC_L3_SA_FILTER_INVERSE)) + +#define IS_ETH_MAC_L3_ADDR_FILTER_PROTOCOL(x) \ +( ((x) == ETH_MAC_L3_ADDR_FILTER_PROTOCOL_IPV4) || \ + ((x) == ETH_MAC_L3_ADDR_FILTER_PROTOCOL_IPV6)) + +#define IS_ETH_MAC_INTERRUPT_FLAG(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(ETH_MAC_INT_FLAG_TSPIS | \ + ETH_MAC_INT_FLAG_MMCTXIS | \ + ETH_MAC_INT_FLAG_MMCRXIS | \ + ETH_MAC_INT_FLAG_MMCIS | \ + ETH_MAC_INT_FLAG_PMTIS)))))) + +#define IS_ETH_MAC_INTERRUPT(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(ETH_MAC_INT_TSPIM | \ + ETH_MAC_INT_PMTIM)))))) + +#define IS_ETH_MAC_ADDRESS_NORMAL_INDEX(x) \ +( ((x) == ETH_MAC_ADDRESS0) || \ + ((x) == ETH_MAC_ADDRESS1) || \ + ((x) == ETH_MAC_ADDRESS2) || \ + ((x) == ETH_MAC_ADDRESS3) || \ + ((x) == ETH_MAC_ADDRESS4)) + +#define IS_ETH_MAC_ADDRESS_SPECIAL_INDEX(x) \ +( ((x) == ETH_MAC_ADDRESS1) || \ + ((x) == ETH_MAC_ADDRESS2) || \ + ((x) == ETH_MAC_ADDRESS3) || \ + ((x) == ETH_MAC_ADDRESS4)) + +#define IS_ETH_MAC_ADDRESS_FILTER(x) \ +( ((x) == ETH_MAC_ADDRESS_FILTER_DISABLE) || \ + ((x) == ETH_MAC_ADDRESS_FILTER_PERFECT_DA) || \ + ((x) == ETH_MAC_ADDRESS_FILTER_PERFECT_SA)) + +#define IS_ETH_MAC_ADDRESS_MASK(x) \ +( ((x) | ETH_MAC_ADDRESS_MASK_ALL) == ETH_MAC_ADDRESS_MASK_ALL) + +#define IS_ETH_DMA_DESC_SKIP_LENGTH(x) ((x) < 0x20U) + +#define IS_ETH_DMA_BURST_MODE(x) \ +( ((x) == ETH_DMA_BURST_MODE_NORMAL) || \ + ((x) == ETH_DMA_BURST_MODE_FIXED) || \ + ((x) == ETH_DMA_BURST_MODE_MIXED)) + +#define IS_ETH_DMA_ADDRESS_ALIGN(x) \ +( ((x) == ETH_DMA_ADDRESS_ALIGN_DISABLE) || \ + ((x) == ETH_DMA_ADDRESS_ALIGN_ENABLE)) + +#define IS_ETH_DMA_RX_BURST_LENGTH(x) \ +( ((x) == ETH_DMA_RX_BURST_LENGTH_1BEAT) || \ + ((x) == ETH_DMA_RX_BURST_LENGTH_2BEAT) || \ + ((x) == ETH_DMA_RX_BURST_LENGTH_4BEAT) || \ + ((x) == ETH_DMA_RX_BURST_LENGTH_8BEAT) || \ + ((x) == ETH_DMA_RX_BURST_LENGTH_16BEAT) || \ + ((x) == ETH_DMA_RX_BURST_LENGTH_32BEAT) || \ + ((x) == ETH_DMA_RX_BURST_LENGTH_8XPBL_8BEAT) || \ + ((x) == ETH_DMA_RX_BURST_LENGTH_8XPBL_16BEAT) || \ + ((x) == ETH_DMA_RX_BURST_LENGTH_8XPBL_32BEAT) || \ + ((x) == ETH_DMA_RX_BURST_LENGTH_8XPBL_64BEAT) || \ + ((x) == ETH_DMA_RX_BURST_LENGTH_8XPBL_128BEAT) || \ + ((x) == ETH_DMA_RX_BURST_LENGTH_8XPBL_256BEAT)) + +#define IS_ETH_DMA_TX_BURST_LENGTH(x) \ +( ((x) == ETH_DMA_TX_BURST_LENGTH_1BEAT) || \ + ((x) == ETH_DMA_TX_BURST_LENGTH_2BEAT) || \ + ((x) == ETH_DMA_TX_BURST_LENGTH_4BEAT) || \ + ((x) == ETH_DMA_TX_BURST_LENGTH_8BEAT) || \ + ((x) == ETH_DMA_TX_BURST_LENGTH_16BEAT) || \ + ((x) == ETH_DMA_TX_BURST_LENGTH_32BEAT) || \ + ((x) == ETH_DMA_TX_BURST_LENGTH_8XPBL_8BEAT) || \ + ((x) == ETH_DMA_TX_BURST_LENGTH_8XPBL_16BEAT) || \ + ((x) == ETH_DMA_TX_BURST_LENGTH_8XPBL_32BEAT) || \ + ((x) == ETH_DMA_TX_BURST_LENGTH_8XPBL_64BEAT) || \ + ((x) == ETH_DMA_TX_BURST_LENGTH_8XPBL_128BEAT) || \ + ((x) == ETH_DMA_TX_BURST_LENGTH_8XPBL_256BEAT)) + +#define IS_ETH_DMA_ENHANCE_DESCRIPTOR(x) \ +( ((x) == ETH_DMA_ENHANCE_DESCRIPTOR_DISABLE) || \ + ((x) == ETH_DMA_ENHANCE_DESCRIPTOR_ENABLE)) + +#define IS_ETH_DMA_PRIORITY_ARBITRATION(x) \ +( ((x) == ETH_DMA_ARBITRATION_LOOP_RXTX_1_1) || \ + ((x) == ETH_DMA_ARBITRATION_LOOP_RXTX_2_1) || \ + ((x) == ETH_DMA_ARBITRATION_LOOP_RXTX_3_1) || \ + ((x) == ETH_DMA_ARBITRATION_LOOP_RXTX_4_1) || \ + ((x) == ETH_DMA_ARBITRATION_LOOP_TXRX_1_1) || \ + ((x) == ETH_DMA_ARBITRATION_LOOP_TXRX_2_1) || \ + ((x) == ETH_DMA_ARBITRATION_LOOP_TXRX_3_1) || \ + ((x) == ETH_DMA_ARBITRATION_LOOP_TXRX_4_1) || \ + ((x) == ETH_DMA_ARBITRATION_FIXED_RXPRIORTX) || \ + ((x) == ETH_DMA_ARBITRATION_FIXED_TXPRIORRX)) + +#define IS_ETH_DMA_DROP_CHECKSUM_ERRORFRAME(x) \ +( ((x) == ETH_DMA_DROP_CHECKSUM_ERRORFRAME_DISABLE) || \ + ((x) == ETH_DMA_DROP_CHECKSUM_ERRORFRAME_ENABLE)) + +#define IS_ETH_DMA_RECEIVE_STORE_FORWARD(x) \ +( ((x) == ETH_DMA_RECEIVE_STORE_FORWARD_DISABLE) || \ + ((x) == ETH_DMA_RECEIVE_STORE_FORWARD_ENABLE)) + +#define IS_ETH_DMA_FLUSH_RECEIVEDFRAME(x) \ +( ((x) == ETH_DMA_FLUSH_RECEIVEDFRAME_DISABLE) || \ + ((x) == ETH_DMA_FLUSH_RECEIVEDFRAME_ENABLE)) + +#define IS_ETH_DMA_TRANSMIT_STORE_FORWARD(x) \ +( ((x) == ETH_DMA_TRANSMIT_STORE_FORWARD_DISABLE) || \ + ((x) == ETH_DMA_TRANSMIT_STORE_FORWARD_ENABLE)) + +#define IS_ETH_DMA_TRANSMIT_THRESHOLD(x) \ +( ((x) == ETH_DMA_TRANSMIT_THRESHOLD_64BYTE) || \ + ((x) == ETH_DMA_TRANSMIT_THRESHOLD_128BYTE) || \ + ((x) == ETH_DMA_TRANSMIT_THRESHOLD_192BYTE) || \ + ((x) == ETH_DMA_TRANSMIT_THRESHOLD_256BYTE) || \ + ((x) == ETH_DMA_TRANSMIT_THRESHOLD_40BYTE) || \ + ((x) == ETH_DMA_TRANSMIT_THRESHOLD_32BYTE) || \ + ((x) == ETH_DMA_TRANSMIT_THRESHOLD_24BYTE) || \ + ((x) == ETH_DMA_TRANSMIT_THRESHOLD_16BYTE)) + +#define IS_ETH_DMA_FORWARD_ERRORFRAME(x) \ +( ((x) == ETH_DMA_FORWARD_ERRORFRAME_DISABLE) || \ + ((x) == ETH_DMA_FORWARD_ERRORFRAME_ENABLE)) + +#define IS_ETH_DMA_FORWARD_UNDERSIZE_GOODFRAME(x) \ +( ((x) == ETH_DMA_FORWARD_UNDERSIZE_GOODFRAME_DISABLE) || \ + ((x) == ETH_DMA_FORWARD_UNDERSIZE_GOODFRAME_ENABLE)) + +#define IS_ETH_DMA_DROP_JUMBO_FRAME(x) \ +( ((x) == ETH_DMA_DROP_JUMBO_FRAME_DISABLE) || \ + ((x) == ETH_DMA_DROP_JUMBO_FRAME_ENABLE)) + +#define IS_ETH_DMA_RECEIVE_THRESHOLD(x) \ +( ((x) == ETH_DMA_RECEIVE_THRESHOLD_64BYTE) || \ + ((x) == ETH_DMA_RECEIVE_THRESHOLD_32BYTE) || \ + ((x) == ETH_DMA_RECEIVE_THRESHOLD_96BYTE) || \ + ((x) == ETH_DMA_RECEIVE_THRESHOLD_128BYTE)) + +#define IS_ETH_DMA_SECONDFRAME_OPERARTE(x) \ +( ((x) == ETH_DMA_SECONDFRAME_OPERARTE_DISABLE) || \ + ((x) == ETH_DMA_SECONDFRAME_OPERARTE_ENABLE)) + +#define IS_ETH_DMA_INTERRUPT(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(ETH_DMA_INT_NIE | \ + ETH_DMA_INT_AIE | \ + ETH_DMA_INT_ERE | \ + ETH_DMA_INT_FBE | \ + ETH_DMA_INT_ETE | \ + ETH_DMA_INT_RWE | \ + ETH_DMA_INT_RSE | \ + ETH_DMA_INT_RUE | \ + ETH_DMA_INT_RIE | \ + ETH_DMA_INT_UNE | \ + ETH_DMA_INT_OVE | \ + ETH_DMA_INT_TJE | \ + ETH_DMA_INT_TUE | \ + ETH_DMA_INT_TSE | \ + ETH_DMA_INT_TIE)))))) + +#define IS_ETH_DMA_FLAG(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(ETH_DMA_FLAG_PTPS | \ + ETH_DMA_FLAG_PMTS | \ + ETH_DMA_FLAG_MMCS | \ + ETH_DMA_FLAG_NIS | \ + ETH_DMA_FLAG_AIS | \ + ETH_DMA_FLAG_ERS | \ + ETH_DMA_FLAG_FBS | \ + ETH_DMA_FLAG_ETS | \ + ETH_DMA_FLAG_RWS | \ + ETH_DMA_FLAG_RSS | \ + ETH_DMA_FLAG_RUS | \ + ETH_DMA_FLAG_RIS | \ + ETH_DMA_FLAG_UNS | \ + ETH_DMA_FLAG_OVS | \ + ETH_DMA_FLAG_TJS | \ + ETH_DMA_FLAG_TUS | \ + ETH_DMA_FLAG_TSS | \ + ETH_DMA_FLAG_TIS)))))) + +#define IS_ETH_DMA_MISS_FRAME_TYPE(x) \ +( ((x) == ETH_DMA_OVERFLOW_RXFIFO_COUNTER) || \ + ((x) == ETH_DMA_OVERFLOW_MISSFRAME_COUNTER)) + +#define IS_ETH_DMATXDESC_BUFFER_SIZE(x) ((x) <= 0x1FFFFFFFUL) + +#define IS_ETH_DMATXDESC_CHECKSUM_CONTROL(x) \ +( ((x) == ETH_DMATXDESC_CHECKSUM_BYPASS) || \ + ((x) == ETH_DMATXDESC_CHECKSUM_IPV4HEADER) || \ + ((x) == ETH_DMATXDESC_CHECKSUM_TCPUDPICMP_SEGMENT) || \ + ((x) == ETH_DMATXDESC_CHECKSUM_TCPUDPICMP_FULL)) + +#define IS_ETH_DMATXDESC_VLAN_CONTROL(x) \ +( ((x) == ETH_DMATXDESC_VLAN_BYPASS) || \ + ((x) == ETH_DMATXDESC_VLAN_REMOVE_TAG) || \ + ((x) == ETH_DMATXDESC_VLAN_INSERT_TAG) || \ + ((x) == ETH_DMATXDESC_VLAN_REPLACE_TAG)) + +#define IS_ETH_DMATXDESC_SA_CONTROL(x) \ +( ((x) == ETH_DMATXDESC_SA_BYPASS) || \ + ((x) == ETH_DMATXDESC_SA_INSTER_MACADDR0) || \ + ((x) == ETH_DMATXDESC_SA_REPLACE_MACADDR0) || \ + ((x) == ETH_DMATXDESC_SA_INSTER_MACADDR1) || \ + ((x) == ETH_DMATXDESC_SA_REPLACE_MACADDR1)) + +#define IS_ETH_DMATXDESC_STATUS(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(ETH_DMATXDESC_OWN | \ + ETH_DMATXDESC_IOC | \ + ETH_DMATXDESC_TLS | \ + ETH_DMATXDESC_TFS | \ + ETH_DMATXDESC_DCRC | \ + ETH_DMATXDESC_DPAD | \ + ETH_DMATXDESC_TTSE | \ + ETH_DMATXDESC_CRCR | \ + ETH_DMATXDESC_TER | \ + ETH_DMATXDESC_TSAC | \ + ETH_DMATXDESC_TTSS | \ + ETH_DMATXDESC_IHE | \ + ETH_DMATXDESC_ETSUM | \ + ETH_DMATXDESC_JTE | \ + ETH_DMATXDESC_FFF | \ + ETH_DMATXDESC_TPCE | \ + ETH_DMATXDESC_LOCE | \ + ETH_DMATXDESC_NCE | \ + ETH_DMATXDESC_TLCE | \ + ETH_DMATXDESC_ECE | \ + ETH_DMATXDESC_VLF | \ + ETH_DMATXDESC_EDE | \ + ETH_DMATXDESC_UDE | \ + ETH_DMATXDESC_DEE)))))) + +#define IS_ETH_DMARXDESC_STATUS(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(ETH_DMARXDESC_OWN | \ + ETH_DMARXDESC_DAF | \ + ETH_DMARXDESC_ERSUM | \ + ETH_DMARXDESC_DPE | \ + ETH_DMARXDESC_SAF | \ + ETH_DMARXDESC_LEE | \ + ETH_DMARXDESC_OVE | \ + ETH_DMARXDESC_VLAT | \ + ETH_DMARXDESC_RFS | \ + ETH_DMARXDESC_RLS | \ + ETH_DMARXDESC_IPE_TSPA_GF | \ + ETH_DMARXDESC_RLCE | \ + ETH_DMARXDESC_FRAT | \ + ETH_DMARXDESC_WTE | \ + ETH_DMARXDESC_REE | \ + ETH_DMARXDESC_DBE | \ + ETH_DMARXDESC_CRE | \ + ETH_DMARXDESC_DAS_ESA)))))) + +#define IS_ETH_DMARXDESC_EXTEND_STATUS(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(ETH_DMARXDESC_L4FMS | \ + ETH_DMARXDESC_L3FMS | \ + ETH_DMARXDESC_TSPD | \ + ETH_DMARXDESC_PTPV | \ + ETH_DMARXDESC_PTPFT | \ + ETH_DMARXDESC_IPV6DR | \ + ETH_DMARXDESC_IPV4DR | \ + ETH_DMARXDESC_IPCB | \ + ETH_DMARXDESC_IPPE | \ + ETH_DMARXDESC_IPHE)))))) + +#define IS_ETH_DMADESC_OWN(x) \ +( ((x) == ETH_DMADESC_OWN_CPU) || \ + ((x) == ETH_DMADESC_OWN_DMA)) + +#define IS_ETH_DMADESC_BUFFER(x) \ +( ((x) == ETH_DMADESC_BUFFER1) || \ + ((x) == ETH_DMADESC_BUFFER2)) + +#define IS_ETH_PMT_FLAG(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(ETH_PMT_FLAG_RTWKFR | \ + ETH_PMT_FLAG_WKFR | \ + ETH_PMT_FLAG_MPFR)))))) + +#define IS_ETH_MMC_COUNTER_PRESETMODE(x) \ +( ((x) == ETH_MMC_COUNTER_PRESETMODE_DISABLE) || \ + ((x) == ETH_MMC_COUNTER_PRESETMODE_HALFVALUE) || \ + ((x) == ETH_MMC_COUNTER_PRESETMODE_FULLVALUE)) + +#define IS_ETH_MMC_READ_RESET(x) \ +( ((x) == ETH_MMC_READ_RESET_ENABLE) || \ + ((x) == ETH_MMC_READ_RESET_DISABLE)) + +#define IS_ETH_MMC_COUNTER_RELOAD(x) \ +( ((x) == ETH_MMC_COUNTER_RELOAD_ENABLE) || \ + ((x) == ETH_MMC_COUNTER_RELOAD_DISABLE)) + +#define IS_ETH_MMC_TX_INTERRUPT(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(ETH_MMC_INT_TXEDEIM | \ + ETH_MMC_INT_TXUGIM | \ + ETH_MMC_INT_TXCAEIM | \ + ETH_MMC_INT_TXECEIM | \ + ETH_MMC_INT_TXLCEIM | \ + ETH_MMC_INT_TXDEEIM | \ + ETH_MMC_INT_TXMGIM | \ + ETH_MMC_INT_TXBGIM)))))) + +#define IS_ETH_MMC_RX_INTERRUPT(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(ETH_MMC_INT_RXOEIM | \ + ETH_MMC_INT_RXLEIM | \ + ETH_MMC_INT_RXUGIM | \ + ETH_MMC_INT_RXREIM | \ + ETH_MMC_INT_RXAEIM | \ + ETH_MMC_INT_RXCEIM | \ + ETH_MMC_INT_RXMGIM | \ + ETH_MMC_INT_RXBGIM)))))) + +#define IS_ETH_MMC_TX_FLAG(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(ETH_MMC_FLAG_TXEDEIS | \ + ETH_MMC_FLAG_TXUGIS | \ + ETH_MMC_FLAG_TXCAEIS | \ + ETH_MMC_FLAG_TXECEIS | \ + ETH_MMC_FLAG_TXLCEIS | \ + ETH_MMC_FLAG_TXDEEIS | \ + ETH_MMC_FLAG_TXMGIS | \ + ETH_MMC_FLAG_TXBGIS)))))) + +#define IS_ETH_MMC_RX_FLAG(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(ETH_MMC_FLAG_RXOEIS | \ + ETH_MMC_FLAG_RXLEIS | \ + ETH_MMC_FLAG_RXUGIS | \ + ETH_MMC_FLAG_RXREIS | \ + ETH_MMC_FLAG_RXAEIS | \ + ETH_MMC_FLAG_RXCEIS | \ + ETH_MMC_FLAG_RXMGIS | \ + ETH_MMC_FLAG_RXBGIS)))))) + +#define IS_ETH_MMC_REG(x) \ +( ((x) == ETH_MMC_REG_TXBRGFR) || \ + ((x) == ETH_MMC_REG_TXMUGFR) || \ + ((x) == ETH_MMC_REG_TXDEEFR) || \ + ((x) == ETH_MMC_REG_TXLCEFR) || \ + ((x) == ETH_MMC_REG_TXECEFR) || \ + ((x) == ETH_MMC_REG_TXCAEFR) || \ + ((x) == ETH_MMC_REG_TXUNGFR) || \ + ((x) == ETH_MMC_REG_TXEDEFR) || \ + ((x) == ETH_MMC_REG_RXBRGFR) || \ + ((x) == ETH_MMC_REG_RXMUGFR) || \ + ((x) == ETH_MMC_REG_RXCREFR) || \ + ((x) == ETH_MMC_REG_RXALEFR) || \ + ((x) == ETH_MMC_REG_RXRUEFR) || \ + ((x) == ETH_MMC_REG_RXUNGFR) || \ + ((x) == ETH_MMC_REG_RXLEEFR) || \ + ((x) == ETH_MMC_REG_RXOREFR)) + +#define IS_ETH_PTP_FRAME_DA_FILTER(x) \ +( ((x) == ETH_PTP_FRAME_DA_FILTER_ENABLE) || \ + ((x) == ETH_PTP_FRAME_DA_FILTER_DISABLE)) + +#define IS_ETH_PTP_DATAGRAM_VERSION(x) \ +( ((x) == ETH_PTP_DATAGRAM_VERSION_IEEE1588V1) || \ + ((x) == ETH_PTP_DATAGRAM_VERSION_IEEE1588V2)) + +#define IS_ETH_PTP_SUBSECOND_SCALE(x) \ +( ((x) == ETH_PTP_SUBSECOND_SCALE_HEX) || \ + ((x) == ETH_PTP_SUBSECOND_SCALE_DEC)) + +#define IS_ETH_PTP_DATAGRAM_TYPE(x) \ +( ((x) == ETH_PTP_DATAGRAM_TYPE_SYNC_FOLLOW_DELAY) || \ + ((x) == ETH_PTP_DATAGRAM_TYPE_SYNC) || \ + ((x) == ETH_PTP_DATAGRAM_TYPE_DELAY) || \ + ((x) == ETH_PTP_DATAGRAM_TYPE_SYNC_FOLLOW_DELAY_PDELAY) || \ + ((x) == ETH_PTP_DATAGRAM_TYPE_SYNC_PDELAY) || \ + ((x) == ETH_PTP_DATAGRAM_TYPE_DELAY_PDEALY) || \ + ((x) == ETH_PTP_DATAGRAM_TYPE_SYNC_DELAY) || \ + ((x) == ETH_PTP_DATAGRAM_TYPE_PDELAY)) + +#define IS_ETH_PTP_FRAME_TYPE(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(ETH_PTP_FRAME_TYPE_IPV4FRAME | \ + ETH_PTP_FRAME_TYPE_IPV6FRAME | \ + ETH_PTP_FRAME_TYPE_ETHERNETFRAME | \ + ETH_PTP_FRAME_TYPE_ALL_RECEIVEFRAME)))))) + +#define IS_ETH_PTP_CALIBRATION_MODE(x) \ +( ((x) == ETH_PTP_CALIBRATION_MODE_COARSE) || \ + ((x) == ETH_PTP_CALIBRATION_MODE_FINE)) + +#define IS_ETH_PTP_TIME_UPDATE_SIGN(x) \ +( ((x) == ETH_PTP_TIME_UPDATE_SIGN_MINUS) || \ + ((x) == ETH_PTP_TIME_UPDATE_SIGN_PLUS)) + +#define IS_ETH_PTP_FLAG(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(ETH_PTP_FLAG_TSERR1 | \ + ETH_PTP_FLAG_TSTAR1 | \ + ETH_PTP_FLAG_TSERR0 | \ + ETH_PTP_FLAG_TSTAR0 | \ + ETH_PTP_FLAG_TSOVF)))))) + +#define IS_ETH_PPS1_COMPLEX_FUNC(ch, mode, freq) \ +( ((ch) == ETH_PPS_TARGET_CH0) || \ + (((mode) == ETH_PPS_OUTPUT_MODE_CONTINUE) && \ + ((freq) == ETH_PPS_OUTPUT_ONE_PULSE))) + +#define IS_ETH_PTP_SUB_SECOND(x) ((x) <= 0x7FFFFFFFUL) + +#define IS_ETH_PPS_TARGET_TIME_FUNC(x) \ +( ((x) == ETH_PPS_TARGET_TIME_FUNC_INT_EVENT) || \ + ((x) == ETH_PPS_TARGET_TIME_FUNC_INT_PPS_EVENT) || \ + ((x) == ETH_PPS_TARGET_TIME_FUNC_PPS_EVENT)) + +#define IS_ETH_PPS_TARGET_CH(x) \ +( ((x) == ETH_PPS_TARGET_CH0) || \ + ((x) == ETH_PPS_TARGET_CH1)) + +#define IS_ETH_PPS_OUTPUT_MODE(x) \ +( ((x) == ETH_PPS_OUTPUT_MODE_CONTINUE) || \ + ((x) == ETH_PPS_OUTPUT_MODE_SINGLE)) + +#define IS_ETH_PPS_OUTPUT_FREQ(x) \ +( ((x) == ETH_PPS_OUTPUT_FREQ_1HZ) || \ + ((x) == ETH_PPS_OUTPUT_FREQ_2HZ) || \ + ((x) == ETH_PPS_OUTPUT_FREQ_4HZ) || \ + ((x) == ETH_PPS_OUTPUT_FREQ_8HZ) || \ + ((x) == ETH_PPS_OUTPUT_FREQ_16HZ) || \ + ((x) == ETH_PPS_OUTPUT_FREQ_32HZ) || \ + ((x) == ETH_PPS_OUTPUT_FREQ_64HZ) || \ + ((x) == ETH_PPS_OUTPUT_FREQ_128HZ) || \ + ((x) == ETH_PPS_OUTPUT_FREQ_256HZ) || \ + ((x) == ETH_PPS_OUTPUT_FREQ_512HZ) || \ + ((x) == ETH_PPS_OUTPUT_FREQ_1024HZ) || \ + ((x) == ETH_PPS_OUTPUT_FREQ_2048HZ) || \ + ((x) == ETH_PPS_OUTPUT_FREQ_4096HZ) || \ + ((x) == ETH_PPS_OUTPUT_FREQ_8192HZ) || \ + ((x) == ETH_PPS_OUTPUT_FREQ_16384HZ) || \ + ((x) == ETH_PPS_OUTPUT_FREQ_32768HZ) || \ + ((x) == ETH_PPS_OUTPUT_ONE_PULSE)) +/** + * @} + */ + +/** + * @} + */ + + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup ETH_Global_Functions ETH Global Functions + * @{ + */ + +/** + * @brief De-Initialize ETH. + * @param None + * @retval An en_result_t enumeration value: + * - Ok: De-Initialize success + * - ErrorTimeout: De-Initialize timeout + */ +en_result_t ETH_DeInit(void) +{ + en_result_t enRet; + + ETH_MAC_DeInit(); + ETH_DMA_DeInit(); + ETH_MACADDR_DeInit(ETH_MAC_ADDRESS0); + ETH_MACADDR_DeInit(ETH_MAC_ADDRESS1); + ETH_MACADDR_DeInit(ETH_MAC_ADDRESS2); + ETH_MACADDR_DeInit(ETH_MAC_ADDRESS3); + ETH_MACADDR_DeInit(ETH_MAC_ADDRESS4); + ETH_MAC_L3L4FilterDeInit(); + ETH_PTP_DeInit(); + ETH_PPS_DeInit(ETH_PPS_TARGET_CH0); + ETH_PPS_DeInit(ETH_PPS_TARGET_CH1); + enRet = ETH_MMC_DeInit(); + if (Ok == enRet) + { + enRet = ETH_DMA_SoftwareReset(); + } + + return enRet; +} + +/** + * @brief Initialize ETH. + * @param [in] pstcEthHandle Pointer to a @ref stc_eth_handle_t structure + * @param [in] pstcEthInit Pointer to a @ref stc_eth_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: ETH Initialize success + * - ErrorInvalidParameter: pstcEthHandle == NULL or pstcEthInit == NULL or + * PHY Address error + * - ErrorTimeout: Initialize timeout + */ +en_result_t ETH_Init(stc_eth_handle_t *pstcEthHandle, stc_eth_init_t *pstcEthInit) +{ + __IO uint32_t u32Count; + en_result_t enRet = Ok; + uint32_t u32TempReg; + uint32_t u32BusClk; + uint32_t u32PhyTimeout; + uint16_t u16PhyReg = 0U; + + if ((NULL == pstcEthHandle) || (NULL == pstcEthInit)) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_ETH_AUTO_NEGOTIATION(pstcEthHandle->stcCommInit.u16AutoNegotiation)); + DDL_ASSERT(IS_ETH_MAC_CHECKSUM_MODE(pstcEthHandle->stcCommInit.u32ChecksumMode)); + DDL_ASSERT(IS_ETH_RX_MODE(pstcEthHandle->stcCommInit.u32RxMode)); + DDL_ASSERT(IS_ETH_MAC_MEDIA_INTERFACE(pstcEthHandle->stcCommInit.u32MediaInterface)); + + /* Select MII or RMII Mode*/ + MODIFY_REG32(M4_ETH->MAC_IFCONFR, ETH_MAC_IFCONFR_IFSEL, pstcEthHandle->stcCommInit.u32MediaInterface); + /* ETH software reset */ + if (Ok != ETH_DMA_SoftwareReset()) + { + enRet = ErrorTimeout; + } + else + { + /* Get ETH frequency value */ + u32BusClk = SystemCoreClock / (0x01UL << (READ_REG32_BIT(M4_CMU->SCFGR, CMU_SCFGR_PCLK1S) >> CMU_SCFGR_PCLK1S_POS)); + /* Set SMIC bits depending on PCLK1 clock value */ + /* PCLK1 Clock Range between 20-35 MHz */ + if ((u32BusClk >= 20000000UL) && (u32BusClk < 35000000UL)) + { + u32TempReg = ETH_MAC_SMIADDR_SMIC_1; + } + /* PCLK1 Clock Range between 35-60 MHz */ + else if ((u32BusClk >= 35000000UL) && (u32BusClk < 60000000UL)) + { + u32TempReg = ETH_MAC_SMIADDR_SMIC_1 | ETH_MAC_SMIADDR_SMIC_0; + } + /* PCLK1 Clock Range between 60-100 MHz */ + else if ((u32BusClk >= 60000000UL) && (u32BusClk < 100000000UL)) + { + u32TempReg = 0UL; + } + /* PCLK1 Clock Range between 100-120 MHz */ + else + { + u32TempReg = ETH_MAC_SMIADDR_SMIC_0; + } + /* Configure the ETH MDC Clock Range */ + MODIFY_REG32(M4_ETH->MAC_SMIADDR, ETH_MAC_SMIADDR_SMIC, u32TempReg); + + /* PHY initialization and configuration */ + /* Reset the PHY */ + if (Ok != (ETH_PHY_WriteRegister(pstcEthHandle, PHY_BCR, PHY_SOFT_RESET))) + { + enRet = ErrorTimeout; + } + else + { + /* Delay to assure PHY reset */ + DDL_DelayMS(PHY_RESET_DELAY); + + if (ETH_AUTO_NEGOTIATION_DISABLE != pstcEthHandle->stcCommInit.u16AutoNegotiation) + { + u32PhyTimeout = PHY_READ_TIMEOUT * (HCLK_VALUE / 20000UL); + /* Wait for linke status */ + u32Count = ETH_TIMEOUT_LINK_STATUS * (HCLK_VALUE / 20000UL); + while (PHY_LINK_STATUS != (u16PhyReg & PHY_LINK_STATUS)) + { + if (0UL == u32Count) + { + break; + } + if (ErrorTimeout == ETH_PHY_ReadRegister(pstcEthHandle, PHY_BSR, &u16PhyReg)) + { + u32Count = (u32Count > u32PhyTimeout) ? (u32Count - u32PhyTimeout) : 0UL; + } + else + { + u32Count = (u32Count > u32PhyTimeout) ? (u32Count - (u32PhyTimeout / 150U)) : 0UL; + } + } + + if ((0x0000U == u16PhyReg) || (0xFFFFU == u16PhyReg)) + { + enRet = ErrorInvalidParameter; + } + else if (PHY_LINK_STATUS != (u16PhyReg & PHY_LINK_STATUS)) + { + enRet = ErrorTimeout; + } + else + { + /* Enable Auto-Negotiation */ + if (Ok != (ETH_PHY_WriteRegister(pstcEthHandle, PHY_BCR, PHY_AUTONEGOTIATION))) + { + enRet = ErrorTimeout; + } + else + { + /* Wait until the auto-negotiation will be completed */ + u32Count = ETH_TIMEOUT_AUTONEGO_COMPLETE * (HCLK_VALUE / 20000UL); + while (PHY_AUTONEGO_COMPLETE != (u16PhyReg & PHY_AUTONEGO_COMPLETE)) + { + if (0UL == u32Count) + { + break; + } + if (ErrorTimeout == ETH_PHY_ReadRegister(pstcEthHandle, PHY_BSR, &u16PhyReg)) + { + u32Count = (u32Count > u32PhyTimeout) ? (u32Count - u32PhyTimeout) : 0UL; + } + else + { + u32Count = (u32Count > u32PhyTimeout) ? (u32Count - (u32PhyTimeout / 150U)) : 0UL; + } + } + + if (PHY_AUTONEGO_COMPLETE != (u16PhyReg & PHY_AUTONEGO_COMPLETE)) + { + enRet = ErrorTimeout; + } + else + { + /* Read the result of the auto-negotiation */ + /* Configure ETH duplex mode according to the result of automatic negotiation */ + if (0U != (u16PhyReg & (uint16_t)(PHY_100BASE_TX_FD | PHY_10BASE_T_FD))) + { + pstcEthHandle->stcCommInit.u32DuplexMode = ETH_MAC_MODE_FULLDUPLEX; + } + else + { + pstcEthHandle->stcCommInit.u32DuplexMode = ETH_MAC_MODE_HALFDUPLEX; + } + + /* Configure ETH speed according to the result of automatic negotiation */ + if (0U != (u16PhyReg & (uint16_t)(PHY_100BASE_TX_FD | PHY_100BASE_TX_HD))) + { + pstcEthHandle->stcCommInit.u32Speed = ETH_MAC_SPEED_100M; + } + else + { + pstcEthHandle->stcCommInit.u32Speed = ETH_MAC_SPEED_10M; + } + } + } + } + } + /* AutoNegotiation Disable */ + else + { + DDL_ASSERT(IS_ETH_MAC_SPEED(pstcEthHandle->stcCommInit.u32Speed)); + DDL_ASSERT(IS_ETH_MAC_DUPLEX_MODE(pstcEthHandle->stcCommInit.u32DuplexMode)); + + if (Ok != ETH_PHY_WriteRegister(pstcEthHandle, PHY_BCR, + ((uint16_t)(pstcEthHandle->stcCommInit.u32DuplexMode >> 3U) | + (uint16_t)(pstcEthHandle->stcCommInit.u32Speed >> 1U)))) + { + enRet = ErrorTimeout; + } + else + { + /* Delay to assure PHY configuration */ + DDL_DelayMS(PHY_CONFIG_DELAY); + } + } + } + + /* Auto-negotiation failed */ + if (Ok != enRet) + { + pstcEthHandle->stcCommInit.u32DuplexMode = ETH_MAC_MODE_FULLDUPLEX; + pstcEthHandle->stcCommInit.u32Speed = ETH_MAC_SPEED_100M; + } + + /* Config checksum offload */ + if(ETH_MAC_CHECKSUM_MODE_HARDWARE == pstcEthHandle->stcCommInit.u32ChecksumMode) + { + pstcEthInit->stcMacInit.u32ChecksumOffload = ETH_MAC_CHECKSUM_OFFLAOD_ENABLE; + } + else + { + pstcEthInit->stcMacInit.u32ChecksumOffload = ETH_MAC_CHECKSUM_OFFLAOD_DISABLE; + } + + /* Config MAC,DMA,MMC and PTP */ + (void)ETH_MAC_Init(pstcEthHandle, &pstcEthInit->stcMacInit); + (void)ETH_DMA_Init(&pstcEthInit->stcDmaInit); + /* Enable the ETH Rx Interrupt */ + if(ETH_RX_MODE_INTERRUPT == pstcEthHandle->stcCommInit.u32RxMode) + { + ETH_DMA_IntCmd(ETH_DMA_INT_NIE | ETH_DMA_INT_RIE, Enable); + } + } + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_eth_comm_init_t to default values. + * @param [out] pstcCommInit Pointer to a @ref stc_eth_comm_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Structure Initialize success + * - ErrorInvalidParameter: pstcCommInit == NULL + */ +en_result_t ETH_CommStructInit(stc_eth_comm_init_t *pstcCommInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcCommInit) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcCommInit->u16AutoNegotiation = ETH_AUTO_NEGOTIATION_ENABLE; + pstcCommInit->u16PHYAddress = PHY_ADDRESS; + pstcCommInit->au8MACAddr[0] = ETH_MAC_ADDR0; + pstcCommInit->au8MACAddr[1] = ETH_MAC_ADDR1; + pstcCommInit->au8MACAddr[2] = ETH_MAC_ADDR2; + pstcCommInit->au8MACAddr[3] = ETH_MAC_ADDR3; + pstcCommInit->au8MACAddr[4] = ETH_MAC_ADDR4; + pstcCommInit->au8MACAddr[5] = ETH_MAC_ADDR5; + pstcCommInit->u32MediaInterface = ETH_MAC_MEDIA_INTERFACE_MII; + pstcCommInit->u32Speed = ETH_MAC_SPEED_100M; + pstcCommInit->u32DuplexMode = ETH_MAC_MODE_FULLDUPLEX; + pstcCommInit->u32ChecksumMode = ETH_MAC_CHECKSUM_MODE_HARDWARE; + pstcCommInit->u32RxMode = ETH_RX_MODE_POLLING; + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_eth_init_t to default values. + * @param [out] pstcEthInit Pointer to a @ref stc_eth_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Structure Initialize success + * - ErrorInvalidParameter: pstcEthInit == NULL + */ +en_result_t ETH_StructInit(stc_eth_init_t *pstcEthInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcEthInit) + { + enRet = ErrorInvalidParameter; + } + else + { + (void)ETH_MAC_StructInit(&pstcEthInit->stcMacInit); + (void)ETH_DMA_StructInit(&pstcEthInit->stcDmaInit); + } + + return enRet; +} + +/** + * @brief Enable MAC and DMA Transmission/Reception + * @param None + * @retval An en_result_t enumeration value: + * - Ok: Enable success + * - ErrorTimeout: Enable timeout + */ +en_result_t ETH_Start(void) +{ + en_result_t enRet; + + /* Flush Transmit FIFO */ + enRet = ETH_DMA_FlushTransmitFIFO(); + if (Ok == enRet) + { + /* Enable MAC Transmit */ + ETH_MAC_TransmitCmd(Enable); + /* Enable MAC Receive */ + ETH_MAC_ReceiveCmd(Enable); + /* Enable DMA Transmit */ + ETH_DMA_TransmitCmd(Enable); + /* Enable DMA Receive */ + ETH_DMA_ReceiveCmd(Enable); + } + + return enRet; +} + +/** + * @brief Disable MAC and DMA Transmission/Reception + * @param None + * @retval An en_result_t enumeration value: + * - Ok: Disable success + * - ErrorTimeout: Disable timeout + */ +en_result_t ETH_Stop(void) +{ + en_result_t enRet; + + /* Disable DMA Transmit */ + ETH_DMA_TransmitCmd(Disable); + /* Disable DMA Receive */ + ETH_DMA_ReceiveCmd(Disable); + /* Disable MAC Receive */ + ETH_MAC_ReceiveCmd(Disable); + /* Disable MAC Transmit */ + ETH_MAC_TransmitCmd(Disable); + /* Flush Transmit FIFO */ + enRet = ETH_DMA_FlushTransmitFIFO(); + + return enRet; +} + +/******************************************************************************/ +/* PHY Functions */ +/******************************************************************************/ +/** + * @brief Write PHY register + * @note More PHY register could be written depending on the used PHY. + * @param [in] pstcEthHandle Pointer to a @ref stc_eth_handle_t structure + * @param [in] u16Reg PHY register address + * This parameter can be one of the following values: + * @arg PHY_BCR: PHY Basic Control Register + * @arg other value: The value range from 1 to 31 + * @param [in] u16RegVal PHY register value + * @retval An en_result_t enumeration value: + * - Ok: Write register success + * - ErrorInvalidParameter: pstcEthHandle == NULL + * - ErrorTimeout: Write timeout + */ +en_result_t ETH_PHY_WriteRegister(stc_eth_handle_t *pstcEthHandle, uint16_t u16Reg, uint16_t u16RegVal) +{ + __IO uint32_t u32Count; + en_result_t enRet = Ok; + + if (NULL == pstcEthHandle) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_ETH_PHY_ADDRESS(pstcEthHandle->stcCommInit.u16PHYAddress)); + DDL_ASSERT(IS_ETH_PHY_REGISTER(u16Reg)); + + /* Set the MAC_SMIDATR register */ + WRITE_REG32(M4_ETH->MAC_SMIDATR, u16RegVal); + /* Set the MAC_SMIADDR register */ + /* Keep only the MDC Clock Range SMIC[3:0] bits value */ + MODIFY_REG32(M4_ETH->MAC_SMIADDR, ETH_MAC_SMIADDR_CLEAR_MASK, + (((uint32_t)(pstcEthHandle->stcCommInit.u16PHYAddress) << ETH_MAC_SMIADDR_SMIA_POS) | + ((uint32_t)u16Reg << ETH_MAC_SMIADDR_SMIR_POS) | ETH_MAC_SMIADDR_SMIW | ETH_MAC_SMIADDR_SMIB)); + /* Check for the Busy flag */ + u32Count = PHY_WRITE_TIMEOUT * (HCLK_VALUE / 20000UL); + while (0UL != READ_REG32_BIT(M4_ETH->MAC_SMIADDR, ETH_MAC_SMIADDR_SMIB)) + { + if (0UL == u32Count) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + } + + return enRet; +} + +/** + * @brief Read PHY register. + * @note More PHY register could be read depending on the used PHY. + * @param [in] pstcEthHandle Pointer to a @ref stc_eth_handle_t structure + * @param [in] u16Reg PHY register address + * This parameter can be one of the following values: + * @arg PHY_BCR: PHY Basic Control Register + * @arg PHY_BSR: PHY Basic Status Register + * @arg other value: The value range from 2 to 31 + * @param [out] pu16RegVal Pointer to PHY register value + * @retval An en_result_t enumeration value: + * - Ok: Read register success + * - ErrorInvalidParameter: pstcEthHandle == NULL or pu16RegVal == NULL + * - ErrorTimeout: Read timeout + */ +en_result_t ETH_PHY_ReadRegister(stc_eth_handle_t *pstcEthHandle, uint16_t u16Reg, uint16_t *pu16RegVal) +{ + __IO uint32_t u32Count; + en_result_t enRet = Ok; + + if ((NULL == pstcEthHandle) || (NULL == pu16RegVal)) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_ETH_PHY_ADDRESS(pstcEthHandle->stcCommInit.u16PHYAddress)); + DDL_ASSERT(IS_ETH_PHY_REGISTER(u16Reg)); + + *pu16RegVal = 0U; + /* Set the MAC_SMIADDR register */ + /* Keep only the MDC Clock Range SMIC[3:0] bits value */ + MODIFY_REG32(M4_ETH->MAC_SMIADDR, ETH_MAC_SMIADDR_CLEAR_MASK, + (((uint32_t)(pstcEthHandle->stcCommInit.u16PHYAddress) << ETH_MAC_SMIADDR_SMIA_POS) | + ((uint32_t)u16Reg << ETH_MAC_SMIADDR_SMIR_POS) | ETH_MAC_SMIADDR_SMIB)); + /* Check for the Busy flag */ + u32Count = PHY_READ_TIMEOUT * (HCLK_VALUE / 20000UL); + while (0UL != READ_REG32_BIT(M4_ETH->MAC_SMIADDR, ETH_MAC_SMIADDR_SMIB)) + { + if (0UL == u32Count) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + + if (ErrorTimeout != enRet) + { + /* Get the MAC_SMIDATR value */ + *pu16RegVal = (uint16_t)(READ_REG32(M4_ETH->MAC_SMIDATR)); + } + } + + return enRet; +} + +/** + * @brief Enabele or disable PHY loopback. + * @param [in] pstcEthHandle Pointer to a @ref stc_eth_handle_t structure + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval An en_result_t enumeration value: + * - Ok: Set loopback success + * - ErrorInvalidParameter: pstcEthHandle == NULL + * - Error: Communication error + */ +en_result_t ETH_PHY_LoopBackCmd(stc_eth_handle_t *pstcEthHandle, en_functional_state_t enNewSta) +{ + en_result_t enRet; + uint16_t u16RegVal; + + if (NULL == pstcEthHandle) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_ETH_PHY_ADDRESS(pstcEthHandle->stcCommInit.u16PHYAddress)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + enRet = ETH_PHY_ReadRegister(pstcEthHandle, PHY_BCR, &u16RegVal); + if (enRet == Ok) + { + if (Disable != enNewSta) + { + SET_REG16_BIT(u16RegVal, PHY_LOOPBACK); + } + else + { + CLEAR_REG16_BIT(u16RegVal, PHY_LOOPBACK); + } + if (Ok != ETH_PHY_WriteRegister(pstcEthHandle, PHY_BCR, u16RegVal)) + { + enRet = Error; + } + } + } + + return enRet; +} + +/******************************************************************************/ +/* MAC Functions */ +/******************************************************************************/ +/** + * @brief De-Initialize MAC. + * @param None + * @retval None + */ +void ETH_MAC_DeInit(void) +{ + WRITE_REG32(M4_ETH->MAC_IFCONFR, 0UL); + WRITE_REG32(M4_ETH->MAC_CONFIGR, 0x00008000UL); + MODIFY_REG32(M4_ETH->MAC_FLTCTLR, ETH_MAC_FLTCTLR_CLEAR_MASK, 0UL); + WRITE_REG32(M4_ETH->MAC_FLOCTLR, 0UL); + WRITE_REG32(M4_ETH->MAC_INTMSKR, 0UL); + WRITE_REG32(M4_ETH->MAC_SMIADDR, 0UL); + WRITE_REG32(M4_ETH->MAC_SMIDATR, 0UL); + WRITE_REG32(M4_ETH->MAC_RTWKFFR, 0UL); + WRITE_REG32(M4_ETH->MAC_PMTCTLR, 0UL); + WRITE_REG32(M4_ETH->MAC_HASHTLR, 0UL); + WRITE_REG32(M4_ETH->MAC_HASHTHR, 0UL); + WRITE_REG32(M4_ETH->MAC_VTACTLR, 0UL); + WRITE_REG32(M4_ETH->MAC_VTAFLTR, 0UL); + WRITE_REG32(M4_ETH->MAC_VLAHTBR, 0UL); +} + +/** + * @brief Initialize MAC. + * @param [in] pstcEthHandle Pointer to a @ref stc_eth_handle_t structure + * @param [in] pstcMacInit Pointer to a @ref stc_eth_mac_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: MAC Initialize success + * - ErrorInvalidParameter: pstcEthHandle == NULL or pstcMacInit == NULL + */ +en_result_t ETH_MAC_Init(stc_eth_handle_t *pstcEthHandle, const stc_eth_mac_init_t *pstcMacInit) +{ + en_result_t enRet = Ok; + + if ((NULL == pstcEthHandle) || (NULL == pstcMacInit)) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_ETH_MAC_TX_CLK_POLARITY(pstcMacInit->u32TxClkPolarity)); + DDL_ASSERT(IS_ETH_MAC_RX_REF_CLK_POLARITY(pstcMacInit->u32RxRefClkPolarity)); + DDL_ASSERT(IS_ETH_MAC_SA_MODE(pstcMacInit->u32SAInsertMode)); + DDL_ASSERT(IS_ETH_MAC_TYPEFRAME_STRIP_FCS(pstcMacInit->u32TypeFrameStripFCS)); + DDL_ASSERT(IS_ETH_MAC_WATCHDOG(pstcMacInit->u32Watchdog)); + DDL_ASSERT(IS_ETH_MAC_JABBER(pstcMacInit->u32Jabber)); + DDL_ASSERT(IS_ETH_MAC_INTERFRAME_GAP(pstcMacInit->u32InterFrameGap)); + DDL_ASSERT(IS_ETH_MAC_CARRIER_SENCE(pstcMacInit->u32CarrierSense)); + DDL_ASSERT(IS_ETH_MAC_SPEED(pstcEthHandle->stcCommInit.u32Speed)); + DDL_ASSERT(IS_ETH_MAC_RECEIVE_OWN(pstcMacInit->u32ReceiveOwn)); + DDL_ASSERT(IS_ETH_MAC_DUPLEX_MODE(pstcEthHandle->stcCommInit.u32DuplexMode)); + DDL_ASSERT(IS_ETH_MAC_CHECKSUM_OFFLAOD(pstcMacInit->u32ChecksumOffload)); + DDL_ASSERT(IS_ETH_MAC_RETRY_TRANSMIT(pstcMacInit->u32RetryTransmit)); + DDL_ASSERT(IS_ETH_MAC_AUTO_STRIP_PAD_FCS(pstcMacInit->u32AutoStripPadFCS)); + DDL_ASSERT(IS_ETH_MAC_BACKOFF_LIMIT(pstcMacInit->u32BackOffLimit)); + DDL_ASSERT(IS_ETH_MAC_DEFFERRAL_CHECK(pstcMacInit->u32DeferralCheck)); + DDL_ASSERT(IS_ETH_MAC_ZERO_QUANTA_PAUSE(pstcMacInit->u32ZeroQuantaPause)); + DDL_ASSERT(IS_ETH_MAC_PAUSE_LOWTHRESHOLD(pstcMacInit->u32PauseLowThreshold)); + DDL_ASSERT(IS_ETH_MAC_UNICAST_PAUSEFRAME_DETECT(pstcMacInit->u32UnicastPauseFrameDetect)); + DDL_ASSERT(IS_ETH_MAC_RECEIVE_FLOWCONTROL(pstcMacInit->u32ReceiveFlowControl)); + DDL_ASSERT(IS_ETH_MAC_TRANSMIT_FLOWCONTROL(pstcMacInit->u32TransmitFlowControl)); + DDL_ASSERT(IS_ETH_MAC_RECEIVE_All(pstcMacInit->u32ReceiveAll)); + DDL_ASSERT(IS_ETH_MAC_DROP_NOT_TCPUDP(pstcMacInit->u32DropNotTcpUdp)); + DDL_ASSERT(IS_ETH_MAC_VLAN_TAG_FILTER(pstcMacInit->u32VlanTagFilter)); + DDL_ASSERT(IS_ETH_MAC_SOURCE_ADDR_FILTER(pstcMacInit->u32SAFilter)); + DDL_ASSERT(IS_ETH_MAC_PASS_CTRLFRAME(pstcMacInit->u32PassControlFrame)); + DDL_ASSERT(IS_ETH_MAC_BROADCASTFRAME_RECEPTION(pstcMacInit->u32BroadcastFrameReception)); + DDL_ASSERT(IS_ETH_MAC_DESTINATION_ADDR_FILTER(pstcMacInit->u32DAFilter)); + DDL_ASSERT(IS_ETH_MAC_MULTICASTFRAME_FILTER(pstcMacInit->u32MulticastFrameFilter)); + DDL_ASSERT(IS_ETH_MAC_UNICASTFRAME_FILTER(pstcMacInit->u32UnicastFrameFilter)); + DDL_ASSERT(IS_ETH_MAC_PROMISCUOUS_MODE(pstcMacInit->u32PromiscuousMode)); + DDL_ASSERT(IS_ETH_MAC_TXVLAN_MODE(pstcMacInit->u32TxVlanInsertMode)); + DDL_ASSERT(IS_ETH_MAC_RXVLAN_FILTER(pstcMacInit->u32RxVlanFilter)); + DDL_ASSERT(IS_ETH_MAC_RXVLAN_COMPARISON(pstcMacInit->u32RxVlanComparison)); + + /* Set MAC_IFCONFR register */ + MODIFY_REG32(M4_ETH->MAC_IFCONFR, ETH_MAC_IFCONFR_CLEAR_MASK, + (pstcMacInit->u32TxClkPolarity | pstcMacInit->u32RxRefClkPolarity)); + /* Set MAC_CONFIGR register */ + MODIFY_REG32(M4_ETH->MAC_CONFIGR, ETH_MAC_CONFIGR_CLEAR_MASK, + (pstcMacInit->u32SAInsertMode | pstcMacInit->u32TypeFrameStripFCS | + pstcMacInit->u32Watchdog | pstcMacInit->u32Jabber | + pstcMacInit->u32InterFrameGap | pstcMacInit->u32CarrierSense | + pstcEthHandle->stcCommInit.u32Speed | pstcMacInit->u32ReceiveOwn | + pstcMacInit->u32DeferralCheck | pstcEthHandle->stcCommInit.u32DuplexMode | + pstcMacInit->u32ChecksumOffload | pstcMacInit->u32RetryTransmit | + pstcMacInit->u32AutoStripPadFCS | pstcMacInit->u32BackOffLimit)); + /* Set MAC_FLOCTLR register */ + MODIFY_REG32(M4_ETH->MAC_FLOCTLR, ETH_MAC_FLOCTLR_CLEAR_MASK, + ((((uint32_t)pstcMacInit->u16PauseTime) << 16U) | pstcMacInit->u32ZeroQuantaPause | + pstcMacInit->u32PauseLowThreshold | pstcMacInit->u32UnicastPauseFrameDetect | + pstcMacInit->u32ReceiveFlowControl | pstcMacInit->u32TransmitFlowControl)); + /* Set MAC_FLTCTLR register */ + MODIFY_REG32(M4_ETH->MAC_FLTCTLR, ETH_MAC_FLTCTLR_CLEAR_MASK, + (pstcMacInit->u32ReceiveAll | pstcMacInit->u32DropNotTcpUdp | + pstcMacInit->u32PromiscuousMode | pstcMacInit->u32VlanTagFilter | + pstcMacInit->u32SAFilter | pstcMacInit->u32PassControlFrame | + pstcMacInit->u32BroadcastFrameReception | pstcMacInit->u32DAFilter | + pstcMacInit->u32MulticastFrameFilter | pstcMacInit->u32UnicastFrameFilter)); + /* Set Hash table register */ + WRITE_REG32(M4_ETH->MAC_HASHTLR, pstcMacInit->u32HashTableLow); + WRITE_REG32(M4_ETH->MAC_HASHTHR, pstcMacInit->u32HashTableHigh); + /* Set Tx VLAN register */ + WRITE_REG32(M4_ETH->MAC_VTACTLR, (pstcMacInit->u32TxVlanInsertMode | pstcMacInit->u16TxVlanTag)); + /* Set Rx VLAN register */ + WRITE_REG32(M4_ETH->MAC_VTAFLTR, (pstcMacInit->u32RxVlanFilter | + pstcMacInit->u32RxVlanComparison | pstcMacInit->u16RxVlanTag)); + WRITE_REG32(M4_ETH->MAC_VLAHTBR, pstcMacInit->u16RxVlanHashTable); + /* Config MAC address in ETH MAC0 */ + (void)ETH_MACADDR_SetAddress(ETH_MAC_ADDRESS0, pstcEthHandle->stcCommInit.au8MACAddr); + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_eth_mac_init_t to default values. + * @param [out] pstcMacInit Pointer to a @ref stc_eth_mac_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Structure Initialize success + * - ErrorInvalidParameter: pstcMacInit == NULL + */ +en_result_t ETH_MAC_StructInit(stc_eth_mac_init_t *pstcMacInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcMacInit) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcMacInit->u32TxClkPolarity = ETH_MAC_TX_CLK_POLARITY_KEEP; + pstcMacInit->u32RxRefClkPolarity = ETH_MAC_RX_REF_CLK_POLARITY_KEEP; + pstcMacInit->u32SAInsertMode = ETH_MAC_SA_MODE_BY_DMATXDESC; + pstcMacInit->u32TypeFrameStripFCS = ETH_MAC_TYPEFRAME_STRIP_FCS_DISABLE; + pstcMacInit->u32Watchdog = ETH_MAC_WATCHDOG_ENABLE; + pstcMacInit->u32Jabber = ETH_MAC_JABBER_ENABLE; + pstcMacInit->u32InterFrameGap = ETH_MAC_INTERFRAME_GAP_96BIT; + pstcMacInit->u32CarrierSense = ETH_MAC_CARRIER_SENCE_ENABLE; + pstcMacInit->u32ReceiveOwn = ETH_MAC_RECEIVE_OWN_ENABLE; + pstcMacInit->u32ChecksumOffload = ETH_MAC_CHECKSUM_OFFLAOD_DISABLE; + pstcMacInit->u32RetryTransmit = ETH_MAC_RETRY_TRANSMIT_DISABLE; + pstcMacInit->u32AutoStripPadFCS = ETH_MAC_AUTO_STRIP_PAD_FCS_DISABLE; + pstcMacInit->u32BackOffLimit = ETH_MAC_BACKOFF_LIMIT_10; + pstcMacInit->u32DeferralCheck = ETH_MAC_DEFFERRAL_CHECK_DISABLE; + pstcMacInit->u16PauseTime = 0U; + pstcMacInit->u32ZeroQuantaPause = ETH_MAC_ZERO_QUANTA_PAUSE_DISABLE; + pstcMacInit->u32PauseLowThreshold = ETH_MAC_PAUSE_LOWTHRESHOLD_MINUS4; + pstcMacInit->u32UnicastPauseFrameDetect = ETH_MAC_UNICAST_PAUSEFRAME_DETECT_DISABLE; + pstcMacInit->u32ReceiveFlowControl = ETH_MAC_RECEIVE_FLOWCONTROL_DISABLE; + pstcMacInit->u32TransmitFlowControl = ETH_MAC_TRANSMIT_FLOWCONTROL_DISABLE; + pstcMacInit->u32ReceiveAll = ETH_MAC_RECEIVE_All_DISABLE; + pstcMacInit->u32DropNotTcpUdp = ETH_MAC_DROP_NOT_TCPUDP_DISABLE; + + pstcMacInit->u32VlanTagFilter = ETH_MAC_VLAN_TAG_FILTER_DISABLE; + pstcMacInit->u32SAFilter = ETH_MAC_SOURCE_ADDR_FILTER_DISABLE; + pstcMacInit->u32PassControlFrame = ETH_MAC_PASS_CTRLFRAME_FORWARD_NOTPAUSE_ALL; + pstcMacInit->u32BroadcastFrameReception = ETH_MAC_BROADCASTFRAME_RECEPTION_ENABLE; + pstcMacInit->u32DAFilter = ETH_MAC_DESTINATION_ADDR_FILTER_NORMAL; + pstcMacInit->u32MulticastFrameFilter = ETH_MAC_MULTICASTFRAME_FILTER_PERFECT; + pstcMacInit->u32UnicastFrameFilter = ETH_MAC_UNICASTFRAME_FILTER_PERFECT; + pstcMacInit->u32PromiscuousMode = ETH_MAC_PROMISCUOUS_MODE_DISABLE; + pstcMacInit->u32HashTableHigh = 0UL; + pstcMacInit->u32HashTableLow = 0UL; + pstcMacInit->u32TxVlanInsertMode = ETH_MAC_TXVLAN_MODE_BYPASS; + pstcMacInit->u16TxVlanTag = 0U; + pstcMacInit->u32RxVlanFilter = ETH_MAC_RXVLAN_FILTER_NORMAL; + pstcMacInit->u32RxVlanComparison = ETH_MAC_RXVLAN_COMPARISON_16BIT; + pstcMacInit->u16RxVlanTag = 0U; + pstcMacInit->u16RxVlanHashTable = 0U; + } + + return enRet; +} + +/** + * @brief Set MAC duplex mode and speed. + * @param [in] u32DuplexMode MAC duplex mode + * This parameter can be one or any combination of the following values: + * @arg ETH_MAC_MODE_HALFDUPLEX: Half duplex mode + * @arg ETH_MAC_MODE_FULLDUPLEX: Full duplex mode + * @param [in] u32Speed MAC speed + * This parameter can be one or any combination of the following values: + * @arg ETH_MAC_SPEED_10M: 10Mbps + * @arg ETH_MAC_SPEED_100M: 100Mbps + * @retval None + */ +void ETH_MAC_SetDuplexSpeed(uint32_t u32DuplexMode, uint32_t u32Speed) +{ + /* Check parameters */ + DDL_ASSERT(IS_ETH_MAC_DUPLEX_MODE(u32DuplexMode)); + DDL_ASSERT(IS_ETH_MAC_SPEED(u32Speed)); + + MODIFY_REG32(M4_ETH->MAC_CONFIGR, (ETH_MAC_CONFIGR_FES | ETH_MAC_CONFIGR_DM), + (u32DuplexMode | u32Speed)); +} + +/** + * @brief Set MAC hash table. + * @param [in] u32HashHigh Hash table high value. + * @param [in] u32HashLow Hash table low value. + * @retval None + */ +void ETH_MAC_SetHashTable(uint32_t u32HashHigh, uint32_t u32HashLow) +{ + WRITE_REG32(M4_ETH->MAC_HASHTLR, u32HashLow); + WRITE_REG32(M4_ETH->MAC_HASHTHR, u32HashHigh); +} + +/** + * @brief Set MAC Tx VLAN tag value. + * @param [in] u16TxTag The tag value of Tx VLAN. + * @retval None + */ +void ETH_MAC_SetTxVlanTagVal(uint16_t u16TxTag) +{ + MODIFY_REG32(M4_ETH->MAC_VTACTLR, ETH_MAC_VTACTLR_VLANV, u16TxTag); +} + +/** + * @brief Set MAC Rx VLAN tag value. + * @param [in] u16RxTag The tag value of Rx VLAN. + * @retval None + */ +void ETH_MAC_SetRxVlanTagVal(uint16_t u16RxTag) +{ + MODIFY_REG32(M4_ETH->MAC_VTAFLTR, ETH_MAC_VTAFLTR_VLFLT, u16RxTag); +} + +/** + * @brief Set MAC Rx VLAN hash table. + * @param [in] u16HashVal The value of Rx VLAN hash table. + * @retval None + */ +void ETH_MAC_SetRxVlanHashTable(uint16_t u16HashVal) +{ + WRITE_REG32(M4_ETH->MAC_VLAHTBR, u16HashVal); +} + +/** + * @brief Enable or disable MAC loopback. + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void ETH_MAC_LoopBackCmd(en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + WRITE_REG32(bM4_ETH->MAC_CONFIGR_b.LM, enNewSta); +} + +/** + * @brief Enable or disable MAC Back Pressure. + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void ETH_MAC_BackPressureCmd(en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + WRITE_REG32(bM4_ETH->MAC_FLOCTLR_b.FCA_BPA, enNewSta); +} + +/** + * @brief Enable or disable MAC Transmit. + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void ETH_MAC_TransmitCmd(en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + WRITE_REG32(bM4_ETH->MAC_CONFIGR_b.TE, enNewSta); +} + +/** + * @brief Enable or disable MAC Receive. + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void ETH_MAC_ReceiveCmd(en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + WRITE_REG32(bM4_ETH->MAC_CONFIGR_b.RE, enNewSta); +} + +/** + * @brief Enable or disable MAC interrupt. + * @param [in] u32IntSrc MAC interrupt source type + * This parameter can be one or any combination of the following values: + * @arg ETH_MAC_INT_TSPIM: Time stamp trigger interrupt (on MAC) + * @arg ETH_MAC_INT_PMTIM: PMT interrupt (on MAC) + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void ETH_MAC_IntCmd(uint32_t u32IntSrc, en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_ETH_MAC_INTERRUPT(u32IntSrc)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + if (Disable != enNewSta) + { + CLEAR_REG32_BIT(M4_ETH->MAC_INTMSKR, u32IntSrc); + } + else + { + SET_REG32_BIT(M4_ETH->MAC_INTMSKR, u32IntSrc); + } +} + +/** + * @brief Get MAC interrupt status. + * @param [in] u32Flag MAC interrupt flag type + * This parameter can be one or any combination of the following values: + * @arg ETH_MAC_INT_FLAG_TSPIS: Time stamp trigger flag (on MAC) + * @arg ETH_MAC_INT_FLAG_MMCTXIS: MMC transmit flag + * @arg ETH_MAC_INT_FLAG_MMCRXIS: MMC receive flag + * @arg ETH_MAC_INT_FLAG_MMCIS: MMC flag (on MAC) + * @arg ETH_MAC_INT_FLAG_PMTIS: PMT flag (on MAC) + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t ETH_MAC_GetIntStatus(uint32_t u32Flag) +{ + en_flag_status_t enFlagSta = Reset; + + /* Check parameters */ + DDL_ASSERT(IS_ETH_MAC_INTERRUPT_FLAG(u32Flag)); + + if (0UL != (READ_REG32_BIT(M4_ETH->MAC_INTSTSR, u32Flag))) + { + enFlagSta = Set; + } + + return enFlagSta; +} + +/******************************************************************************/ +/* MAC Address Functions */ +/******************************************************************************/ +/** + * @brief De-Initialize MAC Address. + * @param [in] u32Index MAC address index. + * This parameter can be one of the following values: + * @arg ETH_MAC_ADDRESS0: MAC address 0 + * @arg ETH_MAC_ADDRESS1: MAC address 1 + * @arg ETH_MAC_ADDRESS2: MAC address 2 + * @arg ETH_MAC_ADDRESS3: MAC address 3 + * @arg ETH_MAC_ADDRESS4: MAC address 4 + * @retval None + */ +void ETH_MACADDR_DeInit(uint32_t u32Index) +{ + __IO uint32_t *MACADHR; + __IO uint32_t *MACADLR; + uint32_t u32MacHigh = 0x0000FFFFUL; + + DDL_ASSERT(IS_ETH_MAC_ADDRESS_NORMAL_INDEX(u32Index)); + + MACADHR = (__IO uint32_t *)ETH_MAC_MACADHRx(u32Index); + MACADLR = (__IO uint32_t *)ETH_MAC_MACADLRx(u32Index); + if (ETH_MAC_ADDRESS0 == u32Index) + { + u32MacHigh |= 0x80000000UL; + } + WRITE_REG32(*MACADHR, u32MacHigh); + WRITE_REG32(*MACADLR, 0xFFFFFFFFUL); +} + +/** + * @brief Initialize MAC Address. + * @param [in] u32Index MAC address index. + * This parameter can be one of the following values: + * @arg ETH_MAC_ADDRESS0: MAC address 0 + * @arg ETH_MAC_ADDRESS1: MAC address 1 + * @arg ETH_MAC_ADDRESS2: MAC address 2 + * @arg ETH_MAC_ADDRESS3: MAC address 3 + * @arg ETH_MAC_ADDRESS4: MAC address 4 + * @param [in] pstcMacAddrInit Pointer to a @ref stc_eth_mac_addr_config_t structure + * @retval An en_result_t enumeration value: + * - Ok: MAC Address Initialize success + * - ErrorInvalidParameter: pstcMacAddrInit == NULL + */ +en_result_t ETH_MACADDR_Init(uint32_t u32Index, const stc_eth_mac_addr_config_t *pstcMacAddrInit) +{ + en_result_t enRet = Ok; + __IO uint32_t *MACADHR; + __IO uint32_t *MACADLR; + uint32_t u32TempReg; + uint32_t *pu32AddrLow; + + if (NULL == pstcMacAddrInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_ETH_MAC_ADDRESS_NORMAL_INDEX(u32Index)); + DDL_ASSERT(IS_ETH_MAC_ADDRESS_FILTER(pstcMacAddrInit->u32MacAddrFilter)); + DDL_ASSERT(IS_ETH_MAC_ADDRESS_MASK(pstcMacAddrInit->u32MacAddrMask)); + + MACADHR = (__IO uint32_t *)ETH_MAC_MACADHRx(u32Index); + MACADLR = (__IO uint32_t *)ETH_MAC_MACADLRx(u32Index); + /* Set MAC address high register */ + u32TempReg = ((uint32_t)pstcMacAddrInit->au8MACAddr[5] << 8U) | (uint32_t)pstcMacAddrInit->au8MACAddr[4]; + if (ETH_MAC_ADDRESS0 != u32Index) + { + u32TempReg |= pstcMacAddrInit->u32MacAddrFilter | pstcMacAddrInit->u32MacAddrMask; + } + WRITE_REG32(*MACADHR, u32TempReg); + /* Set MAC address low register */ + pu32AddrLow = (uint32_t *)((uint32_t)&(pstcMacAddrInit->au8MACAddr[0])); + WRITE_REG32(*MACADLR, *pu32AddrLow); + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_eth_mac_addr_config_t to default values. + * @param [out] pstcMacAddrInit Pointer to a @ref stc_eth_mac_addr_config_t structure + * @retval An en_result_t enumeration value: + * - Ok: Structure Initialize success + * - ErrorInvalidParameter: pstcMacAddrInit == NULL + */ +en_result_t ETH_MACADDR_StructInit(stc_eth_mac_addr_config_t *pstcMacAddrInit) +{ + en_result_t enRet = Ok; + uint8_t i; + + if (NULL == pstcMacAddrInit) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcMacAddrInit->u32MacAddrFilter = ETH_MAC_ADDRESS_FILTER_DISABLE; + pstcMacAddrInit->u32MacAddrMask = ETH_MAC_ADDRESS_MASK_DISABLE; + for (i=0U; iau8MACAddr[i] = 0x00U; + } + } + + return enRet; +} + +/** + * @brief Set MAC Address. + * @param [in] u32Index MAC address index. + * This parameter can be one of the following values: + * @arg ETH_MAC_ADDRESS0: MAC address 0 + * @arg ETH_MAC_ADDRESS1: MAC address 1 + * @arg ETH_MAC_ADDRESS2: MAC address 2 + * @arg ETH_MAC_ADDRESS3: MAC address 3 + * @arg ETH_MAC_ADDRESS4: MAC address 4 + * @param [in] au8Addr Pointer to MAC address buffer(6 bytes). + * @retval An en_result_t enumeration value: + * - Ok: Set address success + * - ErrorInvalidParameter: au8Addr == NULL + */ +en_result_t ETH_MACADDR_SetAddress(uint32_t u32Index, uint8_t au8Addr[]) +{ + en_result_t enRet = Ok; + __IO uint32_t *MACADHR; + __IO uint32_t *MACADLR; + uint32_t u32TempReg; + uint32_t *pu32AddrLow; + + if (NULL == au8Addr) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_ETH_MAC_ADDRESS_NORMAL_INDEX(u32Index)); + + MACADHR = (__IO uint32_t *)ETH_MAC_MACADHRx(u32Index); + MACADLR = (__IO uint32_t *)ETH_MAC_MACADLRx(u32Index); + /* Set MAC address high register */ + u32TempReg = ((uint32_t)au8Addr[5] << 8U) | (uint32_t)au8Addr[4]; + WRITE_REG32(*MACADHR, u32TempReg); + /* Set MAC address low register */ + pu32AddrLow = (uint32_t *)((uint32_t)&(au8Addr[0])); + WRITE_REG32(*MACADLR, *pu32AddrLow); + } + + return enRet; +} + +/** + * @brief Get MAC Address. + * @param [in] u32Index MAC address index. + * This parameter can be one of the following values: + * @arg ETH_MAC_ADDRESS0: MAC address 0 + * @arg ETH_MAC_ADDRESS1: MAC address 1 + * @arg ETH_MAC_ADDRESS2: MAC address 2 + * @arg ETH_MAC_ADDRESS3: MAC address 3 + * @arg ETH_MAC_ADDRESS4: MAC address 4 + * @param [out] au8Addr Pointer to MAC address buffer(6 bytes). + * @retval An en_result_t enumeration value: + * - Ok: Set address success + * - ErrorInvalidParameter: au8Addr == NULL + */ +en_result_t ETH_MACADDR_GetAddress(uint32_t u32Index, uint8_t au8Addr[]) +{ + en_result_t enRet = Ok; + __IO uint32_t *MACADHR; + __IO uint32_t *MACADLR; + uint32_t u32TempReg; + uint32_t *pu32AddrLow; + + if (NULL == au8Addr) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_ETH_MAC_ADDRESS_NORMAL_INDEX(u32Index)); + + MACADHR = (__IO uint32_t *)ETH_MAC_MACADHRx(u32Index); + MACADLR = (__IO uint32_t *)ETH_MAC_MACADLRx(u32Index); + /* Get MAC address high */ + u32TempReg = READ_REG32(*MACADHR); + au8Addr[5] = (uint8_t)((u32TempReg >> 8U) & 0x000000FFUL); + au8Addr[4] = (uint8_t)(u32TempReg & 0x000000FFUL); + /* Get MAC address low */ + pu32AddrLow = (uint32_t *)((uint32_t)&(au8Addr[0])); + *pu32AddrLow = READ_REG32(*MACADLR); + } + + return enRet; +} + +/** + * @brief Set MAC Address filter mode. + * @param [in] u32Index MAC address index. + * This parameter can be one of the following values: + * @arg ETH_MAC_ADDRESS1: MAC address 1 + * @arg ETH_MAC_ADDRESS2: MAC address 2 + * @arg ETH_MAC_ADDRESS3: MAC address 3 + * @arg ETH_MAC_ADDRESS4: MAC address 4 + * @param [in] u32Mode MAC address filter mode. + * This parameter can be one of the following values: + * @arg ETH_MAC_ADDRESS_FILTER_DISABLE: Disable perfect filter with MAC address. + * @arg ETH_MAC_ADDRESS_FILTER_PERFECT_DA: Filter the DA address of the received frame with MAC address. + * @arg ETH_MAC_ADDRESS_FILTER_PERFECT_SA: Filter the SA address of the received frame with MAC address. + * @retval None + */ +void ETH_MACADDR_SetFilterMode(uint32_t u32Index, uint32_t u32Mode) +{ + __IO uint32_t *MACADHR; + + /* Check parameters */ + DDL_ASSERT(IS_ETH_MAC_ADDRESS_SPECIAL_INDEX(u32Index)); + DDL_ASSERT(IS_ETH_MAC_ADDRESS_FILTER(u32Mode)); + + MACADHR = (__IO uint32_t *)ETH_MAC_MACADHRx(u32Index); + MODIFY_REG32(*MACADHR, (ETH_MAC_MACADHR1_SA1 | ETH_MAC_MACADHR1_AE1), u32Mode); +} + +/** + * @brief Set MAC Address Transmit priority ratio. + * @param [in] u32Index MAC address index. + * This parameter can be one of the following values: + * @arg ETH_MAC_ADDRESS1: MAC address 1 + * @arg ETH_MAC_ADDRESS2: MAC address 2 + * @arg ETH_MAC_ADDRESS3: MAC address 3 + * @arg ETH_MAC_ADDRESS4: MAC address 4 + * @param [in] u32Mask MAC address filter mask. + * This parameter can be one of the following values or any combination + * of BYTE1 through BYTE6: + * @arg ETH_MAC_ADDRESS_MASK_DISABLE: Disable MAC Address Mask + * @arg ETH_MAC_ADDRESS_MASK_BYTE6: Mask MAC Address high reg bits [15:8] + * @arg ETH_MAC_ADDRESS_MASK_BYTE5: Mask MAC Address high reg bits [7:0] + * @arg ETH_MAC_ADDRESS_MASK_BYTE4: Mask MAC Address low reg bits [31:24] + * @arg ETH_MAC_ADDRESS_MASK_BYTE3: Mask MAC Address low reg bits [23:16] + * @arg ETH_MAC_ADDRESS_MASK_BYTE2: Mask MAC Address low reg bits [15:8] + * @arg ETH_MAC_ADDRESS_MASK_BYTE1: Mask MAC Address low reg bits [7:0] + * @arg ETH_MAC_ADDRESS_MASK_ALL: Mask MAC Address low reg bits [31:0] and low high bits [15:0] + * @retval None + */ +void ETH_MACADDR_SetFilterMask(uint32_t u32Index, uint32_t u32Mask) +{ + __IO uint32_t *MACADHR; + + /* Check parameters */ + DDL_ASSERT(IS_ETH_MAC_ADDRESS_SPECIAL_INDEX(u32Index)); + DDL_ASSERT(IS_ETH_MAC_ADDRESS_MASK(u32Mask)); + + MACADHR = (__IO uint32_t *)ETH_MAC_MACADHRx(u32Index); + MODIFY_REG32(*MACADHR, ETH_MAC_MACADHR1_MBC1, u32Mask); +} + +/******************************************************************************/ +/* MAC L3L4 Filter Functions */ +/******************************************************************************/ +/** + * @brief De-Initialize MAC L3L4 Filter. + * @param None + * @retval None + */ +void ETH_MAC_L3L4FilterDeInit(void) +{ + WRITE_REG32(bM4_ETH->MAC_FLTCTLR_b.IPFE, Disable); + WRITE_REG32(M4_ETH->MAC_L34CTLR, 0UL); + WRITE_REG32(M4_ETH->MAC_L4PORTR, 0UL); + WRITE_REG32(M4_ETH->MAC_L3ADDRR0, 0UL); + WRITE_REG32(M4_ETH->MAC_L3ADDRR1, 0UL); + WRITE_REG32(M4_ETH->MAC_L3ADDRR2, 0UL); + WRITE_REG32(M4_ETH->MAC_L3ADDRR3, 0UL); +} + +/** + * @brief Initialize MAC L3L4 Filter. + * @param [in] pstcL3L4FilterInit Pointer to a @ref stc_eth_l3l4_filter_config_t structure + * @retval An en_result_t enumeration value: + * - Ok: MAC L3L4 Filter Initialize success + * - ErrorInvalidParameter: pstcL3L4FilterInit == NULL + */ +en_result_t ETH_MAC_L3L4FilterInit(const stc_eth_l3l4_filter_config_t *pstcL3L4FilterInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcL3L4FilterInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_ETH_MAC_L4_DESTPORT_FILTER(pstcL3L4FilterInit->u32L4DestPortFilter)); + DDL_ASSERT(IS_ETH_MAC_L4_SOURCEPORT_FILTER(pstcL3L4FilterInit->u32L4SourcePortFilter)); + DDL_ASSERT(IS_ETH_MAC_L4_PORT_FILTER_PROTOCOL(pstcL3L4FilterInit->u32L4PortFilterProtocol)); + DDL_ASSERT(IS_ETH_MAC_L3_DA_FILTER_MASK(pstcL3L4FilterInit->u32L3Ipv4DAFilterMask)); + DDL_ASSERT(IS_ETH_MAC_L3_SA_FILTER_MASK(pstcL3L4FilterInit->u32L3Ipv4SAFilterMask)); + DDL_ASSERT(IS_ETH_MAC_L3_DA_SA_FILTER_MASK(pstcL3L4FilterInit->u32L3Ipv6AddrFilterMask)); + DDL_ASSERT(IS_ETH_MAC_L3_DA_FILTER(pstcL3L4FilterInit->u32L3DAFilter)); + DDL_ASSERT(IS_ETH_MAC_L3_SA_FILTER(pstcL3L4FilterInit->u32L3SAFilter)); + DDL_ASSERT(IS_ETH_MAC_L3_ADDR_FILTER_PROTOCOL(pstcL3L4FilterInit->u32L3AddrFilterProtocol)); + + /* Set L3/L4 control register */ + if (ETH_MAC_L3_ADDR_FILTER_PROTOCOL_IPV4 != pstcL3L4FilterInit->u32L3AddrFilterProtocol) + { + WRITE_REG32(M4_ETH->MAC_L34CTLR, + (pstcL3L4FilterInit->u32L4DestPortFilter | pstcL3L4FilterInit->u32L4SourcePortFilter | + pstcL3L4FilterInit->u32L4PortFilterProtocol | pstcL3L4FilterInit->u32L3Ipv6AddrFilterMask | + pstcL3L4FilterInit->u32L3DAFilter | pstcL3L4FilterInit->u32L3SAFilter | + pstcL3L4FilterInit->u32L3AddrFilterProtocol)); + WRITE_REG32(M4_ETH->MAC_L3ADDRR0, pstcL3L4FilterInit->au32L3Ipv6AddrFilterValue[0]); + WRITE_REG32(M4_ETH->MAC_L3ADDRR1, pstcL3L4FilterInit->au32L3Ipv6AddrFilterValue[1]); + WRITE_REG32(M4_ETH->MAC_L3ADDRR2, pstcL3L4FilterInit->au32L3Ipv6AddrFilterValue[2]); + WRITE_REG32(M4_ETH->MAC_L3ADDRR3, pstcL3L4FilterInit->au32L3Ipv6AddrFilterValue[3]); + } + /* IPv4 protocol*/ + else + { + WRITE_REG32(M4_ETH->MAC_L34CTLR, + (pstcL3L4FilterInit->u32L4DestPortFilter | pstcL3L4FilterInit->u32L4SourcePortFilter | + pstcL3L4FilterInit->u32L4PortFilterProtocol | pstcL3L4FilterInit->u32L3Ipv4DAFilterMask | + pstcL3L4FilterInit->u32L3Ipv4SAFilterMask | pstcL3L4FilterInit->u32L3DAFilter | + pstcL3L4FilterInit->u32L3SAFilter | pstcL3L4FilterInit->u32L3AddrFilterProtocol)); + WRITE_REG32(M4_ETH->MAC_L3ADDRR0, pstcL3L4FilterInit->u32L3Ipv4SAFilterValue); + WRITE_REG32(M4_ETH->MAC_L3ADDRR1, pstcL3L4FilterInit->u32L3Ipv4DAFilterValue); + } + WRITE_REG32(M4_ETH->MAC_L4PORTR, ((((uint32_t)pstcL3L4FilterInit->u16L4DestProtFilterValue) << ETH_MAC_L4PORTR_L4DPVAL_POS) | + pstcL3L4FilterInit->u16L4SourceProtFilterValue)); + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_eth_l3l4_filter_config_t to default values. + * @param [out] pstcL3L4FilterInit Pointer to a @ref stc_eth_l3l4_filter_config_t structure + * @retval An en_result_t enumeration value: + * - Ok: Structure Initialize success + * - ErrorInvalidParameter: pstcL3L4FilterInit == NULL + */ +en_result_t ETH_MAC_L3L4FilterStructInit(stc_eth_l3l4_filter_config_t *pstcL3L4FilterInit) +{ + en_result_t enRet = Ok; + uint8_t i; + + if (NULL == pstcL3L4FilterInit) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcL3L4FilterInit->u32L4DestPortFilter = ETH_MAC_L4_DESTPORT_FILTER_DISABLE; + pstcL3L4FilterInit->u32L4SourcePortFilter = ETH_MAC_L4_SOURCEPORT_FILTER_DISABLE; + pstcL3L4FilterInit->u32L4PortFilterProtocol = ETH_MAC_L4_PORT_FILTER_PROTOCOL_TCP; + pstcL3L4FilterInit->u32L3Ipv4DAFilterMask = ETH_MAC_L3_DA_FILTER_MASK_NONE; + pstcL3L4FilterInit->u32L3Ipv4SAFilterMask = ETH_MAC_L3_SA_FILTER_MASK_NONE; + pstcL3L4FilterInit->u32L3Ipv6AddrFilterMask = ETH_MAC_L3_DA_SA_FILTER_MASK_NONE; + pstcL3L4FilterInit->u32L3DAFilter = ETH_MAC_L3_DA_FILTER_DISABLE; + pstcL3L4FilterInit->u32L3SAFilter = ETH_MAC_L3_SA_FILTER_DISABLE; + pstcL3L4FilterInit->u32L3AddrFilterProtocol = ETH_MAC_L3_ADDR_FILTER_PROTOCOL_IPV4; + pstcL3L4FilterInit->u16L4DestProtFilterValue = 0U; + pstcL3L4FilterInit->u16L4SourceProtFilterValue = 0U; + pstcL3L4FilterInit->u32L3Ipv4DAFilterValue = 0UL; + pstcL3L4FilterInit->u32L3Ipv4SAFilterValue = 0UL; + for (i=0U; i<4U; i++) + { + pstcL3L4FilterInit->au32L3Ipv6AddrFilterValue[i] = 0UL; + } + } + + return enRet; +} + +/** + * @brief Enable or disable MAC L3L4 Filter function. + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void ETH_MAC_L3L4FilterCmd(en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + WRITE_REG32(bM4_ETH->MAC_FLTCTLR_b.IPFE, enNewSta); +} + +/** + * @brief Set L4 port filter protocol. + * @param [in] u32PortProtocol MAC L4 port filter protocol. + * This parameter can be one of the following values: + * @arg ETH_MAC_L4_PORT_FILTER_PROTOCOL_TCP: Port filter for TCP frame + * @arg ETH_MAC_L4_PORT_FILTER_PROTOCOL_UDP: Port filter for UDP frame + * @retval None + */ +void ETH_MAC_SetPortFilterProtocol(uint32_t u32PortProtocol) +{ + /* Check parameters */ + DDL_ASSERT(IS_ETH_MAC_L4_PORT_FILTER_PROTOCOL(u32PortProtocol)); + + WRITE_REG32(bM4_ETH->MAC_L34CTLR_b.L4PEN, (u32PortProtocol >> ETH_MAC_L34CTLR_L4PEN_POS)); +} + +/** + * @brief Set L4 Destination port filter value. + * @param [in] u16Port The value of Destination port. + * @retval None + */ +void ETH_MAC_SetDestPortFilterVal(uint16_t u16Port) +{ + MODIFY_REG32(M4_ETH->MAC_L4PORTR, ETH_MAC_L4PORTR_L4DPVAL, ((uint32_t)u16Port << 16U)); +} + +/** + * @brief Set L4 Source port filter value. + * @param [in] u16Port The value of Source port. + * @retval None + */ +void ETH_MAC_SetSrcPortFilterVal(uint16_t u16Port) +{ + MODIFY_REG32(M4_ETH->MAC_L4PORTR, ETH_MAC_L4PORTR_L4SPVAL, u16Port); +} + +/** + * @brief Set L3 address filter protocol. + * @param [in] u32AddrProtocol MAC L3 address filter protocol. + * This parameter can be one of the following values: + * @arg ETH_MAC_L3_ADDR_FILTER_PROTOCOL_IPV4: Ip Address filter for IPv4 + * @arg ETH_MAC_L3_ADDR_FILTER_PROTOCOL_IPV6: Ip Address filter for IPv6 + * @retval None + */ +void ETH_MAC_SetAddrFilterProtocol(uint32_t u32AddrProtocol) +{ + /* Check parameters */ + DDL_ASSERT(IS_ETH_MAC_L3_ADDR_FILTER_PROTOCOL(u32AddrProtocol)); + + WRITE_REG32(bM4_ETH->MAC_L34CTLR_b.L3PEN, u32AddrProtocol); +} + +/** + * @brief Set L3 Destination address filter value of IPv4. + * @param [in] u32Addr The value of Destination address. + * @retval None + */ +void ETH_MAC_SetIpv4DestAddrFilterVal(uint32_t u32Addr) +{ + WRITE_REG32(M4_ETH->MAC_L3ADDRR1, u32Addr); +} + +/** + * @brief Set L3 Source address filter value of IPv4. + * @param [in] u32Addr The value of Source address. + * @retval None + */ +void ETH_MAC_SetIpv4SrcAddrFilterVal(uint32_t u32Addr) +{ + WRITE_REG32(M4_ETH->MAC_L3ADDRR0, u32Addr); +} + +/** + * @brief Set L3 Destination/Source Address filter value of IPv6. + * @param [in] au32Addr Pointer to Destination/Source Address buffer(4 words). + * @retval An en_result_t enumeration value: + * - Ok: Set Address filter value success + * - ErrorInvalidParameter: au32Addr == NULL + */ +en_result_t ETH_MAC_SetIpv6AddrFilterVal(const uint32_t au32Addr[]) +{ + en_result_t enRet = Ok; + + if (NULL == au32Addr) + { + enRet = ErrorInvalidParameter; + } + else + { + WRITE_REG32(M4_ETH->MAC_L3ADDRR0, au32Addr[0]); + WRITE_REG32(M4_ETH->MAC_L3ADDRR1, au32Addr[1]); + WRITE_REG32(M4_ETH->MAC_L3ADDRR2, au32Addr[2]); + WRITE_REG32(M4_ETH->MAC_L3ADDRR3, au32Addr[3]); + } + + return enRet; +} + +/******************************************************************************/ +/* DMA Functions */ +/******************************************************************************/ +/** + * @brief De-Initialize DMA. + * @param None + * @retval None + */ +void ETH_DMA_DeInit(void) +{ + WRITE_REG32(M4_ETH->DMA_BUSMODR, 0x00020101UL); + WRITE_REG32(M4_ETH->DMA_OPRMODR, 0U); + WRITE_REG32(M4_ETH->DMA_INTENAR, 0U); + WRITE_REG32(M4_ETH->DMA_REVWDTR, 0U); + WRITE_REG32(M4_ETH->DMA_TXDLADR, 0U); + WRITE_REG32(M4_ETH->DMA_RXDLADR, 0U); +} + +/** + * @brief Initialize DMA. + * @param [in] pstcDmaInit Pointer to a @ref stc_eth_dma_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: DMA Initialize success + * - ErrorInvalidParameter: pstcDmaInit == NULL + */ +en_result_t ETH_DMA_Init(const stc_eth_dma_init_t *pstcDmaInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcDmaInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_ETH_DMA_BURST_MODE(pstcDmaInit->u32BurstMode)); + DDL_ASSERT(IS_ETH_DMA_ADDRESS_ALIGN(pstcDmaInit->u32AddressAlign)); + DDL_ASSERT(IS_ETH_DMA_RX_BURST_LENGTH(pstcDmaInit->u32RxDMABurstLength)); + DDL_ASSERT(IS_ETH_DMA_TX_BURST_LENGTH(pstcDmaInit->u32TxDMABurstLength)); + DDL_ASSERT(IS_ETH_DMA_ENHANCE_DESCRIPTOR(pstcDmaInit->u32EnhanceDescriptor)); + DDL_ASSERT(IS_ETH_DMA_DESC_SKIP_LENGTH(pstcDmaInit->u32DescriptorSkipLength)); + DDL_ASSERT(IS_ETH_DMA_PRIORITY_ARBITRATION(pstcDmaInit->u32DMAArbitration)); + DDL_ASSERT(IS_ETH_DMA_DROP_CHECKSUM_ERRORFRAME(pstcDmaInit->u32DropChecksumErrorFrame)); + DDL_ASSERT(IS_ETH_DMA_RECEIVE_STORE_FORWARD(pstcDmaInit->u32ReceiveStoreForward)); + DDL_ASSERT(IS_ETH_DMA_FLUSH_RECEIVEDFRAME(pstcDmaInit->u32FlushReceiveFrame)); + DDL_ASSERT(IS_ETH_DMA_TRANSMIT_STORE_FORWARD(pstcDmaInit->u32TransmitStoreForward)); + DDL_ASSERT(IS_ETH_DMA_TRANSMIT_THRESHOLD(pstcDmaInit->u32TransmitThreshold)); + DDL_ASSERT(IS_ETH_DMA_FORWARD_ERRORFRAME(pstcDmaInit->u32ForwardErrorFrame)); + DDL_ASSERT(IS_ETH_DMA_FORWARD_UNDERSIZE_GOODFRAME(pstcDmaInit->u32ForwardUndersizeGoodFrame)); + DDL_ASSERT(IS_ETH_DMA_DROP_JUMBO_FRAME(pstcDmaInit->u32DropJumboFrame)); + DDL_ASSERT(IS_ETH_DMA_RECEIVE_THRESHOLD(pstcDmaInit->u32ReceiveThreshold)); + DDL_ASSERT(IS_ETH_DMA_SECONDFRAME_OPERARTE(pstcDmaInit->u32SecondFrameOperate)); + + /* Set Bus mode register */ + MODIFY_REG32(M4_ETH->DMA_BUSMODR, ETH_DMA_BUSMODR_CLEAR_MASK, + (pstcDmaInit->u32BurstMode | pstcDmaInit->u32AddressAlign | pstcDmaInit->u32RxDMABurstLength | + pstcDmaInit->u32TxDMABurstLength | pstcDmaInit->u32EnhanceDescriptor | pstcDmaInit->u32DescriptorSkipLength | + pstcDmaInit->u32DMAArbitration | ETH_DMA_BUSMODR_SPBL)); + /* Set Operation mode register */ + MODIFY_REG32(M4_ETH->DMA_OPRMODR, ETH_DMA_OPRMODR_CLEAR_MASK, + (pstcDmaInit->u32DropChecksumErrorFrame | pstcDmaInit->u32ReceiveStoreForward | pstcDmaInit->u32FlushReceiveFrame | + pstcDmaInit->u32TransmitStoreForward | pstcDmaInit->u32TransmitThreshold | pstcDmaInit->u32ForwardErrorFrame | + pstcDmaInit->u32ForwardUndersizeGoodFrame | pstcDmaInit->u32DropJumboFrame | pstcDmaInit->u32ReceiveThreshold | + pstcDmaInit->u32SecondFrameOperate)); + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_eth_dma_init_t to default values. + * @param [out] pstcDmaInit Pointer to a @ref stc_eth_dma_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Structure Initialize success + * - ErrorInvalidParameter: pstcDmaInit == NULL + */ +en_result_t ETH_DMA_StructInit(stc_eth_dma_init_t *pstcDmaInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcDmaInit) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcDmaInit->u32BurstMode = ETH_DMA_BURST_MODE_FIXED; + pstcDmaInit->u32AddressAlign = ETH_DMA_ADDRESS_ALIGN_ENABLE; + pstcDmaInit->u32RxDMABurstLength = ETH_DMA_RX_BURST_LENGTH_32BEAT; + pstcDmaInit->u32TxDMABurstLength = ETH_DMA_TX_BURST_LENGTH_32BEAT; + pstcDmaInit->u32EnhanceDescriptor = ETH_DMA_ENHANCE_DESCRIPTOR_ENABLE; + pstcDmaInit->u32DescriptorSkipLength = 0U; + pstcDmaInit->u32DMAArbitration = ETH_DMA_ARBITRATION_LOOP_RXTX_1_1; + pstcDmaInit->u32DropChecksumErrorFrame = ETH_DMA_DROP_CHECKSUM_ERRORFRAME_ENABLE; + pstcDmaInit->u32ReceiveStoreForward = ETH_DMA_RECEIVE_STORE_FORWARD_ENABLE; + pstcDmaInit->u32FlushReceiveFrame = ETH_DMA_FLUSH_RECEIVEDFRAME_ENABLE; + pstcDmaInit->u32TransmitStoreForward = ETH_DMA_TRANSMIT_STORE_FORWARD_ENABLE; + pstcDmaInit->u32TransmitThreshold = ETH_DMA_TRANSMIT_THRESHOLD_64BYTE; + pstcDmaInit->u32ForwardErrorFrame = ETH_DMA_FORWARD_ERRORFRAME_DISABLE; + pstcDmaInit->u32ForwardUndersizeGoodFrame = ETH_DMA_FORWARD_UNDERSIZE_GOODFRAME_DISABLE; + pstcDmaInit->u32DropJumboFrame = ETH_DMA_DROP_JUMBO_FRAME_DISABLE; + pstcDmaInit->u32ReceiveThreshold = ETH_DMA_RECEIVE_THRESHOLD_64BYTE; + pstcDmaInit->u32SecondFrameOperate = ETH_DMA_SECONDFRAME_OPERARTE_ENABLE; + } + + return enRet; +} + +/** + * @brief Set DMA software reset. + * @param None + * @retval An en_result_t enumeration value: + * - Ok: Software reset success + * - ErrorTimeout: Reset timeout + */ +en_result_t ETH_DMA_SoftwareReset(void) +{ + __IO uint32_t u32Count; + en_result_t enRet = Ok; + + WRITE_REG32(bM4_ETH->DMA_BUSMODR_b.SWR, 1U); + u32Count = ETH_TIMEOUT_SOFTWARE_RESET * (HCLK_VALUE / 20000UL); + while (0UL != READ_REG32(bM4_ETH->DMA_BUSMODR_b.SWR)) + { + if (0UL == u32Count) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + + return enRet; +} + +/** + * @brief Set DMA Transmit priority ratio. + * @param [in] u32PrioRatio Priority ratio + * This parameter can be one of the following values: + * @arg ETH_DMA_ARBITRATION_LOOP_RXTX_1_1: Rx:Tx = 1:1 + * @arg ETH_DMA_ARBITRATION_LOOP_RXTX_2_1: Rx:Tx = 2:1 + * @arg ETH_DMA_ARBITRATION_LOOP_RXTX_3_1: Rx:Tx = 3:1 + * @arg ETH_DMA_ARBITRATION_LOOP_RXTX_4_1: Rx:Tx = 4:1 + * @arg ETH_DMA_ARBITRATION_LOOP_TXRX_1_1: Tx:Rx = 1:1 + * @arg ETH_DMA_ARBITRATION_LOOP_TXRX_2_1: Tx:Rx = 2:1 + * @arg ETH_DMA_ARBITRATION_LOOP_TXRX_3_1: Tx:Rx = 3:1 + * @arg ETH_DMA_ARBITRATION_LOOP_TXRX_4_1: Tx:Rx = 4:1 + * @arg ETH_DMA_ARBITRATION_FIXED_RXPRIORTX: Fixed priority: Rx is higher than Tx + * @arg ETH_DMA_ARBITRATION_FIXED_TXPRIORRX: Fixed priority: Tx is higher than Rx + * @retval None + */ +void ETH_DMA_SetTransPrioRatio(uint32_t u32PrioRatio) +{ + /* Check parameters */ + DDL_ASSERT(IS_ETH_DMA_PRIORITY_ARBITRATION(u32PrioRatio)); + + MODIFY_REG32(M4_ETH->DMA_BUSMODR, + (ETH_DMA_BUSMODR_TXPR | ETH_DMA_BUSMODR_PRAT | ETH_DMA_BUSMODR_DMAA), + u32PrioRatio); +} + +/** + * @brief Set DMA Rx watchdog counter. + * @param [in] u8Value The value of Watchdog timer + * @retval None + */ +void ETH_DMA_SetRxWatchdogCounter(uint8_t u8Value) +{ + WRITE_REG32(M4_ETH->DMA_REVWDTR, u8Value); +} + +/** + * @brief Flush transmit FIFO. + * @param None + * @retval An en_result_t enumeration value: + * - Ok: Flush transmit FIFO success + * - ErrorTimeout: Flush timeout + */ +en_result_t ETH_DMA_FlushTransmitFIFO(void) +{ + __IO uint32_t u32Count; + en_result_t enRet = Ok; + + WRITE_REG32(bM4_ETH->DMA_OPRMODR_b.FTF, 1U); + u32Count = ETH_TIMEOUT_WRITE_REGISTER * (HCLK_VALUE / 20000UL); + while (0UL != READ_REG32(bM4_ETH->DMA_OPRMODR_b.FTF)) + { + if (0UL == u32Count) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + + return enRet; +} + +/** + * @brief Enable or disable DMA transmit. + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void ETH_DMA_TransmitCmd(en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + WRITE_REG32(bM4_ETH->DMA_OPRMODR_b.STT, enNewSta); +} + +/** + * @brief Enable or disable DMA receive. + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void ETH_DMA_ReceiveCmd(en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + WRITE_REG32(bM4_ETH->DMA_OPRMODR_b.STR, enNewSta); +} + +/** + * @brief Enable or disable DMA interrupt. + * @param [in] u32IntSrc DMA interrupt source + * This parameter can be one or any combination of the following values: + * @arg ETH_DMA_INT_NIE: Normal interrupt summary + * @arg ETH_DMA_INT_AIE: Abnormal interrupt summary + * @arg ETH_DMA_INT_ERE: Early receive interrupt + * @arg ETH_DMA_INT_FBE: Fatal bus error interrupt + * @arg ETH_DMA_INT_ETE: Early transmit interrupt + * @arg ETH_DMA_INT_RWE: Receive watchdog timeout interrupt + * @arg ETH_DMA_INT_RSE: Receive process stopped interrupt + * @arg ETH_DMA_INT_RUE: Receive buffer unavailable interrupt + * @arg ETH_DMA_INT_RIE: Receive interrupt + * @arg ETH_DMA_INT_UNE: Transmit Underflow interrupt + * @arg ETH_DMA_INT_OVE: Receive Overflow interrupt + * @arg ETH_DMA_INT_TJE: Transmit jabber timeout interrupt + * @arg ETH_DMA_INT_TUE: Transmit buffer unavailable interrupt + * @arg ETH_DMA_INT_TSE: Transmit process stopped interrupt + * @arg ETH_DMA_INT_TIE: Transmit interrupt + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void ETH_DMA_IntCmd(uint32_t u32IntSrc, en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_ETH_DMA_INTERRUPT(u32IntSrc)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + if (Disable != enNewSta) + { + SET_REG32_BIT(M4_ETH->DMA_INTENAR, u32IntSrc); + } + else + { + CLEAR_REG32_BIT(M4_ETH->DMA_INTENAR, u32IntSrc); + } +} + +/** + * @brief Get DMA flag status. + * @param [in] u32Flag DMA flag type + * This parameter can be one or any combination of the following values: + * @arg ETH_DMA_FLAG_PTPS: Time-stamp trigger status + * @arg ETH_DMA_FLAG_PMTS: PMT trigger status + * @arg ETH_DMA_FLAG_MMCS: MMC trigger status + * @arg ETH_DMA_FLAG_NIS: Normal interrupt summary flag + * @arg ETH_DMA_FLAG_AIS: Abnormal interrupt summary flag + * @arg ETH_DMA_FLAG_ERS: Early receive flag + * @arg ETH_DMA_FLAG_FBS: Fatal bus error flag + * @arg ETH_DMA_FLAG_ETS: Early transmit flag + * @arg ETH_DMA_FLAG_RWS: Receive watchdog timeout flag + * @arg ETH_DMA_FLAG_RSS: Receive stopped flag + * @arg ETH_DMA_FLAG_RUS: Receive buffer unavailable flag + * @arg ETH_DMA_FLAG_RIS: Receive flag + * @arg ETH_DMA_FLAG_UNS: Transmit Underflow flag + * @arg ETH_DMA_FLAG_OVS: Receive Overflow flag + * @arg ETH_DMA_FLAG_TJS: Transmit jabber timeout flag + * @arg ETH_DMA_FLAG_TUS: Transmit buffer unavailable flag + * @arg ETH_DMA_FLAG_TSS: Transmit stopped flag + * @arg ETH_DMA_FLAG_TIS: Transmit interrupt flag + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t ETH_DMA_GetStatus(uint32_t u32Flag) +{ + en_flag_status_t enFlagSta = Reset; + + /* Check parameters */ + DDL_ASSERT(IS_ETH_DMA_FLAG(u32Flag)); + + if (0UL != (READ_REG32_BIT(M4_ETH->DMA_DMASTSR, u32Flag))) + { + enFlagSta = Set; + } + + return enFlagSta; +} + +/** + * @brief Get DMA overflow flag status. + * @param [in] u32Flag DMA overflow flag type + * This parameter can be one of the following values: + * @arg ETH_DMA_OVERFLOW_RXFIFO_COUNTER: Overflow bit for FIFO overflow counter + * @arg ETH_DMA_OVERFLOW_MISSFRAME_COUNTER: Overflow bit for miss frame counter + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t ETH_DMA_GetOvfStatus(uint32_t u32Flag) +{ + en_flag_status_t enFlagSta = Reset; + + /* Check parameters */ + DDL_ASSERT(IS_ETH_DMA_MISS_FRAME_TYPE(u32Flag)); + + if (0UL != (READ_REG32_BIT(M4_ETH->DMA_RFRCNTR, u32Flag))) + { + enFlagSta = Set; + } + + return enFlagSta; +} + +/******************************************************************************/ +/* DMA descriptor Functions */ +/******************************************************************************/ +/** + * @brief Initializes DMA Tx descriptor in chain mode. + * @param [in] pstcEthHandle Pointer to a @ref stc_eth_handle_t structure + * @param [in] astcTxDescTab Pointer to the first Tx desc list + * @param [in] au8TxBuffer Pointer to the first TxBuffer list + * @param [in] u32TxBufferCnt Number of the Tx desc in the list + * @retval An en_result_t enumeration value: + * - Ok: Initializes Tx chain mode success + * - ErrorInvalidParameter: pstcEthHandle == NULL or astcTxDescTab == NULL or + * au8TxBuffer == NULL or u32TxBufferCnt == 0 + */ +en_result_t ETH_DMA_TxDescListInit(stc_eth_handle_t *pstcEthHandle, stc_eth_dma_desc_t astcTxDescTab[], const uint8_t au8TxBuffer[], uint32_t u32TxBufferCnt) +{ + uint32_t i; + stc_eth_dma_desc_t *pstcTxDesc; + en_result_t enRet = Ok; + + if ((NULL == pstcEthHandle) || (NULL == astcTxDescTab) || (NULL == au8TxBuffer) || (0UL== u32TxBufferCnt)) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Set the DMATxDesc pointer with the first in the astcTxDescTab list */ + pstcEthHandle->stcTxDesc = astcTxDescTab; + + /* Fill each DMATxDesc descriptor */ + for (i=0U; iu32ControlStatus = ETH_DMATXDESC_TSAC; + /* Set Buffer1 address pointer */ + pstcTxDesc->u32Buffer1Addr = (uint32_t)(&au8TxBuffer[i * ETH_TXBUF_SIZE]); + /* Set the DMA Tx descriptors checksum insertion */ + if (ETH_MAC_CHECKSUM_MODE_HARDWARE == pstcEthHandle->stcCommInit.u32ChecksumMode) + { + SET_REG32_BIT(pstcTxDesc->u32ControlStatus, ETH_DMATXDESC_CIC_TCPUDPICMP_FULL); + } + + /* Initialize the next descriptor with the Next Descriptor Polling */ + if (i < (u32TxBufferCnt - 1U)) + { + pstcTxDesc->u32Buffer2NextDescAddr = (uint32_t)(&astcTxDescTab[i + 1U]); + } + else + { + pstcTxDesc->u32Buffer2NextDescAddr = (uint32_t)astcTxDescTab; + } + } + + /* Set Transmit Descriptor List Address Register */ + WRITE_REG32(M4_ETH->DMA_TXDLADR, (uint32_t)astcTxDescTab); + } + + return enRet; +} + +/** + * @brief Initializes DMA Rx descriptor in chain mode. + * @param [in] pstcEthHandle Pointer to a @ref stc_eth_handle_t structure + * @param [in] astcRxDescTab Pointer to the first Rx desc list + * @param [in] au8RxBuffer Pointer to the first RxBuffer list + * @param [in] u32RxBufferCnt Number of the Rx desc in the list + * @retval An en_result_t enumeration value: + * - Ok: Initializes Rx chain mode success + * - ErrorInvalidParameter: pstcEthHandle == NULL or astcRxDescTab == NULL or + * au8RxBuffer == NULL or u32RxBufferCnt == 0 + */ +en_result_t ETH_DMA_RxDescListInit(stc_eth_handle_t *pstcEthHandle, stc_eth_dma_desc_t astcRxDescTab[], const uint8_t au8RxBuffer[], uint32_t u32RxBufferCnt) +{ + uint32_t i; + stc_eth_dma_desc_t *pstcRxDesc; + en_result_t enRet = Ok; + + if ((NULL == pstcEthHandle) || (NULL == astcRxDescTab) || (NULL == au8RxBuffer) || (0UL == u32RxBufferCnt)) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Set the DMARxDesc pointer with the first in the astcRxDescTab list */ + pstcEthHandle->stcRxDesc = astcRxDescTab; + + /* Fill each DMARxDesc descriptor */ + for (i=0UL; iu32ControlStatus = ETH_DMARXDESC_OWN; + /* Set Buffer1 size and Second Address Chained */ + pstcRxDesc->u32ControlBufferSize = ETH_RXBUF_SIZE | ETH_DMARXDESC_RSAC; + /* Set Buffer1 address pointer */ + pstcRxDesc->u32Buffer1Addr = (uint32_t)(&au8RxBuffer[i * ETH_RXBUF_SIZE]); + /* Set the DMA Rx Descriptor interrupt */ + if (ETH_RX_MODE_INTERRUPT == pstcEthHandle->stcCommInit.u32RxMode) + { + CLEAR_REG32_BIT(pstcRxDesc->u32ControlBufferSize, ETH_DMARXDESC_DIC); + } + + /* Initialize the next descriptor with the Next Descriptor Polling */ + if (i < (u32RxBufferCnt - 1U)) + { + pstcRxDesc->u32Buffer2NextDescAddr = (uint32_t)(&astcRxDescTab[i + 1U]); + } + else + { + pstcRxDesc->u32Buffer2NextDescAddr = (uint32_t)astcRxDescTab; + } + } + + /* Set Receive Descriptor List Address Register */ + WRITE_REG32(M4_ETH->DMA_RXDLADR, (uint32_t)astcRxDescTab); + } + + return enRet; +} + +/** + * @brief Set DMA transmit frame. + * @param [in] pstcEthHandle Pointer to a @ref stc_eth_handle_t structure + * @param [in] u32FrameLength Total of data to be transmit + * @retval An en_result_t enumeration value: + * - Ok: Set transmit frame success + * - ErrorInvalidParameter: pstcEthHandle == NULL + * - ErrorInvalidMode: Descriptor is owned by the DMA + */ +en_result_t ETH_DMA_SetTransmitFrame(stc_eth_handle_t *pstcEthHandle, uint32_t u32FrameLength) +{ + uint32_t i; + uint32_t u32BufCnt; + uint32_t u32Size; + en_result_t enRet = Ok; + + if ((NULL == pstcEthHandle) || (0U == u32FrameLength)) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check if the descriptor is owned by the CPU */ + if (0UL != (pstcEthHandle->stcTxDesc->u32ControlStatus & ETH_DMATXDESC_OWN)) + { + enRet = ErrorInvalidMode; + } + else + { + /* Get the number of needed Tx buffers for the current frame */ + if (u32FrameLength > ETH_TXBUF_SIZE) + { + u32BufCnt = u32FrameLength / ETH_TXBUF_SIZE; + if (0UL != (u32FrameLength % ETH_TXBUF_SIZE)) + { + u32BufCnt++; + } + } + else + { + u32BufCnt = 1U; + } + + if (1U == u32BufCnt) + { + /* Set FIRST and LAST segment */ + SET_REG32_BIT(pstcEthHandle->stcTxDesc->u32ControlStatus, (ETH_DMATXDESC_TFS | ETH_DMATXDESC_TLS)); + /* Set frame size */ + MODIFY_REG32(pstcEthHandle->stcTxDesc->u32ControlBufferSize, ETH_DMATXDESC_TBS1, (u32FrameLength & ETH_DMATXDESC_TBS1)); + /* Set Own bit of the Tx descriptor */ + SET_REG32_BIT(pstcEthHandle->stcTxDesc->u32ControlStatus, ETH_DMATXDESC_OWN); + /* Point to next descriptor */ + pstcEthHandle->stcTxDesc = (stc_eth_dma_desc_t *)(pstcEthHandle->stcTxDesc->u32Buffer2NextDescAddr); + } + else + { + for (i=0U; istcTxDesc->u32ControlStatus, (ETH_DMATXDESC_TFS | ETH_DMATXDESC_TLS)); + if (0U == i) + { + /* Set the FIRST segment bit */ + SET_REG32_BIT(pstcEthHandle->stcTxDesc->u32ControlStatus, ETH_DMATXDESC_TFS); + } + + if ((u32BufCnt - 1U) == i) + { + /* Set the last segment bit */ + SET_REG32_BIT(pstcEthHandle->stcTxDesc->u32ControlStatus, ETH_DMATXDESC_TLS); + u32Size = u32FrameLength - ((u32BufCnt - 1U) * ETH_TXBUF_SIZE); + MODIFY_REG32(pstcEthHandle->stcTxDesc->u32ControlBufferSize, ETH_DMATXDESC_TBS1, (u32Size & ETH_DMATXDESC_TBS1)); + } + else + { + /* Set frame size */ + MODIFY_REG32(pstcEthHandle->stcTxDesc->u32ControlBufferSize, ETH_DMATXDESC_TBS1, (ETH_TXBUF_SIZE & ETH_DMATXDESC_TBS1)); + } + + /* Set Own bit of the Tx descriptor */ + SET_REG32_BIT(pstcEthHandle->stcTxDesc->u32ControlStatus, ETH_DMATXDESC_OWN); + /* Pointer to next descriptor */ + pstcEthHandle->stcTxDesc = (stc_eth_dma_desc_t *)(pstcEthHandle->stcTxDesc->u32Buffer2NextDescAddr); + } + } + + /* When Tx Buffer unavailable flag is set: clear it and resume transmission */ + if (0UL != (READ_REG32_BIT(M4_ETH->DMA_DMASTSR, ETH_DMA_FLAG_TUS))) + { + /* Clear DMA TUS flag */ + WRITE_REG32(M4_ETH->DMA_DMASTSR, ETH_DMA_FLAG_TUS); + /* Resume DMA transmission */ + WRITE_REG32(M4_ETH->DMA_TXPOLLR, 0UL); + } + } + } + + return enRet; +} + +/** + * @brief Get DMA receive frame. + * @param [in] pstcEthHandle Pointer to a @ref stc_eth_handle_t structure + * @retval An en_result_t enumeration value: + * - Ok: Get receive frame success + * - ErrorInvalidParameter: pstcEthHandle == NULL + * - Error: Not completed frame received + */ +en_result_t ETH_DMA_GetReceiveFrame(stc_eth_handle_t *pstcEthHandle) +{ + en_result_t enRet = Error; + + if (NULL == pstcEthHandle) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check if segment is not owned by DMA */ + if (0UL == (pstcEthHandle->stcRxDesc->u32ControlStatus & ETH_DMARXDESC_OWN)) + { + /* Check if last segment */ + if (0UL != (pstcEthHandle->stcRxDesc->u32ControlStatus & ETH_DMARXDESC_RLS)) + { + pstcEthHandle->stcRxFrame.u32SegCount++; + pstcEthHandle->stcRxFrame.pstcLSDesc = pstcEthHandle->stcRxDesc; + /* Check if last segment is first segment */ + if (1U == pstcEthHandle->stcRxFrame.u32SegCount) + { + pstcEthHandle->stcRxFrame.pstcFSDesc = pstcEthHandle->stcRxDesc; + } + + /* Get the Frame Length of the received packet: Strip FCS */ + pstcEthHandle->stcRxFrame.u32Length = ((pstcEthHandle->stcRxDesc->u32ControlStatus & ETH_DMARXDESC_FRAL) >> ETH_DMARXDESC_FRAME_LENGTHSHIFT) - 4U; + /* Get the address of the buffer start address */ + pstcEthHandle->stcRxFrame.u32Buffer = (pstcEthHandle->stcRxFrame.pstcFSDesc)->u32Buffer1Addr; + /* Pointer to next descriptor */ + pstcEthHandle->stcRxDesc = (stc_eth_dma_desc_t*)(pstcEthHandle->stcRxDesc->u32Buffer2NextDescAddr); + /* Get success */ + enRet = Ok; + } + /* Check if first segment */ + else if (0UL != (pstcEthHandle->stcRxDesc->u32ControlStatus & ETH_DMARXDESC_RFS)) + { + pstcEthHandle->stcRxFrame.pstcFSDesc = pstcEthHandle->stcRxDesc; + pstcEthHandle->stcRxFrame.pstcLSDesc = NULL; + pstcEthHandle->stcRxFrame.u32SegCount = 1U; + /* Point to next descriptor */ + pstcEthHandle->stcRxDesc = (stc_eth_dma_desc_t*)(pstcEthHandle->stcRxDesc->u32Buffer2NextDescAddr); + } + /* Check if intermediate segment */ + else + { + pstcEthHandle->stcRxFrame.u32SegCount++; + /* Point to next descriptor */ + pstcEthHandle->stcRxDesc = (stc_eth_dma_desc_t*)(pstcEthHandle->stcRxDesc->u32Buffer2NextDescAddr); + } + } + } + + return enRet; +} + +/** + * @brief Get DMA receive frame in interrupt mode. + * @param [in] pstcEthHandle Pointer to a @ref stc_eth_handle_t structure + * @retval An en_result_t enumeration value: + * - Ok: Get receive frame success + * - ErrorInvalidParameter: pstcEthHandle == NULL + * - Error: Not completed frame received + */ +en_result_t ETH_DMA_GetReceiveFrame_Interrupt(stc_eth_handle_t *pstcEthHandle) +{ + uint32_t u32DescCnt = 0U; + en_result_t enRet = Error; + + if (NULL == pstcEthHandle) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Scan descriptor owned by CPU */ + while ((0UL == (pstcEthHandle->stcRxDesc->u32ControlStatus & ETH_DMARXDESC_OWN)) && (u32DescCnt < ETH_RXBUF_SIZE)) + { + u32DescCnt++; + /* Check if first segment in frame */ + if (ETH_DMARXDESC_RFS == (pstcEthHandle->stcRxDesc->u32ControlStatus & (ETH_DMARXDESC_RFS | ETH_DMARXDESC_RLS))) + { + pstcEthHandle->stcRxFrame.pstcFSDesc = pstcEthHandle->stcRxDesc; + pstcEthHandle->stcRxFrame.pstcLSDesc = NULL; + pstcEthHandle->stcRxFrame.u32SegCount = 1U; + /* Point to next descriptor */ + pstcEthHandle->stcRxDesc = (stc_eth_dma_desc_t*)(pstcEthHandle->stcRxDesc->u32Buffer2NextDescAddr); + } + /* Check if intermediate segment */ + else if (0UL == (pstcEthHandle->stcRxDesc->u32ControlStatus & (ETH_DMARXDESC_RFS | ETH_DMARXDESC_RLS))) + { + pstcEthHandle->stcRxFrame.u32SegCount++; + /* Point to next descriptor */ + pstcEthHandle->stcRxDesc = (stc_eth_dma_desc_t*)(pstcEthHandle->stcRxDesc->u32Buffer2NextDescAddr); + } + /* Last segment */ + else + { + pstcEthHandle->stcRxFrame.u32SegCount++; + /* Last segment */ + pstcEthHandle->stcRxFrame.pstcLSDesc = pstcEthHandle->stcRxDesc; + /* Check if last segment is first segment */ + if (1U == pstcEthHandle->stcRxFrame.u32SegCount) + { + pstcEthHandle->stcRxFrame.pstcFSDesc = pstcEthHandle->stcRxDesc; + } + + /* Get the Frame Length of the received packet: Strip FCS */ + pstcEthHandle->stcRxFrame.u32Length = ((pstcEthHandle->stcRxDesc->u32ControlStatus & ETH_DMARXDESC_FRAL) >> ETH_DMARXDESC_FRAME_LENGTHSHIFT) - 4U; + /* Get the address of the buffer start address */ + pstcEthHandle->stcRxFrame.u32Buffer = (pstcEthHandle->stcRxFrame.pstcFSDesc)->u32Buffer1Addr; + /* Pointer to next descriptor */ + pstcEthHandle->stcRxDesc = (stc_eth_dma_desc_t*)(pstcEthHandle->stcRxDesc->u32Buffer2NextDescAddr); + /* Get success */ + enRet = Ok; + break; + } + } + } + + return enRet; +} + +/** + * @brief Set DMA Tx descriptor own bit. + * @param [in] pstcTxDesc Pointer to a DMA Tx descriptor @ref stc_eth_dma_desc_t + * @param [in] u32Owner DMA Tx descriptor owner + * This parameter can be one of the following values: + * @arg ETH_DMADESC_OWN_CPU: Descriptor is owned by CPU + * @arg ETH_DMADESC_OWN_DMA: Descriptor is owned by DMA + * @retval An en_result_t enumeration value: + * - Ok: Set Tx descriptor own bit success + * - ErrorInvalidParameter: pstcTxDesc == NULL + */ +en_result_t ETH_DMA_SetTxDescOwn(stc_eth_dma_desc_t *pstcTxDesc, uint32_t u32Owner) +{ + en_result_t enRet = Ok; + + if (NULL == pstcTxDesc) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_ETH_DMADESC_OWN(u32Owner)); + + if (ETH_DMADESC_OWN_CPU != u32Owner) + { + SET_REG32_BIT(pstcTxDesc->u32ControlStatus, ETH_DMATXDESC_OWN); + } + else + { + CLEAR_REG32_BIT(pstcTxDesc->u32ControlStatus, ETH_DMATXDESC_OWN); + } + } + + return enRet; +} + +/** + * @brief Set DMA Tx descriptor buffer size. + * @param [in] pstcTxDesc Pointer to a DMA Tx descriptor @ref stc_eth_dma_desc_t + * @param [in] u8BufferNum Buffer sequence number + * This parameter can be one of the following values: + * @arg ETH_DMADESC_BUFFER1: DMA Tx Desc Buffer1 + * @arg ETH_DMADESC_BUFFER2: DMA Tx Desc Buffer2 + * @param [in] u32BufferSize DMA Tx buffer size + * @retval An en_result_t enumeration value: + * - Ok: Set Tx descriptor buffer size success + * - ErrorInvalidParameter: pstcTxDesc == NULL + */ +en_result_t ETH_DMA_SetTxDescBufferSize(stc_eth_dma_desc_t *pstcTxDesc, uint8_t u8BufferNum, uint32_t u32BufferSize) +{ + en_result_t enRet = Ok; + uint32_t u32ShiftBit = 0UL; + + if (NULL == pstcTxDesc) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_ETH_DMADESC_BUFFER(u8BufferNum)); + DDL_ASSERT(IS_ETH_DMATXDESC_BUFFER_SIZE(u32BufferSize)); + + /* DMA Tx Desc buffer2 */ + if (ETH_DMADESC_BUFFER1 != u8BufferNum) + { + u32ShiftBit = ETH_DMADESC_BUFFER2_SIZESHIFT; + } + MODIFY_REG32(pstcTxDesc->u32ControlBufferSize, (ETH_DMATXDESC_TBS1 << u32ShiftBit), + (u32BufferSize << u32ShiftBit)); + } + + return enRet; +} + +/** + * @brief Configure DMA Tx descriptor checksum insert. + * @param [in] pstcTxDesc Pointer to a DMA Tx descriptor @ref stc_eth_dma_desc_t + * @param [in] u32ChecksumMode Checksum insert mode + * This parameter can be one of the following values: + * @arg ETH_DMATXDESC_CHECKSUM_BYPASS: Checksum Engine is bypassed + * @arg ETH_DMATXDESC_CHECKSUM_IPV4HEADER: IPv4 header checksum insertion + * @arg ETH_DMATXDESC_CHECKSUM_TCPUDPICMP_SEGMENT: TCP/UDP/ICMP Checksum Insertion calculated over segment only + * @arg ETH_DMATXDESC_CHECKSUM_TCPUDPICMP_FULL: TCP/UDP/ICMP Checksum Insertion fully calculated + * @retval An en_result_t enumeration value: + * - Ok: Configure Tx descriptor checksum insert success + * - ErrorInvalidParameter: pstcTxDesc == NULL + */ +en_result_t ETH_DMA_TxDescChecksumInsertConfig(stc_eth_dma_desc_t *pstcTxDesc, uint32_t u32ChecksumMode) +{ + en_result_t enRet = Ok; + + if (NULL == pstcTxDesc) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_ETH_DMATXDESC_CHECKSUM_CONTROL(u32ChecksumMode)); + + MODIFY_REG32(pstcTxDesc->u32ControlStatus, ETH_DMATXDESC_CIC, u32ChecksumMode); + } + + return enRet; +} + +/** + * @brief Configure DMA Tx descriptor VLAN insert. + * @param [in] pstcTxDesc Pointer to a DMA Tx descriptor @ref stc_eth_dma_desc_t + * @param [in] u32VlanMode VLAN insert mode + * This parameter can be one of the following values: + * @arg ETH_DMATXDESC_VLAN_BYPASS: VLAN Insertion is bypassed + * @arg ETH_DMATXDESC_VLAN_REMOVE_TAG: Remove Tag and Type fields in VLAN frame + * @arg ETH_DMATXDESC_VLAN_INSERT_TAG: Insert VLAN Tag value in ETH_MAC_VTACTLR Register into transmit frame + * @arg ETH_DMATXDESC_VLAN_REPLACE_TAG: Replace VLAN tag value in transmit frame with VLAN tag value in ETH_MAC_VTACTLR register + * @retval An en_result_t enumeration value: + * - Ok: Configure Tx descriptor VLAN insert success + * - ErrorInvalidParameter: pstcTxDesc == NULL + */ +en_result_t ETH_DMA_TxDescVlanInsertConfig(stc_eth_dma_desc_t *pstcTxDesc, uint32_t u32VlanMode) +{ + en_result_t enRet = Ok; + + if (NULL == pstcTxDesc) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_ETH_DMATXDESC_VLAN_CONTROL(u32VlanMode)); + + MODIFY_REG32(pstcTxDesc->u32ControlStatus, ETH_DMATXDESC_VLANC, u32VlanMode); + } + + return enRet; +} + +/** + * @brief Configure DMA Tx descriptor SA insert. + * @param [in] pstcTxDesc Pointer to a DMA Tx descriptor @ref stc_eth_dma_desc_t + * @param [in] u32SAMode SA insert mode + * This parameter can be one of the following values: + * @arg ETH_DMATXDESC_SA_BYPASS: Source Address Insertion or Replace Control is bypassed + * @arg ETH_DMATXDESC_SA_INSTER_MACADDR0: Insert address value in MAC address register 0 into transmit frame as SA address + * @arg ETH_DMATXDESC_SA_REPLACE_MACADDR0: Replace SA address in transmit frame with address value in MAC address register 0 + * @arg ETH_DMATXDESC_SA_INSTER_MACADDR1: Insert address value in MAC address register 1 into transmit frame as SA address + * @arg ETH_DMATXDESC_SA_REPLACE_MACADDR1: Replace SA address in transmit frame with address value in MAC address register 1 + * @retval An en_result_t enumeration value: + * - Ok: Configure Tx descriptor SA insert success + * - ErrorInvalidParameter: pstcTxDesc == NULL + */ +en_result_t ETH_DMA_TxDescSAInsertConfig(stc_eth_dma_desc_t *pstcTxDesc, uint32_t u32SAMode) +{ + en_result_t enRet = Ok; + + if (NULL == pstcTxDesc) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_ETH_DMATXDESC_SA_CONTROL(u32SAMode)); + + MODIFY_REG32(pstcTxDesc->u32ControlBufferSize, ETH_DMATXDESC_SAIRC, u32SAMode); + } + + return enRet; +} + +/** + * @brief Enable or disable DMA Tx descriptor add CRC. + * @param [in] pstcTxDesc Pointer to a DMA Tx descriptor @ref stc_eth_dma_desc_t + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval An en_result_t enumeration value: + * - Ok: Configure Tx add CRC success + * - ErrorInvalidParameter: pstcTxDesc == NULL + */ +en_result_t ETH_DMA_TxDescCRCCmd(stc_eth_dma_desc_t *pstcTxDesc, en_functional_state_t enNewSta) +{ + en_result_t enRet = Ok; + + if (NULL == pstcTxDesc) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + if (Disable != enNewSta) + { + CLEAR_REG32_BIT(pstcTxDesc->u32ControlStatus, ETH_DMATXDESC_DCRC); + } + else + { + SET_REG32_BIT(pstcTxDesc->u32ControlStatus, ETH_DMATXDESC_DCRC); + } + } + + return enRet; +} + +/** + * @brief Enable or disable DMA Tx descriptor padding. + * @param [in] pstcTxDesc Pointer to a DMA Tx descriptor @ref stc_eth_dma_desc_t + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval An en_result_t enumeration value: + * - Ok: Configure Tx padding success + * - ErrorInvalidParameter: pstcTxDesc == NULL + */ +en_result_t ETH_DMA_TxDescPADCmd(stc_eth_dma_desc_t *pstcTxDesc, en_functional_state_t enNewSta) +{ + en_result_t enRet = Ok; + + if (NULL == pstcTxDesc) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + if (Disable != enNewSta) + { + CLEAR_REG32_BIT(pstcTxDesc->u32ControlStatus, ETH_DMATXDESC_DPAD); + } + else + { + SET_REG32_BIT(pstcTxDesc->u32ControlStatus, ETH_DMATXDESC_DPAD); + } + } + + return enRet; +} + +/** + * @brief Enable or disable DMA Tx descriptor timestamp. + * @param [in] pstcTxDesc Pointer to a DMA Tx descriptor @ref stc_eth_dma_desc_t + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval An en_result_t enumeration value: + * - Ok: Configure Tx padding success + * - ErrorInvalidParameter: pstcTxDesc == NULL + */ +en_result_t ETH_DMA_TxDescTimestamp(stc_eth_dma_desc_t *pstcTxDesc, en_functional_state_t enNewSta) +{ + en_result_t enRet = Ok; + + if (NULL == pstcTxDesc) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + if (Disable != enNewSta) + { + SET_REG32_BIT(pstcTxDesc->u32ControlStatus, ETH_DMATXDESC_TTSE); + } + else + { + CLEAR_REG32_BIT(pstcTxDesc->u32ControlStatus, ETH_DMATXDESC_TTSE); + } + } + + return enRet; +} + +/** + * @brief Enable or disable DMA Tx descriptor replace CRC. + * @param [in] pstcTxDesc Pointer to a DMA Tx descriptor @ref stc_eth_dma_desc_t + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval An en_result_t enumeration value: + * - Ok: Configure Tx replace CRC success + * - ErrorInvalidParameter: pstcTxDesc == NULL + */ +en_result_t ETH_DMA_TxDescReplaceCRCCmd(stc_eth_dma_desc_t *pstcTxDesc, en_functional_state_t enNewSta) +{ + en_result_t enRet = Ok; + + if (NULL == pstcTxDesc) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + if (Disable != enNewSta) + { + SET_REG32_BIT(pstcTxDesc->u32ControlStatus, ETH_DMATXDESC_CRCR); + } + else + { + CLEAR_REG32_BIT(pstcTxDesc->u32ControlStatus, ETH_DMATXDESC_CRCR); + } + } + + return enRet; +} + +/** + * @brief Enable or disable DMA Tx finished interrupt. + * @param [in] pstcTxDesc Pointer to a DMA Tx descriptor @ref stc_eth_dma_desc_t + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval An en_result_t enumeration value: + * - Ok: Configure Tx interrupt configure success + * - ErrorInvalidParameter: pstcTxDesc == NULL + */ +en_result_t ETH_DMA_TxDescIntCmd(stc_eth_dma_desc_t *pstcTxDesc, en_functional_state_t enNewSta) +{ + en_result_t enRet = Ok; + + if (NULL == pstcTxDesc) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + if (Disable != enNewSta) + { + SET_REG32_BIT(pstcTxDesc->u32ControlStatus, ETH_DMATXDESC_IOC); + } + else + { + CLEAR_REG32_BIT(pstcTxDesc->u32ControlStatus, ETH_DMATXDESC_IOC); + } + } + + return enRet; +} + +/** + * @brief Get DMA Tx descriptor flag status. + * @param [in] pstcTxDesc Pointer to a DMA Tx descriptor @ref stc_eth_dma_desc_t + * @param [in] u32Flag DMA Tx descriptor flag type + * This parameter can be one or any combination of the following values: + * @arg ETH_DMATXDESC_OWN: OWN bit + * @arg ETH_DMATXDESC_IOC: Interrupt on Completion + * @arg ETH_DMATXDESC_TLS: Transmit Last Segment + * @arg ETH_DMATXDESC_TFS: Transmit First Segment + * @arg ETH_DMATXDESC_DCRC: Disable CRC + * @arg ETH_DMATXDESC_DPAD: Disable Padding + * @arg ETH_DMATXDESC_TTSE: Transmit Time Stamp Enable + * @arg ETH_DMATXDESC_CRCR: CRC Replace Control + * @arg ETH_DMATXDESC_TER: Transmit End of Ring + * @arg ETH_DMATXDESC_TSAC: Second Address Chained + * @arg ETH_DMATXDESC_TTSS: Tx Time Stamp Status + * @arg ETH_DMATXDESC_IHE: IP Header Error + * @arg ETH_DMATXDESC_ETSUM: Tx Error summary + * @arg ETH_DMATXDESC_JTE: Jabber Timeout Error + * @arg ETH_DMATXDESC_FFF: Frame Flushed + * @arg ETH_DMATXDESC_TPCE: Payload Checksum Error + * @arg ETH_DMATXDESC_LOCE: Loss Carrier Error + * @arg ETH_DMATXDESC_NCE: No Carrier Error + * @arg ETH_DMATXDESC_TLCE: Late Collision Error + * @arg ETH_DMATXDESC_ECE: Excessive Collision Error + * @arg ETH_DMATXDESC_VLF: VLAN Frame + * @arg ETH_DMATXDESC_EDE: Excessive Deferral Error + * @arg ETH_DMATXDESC_UDE: Underflow Error + * @arg ETH_DMATXDESC_DEE: Deferred Error + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t ETH_DMA_GetTxDescStatus(const stc_eth_dma_desc_t *pstcTxDesc, uint32_t u32Flag) +{ + en_flag_status_t enFlagSta = Reset; + + /* Check parameters */ + DDL_ASSERT(IS_ETH_DMATXDESC_STATUS(u32Flag)); + + if (NULL != pstcTxDesc) + { + if (0UL != (pstcTxDesc->u32ControlStatus & u32Flag)) + { + enFlagSta = Set; + } + } + + return enFlagSta; +} + +/** + * @brief Get DMA Tx descriptor collision count + * @param [in] pstcTxDesc Pointer to a DMA Tx descriptor @ref stc_eth_dma_desc_t + * @param [out] pu32ColliCnt Pointer to DMA Tx collision count + * @retval An en_result_t enumeration value: + * - Ok: Get collision count success + * - ErrorInvalidParameter: pstcTxDesc == NULL or pu32ColliCnt == NULL + */ +en_result_t ETH_DMA_GetTxDescCollisionCnt(const stc_eth_dma_desc_t *pstcTxDesc, uint32_t *pu32ColliCnt) +{ + en_result_t enRet = Ok; + + if ((NULL == pstcTxDesc) || (NULL == pu32ColliCnt)) + { + enRet = ErrorInvalidParameter; + } + else + { + *pu32ColliCnt = (pstcTxDesc->u32ControlStatus >> ETH_DMATXDESC_COLLISION_COUNTSHIFT) & ((uint32_t)0x0000000FUL); + } + + return enRet; +} + +/** + * @brief Get DMA Tx descriptor timestamp. + * @param [in] pstcTxDesc Pointer to a DMA Tx descriptor @ref stc_eth_dma_desc_t + * @param [out] pu32High Timestamp high bit time + * @param [out] pu32Low Timestamp low bit time + * @retval An en_result_t enumeration value: + * - Ok: Get timestamp success + * - ErrorInvalidParameter: pstcTxDesc == NULL or pu32High == NULL or pu32Low == NULL + */ +en_result_t ETH_DMA_GetTxDescTimeStamp(const stc_eth_dma_desc_t *pstcTxDesc, uint32_t *pu32High, uint32_t *pu32Low) +{ + en_result_t enRet = Ok; + + if ((NULL == pstcTxDesc) || (NULL == pu32High) || (NULL == pu32Low)) + { + enRet = ErrorInvalidParameter; + } + else + { + *pu32Low = pstcTxDesc->u32TimeStampLow; + *pu32High = pstcTxDesc->u32TimeStampHigh; + } + + return enRet; +} + +/** + * @brief Set DMA Rx descriptor own bit. + * @param [in] pstcRxDesc Pointer to a DMA Rx descriptor @ref stc_eth_dma_desc_t + * @param [in] u32Owner DMA Rx descriptor owner + * This parameter can be one of the following values: + * @arg ETH_DMADESC_OWN_CPU: Descriptor is owned by CPU + * @arg ETH_DMADESC_OWN_DMA: Descriptor is owned by DMA + * @retval An en_result_t enumeration value: + * - Ok: Set Rx descriptor own bit success + * - ErrorInvalidParameter: pstcRxDesc == NULL + */ +en_result_t ETH_DMA_SetRxDescOwn(stc_eth_dma_desc_t *pstcRxDesc, uint32_t u32Owner) +{ + en_result_t enRet = Ok; + + if (NULL == pstcRxDesc) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_ETH_DMADESC_OWN(u32Owner)); + + if (ETH_DMADESC_OWN_CPU != u32Owner) + { + SET_REG32_BIT(pstcRxDesc->u32ControlStatus, ETH_DMARXDESC_OWN); + } + else + { + CLEAR_REG32_BIT(pstcRxDesc->u32ControlStatus, ETH_DMARXDESC_OWN); + } + } + + return enRet; +} + +/** + * @brief Enable or disable DMA Rx finished interrupt. + * @param [in] pstcRxDesc Pointer to a DMA Rx descriptor @ref stc_eth_dma_desc_t + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval An en_result_t enumeration value: + * - Ok: Rx interrupt configure success + * - ErrorInvalidParameter: pstcRxDesc == NULL + */ +en_result_t ETH_DMA_RxDescIntCmd(stc_eth_dma_desc_t *pstcRxDesc, en_functional_state_t enNewSta) +{ + en_result_t enRet = Ok; + + if (NULL == pstcRxDesc) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + if (Disable != enNewSta) + { + CLEAR_REG32_BIT(pstcRxDesc->u32ControlBufferSize, ETH_DMARXDESC_DIC); + } + else + { + SET_REG32_BIT(pstcRxDesc->u32ControlBufferSize, ETH_DMARXDESC_DIC); + } + } + + return enRet; +} + +/** + * @brief Get DMA Rx descriptor flag status. + * @param [in] pstcRxDesc Pointer to a DMA Rx descriptor @ref stc_eth_dma_desc_t + * @param [in] u32Flag DMA Rx descriptor flag type + * This parameter can be one or any combination of the following values: + * @arg ETH_DMARXDESC_OWN: OWN bit + * @arg ETH_DMARXDESC_DAF: DA Filter Fail for the received frame + * @arg ETH_DMARXDESC_ERSUM: Rx Error summary + * @arg ETH_DMARXDESC_DPE: Descriptor Error + * @arg ETH_DMARXDESC_SAF: SA Filter Fail for the received frame + * @arg ETH_DMARXDESC_LEE: Length Error + * @arg ETH_DMARXDESC_OVE: Overflow Error + * @arg ETH_DMARXDESC_VLAT VLAN Tag + * @arg ETH_DMARXDESC_RFS: First descriptor + * @arg ETH_DMARXDESC_RLS: Last descriptor + * @arg ETH_DMARXDESC_IPE_TSPA_GF: COE Error or Time stamp valid or jumbo frame + * @arg ETH_DMARXDESC_RLCE: Late collision Error + * @arg ETH_DMARXDESC_FRAT: Frame type + * @arg ETH_DMARXDESC_WTE: Receive Watchdog Timeout + * @arg ETH_DMARXDESC_REE: Receive error + * @arg ETH_DMARXDESC_DBE: Dribble bit error + * @arg ETH_DMARXDESC_CRE: CRC error + * @arg ETH_DMARXDESC_DAS_ESA: MAC Address Filter/Status bit extension + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t ETH_DMA_GetRxDescStatus(const stc_eth_dma_desc_t *pstcRxDesc, uint32_t u32Flag) +{ + en_flag_status_t enFlagSta = Reset; + + /* Check parameters */ + DDL_ASSERT(IS_ETH_DMARXDESC_STATUS(u32Flag)); + + if (NULL != pstcRxDesc) + { + if (0UL != (pstcRxDesc->u32ControlStatus & u32Flag)) + { + enFlagSta = Set; + } + } + + return enFlagSta; +} + +/** + * @brief Get DMA Rx descriptor extend flag status. + * @param [in] pstcRxDesc Pointer to a DMA Rx descriptor @ref stc_eth_dma_desc_t + * @param [in] u32Flag DMA Rx descriptor extend flag type + * This parameter can be one or any combination of the following values: + * @arg ETH_DMARXDESC_L4FMS: L4 Port Filter Status + * @arg ETH_DMARXDESC_L3FMS: L3 Address Filter Status + * @arg ETH_DMARXDESC_TSPD: Discard Time Stamp + * @arg ETH_DMARXDESC_PTPV: PTP Version + * @arg ETH_DMARXDESC_PTPFT: PTP Frame Type + * @arg ETH_DMARXDESC_IPV6DR: IPv6 Packet Received + * @arg ETH_DMARXDESC_IPV4DR: IPv4 Packet Received + * @arg ETH_DMARXDESC_IPCB: COE engine Bypassed + * @arg ETH_DMARXDESC_IPPE: IP Payload Error + * @arg ETH_DMARXDESC_IPHE: IP Header Error + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t ETH_DMA_GetRxDescExtendStatus(const stc_eth_dma_desc_t *pstcRxDesc, uint32_t u32Flag) +{ + en_flag_status_t enFlagSta = Reset; + + /* Check parameters */ + DDL_ASSERT(IS_ETH_DMARXDESC_EXTEND_STATUS(u32Flag)); + + if (NULL != pstcRxDesc) + { + if (0UL != (pstcRxDesc->u32ExtendStatus & u32Flag)) + { + enFlagSta = Set; + } + } + + return enFlagSta; +} + +/** + * @brief Get DMA Rx descriptor payload type. + * @param [in] pstcRxDesc Pointer to a DMA Rx descriptor @ref stc_eth_dma_desc_t + * @param [out] pu32PayloadType Pointer to DMA Rx payload type + * The payload type may be one of the following values: + * - ETH_DMARXDESC_IPPT_UNKNOWN: Unknown + * - ETH_DMARXDESC_IPPT_UDP: UDP + * - ETH_DMARXDESC_IPPT_TCP: TCP + * - ETH_DMARXDESC_IPPT_ICMP: ICMP + * @retval An en_result_t enumeration value: + * - Ok: Get payload type success + * - ErrorInvalidParameter: pstcRxDesc == NULL or pu32PayloadType == NULL + */ +en_result_t ETH_DMA_GetRxDescPayloadType(const stc_eth_dma_desc_t *pstcRxDesc, uint32_t *pu32PayloadType) +{ + en_result_t enRet = Ok; + + if ((NULL == pstcRxDesc) || (NULL == pu32PayloadType)) + { + enRet = ErrorInvalidParameter; + } + else + { + *pu32PayloadType = pstcRxDesc->u32ExtendStatus & ETH_DMARXDESC_IPPT; + } + + return enRet; +} + +/** + * @brief Get DMA Rx descriptor datagram type. + * @param [in] pstcRxDesc Pointer to a DMA Rx descriptor @ref stc_eth_dma_desc_t + * @param [out] pu32DatagramType Pointer to DMA Rx datagram type + * The payload type may be one of the following values: + * - ETH_DMARXDESC_MTP_NONE: No PTP messages + * - ETH_DMARXDESC_MTP_SYNC: SYNC message (all clock types) + * - ETH_DMARXDESC_MTP_FOLLOWUP: Follow_Up message (all clock types) + * - ETH_DMARXDESC_MTP_DELAYREQ: Delay_Req message (all clock types) + * - ETH_DMARXDESC_MTP_DELAYRESP: Delay_Resp message (all clock types) + * - ETH_DMARXDESC_MTP_PDELAYREQ: Pdelay_Req message (peer-to-peer transparent clock) + * - ETH_DMARXDESC_MTP_PDELAYRESP: Pdelay_Resp message (peer-to-peer transparent clock) + * - ETH_DMARXDESC_MTP_PDELAYRESP_FOLLOWUP: Pdelay_Resp_Follow_Up message (peer-to-peer transparent clock) + * - ETH_DMARXDESC_MTP_ANNOUNCE: Announce message (Ordinary or Boundary clock) + * - ETH_DMARXDESC_MTP_MANAGEMENT: Management message (Ordinary or Boundary clock) + * - ETH_DMARXDESC_MTP_SIGNALING: Signaling message (Ordinary or Boundary clock) + * - ETH_DMARXDESC_MTP_DEFAULT: Default Datagram Type + * @retval An en_result_t enumeration value: + * - Ok: Get datagram type success + * - ErrorInvalidParameter: pstcRxDesc == NULL or pu32DatagramType == NULL + */ +en_result_t ETH_DMA_GetRxDescDatagramType(const stc_eth_dma_desc_t *pstcRxDesc, uint32_t *pu32DatagramType) +{ + en_result_t enRet = Ok; + + if ((NULL == pstcRxDesc) || (NULL == pu32DatagramType)) + { + enRet = ErrorInvalidParameter; + } + else + { + *pu32DatagramType = pstcRxDesc->u32ExtendStatus & ETH_DMARXDESC_MTP; + } + + return enRet; +} + +/** + * @brief Get DMA Rx descriptor frame length. + * @param [in] pstcRxDesc Pointer to a DMA Rx descriptor @ref stc_eth_dma_desc_t + * @param [out] pu32FrameLength Pointer to DMA Rx frame length + * @retval An en_result_t enumeration value: + * - Ok: Get frame length success + * - ErrorInvalidParameter: pstcRxDesc == NULL or pu32FrameLength == NULL + */ +en_result_t ETH_DMA_GetRxDescFrameLength(const stc_eth_dma_desc_t *pstcRxDesc, uint32_t *pu32FrameLength) +{ + en_result_t enRet = Ok; + + if ((NULL == pstcRxDesc) || (NULL == pu32FrameLength)) + { + enRet = ErrorInvalidParameter; + } + else + { + *pu32FrameLength = (pstcRxDesc->u32ControlStatus >> ETH_DMARXDESC_FRAME_LENGTHSHIFT) & ((uint32_t)0x00003FFFUL); + } + + return enRet; +} + +/** + * @brief Get DMA Rx descriptor buffer size. + * @param [in] pstcRxDesc Pointer to a DMA Rx descriptor @ref stc_eth_dma_desc_t + * @param [in] u8BufferNum Buffer sequence number + * This parameter can be one of the following values: + * @arg ETH_DMADESC_BUFFER1: DMA Rx Desc Buffer1 + * @arg ETH_DMADESC_BUFFER2: DMA Rx Desc Buffer2 + * @param [out] pu32BufferSize Pointer to DMA Rx buffer size + * @retval An en_result_t enumeration value: + * - Ok: Get buffer size success + * - ErrorInvalidParameter: pstcRxDesc == NULL or pu32BufferSize == NULL + */ +en_result_t ETH_DMA_GetRxDescBufferSize(const stc_eth_dma_desc_t *pstcRxDesc, uint8_t u8BufferNum, uint32_t *pu32BufferSize) +{ + en_result_t enRet = Ok; + uint32_t u32ShiftBit = 0UL; + + if ((NULL == pstcRxDesc) || (NULL == pu32BufferSize)) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_ETH_DMADESC_BUFFER(u8BufferNum)); + + /* DMA Rx Desc buffer2 */ + if (ETH_DMADESC_BUFFER1 != u8BufferNum) + { + u32ShiftBit = ETH_DMADESC_BUFFER2_SIZESHIFT; + } + *pu32BufferSize = (pstcRxDesc->u32ControlBufferSize >> u32ShiftBit) & ((uint32_t)0x00001FFFUL); + } + + return enRet; +} + +/** + * @brief Get DMA Rx descriptor timestamp. + * @param [in] pstcRxDesc Pointer to a DMA Rx descriptor @ref stc_eth_dma_desc_t + * @param [out] pu32High Timestamp high bit time + * @param [out] pu32Low Timestamp low bit time + * @retval An en_result_t enumeration value: + * - Ok: Get timestamp success + * - ErrorInvalidParameter: pstcRxDesc == NULL or pu32High == NULL or pu32Low == NULL + */ +en_result_t ETH_DMA_GetRxDescTimeStamp(const stc_eth_dma_desc_t *pstcRxDesc, uint32_t *pu32High, uint32_t *pu32Low) +{ + en_result_t enRet = Ok; + + if ((NULL == pstcRxDesc) || (NULL == pu32High) || (NULL == pu32Low)) + { + enRet = ErrorInvalidParameter; + } + else + { + *pu32Low = pstcRxDesc->u32TimeStampLow; + *pu32High = pstcRxDesc->u32TimeStampHigh; + } + + return enRet; +} + +/******************************************************************************/ +/* PMT Functions */ +/******************************************************************************/ +/** + * @brief Reset PMT wakeup frame pointer. + * @param None + * @retval An en_result_t enumeration value: + * - Ok: Reset pointer success + * - ErrorTimeout: Reset timeout + */ +en_result_t ETH_PMT_ResetWakeupFramePointer(void) +{ + __IO uint32_t u32Count; + en_result_t enRet = Ok; + + WRITE_REG32(bM4_ETH->MAC_PMTCTLR_b.RTWKFR, 1U); + u32Count = ETH_TIMEOUT_WRITE_REGISTER * (HCLK_VALUE / 20000UL); + while (0UL != READ_REG32(bM4_ETH->MAC_PMTCTLR_b.RTWKFR)) + { + if (0UL == u32Count) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + + return enRet; +} +/** + * @brief Write PMT wakeup frame register. + * @param [in] au32RegBuffer Pointer to wakeup frame filter register buffer(8 words). + * @retval An en_result_t enumeration value: + * - Ok: Write register success + * - ErrorInvalidParameter: au32RegBuffer == NULL + */ +en_result_t ETH_PMT_WriteWakeupFrameRegister(const uint32_t au32RegBuffer[]) +{ + uint32_t i; + en_result_t enRet = Ok; + + if (NULL == au32RegBuffer) + { + enRet = ErrorInvalidParameter; + } + else + { + for (i=0U; iMAC_RTWKFFR, au32RegBuffer[i]); + } + } + + return enRet; +} + +/** + * @brief Enable or disable PMT forward wakeup frame. + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void ETH_PMT_ForwardWakeupFrameCmd(en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + WRITE_REG32(bM4_ETH->MAC_PMTCTLR_b.RTWKTR, enNewSta); +} + +/** + * @brief Enable or disable PMT wakeup source. + * @param [in] u32WakeupSrc Wakeup source + * This parameter can be one or any combination of the following values: + * @arg ETH_PMT_WAKEUP_GLOBAL_UNICAST: Global unicast + * @arg ETH_PMT_WAKEUP_WAKEUP_FRAME: Wake-Up Frame + * @arg ETH_PMT_WAKEUP_MAGIC_PACKET: Magic Packet + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void ETH_PMT_WakeupSourceCmd(uint32_t u32WakeupSrc, en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + if (Disable != enNewSta) + { + SET_REG32_BIT(M4_ETH->MAC_PMTCTLR, u32WakeupSrc); + } + else + { + CLEAR_REG32_BIT(M4_ETH->MAC_PMTCTLR, u32WakeupSrc); + } +} + +/** + * @brief Enable or disable PMT powerdown mode. + * @param None + * @retval An en_result_t enumeration value: + * - Ok: Set powerdown mode success + * - Error: Set powerdown mode failed + */ +en_result_t ETH_PMT_EnterPowerDown(void) +{ + en_result_t enRet = Error; + + if (0UL != READ_REG32(bM4_ETH->MAC_PMTCTLR_b.MPEN)) + { + if (0UL != READ_REG32(bM4_ETH->MAC_PMTCTLR_b.WKEN)) + { + WRITE_REG32(bM4_ETH->MAC_PMTCTLR_b.PWDN, Enable); + enRet = Ok; + } + } + + return enRet; +} + +/** + * @brief Get PMT flag status. + * @param [in] u32Flag PMT flag type + * This parameter can be one or any combination of the following values: + * @arg ETH_PMT_FLAG_RTWKFR: Wake-Up Frame Filter Register Pointer Reset + * @arg ETH_PMT_FLAG_WKFR: Wake-Up Frame Received + * @arg ETH_PMT_FLAG_MPFR: Magic Packet Received + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t ETH_PMT_GetStatus(uint32_t u32Flag) +{ + en_flag_status_t enFlagSta = Reset; + + /* Check parameters */ + DDL_ASSERT(IS_ETH_PMT_FLAG(u32Flag)); + + if (0UL != (READ_REG32_BIT(M4_ETH->MAC_PMTCTLR, u32Flag))) + { + enFlagSta = Set; + } + + return enFlagSta; +} + +/******************************************************************************/ +/* MMC Functions */ +/******************************************************************************/ +/** + * @brief De-Initialize MMC. + * @param None + * @retval An en_result_t enumeration value: + * - Ok: MMC De-Initialize success +* - ErrorTimeout: De-Initialize timeout + */ +en_result_t ETH_MMC_DeInit(void) +{ + WRITE_REG32(M4_ETH->MMC_MMCCTLR, 0UL); + WRITE_REG32(M4_ETH->MMC_RITCTLR, 0UL); + WRITE_REG32(M4_ETH->MMC_TITCTLR, 0UL); + + return ETH_MMC_CounterReset(); +} + +/** + * @brief Initialize MMC. + * @param [in] pstcMmcInit Pointer to a @ref stc_eth_mmc_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: MMC Initialize success + * - ErrorInvalidParameter: pstcMmcInit == NULL + */ +en_result_t ETH_MMC_Init(const stc_eth_mmc_init_t *pstcMmcInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcMmcInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_ETH_MMC_COUNTER_PRESETMODE(pstcMmcInit->u32PresetMode)); + DDL_ASSERT(IS_ETH_MMC_READ_RESET(pstcMmcInit->u32ReadReset)); + DDL_ASSERT(IS_ETH_MMC_COUNTER_RELOAD(pstcMmcInit->u32ReloadMode)); + + MODIFY_REG32(M4_ETH->MMC_MMCCTLR, + (ETH_MMC_MMCCTLR_MCPSEL | ETH_MMC_MMCCTLR_MCPSET | + ETH_MMC_MMCCTLR_ROR | ETH_MMC_MMCCTLR_COS), + (pstcMmcInit->u32PresetMode | pstcMmcInit->u32ReadReset | + pstcMmcInit->u32ReloadMode)); + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_eth_mmc_init_t to default values. + * @param [out] pstcMmcInit Pointer to a @ref stc_eth_mmc_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Structure Initialize success + * - ErrorInvalidParameter: pstcMmcInit == NULL + */ +en_result_t ETH_MMC_StructInit(stc_eth_mmc_init_t *pstcMmcInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcMmcInit) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcMmcInit->u32PresetMode = ETH_MMC_COUNTER_PRESETMODE_DISABLE; + pstcMmcInit->u32ReadReset = ETH_MMC_READ_RESET_ENABLE; + pstcMmcInit->u32ReloadMode = ETH_MMC_COUNTER_RELOAD_ENABLE; + } + + return enRet; +} + +/** + * @brief MMC all counter software reset. + * @param None + * @retval An en_result_t enumeration value: + * - Ok: Reset success + * - ErrorTimeout: Reset timeout + */ +en_result_t ETH_MMC_CounterReset(void) +{ + __IO uint32_t u32Count; + en_result_t enRet = Ok; + + WRITE_REG32(bM4_ETH->MMC_MMCCTLR_b.CRST, 1U); + u32Count = ETH_TIMEOUT_WRITE_REGISTER * (HCLK_VALUE / 20000UL); + while (0UL != READ_REG32(bM4_ETH->MMC_MMCCTLR_b.CRST)) + { + if (0UL == u32Count) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + + return enRet; +} + +/** + * @brief Enable or disable the reset of all MMC counter after reading. + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void ETH_MMC_ResetAfterReadCmd(en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + WRITE_REG32(bM4_ETH->MMC_MMCCTLR_b.ROR, enNewSta); +} + +/** + * @brief Enable or disable MMC function. + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void ETH_MMC_Cmd(en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + if (Disable != enNewSta) + { + WRITE_REG32(bM4_ETH->MMC_MMCCTLR_b.MCF, Disable); + } + else + { + WRITE_REG32(bM4_ETH->MMC_MMCCTLR_b.MCF, Enable); + } +} + +/** + * @brief Enable or disable MMC transmit interrupt. + * @param [in] u32IntSrc MMC interrupt source + * This parameter can be one or any combination of the following values: + * @arg ETH_MMC_INT_TXEDEIM: Tx excessive deferral error frame interrupt + * @arg ETH_MMC_INT_TXUGIM: Tx unicast good frame interrupt + * @arg ETH_MMC_INT_TXCAEIM: Tx carrier error frame interrupt + * @arg ETH_MMC_INT_TXECEIM: Tx excessive collision error frame interrupt + * @arg ETH_MMC_INT_TXLCEIM: Tx deferral collision error frame interrupt + * @arg ETH_MMC_INT_TXDEEIM: Tx deferral error frame interrupt + * @arg ETH_MMC_INT_TXMGIM: Tx multicast good frame interrupt + * @arg ETH_MMC_INT_TXBGIM: Tx broadcast good frame interrupt + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void ETH_MMC_TxIntCmd(uint32_t u32IntSrc, en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_ETH_MMC_TX_INTERRUPT(u32IntSrc)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + if (Disable != enNewSta) + { + CLEAR_REG32_BIT(M4_ETH->MMC_TITCTLR, u32IntSrc); + } + else + { + SET_REG32_BIT(M4_ETH->MMC_TITCTLR, u32IntSrc); + } +} + +/** + * @brief Enable or disable MMC receive interrupt. + * @param [in] u32IntSrc MMC interrupt source + * This parameter can be one or any combination of the following values: + * @arg ETH_MMC_INT_RXOEIM: Rx out of scope error frame interrupt + * @arg ETH_MMC_INT_RXLEIM: Rx length error frame interrupt + * @arg ETH_MMC_INT_RXUGIM: Rx unicast good frame interrupt + * @arg ETH_MMC_INT_RXREIM: Rx short error frame interrupt + * @arg ETH_MMC_INT_RXAEIM: Rx alignment error frame interrupt + * @arg ETH_MMC_INT_RXCEIM: Rx crc error frame interrupt + * @arg ETH_MMC_INT_RXMGIM: Rx multicast good frame interrupt + * @arg ETH_MMC_INT_RXBGIM: Rx broadcast good frame interrupt + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void ETH_MMC_RxIntCmd(uint32_t u32IntSrc, en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_ETH_MMC_RX_INTERRUPT(u32IntSrc)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + if (Disable != enNewSta) + { + CLEAR_REG32_BIT(M4_ETH->MMC_RITCTLR, u32IntSrc); + } + else + { + SET_REG32_BIT(M4_ETH->MMC_RITCTLR, u32IntSrc); + } +} + +/** + * @brief Get MMC flag transmit status. + * @param [in] u32Flag MMC flag type + * This parameter can be one or any combination of the following values: + * @arg ETH_MMC_FLAG_TXEDEIS: Tx excessive deferral error frame counter reaches half or all the maximum value + * @arg ETH_MMC_FLAG_TXUGIS: Tx unicast good frame counter reaches half or all the maximum value + * @arg ETH_MMC_FLAG_TXCAEIS: Tx carrier error frame counter reaches half or all the maximum value + * @arg ETH_MMC_FLAG_TXECEIS: Tx excessive collision error frame counter reaches half or all the maximum value + * @arg ETH_MMC_FLAG_TXLCEIS: Tx deferral collision error frame counter reaches half or all the maximum value + * @arg ETH_MMC_FLAG_TXDEEIS: Tx deferral error frame counter reaches half or all the maximum value + * @arg ETH_MMC_FLAG_TXMGIS: Tx multicast good frame counter reaches half or all the maximum value + * @arg ETH_MMC_FLAG_TXBGIS: Tx broadcast good frame counter reaches half or all the maximum value + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t ETH_MMC_GetTxStatus(uint32_t u32Flag) +{ + en_flag_status_t enFlagSta = Reset; + + /* Check parameters */ + DDL_ASSERT(IS_ETH_MMC_TX_FLAG(u32Flag)); + + if (0UL != (READ_REG32_BIT(M4_ETH->MMC_TRSSTSR, u32Flag))) + { + enFlagSta = Set; + } + + return enFlagSta; +} + +/** + * @brief Get MMC receive flag status. + * @param [in] u32Flag MMC flag type + * This parameter can be one or any combination of the following values: + * @arg ETH_MMC_FLAG_RXOEIS: Rx out of scope error frame counter reaches half or all the maximum value + * @arg ETH_MMC_FLAG_RXLEIS: Rx length error frame counter reaches half or all the maximum value + * @arg ETH_MMC_FLAG_RXUGIS: Rx unicast good frame counter reaches half or all the maximum value + * @arg ETH_MMC_FLAG_RXREIS: Rx short error frame counter reaches half or all the maximum value + * @arg ETH_MMC_FLAG_RXAEIS: Rx alignment error frame counter reaches half or all the maximum value + * @arg ETH_MMC_FLAG_RXCEIS: Rx crc error frame counter reaches half or all the maximum value + * @arg ETH_MMC_FLAG_RXMGIS: Rx multicast good frame counter reaches half or all the maximum value + * @arg ETH_MMC_FLAG_RXBGIS: Rx broadcast good frame counter reaches half or all the maximum value + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t ETH_MMC_GetRxStatus(uint32_t u32Flag) +{ + en_flag_status_t enFlagSta = Reset; + + /* Check parameters */ + DDL_ASSERT(IS_ETH_MMC_RX_FLAG(u32Flag)); + + if (0UL != (READ_REG32_BIT(M4_ETH->MMC_REVSTSR, u32Flag))) + { + enFlagSta = Set; + } + + return enFlagSta; +} + +/** + * @brief Get MMC register. + * @param [in] u32Reg MMC statistics register + * This parameter can be one of the following values: + * @arg ETH_MMC_REG_TXBRGFR: Tx broadcast good frame Statistical Register + * @arg ETH_MMC_REG_TXMUGFR: Tx multicast good frame Statistical Register + * @arg ETH_MMC_REG_TXDEEFR: Tx deferral error frame Statistical Register + * @arg ETH_MMC_REG_TXLCEFR: Tx deferral collision error frame Statistical Register + * @arg ETH_MMC_REG_TXECEFR: Tx excessive collision error frame Statistical Register + * @arg ETH_MMC_REG_TXCAEFR: Tx carrier error frame Statistical Register + * @arg ETH_MMC_REG_TXUNGFR: Tx unicast good frame Statistical Register + * @arg ETH_MMC_REG_TXEDEFR: Tx excessive deferral error frame Statistical Register + * @arg ETH_MMC_REG_RXBRGFR: Rx broadcast good frame Statistical Register + * @arg ETH_MMC_REG_RXMUGFR: Rx multicast good frame Statistical Register + * @arg ETH_MMC_REG_RXCREFR: Rx crc error frame Statistical Register + * @arg ETH_MMC_REG_RXALEFR: Rx alignment error frame Statistical Register + * @arg ETH_MMC_REG_RXRUEFR: Rx short error frame Statistical Register + * @arg ETH_MMC_REG_RXUNGFR: Rx unicast good frame Statistical Register + * @arg ETH_MMC_REG_RXLEEFR: Rx length error frame Statistical Register + * @arg ETH_MMC_REG_RXOREFR: Rx out of scope error frame Statistical Register + * @retval uint32_t MMC statistics Register value + */ +uint32_t ETH_MMC_GetRegister(uint32_t u32Reg) +{ + /* Check parameters */ + DDL_ASSERT(IS_ETH_MMC_REG(u32Reg)); + + return (*(__IO uint32_t *)((uint32_t)(&M4_ETH->MAC_CONFIGR) + u32Reg)); +} + +/******************************************************************************/ +/* PTP Functions */ +/******************************************************************************/ +/** + * @brief De-Initialize PTP. + * @param None + * @retval None + */ +void ETH_PTP_DeInit(void) +{ + WRITE_REG32(M4_ETH->PTP_TSPCTLR, 0x00002000UL); + WRITE_REG32(M4_ETH->PTP_TSPADDR, 0UL); + WRITE_REG32(M4_ETH->PTP_TSPNSAR, 0UL); + WRITE_REG32(M4_ETH->PTP_TMUSECR, 0UL); + WRITE_REG32(M4_ETH->PTP_TMUNSER, 0UL); +} + +/** + * @brief Initialize PTP. + * @param [in] pstcPtpInit Pointer to a @ref stc_eth_ptp_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: PTP Initialize success + * - Error: PTP Initialize failed + * - ErrorInvalidParameter: pstcPtpInit == NULL + */ +en_result_t ETH_PTP_Init(const stc_eth_ptp_init_t *pstcPtpInit) +{ + en_result_t enRet; + + if (NULL == pstcPtpInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_ETH_PTP_FRAME_DA_FILTER(pstcPtpInit->u32DAFilter)); + DDL_ASSERT(IS_ETH_PTP_DATAGRAM_VERSION(pstcPtpInit->u32DatagramVersion)); + DDL_ASSERT(IS_ETH_PTP_SUBSECOND_SCALE(pstcPtpInit->u32SubSecScale)); + DDL_ASSERT(IS_ETH_PTP_DATAGRAM_TYPE(pstcPtpInit->u32SnapDatagramType)); + DDL_ASSERT(IS_ETH_PTP_FRAME_TYPE(pstcPtpInit->u32SnapFrameType)); + DDL_ASSERT(IS_ETH_PTP_CALIBRATION_MODE(pstcPtpInit->u32CalibMode)); + DDL_ASSERT(IS_ETH_PTP_SUB_SECOND(pstcPtpInit->u32InitValueSubSec)); + + /* Set increase value registers */ + WRITE_REG32(M4_ETH->PTP_TSPNSAR, pstcPtpInit->u8IncValueSubSec); + WRITE_REG32(M4_ETH->PTP_TSPADDR, pstcPtpInit->u32IncValueBasic); + enRet = ETH_PTP_UpdateBasicIncValue(); + if (Ok == enRet) + { + /* Set timestamp control register */ + MODIFY_REG32(M4_ETH->PTP_TSPCTLR, ETH_PTP_TSPCTLR_CLEAR_MASK, + (pstcPtpInit->u32DAFilter | pstcPtpInit->u32SnapDatagramType | pstcPtpInit->u32SnapFrameType | + pstcPtpInit->u32DatagramVersion | pstcPtpInit->u32SubSecScale | pstcPtpInit->u32CalibMode)); + /* Set initialize value */ + WRITE_REG32(M4_ETH->PTP_TMUSECR, pstcPtpInit->u32InitValueSec); + WRITE_REG32(M4_ETH->PTP_TMUNSER, pstcPtpInit->u32InitValueSubSec); + enRet = ETH_PTP_SystemTimeInit(); + if (Ok != enRet) + { + enRet = Error; + } + } + else + { + enRet = Error; + } + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_eth_ptp_init_t to default values. + * @param [out] pstcPtpInit Pointer to a @ref stc_eth_ptp_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Structure Initialize success + * - ErrorInvalidParameter: pstcPtpInit == NULL + */ +en_result_t ETH_PTP_StructInit(stc_eth_ptp_init_t *pstcPtpInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcPtpInit) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcPtpInit->u32DAFilter = ETH_PTP_FRAME_DA_FILTER_DISABLE; + pstcPtpInit->u32SnapDatagramType = ETH_PTP_DATAGRAM_TYPE_SYNC_FOLLOW_DELAY; + pstcPtpInit->u32SnapFrameType = ETH_PTP_FRAME_TYPE_IPV4FRAME; + pstcPtpInit->u32DatagramVersion = ETH_PTP_DATAGRAM_VERSION_IEEE1588V1; + pstcPtpInit->u32SubSecScale = ETH_PTP_SUBSECOND_SCALE_HEX; + pstcPtpInit->u32CalibMode = ETH_PTP_CALIBRATION_MODE_COARSE; + pstcPtpInit->u32IncValueBasic = 0UL; + pstcPtpInit->u8IncValueSubSec = 0U; + pstcPtpInit->u32InitValueSec = 0UL; + pstcPtpInit->u32InitValueSubSec = 0UL; + } + + return enRet; +} + +/** + * @brief Set PTP snapshot datagram type. + * @param [in] u32DatagramType Snapshot datagram type + * This parameter can be one of the following values: + * @arg ETH_PTP_DATAGRAM_TYPE_SYNC_FOLLOW_DELAY: SYNC Follow_Up Delay_Req Delay_Resp + * @arg ETH_PTP_DATAGRAM_TYPE_SYNC: SYNC + * @arg ETH_PTP_DATAGRAM_TYPE_DELAY: Delay_Req + * @arg ETH_PTP_DATAGRAM_TYPE_SYNC_FOLLOW_DELAY_PDELAY: SYNC Follow_Up Delay_Req Delay_Resp Pdelay_Req Pdelay_Resp Pdelay_Resp_Follow_Up + * @arg ETH_PTP_DATAGRAM_TYPE_SYNC_PDELAY: SYNC Pdelay_Req Pdelay_Resp + * @arg ETH_PTP_DATAGRAM_TYPE_DELAY_PDEALY: Delay_Req Pdelay_Req Pdelay_Resp + * @arg ETH_PTP_DATAGRAM_TYPE_SYNC_DELAY: SYNC Delay_Req + * @arg ETH_PTP_DATAGRAM_TYPE_PDELAY: Pdelay_Req Pdelay_Resp + * @retval None + */ +void ETH_PTP_SetSnapDatagramType(uint32_t u32DatagramType) +{ + /* Check parameters */ + DDL_ASSERT(IS_ETH_PTP_DATAGRAM_TYPE(u32DatagramType)); + + MODIFY_REG32(M4_ETH->PTP_TSPCTLR, ETH_PTP_TSPCTLR_TSPMTSEL, u32DatagramType); +} + +/** + * @brief Set PTP snapshot frame type. + * @param [in] u32FrameType Snapshot frame type + * This parameter can be one or any combination of the following values: + * @arg ETH_PTP_FRAME_TYPE_IPV4FRAME: snapshot of IPv4 frame + * @arg ETH_PTP_FRAME_TYPE_IPV6FRAME: snapshot of IPv6 frame + * @arg ETH_PTP_FRAME_TYPE_ETHERNETFRAME: snapshot of PTP over ethernet frame + * @arg ETH_PTP_FRAME_TYPE_ALL_RECEIVEFRAME: snapshot of all received frame + * @retval None + */ +void ETH_PTP_SetSnapFrameType(uint32_t u32FrameType) +{ + /* Check parameters */ + DDL_ASSERT(IS_ETH_PTP_FRAME_TYPE(u32FrameType)); + + MODIFY_REG32(M4_ETH->PTP_TSPCTLR, + (ETH_PTP_TSPCTLR_TSPOVIPV4 | ETH_PTP_TSPCTLR_TSPOVIPV6 | + ETH_PTP_TSPCTLR_TSPOVETH | ETH_PTP_TSPCTLR_TSPEALL), + u32FrameType); +} + +/** + * @brief Set PTP timestamp calibration mode. + * @param [in] u32CalibMode Timestamp calibration mode + * This parameter can be one of the following values: + * @arg ETH_PTP_CALIBRATION_MODE_COARSE: Coarse calibration + * @arg ETH_PTP_CALIBRATION_MODE_FINE: Fine calibration + * @retval None + */ +void ETH_PTP_SetCalibMode(uint32_t u32CalibMode) +{ + /* Check parameters */ + DDL_ASSERT(IS_ETH_PTP_CALIBRATION_MODE(u32CalibMode)); + + WRITE_REG32(bM4_ETH->PTP_TSPCTLR_b.TSPUPSEL, u32CalibMode >> ETH_PTP_TSPCTLR_TSPUPSEL_POS); +} + +/** + * @brief Update PTP timestamp basic increase value. + * @note Update Timestamp increase value by basic increase register. + * @param None + * @retval An en_result_t enumeration value: + * - Ok: Update timestamp increase value success + * - Error: Current state cannot be updated + * - ErrorTimeout: Update timeout + */ +en_result_t ETH_PTP_UpdateBasicIncValue(void) +{ + __IO uint32_t u32Count; + en_result_t enRet = Error; + + if (0UL == READ_REG32(bM4_ETH->PTP_TSPCTLR_b.TSPADUP)) + { + WRITE_REG32(bM4_ETH->MMC_MMCCTLR_b.CRST, 1U); + u32Count = ETH_TIMEOUT_WRITE_REGISTER * (HCLK_VALUE / 20000UL); + while (0UL != READ_REG32(bM4_ETH->MMC_MMCCTLR_b.CRST)) + { + if (0UL == u32Count) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + + if (ErrorTimeout != enRet) + { + enRet = Ok; + } + } + + return enRet; +} + +/** + * @brief Update PTP timestamp system time. + * @note Update Timestamp system time by update second and update subsecond registers. + * @param None + * @retval An en_result_t enumeration value: + * - Ok: Update timestamp system time success + * - Error: Current state cannot be updated + * - ErrorTimeout: Update timeout + */ +en_result_t ETH_PTP_UpdateSystemTime(void) +{ + __IO uint32_t u32Count; + en_result_t enRet = Error; + + if (0UL == READ_REG32(bM4_ETH->PTP_TSPCTLR_b.TSPINI)) + { + if (0UL == READ_REG32(bM4_ETH->PTP_TSPCTLR_b.TSPUP)) + { + WRITE_REG32(bM4_ETH->PTP_TSPCTLR_b.TSPUP, 1U); + u32Count = ETH_TIMEOUT_WRITE_REGISTER * (HCLK_VALUE / 20000UL); + while (0UL != READ_REG32(bM4_ETH->PTP_TSPCTLR_b.TSPUP)) + { + if (0UL == u32Count) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + + if (ErrorTimeout != enRet) + { + enRet = Ok; + } + } + } + + return enRet; +} + +/** + * @brief Initialize PTP timestamp system time. + * @note Initialize Timestamp system time by update second and update subsecond registers. + * @param None + * @retval An en_result_t enumeration value: + * - Ok: Initialize timestamp system time success + * - Error: Current state cannot be initialized + * - ErrorTimeout: Initialize timeout + */ +en_result_t ETH_PTP_SystemTimeInit(void) +{ + __IO uint32_t u32Count; + en_result_t enRet = Error; + + if (0UL == READ_REG32(bM4_ETH->PTP_TSPCTLR_b.TSPINI)) + { + WRITE_REG32(bM4_ETH->PTP_TSPCTLR_b.TSPINI, 1U); + u32Count = ETH_TIMEOUT_WRITE_REGISTER * (HCLK_VALUE / 20000UL); + while (0UL != READ_REG32(bM4_ETH->PTP_TSPCTLR_b.TSPINI)) + { + if (0UL == u32Count) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + + if (ErrorTimeout != enRet) + { + enRet = Ok; + } + } + + return enRet; +} + +/** + * @brief Get PTP timestamp system time. + * @param [out] pu32Sec Pointer to Timestamp system time of Second + * @param [out] pu32SubSec Pointer to Timestamp system time of Subsecond + * @retval An en_result_t enumeration value: + * - Ok: Get timestamp system time success + * - ErrorInvalidParameter: pu32Sec == NULL or pu32SubSec == NULL + */ +en_result_t ETH_PTP_GetSystemTime(uint32_t *pu32Sec, uint32_t *pu32SubSec) +{ + en_result_t enRet = Ok; + + if ((NULL == pu32Sec) || (NULL == pu32SubSec)) + { + enRet = ErrorInvalidParameter; + } + else + { + *pu32Sec = READ_REG32(M4_ETH->PTP_TMSSECR); + *pu32SubSec = READ_REG32(M4_ETH->PTP_TMSNSER); + } + + return enRet; +} + +/** + * @brief Set PTP timestamp increase value. + * @param [in] u32BasicVal Timestamp increase value of Second (Between 0x0 and 0xFFFFFFFF) + * @param [in] u8SubSecVal Timestamp increase value of Subsecond (Between 0x0 and 0xFF) + * @retval None + */ +void ETH_PTP_SetIncValue(uint32_t u32BasicVal, uint8_t u8SubSecVal) +{ + WRITE_REG32(M4_ETH->PTP_TSPADDR, u32BasicVal); + WRITE_REG32(M4_ETH->PTP_TSPNSAR, u8SubSecVal); +} + +/** + * @brief Get PTP timestamp increase value. + * @param [out] pu32BasicVal Pointer to Timestamp increase value of basic + * @param [out] pu8SubSecVal Pointer to Timestamp increase value of Subsecond + * @retval An en_result_t enumeration value: + * - Ok: Get timestamp increase value success + * - ErrorInvalidParameter: pu32BasicVal == NULL or pu8SubSecVal == NULL + */ +en_result_t ETH_PTP_GetIncValue(uint32_t *pu32BasicVal, uint8_t *pu8SubSecVal) +{ + en_result_t enRet = Ok; + + if ((NULL == pu32BasicVal) || (NULL == pu8SubSecVal)) + { + enRet = ErrorInvalidParameter; + } + else + { + *pu32BasicVal = READ_REG32(M4_ETH->PTP_TSPADDR); + *pu8SubSecVal = (uint8_t)(READ_REG32(M4_ETH->PTP_TSPNSAR) & ETH_PTP_TSPNSAR_TSPNSEADD); + } + + return enRet; +} + +/** + * @brief Set PTP timestamp update time. + * @param [in] u32Sign Timestamp Update Sign + * @arg ETH_PTP_TIME_UPDATE_SIGN_MINUS: Minus + * @arg ETH_PTP_TIME_UPDATE_SIGN_PLUS: Plus + * @param [in] u32Sec Update time of Second (Between 0x0 and 0xFFFFFFFF) + * @param [in] u32SubSec Update time of Subsecond (Between 0x0 and 0x7FFFFFFF) + * @retval None + */ +void ETH_PTP_SetUpdateTime(uint32_t u32Sign, uint32_t u32Sec, uint32_t u32SubSec) +{ + /* Check parameters */ + DDL_ASSERT(IS_ETH_PTP_TIME_UPDATE_SIGN(u32Sign)); + DDL_ASSERT(IS_ETH_PTP_SUB_SECOND(u32SubSec)); + + WRITE_REG32(M4_ETH->PTP_TMUSECR, u32Sec); + WRITE_REG32(M4_ETH->PTP_TMUNSER, (u32Sign | u32SubSec)); +} + +/** + * @brief Enable or disable PTP function. + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void ETH_PTP_Cmd(en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + WRITE_REG32(bM4_ETH->PTP_TSPCTLR_b.TSPEN, enNewSta); +} + +/** + * @brief Enable or disable PTP interrupt. + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void ETH_PTP_IntCmd(en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + WRITE_REG32(bM4_ETH->PTP_TSPCTLR_b.TSPINT, enNewSta); +} + +/** + * @brief Get PTP flag status. + * @param [in] u32Flag PTP flag type + * This parameter can be one or any combination of the following values: + * @arg ETH_PTP_FLAG_TSERR1: Target time 1 error + * @arg ETH_PTP_FLAG_TSTAR1: Target time 1 reached + * @arg ETH_PTP_FLAG_TSERR0: Target time 0 error + * @arg ETH_PTP_FLAG_TSTAR0: Target time 0 reached + * @arg ETH_PTP_FLAG_TSOVF: System time overflow + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t ETH_PTP_GetStatus(uint32_t u32Flag) +{ + en_flag_status_t enFlagSta = Reset; + + /* Check parameters */ + DDL_ASSERT(IS_ETH_PTP_FLAG(u32Flag)); + + if (0UL != (READ_REG32_BIT(M4_ETH->PTP_TSPSTSR, u32Flag))) + { + enFlagSta = Set; + } + + return enFlagSta; +} + +/******************************************************************************/ +/* PTP PPS Functions */ +/******************************************************************************/ +/** + * @brief De-Initialize PTP PPS. + * @param [in] u8Ch PPS output channel + * This parameter can be one of the following values: + * @arg ETH_PPS_TARGET_CH0: PPS Channel 0 + * @arg ETH_PPS_TARGET_CH1: PPS Channel 1 + * @retval None + */ +void ETH_PPS_DeInit(uint8_t u8Ch) +{ + uint32_t u32ShiftStep = 0UL; + uint32_t u32ShiftBit = 0UL; + __IO uint32_t *PTP_TMTSECR; + __IO uint32_t *PTP_TMTNSER; + + /* Check parameters */ + DDL_ASSERT(IS_ETH_PPS_TARGET_CH(u8Ch)); + + if (ETH_PPS_TARGET_CH1 == u8Ch) + { + u32ShiftBit = ETH_PTP_PPSCTLR_PPSFRE1_POS; + u32ShiftStep = ETH_PTP_PPS1_TIME_REG_ADDRSHIFT; + } + CLEAR_REG32_BIT(M4_ETH->PTP_PPSCTLR, + ((ETH_PTP_PPSCTLR_PPSFRE0 | ETH_PTP_PPSCTLR_PPSOMD | + ETH_PTP_PPSCTLR_TT0SEL) << u32ShiftBit)); + /* Clear target time registers */ + PTP_TMTSECR = (__IO uint32_t *)ETH_PTP_TMTSECRx(u32ShiftStep); + PTP_TMTNSER = (__IO uint32_t *)ETH_PTP_TMTNSERx(u32ShiftStep); + WRITE_REG32(*PTP_TMTSECR, 0UL); + WRITE_REG32(*PTP_TMTNSER, 0UL); +} + +/** + * @brief Initialize PTP PPS. + * @param [in] u8Ch PPS output channel + * This parameter can be one of the following values: + * @arg ETH_PPS_TARGET_CH0: PPS Channel 0 + * @arg ETH_PPS_TARGET_CH1: PPS Channel 1 + * @param [in] pstcPpsInit Pointer to a @ref stc_eth_pps_config_t structure + * @retval An en_result_t enumeration value: + * - Ok: PPS Initialize success + * - ErrorInvalidParameter: pstcPpsInit == NULL + */ +en_result_t ETH_PPS_Init(uint8_t u8Ch, const stc_eth_pps_config_t *pstcPpsInit) +{ + en_result_t enRet = Ok; + uint32_t u32ShiftStep = 0UL; + uint32_t u32ShiftBit = 0UL; + uint32_t u32RegVal; + __IO uint32_t *PTP_TMTSECR; + __IO uint32_t *PTP_TMTNSER; + + if (NULL == pstcPpsInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_ETH_PPS_TARGET_CH(u8Ch)); + DDL_ASSERT(IS_ETH_PTP_SUB_SECOND(pstcPpsInit->u32TargetTimeSubSec)); + DDL_ASSERT(IS_ETH_PPS_TARGET_TIME_FUNC(pstcPpsInit->u32TargetTimeFunc)); + DDL_ASSERT(IS_ETH_PPS_OUTPUT_MODE(pstcPpsInit->u32OutputMode)); + DDL_ASSERT(IS_ETH_PPS_OUTPUT_FREQ(pstcPpsInit->u32OutputFreq)); + DDL_ASSERT(IS_ETH_PPS1_COMPLEX_FUNC(u8Ch, pstcPpsInit->u32OutputMode, pstcPpsInit->u32OutputFreq)); + + u32RegVal = pstcPpsInit->u32OutputFreq | pstcPpsInit->u32TargetTimeFunc; + if (ETH_PPS_TARGET_CH1 == u8Ch) + { + u32ShiftBit = ETH_PTP_PPSCTLR_PPSFRE1_POS; + u32ShiftStep = ETH_PTP_PPS1_TIME_REG_ADDRSHIFT; + } + else + { + u32RegVal |= pstcPpsInit->u32OutputMode; + } + MODIFY_REG32(M4_ETH->PTP_PPSCTLR, + ((ETH_PTP_PPSCTLR_PPSFRE0 | ETH_PTP_PPSCTLR_PPSOMD | + ETH_PTP_PPSCTLR_TT0SEL) << u32ShiftBit), + (u32RegVal << u32ShiftBit)); + /* Set target time registers */ + PTP_TMTSECR = (__IO uint32_t *)ETH_PTP_TMTSECRx(u32ShiftStep); + PTP_TMTNSER = (__IO uint32_t *)ETH_PTP_TMTNSERx(u32ShiftStep); + WRITE_REG32(*PTP_TMTSECR, pstcPpsInit->u32TargetTimeSec); + WRITE_REG32(*PTP_TMTNSER, pstcPpsInit->u32TargetTimeSubSec); + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_eth_pps_config_t to default values. + * @param [out] pstcPpsInit Pointer to a @ref stc_eth_pps_config_t structure + * @retval An en_result_t enumeration value: + * - Ok: Structure Initialize success + * - ErrorInvalidParameter: pstcPpsInit == NULL + */ +en_result_t ETH_PPS_StructInit(stc_eth_pps_config_t *pstcPpsInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcPpsInit) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcPpsInit->u32TargetTimeFunc = ETH_PPS_TARGET_TIME_FUNC_INT_EVENT; + pstcPpsInit->u32OutputMode = ETH_PPS_OUTPUT_MODE_SINGLE; + pstcPpsInit->u32OutputFreq = ETH_PPS_OUTPUT_ONE_PULSE; + pstcPpsInit->u32TargetTimeSec = 0UL; + pstcPpsInit->u32TargetTimeSubSec = 0UL; + } + + return enRet; +} + +/** + * @brief Set PTP Target time function. + * @param [in] u8Ch PPS output channel + * This parameter can be one of the following values: + * @arg ETH_PPS_TARGET_CH0: PPS Channel 0 + * @arg ETH_PPS_TARGET_CH1: PPS Channel 1 + * @param [in] u32Sec Target time of Second (Between 0x0 and 0xFFFFFFFF) + * @param [in] u32SubSec Target time of Subsecond (Between 0x0 and 0x7FFFFFFF) + * @retval None + */ +void ETH_PPS_SetTargetTime(uint8_t u8Ch, uint32_t u32Sec, uint32_t u32SubSec) +{ + uint32_t u32ShiftStep = 0UL; + __IO uint32_t *PTP_TMTSECR; + __IO uint32_t *PTP_TMTNSER; + + /* Check parameters */ + DDL_ASSERT(IS_ETH_PPS_TARGET_CH(u8Ch)); + DDL_ASSERT(IS_ETH_PTP_SUB_SECOND(u32SubSec)); + + if (ETH_PPS_TARGET_CH1 == u8Ch) + { + u32ShiftStep = ETH_PTP_PPS1_TIME_REG_ADDRSHIFT; + } + PTP_TMTSECR = (__IO uint32_t *)ETH_PTP_TMTSECRx(u32ShiftStep); + PTP_TMTNSER = (__IO uint32_t *)ETH_PTP_TMTNSERx(u32ShiftStep); + WRITE_REG32(*PTP_TMTSECR, u32Sec); + WRITE_REG32(*PTP_TMTNSER, u32SubSec); +} + +/** + * @brief Set PTP Target time function. + * @param [in] u8Ch PPS output channel + * This parameter can be one of the following values: + * @arg ETH_PPS_TARGET_CH0: PPS Channel 0 + * @arg ETH_PPS_TARGET_CH1: PPS Channel 1 + * @param [in] u32Func Arrival time trigger the function + * This parameter can be one of the following values: + * @arg ETH_PPS_TARGET_TIME_FUNC_INT_EVENT: Interrupt output event + * @arg ETH_PPS_TARGET_TIME_FUNC_INT_PPS_EVENT: Interrupt out event and PPS single output event + * @arg ETH_PPS_TARGET_TIME_FUNC_PPS_EVENT: PPS Single output event + * @retval None + */ +void ETH_PPS_SetTargetTimeFunc(uint8_t u8Ch, uint32_t u32Func) +{ + uint32_t u32ShiftBit = 0UL; + + /* Check parameters */ + DDL_ASSERT(IS_ETH_PPS_TARGET_CH(u8Ch)); + DDL_ASSERT(IS_ETH_PPS_TARGET_TIME_FUNC(u32Func)); + + if (ETH_PPS_TARGET_CH1 == u8Ch) + { + u32ShiftBit = ETH_PTP_PPSCTLR_PPSFRE1_POS; + } + MODIFY_REG32(M4_ETH->PTP_PPSCTLR, (ETH_PTP_PPSCTLR_TT0SEL << u32ShiftBit), (u32Func << u32ShiftBit)); +} + +/** + * @brief Set PTP PPS0 output mode. + * @param [in] u32OutputMode PPS output mode + * This parameter can be one of the following values: + * @arg ETH_PPS_OUTPUT_MODE_CONTINUE: Continuous output mode + * @arg ETH_PPS_OUTPUT_MODE_SINGLE: Single output mode + * @retval None + */ +void ETH_PPS_SetPps0OutputMode(uint32_t u32OutputMode) +{ + /* Check parameters */ + DDL_ASSERT(IS_ETH_PPS_OUTPUT_MODE(u32OutputMode)); + + WRITE_REG32(bM4_ETH->PTP_PPSCTLR_b.PPSOMD, u32OutputMode >> ETH_PTP_PPSCTLR_PPSOMD_POS); +} + +/** + * @brief Set PTP PPS0 output frequency. + * @param [in] u32OutputFreq PPS output frequency + * This parameter can be one of the following values: + * @arg ETH_PPS_OUTPUT_FREQ_1HZ: Ouput pulse is 1HZ in continuous ouput mode + * @arg ETH_PPS_OUTPUT_FREQ_2HZ: Ouput pulse is 2HZ in continuous ouput mode + * @arg ETH_PPS_OUTPUT_FREQ_4HZ: Ouput pulse is 4HZ in continuous ouput mode + * @arg ETH_PPS_OUTPUT_FREQ_8HZ: Ouput pulse is 8HZ in continuous ouput mode + * @arg ETH_PPS_OUTPUT_FREQ_16HZ: Ouput pulse is 16HZ in continuous ouput mode + * @arg ETH_PPS_OUTPUT_FREQ_32HZ: Ouput pulse is 32HZ in continuous ouput mode + * @arg ETH_PPS_OUTPUT_FREQ_64HZ: Ouput pulse is 64HZ in continuous ouput mode + * @arg ETH_PPS_OUTPUT_FREQ_128HZ: Ouput pulse is 128HZ in continuous ouput mode + * @arg ETH_PPS_OUTPUT_FREQ_256HZ: Ouput pulse is 256HZ in continuous ouput mode + * @arg ETH_PPS_OUTPUT_FREQ_512HZ: Ouput pulse is 512HZ in continuous ouput mode + * @arg ETH_PPS_OUTPUT_FREQ_1024HZ: Ouput pulse is 1024HZ in continuous ouput mode + * @arg ETH_PPS_OUTPUT_FREQ_2048HZ: Ouput pulse is 2048HZ in continuous ouput mode + * @arg ETH_PPS_OUTPUT_FREQ_4096HZ: Ouput pulse is 4096HZ in continuous ouput mode + * @arg ETH_PPS_OUTPUT_FREQ_8192HZ: Ouput pulse is 8192HZ in continuous ouput mode + * @arg ETH_PPS_OUTPUT_FREQ_16384HZ: Ouput pulse is 16384HZ in continuous ouput mode + * @arg ETH_PPS_OUTPUT_FREQ_32768HZ: Ouput pulse is 32768HZ in continuous ouput mode + * @arg ETH_PPS_OUTPUT_ONE_PULSE: One pulse is generated in single ouput mode + * @retval None + */ +void ETH_PPS_SetPps0OutputFreq(uint32_t u32OutputFreq) +{ + /* Check parameters */ + DDL_ASSERT(IS_ETH_PPS_OUTPUT_FREQ(u32OutputFreq)); + + MODIFY_REG32(M4_ETH->PTP_PPSCTLR, ETH_PTP_PPSCTLR_PPSFRE0, u32OutputFreq); +} + +/** + * @} + */ + +#endif /* DDL_ETH_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_fcm.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_fcm.c new file mode 100644 index 0000000000..5d40baaec9 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_fcm.c @@ -0,0 +1,383 @@ +/** + ******************************************************************************* + * @file hc32f4a0_fcm.c + * @brief This file provides firmware functions to manage the Frequency Clock + * Measurement (FCM). + @verbatim + Change Logs: + Date Author Notes + 2020-03-09 Zhangxl First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_fcm.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_FCM FCM + * @brief FCM Driver Library + * @{ + */ + +#if (DDL_FCM_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup FCM_Local_Macros FCM Local Macros + * @{ + */ + +/** + * @defgroup FCM_Check_Parameters_Validity FCM Check Parameters Validity + * @{ + */ +/*! Parameter validity check for FCM target clock source. */ +#define IS_FCM_TAR_SOURCE(src) \ +( ((src) == FCM_TAR_CLK_XTAL) || \ + ((src) == FCM_TAR_CLK_XTAL32) || \ + ((src) == FCM_TAR_CLK_HRC) || \ + ((src) == FCM_TAR_CLK_LRC) || \ + ((src) == FCM_TAR_CLK_SWDTLRC) || \ + ((src) == FCM_TAR_CLK_PCLK1) || \ + ((src) == FCM_TAR_CLK_PLLAP) || \ + ((src) == FCM_TAR_CLK_MRC) || \ + ((src) == FCM_TAR_CLK_PLLHP) || \ + ((src) == FCM_TAR_CLK_RTCLRC)) + +/*! Parameter validity check for FCM target clock division. */ +#define IS_FCM_TAR_DIV(div) \ +( ((div) == FCM_TAR_CLK_DIV1) || \ + ((div) == FCM_TAR_CLK_DIV4) || \ + ((div) == FCM_TAR_CLK_DIV8) || \ + ((div) == FCM_TAR_CLK_DIV32)) + +/*! Parameter validity check for FCM external reference input function. */ +#define IS_FCM_EX_REF_FUNC(func) \ +( ((func) == FCM_EX_REF_OFF) || \ + ((func) == FCM_EX_REF_ON)) + +/*! Parameter validity check for FCM reference clock edge. */ +#define IS_FCM_REF_EDGE(edge) \ +( ((edge) == FCM_REF_CLK_RISING) || \ + ((edge) == FCM_REF_CLK_FALLING) || \ + ((edge) == FCM_REF_CLK_BOTH)) + +/*! Parameter validity check for FCM digital filter function. */ +#define IS_FCM_DF(df) \ +( ((df) == FCM_DF_OFF) || \ + ((df) == FCM_DF_MCKS_DIV1) || \ + ((df) == FCM_DF_MCKS_DIV4) || \ + ((df) == FCM_DF_MCKS_DIV16)) + +/*! Parameter validity check for FCM reference clock source. */ +#define IS_FCM_REF_SOURCE(src) \ +( ((src) == FCM_REF_CLK_EXINPUT) || \ + ((src) == FCM_REF_CLK_XTAL) || \ + ((src) == FCM_REF_CLK_XTAL32) || \ + ((src) == FCM_REF_CLK_HRC) || \ + ((src) == FCM_REF_CLK_LRC) || \ + ((src) == FCM_REF_CLK_SWDTLRC) || \ + ((src) == FCM_REF_CLK_PCLK1) || \ + ((src) == FCM_REF_CLK_PCLKAP) || \ + ((src) == FCM_REF_CLK_MRC) || \ + ((src) == FCM_REF_CLK_PLLHP) || \ + ((src) == FCM_REF_CLK_RTCLRC)) + +/*! Parameter validity check for FCM reference clock division. */ +#define IS_FCM_REF_DIV(div) \ +( ((div) == FCM_REF_CLK_DIV32) || \ + ((div) == FCM_REF_CLK_DIV128) || \ + ((div) == FCM_REF_CLK_DIV1024) || \ + ((div) == FCM_REF_CLK_DIV8192)) + +/*! Parameter validity check for FCM abnormal reset function. */ +#define IS_FCM_RESET_FUNC(func) \ +( ((func) == FCM_RST_OFF) || \ + ((func) == FCM_RST_ON)) + +/*! Parameter validity check for FCM abnormal behavior function. */ +#define IS_FCM_ERR_HANDLE(hd) \ +( ((hd) == FCM_ERR_INT) || \ + ((hd) == FCM_ERR_RESET)) + +/*! Parameter validity check for FCM interrupt. */ +#define IS_FCM_INT(it) (((it) | FCM_INT_MSK) == FCM_INT_MSK) + +/*! Parameter validity check for FCM flag state. */ +#define IS_FCM_FLAG(flag) \ +( ((flag) != 0x00UL) && \ + (((flag) | FCM_FLAG_MSK) == FCM_FLAG_MSK)) + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup FCM_Global_Functions FCM Global Functions + * @{ + */ + +/** + * @brief Initialize FCM. + * @param [in] pstcFcmInit Pointer to a stc_fcm_init_t structure + * that contains configuration information. + * @retval Ok: FCM initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t FCM_Init(const stc_fcm_init_t *pstcFcmInit) +{ + en_result_t enRet = Ok; + + /* Check if pointer is NULL */ + if (NULL == pstcFcmInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Parameter validity checking */ + DDL_ASSERT(IS_FCM_TAR_SOURCE(pstcFcmInit->u32TarClk)); + DDL_ASSERT(IS_FCM_TAR_DIV(pstcFcmInit->u32TarClkDiv)); + DDL_ASSERT(IS_FCM_EX_REF_FUNC(pstcFcmInit->u32ExRefClkEn)); + DDL_ASSERT(IS_FCM_REF_EDGE(pstcFcmInit->u32RefClkEdge)); + DDL_ASSERT(IS_FCM_DF(pstcFcmInit->u32DigFilter)); + DDL_ASSERT(IS_FCM_REF_SOURCE(pstcFcmInit->u32RefClk)); + DDL_ASSERT(IS_FCM_REF_DIV(pstcFcmInit->u32RefClkDiv)); + DDL_ASSERT(IS_FCM_RESET_FUNC(pstcFcmInit->u32RstEn)); + DDL_ASSERT(IS_FCM_ERR_HANDLE(pstcFcmInit->u32IntRstSel)); + DDL_ASSERT(IS_FCM_INT(pstcFcmInit->u32IntType)); + + WRITE_REG32(M4_FCM->LVR, pstcFcmInit->u16LowerLimit); + WRITE_REG32(M4_FCM->UVR, pstcFcmInit->u16UpperLimit); + WRITE_REG32(M4_FCM->MCCR, (pstcFcmInit->u32TarClk | pstcFcmInit->u32TarClkDiv)); + WRITE_REG32(M4_FCM->RCCR, (pstcFcmInit->u32ExRefClkEn | pstcFcmInit->u32RefClkEdge | \ + pstcFcmInit->u32DigFilter | pstcFcmInit->u32RefClk | \ + pstcFcmInit->u32RefClkDiv)); + WRITE_REG32(M4_FCM->RIER, (pstcFcmInit->u32RstEn | pstcFcmInit->u32IntRstSel | \ + pstcFcmInit->u32IntType)); + } + return enRet; +} + +/** + * @brief Initialize FCM structure. Fill each pstcFcmInit with + * default value + * @param [in] pstcFcmInit Pointer to a stc_fcm_init_t structure + * that contains configuration information. + * @retval Ok: FCM structure initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t FCM_StructInit(stc_fcm_init_t *pstcFcmInit) +{ + en_result_t enRet = Ok; + + /* Check if pointer is NULL */ + if (NULL == pstcFcmInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Reset FCM init structure parameters values */ + pstcFcmInit->u16LowerLimit = 0U; + pstcFcmInit->u16UpperLimit = 0U; + pstcFcmInit->u32TarClk = FCM_TAR_CLK_XTAL; + pstcFcmInit->u32TarClkDiv = FCM_TAR_CLK_DIV1; + pstcFcmInit->u32ExRefClkEn = FCM_EX_REF_OFF; + pstcFcmInit->u32RefClkEdge = FCM_REF_CLK_RISING; + pstcFcmInit->u32DigFilter = FCM_DF_OFF; + pstcFcmInit->u32RefClk = FCM_REF_CLK_XTAL; + pstcFcmInit->u32RefClkDiv = FCM_REF_CLK_DIV32; + pstcFcmInit->u32RstEn = FCM_RST_OFF; + pstcFcmInit->u32IntRstSel = FCM_ERR_INT; + pstcFcmInit->u32IntType = (FCM_ERR_INT_OFF | FCM_END_INT_OFF | FCM_OVF_INT_OFF); + } + return enRet; +} + +/** + * @brief De-Initialize FCM. + * @param None + * @retval None + */ +void FCM_DeInit(void) +{ + WRITE_REG32(M4_FCM->STR, FCM_REG_RESET_VALUE); + WRITE_REG32(M4_FCM->CLR, FCM_FLAG_MSK); + WRITE_REG32(M4_FCM->LVR, FCM_REG_RESET_VALUE); + WRITE_REG32(M4_FCM->UVR, FCM_REG_RESET_VALUE); + WRITE_REG32(M4_FCM->MCCR,FCM_REG_RESET_VALUE); + WRITE_REG32(M4_FCM->RCCR,FCM_REG_RESET_VALUE); + WRITE_REG32(M4_FCM->RIER,FCM_REG_RESET_VALUE); +} + +/** + * @brief Get FCM state, get FCM overflow, complete, error flag. + * @param [in] u32Flag FCM flags. + * @arg FCM_FLAG_ERR: FCM error. + * @arg FCM_FLAG_END: FCM measure end. + * @arg FCM_FLAG_OVF: FCM overflow. + * @retval en_flag_status_t: FCM flag status. + */ +en_flag_status_t FCM_GetStatus(uint32_t u32Flag) +{ + DDL_ASSERT(IS_FCM_FLAG(u32Flag)); + + return (READ_REG32_BIT(M4_FCM->SR, u32Flag) ? Set : Reset); +} + +/** + * @brief Clear FCM state, Clear FCM overflow, complete, error flag. + * @param [in] u32Flag FCM flags. + * @arg FCM_FLAG_ERR: FCM error. + * @arg FCM_FLAG_END: FCM measure end. + * @arg FCM_FLAG_OVF: FCM overflow. + * @arg FCM_FLAG_MSK: All above 3 flags of FCM. + * @retval None. + */ +void FCM_ClearStatus(uint32_t u32Flag) +{ + DDL_ASSERT(IS_FCM_FLAG(u32Flag)); + + SET_REG32_BIT(M4_FCM->CLR, u32Flag); +} + +/** + * @brief Get FCM counter value. + * @param None + * @retval FCM counter value. + */ +uint16_t FCM_GetCounter(void) +{ + return (uint16_t)(READ_REG32(M4_FCM->CNTR) & 0xFFFFU); +} + +/** + * @brief FCM target clock type and division config. + * @param [in] u32Tar Target clock type. + * @arg FCM_TAR_CLK_XTAL + * @arg FCM_TAR_CLK_XTAL32 + * @arg FCM_TAR_CLK_HRC + * @arg FCM_TAR_CLK_LRC + * @arg FCM_TAR_CLK_SWDTLRC + * @arg FCM_TAR_CLK_PCLK1 + * @arg FCM_TAR_CLK_PLLAP + * @arg FCM_TAR_CLK_MRC + * @arg FCM_TAR_CLK_PLLHP + * @arg FCM_TAR_CLK_RTCLRC + * @param [in] u32Div Target clock division. + * @arg FCM_TAR_CLK_DIV1 + * @arg FCM_TAR_CLK_DIV4 + * @arg FCM_TAR_CLK_DIV8 + * @arg FCM_TAR_CLK_DIV32 + * @retval None. + */ +void FCM_SetTarClk(uint32_t u32Tar, uint32_t u32Div) +{ + DDL_ASSERT(IS_FCM_TAR_SOURCE(u32Tar)); + DDL_ASSERT(IS_FCM_TAR_DIV(u32Div)); + WRITE_REG32(M4_FCM->MCCR, (u32Tar | u32Div)); +} + +/** + * @brief FCM reference clock type and division config. + * @param [in] u32Ref Reference clock type. + * @arg FCM_REF_CLK_EXINPUT + * @arg FCM_REF_CLK_XTAL + * @arg FCM_REF_CLK_XTAL32 + * @arg FCM_REF_CLK_HRC + * @arg FCM_REF_CLK_LRC + * @arg FCM_REF_CLK_SWDTLRC + * @arg FCM_REF_CLK_PCLK1 + * @arg FCM_REF_CLK_PCLKAP + * @arg FCM_REF_CLK_MRC + * @arg FCM_REF_CLK_PLLHP + * @arg FCM_REF_CLK_RTCLRC + * @param [in] u32Div Reference clock division. + * @arg FCM_REF_CLK_DIV32 + * @arg FCM_REF_CLK_DIV128 + * @arg FCM_REF_CLK_DIV1024 + * @arg FCM_REF_CLK_DIV8192 + * @retval None. + */ +void FCM_SetRefClk(uint32_t u32Ref, uint32_t u32Div) +{ + DDL_ASSERT(IS_FCM_REF_SOURCE(u32Ref)); + DDL_ASSERT(IS_FCM_REF_DIV(u32Div)); + MODIFY_REG32(M4_FCM->RCCR, \ + (FCM_RCCR_INEXS | FCM_RCCR_RCKS | FCM_RCCR_RDIVS), \ + (u32Ref | u32Div)); +} + +/** + * @brief FCM function config. + * @param [in] enNewState + * @arg Enable + * @arg Disable + * @retval None. + */ +void FCM_Cmd(en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + WRITE_REG32(bM4_FCM->STR_b.START, enNewState); +} + +/** + * @} + */ + +#endif /* DDL_FCM_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_fmac.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_fmac.c new file mode 100644 index 0000000000..84ce965685 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_fmac.c @@ -0,0 +1,350 @@ +/** + ******************************************************************************* + * @file hc32f4a0_fmac.c + * @brief This file provides firmware functions to manage the Filter Math + * Accelerate (FMAC). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Heqb First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_fmac.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_FMAC FMAC + * @brief FMAC Driver Library + * @{ + */ + +#if (DDL_FMAC_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup FMAC_Local_Macros FMAC Local Macros + * @{ + */ + +/** + * @defgroup FMAC_Check_Parameters_Validity FMAC Check Parameters Validity + * @{ + */ +#define IS_FMAC_FILTER_SHIFT(x) ((x) <= FMAC_FILTER_SHIFT_21BIT) + + +#define IS_FMAC_FILTER_STAGE(x) ((x) <= FMAC_FILTER_STAGE_16) + +#define IS_FMAC_INT_FUNC(x) \ +( ((x) == FMAC_INT_ENABLE) || \ + ((x) == FMAC_INT_DISABLE)) + +#define IS_VALID_UNIT(x) \ +( ((x) == M4_FMAC1) || \ + ((x) == M4_FMAC2) || \ + ((x) == M4_FMAC3) || \ + ((x) == M4_FMAC4)) +/** + * @} + */ + + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup FMAC_Global_Functions FMAC Global Functions + * @{ + */ + +/** + * @brief FMAC peripheral initialization stucture clear + * @param [in] pstcInitStruct FMAC function structure + * @arg See the structure definition for @ref stc_fmac_init_t + * @retval Ok: Success + * ErrorInvalidParameter: Parameter error + */ +en_result_t FMAC_StructInit(stc_fmac_init_t* pstcInitStruct) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (pstcInitStruct != NULL) + { + pstcInitStruct->u32FiltStage = FMAC_FILTER_STAGE_0; + pstcInitStruct->u32FiltShift = FMAC_FILTER_SHIFT_0BIT; + pstcInitStruct->i16FiltFactor = 0; + pstcInitStruct->u32IntCmd = FMAC_INT_DISABLE; + enRet = Ok; + } + return enRet; +} + +/** + * @brief De-Initialize FMAC function + * @param [in] FMACx Pointer to FMAC instance register base. + * This parameter can be a value of the following: + * @arg M4_FMAC1: FMAC unit 1 instance register base + * @arg M4_FMAC2: FMAC unit 2 instance register base + * @arg M4_FMAC3: FMAC unit 3 instance register base + * @arg M4_FMAC4: FMAC unit 4 instance register base + * @retval None + */ +void FMAC_DeInit(M4_FMAC_TypeDef* FMACx) +{ + DDL_ASSERT(IS_VALID_UNIT(FMACx)); + + WRITE_REG32(FMACx->CTR, 0UL); + WRITE_REG32(FMACx->IER, 0UL); + WRITE_REG32(FMACx->DTR, 0UL); + WRITE_REG32(FMACx->RTR0, 0UL); + WRITE_REG32(FMACx->RTR1, 0UL); + WRITE_REG32(FMACx->STR, 0UL); +} + +/** + * @brief FMAC peripheral function initialize + * @param [in] FMACx Pointer to FMAC instance register base. + * This parameter can be a value of the following: + * @arg M4_FMAC1: FMAC unit 1 instance register base + * @arg M4_FMAC2: FMAC unit 2 instance register base + * @arg M4_FMAC3: FMAC unit 3 instance register base + * @arg M4_FMAC4: FMAC unit 4 instance register base + * @param [in] pstcFmacInit FMAC function base parameter structure + * @arg See the structure definition for @ref stc_fmac_init_t + * @retval Ok: Success + * ErrorInvalidParameter: Parameter error + */ +en_result_t FMAC_Init(M4_FMAC_TypeDef* FMACx, const stc_fmac_init_t *pstcFmacInit) +{ + en_result_t enRet = ErrorInvalidParameter; + __IO uint32_t *FMAC_CORx; + uint32_t u32temp; + if(pstcFmacInit != NULL) + { + DDL_ASSERT(IS_VALID_UNIT(FMACx)); + DDL_ASSERT(IS_FMAC_FILTER_SHIFT(pstcFmacInit->u32FiltShift)); + DDL_ASSERT(IS_FMAC_FILTER_STAGE(pstcFmacInit->u32FiltStage)); + DDL_ASSERT(IS_FMAC_INT_FUNC(pstcFmacInit->u32IntCmd)); + u32temp = pstcFmacInit->u32FiltStage; + /* Configure filter stage and results right shift bits */ + WRITE_REG32(FMACx->CTR, (pstcFmacInit->u32FiltStage | \ + (pstcFmacInit->u32FiltShift << FMAC_CTR_SHIFT_POS))); + /* Configure interrupt command */ + WRITE_REG32(FMACx->IER, pstcFmacInit->u32IntCmd); + do{ + FMAC_CORx = (__IO uint32_t *)((uint32_t)(&FMACx->COR0) + (u32temp << 2UL)); + WRITE_REG32(*FMAC_CORx, pstcFmacInit->i16FiltFactor); + }while((u32temp--) > 0UL); + enRet = Ok; + } + return enRet; +} + +/** + * @brief Enable or Disable FMAC + * @param [in] FMACx Pointer to FMAC instance register base. + * This parameter can be a value of the following: + * @arg M4_FMAC1: FMAC unit 1 instance register base + * @arg M4_FMAC2: FMAC unit 2 instance register base + * @arg M4_FMAC3: FMAC unit 3 instance register base + * @arg M4_FMAC4: FMAC unit 4 instance register base + * @param [in] enNewState Disable or Enable the function + * @retval None + */ +void FMAC_Cmd(M4_FMAC_TypeDef* FMACx, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_UNIT(FMACx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + WRITE_REG32(FMACx->ENR, enNewState); +} + +/** + * @brief Set Filter result shift bits. + * @param [in] FMACx Pointer to FMAC instance register base. + * This parameter can be a value of the following: + * @arg M4_FMAC1: FMAC unit 1 instance register base + * @arg M4_FMAC2: FMAC unit 2 instance register base + * @arg M4_FMAC3: FMAC unit 3 instance register base + * @arg M4_FMAC4: FMAC unit 4 instance register base + * @param [in] u32ShiftNum Result shift times. + * This parameter can be set 0-21 + * @retval None + */ +void FMAC_SetResultShift(M4_FMAC_TypeDef* FMACx, uint32_t u32ShiftNum) +{ + DDL_ASSERT(IS_VALID_UNIT(FMACx)); + DDL_ASSERT(IS_FMAC_FILTER_SHIFT(u32ShiftNum)); + /* Set Filter result shift bits */ + MODIFY_REG32(FMACx->CTR, FMAC_CTR_SHIFT, u32ShiftNum << FMAC_CTR_SHIFT_POS); +} + +/** + * @brief Set filter stage and filter factor. + * @param [in] FMACx Pointer to FMAC instance register base. + * This parameter can be a value of the following: + * @arg M4_FMAC1: FMAC unit 1 instance register base + * @arg M4_FMAC2: FMAC unit 2 instance register base + * @arg M4_FMAC3: FMAC unit 3 instance register base + * @arg M4_FMAC4: FMAC unit 4 instance register base + * @param [in] u32FilterStage FMAC filter stage. + * This parameter can be set 0 ~ 16 + * @param [in] i16Factor FMAC filter factor. + * This parameter can be set -32768 ~ 32767 + * @retval None + */ +void FMAC_SetStageFactor(M4_FMAC_TypeDef* FMACx, uint32_t u32FilterStage, int16_t i16Factor) +{ + __IO uint32_t *FMAC_CORx; + DDL_ASSERT(IS_VALID_UNIT(FMACx)); + DDL_ASSERT(IS_FMAC_FILTER_STAGE(u32FilterStage)); + /* FMAC Software reset */ + CLEAR_REG32_BIT(FMACx->ENR, FMAC_ENR_FMACEN); + SET_REG32_BIT(FMACx->ENR, FMAC_ENR_FMACEN); + /* Set the filter stage */ + MODIFY_REG32(FMACx->CTR, FMAC_CTR_STAGE_NUM, u32FilterStage); + do + { + FMAC_CORx = (__IO uint32_t*)((uint32_t)(&FMACx->COR0) + (u32FilterStage << 2UL)); + WRITE_REG32(*FMAC_CORx, i16Factor); + }while((u32FilterStage--) > 0UL); +} + +/** + * @brief Configure interrupt command. + * @param [in] FMACx Pointer to FMAC instance register base. + * This parameter can be a value of the following: + * @arg M4_FMAC1: FMAC unit 1 instance register base + * @arg M4_FMAC2: FMAC unit 2 instance register base + * @arg M4_FMAC3: FMAC unit 3 instance register base + * @arg M4_FMAC4: FMAC unit 4 instance register base + * @param [in] enNewState Disable or Enable the function. + * @retval None + */ +void FMAC_IntCmd(M4_FMAC_TypeDef* FMACx, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_UNIT(FMACx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + WRITE_REG32(FMACx->IER, enNewState); +} + +/** + * @brief Data input. + * @param [in] FMACx Pointer to FMAC instance register base. + * This parameter can be a value of the following: + * @arg M4_FMAC1: FMAC unit 1 instance register base + * @arg M4_FMAC2: FMAC unit 2 instance register base + * @arg M4_FMAC3: FMAC unit 3 instance register base + * @arg M4_FMAC4: FMAC unit 4 instance register base + * @param [in] i16Factor Data that needs to be processed. + * @retval None + */ +void FMAC_FIRInput(M4_FMAC_TypeDef* FMACx, int16_t i16Factor) +{ + DDL_ASSERT(IS_VALID_UNIT(FMACx)); + WRITE_REG32(FMACx->DTR, i16Factor); +} + +/** + * @brief Get FMAC status. + * @param [in] FMACx Pointer to FMAC instance register base. + * This parameter can be a value of the following: + * @arg M4_FMAC1: FMAC unit 1 instance register base + * @arg M4_FMAC2: FMAC unit 2 instance register base + * @arg M4_FMAC3: FMAC unit 3 instance register base + * @arg M4_FMAC4: FMAC unit 4 instance register base + * @retval Set Calculate complete + * Reset Calculation in progress + */ +en_flag_status_t FMAC_GetStatus(const M4_FMAC_TypeDef* FMACx) +{ + DDL_ASSERT(IS_VALID_UNIT(FMACx)); + return (READ_REG32_BIT(FMACx->STR, FMAC_STR_READY) ? Set : Reset); +} + +/** + * @brief Get calculation results. + * @param [in] FMACx Pointer to FMAC instance register base. + * This parameter can be a value of the following: + * @arg M4_FMAC1: FMAC unit 1 instance register base + * @arg M4_FMAC2: FMAC unit 2 instance register base + * @arg M4_FMAC3: FMAC unit 3 instance register base + * @arg M4_FMAC4: FMAC unit 4 instance register base + * @param [out] stcResult Get result. + * u32ResultHigh: The high value of the result + * u32ResultLow: The low value of the result + * @retval Ok: Success + * ErrorInvalidParameter: stcResult == NULL + */ +en_result_t FMAC_GetResult(const M4_FMAC_TypeDef* FMACx, stc_fmac_result_t *stcResult) +{ + en_result_t enRet = ErrorInvalidParameter; + DDL_ASSERT(IS_VALID_UNIT(FMACx)); + + if (stcResult != NULL) + { + stcResult->u32ResultHigh = READ_REG32(FMACx->RTR0); + stcResult->u32ResultLow = READ_REG32(FMACx->RTR1); + enRet = Ok; + } + return enRet; +} + +/** + * @} + */ + +#endif /* DDL_FMAC_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ + diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_gpio.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_gpio.c new file mode 100644 index 0000000000..4c0c9ccef0 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_gpio.c @@ -0,0 +1,651 @@ +/** + ******************************************************************************* + * @file hc32f4a0_gpio.c + * @brief This file provides firmware functions to manage the General Purpose + * Input/Output(GPIO). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Zhangxl First version + 2020-09-18 Zhangxl Optimize GPIO_DeInit() API + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_gpio.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_GPIO GPIO + * @brief GPIO Driver Library + * @{ + */ + +#if (DDL_GPIO_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup GPIO_Local_Macros GPIO Local Macros + * @{ + */ +/** + * @defgroup GPIO_Registers_Reset_Value GPIO Registers Reset Value + * @{ + */ +#define GPIO_PSPCR_RESET_VALUE (0x001FU) +#define GPIO_PCCR_RESET_VALUE (0x1000U) +#define GPIO_PINAER_RESET_VALUE (0x0000U) +/** + * @} + */ + +/** + * @defgroup GPIO_Check_Parameters_Validity GPIO Check Parameters Validity + * @{ + */ +/*! Parameter validity check for pin state. */ +#define IS_GPIO_PIN_STATE(state) \ +( ((state) == PIN_STATE_RESET) || \ + ((state) == PIN_STATE_SET)) + +/*! Parameter validity check for pin direction. */ +#define IS_GPIO_DIR(dir) \ +( ((dir) == PIN_DIR_IN) || \ + ((dir) == PIN_DIR_OUT)) + +/*! Parameter validity check for pin output type. */ +#define IS_GPIO_OTYPE(otype) \ +( ((otype) == PIN_OTYPE_CMOS) || \ + ((otype) == PIN_OTYPE_NMOS)) + +/*! Parameter validity check for pin driver capacity. */ +#define IS_GPIO_PIN_DRV(drv) \ +( ((drv) == PIN_DRV_LOW) || \ + ((drv) == PIN_DRV_MID) || \ + ((drv) == PIN_DRV_HIGH)) + +/*! Parameter validity check for pin latch function. */ +#define IS_GPIO_LATCH(latch) \ +( ((latch) == PIN_LATCH_OFF) || \ + ((latch) == PIN_LATCH_ON)) + +/*! Parameter validity check for internal pull-up resistor. */ +#define IS_GPIO_PIN_PU(pu) \ +( ((pu) == PIN_PU_OFF) || \ + ((pu) == PIN_PU_ON)) + +/*! Parameter validity check for pin state invert. */ +#define IS_GPIO_PIN_INVERT(invert) \ +( ((invert) == PIN_INVERT_OFF) || \ + ((invert) == PIN_INVERT_ON)) + +/*! Parameter validity check for pin input type. */ +#define IS_GPIO_ITYPE(itype) \ +( ((itype) == PIN_ITYPE_SMT) || \ + ((itype) == PIN_ITYPE_CMOS)) + +/*! Parameter validity check for external interrupt function. */ +#define IS_GPIO_EXINT(exint) \ +( ((exint) == PIN_EXINT_OFF) || \ + ((exint) == PIN_EXINT_ON)) + +/*! Parameter validity check for pin attribute. */ +#define IS_GPIO_ATTR(attr) \ +( ((attr) == PIN_ATTR_DIGITAL) || \ + ((attr) == PIN_ATTR_ANALOG)) + +/*! Parameter validity check for pin number. */ +#define IS_GPIO_PIN(pin) (((pin) & GPIO_PIN_MASK ) != 0x0000U) + +/*! Parameter validity check for port source. */ +#define IS_GPIO_PORT(port) \ +( ((port) != 0x00U) && \ + (((port) | GPIO_PORT_MASK) == GPIO_PORT_MASK)) + +/*! Parameter validity check for port source. */ +#define IS_GPIO_PORT_SOURCE(port) \ +( ((port) == GPIO_PORT_A) || \ + ((port) == GPIO_PORT_B) || \ + ((port) == GPIO_PORT_C) || \ + ((port) == GPIO_PORT_D) || \ + ((port) == GPIO_PORT_E) || \ + ((port) == GPIO_PORT_F) || \ + ((port) == GPIO_PORT_G) || \ + ((port) == GPIO_PORT_H) || \ + ((port) == GPIO_PORT_I)) + +/*! Parameter validity check for pin function. */ +#define IS_GPIO_FUNC(func) \ +( ((func) <= GPIO_FUNC_20) || \ + (((func) >= GPIO_FUNC_32) && ((func) <= GPIO_FUNC_63))) + +/*! Parameter validity check for debug pin definition. */ +#define IS_GPIO_DEBUG_PORT(port) \ +( ((port) != 0x00U) && \ + (((port) | GPIO_PIN_DEBUG_JTAG) == GPIO_PIN_DEBUG_JTAG)) + +/*! Parameter validity check for pin sub-function setting. */ +#define IS_GPIO_PIN_BFE(bfe) \ +( ((bfe) == PIN_SUBFUNC_ENABLE) || \ + ((bfe) == PIN_SUBFUNC_DISABLE)) + +/*! Parameter validity check for pin read wait cycle. */ +#define IS_GPIO_READ_WAIT(wait) \ +( ((wait) == GPIO_READ_WAIT_0) || \ + ((wait) == GPIO_READ_WAIT_1) || \ + ((wait) == GPIO_READ_WAIT_2) || \ + ((wait) == GPIO_READ_WAIT_3) || \ + ((wait) == GPIO_READ_WAIT_4) || \ + ((wait) == GPIO_READ_WAIT_5) || \ + ((wait) == GPIO_READ_WAIT_6) || \ + ((wait) == GPIO_READ_WAIT_7)) + +/* Check GPIO register lock status. */ +#define IS_GPIO_UNLOCKED() (GPIO_PWPR_WE == (M4_GPIO->PWPR & GPIO_PWPR_WE)) + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup GPIO_Global_Functions GPIO Global Functions + * @{ + */ + +/** + * @brief Initialize GPIO. + * @param [in] u8Port: GPIO_PORT_x, x can be (A~I) to select the GPIO peripheral + * @param [in] u16Pin: GPIO_PIN_x, x can be (00~15) to select the PIN index + * @param [in] pstcGpioInit: Pointer to a stc_gpio_init_t structure that + * contains configuration information. + * @retval Ok: GPIO initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t GPIO_Init(uint8_t u8Port, uint16_t u16Pin, const stc_gpio_init_t *pstcGpioInit) +{ + __IO uint16_t *PCRx; + uint16_t u16PinPos; + uint16_t u16PCRVal; + en_result_t enRet = Ok; + + /* Check if pointer is NULL */ + if (NULL == pstcGpioInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Parameter validity checking */ + DDL_ASSERT(IS_GPIO_PORT_SOURCE(u8Port)); + DDL_ASSERT(IS_GPIO_PIN(u16Pin)); + DDL_ASSERT(IS_GPIO_PIN_STATE(pstcGpioInit->u16PinState)); + DDL_ASSERT(IS_GPIO_DIR(pstcGpioInit->u16PinDir)); + DDL_ASSERT(IS_GPIO_OTYPE(pstcGpioInit->u16PinOType)); + DDL_ASSERT(IS_GPIO_PIN_DRV(pstcGpioInit->u16PinDrv)); + DDL_ASSERT(IS_GPIO_LATCH(pstcGpioInit->u16Latch)); + DDL_ASSERT(IS_GPIO_PIN_PU(pstcGpioInit->u16PullUp)); + DDL_ASSERT(IS_GPIO_PIN_INVERT(pstcGpioInit->u16Invert)); + DDL_ASSERT(IS_GPIO_ITYPE(pstcGpioInit->u16PinIType)); + DDL_ASSERT(IS_GPIO_EXINT(pstcGpioInit->u16ExInt)); + DDL_ASSERT(IS_GPIO_UNLOCKED()); + + for (u16PinPos = 0U; u16PinPos < 16U; u16PinPos++) + { + if ((u16Pin & (1UL<PCRA0) + \ + ((uint32_t)(u8Port) * 0x40UL) + u16PinPos * 4UL); + + u16PCRVal = pstcGpioInit->u16ExInt | pstcGpioInit->u16PinIType | \ + pstcGpioInit->u16Invert | pstcGpioInit->u16PullUp | \ + pstcGpioInit->u16Latch | pstcGpioInit->u16PinDrv | \ + pstcGpioInit->u16PinOType | pstcGpioInit->u16PinState | \ + pstcGpioInit->u16PinDir | pstcGpioInit->u16PinAttr; + WRITE_REG16(*PCRx, u16PCRVal); + } + } + } + return enRet; +} + +/** + * @brief De-init GPIO register to default value + * @param None + * @retval None + */ +void GPIO_DeInit(void) +{ + stc_gpio_init_t stcGpioInit; + + DDL_ASSERT(IS_GPIO_UNLOCKED()); + + (void)GPIO_StructInit(&stcGpioInit); + + /* PORTA reset */ + (void)GPIO_Init(GPIO_PORT_A, GPIO_PIN_ALL, &stcGpioInit); + /* PORTB reset */ + (void)GPIO_Init(GPIO_PORT_B, GPIO_PIN_ALL, &stcGpioInit); + /* PORTC reset */ + (void)GPIO_Init(GPIO_PORT_C, GPIO_PIN_ALL, &stcGpioInit); + /* PORTD reset */ + (void)GPIO_Init(GPIO_PORT_D, GPIO_PIN_ALL, &stcGpioInit); + /* PORTE reset */ + (void)GPIO_Init(GPIO_PORT_E, GPIO_PIN_ALL, &stcGpioInit); + /* PORTF reset */ + (void)GPIO_Init(GPIO_PORT_F, GPIO_PIN_ALL, &stcGpioInit); + /* PORTG reset */ + (void)GPIO_Init(GPIO_PORT_G, GPIO_PIN_ALL, &stcGpioInit); + /* PORTH reset */ + (void)GPIO_Init(GPIO_PORT_H, GPIO_PIN_ALL, &stcGpioInit); + /* PORTI reset */ + (void)GPIO_Init(GPIO_PORT_I, (GPIO_PIN_00 | GPIO_PIN_01 | GPIO_PIN_02 | \ + GPIO_PIN_03 | GPIO_PIN_04 | GPIO_PIN_05 | \ + GPIO_PIN_06 | GPIO_PIN_07 | GPIO_PIN_08 | \ + GPIO_PIN_09 | GPIO_PIN_10 | GPIO_PIN_11 | \ + GPIO_PIN_12 | GPIO_PIN_13), &stcGpioInit); + /* PORT global register reset */ + WRITE_REG16(M4_GPIO->PSPCR, GPIO_PSPCR_RESET_VALUE); + WRITE_REG16(M4_GPIO->PCCR, GPIO_PCCR_RESET_VALUE); + WRITE_REG16(M4_GPIO->PINAER, GPIO_PINAER_RESET_VALUE); +} + +/** + * @brief Initialize GPIO config structure. Fill each pstcGpioInit with default value + * @param [in] pstcGpioInit: Pointer to a stc_gpio_init_t structure that + * contains configuration information. + * @retval Ok: GPIO structure initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t GPIO_StructInit(stc_gpio_init_t *pstcGpioInit) +{ + en_result_t enRet = Ok; + /* Check if pointer is NULL */ + if (NULL == pstcGpioInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Reset GPIO init structure parameters values */ + pstcGpioInit->u16PinState = PIN_STATE_RESET; + pstcGpioInit->u16PinDir = PIN_DIR_IN; + pstcGpioInit->u16PinOType = PIN_OTYPE_CMOS; + pstcGpioInit->u16PinDrv = PIN_DRV_LOW; + pstcGpioInit->u16Latch = PIN_LATCH_OFF; + pstcGpioInit->u16PullUp = PIN_PU_OFF; + pstcGpioInit->u16Invert = PIN_INVERT_OFF; + pstcGpioInit->u16PinIType = PIN_ITYPE_SMT; + pstcGpioInit->u16ExInt = PIN_EXINT_OFF; + pstcGpioInit->u16PinAttr = PIN_ATTR_DIGITAL; + } + return enRet; +} + +/** + * @brief GPIO debug port configure. Set debug pins to GPIO + * @param [in] u8DebugPort + * @arg GPIO_PIN_SWDIO + * @arg GPIO_PIN_SWCLK + * @arg GPIO_PIN_SWO + * @arg GPIO_PIN_DEBUG_SWD + * @arg GPIO_PIN_TCK + * @arg GPIO_PIN_TMS + * @arg GPIO_PIN_TDO + * @arg GPIO_PIN_TDI + * @arg GPIO_PIN_TRST + * @arg GPIO_PIN_DEBUG_JTAG + * @param [in] enNewState + * @arg Enable: set to debug port (SWD/JTAG) + * @arg Disable: set to GPIO + * @retval None + */ +void GPIO_SetDebugPort(uint8_t u8DebugPort, en_functional_state_t enNewState) +{ + /* Parameter validity checking */ + DDL_ASSERT(IS_GPIO_DEBUG_PORT(u8DebugPort)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_GPIO_UNLOCKED()); + + if (Enable == enNewState) + { + SET_REG16_BIT(M4_GPIO->PSPCR, ((uint16_t)u8DebugPort & GPIO_PSPCR_SPFE)); + } + else + { + CLEAR_REG16_BIT(M4_GPIO->PSPCR, ((uint16_t)u8DebugPort & GPIO_PSPCR_SPFE)); + } +} + +/** + * @brief Set specified Port Pin function , and turn ON/OFF its sub-function + * @param [in] u8Port: GPIO_PORT_x, x can be (A~I) to select the GPIO peripheral + * @param [in] u16Pin: GPIO_PIN_x, x can be (00~15) to select the PIN index + * @param [in] u8Func: GPIO_FUNC_x, x can be selected from GPIO function definitions + * @param [in] u16BFE: GPIO Sub-function enable setting + * @arg PIN_SUBFUNC_ENABLE + * @arg PIN_SUBFUNC_DISABLE + * @retval None + */ +void GPIO_SetFunc(uint8_t u8Port, uint16_t u16Pin, uint8_t u8Func, uint16_t u16BFE) +{ + __IO uint16_t *PFSRx; + uint8_t u8PinPos; + + /* Parameter validity checking */ + DDL_ASSERT(IS_GPIO_PORT_SOURCE(u8Port)); + DDL_ASSERT(IS_GPIO_PIN(u16Pin)); + DDL_ASSERT(IS_GPIO_FUNC(u8Func)); + DDL_ASSERT(IS_GPIO_PIN_BFE(u16BFE)); + DDL_ASSERT(IS_GPIO_UNLOCKED()); + + for (u8PinPos = 0U; u8PinPos < 16U; u8PinPos++) + { + if ((u16Pin & (uint16_t)(1UL << u8PinPos)) != 0U) + { + PFSRx = (__IO uint16_t *)((uint32_t)(&M4_GPIO->PFSRA0) + \ + (uint32_t)(u8Port * 0x40UL) + u8PinPos * 4UL); + WRITE_REG16(*PFSRx, (u16BFE | (uint16_t)u8Func)); + } + } +} + +/** + * @brief Set the sub-function, it's a global configuration + * @param [in] u8Func: GPIO_FUNC_x, x can be selected from GPIO function definitions + * @retval None + */ +void GPIO_SetSubFunc(uint8_t u8Func) +{ + DDL_ASSERT(IS_GPIO_FUNC(u8Func)); + DDL_ASSERT(IS_GPIO_UNLOCKED()); + + MODIFY_REG16(M4_GPIO->PCCR, GPIO_PCCR_BFSEL, u8Func); +} + +/** + * @brief Initialize GPIO. + * @param [in] u8Port: GPIO_PORT_x, x can be (A~I) to select the GPIO peripheral + * @param [in] u16Pin: GPIO_PIN_x, x can be (00~15) to select the PIN index + * @param [in] enNewState + * @arg Enable: set specified pin output enable + * @arg Disable: set specified pin output disable + * @retval None + */ +void GPIO_OE(uint8_t u8Port, uint16_t u16Pin, en_functional_state_t enNewState) +{ + __IO uint16_t *POERx; + + /* Parameter validity checking */ + DDL_ASSERT(IS_GPIO_PORT_SOURCE(u8Port)); + DDL_ASSERT(IS_GPIO_PIN(u16Pin)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + POERx = (__IO uint16_t *)((uint32_t)(&M4_GPIO->POERA) + 0x10UL * u8Port); + + if (Enable == enNewState) + { + SET_REG16_BIT(*POERx, u16Pin); + } + else + { + CLEAR_REG16_BIT(*POERx, u16Pin); + } +} + +/** + * @brief GPIO read wait cycle configure. + * @param [in] u16ReadWait + * @arg GPIO_READ_WAIT_0: ~ 50MHz + * @arg GPIO_READ_WAIT_1: 50 ~ 100MHz + * @arg GPIO_READ_WAIT_2: 100 ~ 150MHz + * @arg GPIO_READ_WAIT_3: 150 ~ 200MHz + * @arg GPIO_READ_WAIT_4: 200 ~ 250MHz + * @arg GPIO_READ_WAIT_5: 250MHz above + * @arg GPIO_READ_WAIT_6: 250MHz above + * @arg GPIO_READ_WAIT_7: 250MHz above + * @retval None + */ +void GPIO_SetReadWaitCycle(uint16_t u16ReadWait) +{ + DDL_ASSERT(IS_GPIO_READ_WAIT(u16ReadWait)); + DDL_ASSERT(IS_GPIO_UNLOCKED()); + + MODIFY_REG16(M4_GPIO->PCCR, GPIO_PCCR_RDWT, u16ReadWait); +} + +/** + * @brief GPIO input MOS always ON configure. + * @param [in] u16PortIdx: Port index + * @arg GPIO_PORTA_IDX + * @arg GPIO_PORTB_IDX + * @arg GPIO_PORTC_IDX + * @arg GPIO_PORTD_IDX + * @arg GPIO_PORTE_IDX + * @arg GPIO_PORTF_IDX + * @arg GPIO_PORTG_IDX + * @arg GPIO_PORTH_IDX + * @arg GPIO_PORTI_IDX + * @arg GPIO_PORT_ALL + * @param [in] enNewState + * @arg Enable: set input MOS always ON + * @arg Disable: set input MOS turns on while read operation + * @retval None + */ +void GPIO_InMOSCmd(uint16_t u16PortIdx, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_GPIO_PORT(u16PortIdx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_GPIO_UNLOCKED()); + + if (Enable == enNewState) + { + SET_REG16_BIT(M4_GPIO->PINAER, u16PortIdx); + } + else + { + CLEAR_REG16_BIT(M4_GPIO->PINAER, u16PortIdx); + } +} + +/** + * @brief Read specified GPIO input data port pins + * @param [in] u8Port: GPIO_PORT_x, x can be (A~I) to select the GPIO peripheral + * @param [in] u16Pin: GPIO_PIN_x, x can be (00~15) to select the PIN index + * @retval Specified GPIO port pin input value + */ +en_pin_state_t GPIO_ReadInputPins(uint8_t u8Port, uint16_t u16Pin) +{ + __IO uint16_t *PIDRx; + + /* Parameter validity checking */ + DDL_ASSERT(IS_GPIO_PORT_SOURCE(u8Port)); + DDL_ASSERT(IS_GPIO_PIN(u16Pin)); + + PIDRx = (__IO uint16_t *)((uint32_t)(&M4_GPIO->PIDRA) + 0x10UL * u8Port); + + return ((READ_REG16(*PIDRx) & (u16Pin)) != 0U) ? Pin_Set : Pin_Reset; +} + +/** + * @brief Read specified GPIO input data port + * @param [in] u8Port: GPIO_PORT_x, x can be (A~I) to select the GPIO peripheral + * @retval Specified GPIO port input value + */ +uint16_t GPIO_ReadInputPort(uint8_t u8Port) +{ + __IO uint16_t *PIDRx; + + /* Parameter validity checking */ + DDL_ASSERT(IS_GPIO_PORT_SOURCE(u8Port)); + + PIDRx = (__IO uint16_t *)((uint32_t)(&M4_GPIO->PIDRA) + 0x10UL * u8Port); + + return READ_REG16(*PIDRx); +} + +/** + * @brief Read specified GPIO output data port pins + * @param [in] u8Port: GPIO_PORT_x, x can be (A~I) to select the GPIO peripheral + * @param [in] u16Pin: GPIO_PIN_x, x can be (00~15) to select the PIN index + * @retval Specified GPIO port pin output value + */ +en_pin_state_t GPIO_ReadOutputPins(uint8_t u8Port, uint16_t u16Pin) +{ + __IO uint16_t *PODRx; + + /* Parameter validity checking */ + DDL_ASSERT(IS_GPIO_PORT_SOURCE(u8Port)); + DDL_ASSERT(IS_GPIO_PIN(u16Pin)); + + PODRx = (__IO uint16_t *)((uint32_t)(&M4_GPIO->PODRA) + 0x10UL * u8Port); + + return ((*PODRx & (u16Pin)) != 0U) ? Pin_Set : Pin_Reset; +} + +/** + * @brief Read specified GPIO output data port + * @param [in] u8Port: GPIO_PORT_x, x can be (A~I) to select the GPIO peripheral + * @retval Specified GPIO port output value + */ +uint16_t GPIO_ReadOutputPort(uint8_t u8Port) +{ + __IO uint16_t *PODRx; + + /* Parameter validity checking */ + DDL_ASSERT(IS_GPIO_PORT_SOURCE(u8Port)); + + PODRx = (__IO uint16_t *)((uint32_t)(&M4_GPIO->PODRA) + 0x10UL * u8Port); + + return READ_REG16(*PODRx); +} + +/** + * @brief Set specified GPIO output data port pins + * @param [in] u8Port: GPIO_PORT_x, x can be (A~I) to select the GPIO peripheral + * @param [in] u16Pin: GPIO_PIN_x, x can be (00~15) to select the PIN index + * @retval None + */ +void GPIO_SetPins(uint8_t u8Port, uint16_t u16Pin) +{ + __IO uint16_t *POSRx; + + /* Parameter validity checking */ + DDL_ASSERT(IS_GPIO_PORT_SOURCE(u8Port)); + DDL_ASSERT(IS_GPIO_PIN(u16Pin)); + + POSRx = (__IO uint16_t *)((uint32_t)(&M4_GPIO->POSRA) + 0x10UL * u8Port); + SET_REG16_BIT(*POSRx, u16Pin); +} + +/** + * @brief Reset specified GPIO output data port pins + * @param [in] u8Port: GPIO_PORT_x, x can be (A~I) to select the GPIO peripheral + * @param [in] u16Pin: GPIO_PIN_x, x can be (00~15) to select the PIN index + * @retval None + */ +void GPIO_ResetPins(uint8_t u8Port, uint16_t u16Pin) +{ + __IO uint16_t *PORRx; + + /* Parameter validity checking */ + DDL_ASSERT(IS_GPIO_PORT_SOURCE(u8Port)); + DDL_ASSERT(IS_GPIO_PIN(u16Pin)); + + PORRx = (__IO uint16_t *)((uint32_t)(&M4_GPIO->PORRA) + 0x10UL * u8Port); + SET_REG16_BIT(*PORRx, u16Pin); +} + +/** + * @brief Write specified GPIO data port + * @param [in] u8Port: GPIO_PORT_x, x can be (A~I) to select the GPIO peripheral + * @param [in] u16PortVal: Pin output value + * @retval None + */ +void GPIO_WritePort(uint8_t u8Port, uint16_t u16PortVal) +{ + __IO uint16_t *PODRx; + + /* Parameter validity checking */ + DDL_ASSERT(IS_GPIO_PORT_SOURCE(u8Port)); + + PODRx = (__IO uint16_t *)((uint32_t)(&M4_GPIO->PODRA) + 0x10UL * u8Port); + WRITE_REG16(*PODRx, u16PortVal); + +} + +/** + * @brief Toggle specified GPIO output data port pin + * @param [in] u8Port: GPIO_PORT_x, x can be (A~I) to select the GPIO peripheral + * @param [in] u16Pin: GPIO_PIN_x, x can be (00~15) to select the PIN index + * @retval None + */ +void GPIO_TogglePins(uint8_t u8Port, uint16_t u16Pin) +{ + __IO uint16_t *POTRx; + + /* Parameter validity checking */ + DDL_ASSERT(IS_GPIO_PORT_SOURCE(u8Port)); + DDL_ASSERT(IS_GPIO_PIN(u16Pin)); + + POTRx = (__IO uint16_t *)((uint32_t)(&M4_GPIO->POTRA) + 0x10UL * u8Port); + SET_REG16_BIT(*POTRx, u16Pin); +} + +/** + * @} + */ + +#endif /* DDL_GPIO_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_hash.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_hash.c new file mode 100644 index 0000000000..102ab0ab33 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_hash.c @@ -0,0 +1,732 @@ +/** + ******************************************************************************* + * @file hc32f4a0_hash.c + * @brief This file provides firmware functions to manage the HASH + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Heqb First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_hash.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_HASH HASH + * @brief HASH Driver Library + * @{ + */ + +#if (DDL_HASH_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup HASH_Local_Macros HASH Local Macros + * @{ + */ +#define HASH_TIMEOUT (6000U) + +#define HASH_INT_MASK (HASH_INT_GROUP | HASH_INT_ALL) + +#define HASH_FLAG_MASK (HASH_FLAG_START | HASH_FLAG_BUSY | \ + HASH_FLAG_CYC_END | HASH_FLAG_HMAC_END) + +#define HASH_CLR_FLAG_MASK (HASH_FLAG_CYC_END | HASH_FLAG_HMAC_END) +/** + * @defgroup HASH_Check_Parameters_Validity HASH Check Parameters Validity + * @{ + */ +#define IS_VALID_MODE(x) \ +( ((x) == HASH_MODE_SHA_256) || \ + ((x) == HASH_MODE_HMAC)) + +#define IS_VALID_KEY_LEN(x) \ +( ((x) == HASH_KEY_LEN_LONG) || \ + ((x) == HASH_KEY_LEN_SHORT)) + +#define IS_VALID_INT_CMD(x) (((x) | HASH_INT_MASK) == HASH_INT_MASK) + +#define IS_VALID_FLAG(x) (((x) | HASH_FLAG_MASK) == HASH_FLAG_MASK) + +#define IS_VALID_MSG_GRP(x) \ +( ((x) == HASH_MSG_GRP_FIRST) || \ + ((x) == HASH_MSG_GRP_END) || \ + ((x) == HASH_MSG_GRP_ONLY_ONE)) + +#define IS_VALID_FLAG_CLR(x) \ +( ((x) != 0x0UL) && \ + (((x) | HASH_CLR_FLAG_MASK) == HASH_CLR_FLAG_MASK)) + +#define IS_VALID_COM_TRIG(x) \ +( ((x) != 0x0UL) && \ + (((x) | HASH_COM_TRIG_MASk) == HASH_COM_TRIG_MASk)) + +#define IS_VALID_TRG_REG_SEL(x) \ +( ((x) == HASH_TRIG_REG_BLKCOM) || \ + ((x) == HASH_TRIG_REG_TRNCOM)) + +#define IS_VALID_TRG_SRC_SEL(x) \ +( ((x) == HASH_TRG_SRC_DMA1_BTC0) || \ + ((x) == HASH_TRG_SRC_DMA1_BTC1) || \ + ((x) == HASH_TRG_SRC_DMA1_BTC2) || \ + ((x) == HASH_TRG_SRC_DMA1_BTC3) || \ + ((x) == HASH_TRG_SRC_DMA1_BTC4) || \ + ((x) == HASH_TRG_SRC_DMA1_BTC5) || \ + ((x) == HASH_TRG_SRC_DMA1_BTC6) || \ + ((x) == HASH_TRG_SRC_DMA1_BTC7) || \ + ((x) == HASH_TRG_SRC_DMA1_TC0) || \ + ((x) == HASH_TRG_SRC_DMA1_TC1) || \ + ((x) == HASH_TRG_SRC_DMA1_TC2) || \ + ((x) == HASH_TRG_SRC_DMA1_TC3) || \ + ((x) == HASH_TRG_SRC_DMA1_TC4) || \ + ((x) == HASH_TRG_SRC_DMA1_TC5) || \ + ((x) == HASH_TRG_SRC_DMA1_TC6) || \ + ((x) == HASH_TRG_SRC_DMA1_TC7) || \ + ((x) == HASH_TRG_SRC_DMA2_BTC0) || \ + ((x) == HASH_TRG_SRC_DMA2_BTC1) || \ + ((x) == HASH_TRG_SRC_DMA2_BTC2) || \ + ((x) == HASH_TRG_SRC_DMA2_BTC3) || \ + ((x) == HASH_TRG_SRC_DMA2_BTC4) || \ + ((x) == HASH_TRG_SRC_DMA2_BTC5) || \ + ((x) == HASH_TRG_SRC_DMA2_BTC6) || \ + ((x) == HASH_TRG_SRC_DMA2_BTC7) || \ + ((x) == HASH_TRG_SRC_DMA2_TC0) || \ + ((x) == HASH_TRG_SRC_DMA2_TC1) || \ + ((x) == HASH_TRG_SRC_DMA2_TC2) || \ + ((x) == HASH_TRG_SRC_DMA2_TC3) || \ + ((x) == HASH_TRG_SRC_DMA2_TC4) || \ + ((x) == HASH_TRG_SRC_DMA2_TC5) || \ + ((x) == HASH_TRG_SRC_DMA2_TC6) || \ + ((x) == HASH_TRG_SRC_DMA2_TC7)) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ +static void HASH_WriteData(uint8_t u8Data[]); +static en_result_t HASH_Fill_Calc_Data(const uint8_t au8Data[], uint32_t u32DataSize); + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup HASH_Global_Functions HASH Global Functions + * @{ + */ + +/** + * @brief HASH calculate. + * @param [in] pvSrcData Pointer to the source data buffer + * @param [in] u32SrcDataSize Length of the input buffer in bytes + * @param [out] au8MsgDigest Buffer of the digest. The size must be 32 bytes + * @retval Ok: Success + * ErrorBufferFull: Filling Error + * ErrorInvalidParameter: Parameter error + */ +en_result_t HASH_Calculate(const void *pvSrcData, + uint32_t u32SrcDataSize, + uint8_t au8MsgDigest[]) +{ + en_result_t enRet = ErrorInvalidParameter; + if((pvSrcData != NULL) && + (u32SrcDataSize != 0UL) && + (au8MsgDigest != NULL)) + { + /* Set HMAC Mode */ + + (void)HASH_SetMode(HASH_MODE_SHA_256); + if(HASH_Fill_Calc_Data(pvSrcData, u32SrcDataSize) == Ok) + { + /* Get the message digest result */ + HASH_GetResult(au8MsgDigest); + enRet = Ok; + } + else + { + enRet = ErrorBufferFull; + } + } + return enRet; +} + +/** + * @brief HMAC calculate. + * @param [in] pvSrcData Pointer to the source data buffer + * @param [in] u32SrcDataSize Length of the input buffer in bytes + * @param [in] au8Key Buffer of the secret key + * @param [in] u32KeyLength Length of the input secret key in bytes + * @param [out] au8MsgDigest Buffer of the digest data buffer. The size must be 32 bytes + * @retval Ok: Success + * Error: Filling Error + * ErrorInvalidParameter: Parameter error + * ErrorTimeout: Process timeout + */ +en_result_t HMAC_Calculate(const void *pvSrcData, + uint32_t u32SrcDataSize, + const uint8_t au8Key[], + uint32_t u32KeyLength, + uint8_t au8MsgDigest[]) +{ + en_result_t enRet = ErrorInvalidParameter; + uint32_t u32TimeCount = 0UL; + uint8_t u8FillBuffer[HASH_GROUP_LEN] = {0UL}; + if ((pvSrcData != NULL) && + (u32SrcDataSize != 0UL) && + (au8Key != NULL) && + (u32KeyLength != 0UL) && + (au8MsgDigest != NULL)) + { + enRet = Ok; + /* Set HMAC Mode */ + (void)HASH_SetMode(HASH_MODE_HMAC); + if (u32KeyLength > HASH_GROUP_LEN) + { + SET_REG32_BIT(M4_HASH->CR, HASH_CR_LKEY); + /* Write the key to the data register */ + (void)HASH_Fill_Calc_Data(au8Key, u32KeyLength); + } + else + { + (void)memcpy(u8FillBuffer, &au8Key[0U], u32KeyLength); + /* Write the key to the data register */ + HASH_WriteData(u8FillBuffer); + /* Set first group. */ + SET_REG32_BIT(M4_HASH->CR, HASH_CR_FST_GRP); + /* Set last group. */ + SET_REG32_BIT(M4_HASH->CR, HASH_CR_KMSG_END); + /* Start hash calculating. */ + SET_REG32_BIT(M4_HASH->CR, HASH_CR_START); + /* Wait for operation completion */ + while(READ_REG32_BIT(M4_HASH->CR, HASH_CR_BUSY)) + { + if(u32TimeCount++ > HASH_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + } + /* Clear operation completion flag */ + CLEAR_REG32_BIT(M4_HASH->CR, HASH_CR_CYC_END); + if (enRet == Ok) + { + u32TimeCount =0UL; + /* Write the message to the data register */ + if (HASH_Fill_Calc_Data(pvSrcData, u32SrcDataSize) == Ok) + { + while(READ_REG32_BIT(M4_HASH->CR, HASH_CR_HMAC_END) == 0UL) + { + if (u32TimeCount++ > HASH_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + if (enRet == Ok) + { + /* Clear operation completion flag */ + CLEAR_REG32_BIT(M4_HASH->CR, HASH_CR_CYC_END); + CLEAR_REG32_BIT(M4_HASH->CR, HASH_CR_HMAC_END); + /* Get the message digest result */ + HASH_GetResult(au8MsgDigest); + } + } + } + } + return enRet; +} + +/** + * @brief Start HASH. + * @param None + * @retval Ok: Success + * ErrorTimeout: Process timeout + */ +en_result_t HASH_Start(void) +{ + en_result_t enRet = Ok; + uint32_t u32TimeCount = 0UL; + /* Wait for the HASH to stop */ + while(READ_REG32_BIT(M4_HASH->CR, HASH_CR_START)) + { + if (u32TimeCount++ > HASH_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + if (enRet == Ok) + { + /* Start hash calculating. */ + SET_REG32_BIT(M4_HASH->CR, HASH_CR_START); + } + return enRet; +} + +/** + * @brief Enable or Disable HASH interrupt. + * @param [in] u32HashInt Specifies the HASH interrupt to check. + * This parameter can be following values: + * @arg HASH_INT_GROUP: A set of data operations complete interrupt + * @arg HASH_INT_ALL: All data operations complete interrupt + * @param [in] enNewState The new state of specified interrupt. + * This parameter can be: Enable or Disable. + * @retval Ok: Success + * ErrorTimeout: Process timeout + */ +en_result_t HASH_IntCmd(uint32_t u32HashInt, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_VALID_INT_CMD(u32HashInt)); + en_result_t enRet = Ok; + uint32_t u32TimeCount = 0UL; + /* Wait for the HASH to stop */ + while(READ_REG32_BIT(M4_HASH->CR, HASH_CR_START)) + { + if(u32TimeCount++ > HASH_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + if (enRet == Ok) + { + if (enNewState == Enable) + { + SET_REG32_BIT(M4_HASH->CR, u32HashInt); + } + else + { + CLEAR_REG32_BIT(M4_HASH->CR, u32HashInt); + } + } + return enRet; +} + +/** + * @brief Set mode for the HASH + * @param [in] u32HashMode HASH mode selection + * This parameter can be one of the following values: + * @arg HASH_MODE_SHA_256: SHA_256 Operating mode + * @arg HASH_MODE_HMAC: HMAC Operating mode + * @retval Ok: Success + * ErrorTimeout: Process timeout + */ +en_result_t HASH_SetMode(uint32_t u32HashMode) +{ + DDL_ASSERT(IS_VALID_MODE(u32HashMode)); + en_result_t enRet = Ok; + uint32_t u32TimeCount = 0UL; + /* Wait for the HASH to stop */ + while(READ_REG32_BIT(M4_HASH->CR, HASH_CR_START)) + { + if (u32TimeCount++ > HASH_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + if (enRet == Ok) + { + MODIFY_REG32(M4_HASH->CR, HASH_CR_MODE, u32HashMode); + } + return enRet; +} + +/** + * @brief Get HASH status + * @param [in] u32HashFlag Specifies the flag to query. + * @arg HASH_FLAG_START: Operation in progress + * @arg HASH_FLAG_BUSY: Operation in progress + * @arg HASH_FLAG_CYC_END: key or message operation completed + * @arg HASH_FLAG_HMAC_END: HMAC operation completed + * @retval Set: Flag is set + * Reset: Flag is reset + */ +en_flag_status_t HASH_GetStatus(uint32_t u32HashFlag) +{ + en_flag_status_t enRet; + DDL_ASSERT(IS_VALID_FLAG(u32HashFlag)); + + enRet = (READ_REG32_BIT(M4_HASH->CR, u32HashFlag) ? Set :Reset); + return enRet; +} + +/** + * @brief Set HASH key length + * @param [in] u32KeyLen Key length. + * This parameter can be a value of the following: + * @arg HASH_KEY_LEN_LONG: Key length > 64 Bytes + * @arg HASH_KEY_LEN_SHORT: Key length <= 64 Bytes + * @retval Ok: Success + * ErrorTimeout: Process timeout + */ +en_result_t HASH_SetKeyLength(uint32_t u32KeyLen) +{ + DDL_ASSERT(IS_VALID_KEY_LEN(u32KeyLen)); + en_result_t enRet = Ok; + uint32_t u32TimeCount = 0UL; + /* Wait for the HASH to stop */ + while(READ_REG32_BIT(M4_HASH->CR, HASH_CR_START)) + { + if (u32TimeCount++ > HASH_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + if (enRet == Ok) + { + MODIFY_REG32(M4_HASH->CR, HASH_CR_LKEY, u32KeyLen); + } + return enRet; +} + +/** + * @brief Clear HASH status + * @param [in] u32ClearFlag Specifies the flag to clear. + * This parameter can be a value of the following: + * @arg HASH_FLAG_CYC_END: Clear the key or message operation completed flag + * @arg HASH_FLAG_HMAC_END: Clear the HMAC operation completed flag + * @retval Ok: Success + * ErrorTimeout: Process timeout + */ +en_result_t HASH_ClearStatus(uint32_t u32ClearFlag) +{ + en_result_t enRet = Ok; + uint32_t u32TimeCount = 0UL; + DDL_ASSERT(IS_VALID_FLAG_CLR(u32ClearFlag)); + + /* Wait for the HASH to stop */ + while(READ_REG32_BIT(M4_HASH->CR, HASH_CR_START)) + { + if (u32TimeCount++ > HASH_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + if (enRet == Ok) + { + CLEAR_REG32_BIT(M4_HASH->CR, u32ClearFlag); + } + return enRet; +} + +/** + * @brief Set trigger source for HASH + * @param [in] enSrc Specifies the Event as trigger source. + * This parameter can be a value of the following: + * @arg HASH_TRG_SRC_DMA1_BTC0: Select the DMA1 channel_0 block transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA1_BTC1: Select the DMA1 channel_1 block transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA1_BTC2: Select the DMA1 channel_2 block transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA1_BTC3: Select the DMA1 channel_3 block transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA1_BTC4: Select the DMA1 channel_4 block transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA1_BTC5: Select the DMA1 channel_5 block transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA1_BTC6: Select the DMA1 channel_6 block transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA1_BTC7: Select the DMA1 channel_7 block transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA1_TC0: Select the DMA1 channel_0 transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA1_TC1: Select the DMA1 channel_1 transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA1_TC2: Select the DMA1 channel_2 transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA1_TC3: Select the DMA1 channel_3 transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA1_TC4: Select the DMA1 channel_4 transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA1_TC5: Select the DMA1 channel_5 transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA1_TC6: Select the DMA1 channel_6 transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA1_TC7: Select the DMA1 channel_7 transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA2_BTC0: Select the DMA2 channel_0 block transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA2_BTC1: Select the DMA2 channel_1 block transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA2_BTC2: Select the DMA2 channel_2 block transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA2_BTC3: Select the DMA2 channel_3 block transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA2_BTC4: Select the DMA2 channel_4 block transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA2_BTC5: Select the DMA2 channel_5 block transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA2_BTC6: Select the DMA2 channel_6 block transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA2_BTC7: Select the DMA2 channel_7 block transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA2_TC0: Select the DMA2 channel_0 transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA2_TC1: Select the DMA2 channel_1 transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA2_TC2: Select the DMA2 channel_2 transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA2_TC3: Select the DMA2 channel_3 transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA2_TC4: Select the DMA2 channel_4 transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA2_TC5: Select the DMA2 channel_5 transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA2_TC6: Select the DMA2 channel_6 transfer complete as trigger source + * @arg HASH_TRG_SRC_DMA2_TC7: Select the DMA2 channel_7 transfer complete as trigger source + * @retval None + */ +void HASH_SetTriggerSrc(en_event_src_t enSrc) +{ + DDL_ASSERT(IS_VALID_TRG_SRC_SEL(enSrc)); + + if(((enSrc >= HASH_TRG_SRC_DMA1_TC0) && (enSrc <= HASH_TRG_SRC_DMA1_TC7)) || \ + ((enSrc >= HASH_TRG_SRC_DMA2_TC0) && (enSrc <= HASH_TRG_SRC_DMA2_TC7))) + { + MODIFY_REG32(M4_AOS->HASH_ITRGSELA, AOS_HASH_ITRGSELA_TRGSEL, enSrc); + } + else + { + MODIFY_REG32(M4_AOS->HASH_ITRGSELB, AOS_HASH_ITRGSELB_TRGSEL, enSrc); + } +} + +/** + * @brief Enable or Disable common trigger source for HASH + * @param [in] u8TrigReg HASH common trigger source select. + * This parameter can be a value of @ref HASH_Common_Trigger_Reg_Sel + * @arg HASH_TRIG_REG_BLKCOM: DMA block transfer complete register. + * @arg HASH_TRID_REG_TRNCOM: DMA transfer complete register + * @param [in] u32ComTrig Common trigger event enable bit mask. + * This parameter can be value of @ref HASH_Common_Trigger_Sel + * @arg HASH_COM_TRIG1: Common trigger source 1. + * @arg HASH_COM_TRIG2: Common trigger source 2. + * @param [in] enNewState Disable or Enable the function + * @retval None + */ +void HASH_ComTriggerCmd(uint8_t u8TrigReg, uint32_t u32ComTrig, + en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_TRG_REG_SEL(u8TrigReg)); + DDL_ASSERT(IS_VALID_COM_TRIG(u32ComTrig)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + __IO uint32_t *HASH_ITRGSELx = (__IO uint32_t *)((uint32_t)&M4_AOS->HASH_ITRGSELA + 4UL * u8TrigReg); + + if (enNewState == Enable) + { + SET_REG32_BIT(*HASH_ITRGSELx, u32ComTrig); + } + else + { + CLEAR_REG32_BIT(*HASH_ITRGSELx, u32ComTrig); + } +} + +/** + * @brief Set the group of messages. + * @param [in] u32MsgGroup First group or Last group of messages. + * This parameter can be a value of the following: + * @arg HASH_MSG_GRP_FIRST: The first group of messages or keys + * @arg HASH_MSG_GRP_END: The last group of messages or keys + * @arg HASH_MSG_GRP_ONLY_ONE: Only one set of message or key + * @retval Ok: Success + * ErrorTimeout: Process timeout + */ +en_result_t HASH_MsgGrpConfig(uint32_t u32MsgGroup) +{ + DDL_ASSERT(IS_VALID_MSG_GRP(u32MsgGroup)); + en_result_t enRet = Ok; + uint32_t u32TimeCount = 0UL; + /* Wait for the HASH to stop */ + while(READ_REG32_BIT(M4_HASH->CR, HASH_CR_START)) + { + if (u32TimeCount++ > HASH_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + if (enRet == Ok) + { + SET_REG32_BIT(M4_HASH->CR, u32MsgGroup); + } + return enRet; +} + +/** + * @brief Provides the message digest result. + * @param [out] au8MsgDigest Buffer for message digest. + * @retval None + */ +void HASH_GetResult(uint8_t au8MsgDigest[]) +{ + uint8_t i; + uint32_t u32Temp1; + uint32_t u32HashHr = (uint32_t)(&M4_HASH->HR7); + uint32_t u32DigestHr = (uint32_t)(&au8MsgDigest[0U]); + for (i = 0U; i < 8U; i++) + { + u32Temp1 = __REV(RW_MEM32(u32HashHr)); + *(uint32_t *)(u32DigestHr) = u32Temp1; + u32HashHr += 4U; + u32DigestHr += 4U; + } +} + +/** + * @brief HASH Filling data + * @param [in] au8Data The source data buffer + * @param [in] u32DataSize Length of the input buffer in bytes + * @retval Ok: Success + * ErrorTimeout: Process timeout + */ +static en_result_t HASH_Fill_Calc_Data(const uint8_t au8Data[], uint32_t u32DataSize) +{ + en_result_t enRet = Ok; + uint8_t au8FillBuffer[HASH_GROUP_LEN]; + uint8_t u8FirstGroup = 0U; + uint8_t u8LastGroup = 0U; + uint8_t u8FillFlag = 0U; + uint32_t u32TimeCount = 0UL; + uint32_t u32GroupCount = 0UL; + uint32_t u32BitLenHi; + uint32_t u32BitLenLo; + uint32_t u32Index; + u32BitLenHi = (u32DataSize >> 29UL) & 0x7UL; + u32BitLenLo = (u32DataSize << 3UL); + while(u32DataSize > 0UL) + { + /* Wait for the HASH to stop */ + while(READ_REG32_BIT(M4_HASH->CR, HASH_CR_START)) + { + if(u32TimeCount++ > HASH_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + if (enRet == Ok) + { + u32Index = u32GroupCount * HASH_GROUP_LEN; + if((u32DataSize >= HASH_GROUP_LEN)) + { + (void)memset(au8FillBuffer, 0, HASH_GROUP_LEN); + (void)memcpy(au8FillBuffer, &au8Data[u32Index], HASH_GROUP_LEN); + HASH_WriteData(au8FillBuffer); + u32GroupCount++; + u32DataSize -= HASH_GROUP_LEN; + } + else + { + (void)memset(au8FillBuffer, 0, HASH_GROUP_LEN); + if(u32DataSize >= LAST_GROUP_MAX_LEN) + { + if(u8FillFlag == 0U) + { + (void)memcpy(au8FillBuffer, &au8Data[u32Index], u32DataSize); + au8FillBuffer[u32DataSize] = 0x80U; + u8FillFlag = 1U; + } + else + { + u32DataSize = 0UL; + } + } + else + { + (void)memcpy(au8FillBuffer, &au8Data[u32Index], u32DataSize); + au8FillBuffer[u32DataSize] = 0x80U; + u32DataSize = 0UL; + } + if(0U == u32DataSize) + { + au8FillBuffer[63U] = (uint8_t)(u32BitLenLo); + au8FillBuffer[62U] = (uint8_t)(u32BitLenLo >> 8U); + au8FillBuffer[61U] = (uint8_t)(u32BitLenLo >> 16U); + au8FillBuffer[60U] = (uint8_t)(u32BitLenLo >> 24U); + au8FillBuffer[59U] = (uint8_t)(u32BitLenHi); + au8FillBuffer[58U] = (uint8_t)(u32BitLenHi >> 8U); + au8FillBuffer[57U] = (uint8_t)(u32BitLenHi >> 16U); + au8FillBuffer[56U] = (uint8_t)(u32BitLenHi >> 24U); + u8LastGroup = 1U; + } + HASH_WriteData(au8FillBuffer); + } + /* check if first group */ + if (0U == u8FirstGroup) + { + u8FirstGroup = 1U; + /* Set first group. */ + SET_REG32_BIT(M4_HASH->CR, HASH_CR_FST_GRP); + } + /* check if last group */ + if (1U == u8LastGroup) + { + u8LastGroup = 0U; + /* Set last group. */ + SET_REG32_BIT(M4_HASH->CR, HASH_CR_KMSG_END); + } + /* Start hash calculating. */ + SET_REG32_BIT(M4_HASH->CR, HASH_CR_START); + /* Wait for operation completion */ + while(READ_REG32_BIT(M4_HASH->CR, HASH_CR_BUSY)) + { + if(u32TimeCount++ > HASH_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + } + } + return enRet; +} + +/** + * @brief Writes the input buffer in data register. + * @param [in] au8Data The buffer for source data + * @retval None + */ +static void HASH_WriteData(uint8_t au8Data[]) +{ + uint8_t i; + uint32_t u32Temp1; + uint32_t u32HashDr = (uint32_t)&(M4_HASH->DR15); + + for (i = 0U; i < 16U; i++) + { + u32Temp1 = __REV(RW_MEM32(&au8Data[i*4U])); + RW_MEM32(u32HashDr) = u32Temp1; + u32HashDr += 4U; + } +} + +/** + * @} + */ + +#endif /* DDL_HASH_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_hrpwm.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_hrpwm.c new file mode 100644 index 0000000000..0e32563c59 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_hrpwm.c @@ -0,0 +1,413 @@ +/** + ******************************************************************************* + * @file hc32f4a0_hrpwm.c + * @brief This file provides firmware functions to manage the High Resolution + * Pulse-Width Modulation(HRPWM). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Wangmin First version + 2020-09-07 Wangmin Modify channel delay configure function + parameter type. + 2020-10-13 Wangmin Define variable for count as __IO type + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_hrpwm.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_HRPWM HRPWM + * @brief HRPWM Driver Library + * @{ + */ + +#if (DDL_HRPWM_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup HRPWM_Local_Macros HRPWM Local Macros + * @{ + */ +/* About 1mS timeout */ +#define HRPWM_CAL_TIMEOUT (HCLK_VALUE/1000UL) +#define HRPWM_PCLK0_MIN (120000000UL) + +#define HRPWM_SYSCLKSOURCE_HRC (0x00U) +#define HRPWM_SYSCLKSOURCE_MRC (0x01U) +#define HRPWM_SYSCLKSOURCE_LRC (0x02U) +#define HRPWM_SYSCLKSOURCE_XTAL (0x03U) +#define HRPWM_SYSCLKSOURCE_XTAL32 (0x04U) +#define HRPWM_SYSCLKSOURCE_PLLH (0x05U) + +#define HRPWM_PLLSRC_XTAL (0x00UL) +#define HRPWM_PLLSRC_HRC (0x01UL) + +/** + * @defgroup HRPWM_Check_Parameters_Validity HRPWM Check Parameters Validity + * @{ + */ + +/*! Parameter valid check for HRPWM output channel */ +#define IS_VALID_HRPWM_CH(x) \ +( ((x) >= HRPWM_CH_MIN) && \ + ((x) <= HRPWM_CH_MAX)) + +/*! Parameter valid check for HRPWM caliration unit */ +#define IS_VALID_HRPWM_CAL_UNIT(x) \ +( (HRPWM_CAL_UNIT0 == (x)) || \ + (HRPWM_CAL_UNIT1 == (x))) + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ + +/** + * @defgroup HRPWM_Global_Functions HRPWM Global Functions + * @{ + */ + +/** + * @brief Process for getting HRPWM Calibrate function code + * @param [in] u32Unit Calibrate unit, the parameter should be HRPWM_CAL_UNIT0 or HRPWM_CAL_UNIT1 + * @param [out] pu8Code The pointer to get calibrate code. + * @retval Ok: Success + * @retval ErrorTimeout: Time out + * @retval ErrorInvalidParameter: Parameter error + */ +en_result_t HRPWM_CalibrateProcess(uint32_t u32Unit, uint8_t* pu8Code) +{ + __IO uint32_t u32Timeout = HRPWM_CAL_TIMEOUT; + en_result_t enRet = Ok; + + if(NULL != pu8Code) + { + /* Enable calibrate */ + HRPWM_CalibrateCmd(u32Unit, Enable); + /* Wait calibrate finish flag */ + while(Disable == HRPWM_GetCalibrateStd(u32Unit)) + { + if(0UL == u32Timeout--) + { + enRet = ErrorTimeout; + break; + } + } + + if(Ok == enRet) + { + /* Get calibrate code */ + *pu8Code = HRPWM_GetCalCode(u32Unit); + } + } + else + { + enRet = ErrorInvalidParameter; + } + return enRet; +} + +/** + * @brief HRPWM Calibrate function enable or disable for specified unit + * @param [in] u32Unit Calibrate unit, the parameter should be HRPWM_CAL_UNIT0 or HRPWM_CAL_UNIT1 + * @param [in] enNewState Disable or Enable the function + * @retval None + */ +void HRPWM_CalibrateCmd(uint32_t u32Unit, en_functional_state_t enNewState) +{ + __IO uint32_t *CALCRx; + /* Check parameters */ + DDL_ASSERT(IS_VALID_HRPWM_CAL_UNIT(u32Unit)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + CALCRx = (__IO uint32_t*)(((uint32_t)&M4_HRPWM->CALCR0) + 4UL*u32Unit); + + if(Enable == enNewState) + { + SET_REG32_BIT(*CALCRx, HRPWM_CALCR_CALEN); + + } + else + { + CLEAR_REG32_BIT(*CALCRx, HRPWM_CALCR_CALEN); + } +} + +/** + * @brief HRPWM Calibrate function status get for specified unit + * @param [in] u32Unit Calibrate unit, the parameter should be HRPWM_CAL_UNIT0 or HRPWM_CAL_UNIT1 + * @retval Enable: Calibration function is on. + * @retval Disable: Calibration function is off. + */ +en_functional_state_t HRPWM_GetCalibrateStd(uint32_t u32Unit) +{ + en_functional_state_t enRet; + __IO uint32_t *CALCRx; + /* Check parameters */ + DDL_ASSERT(IS_VALID_HRPWM_CAL_UNIT(u32Unit)); + + CALCRx = (__IO uint32_t*)(((uint32_t)&M4_HRPWM->CALCR0) + 4UL*u32Unit); + + if( 0UL != READ_REG32_BIT(*CALCRx, HRPWM_CALCR_ENDF)) + { + enRet = Enable; + } + else + { + enRet = Disable; + } + return enRet; +} + +/** + * @brief HRPWM Calibrate code get for specified unit + * @param [in] u32Unit Calibrate unit, the parameter should be HRPWM_CAL_UNIT0 or HRPWM_CAL_UNIT1 + * @retval uint8_t: The calibration code. + */ +uint8_t HRPWM_GetCalCode(uint32_t u32Unit) +{ + __IO uint32_t *CALCRx; + /* Check parameters */ + DDL_ASSERT(IS_VALID_HRPWM_CAL_UNIT(u32Unit)); + + CALCRx = (__IO uint32_t*)(((uint32_t)&M4_HRPWM->CALCR0) + 4UL*u32Unit); + + return ((uint8_t)(READ_REG32(*CALCRx))); +} + +/** + * @brief HRPWM function enable or disable for specified channel + * @param [in] u32Ch Channel, the parameter should range from HRPWM_CH_MIN to HRPWM_CH_MAX + * @param [in] enNewState Disable or Enable the function + * @retval None + */ +void HRPWM_CHCmd(uint32_t u32Ch, en_functional_state_t enNewState) +{ + __IO uint32_t *CRx; + /* Check parameters */ + DDL_ASSERT(IS_VALID_HRPWM_CH(u32Ch)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + CRx = (__IO uint32_t*)(((uint32_t)&M4_HRPWM->CR1) + 4UL*(u32Ch - 1UL)); + if(Enable == enNewState) + { + SET_REG32_BIT(*CRx, HRPWM_CR_EN); + } + else + { + CLEAR_REG32_BIT(*CRx, HRPWM_CR_EN); + } +} + +/** + * @brief HRPWM positive edge adjust enable or disable for specified channel + * @param [in] u32Ch Channel, the parameter should range from HRPWM_CH_MIN to HRPWM_CH_MAX + * @param [in] enNewState Disable or Enable the function + * @retval None + */ +void HRPWM_CHPositAdjCmd(uint32_t u32Ch, en_functional_state_t enNewState) +{ + __IO uint32_t *CRx; + /* Check parameters */ + DDL_ASSERT(IS_VALID_HRPWM_CH(u32Ch)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + CRx = (__IO uint32_t*)(((uint32_t)&M4_HRPWM->CR1) + 4UL*(u32Ch - 1UL)); + if(Enable == enNewState) + { + SET_REG32_BIT(*CRx, HRPWM_CR_PE); + } + else + { + CLEAR_REG32_BIT(*CRx, HRPWM_CR_PE); + } +} + +/** + * @brief HRPWM negative edge adjust enable or disable for specified channel + * @param [in] u32Ch Channel, the parameter should range from HRPWM_CH_MIN to HRPWM_CH_MAX + * @param [in] enNewState Disable or Enable the function + * @retval None + */ +void HRPWM_CHNegatAdjCmd(uint32_t u32Ch, en_functional_state_t enNewState) +{ + __IO uint32_t *CRx; + /* Check parameters */ + DDL_ASSERT(IS_VALID_HRPWM_CH(u32Ch)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + CRx = (__IO uint32_t*)(((uint32_t)&M4_HRPWM->CR1) + 4UL*(u32Ch - 1UL)); + if(Enable == enNewState) + { + SET_REG32_BIT(*CRx, HRPWM_CR_NE); + } + else + { + CLEAR_REG32_BIT(*CRx, HRPWM_CR_NE); + } +} + +/** + * @brief HRPWM positive edge adjust delay counts configration for specified channel + * @param [in] u32Ch Channel, the parameter should range from HRPWM_CH_MIN to HRPWM_CH_MAX + * @param [in] u8DelayNum Delay counts of minimum delay time. + * @retval None + */ +void HRPWM_CHPositCfg(uint32_t u32Ch, uint8_t u8DelayNum) +{ + __IO uint32_t *CRx; + /* Check parameters */ + DDL_ASSERT(IS_VALID_HRPWM_CH(u32Ch)); + + CRx = (__IO uint32_t*)(((uint32_t)&M4_HRPWM->CR1) + 4UL*(u32Ch - 1UL)); + MODIFY_REG32(*CRx, HRPWM_CR_PSEL, ((uint32_t)u8DelayNum-1UL) << HRPWM_CR_PSEL_POS); +} + +/** + * @brief HRPWM negative edge adjust delay counts configration for specified channel + * @param [in] u32Ch Channel, the parameter should range from HRPWM_CH_MIN to HRPWM_CH_MAX + * @param [in] u8DelayNum Delay counts of minimum delay time. + * @retval None + */ +void HRPWM_CHNegatCfg(uint32_t u32Ch, uint8_t u8DelayNum) +{ + __IO uint32_t *CRx; + /* Check parameters */ + DDL_ASSERT(IS_VALID_HRPWM_CH(u32Ch)); + + CRx = (__IO uint32_t*)(((uint32_t)&M4_HRPWM->CR1) + 4UL*(u32Ch - 1UL)); + MODIFY_REG32(*CRx, HRPWM_CR_NSEL, ((uint32_t)u8DelayNum-1UL) << HRPWM_CR_NSEL_POS); +} + +/** + * @brief HRPWM Judge the condition of calibration function. + * @param None + * @retval Enable: Condition is ready. + * @retval Disable: Condition is not ready. + */ +en_functional_state_t HRPWM_ConditionConfirm(void) +{ + en_functional_state_t enRet = Enable; + uint32_t plln; + uint32_t pllp; + uint32_t pllm; + uint32_t sysclkFreq; + uint32_t pclk0Freq; + + switch (READ_REG8_BIT(M4_CMU->CKSWR, CMU_CKSWR_CKSW)) + { + case HRPWM_SYSCLKSOURCE_HRC: + /* HRC is used to system clock */ + sysclkFreq = HRC_VALUE; + break; + case HRPWM_SYSCLKSOURCE_MRC: + /* MRC is used to system clock */ + sysclkFreq = MRC_VALUE; + break; + case HRPWM_SYSCLKSOURCE_LRC: + /* LRC is used to system clock */ + sysclkFreq = LRC_VALUE; + break; + case HRPWM_SYSCLKSOURCE_XTAL: + /* XTAL is used to system clock */ + sysclkFreq = XTAL_VALUE; + break; + case HRPWM_SYSCLKSOURCE_XTAL32: + /* XTAL32 is used to system clock */ + sysclkFreq = HRC_VALUE; + break; + case HRPWM_SYSCLKSOURCE_PLLH: + /* PLLHP is used as system clock. */ + pllp = (uint32_t)((M4_CMU->PLLHCFGR >> CMU_PLLHCFGR_PLLHP_POS) & 0x0FUL); + plln = (uint32_t)((M4_CMU->PLLHCFGR >> CMU_PLLHCFGR_PLLHN_POS) & 0xFFUL); + pllm = (uint32_t)((M4_CMU->PLLHCFGR >> CMU_PLLHCFGR_PLLHM_POS) & 0x03UL); + + /* fpll = ((pllin / pllm) * plln) / pllp */ + if (HRPWM_PLLSRC_XTAL == READ_REG32_BIT(M4_CMU->PLLHCFGR, CMU_PLLHCFGR_PLLSRC)) + { + sysclkFreq = ((XTAL_VALUE/(pllm + 1UL))*(plln + 1UL))/(pllp + 1UL); + } + else + { + sysclkFreq = ((HRC_VALUE/(pllm + 1UL))*(plln + 1UL))/(pllp + 1UL); + } + break; + default: + sysclkFreq = HRC_VALUE; + enRet = Disable; + break; + } + + if(Enable == enRet) + { + /* Get pclk0. */ + pclk0Freq = sysclkFreq >> (READ_REG32_BIT(M4_CMU->SCFGR, CMU_SCFGR_PCLK0S) >> CMU_SCFGR_PCLK0S_POS); + + if(pclk0Freq < HRPWM_PCLK0_MIN) + { + enRet = Disable; + } + } + return enRet; +} + +/** + * @} + */ + +#endif /* DDL_HRPWM_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_i2c.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_i2c.c new file mode 100644 index 0000000000..31c3d8c565 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_i2c.c @@ -0,0 +1,1631 @@ +/** + ******************************************************************************* + * @file hc32f4a0_i2c.c + * @brief This file provides firmware functions to manage the Inter-Integrated + * Circuit(I2C). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Hexiao First version + 2020-07-15 Hexiao Modify I2C_SmBusCmd to I2C_SetMode + 2020-08-31 Hexiao Refine I2C_Init/I2C_SendData/I2C_RcvData + 2020-09-15 Hexiao Modify I2C_RcvData for manually ack and nack + 2020-10-30 Hexiao Optimize data transfer api,etc. + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_i2c.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_I2C I2C + * @brief I2C Driver Library + * @{ + */ + +#if (DDL_I2C_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup I2C_Local_Macros I2C Local Macros + * @{ + */ + +#define I2C_CLR_MASK (0x00F052DFUL) +#define I2C_INT_MASK (0x00F052DFUL) +#define I2C_SCL_HIGHT_LOW_LVL_SUM_MAX ((float32_t)0x1F*(float32_t)2) + + +/** + * @defgroup I2C_Check_Parameters_Validity I2C Check Parameters Validity + * @{ + */ +#define IS_VALID_UNIT(x) \ +( ((x) == M4_I2C1) || \ + ((x) == M4_I2C2) || \ + ((x) == M4_I2C3) || \ + ((x) == M4_I2C4) || \ + ((x) == M4_I2C5) || \ + ((x) == M4_I2C6)) + +#define IS_VALID_MODE(x) \ +( ((x) == I2C_MODE_I2C) || \ + ((x) == I2C_MODE_SMBUS)) + +#define IS_VALID_CLEARBIT(x) ((0U != (x)) && (0U == ((x) & (~I2C_CLR_MASK)))) + +#define IS_VALID_INT(x) ((0U != (x)) && (0U == ((x) & (~I2C_INT_MASK)))) + +#define IS_VALID_SPEED(speed) ((0U != (speed)) && ((speed) <= (I2C_BAUDRATE_MAX))) + +#define IS_VALID_DIGITAL_FILTER(x) ((x) <= I2C_DIG_FILTMODE_4CYCLE) + +#define IS_VALID_RD_STATUS_BIT(x) \ +( ((x) == I2C_SR_STARTF) || \ + ((x) == I2C_SR_SLADDR0F) || \ + ((x) == I2C_SR_SLADDR1F) || \ + ((x) == I2C_SR_TENDF) || \ + ((x) == I2C_SR_STOPF) || \ + ((x) == I2C_SR_RFULLF) || \ + ((x) == I2C_SR_TEMPTYF) || \ + ((x) == I2C_SR_ARLOF) || \ + ((x) == I2C_SR_ACKRF) || \ + ((x) == I2C_SR_NACKF) || \ + ((x) == I2C_SR_TMOUTF) || \ + ((x) == I2C_SR_MSL) || \ + ((x) == I2C_SR_BUSY) || \ + ((x) == I2C_SR_TRA) || \ + ((x) == I2C_SR_GENCALLF) || \ + ((x) == I2C_SR_SMBDEFAULTF) || \ + ((x) == I2C_SR_SMBHOSTF) || \ + ((x) == I2C_SR_SMBALRTF)) + +#define IS_VALID_SMBUS_CONFIG(x) ((0U != (x)) && \ + (0U == ((x) & (~(uint32_t)I2C_SMBUS_CONFIG_CLEARMASK)))) + +#define IS_VALID_7BIT_ADDR(x) ((x) <= 0x7FUL) +#define IS_VALID_10BIT_ADDR(x) ((x) <= 0x3FFUL) + + +#define IS_VALID_ADDR_NUM(x) \ +( ((x) == I2C_ADDR_0) || \ + ((x) == I2C_ADDR_1)) + +#define IS_VALID_CLK_DIV(x) \ +( ((x) == I2C_CLK_DIV1) || \ + ((x) == I2C_CLK_DIV2) || \ + ((x) == I2C_CLK_DIV4) || \ + ((x) == I2C_CLK_DIV8) || \ + ((x) == I2C_CLK_DIV16) || \ + ((x) == I2C_CLK_DIV32) || \ + ((x) == I2C_CLK_DIV64) || \ + ((x) == I2C_CLK_DIV128)) + +#define IS_VALID_DIR(x) \ +( ((x) == I2C_DIR_TX) || \ + ((x) == I2C_DIR_RX)) + +#define IS_VALID_ACK_CONFIG(x) \ +( ((x) == I2C_ACK) || \ + ((x) == I2C_NACK)) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ +static en_result_t I2C_WaitStatus(const M4_I2C_TypeDef *I2Cx, uint32_t u32Flags, en_flag_status_t enStatus, uint32_t u32Timeout); + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ + +/** + * @defgroup I2C_Global_Functions I2C Global Functions + * @{ + */ + +/** + * @brief Set the baudrate for I2C peripheral. + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] pstcI2C_InitStruct Pointer to I2C configuration structure + * @ref stc_i2c_init_t + * @arg pstcI2C_InitStruct->u32ClkDiv: Division of Pclk3, reference as: + * step1: calculate div = (Pclk3/Baudrate/(68+2*dnfsum+SclTime) + * Pclk3 -- system clock + * Baudrate -- baudrate of i2c + * SclTime -- =(SCL rising time + SCL falling time)/period of i2c clock + * according to i2c bus hardware parameter. + * dnfsum -- 0 if digital filter off; + * Filter capacity if digital filter on(1 ~ 4) + * step2: chose a division item which is similar and bigger than div + * from @ref I2C_Clock_division. + * @arg pstcI2C_InitStruct->u32Baudrate : Baudrate configuration + * @arg pstcI2C_InitStruct->u32SclTime : Indicate SCL pin rising and + * falling time, should be number of T(i2c clock period time) + * @param [out] pf32Err Baudrate error + * @retval en_result_t + */ +en_result_t I2C_BaudrateConfig(M4_I2C_TypeDef* I2Cx, const stc_i2c_init_t *pstcI2C_InitStruct, float32_t *pf32Err) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + en_result_t enRet = Ok; + uint32_t u32Pclk3; + uint32_t I2cDivClk; + uint32_t SclCnt; + uint32_t Baudrate; + uint32_t dnfsum = 0UL; + uint32_t divsum = 2UL; + float32_t WidthTotal; + float32_t SumTotal; + float32_t WidthHL; + float32_t fErr = 0.0F; + + if ((NULL == pstcI2C_InitStruct) || (NULL == pf32Err)) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_VALID_SPEED(pstcI2C_InitStruct->u32Baudrate)); + DDL_ASSERT(IS_VALID_CLK_DIV(pstcI2C_InitStruct->u32ClkDiv)); + + /* Get configuration for i2c */ + u32Pclk3 = SystemCoreClock >> ((M4_CMU->SCFGR & CMU_SCFGR_PCLK3S) >> CMU_SCFGR_PCLK3S_POS); + I2cDivClk = 1UL << pstcI2C_InitStruct->u32ClkDiv; + SclCnt = pstcI2C_InitStruct->u32SclTime; + Baudrate = pstcI2C_InitStruct->u32Baudrate; + + /* Judge digital filter status*/ + if(0U != READ_REG32_BIT(I2Cx->FLTR, I2C_FLTR_DNFEN)) + { + dnfsum = (READ_REG32_BIT(I2Cx->FLTR, I2C_FLTR_DNF) >> I2C_FLTR_DNF_POS) + 1U; + } + + /* Judge if clock divider on*/ + if(I2C_CLK_DIV1 == I2cDivClk) + { + divsum = 3UL; + } + + WidthTotal = (float32_t)u32Pclk3 / (float32_t)Baudrate / (float32_t)I2cDivClk; + SumTotal = 2.0F*(float32_t)divsum + 2.0F*(float32_t)dnfsum + (float32_t)SclCnt; + WidthHL = WidthTotal - SumTotal; + + if(WidthTotal <= SumTotal) + { + /* Err, Should set a smaller division value for pstcI2C_InitStruct->u32ClkDiv */ + enRet = ErrorInvalidParameter; + } + else if(WidthHL > I2C_SCL_HIGHT_LOW_LVL_SUM_MAX) + { + /* Err, Should set a bigger division value for pstcI2C_InitStruct->u32ClkDiv */ + enRet = ErrorInvalidParameter; + } + else + { + fErr =(WidthHL - (float32_t)((uint32_t)WidthHL)) / WidthHL; + WRITE_REG32(I2Cx->CCR, (pstcI2C_InitStruct->u32ClkDiv << I2C_CCR_FREQ_POS) \ + | (((uint32_t)WidthHL/2U) << I2C_CCR_SLOWW_POS) \ + | (((uint32_t)WidthHL - (uint32_t)WidthHL/2U) << I2C_CCR_SHIGHW_POS)); + } + } + + if((NULL != pf32Err)&&(Ok == enRet)) + { + *pf32Err = fErr; + } + + return enRet; +} + +/** + * @brief De-initialize I2C unit + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @retval None + */ +void I2C_DeInit(M4_I2C_TypeDef* I2Cx) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + + /* Reset peripheral register and internal status*/ + CLEAR_REG32_BIT(I2Cx->CR1,I2C_CR1_PE); + SET_REG32_BIT(I2Cx->CR1,I2C_CR1_SWRST); +} + +/** + * @brief Initialize structure stc_i2c_init_t variable with default value. + * @param [out] pstcI2C_InitStruct Pointer to a stc_i2c_init_t structure variable + * which will be initialized. + * @arg See the struct @ref stc_i2c_init_t. + * @retval en_result_t + */ +en_result_t I2C_StructInit(stc_i2c_init_t* pstcI2C_InitStruct) +{ + en_result_t enRet = Ok; + + if (pstcI2C_InitStruct == NULL) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcI2C_InitStruct->u32Baudrate = 50000UL; + pstcI2C_InitStruct->u32ClkDiv = I2C_CLK_DIV1; + pstcI2C_InitStruct->u32SclTime = 0UL; + } + + return enRet; +} + +/** + * @brief Initialize I2C peripheral according to the structure + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] pstcI2C_InitStruct Pointer to I2C configuration structure + * @ref stc_i2c_init_t + * @arg pstcI2C_InitStruct->u32ClkDiv: Division of Pclk3, reference as: + * step1: calculate div = (Pclk3/Baudrate/(68+2*dnfsum+SclTime) + * Pclk3 -- system clock + * Baudrate -- baudrate of i2c + * SclTime -- =(SCL rising time + SCL falling time)/period of i2c clock + * according to i2c bus hardware parameter. + * dnfsum -- 0 if digital filter off; + * Filter capacity if digital filter on(1 ~ 4) + * step2: chose a division item which is similar and bigger than div + * from @ref I2C_Clock_division. + * @arg pstcI2C_InitStruct->u32Baudrate : Baudrate configuration + * @arg pstcI2C_InitStruct->u32SclTime : Indicate SCL pin rising and + * falling time, should be number of T(i2c clock period time) + * @param [out] pf32Err Baudrate error + * @retval en_result_t + */ +en_result_t I2C_Init(M4_I2C_TypeDef* I2Cx, const stc_i2c_init_t *pstcI2C_InitStruct, float32_t *pf32Err) +{ + en_result_t enRet; + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + + if (NULL == pstcI2C_InitStruct ) + { + enRet = ErrorInvalidParameter; + } + else + { + DDL_ASSERT(IS_VALID_SPEED(pstcI2C_InitStruct->u32Baudrate)); + DDL_ASSERT(IS_VALID_CLK_DIV(pstcI2C_InitStruct->u32ClkDiv)); + + /* Register and internal status reset */ + CLEAR_REG32_BIT(I2Cx->CR1,I2C_CR1_PE); + SET_REG32_BIT(I2Cx->CR1,I2C_CR1_SWRST); + SET_REG32_BIT(I2Cx->CR1,I2C_CR1_PE); + + /* I2C baudrate config */ + enRet = I2C_BaudrateConfig(I2Cx, pstcI2C_InitStruct, pf32Err); + + if(enRet == Ok) + { + /* Disable global broadcast address function */ + CLEAR_REG32_BIT(I2Cx->CR1,I2C_CR1_ENGC); + + /* Release software reset */ + CLEAR_REG32_BIT(I2Cx->CR1,I2C_CR1_SWRST); + /* Disable I2C peripheral */ + CLEAR_REG32_BIT(I2Cx->CR1,I2C_CR1_PE); + } + } + + return enRet; +} + +/** + * @brief Enable or disable the specified I2C slave address function + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] u32AddrNum I2C address 0 or address 1 @ref I2C_Address_Num + * This parameter can be one of the following values: + * @arg I2C_ADDR_0 + * @arg I2C_ADDR_1 + * @param [in] enNewState New state of the I2Cx function, + * @ref en_functional_state_t + * @retval None + */ +void I2C_SlaveAddrCmd(M4_I2C_TypeDef* I2Cx, uint32_t u32AddrNum, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + DDL_ASSERT(IS_VALID_ADDR_NUM(u32AddrNum)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + __IO uint32_t* pu32SLRx = (__IO uint32_t*)((uint32_t)&I2Cx->SLR0 + u32AddrNum * 4UL); + + if(Enable == enNewState) + { + SET_REG32_BIT(*pu32SLRx, I2C_SLR0_SLADDR0EN); + } + else + { + CLEAR_REG32_BIT(*pu32SLRx, I2C_SLR0_SLADDR0EN); + } +} + +/** + * @brief I2C slave address config + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] u32AddrNum I2C address 0 or address 1 @ref I2C_Address_Num + * This parameter can be one of the following values: + * @arg I2C_ADDR_0 + * @arg I2C_ADDR_1 + * @param [in] u32AddrMode Address mode configuration,@ref I2C_Addr_Config + * This parameter can be one of the following values: + * @arg I2C_ADDR_MODE_7BIT + * @arg I2C_ADDR_MODE_10BIT + * @param [in] u32Addr The slave address + * @retval None + */ +void I2C_SlaveAddrConfig(M4_I2C_TypeDef* I2Cx, uint32_t u32AddrNum, uint32_t u32AddrMode, uint32_t u32Addr) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + DDL_ASSERT(IS_VALID_ADDR_NUM(u32AddrNum)); + + + __IO uint32_t* pu32SLRx = (__IO uint32_t*)((uint32_t)&I2Cx->SLR0 + u32AddrNum * 4UL); + + if(I2C_ADDR_MODE_10BIT == u32AddrMode) + { + DDL_ASSERT(IS_VALID_10BIT_ADDR(u32Addr)); + MODIFY_REG32(*pu32SLRx, I2C_SLR0_ADDRMOD0 | I2C_SLR0_SLADDR0, u32AddrMode + u32Addr); + } + else + { + DDL_ASSERT(IS_VALID_7BIT_ADDR(u32Addr)); + MODIFY_REG32(*pu32SLRx, I2C_SLR0_ADDRMOD0 | I2C_SLR0_SLADDR0, u32AddrMode + (u32Addr << 1)); + } +} + +/** + * @brief Configure peripheral mode + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] u32Mode This parameter can be one of the following values: + * @arg I2C_MODE_I2C + * @arg I2C_MODE_SMBUS + * @retval None + */ +void I2C_SetMode(M4_I2C_TypeDef* I2Cx, uint32_t u32Mode) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + DDL_ASSERT(IS_VALID_MODE(u32Mode)); + + MODIFY_REG32(I2Cx->CR1, I2C_CR1_SMBUS, u32Mode); +} + +/** + * @brief Enable or disable the specified I2C peripheral + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] enNewState New state of the I2Cx function, + * @ref en_functional_state_t + * @retval None + */ +void I2C_Cmd(M4_I2C_TypeDef* I2Cx, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + MODIFY_REG32(I2Cx->CR1, I2C_CR1_PE, (uint32_t)enNewState << I2C_CR1_PE_POS); +} + +/** + * @brief Enable or disable the I2C fast ack function + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] enNewState New state of the fast ACK function, can be + * Disable or Enable the function + * @retval None + */ +void I2C_FastAckCmd(M4_I2C_TypeDef* I2Cx, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if(Enable == enNewState) + { + CLEAR_REG32_BIT(I2Cx->CR3, I2C_CR3_FACKEN); + } + else + { + SET_REG32_BIT(I2Cx->CR3, I2C_CR3_FACKEN); + } +} + +/** + * @brief Enable or disable the bus wait function + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] enNewState New state of the bus wait function, can be + * Disable or Enable the function + * @retval None + */ +void I2C_BusWaitCmd(M4_I2C_TypeDef* I2Cx, en_functional_state_t enNewState) +{ + uint32_t u32CR4_Reg = ((uint32_t)&I2Cx->CR3) + 4UL; + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if(Enable == enNewState) + { + *(__IO uint32_t *)u32CR4_Reg |= (1UL << 10UL); + } + else + { + *(__IO uint32_t *)u32CR4_Reg &= ~(1UL << 10UL); + } +} + +/** + * @brief I2C SCL high level timeout configuration + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] u16TimeoutH clock timeout period for high level + * @retval None + */ +void I2C_ClkHighTimeoutConfig(M4_I2C_TypeDef* I2Cx, uint16_t u16TimeoutH) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + + CLEAR_REG32_BIT(I2Cx->SLTR, I2C_SLTR_TOUTHIGH); + SET_REG32_BIT(I2Cx->SLTR, ((uint32_t)u16TimeoutH << 16U)); +} + +/** + * @brief I2C SCL low level timeout configuration + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] u16TimeoutL clock timeout period for low level + * @retval None + */ +void I2C_ClkLowTimeoutConfig(M4_I2C_TypeDef* I2Cx, uint16_t u16TimeoutL) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + + CLEAR_REG32_BIT(I2Cx->SLTR, I2C_SLTR_TOUTLOW); + SET_REG32_BIT(I2Cx->SLTR, u16TimeoutL); +} + +/** + * @brief Enable or disable I2C SCL high level timeout function + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] enNewState New state of the I2C SCL high level timeout function, + * can be Disable or Enable the function + * @retval None + */ +void I2C_ClkHighTimeoutCmd(M4_I2C_TypeDef* I2Cx, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if(Enable == enNewState) + { + SET_REG32_BIT(I2Cx->CR3, I2C_CR3_HTMOUT); + } + else + { + CLEAR_REG32_BIT(I2Cx->CR3, I2C_CR3_HTMOUT); + } +} + +/** + * @brief Enable or disable I2C SCL low level timeout function + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] enNewState New state of the I2C SCL low level timeout function + * can be Disable or Enable the function + * @retval None + */ +void I2C_ClkLowTimeoutCmd(M4_I2C_TypeDef* I2Cx, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if(Enable == enNewState) + { + SET_REG32_BIT(I2Cx->CR3, I2C_CR3_LTMOUT); + } + else + { + CLEAR_REG32_BIT(I2Cx->CR3, I2C_CR3_LTMOUT); + } +} + +/** + * @brief Enable or disable I2C SCL timeout function + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] enNewState New state of the I2C SCL timeout function, can be + * Disable or Enable the function + * @retval None + */ +void I2C_ClkTimeoutCmd(M4_I2C_TypeDef* I2Cx, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if(Enable == enNewState) + { + SET_REG32_BIT(I2Cx->CR3, I2C_CR3_TMOUTEN); + } + else + { + CLEAR_REG32_BIT(I2Cx->CR3, I2C_CR3_TMOUTEN); + } +} + +/** + * @brief Config I2C SMBUS address match function + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] u32SmbusConfig Indicate the SMBUS address match function configuration. + * This parameter can be one or any combination of the following values: + * @ref I2C_Smbus_Match_Cfg + * @arg I2C_SMBUS_MATCH_ALRT : Smbus alarm address + * @arg I2C_SMBUS_MATCH_DEFAULT : Smbus default address + * @arg I2C_SMBUS_MATCH_HOST : Smbus host address address + * @param [in] enNewState New state of the I2Cx SMBUS match config, + * @ref en_functional_state_t + * @retval None + */ +void I2C_SmbusConfig(M4_I2C_TypeDef* I2Cx, uint32_t u32SmbusConfig, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + DDL_ASSERT(IS_VALID_SMBUS_CONFIG(u32SmbusConfig)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if(Enable == enNewState) + { + SET_REG32_BIT(I2Cx->CR1, u32SmbusConfig); + } + else + { + CLEAR_REG32_BIT(I2Cx->CR1, u32SmbusConfig); + } +} + +/** + * @brief Config I2C digital filter mode + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] u32DigFilterMode Chose the digital filter mode, + * @ref I2C_Digital_Filter_mode + * This parameter can be one of the following values: + * @arg I2C_DIG_FILTMODE_1CYCLE + * @arg I2C_DIG_FILTMODE_2CYCLE + * @arg I2C_DIG_FILTMODE_3CYCLE + * @arg I2C_DIG_FILTMODE_4CYCLE + * @retval None + */ +void I2C_DigitalFilterConfig(M4_I2C_TypeDef* I2Cx, uint32_t u32DigFilterMode) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + DDL_ASSERT(IS_VALID_DIGITAL_FILTER(u32DigFilterMode)); + + MODIFY_REG32(I2Cx->FLTR, I2C_FLTR_DNF, u32DigFilterMode); +} + +/** + * @brief Enable or disable I2C digital filter function + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] enNewState New state of the I2Cx function, + * @ref en_functional_state_t + * @retval None + */ +void I2C_DigitalFilterCmd(M4_I2C_TypeDef* I2Cx, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + MODIFY_REG32(I2Cx->FLTR, I2C_FLTR_DNFEN, (uint32_t)enNewState << I2C_FLTR_DNFEN_POS); +} + +/** + * @brief Enable or disable I2C analog filter function + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] enNewState New state of the I2Cx function, + * @ref en_functional_state_t + * @retval None + */ +void I2C_AnalogFilterCmd(M4_I2C_TypeDef* I2Cx, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + MODIFY_REG32(I2Cx->FLTR, I2C_FLTR_ANFEN, (uint32_t)enNewState << I2C_FLTR_ANFEN_POS); +} + +/** + * @brief Enable or disable I2C general call function + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] enNewState New state of the I2Cx function, + * @ref en_functional_state_t + * @retval None + */ +void I2C_GeneralCallCmd(M4_I2C_TypeDef* I2Cx, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + MODIFY_REG32(I2Cx->CR1, I2C_CR1_ENGC, (uint32_t)enNewState << I2C_CR1_ENGC_POS); +} + +/** + * @brief Generate I2Cx communication start condition + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @retval None + */ +void I2C_GenerateStart(M4_I2C_TypeDef* I2Cx) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + + SET_REG32_BIT(I2Cx->CR1, I2C_CR1_START); +} + +/** + * @brief Generate I2Cx communication restart condition + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @retval None + */ +void I2C_GenerateReStart(M4_I2C_TypeDef* I2Cx) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + + SET_REG32_BIT(I2Cx->CR1, I2C_CR1_RESTART); +} + +/** + * @brief Generate I2Cx communication stop condition + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @retval None + */ +void I2C_GenerateStop(M4_I2C_TypeDef* I2Cx) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + + SET_REG32_BIT(I2Cx->CR1, I2C_CR1_STOP); +} + +/** + * @brief Check whether the specified I2C flag is set or not + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] u32StatusBit specify the flag to check, + * This parameter can be one of the following values: + * @arg I2C_SR_STARTF : Start condition detected flag + * @arg I2C_SR_SLADDR0F : Address 0 detected flag + * @arg I2C_SR_SLADDR1F : Address 1 detected flag + * @arg I2C_SR_TENDF : Transfer end flag + * @arg I2C_SR_STOPF : Stop condition detected flag + * @arg I2C_SR_RFULLF : Receive buffer full flag + * @arg I2C_SR_TEMPTYF : Transfer buffer empty flag + * @arg I2C_SR_ARLOF : Arbitration fails flag + * @arg I2C_SR_ACKRF : ACK detected flag + * @arg I2C_SR_NACKF : NACK detected flag + * @arg I2C_SR_TMOUTF : Time out detected flag + * @arg I2C_SR_MSL : Master mode flag + * @arg I2C_SR_BUSY : Bus busy status flag + * @arg I2C_SR_TRA : Transfer mode flag + * @arg I2C_SR_GENCALLF : General call detected flag + * @arg I2C_SR_SMBDEFAULTF: Smbus default address detected flag + * @arg I2C_SR_SMBHOSTF : Smbus host address detected flag + * @arg I2C_SR_SMBALRTF : Smbus alarm address detected flag + * @retval The status of the I2C status flag, may be Set or Reset. + */ +en_flag_status_t I2C_GetStatus(const M4_I2C_TypeDef *I2Cx, uint32_t u32StatusBit) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + DDL_ASSERT(IS_VALID_RD_STATUS_BIT(u32StatusBit)); + + return ((0UL != READ_REG32_BIT(I2Cx->SR, u32StatusBit)) ? Set : Reset); +} + +/** + * @brief Clear I2C status flag + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] u32StatusBit Specify the flag to clear, + * This parameter can be any combination of the following values: + * @arg I2C_CLR_STARTFCLR : Start flag clear + * @arg I2C_CLR_SLADDR0FCLR : Address 0 detected flag clear + * @arg I2C_CLR_SLADDR1FCLR : Address 1 detected flag clear + * @arg I2C_CLR_TENDFCLR : Transfer end flag clear + * @arg I2C_CLR_STOPFCLR : Stop flag clear + * @arg I2C_CLR_RFULLFCLR : Receive buffer full flag clear + * @arg I2C_CLR_TEMPTYFCLR : Transfer buffer empty flag clear + * @arg I2C_CLR_ARLOFCLR : Arbitration fails flag clear + * @arg I2C_CLR_NACKFCLR : NACK detected flag clear + * @arg I2C_CLR_TMOUTFCLR : Time out detected flag clear + * @arg I2C_CLR_GENCALLFCLR : General call address detected flag clear + * @arg I2C_CLR_SMBDEFAULTFCLR: Smbus default address detected flag clear + * @arg I2C_CLR_SMBHOSTFCLR : Smbus host address detected flag clear + * @arg I2C_CLR_SMBALRTFCLR : Smbus alarm address detected flag clear + * @retval None + */ +void I2C_ClearStatus(M4_I2C_TypeDef* I2Cx, uint32_t u32StatusBit) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + DDL_ASSERT(IS_VALID_CLEARBIT(u32StatusBit)); + + WRITE_REG32(I2Cx->CLR,u32StatusBit); +} + +/** + * @brief I2C software reset function command + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] enNewState New state of the I2Cx function, + * @ref en_functional_state_t + * @retval None + */ +void I2C_SoftwareResetCmd(M4_I2C_TypeDef* I2Cx, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + MODIFY_REG32(I2Cx->CR1, I2C_CR1_SWRST, (uint32_t)enNewState << I2C_CR1_SWRST_POS); +} + +/** + * @brief Enable or disable the specified I2C interrupts + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] u32IntEn Specify the I2C interrupts sources to be configuration. + * This parameter can be any combination of the following values: + * @arg I2C_CR2_STARTIE : Start flag interrupt + * @arg I2C_CR2_SLADDR0IE : Address 0 detected interrupt + * @arg I2C_CR2_SLADDR1IE : Address 1 detected interrupt + * @arg I2C_CR2_TENDIE : Transfer end interrupt + * @arg I2C_CR2_STOPIE : Stop flag interrupt + * @arg I2C_CR2_RFULLIE : Receive buffer full interrupt + * @arg I2C_CR2_TEMPTYIE : Transfer buffer empty interrupt + * @arg I2C_CR2_ARLOIE : Arbitration fails interrupt + * @arg I2C_CR2_NACKIE : NACK flag detected interrupt + * @arg I2C_CR2_TMOUTIE : Time out detected interrupt + * @arg I2C_CR2_GENCALLIE : General call address detected interrupt + * @arg I2C_CR2_SMBDEFAULTIE : Smbus default address detected interrupt + * @arg I2C_CR2_SMBHOSTIE : Smbus host address detected interrupt + * @arg I2C_CR2_SMBALRTIE : Smbus alarm address detected interrupt + * @param [in] enNewState New state of the I2Cx interrupt function, + * @ref en_functional_state_t + * @retval None + */ +void I2C_IntCmd(M4_I2C_TypeDef* I2Cx, uint32_t u32IntEn, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + DDL_ASSERT(IS_VALID_INT(u32IntEn)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if(Enable == enNewState) + { + SET_REG32_BIT(I2Cx->CR2, u32IntEn); + } + else + { + CLEAR_REG32_BIT(I2Cx->CR2, u32IntEn); + } +} + +/** + * @brief Send data byte + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] u8Data The data to be send + * @retval None + */ +void I2C_WriteDataReg(M4_I2C_TypeDef* I2Cx, uint8_t u8Data) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + + WRITE_REG8(I2Cx->DTR, u8Data); +} + +/** + * @brief Read the most recent received data byte + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @retval The value of the received data + */ +uint8_t I2C_ReadDataReg(const M4_I2C_TypeDef *I2Cx) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + + return READ_REG8(I2Cx->DRR); +} + +/** + * @brief Config I2C ACK status + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] u32AckConfig Ack configuration + * This parameter can be one of the following values: + * @arg I2C_ACK + * @arg I2C_NACK + * @retval None + */ +void I2C_AckConfig(M4_I2C_TypeDef* I2Cx, uint32_t u32AckConfig) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + DDL_ASSERT(IS_VALID_ACK_CONFIG(u32AckConfig)); + + MODIFY_REG32(I2Cx->CR1, I2C_CR1_ACK, u32AckConfig); +} + +/** + * @brief I2Cx Start + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] u32Timeout Maximum count of trying to get a status of a + * flag in status register + * @retval An en_result_t enumeration value: + * - Ok: Start successfully + * - Error: Start unsuccessfully + */ +en_result_t I2C_Start(M4_I2C_TypeDef* I2Cx, uint32_t u32Timeout) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + + en_result_t enRet; + + enRet = I2C_WaitStatus(I2Cx, I2C_SR_BUSY, Reset, u32Timeout); + + if(Ok == enRet) + { + /* generate start signal */ + I2C_GenerateStart(I2Cx); + /* Judge if start success*/ + enRet = I2C_WaitStatus(I2Cx, (I2C_SR_BUSY | I2C_SR_STARTF), Set, u32Timeout); + } + + return enRet; +} + +/** + * @brief I2Cx Restart + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] u32Timeout Maximum count of trying to get a status of a + * flag in status register + * @retval An en_result_t enumeration value: + * - Ok: Restart successfully + * - Error: Restart unsuccessfully + */ +en_result_t I2C_Restart(M4_I2C_TypeDef* I2Cx, uint32_t u32Timeout) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + + en_result_t enRet; + + /* Clear start status flag */ + I2C_ClearStatus(I2Cx, I2C_CLR_STARTFCLR); + /* Send restart condition */ + I2C_GenerateReStart(I2Cx); + /* Judge if start success*/ + enRet = I2C_WaitStatus(I2Cx, (I2C_SR_BUSY | I2C_SR_STARTF), Set, u32Timeout); + + return enRet; +} + +/** + * @brief Send 7bit address + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] u8Addr The address to be sent + * @param [in] u8Dir Transfer direction, + * This parameter can be one of the following values: + * @arg I2C_DIR_TX + * @arg I2C_DIR_RX + * @param [in] u32Timeout Maximum count of trying to get a status of a + * flag in status register + * @retval An en_result_t enumeration value: + * - Ok: Send successfully + * - Error: Send unsuccessfully or NACK received + */ +en_result_t I2C_TransAddr(M4_I2C_TypeDef* I2Cx, uint8_t u8Addr, uint8_t u8Dir, uint32_t u32Timeout) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + DDL_ASSERT(IS_VALID_7BIT_ADDR(u8Addr)); + DDL_ASSERT(IS_VALID_DIR(u8Dir)); + + en_result_t enRet; + + enRet = I2C_WaitStatus(I2Cx, I2C_SR_TEMPTYF, Set, u32Timeout); + + if(Ok == enRet) + { + /* Send I2C address */ + I2C_WriteDataReg(I2Cx, (uint8_t)(u8Addr << 1U) | u8Dir); + + if(I2C_DIR_TX == u8Dir) + { + /* If in master transfer process, wait transfer end */ + enRet = I2C_WaitStatus(I2Cx, I2C_SR_TENDF, Set, u32Timeout); + } + else + { + /* If in master recevie process, wait I2C_SR_TRA changed to recevie */ + enRet = I2C_WaitStatus(I2Cx, I2C_SR_TRA, Reset, u32Timeout); + } + + /* If receive NACK*/ + if(enRet == Ok) + { + if(I2C_GetStatus(I2Cx, I2C_SR_ACKRF) == Set) + { + enRet = Error; + } + } + } + + return enRet; +} + + +/** +* @brief Send 10bit Address +* @param [in] I2Cx Pointer to the I2C peripheral register +* This parameter can be one of the following values: +* @arg M4_I2C1 +* @arg M4_I2C2 +* @arg M4_I2C3 +* @arg M4_I2C4 +* @arg M4_I2C5 +* @arg M4_I2C6 +* @param [in] u16Addr The address to be sent +* @param [in] u8Dir Transfer direction, +* This parameter can be one of the following values: +* @arg I2C_DIR_TX +* @arg I2C_DIR_RX +* @param [in] u32Timeout Maximum count of trying to get a status of a +* flag in status register +* @retval An en_result_t enumeration value: +* - Ok: Send successfully +* - Error: Send unsuccessfully or NACK received +*/ +en_result_t I2C_Trans10BitAddr(M4_I2C_TypeDef* I2Cx, uint16_t u16Addr, uint8_t u8Dir, uint32_t u32Timeout) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + DDL_ASSERT(IS_VALID_10BIT_ADDR(u16Addr)); + DDL_ASSERT(IS_VALID_DIR(u8Dir)); + + en_result_t enRet; + enRet = I2C_WaitStatus(I2Cx, I2C_SR_TEMPTYF, Set, u32Timeout); + if(Ok == enRet) + { + /* Write 11110 + SLA(bit9:8) + W#(1bit) */ + I2C_WriteDataReg(I2Cx, (uint8_t)((u16Addr>>7U) & 0x06U) | 0xF0U | I2C_DIR_TX); + enRet = I2C_WaitStatus(I2Cx, I2C_SR_TENDF, Set, u32Timeout); + + if(Ok == enRet) + { + /* If receive ACK */ + if(I2C_GetStatus(I2Cx, I2C_SR_ACKRF) == Reset) + { + /* Write SLA(bit7:0)*/ + I2C_WriteDataReg(I2Cx, (uint8_t)(u16Addr & 0xFFU)); + enRet = I2C_WaitStatus(I2Cx, I2C_SR_TENDF, Set, u32Timeout); + + if(Ok == enRet) + { + if(I2C_GetStatus(I2Cx, I2C_SR_ACKRF) != Reset) + { + enRet = Error; + } + } + } + else + { + enRet = Error; + } + } + } + + if((u8Dir == I2C_DIR_RX) && (Ok == enRet)) + { + /* Restart */ + I2C_ClearStatus(I2Cx, I2C_CLR_STARTFCLR); + I2C_GenerateReStart(I2Cx); + enRet = I2C_WaitStatus(I2Cx, I2C_SR_STARTF, Set, u32Timeout); + + if(Ok == enRet) + { + /* Write 11110 + SLA(bit9:8) + R(1bit) */ + I2C_WriteDataReg(I2Cx, (uint8_t)((u16Addr>>7U) & 0x06U) | 0xF0U | I2C_DIR_RX); + /* If in master receive process, Need wait TRA flag */ + enRet = I2C_WaitStatus(I2Cx, I2C_SR_TRA, Reset, u32Timeout); + + if(Ok == enRet) + { + /* If receive NACK */ + if(I2C_GetStatus(I2Cx, I2C_SR_ACKRF) != Reset) + { + enRet = Error; + } + } + } + } + + return enRet; +} + +/** + * @brief Send data bytes + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] pau8TxData The data array to be sent + * @param [in] u32Size Number of data in array pau8TxData + * @param [in] u32Timeout Maximum count of trying to get a status of a + * flag in status register + * @retval An en_result_t enumeration value: + * - Ok: Send successfully + * - Error: Send unsuccessfully or NACK received + * - ErrorInvalidParameter: pau8TxData is NULL + */ +en_result_t I2C_TransData(M4_I2C_TypeDef* I2Cx, uint8_t const pau8TxData[], uint32_t u32Size, uint32_t u32Timeout) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + + en_result_t enRet = Ok; + uint32_t u32Cnt = 0UL; + + if(pau8TxData != NULL) + { + while((u32Cnt != u32Size) &&(enRet == Ok)) + { + /* Wait tx buffer empty */ + enRet = I2C_WaitStatus(I2Cx, I2C_SR_TEMPTYF, Set, u32Timeout); + + if(enRet == Ok) + { + /* Send one byte data */ + I2C_WriteDataReg(I2Cx, pau8TxData[u32Cnt]); + /* Wait transfer end */ + enRet = I2C_WaitStatus(I2Cx, I2C_SR_TENDF, Set, u32Timeout); + + /* If receive NACK*/ + if(I2C_GetStatus(I2Cx, I2C_SR_ACKRF) == Set) + { + break; + } + u32Cnt++; + } + } + } + else + { + enRet = ErrorInvalidParameter; + } + + return enRet; +} + +/** + * @brief I2Cx Receive Data + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [out] pau8RxData Array to hold the received data + * @param [in] u32Size Number of data to be received + * @param [in] u32Timeout Maximum count of trying to get a status of a + * flag in status register + * @retval An en_result_t enumeration value: + * - Ok: Receive successfully + * - Error: Receive unsuccessfully + * - ErrorInvalidParameter: pau8RxData is NULL + */ +en_result_t I2C_Receive(M4_I2C_TypeDef* I2Cx, uint8_t pau8RxData[], uint32_t u32Size, uint32_t u32Timeout) +{ + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + + en_result_t enRet = Ok; + + if(pau8RxData != NULL) + { + uint32_t u32FastAckEn = READ_REG32_BIT(I2Cx->CR3, I2C_CR3_FACKEN); + for(uint32_t i=0UL; i= 2UL) && (i == (u32Size - 2UL))) + { + I2C_AckConfig(I2Cx, I2C_NACK); + } + } + else + { + if(i != (u32Size - 1UL)) + { + I2C_AckConfig(I2Cx, I2C_ACK); + } + else + { + I2C_AckConfig(I2Cx, I2C_NACK); + } + } + + if(enRet == Ok) + { + /* read data from register */ + pau8RxData[i] = I2C_ReadDataReg(I2Cx); + } + else + { + break; + } + } + I2C_AckConfig(I2Cx, I2C_ACK); + } + else + { + enRet = ErrorInvalidParameter; + } + + return enRet; +} + +/** + * @brief Master receive data and stop + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] au8RxData Array to hold the received data + * @param [in] u32Size Number of data to be received + * @param [in] u32Timeout Maximum count of trying to get a status of a + * flag in status register + * @retval An en_result_t enumeration value: + * - Ok: Receive successfully + * - Error: Receive or Stop unsuccessfully + * - ErrorInvalidParameter: au8RxData is NULL + */ +en_result_t I2C_MasterReceiveAndStop(M4_I2C_TypeDef* I2Cx, uint8_t au8RxData[], uint32_t u32Size, uint32_t u32Timeout) +{ + en_result_t enRet = Ok; + + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + + if(au8RxData != NULL) + { + uint32_t u32FastAckEn = READ_REG32_BIT(I2Cx->CR3, I2C_CR3_FACKEN); + for(uint32_t i=0UL; i= 2UL) && (i == (u32Size - 2UL))) + { + I2C_AckConfig(I2Cx, I2C_NACK); + } + } + else + { + if(i != (u32Size - 1UL)) + { + I2C_AckConfig(I2Cx, I2C_ACK); + } + else + { + I2C_AckConfig(I2Cx, I2C_NACK); + } + } + + if(enRet == Ok) + { + /* Stop before read last data */ + if(i == (u32Size - 1UL)) + { + I2C_ClearStatus(I2Cx, I2C_SR_STOPF); + I2C_GenerateStop(I2Cx); + } + + /* read data from register */ + au8RxData[i] = I2C_ReadDataReg(I2Cx); + + if(i == (u32Size - 1UL)) + { + /* Wait stop flag after DRR read */ + enRet = I2C_WaitStatus(I2Cx, I2C_SR_STOPF, Set, u32Timeout); + } + } + else + { + break; + } + } + I2C_AckConfig(I2Cx, I2C_ACK); + } + else + { + enRet = ErrorInvalidParameter; + } + + return enRet; +} + + +/** + * @brief I2Cx Stop + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] u32Timeout Maximum count of trying to get a status of a + * flag in status register + * @retval An en_result_t enumeration value: + * - Ok: Stop successfully + * - Error: Stop unsuccessfully + */ +en_result_t I2C_Stop(M4_I2C_TypeDef* I2Cx, uint32_t u32Timeout) +{ + en_result_t enRet; + + DDL_ASSERT(IS_VALID_UNIT(I2Cx)); + + /* Clear stop flag */ + while((Set == I2C_GetStatus(I2Cx, I2C_SR_STOPF)) && (u32Timeout > 0UL)) + { + I2C_ClearStatus(I2Cx, I2C_CLR_STOPFCLR); + u32Timeout--; + } + I2C_GenerateStop(I2Cx); + /* Wait stop flag */ + enRet = I2C_WaitStatus(I2Cx, I2C_SR_STOPF, Set, u32Timeout); + + return enRet; +} +/** + * @} + */ + +/** +* @defgroup I2C_Local_Functions I2C Local Functions +* @{ +*/ + +/** + * @brief Try to wait a status of specified flags + * @param [in] I2Cx Pointer to the I2C peripheral register. + * This parameter can be one of the following values: + * @arg M4_I2C1 + * @arg M4_I2C2 + * @arg M4_I2C3 + * @arg M4_I2C4 + * @arg M4_I2C5 + * @arg M4_I2C6 + * @param [in] u32Flags specify the flags to check + * @param [in] enStatus expected status, + * This parameter can be any combination of the following values: + * @arg I2C_SR_STARTF : Start condition detected flag + * @arg I2C_SR_SLADDR0F : Address 0 detected flag + * @arg I2C_SR_SLADDR1F : Address 1 detected flag + * @arg I2C_SR_TENDF : Transfer end flag + * @arg I2C_SR_STOPF : Stop condition detected flag + * @arg I2C_SR_RFULLF : Receive buffer full flag + * @arg I2C_SR_TEMPTYF : Transfer buffer empty flag + * @arg I2C_SR_ARLOF : Arbitration fails flag + * @arg I2C_SR_ACKRF : ACK detected flag + * @arg I2C_SR_NACKF : NACK detected flag + * @arg I2C_SR_TMOUTF : Time out detected flag + * @arg I2C_SR_MSL : Master mode flag + * @arg I2C_SR_BUSY : Bus busy status flag + * @arg I2C_SR_TRA : Transfer mode flag + * @arg I2C_SR_GENCALLF : General call detected flag + * @arg I2C_SR_SMBDEFAULTF: Smbus default address detected flag + * @arg I2C_SR_SMBHOSTF : Smbus host address detected flag + * @arg I2C_SR_SMBALRTF : Smbus alarm address detected flag + * @param [in] u32Timeout Maximum count of trying to get a status of a + * flag in status register + * @retval Process result + * - Error Failed to get expected status of specified flags + * - Ok successfully gotten the expected status of the specified flags + */ +static en_result_t I2C_WaitStatus(const M4_I2C_TypeDef *I2Cx, uint32_t u32Flags, en_flag_status_t enStatus, uint32_t u32Timeout) +{ + en_result_t enRet = Error; + uint32_t u32RegStatusBit; + + for(;;) + { + u32RegStatusBit = (READ_REG32_BIT(I2Cx->SR, u32Flags)); + if(((enStatus == Set) && (u32Flags == u32RegStatusBit)) + || ((enStatus == Reset) && (0UL == u32RegStatusBit))) + { + enRet = Ok; + } + + if((Ok == enRet) || (0UL == u32Timeout)) + { + break; + } + else + { + u32Timeout--; + } + } + + return enRet; +} + +/** +* @} +*/ + +#endif /* DDL_I2C_ENABLE */ + +/** +* @} +*/ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_i2s.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_i2s.c new file mode 100644 index 0000000000..79b18dc242 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_i2s.c @@ -0,0 +1,1184 @@ +/** + ******************************************************************************* + * @file hc32f4a0_i2s.c + * @brief This file provides firmware functions to manage the Inter IC Sound Bus + * (I2S). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Yangjp First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_i2s.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_I2S I2S + * @brief Inter IC Sound Bus Driver Library + * @{ + */ + +#if (DDL_I2S_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup I2S_Local_Macros I2S Local Macros + * @{ + */ + +/* I2S CTRL register Mask */ +#define I2S_CTRL_CLEAR_MASK (I2S_CTRL_WMS | I2S_CTRL_ODD | I2S_CTRL_MCKOE | \ + I2S_CTRL_TXBIRQWL | I2S_CTRL_RXBIRQWL | I2S_CTRL_I2SPLLSEL | \ + I2S_CTRL_SDOE | I2S_CTRL_LRCKOE | I2S_CTRL_CKOE | \ + I2S_CTRL_DUPLEX | I2S_CTRL_CLKSEL) + +/** + * @defgroup I2S_Check_Parameters_Validity I2S Check Parameters Validity + * @{ + */ +#define IS_I2S_UNIT(x) \ +( ((x) == M4_I2S1) || \ + ((x) == M4_I2S2) || \ + ((x) == M4_I2S3) || \ + ((x) == M4_I2S4)) + +#define IS_I2S_CLK_SRC(x) \ +( ((x) == I2S_CLK_SRC_PLL) || \ + ((x) == I2S_CLK_SRC_EXT)) + +#define IS_I2S_MD(x) \ +( ((x) == I2S_MD_MASTER) || \ + ((x) == I2S_MD_SLAVE)) + +#define IS_I2S_COM_PROTOCOL(x) \ +( ((x) == I2S_COM_PROTOCOL_PHILLIPS) || \ + ((x) == I2S_COM_PROTOCOL_MSB) || \ + ((x) == I2S_COM_PROTOCOL_LSB) || \ + ((x) == I2S_COM_PROTOCOL_PCM_SHORT) || \ + ((x) == I2S_COM_PROTOCOL_PCM_LONG)) + +#define IS_I2S_TRANS_MD(x) \ +( ((x) == I2S_TRANS_MD_HALF_DUPLEX_RX) || \ + ((x) == I2S_TRANS_MD_HALF_DUPLEX_TX) || \ + ((x) == I2S_TRANS_MD_FULL_DUPLEX)) + +#define IS_I2S_AUDIO_FREQ(x) \ +( ((x) == I2S_AUDIO_FREQ_DEFAULT) || \ + (((x) >= I2S_AUDIO_FREQ_8K) && ((x) <= I2S_AUDIO_FREQ_192K))) + +#define IS_I2S_CH_LEN(x) \ +( ((x) == I2S_CH_LEN_16BIT) || \ + ((x) == I2S_CH_LEN_32BIT)) + +#define IS_I2S_DATA_LEN(x) \ +( ((x) == I2S_DATA_LEN_16BIT) || \ + ((x) == I2S_DATA_LEN_24BIT) || \ + ((x) == I2S_DATA_LEN_32BIT)) + +#define IS_I2S_MCK_OUTPUT(x) \ +( ((x) == I2S_MCK_OUTPUT_DISABLE) || \ + ((x) == I2S_MCK_OUTPUT_ENABLE)) + +#define IS_I2S_TRANS_LVL(x) \ +( ((x) == I2S_TRANS_LVL0) || \ + ((x) == I2S_TRANS_LVL1) || \ + ((x) == I2S_TRANS_LVL2) || \ + ((x) == I2S_TRANS_LVL3) || \ + ((x) == I2S_TRANS_LVL4)) + +#define IS_I2S_RECEIVE_LVL(x) \ +( ((x) == I2S_RECEIVE_LVL0) || \ + ((x) == I2S_RECEIVE_LVL1) || \ + ((x) == I2S_RECEIVE_LVL2) || \ + ((x) == I2S_RECEIVE_LVL3) || \ + ((x) == I2S_RECEIVE_LVL4)) + +#define IS_I2S_FUNC(x) \ +( ((x) != 0U) && \ + (((x) | I2S_FUNC_ALL) == I2S_FUNC_ALL)) + +#define IS_I2S_RST_TYPE(x) \ +( ((x) != 0U) && \ + (((x) | I2S_RST_TYPE_ALL) == I2S_RST_TYPE_ALL)) + +#define IS_I2S_INT(x) \ +( ((x) != 0U) && \ + (((x) | I2S_INT_ALL) == I2S_INT_ALL)) + +#define IS_I2S_FLAG(x) \ +( ((x) != 0U) && \ + (((x) | I2S_FLAG_ALL) == I2S_FLAG_ALL)) + +#define IS_I2S_CLR_FLAG(x) \ +( ((x) != 0U) && \ + (((x) | I2S_CLR_FLAG_ALL) == I2S_CLR_FLAG_ALL)) + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ +static uint32_t I2S_GetClockFreq(const M4_I2S_TypeDef *I2Sx); +static en_result_t I2S_WaitStatus(const M4_I2S_TypeDef *I2Sx, uint32_t u32Flag, en_flag_status_t enStatus, uint32_t u32Timeout); + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup I2S_Global_Functions I2S Global Functions + * @{ + */ + +/** + * @brief De-Initialize I2S. + * @param [in] I2Sx Pointer to I2S instance register base + * This parameter can be one of the following values: + * @arg M4_I2S1: I2S unit 1 instance register base + * @arg M4_I2S2: I2S unit 2 instance register base + * @arg M4_I2S3: I2S unit 3 instance register base + * @arg M4_I2S4: I2S unit 4 instance register base + * @retval None + */ +void I2S_DeInit(M4_I2S_TypeDef *I2Sx) +{ + /* Check parameters */ + DDL_ASSERT(IS_I2S_UNIT(I2Sx)); + + /* Reset all registers of I2S */ + WRITE_REG32(I2Sx->CTRL, 0x00004400UL); + WRITE_REG32(I2Sx->ER, 0x00000003UL); + WRITE_REG32(I2Sx->CFGR, 0x00000000UL); + WRITE_REG32(I2Sx->PR, 0x00000002UL); + SET_REG32_BIT(I2Sx->CTRL, I2S_RST_TYPE_ALL); + CLEAR_REG32_BIT(I2Sx->CTRL, I2S_RST_TYPE_ALL); +} + +/** + * @brief Initialize I2S. + * @param [in] I2Sx Pointer to I2S instance register base + * This parameter can be one of the following values: + * @arg M4_I2S1: I2S unit 1 instance register base + * @arg M4_I2S2: I2S unit 2 instance register base + * @arg M4_I2S3: I2S unit 3 instance register base + * @arg M4_I2S4: I2S unit 4 instance register base + * @param [in] pstcI2sInit Pointer to a @ref stc_i2s_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: Invalid parameter + * - Error: Initialize failed + */ +en_result_t I2S_Init(M4_I2S_TypeDef *I2Sx, const stc_i2s_init_t *pstcI2sInit) +{ + en_result_t enRet = Ok; + uint32_t u32I2sClk; + uint32_t u32Temp; + uint32_t u32I2sDiv = 2UL; + uint32_t u32I2sOdd = 0UL; + uint32_t u32ChLen; + + if (NULL == pstcI2sInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_I2S_UNIT(I2Sx)); + DDL_ASSERT(IS_I2S_CLK_SRC(pstcI2sInit->u32ClockSrc)); + DDL_ASSERT(IS_I2S_MD(pstcI2sInit->u32Mode)); + DDL_ASSERT(IS_I2S_COM_PROTOCOL(pstcI2sInit->u32ComProtocol)); + DDL_ASSERT(IS_I2S_TRANS_MD(pstcI2sInit->u32TransMode)); + DDL_ASSERT(IS_I2S_AUDIO_FREQ(pstcI2sInit->u32AudioFreq)); + DDL_ASSERT(IS_I2S_CH_LEN(pstcI2sInit->u32ChLen)); + DDL_ASSERT(IS_I2S_DATA_LEN(pstcI2sInit->u32DataLen)); + DDL_ASSERT(IS_I2S_MCK_OUTPUT(pstcI2sInit->u32MCKOutput)); + DDL_ASSERT(IS_I2S_TRANS_LVL(pstcI2sInit->u32TransFIFOLevel)); + DDL_ASSERT(IS_I2S_RECEIVE_LVL(pstcI2sInit->u32ReceiveFIFOLevel)); + + if (I2S_AUDIO_FREQ_DEFAULT != pstcI2sInit->u32AudioFreq) + { + /* Get I2S source Clock frequency */ + if (I2S_CLK_SRC_EXT == pstcI2sInit->u32ClockSrc) + { + /* If an external I2S clock has to be used, this define + should be set in the ddl_config.h file */ + u32I2sClk = I2S_EXT_CLK_FREQ; + } + else + { + u32I2sClk = I2S_GetClockFreq(I2Sx); + } + + /* The actual frequency division value is calculated according to the output state of MCK */ + if (I2S_CH_LEN_16BIT != pstcI2sInit->u32ChLen) + { + u32ChLen = 32UL; + } + else + { + u32ChLen = 16UL; + } + + if (I2S_MCK_OUTPUT_ENABLE == pstcI2sInit->u32MCKOutput) + { + if (I2S_CH_LEN_16BIT != pstcI2sInit->u32ChLen) + { + u32Temp = (((u32I2sClk / (u32ChLen*2U * 4U)) * 10U) / pstcI2sInit->u32AudioFreq) + 5U; + } + else + { + u32Temp = (((u32I2sClk / (u32ChLen*2U * 8U)) * 10U) / pstcI2sInit->u32AudioFreq) + 5U; + } + } + else + { + u32Temp = (((u32I2sClk / (u32ChLen*2U)) * 10U) / pstcI2sInit->u32AudioFreq) + 5U; + } + u32Temp = u32Temp / 10U; + u32I2sOdd = u32Temp & 0x01U; + u32I2sDiv = (u32Temp - u32I2sOdd) / 2U; + } + + if ((u32I2sDiv < 2U) || (u32I2sDiv > 0xFFU)) + { + /* Set the default values */ + u32I2sOdd = 0U; + u32I2sDiv = 2U; + enRet = Error; + } + + u32Temp = pstcI2sInit->u32ClockSrc | pstcI2sInit->u32Mode | + pstcI2sInit->u32ComProtocol | pstcI2sInit->u32TransMode | + pstcI2sInit->u32ChLen | pstcI2sInit->u32DataLen | + pstcI2sInit->u32MCKOutput | pstcI2sInit->u32TransFIFOLevel | + pstcI2sInit->u32ReceiveFIFOLevel | (u32I2sOdd << I2S_CTRL_ODD_POS); + if (I2S_MD_MASTER == pstcI2sInit->u32Mode) + { + u32Temp |= (I2S_CTRL_CKOE | I2S_CTRL_LRCKOE); + } + /* Set I2S_CFGR register */ + WRITE_REG32(I2Sx->CFGR, (pstcI2sInit->u32ComProtocol | pstcI2sInit->u32ChLen | pstcI2sInit->u32DataLen)); + /* set I2S_PR register */ + WRITE_REG32(I2Sx->PR, u32I2sDiv); + /* Set I2S_CTRL register */ + MODIFY_REG32(I2Sx->CTRL, I2S_CTRL_CLEAR_MASK, u32Temp); + } + + return enRet; +} + +/** + * @brief Fills each stc_i2s_init_t member with default value. + * @param [out] pstcI2sInit Pointer to a @ref stc_i2s_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: stc_i2s_init_t member initialize success + * - ErrorInvalidParameter: Invalid parameter + */ +en_result_t I2S_StructInit(stc_i2s_init_t *pstcI2sInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcI2sInit) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcI2sInit->u32ClockSrc = I2S_CLK_SRC_PLL; + pstcI2sInit->u32Mode = I2S_MD_MASTER; + pstcI2sInit->u32ComProtocol = I2S_COM_PROTOCOL_PHILLIPS; + pstcI2sInit->u32TransMode = I2S_TRANS_MD_HALF_DUPLEX_RX; + pstcI2sInit->u32AudioFreq = I2S_AUDIO_FREQ_DEFAULT; + pstcI2sInit->u32ChLen = I2S_CH_LEN_16BIT; + pstcI2sInit->u32DataLen = I2S_DATA_LEN_16BIT; + pstcI2sInit->u32MCKOutput = I2S_MCK_OUTPUT_DISABLE; + pstcI2sInit->u32TransFIFOLevel = I2S_TRANS_LVL2; + pstcI2sInit->u32ReceiveFIFOLevel = I2S_RECEIVE_LVL2; + } + + return enRet; +} + +/** + * @brief Set the software reset of I2S. + * @param [in] I2Sx Pointer to I2S instance register base + * This parameter can be one of the following values: + * @arg M4_I2S1: I2S unit 1 instance register base + * @arg M4_I2S2: I2S unit 2 instance register base + * @arg M4_I2S3: I2S unit 3 instance register base + * @arg M4_I2S4: I2S unit 4 instance register base + * @param [in] u32ResetType Software reset type + * This parameter can be one or any combination of the following values: + * @arg I2S_RST_TYPE_SW: I2S software reset + * @arg I2S_RST_TYPE_CODEC: Reset codec of I2S + * @arg I2S_RST_TYPE_FIFO: Reset FIFO of I2S + * @arg I2S_RST_TYPE_ALL: All of the above + * @retval None + */ +void I2S_SetSWReset(M4_I2S_TypeDef *I2Sx, uint32_t u32ResetType) +{ + /* Check parameters */ + DDL_ASSERT(IS_I2S_UNIT(I2Sx)); + DDL_ASSERT(IS_I2S_RST_TYPE(u32ResetType)); + + SET_REG32_BIT(I2Sx->CTRL, u32ResetType); + CLEAR_REG32_BIT(I2Sx->CTRL, u32ResetType); +} + +/** + * @brief Set the transfer mode for the I2S communication. + * @param [in] I2Sx Pointer to I2S instance register base + * This parameter can be one of the following values: + * @arg M4_I2S1: I2S unit 1 instance register base + * @arg M4_I2S2: I2S unit 2 instance register base + * @arg M4_I2S3: I2S unit 3 instance register base + * @arg M4_I2S4: I2S unit 4 instance register base + * @param [in] u32Mode Transfer mode + * This parameter can be one of the following values: + * @arg I2S_TRANS_MD_HALF_DUPLEX_RX: Receive only and half duplex mode + * @arg I2S_TRANS_MD_HALF_DUPLEX_TX: Send only and half duplex mode + * @arg I2S_TRANS_MD_FULL_DUPLEX: Full duplex mode + * @retval None + */ +void I2S_SetTransMode(M4_I2S_TypeDef *I2Sx, uint32_t u32Mode) +{ + /* Check parameters */ + DDL_ASSERT(IS_I2S_UNIT(I2Sx)); + DDL_ASSERT(IS_I2S_TRANS_MD(u32Mode)); + + MODIFY_REG32(I2Sx->CTRL, (I2S_CTRL_DUPLEX | I2S_CTRL_SDOE), u32Mode); +} + +/** + * @brief Set the transfer FIFO level of I2S. + * @param [in] I2Sx Pointer to I2S instance register base + * This parameter can be one of the following values: + * @arg M4_I2S1: I2S unit 1 instance register base + * @arg M4_I2S2: I2S unit 2 instance register base + * @arg M4_I2S3: I2S unit 3 instance register base + * @arg M4_I2S4: I2S unit 4 instance register base + * @param [in] u32Level Transfer FIFO level + * This parameter can be one of the following values: + * @arg I2S_TRANS_LVL0: Transfer FIFO level is 0 + * @arg I2S_TRANS_LVL1: Transfer FIFO level is 1 + * @arg I2S_TRANS_LVL2: Transfer FIFO level is 2 + * @arg I2S_TRANS_LVL3: Transfer FIFO level is 3 + * @arg I2S_TRANS_LVL4: Transfer FIFO level is 4 + * @retval None + */ +void I2S_SetTransFIFOLevel(M4_I2S_TypeDef *I2Sx, uint32_t u32Level) +{ + /* Check parameters */ + DDL_ASSERT(IS_I2S_UNIT(I2Sx)); + DDL_ASSERT(IS_I2S_TRANS_LVL(u32Level)); + + MODIFY_REG32(I2Sx->CTRL, I2S_CTRL_TXBIRQWL, u32Level); +} + +/** + * @brief Set the receive FIFO level of I2S. + * @param [in] I2Sx Pointer to I2S instance register base + * This parameter can be one of the following values: + * @arg M4_I2S1: I2S unit 1 instance register base + * @arg M4_I2S2: I2S unit 2 instance register base + * @arg M4_I2S3: I2S unit 3 instance register base + * @arg M4_I2S4: I2S unit 4 instance register base + * @param [in] u32Level Receive FIFO level + * This parameter can be one of the following values: + * @arg I2S_RECEIVE_LVL0: Receive FIFO level is 0 + * @arg I2S_RECEIVE_LVL1: Receive FIFO level is 1 + * @arg I2S_RECEIVE_LVL2: Receive FIFO level is 2 + * @arg I2S_RECEIVE_LVL3: Receive FIFO level is 3 + * @arg I2S_RECEIVE_LVL4: Receive FIFO level is 4 + * @retval None + */ +void I2S_SetReceiveFIFOLevel(M4_I2S_TypeDef *I2Sx, uint32_t u32Level) +{ + /* Check parameters */ + DDL_ASSERT(IS_I2S_UNIT(I2Sx)); + DDL_ASSERT(IS_I2S_RECEIVE_LVL(u32Level)); + + MODIFY_REG32(I2Sx->CTRL, I2S_CTRL_RXBIRQWL, u32Level); +} + +/** + * @brief Set the communication protocol of I2S. + * @param [in] I2Sx Pointer to I2S instance register base + * This parameter can be one of the following values: + * @arg M4_I2S1: I2S unit 1 instance register base + * @arg M4_I2S2: I2S unit 2 instance register base + * @arg M4_I2S3: I2S unit 3 instance register base + * @arg M4_I2S4: I2S unit 4 instance register base + * @param [in] u32Protocol Communication protocol + * This parameter can be one of the following values: + * @arg I2S_COM_PROTOCOL_PHILLIPS: Phillips protocol + * @arg I2S_COM_PROTOCOL_MSB: MSB justified protocol + * @arg I2S_COM_PROTOCOL_LSB: LSB justified protocol + * @arg I2S_COM_PROTOCOL_PCM_SHORT: PCM short-frame protocol + * @arg I2S_COM_PROTOCOL_PCM_LONG: PCM long-frame protocol + * @retval None + */ +void I2S_SetComProtocol(M4_I2S_TypeDef *I2Sx, uint32_t u32Protocol) +{ + /* Check parameters */ + DDL_ASSERT(IS_I2S_UNIT(I2Sx)); + DDL_ASSERT(IS_I2S_COM_PROTOCOL(u32Protocol)); + + MODIFY_REG32(I2Sx->CFGR, (I2S_CFGR_I2SSTD | I2S_CFGR_PCMSYNC), u32Protocol); +} + +/** + * @brief Set the audio frequency for the I2S communication. + * @param [in] I2Sx Pointer to I2S instance register base + * This parameter can be one of the following values: + * @arg M4_I2S1: I2S unit 1 instance register base + * @arg M4_I2S2: I2S unit 2 instance register base + * @arg M4_I2S3: I2S unit 3 instance register base + * @arg M4_I2S4: I2S unit 4 instance register base + * @param [in] u32Freq Audio frequency + * This parameter can be 'I2S_AUDIO_FREQ_DEFAULT' or between + * 'I2S_AUDIO_FREQ_8K' and 'I2S_AUDIO_FREQ_192K': + * @arg I2S_AUDIO_FREQ_192K: FS = 192000Hz + * @arg I2S_AUDIO_FREQ_8K: FS = 8000Hz + * @arg I2S_AUDIO_FREQ_DEFAULT + * @retval An en_result_t enumeration value: + * - Ok: Set success + * - Error: Set failed + */ +en_result_t I2S_SetAudioFreq(M4_I2S_TypeDef *I2Sx, uint32_t u32Freq) +{ + en_result_t enRet = Ok; + uint32_t u32I2sClk; + uint32_t u32Temp; + uint32_t u32I2sDiv = 2UL; + uint32_t u32I2sOdd = 0UL; + uint32_t u32ChLen; + + /* Check parameters */ + DDL_ASSERT(IS_I2S_UNIT(I2Sx)); + DDL_ASSERT(IS_I2S_AUDIO_FREQ(u32Freq)); + + if (I2S_AUDIO_FREQ_DEFAULT != u32Freq) + { + /* Get I2S source Clock frequency */ + if (I2S_CLK_SRC_EXT == READ_REG32_BIT(I2Sx->CTRL, I2S_CTRL_CLKSEL)) + { + /* If an external I2S clock has to be used, this define + should be set in the ddl_config.h file */ + u32I2sClk = I2S_EXT_CLK_FREQ; + } + else + { + u32I2sClk = I2S_GetClockFreq(I2Sx); + } + + /* The actual frequency division value is calculated according to the output state of MCK */ + if (I2S_CH_LEN_16BIT != READ_REG32_BIT(I2Sx->CFGR, I2S_CFGR_CHLEN)) + { + u32ChLen = 32UL; + } + else + { + u32ChLen = 16UL; + } + + if (I2S_MCK_OUTPUT_ENABLE == READ_REG32_BIT(I2Sx->CTRL, I2S_CTRL_MCKOE)) + { + if (I2S_CH_LEN_16BIT != READ_REG32_BIT(I2Sx->CFGR, I2S_CFGR_CHLEN)) + { + u32Temp = (((u32I2sClk / (u32ChLen*2U * 4U)) * 10U) / u32Freq) + 5U; + } + else + { + u32Temp = (((u32I2sClk / (u32ChLen*2U * 8U)) * 10U) / u32Freq) + 5U; + } + } + else + { + u32Temp = (((u32I2sClk / (u32ChLen*2U)) * 10U) / u32Freq) + 5U; + } + u32Temp = u32Temp / 10U; + u32I2sOdd = u32Temp & 0x01U; + u32I2sDiv = (u32Temp - u32I2sOdd) / 2U; + } + + if ((u32I2sDiv < 2U) || (u32I2sDiv > 0xFFU)) + { + enRet = Error; + } + else + { + /* Set clock division */ + WRITE_REG32(I2Sx->PR, u32I2sDiv); + MODIFY_REG32(I2Sx->CTRL, I2S_CTRL_ODD, (u32I2sOdd << I2S_CTRL_ODD_POS)); + } + + return enRet; +} + +/** + * @brief Enable or disable MCK clock output. + * @param [in] I2Sx Pointer to I2S instance register base + * This parameter can be one of the following values: + * @arg M4_I2S1: I2S unit 1 instance register base + * @arg M4_I2S2: I2S unit 2 instance register base + * @arg M4_I2S3: I2S unit 3 instance register base + * @arg M4_I2S4: I2S unit 4 instance register base + * @param [in] enNewState The function new state + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void I2S_MCKOutputCmd(M4_I2S_TypeDef *I2Sx, en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_I2S_UNIT(I2Sx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Disable != enNewState) + { + SET_REG32_BIT(I2Sx->CTRL, I2S_CTRL_MCKOE); + } + else + { + CLEAR_REG32_BIT(I2Sx->CTRL, I2S_CTRL_MCKOE); + } +} + +/** + * @brief Enable or disable the function of I2S. + * @param [in] I2Sx Pointer to I2S instance register base + * This parameter can be one of the following values: + * @arg M4_I2S1: I2S unit 1 instance register base + * @arg M4_I2S2: I2S unit 2 instance register base + * @arg M4_I2S3: I2S unit 3 instance register base + * @arg M4_I2S4: I2S unit 4 instance register base + * @param [in] u32Func I2S function + * This parameter can be one or any combination of the following values: + * @arg I2S_FUNC_TXE: Transfer function + * @arg I2S_FUNC_RXE: Receive function + * @arg I2S_FUNC_ALL: All of the above + * @param [in] enNewState The function new state + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void I2S_FuncCmd(M4_I2S_TypeDef* I2Sx, uint32_t u32Func, en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_I2S_UNIT(I2Sx)); + DDL_ASSERT(IS_I2S_FUNC(u32Func)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Disable != enNewState) + { + SET_REG32_BIT(I2Sx->CTRL, u32Func); + } + else + { + CLEAR_REG32_BIT(I2Sx->CTRL, u32Func); + } +} + +/** + * @brief I2S send data. + * @param [in] I2Sx Pointer to I2S instance register base + * This parameter can be one of the following values: + * @arg M4_I2S1: I2S unit 1 instance register base + * @arg M4_I2S2: I2S unit 2 instance register base + * @arg M4_I2S3: I2S unit 3 instance register base + * @arg M4_I2S4: I2S unit 4 instance register base + * @param [in] u32Data Send data + * @retval None + */ +void I2S_WriteData(M4_I2S_TypeDef *I2Sx, uint32_t u32Data) +{ + /* Check parameters */ + DDL_ASSERT(IS_I2S_UNIT(I2Sx)); + + WRITE_REG32(I2Sx->TXBUF, u32Data); +} + +/** + * @brief I2S receive data. + * @param [in] I2Sx Pointer to I2S instance register base + * This parameter can be one of the following values: + * @arg M4_I2S1: I2S unit 1 instance register base + * @arg M4_I2S2: I2S unit 2 instance register base + * @arg M4_I2S3: I2S unit 3 instance register base + * @arg M4_I2S4: I2S unit 4 instance register base + * @retval uint32_t Receive data + */ +uint32_t I2S_ReadData(const M4_I2S_TypeDef *I2Sx) +{ + /* Check parameters */ + DDL_ASSERT(IS_I2S_UNIT(I2Sx)); + + return READ_REG32(I2Sx->RXBUF); +} + +/** + * @brief I2S transmit data in polling mode. + * @param [in] I2Sx Pointer to I2S instance register base + * This parameter can be one of the following values: + * @arg M4_I2S1: I2S unit 1 instance register base + * @arg M4_I2S2: I2S unit 2 instance register base + * @arg M4_I2S3: I2S unit 3 instance register base + * @arg M4_I2S4: I2S unit 4 instance register base + * @param [in] pvTxBuf The pointer to data transmitted buffer + * @param [in] u32Len Data length + * @param [in] u32Timeout Transfer timeout(ms) + * @retval An en_result_t enumeration value: + * - Ok: Transmit data success + * - ErrorInvalidParameter: Invalid parameter + * - ErrorTimeout: Transmission timeout + */ +en_result_t I2S_Trans(M4_I2S_TypeDef *I2Sx, const void *pvTxBuf, uint32_t u32Len, uint32_t u32Timeout) +{ + en_result_t enRet = Ok; + uint32_t i; + uint32_t u32DataWidth; + + if ((NULL == pvTxBuf) || (0UL == u32Len)) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_I2S_UNIT(I2Sx)); + + u32DataWidth = READ_REG32_BIT(I2Sx->CFGR, I2S_CFGR_DATLEN); + if (((I2S_DATA_LEN_16BIT == u32DataWidth) && IS_ADDRESS_ALIGN_HALFWORD(pvTxBuf)) || + (IS_ADDRESS_ALIGN_WORD(pvTxBuf))) + { + for (i = 0UL; i < u32Len; i++) + { + enRet = I2S_WaitStatus(I2Sx, I2S_FLAG_TX_FULL, Reset, u32Timeout); + if (Ok != enRet) + { + break; + } + + if (I2S_DATA_LEN_16BIT == u32DataWidth) + { + WRITE_REG32(I2Sx->TXBUF, ((const uint16_t *)pvTxBuf)[i]); + } + else + { + WRITE_REG32(I2Sx->TXBUF, ((const uint32_t *)pvTxBuf)[i]); + } + } + } + else + { + enRet = ErrorInvalidParameter; + } + } + + return enRet; +} + +/** + * @brief I2S receive data in polling mode. + * @param [in] I2Sx Pointer to I2S instance register base + * This parameter can be one of the following values: + * @arg M4_I2S1: I2S unit 1 instance register base + * @arg M4_I2S2: I2S unit 2 instance register base + * @arg M4_I2S3: I2S unit 3 instance register base + * @arg M4_I2S4: I2S unit 4 instance register base + * @param [in] pvRxBuf The pointer to data received buffer + * @param [in] u32Len Data length + * @param [in] u32Timeout Transfer timeout(ms) + * @retval An en_result_t enumeration value: + * - Ok: Receive data success + * - ErrorInvalidParameter: Invalid parameter + * - ErrorTimeout: Transmission timeout + */ +en_result_t I2S_Receive(const M4_I2S_TypeDef *I2Sx, void *pvRxBuf, uint32_t u32Len, uint32_t u32Timeout) +{ + en_result_t enRet = Ok; + uint32_t i; + uint32_t u32DataWidth; + uint32_t u32Temp; + + if ((NULL == pvRxBuf) || (0UL == u32Len)) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_I2S_UNIT(I2Sx)); + + u32DataWidth = READ_REG32_BIT(I2Sx->CFGR, I2S_CFGR_DATLEN); + if (((I2S_DATA_LEN_16BIT == u32DataWidth) && IS_ADDRESS_ALIGN_HALFWORD(pvRxBuf)) || + (IS_ADDRESS_ALIGN_WORD(pvRxBuf))) + { + for (i = 0UL; i < u32Len; i++) + { + enRet = I2S_WaitStatus(I2Sx, I2S_FLAG_RX_EMPTY, Reset, u32Timeout); + if (Ok != enRet) + { + break; + } + + u32Temp = READ_REG32(I2Sx->RXBUF); + if (I2S_DATA_LEN_16BIT == u32DataWidth) + { + ((uint16_t *)pvRxBuf)[i] = (uint16_t)(u32Temp & 0xFFFFUL); + } + else if (I2S_DATA_LEN_24BIT == u32DataWidth) + { + ((uint32_t *)pvRxBuf)[i] = u32Temp & 0xFFFFFFUL; + } + else + { + ((uint32_t *)pvRxBuf)[i] = u32Temp; + } + } + } + else + { + enRet = ErrorInvalidParameter; + } + } + + return enRet; +} + +/** + * @brief I2S transmit and receive data in polling mode. + * @param [in] I2Sx Pointer to I2S instance register base + * This parameter can be one of the following values: + * @arg M4_I2S1: I2S unit 1 instance register base + * @arg M4_I2S2: I2S unit 2 instance register base + * @arg M4_I2S3: I2S unit 3 instance register base + * @arg M4_I2S4: I2S unit 4 instance register base + * @param [in] pvTxBuf The pointer to data transmitted buffer + * @param [in] pvRxBuf The pointer to data received buffer + * @param [in] u32Len Data length + * @param [in] u32Timeout Transfer timeout(ms) + * @retval An en_result_t enumeration value: + * - Ok: Receive data success + * - ErrorInvalidParameter: Invalid parameter + * - ErrorTimeout: Transmission timeout + */ +en_result_t I2S_TransReceive(M4_I2S_TypeDef *I2Sx, const void *pvTxBuf, void *pvRxBuf, uint32_t u32Len, uint32_t u32Timeout) +{ + en_result_t enRet; + uint32_t u32TxCnt = 0U; + uint32_t u32RxCnt = 0U; + uint32_t u32DataWidth; + uint32_t u32Temp; + uint8_t u8BreakFlag = 0U; + + if ((NULL == pvTxBuf) || (NULL == pvRxBuf) || (0UL == u32Len)) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_I2S_UNIT(I2Sx)); + + u32DataWidth = READ_REG32_BIT(I2Sx->CFGR, I2S_CFGR_DATLEN); + if (((I2S_DATA_LEN_16BIT == u32DataWidth) && IS_ADDRESS_ALIGN_HALFWORD(pvTxBuf) && IS_ADDRESS_ALIGN_HALFWORD(pvRxBuf)) || + (IS_ADDRESS_ALIGN_WORD(pvTxBuf) && IS_ADDRESS_ALIGN_WORD(pvRxBuf))) + { + enRet = I2S_WaitStatus(I2Sx, I2S_FLAG_TX_FULL, Reset, u32Timeout); + if (Ok == enRet) + { + /* Preload data */ + if (I2S_DATA_LEN_16BIT == u32DataWidth) + { + WRITE_REG32(I2Sx->TXBUF, ((const uint16_t *)pvTxBuf)[u32TxCnt]); + } + else + { + WRITE_REG32(I2Sx->TXBUF, ((const uint32_t *)pvTxBuf)[u32TxCnt]); + } + u32TxCnt++; + + for (;;) + { + /* Transmit data */ + if (u32TxCnt < u32Len) + { + enRet = I2S_WaitStatus(I2Sx, I2S_FLAG_TX_FULL, Reset, u32Timeout); + if (Ok != enRet) + { + u8BreakFlag = 1U; + } + else + { + if (I2S_DATA_LEN_16BIT == u32DataWidth) + { + WRITE_REG32(I2Sx->TXBUF, ((const uint16_t *)pvTxBuf)[u32TxCnt]); + } + else + { + WRITE_REG32(I2Sx->TXBUF, ((const uint32_t *)pvTxBuf)[u32TxCnt]); + } + u32TxCnt++; + } + } + /* Receive data */ + if ((1U != u8BreakFlag) && (u32RxCnt < u32Len)) + { + enRet = I2S_WaitStatus(I2Sx, I2S_FLAG_RX_EMPTY, Reset, u32Timeout); + if (Ok != enRet) + { + u8BreakFlag = 1U; + } + else + { + u32Temp = READ_REG32(I2Sx->RXBUF); + if (I2S_DATA_LEN_16BIT == u32DataWidth) + { + ((uint16_t *)pvRxBuf)[u32RxCnt] = (uint16_t)(u32Temp & 0xFFFFUL); + } + else if (I2S_DATA_LEN_24BIT == u32DataWidth) + { + ((uint32_t *)pvRxBuf)[u32RxCnt] = u32Temp & 0xFFFFFFUL; + } + else + { + ((uint32_t *)pvRxBuf)[u32RxCnt] = u32Temp; + } + u32RxCnt++; + } + } + + /* Complete the transmission */ + if ((1U == u8BreakFlag) || ((u32Len == u32TxCnt) && (u32Len == u32RxCnt))) + { + break; + } + } + } + } + else + { + enRet = ErrorInvalidParameter; + } + } + + return enRet; +} + +/** + * @brief Enable or disable specified I2S interrupt. + * @param [in] I2Sx Pointer to I2S instance register base + * This parameter can be one of the following values: + * @arg M4_I2S1: I2S unit 1 instance register base + * @arg M4_I2S2: I2S unit 2 instance register base + * @arg M4_I2S3: I2S unit 3 instance register base + * @arg M4_I2S4: I2S unit 4 instance register base + * @param [in] u32IntType Interrupt type + * This parameter can be one or any combination of the following values: + * @arg I2S_INT_TX: Transfer interrupt + * @arg I2S_INT_RX: Receive interrupt + * @arg I2S_INT_ERR: Communication error interrupt + * @arg I2S_INT_ALL: All of the above + * @param [in] enNewState The function new state + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void I2S_IntCmd(M4_I2S_TypeDef *I2Sx, uint32_t u32IntType, en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_I2S_UNIT(I2Sx)); + DDL_ASSERT(IS_I2S_INT(u32IntType)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Disable != enNewState) + { + SET_REG32_BIT(I2Sx->CTRL, u32IntType); + } + else + { + CLEAR_REG32_BIT(I2Sx->CTRL, u32IntType); + } +} + +/** + * @brief Get I2S flag status. + * @param [in] I2Sx Pointer to I2S instance register base + * This parameter can be one of the following values: + * @arg M4_I2S1: I2S unit 1 instance register base + * @arg M4_I2S2: I2S unit 2 instance register base + * @arg M4_I2S3: I2S unit 3 instance register base + * @arg M4_I2S4: I2S unit 4 instance register base + * @param [in] u32Flag I2S flag type + * This parameter can be one or any combination of the following values: + * @arg I2S_FLAG_TX_ALARM: Transfer buffer alarm flag + * @arg I2S_FLAG_RX_ALARM: Receive buffer alarm flag + * @arg I2S_FLAG_TX_EMPTY: Transfer buffer empty flag + * @arg I2S_FLAG_TX_FULL: Transfer buffer full flag + * @arg I2S_FLAG_RX_EMPTY: Receive buffer empty flag + * @arg I2S_FLAG_RX_FULL: Receive buffer full flag + * @arg I2S_FLAG_TX_ERR: Transfer overflow or underflow flag + * @arg I2S_FLAG_RX_ERR: Receive overflow flag + * @arg I2S_FLAG_ALL: All of the above + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t I2S_GetStatus(const M4_I2S_TypeDef *I2Sx, uint32_t u32Flag) +{ + en_flag_status_t enFlagSta = Reset; + uint32_t u32NormalFlag; + uint32_t u32ErrorFlag; + + /* Check parameters */ + DDL_ASSERT(IS_I2S_UNIT(I2Sx)); + DDL_ASSERT(IS_I2S_FLAG(u32Flag)); + + u32NormalFlag = u32Flag & 0xFFFFUL; + u32ErrorFlag = u32Flag >> 16U; + if (0UL != u32NormalFlag) + { + if (0UL != (READ_REG32_BIT(I2Sx->SR, u32NormalFlag))) + { + enFlagSta = Set; + } + } + if ((Reset == enFlagSta) && (0UL != u32ErrorFlag)) + { + if (0UL != (READ_REG32_BIT(I2Sx->ER, u32ErrorFlag))) + { + enFlagSta = Set; + } + } + + return enFlagSta; +} + +/** + * @brief Clear I2S flag. + * @param [in] I2Sx Pointer to I2S instance register base + * This parameter can be one of the following values: + * @arg M4_I2S1: I2S unit 1 instance register base + * @arg M4_I2S2: I2S unit 2 instance register base + * @arg M4_I2S3: I2S unit 3 instance register base + * @arg M4_I2S4: I2S unit 4 instance register base + * @param [in] u32Flag I2S flag type + * This parameter can be one or any combination of the following values: + * @arg I2S_FLAG_TX_ERR: Transfer overflow or underflow flag + * @arg I2S_FLAG_RX_ERR: Receive overflow flag + * @arg I2S_CLR_FLAG_ALL: All of the above + * @retval None + */ +void I2S_ClearStatus(M4_I2S_TypeDef *I2Sx, uint32_t u32Flag) +{ + /* Check parameters */ + DDL_ASSERT(IS_I2S_UNIT(I2Sx)); + DDL_ASSERT(IS_I2S_CLR_FLAG(u32Flag)); + + CLEAR_REG32_BIT(I2Sx->ER, u32Flag); +} + +/** + * @brief Get I2S clock frequency. + * @param [in] I2Sx Pointer to I2S instance register base + * This parameter can be one of the following values: + * @arg M4_I2S1: I2S unit 1 instance register base + * @arg M4_I2S2: I2S unit 2 instance register base + * @arg M4_I2S3: I2S unit 3 instance register base + * @arg M4_I2S4: I2S unit 4 instance register base + * @retval uint32_t The I2S clock frequency + */ +static uint32_t I2S_GetClockFreq(const M4_I2S_TypeDef *I2Sx) +{ + uint32_t u32ClockShift; + uint16_t u32ClockSrc; + uint32_t u32ClockFreq; + uint32_t u32PllP; + uint32_t u32PllQ; + uint32_t u32PllR; + uint32_t u32PllN; + uint32_t u32PllM; + uint32_t u32PllIn; + uint32_t u32Temp; + + /* Get the offset of the I2S clock source in CMU_I2SCKSEL */ + if (M4_I2S1 == I2Sx) + { + u32ClockShift = CMU_I2SCKSEL_I2S1CKSEL_POS; + } + else if (M4_I2S2 == I2Sx) + { + u32ClockShift = CMU_I2SCKSEL_I2S2CKSEL_POS; + } + else if (M4_I2S3 == I2Sx) + { + u32ClockShift = CMU_I2SCKSEL_I2S3CKSEL_POS; + } + else if (M4_I2S4 == I2Sx) + { + u32ClockShift = CMU_I2SCKSEL_I2S4CKSEL_POS; + } + else + { + u32ClockShift = 0UL; + } + + u32ClockSrc = (READ_REG16(M4_CMU->I2SCKSEL) >> u32ClockShift) & CMU_I2SCKSEL_I2S1CKSEL; + if (0UL != READ_REG32_BIT(M4_CMU->PLLHCFGR, CMU_PLLHCFGR_PLLSRC)) + { + u32PllIn = HRC_VALUE; + } + else + { + u32PllIn = XTAL_VALUE; + } + /* Calculate the clock frequency */ + switch(u32ClockSrc) + { + case 0x00U: /* PCLK1 */ + u32ClockFreq = SystemCoreClock >> ((READ_REG32_BIT(M4_CMU->SCFGR, CMU_SCFGR_PCLK1S) >> CMU_SCFGR_PCLK1S_POS)); + break; + case 0x08U: /* PLLHQ */ + u32Temp = READ_REG32(M4_CMU->PLLHCFGR); + u32PllM = (u32Temp >> CMU_PLLHCFGR_PLLHM_POS) & 0x03UL; + u32PllN = (u32Temp >> CMU_PLLHCFGR_PLLHN_POS) & 0xFFUL; + u32PllQ = (u32Temp >> CMU_PLLHCFGR_PLLHQ_POS) & 0x0FUL; + u32ClockFreq = ((u32PllIn / (u32PllM + 1UL)) * (u32PllN + 1UL)) / (u32PllQ + 1UL); + break; + case 0x09U: /* PLLHR */ + u32Temp = READ_REG32(M4_CMU->PLLHCFGR); + u32PllM = (u32Temp >> CMU_PLLHCFGR_PLLHM_POS) & 0x03UL; + u32PllN = (u32Temp >> CMU_PLLHCFGR_PLLHN_POS) & 0xFFUL; + u32PllR = (u32Temp >> CMU_PLLHCFGR_PLLHR_POS) & 0x0FUL; + u32ClockFreq = ((u32PllIn / (u32PllM + 1UL)) * (u32PllN + 1UL)) / (u32PllR + 1UL); + break; + case 0x0AU: /* PLLAP */ + u32Temp = READ_REG32(M4_CMU->PLLACFGR); + u32PllM = (u32Temp >> CMU_PLLACFGR_PLLAM_POS) & 0x1FUL; + u32PllN = (u32Temp >> CMU_PLLACFGR_PLLAN_POS) & 0x1FFUL; + u32PllP = (u32Temp >> CMU_PLLACFGR_PLLAP_POS) & 0x0FUL; + u32ClockFreq = ((u32PllIn / (u32PllM + 1UL)) * (u32PllN + 1UL)) / (u32PllP + 1UL); + break; + case 0x0BU: /* PLLAQ */ + u32Temp = READ_REG32(M4_CMU->PLLACFGR); + u32PllM = (u32Temp >> CMU_PLLACFGR_PLLAM_POS) & 0x1FUL; + u32PllN = (u32Temp >> CMU_PLLACFGR_PLLAN_POS) & 0x1FFUL; + u32PllQ = (u32Temp >> CMU_PLLACFGR_PLLAQ_POS) & 0x0FUL; + u32ClockFreq = ((u32PllIn / (u32PllM + 1UL)) * (u32PllN + 1UL)) / (u32PllQ + 1UL); + break; + case 0x0CU: /* PLLAR */ + u32Temp = READ_REG32(M4_CMU->PLLACFGR); + u32PllM = (u32Temp >> CMU_PLLACFGR_PLLAM_POS) & 0x1FUL; + u32PllN = (u32Temp >> CMU_PLLACFGR_PLLAN_POS) & 0x1FFUL; + u32PllR = (u32Temp >> CMU_PLLACFGR_PLLAR_POS) & 0x0FUL; + u32ClockFreq = ((u32PllIn / (u32PllM + 1UL)) * (u32PllN + 1UL)) / (u32PllR + 1UL); + break; + default: + u32ClockFreq = 0UL; + break; + } + + return u32ClockFreq; +} + +/** + * @brief Wait for the flag status of I2S. + * @param [in] I2Sx Pointer to I2S instance register base + * This parameter can be one of the following values: + * @arg M4_I2S1: I2S unit 1 instance register base + * @arg M4_I2S2: I2S unit 2 instance register base + * @arg M4_I2S3: I2S unit 3 instance register base + * @arg M4_I2S4: I2S unit 4 instance register base + * @param [in] u32Flag I2S flag type + * This parameter can be one of the following values: + * @arg I2S_FLAG_TX_ALARM: Transfer buffer alarm flag + * @arg I2S_FLAG_RX_ALARM: Receive buffer alarm flag + * @arg I2S_FLAG_TX_EMPTY: Transfer buffer empty flag + * @arg I2S_FLAG_TX_FULL: Transfer buffer full flag + * @arg I2S_FLAG_RX_EMPTY: Receive buffer empty flag + * @arg I2S_FLAG_RX_FULL: Receive buffer full flag + * @arg I2S_FLAG_TX_ERR: Transfer overflow or underflow flag + * @arg I2S_FLAG_RX_ERR: Receive overflow flag + * @param [in] enStatus The flag status + * This parameter can be one of the following values: + * @arg Set: Wait for the flag to set + * @arg Reset: Wait for the flag to reset + * @param [in] u32Timeout Wait the flag timeout(ms) + * @retval An en_result_t enumeration value: + * - Ok: Wait status success + * - ErrorTimeout: Wait timeout + */ +static en_result_t I2S_WaitStatus(const M4_I2S_TypeDef *I2Sx, uint32_t u32Flag, en_flag_status_t enStatus, uint32_t u32Timeout) +{ + en_result_t enRet = Ok; + __IO uint32_t u32Count; + + /* Waiting for the flag status to change to the enStatus */ + u32Count = u32Timeout * (HCLK_VALUE / 20000UL); + while (enStatus != I2S_GetStatus(I2Sx, u32Flag)) + { + if (u32Count == 0UL) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + + return enRet; +} + +/** + * @} + */ + +#endif /* DDL_I2S_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_icg.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_icg.c new file mode 100644 index 0000000000..7937465caa --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_icg.c @@ -0,0 +1,124 @@ +/** + ******************************************************************************* + * @file hc32f4a0_icg.c + * @brief This file provides firmware functions to manage the Initial + * Configuration(ICG). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Yangjp First version + 2020-09-04 Yangjp Optimizing the definition method of ICG field + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_icg.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_ICG ICG + * @brief Initial Configuration Driver Library + * @{ + */ + +#if (DDL_ICG_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ +/** + * @brief ICG parameters configuration + */ +#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) +const uint32_t u32ICG[] __attribute__((section(".ARM.__at_0x400"))) = +#elif defined (__GNUC__) && !defined (__CC_ARM) +const uint32_t u32ICG[] __attribute__((section(".icg_sec"))) = +#elif defined (__CC_ARM) +const uint32_t u32ICG[] __attribute__((at(0x400))) = +#elif defined (__ICCARM__) +#pragma location = 0x400 +__root static const uint32_t u32ICG[] = +#else +#error "unsupported compiler!!" +#endif +{ + /* ICG 0~3 */ + ICG_REG_CFG0_CONSTANT, + ICG_REG_CFG1_CONSTANT, + ICG_REG_CFG2_CONSTANT, + ICG_REG_CFG3_CONSTANT, + /* Reserved 0~3 */ + ICG_RESERVED_CONSTANT, + ICG_RESERVED_CONSTANT, + ICG_RESERVED_CONSTANT, + ICG_RESERVED_CONSTANT, + /* Reserved 4~7 */ + ICG_RESERVED_CONSTANT, + ICG_RESERVED_CONSTANT, + ICG_RESERVED_CONSTANT, + ICG_RESERVED_CONSTANT, + /* Reserved 8~11 */ + ICG_RESERVED_CONSTANT, + ICG_RESERVED_CONSTANT, + ICG_RESERVED_CONSTANT, + ICG_RESERVED_CONSTANT, + /* Reserved 12~15 */ + ICG_RESERVED_CONSTANT, + ICG_RESERVED_CONSTANT, + ICG_RESERVED_CONSTANT, + ICG_RESERVED_CONSTANT, + /* Reserved 16~19 */ + ICG_RESERVED_CONSTANT, + ICG_RESERVED_CONSTANT, + ICG_RESERVED_CONSTANT, + ICG_RESERVED_CONSTANT, +}; + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ + +#endif /* DDL_ICG_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_interrupts.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_interrupts.c new file mode 100644 index 0000000000..691a3e060c --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_interrupts.c @@ -0,0 +1,7673 @@ +/** + ******************************************************************************* + * @file hc32f4a0_interrupts.c + * @brief This file provides firmware functions to manage the Interrupt Controller + * (INTC). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Zhangxl First version + 2020-08-25 Zhangxl Modify for MISRAC2012-8.4, 8.6, 10.1 + 2020-09-09 Zhangxl Merge EFM0/1 share IRQ handler + 2020-10-30 Zhangxl Revise I2C TxEmpty & Complete share IRQ handler entry + 2020-11-15 Zhangxl SPII flag judgment for share IRQ. + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_interrupts.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_INTERRUPTS INTERRUPTS + * @brief INTC Driver Library + * @{ + */ + +#if (DDL_INTERRUPTS_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup INTC_Local_Macros INTC Local Macros + * @{ + */ +/** + * @brief Maximum IRQ handler number + */ +#define IRQ_NUM_MAX (128U) + +/** + * @brief Wakeup event enable mask + */ +#define INTC_WUPEN_MASK \ + (INTC_WUPEN_EIRQWUEN | INTC_WUPEN_SWDTWUEN | \ + INTC_WUPEN_PVD1WUEN | INTC_WUPEN_PVD2WUEN | \ + INTC_WUPEN_CMPWUEN | INTC_WUPEN_WKTMWUEN | \ + INTC_WUPEN_RTCALMWUEN | INTC_WUPEN_RTCPRDWUEN | \ + INTC_WUPEN_TMR0GCMWUEN | INTC_WUPEN_TMR2GCMWUEN | \ + INTC_WUPEN_TMR2OVFWUEN | INTC_WUPEN_RXWUEN | \ + INTC_WUPEN_USHWUEN | INTC_WUPEN_USFWUEN | \ + INTC_WUPEN_ETHWUEN) + +/** + * @} + */ + +/** + * @defgroup INTC_Check_Parameters_Validity INTC Check Parameters Validity + * @{ + */ +/*! Parameter validity check for wakeup source from stop mode. */ +#define IS_INTC_WKUP_SRC(src) \ +( ((src) != 0x00UL) && \ + (((src) | INTC_WUPEN_MASK) == INTC_WUPEN_MASK)) + +/*! Parameter validity check for event index. */ +#define IS_INTC_EVENT(event) ((event) != 0x00UL) + +/*! Parameter validity check for interrupt index. */ +#define IS_INTC_INT(it) ((it) != 0x00UL) + +/*! Parameter validity check for software interrupt index. */ +#define IS_INTC_SWI(swi) ((swi) != 0x00UL) + +/*! Parameter validity check for NMI trigger source. */ +#define IS_NMI_SRC(src) \ +( ((src) != 0x00UL) && \ + (((src) | NMI_SRC_MASK) == NMI_SRC_MASK)) + +/*! Parameter validity check for EXINT filter A function. */ +#define IS_EXINT_FAE(fae) \ +( ((fae) == EXINT_FILTER_A_OFF) || \ + ((fae) == EXINT_FILTER_A_ON)) + +/*! Parameter validity check for EXINT filter A clock division. */ +#define IS_EXINT_FACLK(faclk) \ +( ((faclk) == EXINT_FACLK_HCLK_DIV1) || \ + ((faclk) == EXINT_FACLK_HCLK_DIV8) || \ + ((faclk) == EXINT_FACLK_HCLK_DIV32) || \ + ((faclk) == EXINT_FACLK_HCLK_DIV64)) + +/*! Parameter validity check for EXINT filter B function. */ +#define IS_EXINT_FBE(fbe) \ +( ((fbe) == EXINT_FILTER_B_OFF) || \ + ((fbe) == EXINT_FILTER_B_ON)) + +/*! Parameter validity check for EXINT filter B time. */ +#define IS_EXINT_FBTIME(fbtime) \ +( ((fbtime) == EXINT_FBTIM_500NS) || \ + ((fbtime) == EXINT_FBTIM_1US) || \ + ((fbtime) == EXINT_FBTIM_2US) || \ + ((fbtime) == EXINT_FBTIM_4US)) + + +/*! Parameter validity check for EXINT trigger edge. */ +#define IS_EXINT_TRIGGER(trigger) \ +( ((trigger) == EXINT_TRIGGER_LOW) || \ + ((trigger) == EXINT_TRIGGER_RISING) || \ + ((trigger) == EXINT_TRIGGER_FALLING) || \ + ((trigger) == EXINT_TRIGGER_BOTH)) + +/*! Parameter validity check for EXINT channel. */ +#define IS_EXINT_CH(ch) \ +( ((ch) != 0x00UL) && \ + (((ch) | EXINT_CH_MASK) == EXINT_CH_MASK)) + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ +/** + * @defgroup INTC_Local_Variable INTC Local Variable + * @{ + */ +static func_ptr_t m_apfnIrqHandler[IRQ_NUM_MAX] = {NULL}; +static func_ptr_t m_pfnNmiCallback; +/** + * @} + */ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup INTC_Global_Functions INTC Global Functions + * @{ + */ +/** + * @brief IRQ sign in function + * @param [in] pstcIrqSignConfig: pointer of IRQ registration structure + * @arg enIntSrc: can be any value @ref en_int_src_t + * @arg enIRQn: can be any value from Int000_IRQn ~ Int127_IRQn @ref IRQn_Type + * @arg pfnCallback: Callback function + * @retval Ok: IRQ register successfully + * ErrorInvalidParameter: IRQ No. and Peripheral Int source are not match; + * NULL pointer. + * ErrorUninitialized: Specified IRQ entry was signed before. + */ +en_result_t INTC_IrqSignIn(const stc_irq_signin_config_t *pstcIrqSignConfig) +{ + __IO uint32_t *INTC_SELx; + en_result_t enRet = Ok; + + /* Check if pointer is NULL */ + if (NULL == pstcIrqSignConfig) + { + enRet = ErrorInvalidParameter; + } + else + { + /* IRQ032~127 whether out of range */ + if ((((((uint32_t)pstcIrqSignConfig->enIntSrc / 0x20UL) * 6UL + 0x20UL) > (uint32_t)pstcIrqSignConfig->enIRQn) || \ + ((((uint32_t)pstcIrqSignConfig->enIntSrc / 0x20UL) * 6UL + 0x25U) < (uint32_t)pstcIrqSignConfig->enIRQn))&& \ + ((uint32_t)pstcIrqSignConfig->enIRQn >= 0x20UL)) + { + enRet = ErrorInvalidParameter; + } + else + { + INTC_SELx = (__IO uint32_t *)((uint32_t)(&M4_INTC->SEL0) + (4U * (uint32_t)pstcIrqSignConfig->enIRQn)); + /* for MISRAC2004-12.4 */ + if (0x1FFUL == ((*INTC_SELx) & 0x1FFUL)) + { + WRITE_REG32(*INTC_SELx, pstcIrqSignConfig->enIntSrc); + m_apfnIrqHandler[pstcIrqSignConfig->enIRQn] = pstcIrqSignConfig->pfnCallback; + } + else if ((uint32_t)(pstcIrqSignConfig->enIntSrc) == ((*INTC_SELx) & 0x1FFUL)) + { + WRITE_REG32(*INTC_SELx, pstcIrqSignConfig->enIntSrc); + m_apfnIrqHandler[pstcIrqSignConfig->enIRQn] = pstcIrqSignConfig->pfnCallback; + } + else + { + enRet = ErrorUninitialized; + } + } + } + return enRet; +} + +/** + * @brief IRQ sign out function + * @param [in] enIRQn: can be any value from Int000_IRQn ~ Int127_IRQn @ref IRQn_Type + * @retval Ok: IRQ sign out successfully + * ErrorInvalidParameter: IRQ No. is out of range + */ +en_result_t INTC_IrqSignOut(IRQn_Type enIRQn) +{ + __IO uint32_t *INTC_SELx; + en_result_t enRet = Ok; + + if ((enIRQn < Int000_IRQn) || (enIRQn > Int127_IRQn)) + { + enRet = ErrorInvalidParameter; + } + else + { + INTC_SELx = (__IO uint32_t *)((uint32_t)(&M4_INTC->SEL0) + (4UL * (uint32_t)enIRQn)); + WRITE_REG32(*INTC_SELx, 0x1FFUL); + m_apfnIrqHandler[enIRQn] = NULL; + } + return enRet; +} + +/** + * @brief Share IRQ configure + * @param [in] enIntSrc: Peripheral interrupt source @ref en_int_src_t + * @param [in] enNewState: + * @arg Enable: Enable corresponding peripheral interrupt in share IRQ handler + * @arg Disable: Disable corresponding peripheral interrupt in share IRQ handler + * @retval Ok: Share IRQ configure successfully + */ +en_result_t INTC_ShareIrqCmd(en_int_src_t enIntSrc, en_functional_state_t enNewState) +{ + __IO uint32_t *INTC_VSSELx; + + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + INTC_VSSELx = (__IO uint32_t *)(((uint32_t)&M4_INTC->VSSEL128) + (4U * ((uint32_t)enIntSrc / 0x20U))); + if (Enable == enNewState) + { + SET_REG32_BIT(*INTC_VSSELx, (uint32_t)(1UL << ((uint32_t)enIntSrc & 0x1FUL))); + } + else + { + CLEAR_REG32_BIT(*INTC_VSSELx, (1UL << ((uint32_t)enIntSrc & 0x1FUL))); + } + return Ok; +} + +/** + * @brief Stop mode wake-up source configure + * @param [in] u32WakeupSrc: Wake-up source + * @arg INTC_WUPEN_EIRQWUEN + * @arg INTC_WUPEN_EIRQWUEN_0 + * @arg INTC_WUPEN_EIRQWUEN_1 + * @arg INTC_WUPEN_EIRQWUEN_2 + * @arg INTC_WUPEN_EIRQWUEN_3 + * @arg INTC_WUPEN_EIRQWUEN_4 + * @arg INTC_WUPEN_EIRQWUEN_5 + * @arg INTC_WUPEN_EIRQWUEN_6 + * @arg INTC_WUPEN_EIRQWUEN_7 + * @arg INTC_WUPEN_EIRQWUEN_8 + * @arg INTC_WUPEN_EIRQWUEN_9 + * @arg INTC_WUPEN_EIRQWUEN_10 + * @arg INTC_WUPEN_EIRQWUEN_11 + * @arg INTC_WUPEN_EIRQWUEN_12 + * @arg INTC_WUPEN_EIRQWUEN_13 + * @arg INTC_WUPEN_EIRQWUEN_14 + * @arg INTC_WUPEN_EIRQWUEN_15 + * @arg INTC_WUPEN_SWDTWUEN + * @arg INTC_WUPEN_PVD1WUEN + * @arg INTC_WUPEN_PVD2WUEN + * @arg INTC_WUPEN_CMPWUEN + * @arg INTC_WUPEN_WKTMWUEN + * @arg INTC_WUPEN_RTCALMWUEN + * @arg INTC_WUPEN_RTCPRDWUEN + * @arg INTC_WUPEN_TMR0GCMWUEN + * @arg INTC_WUPEN_TMR2GCMWUEN + * @arg INTC_WUPEN_TMR2OVFWUEN + * @arg INTC_WUPEN_RXWEN + * @arg INTC_WUPEN_USHWUEN + * @arg INTC_WUPEN_USFWUEN + * @arg INTC_WUPEN_ETHWUEN + * @param [in] enNewState + * @arg Enable: Enable corresponding wake up source + * @arg Disable: Disable corresponding wake up source + * @retval None + */ +void INTC_WakeupSrcCmd(uint32_t u32WakeupSrc, en_functional_state_t enNewState) +{ + /* Parameter validity checking */ + DDL_ASSERT(IS_INTC_WKUP_SRC(u32WakeupSrc)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(M4_INTC->WUPEN, u32WakeupSrc); + } + else + { + CLEAR_REG32_BIT(M4_INTC->WUPEN, u32WakeupSrc); + } +} + +/** + * @brief Event or Interrupt output configure + * @param [in] u32Event: Event index + * @arg INTC_EVTER_EVTE0 + * @arg INTC_EVTER_EVTE1 + * @arg INTC_EVTER_EVTE2 + * @arg INTC_EVTER_EVTE3 + * @arg INTC_EVTER_EVTE4 + * @arg INTC_EVTER_EVTE5 + * @arg INTC_EVTER_EVTE6 + * @arg INTC_EVTER_EVTE7 + * @arg INTC_EVTER_EVTE8 + * @arg INTC_EVTER_EVTE9 + * @arg INTC_EVTER_EVTE10 + * @arg INTC_EVTER_EVTE11 + * @arg INTC_EVTER_EVTE12 + * @arg INTC_EVTER_EVTE13 + * @arg INTC_EVTER_EVTE14 + * @arg INTC_EVTER_EVTE15 + * @arg INTC_EVTER_EVTE16 + * @arg INTC_EVTER_EVTE17 + * @arg INTC_EVTER_EVTE18 + * @arg INTC_EVTER_EVTE19 + * @arg INTC_EVTER_EVTE20 + * @arg INTC_EVTER_EVTE21 + * @arg INTC_EVTER_EVTE22 + * @arg INTC_EVTER_EVTE23 + * @arg INTC_EVTER_EVTE24 + * @arg INTC_EVTER_EVTE25 + * @arg INTC_EVTER_EVTE26 + * @arg INTC_EVTER_EVTE27 + * @arg INTC_EVTER_EVTE28 + * @arg INTC_EVTER_EVTE29 + * @arg INTC_EVTER_EVTE30 + * @arg INTC_EVTER_EVTE31 + * @param [in] enNewState + * @arg Enable: Enable corresponding event to NVIC + * @arg Disable: Disable corresponding event but interrupt to NVIC + * @retval None + */ +void INTC_EventCmd(uint32_t u32Event, en_functional_state_t enNewState) +{ + /* Parameter validity checking */ + DDL_ASSERT(IS_INTC_EVENT(u32Event)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(M4_INTC->EVTER, u32Event); + } + else + { + CLEAR_REG32_BIT(M4_INTC->EVTER, u32Event); + } +} + +/** + * @brief Interrupt function configure + * @param [in] u32Int: Interrupt index + * @arg INTC_IER_IER0 + * @arg INTC_IER_IER1 + * @arg INTC_IER_IER2 + * @arg INTC_IER_IER3 + * @arg INTC_IER_IER4 + * @arg INTC_IER_IER5 + * @arg INTC_IER_IER6 + * @arg INTC_IER_IER7 + * @arg INTC_IER_IER8 + * @arg INTC_IER_IER9 + * @arg INTC_IER_IER10 + * @arg INTC_IER_IER11 + * @arg INTC_IER_IER12 + * @arg INTC_IER_IER13 + * @arg INTC_IER_IER14 + * @arg INTC_IER_IER15 + * @arg INTC_IER_IER16 + * @arg INTC_IER_IER17 + * @arg INTC_IER_IER18 + * @arg INTC_IER_IER19 + * @arg INTC_IER_IER20 + * @arg INTC_IER_IER21 + * @arg INTC_IER_IER22 + * @arg INTC_IER_IER23 + * @arg INTC_IER_IER24 + * @arg INTC_IER_IER25 + * @arg INTC_IER_IER26 + * @arg INTC_IER_IER27 + * @arg INTC_IER_IER28 + * @arg INTC_IER_IER29 + * @arg INTC_IER_IER30 + * @arg INTC_IER_IER31 + * @param [in] enNewState + * @arg Enable: Enable corresponding interrupt to NVIC + * @arg Disable: Disable corresponding interrupt to NVIC + * @retval None + */ +void INTC_IntCmd(uint32_t u32Int, en_functional_state_t enNewState) +{ + /* Parameter validity checking */ + DDL_ASSERT(IS_INTC_INT(u32Int)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(M4_INTC->IER, u32Int); + } + else + { + CLEAR_REG32_BIT(M4_INTC->IER, u32Int); + } +} + +/** + * @brief Software Interrupt function configure + * @param [in] u32SWI: Software Interrupt index + * @arg INTC_SWIER_SWIE0 + * @arg INTC_SWIER_SWIE1 + * @arg INTC_SWIER_SWIE2 + * @arg INTC_SWIER_SWIE3 + * @arg INTC_SWIER_SWIE4 + * @arg INTC_SWIER_SWIE5 + * @arg INTC_SWIER_SWIE6 + * @arg INTC_SWIER_SWIE7 + * @arg INTC_SWIER_SWIE8 + * @arg INTC_SWIER_SWIE9 + * @arg INTC_SWIER_SWIE10 + * @arg INTC_SWIER_SWIE11 + * @arg INTC_SWIER_SWIE12 + * @arg INTC_SWIER_SWIE13 + * @arg INTC_SWIER_SWIE14 + * @arg INTC_SWIER_SWIE15 + * @arg INTC_SWIER_SWIE16 + * @arg INTC_SWIER_SWIE17 + * @arg INTC_SWIER_SWIE18 + * @arg INTC_SWIER_SWIE19 + * @arg INTC_SWIER_SWIE20 + * @arg INTC_SWIER_SWIE21 + * @arg INTC_SWIER_SWIE22 + * @arg INTC_SWIER_SWIE23 + * @arg INTC_SWIER_SWIE24 + * @arg INTC_SWIER_SWIE25 + * @arg INTC_SWIER_SWIE26 + * @arg INTC_SWIER_SWIE27 + * @arg INTC_SWIER_SWIE28 + * @arg INTC_SWIER_SWIE29 + * @arg INTC_SWIER_SWIE30 + * @arg INTC_SWIER_SWIE31 + * @param [in] enNewState + * @arg Enable: Enable corresponding software interrupt + * @arg Disable: Disable corresponding software interrupt + * @retval None + */ +void INTC_SWICmd(uint32_t u32SWI, en_functional_state_t enNewState) +{ + /* Parameter validity checking */ + DDL_ASSERT(IS_INTC_SWI(u32SWI)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(M4_INTC->SWIER, u32SWI); + } + else + { + CLEAR_REG32_BIT(M4_INTC->SWIER, u32SWI); + } +} + +/** + * @brief Initialize NMI. Fill each pstcNmiInit with default value + * @param [in] pstcNmiInit: Pointer to a stc_nmi_init_t structure that + * contains configuration information. + * @retval Ok: NMI structure initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t NMI_StructInit(stc_nmi_init_t *pstcNmiInit) +{ + en_result_t enRet = Ok; + + /* Check if pointer is NULL */ + if (NULL == pstcNmiInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Configure to default value */ + pstcNmiInit->u32NmiSrc = 0UL; + pstcNmiInit->pfnNmiCallback = NULL; + } + return enRet; +} + +/** + * @brief Initialize NMI. + * @param [in] pstcNmiInit: Pointer to a pstcNmiInit structure that + * contains configuration information. + * @retval Ok: NMI initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t NMI_Init(const stc_nmi_init_t *pstcNmiInit) +{ + en_result_t enRet = Ok; + + /* Check if pointer is NULL */ + if ((NULL == pstcNmiInit) || (NULL == pstcNmiInit->pfnNmiCallback)) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Parameter validity checking */ + DDL_ASSERT(IS_NMI_SRC(pstcNmiInit->u32NmiSrc)); + + /* Clear all NMI trigger source before set */ + WRITE_REG32(M4_INTC->NMICFR, INTC_NMICLR_MASK); + + /* NMI trigger source configure */ + WRITE_REG32(M4_INTC->NMIENR, pstcNmiInit->u32NmiSrc); + + /* NMI callback function configure */ + m_pfnNmiCallback = pstcNmiInit->pfnNmiCallback; + } + return enRet; +} + +/** + * @brief Get NMI trigger source + * @param [in] u32NmiSrc: NMI trigger source, @ref NMI_TriggerSrc_Sel for details + * @arg NMI_SRC_SWDT + * @arg NMI_SRC_PVD1 + * @arg NMI_SRC_PVD2 + * @arg NMI_SRC_XTAL + * @arg NMI_SRC_SRAM_PARITY + * @arg NMI_SRC_SRAM_ECC + * @arg NMI_SRC_BUS_ERR + * @arg NMI_SRC_WDT + * @retval Set: NMI is triggered by corresponding source + * Reset: NMI is not triggered by corresponding source + */ +en_flag_status_t NMI_GetNmiSrc(uint32_t u32NmiSrc) +{ + /* Parameter validity checking */ + DDL_ASSERT(IS_NMI_SRC(u32NmiSrc)); + + return (((READ_REG32(M4_INTC->NMIFR) & u32NmiSrc)) != 0UL) ? Set : Reset; +} + +/** + * @brief Set NMI trigger source + * @param [in] u32NmiSrc: NMI trigger source, @ref NMI_TriggerSrc_Sel for details + * @arg NMI_SRC_SWDT + * @arg NMI_SRC_PVD1 + * @arg NMI_SRC_PVD2 + * @arg NMI_SRC_XTAL + * @arg NMI_SRC_SRAM_PARITY + * @arg NMI_SRC_SRAM_ECC + * @arg NMI_SRC_BUS_ERR + * @arg NMI_SRC_WDT + * @retval None + */ +void NMI_SetNmiSrc(uint32_t u32NmiSrc) +{ + /* Parameter validity checking */ + DDL_ASSERT(IS_NMI_SRC(u32NmiSrc)); + + WRITE_REG32(M4_INTC->NMIENR, u32NmiSrc); +} + +/** + * @brief Clear specified NMI trigger source + * @param [in] u32NmiSrc: NMI trigger source, @ref NMI_TriggerSrc_Sel for details + * @arg NMI_SRC_SWDT + * @arg NMI_SRC_PVD1 + * @arg NMI_SRC_PVD2 + * @arg NMI_SRC_XTAL + * @arg NMI_SRC_SRAM_PARITY + * @arg NMI_SRC_SRAM_ECC + * @arg NMI_SRC_BUS_ERR + * @arg NMI_SRC_WDT + * @retval None + */ +void NMI_ClrNmiSrc(uint32_t u32NmiSrc) +{ + /* Parameter validity checking */ + DDL_ASSERT(IS_NMI_SRC(u32NmiSrc)); + + SET_REG32_BIT(M4_INTC->NMICFR, u32NmiSrc); +} + +/** + * @brief NMI IRQ handler + * @param None + * @retval None + */ +void NMI_IrqHandler(void) +{ + if (NULL != m_pfnNmiCallback) + { + m_pfnNmiCallback(); + } +} + +/** + * @brief Initialize External interrupt. + * @param [in] pstcExIntInit: Pointer to a stc_exint_init_t structure that + * contains configuration information. + * @retval Ok: EXINT initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t EXINT_Init(const stc_exint_init_t *pstcExIntInit) +{ + uint8_t u8ExIntPos; + en_result_t enRet = Ok; + + /* Check if pointer is NULL */ + if (NULL == pstcExIntInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Parameter validity checking */ + DDL_ASSERT(IS_EXINT_FAE(pstcExIntInit->u32ExIntFAE)); + DDL_ASSERT(IS_EXINT_FACLK(pstcExIntInit->u32ExIntFAClk)); + DDL_ASSERT(IS_EXINT_FBE(pstcExIntInit->u32ExIntFBE)); + DDL_ASSERT(IS_EXINT_FBTIME(pstcExIntInit->u32ExIntFBTime)); + DDL_ASSERT(IS_EXINT_TRIGGER(pstcExIntInit->u32ExIntLvl)); + DDL_ASSERT(IS_EXINT_CH(pstcExIntInit->u32ExIntCh)); + + for (u8ExIntPos = 0U; u8ExIntPos < 16U; u8ExIntPos++) + { + if ((pstcExIntInit->u32ExIntCh & (1UL << u8ExIntPos)) != 0U) + { + WRITE_REG32(*(uint32_t *)((uint32_t)(&M4_INTC->EIRQCR0) + 4UL*u8ExIntPos), \ + (pstcExIntInit->u32ExIntFAE | \ + pstcExIntInit->u32ExIntFAClk | \ + pstcExIntInit->u32ExIntFBE | \ + pstcExIntInit->u32ExIntLvl)); + WRITE_REG32(M4_INTC->NOCCR, pstcExIntInit->u32ExIntFBTime); + } + } + } + return enRet; +} + +/** + * @brief Initialize ExInt. Fill each pstcExIntInit with default value + * @param [in] pstcExIntInit: Pointer to a stc_exint_init_t structure + * that contains configuration information. + * @retval Ok: EXINT structure initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t EXINT_StructInit(stc_exint_init_t *pstcExIntInit) +{ + en_result_t enRet = Ok; + + /* Check if pointer is NULL */ + if (NULL == pstcExIntInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Configure to default value */ + pstcExIntInit->u32ExIntCh = (uint32_t)0UL; + pstcExIntInit->u32ExIntFAE = EXINT_FILTER_A_OFF; + pstcExIntInit->u32ExIntFAClk = EXINT_FACLK_HCLK_DIV1; + pstcExIntInit->u32ExIntFBE = EXINT_FILTER_B_OFF; + pstcExIntInit->u32ExIntFBTime = EXINT_FBTIM_500NS; + pstcExIntInit->u32ExIntLvl = EXINT_TRIGGER_FALLING; + } + return enRet; +} + +/** + * @brief Clear specified External interrupt trigger source + * @param [in] u32ExIntCh: External interrupt channel, @ref EXINT_Channel_Sel for details + * @arg EXINT_CH00 + * @arg EXINT_CH01 + * @arg EXINT_CH02 + * @arg EXINT_CH03 + * @arg EXINT_CH04 + * @arg EXINT_CH05 + * @arg EXINT_CH06 + * @arg EXINT_CH07 + * @arg EXINT_CH08 + * @arg EXINT_CH09 + * @arg EXINT_CH10 + * @arg EXINT_CH11 + * @arg EXINT_CH12 + * @arg EXINT_CH13 + * @arg EXINT_CH14 + * @arg EXINT_CH15 + * @retval None + */ +void EXINT_ClrExIntSrc(uint32_t u32ExIntCh) +{ + /* Parameter validity checking */ + DDL_ASSERT(IS_EXINT_CH(u32ExIntCh)); + + SET_REG32_BIT(M4_INTC->EICFR, u32ExIntCh); +} + +/** + * @brief Get specified External interrupt trigger source + * @param [in] u32ExIntCh: External interrupt channel, @ref EXINT_Channel_Sel for details + * @arg EXINT_CH00 + * @arg EXINT_CH01 + * @arg EXINT_CH02 + * @arg EXINT_CH03 + * @arg EXINT_CH04 + * @arg EXINT_CH05 + * @arg EXINT_CH06 + * @arg EXINT_CH07 + * @arg EXINT_CH08 + * @arg EXINT_CH09 + * @arg EXINT_CH10 + * @arg EXINT_CH11 + * @arg EXINT_CH12 + * @arg EXINT_CH13 + * @arg EXINT_CH14 + * @arg EXINT_CH15 + * @retval Set: Specified channel of external interrupt is triggered + * Reset: Specified channel of external interrupt is not triggered + */ +en_flag_status_t EXINT_GetExIntSrc(uint32_t u32ExIntCh) +{ + /* Parameter validity checking */ + DDL_ASSERT(IS_EXINT_CH(u32ExIntCh)); + + return ((READ_REG16(M4_INTC->EIFR) & u32ExIntCh) != 0U) ? Set : Reset; +} + +/** + * @brief NMI IRQ handler + * @param None + * @retval None + */ +void NMI_Handler(void) +{ + NMI_IrqHandler(); +} + +/** + * @brief Hard Fault IRQ handler + * @param None + * @retval None + */ +__WEAKDEF void HardFault_Handler(void) +{ + HardFault_IrqHandler(); +} + +/** + * @brief Mem manage fault IRQ handler + * @param None + * @retval None + */ +void MemManage_Handler(void) +{ + MemManage_IrqHandler(); +} + +/** + * @brief Bus fault IRQ handler + * @param None + * @retval None + */ +void BusFault_Handler(void) +{ + BusFault_IrqHandler(); +} + +/** + * @brief Usage fault IRQ handler + * @param None + * @retval None + */ +void UsageFault_Handler(void) +{ + UsageFault_IrqHandler(); +} + +/** + * @brief SVCall IRQ handler + * @param None + * @retval None + */ +void SVC_Handler(void) +{ + SVC_IrqHandler(); +} + +/** + * @brief Debbug monitor IRQ handler + * @param None + * @retval None + */ +void DebugMon_Handler(void) +{ + DebugMon_IrqHandler(); +} + +/** + * @brief PendSV IRQ handler + * @param None + * @retval None + */ +__WEAKDEF void PendSV_Handler(void) +{ + PendSV_IrqHandler(); +} + +/** + * @brief SysTick IRQ handler + * @param None + * @retval None + */ +__WEAKDEF void SysTick_Handler(void) +{ + SysTick_IrqHandler(); +} + +/** + * @brief Interrupt No.000 IRQ handler + * @param None + * @retval None + */ +void IRQ000_Handler(void) +{ + m_apfnIrqHandler[Int000_IRQn](); +} + +/** + * @brief Interrupt No.001 IRQ handler + * @param None + * @retval None + */ +void IRQ001_Handler(void) +{ + m_apfnIrqHandler[Int001_IRQn](); +} + +/** + * @brief Interrupt No.002 IRQ handler + * @param None + * @retval None + */ +void IRQ002_Handler(void) +{ + m_apfnIrqHandler[Int002_IRQn](); +} + +/** + * @brief Interrupt No.003 IRQ handler + * @param None + * @retval None + */ +void IRQ003_Handler(void) +{ + m_apfnIrqHandler[Int003_IRQn](); +} + +/** + * @brief Interrupt No.004 IRQ handler + * @param None + * @retval None + */ +void IRQ004_Handler(void) +{ + m_apfnIrqHandler[Int004_IRQn](); +} + +/** + * @brief Interrupt No.005 IRQ handler + * @param None + * @retval None + */ +void IRQ005_Handler(void) +{ + m_apfnIrqHandler[Int005_IRQn](); +} + +/** + * @brief Interrupt No.006 IRQ handler + * @param None + * @retval None + */ +void IRQ006_Handler(void) +{ + m_apfnIrqHandler[Int006_IRQn](); +} + +/** + * @brief Interrupt No.007 IRQ handler + * @param None + * @retval None + */ +void IRQ007_Handler(void) +{ + m_apfnIrqHandler[Int007_IRQn](); +} + +/** + * @brief Interrupt No.008 IRQ handler + * @param None + * @retval None + */ +void IRQ008_Handler(void) +{ + m_apfnIrqHandler[Int008_IRQn](); +} + +/** + * @brief Interrupt No.009 IRQ handler + * @param None + * @retval None + */ +void IRQ009_Handler(void) +{ + m_apfnIrqHandler[Int009_IRQn](); +} + +/** + * @brief Interrupt No.010 IRQ handler + * @param None + * @retval None + */ +void IRQ010_Handler(void) +{ + m_apfnIrqHandler[Int010_IRQn](); +} + + +/** + * @brief Interrupt No.011 IRQ handler + * @param None + * @retval None + */ +void IRQ011_Handler(void) +{ + m_apfnIrqHandler[Int011_IRQn](); +} + +/** + * @brief Interrupt No.012 IRQ handler + * @param None + * @retval None + */ +void IRQ012_Handler(void) +{ + m_apfnIrqHandler[Int012_IRQn](); +} + +/** + * @brief Interrupt No.013 IRQ handler + * @param None + * @retval None + */ +void IRQ013_Handler(void) +{ + m_apfnIrqHandler[Int013_IRQn](); +} + +/** + * @brief Interrupt No.014 IRQ handler + * @param None + * @retval None + */ +void IRQ014_Handler(void) +{ + m_apfnIrqHandler[Int014_IRQn](); +} + +/** + * @brief Interrupt No.015 IRQ handler + * @param None + * @retval None + */ +void IRQ015_Handler(void) +{ + m_apfnIrqHandler[Int015_IRQn](); +} + +/** + * @brief Interrupt No.016 IRQ handler + * @param None + * @retval None + */ +void IRQ016_Handler(void) +{ + m_apfnIrqHandler[Int016_IRQn](); +} + +/** + * @brief Interrupt No.017 IRQ handler + * @param None + * @retval None + */ +void IRQ017_Handler(void) +{ + m_apfnIrqHandler[Int017_IRQn](); +} + +/** + * @brief Interrupt No.018 IRQ handler + * @param None + * @retval None + */ +void IRQ018_Handler(void) +{ + m_apfnIrqHandler[Int018_IRQn](); +} + +/** + * @brief Interrupt No.019 IRQ handler + * @param None + * @retval None + */ +void IRQ019_Handler(void) +{ + m_apfnIrqHandler[Int019_IRQn](); +} + +/** + * @brief Interrupt No.020 IRQ handler + * @param None + * @retval None + */ +void IRQ020_Handler(void) +{ + m_apfnIrqHandler[Int020_IRQn](); +} + +/** + * @brief Interrupt No.021 IRQ handler + * @param None + * @retval None + */ +void IRQ021_Handler(void) +{ + m_apfnIrqHandler[Int021_IRQn](); +} + +/** + * @brief Interrupt No.022 IRQ handler + * @param None + * @retval None + */ +void IRQ022_Handler(void) +{ + m_apfnIrqHandler[Int022_IRQn](); +} + +/** + * @brief Interrupt No.023 IRQ handler + * @param None + * @retval None + */ +void IRQ023_Handler(void) +{ + m_apfnIrqHandler[Int023_IRQn](); +} + +/** + * @brief Interrupt No.024 IRQ handler + * @param None + * @retval None + */ +void IRQ024_Handler(void) +{ + m_apfnIrqHandler[Int024_IRQn](); +} + +/** + * @brief Interrupt No.025 IRQ handler + * @param None + * @retval None + */ +void IRQ025_Handler(void) +{ + m_apfnIrqHandler[Int025_IRQn](); +} + +/** + * @brief Interrupt No.026 IRQ handler + * @param None + * @retval None + */ +void IRQ026_Handler(void) +{ + m_apfnIrqHandler[Int026_IRQn](); +} + +/** + * @brief Interrupt No.027 IRQ handler + * @param None + * @retval None + */ +void IRQ027_Handler(void) +{ + m_apfnIrqHandler[Int027_IRQn](); +} + +/** + * @brief Interrupt No.028 IRQ handler + * @param None + * @retval None + */ +void IRQ028_Handler(void) +{ + m_apfnIrqHandler[Int028_IRQn](); +} + +/** + * @brief Interrupt No.029 IRQ handler + * @param None + * @retval None + */ +void IRQ029_Handler(void) +{ + m_apfnIrqHandler[Int029_IRQn](); +} + +/** + * @brief Interrupt No.030 IRQ handler + * @param None + * @retval None + */ +void IRQ030_Handler(void) +{ + m_apfnIrqHandler[Int030_IRQn](); +} + +/** + * @brief Interrupt No.031 IRQ handler + * @param None + * @retval None + */ +void IRQ031_Handler(void) +{ + m_apfnIrqHandler[Int031_IRQn](); +} + +/** + * @brief Interrupt No.032 IRQ handler + * @param None + * @retval None + */ +void IRQ032_Handler(void) +{ + m_apfnIrqHandler[Int032_IRQn](); +} + +/** + * @brief Interrupt No.033 IRQ handler + * @param None + * @retval None + */ +void IRQ033_Handler(void) +{ + m_apfnIrqHandler[Int033_IRQn](); +} + +/** + * @brief Interrupt No.034 IRQ handler + * @param None + * @retval None + */ +void IRQ034_Handler(void) +{ + m_apfnIrqHandler[Int034_IRQn](); +} + +/** + * @brief Interrupt No.035 IRQ handler + * @param None + * @retval None + */ +void IRQ035_Handler(void) +{ + m_apfnIrqHandler[Int035_IRQn](); +} + +/** + * @brief Interrupt No.036 IRQ handler + * @param None + * @retval None + */ +void IRQ036_Handler(void) +{ + m_apfnIrqHandler[Int036_IRQn](); +} + +/** + * @brief Interrupt No.037 IRQ handler + * @param None + * @retval None + */ +void IRQ037_Handler(void) +{ + m_apfnIrqHandler[Int037_IRQn](); +} + +/** + * @brief Interrupt No.038 IRQ handler + * @param None + * @retval None + */ +void IRQ038_Handler(void) +{ + m_apfnIrqHandler[Int038_IRQn](); +} + +/** + * @brief Interrupt No.039 IRQ handler + * @param None + * @retval None + */ +void IRQ039_Handler(void) +{ + m_apfnIrqHandler[Int039_IRQn](); +} + +/** + * @brief Interrupt No.040 IRQ handler + * @param None + * @retval None + */ +void IRQ040_Handler(void) +{ + m_apfnIrqHandler[Int040_IRQn](); +} + +/** + * @brief Interrupt No.041 IRQ handler + * @param None + * @retval None + */ +void IRQ041_Handler(void) +{ + m_apfnIrqHandler[Int041_IRQn](); +} + +/** + * @brief Interrupt No.042 IRQ handler + * @param None + * @retval None + */ +void IRQ042_Handler(void) +{ + m_apfnIrqHandler[Int042_IRQn](); +} + +/** + * @brief Interrupt No.043 IRQ handler + * @param None + * @retval None + */ +void IRQ043_Handler(void) +{ + m_apfnIrqHandler[Int043_IRQn](); +} + +/** + * @brief Interrupt No.044 IRQ handler + * @param None + * @retval None + */ +void IRQ044_Handler(void) +{ + m_apfnIrqHandler[Int044_IRQn](); +} + +/** + * @brief Interrupt No.045 IRQ handler + * @param None + * @retval None + */ +void IRQ045_Handler(void) +{ + m_apfnIrqHandler[Int045_IRQn](); +} + +/** + * @brief Interrupt No.046 IRQ handler + * @param None + * @retval None + */ +void IRQ046_Handler(void) +{ + m_apfnIrqHandler[Int046_IRQn](); +} + +/** + * @brief Interrupt No.047 IRQ handler + * @param None + * @retval None + */ +void IRQ047_Handler(void) +{ + m_apfnIrqHandler[Int047_IRQn](); +} + +/** + * @brief Interrupt No.048 IRQ handler + * @param None + * @retval None + */ +void IRQ048_Handler(void) +{ + m_apfnIrqHandler[Int048_IRQn](); +} + +/** + * @brief Interrupt No.049 IRQ handler + * @param None + * @retval None + */ +void IRQ049_Handler(void) +{ + m_apfnIrqHandler[Int049_IRQn](); +} + +/** + * @brief Interrupt No.050 IRQ handler + * @param None + * @retval None + */ +void IRQ050_Handler(void) +{ + m_apfnIrqHandler[Int050_IRQn](); +} + +/** + * @brief Interrupt No.051 IRQ handler + * @param None + * @retval None + */ +void IRQ051_Handler(void) +{ + m_apfnIrqHandler[Int051_IRQn](); +} + +/** + * @brief Interrupt No.052 IRQ handler + * @param None + * @retval None + */ +void IRQ052_Handler(void) +{ + m_apfnIrqHandler[Int052_IRQn](); +} + +/** + * @brief Interrupt No.053 IRQ handler + * @param None + * @retval None + */ +void IRQ053_Handler(void) +{ + m_apfnIrqHandler[Int053_IRQn](); +} + +/** + * @brief Interrupt No.054 IRQ handler + * @param None + * @retval None + */ +void IRQ054_Handler(void) +{ + m_apfnIrqHandler[Int054_IRQn](); +} + +/** + * @brief Interrupt No.055 IRQ handler + * @param None + * @retval None + */ +void IRQ055_Handler(void) +{ + m_apfnIrqHandler[Int055_IRQn](); +} + +/** + * @brief Interrupt No.056 IRQ handler + * @param None + * @retval None + */ +void IRQ056_Handler(void) +{ + m_apfnIrqHandler[Int056_IRQn](); +} + +/** + * @brief Interrupt No.057 IRQ handler + * @param None + * @retval None + */ +void IRQ057_Handler(void) +{ + m_apfnIrqHandler[Int057_IRQn](); +} + +/** + * @brief Interrupt No.058 IRQ handler + * @param None + * @retval None + */ +void IRQ058_Handler(void) +{ + m_apfnIrqHandler[Int058_IRQn](); +} + +/** + * @brief Interrupt No.059 IRQ handler + * @param None + * @retval None + */ +void IRQ059_Handler(void) +{ + m_apfnIrqHandler[Int059_IRQn](); +} + +/** + * @brief Interrupt No.060 IRQ handler + * @param None + * @retval None + */ +void IRQ060_Handler(void) +{ + m_apfnIrqHandler[Int060_IRQn](); +} + +/** + * @brief Interrupt No.061 IRQ handler + * @param None + * @retval None + */ +void IRQ061_Handler(void) +{ + m_apfnIrqHandler[Int061_IRQn](); +} + +/** + * @brief Interrupt No.062 IRQ handler + * @param None + * @retval None + */ +void IRQ062_Handler(void) +{ + m_apfnIrqHandler[Int062_IRQn](); +} + +/** + * @brief Interrupt No.063 IRQ handler + * @param None + * @retval None + */ +void IRQ063_Handler(void) +{ + m_apfnIrqHandler[Int063_IRQn](); +} + +/** + * @brief Interrupt No.064 IRQ handler + * @param None + * @retval None + */ +void IRQ064_Handler(void) +{ + m_apfnIrqHandler[Int064_IRQn](); +} + +/** + * @brief Interrupt No.065 IRQ handler + * @param None + * @retval None + */ +void IRQ065_Handler(void) +{ + m_apfnIrqHandler[Int065_IRQn](); +} + +/** + * @brief Interrupt No.066 IRQ handler + * @param None + * @retval None + */ +void IRQ066_Handler(void) +{ + m_apfnIrqHandler[Int066_IRQn](); +} + +/** + * @brief Interrupt No.067 IRQ handler + * @param None + * @retval None + */ +void IRQ067_Handler(void) +{ + m_apfnIrqHandler[Int067_IRQn](); +} + +/** + * @brief Interrupt No.068 IRQ handler + * @param None + * @retval None + */ +void IRQ068_Handler(void) +{ + m_apfnIrqHandler[Int068_IRQn](); +} + +/** + * @brief Interrupt No.069 IRQ handler + * @param None + * @retval None + */ +void IRQ069_Handler(void) +{ + m_apfnIrqHandler[Int069_IRQn](); +} + +/** + * @brief Interrupt No.070 IRQ handler + * @param None + * @retval None + */ +void IRQ070_Handler(void) +{ + m_apfnIrqHandler[Int070_IRQn](); +} + +/** + * @brief Interrupt No.071 IRQ handler + * @param None + * @retval None + */ +void IRQ071_Handler(void) +{ + m_apfnIrqHandler[Int071_IRQn](); +} + +/** + * @brief Interrupt No.072 IRQ handler + * @param None + * @retval None + */ +void IRQ072_Handler(void) +{ + m_apfnIrqHandler[Int072_IRQn](); +} + +/** + * @brief Interrupt No.073 IRQ handler + * @param None + * @retval None + */ +void IRQ073_Handler(void) +{ + m_apfnIrqHandler[Int073_IRQn](); +} + +/** + * @brief Interrupt No.074 IRQ handler + * @param None + * @retval None + */ +void IRQ074_Handler(void) +{ + m_apfnIrqHandler[Int074_IRQn](); +} + +/** + * @brief Interrupt No.075 IRQ handler + * @param None + * @retval None + */ +void IRQ075_Handler(void) +{ + m_apfnIrqHandler[Int075_IRQn](); +} + +/** + * @brief Interrupt No.076 IRQ handler + * @param None + * @retval None + */ +void IRQ076_Handler(void) +{ + m_apfnIrqHandler[Int076_IRQn](); +} + +/** + * @brief Interrupt No.077 IRQ handler + * @param None + * @retval None + */ +void IRQ077_Handler(void) +{ + m_apfnIrqHandler[Int077_IRQn](); +} + +/** + * @brief Interrupt No.078 IRQ handler + * @param None + * @retval None + */ +void IRQ078_Handler(void) +{ + m_apfnIrqHandler[Int078_IRQn](); +} + +/** + * @brief Interrupt No.079 IRQ handler + * @param None + * @retval None + */ +void IRQ079_Handler(void) +{ + m_apfnIrqHandler[Int079_IRQn](); +} + +/** + * @brief Interrupt No.080 IRQ handler + * @param None + * @retval None + */ +void IRQ080_Handler(void) +{ + m_apfnIrqHandler[Int080_IRQn](); +} + +/** + * @brief Interrupt No.081 IRQ handler + * @param None + * @retval None + */ +void IRQ081_Handler(void) +{ + m_apfnIrqHandler[Int081_IRQn](); +} + +/** + * @brief Interrupt No.082 IRQ handler + * @param None + * @retval None + */ +void IRQ082_Handler(void) +{ + m_apfnIrqHandler[Int082_IRQn](); +} + +/** + * @brief Interrupt No.083 IRQ handler + * @param None + * @retval None + */ +void IRQ083_Handler(void) +{ + m_apfnIrqHandler[Int083_IRQn](); +} + +/** + * @brief Interrupt No.084 IRQ handler + * @param None + * @retval None + */ +void IRQ084_Handler(void) +{ + m_apfnIrqHandler[Int084_IRQn](); +} + +/** + * @brief Interrupt No.085 IRQ handler + * @param None + * @retval None + */ +void IRQ085_Handler(void) +{ + m_apfnIrqHandler[Int085_IRQn](); +} + +/** + * @brief Interrupt No.086 IRQ handler + * @param None + * @retval None + */ +void IRQ086_Handler(void) +{ + m_apfnIrqHandler[Int086_IRQn](); +} + +/** + * @brief Interrupt No.087 IRQ handler + * @param None + * @retval None + */ +void IRQ087_Handler(void) +{ + m_apfnIrqHandler[Int087_IRQn](); +} + +/** + * @brief Interrupt No.088 IRQ handler + * @param None + * @retval None + */ +void IRQ088_Handler(void) +{ + m_apfnIrqHandler[Int088_IRQn](); +} + +/** + * @brief Interrupt No.089 IRQ handler + * @param None + * @retval None + */ +void IRQ089_Handler(void) +{ + m_apfnIrqHandler[Int089_IRQn](); +} + +/** + * @brief Interrupt No.090 IRQ handler + * @param None + * @retval None + */ +void IRQ090_Handler(void) +{ + m_apfnIrqHandler[Int090_IRQn](); +} + +/** + * @brief Interrupt No.091 IRQ handler + * @param None + * @retval None + */ +void IRQ091_Handler(void) +{ + m_apfnIrqHandler[Int091_IRQn](); +} + +/** + * @brief Interrupt No.092 IRQ handler + * @param None + * @retval None + */ +void IRQ092_Handler(void) +{ + m_apfnIrqHandler[Int092_IRQn](); +} + +/** + * @brief Interrupt No.093 IRQ handler + * @param None + * @retval None + */ +void IRQ093_Handler(void) +{ + m_apfnIrqHandler[Int093_IRQn](); +} + +/** + * @brief Interrupt No.094 IRQ handler + * @param None + * @retval None + */ +void IRQ094_Handler(void) +{ + m_apfnIrqHandler[Int094_IRQn](); +} + +/** + * @brief Interrupt No.095 IRQ handler + * @param None + * @retval None + */ +void IRQ095_Handler(void) +{ + m_apfnIrqHandler[Int095_IRQn](); +} + +/** + * @brief Interrupt No.096 IRQ handler + * @param None + * @retval None + */ +void IRQ096_Handler(void) +{ + m_apfnIrqHandler[Int096_IRQn](); +} + +/** + * @brief Interrupt No.097 IRQ handler + * @param None + * @retval None + */ +void IRQ097_Handler(void) +{ + m_apfnIrqHandler[Int097_IRQn](); +} + +/** + * @brief Interrupt No.098 IRQ handler + * @param None + * @retval None + */ +void IRQ098_Handler(void) +{ + m_apfnIrqHandler[Int098_IRQn](); +} + +/** + * @brief Interrupt No.099 IRQ handler + * @param None + * @retval None + */ +void IRQ099_Handler(void) +{ + m_apfnIrqHandler[Int099_IRQn](); +} + +/** + * @brief Interrupt No.100 IRQ handler + * @param None + * @retval None + */ +void IRQ100_Handler(void) +{ + m_apfnIrqHandler[Int100_IRQn](); +} + +/** + * @brief Interrupt No.101 IRQ handler + * @param None + * @retval None + */ +void IRQ101_Handler(void) +{ + m_apfnIrqHandler[Int101_IRQn](); +} + +/** + * @brief Interrupt No.102 IRQ handler + * @param None + * @retval None + */ +void IRQ102_Handler(void) +{ + m_apfnIrqHandler[Int102_IRQn](); +} + +/** + * @brief Interrupt No.103 IRQ handler + * @param None + * @retval None + */ +void IRQ103_Handler(void) +{ + m_apfnIrqHandler[Int103_IRQn](); +} + +/** + * @brief Interrupt No.104 IRQ handler + * @param None + * @retval None + */ +void IRQ104_Handler(void) +{ + m_apfnIrqHandler[Int104_IRQn](); +} + +/** + * @brief Interrupt No.105 IRQ handler + * @param None + * @retval None + */ +void IRQ105_Handler(void) +{ + m_apfnIrqHandler[Int105_IRQn](); +} + +/** + * @brief Interrupt No.106 IRQ handler + * @param None + * @retval None + */ +void IRQ106_Handler(void) +{ + m_apfnIrqHandler[Int106_IRQn](); +} + +/** + * @brief Interrupt No.107 IRQ handler + * @param None + * @retval None + */ +void IRQ107_Handler(void) +{ + m_apfnIrqHandler[Int107_IRQn](); +} + +/** + * @brief Interrupt No.108 IRQ handler + * @param None + * @retval None + */ +void IRQ108_Handler(void) +{ + m_apfnIrqHandler[Int108_IRQn](); +} + +/** + * @brief Interrupt No.109 IRQ handler + * @param None + * @retval None + */ +void IRQ109_Handler(void) +{ + m_apfnIrqHandler[Int109_IRQn](); +} + +/** + * @brief Interrupt No.110 IRQ handler + * @param None + * @retval None + */ +void IRQ110_Handler(void) +{ + m_apfnIrqHandler[Int110_IRQn](); +} + +/** + * @brief Interrupt No.111 IRQ handler + * @param None + * @retval None + */ +void IRQ111_Handler(void) +{ + m_apfnIrqHandler[Int111_IRQn](); +} + +/** + * @brief Interrupt No.112 IRQ handler + * @param None + * @retval None + */ +void IRQ112_Handler(void) +{ + m_apfnIrqHandler[Int112_IRQn](); +} + +/** + * @brief Interrupt No.113 IRQ handler + * @param None + * @retval None + */ +void IRQ113_Handler(void) +{ + m_apfnIrqHandler[Int113_IRQn](); +} + +/** + * @brief Interrupt No.114 IRQ handler + * @param None + * @retval None + */ +void IRQ114_Handler(void) +{ + m_apfnIrqHandler[Int114_IRQn](); +} + +/** + * @brief Interrupt No.115 IRQ handler + * @param None + * @retval None + */ +void IRQ115_Handler(void) +{ + m_apfnIrqHandler[Int115_IRQn](); +} + +/** + * @brief Interrupt No.116 IRQ handler + * @param None + * @retval None + */ +void IRQ116_Handler(void) +{ + m_apfnIrqHandler[Int116_IRQn](); +} + +/** + * @brief Interrupt No.117 IRQ handler + * @param None + * @retval None + */ +void IRQ117_Handler(void) +{ + m_apfnIrqHandler[Int117_IRQn](); +} + +/** + * @brief Interrupt No.118 IRQ handler + * @param None + * @retval None + */ +void IRQ118_Handler(void) +{ + m_apfnIrqHandler[Int118_IRQn](); +} + +/** + * @brief Interrupt No.119 IRQ handler + * @param None + * @retval None + */ +void IRQ119_Handler(void) +{ + m_apfnIrqHandler[Int119_IRQn](); +} + +/** + * @brief Interrupt No.120 IRQ handler + * @param None + * @retval None + */ +void IRQ120_Handler(void) +{ + m_apfnIrqHandler[Int120_IRQn](); +} + +/** + * @brief Interrupt No.121 IRQ handler + * @param None + * @retval None + */ +void IRQ121_Handler(void) +{ + m_apfnIrqHandler[Int121_IRQn](); +} + +/** + * @brief Interrupt No.122 IRQ handler + * @param None + * @retval None + */ +void IRQ122_Handler(void) +{ + m_apfnIrqHandler[Int122_IRQn](); +} + +/** + * @brief Interrupt No.123 IRQ handler + * @param None + * @retval None + */ +void IRQ123_Handler(void) +{ + m_apfnIrqHandler[Int123_IRQn](); +} + +/** + * @brief Interrupt No.124 IRQ handler + * @param None + * @retval None + */ +void IRQ124_Handler(void) +{ + m_apfnIrqHandler[Int124_IRQn](); +} + +/** + * @brief Interrupt No.125 IRQ handler + * @param None + * @retval None + */ +void IRQ125_Handler(void) +{ + m_apfnIrqHandler[Int125_IRQn](); +} + +/** + * @brief Interrupt No.126 IRQ handler + * @param None + * @retval None + */ +void IRQ126_Handler(void) +{ + m_apfnIrqHandler[Int126_IRQn](); +} + +/** + * @brief Interrupt No.127 IRQ handler + * @param None + * @retval None + */ +void IRQ127_Handler(void) +{ + m_apfnIrqHandler[Int127_IRQn](); +} + +/** + * @brief Interrupt No.128 share IRQ handler + * @param None + * @retval None + */ +void IRQ128_Handler(void) +{ + const uint32_t VSSEL128 = M4_INTC->VSSEL128; + + /* external interrupt 00 */ + if ((1UL == bM4_INTC->EIFR_b.EIFR0) && (0UL != (VSSEL128 & BIT_MASK_00))) + { + EXTINT_00_IrqHandler(); + } + /* external interrupt 01 */ + if ((1UL == bM4_INTC->EIFR_b.EIFR1) && (0UL != (VSSEL128 & BIT_MASK_01))) + { + EXTINT_01_IrqHandler(); + } + /* external interrupt 02 */ + if ((1UL == bM4_INTC->EIFR_b.EIFR2) && (0UL != (VSSEL128 & BIT_MASK_02))) + { + EXTINT_02_IrqHandler(); + } + /* external interrupt 03 */ + if ((1UL == bM4_INTC->EIFR_b.EIFR3) && (0UL != (VSSEL128 & BIT_MASK_03))) + { + EXTINT_03_IrqHandler(); + } + /* external interrupt 04 */ + if ((1UL == bM4_INTC->EIFR_b.EIFR4) && (0UL != (VSSEL128 & BIT_MASK_04))) + { + EXTINT_04_IrqHandler(); + } + /* external interrupt 05 */ + if ((1UL == bM4_INTC->EIFR_b.EIFR5) && (0UL != (VSSEL128 & BIT_MASK_05))) + { + EXTINT_05_IrqHandler(); + } + /* external interrupt 06 */ + if ((1UL == bM4_INTC->EIFR_b.EIFR6) && (0UL != (VSSEL128 & BIT_MASK_06))) + { + EXTINT_06_IrqHandler(); + } + /* external interrupt 07 */ + if ((1UL == bM4_INTC->EIFR_b.EIFR7) && (0UL != (VSSEL128 & BIT_MASK_07))) + { + EXTINT_07_IrqHandler(); + } + /* external interrupt 08 */ + if ((1UL == bM4_INTC->EIFR_b.EIFR8) && (0UL != (VSSEL128 & BIT_MASK_08))) + { + EXTINT_08_IrqHandler(); + } + /* external interrupt 09 */ + if ((1UL == bM4_INTC->EIFR_b.EIFR9) && (0UL != (VSSEL128 & BIT_MASK_09))) + { + EXTINT_09_IrqHandler(); + } + /* external interrupt 10 */ + if ((1UL == bM4_INTC->EIFR_b.EIFR10) && (0UL != (VSSEL128 & BIT_MASK_10))) + { + EXTINT_10_IrqHandler(); + } + /* external interrupt 11 */ + if ((1UL == bM4_INTC->EIFR_b.EIFR11) && (0UL != (VSSEL128 & BIT_MASK_11))) + { + EXTINT_11_IrqHandler(); + } + /* external interrupt 12 */ + if ((1UL == bM4_INTC->EIFR_b.EIFR12) && (0UL != (VSSEL128 & BIT_MASK_12))) + { + EXTINT_12_IrqHandler(); + } + /* external interrupt 13 */ + if ((1UL == bM4_INTC->EIFR_b.EIFR13) && (0UL != (VSSEL128 & BIT_MASK_13))) + { + EXTINT_13_IrqHandler(); + } + /* external interrupt 14 */ + if ((1UL == bM4_INTC->EIFR_b.EIFR14) && (0UL != (VSSEL128 & BIT_MASK_14))) + { + EXTINT_14_IrqHandler(); + } + /* external interrupt 15 */ + if ((1UL == bM4_INTC->EIFR_b.EIFR15) && (0UL != (VSSEL128 & BIT_MASK_15))) + { + EXTINT_15_IrqHandler(); + } +} + +/** + * @brief Interrupt No.129 share IRQ handler + * @param None + * @retval None + */ +void IRQ129_Handler(void) +{ + const uint32_t VSSEL129 = M4_INTC->VSSEL129; + uint32_t u32Tmp1; + uint32_t u32Tmp2; + + /* DMA1 Ch.0 interrupt enabled */ + if (1UL == bM4_DMA1->CHCTL0_b.IE) + { + /* DMA1 Ch.0 Tx completed */ + if (0UL == bM4_DMA1->INTMASK1_b.MSKTC0) + { + if ((1UL == bM4_DMA1->INTSTAT1_b.TC0) && (0UL != (VSSEL129 & BIT_MASK_00))) + { + DMA_1_Tc0_IrqHandler(); + } + } + /* DMA1 ch.0 Block Tx completed */ + if (0UL == bM4_DMA1->INTMASK1_b.MSKBTC0) + { + if ((1UL == bM4_DMA1->INTSTAT1_b.BTC0) && (0UL != (VSSEL129 & BIT_MASK_08))) + { + DMA_1_Btc0_IrqHandler(); + } + } + /* DMA1 ch.0 Transfer/Request Error */ + u32Tmp1 = M4_DMA1->INTSTAT0 & (BIT_MASK_00 | BIT_MASK_16); + u32Tmp2 = (uint32_t)(~(M4_DMA1->INTMASK0) & (BIT_MASK_00 | BIT_MASK_16)); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL129 & BIT_MASK_16))) + { + DMA_1_Err0_IrqHandler(); + } + } + /* DMA1 Ch.1 interrupt enabled */ + if (1UL == bM4_DMA1->CHCTL1_b.IE) + { + /* DMA1 Ch.1 Tx completed */ + if (0UL == bM4_DMA1->INTMASK1_b.MSKTC1) + { + if ((1UL == bM4_DMA1->INTSTAT1_b.TC1) && (0UL != (VSSEL129 & BIT_MASK_01))) + { + DMA_1_Tc1_IrqHandler(); + } + } + /* DMA1 ch.1 Block Tx completed */ + if (0UL == bM4_DMA1->INTMASK1_b.MSKBTC1) + { + if ((1UL == bM4_DMA1->INTSTAT1_b.BTC1) && (0UL != (VSSEL129 & BIT_MASK_09))) + { + DMA_1_Btc1_IrqHandler(); + } + } + /* DMA1 ch.1 Transfer/Request Error */ + u32Tmp1 = M4_DMA1->INTSTAT0 & (BIT_MASK_01 | BIT_MASK_17); + u32Tmp2 = (uint32_t)(~(M4_DMA1->INTMASK0) & (BIT_MASK_01 | BIT_MASK_17)); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL129 & BIT_MASK_16))) + { + DMA_1_Err1_IrqHandler(); + } + } + /* DMA1 Ch.2 interrupt enabled */ + if (1UL == bM4_DMA1->CHCTL2_b.IE) + { + /* DMA1 Ch.2 Tx completed */ + if (0UL == bM4_DMA1->INTMASK1_b.MSKTC2) + { + if ((1UL == bM4_DMA1->INTSTAT1_b.TC2) && (0UL != (VSSEL129 & BIT_MASK_02))) + { + DMA_1_Tc2_IrqHandler(); + } + } + /* DMA1 ch.2 Block Tx completed */ + if (0UL == bM4_DMA1->INTMASK1_b.MSKBTC2) + { + if ((1UL == bM4_DMA1->INTSTAT1_b.BTC2) && (0UL != (VSSEL129 & BIT_MASK_10))) + { + DMA_1_Btc2_IrqHandler(); + } + } + /* DMA1 ch.2 Transfer/Request Error */ + u32Tmp1 = M4_DMA1->INTSTAT0 & (BIT_MASK_02 | BIT_MASK_18); + u32Tmp2 = (uint32_t)(~(M4_DMA1->INTMASK0) & (BIT_MASK_02 | BIT_MASK_18)); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL129 & BIT_MASK_16))) + { + DMA_1_Err2_IrqHandler(); + } + } + /* DMA1 Ch.3 interrupt enabled */ + if (1UL == bM4_DMA1->CHCTL3_b.IE) + { + /* DMA1 Ch.3 Tx completed */ + if (0UL == bM4_DMA1->INTMASK1_b.MSKTC3) + { + if ((1UL == bM4_DMA1->INTSTAT1_b.TC3) && (0UL != (VSSEL129 & BIT_MASK_03))) + { + DMA_1_Tc3_IrqHandler(); + } + } + /* DMA1 ch.3 Block Tx completed */ + if (0UL == bM4_DMA1->INTMASK1_b.MSKBTC3) + { + if ((1UL == bM4_DMA1->INTSTAT1_b.BTC3) && (0UL != (VSSEL129 & BIT_MASK_11))) + { + DMA_1_Btc3_IrqHandler(); + } + } + /* DMA1 ch.3 Transfer/Request Error */ + u32Tmp1 = M4_DMA1->INTSTAT0 & (BIT_MASK_03 | BIT_MASK_19); + u32Tmp2 = (uint32_t)(~(M4_DMA1->INTMASK0) & (BIT_MASK_03 | BIT_MASK_19)); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL129 & BIT_MASK_16))) + { + DMA_1_Err3_IrqHandler(); + } + } + /* DMA1 Ch.4 interrupt enabled */ + if (1UL == bM4_DMA1->CHCTL4_b.IE) + { + /* DMA1 Ch.4 Tx completed */ + if (0UL == bM4_DMA1->INTMASK1_b.MSKTC4) + { + if ((1UL == bM4_DMA1->INTSTAT1_b.TC4) && (0UL != (VSSEL129 & BIT_MASK_04))) + { + DMA_1_Tc4_IrqHandler(); + } + } + /* DMA1 ch.4 Block Tx completed */ + if (0UL == bM4_DMA1->INTMASK1_b.MSKBTC4) + { + if ((1UL == bM4_DMA1->INTSTAT1_b.BTC4) && (0UL != (VSSEL129 & BIT_MASK_12))) + { + DMA_1_Btc4_IrqHandler(); + } + } + /* DMA1 ch.4 Transfer/Request Error */ + u32Tmp1 = M4_DMA1->INTSTAT0 & (BIT_MASK_04 | BIT_MASK_20); + u32Tmp2 = (uint32_t)(~(M4_DMA1->INTMASK0) & (BIT_MASK_04 | BIT_MASK_20)); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL129 & BIT_MASK_16))) + { + DMA_1_Err4_IrqHandler(); + } + } + /* DMA1 Ch.5 interrupt enabled */ + if (1UL == bM4_DMA1->CHCTL5_b.IE) + { + /* DMA1 Ch.5 Tx completed */ + if (0UL == bM4_DMA1->INTMASK1_b.MSKTC5) + { + if ((1UL == bM4_DMA1->INTSTAT1_b.TC5) && (0UL != (VSSEL129 & BIT_MASK_05))) + { + DMA_1_Tc5_IrqHandler(); + } + } + /* DMA1 ch.5 Block Tx completed */ + if (0UL == bM4_DMA1->INTMASK1_b.MSKBTC5) + { + if ((1UL == bM4_DMA1->INTSTAT1_b.BTC5) && (0UL != (VSSEL129 & BIT_MASK_13))) + { + DMA_1_Btc5_IrqHandler(); + } + } + /* DMA1 ch.5 Transfer/Request Error */ + u32Tmp1 = M4_DMA1->INTSTAT0 & (BIT_MASK_05 | BIT_MASK_21); + u32Tmp2 = (uint32_t)(~(M4_DMA1->INTMASK0) & (BIT_MASK_05 | BIT_MASK_21)); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL129 & BIT_MASK_16))) + { + DMA_1_Err5_IrqHandler(); + } + } + /* DMA1 Ch.6 interrupt enabled */ + if (1UL == bM4_DMA1->CHCTL6_b.IE) + { + /* DMA1 Ch.6 Tx completed */ + if (0UL == bM4_DMA1->INTMASK1_b.MSKTC6) + { + if ((1UL == bM4_DMA1->INTSTAT1_b.TC6) && (0UL != (VSSEL129 & BIT_MASK_06))) + { + DMA_1_Tc6_IrqHandler(); + } + } + /* DMA1 ch.6 Block Tx completed */ + if (0UL == bM4_DMA1->INTMASK1_b.MSKBTC6) + { + if ((1UL == bM4_DMA1->INTSTAT1_b.BTC6) && (0UL != (VSSEL129 & BIT_MASK_14))) + { + DMA_1_Btc6_IrqHandler(); + } + } + /* DMA1 ch.6 Transfer/Request Error */ + u32Tmp1 = M4_DMA1->INTSTAT0 & (BIT_MASK_06 | BIT_MASK_22); + u32Tmp2 = (uint32_t)(~(M4_DMA1->INTMASK0) & (BIT_MASK_06 | BIT_MASK_22)); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL129 & BIT_MASK_16))) + { + DMA_1_Err6_IrqHandler(); + } + } + /* DMA1 Ch.7 interrupt enabled */ + if (1UL == bM4_DMA1->CHCTL7_b.IE) + { + /* DMA1 Ch.7 Tx completed */ + if (0UL == bM4_DMA1->INTMASK1_b.MSKTC7) + { + if ((1UL == bM4_DMA1->INTSTAT1_b.TC7) && (0UL != (VSSEL129 & BIT_MASK_07))) + { + DMA_1_Tc7_IrqHandler(); + } + } + /* DMA1 ch.7 Block Tx completed */ + if (0UL == bM4_DMA1->INTMASK1_b.MSKBTC7) + { + if ((1UL == bM4_DMA1->INTSTAT1_b.BTC7) && (0UL != (VSSEL129 & BIT_MASK_15))) + { + DMA_1_Btc7_IrqHandler(); + } + } + /* DMA1 ch.7 Transfer/Request Error */ + u32Tmp1 = M4_DMA1->INTSTAT0 & (BIT_MASK_07 | BIT_MASK_22); + u32Tmp2 = (uint32_t)(~(M4_DMA1->INTMASK0) & (BIT_MASK_07 | BIT_MASK_22)); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL129 & BIT_MASK_16))) + { + DMA_1_Err7_IrqHandler(); + } + } + /* EFM error */ + if (0UL != bM4_EFM->FITE_b.PEERRITE) + { + /* EFM program/erase/protect/otp error */ + u32Tmp1 = M4_EFM->FSR & (EFM_FSR_PRTWERR0 | EFM_FSR_PGSZERR0 | EFM_FSR_MISMTCH0 | \ + EFM_FSR_PRTWERR1 | EFM_FSR_PGSZERR1 | EFM_FSR_MISMTCH1 | \ + EFM_FSR_OTPWERR0); + if ((0UL != u32Tmp1) && (0UL != (VSSEL129 & BIT_MASK_17))) + { + EFM_PgmEraseErr_IrqHandler(); + } + } + /* EFM read collision */ + if (0UL != bM4_EFM->FITE_b.COLERRITE) + { + /* EFM read collision */ + u32Tmp1 = M4_EFM->FSR & (EFM_FSR_COLERR0 | EFM_FSR_COLERR1); + if ((0UL != u32Tmp1) && (0UL != (VSSEL129 & BIT_MASK_18))) + { + EFM_ColErr_IrqHandler(); + } + } + /* EFM operate end */ + if (0UL != bM4_EFM->FITE_b.OPTENDITE) + { + /* EFM operate end */ + u32Tmp1 = M4_EFM->FSR & (EFM_FSR_OPTEND0 | EFM_FSR_OPTEND1); + if ((0UL != u32Tmp1) && (0UL != (VSSEL129 & BIT_MASK_19))) + { + EFM_OpEnd_IrqHandler(); + } + } + /* QSPI access error */ + u32Tmp1 = M4_QSPI->SR & QSPI_SR_RAER; + if ((0UL != u32Tmp1) && (0UL != (VSSEL129 & BIT_MASK_22))) + { + QSPI_Err_IrqHandler(); + } + /*DCU1 */ + u32Tmp1 = M4_DCU1->INTEVTSEL; + u32Tmp2 = M4_DCU1->FLAG; + if ((0UL != ((u32Tmp1) & (u32Tmp2) & 0x0E7FUL)) && (0UL != (VSSEL129 & BIT_MASK_23))) + { + DCU_1_IrqHandler(); + } + /*DCU2 */ + u32Tmp1 = M4_DCU2->INTEVTSEL; + u32Tmp2 = M4_DCU2->FLAG; + if ((0UL != ((u32Tmp1) & (u32Tmp2) & 0x0E7FUL)) && (0UL != (VSSEL129 & BIT_MASK_24))) + { + DCU_2_IrqHandler(); + } + /*DCU3 */ + u32Tmp1 = M4_DCU3->INTEVTSEL; + u32Tmp2 = M4_DCU3->FLAG; + if ((0UL != ((u32Tmp1) & (u32Tmp2) & 0x0E7FUL)) && (0UL != (VSSEL129 & BIT_MASK_25))) + { + DCU_3_IrqHandler(); + } + /*DCU4 */ + u32Tmp1 = M4_DCU4->INTEVTSEL; + u32Tmp2 = M4_DCU4->FLAG; + if ((0UL != ((u32Tmp1) & (u32Tmp2) & 0x0E7FUL)) && (0UL != (VSSEL129 & BIT_MASK_26))) + { + DCU_4_IrqHandler(); + } + /*DCU5 */ + u32Tmp1 = M4_DCU5->INTEVTSEL; + u32Tmp2 = M4_DCU5->FLAG; + if ((0UL != ((u32Tmp1) & (u32Tmp2) & 0x0E7FUL)) && (0UL != (VSSEL129 & BIT_MASK_27))) + { + DCU_5_IrqHandler(); + } + /*DCU6 */ + u32Tmp1 = M4_DCU6->INTEVTSEL; + u32Tmp2 = M4_DCU6->FLAG; + if ((0UL != ((u32Tmp1) & (u32Tmp2) & 0x0E7FUL)) && (0UL != (VSSEL129 & BIT_MASK_28))) + { + DCU_6_IrqHandler(); + } + /*DCU7 */ + u32Tmp1 = M4_DCU7->INTEVTSEL; + u32Tmp2 = M4_DCU7->FLAG; + if ((0UL != ((u32Tmp1) & (u32Tmp2) & 0x0E7FUL)) && (0UL != (VSSEL129 & BIT_MASK_29))) + { + DCU_7_IrqHandler(); + } + /*DCU8 */ + u32Tmp1 = M4_DCU8->INTEVTSEL; + u32Tmp2 = M4_DCU8->FLAG; + if ((0UL != ((u32Tmp1) & (u32Tmp2) & 0x0E7FUL)) && (0UL != (VSSEL129 & BIT_MASK_30))) + { + DCU_8_IrqHandler(); + } +} + +/** + * @brief Interrupt No.130 share IRQ handler + * @param None + * @retval None + */ +void IRQ130_Handler(void) +{ + const uint32_t VSSEL130 = M4_INTC->VSSEL130; + uint32_t u32Tmp1; + uint32_t u32Tmp2; + + /* MAU square */ + if (0UL != (VSSEL130 & BIT_MASK_19)) + { + MAU_Sqrt_IrqHandler(); + } + else + { + /* DMA2 Ch.0 interrupt enabled */ + if (1UL == bM4_DMA2->CHCTL0_b.IE) + { + /* DMA2 Ch.0 Tx completed */ + if (0UL == bM4_DMA2->INTMASK1_b.MSKTC0) + { + if ((1UL == bM4_DMA2->INTSTAT1_b.TC0) && (0UL != (VSSEL130 & BIT_MASK_00))) + { + DMA_2_Tc0_IrqHandler(); + } + } + /* DMA2 ch.0 Block Tx completed */ + if (0UL == bM4_DMA2->INTMASK1_b.MSKBTC0) + { + if ((1UL == bM4_DMA2->INTSTAT1_b.BTC0) && (0UL != (VSSEL130 & BIT_MASK_08))) + { + DMA_2_Btc0_IrqHandler(); + } + } + /* DMA2 ch.0 Transfer/Request Error */ + u32Tmp1 = M4_DMA2->INTSTAT0 & (BIT_MASK_00 | BIT_MASK_16); + u32Tmp2 = (uint32_t)(~(M4_DMA2->INTMASK0) & (BIT_MASK_00 | BIT_MASK_16)); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL130 & BIT_MASK_16))) + { + DMA_2_Err0_IrqHandler(); + } + } + /* DMA2 Ch.1 interrupt enabled */ + if (1UL == bM4_DMA2->CHCTL1_b.IE) + { + /* DMA2 Ch.1 Tx completed */ + if (0UL == bM4_DMA2->INTMASK1_b.MSKTC1) + { + if ((1UL == bM4_DMA2->INTSTAT1_b.TC1) && (0UL != (VSSEL130 & BIT_MASK_01))) + { + DMA_2_Tc1_IrqHandler(); + } + } + /* DMA2 ch.1 Block Tx completed */ + if (0UL == bM4_DMA2->INTMASK1_b.MSKBTC1) + { + if ((1UL == bM4_DMA2->INTSTAT1_b.BTC1) && (0UL != (VSSEL130 & BIT_MASK_09))) + { + DMA_2_Btc1_IrqHandler(); + } + } + /* DMA2 ch.1 Transfer/Request Error */ + u32Tmp1 = M4_DMA2->INTSTAT0 & (BIT_MASK_01 | BIT_MASK_17); + u32Tmp2 = (uint32_t)(~(M4_DMA2->INTMASK0) & (BIT_MASK_01 | BIT_MASK_17)); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL130 & BIT_MASK_16))) + { + DMA_2_Err1_IrqHandler(); + } + } + /* DMA2 Ch.2 interrupt enabled */ + if (1UL == bM4_DMA2->CHCTL2_b.IE) + { + /* DMA2 Ch.2 Tx completed */ + if (0UL == bM4_DMA2->INTMASK1_b.MSKTC2) + { + if ((1UL == bM4_DMA2->INTSTAT1_b.TC2) && (0UL != (VSSEL130 & BIT_MASK_02))) + { + DMA_2_Tc2_IrqHandler(); + } + } + /* DMA2 ch.2 Block Tx completed */ + if (0UL == bM4_DMA2->INTMASK1_b.MSKBTC2) + { + if ((1UL == bM4_DMA2->INTSTAT1_b.BTC2) && (0UL != (VSSEL130 & BIT_MASK_10))) + { + DMA_2_Btc2_IrqHandler(); + } + } + /* DMA2 ch.2 Transfer/Request Error */ + u32Tmp1 = M4_DMA2->INTSTAT0 & (BIT_MASK_02 | BIT_MASK_18); + u32Tmp2 = (uint32_t)(~(M4_DMA2->INTMASK0) & (BIT_MASK_02 | BIT_MASK_18)); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL130 & BIT_MASK_16))) + { + DMA_2_Err2_IrqHandler(); + } + } + /* DMA2 Ch.3 interrupt enabled */ + if (1UL == bM4_DMA2->CHCTL3_b.IE) + { + /* DMA2 Ch.3 Tx completed */ + if (0UL == bM4_DMA2->INTMASK1_b.MSKTC3) + { + if ((1UL == bM4_DMA2->INTSTAT1_b.TC3) && (0UL != (VSSEL130 & BIT_MASK_03))) + { + DMA_2_Tc3_IrqHandler(); + } + } + /* DMA2 ch.3 Block Tx completed */ + if (0UL == bM4_DMA2->INTMASK1_b.MSKBTC3) + { + if ((1UL == bM4_DMA2->INTSTAT1_b.BTC3) && (0UL != (VSSEL130 & BIT_MASK_11))) + { + DMA_2_Btc3_IrqHandler(); + } + } + /* DMA2 ch.3 Transfer/Request Error */ + u32Tmp1 = M4_DMA2->INTSTAT0 & (BIT_MASK_03 | BIT_MASK_19); + u32Tmp2 = (uint32_t)(~(M4_DMA2->INTMASK0) & (BIT_MASK_03 | BIT_MASK_19)); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL130 & BIT_MASK_16))) + { + DMA_2_Err3_IrqHandler(); + } + } + /* DMA2 Ch.4 interrupt enabled */ + if (1UL == bM4_DMA2->CHCTL4_b.IE) + { + /* DMA2 Ch.4 Tx completed */ + if (0UL == bM4_DMA2->INTMASK1_b.MSKTC4) + { + if ((1UL == bM4_DMA2->INTSTAT1_b.TC4) && (0UL != (VSSEL130 & BIT_MASK_04))) + { + DMA_2_Tc4_IrqHandler(); + } + } + /* DMA2 ch.4 Block Tx completed */ + if (0UL == bM4_DMA2->INTMASK1_b.MSKBTC4) + { + if ((1UL == bM4_DMA2->INTSTAT1_b.BTC4) && (0UL != (VSSEL130 & BIT_MASK_12))) + { + DMA_2_Btc4_IrqHandler(); + } + } + /* DMA2 ch.4 Transfer/Request Error */ + u32Tmp1 = M4_DMA2->INTSTAT0 & (BIT_MASK_04 | BIT_MASK_20); + u32Tmp2 = (uint32_t)(~(M4_DMA2->INTMASK0) & (BIT_MASK_04 | BIT_MASK_20)); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL130 & BIT_MASK_16))) + { + DMA_2_Err4_IrqHandler(); + } + } + /* DMA2 Ch.5 interrupt enabled */ + if (1UL == bM4_DMA2->CHCTL5_b.IE) + { + /* DMA2 Ch.5 Tx completed */ + if (0UL == bM4_DMA2->INTMASK1_b.MSKTC5) + { + if ((1UL == bM4_DMA2->INTSTAT1_b.TC5) && (0UL != (VSSEL130 & BIT_MASK_05))) + { + DMA_2_Tc5_IrqHandler(); + } + } + /* DMA2 ch.5 Block Tx completed */ + if (0UL == bM4_DMA2->INTMASK1_b.MSKBTC5) + { + if ((1UL == bM4_DMA2->INTSTAT1_b.BTC5) && (0UL != (VSSEL130 & BIT_MASK_13))) + { + DMA_2_Btc5_IrqHandler(); + } + } + /* DMA2 ch.5 Transfer/Request Error */ + u32Tmp1 = M4_DMA2->INTSTAT0 & (BIT_MASK_05 | BIT_MASK_21); + u32Tmp2 = (uint32_t)(~(M4_DMA2->INTMASK0) & (BIT_MASK_05 | BIT_MASK_21)); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL130 & BIT_MASK_16))) + { + DMA_2_Err5_IrqHandler(); + } + } + /* DMA2 Ch.6 interrupt enabled */ + if (1UL == bM4_DMA2->CHCTL6_b.IE) + { + /* DMA2 Ch.6 Tx completed */ + if (0UL == bM4_DMA2->INTMASK1_b.MSKTC6) + { + if ((1UL == bM4_DMA2->INTSTAT1_b.TC6) && (0UL != (VSSEL130 & BIT_MASK_06))) + { + DMA_2_Tc6_IrqHandler(); + } + } + /* DMA2 ch.6 Block Tx completed */ + if (0UL == bM4_DMA2->INTMASK1_b.MSKBTC6) + { + if ((1UL == bM4_DMA2->INTSTAT1_b.BTC6) && (0UL != (VSSEL130 & BIT_MASK_14))) + { + DMA_2_Btc6_IrqHandler(); + } + } + /* DMA2 ch.6 Transfer/Request Error */ + u32Tmp1 = M4_DMA2->INTSTAT0 & (BIT_MASK_06 | BIT_MASK_22); + u32Tmp2 = (uint32_t)(~(M4_DMA2->INTMASK0) & (BIT_MASK_06 | BIT_MASK_22)); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL130 & BIT_MASK_16))) + { + DMA_2_Err6_IrqHandler(); + } + } + /* DMA2 Ch.7 interrupt enabled */ + if (1UL == bM4_DMA2->CHCTL7_b.IE) + { + /* DMA2 Ch.7 Tx completed */ + if (0UL == bM4_DMA2->INTMASK1_b.MSKTC7) + { + if ((1UL == bM4_DMA2->INTSTAT1_b.TC7) && (0UL != (VSSEL130 & BIT_MASK_07))) + { + DMA_2_Tc7_IrqHandler(); + } + } + /* DMA2 ch.7 Block Tx completed */ + if (0UL == bM4_DMA2->INTMASK1_b.MSKBTC7) + { + if ((1UL == bM4_DMA2->INTSTAT1_b.BTC7) && (0UL != (VSSEL130 & BIT_MASK_15))) + { + DMA_2_Btc7_IrqHandler(); + } + } + /* DMA2 ch.7 Transfer/Request Error */ + u32Tmp1 = M4_DMA2->INTSTAT0 & (BIT_MASK_07 | BIT_MASK_22); + u32Tmp2 = (uint32_t)(~(M4_DMA2->INTMASK0) & (BIT_MASK_07 | BIT_MASK_22)); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL130 & BIT_MASK_16))) + { + DMA_2_Err7_IrqHandler(); + } + } + /* DVP frame start */ + if (1UL == bM4_DVP->IER_b.FSIEN) + { + if ((1UL == bM4_DVP->STR_b.FSF) && (0UL != (VSSEL130 & BIT_MASK_20))) + { + DVP_FrameStart_IrqHandler(); + } + } + /* DVP line start */ + if (1UL == bM4_DVP->IER_b.LSIEN) + { + if ((1UL == bM4_DVP->STR_b.LSF) && (0UL != (VSSEL130 & BIT_MASK_21))) + { + DVP_LineStart_IrqHandler(); + } + } + /* DVP line end */ + if (1UL == bM4_DVP->IER_b.LEIEN) + { + if ((1UL == bM4_DVP->STR_b.LEF) && (0UL != (VSSEL130 & BIT_MASK_22))) + { + DVP_LineEnd_IrqHandler(); + } + } + /* DVP frame end */ + if (1UL == bM4_DVP->IER_b.FEIEN) + { + if ((1UL == bM4_DVP->STR_b.FEF) && (0UL != (VSSEL130 & BIT_MASK_23))) + { + DVP_FrameEnd_IrqHandler(); + } + } + /* DVP software sync err */ + if (1UL == bM4_DVP->IER_b.SQUERIEN) + { + if ((1UL == bM4_DVP->STR_b.SQUERF) && (0UL != (VSSEL130 & BIT_MASK_24))) + { + DVP_SwSyncErr_IrqHandler(); + } + } + /* DVP fifo overfolw err */ + if (1UL == bM4_DVP->IER_b.FIFOERIEN) + { + if ((1UL == bM4_DVP->STR_b.FIFOERF) && (0UL != (VSSEL130 & BIT_MASK_25))) + { + DVP_FifoErr_IrqHandler(); + } + } + /* FMAC 1 */ + if (1UL == bM4_FMAC1->IER_b.INTEN) + { + if ((1UL == bM4_FMAC1->STR_b.READY) && (0UL != (VSSEL130 & BIT_MASK_27))) + { + FMAC_1_IrqHandler(); + } + } + /* FMAC 2 */ + if (1UL == bM4_FMAC2->IER_b.INTEN) + { + if ((1UL == bM4_FMAC2->STR_b.READY) && (0UL != (VSSEL130 & BIT_MASK_28))) + { + FMAC_2_IrqHandler(); + } + } + /* FMAC 3 */ + if (1UL == bM4_FMAC3->IER_b.INTEN) + { + if ((1UL == bM4_FMAC3->STR_b.READY) && (0UL != (VSSEL130 & BIT_MASK_29))) + { + FMAC_3_IrqHandler(); + } + } + /* FMAC 4 */ + if (1UL == bM4_FMAC4->IER_b.INTEN) + { + if ((1UL == bM4_FMAC4->STR_b.READY) && (0UL != (VSSEL130 & BIT_MASK_30))) + { + FMAC_4_IrqHandler(); + } + } + } +} + +/** + * @brief Interrupt No.131 share IRQ handler + * @param None + * @retval None + */ +void IRQ131_Handler(void) +{ + const uint32_t VSSEL131 = M4_INTC->VSSEL131; + uint32_t u32Tmp1; + + /* Timer0 unit1, Ch.A compare match */ + if (1UL == bM4_TMR0_1->BCONR_b.INTENA) + { + if ((1UL ==bM4_TMR0_1->STFLR_b.CMFA) && (0UL != (VSSEL131 & BIT_MASK_00))) + { + TMR0_1_CmpA_IrqHandler(); + } + } + /* Timer0 unit1, Ch.B compare match */ + if (1UL == bM4_TMR0_1->BCONR_b.INTENB) + { + if ((1UL ==bM4_TMR0_1->STFLR_b.CMFB) && (0UL != (VSSEL131 & BIT_MASK_01))) + { + TMR0_1_CmpB_IrqHandler(); + } + } + /* Timer0 unit2, Ch.A compare match */ + if (1UL == bM4_TMR0_2->BCONR_b.INTENA) + { + if ((1UL ==bM4_TMR0_2->STFLR_b.CMFA) && (0UL != (VSSEL131 & BIT_MASK_02))) + { + TMR0_2_CmpA_IrqHandler(); + } + } + /* Timer0 unit2, Ch.B compare match */ + if (1UL == bM4_TMR0_2->BCONR_b.INTENB) + { + if ((1UL ==bM4_TMR0_2->STFLR_b.CMFB) && (0UL != (VSSEL131 & BIT_MASK_03))) + { + TMR0_2_CmpB_IrqHandler(); + } + } + /* Timer2 unit1, Ch.A compare match */ + if (1UL == bM4_TMR2_1->ICONR_b.CMENA) + { + if ((1UL == bM4_TMR2_1->STFLR_b.CMFA) && (0UL != (VSSEL131 & BIT_MASK_04))) + { + TMR2_1_CmpA_IrqHandler(); + } + } + /* Timer2 unit1, Ch.B compare match */ + if (1UL == bM4_TMR2_1->ICONR_b.CMENB) + { + if ((1UL == bM4_TMR2_1->STFLR_b.CMFB) && (0UL != (VSSEL131 & BIT_MASK_05))) + { + TMR2_1_CmpB_IrqHandler(); + } + } + /* Timer2 unit1, Ch.A overflow */ + if (1UL == bM4_TMR2_1->ICONR_b.OVENA) + { + if ((1UL == bM4_TMR2_1->STFLR_b.OVFA) && (0UL != (VSSEL131 & BIT_MASK_06))) + { + TMR2_1_OvfA_IrqHandler(); + } + } + /* Timer2 unit1, Ch.B overflow */ + if (1UL == bM4_TMR2_1->ICONR_b.OVENB) + { + if ((1UL == bM4_TMR2_1->STFLR_b.OVFB) && (0UL != (VSSEL131 & BIT_MASK_07))) + { + TMR2_1_OvfB_IrqHandler(); + } + } + /* Timer2 unit2, Ch.A compare match */ + if (1UL == bM4_TMR2_2->ICONR_b.CMENA) + { + if ((1UL == bM4_TMR2_2->STFLR_b.CMFA) && (0UL != (VSSEL131 & BIT_MASK_08))) + { + TMR2_2_CmpA_IrqHandler(); + } + } + /* Timer2 unit2, Ch.B compare match */ + if (1UL == bM4_TMR2_2->ICONR_b.CMENB) + { + if ((1UL == bM4_TMR2_2->STFLR_b.CMFB) && (0UL != (VSSEL131 & BIT_MASK_09))) + { + TMR2_2_CmpB_IrqHandler(); + } + } + /* Timer2 unit2, Ch.A overflow */ + if (1UL == bM4_TMR2_2->ICONR_b.OVENA) + { + if ((1UL == bM4_TMR2_2->STFLR_b.OVFA) && (0UL != (VSSEL131 & BIT_MASK_10))) + { + TMR2_2_OvfA_IrqHandler(); + } + } + /* Timer2 unit2, Ch.B overflow */ + if (1UL == bM4_TMR2_2->ICONR_b.OVENB) + { + if ((1UL == bM4_TMR2_2->STFLR_b.OVFB) && (0UL != (VSSEL131 & BIT_MASK_11))) + { + TMR2_2_OvfB_IrqHandler(); + } + } + /* Timer2 unit3, Ch.A compare match */ + if (1UL == bM4_TMR2_3->ICONR_b.CMENA) + { + if ((1UL == bM4_TMR2_3->STFLR_b.CMFA) && (0UL != (VSSEL131 & BIT_MASK_12))) + { + TMR2_3_CmpA_IrqHandler(); + } + } + /* Timer2 unit3, Ch.B compare match */ + if (1UL == bM4_TMR2_3->ICONR_b.CMENB) + { + if ((1UL == bM4_TMR2_3->STFLR_b.CMFB) && (0UL != (VSSEL131 & BIT_MASK_13))) + { + TMR2_3_CmpB_IrqHandler(); + } + } + /* Timer2 unit3, Ch.A overflow */ + if (1UL == bM4_TMR2_3->ICONR_b.OVENA) + { + if ((1UL == bM4_TMR2_3->STFLR_b.OVFA) && (0UL != (VSSEL131 & BIT_MASK_14))) + { + TMR2_3_OvfA_IrqHandler(); + } + } + /* Timer2 unit3, Ch.B overflow */ + if (1UL == bM4_TMR2_3->ICONR_b.OVENB) + { + if ((1UL == bM4_TMR2_3->STFLR_b.OVFB) && (0UL != (VSSEL131 & BIT_MASK_15))) + { + TMR2_3_OvfB_IrqHandler(); + } + } + /* Timer2 unit4, Ch.A compare match */ + if (1UL == bM4_TMR2_4->ICONR_b.CMENA) + { + if ((1UL == bM4_TMR2_4->STFLR_b.CMFA) && (0UL != (VSSEL131 & BIT_MASK_16))) + { + TMR2_4_CmpA_IrqHandler(); + } + } + /* Timer2 unit4, Ch.B compare match */ + if (1UL == bM4_TMR2_4->ICONR_b.CMENB) + { + if ((1UL == bM4_TMR2_4->STFLR_b.CMFB) && (0UL != (VSSEL131 & BIT_MASK_17))) + { + TMR2_4_CmpB_IrqHandler(); + } + } + /* Timer2 unit4, Ch.A overflow */ + if (1UL == bM4_TMR2_4->ICONR_b.OVENA) + { + if ((1UL == bM4_TMR2_4->STFLR_b.OVFA) && (0UL != (VSSEL131 & BIT_MASK_18))) + { + TMR2_4_OvfA_IrqHandler(); + } + } + /* Timer2 unit4, Ch.B overflow */ + if (1UL == bM4_TMR2_4->ICONR_b.OVENB) + { + if ((1UL == bM4_TMR2_4->STFLR_b.OVFB) && (0UL != (VSSEL131 & BIT_MASK_19))) + { + TMR2_4_OvfB_IrqHandler(); + } + } + /* RTC time stamp 0 */ + if (1UL == bM4_RTC->TPCR0_b.TPIE0) + { + if ((1UL == bM4_RTC->TPSR_b.TPF0) && (0UL != (VSSEL131 & BIT_MASK_24))) + { + RTC_TimeStamp0_IrqHandler(); + } + } + /* RTC time stamp 1 */ + if (1UL == bM4_RTC->TPCR1_b.TPIE1) + { + if ((1UL == bM4_RTC->TPSR_b.TPF1) && (0UL != (VSSEL131 & BIT_MASK_24))) + { + RTC_TimeStamp1_IrqHandler(); + } + } + /* RTC alarm */ + if (1UL == bM4_RTC->CR2_b.ALMIE) + { + if ((1UL == bM4_RTC->CR2_b.ALMF) && (0UL != (VSSEL131 & BIT_MASK_25))) + { + RTC_Alarm_IrqHandler(); + } + } + /* RTC period */ + if (1UL == bM4_RTC->CR2_b.PRDIE) + { + if ((1UL == bM4_RTC->CR2_b.PRDF) && (0UL != (VSSEL131 & BIT_MASK_26))) + { + RTC_Period_IrqHandler(); + } + } + /* XTAL stop */ + if (1UL == bM4_CMU->XTALSTDCR_b.XTALSTDIE) + { + if ((1UL == bM4_CMU->XTALSTDSR_b.XTALSTDF) && (0UL != (VSSEL131 & BIT_MASK_29))) + { + CLK_XtalStop_IrqHandler(); + } + } + /* Wakeup timer overflow */ + if (1UL == bM4_PWC->WKTC2_b.WKTCE) + { + if ((1UL == bM4_PWC->WKTC2_b.WKOVF) && (0UL != (VSSEL131 & BIT_MASK_30))) + { + PWC_WakeupTimer_IrqHandler(); + } + } + /* SWDT underflow or refresh error */ + u32Tmp1 = M4_SWDT->SR & (SWDT_SR_UDF | SWDT_SR_REF); + if ((0UL != u32Tmp1) && (0UL != (VSSEL131 & BIT_MASK_31))) + { + SWDT_IrqHandler(); + } +} + +/** + * @brief Interrupt No.132 share IRQ handler + * @param None + * @retval None + */ +void IRQ132_Handler(void) +{ + const uint32_t VSSEL132 = M4_INTC->VSSEL132; + + /* Timer6 Ch.1 general compare match A */ + if (1UL == bM4_TMR6_1->ICONR_b.INTENA) + { + if ((1UL == bM4_TMR6_1->STFLR_b.CMAF) && (0UL != (VSSEL132 & BIT_MASK_00))) + { + TMR6_1_GCmpA_IrqHandler(); + } + } + /* Timer6 Ch.1 general compare match B */ + if (1UL == bM4_TMR6_1->ICONR_b.INTENB) + { + if ((1UL == bM4_TMR6_1->STFLR_b.CMBF) && (0UL != (VSSEL132 & BIT_MASK_01))) + { + TMR6_1_GCmpB_IrqHandler(); + } + } + /* Timer6 Ch.1 general compare match C */ + if (1UL == bM4_TMR6_1->ICONR_b.INTENC) + { + if ((1UL == bM4_TMR6_1->STFLR_b.CMCF) && (0UL != (VSSEL132 & BIT_MASK_02))) + { + TMR6_1_GCmpC_IrqHandler(); + } + } + /* Timer6 Ch.1 general compare match D */ + if (1UL == bM4_TMR6_1->ICONR_b.INTEND) + { + if ((1UL == bM4_TMR6_1->STFLR_b.CMDF) && (0UL != (VSSEL132 & BIT_MASK_03))) + { + TMR6_1_GCmpD_IrqHandler(); + } + } + /* Timer6 Ch.1 general compare match E */ + if (1UL == bM4_TMR6_1->ICONR_b.INTENE) + { + if ((1UL == bM4_TMR6_1->STFLR_b.CMEF) && (0UL != (VSSEL132 & BIT_MASK_04))) + { + TMR6_1_GCmpE_IrqHandler(); + } + } + /* Timer6 Ch.1 general compare match F */ + if (1UL == bM4_TMR6_1->ICONR_b.INTENF) + { + if ((1UL == bM4_TMR6_1->STFLR_b.CMFF) && (0UL != (VSSEL132 & BIT_MASK_05))) + { + TMR6_1_GCmpF_IrqHandler(); + } + } + /* Timer6 Ch.1 overflow*/ + if (1UL == bM4_TMR6_1->ICONR_b.INTENOVF) + { + if ((1UL == bM4_TMR6_1->STFLR_b.OVFF) && (0UL != (VSSEL132 & BIT_MASK_06))) + { + TMR6_1_GOvf_IrqHandler(); + } + } + /* Timer6 Ch.1 underflow*/ + if (1UL == bM4_TMR6_1->ICONR_b.INTENUDF) + { + if ((1UL == bM4_TMR6_1->STFLR_b.UDFF) && (0UL != (VSSEL132 & BIT_MASK_07))) + { + TMR6_1_GUdf_IrqHandler(); + } + } + /* Timer4 Ch.1 U phase higher compare match */ + if (1UL == bM4_TMR4_1->OCSRU_b.OCIEH) + { + if ((1UL == bM4_TMR4_1->OCSRU_b.OCFH) && (0UL != (VSSEL132 & BIT_MASK_08))) + { + TMR4_1_GCmpUH_IrqHandler(); + } + } + /* Timer4 Ch.1 U phase lower compare match */ + if (1UL == bM4_TMR4_1->OCSRU_b.OCIEL) + { + if ((1UL == bM4_TMR4_1->OCSRU_b.OCFL) && (0UL != (VSSEL132 & BIT_MASK_09))) + { + TMR4_1_GCmpUL_IrqHandler(); + } + } + /* Timer4 Ch.1 V phase higher compare match */ + if (1UL == bM4_TMR4_1->OCSRV_b.OCIEH) + { + if ((1UL == bM4_TMR4_1->OCSRV_b.OCFH) && (0UL != (VSSEL132 & BIT_MASK_10))) + { + TMR4_1_GCmpVH_IrqHandler(); + } + } + /* Timer4 Ch.1 V phase lower compare match */ + if (1UL == bM4_TMR4_1->OCSRV_b.OCIEL) + { + if ((1UL == bM4_TMR4_1->OCSRV_b.OCFL) && (0UL != (VSSEL132 & BIT_MASK_11))) + { + TMR4_1_GCmpVL_IrqHandler(); + } + } + /* Timer4 Ch.1 W phase higher compare match */ + if (1UL == bM4_TMR4_1->OCSRW_b.OCIEH) + { + if ((1UL == bM4_TMR4_1->OCSRW_b.OCFH) && (0UL != (VSSEL132 & BIT_MASK_12))) + { + TMR4_1_GCmpWH_IrqHandler(); + } + } + /* Timer4 Ch.1 W phase lower compare match */ + if (1UL == bM4_TMR4_1->OCSRW_b.OCIEL) + { + if ((1UL == bM4_TMR4_1->OCSRW_b.OCFL) && (0UL != (VSSEL132 & BIT_MASK_13))) + { + TMR4_1_GCmpWL_IrqHandler(); + } + } + /* Timer4 Ch.1 overflow */ + if (1UL == bM4_TMR4_1->CCSR_b.IRQPEN) + { + if ((1UL == bM4_TMR4_1->CCSR_b.IRQPF) && (0UL != (VSSEL132 & BIT_MASK_14))) + { + TMR4_1_Ovf_IrqHandler(); + } + } + /* Timer4 Ch.1 underflow */ + if (1UL == bM4_TMR4_1->CCSR_b.IRQZEN) + { + if ((1UL == bM4_TMR4_1->CCSR_b.IRQZF) && (0UL != (VSSEL132 & BIT_MASK_15))) + { + TMR4_1_Udf_IrqHandler(); + } + } + /* Timer6 Ch.2 general compare match A */ + if (1UL == bM4_TMR6_2->ICONR_b.INTENA) + { + if ((1UL == bM4_TMR6_2->STFLR_b.CMAF) && (0UL != (VSSEL132 & BIT_MASK_16))) + { + TMR6_2_GCmpA_IrqHandler(); + } + } + /* Timer6 Ch.2 general compare match B */ + if (1UL == bM4_TMR6_2->ICONR_b.INTENB) + { + if ((1UL == bM4_TMR6_2->STFLR_b.CMBF) && (0UL != (VSSEL132 & BIT_MASK_17))) + { + TMR6_2_GCmpB_IrqHandler(); + } + } + /* Timer6 Ch.2 general compare match C */ + if (1UL == bM4_TMR6_2->ICONR_b.INTENC) + { + if ((1UL == bM4_TMR6_2->STFLR_b.CMCF) && (0UL != (VSSEL132 & BIT_MASK_18))) + { + TMR6_2_GCmpC_IrqHandler(); + } + } + /* Timer6 Ch.2 general compare match D */ + if (1UL == bM4_TMR6_2->ICONR_b.INTEND) + { + if ((1UL == bM4_TMR6_2->STFLR_b.CMDF) && (0UL != (VSSEL132 & BIT_MASK_19))) + { + TMR6_2_GCmpD_IrqHandler(); + } + } + /* Timer6 Ch.2 general compare match E */ + if (1UL == bM4_TMR6_2->ICONR_b.INTENE) + { + if ((1UL == bM4_TMR6_2->STFLR_b.CMEF) && (0UL != (VSSEL132 & BIT_MASK_20))) + { + TMR6_2_GCmpE_IrqHandler(); + } + } + /* Timer6 Ch.2 general compare match F */ + if (1UL == bM4_TMR6_2->ICONR_b.INTENF) + { + if ((1UL == bM4_TMR6_2->STFLR_b.CMFF) && (0UL != (VSSEL132 & BIT_MASK_21))) + { + TMR6_2_GCmpF_IrqHandler(); + } + } + /* Timer6 Ch.2 overflow*/ + if (1UL == bM4_TMR6_2->ICONR_b.INTENOVF) + { + if ((1UL == bM4_TMR6_2->STFLR_b.OVFF) && (0UL != (VSSEL132 & BIT_MASK_22))) + { + TMR6_2_GOvf_IrqHandler(); + } + } + /* Timer6 Ch.2 underflow*/ + if (1UL == bM4_TMR6_2->ICONR_b.INTENUDF) + { + if ((1UL == bM4_TMR6_2->STFLR_b.UDFF) && (0UL != (VSSEL132 & BIT_MASK_23))) + { + TMR6_2_GUdf_IrqHandler(); + } + } + /* Timer4 Ch.2 U phase higher compare match */ + if (1UL == bM4_TMR4_2->OCSRU_b.OCIEH) + { + if ((1UL == bM4_TMR4_2->OCSRU_b.OCFH) && (0UL != (VSSEL132 & BIT_MASK_24))) + { + TMR4_2_GCmpUH_IrqHandler(); + } + } + /* Timer4 Ch.2 U phase lower compare match */ + if (1UL == bM4_TMR4_2->OCSRU_b.OCIEL) + { + if ((1UL == bM4_TMR4_2->OCSRU_b.OCFL) && (0UL != (VSSEL132 & BIT_MASK_25))) + { + TMR4_2_GCmpUL_IrqHandler(); + } + } + /* Timer4 Ch.2 V phase higher compare match */ + if (1UL == bM4_TMR4_2->OCSRV_b.OCIEH) + { + if ((1UL == bM4_TMR4_2->OCSRV_b.OCFH) && (0UL != (VSSEL132 & BIT_MASK_26))) + { + TMR4_2_GCmpVH_IrqHandler(); + } + } + /* Timer4 Ch.2 V phase lower compare match */ + if (1UL == bM4_TMR4_2->OCSRV_b.OCIEL) + { + if ((1UL == bM4_TMR4_2->OCSRV_b.OCFL) && (0UL != (VSSEL132 & BIT_MASK_27))) + { + TMR4_2_GCmpVL_IrqHandler(); + } + } + /* Timer4 Ch.2 W phase higher compare match */ + if (1UL == bM4_TMR4_2->OCSRW_b.OCIEH) + { + if ((1UL == bM4_TMR4_2->OCSRW_b.OCFH) && (0UL != (VSSEL132 & BIT_MASK_28))) + { + TMR4_2_GCmpWH_IrqHandler(); + } + } + /* Timer4 Ch.2 W phase lower compare match */ + if (1UL == bM4_TMR4_2->OCSRW_b.OCIEL) + { + if ((1UL == bM4_TMR4_2->OCSRW_b.OCFL) && (0UL != (VSSEL132 & BIT_MASK_29))) + { + TMR4_2_GCmpWL_IrqHandler(); + } + } + /* Timer4 Ch.2 overflow */ + if (1UL == bM4_TMR4_2->CCSR_b.IRQPEN) + { + if ((1UL == bM4_TMR4_2->CCSR_b.IRQPF) && (0UL != (VSSEL132 & BIT_MASK_30))) + { + TMR4_2_Ovf_IrqHandler(); + } + } + /* Timer4 Ch.2 underflow */ + if (1UL == bM4_TMR4_2->CCSR_b.IRQZEN) + { + if ((1UL == bM4_TMR4_2->CCSR_b.IRQZF) && (0UL != (VSSEL132 & BIT_MASK_31))) + { + TMR4_2_Udf_IrqHandler(); + } + } +} + +/** + * @brief Interrupt No.133 share IRQ handler + * @param None + * @retval None + */ +void IRQ133_Handler(void) +{ + const uint32_t VSSEL133 = M4_INTC->VSSEL133; + + /* Timer6 Ch.3 general compare match A */ + if (1UL == bM4_TMR6_3->ICONR_b.INTENA) + { + if ((1UL == bM4_TMR6_3->STFLR_b.CMAF) && (0UL != (VSSEL133 & BIT_MASK_00))) + { + TMR6_3_GCmpA_IrqHandler(); + } + } + /* Timer6 Ch.3 general compare match B */ + if (1UL == bM4_TMR6_3->ICONR_b.INTENB) + { + if ((1UL == bM4_TMR6_3->STFLR_b.CMBF) && (0UL != (VSSEL133 & BIT_MASK_01))) + { + TMR6_3_GCmpB_IrqHandler(); + } + } + /* Timer6 Ch.3 general compare match C */ + if (1UL == bM4_TMR6_3->ICONR_b.INTENC) + { + if ((1UL == bM4_TMR6_3->STFLR_b.CMCF) && (0UL != (VSSEL133 & BIT_MASK_02))) + { + TMR6_3_GCmpC_IrqHandler(); + } + } + /* Timer6 Ch.3 general compare match D */ + if (1UL == bM4_TMR6_3->ICONR_b.INTEND) + { + if ((1UL == bM4_TMR6_3->STFLR_b.CMDF) && (0UL != (VSSEL133 & BIT_MASK_03))) + { + TMR6_3_GCmpD_IrqHandler(); + } + } + /* Timer6 Ch.3 general compare match E */ + if (1UL == bM4_TMR6_3->ICONR_b.INTENE) + { + if ((1UL == bM4_TMR6_3->STFLR_b.CMEF) && (0UL != (VSSEL133 & BIT_MASK_04))) + { + TMR6_3_GCmpE_IrqHandler(); + } + } + /* Timer6 Ch.3 general compare match F */ + if (1UL == bM4_TMR6_3->ICONR_b.INTENF) + { + if ((1UL == bM4_TMR6_3->STFLR_b.CMFF) && (0UL != (VSSEL133 & BIT_MASK_05))) + { + TMR6_3_GCmpF_IrqHandler(); + } + } + /* Timer6 Ch.3 overflow*/ + if (1UL == bM4_TMR6_3->ICONR_b.INTENOVF) + { + if ((1UL == bM4_TMR6_3->STFLR_b.OVFF) && (0UL != (VSSEL133 & BIT_MASK_06))) + { + TMR6_3_GOvf_IrqHandler(); + } + } + /* Timer6 Ch.3 underflow*/ + if (1UL == bM4_TMR6_3->ICONR_b.INTENUDF) + { + if ((1UL == bM4_TMR6_3->STFLR_b.UDFF) && (0UL != (VSSEL133 & BIT_MASK_07))) + { + TMR6_3_GUdf_IrqHandler(); + } + } + /* Timer4 Ch.3 U phase higher compare match */ + if (1UL == bM4_TMR4_3->OCSRU_b.OCIEH) + { + if ((1UL == bM4_TMR4_3->OCSRU_b.OCFH) && (0UL != (VSSEL133 & BIT_MASK_08))) + { + TMR4_3_GCmpUH_IrqHandler(); + } + } + /* Timer4 Ch.3 U phase lower compare match */ + if (1UL == bM4_TMR4_3->OCSRU_b.OCIEL) + { + if ((1UL == bM4_TMR4_3->OCSRU_b.OCFL) && (0UL != (VSSEL133 & BIT_MASK_09))) + { + TMR4_3_GCmpUL_IrqHandler(); + } + } + /* Timer4 Ch.3 V phase higher compare match */ + if (1UL == bM4_TMR4_3->OCSRV_b.OCIEH) + { + if ((1UL == bM4_TMR4_3->OCSRV_b.OCFH) && (0UL != (VSSEL133 & BIT_MASK_10))) + { + TMR4_3_GCmpVH_IrqHandler(); + } + } + /* Timer4 Ch.3 V phase lower compare match */ + if (1UL == bM4_TMR4_3->OCSRV_b.OCIEL) + { + if ((1UL == bM4_TMR4_3->OCSRV_b.OCFL) && (0UL != (VSSEL133 & BIT_MASK_11))) + { + TMR4_3_GCmpVL_IrqHandler(); + } + } + /* Timer4 Ch.3 W phase higher compare match */ + if (1UL == bM4_TMR4_3->OCSRW_b.OCIEH) + { + if ((1UL == bM4_TMR4_3->OCSRW_b.OCFH) && (0UL != (VSSEL133 & BIT_MASK_12))) + { + TMR4_3_GCmpWH_IrqHandler(); + } + } + /* Timer4 Ch.3 W phase lower compare match */ + if (1UL == bM4_TMR4_3->OCSRW_b.OCIEL) + { + if ((1UL == bM4_TMR4_3->OCSRW_b.OCFL) && (0UL != (VSSEL133 & BIT_MASK_13))) + { + TMR4_3_GCmpWL_IrqHandler(); + } + } + /* Timer4 Ch.3 overflow */ + if (1UL == bM4_TMR4_3->CCSR_b.IRQPEN) + { + if ((1UL == bM4_TMR4_3->CCSR_b.IRQPF) && (0UL != (VSSEL133 & BIT_MASK_14))) + { + TMR4_3_Ovf_IrqHandler(); + } + } + /* Timer4 Ch.3 underflow */ + if (1UL == bM4_TMR4_3->CCSR_b.IRQZEN) + { + if ((1UL == bM4_TMR4_3->CCSR_b.IRQZF) && (0UL != (VSSEL133 & BIT_MASK_15))) + { + TMR4_3_Udf_IrqHandler(); + } + } + /* Timer6 Ch.1 dead time */ + if (1UL == bM4_TMR6_1->ICONR_b.INTENDTE) + { + if ((1UL == bM4_TMR6_1->STFLR_b.DTEF) && (0UL != (VSSEL133 & BIT_MASK_16))) + { + TMR6_1_Gdte_IrqHandler(); + } + } + /* Timer6 Ch.1 specified up compare match A*/ + if (1UL == bM4_TMR6_1->ICONR_b.INTENSAU) + { + if ((1UL == bM4_TMR6_1->STFLR_b.CMSAUF) && (0UL != (VSSEL133 & BIT_MASK_19))) + { + TMR6_1_SCmpUpA_IrqHandler(); + } + } + /* Timer6 Ch.1 specified down compare match A*/ + if (1UL == bM4_TMR6_1->ICONR_b.INTENSAD) + { + if ((1UL == bM4_TMR6_1->STFLR_b.CMSADF) && (0UL != (VSSEL133 & BIT_MASK_19))) + { + TMR6_1_SCmpDownA_IrqHandler(); + } + } + /* Timer6 Ch.1 specified up compare match B*/ + if (1UL == bM4_TMR6_1->ICONR_b.INTENSBU) + { + if ((1UL == bM4_TMR6_1->STFLR_b.CMSBUF) && (0UL != (VSSEL133 & BIT_MASK_20))) + { + TMR6_1_SCmpUpB_IrqHandler(); + } + } + /* Timer6 Ch.1 specified down compare match B*/ + if (1UL == bM4_TMR6_1->ICONR_b.INTENSBD) + { + if ((1UL == bM4_TMR6_1->STFLR_b.CMSBDF) && (0UL != (VSSEL133 & BIT_MASK_20))) + { + TMR6_1_SCmpDownB_IrqHandler(); + } + } + /* Timer4 Ch.1 U phase reload */ + if (0UL == bM4_TMR4_1->RCSR_b.RTIDU) + { + if ((1UL == bM4_TMR4_1->RCSR_b.RTIFU) && (0UL != (VSSEL133 & BIT_MASK_21))) + { + TMR4_1_ReloadU_IrqHandler(); + } + } + /* Timer4 Ch.1 V phase reload */ + if (0UL == bM4_TMR4_1->RCSR_b.RTIDV) + { + if ((1UL == bM4_TMR4_1->RCSR_b.RTIFV) && (0UL != (VSSEL133 & BIT_MASK_22))) + { + TMR4_1_ReloadU_IrqHandler(); + } + } + /* Timer4 Ch.1 W phase reload */ + if (0UL == bM4_TMR4_1->RCSR_b.RTIDW) + { + if ((1UL == bM4_TMR4_1->RCSR_b.RTIFW) && (0UL != (VSSEL133 & BIT_MASK_23))) + { + TMR4_1_ReloadU_IrqHandler(); + } + } + /* Timer6 Ch.2 dead time */ + if (1UL == bM4_TMR6_2->ICONR_b.INTENDTE) + { + if ((1UL == bM4_TMR6_2->STFLR_b.DTEF) && (0UL != (VSSEL133 & BIT_MASK_24))) + { + TMR6_2_Gdte_IrqHandler(); + } + } + /* Timer6 Ch.2 specified up compare match A*/ + if (1UL == bM4_TMR6_2->ICONR_b.INTENSAU) + { + if ((1UL == bM4_TMR6_2->STFLR_b.CMSAUF) && (0UL != (VSSEL133 & BIT_MASK_27))) + { + TMR6_2_SCmpUpA_IrqHandler(); + } + } + /* Timer6 Ch.2 specified down compare match A*/ + if (1UL == bM4_TMR6_2->ICONR_b.INTENSAD) + { + if ((1UL == bM4_TMR6_2->STFLR_b.CMSADF) && (0UL != (VSSEL133 & BIT_MASK_27))) + { + TMR6_2_SCmpDownA_IrqHandler(); + } + } + /* Timer6 Ch.2 specified up compare match B*/ + if (1UL == bM4_TMR6_2->ICONR_b.INTENSBU) + { + if ((1UL == bM4_TMR6_2->STFLR_b.CMSBUF) && (0UL != (VSSEL133 & BIT_MASK_28))) + { + TMR6_2_SCmpUpB_IrqHandler(); + } + } + /* Timer6 Ch.2 specified down compare match B*/ + if (1UL == bM4_TMR6_2->ICONR_b.INTENSBD) + { + if ((1UL == bM4_TMR6_2->STFLR_b.CMSBDF) && (0UL != (VSSEL133 & BIT_MASK_28))) + { + TMR6_2_SCmpDownB_IrqHandler(); + } + } + /* Timer4 Ch.2 U phase reload */ + if (0UL == bM4_TMR4_2->RCSR_b.RTIDU) + { + if ((1UL == bM4_TMR4_2->RCSR_b.RTIFU) && (0UL != (VSSEL133 & BIT_MASK_29))) + { + TMR4_2_ReloadU_IrqHandler(); + } + } + /* Timer4 Ch.2 V phase reload */ + if (0UL == bM4_TMR4_2->RCSR_b.RTIDV) + { + if ((1UL == bM4_TMR4_2->RCSR_b.RTIFV) && (0UL != (VSSEL133 & BIT_MASK_30))) + { + TMR4_2_ReloadU_IrqHandler(); + } + } + /* Timer4 Ch.2 W phase reload */ + if (0UL == bM4_TMR4_2->RCSR_b.RTIDW) + { + if ((1UL == bM4_TMR4_2->RCSR_b.RTIFW) && (0UL != (VSSEL133 & BIT_MASK_31))) + { + TMR4_2_ReloadU_IrqHandler(); + } + } +} + +/** + * @brief Interrupt No.134 share IRQ handler + * @param None + * @retval None + */ +void IRQ134_Handler(void) +{ + const uint32_t VSSEL134 = M4_INTC->VSSEL134; + + /* Timer6 Ch.3 dead time */ + if (1UL == bM4_TMR6_3->ICONR_b.INTENDTE) + { + if ((1UL == bM4_TMR6_3->STFLR_b.DTEF) && (0UL != (VSSEL134 & BIT_MASK_00))) + { + TMR6_3_Gdte_IrqHandler(); + } + } + /* Timer6 Ch.3 specified up compare match A*/ + if (1UL == bM4_TMR6_3->ICONR_b.INTENSAU) + { + if ((1UL == bM4_TMR6_3->STFLR_b.CMSAUF) && (0UL != (VSSEL134 & BIT_MASK_03))) + { + TMR6_3_SCmpUpA_IrqHandler(); + } + } + /* Timer6 Ch.3 specified down compare match A*/ + if (1UL == bM4_TMR6_3->ICONR_b.INTENSAD) + { + if ((1UL == bM4_TMR6_3->STFLR_b.CMSADF) && (0UL != (VSSEL134 & BIT_MASK_03))) + { + TMR6_3_SCmpDownA_IrqHandler(); + } + } + /* Timer6 Ch.3 specified up compare match B*/ + if (1UL == bM4_TMR6_3->ICONR_b.INTENSBU) + { + if ((1UL == bM4_TMR6_3->STFLR_b.CMSBUF) && (0UL != (VSSEL134 & BIT_MASK_04))) + { + TMR6_3_SCmpUpB_IrqHandler(); + } + } + /* Timer6 Ch.3 specified down compare match B*/ + if (1UL == bM4_TMR6_3->ICONR_b.INTENSBD) + { + if ((1UL == bM4_TMR6_3->STFLR_b.CMSBDF) && (0UL != (VSSEL134 & BIT_MASK_04))) + { + TMR6_3_SCmpDownB_IrqHandler(); + } + } + /* Timer4 Ch.3 U phase reload */ + if (0UL == bM4_TMR4_3->RCSR_b.RTIDU) + { + if ((1UL == bM4_TMR4_3->RCSR_b.RTIFU) && (0UL != (VSSEL134 & BIT_MASK_05))) + { + TMR4_3_ReloadU_IrqHandler(); + } + } + /* Timer4 Ch.3 V phase reload */ + if (0UL == bM4_TMR4_3->RCSR_b.RTIDV) + { + if ((1UL == bM4_TMR4_3->RCSR_b.RTIFV) && (0UL != (VSSEL134 & BIT_MASK_06))) + { + TMR4_3_ReloadU_IrqHandler(); + } + } + /* Timer4 Ch.3 W phase reload */ + if (0UL == bM4_TMR4_3->RCSR_b.RTIDW) + { + if ((1UL == bM4_TMR4_3->RCSR_b.RTIFW) && (0UL != (VSSEL134 & BIT_MASK_07))) + { + TMR4_3_ReloadU_IrqHandler(); + } + } + /* Timer6 Ch.4 general compare match A */ + if (1UL == bM4_TMR6_4->ICONR_b.INTENA) + { + if ((1UL == bM4_TMR6_4->STFLR_b.CMAF) && (0UL != (VSSEL134 & BIT_MASK_16))) + { + TMR6_4_GCmpA_IrqHandler(); + } + } + /* Timer6 Ch.4 general compare match B */ + if (1UL == bM4_TMR6_4->ICONR_b.INTENB) + { + if ((1UL == bM4_TMR6_4->STFLR_b.CMBF) && (0UL != (VSSEL134 & BIT_MASK_17))) + { + TMR6_4_GCmpB_IrqHandler(); + } + } + /* Timer6 Ch.4 general compare match C */ + if (1UL == bM4_TMR6_4->ICONR_b.INTENC) + { + if ((1UL == bM4_TMR6_4->STFLR_b.CMCF) && (0UL != (VSSEL134 & BIT_MASK_18))) + { + TMR6_4_GCmpC_IrqHandler(); + } + } + /* Timer6 Ch.4 general compare match D */ + if (1UL == bM4_TMR6_4->ICONR_b.INTEND) + { + if ((1UL == bM4_TMR6_4->STFLR_b.CMDF) && (0UL != (VSSEL134 & BIT_MASK_19))) + { + TMR6_4_GCmpD_IrqHandler(); + } + } + /* Timer6 Ch.4 general compare match E */ + if (1UL == bM4_TMR6_4->ICONR_b.INTENE) + { + if ((1UL == bM4_TMR6_4->STFLR_b.CMEF) && (0UL != (VSSEL134 & BIT_MASK_20))) + { + TMR6_4_GCmpE_IrqHandler(); + } + } + /* Timer6 Ch.4 general compare match F */ + if (1UL == bM4_TMR6_4->ICONR_b.INTENF) + { + if ((1UL == bM4_TMR6_4->STFLR_b.CMFF) && (0UL != (VSSEL134 & BIT_MASK_21))) + { + TMR6_4_GCmpF_IrqHandler(); + } + } + /* Timer6 Ch.4 overflow*/ + if (1UL == bM4_TMR6_4->ICONR_b.INTENOVF) + { + if ((1UL == bM4_TMR6_4->STFLR_b.OVFF) && (0UL != (VSSEL134 & BIT_MASK_22))) + { + TMR6_4_GOvf_IrqHandler(); + } + } + /* Timer6 Ch.4 underflow*/ + if (1UL == bM4_TMR6_4->ICONR_b.INTENUDF) + { + if ((1UL == bM4_TMR6_4->STFLR_b.UDFF) && (0UL != (VSSEL134 & BIT_MASK_23))) + { + TMR6_4_GUdf_IrqHandler(); + } + } + /* Timer6 Ch.4 dead time */ + if (1UL == bM4_TMR6_4->ICONR_b.INTENDTE) + { + if ((1UL == bM4_TMR6_4->STFLR_b.DTEF) && (0UL != (VSSEL134 & BIT_MASK_24))) + { + TMR6_4_Gdte_IrqHandler(); + } + } + /* Timer6 Ch.4 specified up compare match A*/ + if (1UL == bM4_TMR6_4->ICONR_b.INTENSAU) + { + if ((1UL == bM4_TMR6_4->STFLR_b.CMSAUF) && (0UL != (VSSEL134 & BIT_MASK_27))) + { + TMR6_4_SCmpUpA_IrqHandler(); + } + } + /* Timer6 Ch.4 specified down compare match A*/ + if (1UL == bM4_TMR6_4->ICONR_b.INTENSAD) + { + if ((1UL == bM4_TMR6_4->STFLR_b.CMSADF) && (0UL != (VSSEL134 & BIT_MASK_27))) + { + TMR6_4_SCmpDownA_IrqHandler(); + } + } + /* Timer6 Ch.4 specified up compare match B*/ + if (1UL == bM4_TMR6_4->ICONR_b.INTENSBU) + { + if ((1UL == bM4_TMR6_4->STFLR_b.CMSBUF) && (0UL != (VSSEL134 & BIT_MASK_28))) + { + TMR6_4_SCmpUpB_IrqHandler(); + } + } + /* Timer6 Ch.4 specified down compare match B*/ + if (1UL == bM4_TMR6_4->ICONR_b.INTENSBD) + { + if ((1UL == bM4_TMR6_4->STFLR_b.CMSBDF) && (0UL != (VSSEL134 & BIT_MASK_28))) + { + TMR6_4_SCmpDownB_IrqHandler(); + } + } +} + +/** + * @brief Interrupt No.135 share IRQ handler + * @param None + * @retval None + */ +void IRQ135_Handler(void) +{ + const uint32_t VSSEL135 = M4_INTC->VSSEL135; + + /* Timer6 Ch.5 general compare match A */ + if (1UL == bM4_TMR6_5->ICONR_b.INTENA) + { + if ((1UL == bM4_TMR6_5->STFLR_b.CMAF) && (0UL != (VSSEL135 & BIT_MASK_00))) + { + TMR6_5_GCmpA_IrqHandler(); + } + } + /* Timer6 Ch.5 general compare match B */ + if (1UL == bM4_TMR6_5->ICONR_b.INTENB) + { + if ((1UL == bM4_TMR6_5->STFLR_b.CMBF) && (0UL != (VSSEL135 & BIT_MASK_01))) + { + TMR6_5_GCmpB_IrqHandler(); + } + } + /* Timer6 Ch.5 general compare match C */ + if (1UL == bM4_TMR6_5->ICONR_b.INTENC) + { + if ((1UL == bM4_TMR6_5->STFLR_b.CMCF) && (0UL != (VSSEL135 & BIT_MASK_02))) + { + TMR6_5_GCmpC_IrqHandler(); + } + } + /* Timer6 Ch.5 general compare match D */ + if (1UL == bM4_TMR6_5->ICONR_b.INTEND) + { + if ((1UL == bM4_TMR6_5->STFLR_b.CMDF) && (0UL != (VSSEL135 & BIT_MASK_03))) + { + TMR6_5_GCmpD_IrqHandler(); + } + } + /* Timer6 Ch.5 general compare match E */ + if (1UL == bM4_TMR6_5->ICONR_b.INTENE) + { + if ((1UL == bM4_TMR6_5->STFLR_b.CMEF) && (0UL != (VSSEL135 & BIT_MASK_04))) + { + TMR6_5_GCmpE_IrqHandler(); + } + } + /* Timer6 Ch.5 general compare match F */ + if (1UL == bM4_TMR6_5->ICONR_b.INTENF) + { + if ((1UL == bM4_TMR6_5->STFLR_b.CMFF) && (0UL != (VSSEL135 & BIT_MASK_05))) + { + TMR6_5_GCmpF_IrqHandler(); + } + } + /* Timer6 Ch.5 overflow*/ + if (1UL == bM4_TMR6_5->ICONR_b.INTENOVF) + { + if ((1UL == bM4_TMR6_5->STFLR_b.OVFF) && (0UL != (VSSEL135 & BIT_MASK_06))) + { + TMR6_5_GOvf_IrqHandler(); + } + } + /* Timer6 Ch.5 underflow*/ + if (1UL == bM4_TMR6_5->ICONR_b.INTENUDF) + { + if ((1UL == bM4_TMR6_5->STFLR_b.UDFF) && (0UL != (VSSEL135 & BIT_MASK_07))) + { + TMR6_5_GUdf_IrqHandler(); + } + } + /* Timer6 Ch.5 dead time */ + if (1UL == bM4_TMR6_5->ICONR_b.INTENDTE) + { + if ((1UL == bM4_TMR6_5->STFLR_b.DTEF) && (0UL != (VSSEL135 & BIT_MASK_08))) + { + TMR6_5_Gdte_IrqHandler(); + } + } + /* Timer6 Ch.5 specified up compare match A*/ + if (1UL == bM4_TMR6_5->ICONR_b.INTENSAU) + { + if ((1UL == bM4_TMR6_5->STFLR_b.CMSAUF) && (0UL != (VSSEL135 & BIT_MASK_11))) + { + TMR6_5_SCmpUpA_IrqHandler(); + } + } + /* Timer6 Ch.5 specified down compare match A*/ + if (1UL == bM4_TMR6_5->ICONR_b.INTENSAD) + { + if ((1UL == bM4_TMR6_5->STFLR_b.CMSADF) && (0UL != (VSSEL135 & BIT_MASK_11))) + { + TMR6_5_SCmpDownA_IrqHandler(); + } + } + /* Timer6 Ch.5 specified up compare match B*/ + if (1UL == bM4_TMR6_5->ICONR_b.INTENSBU) + { + if ((1UL == bM4_TMR6_5->STFLR_b.CMSBUF) && (0UL != (VSSEL135 & BIT_MASK_12))) + { + TMR6_5_SCmpUpB_IrqHandler(); + } + } + /* Timer6 Ch.5 specified down compare match B*/ + if (1UL == bM4_TMR6_5->ICONR_b.INTENSBD) + { + if ((1UL == bM4_TMR6_5->STFLR_b.CMSBDF) && (0UL != (VSSEL135 & BIT_MASK_12))) + { + TMR6_5_SCmpDownB_IrqHandler(); + } + } + /* TimerA Ch.1 overflow */ + if (1UL == bM4_TMRA_1->BCSTR_b.ITENOVF) + { + if ((1UL == bM4_TMRA_1->BCSTR_b.OVFF) && (0UL != (VSSEL135 & BIT_MASK_13))) + { + TMRA_1_Ovf_IrqHandler(); + } + } + /* TimerA Ch.1 underflow */ + if (1UL == bM4_TMRA_1->BCSTR_b.ITENUDF) + { + if ((1UL == bM4_TMRA_1->BCSTR_b.UDFF) && (0UL != (VSSEL135 & BIT_MASK_14))) + { + TMRA_1_Udf_IrqHandler(); + } + } + /* TimerA Ch.1 compare match 1 */ + if (1UL == bM4_TMRA_1->ICONR_b.ITEN1) + { + if ((1UL == bM4_TMRA_1->STFLR_b.CMPF1) && (0UL != (VSSEL135 & BIT_MASK_15))) + { + TMRA_1_Cmp1_IrqHandler(); + } + } + /* TimerA Ch.1 compare match 2 */ + if (1UL == bM4_TMRA_1->ICONR_b.ITEN2) + { + if ((1UL == bM4_TMRA_1->STFLR_b.CMPF2) && (0UL != (VSSEL135 & BIT_MASK_15))) + { + TMRA_1_Cmp2_IrqHandler(); + } + } + /* TimerA Ch.1 compare match 3 */ + if (1UL == bM4_TMRA_1->ICONR_b.ITEN3) + { + if ((1UL == bM4_TMRA_1->STFLR_b.CMPF3) && (0UL != (VSSEL135 & BIT_MASK_15))) + { + TMRA_1_Cmp3_IrqHandler(); + } + } + /* TimerA Ch.1 compare match 4 */ + if (1UL == bM4_TMRA_1->ICONR_b.ITEN4) + { + if ((1UL == bM4_TMRA_1->STFLR_b.CMPF4) && (0UL != (VSSEL135 & BIT_MASK_15))) + { + TMRA_1_Cmp4_IrqHandler(); + } + } + /* Timer6 Ch.6 general compare match A */ + if (1UL == bM4_TMR6_6->ICONR_b.INTENA) + { + if ((1UL == bM4_TMR6_6->STFLR_b.CMAF) && (0UL != (VSSEL135 & BIT_MASK_16))) + { + TMR6_6_GCmpA_IrqHandler(); + } + } + /* Timer6 Ch.6 general compare match B */ + if (1UL == bM4_TMR6_6->ICONR_b.INTENB) + { + if ((1UL == bM4_TMR6_6->STFLR_b.CMBF) && (0UL != (VSSEL135 & BIT_MASK_17))) + { + TMR6_6_GCmpB_IrqHandler(); + } + } + /* Timer6 Ch.6 general compare match C */ + if (1UL == bM4_TMR6_6->ICONR_b.INTENC) + { + if ((1UL == bM4_TMR6_6->STFLR_b.CMCF) && (0UL != (VSSEL135 & BIT_MASK_18))) + { + TMR6_6_GCmpC_IrqHandler(); + } + } + /* Timer6 Ch.6 general compare match D */ + if (1UL == bM4_TMR6_6->ICONR_b.INTEND) + { + if ((1UL == bM4_TMR6_6->STFLR_b.CMDF) && (0UL != (VSSEL135 & BIT_MASK_19))) + { + TMR6_6_GCmpD_IrqHandler(); + } + } + /* Timer6 Ch.6 general compare match E */ + if (1UL == bM4_TMR6_6->ICONR_b.INTENE) + { + if ((1UL == bM4_TMR6_6->STFLR_b.CMEF) && (0UL != (VSSEL135 & BIT_MASK_20))) + { + TMR6_6_GCmpE_IrqHandler(); + } + } + /* Timer6 Ch.6 general compare match F */ + if (1UL == bM4_TMR6_6->ICONR_b.INTENF) + { + if ((1UL == bM4_TMR6_6->STFLR_b.CMFF) && (0UL != (VSSEL135 & BIT_MASK_21))) + { + TMR6_6_GCmpF_IrqHandler(); + } + } + /* Timer6 Ch.6 overflow*/ + if (1UL == bM4_TMR6_6->ICONR_b.INTENOVF) + { + if ((1UL == bM4_TMR6_6->STFLR_b.OVFF) && (0UL != (VSSEL135 & BIT_MASK_22))) + { + TMR6_6_GOvf_IrqHandler(); + } + } + /* Timer6 Ch.6 underflow*/ + if (1UL == bM4_TMR6_6->ICONR_b.INTENUDF) + { + if ((1UL == bM4_TMR6_6->STFLR_b.UDFF) && (0UL != (VSSEL135 & BIT_MASK_23))) + { + TMR6_6_GUdf_IrqHandler(); + } + } + /* Timer6 Ch.6 dead time */ + if (1UL == bM4_TMR6_6->ICONR_b.INTENDTE) + { + if ((1UL == bM4_TMR6_6->STFLR_b.DTEF) && (0UL != (VSSEL135 & BIT_MASK_24))) + { + TMR6_6_Gdte_IrqHandler(); + } + } + /* Timer6 Ch.6 specified up compare match A*/ + if (1UL == bM4_TMR6_6->ICONR_b.INTENSAU) + { + if ((1UL == bM4_TMR6_6->STFLR_b.CMSAUF) && (0UL != (VSSEL135 & BIT_MASK_27))) + { + TMR6_6_SCmpUpA_IrqHandler(); + } + } + /* Timer6 Ch.6 specified down compare match A*/ + if (1UL == bM4_TMR6_6->ICONR_b.INTENSAD) + { + if ((1UL == bM4_TMR6_6->STFLR_b.CMSADF) && (0UL != (VSSEL135 & BIT_MASK_27))) + { + TMR6_6_SCmpDownA_IrqHandler(); + } + } + /* Timer6 Ch.6 specified up compare match B*/ + if (1UL == bM4_TMR6_6->ICONR_b.INTENSBU) + { + if ((1UL == bM4_TMR6_6->STFLR_b.CMSBUF) && (0UL != (VSSEL135 & BIT_MASK_28))) + { + TMR6_6_SCmpUpB_IrqHandler(); + } + } + /* Timer6 Ch.6 specified down compare match B*/ + if (1UL == bM4_TMR6_6->ICONR_b.INTENSBD) + { + if ((1UL == bM4_TMR6_6->STFLR_b.CMSBDF) && (0UL != (VSSEL135 & BIT_MASK_28))) + { + TMR6_6_SCmpDownB_IrqHandler(); + } + } + /* TimerA Ch.2 overflow */ + if (1UL == bM4_TMRA_2->BCSTR_b.ITENOVF) + { + if ((1UL == bM4_TMRA_2->BCSTR_b.OVFF) && (0UL != (VSSEL135 & BIT_MASK_29))) + { + TMRA_2_Ovf_IrqHandler(); + } + } + /* TimerA Ch.2 underflow */ + if (1UL == bM4_TMRA_2->BCSTR_b.ITENUDF) + { + if ((1UL == bM4_TMRA_2->BCSTR_b.UDFF) && (0UL != (VSSEL135 & BIT_MASK_30))) + { + TMRA_2_Udf_IrqHandler(); + } + } + /* TimerA Ch.2 compare match 1 */ + if (1UL == bM4_TMRA_2->ICONR_b.ITEN1) + { + if ((1UL == bM4_TMRA_2->STFLR_b.CMPF1) && (0UL != (VSSEL135 & BIT_MASK_31))) + { + TMRA_2_Cmp1_IrqHandler(); + } + } + /* TimerA Ch.2 compare match 2 */ + if (1UL == bM4_TMRA_2->ICONR_b.ITEN2) + { + if ((1UL == bM4_TMRA_2->STFLR_b.CMPF2) && (0UL != (VSSEL135 & BIT_MASK_31))) + { + TMRA_2_Cmp2_IrqHandler(); + } + } + /* TimerA Ch.2 compare match 3 */ + if (1UL == bM4_TMRA_2->ICONR_b.ITEN3) + { + if ((1UL == bM4_TMRA_2->STFLR_b.CMPF3) && (0UL != (VSSEL135 & BIT_MASK_31))) + { + TMRA_2_Cmp3_IrqHandler(); + } + } + /* TimerA Ch.2 compare match 4 */ + if (1UL == bM4_TMRA_2->ICONR_b.ITEN4) + { + if ((1UL == bM4_TMRA_2->STFLR_b.CMPF4) && (0UL != (VSSEL135 & BIT_MASK_31))) + { + TMRA_2_Cmp4_IrqHandler(); + } + } +} + +/** + * @brief Interrupt No.136 share IRQ handler + * @param None + * @retval None + */ +void IRQ136_Handler(void) +{ + const uint32_t VSSEL136 = M4_INTC->VSSEL136; + + /* Timer6 Ch.7 general compare match A */ + if (1UL == bM4_TMR6_7->ICONR_b.INTENA) + { + if ((1UL == bM4_TMR6_7->STFLR_b.CMAF) && (0UL != (VSSEL136 & BIT_MASK_00))) + { + TMR6_7_GCmpA_IrqHandler(); + } + } + /* Timer6 Ch.7 general compare match B */ + if (1UL == bM4_TMR6_7->ICONR_b.INTENB) + { + if ((1UL == bM4_TMR6_7->STFLR_b.CMBF) && (0UL != (VSSEL136 & BIT_MASK_01))) + { + TMR6_7_GCmpB_IrqHandler(); + } + } + /* Timer6 Ch.7 general compare match C */ + if (1UL == bM4_TMR6_7->ICONR_b.INTENC) + { + if ((1UL == bM4_TMR6_7->STFLR_b.CMCF) && (0UL != (VSSEL136 & BIT_MASK_02))) + { + TMR6_7_GCmpC_IrqHandler(); + } + } + /* Timer6 Ch.7 general compare match D */ + if (1UL == bM4_TMR6_7->ICONR_b.INTEND) + { + if ((1UL == bM4_TMR6_7->STFLR_b.CMDF) && (0UL != (VSSEL136 & BIT_MASK_03))) + { + TMR6_7_GCmpD_IrqHandler(); + } + } + /* Timer6 Ch.7 general compare match E */ + if (1UL == bM4_TMR6_7->ICONR_b.INTENE) + { + if ((1UL == bM4_TMR6_7->STFLR_b.CMEF) && (0UL != (VSSEL136 & BIT_MASK_04))) + { + TMR6_7_GCmpE_IrqHandler(); + } + } + /* Timer6 Ch.7 general compare match F */ + if (1UL == bM4_TMR6_7->ICONR_b.INTENF) + { + if ((1UL == bM4_TMR6_7->STFLR_b.CMFF) && (0UL != (VSSEL136 & BIT_MASK_05))) + { + TMR6_7_GCmpF_IrqHandler(); + } + } + /* Timer6 Ch.7 overflow*/ + if (1UL == bM4_TMR6_7->ICONR_b.INTENOVF) + { + if ((1UL == bM4_TMR6_7->STFLR_b.OVFF) && (0UL != (VSSEL136 & BIT_MASK_06))) + { + TMR6_7_GOvf_IrqHandler(); + } + } + /* Timer6 Ch.7 underflow*/ + if (1UL == bM4_TMR6_7->ICONR_b.INTENUDF) + { + if ((1UL == bM4_TMR6_7->STFLR_b.UDFF) && (0UL != (VSSEL136 & BIT_MASK_07))) + { + TMR6_7_GUdf_IrqHandler(); + } + } + /* Timer6 Ch.7 dead time */ + if (1UL == bM4_TMR6_7->ICONR_b.INTENDTE) + { + if ((1UL == bM4_TMR6_7->STFLR_b.DTEF) && (0UL != (VSSEL136 & BIT_MASK_08))) + { + TMR6_7_Gdte_IrqHandler(); + } + } + /* Timer6 Ch.7 specified up compare match A*/ + if (1UL == bM4_TMR6_7->ICONR_b.INTENSAU) + { + if ((1UL == bM4_TMR6_7->STFLR_b.CMSAUF) && (0UL != (VSSEL136 & BIT_MASK_11))) + { + TMR6_7_SCmpUpA_IrqHandler(); + } + } + /* Timer6 Ch.7 specified down compare match A*/ + if (1UL == bM4_TMR6_7->ICONR_b.INTENSAD) + { + if ((1UL == bM4_TMR6_7->STFLR_b.CMSADF) && (0UL != (VSSEL136 & BIT_MASK_11))) + { + TMR6_7_SCmpDownA_IrqHandler(); + } + } + /* Timer6 Ch.7 specified up compare match B*/ + if (1UL == bM4_TMR6_7->ICONR_b.INTENSBU) + { + if ((1UL == bM4_TMR6_7->STFLR_b.CMSBUF) && (0UL != (VSSEL136 & BIT_MASK_12))) + { + TMR6_7_SCmpUpB_IrqHandler(); + } + } + /* Timer6 Ch.7 specified down compare match B*/ + if (1UL == bM4_TMR6_7->ICONR_b.INTENSBD) + { + if ((1UL == bM4_TMR6_7->STFLR_b.CMSBDF) && (0UL != (VSSEL136 & BIT_MASK_12))) + { + TMR6_7_SCmpDownB_IrqHandler(); + } + } + /* TimerA Ch.3 overflow */ + if (1UL == bM4_TMRA_3->BCSTR_b.ITENOVF) + { + if ((1UL == bM4_TMRA_3->BCSTR_b.OVFF) && (0UL != (VSSEL136 & BIT_MASK_13))) + { + TMRA_3_Ovf_IrqHandler(); + } + } + /* TimerA Ch.3 underflow */ + if (1UL == bM4_TMRA_3->BCSTR_b.ITENUDF) + { + if ((1UL == bM4_TMRA_3->BCSTR_b.UDFF) && (0UL != (VSSEL136 & BIT_MASK_14))) + { + TMRA_3_Udf_IrqHandler(); + } + } + /* TimerA Ch.3 compare match 1 */ + if (1UL == bM4_TMRA_3->ICONR_b.ITEN1) + { + if ((1UL == bM4_TMRA_3->STFLR_b.CMPF1) && (0UL != (VSSEL136 & BIT_MASK_15))) + { + TMRA_3_Cmp1_IrqHandler(); + } + } + /* TimerA Ch.3 compare match 2 */ + if (1UL == bM4_TMRA_3->ICONR_b.ITEN2) + { + if ((1UL == bM4_TMRA_3->STFLR_b.CMPF2) && (0UL != (VSSEL136 & BIT_MASK_15))) + { + TMRA_3_Cmp2_IrqHandler(); + } + } + /* TimerA Ch.3 compare match 3 */ + if (1UL == bM4_TMRA_3->ICONR_b.ITEN3) + { + if ((1UL == bM4_TMRA_3->STFLR_b.CMPF3) && (0UL != (VSSEL136 & BIT_MASK_15))) + { + TMRA_3_Cmp3_IrqHandler(); + } + } + /* TimerA Ch.3 compare match 4 */ + if (1UL == bM4_TMRA_3->ICONR_b.ITEN4) + { + if ((1UL == bM4_TMRA_3->STFLR_b.CMPF4) && (0UL != (VSSEL136 & BIT_MASK_15))) + { + TMRA_3_Cmp4_IrqHandler(); + } + } + /* Timer6 Ch.8 general compare match A */ + if (1UL == bM4_TMR6_8->ICONR_b.INTENA) + { + if ((1UL == bM4_TMR6_8->STFLR_b.CMAF) && (0UL != (VSSEL136 & BIT_MASK_16))) + { + TMR6_8_GCmpA_IrqHandler(); + } + } + /* Timer6 Ch.8 general compare match B */ + if (1UL == bM4_TMR6_8->ICONR_b.INTENB) + { + if ((1UL == bM4_TMR6_8->STFLR_b.CMBF) && (0UL != (VSSEL136 & BIT_MASK_17))) + { + TMR6_8_GCmpB_IrqHandler(); + } + } + /* Timer6 Ch.8 general compare match C */ + if (1UL == bM4_TMR6_8->ICONR_b.INTENC) + { + if ((1UL == bM4_TMR6_8->STFLR_b.CMCF) && (0UL != (VSSEL136 & BIT_MASK_18))) + { + TMR6_8_GCmpC_IrqHandler(); + } + } + /* Timer6 Ch.8 general compare match D */ + if (1UL == bM4_TMR6_8->ICONR_b.INTEND) + { + if ((1UL == bM4_TMR6_8->STFLR_b.CMDF) && (0UL != (VSSEL136 & BIT_MASK_19))) + { + TMR6_8_GCmpD_IrqHandler(); + } + } + /* Timer6 Ch.8 general compare match E */ + if (1UL == bM4_TMR6_8->ICONR_b.INTENE) + { + if ((1UL == bM4_TMR6_8->STFLR_b.CMEF) && (0UL != (VSSEL136 & BIT_MASK_20))) + { + TMR6_8_GCmpE_IrqHandler(); + } + } + /* Timer6 Ch.8 general compare match F */ + if (1UL == bM4_TMR6_8->ICONR_b.INTENF) + { + if ((1UL == bM4_TMR6_8->STFLR_b.CMFF) && (0UL != (VSSEL136 & BIT_MASK_21))) + { + TMR6_8_GCmpF_IrqHandler(); + } + } + /* Timer6 Ch.8 overflow*/ + if (1UL == bM4_TMR6_8->ICONR_b.INTENOVF) + { + if ((1UL == bM4_TMR6_8->STFLR_b.OVFF) && (0UL != (VSSEL136 & BIT_MASK_22))) + { + TMR6_8_GOvf_IrqHandler(); + } + } + /* Timer6 Ch.8 underflow*/ + if (1UL == bM4_TMR6_8->ICONR_b.INTENUDF) + { + if ((1UL == bM4_TMR6_8->STFLR_b.UDFF) && (0UL != (VSSEL136 & BIT_MASK_23))) + { + TMR6_8_GUdf_IrqHandler(); + } + } + /* Timer6 Ch.8 dead time */ + if (1UL == bM4_TMR6_8->ICONR_b.INTENDTE) + { + if ((1UL == bM4_TMR6_8->STFLR_b.DTEF) && (0UL != (VSSEL136 & BIT_MASK_24))) + { + TMR6_8_Gdte_IrqHandler(); + } + } + /* Timer6 Ch.8 specified up compare match A*/ + if (1UL == bM4_TMR6_8->ICONR_b.INTENSAU) + { + if ((1UL == bM4_TMR6_8->STFLR_b.CMSAUF) && (0UL != (VSSEL136 & BIT_MASK_27))) + { + TMR6_8_SCmpUpA_IrqHandler(); + } + } + /* Timer6 Ch.8 specified down compare match A*/ + if (1UL == bM4_TMR6_8->ICONR_b.INTENSAD) + { + if ((1UL == bM4_TMR6_8->STFLR_b.CMSADF) && (0UL != (VSSEL136 & BIT_MASK_27))) + { + TMR6_8_SCmpDownA_IrqHandler(); + } + } + /* Timer6 Ch.8 specified up compare match B*/ + if (1UL == bM4_TMR6_8->ICONR_b.INTENSBU) + { + if ((1UL == bM4_TMR6_8->STFLR_b.CMSBUF) && (0UL != (VSSEL136 & BIT_MASK_28))) + { + TMR6_8_SCmpUpB_IrqHandler(); + } + } + /* Timer6 Ch.8 specified down compare match B*/ + if (1UL == bM4_TMR6_8->ICONR_b.INTENSBD) + { + if ((1UL == bM4_TMR6_8->STFLR_b.CMSBDF) && (0UL != (VSSEL136 & BIT_MASK_28))) + { + TMR6_8_SCmpDownB_IrqHandler(); + } + } + /* TimerA Ch.4 overflow */ + if (1UL == bM4_TMRA_4->BCSTR_b.ITENOVF) + { + if ((1UL == bM4_TMRA_4->BCSTR_b.OVFF) && (0UL != (VSSEL136 & BIT_MASK_29))) + { + TMRA_4_Ovf_IrqHandler(); + } + } + /* TimerA Ch.4 underflow */ + if (1UL == bM4_TMRA_4->BCSTR_b.ITENUDF) + { + if ((1UL == bM4_TMRA_4->BCSTR_b.UDFF) && (0UL != (VSSEL136 & BIT_MASK_30))) + { + TMRA_4_Udf_IrqHandler(); + } + } + /* TimerA Ch.4 compare match 1 */ + if (1UL == bM4_TMRA_4->ICONR_b.ITEN1) + { + if ((1UL == bM4_TMRA_4->STFLR_b.CMPF1) && (0UL != (VSSEL136 & BIT_MASK_31))) + { + TMRA_4_Cmp1_IrqHandler(); + } + } + /* TimerA Ch.4 compare match 2 */ + if (1UL == bM4_TMRA_4->ICONR_b.ITEN2) + { + if ((1UL == bM4_TMRA_4->STFLR_b.CMPF2) && (0UL != (VSSEL136 & BIT_MASK_31))) + { + TMRA_4_Cmp2_IrqHandler(); + } + } + /* TimerA Ch.4 compare match 3 */ + if (1UL == bM4_TMRA_4->ICONR_b.ITEN3) + { + if ((1UL == bM4_TMRA_4->STFLR_b.CMPF3) && (0UL != (VSSEL136 & BIT_MASK_31))) + { + TMRA_4_Cmp3_IrqHandler(); + } + } + /* TimerA Ch.4 compare match 4 */ + if (1UL == bM4_TMRA_4->ICONR_b.ITEN4) + { + if ((1UL == bM4_TMRA_4->STFLR_b.CMPF4) && (0UL != (VSSEL136 & BIT_MASK_31))) + { + TMRA_4_Cmp4_IrqHandler(); + } + } +} + +/** + * @brief Interrupt No.137 share IRQ handler + * @param None + * @retval None + */ +void IRQ137_Handler(void) +{ + const uint32_t VSSEL137 = M4_INTC->VSSEL137; + uint32_t u32Tmp1; + uint32_t u32Tmp2; + + /* EMB0 */ + u32Tmp1 = M4_EMB0->INTEN & (BIT_MASK_01 | BIT_MASK_02 | BIT_MASK_03 | \ + BIT_MASK_08 | BIT_MASK_09 | BIT_MASK_10 | BIT_MASK_11); + u32Tmp2 = M4_EMB0->STAT & (BIT_MASK_01 | BIT_MASK_02 | BIT_MASK_03 | \ + BIT_MASK_08 | BIT_MASK_09 | BIT_MASK_10 | BIT_MASK_11); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL137 & BIT_MASK_00))) + { + EMB_GR0_IrqHandler(); + } + /* EMB1 */ + u32Tmp1 = M4_EMB1->INTEN & (BIT_MASK_01 | BIT_MASK_02 | BIT_MASK_03 | \ + BIT_MASK_08 | BIT_MASK_09 | BIT_MASK_10 | BIT_MASK_11); + u32Tmp2 = M4_EMB1->STAT & (BIT_MASK_01 | BIT_MASK_02 | BIT_MASK_03 | \ + BIT_MASK_08 | BIT_MASK_09 | BIT_MASK_10 | BIT_MASK_11); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL137 & BIT_MASK_01))) + { + EMB_GR1_IrqHandler(); + } + /* EMB2 */ + u32Tmp1 = M4_EMB2->INTEN & (BIT_MASK_01 | BIT_MASK_02 | BIT_MASK_03 | \ + BIT_MASK_08 | BIT_MASK_09 | BIT_MASK_10 | BIT_MASK_11); + u32Tmp2 = M4_EMB2->STAT & (BIT_MASK_01 | BIT_MASK_02 | BIT_MASK_03 | \ + BIT_MASK_08 | BIT_MASK_09 | BIT_MASK_10 | BIT_MASK_11); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL137 & BIT_MASK_02))) + { + EMB_GR2_IrqHandler(); + } + /* EMB3 */ + u32Tmp1 = M4_EMB3->INTEN & (BIT_MASK_01 | BIT_MASK_02 | BIT_MASK_03 | \ + BIT_MASK_08 | BIT_MASK_09 | BIT_MASK_10 | BIT_MASK_11); + u32Tmp2 = M4_EMB3->STAT & (BIT_MASK_01 | BIT_MASK_02 | BIT_MASK_03 | \ + BIT_MASK_08 | BIT_MASK_09 | BIT_MASK_10 | BIT_MASK_11); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL137 & BIT_MASK_03))) + { + EMB_GR3_IrqHandler(); + } + /* EMB4 */ + u32Tmp1 = M4_EMB4->INTEN & (BIT_MASK_01 | BIT_MASK_02 | BIT_MASK_03 | \ + BIT_MASK_08 | BIT_MASK_09 | BIT_MASK_10 | BIT_MASK_11); + u32Tmp2 = M4_EMB4->STAT & (BIT_MASK_01 | BIT_MASK_02 | BIT_MASK_03 | \ + BIT_MASK_08 | BIT_MASK_09 | BIT_MASK_10 | BIT_MASK_11); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL137 & BIT_MASK_04))) + { + EMB_GR4_IrqHandler(); + } + /* EMB5 */ + u32Tmp1 = M4_EMB5->INTEN & (BIT_MASK_01 | BIT_MASK_02 | BIT_MASK_03 | \ + BIT_MASK_08 | BIT_MASK_09 | BIT_MASK_10 | BIT_MASK_11); + u32Tmp2 = M4_EMB5->STAT & (BIT_MASK_01 | BIT_MASK_02 | BIT_MASK_03 | \ + BIT_MASK_08 | BIT_MASK_09 | BIT_MASK_10 | BIT_MASK_11); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL137 & BIT_MASK_05))) + { + EMB_GR5_IrqHandler(); + } + /* EMB6 */ + u32Tmp1 = M4_EMB6->INTEN & (BIT_MASK_01 | BIT_MASK_02 | BIT_MASK_03 | \ + BIT_MASK_08 | BIT_MASK_09 | BIT_MASK_10 | BIT_MASK_11); + u32Tmp2 = M4_EMB6->STAT & (BIT_MASK_01 | BIT_MASK_02 | BIT_MASK_03 | \ + BIT_MASK_08 | BIT_MASK_09 | BIT_MASK_10 | BIT_MASK_11); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL137 & BIT_MASK_06))) + { + EMB_GR6_IrqHandler(); + } + /* USB HS EP1 out */ + + /* USB HS EP1 in */ + + /* USB HS global */ + + /* USB HS wakeup */ + + if (1UL == bM4_USART1->CR1_b.RIE) + { + /* USART Ch.1 Rx ORE/FE/PE error */ + u32Tmp1 = M4_USART1->SR & (USART_SR_PE | USART_SR_FE | USART_SR_ORE); + if ((0UL != u32Tmp1) && (0UL != (VSSEL137 & BIT_MASK_12))) + { + USART_1_RxErr_IrqHandler(); + } + /* USART Ch.1 Rx end */ + if ((1UL == bM4_USART1->SR_b.RXNE) && (0UL != (VSSEL137 & BIT_MASK_13))) + { + USART_1_RxEnd_IrqHandler(); + } + } + /* USART Ch.1 Tx buffer empty */ + if (1UL == bM4_USART1->CR1_b.TXEIE) + { + if ((1UL == bM4_USART1->SR_b.TXE) && (0UL != (VSSEL137 & BIT_MASK_14))) + { + USART_1_TxEmpty_IrqHandler(); + } + } + /* USART Ch.1 Tx end */ + if (1UL == bM4_USART1->CR1_b.TCIE) + { + if ((1UL == bM4_USART1->SR_b.TC) && (0UL != (VSSEL137 & BIT_MASK_15))) + { + USART_1_TxEnd_IrqHandler(); + } + } + /* USART Ch.1 Tx timeout */ + if (1UL == bM4_USART1->CR1_b.RTOIE) + { + if ((1UL == bM4_USART1->SR_b.RTOF) && (0UL != (VSSEL137 & BIT_MASK_16))) + { + USART_1_RxTO_IrqHandler(); + } + } + if (1UL == bM4_USART2->CR1_b.RIE) + { + /* USART Ch.2 Rx ORE/FE/PE error */ + u32Tmp1 = M4_USART2->SR & (USART_SR_PE | USART_SR_FE | USART_SR_ORE); + if ((0UL != u32Tmp1) && (0UL != (VSSEL137 & BIT_MASK_17))) + { + USART_2_RxErr_IrqHandler(); + } + /* USART Ch.2 Rx end */ + if ((1UL == bM4_USART2->SR_b.RXNE) && (0UL != (VSSEL137 & BIT_MASK_18))) + { + USART_2_RxEnd_IrqHandler(); + } + } + /* USART Ch.2 Tx buffer empty */ + if (1UL == bM4_USART2->CR1_b.TXEIE) + { + if ((1UL == bM4_USART2->SR_b.TXE) && (0UL != (VSSEL137 & BIT_MASK_19))) + { + USART_2_TxEmpty_IrqHandler(); + } + } + /* USART Ch.2 Tx end */ + if (1UL == bM4_USART2->CR1_b.TCIE) + { + if ((1UL == bM4_USART2->SR_b.TC) && (0UL != (VSSEL137 & BIT_MASK_20))) + { + USART_2_TxEnd_IrqHandler(); + } + } + /* USART Ch.2 Tx timeout */ + if (1UL == bM4_USART2->CR1_b.RTOIE) + { + if ((1UL == bM4_USART2->SR_b.RTOF) && (0UL != (VSSEL137 & BIT_MASK_21))) + { + USART_2_RxTO_IrqHandler(); + } + } + /* SPI Ch.1 Rx end */ + if (1UL == bM4_SPI1->CR1_b.RXIE) + { + if ((1UL == bM4_SPI1->SR_b.RDFF) && (0UL != (VSSEL137 & BIT_MASK_22))) + { + SPI_1_RxEnd_IrqHandler(); + } + } + /* SPI Ch.1 Tx buffer empty */ + if (1UL == bM4_SPI1->CR1_b.TXIE) + { + if ((1UL == bM4_SPI1->SR_b.TDEF) && (0UL != (VSSEL137 & BIT_MASK_23))) + { + SPI_1_TxEmpty_IrqHandler(); + } + } + /* SPI Ch.1 Bus idle */ + if (1UL == bM4_SPI1->CR1_b.IDIE) + { + if ((0UL == bM4_SPI1->SR_b.IDLNF) && (0UL != (VSSEL137 & BIT_MASK_24))) + { + SPI_1_Idle_IrqHandler(); + } + } + /* SPI Ch.1 parity/overflow/underflow/mode error */ + if (1UL == bM4_SPI1->CR1_b.EIE) + { + u32Tmp1 = M4_SPI1->SR & (SPI_SR_OVRERF | SPI_SR_MODFERF | SPI_SR_PERF | SPI_SR_UDRERF); + if ((0UL != u32Tmp1) && (0UL != (VSSEL137 & BIT_MASK_25))) + { + SPI_1_Err_IrqHandler(); + } + } + /* SPI Ch.2 Rx end */ + if (1UL == bM4_SPI2->CR1_b.RXIE) + { + if ((1UL == bM4_SPI2->SR_b.RDFF) && (0UL != (VSSEL137 & BIT_MASK_27))) + { + SPI_2_RxEnd_IrqHandler(); + } + } + /* SPI Ch.2 Tx buffer empty */ + if (1UL == bM4_SPI2->CR1_b.TXIE) + { + if ((1UL == bM4_SPI2->SR_b.TDEF) && (0UL != (VSSEL137 & BIT_MASK_28))) + { + SPI_2_TxEmpty_IrqHandler(); + } + } + /* SPI Ch.2 Bus idle */ + if (1UL == bM4_SPI2->CR1_b.IDIE) + { + if ((0UL == bM4_SPI2->SR_b.IDLNF) && (0UL != (VSSEL137 & BIT_MASK_29))) + { + SPI_2_Idle_IrqHandler(); + } + } + /* SPI Ch.2 parity/overflow/underflow/mode error */ + if (1UL == bM4_SPI2->CR1_b.EIE) + { + u32Tmp1 = M4_SPI2->SR & (SPI_SR_OVRERF | SPI_SR_MODFERF | SPI_SR_PERF | SPI_SR_UDRERF); + if ((0UL != u32Tmp1) && (0UL != (VSSEL137 & BIT_MASK_30))) + { + SPI_2_Err_IrqHandler(); + } + } +} + +/** + * @brief Interrupt No.138 share IRQ handler + * @param None + * @retval None + */ +void IRQ138_Handler(void) +{ + const uint32_t VSSEL138 = M4_INTC->VSSEL138; + uint32_t u32Tmp1; + uint8_t RTIF; + uint8_t RTIE; + uint8_t ERRINT; + uint8_t TTCFG; + + /* TimerA Ch.5 overflow */ + if (1UL == bM4_TMRA_5->BCSTR_b.ITENOVF) + { + if ((1UL == bM4_TMRA_5->BCSTR_b.OVFF) && (0UL != (VSSEL138 & BIT_MASK_00))) + { + TMRA_5_Ovf_IrqHandler(); + } + } + /* TimerA Ch.5 underflow */ + if (1UL == bM4_TMRA_5->BCSTR_b.ITENUDF) + { + if ((1UL == bM4_TMRA_5->BCSTR_b.UDFF) && (0UL != (VSSEL138 & BIT_MASK_01))) + { + TMRA_5_Udf_IrqHandler(); + } + } + /* TimerA Ch.5 compare match 1 */ + if (1UL == bM4_TMRA_5->ICONR_b.ITEN1) + { + if ((1UL == bM4_TMRA_5->STFLR_b.CMPF1) && (0UL != (VSSEL138 & BIT_MASK_02))) + { + TMRA_5_Cmp1_IrqHandler(); + } + } + /* TimerA Ch.5 compare match 2 */ + if (1UL == bM4_TMRA_5->ICONR_b.ITEN2) + { + if ((1UL == bM4_TMRA_5->STFLR_b.CMPF2) && (0UL != (VSSEL138 & BIT_MASK_02))) + { + TMRA_5_Cmp2_IrqHandler(); + } + } + /* TimerA Ch.5 compare match 3 */ + if (1UL == bM4_TMRA_5->ICONR_b.ITEN3) + { + if ((1UL == bM4_TMRA_5->STFLR_b.CMPF3) && (0UL != (VSSEL138 & BIT_MASK_02))) + { + TMRA_5_Cmp3_IrqHandler(); + } + } + /* TimerA Ch.5 compare match 4 */ + if (1UL == bM4_TMRA_5->ICONR_b.ITEN4) + { + if ((1UL == bM4_TMRA_5->STFLR_b.CMPF4) && (0UL != (VSSEL138 & BIT_MASK_02))) + { + TMRA_5_Cmp4_IrqHandler(); + } + } + /* TimerA Ch.6 overflow */ + if (1UL == bM4_TMRA_6->BCSTR_b.ITENOVF) + { + if ((1UL == bM4_TMRA_6->BCSTR_b.OVFF) && (0UL != (VSSEL138 & BIT_MASK_03))) + { + TMRA_6_Ovf_IrqHandler(); + } + } + /* TimerA Ch.6 underflow */ + if (1UL == bM4_TMRA_6->BCSTR_b.ITENUDF) + { + if ((1UL == bM4_TMRA_6->BCSTR_b.UDFF) && (0UL != (VSSEL138 & BIT_MASK_04))) + { + TMRA_6_Udf_IrqHandler(); + } + } + /* TimerA Ch.6 compare match 1 */ + if (1UL == bM4_TMRA_6->ICONR_b.ITEN1) + { + if ((1UL == bM4_TMRA_6->STFLR_b.CMPF1) && (0UL != (VSSEL138 & BIT_MASK_05))) + { + TMRA_6_Cmp1_IrqHandler(); + } + } + /* TimerA Ch.6 compare match 2 */ + if (1UL == bM4_TMRA_6->ICONR_b.ITEN2) + { + if ((1UL == bM4_TMRA_6->STFLR_b.CMPF2) && (0UL != (VSSEL138 & BIT_MASK_05))) + { + TMRA_6_Cmp2_IrqHandler(); + } + } + /* TimerA Ch.6 compare match 3 */ + if (1UL == bM4_TMRA_6->ICONR_b.ITEN3) + { + if ((1UL == bM4_TMRA_6->STFLR_b.CMPF3) && (0UL != (VSSEL138 & BIT_MASK_05))) + { + TMRA_6_Cmp3_IrqHandler(); + } + } + /* TimerA Ch.6 compare match 4 */ + if (1UL == bM4_TMRA_6->ICONR_b.ITEN4) + { + if ((1UL == bM4_TMRA_6->STFLR_b.CMPF4) && (0UL != (VSSEL138 & BIT_MASK_05))) + { + TMRA_6_Cmp4_IrqHandler(); + } + } + /* TimerA Ch.7 overflow */ + if (1UL == bM4_TMRA_7->BCSTR_b.ITENOVF) + { + if ((1UL == bM4_TMRA_7->BCSTR_b.OVFF) && (0UL != (VSSEL138 & BIT_MASK_06))) + { + TMRA_7_Ovf_IrqHandler(); + } + } + /* TimerA Ch.7 underflow */ + if (1UL == bM4_TMRA_7->BCSTR_b.ITENUDF) + { + if ((1UL == bM4_TMRA_7->BCSTR_b.UDFF) && (0UL != (VSSEL138 & BIT_MASK_07))) + { + TMRA_7_Udf_IrqHandler(); + } + } + /* TimerA Ch.7 compare match 1 */ + if (1UL == bM4_TMRA_7->ICONR_b.ITEN1) + { + if ((1UL == bM4_TMRA_7->STFLR_b.CMPF1) && (0UL != (VSSEL138 & BIT_MASK_08))) + { + TMRA_7_Cmp1_IrqHandler(); + } + } + /* TimerA Ch.7 compare match 2 */ + if (1UL == bM4_TMRA_7->ICONR_b.ITEN2) + { + if ((1UL == bM4_TMRA_7->STFLR_b.CMPF2) && (0UL != (VSSEL138 & BIT_MASK_08))) + { + TMRA_7_Cmp2_IrqHandler(); + } + } + /* TimerA Ch.7 compare match 3 */ + if (1UL == bM4_TMRA_7->ICONR_b.ITEN3) + { + if ((1UL == bM4_TMRA_7->STFLR_b.CMPF3) && (0UL != (VSSEL138 & BIT_MASK_08))) + { + TMRA_7_Cmp3_IrqHandler(); + } + } + /* TimerA Ch.7 compare match 4 */ + if (1UL == bM4_TMRA_7->ICONR_b.ITEN4) + { + if ((1UL == bM4_TMRA_7->STFLR_b.CMPF4) && (0UL != (VSSEL138 & BIT_MASK_08))) + { + TMRA_7_Cmp4_IrqHandler(); + } + } + /* TimerA Ch.8 overflow */ + if (1UL == bM4_TMRA_8->BCSTR_b.ITENOVF) + { + if ((1UL == bM4_TMRA_8->BCSTR_b.OVFF) && (0UL != (VSSEL138 & BIT_MASK_09))) + { + TMRA_8_Ovf_IrqHandler(); + } + } + /* TimerA Ch.8 underflow */ + if (1UL == bM4_TMRA_8->BCSTR_b.ITENUDF) + { + if ((1UL == bM4_TMRA_8->BCSTR_b.UDFF) && (0UL != (VSSEL138 & BIT_MASK_10))) + { + TMRA_8_Udf_IrqHandler(); + } + } + /* TimerA Ch.8 compare match 1 */ + if (1UL == bM4_TMRA_8->ICONR_b.ITEN1) + { + if ((1UL == bM4_TMRA_8->STFLR_b.CMPF1) && (0UL != (VSSEL138 & BIT_MASK_11))) + { + TMRA_8_Cmp1_IrqHandler(); + } + } + /* TimerA Ch.8 compare match 2 */ + if (1UL == bM4_TMRA_8->ICONR_b.ITEN2) + { + if ((1UL == bM4_TMRA_8->STFLR_b.CMPF2) && (0UL != (VSSEL138 & BIT_MASK_11))) + { + TMRA_8_Cmp2_IrqHandler(); + } + } + /* TimerA Ch.8 compare match 3 */ + if (1UL == bM4_TMRA_8->ICONR_b.ITEN3) + { + if ((1UL == bM4_TMRA_8->STFLR_b.CMPF3) && (0UL != (VSSEL138 & BIT_MASK_11))) + { + TMRA_8_Cmp3_IrqHandler(); + } + } + /* TimerA Ch.8 compare match 4 */ + if (1UL == bM4_TMRA_8->ICONR_b.ITEN4) + { + if ((1UL == bM4_TMRA_8->STFLR_b.CMPF4) && (0UL != (VSSEL138 & BIT_MASK_11))) + { + TMRA_8_Cmp4_IrqHandler(); + } + } + if (1UL == bM4_USART3->CR1_b.RIE) + { + /* USART Ch.3 Rx ORE/FE/PE error */ + u32Tmp1 = M4_USART3->SR & (USART_SR_PE | USART_SR_FE | USART_SR_ORE); + if ((0UL != u32Tmp1) && (0UL != (VSSEL138 & BIT_MASK_12))) + { + USART_3_RxErr_IrqHandler(); + } + /* USART Ch.3 Rx end */ + if ((1UL == bM4_USART3->SR_b.RXNE) && (0UL != (VSSEL138 & BIT_MASK_13))) + { + USART_3_RxEnd_IrqHandler(); + } + } + /* USART Ch.3 Tx buffer empty */ + if (1UL == bM4_USART3->CR1_b.TXEIE) + { + if ((1UL == bM4_USART3->SR_b.TXE) && (0UL != (VSSEL138 & BIT_MASK_14))) + { + USART_3_TxEmpty_IrqHandler(); + } + } + /* USART Ch.3 Tx end */ + if (1UL == bM4_USART3->CR1_b.TCIE) + { + if ((1UL == bM4_USART3->SR_b.TC) && (0UL != (VSSEL138 & BIT_MASK_15))) + { + USART_3_TxEnd_IrqHandler(); + } + } + if (1UL == bM4_USART4->CR1_b.RIE) + { + /* USART Ch.4 Rx ORE/FE/PE error */ + u32Tmp1 = M4_USART4->SR & (USART_SR_PE | USART_SR_FE | USART_SR_ORE); + if ((0UL != u32Tmp1) && (0UL != (VSSEL138 & BIT_MASK_16))) + { + USART_4_RxErr_IrqHandler(); + } + /* USART Ch.4 Rx end */ + if ((1UL == bM4_USART4->SR_b.RXNE) && (0UL != (VSSEL138 & BIT_MASK_17))) + { + USART_4_RxEnd_IrqHandler(); + } + } + /* USART Ch.4 Tx buffer empty */ + if (1UL == bM4_USART4->CR1_b.TXEIE) + { + if ((1UL == bM4_USART4->SR_b.TXE) && (0UL != (VSSEL138 & BIT_MASK_18))) + { + USART_4_TxEmpty_IrqHandler(); + } + } + /* USART Ch.4 Tx end */ + if (1UL == bM4_USART4->CR1_b.TCIE) + { + if ((1UL == bM4_USART4->SR_b.TC) && (0UL != (VSSEL138 & BIT_MASK_19))) + { + USART_4_TxEnd_IrqHandler(); + } + } + /* CAN Ch.1 */ + if (0UL != (0UL != (VSSEL138 & BIT_MASK_20))) + { + RTIF = M4_CAN1->RTIF; + RTIE = M4_CAN1->RTIE; + ERRINT = M4_CAN1->ERRINT; + TTCFG = M4_CAN1->TTCFG; + if ((0U != (TTCFG & CAN_TTCFG_TEIF)) || \ + (0U != (RTIF & CAN_RTIF_AIF)) || \ + (0U != (RTIF & RTIE & 0xFEU)) || \ + ((0U != (ERRINT & CAN_ERRINT_BEIE)) && \ + (0U != (ERRINT & CAN_ERRINT_BEIF))) || \ + ((0U != (ERRINT & CAN_ERRINT_ALIE)) && \ + (0U != (ERRINT & CAN_ERRINT_ALIF))) || \ + ((0U != (ERRINT & CAN_ERRINT_EPIE)) && \ + (0U != (ERRINT & CAN_ERRINT_EPIF))) || \ + ((0U != (TTCFG & CAN_TTCFG_TTIE)) && \ + (0U != (TTCFG & CAN_TTCFG_TTIF))) || \ + ((0U != (TTCFG & CAN_TTCFG_WTIE)) && \ + (0U != (TTCFG & CAN_TTCFG_WTIF)))) + { + CAN_1_IrqHandler(); + } + } + /* CAN Ch.2 */ + if (0UL != (0UL != (VSSEL138 & BIT_MASK_21))) + { + RTIF = M4_CAN2->RTIF; + RTIE = M4_CAN2->RTIE; + ERRINT = M4_CAN2->ERRINT; + TTCFG = M4_CAN2->TTCFG; + if ((0U != (TTCFG & CAN_TTCFG_TEIF)) || \ + (0U != (RTIF & CAN_RTIF_AIF)) || \ + (0U != (RTIF & RTIE & 0xFEU)) || \ + ((0U != (ERRINT & CAN_ERRINT_BEIE)) && \ + (0U != (ERRINT & CAN_ERRINT_BEIF))) || \ + ((0U != (ERRINT & CAN_ERRINT_ALIE)) && \ + (0U != (ERRINT & CAN_ERRINT_ALIF))) || \ + ((0U != (ERRINT & CAN_ERRINT_EPIE)) && \ + (0U != (ERRINT & CAN_ERRINT_EPIF))) || \ + ((0U != (TTCFG & CAN_TTCFG_TTIE)) && \ + (0U != (TTCFG & CAN_TTCFG_TTIF))) || \ + ((0U != (TTCFG & CAN_TTCFG_WTIE)) && \ + (0U != (TTCFG & CAN_TTCFG_WTIF)))) + { + CAN_2_IrqHandler(); + } + } + /* SPI Ch.3 Rx end */ + if (1UL == bM4_SPI3->CR1_b.RXIE) + { + if ((1UL == bM4_SPI3->SR_b.RDFF) && (0UL != (VSSEL138 & BIT_MASK_22))) + { + SPI_3_RxEnd_IrqHandler(); + } + } + /* SPI Ch.3 Tx buffer empty */ + if (1UL == bM4_SPI3->CR1_b.TXIE) + { + if ((1UL == bM4_SPI3->SR_b.TDEF) && (0UL != (VSSEL138 & BIT_MASK_23))) + { + SPI_3_TxEmpty_IrqHandler(); + } + } + /* SPI Ch.3 Bus idle */ + if (1UL == bM4_SPI3->CR1_b.IDIE) + { + if ((0UL == bM4_SPI3->SR_b.IDLNF) && (0UL != (VSSEL138 & BIT_MASK_24))) + { + SPI_3_Idle_IrqHandler(); + } + } + /* SPI Ch.3 parity/overflow/underflow/mode error */ + if (1UL == bM4_SPI3->CR1_b.EIE) + { + u32Tmp1 = M4_SPI3->SR & (SPI_SR_OVRERF | SPI_SR_MODFERF | SPI_SR_PERF | SPI_SR_UDRERF); + if ((0UL != u32Tmp1) && (0UL != (VSSEL138 & BIT_MASK_25))) + { + SPI_3_Err_IrqHandler(); + } + } + /* SPI Ch.4 Rx end */ + if (1UL == bM4_SPI4->CR1_b.RXIE) + { + if ((1UL == bM4_SPI4->SR_b.RDFF) && (0UL != (VSSEL138 & BIT_MASK_27))) + { + SPI_4_RxEnd_IrqHandler(); + } + } + /* SPI Ch.4 Tx buffer empty */ + if (1UL == bM4_SPI4->CR1_b.TXIE) + { + if ((1UL == bM4_SPI4->SR_b.TDEF) && (0UL != (VSSEL138 & BIT_MASK_28))) + { + SPI_4_TxEmpty_IrqHandler(); + } + } + /* SPI Ch.4 Bus idle */ + if (1UL == bM4_SPI4->CR1_b.IDIE) + { + if ((0UL == bM4_SPI4->SR_b.IDLNF) && (0UL != (VSSEL138 & BIT_MASK_29))) + { + SPI_4_Idle_IrqHandler(); + } + } + /* SPI Ch.4 parity/overflow/underflow/mode error */ + if (1UL == bM4_SPI4->CR1_b.EIE) + { + u32Tmp1 = M4_SPI4->SR & (SPI_SR_OVRERF | SPI_SR_MODFERF | SPI_SR_PERF | SPI_SR_UDRERF); + if ((0UL != u32Tmp1) && (0UL != (VSSEL138 & BIT_MASK_30))) + { + SPI_4_Err_IrqHandler(); + } + } +} + +/** + * @brief Interrupt No.139 share IRQ handler + * @param None + * @retval None + */ +void IRQ139_Handler(void) +{ + const uint32_t VSSEL139 = M4_INTC->VSSEL139; + uint32_t u32Tmp1; + + /* TimerA Ch.9 overflow */ + if (1UL == bM4_TMRA_9->BCSTR_b.ITENOVF) + { + if ((1UL == bM4_TMRA_9->BCSTR_b.OVFF) && (0UL != (VSSEL139 & BIT_MASK_00))) + { + TMRA_9_Ovf_IrqHandler(); + } + } + /* TimerA Ch.9 underflow */ + if (1UL == bM4_TMRA_9->BCSTR_b.ITENUDF) + { + if ((1UL == bM4_TMRA_9->BCSTR_b.UDFF) && (0UL != (VSSEL139 & BIT_MASK_01))) + { + TMRA_9_Udf_IrqHandler(); + } + } + /* TimerA Ch.9 compare match 1 */ + if (1UL == bM4_TMRA_9->ICONR_b.ITEN1) + { + if ((1UL == bM4_TMRA_9->STFLR_b.CMPF1) && (0UL != (VSSEL139 & BIT_MASK_02))) + { + TMRA_9_Cmp1_IrqHandler(); + } + } + /* TimerA Ch.9 compare match 2 */ + if (1UL == bM4_TMRA_9->ICONR_b.ITEN2) + { + if ((1UL == bM4_TMRA_9->STFLR_b.CMPF2) && (0UL != (VSSEL139 & BIT_MASK_02))) + { + TMRA_9_Cmp2_IrqHandler(); + } + } + /* TimerA Ch.9 compare match 3 */ + if (1UL == bM4_TMRA_9->ICONR_b.ITEN3) + { + if ((1UL == bM4_TMRA_9->STFLR_b.CMPF3) && (0UL != (VSSEL139 & BIT_MASK_02))) + { + TMRA_9_Cmp3_IrqHandler(); + } + } + /* TimerA Ch.9 compare match 4 */ + if (1UL == bM4_TMRA_9->ICONR_b.ITEN4) + { + if ((1UL == bM4_TMRA_9->STFLR_b.CMPF4) && (0UL != (VSSEL139 & BIT_MASK_02))) + { + TMRA_9_Cmp4_IrqHandler(); + } + } + /* TimerA Ch.10 overflow */ + if (1UL == bM4_TMRA_10->BCSTR_b.ITENOVF) + { + if ((1UL == bM4_TMRA_10->BCSTR_b.OVFF) && (0UL != (VSSEL139 & BIT_MASK_03))) + { + TMRA_10_Ovf_IrqHandler(); + } + } + /* TimerA Ch.10 underflow */ + if (1UL == bM4_TMRA_10->BCSTR_b.ITENUDF) + { + if ((1UL == bM4_TMRA_10->BCSTR_b.UDFF) && (0UL != (VSSEL139 & BIT_MASK_04))) + { + TMRA_10_Udf_IrqHandler(); + } + } + /* TimerA Ch.10 compare match 1 */ + if (1UL == bM4_TMRA_10->ICONR_b.ITEN1) + { + if ((1UL == bM4_TMRA_10->STFLR_b.CMPF1) && (0UL != (VSSEL139 & BIT_MASK_05))) + { + TMRA_10_Cmp1_IrqHandler(); + } + } + /* TimerA Ch.10 compare match 2 */ + if (1UL == bM4_TMRA_10->ICONR_b.ITEN2) + { + if ((1UL == bM4_TMRA_10->STFLR_b.CMPF2) && (0UL != (VSSEL139 & BIT_MASK_05))) + { + TMRA_10_Cmp2_IrqHandler(); + } + } + /* TimerA Ch.10 compare match 3 */ + if (1UL == bM4_TMRA_10->ICONR_b.ITEN3) + { + if ((1UL == bM4_TMRA_10->STFLR_b.CMPF3) && (0UL != (VSSEL139 & BIT_MASK_05))) + { + TMRA_10_Cmp3_IrqHandler(); + } + } + /* TimerA Ch.10 compare match 4 */ + if (1UL == bM4_TMRA_10->ICONR_b.ITEN4) + { + if ((1UL == bM4_TMRA_10->STFLR_b.CMPF4) && (0UL != (VSSEL139 & BIT_MASK_05))) + { + TMRA_10_Cmp4_IrqHandler(); + } + } + /* TimerA Ch.11 overflow */ + if (1UL == bM4_TMRA_11->BCSTR_b.ITENOVF) + { + if ((1UL == bM4_TMRA_11->BCSTR_b.OVFF) && (0UL != (VSSEL139 & BIT_MASK_06))) + { + TMRA_11_Ovf_IrqHandler(); + } + } + /* TimerA Ch.11 underflow */ + if (1UL == bM4_TMRA_11->BCSTR_b.ITENUDF) + { + if ((1UL == bM4_TMRA_11->BCSTR_b.UDFF) && (0UL != (VSSEL139 & BIT_MASK_07))) + { + TMRA_11_Udf_IrqHandler(); + } + } + /* TimerA Ch.11 compare match 1 */ + if (1UL == bM4_TMRA_11->ICONR_b.ITEN1) + { + if ((1UL == bM4_TMRA_11->STFLR_b.CMPF1) && (0UL != (VSSEL139 & BIT_MASK_08))) + { + TMRA_11_Cmp1_IrqHandler(); + } + } + /* TimerA Ch.11 compare match 2 */ + if (1UL == bM4_TMRA_11->ICONR_b.ITEN2) + { + if ((1UL == bM4_TMRA_11->STFLR_b.CMPF2) && (0UL != (VSSEL139 & BIT_MASK_08))) + { + TMRA_11_Cmp2_IrqHandler(); + } + } + /* TimerA Ch.11 compare match 3 */ + if (1UL == bM4_TMRA_11->ICONR_b.ITEN3) + { + if ((1UL == bM4_TMRA_11->STFLR_b.CMPF3) && (0UL != (VSSEL139 & BIT_MASK_08))) + { + TMRA_11_Cmp3_IrqHandler(); + } + } + /* TimerA Ch.11 compare match 4 */ + if (1UL == bM4_TMRA_11->ICONR_b.ITEN4) + { + if ((1UL == bM4_TMRA_11->STFLR_b.CMPF4) && (0UL != (VSSEL139 & BIT_MASK_08))) + { + TMRA_11_Cmp4_IrqHandler(); + } + } + /* TimerA Ch.12 overflow */ + if (1UL == bM4_TMRA_12->BCSTR_b.ITENOVF) + { + if ((1UL == bM4_TMRA_12->BCSTR_b.OVFF) && (0UL != (VSSEL139 & BIT_MASK_09))) + { + TMRA_12_Ovf_IrqHandler(); + } + } + /* TimerA Ch.12 underflow */ + if (1UL == bM4_TMRA_12->BCSTR_b.ITENUDF) + { + if ((1UL == bM4_TMRA_12->BCSTR_b.UDFF) && (0UL != (VSSEL139 & BIT_MASK_10))) + { + TMRA_12_Udf_IrqHandler(); + } + } + /* TimerA Ch.12 compare match 1 */ + if (1UL == bM4_TMRA_12->ICONR_b.ITEN1) + { + if ((1UL == bM4_TMRA_12->STFLR_b.CMPF1) && (0UL != (VSSEL139 & BIT_MASK_11))) + { + TMRA_12_Cmp1_IrqHandler(); + } + } + /* TimerA Ch.12 compare match 2 */ + if (1UL == bM4_TMRA_12->ICONR_b.ITEN2) + { + if ((1UL == bM4_TMRA_12->STFLR_b.CMPF2) && (0UL != (VSSEL139 & BIT_MASK_11))) + { + TMRA_12_Cmp2_IrqHandler(); + } + } + /* TimerA Ch.12 compare match 3 */ + if (1UL == bM4_TMRA_12->ICONR_b.ITEN3) + { + if ((1UL == bM4_TMRA_12->STFLR_b.CMPF3) && (0UL != (VSSEL139 & BIT_MASK_11))) + { + TMRA_12_Cmp3_IrqHandler(); + } + } + /* TimerA Ch.12 compare match 4 */ + if (1UL == bM4_TMRA_12->ICONR_b.ITEN4) + { + if ((1UL == bM4_TMRA_12->STFLR_b.CMPF4) && (0UL != (VSSEL139 & BIT_MASK_11))) + { + TMRA_12_Cmp4_IrqHandler(); + } + } + /* USART Ch.5 LIN bus break */ + if (1UL == bM4_USART5->CR2_b.LBDIE) + { + if ((1UL == bM4_USART5->SR_b.LBD) && (0UL != (VSSEL139 & BIT_MASK_12))) + { + USART_5_LinBreakField_IrqHandler(); + } + } + /* USART Ch.5 LIN bus wakeup */ + if (1UL == bM4_USART5->CR2_b.WKUPE) + { + if ((1UL == bM4_USART5->SR_b.WKUP) && (0UL != (VSSEL139 & BIT_MASK_12))) + { + USART_5_LinWakeup_IrqHandler(); + } + } + if (1UL == bM4_USART5->CR1_b.RIE) + { + /* USART Ch.5 Rx ORE/FE/PE error */ + u32Tmp1 = M4_USART5->SR & (USART_SR_PE | USART_SR_FE | USART_SR_ORE); + if ((0UL != u32Tmp1) && (0UL != (VSSEL139 & BIT_MASK_13))) + { + USART_5_RxErr_IrqHandler(); + } + /* USART Ch.5 Rx end */ + if ((1UL == bM4_USART5->SR_b.RXNE) && (0UL != (VSSEL139 & BIT_MASK_14))) + { + USART_5_RxEnd_IrqHandler(); + } + } + /* USART Ch.5 Tx buffer empty */ + if (1UL == bM4_USART5->CR1_b.TXEIE) + { + if ((1UL == bM4_USART5->SR_b.TXE) && (0UL != (VSSEL139 & BIT_MASK_15))) + { + USART_5_TxEmpty_IrqHandler(); + } + } + /* USART Ch.5 Tx end */ + if (1UL == bM4_USART5->CR1_b.TCIE) + { + if ((1UL == bM4_USART5->SR_b.TC) && (0UL != (VSSEL139 & BIT_MASK_16))) + { + USART_5_TxEnd_IrqHandler(); + } + } + if (1UL == bM4_USART6->CR1_b.RIE) + { + /* USART Ch.6 Rx ORE/FE/PE error */ + u32Tmp1 = M4_USART6->SR & (USART_SR_PE | USART_SR_FE | USART_SR_ORE); + if ((0UL != u32Tmp1) && (0UL != (VSSEL139 & BIT_MASK_17))) + { + USART_6_RxErr_IrqHandler(); + } + /* USART Ch.6 Rx end */ + if ((1UL == bM4_USART6->SR_b.RXNE) && (0UL != (VSSEL139 & BIT_MASK_18))) + { + USART_6_RxEnd_IrqHandler(); + } + } + /* USART Ch.6 Tx buffer empty */ + if (1UL == bM4_USART6->CR1_b.TXEIE) + { + if ((1UL == bM4_USART6->SR_b.TXE) && (0UL != (VSSEL139 & BIT_MASK_19))) + { + USART_6_TxEmpty_IrqHandler(); + } + } + /* USART Ch.6 Tx end */ + if (1UL == bM4_USART6->CR1_b.TCIE) + { + if ((1UL == bM4_USART6->SR_b.TC) && (0UL != (VSSEL139 & BIT_MASK_20))) + { + USART_6_TxEnd_IrqHandler(); + } + } + /* USART Ch.6 Tx timeout */ + if (1UL == bM4_USART6->CR1_b.RTOIE) + { + if ((1UL == bM4_USART6->SR_b.RTOF) && (0UL != (VSSEL139 & BIT_MASK_21))) + { + USART_6_RxTO_IrqHandler(); + } + } + /* SPI Ch.5 Rx end */ + if (1UL == bM4_SPI5->CR1_b.RXIE) + { + if ((1UL == bM4_SPI5->SR_b.RDFF) && (0UL != (VSSEL139 & BIT_MASK_22))) + { + SPI_5_RxEnd_IrqHandler(); + } + } + /* SPI Ch.5 Tx buffer empty */ + if (1UL == bM4_SPI5->CR1_b.TXIE) + { + if ((1UL == bM4_SPI5->SR_b.TDEF) && (0UL != (VSSEL139 & BIT_MASK_23))) + { + SPI_5_TxEmpty_IrqHandler(); + } + } + /* SPI Ch.5 Bus idle */ + if (1UL == bM4_SPI5->CR1_b.IDIE) + { + if ((0UL == bM4_SPI5->SR_b.IDLNF) && (0UL != (VSSEL139 & BIT_MASK_24))) + { + SPI_5_Idle_IrqHandler(); + } + } + /* SPI Ch.5 parity/overflow/underflow/mode error */ + if (1UL == bM4_SPI5->CR1_b.EIE) + { + u32Tmp1 = M4_SPI5->SR & (SPI_SR_OVRERF | SPI_SR_MODFERF | SPI_SR_PERF | SPI_SR_UDRERF); + if ((0UL != u32Tmp1) && (0UL != (VSSEL139 & BIT_MASK_25))) + { + SPI_5_Err_IrqHandler(); + } + } + /* SPI Ch.6 Rx end */ + if (1UL == bM4_SPI6->CR1_b.RXIE) + { + if ((1UL == bM4_SPI6->SR_b.RDFF) && (0UL != (VSSEL139 & BIT_MASK_27))) + { + SPI_6_RxEnd_IrqHandler(); + } + } + /* SPI Ch.6 Tx buffer empty */ + if (1UL == bM4_SPI6->CR1_b.TXIE) + { + if ((1UL == bM4_SPI6->SR_b.TDEF) && (0UL != (VSSEL139 & BIT_MASK_28))) + { + SPI_6_TxEmpty_IrqHandler(); + } + } + /* SPI Ch.6 Bus idle */ + if (1UL == bM4_SPI6->CR1_b.IDIE) + { + if ((0UL == bM4_SPI6->SR_b.IDLNF) && (0UL != (VSSEL139 & BIT_MASK_29))) + { + SPI_6_Idle_IrqHandler(); + } + } + /* SPI Ch.6 parity/overflow/underflow/mode error */ + if (1UL == bM4_SPI6->CR1_b.EIE) + { + u32Tmp1 = M4_SPI6->SR & (SPI_SR_OVRERF | SPI_SR_MODFERF | SPI_SR_PERF | SPI_SR_UDRERF); + if ((0UL != u32Tmp1) && (0UL != (VSSEL139 & BIT_MASK_30))) + { + SPI_6_Err_IrqHandler(); + } + } +} + +/** + * @brief Interrupt No.140 share IRQ handler + * @param None + * @retval None + */ +void IRQ140_Handler(void) +{ + const uint32_t VSSEL140 = M4_INTC->VSSEL140; + uint32_t u32Tmp1; + uint32_t u32Tmp2; + uint16_t NORINTST; + uint16_t NORINTSGEN; + uint16_t ERRINTSGEN; + uint32_t MMC_REVSTSR; + uint32_t MMC_TRSSTSR; + uint32_t MMC_RITCTLR; + uint32_t MMC_TITCTLR; + uint32_t DMA_DMASTSR; + uint32_t DMA_INTENAR; + uint32_t PTP_INTE; + uint32_t PMT_INTMASK; + uint32_t PMT_INTSTSR; + uint32_t PTP_INTMASK; + uint32_t PTP_INTSTSR; + + /* I2S Ch.1 Tx */ + if (1UL == bM4_I2S1->CTRL_b.TXIE) + { + if ((1UL == bM4_I2S1->SR_b.TXBA) && (0UL != (VSSEL140 & BIT_MASK_00))) + { + I2S_1_Tx_IrqHandler(); + } + } + /* I2S Ch.1 Rx */ + if (1UL == bM4_I2S1->CTRL_b.RXIE) + { + if ((1UL == bM4_I2S1->SR_b.RXBA) && (0UL != (VSSEL140 & BIT_MASK_01))) + { + I2S_1_Rx_IrqHandler(); + } + } + /* I2S Ch.1 Error */ + if (1UL == bM4_I2S1->CTRL_b.EIE) + { + u32Tmp1 = M4_I2S1->ER & (I2S_ER_TXERR | I2S_ER_RXERR); + if ((0UL != u32Tmp1) && (0UL != (VSSEL140 & BIT_MASK_02))) + { + I2S_1_Err_IrqHandler(); + } + } + /* I2S Ch.2 Tx */ + if (1UL == bM4_I2S2->CTRL_b.TXIE) + { + if ((1UL == bM4_I2S2->SR_b.TXBA) && (0UL != (VSSEL140 & BIT_MASK_03))) + { + I2S_2_Tx_IrqHandler(); + } + } + /* I2S Ch.2 Rx */ + if (1UL == bM4_I2S2->CTRL_b.RXIE) + { + if ((1UL == bM4_I2S2->SR_b.RXBA) && (0UL != (VSSEL140 & BIT_MASK_04))) + { + I2S_2_Rx_IrqHandler(); + } + } + /* I2S Ch.2 Error */ + if (1UL == bM4_I2S2->CTRL_b.EIE) + { + u32Tmp1 = M4_I2S2->ER & (I2S_ER_TXERR | I2S_ER_RXERR); + if ((0UL != u32Tmp1) && (0UL != (VSSEL140 & BIT_MASK_05))) + { + I2S_2_Err_IrqHandler(); + } + } + if (1UL == bM4_USART7->CR1_b.RIE) + { + /* USART Ch.7 Rx ORE/FE/PE error */ + u32Tmp1 = M4_USART7->SR & (USART_SR_PE | USART_SR_FE | USART_SR_ORE); + if ((0UL != u32Tmp1) && (0UL != (VSSEL140 & BIT_MASK_06))) + { + USART_7_RxErr_IrqHandler(); + } + /* USART Ch.7 Rx end */ + if ((1UL == bM4_USART7->SR_b.RXNE) && (0UL != (VSSEL140 & BIT_MASK_07))) + { + USART_7_RxEnd_IrqHandler(); + } + } + /* USART Ch.7 Tx buffer empty */ + if (1UL == bM4_USART7->CR1_b.TXEIE) + { + if ((1UL == bM4_USART7->SR_b.TXE) && (0UL != (VSSEL140 & BIT_MASK_08))) + { + USART_7_TxEmpty_IrqHandler(); + } + } + /* USART Ch.7 Tx end */ + if (1UL == bM4_USART7->CR1_b.TCIE) + { + if ((1UL == bM4_USART7->SR_b.TC) && (0UL != (VSSEL140 & BIT_MASK_09))) + { + USART_7_TxEnd_IrqHandler(); + } + } + /* USART Ch.7 Tx timeout */ + if (1UL == bM4_USART7->CR1_b.RTOIE) + { + if ((1UL == bM4_USART7->SR_b.RTOF) && (0UL != (VSSEL140 & BIT_MASK_10))) + { + USART_7_RxTO_IrqHandler(); + } + } + if (1UL == bM4_USART8->CR1_b.RIE) + { + /* USART Ch.8 Rx ORE/FE/PE error */ + u32Tmp1 = M4_USART8->SR & (USART_SR_PE | USART_SR_FE | USART_SR_ORE); + if ((0UL != u32Tmp1) && (0UL != (VSSEL140 & BIT_MASK_11))) + { + USART_8_RxErr_IrqHandler(); + } + /* USART Ch.8 Rx end */ + if ((1UL == bM4_USART8->SR_b.RXNE) && (0UL != (VSSEL140 & BIT_MASK_12))) + { + USART_8_RxEnd_IrqHandler(); + } + } + /* USART Ch.8 Tx buffer empty */ + if (1UL == bM4_USART8->CR1_b.TXEIE) + { + if ((1UL == bM4_USART8->SR_b.TXE) && (0UL != (VSSEL140 & BIT_MASK_13))) + { + USART_8_TxEmpty_IrqHandler(); + } + } + /* USART Ch.8 Tx end */ + if (1UL == bM4_USART8->CR1_b.TCIE) + { + if ((1UL == bM4_USART8->SR_b.TC) && (0UL != (VSSEL140 & BIT_MASK_14))) + { + USART_8_TxEnd_IrqHandler(); + } + } + /* USB FS global interrupt */ + if (1UL == bM4_USBFS->GAHBCFG_b.GLBLINTRMSK) + { + u32Tmp1 = M4_USBFS->GINTMSK & 0xF77CFCFBUL; + u32Tmp2 = M4_USBFS->GINTSTS & 0xF77CFCFBUL; + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL140 & BIT_MASK_15))) + { + USBFS_Global_IrqHandler(); + } + } + /* SDIO unit 1 */ + if (0UL != (VSSEL140 & BIT_MASK_20)) + { + NORINTST = M4_SDIOC1->NORINTST & (SDIOC_NORINTST_CINT | SDIOC_NORINTST_CRM | SDIOC_NORINTST_CIST | \ + SDIOC_NORINTST_BRR | SDIOC_NORINTST_BWR | SDIOC_NORINTST_BGE | \ + SDIOC_NORINTST_TC | SDIOC_NORINTST_CC); + NORINTSGEN = M4_SDIOC1->NORINTSGEN & (SDIOC_NORINTSTEN_CINTEN | SDIOC_NORINTSTEN_CRMEN | \ + SDIOC_NORINTSTEN_CISTEN | SDIOC_NORINTSTEN_BRREN | \ + SDIOC_NORINTSTEN_BWREN | SDIOC_NORINTSTEN_BGEEN | \ + SDIOC_NORINTSTEN_TCEN | SDIOC_NORINTSTEN_CCEN); + ERRINTSGEN = M4_SDIOC1->ERRINTSGEN & (SDIOC_ERRINTSTEN_ACEEN | SDIOC_ERRINTSTEN_DEBEEN | \ + SDIOC_ERRINTSTEN_DCEEN | SDIOC_ERRINTSTEN_DTOEEN | \ + SDIOC_ERRINTSTEN_CIEEN | SDIOC_ERRINTSTEN_CEBEEN | \ + SDIOC_ERRINTSTEN_CCEEN | SDIOC_ERRINTSTEN_CTOEEN); + if (0U != (NORINTST & NORINTSGEN)) + { + SDIOC_1_Normal_IrqHandler(); + } + if ((1UL == bM4_SDIOC1->NORINTST_b.EI) && (0U != ERRINTSGEN)) + { + SDIOC_1_Error_IrqHandler(); + } + } + /* SDIO unit 2 */ + if (0UL != (VSSEL140 & BIT_MASK_23)) + { + NORINTST = M4_SDIOC2->NORINTST & (SDIOC_NORINTST_CINT | SDIOC_NORINTST_CRM | SDIOC_NORINTST_CIST | \ + SDIOC_NORINTST_BRR | SDIOC_NORINTST_BWR | SDIOC_NORINTST_BGE | \ + SDIOC_NORINTST_TC | SDIOC_NORINTST_CC); + NORINTSGEN = M4_SDIOC2->NORINTSGEN & (SDIOC_NORINTSTEN_CINTEN | SDIOC_NORINTSTEN_CRMEN | \ + SDIOC_NORINTSTEN_CISTEN | SDIOC_NORINTSTEN_BRREN | \ + SDIOC_NORINTSTEN_BWREN | SDIOC_NORINTSTEN_BGEEN | \ + SDIOC_NORINTSTEN_TCEN | SDIOC_NORINTSTEN_CCEN); + ERRINTSGEN = M4_SDIOC2->ERRINTSGEN & (SDIOC_ERRINTSTEN_ACEEN | SDIOC_ERRINTSTEN_DEBEEN | \ + SDIOC_ERRINTSTEN_DCEEN | SDIOC_ERRINTSTEN_DTOEEN | \ + SDIOC_ERRINTSTEN_CIEEN | SDIOC_ERRINTSTEN_CEBEEN | \ + SDIOC_ERRINTSTEN_CCEEN | SDIOC_ERRINTSTEN_CTOEEN); + if (0U != (NORINTST & NORINTSGEN)) + { + SDIOC_2_Normal_IrqHandler(); + } + if ((1UL == bM4_SDIOC2->NORINTST_b.EI) && (0U != ERRINTSGEN)) + { + SDIOC_2_Error_IrqHandler(); + } + } + /* Ethernat global */ + MMC_REVSTSR = M4_ETH->MMC_REVSTSR & (ETH_MMC_REVSTSR_RXOEIS | ETH_MMC_REVSTSR_RXLEIS | \ + ETH_MMC_REVSTSR_RXUGIS | ETH_MMC_REVSTSR_RXREIS | \ + ETH_MMC_REVSTSR_RXAEIS | ETH_MMC_REVSTSR_RXCEIS | \ + ETH_MMC_REVSTSR_RXMGIS | ETH_MMC_REVSTSR_RXBGIS); + MMC_TRSSTSR = M4_ETH->MMC_TRSSTSR & (ETH_MMC_TRSSTSR_TXEDEIS| ETH_MMC_TRSSTSR_TXUGIS | \ + ETH_MMC_TRSSTSR_TXCAEIS| ETH_MMC_TRSSTSR_TXECEIS| \ + ETH_MMC_TRSSTSR_TXLCEIS| ETH_MMC_TRSSTSR_TXDEEIS| \ + ETH_MMC_TRSSTSR_TXMGIS | ETH_MMC_TRSSTSR_TXBGIS); + MMC_RITCTLR = M4_ETH->MMC_RITCTLR & (ETH_MMC_RITCTLR_RXBGIM | ETH_MMC_RITCTLR_RXMGIM | \ + ETH_MMC_RITCTLR_RXCEIM | ETH_MMC_RITCTLR_RXAEIM | \ + ETH_MMC_RITCTLR_RXREIM | ETH_MMC_RITCTLR_RXUGIM | \ + ETH_MMC_RITCTLR_RXLEIM | ETH_MMC_RITCTLR_RXOEIM); + MMC_TITCTLR = M4_ETH->MMC_TITCTLR & (ETH_MMC_TITCTLR_TXBGIM | ETH_MMC_TITCTLR_TXMGIM | \ + ETH_MMC_TITCTLR_TXDEEIM| ETH_MMC_TITCTLR_TXLCEIM| \ + ETH_MMC_TITCTLR_TXECEIM| ETH_MMC_TITCTLR_TXCAEIM| \ + ETH_MMC_TITCTLR_TXUGIM | ETH_MMC_TITCTLR_TXEDEIM); + PMT_INTMASK = bM4_ETH->MAC_INTMSKR_b.PMTIM; + PMT_INTSTSR = bM4_ETH->MAC_INTSTSR_b.PMTIS; + PTP_INTMASK = bM4_ETH->MAC_INTMSKR_b.TSPIM; + PTP_INTSTSR = bM4_ETH->MAC_INTSTSR_b.TSPIS; + PTP_INTE = bM4_ETH->PTP_TSPCTLR_b.TSPINT; + + DMA_DMASTSR = M4_ETH->DMA_DMASTSR & (ETH_DMA_DMASTSR_AIS | ETH_DMA_DMASTSR_NIS); + DMA_INTENAR = M4_ETH->DMA_INTENAR & (ETH_DMA_INTENAR_AIE | ETH_DMA_INTENAR_NIE); + if (0UL != (VSSEL140 & BIT_MASK_28)) + { + if ((0UL != (MMC_REVSTSR & (~MMC_RITCTLR))) || \ + (0UL != (MMC_TRSSTSR & (~MMC_TITCTLR))) || \ + (0UL != (PMT_INTSTSR & (~PMT_INTMASK))) || \ + (0UL != (PTP_INTSTSR & (~PTP_INTMASK) & PTP_INTE)) || \ + (0UL != (DMA_DMASTSR & DMA_INTENAR))) + { + ETH_Global_IrqHandler(); + } + } + + /* Ethernat wakeup */ + if (0UL == bM4_ETH->MAC_INTMSKR_b.PMTIM) + { + if ((1UL == bM4_ETH->MAC_INTSTSR_b.PMTIS) && (0UL != (VSSEL140 & BIT_MASK_29))) + { + ETH_Wakeup_IrqHandler(); + } + } +} + +/** + * @brief Interrupt No.141 share IRQ handler + * @param None + * @retval None + */ +void IRQ141_Handler(void) +{ + const uint32_t VSSEL141 = M4_INTC->VSSEL141; + uint32_t u32Tmp1; + uint32_t u32Tmp2; + + /* I2S Ch.3 Tx */ + if (1UL == bM4_I2S3->CTRL_b.TXIE) + { + if ((1UL == bM4_I2S3->SR_b.TXBA) && (0UL != (VSSEL141 & BIT_MASK_00))) + { + I2S_3_Tx_IrqHandler(); + } + } + /* I2S Ch.3 Rx */ + if (1UL == bM4_I2S3->CTRL_b.RXIE) + { + if ((1UL == bM4_I2S3->SR_b.RXBA) && (0UL != (VSSEL141 & BIT_MASK_01))) + { + I2S_3_Rx_IrqHandler(); + } + } + /* I2S Ch.3 Error */ + if (1UL == bM4_I2S3->CTRL_b.EIE) + { + u32Tmp1 = M4_I2S3->ER & (I2S_ER_TXERR | I2S_ER_RXERR); + if ((0UL != u32Tmp1) && (0UL != (VSSEL141 & BIT_MASK_02))) + { + I2S_3_Err_IrqHandler(); + } + } + /* I2S Ch.4 Tx */ + if (1UL == bM4_I2S4->CTRL_b.TXIE) + { + if ((1UL == bM4_I2S4->SR_b.TXBA) && (0UL != (VSSEL141 & BIT_MASK_03))) + { + I2S_4_Tx_IrqHandler(); + } + } + /* I2S Ch.4 Rx */ + if (1UL == bM4_I2S4->CTRL_b.RXIE) + { + if ((1UL == bM4_I2S4->SR_b.RXBA) && (0UL != (VSSEL141 & BIT_MASK_04))) + { + I2S_4_Rx_IrqHandler(); + } + } + /* I2S Ch.4 Error */ + if (1UL == bM4_I2S4->CTRL_b.EIE) + { + u32Tmp1 = M4_I2S4->ER & (I2S_ER_TXERR | I2S_ER_RXERR); + if ((0UL != u32Tmp1) && (0UL != (VSSEL141 & BIT_MASK_05))) + { + I2S_4_Err_IrqHandler(); + } + } + if (1UL == bM4_USART9->CR1_b.RIE) + { + /* USART Ch.9 Rx ORE/FE/PE error */ + u32Tmp1 = M4_USART9->SR & (USART_SR_PE | USART_SR_FE | USART_SR_ORE); + if ((0UL != u32Tmp1) && (0UL != (VSSEL141 & BIT_MASK_06))) + { + USART_9_RxErr_IrqHandler(); + } + /* USART Ch.9 Rx end */ + if ((1UL == bM4_USART9->SR_b.RXNE) && (0UL != (VSSEL141 & BIT_MASK_07))) + { + USART_9_RxEnd_IrqHandler(); + } + } + /* USART Ch.9 Tx buffer empty */ + if (1UL == bM4_USART9->CR1_b.TXEIE) + { + if ((1UL == bM4_USART9->SR_b.TXE) && (0UL != (VSSEL141 & BIT_MASK_08))) + { + USART_9_TxEmpty_IrqHandler(); + } + } + /* USART Ch.9 Tx end */ + if (1UL == bM4_USART9->CR1_b.TCIE) + { + if ((1UL == bM4_USART9->SR_b.TC) && (0UL != (VSSEL141 & BIT_MASK_09))) + { + USART_9_TxEnd_IrqHandler(); + } + } + /* USART Ch.10 LIN bus break */ + if (1UL == bM4_USART10->CR2_b.LBDIE) + { + if ((1UL == bM4_USART10->SR_b.LBD) && (0UL != (VSSEL141 & BIT_MASK_10))) + { + USART_10_LinBreakField_IrqHandler(); + } + } + /* USART Ch.10 LIN bus wakeup */ + if (1UL == bM4_USART10->CR2_b.WKUPE) + { + if ((1UL == bM4_USART10->SR_b.WKUP) && (0UL != (VSSEL141 & BIT_MASK_10))) + { + USART_10_LinWakeup_IrqHandler(); + } + } + if (1UL == bM4_USART10->CR1_b.RIE) + { + /* USART Ch.10 Rx ORE/FE/PE error */ + u32Tmp1 = M4_USART10->SR & (USART_SR_PE | USART_SR_FE | USART_SR_ORE); + if ((0UL != u32Tmp1) && (0UL != (VSSEL141 & BIT_MASK_11))) + { + USART_10_RxErr_IrqHandler(); + } + /* USART Ch.10 Rx end */ + if ((1UL == bM4_USART10->SR_b.RXNE) && (0UL != (VSSEL141 & BIT_MASK_12))) + { + USART_10_RxEnd_IrqHandler(); + } + } + /* USART Ch.10 Tx buffer empty */ + if (1UL == bM4_USART10->CR1_b.TXEIE) + { + if ((1UL == bM4_USART10->SR_b.TXE) && (0UL != (VSSEL141 & BIT_MASK_13))) + { + USART_10_TxEmpty_IrqHandler(); + } + } + /* USART Ch.10 Tx end */ + if (1UL == bM4_USART10->CR1_b.TCIE) + { + if ((1UL == bM4_USART10->SR_b.TC) && (0UL != (VSSEL141 & BIT_MASK_14))) + { + USART_10_TxEnd_IrqHandler(); + } + } + /* I2C Ch.1 Rx end */ + if (1UL == bM4_I2C1->CR2_b.RFULLIE) + { + if ((1UL == bM4_I2C1->SR_b.RFULLF) && (0UL != (VSSEL141 & BIT_MASK_16))) + { + I2C_1_RxEnd_IrqHandler(); + } + } + /* I2C Ch.1 Tx buffer empty */ + if (1UL == bM4_I2C1->CR2_b.TEMPTYIE) + { + if ((1UL == bM4_I2C1->SR_b.TEMPTYF) && (0UL != (VSSEL141 & BIT_MASK_17))) + { + I2C_1_TxEmpty_IrqHandler(); + } + } + /* I2C Ch.1 Tx end */ + if (1UL == bM4_I2C1->CR2_b.TENDIE) + { + if ((1UL == bM4_I2C1->SR_b.TENDF) && (0UL != (VSSEL141 & BIT_MASK_18))) + { + I2C_1_TxEnd_IrqHandler(); + } + } + /* I2C Ch.1 Error */ + u32Tmp1 = M4_I2C1->CR2 & (I2C_CR2_SMBALRTIE | I2C_CR2_SMHOSTIE | I2C_CR2_SMBDEFAULTIE | \ + I2C_CR2_GENCALLIE | I2C_CR2_TMOUTIE | I2C_CR2_NACKIE | \ + I2C_CR2_ARLOIE | I2C_CR2_STOPIE | I2C_CR2_SLADDR1IE | \ + I2C_CR2_SLADDR0IE | I2C_CR2_STARTIE); + u32Tmp2 = M4_I2C1->SR & (I2C_SR_SMBALRTF | I2C_SR_SMBHOSTF | I2C_SR_SMBDEFAULTF | \ + I2C_SR_GENCALLF | I2C_SR_TMOUTF | I2C_SR_NACKF | \ + I2C_SR_ARLOF | I2C_SR_STOPF | I2C_SR_SLADDR1F | \ + I2C_SR_SLADDR0F | I2C_SR_STARTF); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL141 & BIT_MASK_19))) + { + I2C_1_Err_IrqHandler(); + } + /* I2C Ch.2 Rx end */ + if (1UL == bM4_I2C2->CR2_b.RFULLIE) + { + if ((1UL == bM4_I2C2->SR_b.RFULLF) && (0UL != (VSSEL141 & BIT_MASK_20))) + { + I2C_2_RxEnd_IrqHandler(); + } + } + /* I2C Ch.2 Tx buffer empty */ + if (1UL == bM4_I2C2->CR2_b.TEMPTYIE) + { + if ((1UL == bM4_I2C2->SR_b.TEMPTYF) && (0UL != (VSSEL141 & BIT_MASK_21))) + { + I2C_2_TxEmpty_IrqHandler(); + } + } + /* I2C Ch.2 Tx end */ + if (1UL == bM4_I2C2->CR2_b.TENDIE) + { + if ((1UL == bM4_I2C2->SR_b.TENDF) && (0UL != (VSSEL141 & BIT_MASK_22))) + { + I2C_2_TxEnd_IrqHandler(); + } + } + /* I2C Ch.2 Error */ + u32Tmp1 = M4_I2C2->CR2 & (I2C_CR2_SMBALRTIE | I2C_CR2_SMHOSTIE | I2C_CR2_SMBDEFAULTIE | \ + I2C_CR2_GENCALLIE | I2C_CR2_TMOUTIE | I2C_CR2_NACKIE | \ + I2C_CR2_ARLOIE | I2C_CR2_STOPIE | I2C_CR2_SLADDR1IE | \ + I2C_CR2_SLADDR0IE | I2C_CR2_STARTIE); + u32Tmp2 = M4_I2C2->SR & (I2C_SR_SMBALRTF | I2C_SR_SMBHOSTF | I2C_SR_SMBDEFAULTF | \ + I2C_SR_GENCALLF | I2C_SR_TMOUTF | I2C_SR_NACKF | \ + I2C_SR_ARLOF | I2C_SR_STOPF | I2C_SR_SLADDR1F | \ + I2C_SR_SLADDR0F | I2C_SR_STARTF); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL141 & BIT_MASK_23))) + { + I2C_2_Err_IrqHandler(); + } + /* I2C Ch.3 Rx end */ + if (1UL == bM4_I2C3->CR2_b.RFULLIE) + { + if ((1UL == bM4_I2C3->SR_b.RFULLF) && (0UL != (VSSEL141 & BIT_MASK_24))) + { + I2C_3_RxEnd_IrqHandler(); + } + } + /* I2C Ch.3 Tx buffer empty */ + if (1UL == bM4_I2C3->CR2_b.TEMPTYIE) + { + if ((1UL == bM4_I2C3->SR_b.TEMPTYF) && (0UL != (VSSEL141 & BIT_MASK_25))) + { + I2C_3_TxEmpty_IrqHandler(); + } + } + /* I2C Ch.3 Tx end */ + if (1UL == bM4_I2C3->CR2_b.TENDIE) + { + if ((1UL == bM4_I2C3->SR_b.TENDF) && (0UL != (VSSEL141 & BIT_MASK_26))) + { + I2C_3_TxEnd_IrqHandler(); + } + } + /* I2C Ch.3 Error */ + u32Tmp1 = M4_I2C3->CR2 & (I2C_CR2_SMBALRTIE | I2C_CR2_SMHOSTIE | I2C_CR2_SMBDEFAULTIE | \ + I2C_CR2_GENCALLIE | I2C_CR2_TMOUTIE | I2C_CR2_NACKIE | \ + I2C_CR2_ARLOIE | I2C_CR2_STOPIE | I2C_CR2_SLADDR1IE | \ + I2C_CR2_SLADDR0IE | I2C_CR2_STARTIE); + u32Tmp2 = M4_I2C3->SR & (I2C_SR_SMBALRTF | I2C_SR_SMBHOSTF | I2C_SR_SMBDEFAULTF | \ + I2C_SR_GENCALLF | I2C_SR_TMOUTF | I2C_SR_NACKF | \ + I2C_SR_ARLOF | I2C_SR_STOPF | I2C_SR_SLADDR1F | \ + I2C_SR_SLADDR0F | I2C_SR_STARTF); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL141 & BIT_MASK_27))) + { + I2C_3_Err_IrqHandler(); + } +} + +/** + * @brief Interrupt No.142 share IRQ handler + * @param None + * @retval None + */ +void IRQ142_Handler(void) +{ + const uint32_t VSSEL142 = M4_INTC->VSSEL142; + uint32_t u32Tmp1; + uint32_t u32Tmp2; + + /* I2C Ch.4 Rx end */ + if (1UL == bM4_I2C4->CR2_b.RFULLIE) + { + if ((1UL == bM4_I2C4->SR_b.RFULLF) && (0UL != (VSSEL142 & BIT_MASK_00))) + { + I2C_4_RxEnd_IrqHandler(); + } + } + /* I2C Ch.4 Tx buffer empty */ + if (1UL == bM4_I2C4->CR2_b.TEMPTYIE) + { + if ((1UL == bM4_I2C4->SR_b.TEMPTYF) && (0UL != (VSSEL142 & BIT_MASK_01))) + { + I2C_4_TxEmpty_IrqHandler(); + } + } + /* I2C Ch.4 Tx end */ + if (1UL == bM4_I2C4->CR2_b.TENDIE) + { + if ((1UL == bM4_I2C4->SR_b.TENDF) && (0UL != (VSSEL142 & BIT_MASK_02))) + { + I2C_4_TxEnd_IrqHandler(); + } + } + /* I2C Ch.4 Error */ + u32Tmp1 = M4_I2C4->CR2 & (I2C_CR2_SMBALRTIE | I2C_CR2_SMHOSTIE | I2C_CR2_SMBDEFAULTIE | \ + I2C_CR2_GENCALLIE | I2C_CR2_TMOUTIE | I2C_CR2_NACKIE | \ + I2C_CR2_ARLOIE | I2C_CR2_STOPIE | I2C_CR2_SLADDR1IE | \ + I2C_CR2_SLADDR0IE | I2C_CR2_STARTIE); + u32Tmp2 = M4_I2C4->SR & (I2C_SR_SMBALRTF | I2C_SR_SMBHOSTF | I2C_SR_SMBDEFAULTF | \ + I2C_SR_GENCALLF | I2C_SR_TMOUTF | I2C_SR_NACKF | \ + I2C_SR_ARLOF | I2C_SR_STOPF | I2C_SR_SLADDR1F | \ + I2C_SR_SLADDR0F | I2C_SR_STARTF); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL142 & BIT_MASK_03))) + { + I2C_4_Err_IrqHandler(); + } + /* I2C Ch.5 Rx end */ + if (1UL == bM4_I2C5->CR2_b.RFULLIE) + { + if ((1UL == bM4_I2C5->SR_b.RFULLF) && (0UL != (VSSEL142 & BIT_MASK_04))) + { + I2C_5_RxEnd_IrqHandler(); + } + } + /* I2C Ch.5 Tx buffer empty */ + if (1UL == bM4_I2C5->CR2_b.TEMPTYIE) + { + if ((1UL == bM4_I2C5->SR_b.TEMPTYF) && (0UL != (VSSEL142 & BIT_MASK_05))) + { + I2C_5_TxEmpty_IrqHandler(); + } + } + /* I2C Ch.5 Tx end */ + if (1UL == bM4_I2C5->CR2_b.TENDIE) + { + if ((1UL == bM4_I2C5->SR_b.TENDF) && (0UL != (VSSEL142 & BIT_MASK_06))) + { + I2C_5_TxEnd_IrqHandler(); + } + } + /* I2C Ch.5 Error */ + u32Tmp1 = M4_I2C5->CR2 & (I2C_CR2_SMBALRTIE | I2C_CR2_SMHOSTIE | I2C_CR2_SMBDEFAULTIE | \ + I2C_CR2_GENCALLIE | I2C_CR2_TMOUTIE | I2C_CR2_NACKIE | \ + I2C_CR2_ARLOIE | I2C_CR2_STOPIE | I2C_CR2_SLADDR1IE | \ + I2C_CR2_SLADDR0IE | I2C_CR2_STARTIE); + u32Tmp2 = M4_I2C5->SR & (I2C_SR_SMBALRTF | I2C_SR_SMBHOSTF | I2C_SR_SMBDEFAULTF | \ + I2C_SR_GENCALLF | I2C_SR_TMOUTF | I2C_SR_NACKF | \ + I2C_SR_ARLOF | I2C_SR_STOPF | I2C_SR_SLADDR1F | \ + I2C_SR_SLADDR0F | I2C_SR_STARTF); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL142 & BIT_MASK_07))) + { + I2C_5_Err_IrqHandler(); + } + /* I2C Ch.6 Rx end */ + if (1UL == bM4_I2C6->CR2_b.RFULLIE) + { + if ((1UL == bM4_I2C6->SR_b.RFULLF) && (0UL != (VSSEL142 & BIT_MASK_08))) + { + I2C_6_RxEnd_IrqHandler(); + } + } + /* I2C Ch.6 Tx buffer empty */ + if (1UL == bM4_I2C6->CR2_b.TEMPTYIE) + { + if ((1UL == bM4_I2C6->SR_b.TEMPTYF) && (0UL != (VSSEL142 & BIT_MASK_09))) + { + I2C_6_TxEmpty_IrqHandler(); + } + } + /* I2C Ch.6 Tx end */ + if (1UL == bM4_I2C6->CR2_b.TENDIE) + { + if ((1UL == bM4_I2C6->SR_b.TENDF) && (0UL != (VSSEL142 & BIT_MASK_10))) + { + I2C_6_TxEnd_IrqHandler(); + } + } + /* I2C Ch.6 Error */ + u32Tmp1 = M4_I2C6->CR2 & (I2C_CR2_SMBALRTIE | I2C_CR2_SMHOSTIE | I2C_CR2_SMBDEFAULTIE | \ + I2C_CR2_GENCALLIE | I2C_CR2_TMOUTIE | I2C_CR2_NACKIE | \ + I2C_CR2_ARLOIE | I2C_CR2_STOPIE | I2C_CR2_SLADDR1IE | \ + I2C_CR2_SLADDR0IE | I2C_CR2_STARTIE); + u32Tmp2 = M4_I2C6->SR & (I2C_SR_SMBALRTF | I2C_SR_SMBHOSTF | I2C_SR_SMBDEFAULTF | \ + I2C_SR_GENCALLF | I2C_SR_TMOUTF | I2C_SR_NACKF | \ + I2C_SR_ARLOF | I2C_SR_STOPF | I2C_SR_SLADDR1F | \ + I2C_SR_SLADDR0F | I2C_SR_STARTF); + if ((0UL != (u32Tmp1 & u32Tmp2)) && (0UL != (VSSEL142 & BIT_MASK_11))) + { + I2C_6_Err_IrqHandler(); + } + /* PVD Ch.1 */ + if (1UL == bM4_PWC->PVDCR1_b.PVD1IRE) + { + if ((1UL ==bM4_PWC->PVDDSR_b.PVD1DETFLG) && (0UL != (VSSEL142 & BIT_MASK_13))) + { + PWC_Pvd1_IrqHandler(); + } + } + /* PVD Ch.2 */ + if (1UL == bM4_PWC->PVDCR1_b.PVD2IRE) + { + if ((1UL ==bM4_PWC->PVDDSR_b.PVD2DETFLG) && (0UL != (VSSEL142 & BIT_MASK_14))) + { + PWC_Pvd2_IrqHandler(); + } + } + /* FCM error */ + if (1UL == bM4_FCM->RIER_b.ERRIE) + { + if ((1UL == bM4_FCM->SR_b.ERRF) && (0UL != (VSSEL142 & BIT_MASK_16))) + { + FCM_Err_IrqHandler(); + } + } + /* FCM end */ + if (1UL == bM4_FCM->RIER_b.MENDIE) + { + if ((1UL == bM4_FCM->SR_b.MENDF) && (0UL != (VSSEL142 & BIT_MASK_17))) + { + FCM_End_IrqHandler(); + } + } + /* FCM overflow */ + if (1UL == bM4_FCM->RIER_b.OVFIE) + { + if ((1UL == bM4_FCM->SR_b.OVF) && (0UL != (VSSEL142 & BIT_MASK_18))) + { + FCM_Ovf_IrqHandler(); + } + } + /* WDT underflow or refresh error */ + u32Tmp1 = M4_WDT->SR & (WDT_SR_UDF | WDT_SR_REF); + if ((0UL != u32Tmp1) && (0UL != (VSSEL142 & BIT_MASK_19))) + { + WDT_IrqHandler(); + } + /* CTC overflow or underflow error */ + if (1UL == bM4_CTC->CR1_b.ERRIE) + { + /* underflow */ + if ((1UL == bM4_CTC->STR_b.TRMUDF) && (0UL != (VSSEL142 & BIT_MASK_20))) + { + CTC_Udf_IrqHandler(); + } + /* overflow */ + if ((1UL == bM4_CTC->STR_b.TRMOVF) && (0UL != (VSSEL142 & BIT_MASK_20))) + { + CTC_Ovf_IrqHandler(); + } + } +} + +/** + * @brief Interrupt No.143 share IRQ handler + * @param None + * @retval None + */ +void IRQ143_Handler(void) +{ + const uint32_t VSSEL143 = M4_INTC->VSSEL143; + uint32_t u32Tmp1; + + /* ADC unit1 sequence A */ + if (1UL == bM4_ADC1->ICR_b.EOCAIEN) + { + if ((1UL == bM4_ADC1->ISR_b.EOCAF) && (0UL != (VSSEL143 & BIT_MASK_00))) + { + ADC_1_SeqA_IrqHandler(); + } + } + /* ADC unit1 sequence B */ + if (1UL == bM4_ADC1->ICR_b.EOCBIEN) + { + if ((1UL == bM4_ADC1->ISR_b.EOCBF) && (0UL != (VSSEL143 & BIT_MASK_01))) + { + ADC_1_SeqB_IrqHandler(); + } + } + /* ADC unit1 window 0 compare */ + if (1UL == bM4_ADC1->AWDCR_b.AWD0IEN) + { + if ((1UL == bM4_ADC1->AWDSR_b.AWD0F) && (0UL != (VSSEL143 & BIT_MASK_02))) + { + ADC_1_Cmp0_IrqHandler(); + } + } + /* ADC unit1 window 1 compare */ + if (1UL == bM4_ADC1->AWDCR_b.AWD1IEN) + { + /* independence use */ + u32Tmp1 = (uint16_t)(M4_ADC1->AWDCR & ADC_AWDCR_AWDCM); + if ((1UL == bM4_ADC1->AWDSR_b.AWD1F) && (0UL == u32Tmp1) && (0UL != (VSSEL143 & BIT_MASK_03))) + { + ADC_1_Cmp1Ind_IrqHandler(); + } + /* combination use */ + if ((1UL == bM4_ADC1->AWDSR_b.AWDCMF) && (0UL != u32Tmp1) && (0UL != (VSSEL143 & BIT_MASK_03))) + { + ADC_1_Cmp1Comb_IrqHandler(); + } + } + /* ADC unit2 sequence A */ + if (1UL == bM4_ADC2->ICR_b.EOCAIEN) + { + if ((1UL == bM4_ADC2->ISR_b.EOCAF) && (0UL != (VSSEL143 & BIT_MASK_04))) + { + ADC_2_SeqA_IrqHandler(); + } + } + /* ADC unit2 sequence B */ + if (1UL == bM4_ADC2->ICR_b.EOCBIEN) + { + if ((1UL == bM4_ADC2->ISR_b.EOCBF) && (0UL != (VSSEL143 & BIT_MASK_05))) + { + ADC_2_SeqB_IrqHandler(); + } + } + /* ADC unit2 window 0 compare */ + if (1UL == bM4_ADC2->AWDCR_b.AWD0IEN) + { + if ((1UL == bM4_ADC2->AWDSR_b.AWD0F) && (0UL != (VSSEL143 & BIT_MASK_06))) + { + ADC_2_Cmp0_IrqHandler(); + } + } + /* ADC unit2 window 1 compare */ + if (1UL == bM4_ADC2->AWDCR_b.AWD1IEN) + { + /* independence use */ + u32Tmp1 = ((uint16_t)(M4_ADC2->AWDCR & ADC_AWDCR_AWDCM)); + if ((1UL == bM4_ADC2->AWDSR_b.AWD1F) && (0UL == u32Tmp1) && (0UL != (0UL != (VSSEL143 & BIT_MASK_07)))) + { + ADC_2_Cmp1Ind_IrqHandler(); + } + /* combination use */ + if ((1UL == bM4_ADC2->AWDSR_b.AWDCMF) && (0UL != u32Tmp1) && (0UL != (0UL != (VSSEL143 & BIT_MASK_07)))) + { + ADC_2_Cmp1Comb_IrqHandler(); + } + } + /* ADC unit3 sequence A */ + if (1UL == bM4_ADC3->ICR_b.EOCAIEN) + { + if ((1UL == bM4_ADC3->ISR_b.EOCAF) && (0UL != (VSSEL143 & BIT_MASK_04))) + { + ADC_3_SeqA_IrqHandler(); + } + } + /* ADC unit3 sequence B */ + if (1UL == bM4_ADC3->ICR_b.EOCBIEN) + { + if ((1UL == bM4_ADC3->ISR_b.EOCBF) && (0UL != (VSSEL143 & BIT_MASK_08))) + { + ADC_3_SeqB_IrqHandler(); + } + } + /* ADC unit3 window 0 compare */ + if (1UL == bM4_ADC3->AWDCR_b.AWD0IEN) + { + if ((1UL == bM4_ADC3->AWDSR_b.AWD0F) && (0UL != (VSSEL143 & BIT_MASK_09))) + { + ADC_3_Cmp0_IrqHandler(); + } + } + /* ADC unit3 window 1 compare */ + if (1UL == bM4_ADC3->AWDCR_b.AWD1IEN) + { + /* independence use */ + u32Tmp1 = (uint16_t)(M4_ADC3->AWDCR & ADC_AWDCR_AWDCM); + if ((1UL == bM4_ADC3->AWDSR_b.AWD1F) && (0UL == u32Tmp1) && (0UL != (VSSEL143 & BIT_MASK_10))) + { + ADC_3_Cmp1Ind_IrqHandler(); + } + /* combination use */ + if ((1UL == bM4_ADC3->AWDSR_b.AWDCMF) && (0UL != u32Tmp1) && (0UL != (VSSEL143 & BIT_MASK_10))) + { + ADC_3_Cmp1Comb_IrqHandler(); + } + } + if (0UL != (VSSEL143 & BIT_MASK_16)) + { + if (0UL != (M4_NFC->IRSR & (NFC_IRSR_RBRS | NFC_IRSR_ECCERS | \ + NFC_IRSR_ECCCRS | NFC_IRSR_ECCECRS | NFC_IRSR_ECCEURS))) + { + NFC_IrqHandler(); + } + } +} +/** + * @} + */ + +/** + * @defgroup INTC_Weakdef_Prototypes INTC weak function prototypes + * @{ + */ +__WEAKDEF void HardFault_IrqHandler(void) +{ +} +__WEAKDEF void MemManage_IrqHandler(void) +{ +} +__WEAKDEF void BusFault_IrqHandler(void) +{ +} +__WEAKDEF void UsageFault_IrqHandler(void) +{ +} +__WEAKDEF void SVC_IrqHandler(void) +{ +} +__WEAKDEF void DebugMon_IrqHandler(void) +{ +} +__WEAKDEF void PendSV_IrqHandler(void) +{ +} +__WEAKDEF void SysTick_IrqHandler(void) +{ +} +__WEAKDEF void EXTINT_00_IrqHandler(void) +{ +} +__WEAKDEF void EXTINT_01_IrqHandler(void) +{ +} +__WEAKDEF void EXTINT_02_IrqHandler(void) +{ +} +__WEAKDEF void EXTINT_03_IrqHandler(void) +{ +} +__WEAKDEF void EXTINT_04_IrqHandler(void) +{ +} +__WEAKDEF void EXTINT_05_IrqHandler(void) +{ +} +__WEAKDEF void EXTINT_06_IrqHandler(void) +{ +} +__WEAKDEF void EXTINT_07_IrqHandler(void) +{ +} +__WEAKDEF void EXTINT_08_IrqHandler(void) +{ +} +__WEAKDEF void EXTINT_09_IrqHandler(void) +{ +} +__WEAKDEF void EXTINT_10_IrqHandler(void) +{ +} +__WEAKDEF void EXTINT_11_IrqHandler(void) +{ +} +__WEAKDEF void EXTINT_12_IrqHandler(void) +{ +} +__WEAKDEF void EXTINT_13_IrqHandler(void) +{ +} +__WEAKDEF void EXTINT_14_IrqHandler(void) +{ +} +__WEAKDEF void EXTINT_15_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Tc0_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Tc1_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Tc2_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Tc3_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Tc4_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Tc5_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Tc6_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Tc7_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Btc0_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Btc1_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Btc2_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Btc3_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Btc4_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Btc5_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Btc6_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Btc7_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Err0_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Err1_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Err2_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Err3_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Err4_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Err5_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Err6_IrqHandler(void) +{ +} +__WEAKDEF void DMA_1_Err7_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Tc0_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Tc1_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Tc2_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Tc3_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Tc4_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Tc5_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Tc6_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Tc7_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Btc0_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Btc1_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Btc2_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Btc3_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Btc4_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Btc5_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Btc6_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Btc7_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Err0_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Err1_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Err2_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Err3_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Err4_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Err5_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Err6_IrqHandler(void) +{ +} +__WEAKDEF void DMA_2_Err7_IrqHandler(void) +{ +} +__WEAKDEF void EFM_PgmEraseErr_IrqHandler(void) +{ +} +__WEAKDEF void EFM_ColErr_IrqHandler(void) +{ +} +__WEAKDEF void EFM_OpEnd_IrqHandler(void) +{ +} +__WEAKDEF void QSPI_Err_IrqHandler(void) +{ +} +__WEAKDEF void MAU_Sqrt_IrqHandler(void) +{ +} +__WEAKDEF void DVP_FrameStart_IrqHandler(void) +{ +} +__WEAKDEF void DVP_FrameEnd_IrqHandler(void) +{ +} +__WEAKDEF void DVP_LineStart_IrqHandler(void) +{ +} +__WEAKDEF void DVP_LineEnd_IrqHandler(void) +{ +} +__WEAKDEF void DVP_SwSyncErr_IrqHandler(void) +{ +} +__WEAKDEF void DVP_FifoErr_IrqHandler(void) +{ +} +__WEAKDEF void FMAC_1_IrqHandler(void) +{ +} +__WEAKDEF void FMAC_2_IrqHandler(void) +{ +} +__WEAKDEF void FMAC_3_IrqHandler(void) +{ +} +__WEAKDEF void FMAC_4_IrqHandler(void) +{ +} +__WEAKDEF void DCU_1_IrqHandler(void) +{ +} +__WEAKDEF void DCU_2_IrqHandler(void) +{ +} +__WEAKDEF void DCU_3_IrqHandler(void) +{ +} +__WEAKDEF void DCU_4_IrqHandler(void) +{ +} +__WEAKDEF void DCU_5_IrqHandler(void) +{ +} +__WEAKDEF void DCU_6_IrqHandler(void) +{ +} +__WEAKDEF void DCU_7_IrqHandler(void) +{ +} +__WEAKDEF void DCU_8_IrqHandler(void) +{ +} +__WEAKDEF void TMR0_1_CmpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR0_1_CmpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR0_2_CmpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR0_2_CmpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR2_1_CmpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR2_1_CmpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR2_1_OvfA_IrqHandler(void) +{ +} +__WEAKDEF void TMR2_1_OvfB_IrqHandler(void) +{ +} +__WEAKDEF void TMR2_2_CmpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR2_2_CmpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR2_2_OvfA_IrqHandler(void) +{ +} +__WEAKDEF void TMR2_2_OvfB_IrqHandler(void) +{ +} +__WEAKDEF void TMR2_3_CmpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR2_3_CmpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR2_3_OvfA_IrqHandler(void) +{ +} +__WEAKDEF void TMR2_3_OvfB_IrqHandler(void) +{ +} +__WEAKDEF void TMR2_4_CmpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR2_4_CmpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR2_4_OvfA_IrqHandler(void) +{ +} +__WEAKDEF void TMR2_4_OvfB_IrqHandler(void) +{ +} +__WEAKDEF void RTC_TimeStamp0_IrqHandler(void) +{ +} +__WEAKDEF void RTC_TimeStamp1_IrqHandler(void) +{ +} +__WEAKDEF void RTC_Alarm_IrqHandler(void) +{ +} +__WEAKDEF void RTC_Period_IrqHandler(void) +{ +} +__WEAKDEF void CLK_XtalStop_IrqHandler(void) +{ +} +__WEAKDEF void SWDT_IrqHandler(void) +{ +} +__WEAKDEF void WDT_IrqHandler(void) +{ +} +__WEAKDEF void PWC_WakeupTimer_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_1_GCmpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_1_GCmpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_1_GCmpC_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_1_GCmpD_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_1_GCmpE_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_1_GCmpF_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_1_GOvf_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_1_GUdf_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_1_Gdte_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_1_SCmpUpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_1_SCmpDownA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_1_SCmpUpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_1_SCmpDownB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_2_GCmpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_2_GCmpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_2_GCmpC_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_2_GCmpD_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_2_GCmpE_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_2_GCmpF_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_2_GOvf_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_2_GUdf_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_2_Gdte_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_2_SCmpUpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_2_SCmpDownA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_2_SCmpUpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_2_SCmpDownB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_3_GCmpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_3_GCmpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_3_GCmpC_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_3_GCmpD_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_3_GCmpE_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_3_GCmpF_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_3_GOvf_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_3_GUdf_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_3_Gdte_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_3_SCmpUpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_3_SCmpDownA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_3_SCmpUpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_3_SCmpDownB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_4_GCmpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_4_GCmpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_4_GCmpC_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_4_GCmpD_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_4_GCmpE_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_4_GCmpF_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_4_GOvf_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_4_GUdf_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_4_Gdte_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_4_SCmpUpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_4_SCmpDownA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_4_SCmpUpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_4_SCmpDownB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_5_GCmpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_5_GCmpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_5_GCmpC_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_5_GCmpD_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_5_GCmpE_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_5_GCmpF_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_5_GOvf_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_5_GUdf_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_5_Gdte_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_5_SCmpUpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_5_SCmpDownA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_5_SCmpUpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_5_SCmpDownB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_6_GCmpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_6_GCmpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_6_GCmpC_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_6_GCmpD_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_6_GCmpE_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_6_GCmpF_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_6_GOvf_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_6_GUdf_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_6_Gdte_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_6_SCmpUpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_6_SCmpDownA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_6_SCmpUpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_6_SCmpDownB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_7_GCmpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_7_GCmpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_7_GCmpC_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_7_GCmpD_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_7_GCmpE_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_7_GCmpF_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_7_GOvf_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_7_GUdf_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_7_Gdte_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_7_SCmpUpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_7_SCmpDownA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_7_SCmpUpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_7_SCmpDownB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_8_GCmpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_8_GCmpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_8_GCmpC_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_8_GCmpD_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_8_GCmpE_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_8_GCmpF_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_8_GOvf_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_8_GUdf_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_8_Gdte_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_8_SCmpUpA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_8_SCmpDownA_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_8_SCmpUpB_IrqHandler(void) +{ +} +__WEAKDEF void TMR6_8_SCmpDownB_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_1_GCmpUH_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_1_GCmpUL_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_1_GCmpVH_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_1_GCmpVL_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_1_GCmpWH_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_1_GCmpWL_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_1_Ovf_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_1_Udf_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_1_ReloadU_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_1_ReloadV_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_1_ReloadW_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_2_GCmpUH_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_2_GCmpUL_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_2_GCmpVH_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_2_GCmpVL_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_2_GCmpWH_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_2_GCmpWL_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_2_Ovf_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_2_Udf_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_2_ReloadU_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_2_ReloadV_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_2_ReloadW_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_3_GCmpUH_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_3_GCmpUL_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_3_GCmpVH_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_3_GCmpVL_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_3_GCmpWH_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_3_GCmpWL_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_3_Ovf_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_3_Udf_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_3_ReloadU_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_3_ReloadV_IrqHandler(void) +{ +} +__WEAKDEF void TMR4_3_ReloadW_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_1_Ovf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_1_Udf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_1_Cmp1_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_1_Cmp2_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_1_Cmp3_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_1_Cmp4_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_2_Ovf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_2_Udf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_2_Cmp1_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_2_Cmp2_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_2_Cmp3_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_2_Cmp4_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_3_Ovf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_3_Udf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_3_Cmp1_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_3_Cmp2_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_3_Cmp3_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_3_Cmp4_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_4_Ovf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_4_Udf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_4_Cmp1_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_4_Cmp2_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_4_Cmp3_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_4_Cmp4_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_5_Ovf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_5_Udf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_5_Cmp1_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_5_Cmp2_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_5_Cmp3_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_5_Cmp4_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_6_Ovf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_6_Udf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_6_Cmp1_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_6_Cmp2_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_6_Cmp3_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_6_Cmp4_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_7_Ovf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_7_Udf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_7_Cmp1_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_7_Cmp2_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_7_Cmp3_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_7_Cmp4_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_8_Ovf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_8_Udf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_8_Cmp1_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_8_Cmp2_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_8_Cmp3_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_8_Cmp4_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_9_Ovf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_9_Udf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_9_Cmp1_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_9_Cmp2_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_9_Cmp3_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_9_Cmp4_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_10_Ovf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_10_Udf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_10_Cmp1_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_10_Cmp2_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_10_Cmp3_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_10_Cmp4_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_11_Ovf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_11_Udf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_11_Cmp1_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_11_Cmp2_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_11_Cmp3_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_11_Cmp4_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_12_Ovf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_12_Udf_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_12_Cmp1_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_12_Cmp2_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_12_Cmp3_IrqHandler(void) +{ +} +__WEAKDEF void TMRA_12_Cmp4_IrqHandler(void) +{ +} +__WEAKDEF void EMB_GR0_IrqHandler(void) +{ +} +__WEAKDEF void EMB_GR1_IrqHandler(void) +{ +} +__WEAKDEF void EMB_GR2_IrqHandler(void) +{ +} +__WEAKDEF void EMB_GR3_IrqHandler(void) +{ +} +__WEAKDEF void EMB_GR4_IrqHandler(void) +{ +} +__WEAKDEF void EMB_GR5_IrqHandler(void) +{ +} +__WEAKDEF void EMB_GR6_IrqHandler(void) +{ +} +__WEAKDEF void USART_1_RxErr_IrqHandler(void) +{ +} +__WEAKDEF void USART_1_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void USART_1_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void USART_1_TxEnd_IrqHandler(void) +{ +} +__WEAKDEF void USART_1_RxTO_IrqHandler(void) +{ +} +__WEAKDEF void USART_2_RxErr_IrqHandler(void) +{ +} +__WEAKDEF void USART_2_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void USART_2_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void USART_2_TxEnd_IrqHandler(void) +{ +} +__WEAKDEF void USART_2_RxTO_IrqHandler(void) +{ +} +__WEAKDEF void USART_3_RxErr_IrqHandler(void) +{ +} +__WEAKDEF void USART_3_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void USART_3_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void USART_3_TxEnd_IrqHandler(void) +{ +} +__WEAKDEF void USART_4_RxErr_IrqHandler(void) +{ +} +__WEAKDEF void USART_4_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void USART_4_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void USART_4_TxEnd_IrqHandler(void) +{ +} +__WEAKDEF void USART_5_LinBreakField_IrqHandler(void) +{ +} +__WEAKDEF void USART_5_LinWakeup_IrqHandler(void) +{ +} +__WEAKDEF void USART_5_RxErr_IrqHandler(void) +{ +} +__WEAKDEF void USART_5_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void USART_5_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void USART_5_TxEnd_IrqHandler(void) +{ +} +__WEAKDEF void USART_6_RxErr_IrqHandler(void) +{ +} +__WEAKDEF void USART_6_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void USART_6_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void USART_6_TxEnd_IrqHandler(void) +{ +} +__WEAKDEF void USART_6_RxTO_IrqHandler(void) +{ +} +__WEAKDEF void USART_7_RxErr_IrqHandler(void) +{ +} +__WEAKDEF void USART_7_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void USART_7_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void USART_7_TxEnd_IrqHandler(void) +{ +} +__WEAKDEF void USART_7_RxTO_IrqHandler(void) +{ +} +__WEAKDEF void USART_8_RxErr_IrqHandler(void) +{ +} +__WEAKDEF void USART_8_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void USART_8_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void USART_8_TxEnd_IrqHandler(void) +{ +} +__WEAKDEF void USART_9_RxErr_IrqHandler(void) +{ +} +__WEAKDEF void USART_9_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void USART_9_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void USART_9_TxEnd_IrqHandler(void) +{ +} +__WEAKDEF void USART_10_LinBreakField_IrqHandler(void) +{ +} +__WEAKDEF void USART_10_LinWakeup_IrqHandler(void) +{ +} +__WEAKDEF void USART_10_RxErr_IrqHandler(void) +{ +} +__WEAKDEF void USART_10_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void USART_10_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void USART_10_TxEnd_IrqHandler(void) +{ +} +__WEAKDEF void SPI_1_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void SPI_1_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void SPI_1_Err_IrqHandler(void) +{ +} +__WEAKDEF void SPI_1_Idle_IrqHandler(void) +{ +} +__WEAKDEF void SPI_2_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void SPI_2_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void SPI_2_Err_IrqHandler(void) +{ +} +__WEAKDEF void SPI_2_Idle_IrqHandler(void) +{ +} +__WEAKDEF void SPI_3_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void SPI_3_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void SPI_3_Err_IrqHandler(void) +{ +} +__WEAKDEF void SPI_3_Idle_IrqHandler(void) +{ +} +__WEAKDEF void SPI_4_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void SPI_4_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void SPI_4_Err_IrqHandler(void) +{ +} +__WEAKDEF void SPI_4_Idle_IrqHandler(void) +{ +} +__WEAKDEF void SPI_5_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void SPI_5_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void SPI_5_Err_IrqHandler(void) +{ +} +__WEAKDEF void SPI_5_Idle_IrqHandler(void) +{ +} +__WEAKDEF void SPI_6_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void SPI_6_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void SPI_6_Err_IrqHandler(void) +{ +} +__WEAKDEF void SPI_6_Idle_IrqHandler(void) +{ +} +__WEAKDEF void CAN_1_IrqHandler(void) +{ +} +__WEAKDEF void CAN_2_IrqHandler(void) +{ +} +__WEAKDEF void I2S_1_Tx_IrqHandler(void) +{ +} +__WEAKDEF void I2S_1_Rx_IrqHandler(void) +{ +} +__WEAKDEF void I2S_1_Err_IrqHandler(void) +{ +} +__WEAKDEF void I2S_2_Tx_IrqHandler(void) +{ +} +__WEAKDEF void I2S_2_Rx_IrqHandler(void) +{ +} +__WEAKDEF void I2S_2_Err_IrqHandler(void) +{ +} +__WEAKDEF void I2S_3_Tx_IrqHandler(void) +{ +} +__WEAKDEF void I2S_3_Rx_IrqHandler(void) +{ +} +__WEAKDEF void I2S_3_Err_IrqHandler(void) +{ +} +__WEAKDEF void I2S_4_Tx_IrqHandler(void) +{ +} +__WEAKDEF void I2S_4_Rx_IrqHandler(void) +{ +} +__WEAKDEF void I2S_4_Err_IrqHandler(void) +{ +} +__WEAKDEF void USBFS_Global_IrqHandler(void) +{ +} +__WEAKDEF void SDIOC_1_Normal_IrqHandler(void) +{ +} +__WEAKDEF void SDIOC_1_Error_IrqHandler(void) +{ +} +__WEAKDEF void SDIOC_2_Normal_IrqHandler(void) +{ +} +__WEAKDEF void SDIOC_2_Error_IrqHandler(void) +{ +} +__WEAKDEF void ETH_Global_IrqHandler(void) +{ +} +__WEAKDEF void ETH_Wakeup_IrqHandler(void) +{ +} +__WEAKDEF void I2C_1_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void I2C_1_TxEnd_IrqHandler(void) +{ +} +__WEAKDEF void I2C_1_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void I2C_1_Err_IrqHandler(void) +{ +} +__WEAKDEF void I2C_2_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void I2C_2_TxEnd_IrqHandler(void) +{ +} +__WEAKDEF void I2C_2_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void I2C_2_Err_IrqHandler(void) +{ +} +__WEAKDEF void I2C_3_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void I2C_3_TxEnd_IrqHandler(void) +{ +} +__WEAKDEF void I2C_3_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void I2C_3_Err_IrqHandler(void) +{ +} +__WEAKDEF void I2C_4_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void I2C_4_TxEnd_IrqHandler(void) +{ +} +__WEAKDEF void I2C_4_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void I2C_4_Err_IrqHandler(void) +{ +} +__WEAKDEF void I2C_5_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void I2C_5_TxEnd_IrqHandler(void) +{ +} +__WEAKDEF void I2C_5_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void I2C_5_Err_IrqHandler(void) +{ +} +__WEAKDEF void I2C_6_RxEnd_IrqHandler(void) +{ +} +__WEAKDEF void I2C_6_TxEnd_IrqHandler(void) +{ +} +__WEAKDEF void I2C_6_TxEmpty_IrqHandler(void) +{ +} +__WEAKDEF void I2C_6_Err_IrqHandler(void) +{ +} + +__WEAKDEF void PWC_Pvd1_IrqHandler(void) +{ +} +__WEAKDEF void PWC_Pvd2_IrqHandler(void) +{ +} +__WEAKDEF void FCM_Err_IrqHandler(void) +{ +} +__WEAKDEF void FCM_End_IrqHandler(void) +{ +} +__WEAKDEF void FCM_Ovf_IrqHandler(void) +{ +} +__WEAKDEF void CTC_Udf_IrqHandler(void) +{ +} +__WEAKDEF void CTC_Ovf_IrqHandler(void) +{ +} +__WEAKDEF void ADC_1_SeqA_IrqHandler(void) +{ +} +__WEAKDEF void ADC_1_SeqB_IrqHandler(void) +{ +} +__WEAKDEF void ADC_1_Cmp0_IrqHandler(void) +{ +} +__WEAKDEF void ADC_1_Cmp1Ind_IrqHandler(void) +{ +} +__WEAKDEF void ADC_1_Cmp1Comb_IrqHandler(void) +{ +} +__WEAKDEF void ADC_2_SeqA_IrqHandler(void) +{ +} +__WEAKDEF void ADC_2_SeqB_IrqHandler(void) +{ +} +__WEAKDEF void ADC_2_Cmp0_IrqHandler(void) +{ +} +__WEAKDEF void ADC_2_Cmp1Ind_IrqHandler(void) +{ +} +__WEAKDEF void ADC_2_Cmp1Comb_IrqHandler(void) +{ +} +__WEAKDEF extern void ADC_3_SeqA_IrqHandler(void) +{ +} +__WEAKDEF extern void ADC_3_SeqB_IrqHandler(void) +{ +} +__WEAKDEF void ADC_3_Cmp0_IrqHandler(void) +{ +} +__WEAKDEF void ADC_3_Cmp1Ind_IrqHandler(void) +{ +} +__WEAKDEF void ADC_3_Cmp1Comb_IrqHandler(void) +{ +} +__WEAKDEF void NFC_IrqHandler(void) +{ +} +/** + * @} + */ + +#endif /* DDL_INTERRUPTS_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_interrupts.txt b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_interrupts.txt new file mode 100644 index 0000000000..575caaed79 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_interrupts.txt @@ -0,0 +1,1657 @@ + + +/** + * @brief Maximum IRQ handler number + */ +#define IRQ_NUM_MAX (128U) + +/** + * @brief Wakeup event enable mask + */ +#define INTC_WUPEN_MASK \ + (INTC_WUPEN_EIRQWUEN | INTC_WUPEN_SWDTWUEN | \ + INTC_WUPEN_PVD1WUEN | INTC_WUPEN_PVD2WUEN | \ + INTC_WUPEN_CMPWUEN | INTC_WUPEN_WKTMWUEN | \ + INTC_WUPEN_RTCALMWUEN | INTC_WUPEN_RTCPRDWUEN | \ + INTC_WUPEN_TMR0GCMWUEN | INTC_WUPEN_TMR2GCMWUEN | \ + INTC_WUPEN_TMR2OVFWUEN | INTC_WUPEN_RXWUEN | \ + INTC_WUPEN_USHWUEN | INTC_WUPEN_USFWUEN | \ + INTC_WUPEN_ETHWUEN) + +/** + * @} + */ + +/** + * @defgroup INTC_Check_Parameters_Validity INTC Check Parameters Validity + * @{ + */ +/*! Parameter validity check for wakeup source from stop mode. */ +#define IS_INTC_WKUP_SRC(src) \ +( ((src) != 0x00UL) && \ + (((src) | INTC_WUPEN_MASK) == INTC_WUPEN_MASK)) + +/*! Parameter validity check for event index. */ +#define IS_INTC_EVENT(event) ((event) != 0x00UL) + +/*! Parameter validity check for interrupt index. */ +#define IS_INTC_INT(it) ((it) != 0x00UL) + +/*! Parameter validity check for software interrupt index. */ +#define IS_INTC_SWI(swi) ((swi) != 0x00UL) + +/*! Parameter validity check for NMI trigger source. */ +#define IS_NMI_SRC(src) \ +( ((src) != 0x00UL) && \ + (((src) | NMI_SRC_MASK) == NMI_SRC_MASK)) + +/*! Parameter validity check for EXINT filter A function. */ +#define IS_EXINT_FAE(fae) \ +( ((fae) == EXINT_FILTER_A_OFF) || \ + ((fae) == EXINT_FILTER_A_ON)) + +/*! Parameter validity check for EXINT filter A clock division. */ +#define IS_EXINT_FACLK(faclk) \ +( ((faclk) == EXINT_FACLK_HCLK_DIV1) || \ + ((faclk) == EXINT_FACLK_HCLK_DIV8) || \ + ((faclk) == EXINT_FACLK_HCLK_DIV32) || \ + ((faclk) == EXINT_FACLK_HCLK_DIV64)) + +/*! Parameter validity check for EXINT filter B function. */ +#define IS_EXINT_FBE(fbe) \ +( ((fbe) == EXINT_FILTER_B_OFF) || \ + ((fbe) == EXINT_FILTER_B_ON)) + +/*! Parameter validity check for EXINT filter B time. */ +#define IS_EXINT_FBTIME(fbtime) \ +( ((fbtime) == EXINT_FBTIM_500NS) || \ + ((fbtime) == EXINT_FBTIM_1US) || \ + ((fbtime) == EXINT_FBTIM_2US) || \ + ((fbtime) == EXINT_FBTIM_4US)) + + +/*! Parameter validity check for EXINT trigger edge. */ +#define IS_EXINT_TRIGGER(trigger) \ +( ((trigger) == EXINT_TRIGGER_LOW) || \ + ((trigger) == EXINT_TRIGGER_RISING) || \ + ((trigger) == EXINT_TRIGGER_FALLING) || \ + ((trigger) == EXINT_TRIGGER_BOTH)) + +/*! Parameter validity check for EXINT channel. */ +#define IS_EXINT_CH(ch) \ +( ((ch) != 0x00UL) && \ + (((ch) | EXINT_CH_MASK) == EXINT_CH_MASK)) + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ +/** + * @defgroup INTC_Local_Variable INTC Local Variable + * @{ + */ +static func_ptr_t m_apfnIrqHandler[IRQ_NUM_MAX] = {NULL}; +static func_ptr_t m_pfnNmiCallback; +/** + * @} + */ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup INTC_Global_Functions INTC Global Functions + * @{ + */ +/** + * @brief IRQ sign in function + * @param [in] pstcIrqSignConfig: pointer of IRQ registration structure + * @arg enIntSrc: can be any value @ref en_int_src_t + * @arg enIRQn: can be any value from Int000_IRQn ~ Int127_IRQn @ref IRQn_Type + * @arg pfnCallback: Callback function + * @retval Ok: IRQ register successfully + * ErrorInvalidParameter: IRQ No. and Peripheral Int source are not match; + * NULL pointer. + * ErrorUninitialized: Specified IRQ entry was signed before. + */ +en_result_t INTC_IrqSignIn(const stc_irq_signin_config_t *pstcIrqSignConfig) + + +/** + * @brief IRQ sign out function + * @param [in] enIRQn: can be any value from Int000_IRQn ~ Int127_IRQn @ref IRQn_Type + * @retval Ok: IRQ sign out successfully + * ErrorInvalidParameter: IRQ No. is out of range + */ +en_result_t INTC_IrqSignOut(IRQn_Type enIRQn) + + +/** + * @brief Share IRQ configure + * @param [in] enIntSrc: Peripheral interrupt source @ref en_int_src_t + * @param [in] enNewState: + * @arg Enable: Enable corresponding peripheral interrupt in share IRQ handler + * @arg Disable: Disable corresponding peripheral interrupt in share IRQ handler + * @retval Ok: Share IRQ configure successfully + */ +en_result_t INTC_ShareIrqCmd(en_int_src_t enIntSrc, en_functional_state_t enNewState) + + +/** + * @brief Stop mode wake-up source configure + * @param [in] u32WakeupSrc: Wake-up source + * @arg INTC_WUPEN_EIRQWUEN + * @arg INTC_WUPEN_EIRQWUEN_0 + * @arg INTC_WUPEN_EIRQWUEN_1 + * @arg INTC_WUPEN_EIRQWUEN_2 + * @arg INTC_WUPEN_EIRQWUEN_3 + * @arg INTC_WUPEN_EIRQWUEN_4 + * @arg INTC_WUPEN_EIRQWUEN_5 + * @arg INTC_WUPEN_EIRQWUEN_6 + * @arg INTC_WUPEN_EIRQWUEN_7 + * @arg INTC_WUPEN_EIRQWUEN_8 + * @arg INTC_WUPEN_EIRQWUEN_9 + * @arg INTC_WUPEN_EIRQWUEN_10 + * @arg INTC_WUPEN_EIRQWUEN_11 + * @arg INTC_WUPEN_EIRQWUEN_12 + * @arg INTC_WUPEN_EIRQWUEN_13 + * @arg INTC_WUPEN_EIRQWUEN_14 + * @arg INTC_WUPEN_EIRQWUEN_15 + * @arg INTC_WUPEN_SWDTWUEN + * @arg INTC_WUPEN_PVD1WUEN + * @arg INTC_WUPEN_PVD2WUEN + * @arg INTC_WUPEN_CMPWUEN + * @arg INTC_WUPEN_WKTMWUEN + * @arg INTC_WUPEN_RTCALMWUEN + * @arg INTC_WUPEN_RTCPRDWUEN + * @arg INTC_WUPEN_TMR0GCMWUEN + * @arg INTC_WUPEN_TMR2GCMWUEN + * @arg INTC_WUPEN_TMR2OVFWUEN + * @arg INTC_WUPEN_RXWEN + * @arg INTC_WUPEN_USHWUEN + * @arg INTC_WUPEN_USFWUEN + * @arg INTC_WUPEN_ETHWUEN + * @param [in] enNewState + * @arg Enable: Enable corresponding wake up source + * @arg Disable: Disable corresponding wake up source + * @retval None + */ +void INTC_WakeupSrcCmd(uint32_t u32WakeupSrc, en_functional_state_t enNewState) + + +/** + * @brief Event or Interrupt output configure + * @param [in] u32Event: Event index + * @arg INTC_EVTER_EVTE0 + * @arg INTC_EVTER_EVTE1 + * @arg INTC_EVTER_EVTE2 + * @arg INTC_EVTER_EVTE3 + * @arg INTC_EVTER_EVTE4 + * @arg INTC_EVTER_EVTE5 + * @arg INTC_EVTER_EVTE6 + * @arg INTC_EVTER_EVTE7 + * @arg INTC_EVTER_EVTE8 + * @arg INTC_EVTER_EVTE9 + * @arg INTC_EVTER_EVTE10 + * @arg INTC_EVTER_EVTE11 + * @arg INTC_EVTER_EVTE12 + * @arg INTC_EVTER_EVTE13 + * @arg INTC_EVTER_EVTE14 + * @arg INTC_EVTER_EVTE15 + * @arg INTC_EVTER_EVTE16 + * @arg INTC_EVTER_EVTE17 + * @arg INTC_EVTER_EVTE18 + * @arg INTC_EVTER_EVTE19 + * @arg INTC_EVTER_EVTE20 + * @arg INTC_EVTER_EVTE21 + * @arg INTC_EVTER_EVTE22 + * @arg INTC_EVTER_EVTE23 + * @arg INTC_EVTER_EVTE24 + * @arg INTC_EVTER_EVTE25 + * @arg INTC_EVTER_EVTE26 + * @arg INTC_EVTER_EVTE27 + * @arg INTC_EVTER_EVTE28 + * @arg INTC_EVTER_EVTE29 + * @arg INTC_EVTER_EVTE30 + * @arg INTC_EVTER_EVTE31 + * @param [in] enNewState + * @arg Enable: Enable corresponding event to NVIC + * @arg Disable: Disable corresponding event but interrupt to NVIC + * @retval None + */ +void INTC_EventCmd(uint32_t u32Event, en_functional_state_t enNewState) + + +/** + * @brief Interrupt function configure + * @param [in] u32Int: Interrupt index + * @arg INTC_IER_IER0 + * @arg INTC_IER_IER1 + * @arg INTC_IER_IER2 + * @arg INTC_IER_IER3 + * @arg INTC_IER_IER4 + * @arg INTC_IER_IER5 + * @arg INTC_IER_IER6 + * @arg INTC_IER_IER7 + * @arg INTC_IER_IER8 + * @arg INTC_IER_IER9 + * @arg INTC_IER_IER10 + * @arg INTC_IER_IER11 + * @arg INTC_IER_IER12 + * @arg INTC_IER_IER13 + * @arg INTC_IER_IER14 + * @arg INTC_IER_IER15 + * @arg INTC_IER_IER16 + * @arg INTC_IER_IER17 + * @arg INTC_IER_IER18 + * @arg INTC_IER_IER19 + * @arg INTC_IER_IER20 + * @arg INTC_IER_IER21 + * @arg INTC_IER_IER22 + * @arg INTC_IER_IER23 + * @arg INTC_IER_IER24 + * @arg INTC_IER_IER25 + * @arg INTC_IER_IER26 + * @arg INTC_IER_IER27 + * @arg INTC_IER_IER28 + * @arg INTC_IER_IER29 + * @arg INTC_IER_IER30 + * @arg INTC_IER_IER31 + * @param [in] enNewState + * @arg Enable: Enable corresponding interrupt to NVIC + * @arg Disable: Disable corresponding interrupt to NVIC + * @retval None + */ +void INTC_IntCmd(uint32_t u32Int, en_functional_state_t enNewState) + + +/** + * @brief Software Interrupt function configure + * @param [in] u32SWI: Software Interrupt index + * @arg INTC_SWIER_SWIE0 + * @arg INTC_SWIER_SWIE1 + * @arg INTC_SWIER_SWIE2 + * @arg INTC_SWIER_SWIE3 + * @arg INTC_SWIER_SWIE4 + * @arg INTC_SWIER_SWIE5 + * @arg INTC_SWIER_SWIE6 + * @arg INTC_SWIER_SWIE7 + * @arg INTC_SWIER_SWIE8 + * @arg INTC_SWIER_SWIE9 + * @arg INTC_SWIER_SWIE10 + * @arg INTC_SWIER_SWIE11 + * @arg INTC_SWIER_SWIE12 + * @arg INTC_SWIER_SWIE13 + * @arg INTC_SWIER_SWIE14 + * @arg INTC_SWIER_SWIE15 + * @arg INTC_SWIER_SWIE16 + * @arg INTC_SWIER_SWIE17 + * @arg INTC_SWIER_SWIE18 + * @arg INTC_SWIER_SWIE19 + * @arg INTC_SWIER_SWIE20 + * @arg INTC_SWIER_SWIE21 + * @arg INTC_SWIER_SWIE22 + * @arg INTC_SWIER_SWIE23 + * @arg INTC_SWIER_SWIE24 + * @arg INTC_SWIER_SWIE25 + * @arg INTC_SWIER_SWIE26 + * @arg INTC_SWIER_SWIE27 + * @arg INTC_SWIER_SWIE28 + * @arg INTC_SWIER_SWIE29 + * @arg INTC_SWIER_SWIE30 + * @arg INTC_SWIER_SWIE31 + * @param [in] enNewState + * @arg Enable: Enable corresponding software interrupt + * @arg Disable: Disable corresponding software interrupt + * @retval None + */ +void INTC_SWICmd(uint32_t u32SWI, en_functional_state_t enNewState) + + +/** + * @brief Initialize NMI. Fill each pstcNmiInit with default value + * @param [in] pstcNmiInit: Pointer to a stc_nmi_init_t structure that + * contains configuration information. + * @retval Ok: NMI structure initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t NMI_StructInit(stc_nmi_init_t *pstcNmiInit) + + +/** + * @brief Initialize NMI. + * @param [in] pstcNmiInit: Pointer to a pstcNmiInit structure that + * contains configuration information. + * @retval Ok: NMI initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t NMI_Init(const stc_nmi_init_t *pstcNmiInit) + + +/** + * @brief Get NMI trigger source + * @param [in] u32NmiSrc: NMI trigger source, @ref NMI_TriggerSrc_Sel for details + * @arg NMI_SRC_SWDT + * @arg NMI_SRC_PVD1 + * @arg NMI_SRC_PVD2 + * @arg NMI_SRC_XTAL + * @arg NMI_SRC_SRAM_PARITY + * @arg NMI_SRC_SRAM_ECC + * @arg NMI_SRC_BUS_ERR + * @arg NMI_SRC_WDT + * @retval Set: NMI is triggered by corresponding source + * Reset: NMI is not triggered by corresponding source + */ +en_flag_status_t NMI_GetNmiSrc(uint32_t u32NmiSrc) + + +/** + * @brief Set NMI trigger source + * @param [in] u32NmiSrc: NMI trigger source, @ref NMI_TriggerSrc_Sel for details + * @arg NMI_SRC_SWDT + * @arg NMI_SRC_PVD1 + * @arg NMI_SRC_PVD2 + * @arg NMI_SRC_XTAL + * @arg NMI_SRC_SRAM_PARITY + * @arg NMI_SRC_SRAM_ECC + * @arg NMI_SRC_BUS_ERR + * @arg NMI_SRC_WDT + * @retval None + */ +void NMI_SetNmiSrc(uint32_t u32NmiSrc) + + +/** + * @brief Clear specified NMI trigger source + * @param [in] u32NmiSrc: NMI trigger source, @ref NMI_TriggerSrc_Sel for details + * @arg NMI_SRC_SWDT + * @arg NMI_SRC_PVD1 + * @arg NMI_SRC_PVD2 + * @arg NMI_SRC_XTAL + * @arg NMI_SRC_SRAM_PARITY + * @arg NMI_SRC_SRAM_ECC + * @arg NMI_SRC_BUS_ERR + * @arg NMI_SRC_WDT + * @retval None + */ +void NMI_ClrNmiSrc(uint32_t u32NmiSrc) + + +/** + * @brief NMI IRQ handler + * @param None + * @retval None + */ +void NMI_IrqHandler(void) + + +/** + * @brief Initialize External interrupt. + * @param [in] pstcExIntInit: Pointer to a stc_exint_init_t structure that + * contains configuration information. + * @retval Ok: EXINT initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t EXINT_Init(const stc_exint_init_t *pstcExIntInit) + + +/** + * @brief Initialize ExInt. Fill each pstcExIntInit with default value + * @param [in] pstcExIntInit: Pointer to a stc_exint_init_t structure + * that contains configuration information. + * @retval Ok: EXINT structure initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t EXINT_StructInit(stc_exint_init_t *pstcExIntInit) + + +/** + * @brief Clear specified External interrupt trigger source + * @param [in] u32ExIntCh: External interrupt channel, @ref EXINT_Channel_Sel for details + * @arg EXINT_CH00 + * @arg EXINT_CH01 + * @arg EXINT_CH02 + * @arg EXINT_CH03 + * @arg EXINT_CH04 + * @arg EXINT_CH05 + * @arg EXINT_CH06 + * @arg EXINT_CH07 + * @arg EXINT_CH08 + * @arg EXINT_CH09 + * @arg EXINT_CH10 + * @arg EXINT_CH11 + * @arg EXINT_CH12 + * @arg EXINT_CH13 + * @arg EXINT_CH14 + * @arg EXINT_CH15 + * @retval None + */ +void EXINT_ClrExIntSrc(uint32_t u32ExIntCh) + + +/** + * @brief Get specified External interrupt trigger source + * @param [in] u32ExIntCh: External interrupt channel, @ref EXINT_Channel_Sel for details + * @arg EXINT_CH00 + * @arg EXINT_CH01 + * @arg EXINT_CH02 + * @arg EXINT_CH03 + * @arg EXINT_CH04 + * @arg EXINT_CH05 + * @arg EXINT_CH06 + * @arg EXINT_CH07 + * @arg EXINT_CH08 + * @arg EXINT_CH09 + * @arg EXINT_CH10 + * @arg EXINT_CH11 + * @arg EXINT_CH12 + * @arg EXINT_CH13 + * @arg EXINT_CH14 + * @arg EXINT_CH15 + * @retval Set: Specified channel of external interrupt is triggered + * Reset: Specified channel of external interrupt is not triggered + */ +en_flag_status_t EXINT_GetExIntSrc(uint32_t u32ExIntCh) + + +/** + * @brief NMI IRQ handler + * @param None + * @retval None + */ +void NMI_Handler(void) + + +/** + * @brief Hard Fault IRQ handler + * @param None + * @retval None + */ +void HardFault_Handler(void) + + +/** + * @brief SVCall IRQ handler + * @param None + * @retval None + */ +void SVC_Handler(void) + + +/** + * @brief PendSV IRQ handler + * @param None + * @retval None + */ +void PendSV_Handler(void) + + +/** + * @brief SysTick IRQ handler + * @param None + * @retval None + */ +void SysTick_Handler(void) + + +/** + * @brief Interrupt No.000 IRQ handler + * @param None + * @retval None + */ +void IRQ000_Handler(void) + + +/** + * @brief Interrupt No.001 IRQ handler + * @param None + * @retval None + */ +void IRQ001_Handler(void) + + +/** + * @brief Interrupt No.002 IRQ handler + * @param None + * @retval None + */ +void IRQ002_Handler(void) + + +/** + * @brief Interrupt No.003 IRQ handler + * @param None + * @retval None + */ +void IRQ003_Handler(void) + + +/** + * @brief Interrupt No.004 IRQ handler + * @param None + * @retval None + */ +void IRQ004_Handler(void) + + +/** + * @brief Interrupt No.005 IRQ handler + * @param None + * @retval None + */ +void IRQ005_Handler(void) + + +/** + * @brief Interrupt No.006 IRQ handler + * @param None + * @retval None + */ +void IRQ006_Handler(void) + + +/** + * @brief Interrupt No.007 IRQ handler + * @param None + * @retval None + */ +void IRQ007_Handler(void) + + +/** + * @brief Interrupt No.008 IRQ handler + * @param None + * @retval None + */ +void IRQ008_Handler(void) + + +/** + * @brief Interrupt No.009 IRQ handler + * @param None + * @retval None + */ +void IRQ009_Handler(void) + + +/** + * @brief Interrupt No.010 IRQ handler + * @param None + * @retval None + */ +void IRQ010_Handler(void) + + +/** + * @brief Interrupt No.011 IRQ handler + * @param None + * @retval None + */ +void IRQ011_Handler(void) + + +/** + * @brief Interrupt No.012 IRQ handler + * @param None + * @retval None + */ +void IRQ012_Handler(void) + + +/** + * @brief Interrupt No.013 IRQ handler + * @param None + * @retval None + */ +void IRQ013_Handler(void) + + +/** + * @brief Interrupt No.014 IRQ handler + * @param None + * @retval None + */ +void IRQ014_Handler(void) + + +/** + * @brief Interrupt No.015 IRQ handler + * @param None + * @retval None + */ +void IRQ015_Handler(void) + + +/** + * @brief Interrupt No.016 IRQ handler + * @param None + * @retval None + */ +void IRQ016_Handler(void) + + +/** + * @brief Interrupt No.017 IRQ handler + * @param None + * @retval None + */ +void IRQ017_Handler(void) + + +/** + * @brief Interrupt No.018 IRQ handler + * @param None + * @retval None + */ +void IRQ018_Handler(void) + + +/** + * @brief Interrupt No.019 IRQ handler + * @param None + * @retval None + */ +void IRQ019_Handler(void) + + +/** + * @brief Interrupt No.020 IRQ handler + * @param None + * @retval None + */ +void IRQ020_Handler(void) + + +/** + * @brief Interrupt No.021 IRQ handler + * @param None + * @retval None + */ +void IRQ021_Handler(void) + + +/** + * @brief Interrupt No.022 IRQ handler + * @param None + * @retval None + */ +void IRQ022_Handler(void) + + +/** + * @brief Interrupt No.023 IRQ handler + * @param None + * @retval None + */ +void IRQ023_Handler(void) + + +/** + * @brief Interrupt No.024 IRQ handler + * @param None + * @retval None + */ +void IRQ024_Handler(void) + + +/** + * @brief Interrupt No.025 IRQ handler + * @param None + * @retval None + */ +void IRQ025_Handler(void) + + +/** + * @brief Interrupt No.026 IRQ handler + * @param None + * @retval None + */ +void IRQ026_Handler(void) + + +/** + * @brief Interrupt No.027 IRQ handler + * @param None + * @retval None + */ +void IRQ027_Handler(void) + + +/** + * @brief Interrupt No.028 IRQ handler + * @param None + * @retval None + */ +void IRQ028_Handler(void) + + +/** + * @brief Interrupt No.029 IRQ handler + * @param None + * @retval None + */ +void IRQ029_Handler(void) + + +/** + * @brief Interrupt No.030 IRQ handler + * @param None + * @retval None + */ +void IRQ030_Handler(void) + + +/** + * @brief Interrupt No.031 IRQ handler + * @param None + * @retval None + */ +void IRQ031_Handler(void) + + +/** + * @brief Interrupt No.032 IRQ handler + * @param None + * @retval None + */ +void IRQ032_Handler(void) + + +/** + * @brief Interrupt No.033 IRQ handler + * @param None + * @retval None + */ +void IRQ033_Handler(void) + + +/** + * @brief Interrupt No.034 IRQ handler + * @param None + * @retval None + */ +void IRQ034_Handler(void) + + +/** + * @brief Interrupt No.035 IRQ handler + * @param None + * @retval None + */ +void IRQ035_Handler(void) + + +/** + * @brief Interrupt No.036 IRQ handler + * @param None + * @retval None + */ +void IRQ036_Handler(void) + + +/** + * @brief Interrupt No.037 IRQ handler + * @param None + * @retval None + */ +void IRQ037_Handler(void) + + +/** + * @brief Interrupt No.038 IRQ handler + * @param None + * @retval None + */ +void IRQ038_Handler(void) + + +/** + * @brief Interrupt No.039 IRQ handler + * @param None + * @retval None + */ +void IRQ039_Handler(void) + + +/** + * @brief Interrupt No.040 IRQ handler + * @param None + * @retval None + */ +void IRQ040_Handler(void) + + +/** + * @brief Interrupt No.041 IRQ handler + * @param None + * @retval None + */ +void IRQ041_Handler(void) + + +/** + * @brief Interrupt No.042 IRQ handler + * @param None + * @retval None + */ +void IRQ042_Handler(void) + + +/** + * @brief Interrupt No.043 IRQ handler + * @param None + * @retval None + */ +void IRQ043_Handler(void) + + +/** + * @brief Interrupt No.044 IRQ handler + * @param None + * @retval None + */ +void IRQ044_Handler(void) + + +/** + * @brief Interrupt No.045 IRQ handler + * @param None + * @retval None + */ +void IRQ045_Handler(void) + + +/** + * @brief Interrupt No.046 IRQ handler + * @param None + * @retval None + */ +void IRQ046_Handler(void) + + +/** + * @brief Interrupt No.047 IRQ handler + * @param None + * @retval None + */ +void IRQ047_Handler(void) + + +/** + * @brief Interrupt No.048 IRQ handler + * @param None + * @retval None + */ +void IRQ048_Handler(void) + + +/** + * @brief Interrupt No.049 IRQ handler + * @param None + * @retval None + */ +void IRQ049_Handler(void) + + +/** + * @brief Interrupt No.050 IRQ handler + * @param None + * @retval None + */ +void IRQ050_Handler(void) + + +/** + * @brief Interrupt No.051 IRQ handler + * @param None + * @retval None + */ +void IRQ051_Handler(void) + + +/** + * @brief Interrupt No.052 IRQ handler + * @param None + * @retval None + */ +void IRQ052_Handler(void) + + +/** + * @brief Interrupt No.053 IRQ handler + * @param None + * @retval None + */ +void IRQ053_Handler(void) + + +/** + * @brief Interrupt No.054 IRQ handler + * @param None + * @retval None + */ +void IRQ054_Handler(void) + + +/** + * @brief Interrupt No.055 IRQ handler + * @param None + * @retval None + */ +void IRQ055_Handler(void) + + +/** + * @brief Interrupt No.056 IRQ handler + * @param None + * @retval None + */ +void IRQ056_Handler(void) + + +/** + * @brief Interrupt No.057 IRQ handler + * @param None + * @retval None + */ +void IRQ057_Handler(void) + + +/** + * @brief Interrupt No.058 IRQ handler + * @param None + * @retval None + */ +void IRQ058_Handler(void) + + +/** + * @brief Interrupt No.059 IRQ handler + * @param None + * @retval None + */ +void IRQ059_Handler(void) + + +/** + * @brief Interrupt No.060 IRQ handler + * @param None + * @retval None + */ +void IRQ060_Handler(void) + + +/** + * @brief Interrupt No.061 IRQ handler + * @param None + * @retval None + */ +void IRQ061_Handler(void) + + +/** + * @brief Interrupt No.062 IRQ handler + * @param None + * @retval None + */ +void IRQ062_Handler(void) + + +/** + * @brief Interrupt No.063 IRQ handler + * @param None + * @retval None + */ +void IRQ063_Handler(void) + + +/** + * @brief Interrupt No.064 IRQ handler + * @param None + * @retval None + */ +void IRQ064_Handler(void) + + +/** + * @brief Interrupt No.065 IRQ handler + * @param None + * @retval None + */ +void IRQ065_Handler(void) + + +/** + * @brief Interrupt No.066 IRQ handler + * @param None + * @retval None + */ +void IRQ066_Handler(void) + + +/** + * @brief Interrupt No.067 IRQ handler + * @param None + * @retval None + */ +void IRQ067_Handler(void) + + +/** + * @brief Interrupt No.068 IRQ handler + * @param None + * @retval None + */ +void IRQ068_Handler(void) + + +/** + * @brief Interrupt No.069 IRQ handler + * @param None + * @retval None + */ +void IRQ069_Handler(void) + + +/** + * @brief Interrupt No.070 IRQ handler + * @param None + * @retval None + */ +void IRQ070_Handler(void) + + +/** + * @brief Interrupt No.071 IRQ handler + * @param None + * @retval None + */ +void IRQ071_Handler(void) + + +/** + * @brief Interrupt No.072 IRQ handler + * @param None + * @retval None + */ +void IRQ072_Handler(void) + + +/** + * @brief Interrupt No.073 IRQ handler + * @param None + * @retval None + */ +void IRQ073_Handler(void) + + +/** + * @brief Interrupt No.074 IRQ handler + * @param None + * @retval None + */ +void IRQ074_Handler(void) + + +/** + * @brief Interrupt No.075 IRQ handler + * @param None + * @retval None + */ +void IRQ075_Handler(void) + + +/** + * @brief Interrupt No.076 IRQ handler + * @param None + * @retval None + */ +void IRQ076_Handler(void) + + +/** + * @brief Interrupt No.077 IRQ handler + * @param None + * @retval None + */ +void IRQ077_Handler(void) + + +/** + * @brief Interrupt No.078 IRQ handler + * @param None + * @retval None + */ +void IRQ078_Handler(void) + + +/** + * @brief Interrupt No.079 IRQ handler + * @param None + * @retval None + */ +void IRQ079_Handler(void) + + +/** + * @brief Interrupt No.080 IRQ handler + * @param None + * @retval None + */ +void IRQ080_Handler(void) + + +/** + * @brief Interrupt No.081 IRQ handler + * @param None + * @retval None + */ +void IRQ081_Handler(void) + + +/** + * @brief Interrupt No.082 IRQ handler + * @param None + * @retval None + */ +void IRQ082_Handler(void) + + +/** + * @brief Interrupt No.083 IRQ handler + * @param None + * @retval None + */ +void IRQ083_Handler(void) + + +/** + * @brief Interrupt No.084 IRQ handler + * @param None + * @retval None + */ +void IRQ084_Handler(void) + + +/** + * @brief Interrupt No.085 IRQ handler + * @param None + * @retval None + */ +void IRQ085_Handler(void) + + +/** + * @brief Interrupt No.086 IRQ handler + * @param None + * @retval None + */ +void IRQ086_Handler(void) + + +/** + * @brief Interrupt No.087 IRQ handler + * @param None + * @retval None + */ +void IRQ087_Handler(void) + + +/** + * @brief Interrupt No.088 IRQ handler + * @param None + * @retval None + */ +void IRQ088_Handler(void) + + +/** + * @brief Interrupt No.089 IRQ handler + * @param None + * @retval None + */ +void IRQ089_Handler(void) + + +/** + * @brief Interrupt No.090 IRQ handler + * @param None + * @retval None + */ +void IRQ090_Handler(void) + + +/** + * @brief Interrupt No.091 IRQ handler + * @param None + * @retval None + */ +void IRQ091_Handler(void) + + +/** + * @brief Interrupt No.092 IRQ handler + * @param None + * @retval None + */ +void IRQ092_Handler(void) + + +/** + * @brief Interrupt No.093 IRQ handler + * @param None + * @retval None + */ +void IRQ093_Handler(void) + + +/** + * @brief Interrupt No.094 IRQ handler + * @param None + * @retval None + */ +void IRQ094_Handler(void) + + +/** + * @brief Interrupt No.095 IRQ handler + * @param None + * @retval None + */ +void IRQ095_Handler(void) + + +/** + * @brief Interrupt No.096 IRQ handler + * @param None + * @retval None + */ +void IRQ096_Handler(void) + + +/** + * @brief Interrupt No.097 IRQ handler + * @param None + * @retval None + */ +void IRQ097_Handler(void) + + +/** + * @brief Interrupt No.098 IRQ handler + * @param None + * @retval None + */ +void IRQ098_Handler(void) + + +/** + * @brief Interrupt No.099 IRQ handler + * @param None + * @retval None + */ +void IRQ099_Handler(void) + + +/** + * @brief Interrupt No.100 IRQ handler + * @param None + * @retval None + */ +void IRQ100_Handler(void) + + +/** + * @brief Interrupt No.101 IRQ handler + * @param None + * @retval None + */ +void IRQ101_Handler(void) + + +/** + * @brief Interrupt No.102 IRQ handler + * @param None + * @retval None + */ +void IRQ102_Handler(void) + + +/** + * @brief Interrupt No.103 IRQ handler + * @param None + * @retval None + */ +void IRQ103_Handler(void) + + +/** + * @brief Interrupt No.104 IRQ handler + * @param None + * @retval None + */ +void IRQ104_Handler(void) + + +/** + * @brief Interrupt No.105 IRQ handler + * @param None + * @retval None + */ +void IRQ105_Handler(void) + + +/** + * @brief Interrupt No.106 IRQ handler + * @param None + * @retval None + */ +void IRQ106_Handler(void) + + +/** + * @brief Interrupt No.107 IRQ handler + * @param None + * @retval None + */ +void IRQ107_Handler(void) + + +/** + * @brief Interrupt No.108 IRQ handler + * @param None + * @retval None + */ +void IRQ108_Handler(void) + + +/** + * @brief Interrupt No.109 IRQ handler + * @param None + * @retval None + */ +void IRQ109_Handler(void) + + +/** + * @brief Interrupt No.110 IRQ handler + * @param None + * @retval None + */ +void IRQ110_Handler(void) + + +/** + * @brief Interrupt No.111 IRQ handler + * @param None + * @retval None + */ +void IRQ111_Handler(void) + + +/** + * @brief Interrupt No.112 IRQ handler + * @param None + * @retval None + */ +void IRQ112_Handler(void) + + +/** + * @brief Interrupt No.113 IRQ handler + * @param None + * @retval None + */ +void IRQ113_Handler(void) + + +/** + * @brief Interrupt No.114 IRQ handler + * @param None + * @retval None + */ +void IRQ114_Handler(void) + + +/** + * @brief Interrupt No.115 IRQ handler + * @param None + * @retval None + */ +void IRQ115_Handler(void) + + +/** + * @brief Interrupt No.116 IRQ handler + * @param None + * @retval None + */ +void IRQ116_Handler(void) + + +/** + * @brief Interrupt No.117 IRQ handler + * @param None + * @retval None + */ +void IRQ117_Handler(void) + + +/** + * @brief Interrupt No.118 IRQ handler + * @param None + * @retval None + */ +void IRQ118_Handler(void) + + +/** + * @brief Interrupt No.119 IRQ handler + * @param None + * @retval None + */ +void IRQ119_Handler(void) + + +/** + * @brief Interrupt No.120 IRQ handler + * @param None + * @retval None + */ +void IRQ120_Handler(void) + + +/** + * @brief Interrupt No.121 IRQ handler + * @param None + * @retval None + */ +void IRQ121_Handler(void) + + +/** + * @brief Interrupt No.122 IRQ handler + * @param None + * @retval None + */ +void IRQ122_Handler(void) + + +/** + * @brief Interrupt No.123 IRQ handler + * @param None + * @retval None + */ +void IRQ123_Handler(void) + + +/** + * @brief Interrupt No.124 IRQ handler + * @param None + * @retval None + */ +void IRQ124_Handler(void) + + +/** + * @brief Interrupt No.125 IRQ handler + * @param None + * @retval None + */ +void IRQ125_Handler(void) + + +/** + * @brief Interrupt No.126 IRQ handler + * @param None + * @retval None + */ +void IRQ126_Handler(void) + + +/** + * @brief Interrupt No.127 IRQ handler + * @param None + * @retval None + */ +void IRQ127_Handler(void) + + +/** + * @brief Interrupt No.128 share IRQ handler + * @param None + * @retval None + */ +void IRQ128_Handler(void) + + +/** + * @brief Interrupt No.129 share IRQ handler + * @param None + * @retval None + */ +void IRQ129_Handler(void) + + +/** + * @brief Interrupt No.130 share IRQ handler + * @param None + * @retval None + */ +void IRQ130_Handler(void) + + +/** + * @brief Interrupt No.131 share IRQ handler + * @param None + * @retval None + */ +void IRQ131_Handler(void) + + +/** + * @brief Interrupt No.132 share IRQ handler + * @param None + * @retval None + */ +void IRQ132_Handler(void) + + +/** + * @brief Interrupt No.133 share IRQ handler + * @param None + * @retval None + */ +void IRQ133_Handler(void) + + +/** + * @brief Interrupt No.134 share IRQ handler + * @param None + * @retval None + */ +void IRQ134_Handler(void) + + +/** + * @brief Interrupt No.135 share IRQ handler + * @param None + * @retval None + */ +void IRQ135_Handler(void) + + +/** + * @brief Interrupt No.136 share IRQ handler + * @param None + * @retval None + */ +void IRQ136_Handler(void) + + +/** + * @brief Interrupt No.137 share IRQ handler + * @param None + * @retval None + */ +void IRQ137_Handler(void) + + +/** + * @brief Interrupt No.138 share IRQ handler + * @param None + * @retval None + */ +void IRQ138_Handler(void) + + +/** + * @brief Interrupt No.139 share IRQ handler + * @param None + * @retval None + */ +void IRQ139_Handler(void) + + +/** + * @brief Interrupt No.140 share IRQ handler + * @param None + * @retval None + */ +void IRQ140_Handler(void) + + +/** + * @brief Interrupt No.141 share IRQ handler + * @param None + * @retval None + */ +void IRQ141_Handler(void) + + +/** + * @brief Interrupt No.142 share IRQ handler + * @param None + * @retval None + */ +void IRQ142_Handler(void) + + +/** + * @brief Interrupt No.143 share IRQ handler + * @param None + * @retval None + */ +void IRQ143_Handler(void) diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_keyscan.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_keyscan.c new file mode 100644 index 0000000000..e89b654d52 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_keyscan.c @@ -0,0 +1,232 @@ +/** + ******************************************************************************* + * @file hc32f4a0_keyscan.c + * @brief This file provides firmware functions to manage the matrix keyscan + * function (KEYSCAN). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Zhangxl First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_keyscan.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_KEYSCAN KEYSCAN + * @brief Matrix keyscan Driver Library + * @{ + */ + +#if (DDL_KEYSCAN_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup KEYSCAN_Local_Macros KEYSCAN Local Macros + * @{ + */ + +/** + * @defgroup KEYSCAN_Check_Parameters_Validity KEYSCAN Check Parameters Validity + * @{ + */ +/*! Parameter valid check for KEYSCAN HiZ state cycles. */ +#define IS_KEYSCAN_HIZ_CLC(clc) \ +( ((clc) == KEYSCAN_HIZ_CLC_4) || \ + ((clc) == KEYSCAN_HIZ_CLC_8) || \ + ((clc) == KEYSCAN_HIZ_CLC_16) || \ + ((clc) == KEYSCAN_HIZ_CLC_32) || \ + ((clc) == KEYSCAN_HIZ_CLC_64) || \ + ((clc) == KEYSCAN_HIZ_CLC_256) || \ + ((clc) == KEYSCAN_HIZ_CLC_512) || \ + ((clc) == KEYSCAN_HIZ_CLC_1024)) + +/*! Parameter valid check for KEYSCAN low level output cycles. */ +#define IS_KEYSCAN_LOW_CLC(clc) \ +( ((clc) == KEYSCAN_LOW_CLC_4) || \ + ((clc) == KEYSCAN_LOW_CLC_8) || \ + ((clc) == KEYSCAN_LOW_CLC_16) || \ + ((clc) == KEYSCAN_LOW_CLC_32) || \ + ((clc) == KEYSCAN_LOW_CLC_64) || \ + ((clc) == KEYSCAN_LOW_CLC_128) || \ + ((clc) == KEYSCAN_LOW_CLC_256) || \ + ((clc) == KEYSCAN_LOW_CLC_512) || \ + ((clc) == KEYSCAN_LOW_CLC_1K) || \ + ((clc) == KEYSCAN_LOW_CLC_2K) || \ + ((clc) == KEYSCAN_LOW_CLC_4K) || \ + ((clc) == KEYSCAN_LOW_CLC_8K) || \ + ((clc) == KEYSCAN_LOW_CLC_16K) || \ + ((clc) == KEYSCAN_LOW_CLC_32K) || \ + ((clc) == KEYSCAN_LOW_CLC_64K) || \ + ((clc) == KEYSCAN_LOW_CLC_128K) || \ + ((clc) == KEYSCAN_LOW_CLC_256K) || \ + ((clc) == KEYSCAN_LOW_CLC_512K) || \ + ((clc) == KEYSCAN_LOW_CLC_1M) || \ + ((clc) == KEYSCAN_LOW_CLC_2M) || \ + ((clc) == KEYSCAN_LOW_CLC_4M) || \ + ((clc) == KEYSCAN_LOW_CLC_8M) || \ + ((clc) == KEYSCAN_LOW_CLC_16M)) + +/*! Parameter valid check for KEYSCAN scan clock. */ +#define IS_KEYSCAN_CLK(clk) \ +( ((clk) == KEYSCAN_CLK_HCLK) || \ + ((clk) == KEYSCAN_CLK_LRC) || \ + ((clk) == KEYSCAN_CLK_XTAL32)) + +/*! Parameter valid check for KEYSCAN keyout pins. */ +#define IS_KEYSCAN_OUT(out) \ +( ((out) == KEYSCAN_OUT_0T1) || \ + ((out) == KEYSCAN_OUT_0T2) || \ + ((out) == KEYSCAN_OUT_0T3) || \ + ((out) == KEYSCAN_OUT_0T4) || \ + ((out) == KEYSCAN_OUT_0T5) || \ + ((out) == KEYSCAN_OUT_0T6) || \ + ((out) == KEYSCAN_OUT_0T7)) + +/*! Parameter valid check for KEYSCAN keyin(EIRQ) pins. */ +#define IS_KEYSCAN_IN(in) \ +( ((in) != 0x00U) && \ + (((in) | KEYSCAN_IN_MASK) == KEYSCAN_IN_MASK)) + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup KEYSCAN_Global_Functions KEYSCAN Global Functions + * @{ + */ + +/** + * @brief KEYSCAN function config. + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void KEYSCAN_Cmd(en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + WRITE_REG32(M4_KEYSCAN->SER, enNewState); +} + +/** + * @brief Initialize KEYSCAN config structure. Fill each pstcKeyscanInit with default value + * @param [in] pstcKeyscanInit Pointer to a stc_keyscan_init_t structure that + * contains configuration information. + * @retval Ok: KEYSCAN structure initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t KEYSCAN_StructInit(stc_keyscan_init_t *pstcKeyscanInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcKeyscanInit) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcKeyscanInit->u32HizCycle= KEYSCAN_HIZ_CLC_4; + pstcKeyscanInit->u32LowCycle= KEYSCAN_LOW_CLC_4; + pstcKeyscanInit->u32KeyClk = KEYSCAN_CLK_HCLK; + pstcKeyscanInit->u32KeyOut = KEYSCAN_OUT_0T1; + pstcKeyscanInit->u32KeyIn = KEYSCAN_IN_0; + } + return enRet; +} + +/** + * @brief KEYSCAN initialize. + * @param [in] pstcKeyscanInit KEYSCAN config structure. + * @arg u32HizCycle Hiz state keep cycles during low level output. + * @arg u32LowCycle Low level output cycles. + * @arg u32KeyClk Scan clock. + * @arg u32KeyOut KEYOUT selection. + * @arg u32KeyIn KEYIN(EIRQ) selection. + * @retval Ok: KEYSCAN function initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t KEYSCAN_Init(const stc_keyscan_init_t *pstcKeyscanInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcKeyscanInit) + { + enRet = ErrorInvalidParameter; + } + else + { + DDL_ASSERT(IS_KEYSCAN_HIZ_CLC(pstcKeyscanInit->u32HizCycle)); + DDL_ASSERT(IS_KEYSCAN_LOW_CLC(pstcKeyscanInit->u32LowCycle)); + DDL_ASSERT(IS_KEYSCAN_CLK(pstcKeyscanInit->u32KeyClk)); + DDL_ASSERT(IS_KEYSCAN_OUT(pstcKeyscanInit->u32KeyOut)); + DDL_ASSERT(IS_KEYSCAN_IN(pstcKeyscanInit->u32KeyIn)); + + WRITE_REG32(M4_KEYSCAN->SCR, \ + (pstcKeyscanInit->u32HizCycle | pstcKeyscanInit->u32LowCycle | \ + pstcKeyscanInit->u32KeyClk | pstcKeyscanInit->u32KeyOut | \ + pstcKeyscanInit->u32KeyIn )); + } + return enRet; +} + +/** + * @} + */ + +#endif /* DDL_KEYSCAN_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_mau.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_mau.c new file mode 100644 index 0000000000..6753a97064 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_mau.c @@ -0,0 +1,283 @@ +/** + ******************************************************************************* + * @file hc32f4a0_mau.c + * @brief This file provides firmware functions to manage the MAU. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Hexiao First version + 2020-07-15 Hexiao Modify MAU_SqrtStartCmd to MAU_SqrtStart + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_mau.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_MAU MAU + * @brief MAU Driver Library + * @{ + */ + +#if (DDL_MAU_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup MAU_Local_Macros MAU Local Macros + * @{ + */ + +/** + * @defgroup MAU_Check_Parameters_Validity MAU Check Parameters Validity + * @{ + */ +#define IS_VALID_UNIT(x) ((x) == M4_MAU) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ + +/** + * @defgroup MAU_Global_Functions MAU Global Functions + * @{ + */ + +/** + * @brief Sqrt result left shift config + * @param [in] MAUx Pointer to MAU instance register base. + * This parameter can only be: @arg M4_MAU + * @param [in] u8LShBitsNumber number of left shift bits + * max value is MAU_SQRT_OUTPUT_LSHIFT_MAX + * @retval None + */ +void MAU_SqrtResultLShiftCfg(M4_MAU_TypeDef *MAUx, uint8_t u8LShBitsNumber) +{ + DDL_ASSERT(IS_VALID_UNIT(MAUx)); + DDL_ASSERT(u8LShBitsNumber <= MAU_SQRT_OUTPUT_LSHIFT_MAX); + + MODIFY_REG32(MAUx->CSR, MAU_CSR_SHIFT, ((uint32_t)u8LShBitsNumber << MAU_CSR_SHIFT_POS)); +} + +/** + * @brief Sqrt interrupt function command + * @param [in] MAUx Pointer to MAU instance register base. + * This parameter can only be: @arg M4_MAU + * @param [in] enNewState New state of the MAUx sqrt interrupt function, + * @ref en_functional_state_t + * @retval None + */ +void MAU_SqrtIntCmd(M4_MAU_TypeDef *MAUx, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_UNIT(MAUx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + MODIFY_REG32(MAUx->CSR, MAU_CSR_INTEN, (uint32_t)enNewState << MAU_CSR_INTEN_POS); +} + +/** + * @brief Input radicand for sqrt + * @param [in] MAUx Pointer to MAU instance register base. + * This parameter can only be: @arg M4_MAU + * @param [in] u32Radicand data to be square rooted + * @retval None + */ +void MAU_SqrtWriteDataReg(M4_MAU_TypeDef* MAUx, uint32_t u32Radicand) +{ + DDL_ASSERT(M4_MAU == MAUx); + + WRITE_REG32(MAUx->DTR0, u32Radicand); +} + +/** + * @brief Start sqrt calculation + * @param [in] MAUx Pointer to MAU instance register base. + * This parameter can only be: @arg M4_MAU + * @retval None + */ +void MAU_SqrtStart(M4_MAU_TypeDef *MAUx) +{ + DDL_ASSERT(M4_MAU == MAUx); + + SET_REG32_BIT(MAUx->CSR, MAU_CSR_START); +} + +/** + * @brief Read if sqrt calculation is ongoing or not + * @param [in] MAUx Pointer to MAU instance register base. + * This parameter can only be: @arg M4_MAU + * @retval An en_flag_status_t enumeration value: + * - Set: calculation is ongoing + * - Reset: calculation is not ongoing + */ +en_flag_status_t MAU_SqrtGetStatus(const M4_MAU_TypeDef *MAUx) +{ + DDL_ASSERT(M4_MAU == MAUx); + + return (0UL != READ_REG32_BIT(MAUx->CSR, MAU_CSR_BUSY)) ? Set : Reset; +} + +/** + * @brief Read result of sqrt + * @param [in] MAUx Pointer to MAU instance register base. + * This parameter can only be: @arg M4_MAU + * @retval Result of sqrt,range is [0,0x10000] + */ +uint32_t MAU_SqrtReadDataReg(const M4_MAU_TypeDef *MAUx) +{ + DDL_ASSERT(M4_MAU == MAUx); + + return READ_REG32(MAUx->RTR0); +} + +/** + * @brief Initialize the specified DAC peripheral according to the specified parameters. + * @param [in] MAUx Pointer to MAU instance register base. + * This parameter can only be: @arg M4_MAU + * @param [in] u8LShBitsNumber Sqrt result left shift bits number + * max value is @ref MAU_SQRT_OUTPUT_LSHIFT_MAX + * @param [in] enIntNewState Enable or Disable sqrt interrupt + * @ref en_functional_state_t + * @retval None + */ +void MAU_SqrtInit(M4_MAU_TypeDef *MAUx, uint8_t u8LShBitsNumber, en_functional_state_t enIntNewState) +{ + DDL_ASSERT(M4_MAU == MAUx); + DDL_ASSERT(u8LShBitsNumber <= MAU_SQRT_OUTPUT_LSHIFT_MAX); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enIntNewState)); + + MODIFY_REG32(MAUx->CSR, MAU_CSR_SHIFT | MAU_CSR_INTEN, + ((((uint32_t)u8LShBitsNumber << MAU_CSR_SHIFT_POS)) | ((uint32_t)enIntNewState << MAU_CSR_INTEN_POS))); +} + +/** + * @brief De-initialize the DAC peripheral. Reset the registers of the specified DAC unit. + * @param [in] MAUx Pointer to MAU instance register base. + * This parameter can only be: @arg M4_MAU + * @retval None + */ +void MAU_SqrtDeInit(M4_MAU_TypeDef *MAUx) +{ + DDL_ASSERT(M4_MAU == MAUx); + + CLEAR_REG32_BIT(MAUx->CSR, MAU_CSR_SHIFT | MAU_CSR_INTEN); +} + +/** + * @brief Square root + * @param [in] MAUx Pointer to MAU instance register base. + * This parameter can only be: @arg M4_MAU + * @param [in] u32Radicand data to be square rooted + * @param [out] pu32Result Result of sqrt,range is [0,0x10000] + * @retval An en_result_t enumeration value + * - Ok: No errors occurred + * - Error: errors occurred + */ +en_result_t MAU_Sqrt(M4_MAU_TypeDef *MAUx, uint32_t u32Radicand, uint32_t *pu32Result) +{ + DDL_ASSERT(M4_MAU == MAUx); + DDL_ASSERT(pu32Result != (void *)0UL); + + uint32_t u32TimeCount = 0UL; + en_result_t enRet = Ok; + + WRITE_REG32(MAUx->DTR0, u32Radicand); + SET_REG32_BIT(MAUx->CSR, MAU_CSR_START); + __ASM("NOP"); + __ASM("NOP"); + __ASM("NOP"); + + while((MAUx->CSR & MAU_CSR_BUSY) != 0UL) + { + if(u32TimeCount++ > MAU_SQRT_TIMEOUT) + { + enRet = Error; + break; + } + } + + if(Ok == enRet) + { + *pu32Result = READ_REG32(MAUx->RTR0); + } + + return enRet; +} + +/** + * @brief Sine + * @param [in] MAUx Pointer to MAU instance register base. + * This parameter can only be: @arg M4_MAU + * @param u16AngleIdx: Angle index,range is [0,0xFFF], calculation method for reference: + AngleIdx = (uint16_t)(Angle * 4096.0F / 360.0F + 0.5F) % 4096U + * @retval Result of Sine in Q15 format + */ +int16_t MAU_Sin(M4_MAU_TypeDef *MAUx, uint16_t u16AngleIdx) +{ + DDL_ASSERT(M4_MAU == MAUx); + DDL_ASSERT(MAU_SIN_ANGIDX_TOTAL > u16AngleIdx); + + WRITE_REG16(MAUx->DTR1, u16AngleIdx); + __ASM("NOP"); + + return (int16_t)READ_REG16(MAUx->RTR1); +} + +/** + * @} + */ + +#endif /* DDL_MAU_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_mpu.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_mpu.c new file mode 100644 index 0000000000..6fa6849735 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_mpu.c @@ -0,0 +1,1106 @@ +/** + ******************************************************************************* + * @file hc32f4a0_mpu.c + * @brief This file provides firmware functions to manage the Memory Protection + * Unit(MPU). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Yangjp First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_mpu.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_MPU MPU + * @brief Memory Protection Unit Driver Library + * @{ + */ + +#if (DDL_MPU_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup MPU_Local_Macros MPU Local Macros + * @{ + */ + +/* Number of MPU unit */ +#define MPU_UNIT_NUM (5UL) +/* Number of MPU region */ +#define MPU_REGION_NUM (16UL) + +/* MPU Register Combination Mask */ +#define MPU_UNIT_CONFIG_MASK (MPU_S1CR_SMPU1BRP | MPU_S1CR_SMPU1BWP | MPU_S1CR_SMPU1ACT) + +/* DMA units with only 8 regions */ +#define MPU_NORMAL_UNIT (MPU_UNIT_USBFS_DMA | MPU_UNIT_USBHS_DMA | MPU_UNIT_ETH_DMA) + +/* Get the specified register address of the MPU Intrusion Control */ +#define MPU_RGD(__NUM__) ((uint32_t)(&(M4_MPU->RGD0)) + ((uint32_t)(__NUM__) << 2U)) + +#define MPU_RGE(__UNIT__) ((uint32_t)(&(M4_MPU->S1RGE)) + (uint32_t)(__UNIT__)) +#define MPU_RGWP(__UNIT__) ((uint32_t)(&(M4_MPU->S1RGWP)) + (uint32_t)(__UNIT__)) +#define MPU_RGRP(__UNIT__) ((uint32_t)(&(M4_MPU->S1RGRP)) + (uint32_t)(__UNIT__)) +#define MPU_CR(__UNIT__) ((uint32_t)(&(M4_MPU->S1CR)) + (uint32_t)(__UNIT__)) + +/** + * @defgroup MPU_Check_Parameters_Validity MPU Check Parameters Validity + * @{ + */ +#define IS_MPU_UNIT(x) \ +( ((x) != 0UL) && \ + (((x) | MPU_UNIT_ALL) == MPU_UNIT_ALL)) + +#define IS_MPU_REGION(x) \ +( ((x) == MPU_REGION_NUM0) || \ + ((x) == MPU_REGION_NUM1) || \ + ((x) == MPU_REGION_NUM2) || \ + ((x) == MPU_REGION_NUM3) || \ + ((x) == MPU_REGION_NUM4) || \ + ((x) == MPU_REGION_NUM5) || \ + ((x) == MPU_REGION_NUM6) || \ + ((x) == MPU_REGION_NUM7) || \ + ((x) == MPU_REGION_NUM8) || \ + ((x) == MPU_REGION_NUM9) || \ + ((x) == MPU_REGION_NUM10) || \ + ((x) == MPU_REGION_NUM11) || \ + ((x) == MPU_REGION_NUM12) || \ + ((x) == MPU_REGION_NUM13) || \ + ((x) == MPU_REGION_NUM14) || \ + ((x) == MPU_REGION_NUM15)) + +#define IS_MPU_UNIT_REGION(unit, region) \ +( (((unit) & MPU_NORMAL_UNIT) == 0UL) || \ + (((region) == MPU_REGION_NUM0) || \ + ((region) == MPU_REGION_NUM1) || \ + ((region) == MPU_REGION_NUM2) || \ + ((region) == MPU_REGION_NUM3) || \ + ((region) == MPU_REGION_NUM4) || \ + ((region) == MPU_REGION_NUM5) || \ + ((region) == MPU_REGION_NUM6) || \ + ((region) == MPU_REGION_NUM7))) + +#define IS_MPU_BKGRD_WR_PROTECT(x) \ +( ((x) == MPU_BKGRD_WR_PROTECT_DISABLE) || \ + ((x) == MPU_BKGRD_WR_PROTECT_ENABLE)) + +#define IS_MPU_BKGRD_RD_PROTECT(x) \ +( ((x) == MPU_BKGRD_RD_PROTECT_DISABLE) || \ + ((x) == MPU_BKGRD_RD_PROTECT_ENABLE)) + +#define IS_MPU_EXP_TYPE(x) \ +( ((x) == MPU_EXP_TYPE_NONE) || \ + ((x) == MPU_EXP_TYPE_BUS_ERR) || \ + ((x) == MPU_EXP_TYPE_NMI) || \ + ((x) == MPU_EXP_TYPE_RST)) + +#define IS_MPU_REGION_WR_PROTECT(x) \ +( ((x) == MPU_REGION_WR_PROTECT_DISABLE) || \ + ((x) == MPU_REGION_WR_PROTECT_ENABLE)) + +#define IS_MPU_REGION_RD_PROTECT(x) \ +( ((x) == MPU_REGION_RD_PROTECT_DISABLE) || \ + ((x) == MPU_REGION_RD_PROTECT_ENABLE)) + +#define IS_MPU_REGION_SIZE(x) \ +( ((x) == MPU_REGION_SIZE_32BYTE) || \ + ((x) == MPU_REGION_SIZE_64BYTE) || \ + ((x) == MPU_REGION_SIZE_128BYTE) || \ + ((x) == MPU_REGION_SIZE_256BYTE) || \ + ((x) == MPU_REGION_SIZE_512BYTE) || \ + ((x) == MPU_REGION_SIZE_1KBYTE) || \ + ((x) == MPU_REGION_SIZE_2KBYTE) || \ + ((x) == MPU_REGION_SIZE_4KBYTE) || \ + ((x) == MPU_REGION_SIZE_8KBYTE) || \ + ((x) == MPU_REGION_SIZE_16KBYTE) || \ + ((x) == MPU_REGION_SIZE_32KBYTE) || \ + ((x) == MPU_REGION_SIZE_64KBYTE) || \ + ((x) == MPU_REGION_SIZE_128KBYTE) || \ + ((x) == MPU_REGION_SIZE_256KBYTE) || \ + ((x) == MPU_REGION_SIZE_512KBYTE) || \ + ((x) == MPU_REGION_SIZE_1MBYTE) || \ + ((x) == MPU_REGION_SIZE_2MBYTE) || \ + ((x) == MPU_REGION_SIZE_4MBYTE) || \ + ((x) == MPU_REGION_SIZE_8MBYTE) || \ + ((x) == MPU_REGION_SIZE_16MBYTE) || \ + ((x) == MPU_REGION_SIZE_32MBYTE) || \ + ((x) == MPU_REGION_SIZE_64MBYTE) || \ + ((x) == MPU_REGION_SIZE_128MBYTE) || \ + ((x) == MPU_REGION_SIZE_256MBYTE) || \ + ((x) == MPU_REGION_SIZE_512MBYTE) || \ + ((x) == MPU_REGION_SIZE_1GBYTE) || \ + ((x) == MPU_REGION_SIZE_2GBYTE) || \ + ((x) == MPU_REGION_SIZE_4GBYTE)) + +#define IS_MPU_REGION_BASE_ADDER(addr, size) \ +( ((addr) & ((uint32_t)(~((uint64_t)0xFFFFFFFFUL << ((size) + 1U))))) == 0UL) + +#define IS_MPU_FLAG(x) \ +( ((x) != 0UL) && \ + (((x) | MPU_FLAG_ALL) == MPU_FLAG_ALL)) + +#define IS_MPU_IP_TYPE(x) \ +( ((x) != 0UL) && \ + (((x) | MPU_IP_ALL) == MPU_IP_ALL)) + +#define IS_MPU_IP_EXP_TYPE(x) \ +( ((x) == MPU_IP_EXP_TYPE_NONE) || \ + ((x) == MPU_IP_EXP_TYPE_BUS_ERR)) + +#define IS_MPU_UNLOCK() ((M4_MPU->WP & MPU_WP_MPUWE) == MPU_WP_MPUWE) + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup MPU_Global_Functions MPU Global Functions + * @{ + */ + +/** + * @brief De-Initialize MPU. + * @param None + * @retval None + */ +void MPU_DeInit(void) +{ + uint32_t i; + __IO uint32_t *RGD; + __IO uint32_t *RGE; + __IO uint32_t *RGWP; + __IO uint32_t *RGRP; + __IO uint32_t *CR; + + /* Check parameters */ + DDL_ASSERT(IS_MPU_UNLOCK()); + + for (i = 0UL; i < MPU_REGION_NUM; i++) + { + RGD = (__IO uint32_t *)MPU_RGD(i); + WRITE_REG32(*RGD, 0UL); + } + WRITE_REG32(M4_MPU->ECLR, 0x1FUL); + WRITE_REG32(M4_MPU->IPPR, 0UL); + for (i = 0UL; i < MPU_UNIT_NUM; i++) + { + RGE = (__IO uint32_t *)MPU_RGE(i << 4); + WRITE_REG32(*RGE, 0UL); + RGWP = (__IO uint32_t *)MPU_RGWP(i << 4); + WRITE_REG32(*RGWP, 0UL); + RGRP = (__IO uint32_t *)MPU_RGRP(i << 4); + WRITE_REG32(*RGRP, 0UL); + CR = (__IO uint32_t *)MPU_CR(i << 4); + WRITE_REG32(*CR, 0UL); + } +} + +/** + * @brief Initialize MPU. + * @param [in] pstcMpuInit Pointer to a @ref stc_mpu_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: Invalid parameter + */ +en_result_t MPU_Init(const stc_mpu_init_t *pstcMpuInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcMpuInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_MPU_UNLOCK()); + DDL_ASSERT(IS_MPU_EXP_TYPE(pstcMpuInit->stcDma1.u32ExceptionType)); + DDL_ASSERT(IS_MPU_EXP_TYPE(pstcMpuInit->stcDma2.u32ExceptionType)); + DDL_ASSERT(IS_MPU_EXP_TYPE(pstcMpuInit->stcUsbFSDma.u32ExceptionType)); + DDL_ASSERT(IS_MPU_EXP_TYPE(pstcMpuInit->stcUsbHSDma.u32ExceptionType)); + DDL_ASSERT(IS_MPU_EXP_TYPE(pstcMpuInit->stcEthDma.u32ExceptionType)); + DDL_ASSERT(IS_MPU_BKGRD_WR_PROTECT(pstcMpuInit->stcDma1.u32BackgroundWriteProtect)); + DDL_ASSERT(IS_MPU_BKGRD_WR_PROTECT(pstcMpuInit->stcDma2.u32BackgroundWriteProtect)); + DDL_ASSERT(IS_MPU_BKGRD_WR_PROTECT(pstcMpuInit->stcUsbFSDma.u32BackgroundWriteProtect)); + DDL_ASSERT(IS_MPU_BKGRD_WR_PROTECT(pstcMpuInit->stcUsbHSDma.u32BackgroundWriteProtect)); + DDL_ASSERT(IS_MPU_BKGRD_WR_PROTECT(pstcMpuInit->stcEthDma.u32BackgroundWriteProtect)); + DDL_ASSERT(IS_MPU_BKGRD_RD_PROTECT(pstcMpuInit->stcDma1.u32BackgroundReadProtect)); + DDL_ASSERT(IS_MPU_BKGRD_RD_PROTECT(pstcMpuInit->stcDma2.u32BackgroundReadProtect)); + DDL_ASSERT(IS_MPU_BKGRD_RD_PROTECT(pstcMpuInit->stcUsbFSDma.u32BackgroundReadProtect)); + DDL_ASSERT(IS_MPU_BKGRD_RD_PROTECT(pstcMpuInit->stcUsbHSDma.u32BackgroundReadProtect)); + DDL_ASSERT(IS_MPU_BKGRD_RD_PROTECT(pstcMpuInit->stcEthDma.u32BackgroundReadProtect)); + + MODIFY_REG32(M4_MPU->S1CR, MPU_UNIT_CONFIG_MASK, + (pstcMpuInit->stcDma1.u32ExceptionType | + pstcMpuInit->stcDma1.u32BackgroundWriteProtect | pstcMpuInit->stcDma1.u32BackgroundReadProtect)); + MODIFY_REG32(M4_MPU->S2CR, MPU_UNIT_CONFIG_MASK, + (pstcMpuInit->stcDma2.u32ExceptionType | + pstcMpuInit->stcDma2.u32BackgroundWriteProtect | pstcMpuInit->stcDma2.u32BackgroundReadProtect)); + MODIFY_REG32(M4_MPU->FCR, MPU_UNIT_CONFIG_MASK, + (pstcMpuInit->stcUsbFSDma.u32ExceptionType | + pstcMpuInit->stcUsbFSDma.u32BackgroundWriteProtect | pstcMpuInit->stcUsbFSDma.u32BackgroundReadProtect)); + MODIFY_REG32(M4_MPU->HCR, MPU_UNIT_CONFIG_MASK, + (pstcMpuInit->stcUsbHSDma.u32ExceptionType | + pstcMpuInit->stcUsbHSDma.u32BackgroundWriteProtect | pstcMpuInit->stcUsbHSDma.u32BackgroundReadProtect)); + MODIFY_REG32(M4_MPU->ECR, MPU_UNIT_CONFIG_MASK, + (pstcMpuInit->stcEthDma.u32ExceptionType | + pstcMpuInit->stcEthDma.u32BackgroundWriteProtect | pstcMpuInit->stcEthDma.u32BackgroundReadProtect)); + } + + return enRet; +} + +/** + * @brief Fills each stc_mpu_init_t member with default value. + * @param [out] pstcMpuInit Pointer to a @ref stc_mpu_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: stc_mpu_init_t member initialize success + * - ErrorInvalidParameter: Invalid parameter + */ +en_result_t MPU_StructInit(stc_mpu_init_t *pstcMpuInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcMpuInit) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcMpuInit->stcDma1.u32ExceptionType = MPU_EXP_TYPE_NONE; + pstcMpuInit->stcDma2.u32ExceptionType = MPU_EXP_TYPE_NONE; + pstcMpuInit->stcUsbFSDma.u32ExceptionType = MPU_EXP_TYPE_NONE; + pstcMpuInit->stcUsbHSDma.u32ExceptionType = MPU_EXP_TYPE_NONE; + pstcMpuInit->stcEthDma.u32ExceptionType = MPU_EXP_TYPE_NONE; + pstcMpuInit->stcDma1.u32BackgroundWriteProtect = MPU_BKGRD_WR_PROTECT_DISABLE; + pstcMpuInit->stcDma2.u32BackgroundWriteProtect = MPU_BKGRD_WR_PROTECT_DISABLE; + pstcMpuInit->stcUsbFSDma.u32BackgroundWriteProtect = MPU_BKGRD_WR_PROTECT_DISABLE; + pstcMpuInit->stcUsbHSDma.u32BackgroundWriteProtect = MPU_BKGRD_WR_PROTECT_DISABLE; + pstcMpuInit->stcEthDma.u32BackgroundWriteProtect = MPU_BKGRD_WR_PROTECT_DISABLE; + pstcMpuInit->stcDma1.u32BackgroundReadProtect = MPU_BKGRD_RD_PROTECT_DISABLE; + pstcMpuInit->stcDma2.u32BackgroundReadProtect = MPU_BKGRD_RD_PROTECT_DISABLE; + pstcMpuInit->stcUsbFSDma.u32BackgroundReadProtect = MPU_BKGRD_RD_PROTECT_DISABLE; + pstcMpuInit->stcUsbHSDma.u32BackgroundReadProtect = MPU_BKGRD_RD_PROTECT_DISABLE; + pstcMpuInit->stcEthDma.u32BackgroundReadProtect = MPU_BKGRD_RD_PROTECT_DISABLE; + } + + return enRet; +} + +/** + * @brief Set the exception type of the unit. + * @param [in] u32Unit The type of MPU unit. + * This parameter can be one or any combination of the following values: + * @arg MPU_UNIT_DMA1: System DMA_1 MPU + * @arg MPU_UNIT_DMA2: System DMA_2 MPU + * @arg MPU_UNIT_USBFS_DMA: USBFS_DMA MPU + * @arg MPU_UNIT_USBHS_DMA: USBHS_DMA MPU + * @arg MPU_UNIT_ETH_DMA: ETH_DMA MPU + * @param [in] u32ExceptionType Exception type of MPU unit. + * This parameter can be one of the following values: + * @arg MPU_EXP_TYPE_NONE: The host unit access protection regions will be ignored + * @arg MPU_EXP_TYPE_BUS_ERR: The host unit access protection regions will be ignored and a bus error will be triggered + * @arg MPU_EXP_TYPE_NMI: The host unit access protection regions will be ignored and a NMI interrupt will be triggered + * @arg MPU_EXP_TYPE_RST: The host unit access protection regions will trigger the reset + * @retval None + */ +void MPU_SetExceptionType(uint32_t u32Unit, uint32_t u32ExceptionType) +{ + __IO uint32_t *CR; + uint32_t u32UnitPos = 0UL; + uint32_t u32Temp; + + /* Check parameters */ + DDL_ASSERT(IS_MPU_UNLOCK()); + DDL_ASSERT(IS_MPU_UNIT(u32Unit)); + DDL_ASSERT(IS_MPU_EXP_TYPE(u32ExceptionType)); + + u32Temp = u32Unit; + while (0UL != u32Temp) + { + if (0UL != (u32Temp & 0x1UL)) + { + CR = (__IO uint32_t *)MPU_CR(u32UnitPos); + MODIFY_REG32(*CR, MPU_S1CR_SMPU1ACT, u32ExceptionType); + } + u32Temp >>= 1UL; + u32UnitPos += 0x10U; + } +} + +/** + * @brief Enable or disable the write protection of the unit for background space. + * @param [in] u32Unit The type of MPU unit. + * This parameter can be one or any combination of the following values: + * @arg MPU_UNIT_DMA1: System DMA_1 MPU + * @arg MPU_UNIT_DMA2: System DMA_2 MPU + * @arg MPU_UNIT_USBFS_DMA: USBFS_DMA MPU + * @arg MPU_UNIT_USBHS_DMA: USBHS_DMA MPU + * @arg MPU_UNIT_ETH_DMA: ETH_DMA MPU + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void MPU_BackgroundWriteProtectCmd(uint32_t u32Unit, en_functional_state_t enNewState) +{ + __IO uint32_t *CR; + uint32_t u32UnitPos = 0UL; + uint32_t u32Temp; + + /* Check parameters */ + DDL_ASSERT(IS_MPU_UNLOCK()); + DDL_ASSERT(IS_MPU_UNIT(u32Unit)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32Temp = u32Unit; + while (0UL != u32Temp) + { + if (0UL != (u32Temp & 0x1UL)) + { + CR = (__IO uint32_t *)MPU_CR(u32UnitPos); + if (Disable != enNewState) + { + SET_REG32_BIT(*CR, MPU_S1CR_SMPU1BWP); + } + else + { + CLEAR_REG32_BIT(*CR, MPU_S1CR_SMPU1BWP); + } + } + u32Temp >>= 1UL; + u32UnitPos += 0x10U; + } +} + +/** + * @brief Enable or disable the read protection of the unit for background space. + * @param [in] u32Unit The type of MPU unit. + * This parameter can be one or any combination of the following values: + * @arg MPU_UNIT_DMA1: System DMA_1 MPU + * @arg MPU_UNIT_DMA2: System DMA_2 MPU + * @arg MPU_UNIT_USBFS_DMA: USBFS_DMA MPU + * @arg MPU_UNIT_USBHS_DMA: USBHS_DMA MPU + * @arg MPU_UNIT_ETH_DMA: ETH_DMA MPU + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void MPU_BackgroundReadProtectCmd(uint32_t u32Unit, en_functional_state_t enNewState) +{ + __IO uint32_t *CR; + uint32_t u32UnitPos = 0UL; + uint32_t u32Temp; + + /* Check parameters */ + DDL_ASSERT(IS_MPU_UNLOCK()); + DDL_ASSERT(IS_MPU_UNIT(u32Unit)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32Temp = u32Unit; + while (0UL != u32Temp) + { + if (0UL != (u32Temp & 0x1UL)) + { + CR = (__IO uint32_t *)MPU_CR(u32UnitPos); + if (Disable != enNewState) + { + SET_REG32_BIT(*CR, MPU_S1CR_SMPU1BRP); + } + else + { + CLEAR_REG32_BIT(*CR, MPU_S1CR_SMPU1BRP); + } + } + u32Temp >>= 1UL; + u32UnitPos += 0x10U; + } +} + +/** + * @brief Enable or disable the access control of the unit. + * @param [in] u32Unit The type of MPU unit. + * This parameter can be one or any combination of the following values: + * @arg MPU_UNIT_DMA1: System DMA_1 MPU + * @arg MPU_UNIT_DMA2: System DMA_2 MPU + * @arg MPU_UNIT_USBFS_DMA: USBFS_DMA MPU + * @arg MPU_UNIT_USBHS_DMA: USBHS_DMA MPU + * @arg MPU_UNIT_ETH_DMA: ETH_DMA MPU + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void MPU_UnitCmd(uint32_t u32Unit, en_functional_state_t enNewState) +{ + __IO uint32_t *CR; + uint32_t u32UnitPos = 0UL; + uint32_t u32Temp; + + /* Check parameters */ + DDL_ASSERT(IS_MPU_UNLOCK()); + DDL_ASSERT(IS_MPU_UNIT(u32Unit)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32Temp = u32Unit; + while (0UL != u32Temp) + { + if (0UL != (u32Temp & 0x1UL)) + { + CR = (__IO uint32_t *)MPU_CR(u32UnitPos); + if (Disable != enNewState) + { + SET_REG32_BIT(*CR, MPU_S1CR_SMPU1E); + } + else + { + CLEAR_REG32_BIT(*CR, MPU_S1CR_SMPU1E); + } + } + u32Temp >>= 1UL; + u32UnitPos += 0x10U; + } +} + +/** + * @brief Gets the status of MPU flag. + * @param [in] u32Flag The type of MPU flag. + * This parameter can be one or any combination of the following values: + * @arg MPU_FLAG_SMPU1EAF: System DMA_1 error flag + * @arg MPU_FLAG_SMPU2EAF: System DMA_2 error flag + * @arg MPU_FLAG_FMPUEAF: USBFS_DMA error flag + * @arg MPU_FLAG_HMPUEAF: USBHS_DMA error flag + * @arg MPU_FLAG_EMPUEAF: ETH_DMA error flag + * @arg MPU_FLAG_ALL: All of the above + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t MPU_GetStatus(uint32_t u32Flag) +{ + en_flag_status_t enFlagSta = Reset; + + /* Check parameters */ + DDL_ASSERT(IS_MPU_FLAG(u32Flag)); + + if (0UL != (READ_REG32_BIT(M4_MPU->SR, u32Flag))) + { + enFlagSta = Set; + } + + return enFlagSta; +} + +/** + * @brief Clear the flag of MPU. + * @param [in] u32Flag The type of MPU flag. + * This parameter can be one or any combination of the following values: + * @arg MPU_FLAG_SMPU1EAF: System DMA_1 error flag + * @arg MPU_FLAG_SMPU2EAF: System DMA_2 error flag + * @arg MPU_FLAG_FMPUEAF: USBFS_DMA error flag + * @arg MPU_FLAG_HMPUEAF: USBHS_DMA error flag + * @arg MPU_FLAG_EMPUEAF: ETH_DMA error flag + * @arg MPU_FLAG_ALL: All of the above + * @retval None + */ +void MPU_ClearStatus(uint32_t u32Flag) +{ + /* Check parameters */ + DDL_ASSERT(IS_MPU_FLAG(u32Flag)); + + SET_REG32_BIT(M4_MPU->ECLR, u32Flag); +} + +/** + * @brief Initialize the region. + * @note 'MPU_REGION_NUM8' to 'MPU_REGION_NUM15' are only valid when the MPU unit is 'MPU_UNIT_DMA1' or 'MPU_UNIT_DMA2'. + * @note The effective bits of the 'u32BaseAddr' are related to the 'u32Size' of the region, + * and the low 'u32Size+1' bits are fixed at 0. + * @param [in] u32Num The number of the regsion. + * This parameter can be one of the following values: + * @arg MPU_REGION_NUM0: MPU region number 0 + * @arg MPU_REGION_NUM1: MPU region number 1 + * @arg MPU_REGION_NUM2: MPU region number 2 + * @arg MPU_REGION_NUM3: MPU region number 3 + * @arg MPU_REGION_NUM4: MPU region number 4 + * @arg MPU_REGION_NUM5: MPU region number 5 + * @arg MPU_REGION_NUM6: MPU region number 6 + * @arg MPU_REGION_NUM7: MPU region number 7 + * @arg MPU_REGION_NUM8: MPU region number 8 + * @arg MPU_REGION_NUM9: MPU region number 9 + * @arg MPU_REGION_NUM10: MPU region number 10 + * @arg MPU_REGION_NUM11: MPU region number 11 + * @arg MPU_REGION_NUM12: MPU region number 12 + * @arg MPU_REGION_NUM13: MPU region number 13 + * @arg MPU_REGION_NUM14: MPU region number 14 + * @arg MPU_REGION_NUM15: MPU region number 15 + * @param [in] pstcRegionInit Pointer to a @ref stc_mpu_region_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: Invalid parameter + */ +en_result_t MPU_RegionInit(uint32_t u32Num, const stc_mpu_region_init_t *pstcRegionInit) +{ + en_result_t enRet = Ok; + __IO uint32_t *RGD; + __IO uint32_t *RGWP; + __IO uint32_t *RGRP; + uint32_t i; + uint32_t u32UnitNum = MPU_UNIT_NUM; + stc_mpu_region_permission_t RegionBuffer[MPU_UNIT_NUM]; + + if (NULL == pstcRegionInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_MPU_UNLOCK()); + DDL_ASSERT(IS_MPU_REGION(u32Num)); + DDL_ASSERT(IS_MPU_REGION_SIZE(pstcRegionInit->u32Size)); + DDL_ASSERT(IS_MPU_REGION_BASE_ADDER(pstcRegionInit->u32BaseAddr, pstcRegionInit->u32Size)); + DDL_ASSERT(IS_MPU_REGION_WR_PROTECT(pstcRegionInit->stcDma1.u32WriteProtect)); + DDL_ASSERT(IS_MPU_REGION_WR_PROTECT(pstcRegionInit->stcDma2.u32WriteProtect)); + DDL_ASSERT(IS_MPU_REGION_WR_PROTECT(pstcRegionInit->stcUsbFSDma.u32WriteProtect)); + DDL_ASSERT(IS_MPU_REGION_WR_PROTECT(pstcRegionInit->stcUsbHSDma.u32WriteProtect)); + DDL_ASSERT(IS_MPU_REGION_WR_PROTECT(pstcRegionInit->stcEthDma.u32WriteProtect)); + DDL_ASSERT(IS_MPU_REGION_RD_PROTECT(pstcRegionInit->stcDma1.u32ReadProtect)); + DDL_ASSERT(IS_MPU_REGION_RD_PROTECT(pstcRegionInit->stcDma2.u32ReadProtect)); + DDL_ASSERT(IS_MPU_REGION_RD_PROTECT(pstcRegionInit->stcUsbFSDma.u32ReadProtect)); + DDL_ASSERT(IS_MPU_REGION_RD_PROTECT(pstcRegionInit->stcUsbHSDma.u32ReadProtect)); + DDL_ASSERT(IS_MPU_REGION_RD_PROTECT(pstcRegionInit->stcEthDma.u32ReadProtect)); + + RGD = (__IO uint32_t *)MPU_RGD(u32Num); + WRITE_REG32(*RGD, (pstcRegionInit->u32Size | pstcRegionInit->u32BaseAddr)); + /* Configure the read/write permission for the region */ + RegionBuffer[0] = pstcRegionInit->stcDma1; + RegionBuffer[1] = pstcRegionInit->stcDma2; + RegionBuffer[2] = pstcRegionInit->stcUsbFSDma; + RegionBuffer[3] = pstcRegionInit->stcUsbHSDma; + RegionBuffer[4] = pstcRegionInit->stcEthDma; + if ((u32Num >= MPU_REGION_NUM8) && (u32Num <= MPU_REGION_NUM15)) + { + u32UnitNum = 2UL; + } + for (i = 0UL; i < u32UnitNum; i++) + { + /* Configure the write permission for the region */ + RGWP = (__IO uint32_t *)MPU_RGWP(i << 4); + if (MPU_REGION_WR_PROTECT_DISABLE != RegionBuffer[i].u32WriteProtect) + { + SET_REG32_BIT(*RGWP, (0x1UL << u32Num)); + } + else + { + CLEAR_REG32_BIT(*RGWP, (0x1UL << u32Num)); + } + /* Configure the read permission for the region */ + RGRP = (__IO uint32_t *)MPU_RGRP(i << 4); + if (MPU_REGION_WR_PROTECT_DISABLE != RegionBuffer[i].u32ReadProtect) + { + SET_REG32_BIT(*RGRP, (0x1UL << u32Num)); + } + else + { + CLEAR_REG32_BIT(*RGRP, (0x1UL << u32Num)); + } + } + } + + return enRet; +} + +/** + * @brief Fills each stc_mpu_region_init_t member with default value. + * @param [out] pstcRegionInit Pointer to a @ref stc_mpu_region_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: stc_mpu_region_init_t member initialize success + * - ErrorInvalidParameter: Invalid parameter + */ +en_result_t MPU_RegionStructInit(stc_mpu_region_init_t *pstcRegionInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcRegionInit) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcRegionInit->u32BaseAddr = 0UL; + pstcRegionInit->u32Size = MPU_REGION_SIZE_32BYTE; + pstcRegionInit->stcDma1.u32WriteProtect = MPU_REGION_WR_PROTECT_DISABLE; + pstcRegionInit->stcDma2.u32WriteProtect = MPU_REGION_WR_PROTECT_DISABLE; + pstcRegionInit->stcUsbFSDma.u32WriteProtect = MPU_REGION_WR_PROTECT_DISABLE; + pstcRegionInit->stcUsbHSDma.u32WriteProtect = MPU_REGION_WR_PROTECT_DISABLE; + pstcRegionInit->stcEthDma.u32WriteProtect = MPU_REGION_WR_PROTECT_DISABLE; + pstcRegionInit->stcDma1.u32ReadProtect = MPU_REGION_RD_PROTECT_DISABLE; + pstcRegionInit->stcDma2.u32ReadProtect = MPU_REGION_RD_PROTECT_DISABLE; + pstcRegionInit->stcUsbFSDma.u32ReadProtect = MPU_REGION_RD_PROTECT_DISABLE; + pstcRegionInit->stcUsbHSDma.u32ReadProtect = MPU_REGION_RD_PROTECT_DISABLE; + pstcRegionInit->stcEthDma.u32ReadProtect = MPU_REGION_RD_PROTECT_DISABLE; + } + + return enRet; +} + +/** + * @brief Set the base address of the region. + * @note The effective bits of the 'u32Addr' are related to the 'size' of the region, + * and the low 'size+1' bits are fixed at 0. + * @param [in] u32Num The number of the regsion. + * This parameter can be one of the following values: + * @arg MPU_REGION_NUM0: MPU region number 0 + * @arg MPU_REGION_NUM1: MPU region number 1 + * @arg MPU_REGION_NUM2: MPU region number 2 + * @arg MPU_REGION_NUM3: MPU region number 3 + * @arg MPU_REGION_NUM4: MPU region number 4 + * @arg MPU_REGION_NUM5: MPU region number 5 + * @arg MPU_REGION_NUM6: MPU region number 6 + * @arg MPU_REGION_NUM7: MPU region number 7 + * @arg MPU_REGION_NUM8: MPU region number 8 + * @arg MPU_REGION_NUM9: MPU region number 9 + * @arg MPU_REGION_NUM10: MPU region number 10 + * @arg MPU_REGION_NUM11: MPU region number 11 + * @arg MPU_REGION_NUM12: MPU region number 12 + * @arg MPU_REGION_NUM13: MPU region number 13 + * @arg MPU_REGION_NUM14: MPU region number 14 + * @arg MPU_REGION_NUM15: MPU region number 15 + * @param [in] u32Addr The base address of the region. + * @retval None + */ +void MPU_SetRegionBaseAddr(uint32_t u32Num, uint32_t u32Addr) +{ + __IO uint32_t *RGD; + + /* Check parameters */ + DDL_ASSERT(IS_MPU_UNLOCK()); + DDL_ASSERT(IS_MPU_REGION(u32Num)); + + RGD = (__IO uint32_t *)MPU_RGD(u32Num); + /* Check parameters */ + DDL_ASSERT(IS_MPU_REGION_BASE_ADDER(u32Addr, READ_REG32_BIT(*RGD, MPU_RGD_MPURGSIZE))); + + MODIFY_REG32(*RGD, MPU_RGD_MPURGADDR, u32Addr); +} + +/** + * @brief Set the size of the region. + * @param [in] u32Num The number of the regsion. + * This parameter can be one of the following values: + * @arg MPU_REGION_NUM0: MPU region number 0 + * @arg MPU_REGION_NUM1: MPU region number 1 + * @arg MPU_REGION_NUM2: MPU region number 2 + * @arg MPU_REGION_NUM3: MPU region number 3 + * @arg MPU_REGION_NUM4: MPU region number 4 + * @arg MPU_REGION_NUM5: MPU region number 5 + * @arg MPU_REGION_NUM6: MPU region number 6 + * @arg MPU_REGION_NUM7: MPU region number 7 + * @arg MPU_REGION_NUM8: MPU region number 8 + * @arg MPU_REGION_NUM9: MPU region number 9 + * @arg MPU_REGION_NUM10: MPU region number 10 + * @arg MPU_REGION_NUM11: MPU region number 11 + * @arg MPU_REGION_NUM12: MPU region number 12 + * @arg MPU_REGION_NUM13: MPU region number 13 + * @arg MPU_REGION_NUM14: MPU region number 14 + * @arg MPU_REGION_NUM15: MPU region number 15 + * @param [in] u32Size The size of the region. + * This parameter can be one of the following values: + * @arg MPU_REGION_SIZE_32BYTE: 32 Byte + * @arg MPU_REGION_SIZE_64BYTE: 64 Byte + * @arg MPU_REGION_SIZE_128BYTE: 126 Byte + * @arg MPU_REGION_SIZE_256BYTE: 256 Byte + * @arg MPU_REGION_SIZE_512BYTE: 512 Byte + * @arg MPU_REGION_SIZE_1KBYTE: 1K Byte + * @arg MPU_REGION_SIZE_2KBYTE: 2K Byte + * @arg MPU_REGION_SIZE_4KBYTE: 4K Byte + * @arg MPU_REGION_SIZE_8KBYTE: 8K Byte + * @arg MPU_REGION_SIZE_16KBYTE: 16K Byte + * @arg MPU_REGION_SIZE_32KBYTE: 32K Byte + * @arg MPU_REGION_SIZE_64KBYTE: 64K Byte + * @arg MPU_REGION_SIZE_128KBYTE: 128K Byte + * @arg MPU_REGION_SIZE_256KBYTE: 256K Byte + * @arg MPU_REGION_SIZE_512KBYTE: 512K Byte + * @arg MPU_REGION_SIZE_1MBYTE: 1M Byte + * @arg MPU_REGION_SIZE_2MBYTE: 2M Byte + * @arg MPU_REGION_SIZE_4MBYTE: 4M Byte + * @arg MPU_REGION_SIZE_8MBYTE: 8M Byte + * @arg MPU_REGION_SIZE_16MBYTE: 16M Byte + * @arg MPU_REGION_SIZE_32MBYTE: 32M Byte + * @arg MPU_REGION_SIZE_64MBYTE: 64M Byte + * @arg MPU_REGION_SIZE_128MBYTE: 128M Byte + * @arg MPU_REGION_SIZE_256MBYTE: 256M Byte + * @arg MPU_REGION_SIZE_512MBYTE: 512M Byte + * @arg MPU_REGION_SIZE_1GBYTE: 1G Byte + * @arg MPU_REGION_SIZE_2GBYTE: 2G Byte + * @arg MPU_REGION_SIZE_4GBYTE: 4G Byte + * @retval None + */ +void MPU_SetRegionSize(uint32_t u32Num, uint32_t u32Size) +{ + __IO uint32_t *RGD; + + /* Check parameters */ + DDL_ASSERT(IS_MPU_UNLOCK()); + DDL_ASSERT(IS_MPU_REGION(u32Num)); + DDL_ASSERT(IS_MPU_REGION_SIZE(u32Size)); + + RGD = (__IO uint32_t *)MPU_RGD(u32Num); + MODIFY_REG32(*RGD, MPU_RGD_MPURGSIZE, u32Size); +} + +/** + * @brief Enable or disable the write protection of the unit for the region. + * @note 'MPU_REGION_NUM8' to 'MPU_REGION_NUM15' are only valid when the MPU unit is 'MPU_UNIT_DMA1' or 'MPU_UNIT_DMA2'. + * @param [in] u32Num The number of the regsion. + * This parameter can be one of the following values: + * @arg MPU_REGION_NUM0: MPU region number 0 + * @arg MPU_REGION_NUM1: MPU region number 1 + * @arg MPU_REGION_NUM2: MPU region number 2 + * @arg MPU_REGION_NUM3: MPU region number 3 + * @arg MPU_REGION_NUM4: MPU region number 4 + * @arg MPU_REGION_NUM5: MPU region number 5 + * @arg MPU_REGION_NUM6: MPU region number 6 + * @arg MPU_REGION_NUM7: MPU region number 7 + * @arg MPU_REGION_NUM8: MPU region number 8 + * @arg MPU_REGION_NUM9: MPU region number 9 + * @arg MPU_REGION_NUM10: MPU region number 10 + * @arg MPU_REGION_NUM11: MPU region number 11 + * @arg MPU_REGION_NUM12: MPU region number 12 + * @arg MPU_REGION_NUM13: MPU region number 13 + * @arg MPU_REGION_NUM14: MPU region number 14 + * @arg MPU_REGION_NUM15: MPU region number 15 + * @param [in] u32Unit The type of MPU unit. + * This parameter can be one or any combination of the following values: + * @arg MPU_UNIT_DMA1: System DMA_1 MPU + * @arg MPU_UNIT_DMA2: System DMA_2 MPU + * @arg MPU_UNIT_USBFS_DMA: USBFS_DMA MPU + * @arg MPU_UNIT_USBHS_DMA: USBHS_DMA MPU + * @arg MPU_UNIT_ETH_DMA: ETH_DMA MPU + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void MPU_RegionWriteProtectCmd(uint32_t u32Num, uint32_t u32Unit, en_functional_state_t enNewState) +{ + __IO uint32_t *RGWP; + uint32_t u32UnitPos = 0UL; + uint32_t u32Temp; + + /* Check parameters */ + DDL_ASSERT(IS_MPU_UNLOCK()); + DDL_ASSERT(IS_MPU_REGION(u32Num)); + DDL_ASSERT(IS_MPU_UNIT(u32Unit)); + DDL_ASSERT(IS_MPU_UNIT_REGION(u32Unit, u32Num)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32Temp = u32Unit; + while (0UL != u32Temp) + { + if (0UL != (u32Temp & 0x1UL)) + { + /* Configure the write permission for the region */ + RGWP = (__IO uint32_t *)MPU_RGWP(u32UnitPos); + if (Disable != enNewState) + { + SET_REG32_BIT(*RGWP, (0x1UL << u32Num)); + } + else + { + CLEAR_REG32_BIT(*RGWP, (0x1UL << u32Num)); + } + } + u32Temp >>= 1UL; + u32UnitPos += 0x10U; + } +} + +/** + * @brief Enable or disable the read protection of the unit for the region. + * @note 'MPU_REGION_NUM8' to 'MPU_REGION_NUM15' are only valid when the MPU unit is 'MPU_UNIT_DMA1' or 'MPU_UNIT_DMA2'. + * @param [in] u32Num The number of the regsion. + * This parameter can be one of the following values: + * @arg MPU_REGION_NUM0: MPU region number 0 + * @arg MPU_REGION_NUM1: MPU region number 1 + * @arg MPU_REGION_NUM2: MPU region number 2 + * @arg MPU_REGION_NUM3: MPU region number 3 + * @arg MPU_REGION_NUM4: MPU region number 4 + * @arg MPU_REGION_NUM5: MPU region number 5 + * @arg MPU_REGION_NUM6: MPU region number 6 + * @arg MPU_REGION_NUM7: MPU region number 7 + * @arg MPU_REGION_NUM8: MPU region number 8 + * @arg MPU_REGION_NUM9: MPU region number 9 + * @arg MPU_REGION_NUM10: MPU region number 10 + * @arg MPU_REGION_NUM11: MPU region number 11 + * @arg MPU_REGION_NUM12: MPU region number 12 + * @arg MPU_REGION_NUM13: MPU region number 13 + * @arg MPU_REGION_NUM14: MPU region number 14 + * @arg MPU_REGION_NUM15: MPU region number 15 + * @param [in] u32Unit The type of MPU unit. + * This parameter can be one or any combination of the following values: + * @arg MPU_UNIT_DMA1: System DMA_1 MPU + * @arg MPU_UNIT_DMA2: System DMA_2 MPU + * @arg MPU_UNIT_USBFS_DMA: USBFS_DMA MPU + * @arg MPU_UNIT_USBHS_DMA: USBHS_DMA MPU + * @arg MPU_UNIT_ETH_DMA: ETH_DMA MPU + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void MPU_RegionReadProtectCmd(uint32_t u32Num, uint32_t u32Unit, en_functional_state_t enNewState) +{ + __IO uint32_t *RGRP; + uint32_t u32UnitPos = 0UL; + uint32_t u32Temp; + + /* Check parameters */ + DDL_ASSERT(IS_MPU_UNLOCK()); + DDL_ASSERT(IS_MPU_REGION(u32Num)); + DDL_ASSERT(IS_MPU_UNIT(u32Unit)); + DDL_ASSERT(IS_MPU_UNIT_REGION(u32Unit, u32Num)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32Temp = u32Unit; + while (0UL != u32Temp) + { + if (0UL != (u32Temp & 0x1UL)) + { + /* Configure the read permission for the region */ + RGRP = (__IO uint32_t *)MPU_RGRP(u32UnitPos); + if (Disable != enNewState) + { + SET_REG32_BIT(*RGRP, (0x1UL << u32Num)); + } + else + { + CLEAR_REG32_BIT(*RGRP, (0x1UL << u32Num)); + } + } + u32Temp >>= 1UL; + u32UnitPos += 0x10U; + } +} + +/** + * @brief Enable or disable the access control of the unit for the region. + * @note 'MPU_REGION_NUM8' to 'MPU_REGION_NUM15' are only valid when the MPU unit is 'MPU_UNIT_DMA1' or 'MPU_UNIT_DMA2'. + * @param [in] u32Num The number of the regsion. + * This parameter can be one of the following values: + * @arg MPU_REGION_NUM0: MPU region number 0 + * @arg MPU_REGION_NUM1: MPU region number 1 + * @arg MPU_REGION_NUM2: MPU region number 2 + * @arg MPU_REGION_NUM3: MPU region number 3 + * @arg MPU_REGION_NUM4: MPU region number 4 + * @arg MPU_REGION_NUM5: MPU region number 5 + * @arg MPU_REGION_NUM6: MPU region number 6 + * @arg MPU_REGION_NUM7: MPU region number 7 + * @arg MPU_REGION_NUM8: MPU region number 8 + * @arg MPU_REGION_NUM9: MPU region number 9 + * @arg MPU_REGION_NUM10: MPU region number 10 + * @arg MPU_REGION_NUM11: MPU region number 11 + * @arg MPU_REGION_NUM12: MPU region number 12 + * @arg MPU_REGION_NUM13: MPU region number 13 + * @arg MPU_REGION_NUM14: MPU region number 14 + * @arg MPU_REGION_NUM15: MPU region number 15 + * @param [in] u32Unit The type of MPU unit. + * This parameter can be one or any combination of the following values: + * @arg MPU_UNIT_DMA1: System DMA_1 MPU + * @arg MPU_UNIT_DMA2: System DMA_2 MPU + * @arg MPU_UNIT_USBFS_DMA: USBFS_DMA MPU + * @arg MPU_UNIT_USBHS_DMA: USBHS_DMA MPU + * @arg MPU_UNIT_ETH_DMA: ETH_DMA MPU + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void MPU_RegionCmd(uint32_t u32Num, uint32_t u32Unit, en_functional_state_t enNewState) +{ + __IO uint32_t *RGE; + uint32_t u32UnitPos = 0UL; + uint32_t u32Temp; + + /* Check parameters */ + DDL_ASSERT(IS_MPU_UNLOCK()); + DDL_ASSERT(IS_MPU_REGION(u32Num)); + DDL_ASSERT(IS_MPU_UNIT(u32Unit)); + DDL_ASSERT(IS_MPU_UNIT_REGION(u32Unit, u32Num)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32Temp = u32Unit; + while (0UL != u32Temp) + { + if (0UL != (u32Temp & 0x1UL)) + { + RGE = (__IO uint32_t *)MPU_RGE(u32UnitPos); + if (Disable != enNewState) + { + SET_REG32_BIT(*RGE, (0x1UL << u32Num)); + } + else + { + CLEAR_REG32_BIT(*RGE, (0x1UL << u32Num)); + } + } + u32Temp >>= 1UL; + u32UnitPos += 0x10U; + } +} + +/** + * @brief Set the type of exception to access the protected IP. + * @param [in] u32ExceptionType Exception type of MPU IP. + * This parameter can be one of the following values: + * @arg MPU_IP_EXP_TYPE_NONE: Access to the protected IP will be ignored + * @arg MPU_IP_EXP_TYPE_BUS_ERR: Access to the protected IP will trigger a bus error + * @retval None + */ +void MPU_IP_SetExceptionType(uint32_t u32ExceptionType) +{ + /* Check parameters */ + DDL_ASSERT(IS_MPU_UNLOCK()); + DDL_ASSERT(IS_MPU_IP_EXP_TYPE(u32ExceptionType)); + + WRITE_REG32(bM4_MPU->IPPR_b.BUSERRE, (u32ExceptionType >> MPU_IPPR_BUSERRE_POS)); +} + +/** + * @brief Enable or disable write protection for the IP. + * @param [in] u32Peripheral The peripheral of the chip. + * This parameter can be one or any combination of the following values: + * @arg MPU_IP_AES: AES module + * @arg MPU_IP_HASH: HASH module + * @arg MPU_IP_TRNG: TRNG module + * @arg MPU_IP_CRC: CRC module + * @arg MPU_IP_FMC: FMC module + * @arg MPU_IP_WDT: WDT module + * @arg MPU_IP_SWDT: SWDT module + * @arg MPU_IP_BKSRAM: BKSRAM module + * @arg MPU_IP_RTC: RTC module + * @arg MPU_IP_DMPU: DMPU module + * @arg MPU_IP_SRAMC: SRAMC module + * @arg MPU_IP_INTC: INTC module + * @arg MPU_IP_SYSC: SYSC module + * @arg MPU_IP_MSTP: MSTP module + * @arg MPU_IP_ALL: All of the above + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void MPU_IP_WriteProtectCmd(uint32_t u32Peripheral, en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_MPU_UNLOCK()); + DDL_ASSERT(IS_MPU_IP_TYPE(u32Peripheral)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Disable != enNewState) + { + SET_REG32_BIT(M4_MPU->IPPR, (u32Peripheral << 1U)); + } + else + { + CLEAR_REG32_BIT(M4_MPU->IPPR, (u32Peripheral << 1U)); + } +} + +/** + * @brief Enable or disable read protection for the IP. + * @param [in] u32Peripheral The peripheral of the chip. + * This parameter can be one or any combination of the following values: + * @arg MPU_IP_AES: AES module + * @arg MPU_IP_HASH: HASH module + * @arg MPU_IP_TRNG: TRNG module + * @arg MPU_IP_CRC: CRC module + * @arg MPU_IP_FMC: FMC module + * @arg MPU_IP_WDT: WDT module + * @arg MPU_IP_SWDT: SWDT module + * @arg MPU_IP_BKSRAM: BKSRAM module + * @arg MPU_IP_RTC: RTC module + * @arg MPU_IP_DMPU: DMPU module + * @arg MPU_IP_SRAMC: SRAMC module + * @arg MPU_IP_INTC: INTC module + * @arg MPU_IP_SYSC: SYSC module + * @arg MPU_IP_MSTP: MSTP module + * @arg MPU_IP_ALL: All of the above + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void MPU_IP_ReadProtectCmd(uint32_t u32Peripheral, en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_MPU_UNLOCK()); + DDL_ASSERT(IS_MPU_IP_TYPE(u32Peripheral)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Disable != enNewState) + { + SET_REG32_BIT(M4_MPU->IPPR, u32Peripheral); + } + else + { + CLEAR_REG32_BIT(M4_MPU->IPPR, u32Peripheral); + } +} + +/** + * @} + */ + +#endif /* DDL_MPU_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_nfc.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_nfc.c new file mode 100644 index 0000000000..1047f7e99d --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_nfc.c @@ -0,0 +1,1978 @@ +/** + ******************************************************************************* + * @file hc32f4a0_nfc.c + * @brief This file provides firmware functions to manage the EXMC NFC + * (External Memory Controller: NAND Flash Controller) driver library. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Hongjh First version + 2020-07-14 Hongjh 1. Merge API from EXMC_NFC_Enable/Disable to EXMC_NFC_Cmd + 2. Merge API from EXMC_NFC_Enable/DisableEcc + to EXMC_NFC_EccCmd + 3. Merge API from EXMC_NFC_Enable/DisableWriteProtect + to EXMC_NFC_WriteProtectCmd + 2020-08-25 Hongjh Modify the pointer type cast + 2020-10-12 Hongjh The function EXMC_NFC_ReadId add timeout + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_nfc.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_EXMC_NFC EXMC_NFC + * @brief NAND Flash Controller Driver Library + * @{ + */ + +#if (DDL_NFC_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup EXMC_NFC_Local_Macros NAND Flash Controller Local Macros + * @{ + */ + +/** + * @defgroup EXMC_SMC_Check_Parameters_Validity EXMC SMC Check Parameters Validity + * @{ + */ + +#define IS_EXMC_NFC_BANK(x) \ +( (EXMC_NFC_BANK_0 == (x)) || \ + (EXMC_NFC_BANK_1 == (x)) || \ + (EXMC_NFC_BANK_2 == (x)) || \ + (EXMC_NFC_BANK_3 == (x)) || \ + (EXMC_NFC_BANK_4 == (x)) || \ + (EXMC_NFC_BANK_5 == (x)) || \ + (EXMC_NFC_BANK_6 == (x)) || \ + (EXMC_NFC_BANK_7 == (x))) + +#define IS_EXMC_NFC_MEM_WIDTH(x) \ +( (EXMC_NFC_MEMORY_WIDTH_8BIT == (x)) || \ + (EXMC_NFC_MEMORY_WIDTH_16BIT == (x))) + +#define IS_EXMC_NFC_BANK_CAPACITY(x) \ +( (EXMC_NFC_BANK_CAPACITY_512MBIT == (x)) || \ + (EXMC_NFC_BANK_CAPACITY_1GBIT == (x)) || \ + (EXMC_NFC_BANK_CAPACITY_2GBIT == (x)) || \ + (EXMC_NFC_BANK_CAPACITY_4GBIT == (x)) || \ + (EXMC_NFC_BANK_CAPACITY_8GBIT == (x)) || \ + (EXMC_NFC_BANK_CAPACITY_16GBIT == (x)) || \ + (EXMC_NFC_BANK_CAPACITY_32GBIT == (x)) || \ + (EXMC_NFC_BANK_CAPACITY_64GBIT == (x))) + +#define IS_EXMC_NFC_PAGE_SIZE(x) \ +( (EXMC_NFC_PAGE_SIZE_2KBYTES == (x)) || \ + (EXMC_NFC_PAGE_SIZE_4KBYTES == (x)) || \ + (EXMC_NFC_PAGE_SIZE_8KBYTES == (x))) + +#define IS_EXMC_NFC_BANK_NUM(x) \ +( (EXMC_NFC_1_BANK == (x)) || \ + (EXMC_NFC_2_BANKS == (x)) || \ + (EXMC_NFC_4_BANKS == (x)) || \ + (EXMC_NFC_8_BANKS == (x))) + +#define IS_EXMC_NFC_WR_PROTECT(x) \ +( (EXMC_NFC_WR_PROTECT_ENABLE == (x)) || \ + (EXMC_NFC_WR_PROTECT_DISABLE == (x))) + +#define IS_EXMC_NFC_ECC_MODE(x) \ +( (EXMC_NFC_ECC_1BIT == (x)) || \ + (EXMC_NFC_ECC_4BITS == (x))) + +#define IS_EXMC_NFC_ROW_ADDRESS_CYCLES(x) \ +( (EXMC_NFC_2_ROW_ADDRESS_CYCLES == (x)) || \ + (EXMC_NFC_3_ROW_ADDRESS_CYCLES == (x))) + +#define IS_EXMC_NFC_SECTION(x) ((x) <= EXMC_NFC_ECC_SECTION15) + +#define IS_EXMC_NFC_INT(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & (~EXMC_NFC_INT_MASK)))) + + +#define IS_EXMC_NFC_FLAG(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & (~EXMC_NFC_FLAG_MASK)))) + +#define IS_EXMC_NFC_COLUMN(x) ((x) <= NFC_COLUMN_MAX) + +#define IS_EXMC_NFC_PAGE(page, capacity_index) ((page) <= NFC_PAGE_MAX((capacity_index))) + +#define IS_EXMC_NFC_TIMING_TS(x) ((x) <= 0xFFUL) + +#define IS_EXMC_NFC_TIMING_TWP(x) ((x) <= 0xFFUL) + +#define IS_EXMC_NFC_TIMING_TRP(x) ((x) <= 0xFFUL) + +#define IS_EXMC_NFC_TIMING_TH(x) ((x) <= 0xFFUL) + +#define IS_EXMC_NFC_TIMING_TWH(x) ((x) <= 0xFFUL) + +#define IS_EXMC_NFC_TIMING_TRH(x) ((x) <= 0xFFUL) + +#define IS_EXMC_NFC_TIMING_TRR(x) ((x) <= 0xFFUL) + +#define IS_EXMC_NFC_TIMING_TWB(x) ((x) <= 0xFFUL) + +#define IS_EXMC_NFC_TIMING_TCCS(x) ((x) <= 0xFFUL) + +#define IS_EXMC_NFC_TIMING_TWTR(x) ((x) <= 0xFFUL) + +#define IS_EXMC_NFC_TIMING_TRTW(x) ((x) <= 0xFFUL) + +#define IS_EXMC_NFC_TIMING_TADL(x) ((x) <= 0xFFUL) +/** + * @} + */ + +/** + * @defgroup NFC flag mask + * @{ + */ +#define EXMC_NFC_INT_MASK \ +( EXMC_NFC_INT_RB_BANK0 | \ + EXMC_NFC_INT_RB_BANK1 | \ + EXMC_NFC_INT_RB_BANK2 | \ + EXMC_NFC_INT_RB_BANK3 | \ + EXMC_NFC_INT_RB_BANK4 | \ + EXMC_NFC_INT_RB_BANK5 | \ + EXMC_NFC_INT_RB_BANK6 | \ + EXMC_NFC_INT_RB_BANK7 | \ + EXMC_NFC_INT_ECC_ERROR | \ + EXMC_NFC_INT_ECC_CALC_COMPLETION | \ + EXMC_NFC_INT_ECC_CORRECTABLE_ERROR | \ + EXMC_NFC_INT_ECC_UNCORRECTABLE_ERROR) +/** + * @} + */ + +/** + * @defgroup NFC flag mask + * @{ + */ +#define EXMC_NFC_FLAG_MASK \ +( EXMC_NFC_FLAG_RB_BANK0 | \ + EXMC_NFC_FLAG_RB_BANK1 | \ + EXMC_NFC_FLAG_RB_BANK2 | \ + EXMC_NFC_FLAG_RB_BANK3 | \ + EXMC_NFC_FLAG_RB_BANK4 | \ + EXMC_NFC_FLAG_RB_BANK5 | \ + EXMC_NFC_FLAG_RB_BANK6 | \ + EXMC_NFC_FLAG_RB_BANK7 | \ + EXMC_NFC_FLAG_ECC_ERROR | \ + EXMC_NFC_FLAG_ECC_CALCULATING | \ + EXMC_NFC_FLAG_ECC_CALC_COMPLETION | \ + EXMC_NFC_FLAG_ECC_CORRECTABLE_ERROR | \ + EXMC_NFC_FLAG_ECC_UNCORRECTABLE_ERROR) +/** + * @} + */ + +/** + * @defgroup NFC_Memory_Capacity_Index NFC Memory Capacity Index + * @{ + */ +#define NFC_CAPACITY_INDEX_512MBIT (0UL) +#define NFC_CAPACITY_INDEX_1GBIT (1UL) +#define NFC_CAPACITY_INDEX_2GBIT (2UL) +#define NFC_CAPACITY_INDEX_4GBIT (3UL) +#define NFC_CAPACITY_INDEX_8GBIT (4UL) +#define NFC_CAPACITY_INDEX_16GBIT (5UL) +#define NFC_CAPACITY_INDEX_32GBIT (6UL) +#define NFC_CAPACITY_INDEX_64GBIT (7UL) +/** + * @} + */ + +/** + * @defgroup EXMC_NFC_Command_Regster_Value EXMC NFC Command Regster Value + * @{ + */ +/*!< Command value */ +#define NFC_CMD_VALUE(arg, bank, cmd) ((arg) | ((bank) << 8UL) | (cmd)) + +/*!< Command: Read status */ +#define NFC_ADDR_VALUE(bank, addr) (0x40000000UL | ((bank) << 8UL) | (addr)) + +/*!< Command: Read status */ +#define CMD_RESET(bank) (NFC_CMD_VALUE(0UL, (bank), EXMC_NFC_CMD_RESET)) + +/*!< Command: Read status */ +#define CMD_ASYNC_RESET(bank) (NFC_CMD_VALUE(0x82000000UL, (bank), EXMC_NFC_CMD_ASYNCHRONOUS_RESSET)) + +/*!< Command: Read status */ +#define CMD_RESET_LUN(bank) (NFC_CMD_VALUE(0x82000000UL, (bank), EXMC_NFC_CMD_RESET_LUN)) + +/*!< Command: Read status */ +#define CMD_READ_STATUS(bank) (NFC_CMD_VALUE(0x81000000UL, (bank), EXMC_NFC_CMD_READ_STATUS)) + +/*!< Command: Read status */ +#define CMD_READ_STATUS_ENHANCED(bank) (NFC_CMD_VALUE(0x80000000UL, (bank), EXMC_NFC_CMD_READ_STATUS_ENHANCED)) + +/*!< Command: Read ID */ +#define CMD_READ_ID(bank) (NFC_CMD_VALUE(0x81000000UL, (bank), EXMC_NFC_CMD_READ_ID)) +#define CMD_READ_ID_ADDR(bank, addr) (NFC_ADDR_VALUE((bank), (addr))) + +/*!< Command: Read unique ID */ +#define CMD_READ_UNIQUEID(bank) (NFC_CMD_VALUE(0x83000000UL, (bank), EXMC_NFC_CMD_READ_UNIQUE_ID)) +#define CMD_READ_UNIQUEID_ADDR(bank) (NFC_ADDR_VALUE((bank), 0UL)) + +/*!< Command: Erase block */ +#define CMD_ERASE_BLOCK_1ST_CYCLE(bank) (NFC_CMD_VALUE(0x81000000UL, (bank), EXMC_NFC_CMD_BLK_ERASE_1ST)) +#define CMD_ERASE_BLOCK_2ND_CYCLE(bank) (NFC_CMD_VALUE(0x81000000UL, (bank), EXMC_NFC_CMD_BLK_ERASE_2ND)) + +/*!< Command: Read parameter page */ +#define CMD_READ_PARAMETER_PAGE(bank) (NFC_CMD_VALUE(0x83000000UL, (bank), EXMC_NFC_CMD_READ_PARAMETER_PAGE)) +#define CMD_READ_PARAMETER_PAGE_ADDR(bank) (NFC_ADDR_VALUE((bank), 0UL)) + +/*!< Command: Set feature */ +#define CMD_SET_FEATURE(bank) (NFC_CMD_VALUE(0x83000000UL, (bank), EXMC_NFC_CMD_SET_FEATURES)) +#define CMD_SET_FEATURE_ADDR(bank, addr) (NFC_ADDR_VALUE((bank), (addr))) + +/*!< Command: Get feature */ +#define CMD_GET_FEATURE(bank) (NFC_CMD_VALUE(0x83000000UL, (bank), EXMC_NFC_CMD_GET_FEATURES)) +#define CMD_GET_FEATURE_ADDR(bank, addr) (NFC_ADDR_VALUE((bank), (addr))) + +/*!< Command: Address cycle */ +#define CMD_ADDR_1ST_CYCLE(bank, ras) (NFC_ADDR_VALUE((bank), ((ras) & 0xFFUL))) +#define CMD_ADDR_2ND_CYCLE(bank, ras) (NFC_ADDR_VALUE((bank), (((ras) & 0xFF00UL) >> 8UL))) +#define CMD_ADDR_3RD_CYCLE(bank, ras) (NFC_ADDR_VALUE((bank), (((ras) & 0xFF0000UL) >> 16UL))) + +/** + * @} + */ + +/** + * @defgroup EXMC_NFC_IDXR_Bit_Position EXMC NFC IDXR Bit Position + * @{ + */ +#define EXMC_NFC_IDXR_COL_POS (0UL) +#define EXMC_NFC_IDXR_2KPAGE_POS (12UL) +#define EXMC_NFC_IDXR_512MBIT_BANK_POS (27UL) +/** + * @} + */ + +/*!< NFC BACR regsiter: page field value */ +#define NFC_BACR_PAGE_VAL ((READ_REG32_BIT(M4_NFC->BACR, NFC_BACR_PAGE) >> NFC_BACR_PAGE_POS)) + +/*!< NFC Page Size */ +#define NFC_PAGE_SIZE (1024UL << (NFC_BACR_PAGE_VAL & 0x3UL)) + +/*!< NFC Spare Size for user data */ +#define NFC_SPARE_SIZE_FOR_USER_DATA ((READ_REG32_BIT(M4_NFC->BACR, NFC_BACR_SCS) >> NFC_BACR_SCS_POS) << 2UL) + +/*!< IDX register mask for 64bit */ +#define NFC_IDXR_MASK (0x1FFFFFFFFFULL) + +/*!< NFC_ISTR register RBST bit mask */ +#define NFC_FLAG_RB_BANKx_MASK(bank) (EXMC_NFC_FLAG_RB_BANK0 << (EXMC_NFC_BANK_7 & (bank))) + +/*!< IDX register mask for 64bit */ +#define NFC_NFC_ISTR_MASK (0xFF53UL) + +/*!< NFC_DATR for 32bit */ +#define NFC_DATR_REG32(x) (M4_NFC->DATR_BASE) + +/*!< NFC_ID_DATR for 32bit */ +#define NFC_ID_REG32(x) (*((__IO uint32_t *)((uint32_t)(&(M4_NFC->DATR_BASE)) + 0x8010UL + ((x) << 2UL)))) + +/*!< NFC_SYND_REG for 32bit */ +#define NFC_SYND_REG32(sect, reg) (*((__IO uint32_t *)((uint32_t)(&(M4_NFC->ECC_SYND0_0)) + (((uint32_t)(sect)) << 4UL) + (((uint32_t)(reg)) << 2UL)))) + +/*!< NFC_ECCR_REG for 32bit */ +#define NFC_ECCR_REG32(sect) (*((__IO uint32_t *)((uint32_t)(&(M4_NFC->ECCR0)) + (((uint32_t)(sect)) << 2UL)))) + +/*!< NFC_SYND_MAX_Length (Unit: half-word ) */ +#define NFC_SYND_MAX_LEN (8U) + +/** + * @defgroup Parameter_Align Parameter Align + * @{ + */ +#define IS_PARAM_ALIGN_WORD(x) (IS_ADDRESS_ALIGN_WORD((x))) +/** + * @} + */ + +/*!< NFC column max */ +#define NFC_COLUMN_MAX ((1UL << (12UL + ((0x03UL & NFC_BACR_PAGE_VAL) - 1UL))) - 1UL) + +/*!< NFC page max for the specified capacity */ +#define NFC_PAGE_MAX(capacity_index) ((1UL << (14UL + capacity_index - ((0x03UL & NFC_BACR_PAGE_VAL) - 1UL))) - 1UL) + +/** + * @brief Calculate NFC_IDXR register(64bits) value. + * @param [in]bank The specified bank + * @arg EXMC_NFC_BANK_0: NFC device bank 0 + * @arg EXMC_NFC_BANK_1: NFC device bank 1 + * @arg EXMC_NFC_BANK_2: NFC device bank 2 + * @arg EXMC_NFC_BANK_3: NFC device bank 3 + * @arg EXMC_NFC_BANK_4: NFC device bank 4 + * @arg EXMC_NFC_BANK_5: NFC device bank 5 + * @arg EXMC_NFC_BANK_6: NFC device bank 6 + * @arg EXMC_NFC_BANK_7: NFC device bank 7 + * @param [in]page The page address + * @param [in]col The column address + * @param [in]capacity_index The number of bank capacity bits + * @arg NFC_CAPACITY_INDEX_512MBIT: NFC device bank size:512M bits + * @arg NFC_CAPACITY_INDEX_1GBIT: NFC device bank size:1G bits + * @arg NFC_CAPACITY_INDEX_2GBIT: NFC device bank size:2G bits + * @arg NFC_CAPACITY_INDEX_4GBIT: NFC device bank size:4G bits + * @arg NFC_CAPACITY_INDEX_8GBIT: NFC device bank size:8G bits + * @arg NFC_CAPACITY_INDEX_16GBIT: NFC device bank size:16G bits + * @arg NFC_CAPACITY_INDEX_32BIT: NFC device bank size:32G bits + * @arg NFC_CAPACITY_INDEX_64BIT: NFC device bank size:64G bits + * @retval NFC Index value + */ +#define NFC_IDXR_VAL(bank, page, col, capacity_index) \ +( (((uint64_t)(col)) << EXMC_NFC_IDXR_COL_POS) | \ + (((uint64_t)(page)) << (EXMC_NFC_IDXR_2KPAGE_POS + ((0x03UL & NFC_BACR_PAGE_VAL) - 1UL))) | \ + (((uint64_t)(bank)) << (EXMC_NFC_IDXR_512MBIT_BANK_POS + (0x07UL & (capacity_index))))) +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/** + * @addtogroup EXMC_NFC_Local_Functions + * @{ + */ + +static en_result_t EXMC_NFC_Read(uint32_t u32Bank, + uint32_t u32Page, + uint32_t u32Col, + uint32_t au32Data[], + uint32_t u32NumWords, + en_functional_state_t enEccState, + uint32_t u32Timeout); +static en_result_t EXMC_NFC_Write(uint32_t u32Bank, + uint32_t u32Page, + uint32_t u32Col, + const uint32_t au32Data[], + uint32_t u32NumWords, + en_functional_state_t enEccState, + uint32_t u32Timeout); +static uint32_t EXMC_NFC_GetCapacityIndex(void); +static en_result_t EXMC_NFC_WaitFlagUntilTo(uint32_t u32Flag, + en_flag_status_t enStatus, + uint32_t u32Timeout); + +/** + * @} + */ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup EXMC_NFC_Global_Functions NAND Flash Controller Global Functions + * @{ + */ + +/** + * @brief Initialize EXMC NFC function. + * @param [in] pstcInit Pointer to a @ref stc_exmc_nfc_init_t structure (EXMC NFC function configuration structure). + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: pstcInit = NULL + */ +en_result_t EXMC_NFC_Init(const stc_exmc_nfc_init_t *pstcInit) +{ + uint32_t u32RegVal; + en_result_t enRet = ErrorInvalidParameter; + + /* Check the pointer pstcInit */ + if (NULL != pstcInit) + { + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_BANK_CAPACITY(pstcInit->stcBaseCfg.u32CapacitySize)); + DDL_ASSERT(IS_EXMC_NFC_MEM_WIDTH(pstcInit->stcBaseCfg.u32MemWidth)); + DDL_ASSERT(IS_EXMC_NFC_BANK_NUM(pstcInit->stcBaseCfg.u32BankNum)); + DDL_ASSERT(IS_EXMC_NFC_PAGE_SIZE(pstcInit->stcBaseCfg.u32PageSize)); + DDL_ASSERT(IS_EXMC_NFC_WR_PROTECT(pstcInit->stcBaseCfg.u32WrProtect)); + DDL_ASSERT(IS_EXMC_NFC_ECC_MODE(pstcInit->stcBaseCfg.u32EccMode)); + DDL_ASSERT(IS_EXMC_NFC_ROW_ADDRESS_CYCLES(pstcInit->stcBaseCfg.u32RowAddrCycle)); + + DDL_ASSERT(IS_EXMC_NFC_TIMING_TS(pstcInit->stcTimingReg0.u32TS)); + DDL_ASSERT(IS_EXMC_NFC_TIMING_TWP(pstcInit->stcTimingReg0.u32TWP)); + DDL_ASSERT(IS_EXMC_NFC_TIMING_TRP(pstcInit->stcTimingReg0.u32TRP)); + DDL_ASSERT(IS_EXMC_NFC_TIMING_TH(pstcInit->stcTimingReg0.u32TH)); + + DDL_ASSERT(IS_EXMC_NFC_TIMING_TWH(pstcInit->stcTimingReg1.u32TWH)); + DDL_ASSERT(IS_EXMC_NFC_TIMING_TRH(pstcInit->stcTimingReg1.u32TRH)); + DDL_ASSERT(IS_EXMC_NFC_TIMING_TRR(pstcInit->stcTimingReg1.u32TRR)); + DDL_ASSERT(IS_EXMC_NFC_TIMING_TWB(pstcInit->stcTimingReg1.u32TWB)); + + DDL_ASSERT(IS_EXMC_NFC_TIMING_TCCS(pstcInit->stcTimingReg2.u32TCCS)); + DDL_ASSERT(IS_EXMC_NFC_TIMING_TWTR(pstcInit->stcTimingReg2.u32TWTR)); + DDL_ASSERT(IS_EXMC_NFC_TIMING_TRTW(pstcInit->stcTimingReg2.u32TRTW)); + DDL_ASSERT(IS_EXMC_NFC_TIMING_TADL(pstcInit->stcTimingReg2.u32TADL)); + + /* Set NFC open-page.*/ + WRITE_REG32(M4_PERIC->NFC_SYCTLREG, pstcInit->u32OpenPage); + + /* Disable hardware ECC.*/ + WRITE_REG32(M4_NFC->IENR, 0x00000080UL); + + /* Clear flag.*/ + WRITE_REG32(M4_NFC->ISTR, 0x00000000UL); + + /* Set NFC base configure.*/ + u32RegVal = (pstcInit->stcBaseCfg.u32CapacitySize | \ + pstcInit->stcBaseCfg.u32MemWidth | \ + pstcInit->stcBaseCfg.u32BankNum | \ + pstcInit->stcBaseCfg.u32PageSize | \ + pstcInit->stcBaseCfg.u32WrProtect | \ + pstcInit->stcBaseCfg.u32EccMode | \ + pstcInit->stcBaseCfg.u32RowAddrCycle | \ + (((uint32_t)pstcInit->stcBaseCfg.u8SpareSizeForUserData) << NFC_BACR_SCS_POS)); + WRITE_REG32(M4_NFC->BACR, u32RegVal); + + /* Set NFC timing register 0.*/ + u32RegVal = ((pstcInit->stcTimingReg0.u32TS << NFC_TMCR0_TS_POS) | \ + (pstcInit->stcTimingReg0.u32TWP << NFC_TMCR0_TWP_POS) | \ + (pstcInit->stcTimingReg0.u32TRP << NFC_TMCR0_TRP_POS) | \ + (pstcInit->stcTimingReg0.u32TH << NFC_TMCR0_TH_POS)); + WRITE_REG32(M4_NFC->TMCR0, u32RegVal); + + /* Set NFC timing register 1.*/ + u32RegVal = ((pstcInit->stcTimingReg1.u32TWH << NFC_TMCR1_TWH_POS) | \ + (pstcInit->stcTimingReg1.u32TRH << NFC_TMCR1_TRH_POS) | \ + (pstcInit->stcTimingReg1.u32TRR << NFC_TMCR1_TRR_POS) | \ + (pstcInit->stcTimingReg1.u32TWB << NFC_TMCR1_TWB_POS)); + WRITE_REG32(M4_NFC->TMCR1, u32RegVal); + + /* Set NFC timing register 2.*/ + u32RegVal = ((pstcInit->stcTimingReg2.u32TCCS << NFC_TMCR2_TCCS_POS) | \ + (pstcInit->stcTimingReg2.u32TWTR << NFC_TMCR2_TWTR_POS) | \ + (pstcInit->stcTimingReg2.u32TRTW << NFC_TMCR2_TRTW_POS) | \ + (pstcInit->stcTimingReg2.u32TADL << NFC_TMCR2_TADL_POS)); + WRITE_REG32(M4_NFC->TMCR2, u32RegVal); + + /* De-select NFC bank */ + WRITE_REG32(M4_NFC->CMDR, EXMC_NFC_CMD_DESELECT_CHIP); + enRet = Ok; + } + + return enRet; +} + +/** + * @brief De-Initialize EXMC NFC function. + * @param None + * @retval None + */ +void EXMC_NFC_DeInit(void) +{ + WRITE_REG32(M4_NFC->BACR, 0x00002187UL); + WRITE_REG32(M4_NFC->IENR, 0x00000080UL); + WRITE_REG32(M4_NFC->ISTR, 0x00000000UL); + WRITE_REG32(M4_NFC->TMCR0, 0x03030202UL); + WRITE_REG32(M4_NFC->TMCR1, 0x28080303UL); + WRITE_REG32(M4_NFC->TMCR2, 0x03050D03UL); +} + +/** + * @brief Set the fields of structure stc_exmc_nfc_init_t to default values + * @param [out] pstcInit Pointer to a @ref stc_exmc_nfc_init_t structure (EXMC NFC function configuration structure) + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: pstcInit = NULL + */ +en_result_t EXMC_NFC_StructInit(stc_exmc_nfc_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (NULL != pstcInit) + { + pstcInit->stcBaseCfg.u32CapacitySize = EXMC_NFC_BANK_CAPACITY_8GBIT; + pstcInit->stcBaseCfg.u32MemWidth = EXMC_NFC_MEMORY_WIDTH_8BIT; + pstcInit->stcBaseCfg.u32BankNum = EXMC_NFC_4_BANKS; + pstcInit->stcBaseCfg.u32PageSize = EXMC_NFC_PAGE_SIZE_2KBYTES; + pstcInit->stcBaseCfg.u32WrProtect = EXMC_NFC_WR_PROTECT_ENABLE; + pstcInit->stcBaseCfg.u32EccMode = EXMC_NFC_ECC_1BIT; + pstcInit->stcBaseCfg.u32RowAddrCycle = EXMC_NFC_3_ROW_ADDRESS_CYCLES; + pstcInit->stcBaseCfg.u8SpareSizeForUserData = 0U; + + pstcInit->stcTimingReg0.u32TS = 0x02UL; + pstcInit->stcTimingReg0.u32TWP = 0x02UL; + pstcInit->stcTimingReg0.u32TRP = 0x03UL; + pstcInit->stcTimingReg0.u32TH = 0x03UL; + + pstcInit->stcTimingReg1.u32TWH = 0x03UL; + pstcInit->stcTimingReg1.u32TRH = 0x03UL; + pstcInit->stcTimingReg1.u32TRR = 0x02UL; + pstcInit->stcTimingReg1.u32TWB = 0x28UL; + + pstcInit->stcTimingReg2.u32TCCS = 0x03UL; + pstcInit->stcTimingReg2.u32TWTR = 0x0DUL; + pstcInit->stcTimingReg2.u32TRTW = 0x05UL; + pstcInit->stcTimingReg2.u32TADL = 0x03UL; + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Enable/disable NFC. + * @param [in] enNewState An en_functional_state_t enumeration value. + * This parameter can be one of the following values: + * @arg Enable: Enable function. + * @arg Disable: Disable function. + * @retval None + */ +void EXMC_NFC_Cmd(en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + WRITE_REG32(bM4_PERIC->EXMC_ENAR_b.NFCEN, enNewState); +} + +/** + * @brief Enable/disable NFC ECC function. + * @param [in] enNewState An en_functional_state_t enumeration value. + * This parameter can be one of the following values: + * @arg Enable: Enable function. + * @arg Disable: Disable function. + * @retval None + */ +void EXMC_NFC_EccCmd(en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + CLEAR_REG32_BIT(M4_NFC->IENR, NFC_IENR_ECCDIS); + } + else + { + SET_REG32_BIT(M4_NFC->IENR, NFC_IENR_ECCDIS); + } +} + +/** + * @brief Enable/disable NFC write protection function. + * @param [in] enNewState An en_functional_state_t enumeration value. + * This parameter can be one of the following values: + * @arg Enable: Enable function. + * @arg Disable: Disable function. + * @retval None + */ +void EXMC_NFC_WriteProtectCmd(en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + CLEAR_REG32_BIT(M4_NFC->BACR, NFC_BACR_WP); + } + else + { + SET_REG32_BIT(M4_NFC->BACR, NFC_BACR_WP); + } +} + +/** + * @brief Enable or disable the specified NFC interrupt + * @param [in] u16IntSource The specified interrupt + * This parameter can be any composed value of the following values: + * @arg EXMC_NFC_INT_ECC_UNCORRECTABLE_ERROR: ECC uncorrectable error interrupt + * @arg EXMC_NFC_INT_ECC_CORRECTABLE_ERROR: ECC correctable error interrupt + * @arg EXMC_NFC_INT_ECC_CALC_COMPLETION: Calculating ECC completely interrupt + * @arg EXMC_NFC_INT_ECC_ERROR: ECC error interrupt + * @arg EXMC_NFC_INT_RB_BANK0: NFC bank 0 device ready interrupt + * @arg EXMC_NFC_INT_RB_BANK1: NFC bank 1 device ready interrupt + * @arg EXMC_NFC_INT_RB_BANK2: NFC bank 2 device ready interrupt + * @arg EXMC_NFC_INT_RB_BANK3: NFC bank 3 device ready interrupt + * @arg EXMC_NFC_INT_RB_BANK4: NFC bank 4 device ready flag + * @arg EXMC_NFC_INT_RB_BANK5: NFC bank 5 device ready interrupt + * @arg EXMC_NFC_INT_RB_BANK6: NFC bank 6 device ready interrupt + * @arg EXMC_NFC_INT_RB_BANK7: NFC bank 7 device ready interrupt + * @param [in] enNewState The function new state + * @arg This parameter can be: Enable or Disable + * @retval None + */ +void EXMC_NFC_IntCmd(uint16_t u16IntSource, en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_EXMC_NFC_INT(u16IntSource)); + + if (Enable == enNewState) + { + SET_REG16_BIT(M4_NFC->IENR, u16IntSource); + } + else + { + CLEAR_REG16_BIT(M4_NFC->IENR, u16IntSource); + } +} + +/** + * @brief Get the flag. + * @param [in] u32Flag The specified flag + * This parameter can be any composed value of the following values: + * @arg EXMC_NFC_FLAG_ECC_UNCORRECTABLE_ERROR: ECC uncorrectable error + * @arg EXMC_NFC_FLAG_ECC_CORRECTABLE_ERROR: ECC correctable error + * @arg EXMC_NFC_FLAG_ECC_CALC_COMPLETION: Calculate ECC completely + * @arg EXMC_NFC_FLAG_ECC_ERROR: ECC error + * @arg EXMC_NFC_FLAG_RB_BANK0: NFC bank 0 device ready flag + * @arg EXMC_NFC_FLAG_RB_BANK1: NFC bank 1 device ready flag + * @arg EXMC_NFC_FLAG_RB_BANK2: NFC bank 2 device ready flag + * @arg EXMC_NFC_FLAG_RB_BANK3: NFC bank 3 device ready flag + * @arg EXMC_NFC_FLAG_RB_BANK4: NFC bank 4 device ready flag + * @arg EXMC_NFC_FLAG_RB_BANK5: NFC bank 5 device ready flag + * @arg EXMC_NFC_FLAG_RB_BANK6: NFC bank 6 device ready flag + * @arg EXMC_NFC_FLAG_RB_BANK7: NFC bank 7 device ready flag + * @arg EXMC_NFC_FLAG_ECC_CALCULATING: Calculating ECC + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t EXMC_NFC_GetStatus(uint32_t u32Flag) +{ + en_flag_status_t enStatus1 = Set; + en_flag_status_t enStatus2 = Set; + + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_FLAG(u32Flag)); + + if ((u32Flag & NFC_NFC_ISTR_MASK) != 0UL) + { + if (0UL == READ_REG32_BIT(M4_NFC->ISTR, (u32Flag & NFC_NFC_ISTR_MASK))) + { + enStatus1 = Reset; + } + } + + if ((u32Flag & EXMC_NFC_FLAG_ECC_CALCULATING) != 0UL) + { + if (0UL == READ_REG32(bM4_PERIC->NFC_SYSTATREG_b.PECC)) + { + enStatus2 = Reset; + } + } + + return (((Set == enStatus1) && (Set == enStatus2)) ? Set : Reset); +} + +/** + * @brief Get the flag. + * @param [in] u32Flag The specified flag + * This parameter can be any composed value of the following values: + * @arg EXMC_NFC_FLAG_ECC_UNCORRECTABLE_ERROR: ECC uncorrectable error + * @arg EXMC_NFC_FLAG_ECC_CORRECTABLE_ERROR: ECC correctable error + * @arg EXMC_NFC_FLAG_ECC_CALC_COMPLETION: Calculating ECC completely + * @arg EXMC_NFC_FLAG_ECC_ERROR: ECC error + * @arg EXMC_NFC_FLAG_RB_BANK0: NFC bank 0 device ready flag + * @arg EXMC_NFC_FLAG_RB_BANK1: NFC bank 1 device ready flag + * @arg EXMC_NFC_FLAG_RB_BANK2: NFC bank 2 device ready flag + * @arg EXMC_NFC_FLAG_RB_BANK3: NFC bank 3 device ready flag + * @arg EXMC_NFC_FLAG_RB_BANK4: NFC bank 4 device ready flag + * @arg EXMC_NFC_FLAG_RB_BANK5: NFC bank 5 device ready flag + * @arg EXMC_NFC_FLAG_RB_BANK6: NFC bank 6 device ready flag + * @arg EXMC_NFC_FLAG_RB_BANK7: NFC bank 7 device ready flag + * @retval None + */ +void EXMC_NFC_ClearStatus(uint32_t u32Flag) +{ + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_FLAG(u32Flag)); + + CLEAR_REG32_BIT(M4_NFC->ISTR, u32Flag); +} + +/** + * @brief Get the interrupt result. + * @param [in] u32Flag The specified flag + * This parameter can be any composed value of the following values: + * @arg EXMC_NFC_FLAG_ECC_UNCORRECTABLE_ERROR: ECC uncorrectable error + * @arg EXMC_NFC_FLAG_ECC_CORRECTABLE_ERROR: ECC correctable error + * @arg EXMC_NFC_FLAG_ECC_CALC_COMPLETION: Calculating ECC completely + * @arg EXMC_NFC_FLAG_ECC_ERROR: ECC error + * @arg EXMC_NFC_FLAG_RB_BANK0: NFC bank 0 device ready flag + * @arg EXMC_NFC_FLAG_RB_BANK1: NFC bank 1 device ready flag + * @arg EXMC_NFC_FLAG_RB_BANK2: NFC bank 2 device ready flag + * @arg EXMC_NFC_FLAG_RB_BANK3: NFC bank 3 device ready flag + * @arg EXMC_NFC_FLAG_RB_BANK4: NFC bank 4 device ready flag + * @arg EXMC_NFC_FLAG_RB_BANK5: NFC bank 5 device ready flag + * @arg EXMC_NFC_FLAG_RB_BANK6: NFC bank 6 device ready flag + * @arg EXMC_NFC_FLAG_RB_BANK7: NFC bank 7 device ready flag + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t EXMC_NFC_GetIntResultStatus(uint32_t u32Flag) +{ + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_FLAG(u32Flag)); + + return (READ_REG32_BIT(M4_NFC->IRSR, u32Flag) ? Set : Reset); +} + +/** + * @brief Get the 1BIT ECC result of the specified section. + * @param [in] u32Section The specified section + * This parameter can be one of the following values: + * @arg EXMC_NFC_ECC_SECTION0: ECC section 0 + * @arg EXMC_NFC_ECC_SECTION1: ECC section 1 + * @arg EXMC_NFC_ECC_SECTION2: ECC section 2 + * @arg EXMC_NFC_ECC_SECTION3: ECC section 3 + * @arg EXMC_NFC_ECC_SECTION4: ECC section 4 + * @arg EXMC_NFC_ECC_SECTION5: ECC section 5 + * @arg EXMC_NFC_ECC_SECTION6: ECC section 6 + * @arg EXMC_NFC_ECC_SECTION7: ECC section 7 + * @arg EXMC_NFC_ECC_SECTION8: ECC section 8 + * @arg EXMC_NFC_ECC_SECTION9: ECC section 9 + * @arg EXMC_NFC_ECC_SECTION10: ECC section 10 + * @arg EXMC_NFC_ECC_SECTION11: ECC section 11 + * @arg EXMC_NFC_ECC_SECTION12: ECC section 12 + * @arg EXMC_NFC_ECC_SECTION13: ECC section 13 + * @arg EXMC_NFC_ECC_SECTION14: ECC section 14 + * @arg EXMC_NFC_ECC_SECTION15: ECC section 15 + * @retval The register value + */ +uint32_t EXMC_NFC_GetEcc1BitResult(uint32_t u32Section) +{ + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_SECTION(u32Section)); + + return READ_REG32(NFC_ECCR_REG32(u32Section)); +} + +/** + * @brief Set NFC spare area size. + * @param [in] u8SpareSizeForUserData NFC spare area size for user data + * @retval None + */ +void EXMC_NFC_SetSpareAreaSize(uint8_t u8SpareSizeForUserData) +{ + MODIFY_REG32(M4_NFC ->BACR, NFC_BACR_SCS, ((((uint32_t)u8SpareSizeForUserData) << NFC_BACR_SCS_POS) & NFC_BACR_SCS)); +} + +/** + * @brief Set NFC ECC mode. + * @param [in] u32EccMode ECC mode + * This parameter can be one of the following values: + * @arg EXMC_NFC_ECC_1BIT: ECC 1 bit + * @arg EXMC_NFC_ECC_4BITS: ECC 4 bits + * @retval None + */ +void EXMC_NFC_SetEccMode(uint32_t u32EccMode) +{ + DDL_ASSERT(IS_EXMC_NFC_ECC_MODE(u32EccMode)); + + MODIFY_REG32(M4_NFC ->BACR, NFC_BACR_ECCM, u32EccMode); +} + +/** + * @brief Get the 4 bits ECC syndrome register value. + * @param [in] u32Section The syndrome section + * This parameter can be one of the following values: + * @arg EXMC_NFC_SYND0: ECC syndrome section 0 + * @arg EXMC_NFC_SYND1: ECC syndrome section 1 + * @arg EXMC_NFC_SYND2: ECC syndrome section 2 + * @arg EXMC_NFC_SYND3: ECC syndrome section 3 + * @arg EXMC_NFC_SYND4: ECC syndrome section 4 + * @arg EXMC_NFC_SYND5: ECC syndrome section 5 + * @arg EXMC_NFC_SYND6: ECC syndrome section 6 + * @arg EXMC_NFC_SYND7: ECC syndrome section 7 + * @arg EXMC_NFC_SYND8: ECC syndrome section 8 + * @arg EXMC_NFC_SYND9: ECC syndrome section 9 + * @arg EXMC_NFC_SYND10: ECC syndrome section 10 + * @arg EXMC_NFC_SYND11: ECC syndrome section 11 + * @arg EXMC_NFC_SYND12: ECC syndrome section 12 + * @arg EXMC_NFC_SYND13: ECC syndrome section 13 + * @arg EXMC_NFC_SYND14: ECC syndrome section 14 + * @arg EXMC_NFC_SYND15: ECC syndrome section 15 + * @param [out] au16Synd The syndrome value + * @param [in] u8Length The length to be read(unit: half-word) + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: au16Synd = NULL or u8Length is out of range + * @note u8Length value don't be greater than 8 + */ +en_result_t EXMC_NFC_GetSyndrome(uint32_t u32Section, + uint16_t au16Synd[], + uint8_t u8Length) +{ + uint8_t i; + uint32_t u32SyndVal; + uint8_t u8LoopWords; + en_result_t enRet = ErrorInvalidParameter; + + if ((NULL != au16Synd) && (u8Length <= NFC_SYND_MAX_LEN)) + { + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_SECTION(u32Section)); + + u8LoopWords = (u8Length >> 1U); + + for (i = 0U; i < u8LoopWords; i++) + { + u32SyndVal = READ_REG32(NFC_SYND_REG32(u32Section, i)); + RW_MEM16(&au16Synd[i * 2U]) = (uint16_t)(u32SyndVal); + RW_MEM16(&au16Synd[i * 2U + 1U ]) = (uint16_t)(u32SyndVal >> 16UL); + } + + if ((u8Length % 2U) != 0U) + { + u32SyndVal = READ_REG32(NFC_SYND_REG32(u32Section, i)); + RW_MEM16(&au16Synd[i * 2U]) = (uint16_t)(u32SyndVal); + } + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Read NFC device status + * @param [in] u32Bank The specified bank + * This parameter can be one of the following values: + * @arg EXMC_NFC_BANK_0: NFC device bank 0 + * @arg EXMC_NFC_BANK_1: NFC device bank 1 + * @arg EXMC_NFC_BANK_2: NFC device bank 2 + * @arg EXMC_NFC_BANK_3: NFC device bank 3 + * @arg EXMC_NFC_BANK_4: NFC device bank 4 + * @arg EXMC_NFC_BANK_5: NFC device bank 5 + * @arg EXMC_NFC_BANK_6: NFC device bank 6 + * @arg EXMC_NFC_BANK_7: NFC device bank 7 + * @retval NFC device status + */ +uint32_t EXMC_NFC_ReadStatus(uint32_t u32Bank) +{ + uint32_t u32Status; + + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_BANK_NUM(u32Bank)); + + /* Write 0x81000M70 to NFC_CMDR, M = bank number */ + WRITE_REG32(M4_NFC->CMDR, CMD_READ_STATUS(u32Bank)); + + u32Status = READ_REG32(M4_NFC->DATR_BASE); + + EXMC_NFC_DeselectChip(); + + return u32Status; +} + +/** + * @brief Read status enhanced + * @param [in] u32Bank The specified bank + * This parameter can be one of the following values: + * @arg EXMC_NFC_BANK_0: NFC device bank 0 + * @arg EXMC_NFC_BANK_1: NFC device bank 1 + * @arg EXMC_NFC_BANK_2: NFC device bank 2 + * @arg EXMC_NFC_BANK_3: NFC device bank 3 + * @arg EXMC_NFC_BANK_4: NFC device bank 4 + * @arg EXMC_NFC_BANK_5: NFC device bank 5 + * @arg EXMC_NFC_BANK_6: NFC device bank 6 + * @arg EXMC_NFC_BANK_7: NFC device bank 7 + * @param [in] u32RowAddress The row address + * @retval NFC device status enhanced + */ +uint32_t EXMC_NFC_ReadStatusEnhanced(uint32_t u32Bank, + uint32_t u32RowAddress) +{ + uint32_t u32Status; + + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_BANK_NUM(u32Bank)); + + /* Erase block step: + 1. Write 0x81000M78 to NFC_CMDR, M = bank number + 2. Write 0x40000MAB to NFC_CMDR, M = bank number, AB= the lowest bytes of Row address + 3. Write 0x40000MAB to NFC_CMDR, M = bank number, AB= the middle bytes of Row address + 4. Write 0x40000MAB to NFC_CMDR, M = bank number, AB= the highest bytes of Row address + 5. Read Data Register */ + WRITE_REG32(M4_NFC->CMDR, CMD_READ_STATUS_ENHANCED(u32Bank)); + WRITE_REG32(M4_NFC->CMDR, CMD_ADDR_1ST_CYCLE(u32Bank, u32RowAddress)); + WRITE_REG32(M4_NFC->CMDR, CMD_ADDR_2ND_CYCLE(u32Bank, u32RowAddress)); + WRITE_REG32(M4_NFC->CMDR, CMD_ADDR_3RD_CYCLE(u32Bank, u32RowAddress)); + + u32Status = READ_REG32(M4_NFC->DATR_BASE); + + EXMC_NFC_DeselectChip(); + + return u32Status; +} + +/** + * @brief Reset NFC device + * @param [in] u32Bank The specified bank + * This parameter can be one of the following values: + * @arg EXMC_NFC_BANK_0: NFC device bank 0 + * @arg EXMC_NFC_BANK_1: NFC device bank 1 + * @arg EXMC_NFC_BANK_2: NFC device bank 2 + * @arg EXMC_NFC_BANK_3: NFC device bank 3 + * @arg EXMC_NFC_BANK_4: NFC device bank 4 + * @arg EXMC_NFC_BANK_5: NFC device bank 5 + * @arg EXMC_NFC_BANK_6: NFC device bank 6 + * @arg EXMC_NFC_BANK_7: NFC device bank 7 + * @param [in] u32Timeout The operation timeout value + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg ErrorTimeout: Reset timeout. + * @note Block waiting until operation complete if u32Timeout value is EXMC_NFC_MAX_TIMEOUT + */ +en_result_t EXMC_NFC_Reset(uint32_t u32Bank, uint32_t u32Timeout) +{ + en_result_t enRet; + + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_BANK_NUM(u32Bank)); + + /* Clear Flag */ + EXMC_NFC_ClearStatus(NFC_FLAG_RB_BANKx_MASK(u32Bank)); + + /* Reset step: + 1. Write 0x00000MFF to NFC_CMDR, M = bank number + 2. Wait RB signal until high level */ + WRITE_REG32(M4_NFC->CMDR, CMD_RESET(u32Bank)); + + enRet = EXMC_NFC_WaitFlagUntilTo(NFC_FLAG_RB_BANKx_MASK(u32Bank), \ + Set, \ + u32Timeout); + + EXMC_NFC_DeselectChip(); + + return enRet; +} + +/** + * @brief Asynchronous reset + * @param [in] u32Bank The specified bank + * This parameter can be one of the following values: + * @arg EXMC_NFC_BANK_0: NFC device bank 0 + * @arg EXMC_NFC_BANK_1: NFC device bank 1 + * @arg EXMC_NFC_BANK_2: NFC device bank 2 + * @arg EXMC_NFC_BANK_3: NFC device bank 3 + * @arg EXMC_NFC_BANK_4: NFC device bank 4 + * @arg EXMC_NFC_BANK_5: NFC device bank 5 + * @arg EXMC_NFC_BANK_6: NFC device bank 6 + * @arg EXMC_NFC_BANK_7: NFC device bank 7 + * @param [in] u32Timeout The operation timeout value + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg ErrorTimeout: Reset timeout. + * @note Block waiting until operation complete if u32Timeout value is EXMC_NFC_MAX_TIMEOUT + */ +en_result_t EXMC_NFC_AsyncReset(uint32_t u32Bank, uint32_t u32Timeout) +{ + en_result_t enRet; + + /* Clear Flag */ + EXMC_NFC_ClearStatus(NFC_FLAG_RB_BANKx_MASK(u32Bank)); + + /* Reset step: + 1. Write 0x00000MFC to NFC_CMDR, M = bank number + 2. Wait RB signal until high level */ + WRITE_REG32(M4_NFC->CMDR, CMD_ASYNC_RESET(u32Bank)); + + enRet = EXMC_NFC_WaitFlagUntilTo(NFC_FLAG_RB_BANKx_MASK(u32Bank), \ + Set, \ + u32Timeout); + EXMC_NFC_DeselectChip(); + return enRet; +} + +/** + * @brief Reset lun of NFC device + * @param [in] u32Bank The specified bank + * This parameter can be one of the following values: + * @arg EXMC_NFC_BANK_0: NFC device bank 0 + * @arg EXMC_NFC_BANK_1: NFC device bank 1 + * @arg EXMC_NFC_BANK_2: NFC device bank 2 + * @arg EXMC_NFC_BANK_3: NFC device bank 3 + * @arg EXMC_NFC_BANK_4: NFC device bank 4 + * @arg EXMC_NFC_BANK_5: NFC device bank 5 + * @arg EXMC_NFC_BANK_6: NFC device bank 6 + * @arg EXMC_NFC_BANK_7: NFC device bank 7 + * @param [in] u32RowAddress The row address + * @param [in] u32Timeout The operation timeout value + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg ErrorTimeout: Reset timeout. + * @note Block waiting until operation complete if u32Timeout value is EXMC_NFC_MAX_TIMEOUT + */ +en_result_t EXMC_NFC_ResetLun(uint32_t u32Bank, + uint32_t u32RowAddress, + uint32_t u32Timeout) +{ + en_result_t enRet; + + /* Clear Flag */ + EXMC_NFC_ClearStatus(NFC_FLAG_RB_BANKx_MASK(u32Bank)); + + /* Reset lun step: + 1. Write 0x82000MFA to NFC_CMDR, M = bank number + 2. Write 0x40000MAB to NFC_CMDR, M = bank number, AB= the lowest bytes of Row address + 3. Write 0x40000MAB to NFC_CMDR, M = bank number, AB= the middle bytes of Row address + 4. Write 0x40000MAB to NFC_CMDR, M = bank number, AB= the highest bytes of Row address + 5. Wait RB signal until high level */ + WRITE_REG32(M4_NFC->CMDR, CMD_RESET_LUN(u32Bank)); + WRITE_REG32(M4_NFC->CMDR, CMD_ADDR_1ST_CYCLE(u32Bank, u32RowAddress)); + WRITE_REG32(M4_NFC->CMDR, CMD_ADDR_2ND_CYCLE(u32Bank, u32RowAddress)); + WRITE_REG32(M4_NFC->CMDR, CMD_ADDR_3RD_CYCLE(u32Bank, u32RowAddress)); + + enRet = EXMC_NFC_WaitFlagUntilTo(NFC_FLAG_RB_BANKx_MASK(u32Bank), \ + Set, \ + u32Timeout); + return enRet; +} + +/** + * @brief Read ID + * @param [in] u32Bank The specified bank + * This parameter can be one of the following values: + * @arg EXMC_NFC_BANK_0: NFC device bank 0 + * @arg EXMC_NFC_BANK_1: NFC device bank 1 + * @arg EXMC_NFC_BANK_2: NFC device bank 2 + * @arg EXMC_NFC_BANK_3: NFC device bank 3 + * @arg EXMC_NFC_BANK_4: NFC device bank 4 + * @arg EXMC_NFC_BANK_5: NFC device bank 5 + * @arg EXMC_NFC_BANK_6: NFC device bank 6 + * @arg EXMC_NFC_BANK_7: NFC device bank 7 + * @param [in] u32IdAddr The address + * @param [in] au8DevId The id buffer + * @param [in] u32NumBytes The number of bytes to read + * @param [in] u32Timeout The operation timeout value + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg Error: au8DevId == NULL. + */ +en_result_t EXMC_NFC_ReadId(uint32_t u32Bank, + uint32_t u32IdAddr, + uint8_t au8DevId[], + uint32_t u32NumBytes, + uint32_t u32Timeout) +{ + uint32_t i; + uint64_t u64Val; + const uint32_t u32LoopWords = u32NumBytes/4UL; + const uint32_t u32RemainBytes = u32NumBytes%4UL; + uint32_t u32TmpId; + uint32_t u32CapacityIndex; + en_result_t enRet = Error; + + if ((NULL != au8DevId) && (u32NumBytes > 0UL)) + { + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_BANK_NUM(u32Bank)); + DDL_ASSERT(u32IdAddr <= 0xFFUL); + + /* Clear Flag */ + EXMC_NFC_ClearStatus(NFC_FLAG_RB_BANKx_MASK(u32Bank) | \ + EXMC_NFC_FLAG_ECC_UNCORRECTABLE_ERROR | \ + EXMC_NFC_FLAG_ECC_CORRECTABLE_ERROR | \ + EXMC_NFC_FLAG_ECC_CALC_COMPLETION | \ + EXMC_NFC_FLAG_ECC_ERROR); + + u32CapacityIndex = EXMC_NFC_GetCapacityIndex(); + u64Val = (NFC_IDXR_VAL(u32Bank, 0UL, 0UL, u32CapacityIndex) & NFC_IDXR_MASK); + + /* 1. Write 0x00000000 to NFC_CMDR */ + WRITE_REG32(M4_NFC->CMDR, EXMC_NFC_CMD_READ_1ST); + + /* 2. Write NAND Flash address to NFC_IDXR0/1 */ + WRITE_REG32(M4_NFC->IDXR0, (uint32_t)(u64Val & 0xFFFFFFFFUL)); + WRITE_REG32(M4_NFC->IDXR1, (uint32_t)(u64Val >> 32UL)); + + /* 3. Write 0x000000E0 to NFC_CMDR */ + WRITE_REG32(M4_NFC->CMDR, EXMC_NFC_CMD_READ_2ND); + + /* 4. Wait RB signal until high level */ + enRet = EXMC_NFC_WaitFlagUntilTo(NFC_FLAG_RB_BANKx_MASK(u32Bank), \ + Set, \ + u32Timeout); + if (Ok == enRet) + { + /* Read Id step: + 1. Write 0x81000M90 to NFC_CMDR, M = bank number + 2. Write 0x40000MAB to NFC_CMDR, M = bank number, AB=ID address + 3. Read NFC_DATR + 4. Write 0x000000FE to NFC_CMDR, and invalidate CE */ + WRITE_REG32(M4_NFC->CMDR, CMD_READ_ID(u32Bank)); + WRITE_REG32(M4_NFC->CMDR, CMD_READ_ID_ADDR(u32Bank, u32IdAddr)); + for (i = 0UL; i < u32LoopWords; i++) + { + u32TmpId = NFC_DATR_REG32(i); + (void)memcpy (&au8DevId[i * 4UL], &u32TmpId, 4UL); + } + + if (u32RemainBytes > 0UL) + { + u32TmpId = NFC_DATR_REG32(i); + (void)memcpy (&au8DevId[i * 4UL], &u32TmpId, u32RemainBytes); + } + + enRet = Ok; + } + + EXMC_NFC_DeselectChip(); + } + + return enRet; +} + +/** + * @brief Read Unique ID + * @param [in] u32Bank The specified bank + * This parameter can be one of the following values: + * @arg EXMC_NFC_BANK_0: NFC device bank 0 + * @arg EXMC_NFC_BANK_1: NFC device bank 1 + * @arg EXMC_NFC_BANK_2: NFC device bank 2 + * @arg EXMC_NFC_BANK_3: NFC device bank 3 + * @arg EXMC_NFC_BANK_4: NFC device bank 4 + * @arg EXMC_NFC_BANK_5: NFC device bank 5 + * @arg EXMC_NFC_BANK_6: NFC device bank 6 + * @arg EXMC_NFC_BANK_7: NFC device bank 7 + * @param [in] u32IdAddr The address + * @param [in] au32UniqueId The id buffer + * @param [in] u8NumWords The number of words to read + * @param [in] u32Timeout The operation timeout value + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg Error: au8DevId == NULL. + * @note Block waiting until operation complete if u32Timeout value is EXMC_NFC_MAX_TIMEOUT + */ +en_result_t EXMC_NFC_ReadUniqueId(uint32_t u32Bank, + uint32_t u32IdAddr, + uint32_t au32UniqueId[], + uint8_t u8NumWords, + uint32_t u32Timeout) +{ + uint8_t i; + en_result_t enRet = Error; + + if ((NULL != au32UniqueId) && (u8NumWords > 0U)) + { + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_BANK_NUM(u32Bank)); + + /* Clear Flag */ + EXMC_NFC_ClearStatus(NFC_FLAG_RB_BANKx_MASK(u32Bank)); + + /* Read Id step: + 1. Write 0x81000M90 to NFC_CMDR, M = bank number + 2. Write 0x40000M00 to NFC_CMDR, M = bank number, AB=ID address + 3. Read NFC_DATR + 4. Write 0x000000FE to NFC_CMDR, and invalidate CE */ + WRITE_REG32(M4_NFC->CMDR, CMD_READ_UNIQUEID(u32Bank)); + WRITE_REG32(M4_NFC->CMDR, CMD_READ_UNIQUEID_ADDR(u32Bank)); + + enRet = EXMC_NFC_WaitFlagUntilTo(NFC_FLAG_RB_BANKx_MASK(u32Bank), \ + Set, \ + u32Timeout); + if (Ok == enRet) + { + for (i = 0U; i < u8NumWords; i++) + { + au32UniqueId[i] = NFC_DATR_REG32(i); + } + } + + EXMC_NFC_DeselectChip(); + } + + return enRet; +} + +/** + * @brief Read parameter page + * @param [in] u32Bank The specified bank + * This parameter can be one of the following values: + * @arg EXMC_NFC_BANK_0: NFC device bank 0 + * @arg EXMC_NFC_BANK_1: NFC device bank 1 + * @arg EXMC_NFC_BANK_2: NFC device bank 2 + * @arg EXMC_NFC_BANK_3: NFC device bank 3 + * @arg EXMC_NFC_BANK_4: NFC device bank 4 + * @arg EXMC_NFC_BANK_5: NFC device bank 5 + * @arg EXMC_NFC_BANK_6: NFC device bank 6 + * @arg EXMC_NFC_BANK_7: NFC device bank 7 + * @param [in] au32Data The data buffer + * @param [in] u16NumWords The number of words to read + * @param [in] u32Timeout The operation timeout value + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg Error: au8Data == NULL. + * @arg ErrorTimeout: Read timeout + * @note Block waiting until operation complete if u32Timeout value is EXMC_NFC_MAX_TIMEOUT + */ +en_result_t EXMC_NFC_ReadParameterPage(uint32_t u32Bank, + uint32_t au32Data[], + uint16_t u16NumWords, + uint32_t u32Timeout) +{ + uint16_t i; + en_result_t enRet = Error; + + if ((NULL != au32Data) && (u16NumWords > 0U)) + { + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_BANK_NUM(u32Bank)); + + /* Clear Flag */ + EXMC_NFC_ClearStatus(NFC_FLAG_RB_BANKx_MASK(u32Bank)); + + /* Read parameter page step: + 1. Write 0x81000MEC to NFC_CMDR, M = bank number + 2. Write 0x40000M00 to NFC_CMDR, M = bank number + 3. Read NFC_DATR + 4. Write 0x000000FE to NFC_CMDR, and invalidate CE */ + WRITE_REG32(M4_NFC->CMDR, CMD_READ_PARAMETER_PAGE(u32Bank)); + WRITE_REG32(M4_NFC->CMDR, CMD_READ_PARAMETER_PAGE_ADDR(u32Bank)); + + enRet = EXMC_NFC_WaitFlagUntilTo(NFC_FLAG_RB_BANKx_MASK(u32Bank), \ + Set, \ + u32Timeout); + if (Ok == enRet) + { + for (i = 0U; i < u16NumWords; i++) + { + au32Data[i] = NFC_DATR_REG32(i); + } + } + + EXMC_NFC_DeselectChip(); + } + + return enRet; +} + +/** + * @brief Set feature + * @param [in] u32Bank The specified bank + * This parameter can be one of the following values: + * @arg EXMC_NFC_BANK_0: NFC device bank 0 + * @arg EXMC_NFC_BANK_1: NFC device bank 1 + * @arg EXMC_NFC_BANK_2: NFC device bank 2 + * @arg EXMC_NFC_BANK_3: NFC device bank 3 + * @arg EXMC_NFC_BANK_4: NFC device bank 4 + * @arg EXMC_NFC_BANK_5: NFC device bank 5 + * @arg EXMC_NFC_BANK_6: NFC device bank 6 + * @arg EXMC_NFC_BANK_7: NFC device bank 7 + * @param [in] u8FeatrueAddr The featrue address + * @param [in] au32Data The data buffer + * @param [in] u8NumWords The number of words to set + * @param [in] u32Timeout The operation timeout value + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg Error: au8Data == NULL. + * @arg ErrorTimeout: Read timeout + * @note Block waiting until operation complete if u32Timeout value is EXMC_NFC_MAX_TIMEOUT + */ +en_result_t EXMC_NFC_SetFeature(uint32_t u32Bank, + uint8_t u8FeatrueAddr, + const uint32_t au32Data[], + uint8_t u8NumWords, + uint32_t u32Timeout) +{ + uint8_t i; + en_result_t enRet = Error; + + if ((NULL != au32Data) && (u8NumWords > 0U)) + { + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_BANK_NUM(u32Bank)); + + /* Clear Flag */ + EXMC_NFC_ClearStatus(NFC_FLAG_RB_BANKx_MASK(u32Bank)); + + WRITE_REG32(M4_NFC->CMDR, CMD_SET_FEATURE(u32Bank)); + WRITE_REG32(M4_NFC->CMDR, CMD_SET_FEATURE_ADDR(u32Bank, u8FeatrueAddr)); + + for (i = 0U; i < u8NumWords; i++) + { + NFC_DATR_REG32(i) = au32Data[i]; + } + + enRet = EXMC_NFC_WaitFlagUntilTo(NFC_FLAG_RB_BANKx_MASK(u32Bank), \ + Set, \ + u32Timeout); + + EXMC_NFC_DeselectChip(); + } + + return enRet; +} + +/** + * @brief Get feature + * @param [in] u32Bank The specified bank + * This parameter can be one of the following values: + * @arg EXMC_NFC_BANK_0: NFC device bank 0 + * @arg EXMC_NFC_BANK_1: NFC device bank 1 + * @arg EXMC_NFC_BANK_2: NFC device bank 2 + * @arg EXMC_NFC_BANK_3: NFC device bank 3 + * @arg EXMC_NFC_BANK_4: NFC device bank 4 + * @arg EXMC_NFC_BANK_5: NFC device bank 5 + * @arg EXMC_NFC_BANK_6: NFC device bank 6 + * @arg EXMC_NFC_BANK_7: NFC device bank 7 + * @param [in] u8FeatrueAddr The featrue address + * @param [out] au32Data The data buffer + * @param [in] u8NumWords The number of words to get + * @param [in] u32Timeout The operation timeout value + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg Error: au8Data == NULL. + * @arg ErrorTimeout: Read timeout + * @note Block waiting until operation complete if u32Timeout value is EXMC_NFC_MAX_TIMEOUT + */ +en_result_t EXMC_NFC_GetFeature(uint32_t u32Bank, + uint8_t u8FeatrueAddr, + uint32_t au32Data[], + uint8_t u8NumWords, + uint32_t u32Timeout) +{ + uint8_t i; + en_result_t enRet = Error; + + if ((NULL != au32Data) && (u8NumWords > 0U)) + { + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_BANK_NUM(u32Bank)); + + /* Clear Flag */ + EXMC_NFC_ClearStatus(NFC_FLAG_RB_BANKx_MASK(u32Bank)); + + WRITE_REG32(M4_NFC->CMDR, CMD_GET_FEATURE(u32Bank)); + WRITE_REG32(M4_NFC->CMDR, CMD_GET_FEATURE_ADDR(u32Bank, u8FeatrueAddr)); + + enRet = EXMC_NFC_WaitFlagUntilTo(NFC_FLAG_RB_BANKx_MASK(u32Bank), \ + Set, \ + u32Timeout); + if (Ok == enRet) + { + for (i = 0U; i < u8NumWords; i++) + { + au32Data[i] = NFC_DATR_REG32(i); + } + } + + EXMC_NFC_DeselectChip(); + } + + return enRet; +} + +/** + * @brief Erase NFC device block + * @param [in] u32Bank The specified bank + * This parameter can be one of the following values: + * @arg EXMC_NFC_BANK_0: NFC device bank 0 + * @arg EXMC_NFC_BANK_1: NFC device bank 1 + * @arg EXMC_NFC_BANK_2: NFC device bank 2 + * @arg EXMC_NFC_BANK_3: NFC device bank 3 + * @arg EXMC_NFC_BANK_4: NFC device bank 4 + * @arg EXMC_NFC_BANK_5: NFC device bank 5 + * @arg EXMC_NFC_BANK_6: NFC device bank 6 + * @arg EXMC_NFC_BANK_7: NFC device bank 7 + * @param [in] u32RowAddress The row address + * @param [in] u32Timeout The operation timeout value + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg ErrorTimeout: Erase timeout. + * @note Block waiting until operation complete if u32Timeout value is EXMC_NFC_MAX_TIMEOUT + */ +en_result_t EXMC_NFC_EraseBlock(uint32_t u32Bank, + uint32_t u32RowAddress, + uint32_t u32Timeout) +{ + en_result_t enRet; + + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_BANK_NUM(u32Bank)); + + /* Clear Flag */ + EXMC_NFC_ClearStatus(NFC_FLAG_RB_BANKx_MASK(u32Bank)); + + /* Erase block step: + 1. Write 0x81000M60 to NFC_CMDR, M = bank number + 2. Write 0x40000MAB to NFC_CMDR, M = bank number, AB= the lowest bytes of Row address + 3. Write 0x40000MAB to NFC_CMDR, M = bank number, AB= the middle bytes of Row address + 4. Write 0x40000MAB to NFC_CMDR, M = bank number, AB= the highest bytes of Row address + 5. Write 0x00000MD0 to NFC_CMDR, M = bank number + 6. Wait RB signal until high level */ + WRITE_REG32(M4_NFC->CMDR, CMD_ERASE_BLOCK_1ST_CYCLE(u32Bank)); + WRITE_REG32(M4_NFC->CMDR, CMD_ADDR_1ST_CYCLE(u32Bank, u32RowAddress)); + WRITE_REG32(M4_NFC->CMDR, CMD_ADDR_2ND_CYCLE(u32Bank, u32RowAddress)); + WRITE_REG32(M4_NFC->CMDR, CMD_ADDR_3RD_CYCLE(u32Bank, u32RowAddress)); + WRITE_REG32(M4_NFC->CMDR, CMD_ERASE_BLOCK_2ND_CYCLE(u32Bank)); + + enRet = EXMC_NFC_WaitFlagUntilTo(NFC_FLAG_RB_BANKx_MASK(u32Bank), \ + Set, \ + u32Timeout); + return enRet; +} + +/** + * @brief NFC page read + * @param [in] u32Bank The specified bank + * This parameter can be one of the following values: + * @arg EXMC_NFC_BANK_0: NFC device bank 0 + * @arg EXMC_NFC_BANK_1: NFC device bank 1 + * @arg EXMC_NFC_BANK_2: NFC device bank 2 + * @arg EXMC_NFC_BANK_3: NFC device bank 3 + * @arg EXMC_NFC_BANK_4: NFC device bank 4 + * @arg EXMC_NFC_BANK_5: NFC device bank 5 + * @arg EXMC_NFC_BANK_6: NFC device bank 6 + * @arg EXMC_NFC_BANK_7: NFC device bank 7 + * @param [in] u32Page The specified page + * @param [out] pu8Data The buffer for reading + * @param [in] u32NumBytes The buffer size for bytes + * @param [in] u32Timeout The operation timeout value + * @retval An en_result_t enumeration value: + * @arg Ok: No errors occurred. + * @arg ErrorTimeout: Write timeout. + * @arg ErrorInvalidParameter: The pointer au8Buf value is NULL. + * @note Block waiting until operation complete if u32Timeout value is EXMC_NFC_MAX_TIMEOUT + */ +en_result_t EXMC_NFC_ReadPageMeta(uint32_t u32Bank, + uint32_t u32Page, + uint8_t *pu8Data, + uint32_t u32NumBytes, + uint32_t u32Timeout) +{ + en_result_t enRet = ErrorInvalidParameter; + + if ((NULL != pu8Data) && (u32NumBytes > 0UL)) + { + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_BANK_NUM(u32Bank)); + DDL_ASSERT(IS_PARAM_ALIGN_WORD(u32NumBytes)); + DDL_ASSERT(IS_ADDRESS_ALIGN_WORD(pu8Data)); + + enRet = EXMC_NFC_Read(u32Bank, u32Page, 0UL, (uint32_t *)((uint32_t)pu8Data), \ + (u32NumBytes/4UL), Disable, u32Timeout); + } + + return enRet; +} + +/** + * @brief NFC page write + * @param [in] u32Bank The specified bank + * This parameter can be one of the following values: + * @arg EXMC_NFC_BANK_0: NFC device bank 0 + * @arg EXMC_NFC_BANK_1: NFC device bank 1 + * @arg EXMC_NFC_BANK_2: NFC device bank 2 + * @arg EXMC_NFC_BANK_3: NFC device bank 3 + * @arg EXMC_NFC_BANK_4: NFC device bank 4 + * @arg EXMC_NFC_BANK_5: NFC device bank 5 + * @arg EXMC_NFC_BANK_6: NFC device bank 6 + * @arg EXMC_NFC_BANK_7: NFC device bank 7 + * @param [in] u32Page The specified page + * @param [in] pu8Data The buffer for writing + * @param [in] u32NumBytes The buffer size for bytes + * @param [in] u32Timeout The operation timeout value + * @retval An en_result_t enumeration value: + * @arg Ok: No errors occurred. + * @arg ErrorTimeout: Write timeout. + * @arg ErrorInvalidParameter: The pointer au8Buf value is NULL. + * @note Block waiting until operation complete if u32Timeout value is EXMC_NFC_MAX_TIMEOUT + */ +en_result_t EXMC_NFC_WritePageMeta(uint32_t u32Bank, + uint32_t u32Page, + const uint8_t *pu8Data, + uint32_t u32NumBytes, + uint32_t u32Timeout) +{ + en_result_t enRet = ErrorInvalidParameter; + + if ((NULL != pu8Data) && (u32NumBytes > 0UL)) + { + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_BANK_NUM(u32Bank)); + DDL_ASSERT(IS_PARAM_ALIGN_WORD(u32NumBytes)); + DDL_ASSERT(IS_ADDRESS_ALIGN_WORD(pu8Data)); + + enRet = EXMC_NFC_Write(u32Bank, u32Page, 0UL, (uint32_t *)((uint32_t)pu8Data), \ + (u32NumBytes/4UL), Disable, u32Timeout); + } + + return enRet; +} + +/** + * @brief NFC page read by hardware ECC + * @param [in] u32Bank The specified bank + * This parameter can be one of the following values: + * @arg EXMC_NFC_BANK_0: NFC device bank 0 + * @arg EXMC_NFC_BANK_1: NFC device bank 1 + * @arg EXMC_NFC_BANK_2: NFC device bank 2 + * @arg EXMC_NFC_BANK_3: NFC device bank 3 + * @arg EXMC_NFC_BANK_4: NFC device bank 4 + * @arg EXMC_NFC_BANK_5: NFC device bank 5 + * @arg EXMC_NFC_BANK_6: NFC device bank 6 + * @arg EXMC_NFC_BANK_7: NFC device bank 7 + * @param [in] u32Page The specified page + * @param [out] pu8Data The buffer for reading + * @param [in] u32NumBytes The buffer size for bytes + * @param [in] u32Timeout The operation timeout value + * @retval An en_result_t enumeration value: + * @arg Ok: No errors occurred. + * @arg ErrorTimeout: Write timeout. + * @arg ErrorInvalidParameter: The pointer au8Buf value is NULL. + * @note Block waiting until operation complete if u32Timeout value is EXMC_NFC_MAX_TIMEOUT + */ +en_result_t EXMC_NFC_ReadPageHwEcc(uint32_t u32Bank, + uint32_t u32Page, + uint8_t *pu8Data, + uint32_t u32NumBytes, + uint32_t u32Timeout) +{ + const uint32_t u32PageSize = NFC_PAGE_SIZE; + const uint32_t u32SpareSizeUserData = NFC_SPARE_SIZE_FOR_USER_DATA; + en_result_t enRet = ErrorInvalidParameter; + + if ((NULL != pu8Data) && (u32NumBytes > 0UL)) + { + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_BANK_NUM(u32Bank)); + DDL_ASSERT(IS_PARAM_ALIGN_WORD(u32NumBytes)); + DDL_ASSERT(IS_ADDRESS_ALIGN_WORD(pu8Data)); + DDL_ASSERT(u32NumBytes <= (u32PageSize + u32SpareSizeUserData)); + + enRet = EXMC_NFC_Read(u32Bank, u32Page, 0UL, (uint32_t *)((uint32_t)pu8Data), \ + (u32NumBytes/4UL), Enable, u32Timeout); + } + + return enRet; +} + +/** + * @brief NFC page write by hardware ECC + * @param [in] u32Bank The specified bank + * This parameter can be one of the following values: + * @arg EXMC_NFC_BANK_0: NFC device bank 0 + * @arg EXMC_NFC_BANK_1: NFC device bank 1 + * @arg EXMC_NFC_BANK_2: NFC device bank 2 + * @arg EXMC_NFC_BANK_3: NFC device bank 3 + * @arg EXMC_NFC_BANK_4: NFC device bank 4 + * @arg EXMC_NFC_BANK_5: NFC device bank 5 + * @arg EXMC_NFC_BANK_6: NFC device bank 6 + * @arg EXMC_NFC_BANK_7: NFC device bank 7 + * @param [in] u32Page The specified page + * @param [in] pu8Data The buffer for writing + * @param [in] u32NumBytes The buffer size for bytes + * @param [in] u32Timeout The operation timeout value + * @retval An en_result_t enumeration value: + * @arg Ok: No errors occurred. + * @arg ErrorTimeout: Write timeout. + * @arg ErrorInvalidParameter: The pointer au8Buf value is NULL. + * @note Block waiting until operation complete if u32Timeout value is EXMC_NFC_MAX_TIMEOUT + */ +en_result_t EXMC_NFC_WritePageHwEcc(uint32_t u32Bank, + uint32_t u32Page, + const uint8_t *pu8Data, + uint32_t u32NumBytes, + uint32_t u32Timeout) +{ + const uint32_t u32PageSize = NFC_PAGE_SIZE; + const uint32_t u32SpareSizeUserData = NFC_SPARE_SIZE_FOR_USER_DATA; + en_result_t enRet = ErrorInvalidParameter; + + if ((NULL != pu8Data) && (u32NumBytes > 0UL)) + { + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_BANK_NUM(u32Bank)); + DDL_ASSERT(IS_PARAM_ALIGN_WORD(u32NumBytes)); + DDL_ASSERT(IS_ADDRESS_ALIGN_WORD((uint32_t)pu8Data)); + DDL_ASSERT(u32NumBytes <= (u32PageSize + u32SpareSizeUserData)); + + enRet = EXMC_NFC_Write(u32Bank, u32Page, 0UL, (uint32_t *)((uint32_t)pu8Data), \ + (u32NumBytes/4UL), Enable, u32Timeout); + } + + return enRet; +} + +/** + * @} + */ + +/** + * @defgroup EXMC_NFC_Local_Functions NAND Flash Controller Local Functions + * @{ + */ + +/** + * @brief NFC read operation + * @param [in] u32Bank The specified bank + * This parameter can be one of the following values: + * @arg EXMC_NFC_BANK_0: NFC device bank 0 + * @arg EXMC_NFC_BANK_1: NFC device bank 1 + * @arg EXMC_NFC_BANK_2: NFC device bank 2 + * @arg EXMC_NFC_BANK_3: NFC device bank 3 + * @arg EXMC_NFC_BANK_4: NFC device bank 4 + * @arg EXMC_NFC_BANK_5: NFC device bank 5 + * @arg EXMC_NFC_BANK_6: NFC device bank 6 + * @arg EXMC_NFC_BANK_7: NFC device bank 7 + * @param [in] u32Page The specified page + * @param [in] u32Col The column address + * @param [out] au32Data The buffer for reading + * @param [in] u32NumWords The buffer size for words + * @param [in] enEccState Disable/enable ECC function + * @param [in] u32Timeout The operation timeout value + * @retval An en_result_t enumeration value: + * @arg Ok: No errors occurred. + * @arg ErrorTimeout: Write timeout. + * @arg ErrorInvalidParameter: The pointer au8Buf value is NULL. + * @note Block waiting until operation complete if u32Timeout value is EXMC_NFC_MAX_TIMEOUT + */ +static en_result_t EXMC_NFC_Read(uint32_t u32Bank, + uint32_t u32Page, + uint32_t u32Col, + uint32_t au32Data[], + uint32_t u32NumWords, + en_functional_state_t enEccState, + uint32_t u32Timeout) +{ + uint32_t i; + uint64_t u64Val; + en_result_t enRet = ErrorInvalidParameter; + const uint32_t u32CapacityIndex = EXMC_NFC_GetCapacityIndex(); + + if ((NULL != au32Data) && (u32NumWords > 0UL)) + { + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_BANK_NUM(u32Bank)); + DDL_ASSERT(IS_EXMC_NFC_PAGE(u32Page, u32CapacityIndex)); + DDL_ASSERT(IS_EXMC_NFC_COLUMN(u32Col)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enEccState)); + + /* Clear Flag */ + EXMC_NFC_ClearStatus(NFC_FLAG_RB_BANKx_MASK(u32Bank) | \ + EXMC_NFC_FLAG_ECC_UNCORRECTABLE_ERROR | \ + EXMC_NFC_FLAG_ECC_CORRECTABLE_ERROR | \ + EXMC_NFC_FLAG_ECC_CALC_COMPLETION | \ + EXMC_NFC_FLAG_ECC_ERROR); + + if (Enable == enEccState) + { + EXMC_NFC_EccCmd(Enable); + } + else + { + EXMC_NFC_EccCmd(Disable); + } + + u64Val = (NFC_IDXR_VAL(u32Bank, u32Page, u32Col, u32CapacityIndex) & NFC_IDXR_MASK); + + /* Read page step: + 1. Write 0x00000000 to NFC_CMDR + 2. Write NAND Flash address to NFC_IDXR0/1 + 3. Write 0x000000E0 to NFC_CMDR + 4. Wait RB signal until high level + 5. Read NFC_DATR + 6. Write 0x000000FE to NFC_CMDR, and invalidate CE */ + + /* 1. Write 0x00000000 to NFC_CMDR */ + WRITE_REG32(M4_NFC->CMDR, EXMC_NFC_CMD_READ_1ST); + + /* 2. Write NAND Flash address to NFC_IDXR0/1 */ + WRITE_REG32(M4_NFC->IDXR0, (uint32_t)(u64Val & 0xFFFFFFFFUL)); + WRITE_REG32(M4_NFC->IDXR1, (uint32_t)(u64Val >> 32UL)); + + /* 3. Write 0x000000E0 to NFC_CMDR */ + WRITE_REG32(M4_NFC->CMDR, EXMC_NFC_CMD_READ_2ND); + + /* 4. Wait RB signal until high level */ + enRet = EXMC_NFC_WaitFlagUntilTo(NFC_FLAG_RB_BANKx_MASK(u32Bank), \ + Set, \ + u32Timeout); + if (Ok == enRet) + { + /* 5. Read NFC_DATR */ + for (i = 0UL; i < u32NumWords; i++) + { + au32Data[i] = NFC_DATR_REG32(i); + } + + /* Clear Flag */ + EXMC_NFC_ClearStatus(NFC_FLAG_RB_BANKx_MASK(u32Bank)); + + if (Enable == enEccState) + { + /* Write 0x00000023 to NFC_CMDR */ + WRITE_REG32(M4_NFC->CMDR, EXMC_NFC_CMD_CALCULATE_ECC); + + /* 4. Wait RB signal until high level */ + enRet = EXMC_NFC_WaitFlagUntilTo(EXMC_NFC_FLAG_ECC_CALCULATING, \ + Reset, \ + u32Timeout); + EXMC_NFC_EccCmd(Disable); + } + } + + /* 6. Write 0x000000FE to NFC_CMDR, and invalidate CE */ + EXMC_NFC_DeselectChip(); + } + + return enRet; +} + +/** + * @brief NFC write operation + * @param [in] u32Bank The specified bank + * This parameter can be one of the following values: + * @arg EXMC_NFC_BANK_0: NFC device bank 0 + * @arg EXMC_NFC_BANK_1: NFC device bank 1 + * @arg EXMC_NFC_BANK_2: NFC device bank 2 + * @arg EXMC_NFC_BANK_3: NFC device bank 3 + * @arg EXMC_NFC_BANK_4: NFC device bank 4 + * @arg EXMC_NFC_BANK_5: NFC device bank 5 + * @arg EXMC_NFC_BANK_6: NFC device bank 6 + * @arg EXMC_NFC_BANK_7: NFC device bank 7 + * @param [in] u32Page The specified page + * @param [in] u32Col The column address + * @param [in] au32Data The buffer for writing + * @param [in] u32NumWords The buffer size for words + * @param [in] enEccState Disable/enable ECC function + * @param [in] u32Timeout The operation timeout value + * @retval An en_result_t enumeration value: + * @arg Ok: No errors occurred. + * @arg ErrorTimeout: Write timeout. + * @arg ErrorInvalidParameter: The pointer au8Buf value is NULL. + * @note Block waiting until operation complete if u32Timeout value is EXMC_NFC_MAX_TIMEOUT + */ +static en_result_t EXMC_NFC_Write(uint32_t u32Bank, + uint32_t u32Page, + uint32_t u32Col, + const uint32_t au32Data[], + uint32_t u32NumWords, + en_functional_state_t enEccState, + uint32_t u32Timeout) +{ + uint32_t i; + uint64_t u64Val; + en_result_t enRet = Error; + const uint32_t u32CapacityIndex = EXMC_NFC_GetCapacityIndex(); + + if ((NULL != au32Data) && (u32NumWords > 0UL)) + { + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_BANK_NUM(u32Bank)); + DDL_ASSERT(IS_EXMC_NFC_PAGE(u32Page, u32CapacityIndex)); + DDL_ASSERT(IS_EXMC_NFC_COLUMN(u32Col)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enEccState)); + + /* Check parameters */ + EXMC_NFC_ClearStatus(NFC_FLAG_RB_BANKx_MASK(u32Bank) | \ + EXMC_NFC_FLAG_ECC_UNCORRECTABLE_ERROR | \ + EXMC_NFC_FLAG_ECC_CORRECTABLE_ERROR | \ + EXMC_NFC_FLAG_ECC_CALC_COMPLETION | \ + EXMC_NFC_FLAG_ECC_ERROR); + + /* Clear Flag */ + EXMC_NFC_ClearStatus(NFC_FLAG_RB_BANKx_MASK(u32Bank)); + + if (Enable == enEccState) + { + EXMC_NFC_EccCmd(Enable); + } + else + { + EXMC_NFC_EccCmd(Disable); + } + + u64Val = (NFC_IDXR_VAL(u32Bank, u32Page, u32Col, u32CapacityIndex) & NFC_IDXR_MASK); + + /* Write page step: + 1. Write 0x00000080 to NFC_CMDR + 2. Write NAND Flash address to NFC_IDXR0/1 + 3. Write NFC_DATR + 4. Write 0x00000010 to NFC_CMDR + 5. Wait RB signal until high level + 6. Write 0x000000FE to NFC_CMDR, and invalidate CE */ + + /* 1. Write 0x00000080 to NFC_CMDR */ + WRITE_REG32(M4_NFC->CMDR, EXMC_NFC_CMD_PAGE_PROGRAM_1ST); + + /* 2. Write NAND Flash address to NFC_IDXR0/1 */ + WRITE_REG32(M4_NFC->IDXR0, (uint32_t)(u64Val & 0xFFFFFFFFUL)); + WRITE_REG32(M4_NFC->IDXR1, (uint32_t)(u64Val >> 32UL)); + + /* 3. Write NFC_DATR */ + for (i = 0UL; i < u32NumWords; i++) + { + NFC_DATR_REG32(i) = au32Data[i]; + } + + /* 4. Write 0x00000010 to NFC_CMDR */ + WRITE_REG32(M4_NFC->CMDR, EXMC_NFC_CMD_PAGE_PROGRAM_2ND); + + /* 5. Wait RB signal until high level */ + enRet = EXMC_NFC_WaitFlagUntilTo(NFC_FLAG_RB_BANKx_MASK(u32Bank), \ + Set, \ + u32Timeout); + + /* Write 0x000000FE to NFC_CMDR, and invalidate CE */ + EXMC_NFC_DeselectChip(); + + if (Enable == enEccState) + { + EXMC_NFC_EccCmd(Disable); + } + } + + return enRet; +} + +/** + * @brief Get capacity size. + * @param None + * @retval Capacity index + * @arg NFC_CAPACITY_INDEX_512MBIT: NFC device capacity 512MBit + * @arg NFC_CAPACITY_INDEX_1GBIT: NFC device capacity 1GBit + * @arg NFC_CAPACITY_INDEX_2GBIT: NFC device capacity 2GBit + * @arg NFC_CAPACITY_INDEX_4GBIT: NFC device capacity 4GBit + * @arg NFC_CAPACITY_INDEX_8GBIT: NFC device capacity 8GBit + * @arg NFC_CAPACITY_INDEX_16GBIT: NFC device capacity 16GBit + * @arg NFC_CAPACITY_INDEX_32GBIT: NFC device capacity 32GBit + * @arg NFC_CAPACITY_INDEX_64GBIT: NFC device capacity 64GBit + */ +static uint32_t EXMC_NFC_GetCapacityIndex(void) +{ + uint32_t u32Index; + const uint32_t u32BacrSize = READ_REG32_BIT(M4_NFC->BACR, NFC_BACR_SIZE); + + switch (u32BacrSize) + { + case EXMC_NFC_BANK_CAPACITY_512MBIT: + u32Index = NFC_CAPACITY_INDEX_512MBIT; + break; + case EXMC_NFC_BANK_CAPACITY_1GBIT: + u32Index = NFC_CAPACITY_INDEX_1GBIT; + break; + case EXMC_NFC_BANK_CAPACITY_2GBIT: + u32Index = NFC_CAPACITY_INDEX_2GBIT; + break; + case EXMC_NFC_BANK_CAPACITY_4GBIT: + u32Index = NFC_CAPACITY_INDEX_4GBIT; + break; + case EXMC_NFC_BANK_CAPACITY_8GBIT: + u32Index = NFC_CAPACITY_INDEX_8GBIT; + break; + case EXMC_NFC_BANK_CAPACITY_16GBIT: + u32Index = NFC_CAPACITY_INDEX_16GBIT; + break; + case EXMC_NFC_BANK_CAPACITY_32GBIT: + u32Index = NFC_CAPACITY_INDEX_32GBIT; + break; + default: + u32Index = NFC_CAPACITY_INDEX_64GBIT; + break; + } + + return u32Index; +} + +/** + * @brief Wait the specified flag with timeout. + * @param [in] u32Flag The specified flag + * @arg EXMC_NFC_FLAG_ECC_UNCORRECTABLE_ERROR: ECC uncorrectable error + * @arg EXMC_NFC_FLAG_ECC_CORRECTABLE_ERROR: ECC correctable error + * @arg EXMC_NFC_FLAG_ECC_CALC_COMPLETION: Calculating ECC completely + * @arg EXMC_NFC_FLAG_ECC_ERROR: ECC error + * @arg EXMC_NFC_FLAG_RB_BANK0: NFC device bank 0 busy flag + * @arg EXMC_NFC_FLAG_RB_BANK1: NFC device bank 1 busy flag + * @arg EXMC_NFC_FLAG_RB_BANK2: NFC device bank 2 busy flag + * @arg EXMC_NFC_FLAG_RB_BANK3: NFC device bank 3 busy flag + * @arg EXMC_NFC_FLAG_RB_BANK4: NFC device bank 4 busy flag + * @arg EXMC_NFC_FLAG_RB_BANK5: NFC device bank 5 busy flag + * @arg EXMC_NFC_FLAG_RB_BANK6: NFC device bank 6 busy flag + * @arg EXMC_NFC_FLAG_RB_BANK7: NFC device bank 7 busy flag + * @param enStatus The waiting flag status (SET or RESET). + * @param u32Timeout Timeout duration + * @retval An en_result_t enumeration value: + * @arg Ok: Flag is right + * @arg ErrorTimeout: Wait timeout + * @note Block checking flag if u32Timeout value is EXMC_NFC_MAX_TIMEOUT + */ +static en_result_t EXMC_NFC_WaitFlagUntilTo(uint32_t u32Flag, + en_flag_status_t enStatus, + uint32_t u32Timeout) +{ + en_result_t enRet = Ok; + __IO uint32_t u32To = 0UL; + + /* Check parameters */ + DDL_ASSERT(IS_EXMC_NFC_FLAG(u32Flag)); + + while (EXMC_NFC_GetStatus(u32Flag) != enStatus) + { + /* Block checking flag if timeout value is EXMC_NFC_MAX_TIMEOUT */ + if ((u32To++ > u32Timeout) && (u32Timeout < EXMC_NFC_MAX_TIMEOUT)) + { + enRet = ErrorTimeout; + break; + } + } + + return enRet; +} + +/** + * @} + */ + +#endif /* DDL_NFC_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_ots.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_ots.c new file mode 100644 index 0000000000..7158e6f6dd --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_ots.c @@ -0,0 +1,445 @@ +/** + ******************************************************************************* + * @file hc32f4a0_ots.c + * @brief This file provides firmware functions to manage the OTS. + @verbatim + Change Logs: + Date Author Notes + 2020-08-11 Wuze First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_ots.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_OTS OTS + * @brief OTS Driver Library + * @{ + */ + +#if (DDL_OTS_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup OTS_Configuration_Bit_Mask OTS Configuration Bit Mask + * @{ + */ +#define OTS_CTL_INIT_MSK (OTS_CTL_OTSCK | OTS_CTL_TSSTP) +#define OTS_COM_TRIG_MSK (OTS_COM_TRIG1 | OTS_COM_TRIG2) +/** + * @} + */ + +/** + * @defgroup OTS_Ext_Reg_Address OTS Extension Register Address + * @{ + */ +#define OTS_PDR1_ADDR (0x40010600UL + 0xE0UL) +#define OTS_PDR2_ADDR (0x40010600UL + 0xF4UL) +#define OTS_PDR3_ADDR (0x40010600UL + 0xF8UL) +#define OTS_CR2_ADDR (0x4004A800UL + 0x10UL) +#define OTS_TMR_ADDR (0x4004A800UL + 0x12UL) +/** + * @} + */ + +/** + * @defgroup OTS_Check_Parameters_Validity OTS check parameters validity + * @{ + */ +#define IS_OTS_CLK(x) \ +( ((x) == OTS_CLK_HRC) || \ + ((x) == OTS_CLK_XTAL)) + +#define IS_OTS_AUTO_OFF_EN(x) \ +( ((x) == OTS_AUTO_OFF_DISABLE) || \ + ((x) == OTS_AUTO_OFF_ENABLE)) + +#define IS_OTS_COM_TRIGGER(x) \ +( ((x) != 0U) && \ + (((x) | OTS_COM_TRIG_MSK) == OTS_COM_TRIG_MSK)) + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ +static void OTS_GetDfltPara(const stc_ots_init_t *pstcInit); + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ +static float32_t m_f32SlopeK = 0.0f; +static float32_t m_f32OffsetM = 0.0f; + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup OTS_Global_Functions OTS Global Functions + * @{ + */ + +/** + * @brief Initializes OTS according to the specified parameters in the structure stc_ots_init_t. + * @param [in] pstcInit Pointer to a stc_ots_init_t structure value that + * contains the configuration information for OTS. + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg ErrorInvalidParameter: pstcInit == NULL. + */ +en_result_t OTS_Init(const stc_ots_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (pstcInit != NULL) + { + DDL_ASSERT(IS_OTS_CLK(pstcInit->u16ClkSrc)); + DDL_ASSERT(IS_OTS_AUTO_OFF_EN(pstcInit->u16AutoOffEn)); + + /* Stop OTS sampling. */ + OTS_Stop(); + + MODIFY_REG16(M4_OTS->CTL, OTS_CTL_INIT_MSK, (pstcInit->u16ClkSrc|pstcInit->u16AutoOffEn)); + + if ((pstcInit->f32SlopeK == 0.0f) && (pstcInit->f32OffsetM == 0.0f)) + { + OTS_GetDfltPara(pstcInit); + } + else + { + m_f32SlopeK = pstcInit->f32SlopeK; + m_f32OffsetM = pstcInit->f32OffsetM; + } + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set a default value for OTS initialization structure. + * @param [in] pstcInit Pointer to a stc_ots_init_t structure that + * contains configuration information. + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg ErrorInvalidParameter: pstcInit == NULL. + */ +en_result_t OTS_StructInit(stc_ots_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (pstcInit != NULL) + { + pstcInit->u16ClkSrc = OTS_CLK_HRC; + pstcInit->f32SlopeK = 0.0f; + pstcInit->f32OffsetM = 0.0f; + pstcInit->u16AutoOffEn = OTS_AUTO_OFF_ENABLE; + + pstcInit->stcParaCond.u16ClkFreq = 8U; + pstcInit->stcParaCond.u8T1 = OTS_COND_T25; + pstcInit->stcParaCond.u8T2 = OTS_COND_T125; + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief De-initializes OTS peripheral. Reset the registers of OTS. + * @param None + * @retval None + */ +void OTS_DeInit(void) +{ + /* Stop OTS. */ + OTS_Stop(); + /* Set the value of all registers to the reset value. */ + WRITE_REG16(M4_OTS->CTL, 0U); + WRITE_REG16(M4_OTS->DR1, 0U); + WRITE_REG16(M4_OTS->DR2, 0U); + WRITE_REG16(M4_OTS->ECR, 0U); +} + +/** + * @brief Get temperature via normal mode. + * @param [out] pf32Temp Pointer to a float32_t type address that the temperature value to be stored. + * @param [in] u32Timeout Timeout value. + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg ErrorTimeout: Works timeout. + * @arg ErrorInvalidParameter: pf32Temp == NULL. + */ +en_result_t OTS_Polling(float32_t *pf32Temp, uint32_t u32Timeout) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (pf32Temp != NULL) + { + enRet = ErrorTimeout; + + OTS_Start(); + do + { + if (READ_REG32(bM4_OTS->CTL_b.OTSST) == 0UL) + { + *pf32Temp = OTS_CalculateTemp(); + enRet = Ok; + break; + } + } while (u32Timeout-- != 0UL); + OTS_Stop(); + } + + return enRet; +} + +/** + * @brief Enable or disable the OTS interrutp. + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable the OTS interrupt. + * @arg Disable: Disable the OTS interrupt. + * @retval None + */ +void OTS_IntCmd(en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + WRITE_REG32(bM4_OTS->CTL_b.OTSIE, enNewState); +} + +/** + * @brief Specifies the event which is used to trigger OTS start. + * @param [in] enEvent An event of other peripheral. + * This parameter can be a value of @ref en_event_src_t except 'EVT_OTS'. + * @retval None + */ +void OTS_SetTriggerSrc(en_event_src_t enEvent) +{ + MODIFY_REG32(M4_AOS->OTS_TRG, AOS_OTS_TRG_TRGSEL, enEvent); +} + +/** + * @brief Enable or disable common trigger event to start OTS. + * @param [in] u32ComTrig Common trigger event enable bit mask. + * This parameter can be a value of @ref OTS_Common_Trigger_Sel + * @arg OTS_COM_TRIG1: Common trigger 1. + * @arg OTS_COM_TRIG2: Common trigger 2. + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable the specified common trigger. + * @arg Disable: Disable the specified common trigger. + * @retval None + */ +void OTS_ComTriggerCmd(uint32_t u32ComTrig, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_OTS_COM_TRIGGER(u32ComTrig)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (enNewState == Enable) + { + SET_REG32_BIT(M4_AOS->OTS_TRG, u32ComTrig); + } + else + { + CLEAR_REG32_BIT(M4_AOS->OTS_TRG, u32ComTrig); + } +} + +/** + * @brief OTS scaling experiment. Get the value of the data register at the specified temperature to calculate K and M. + * @param [out] pu16Dr1: Pointer to an address to store the value of data register 1. + * @param [out] pu16Dr2: Pointer to an address to store the value of data register 2. + * @param [out] pu16Ecr: Pointer to an address to store the value of register ECR. + * @param [out] pf32A: Pointer to an address to store the parameter A. + * @param [in] u32Timeout: Timeout value. + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg ErrorTimeout: Works timeout. + * @arg ErrorInvalidParameter: -pu16Dr1 == NULL. + * -pu16Dr2 == NULL. + * -pu16Ecr == NULL. + * -pf32A == NULL. + */ +en_result_t OTS_ScalingExperiment(uint16_t *pu16Dr1, uint16_t *pu16Dr2, \ + uint16_t *pu16Ecr, float32_t *pf32A, \ + uint32_t u32Timeout) +{ + float32_t f32Dr1; + float32_t f32Dr2; + float32_t f32Ecr; + en_result_t enRet = ErrorInvalidParameter; + + if ((NULL != pu16Dr1) && (NULL != pu16Dr2) && \ + (NULL != pu16Ecr) && (NULL != pf32A)) + { + enRet = ErrorTimeout; + OTS_Start(); + do + { + if (READ_REG32(bM4_OTS->CTL_b.OTSST) == 0UL) + { + enRet = Ok; + break; + } + } while (u32Timeout-- != 0UL); + OTS_Stop(); + + if (enRet == Ok) + { + *pu16Dr1 = READ_REG16(M4_OTS->DR1); + *pu16Dr2 = READ_REG16(M4_OTS->DR2); + + f32Dr1 = (float32_t)(*pu16Dr1); + f32Dr2 = (float32_t)(*pu16Dr2); + + if (READ_REG8_BIT(M4_OTS->CTL, OTS_CTL_OTSCK) == OTS_CLK_HRC) + { + *pu16Ecr = READ_REG16(M4_OTS->ECR); + f32Ecr = (float32_t)(*pu16Ecr); + } + else + { + *pu16Ecr = 1U; + f32Ecr = 1.0f; + } + + if ((*pu16Dr1 != 0U) && (*pu16Dr2 != 0U) && (*pu16Ecr != 0U)) + { + *pf32A = ((1.7f / f32Dr1) - (1.0f / f32Dr2)) * f32Ecr; + } + } + } + + return enRet; +} + +/** + * @brief Calculate the value of temperature. + * @param None + * @retval A float32_t type value of temperature value. + */ +float OTS_CalculateTemp(void) +{ + float32_t f32Ret = 0.0f; + uint16_t u16Dr1 = READ_REG16(M4_OTS->DR1); + uint16_t u16Dr2 = READ_REG16(M4_OTS->DR2); + uint16_t u16Ecr = READ_REG16(M4_OTS->ECR); + float32_t f32Dr1 = (float32_t)u16Dr1; + float32_t f32Dr2 = (float32_t)u16Dr2; + float32_t f32Ecr = (float32_t)u16Ecr; + + if (READ_REG8_BIT(M4_OTS->CTL, OTS_CTL_OTSCK) == OTS_CLK_XTAL) + { + f32Ecr = 1.0f; + } + + if ((u16Dr1 != 0U) && (u16Dr2 != 0U) && (u16Ecr != 0U)) + { + f32Ret = m_f32SlopeK * ((1.7f / f32Dr1) - (1.0f / f32Dr2)) * f32Ecr + m_f32OffsetM; + } + + return f32Ret; +} + +/** + * @} + */ + +/** + * @addtogroup OTS_Local_Functions OTS Local Functions + * @{ + */ + +/** + * @brief Get built-in slope K and offset M. + * @param [in] pstcInit Pointer to a stc_ots_init_t structure value that + * contains the configuration information for OTS. + * @retval None + */ +static void OTS_GetDfltPara(const stc_ots_init_t *pstcInit) +{ +#define OTS_SCAL_T1 (ai16Temp[pstcInit->stcParaCond.u8T1]) +#define OTS_SCAL_T2 (ai16Temp[pstcInit->stcParaCond.u8T2]) +#define OTS_SCAL_A1 (af32A[0U]) +#define OTS_SCAL_A2 (af32A[1U]) + + uint8_t i; + int16_t ai16Temp[] = {-40, 25, 125}; + uint32_t au32PDRAddr[] = {OTS_PDR3_ADDR, OTS_PDR1_ADDR, OTS_PDR2_ADDR}; + uint32_t au32PDR[2U]; + uint32_t u16D1; + uint32_t u16D2; + float32_t f32D1; + float32_t f32D2; + float32_t af32A[2U]; + float32_t f32Ehrc = 1.0f; + float32_t f32ClkFactor = (float32_t)pstcInit->stcParaCond.u16ClkFreq / 8.0f; + + au32PDR[0U] = RW_MEM32(au32PDRAddr[pstcInit->stcParaCond.u8T1]); + au32PDR[1U] = RW_MEM32(au32PDRAddr[pstcInit->stcParaCond.u8T2]); + + if (pstcInit->u16ClkSrc == OTS_CLK_HRC) + { + f32Ehrc = (float32_t)pstcInit->stcParaCond.u16ClkFreq / 0.032768f; + } + + for (i=0U; i<2U; i++) + { + u16D1 = (uint16_t)au32PDR[i]; + u16D2 = (uint16_t)(au32PDR[i] >> 16U); + f32D1 = ((float32_t)u16D1) * f32ClkFactor; + f32D2 = ((float32_t)u16D2) * f32ClkFactor; + af32A[i] = ((1.7f / f32D1) - (1.0f / f32D2)) * f32Ehrc; + } + m_f32SlopeK = ((float32_t)OTS_SCAL_T2 - (float32_t)OTS_SCAL_T1) / (OTS_SCAL_A2 - OTS_SCAL_A1); + m_f32OffsetM = (float32_t)OTS_SCAL_T2 - (m_f32SlopeK * OTS_SCAL_A2); +} + +/** + * @} + */ + +#endif /* DDL_OTS_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_pwc.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_pwc.c new file mode 100644 index 0000000000..15420d6ebc --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_pwc.c @@ -0,0 +1,1591 @@ +/** + ******************************************************************************* + * @file hc32f4a0_pwc.c + * @brief This file provides firmware functions to manage the Power Control(PWC). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Zhangxl First version + 2020-07-30 Zhangxl Refine power mode switch function + 2020-08-25 Zhangxl Modify for MISRAC2012-10.1 + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_pwc.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_PWC PWC + * @brief Power Control Driver Library + * @{ + */ + +#if (DDL_PWC_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup PWC_Local_Macros PWC Local Macros + * @{ + */ + +/* Get the backup register address of PWC */ +#define PWC_BKRx(num) ((uint32_t)(&(M4_PWC->BKR0)) + ((uint32_t)(num) << 2U)) + +#define PWC_FCG0_MASK \ + (PWC_FCG0_DCU8 | PWC_FCG0_DCU7 | PWC_FCG0_DCU6 | \ + PWC_FCG0_DCU5 | PWC_FCG0_DCU4 | PWC_FCG0_DCU3 | \ + PWC_FCG0_DCU2 | PWC_FCG0_DCU1 | PWC_FCG0_CRC | \ + PWC_FCG0_TRNG | PWC_FCG0_HASH | PWC_FCG0_AES | \ + PWC_FCG0_CORDIC | PWC_FCG0_CTC | PWC_FCG0_AOS | \ + PWC_FCG0_FCM | PWC_FCG0_DMA2 | PWC_FCG0_DMA1 | \ + PWC_FCG0_KEY | PWC_FCG0_SRAMB| PWC_FCG0_SRAM4 | \ + PWC_FCG0_SRAM3 | PWC_FCG0_SRAM2| PWC_FCG0_SRAM1 | \ + PWC_FCG0_SRAMH) + +#define PWC_FCG1_MASK \ + (PWC_FCG1_CAN1 | PWC_FCG1_CAN2 | PWC_FCG1_ETHER | \ + PWC_FCG1_QSPI | PWC_FCG1_IIC1 | PWC_FCG1_IIC2 | \ + PWC_FCG1_IIC3 | PWC_FCG1_IIC4 | PWC_FCG1_IIC5 | \ + PWC_FCG1_IIC6 | PWC_FCG1_SDIOC1|PWC_FCG1_SDIOC2 | \ + PWC_FCG1_I2S1 | PWC_FCG1_I2S2 | PWC_FCG1_I2S3 | \ + PWC_FCG1_I2S4 | PWC_FCG1_SPI1 | PWC_FCG1_SPI2 | \ + PWC_FCG1_SPI3 | PWC_FCG1_SPI4 | PWC_FCG1_SPI5 | \ + PWC_FCG1_SPI6 | PWC_FCG1_USBFS| PWC_FCG1_USBHS | \ + PWC_FCG1_FMAC1 | PWC_FCG1_FMAC2| PWC_FCG1_FMAC3 | \ + PWC_FCG1_FMAC4) +#define PWC_FCG2_MASK \ + (PWC_FCG2_TMR6_1| PWC_FCG2_TMR6_2 | PWC_FCG2_TMR6_3 | \ + PWC_FCG2_TMR6_4 | PWC_FCG2_TMR6_5 | PWC_FCG2_TMR6_6 | \ + PWC_FCG2_TMR6_7 | PWC_FCG2_TMR6_8 | PWC_FCG2_TMR4_1 | \ + PWC_FCG2_TMR4_2 | PWC_FCG2_TMR4_3 | PWC_FCG2_HRPWM | \ + PWC_FCG2_TMR0_1 | PWC_FCG2_TMR0_2 | PWC_FCG2_EMB | \ + PWC_FCG2_TMR2_1 | PWC_FCG2_TMR2_2 | PWC_FCG2_TMR2_3 | \ + PWC_FCG2_TMR2_4 | PWC_FCG2_TMRA_1 | PWC_FCG2_TMRA_2 | \ + PWC_FCG2_TMRA_3 | PWC_FCG2_TMRA_4 | PWC_FCG2_TMRA_5 | \ + PWC_FCG2_TMRA_6 | PWC_FCG2_TMRA_7 | PWC_FCG2_TMRA_8 | \ + PWC_FCG2_TMRA_9 | PWC_FCG2_TMRA_10| PWC_FCG2_TMRA_11| \ + PWC_FCG2_TMRA_12) +#define PWC_FCG3_MASK \ + (PWC_FCG3_ADC1 | PWC_FCG3_ADC2 | PWC_FCG3_ADC3 | \ + PWC_FCG3_DAC1 | PWC_FCG3_DAC2 | PWC_FCG3_CMP1 | \ + PWC_FCG3_CMP2 | PWC_FCG3_OTS | PWC_FCG3_DVP | \ + PWC_FCG3_SMC | PWC_FCG3_DMC | PWC_FCG3_NFC | \ + PWC_FCG3_USART1 | PWC_FCG3_USART2 | PWC_FCG3_USART3 | \ + PWC_FCG3_USART4 | PWC_FCG3_USART5 | PWC_FCG3_USART6 | \ + PWC_FCG3_USART7 | PWC_FCG3_USART8 | PWC_FCG3_USART9 | \ + PWC_FCG3_USART10| PWC_FCG3_CMBIAS) + +#define PWC_RAM_MASK \ + (PWC_RAMPC0_RAMPDC0 | PWC_RAMPC0_RAMPDC1 | PWC_RAMPC0_RAMPDC2 | \ + PWC_RAMPC0_RAMPDC3 | PWC_RAMPC0_RAMPDC4 | PWC_RAMPC0_RAMPDC5 | \ + PWC_RAMPC0_RAMPDC6 | PWC_RAMPC0_RAMPDC7 | PWC_RAMPC0_RAMPDC8 | \ + PWC_RAMPC0_RAMPDC9 | PWC_RAMPC0_RAMPDC10) + +#define PWC_PRAM_MASK \ + (PWC_PRAMLPC_PRAMPDC0 | PWC_PRAMLPC_PRAMPDC1 | \ + PWC_PRAMLPC_PRAMPDC2 | PWC_PRAMLPC_PRAMPDC3 | \ + PWC_PRAMLPC_PRAMPDC4 | PWC_PRAMLPC_PRAMPDC5 | \ + PWC_PRAMLPC_PRAMPDC6 | PWC_PRAMLPC_PRAMPDC7 | \ + PWC_PRAMLPC_PRAMPDC8 | PWC_PRAMLPC_PRAMPDC9) + +#define PWC_PVD_FLAG_MASK \ + (PWC_PVDDSR_PVD1MON | PWC_PVDDSR_PVD1DETFLG| \ + PWC_PVDDSR_PVD2MON | PWC_PVDDSR_PVD2DETFLG) + +#define PWC_PDWK0_MASK \ + (PWC_PDWKE0_WKE0_0 | PWC_PDWKE0_WKE0_1 | \ + PWC_PDWKE0_WKE0_2 | PWC_PDWKE0_WKE0_3 | \ + PWC_PDWKE0_WKE1_0 | PWC_PDWKE0_WKE1_1 | \ + PWC_PDWKE0_WKE1_2 | PWC_PDWKE0_WKE1_3) + +#define PWC_PDWK1_MASK \ + (PWC_PDWKE1_WKE2_0 | PWC_PDWKE1_WKE2_1 | \ + PWC_PDWKE1_WKE2_2 | PWC_PDWKE1_WKE2_3 | \ + PWC_PDWKE1_WKE3_0 | PWC_PDWKE1_WKE3_1 | \ + PWC_PDWKE1_WKE3_2 | PWC_PDWKE1_WKE3_3) + +#define PWC_PDWK2_MASK \ + (PWC_PDWKE2_VD1WKE | PWC_PDWKE2_VD2WKE | \ + PWC_PDWKE2_RTCPRDWKE| PWC_PDWKE2_RTCALMWKE | \ + PWC_PDWKE2_WKTMWKE | PWC_PDWKE2_XTAL32ERWKE) + +#define PWC_PDWK_FLG0_MASK \ + (PWC_PDWKF0_PTWK0F | PWC_PDWKF0_PTWK1F | \ + PWC_PDWKF0_PTWK2F | PWC_PDWKF0_PTWK3F | \ + PWC_PDWKF0_VD1WKF | PWC_PDWKF0_VD2WKF) + +#define PWC_PDWK_FLG1_MASK \ + (PWC_PDWKF1_RTCPRDWKF | PWC_PDWKF1_RTCALMWKF | \ + PWC_PDWKF1_XTAL32ERWKF | PWC_PDWKF1_WKTMWKF) + +/** + * @defgroup PWC_Check_Parameters_Validity PWC Check Parameters Validity + * @{ + */ +/* Check PWC register lock status. */ +#define IS_PWC_UNLOCKED() ((M4_PWC->FPRC & PWC_FPRC_FPRCB1) == PWC_FPRC_FPRCB1) + +/* Check PWC PVD register lock status. */ +#define IS_PVD_UNLOCKED() ((M4_PWC->FPRC & PWC_FPRC_FPRCB3) == PWC_FPRC_FPRCB3) + +#define IS_PWC_FCG0_UNLOCKED() ((M4_PWC->FCG0PC & PWC_FCG0PC_PRT0) == PWC_FCG0PC_PRT0) + +/*! Parameter validity check for peripheral in fcg0. */ +#define IS_PWC_FCG0_PERIPH(per) \ +( ((per) != 0x00UL) && \ + (((per) | PWC_FCG0_MASK) == PWC_FCG0_MASK)) + +/*! Parameter validity check for peripheral in fcg1. */ +#define IS_PWC_FCG1_PERIPH(per) \ +( ((per) != 0x00UL) && \ + (((per) | PWC_FCG1_MASK) == PWC_FCG1_MASK)) + +/*! Parameter validity check for peripheral in fcg2. */ +#define IS_PWC_FCG2_PERIPH(per) \ +( ((per) != 0x00UL) && \ + (((per) | PWC_FCG2_MASK) == PWC_FCG2_MASK)) + +/*! Parameter validity check for peripheral in fcg3. */ +#define IS_PWC_FCG3_PERIPH(per) \ +( ((per) != 0x00UL) && \ + (((per) | PWC_FCG3_MASK) == PWC_FCG3_MASK)) + +/*! Parameter validity check for internal RAM setting of power mode control */ +#define IS_PWC_RAM_CONTROL(ram) \ +( ((ram) != 0x00UL) && \ + (((ram) | PWC_RAM_MASK) == PWC_RAM_MASK)) + +/*! Parameter validity check for peripheral RAM setting of power mode control */ +#define IS_PWC_PRAM_CONTROL(pram) \ +( ((pram) != 0x00UL) && \ + (((pram) | PWC_PRAM_MASK) == PWC_PRAM_MASK)) + +/*! Parameter validity check for RAM setting of MCU operating mode */ +#define IS_PWC_RAM_MODE(mode) \ +( ((mode) == PWC_RAM_HIGH) || \ + ((mode) == PWC_RAM_LOW)) + +/*! Parameter validity check for PVD channel. */ +#define IS_PWC_PVD_CH(ch) \ +( ((ch) == PWC_PVD_CH1) || \ + ((ch) == PWC_PVD_CH2)) + +/*! Parameter validity check for PVD2 ext. input function setting. */ +#define IS_PWC_PVD2_EXINP(func) \ +( ((func) == PWC_PVD2_EXINP_ON) || \ + ((func) == PWC_PVD2_EXINP_OFF)) + +/*! Parameter validity check for PVD function setting. */ +#define IS_PWC_PVD_EN(func) \ +( ((func) == PWC_PVD_ON) || \ + ((func) == PWC_PVD_OFF)) + +/*! Parameter validity check for PVD interrupt or reset function setting. */ +#define IS_PWC_PVD_IR_EN(func) \ +( ((func) == PWC_PVD_IR_ON) || \ + ((func) == PWC_PVD_IR_OFF)) + +/*! Parameter validity check for PVD interrupt or reset selection. */ +#define IS_PWC_PVD_IR_SEL(sel) \ +( ((sel) == PWC_PVD_RST) || \ + ((sel) == PWC_PVD_INT)) + +/*! Parameter validity check for PVD compare output setting. */ +#define IS_PWC_PVD_CMP_EN(out) \ +( ((out) == PWC_PVD_CMP_ON) || \ + ((out) == PWC_PVD_CMP_OFF)) + +/*! Parameter validity check for PVD digital noise filter function setting. */ +#define IS_PWC_PVD_DFS_EN(func) \ +( ((func) == PWC_PVD_DF_ON) || \ + ((func) == PWC_PVD_DF_OFF)) + +/*! Parameter validity check for PVD digital noise filter clock setting. */ +#define IS_PWC_PVD_DFS_CLK(clk) \ +( ((clk) == PWC_PVD_DFS_DIV1) || \ + ((clk) == PWC_PVD_DFS_DIV2) || \ + ((clk) == PWC_PVD_DFS_DIV4) || \ + ((clk) == PWC_PVD_DFS_MUL2)) + +/*! Parameter validity check for PVD detect voltage setting. */ +#define IS_PWC_PVD_VOLTAGE(vol) \ +( ((vol) == PWC_PVD1_2V0_PVD2_2V1) || \ + ((vol) == PWC_PVD1_2V1_PVD2_2V3) || \ + ((vol) == PWC_PVD1_2V3_PVD2_2V5) || \ + ((vol) == PWC_PVD1_2V5_PVD2_2V6) || \ + ((vol) == PWC_PVD1_2V6_PVD2_2V7) || \ + ((vol) == PWC_PVD1_2V7_PVD2_2V8) || \ + ((vol) == PWC_PVD1_2V8_PVD2_2V9) || \ + ((vol) == PWC_PVD1_2V9_PVD2_1V1)) + +/*! Parameter validity check for PVD NMI function setting. */ +#define IS_PWC_PVD_NMI(func) \ +( ((func) == PWC_PVD_INT_MASK) || \ + ((func) == PWC_PVD_INT_NONMASK)) + +/*! Parameter validity check for PVD trigger setting. */ +#define IS_PWC_PVD_TRIG(trig) \ +( ((trig) == PWC_PVD_TRIGGER_FALLING) || \ + ((trig) == PWC_PVD_TRIGGER_RISING) || \ + ((trig) == PWC_PVD_TRIGGER_BOTH)) + +/*! Parameter validity check for PVD flag. */ +#define IS_PWC_PVD_GET_FLAG(flag) \ +( ((flag) != 0x00U) && \ + (((flag) | PWC_PVD_FLAG_MASK) == PWC_PVD_FLAG_MASK)) + +/*! Parameter validity check for wakeup0 event. */ +#define IS_PWC_WAKEUP0_EVENT(evt) \ +( ((evt) != 0x00U) && \ + (((evt) | PWC_PDWK0_MASK) == PWC_PDWK0_MASK)) + +/*! Parameter validity check for wakeup1 event. */ +#define IS_PWC_WAKEUP1_EVENT(evt) \ +( ((evt) != 0x00U) && \ + (((evt) | PWC_PDWK1_MASK) == PWC_PDWK1_MASK)) + +/*! Parameter validity check for wakeup2 event. */ +#define IS_PWC_WAKEUP2_EVENT(evt) \ +( ((evt) != 0x00U) && \ + (((evt) | PWC_PDWK2_MASK) == PWC_PDWK2_MASK)) + +/*! Parameter validity check for wakeup0 flag. */ +#define IS_PWC_WAKEUP0_FLAG(flag) \ +( ((flag) != 0x00U) && \ + (((flag) | PWC_PDWK_FLG0_MASK) == PWC_PDWK_FLG0_MASK)) + +/*! Parameter validity check for wakeup1 flag. */ +#define IS_PWC_WAKEUP1_FLAG(flag) \ +( ((flag) != 0x00U) && \ + (((flag) | PWC_PDWK_FLG1_MASK) == PWC_PDWK_FLG1_MASK)) + +/*! Parameter validity check for power down mode wakeup event with trigger. */ +#define IS_PWC_WAKEUP_TRIG_EVENT(evt) \ +( ((evt) != 0x00U) && \ + (((evt) | PWC_PD_WKUP_TRIG_MASK) == PWC_PD_WKUP_TRIG_MASK)) + +/*! Parameter validity check for power down mode wakeup trigger edge. */ +#define IS_PWC_WAKEUP_TRIG(edge) \ +( ((edge) == PWC_PD_WKUP_FALLING) || \ + ((edge) == PWC_PD_WKUP_RISING)) + +/*! Parameter validity check for wake up flag. */ +#define IS_PWC_WKUP0_FLAG(flag) \ +( ((flag) != 0x00U) && \ + (((flag) | PWC_PDWK_FLG0_MASK) == PWC_PDWK_FLG0_MASK)) + +/*! Parameter validity check for wake up flag. */ +#define IS_PWC_WKUP1_FLAG(flag) \ +( ((flag) != 0x00U) && \ + (((flag) | PWC_PDWK_FLG1_MASK) == PWC_PDWK_FLG1_MASK)) + +/*! Parameter validity check for stop mode drive capacity. */ +#define IS_PWC_STOP_DRV(drv) \ +( ((drv) == PWC_STOP_DRV_HIGH) || \ + ((drv) == PWC_STOP_DRV_LOW)) + +/*! Parameter validity check for clock setting after wake-up from stop mode. */ +#define IS_PWC_STOP_CLK(clk) \ +( ((clk) == PWC_STOP_CLK_KEEP) || \ + ((clk) == PWC_STOP_CLK_MRC)) + +/*! Parameter validity check for flash wait setting after wake-up from stop mode. */ +#define IS_PWC_STOP_FLASH_WAIT(wait) \ +( ((wait) == PWC_STOP_FLASH_WAIT) || \ + ((wait) == PWC_STOP_FLASH_NOWAIT)) + +/*! Parameter validity check for ex-bus setting in stop mode. */ +#define IS_PWC_STOP_EXBUS(bus) \ +( ((bus) == PWC_STOP_EXBUS_HIZ) || \ + ((bus) == PWC_STOP_EXBUS_HOLD)) + +/*! Parameter validity check for VBAT Reference Voltage. */ +#define IS_PWC_VBAT_REF_VOL(vol) \ +( ((vol) == PWC_VBAT_REF_VOL_2P0V) || \ + ((vol) == PWC_VBAT_REF_VOL_1P8V)) + +/*! Parameter validity check for BACKUP RAM Flag. */ +#define IS_PWC_BACKUP_RAM_FLAG(flag) \ +( 0U != ((flag) & (PWC_BACKUP_RAM_FLAG_RAMPDF | PWC_BACKUP_RAM_FLAG_RAMVALID))) + +/*! Parameter validity check for Backup Register Number. */ +#define IS_PWC_BACKUP_REGISTER_NUMBER(num) ((num) <= 127U) + +/*! Parameter validity check for WKT Clock Source. */ +#define IS_PWC_WKT_CLK_SRC(src) \ +( ((src) == PWC_WKT_CLK_SRC_64HZ) || \ + ((src) == PWC_WKT_CLK_SRC_XTAL32) || \ + ((src) == PWC_WKT_CLK_SRC_RTCLRC)) + +/*! Parameter validity check for WKT Comparision Value. */ +#define IS_PWC_WKT_COMPARISION_VALUE(val) ((val) <= 0x0FFFU) + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup PWC_Global_Functions PWC Global Functions + * @{ + */ +/** + * @brief Enter power down mode. + * @param None + * @retval None + */ +void PWC_EnterPowerDownMode(void) +{ + DDL_ASSERT(IS_PWC_UNLOCKED()); + + WRITE_REG32(bM4_PWC->STPMCR_b.STOP, 1U); + WRITE_REG32(bM4_PWC->PWRC0_b.PWDN, 1U); + + __WFI(); +} + +/** + * @brief Enter stop mode. + * @param None + * @retval None + */ +void PWC_EnterStopMode(void) +{ + DDL_ASSERT(IS_PWC_UNLOCKED()); + + WRITE_REG32(bM4_PWC->STPMCR_b.STOP, 1U); + + __WFI(); +} + +/** + * @brief Enter sleep mode. + * @param None + * @retval None + */ +void PWC_EnterSleepMode(void) +{ + DDL_ASSERT(IS_PWC_UNLOCKED()); + + WRITE_REG32(bM4_PWC->STPMCR_b.STOP, 0U); + + __WFI(); +} + +/** + * @brief Enable or disable the FCG0 peripheral clock. + * @param [in] u32Fcg0Periph The peripheral in FCG0. + * @arg PWC_FCG0_SRAMH + * @arg PWC_FCG0_SRAM1 + * @arg PWC_FCG0_SRAM2 + * @arg PWC_FCG0_SRAM3 + * @arg PWC_FCG0_SRAM4 + * @arg PWC_FCG0_SRAMB + * @arg PWC_FCG0_KEY + * @arg PWC_FCG0_DMA1 + * @arg PWC_FCG0_DMA2 + * @arg PWC_FCG0_FCM + * @arg PWC_FCG0_AOS + * @arg PWC_FCG0_CTC + * @arg PWC_FCG0_CORDIC + * @arg PWC_FCG0_AES + * @arg PWC_FCG0_HASH + * @arg PWC_FCG0_TRNG + * @arg PWC_FCG0_CRC + * @arg PWC_FCG0_DCU1 + * @arg PWC_FCG0_DCU2 + * @arg PWC_FCG0_DCU3 + * @arg PWC_FCG0_DCU4 + * @arg PWC_FCG0_DCU5 + * @arg PWC_FCG0_DCU6 + * @arg PWC_FCG0_DCU7 + * @arg PWC_FCG0_DCU8 + * @param [in] enNewState The new state of the clock output. + * @arg Enable + * @arg Disable + * @retval None + */ +void PWC_Fcg0PeriphClockCmd(uint32_t u32Fcg0Periph, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_PWC_FCG0_PERIPH(u32Fcg0Periph)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_PWC_FCG0_UNLOCKED()); + + if(Enable == enNewState) + { + CLEAR_REG32_BIT(M4_PWC->FCG0, u32Fcg0Periph); + } + else + { + SET_REG32_BIT(M4_PWC->FCG0, u32Fcg0Periph); + } +} + +/** + * @brief Enable or disable the FCG1 peripheral clock. + * @param [in] u32Fcg1Periph The peripheral in FCG1. + * @arg PWC_FCG1_CAN1 + * @arg PWC_FCG1_CAN2 + * @arg PWC_FCG1_ETHER + * @arg PWC_FCG1_QSPI + * @arg PWC_FCG1_IIC1 + * @arg PWC_FCG1_IIC2 + * @arg PWC_FCG1_IIC3 + * @arg PWC_FCG1_IIC4 + * @arg PWC_FCG1_IIC5 + * @arg PWC_FCG1_IIC6 + * @arg PWC_FCG1_SDIOC1 + * @arg PWC_FCG1_SDIOC2 + * @arg PWC_FCG1_I2S1 + * @arg PWC_FCG1_I2S2 + * @arg PWC_FCG1_I2S3 + * @arg PWC_FCG1_I2S4 + * @arg PWC_FCG1_SPI1 + * @arg PWC_FCG1_SPI2 + * @arg PWC_FCG1_SPI3 + * @arg PWC_FCG1_SPI4 + * @arg PWC_FCG1_SPI5 + * @arg PWC_FCG1_SPI6 + * @arg PWC_FCG1_USBFS + * @arg PWC_FCG1_USBHS + * @arg PWC_FCG1_FMAC1 + * @arg PWC_FCG1_FMAC2 + * @arg PWC_FCG1_FMAC3 + * @arg PWC_FCG1_FMAC4 + * @param [in] enNewState The new state of the clock output. + * @arg Enable + * @arg Disable + * @retval None + */ +void PWC_Fcg1PeriphClockCmd(uint32_t u32Fcg1Periph, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_PWC_FCG1_PERIPH(u32Fcg1Periph)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if(Enable == enNewState) + { + CLEAR_REG32_BIT(M4_PWC->FCG1, u32Fcg1Periph); + } + else + { + SET_REG32_BIT(M4_PWC->FCG1, u32Fcg1Periph); + } +} + +/** + * @brief Enable or disable the FCG2 peripheral clock. + * @param [in] u32Fcg2Periph The peripheral in FCG2. + * @arg PWC_FCG2_TMR6_1 + * @arg PWC_FCG2_TMR6_2 + * @arg PWC_FCG2_TMR6_3 + * @arg PWC_FCG2_TMR6_4 + * @arg PWC_FCG2_TMR6_5 + * @arg PWC_FCG2_TMR6_6 + * @arg PWC_FCG2_TMR6_7 + * @arg PWC_FCG2_TMR6_8 + * @arg PWC_FCG2_TMR4_1 + * @arg PWC_FCG2_TMR4_2 + * @arg PWC_FCG2_TMR4_3 + * @arg PWC_FCG2_HRPWM + * @arg PWC_FCG2_TMR0_1 + * @arg PWC_FCG2_TMR0_2 + * @arg PWC_FCG2_EMB + * @arg PWC_FCG2_TMR2_1 + * @arg PWC_FCG2_TMR2_2 + * @arg PWC_FCG2_TMR2_3 + * @arg PWC_FCG2_TMR2_4 + * @arg PWC_FCG2_TMRA_1 + * @arg PWC_FCG2_TMRA_2 + * @arg PWC_FCG2_TMRA_3 + * @arg PWC_FCG2_TMRA_4 + * @arg PWC_FCG2_TMRA_5 + * @arg PWC_FCG2_TMRA_6 + * @arg PWC_FCG2_TMRA_7 + * @arg PWC_FCG2_TMRA_8 + * @arg PWC_FCG2_TMRA_9 + * @arg PWC_FCG2_TMRA_10 + * @arg PWC_FCG2_TMRA_11 + * @arg PWC_FCG2_TMRA_12 + * @param [in] enNewState The new state of the clock output. + * @arg Enable + * @arg Disable + * @retval None + */ +void PWC_Fcg2PeriphClockCmd(uint32_t u32Fcg2Periph, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_PWC_FCG2_PERIPH(u32Fcg2Periph)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if(Enable == enNewState) + { + CLEAR_REG32_BIT(M4_PWC->FCG2, u32Fcg2Periph); + } + else + { + SET_REG32_BIT(M4_PWC->FCG2, u32Fcg2Periph); + } +} + +/** + * @brief Enable or disable the FCG3 peripheral clock. + * @param [in] u32Fcg3Periph The peripheral in FCG3. + * @arg PWC_FCG3_ADC1 + * @arg PWC_FCG3_ADC2 + * @arg PWC_FCG3_ADC3 + * @arg PWC_FCG3_CMBIAS + * @arg PWC_FCG3_DAC1 + * @arg PWC_FCG3_DAC2 + * @arg PWC_FCG3_CMP1 + * @arg PWC_FCG3_CMP2 + * @arg PWC_FCG3_OTS + * @arg PWC_FCG3_DVP + * @arg PWC_FCG3_SMC + * @arg PWC_FCG3_DMC + * @arg PWC_FCG3_NFC + * @arg PWC_FCG3_USART1 + * @arg PWC_FCG3_USART2 + * @arg PWC_FCG3_USART3 + * @arg PWC_FCG3_USART4 + * @arg PWC_FCG3_USART5 + * @arg PWC_FCG3_USART6 + * @arg PWC_FCG3_USART7 + * @arg PWC_FCG3_USART8 + * @arg PWC_FCG3_USART9 + * @arg PWC_FCG3_USART10 + * @param [in] enNewState The new state of the clock output. + * @arg Enable + * @arg Disable + * @retval None + */ +void PWC_Fcg3PeriphClockCmd(uint32_t u32Fcg3Periph, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_PWC_FCG3_PERIPH(u32Fcg3Periph)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if(Enable == enNewState) + { + CLEAR_REG32_BIT(M4_PWC->FCG3, u32Fcg3Periph); + } + else + { + SET_REG32_BIT(M4_PWC->FCG3, u32Fcg3Periph); + } +} + +/** + * @brief RAM configuration for MCU operating mode and power down control. + * @param [in] pstcRamConfig Pointer to a stc_pwc_ram_config_t structure that + * contains configuration information. + * @arg u32RamCtrl Internal RAM setting for power mode. + * PWC_RAMPC0_RAMPDC0: 0x20000000 ~ 0x2000FFFF + * PWC_RAMPC0_RAMPDC1: 0x20010000 ~ 0x2001FFFF + * PWC_RAMPC0_RAMPDC2: 0x20020000 ~ 0x2002FFFF + * PWC_RAMPC0_RAMPDC3: 0x20030000 ~ 0x2003FFFF + * PWC_RAMPC0_RAMPDC4: 0x20040000 ~ 0x2004FFFF + * PWC_RAMPC0_RAMPDC5: 0x20050000 ~ 0x20057FFF + * PWC_RAMPC0_RAMPDC6: 0x20058000 ~ 0x2005FFFF + * PWC_RAMPC0_RAMPDC7: 0x1FFE0000 ~ 0x1FFE7FFF + * PWC_RAMPC0_RAMPDC8: 0x1FFE8000 ~ 0x1FFEFFFF + * PWC_RAMPC0_RAMPDC9: 0x1FFF0000 ~ 0x1FFF7FFF + * PWC_RAMPC0_RAMPDC10: 0x1FFF8000 ~ 0x1FFFFFFF + * @arg u32PRamCtrl Peripheral RAM setting for power mode. + * PWC_PRAMLPC_PRAMPDC0: CAN1 RAM + * PWC_PRAMLPC_PRAMPDC1: CAN2 RAM + * PWC_PRAMLPC_PRAMPDC2: CACHE RAM + * PWC_PRAMLPC_PRAMPDC3: USBFS RAM + * PWC_PRAMLPC_PRAMPDC4: USBHS RAM + * PWC_PRAMLPC_PRAMPDC5: Ethernet Tx RAM + * PWC_PRAMLPC_PRAMPDC6: Ethernet Rx RAM + * PWC_PRAMLPC_PRAMPDC7: SDIO1 RAM + * PWC_PRAMLPC_PRAMPDC8: SDIO2 RAM + * PWC_PRAMLPC_PRAMPDC9: NFC RAM + * @arg u16RamMode RAM setting for Operating mode. + * PWC_RAM_HIGH MCU operating under high frequency (lower than 240MHz) + * PWC_RAM_LOW MCU operating under low frequency (lower than 8MHz) + * @retval Ok: RAM config successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t PWC_RamConfig(const stc_pwc_ram_config_t *pstcRamConfig) +{ + en_result_t enRet = Ok; + + /* Check if pointer is NULL */ + if (NULL == pstcRamConfig) + { + enRet = ErrorInvalidParameter; + } + else + { + DDL_ASSERT(IS_PWC_RAM_CONTROL(pstcRamConfig->u32RamCtrl)); + DDL_ASSERT(IS_PWC_PRAM_CONTROL(pstcRamConfig->u32PRamCtrl)); + DDL_ASSERT(IS_PWC_RAM_MODE(pstcRamConfig->u16RamMode)); + DDL_ASSERT(IS_PWC_UNLOCKED()); + + WRITE_REG32(M4_PWC->RAMPC0, pstcRamConfig->u32RamCtrl); + WRITE_REG32(M4_PWC->PRAMLPC, pstcRamConfig->u32PRamCtrl); + WRITE_REG16(M4_PWC->RAMOPM, pstcRamConfig->u16RamMode); + } + return enRet; +} + +/** + * @brief Initialize PVD config structure. Fill each pstcPvdConfig with default value + * @param [in] pstcPvdConfig Pointer to a stc_pwc_pvd_config_t structure that + * contains configuration information. + * @retval Ok: PVD structure initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t PWC_PVD_StructInit(stc_pwc_pvd_config_t *pstcPvdConfig) +{ + en_result_t enRet = Ok; + /* Check if pointer is NULL */ + if (NULL == pstcPvdConfig) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Reset PVD init structure parameters values */ + pstcPvdConfig->u8PvdEn = PWC_PVD_OFF; + pstcPvdConfig->u8Pvd2ExtInEn = PWC_PVD2_EXINP_OFF; + pstcPvdConfig->u8PvdCmpOutEn = PWC_PVD_CMP_OFF; + pstcPvdConfig->u8PvdIntRstSel = PWC_PVD_INT; + pstcPvdConfig->u8PvdIntRstEn = PWC_PVD_IR_OFF; + pstcPvdConfig->u8FilterEn = PWC_PVD_DF_ON; + pstcPvdConfig->u8FilterClk = PWC_PVD_DFS_DIV4; + pstcPvdConfig->u8PvdVoltage = PWC_PVD1_2V0_PVD2_2V1; + pstcPvdConfig->u8PvdNmiEn = PWC_PVD_INT_NONMASK; + pstcPvdConfig->u8PvdTrigger = PWC_PVD_TRIGGER_FALLING; + } + return enRet; +} + +/** + * @brief PVD configuration. + * @param [in] u8Ch PVD channel + * @arg PWC_PVD_CH1 + * @arg PWC_PVD_CH2 + * @param [in] pstcPvdConfig Pointer to a stc_pwc_pvd_config_t structure that + * contains configuration information. + * @retval Ok: PVD initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t PWC_PVD_Init(uint8_t u8Ch, const stc_pwc_pvd_config_t *pstcPvdConfig) +{ + en_result_t enRet = Ok; + + /* Check if pointer is NULL */ + if (NULL == pstcPvdConfig) + { + enRet = ErrorInvalidParameter; + } + else + { + DDL_ASSERT(IS_PVD_UNLOCKED()); + DDL_ASSERT(IS_PWC_PVD_CH(u8Ch)); + DDL_ASSERT(IS_PWC_PVD2_EXINP(pstcPvdConfig->u8Pvd2ExtInEn)); + DDL_ASSERT(IS_PWC_PVD_EN(pstcPvdConfig->u8PvdEn)); + DDL_ASSERT(IS_PWC_PVD_IR_EN(pstcPvdConfig->u8PvdIntRstEn)); + DDL_ASSERT(IS_PWC_PVD_IR_SEL(pstcPvdConfig->u8PvdIntRstSel)); + DDL_ASSERT(IS_PWC_PVD_CMP_EN(pstcPvdConfig->u8PvdCmpOutEn)); + DDL_ASSERT(IS_PWC_PVD_DFS_EN(pstcPvdConfig->u8FilterEn)); + DDL_ASSERT(IS_PWC_PVD_DFS_CLK(pstcPvdConfig->u8FilterClk)); + DDL_ASSERT(IS_PWC_PVD_VOLTAGE(pstcPvdConfig->u8PvdVoltage)); + DDL_ASSERT(IS_PWC_PVD_NMI(pstcPvdConfig->u8PvdNmiEn)); + DDL_ASSERT(IS_PWC_PVD_TRIG(pstcPvdConfig->u8PvdTrigger)); + + if (PWC_PVD_CH1 == u8Ch) + { + WRITE_REG32(bM4_PWC->PVDCR0_b.PVD1EN, pstcPvdConfig->u8PvdEn); + } + else + { + WRITE_REG32(bM4_PWC->PVDCR0_b.PVD2EN, pstcPvdConfig->u8PvdEn); + WRITE_REG32(bM4_PWC->PVDCR0_b.EXVCCINEN, pstcPvdConfig->u8Pvd2ExtInEn); + + } + /* config PVDCMPOE before PVDIRE */ + MODIFY_REG8(M4_PWC->PVDCR1, \ + (PWC_PVDCR1_PVD1CMPOE << (uint8_t)(u8Ch * 4U)), \ + (pstcPvdConfig->u8PvdCmpOutEn) << (uint8_t)(u8Ch * 4U)); + + MODIFY_REG8(M4_PWC->PVDCR1, \ + (PWC_PVDCR1_PVD1IRE | PWC_PVDCR1_PVD1IRS) << (uint8_t)(u8Ch * 4U), \ + (pstcPvdConfig->u8PvdIntRstSel | pstcPvdConfig->u8PvdIntRstEn) << (uint8_t)(u8Ch * 4U)); + if (PWC_PVD_DF_ON == pstcPvdConfig->u8FilterEn) + { + /* disable filter function in advance */ + SET_REG8_BIT(M4_PWC->PVDFCR, PWC_PVDFCR_PVD1NFDIS << (uint8_t)(u8Ch * 4U)); + } + MODIFY_REG8(M4_PWC->PVDFCR, \ + (PWC_PVDFCR_PVD1NFDIS | PWC_PVDFCR_PVD1NFCKS) << (uint8_t)(u8Ch * 4U), \ + (pstcPvdConfig->u8FilterEn | pstcPvdConfig->u8FilterClk) << (uint8_t)(u8Ch * 4U)); + + MODIFY_REG8(M4_PWC->PVDLCR, (PWC_PVDLCR_PVD1LVL << (uint8_t)(u8Ch * 4U)), \ + (pstcPvdConfig->u8PvdVoltage) << (uint8_t)(u8Ch * 4U)); + + MODIFY_REG8(M4_PWC->PVDICR, \ + (PWC_PVDICR_PVD1NMIS | PWC_PVDICR_PVD1EDGS) << (uint8_t)(u8Ch * 4U), \ + (pstcPvdConfig->u8PvdNmiEn | pstcPvdConfig->u8PvdTrigger) << (uint8_t)(u8Ch * 4U)); + } + return enRet; +} + +/** + * @brief Get PVD flag. + * @param [in] u8Flag PVD flag to be get + * @arg PWC_PVDDSR_PVD1DETFLG: VCC across VPVD1 + * @arg PWC_PVDDSR_PVD2DETFLG: VCC across VPVD2 + * @arg PWC_PVDDSR_PVD1MON: VCC > VPVD1 + * @arg PWC_PVDDSR_PVD2MON: VCC > VPVD2 + * @retval An en_flag_status_t enumeration value + * @arg Set + * @arg Reset + * @note PVDxDETFLG is avaliable when PVDCR0.PVDxEN and PVDCR1.PVDxCMPOE are set to '1' + */ +en_flag_status_t PWC_PVD_GetStatus(uint8_t u8Flag) +{ + DDL_ASSERT(IS_PWC_PVD_GET_FLAG(u8Flag)); + return READ_REG8_BIT(M4_PWC->PVDDSR, u8Flag) ? Set:Reset; +} + +/** + * @brief Clear PVD1 & PVD2 flag. + * @param None + * @retval None + */ +void PWC_PVD_ClearStatus(void) +{ + DDL_ASSERT(IS_PVD_UNLOCKED()); + WRITE_REG32(bM4_PWC->PVDDSR_b.PVD1DETFLG, 0UL); +} + +/** + * @brief Power down mode wake up event config. + * @param [in] u8Wkup0Evt Wakeup pin group 0 and 1. + * @arg PWC_PDWKE0_WKE0_0 + * @arg PWC_PDWKE0_WKE0_1 + * @arg PWC_PDWKE0_WKE0_2 + * @arg PWC_PDWKE0_WKE0_3 + * @arg PWC_PDWKE0_WKE1_0 + * @arg PWC_PDWKE0_WKE1_1 + * @arg PWC_PDWKE0_WKE1_2 + * @arg PWC_PDWKE0_WKE1_3 + * @param [in] enNewState The new state of the wakeup event. + * @arg Enable + * @arg Disable + * @retval None + */ +void PWC_PdWakeup0Cmd(uint8_t u8Wkup0Evt, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_PWC_WAKEUP0_EVENT(u8Wkup0Evt)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_PWC_UNLOCKED()); + + if(Enable == enNewState) + { + SET_REG8_BIT(M4_PWC->PDWKE0, u8Wkup0Evt); + } + else + { + CLEAR_REG8_BIT(M4_PWC->PDWKE0, u8Wkup0Evt); + } +} + +/** + * @brief Power down mode wake up event config. + * @param [in] u8Wkup1Evt Wakeup pin group 0 and 1. + * @arg PWC_PDWKE1_WKE2_0 + * @arg PWC_PDWKE1_WKE2_1 + * @arg PWC_PDWKE1_WKE2_2 + * @arg PWC_PDWKE1_WKE2_3 + * @arg PWC_PDWKE1_WKE3_0 + * @arg PWC_PDWKE1_WKE3_1 + * @arg PWC_PDWKE1_WKE3_2 + * @arg PWC_PDWKE1_WKE3_3 + * @param [in] enNewState The new state of the wakeup event. + * @arg Enable + * @arg Disable + * @retval None + */ +void PWC_PdWakeup1Cmd(uint8_t u8Wkup1Evt, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_PWC_WAKEUP1_EVENT(u8Wkup1Evt)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_PWC_UNLOCKED()); + + if(Enable == enNewState) + { + SET_REG8_BIT(M4_PWC->PDWKE1, u8Wkup1Evt); + } + else + { + CLEAR_REG8_BIT(M4_PWC->PDWKE1, u8Wkup1Evt); + } +} + +/** + * @brief Power down mode wake up event config. + * @param [in] u8Wkup2Evt PVD, RTC, XTAL32 and wakeup timer. + * @arg PWC_PDWKE2_VD1WKE + * @arg PWC_PDWKE2_VD2WKE + * @arg PWC_PDWKE2_RTCPRDWKE + * @arg PWC_PDWKE2_RTCALMWKE + * @arg PWC_PDWKE2_XTAL32ERWKE + * @arg PWC_PDWKE2_WKTMWKE + * @param [in] enNewState The new state of the wakeup event. + * @arg Enable + * @arg Disable + * @retval None + */ +void PWC_PdWakeup2Cmd(uint8_t u8Wkup2Evt, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_PWC_WAKEUP2_EVENT(u8Wkup2Evt)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_PWC_UNLOCKED()); + + if(Enable == enNewState) + { + SET_REG8_BIT(M4_PWC->PDWKE2, u8Wkup2Evt); + } + else + { + CLEAR_REG8_BIT(M4_PWC->PDWKE2, u8Wkup2Evt); + } +} + +/** + * @brief Power down mode wake up event trigger config. + * @param [in] u8WkupEvt PVD and wakeup pin. + * @arg PWC_PD_WKUP_PVD1 + * @arg PWC_PD_WKUP_PVD2 + * @arg PWC_PD_WKUP_WKP0 + * @arg PWC_PD_WKUP_WKP1 + * @arg PWC_PD_WKUP_WKP2 + * @arg PWC_PD_WKUP_WKP3 + * @param [in] u8TrigEdge The trigger edge. + * @arg PWC_PD_WKUP_FALLING + * @arg PWC_PD_WKUP_RISING + * @retval None + */ +void PWC_PdWakeupTrigConfig(uint8_t u8WkupEvt, uint8_t u8TrigEdge) +{ + DDL_ASSERT(IS_PWC_WAKEUP_TRIG_EVENT(u8WkupEvt)); + DDL_ASSERT(IS_PWC_WAKEUP_TRIG(u8TrigEdge)); + DDL_ASSERT(IS_PWC_UNLOCKED()); + + if (PWC_PD_WKUP_RISING == u8TrigEdge) + { + SET_REG8_BIT(M4_PWC->PDWKES, u8WkupEvt); + } + else + { + CLEAR_REG8_BIT(M4_PWC->PDWKES, u8WkupEvt); + } +} + +/** + * @brief Get wake up event flag. + * @param [in] u8Flag Wake up event. + * @arg PWC_PDWKF0_PTWK0F + * @arg PWC_PDWKF0_PTWK1F + * @arg PWC_PDWKF0_PTWK2F + * @arg PWC_PDWKF0_PTWK3F + * @arg PWC_PDWKF0_VD1WKF + * @arg PWC_PDWKF0_VD2WKF + * @retval en_flag_status_t + */ +en_flag_status_t PWC_GetWakeup0Status(uint8_t u8Flag) +{ + DDL_ASSERT(IS_PWC_WKUP0_FLAG(u8Flag)); + + return (READ_REG8_BIT(M4_PWC->PDWKF0, u8Flag) ? Set : Reset); +} + +/** + * @brief Get wake up event flag. + * @param [in] u8Flag Wake up event. + * @arg PWC_PDWKF1_RTCPRDWKF + * @arg PWC_PDWKF1_RTCALMWKF + * @arg PWC_PDWKF1_XTAL32ERWK + * @arg PWC_PDWKF1_WKTMWKF + * @retval en_flag_status_t + */ +en_flag_status_t PWC_GetWakeup1Status(uint8_t u8Flag) +{ + DDL_ASSERT(IS_PWC_WKUP1_FLAG(u8Flag)); + + return (READ_REG8_BIT(M4_PWC->PDWKF1, u8Flag) ? Set : Reset); +} + +/** + * @brief HRC clock power config. + * @param [in] enNewState The new state of HRC power state. + * @arg Enable + * @arg Disable + * @retval None + */ +void PWC_HrcPwrCmd(en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_PWC_UNLOCKED()); + + WRITE_REG32(bM4_PWC->PWRC1_b.VHRCSD, enNewState); +} + +/** + * @brief PLLA & PLLH clock power config. + * @param [in] enNewState The new state of PLLA & PLLH power state. + * @arg Enable + * @arg Disable + * @retval None + */ +void PWC_PllPwrCmd(en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_PWC_UNLOCKED()); + + if (Enable == enNewState) + { + SET_REG8_BIT(M4_PWC->PWRC1, PWC_PWRC1_VPLLSD); + } + else + { + CLEAR_REG8_BIT(M4_PWC->PWRC1, PWC_PWRC1_VPLLSD); + } +} + +/** + * @brief Switch high speed to ultra low speed, set the drive ability. + * @param None + * @retval Ok: Mode switch successful. + * Error: Mode switch failure, check whether EFM was unlocked please. + * @note Before calling this API, please switch system clock to the required + * low speed frequency in advance, and make sure NO any flash program + * or erase operation background. + */ +en_result_t PWC_HighSpeedToLowSpeed(void) +{ + en_result_t enRet = Ok; + uint32_t u32To; + + DDL_ASSERT(IS_PWC_UNLOCKED()); + + WRITE_REG32(bM4_EFM->FRMC_b.LVM, 0x01UL); + WRITE_REG16(M4_PWC->RAMOPM, PWC_RAM_LOW); + + u32To = 0x1000UL; + while (1UL != READ_REG32(bM4_EFM->FRMC_b.LVM)) + { + if (0UL == u32To--) + { + enRet = Error; + break; + } + } + if (Ok == enRet) + { + u32To = 0x1000UL; + while(PWC_RAM_LOW != READ_REG16(M4_PWC->RAMOPM)) + { + if (0UL == u32To--) + { + enRet = Error; + break; + } + } + } + if (Ok == enRet) + { + MODIFY_REG8(M4_PWC->PWRC2, PWC_PWRC2_DDAS, 0x01UL); + WRITE_REG8(M4_PWC->PWRC3, 0x00UL); + MODIFY_REG8(M4_PWC->PWRC2, PWC_PWRC2_DVS ,PWC_NOR_DRV_LOW); + DDL_DelayMS(1UL); + } + return enRet; +} + +/** + * @brief Switch ultra low speed to high speed, set the drive ability. + * @param None + * @retval Ok: Mode switch successful. + * Error: Mode switch failure, check whether EFM was unlocked please. + * @note After calling this API, the system clock is able to switch high frequency. + */ +en_result_t PWC_LowSpeedToHighSpeed(void) +{ + en_result_t enRet = Ok; + uint32_t u32To; + + DDL_ASSERT(IS_PWC_UNLOCKED()); + + MODIFY_REG8(M4_PWC->PWRC2, PWC_PWRC2_DDAS, 0x0FUL); + WRITE_REG8(M4_PWC->PWRC3, 0xFFUL); + SET_REG8_BIT(M4_PWC->PWRC2, PWC_NOR_DRV_HIGH); + DDL_DelayMS(1UL); + + WRITE_REG32(bM4_EFM->FRMC_b.LVM, 0x00UL); + WRITE_REG16(M4_PWC->RAMOPM, PWC_RAM_HIGH); + + u32To = 0x1000UL; + while (0UL != READ_REG32(bM4_EFM->FRMC_b.LVM)) + { + if (0UL == u32To--) + { + enRet = Error; + break; + } + } + if (Ok == enRet) + { + u32To = 0x1000UL; + while(PWC_RAM_HIGH != READ_REG16(M4_PWC->RAMOPM)) + { + if (0UL == u32To--) + { + enRet = Error; + break; + } + } + } + return enRet; +} + +/** + * @brief ADC buffer config. + * @param [in] enNewState The new state of ADC buffer. + * @arg Enable + * @arg Disable + * @retval None + */ +void PWC_AdcBufCmd(en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_PWC_UNLOCKED()); + + WRITE_REG32(bM4_PWC->PWRC4_b.ADBUFE, enNewState); +} + +/** + * @brief ADC internal channel sampling selection. + * @param [in] u8AdcInternVol The sampling voltage for ADC internal channel. + * @arg PWC_AD_INTERN_REF + * @arg PWC_AD_VBAT_DIV2 + * @retval None + */ +void PWC_AdcInternVolSel(uint8_t u8AdcInternVol) +{ + DDL_ASSERT(IS_PWC_UNLOCKED()); + + WRITE_REG32(bM4_PWC->PWRC4_b.ADBUFS, u8AdcInternVol); +} + +/** + * @brief Initialize Power down mode config structure. Fill each pstcPDModeConfig with default value + * @param [in] pstcPDModeConfig Pointer to a stc_pwc_pd_mode_config_t structure that + * contains configuration information. + * @retval Ok: Power down mode structure initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t PWC_PowerDownStructInit(stc_pwc_pd_mode_config_t *pstcPDModeConfig) +{ + en_result_t enRet = Ok; + + /* Check if pointer is NULL */ + if (NULL == pstcPDModeConfig) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcPDModeConfig->u8IOState = PWC_PD_IO_STATE1; + pstcPDModeConfig->u8PDMode = PWC_PD_MODE1; + pstcPDModeConfig->u8WkUpSpeed = PWC_PD_WKUP_SLOW; + } + return enRet; +} + +/** + * @brief Power down mode config structure. + * @param [in] pstcPDModeConfig Pointer to a stc_pwc_pd_mode_config_t structure that + * contains configuration information. + * @retval Ok: Power down mode config successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t PWC_PowerDownConfig(const stc_pwc_pd_mode_config_t *pstcPDModeConfig) +{ + en_result_t enRet = Ok; + + /* Check if pointer is NULL */ + if (NULL == pstcPDModeConfig) + { + enRet = ErrorInvalidParameter; + } + else + { + DDL_ASSERT(IS_PWC_UNLOCKED()); + + MODIFY_REG8(M4_PWC->PWRC0, (PWC_PWRC0_IORTN | PWC_PWRC0_PDMDS), \ + (pstcPDModeConfig->u8IOState | pstcPDModeConfig->u8PDMode)); + WRITE_REG32(bM4_PWC->PWRC1_b.PDTS, pstcPDModeConfig->u8WkUpSpeed); + } + return enRet; +} + +/** + * @brief Stop mode config. + * @param [in] pstcStopConfig Chip config before entry stop mode. + * @arg u8StopDrv, MCU from which speed mode entry stop mode. + * @arg u16ClkKeep, System clock setting after wake-up from stop mode. + * @arg u16FlashWait, Whether wait flash stable after wake-up from stop mode. + * @arg u16ExBusHold, ExBus status in stop mode. + * @retval Ok: Stop mode config successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t PWC_StopConfig(const stc_pwc_stop_mode_config *pstcStopConfig) +{ + en_result_t enRet = Ok; + + /* Check if pointer is NULL */ + if (NULL == pstcStopConfig) + { + enRet = ErrorInvalidParameter; + } + else + { + DDL_ASSERT(IS_PWC_STOP_DRV(pstcStopConfig->u8StopDrv)); + DDL_ASSERT(IS_PWC_STOP_CLK(pstcStopConfig->u16ClkKeep)); + DDL_ASSERT(IS_PWC_STOP_FLASH_WAIT(pstcStopConfig->u16FlashWait)); + DDL_ASSERT(IS_PWC_STOP_EXBUS(pstcStopConfig->u16ExBusHold)); + + DDL_ASSERT(IS_PWC_UNLOCKED()); + + MODIFY_REG8(M4_PWC->PWRC1, PWC_PWRC1_STPDAS, pstcStopConfig->u8StopDrv); + + MODIFY_REG16(M4_PWC->STPMCR, \ + (PWC_STPMCR_EXBUSOE | PWC_STPMCR_CKSMRC | PWC_STPMCR_FLNWT),\ + (pstcStopConfig->u16ExBusHold | pstcStopConfig->u16ClkKeep |\ + pstcStopConfig->u16FlashWait)); + } + return enRet; +} + +/** + * @brief Initialize stop mode config structure. Fill each pstcStopConfig with default value + * @param [in] pstcStopConfig Pointer to a stc_pwc_stop_mode_config structure that + * contains configuration information. + * @retval Ok: Stop down mode structure initialize successful + * ErrorInvalidParameter: NULL pointer + */ +en_result_t PWC_StopStructInit(stc_pwc_stop_mode_config *pstcStopConfig) +{ + en_result_t enRet = Ok; + + /* Check if pointer is NULL */ + if (NULL == pstcStopConfig) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcStopConfig->u8StopDrv = PWC_STOP_DRV_HIGH; + pstcStopConfig->u16ExBusHold = PWC_STOP_EXBUS_HIZ; + pstcStopConfig->u16ClkKeep = PWC_STOP_CLK_KEEP; + pstcStopConfig->u16FlashWait = PWC_STOP_FLASH_WAIT; + } + return enRet; +} +/** + * @brief Stop mode wake up clock config. + * @param [in] u16ClkKeep System clock setting after wake-up from stop mode. + * @arg PWC_STOP_CLK_KEEP + * @arg PWC_STOP_CLK_MRC + * @retval None + */ +void PWC_StopClockKeepConfig(uint16_t u16ClkKeep) +{ + DDL_ASSERT(IS_PWC_STOP_CLK(u16ClkKeep)); + DDL_ASSERT(IS_PWC_UNLOCKED()); + + MODIFY_REG16(M4_PWC->STPMCR, PWC_STPMCR_CKSMRC, u16ClkKeep); +} + +/** + * @brief Stop mode wake up flash wait config. + * @param [in] u16FlashWait Whether wait flash stable after wake-up from stop mode. + * @arg PWC_STOP_FLASH_WAIT + * @arg PWC_STOP_FLASH_NOWAIT + * @retval None + */ +void PWC_StopFlashWaitConfig(uint16_t u16FlashWait) +{ + DDL_ASSERT(IS_PWC_STOP_FLASH_WAIT(u16FlashWait)); + DDL_ASSERT(IS_PWC_UNLOCKED()); + + MODIFY_REG16(M4_PWC->STPMCR, PWC_STPMCR_FLNWT, u16FlashWait); +} + +/** + * @brief Stop mode ex-bus status config. + * @param [in] u16ExBusHold ExBus status in stop mode. + * @arg PWC_STOP_EXBUS_HIZ + * @arg PWC_STOP_EXBUS_HOLD + * @retval None + */ +void PWC_StopExBusHoldConfig(uint16_t u16ExBusHold) +{ + DDL_ASSERT(IS_PWC_STOP_EXBUS(u16ExBusHold)); + DDL_ASSERT(IS_PWC_UNLOCKED()); + + MODIFY_REG16(M4_PWC->STPMCR, PWC_STPMCR_EXBUSOE, u16ExBusHold); +} + +/** + * @brief Stop mode driver capacity config. + * @param [in] u8StopDrv Drive capacity while enter stop mode. + * @arg PWC_STOP_DRV_HIGH + * @arg PWC_STOP_DRV_LOW + * @retval None + */ +void PWC_StopDrvConfig(uint8_t u8StopDrv) +{ + DDL_ASSERT(IS_PWC_STOP_DRV(u8StopDrv)); + DDL_ASSERT(IS_PWC_UNLOCKED()); + + MODIFY_REG8(M4_PWC->PWRC1, PWC_PWRC1_STPDAS, u8StopDrv); +} + +/** + * @brief VBAT monitor reference voltage selection. + * @param [in] u8RefVol VBAT monitor reference voltage. + * This parameter can be one of the following values: + * @arg PWC_VBAT_REF_VOL_1P8V: Vbat reference voltage is 1.8V + * @arg PWC_VBAT_REF_VOL_2P0V: Vbat reference voltage is 2.0V + * @retval None + */ +void PWC_VBAT_MonitorVolSel(uint8_t u8RefVol) +{ + /* Check parameters */ + DDL_ASSERT(IS_PWC_VBAT_REF_VOL(u8RefVol)); + DDL_ASSERT(IS_PWC_UNLOCKED()); + + WRITE_REG32(bM4_PWC->PWRC4_b.VBATREFSEL, u8RefVol); +} + +/** + * @brief Enable or Disable VBAT monitor. + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void PWC_VBAT_MonitorCmd(en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_PWC_UNLOCKED()); + + WRITE_REG32(bM4_PWC->PWRC4_b.VBATME, enNewState); +} + +/** + * @brief Get VBAT voltage status. + * @param None + * @retval uint8_t VBAT voltage status + */ +uint8_t PWC_VBAT_GetVolStatus(void) +{ + uint8_t u8VolSta; + + DDL_ASSERT(IS_PWC_UNLOCKED()); + + u8VolSta = (uint8_t)READ_REG32(bM4_PWC->PWRC4_b.VBATMON); + + return u8VolSta; +} + +/** + * @brief Enable or Disable VBAT measure voltage. + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void PWC_VBAT_MeasureVolCmd(en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_PWC_UNLOCKED()); + + WRITE_REG32(bM4_PWC->VBATCR_b.VBATDIVMONE, enNewState); +} + +/** + * @brief Reset the VBAT area. + * @param None + * @retval None + */ +void PWC_VBAT_Reset(void) +{ + DDL_ASSERT(IS_PWC_UNLOCKED()); + WRITE_REG8(M4_PWC->VBATRSTR, 0xA5U); +} + +/** + * @brief Enable or Disable VBAT power. + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void PWC_VBAT_PwrCmd(en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + DDL_ASSERT(IS_PWC_UNLOCKED()); + WRITE_REG32(bM4_PWC->VBATCR_b.CSDIS, enNewState); +} + +/** + * @brief Enable or Disable Backup RAM power. + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void PWC_BkRamPwrCmd(en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + DDL_ASSERT(IS_PWC_UNLOCKED()); + + if (Enable == enNewState) + { + WRITE_REG32(bM4_PWC->VBATCR_b.VBTRSD, 0UL); + } + else + { + WRITE_REG32(bM4_PWC->VBATCR_b.VBTRSD, 1UL); + } +} + +/** + * @brief Get Backup RAM flag. + * @param [in] u8Flag Backup RAM flag. + * This parameter can be one or any combination of the following values: + * @arg PWC_BACKUP_RAM_FLAG_RAMPDF: Backup RAM power down flag + * @arg PWC_BACKUP_RAM_FLAG_RAMVALID: Backup RAM read/write flag + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t PWC_GetBkRamStatus(uint8_t u8Flag) +{ + en_flag_status_t enFlagSta = Reset; + + /* Check parameters */ + DDL_ASSERT(IS_PWC_BACKUP_RAM_FLAG(u8Flag)); + + DDL_ASSERT(IS_PWC_UNLOCKED()); + if (0U != (READ_REG8_BIT(M4_PWC->VBATCR, u8Flag))) + { + enFlagSta = Set; + } + + return enFlagSta; +} + +/** + * @brief Write Backup register. + * @param [in] u8RegNum Backup register number. + * @arg This parameter can be a number between Min_Data = 0 and Max_Data = 127. + * @param [in] u8RegVal Value written to register + * @retval None + */ +void PWC_WriteBackupReg(uint8_t u8RegNum, uint8_t u8RegVal) +{ + __IO uint8_t *BKR; + + /* Check parameters */ + DDL_ASSERT(IS_PWC_BACKUP_REGISTER_NUMBER(u8RegNum)); + DDL_ASSERT(IS_PWC_UNLOCKED()); + + BKR = (__IO uint8_t *)PWC_BKRx(u8RegNum); + WRITE_REG8(*BKR, u8RegVal); +} + +/** + * @brief Read Backup register. + * @param [in] u8RegNum Backup register number. + * @arg This parameter can be a number between Min_Data = 0 and Max_Data = 127. + * @retval uint8_t Register value + */ +uint8_t PWC_ReadBackupReg(uint8_t u8RegNum) +{ + uint8_t u8RegVal; + + /* Check parameters */ + DDL_ASSERT(IS_PWC_BACKUP_REGISTER_NUMBER(u8RegNum)); + DDL_ASSERT(IS_PWC_UNLOCKED()); + + u8RegVal = READ_REG8(*((__IO uint8_t *)PWC_BKRx(u8RegNum))); + + return u8RegVal; +} + +/** + * @brief WKT Timer Initialize. + * @param [in] u8ClkSrc Clock source. + * This parameter can be one of the following values: + * @arg PWC_WKT_CLK_SRC_64HZ: 64Hz Clock + * @arg PWC_WKT_CLK_SRC_XTAL32: XTAL32 Clock + * @arg PWC_WKT_CLK_SRC_RTCLRC: RTCLRC Clock + * @param [in] u16CmpVal Comparison value of the Counter. + * @arg This parameter can be a number between Min_Data = 0 and Max_Data = 0xFFF. + * @retval None + */ +void PWC_WKT_Init(uint8_t u8ClkSrc, uint16_t u16CmpVal) +{ + /* Check parameters */ + DDL_ASSERT(IS_PWC_WKT_CLK_SRC(u8ClkSrc)); + DDL_ASSERT(IS_PWC_WKT_COMPARISION_VALUE(u16CmpVal)); + DDL_ASSERT(IS_PWC_UNLOCKED()); + + MODIFY_REG8(M4_PWC->WKTC2, PWC_WKTC2_WKCKS, u8ClkSrc); + WRITE_REG8(M4_PWC->WKTC0, (uint8_t)(u16CmpVal & 0x00FFU)); + WRITE_REG8(M4_PWC->WKTC1, (uint8_t)((u16CmpVal >> 8U) & 0x000FU)); +} + +/** + * @brief Set WKT Timer compare value. + * @param [in] u16CmpVal Comparison value of the Counter. + * @arg This parameter can be a number between Min_Data = 0 and Max_Data = 0xFFF. + * @retval None + */ +void PWC_WKT_SetCompareValue(uint16_t u16CmpVal) +{ + /* Check parameters */ + DDL_ASSERT(IS_PWC_WKT_COMPARISION_VALUE(u16CmpVal)); + DDL_ASSERT(IS_PWC_UNLOCKED()); + + WRITE_REG8(M4_PWC->WKTC0, (uint8_t)(u16CmpVal & 0x00FFU)); + WRITE_REG8(M4_PWC->WKTC1, (uint8_t)((u16CmpVal >> 8U) & 0x000FU)); +} + +/** + * @brief Get WKT Timer compare value. + * @param None + * @retval uint16_t WKT Compara value + */ +uint16_t PWC_WKT_GetCompareValue(void) +{ + uint16_t u16CmpVal; + + DDL_ASSERT(IS_PWC_UNLOCKED()); + + u16CmpVal = ((uint16_t)READ_REG16_BIT(M4_PWC->WKTC1, PWC_WKTC1_WKTMCMP) << 8U); + u16CmpVal |= READ_REG8(M4_PWC->WKTC0); + + return u16CmpVal; +} + +/** + * @brief Enable or Disable WKT Timer. + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void PWC_WKT_Cmd(en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_PWC_UNLOCKED()); + + WRITE_REG32(bM4_PWC->WKTC2_b.WKTCE, enNewState); +} + +/** + * @brief Get WKT Timer count match flag. + * @param None + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t PWC_WKT_GetStatus(void) +{ + en_flag_status_t enFlagSta; + + DDL_ASSERT(IS_PWC_UNLOCKED()); + + enFlagSta = (en_flag_status_t)READ_REG32(bM4_PWC->WKTC2_b.WKOVF); + + return enFlagSta; +} + +/** + * @brief Clear WKT Timer count match flag. + * @param None + * @retval None + */ +void PWC_WKT_ClearStatus(void) +{ + DDL_ASSERT(IS_PWC_UNLOCKED()); + WRITE_REG32(bM4_PWC->WKTC2_b.WKOVF, 0UL); +} + +/** + * @} + */ + +#endif /* DDL_PWC_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ + diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_qspi.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_qspi.c new file mode 100644 index 0000000000..637b5fe856 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_qspi.c @@ -0,0 +1,590 @@ +/** + ******************************************************************************* + * @file hc32f4a0_qspi.c + * @brief This file provides firmware functions to manage the QSPI. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Wuze First version + 2020-07-15 Wuze Refined QSPI_WriteData(). + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_qspi.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_QSPI QSPI + * @brief QSPI Driver Library + * @{ + */ + +#if (DDL_QSPI_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup QSPI_Local_Macros QSPI Local Macros + * @{ + */ + +/** + * @defgroup QSPI_Configuration_Bit_Mask QSPI Configuration Bit Mask + * @{ + */ +#define QSPI_FLAG_CLR_MSK (QSPI_FLAG_ROM_ACCESS_ERR) +/** + * @} + */ + +/** + * @defgroup QSPI_Common_Instruction QSPI Common Instruction + * @{ + */ +#define QSPI_INS_ENTER_4BA (0xB7U) +#define QSPI_INS_EXIT_4BA (0xE9U) +/** + * @} + */ + +/** + * @defgroup QSPI_Check_Parameters_Validity QSPI check parameters validity + * @{ + */ +#define IS_QSPI_CLK_DIV(x) \ +( ((x) >= 2U) && ((x) <= 64U)) + +#define IS_QSPI_CS_SETUP_TIMING(x) \ +( ((x) == QSPI_CS_SETUP_BEFORE_0P5_CYCLE) || \ + ((x) == QSPI_CS_SETUP_BEFORE_1P5_CYCLE)) + +#define IS_QSPI_CS_RELEASE_TIMING(x) \ +( ((x) == QSPI_CS_RELEASE_AFTER_0P5_CYCLE) || \ + ((x) == QSPI_CS_RELEASE_AFTER_1P5_CYCLE)) + +#define IS_QSPI_CS_IDLE_TIME(x) \ +( ((x) >= 1U) && ((x) <= 16U)) + +#define IS_QSPI_CS_EXTEND_TIME(x) \ +( ((x) == QSPI_CS_EXTEND_0CYCLE) || \ + ((x) == QSPI_CS_EXTEND_32CYCLE) || \ + ((x) == QSPI_CS_EXTEND_128CYCLE) || \ + ((x) == QSPI_CS_EXTEND_INFINITE)) + +#define IS_QSPI_SPI_MODE(x) \ +( ((x) == QSPI_SPI_MODE_0) || \ + ((x) == QSPI_SPI_MODE_3)) + +#define IS_QSPI_PREFETCH_STOP_POSITION(x) \ +( ((x) == QSPI_PREFETCH_STOP_BYTE_EDGE) || \ + ((x) == QSPI_PREFETCH_STOP_IMMED)) + +#define IS_QSPI_READ_MODE(x) \ +( ((x) == QSPI_READ_STANDARD_READ) || \ + ((x) == QSPI_READ_FAST_READ) || \ + ((x) == QSPI_READ_FAST_READ_DUAL_OUTPUT) || \ + ((x) == QSPI_READ_FAST_READ_DUAL_IO) || \ + ((x) == QSPI_READ_FAST_READ_QUAD_OUTPUT) || \ + ((x) == QSPI_READ_FAST_READ_QUAD_IO) || \ + ((x) == QSPI_READ_CUSTOM_STANDARD_READ) || \ + ((x) == QSPI_READ_CUSTOM_FAST_READ)) + +#define IS_QSPI_COMM_MODE(x) \ +( ((x) == QSPI_COMM_ROM_ACCESS) || \ + ((x) == QSPI_COMM_DIRECT_COMM)) + +#define IS_QSPI_ADDR_WIDTH(x) \ +( ((x) == QSPI_ADDR_WIDTH_1BYTE) || \ + ((x) == QSPI_ADDR_WIDTH_2BYTE) || \ + ((x) == QSPI_ADDR_WIDTH_3BYTE) || \ + ((x) == QSPI_ADDR_WIDTH_4BYTE)) + +#define IS_QSPI_DUMMY_CYCLES(x) \ +( ((x) >= 3U) && ((x) <= 18U)) + +#define IS_QSPI_INSTR_MODE(x) \ +( ((x) == QSPI_INSTR_1LINE) || \ + ((x) == QSPI_INSTR_2LINE) || \ + ((x) == QSPI_INSTR_4LINE)) + +#define IS_QSPI_ADDR_MODE(x) \ +( ((x) == QSPI_ADDR_1LINE) || \ + ((x) == QSPI_ADDR_2LINE) || \ + ((x) == QSPI_ADDR_4LINE)) + +#define IS_QSPI_DATA_MODE(x) \ +( ((x) == QSPI_DATA_1LINE) || \ + ((x) == QSPI_DATA_2LINE) || \ + ((x) == QSPI_DATA_4LINE)) + +#define IS_QSPI_BLOCK_NUM(x) \ +( (x) <= 62U) + +#define IS_QSPI_PREFETCH_CMD(x) \ +( ((x) == QSPI_PREFETCH_ENABLE) || \ + ((x) == QSPI_PREFETCH_DISABLE)) + +#define IS_QSPI_WP_LEVEL(x) \ +( ((x) == QSPI_WP_LOW) || \ + ((x) == QSPI_WP_HIGH)) + +/** + * @} + */ + +/** + * @defgroup QSPI_Miscellaneous_Macros QSPI Miscellaneous Macros + * @{ + */ +#define QSPI_WORD_TO_BYTE(__word__, __au8__) \ + do { \ + (__au8__)[0U] = (uint8_t)(__word__); \ + (__au8__)[1U] = (uint8_t)((__word__) >> 8U); \ + (__au8__)[2U] = (uint8_t)((__word__) >> 16U); \ + (__au8__)[3U] = (uint8_t)((__word__) >> 24U); \ + } while (0U) + +#define QSPI_ROM_MAP_BASE (0x98000000UL) + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup QSPI_Global_Functions QSPI Global Functions + * @{ + */ + +/** + * @brief Initializes QSPI peripheral according to the specified parameters \ + * in the structure stc_qspi_init_t + * @param [in] pstcInit Pointer to a stc_qspi_init_t structure value that \ + * contains the configuration information for QSPI. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcInit == NULL. + */ +en_result_t QSPI_Init(const stc_qspi_init_t *pstcInit) +{ + uint32_t u32DutyCorrection = 0U; + en_result_t enRet = ErrorInvalidParameter; + + if (pstcInit != NULL) + { + DDL_ASSERT(IS_QSPI_CLK_DIV(pstcInit->u32ClkDiv)); + DDL_ASSERT(IS_QSPI_CS_SETUP_TIMING(pstcInit->u32CSSetupTiming)); + DDL_ASSERT(IS_QSPI_CS_RELEASE_TIMING(pstcInit->u32CSReleaseTiming)); + DDL_ASSERT(IS_QSPI_CS_IDLE_TIME(pstcInit->u32CSIdleTime)); + DDL_ASSERT(IS_QSPI_CS_EXTEND_TIME(pstcInit->u32CSExtendTime)); + DDL_ASSERT(IS_QSPI_SPI_MODE(pstcInit->u32SPIMode)); + DDL_ASSERT(IS_QSPI_PREFETCH_STOP_POSITION(pstcInit->u32PrefetchStopPos)); + DDL_ASSERT(IS_QSPI_PREFETCH_CMD(pstcInit->u32PrefetchCmd)); + DDL_ASSERT(IS_QSPI_WP_LEVEL(pstcInit->u32WPLevel)); + DDL_ASSERT(IS_QSPI_READ_MODE(pstcInit->u32ReadMode)); + DDL_ASSERT(IS_QSPI_COMM_MODE(pstcInit->u32CommMode)); + DDL_ASSERT(IS_QSPI_ADDR_WIDTH(pstcInit->u32AddrWidth)); + DDL_ASSERT(IS_QSPI_DUMMY_CYCLES(pstcInit->u32DummyCycles)); + DDL_ASSERT(IS_QSPI_INSTR_MODE(pstcInit->u32InstrMode)); + DDL_ASSERT(IS_QSPI_ADDR_MODE(pstcInit->u32AddrMode)); + DDL_ASSERT(IS_QSPI_DATA_MODE(pstcInit->u32DataMode)); + + if ((pstcInit->u32ClkDiv & 1UL) != 0UL) + { + u32DutyCorrection = QSPI_FCR_DUTY; + } + + WRITE_REG32(M4_QSPI->CR, (((pstcInit->u32ClkDiv-1UL) << QSPI_CR_DIV_POS) | \ + pstcInit->u32SPIMode | \ + pstcInit->u32PrefetchStopPos | \ + pstcInit->u32PrefetchCmd | \ + pstcInit->u32ReadMode | \ + pstcInit->u32CommMode | \ + pstcInit->u32InstrMode | \ + pstcInit->u32AddrMode | \ + pstcInit->u32DataMode)); + + WRITE_REG32(M4_QSPI->CSCR, (pstcInit->u32CSExtendTime | \ + (pstcInit->u32CSIdleTime-1UL))); + + WRITE_REG32(M4_QSPI->FCR, (pstcInit->u32CSSetupTiming | \ + pstcInit->u32CSReleaseTiming | \ + pstcInit->u32AddrWidth | \ + ((pstcInit->u32DummyCycles-3UL) << QSPI_FCR_DMCYCN_POS) | \ + pstcInit->u32WPLevel | \ + u32DutyCorrection)); + + WRITE_REG32(M4_QSPI->CCMD, pstcInit->u8RomAccessInstr); + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief De-initializes QSPI peripheral. Reset the registers of QSPI. + * @param None + * @retval None + */ +void QSPI_DeInit(void) +{ + WRITE_REG32(M4_QSPI->CR, 0x3F0000UL); + WRITE_REG32(M4_QSPI->CSCR, 0xFUL); + WRITE_REG32(M4_QSPI->FCR, 0x80B3UL); + WRITE_REG32(M4_QSPI->SR, 0x8000UL); + WRITE_REG32(M4_QSPI->CCMD, 0x0UL); + WRITE_REG32(M4_QSPI->XCMD, 0xFFUL); + WRITE_REG32(M4_QSPI->SR2, QSPI_FLAG_ROM_ACCESS_ERR); + WRITE_REG32(M4_QSPI->EXAR, 0x0UL); +} + +/** + * @brief Set a default value for QSPI initialization structure. + * @param [in] pstcInit Pointer to a stc_qspi_init_t structure value that \ + * contains the configuration information QSPI. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcInit == NULL. + */ +en_result_t QSPI_StructInit(stc_qspi_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (pstcInit != NULL) + { + pstcInit->u32ClkDiv = 2UL; + pstcInit->u32CSSetupTiming = QSPI_CS_SETUP_BEFORE_0P5_CYCLE; + pstcInit->u32CSReleaseTiming = QSPI_CS_RELEASE_AFTER_0P5_CYCLE; + pstcInit->u32CSIdleTime = 1UL; + pstcInit->u32CSExtendTime = QSPI_CS_EXTEND_0CYCLE; + pstcInit->u32SPIMode = QSPI_SPI_MODE_0; + pstcInit->u32PrefetchStopPos = QSPI_PREFETCH_STOP_BYTE_EDGE; + pstcInit->u32PrefetchCmd = QSPI_PREFETCH_ENABLE; + pstcInit->u32WPLevel = QSPI_WP_HIGH; + pstcInit->u32CommMode = QSPI_COMM_ROM_ACCESS; + pstcInit->u32AddrWidth = QSPI_ADDR_WIDTH_3BYTE; + pstcInit->u32InstrMode = QSPI_INSTR_1LINE; + pstcInit->u32AddrMode = QSPI_ADDR_1LINE; + pstcInit->u32DataMode = QSPI_DATA_1LINE; + pstcInit->u32ReadMode = QSPI_READ_STANDARD_READ; + pstcInit->u8RomAccessInstr = 0x0U; + pstcInit->u32DummyCycles = 3UL; + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief QSPI write data. + * @param [in] u32Instr Instruction. + * @param [in] u32Address Address. + * @param [in] pu8Src Pointer to an array that stores the data to be written. + * @param [in] u32SrcSize Size of the data to be written. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pu8Src == NULL or u32SrcSize == 0U + */ +en_result_t QSPI_WriteData(uint32_t u32Instr, uint32_t u32Address, \ + const uint8_t pu8Src[], uint32_t u32SrcSize) +{ + uint32_t i; + uint8_t au8Address[4U]; + uint32_t u32AddrWidth; + en_result_t enRet = ErrorInvalidParameter; + + if ((pu8Src != NULL) && (u32SrcSize > 0U)) + { + QSPI_WORD_TO_BYTE(u32Address, au8Address); + u32AddrWidth = (READ_REG32_BIT(M4_QSPI->FCR, QSPI_FCR_AWSL) >> QSPI_FCR_AWSL_POS) + 1U; + + /* Enter direct communication mode. */ + QSPI_EnterDirectCommMode(); + /* Send instruction. */ + WRITE_REG32(M4_QSPI->DCOM, u32Instr); + /* Send ROM address. */ + for (i=0U; iDCOM, au8Address[i]); + } + /* Write data at last. */ + for (i=0U; iDCOM, pu8Src[i]); + } + /* Exit direct communication mode. */ + QSPI_ExitDirectCommMode(); + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief QSPI write data. + * @param [in] u32Address Address. + * @param [in] pu8Dest Pointer to an array that used to store the read data. + * @param [in] u32DestSize Size of the data to be read. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pu8Dest == NULL or u32DestSize == 0U + */ +en_result_t QSPI_ReadData(uint32_t u32Address, uint8_t pu8Dest[], uint32_t u32DestSize) +{ + uint32_t i = 0U; + en_result_t enRet = ErrorInvalidParameter; + + if ((pu8Dest != NULL) && (u32DestSize > 0U)) + { + u32Address += QSPI_ROM_MAP_BASE; + while (u32DestSize-- != 0U) + { + pu8Dest[i++] = *(uint8_t *)(u32Address++); + } + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Specifies read mode. + * @param [in] u32ReadMode QSPI read mode. + * This parameter can be a value of @ref QSPI_Read_Mode + * @arg QSPI_READ_STANDARD_READ: Standard read mode (no dummy cycles). + * @arg QSPI_READ_FAST_READ: Fast read mode (dummy cycles between address and data). + * @arg QSPI_READ_FAST_READ_DUAL_OUTPUT: Fast read dual output mode (data on 2 lines). + * @arg QSPI_READ_FAST_READ_DUAL_IO: Fast read dual I/O mode (address and data on 2 lines). + * @arg QSPI_READ_FAST_READ_QUAD_OUTPUT: Fast read quad output mode (data on 4 lines). + * @arg QSPI_READ_FAST_READ_QUAD_IO: Fast read quad I/O mode (address and data on 4 lines). + * @arg QSPI_READ_CUSTOM_STANDARD_READ: Custom standard read mode. + * @arg QSPI_READ_CUSTOM_FAST_READ: Custom fast read mode. + * @param [in] u8ReadInstr Read instruction of QSPI flash. Tis instruction must correspond to the read mode that specified by parameter 'u32ReadMode'. + * @param [in] u32DummyCycles The number of dummy cycles for fast read. It must correspond to the QSPI flash read instruction. + * Ignore when u32ReadMode == QSPI_READ_STANDARD_READ. + * This parameter can be a value between 3U and 18U, inclusive. + * @retval None + */ +void QSPI_SetReadMode(uint32_t u32ReadMode, uint8_t u8ReadInstr, uint32_t u32DummyCycles) +{ + DDL_ASSERT(IS_QSPI_READ_MODE(u32ReadMode)); + DDL_ASSERT(IS_QSPI_DUMMY_CYCLES(u32DummyCycles)); + + MODIFY_REG32(M4_QSPI->FCR, QSPI_FCR_DMCYCN, (u32DummyCycles-3UL) << QSPI_FCR_DMCYCN_POS); + MODIFY_REG32(M4_QSPI->CR, QSPI_CR_MDSEL, u32ReadMode); + WRITE_REG32(M4_QSPI->CCMD, u8ReadInstr); +} + +/** + * @brief Enable or disable duty correction. + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable duty correction. + * @arg Disable: Disable duty correction. + * @retval None + */ +void QSPI_DutyCorrectCmd(en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + if (enNewState == Enable) + { + SET_REG32_BIT(M4_QSPI->FCR, QSPI_FCR_DUTY); + } + else + { + CLEAR_REG32_BIT(M4_QSPI->FCR, QSPI_FCR_DUTY); + } +} + +/** + * @brief Enable or disable prefetch function. + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable prefetch function. + * @arg Disable: Disable prefetch function. + * @retval None + */ +void QSPI_PrefetchCmd(en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + if (enNewState == Enable) + { + SET_REG32_BIT(M4_QSPI->CR, QSPI_CR_PFE); + } + else + { + CLEAR_REG32_BIT(M4_QSPI->CR, QSPI_CR_PFE); + } +} + +/** + * @brief Enable or disable XIP mode. + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable XIP mode. + * @arg Disable: Disable XIP mode. + * @retval None + */ +void QSPI_XIPModeCmd(en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + if (enNewState == Enable) + { + SET_REG32_BIT(M4_QSPI->CR, QSPI_CR_XIPE); + } + else + { + CLEAR_REG32_BIT(M4_QSPI->CR, QSPI_CR_XIPE); + } +} + +/** + * @brief Specifies the level of WP. + * @param [in] u32Level The level of WP. + * This parameter can be a value of @ref QSPI_WP_Level + * @arg QSPI_WP_LOW: Set WP output low. + * @arg QSPI_WP_HIGH: Set WP output high. + * @retval None + */ +void QSPI_SetWPPinLevel(uint32_t u32Level) +{ + DDL_ASSERT(IS_QSPI_WP_LEVEL(u32Level)); + MODIFY_REG32(M4_QSPI->FCR, QSPI_FCR_WPOL, u32Level); +} + +/** + * @brief Enable or disable 4-byte address mode. + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable 4-byte address mode. + * @arg Disable: Disable 4-byte address mode. + * @retval None + */ +void QSPI_4ByteAddrModeCmd(en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + if (enNewState == Enable) + { + SET_REG32_BIT(M4_QSPI->FCR, QSPI_FCR_FOUR_BIC); + } + else + { + CLEAR_REG32_BIT(M4_QSPI->FCR, QSPI_FCR_FOUR_BIC); + } +} + +/** + * @brief Selects the block to access. + * @param [in] u32Block External block. A number between 0U and 62U, inclusive. + * @retval None + */ +void QSPI_SelectBlock(uint32_t u32Block) +{ + DDL_ASSERT(IS_QSPI_BLOCK_NUM(u32Block)); + WRITE_REG32(M4_QSPI->EXAR, ((u32Block << QSPI_EXAR_EXADR_POS) & QSPI_EXAR_EXADR)); +} + +/** + * @brief Get the size of prefetched data. + * @param None + * @retval A number between 0U and 18U, inclusive. + */ +uint32_t QSPI_GetPrefetchedSize(void) +{ + return READ_REG32_BIT(M4_QSPI->SR, QSPI_SR_PFNUM) >> QSPI_SR_PFNUM_POS; +} + +/** + * @brief Get the status of the specified QSPI flags. + * @param [in] u32Flag The status flags of QSPI. + * This parameter can be values of @ref QSPI_Status_Flag + * @arg QSPI_FLAG_DIRECT_COMM_BUSY: Serial transfer being processed. + * @arg QSPI_FLAG_XIP_MODE: XIP mode. + * @arg QSPI_FLAG_ROM_ACCESS_ERR: ROM access detection status in direct communication mode. + * @arg QSPI_FLAG_PREFETCH_BUF_FULL: Prefetch buffer is full. + * @arg QSPI_FLAG_PREFETCH_ACTIVE: Prefetch function operating. + * @retval An en_flag_status_t enumeration type value. + * @arg Set: At least one of the specified flags is set. + * @arg Reset: None of the specified flags is set. + */ +en_flag_status_t QSPI_GetStatus(uint32_t u32Flag) +{ + en_flag_status_t enFlag = Reset; + + if (READ_REG32_BIT(M4_QSPI->SR, (u32Flag & QSPI_FLAG_ALL)) != 0UL) + { + enFlag = Set; + } + + return enFlag; +} + +/** + * @brief Clear the specified flag. + * @param [in] u32Flag The specified flags to be cleared. + * This parameter can only be the following: + * @arg QSPI_FLAG_ROM_ACCESS_ERR: ROM access detection status in direct communication mode. + * @retval None + */ +void QSPI_ClrStatus(uint32_t u32Flag) +{ + SET_REG32_BIT(M4_QSPI->SR2, (u32Flag & QSPI_FLAG_CLR_MSK)); +} + +/** + * @} + */ + +#endif /* DDL_QSPI_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_rmu.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_rmu.c new file mode 100644 index 0000000000..900893f7da --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_rmu.c @@ -0,0 +1,171 @@ +/** + ******************************************************************************* + * @file hc32f4a0_rmu.c + * @brief This file provides firmware functions to manage the Reset Manage Unit + * (RMU). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Heqb First version + 2020-07-21 Heqb Add write protect check for RMU_ClrStatus function + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_rmu.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_RMU RMU + * @brief RMU Driver Library + * @{ + */ + +#if (DDL_RMU_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup RMU_Local_Macros RMU Local Macros + * @{ + */ +#define RMU_STATUS_MASK (0x40007FFFUL) + +/** + * @defgroup RMU_Check_Parameters_Validity RMU Check Parameters Validity + * @{ + */ + +/*! Parameter validity check for RMU reset cause. */ +#define IS_VALID_RMU_RESET_STATUS(x) \ +( ((x) != 0U) || \ + ((x) | RMU_STATUS_MASK) == RMU_STATUS_MASK) + +/** + * @} + */ + +/** + * @} + */ +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup RMU_Global_Functions RMU Global Functions + * @{ + */ + +/** + * @brief Get the reset cause. + * @param [in] u32RmuResetCause Reset flags that need to be queried + * @arg RMU_RST_POWER_ON: Power on reset + * @arg RMU_RST_RESET_PIN: Reset pin reset + * @arg RMU_RST_BROWN_OUT: Brown-out reset + * @arg RMU_RST_PVD1: Program voltage Detection 1 reset + * @arg RMU_RST_PVD2: Program voltage Detection 2 reset + * @arg RMU_RST_WDT: Watchdog timer reset + * @arg RMU_RST_SWDT: Special watchdog timer reset + * @arg RMU_RST_POWER_DOWN: Power down reset + * @arg RMU_RST_SOFTWARE: Software reset + * @arg RMU_RST_MPU_ERR: Mpu error reset + * @arg RMU_RST_RAM_PARITY_ERR: Ram parity error reset + * @arg RMU_RST_RAM_ECC: Ram ECC reset + * @arg RMU_RST_CLK_ERR: Clk frequence error reset + * @arg RMU_RST_XTAL_ERR: Xtal error reset + * @arg RMU_RST_LOCKUP: M4 Lockup reset + * @arg RMU_RST_MULTI: Multiply reset cause + * @retval Set: Flag is Set. + * Reset: Flag is Reset + */ +en_flag_status_t RMU_GetStatus(uint32_t u32RmuResetCause) +{ + en_flag_status_t enRet; + DDL_ASSERT(IS_VALID_RMU_RESET_STATUS(u32RmuResetCause)); + + enRet = ((0UL == READ_REG32_BIT(M4_RMU->RSTF0, u32RmuResetCause)) ? Reset :Set); + return enRet; +} + +/** + * @brief Clear reset Status. + * @param None + * @retval NOne + * @note Clear reset flag should be done after read RMU_RSTF0 register. + * Call PWC_Unlock(PWC_UNLOCK_CODE_1) unlock RMU_RSTF0 register first. + */ +void RMU_ClrStatus(void) +{ + DDL_ASSERT((M4_PWC->FPRC & PWC_FPRC_FPRCB1) == PWC_FPRC_FPRCB1); + + SET_REG32_BIT(M4_RMU->RSTF0, RMU_RSTF0_CLRF); + __NOP(); + __NOP(); + __NOP(); + __NOP(); + __NOP(); + __NOP(); +} + +/** + * @brief Enable or disable LOCKUP reset. + * @param [in] enNewState Enable or disable LOCKUP reset. + * @retval None + * @note Call PWC_Unlock(PWC_UNLOCK_CODE_1) unlock RMU_PRSTCR0 register first. + */ +void RMU_CPULockUpCmd(en_functional_state_t enNewState) +{ + DDL_ASSERT((M4_PWC->FPRC & PWC_FPRC_FPRCB1) == PWC_FPRC_FPRCB1); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + WRITE_REG8(bM4_RMU->PRSTCR0_b.LKUPREN, enNewState); +} + +/** + * @} + */ + +#endif /* DDL_RMU_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_rtc.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_rtc.c new file mode 100644 index 0000000000..e08aa40a15 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_rtc.c @@ -0,0 +1,1240 @@ +/** + ******************************************************************************* + * @file hc32f4a0_rtc.c + * @brief This file provides firmware functions to manage the Real-Time + * Clock(RTC). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Yangjp First version + 2020-09-04 Yangjp Optimize timeout handling in functions + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_rtc.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_RTC RTC + * @brief Real-Time Clock Driver Library + * @{ + */ + +#if (DDL_RTC_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup RTC_Local_Macros RTC Local Macros + * @{ + */ + +/* RTC TPCR register Mask */ +#define RTC_TPCR_CLEAR_MASK (RTC_TPCR0_TPCT0 | RTC_TPCR0_TPNF0 | \ + RTC_TPCR0_TPRSTE0 | RTC_TPCR0_TSTPE0) + +/* Get the specified register address of the RTC Intrusion Control */ +#define RTC_TPCRx(__CH__) ((uint32_t)(&(M4_RTC->TPCR0)) + (uint32_t)(__CH__)) + +/* RTC software reset timeout(ms) */ +#define RTC_SOFTWARE_RESET_TIMEOUT (100UL) + +/* RTC mode switch timeout(ms) */ +#define RTC_MODE_SWITCH_TIMEOUT (100UL) + +/** + * @defgroup RTC_Check_Parameters_Validity RTC Check Parameters Validity + * @{ + */ +#define IS_RTC_DATA_FORMAT(x) \ +( ((x) == RTC_DATA_FORMAT_DEC) || \ + ((x) == RTC_DATA_FORMAT_BCD)) + +#define IS_RTC_CLOCK_SOURCE(x) \ +( ((x) == RTC_CLOCK_SOURCE_XTAL32) || \ + ((x) == RTC_CLOCK_SOURCE_RTCLRC)) + +#define IS_RTC_HOUR_FORMAT(x) \ +( ((x) == RTC_HOUR_FORMAT_12) || \ + ((x) == RTC_HOUR_FORMAT_24)) + +#define IS_RTC_PERIOD_INTERRUPT(x) \ +( ((x) == RTC_PERIOD_INT_INVALID) || \ + ((x) == RTC_PERIOD_INT_HALF_SECOND) || \ + ((x) == RTC_PERIOD_INT_ONE_SECOND) || \ + ((x) == RTC_PERIOD_INT_ONE_MINUTE) || \ + ((x) == RTC_PERIOD_INT_ONE_HOUR) || \ + ((x) == RTC_PERIOD_INT_ONE_DAY) || \ + ((x) == RTC_PERIOD_INT_ONE_MONTH)) + +#define IS_RTC_CLOCK_COMPEN(x) \ +( ((x) == RTC_CLOCK_COMPEN_DISABLE) || \ + ((x) == RTC_CLOCK_COMPEN_ENABLE)) + +#define IS_RTC_OUTPUT_COMPEN_MODE(x) \ +( ((x) == RTC_OUTPUT_COMPEN_MODE_DISTRIBUTED) || \ + ((x) == RTC_OUTPUT_COMPEN_MODE_UNIFORM)) + +#define IS_RTC_HOUR12_AM_PM(x) \ +( ((x) == RTC_HOUR12_AM_HOUR24) || \ + ((x) == RTC_HOUR12_PM)) + +#define IS_RTC_INTRUSION_CHANNEL(x) \ +( ((x) == RTC_INTRU_CH0) || \ + ((x) == RTC_INTRU_CH1)) + +#define IS_RTC_INTRUSION_TIMESTAMP(x) \ +( ((x) == RTC_INTRU_TIMESTAMP_DISABLE) || \ + ((x) == RTC_INTRU_TIMESTAMP_ENABLE)) + +#define IS_RTC_RESET_BACKUP_REGISTER(x) \ +( ((x) == RTC_RESET_BACKUP_REG_DISABLE) || \ + ((x) == RTC_RESET_BACKUP_REG_ENABLE)) + +#define IS_RTC_INTRUSION_FILTER(x) \ +( ((x) == RTC_INTRU_FILTER_INVALID) || \ + ((x) == RTC_INTRU_FILTER_THREE_TIME) || \ + ((x) == RTC_INTRU_FILTER_THREE_TIME_CLK_DIV32)) + +#define IS_RTC_INTRUSION_DETECT_EDGE(x) \ +( ((x) == RTC_DETECT_EDGE_NONE) || \ + ((x) == RTC_DETECT_EDGE_RISING) || \ + ((x) == RTC_DETECT_EDGE_FALLING) || \ + ((x) == RTC_DETECT_EDGE_RISING_FALLING)) + +#define IS_RTC_GET_FLAG(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(RTC_FLAG_PRDF | \ + RTC_FLAG_ALMF | \ + RTC_FLAG_RWEN | \ + RTC_FLAG_TPOVF | \ + RTC_FLAG_TPF0 | \ + RTC_FLAG_TPF1)))))) + +#define IS_RTC_CLEAR_FLAG(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(RTC_FLAG_PRDF | \ + RTC_FLAG_ALMF | \ + RTC_FLAG_TPOVF | \ + RTC_FLAG_TPF0 | \ + RTC_FLAG_TPF1)))))) + +#define IS_RTC_INTERRUPT(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(RTC_INT_PRDIE | \ + RTC_INT_ALMIE | \ + RTC_INT_TPIE0 | \ + RTC_INT_TPIE1)))))) + +#define IS_RTC_YEAR(x) ((x) <= 99U) + +#define IS_RTC_MONTH(x) (((x) >= 1U) && ((x) <= 12U)) + +#define IS_RTC_DAY(x) (((x) >= 1U) && ((x) <= 31U)) + +#define IS_RTC_HOUR12(x) (((x) >= 1U) && ((x) <= 12U)) + +#define IS_RTC_HOUR24(x) ((x) <= 23U) + +#define IS_RTC_MINUTE(x) ((x) <= 59U) + +#define IS_RTC_SECOND(x) ((x) <= 59U) + +#define IS_RTC_WEEKDAY(x) ((x) <= 6U) + +#define IS_RTC_ALARM_WEEKDAY(x) (((x) >= 0x01U) && ((x) <= 0x7FU)) + +#define IS_RTC_COMPENSATION_VALUE(x) ((x) <= 0x1FFU) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup RTC_Global_Functions RTC Global Functions + * @{ + */ + +/** + * @brief De-Initialize RTC. + * @param None + * @retval An en_result_t enumeration value: + * - Ok: De-Initialize success + * - ErrorTimeout: De-Initialize timeout + */ +en_result_t RTC_DeInit(void) +{ + __IO uint32_t u32Count; + en_result_t enRet = Ok; + + WRITE_REG32(bM4_RTC->CR0_b.RESET, Reset); + /* Waiting for normal count status or end of RTC software reset */ + u32Count = RTC_SOFTWARE_RESET_TIMEOUT * (HCLK_VALUE / 20000UL); + while (0UL != READ_REG32(bM4_RTC->CR0_b.RESET)) + { + if (0UL == u32Count) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + + if (Ok == enRet) + { + /* Reset all RTC registers */ + WRITE_REG32(bM4_RTC->CR0_b.RESET, Set); + /* Waiting for RTC software reset to complete */ + u32Count = RTC_SOFTWARE_RESET_TIMEOUT * (HCLK_VALUE / 20000UL); + while (0UL != READ_REG32(bM4_RTC->CR0_b.RESET)) + { + if (0UL == u32Count) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + } + + return enRet; +} + +/** + * @brief Initialize RTC. + * @param [in] pstcRtcInit Pointer to a @ref stc_rtc_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: Invalid parameter + */ +en_result_t RTC_Init(const stc_rtc_init_t *pstcRtcInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcRtcInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_RTC_CLOCK_SOURCE(pstcRtcInit->u8ClockSource)); + DDL_ASSERT(IS_RTC_HOUR_FORMAT(pstcRtcInit->u8HourFormat)); + DDL_ASSERT(IS_RTC_PERIOD_INTERRUPT(pstcRtcInit->u8PeriodInterrupt)); + DDL_ASSERT(IS_RTC_CLOCK_COMPEN(pstcRtcInit->u8ClkCompenEn)); + DDL_ASSERT(IS_RTC_COMPENSATION_VALUE(pstcRtcInit->u16ClkCompenValue)); + DDL_ASSERT(IS_RTC_OUTPUT_COMPEN_MODE(pstcRtcInit->u8CompenMode)); + + /* RTC CR3 Configuration */ + MODIFY_REG8(M4_RTC->CR3, (RTC_CR3_LRCEN | RTC_CR3_RCKSEL), pstcRtcInit->u8ClockSource); + /* RTC CR1 Configuration */ + MODIFY_REG8(M4_RTC->CR1, (RTC_CR1_PRDS | RTC_CR1_AMPM | RTC_CR1_ONEHZSEL), + (pstcRtcInit->u8PeriodInterrupt | pstcRtcInit->u8HourFormat | pstcRtcInit->u8CompenMode)); + /* RTC Compensation Configuration */ + MODIFY_REG8(M4_RTC->ERRCRH, (RTC_ERRCRH_COMPEN | RTC_ERRCRH_COMP8), + (pstcRtcInit->u8ClkCompenEn | (uint8_t)((pstcRtcInit->u16ClkCompenValue >> 8U) & 0x01U))); + WRITE_REG8(M4_RTC->ERRCRL, (uint8_t)(pstcRtcInit->u16ClkCompenValue & 0xFFU)); + } + + return enRet; +} + +/** + * @brief Fills each stc_rtc_init_t member with default value. + * @param [out] pstcRtcInit Pointer to a @ref stc_rtc_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: stc_rtc_init_t member initialize success + * - ErrorInvalidParameter: Invalid parameter + */ +en_result_t RTC_StructInit(stc_rtc_init_t *pstcRtcInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcRtcInit) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcRtcInit->u8ClockSource = RTC_CLOCK_SOURCE_RTCLRC; + pstcRtcInit->u8HourFormat = RTC_HOUR_FORMAT_24; + pstcRtcInit->u8PeriodInterrupt = RTC_PERIOD_INT_INVALID; + pstcRtcInit->u8ClkCompenEn = RTC_CLOCK_COMPEN_DISABLE; + pstcRtcInit->u16ClkCompenValue = 0U; + pstcRtcInit->u8CompenMode = RTC_OUTPUT_COMPEN_MODE_DISTRIBUTED; + } + + return enRet; +} + +/** + * @brief Enter RTC read/write mode. + * @param None + * @retval An en_result_t enumeration value: + * - Ok: Enter mode success + * - ErrorTimeout: Enter mode timeout + */ +en_result_t RTC_EnterRwMode(void) +{ + __IO uint32_t u32Count; + en_result_t enRet = Ok; + + /* Mode switch when RTC is running */ + if (0UL != READ_REG32(bM4_RTC->CR1_b.START)) + { + if (1UL != READ_REG32(bM4_RTC->CR2_b.RWEN)) + { + WRITE_REG32(bM4_RTC->CR2_b.RWREQ, Set); + /* Waiting for RWEN bit set */ + u32Count = RTC_MODE_SWITCH_TIMEOUT * (HCLK_VALUE / 20000UL); + while (1UL != READ_REG32(bM4_RTC->CR2_b.RWEN)) + { + if (0UL == u32Count) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + } + } + + return enRet; +} + +/** + * @brief Exit RTC read/write mode. + * @param None + * @retval An en_result_t enumeration value: + * - Ok: Exit mode success + * - ErrorTimeout: Exit mode timeout + */ +en_result_t RTC_ExitRwMode(void) +{ + __IO uint32_t u32Count; + en_result_t enRet = Ok; + + /* Mode switch when RTC is running */ + if (0UL != READ_REG32(bM4_RTC->CR1_b.START)) + { + if (0UL != READ_REG32(bM4_RTC->CR2_b.RWEN)) + { + WRITE_REG32(bM4_RTC->CR2_b.RWREQ, Reset); + /* Waiting for RWEN bit reset */ + u32Count = RTC_MODE_SWITCH_TIMEOUT * (HCLK_VALUE / 20000UL); + while (0UL != READ_REG32(bM4_RTC->CR2_b.RWEN)) + { + if (0UL == u32Count) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + } + } + + return enRet; +} + +/** + * @brief RTC period interrupt config. + * @param [in] u8IntCond Specifies the period interrupt type + * This parameter can be one of the following values: + * @arg RTC_PERIOD_INT_INVALID: Period interrupt invalid + * @arg RTC_PERIOD_INT_HALF_SECOND: 0.5 second period interrupt + * @arg RTC_PERIOD_INT_ONE_SECOND: 1 second period interrupt + * @arg RTC_PERIOD_INT_ONE_MINUTE: 1 minute period interrupt + * @arg RTC_PERIOD_INT_ONE_HOUR: 1 hour period interrupt + * @arg RTC_PERIOD_INT_ONE_DAY: 1 day period interrupt + * @arg RTC_PERIOD_INT_ONE_MONTH: 1 month period interrupt + * @retval None + */ +void RTC_PeriodIntConfig(uint8_t u8IntCond) +{ + uint32_t u32RtcSta; + uint32_t u32IntSta; + + /* Check parameters */ + DDL_ASSERT(IS_RTC_PERIOD_INTERRUPT(u8IntCond)); + + u32RtcSta = READ_REG32(bM4_RTC->CR1_b.START); + u32IntSta = READ_REG32(bM4_RTC->CR2_b.PRDIE); + /* Disable period interrupt when START=1 and clear period flag after write */ + if ((0UL != u32IntSta) && (0UL != u32RtcSta)) + { + WRITE_REG32(bM4_RTC->CR2_b.PRDIE, Reset); + } + + /* RTC CR1 Configuration */ + MODIFY_REG8(M4_RTC->CR1, RTC_CR1_PRDS, u8IntCond); + WRITE_REG32(bM4_RTC->CR2_b.PRDF, Reset); + + if ((0UL != u32IntSta) && (0UL != u32RtcSta)) + { + WRITE_REG32(bM4_RTC->CR2_b.PRDIE, Set); + } +} + +/** + * @brief RTC enter low power condition check. + * @param None + * @retval An en_result_t enumeration value: + * - Ok: Can enter low power mode + * - ErrorTimeout: Can't enter low power mode + */ +en_result_t RTC_LowPowerCheck(void) +{ + __IO uint32_t u32Count; + en_result_t enRet = Ok; + + /* Check RTC work status */ + if (0UL != READ_REG32(bM4_RTC->CR1_b.START)) + { + WRITE_REG32(bM4_RTC->CR2_b.RWREQ, Set); + /* Waiting for RTC RWEN bit set */ + u32Count = RTC_MODE_SWITCH_TIMEOUT * (HCLK_VALUE / 20000UL); + while (1UL != READ_REG32(bM4_RTC->CR2_b.RWEN)) + { + if (0UL == u32Count) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + + if (Ok == enRet) + { + WRITE_REG32(bM4_RTC->CR2_b.RWREQ, Reset); + /* Waiting for RTC RWEN bit reset */ + u32Count = RTC_MODE_SWITCH_TIMEOUT * (HCLK_VALUE / 20000UL); + while (0UL != READ_REG32(bM4_RTC->CR2_b.RWEN)) + { + if (0UL == u32Count) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + } + } + + return enRet; +} + +/** + * @brief Set RTC clock compensation value. + * @param [in] u16CompenVal Specifies the clock compensation value of RTC. + * @arg This parameter can be a number between Min_Data = 0 and Max_Data = 0x1FF. + * @retval None + */ +void RTC_SetClkCompenValue(uint16_t u16CompenVal) +{ + /* Check parameters */ + DDL_ASSERT(IS_RTC_COMPENSATION_VALUE(u16CompenVal)); + + WRITE_REG32(bM4_RTC->ERRCRH_b.COMP8, ((uint32_t)u16CompenVal >> 8U) & 0x01U); + WRITE_REG8(M4_RTC->ERRCRL, (uint8_t)(u16CompenVal & 0x00FFU)); +} + +/** + * @brief Enable or disable RTC count. + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void RTC_Cmd(en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + WRITE_REG32(bM4_RTC->CR1_b.START, enNewSta); +} + +/** + * @brief Enable or disable RTC LRC function. + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void RTC_LrcCmd(en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + WRITE_REG32(bM4_RTC->CR3_b.LRCEN, enNewSta); +} + +/** + * @brief Get RTC counter status. + * @param None + * @retval An en_result_t enumeration value: + * - Enable: RTC counter started + * - Disable: RTC counter stopped + */ +en_functional_state_t RTC_GetCounterState(void) +{ + en_functional_state_t enState; + + if (0UL != READ_REG32(bM4_RTC->CR1_b.START)) + { + enState = Enable; + } + else + { + enState = Disable; + } + + return enState; +} + +/** + * @brief Enable or disable RTC 1HZ output. + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void RTC_OneHzOutputCmd(en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + WRITE_REG32(bM4_RTC->CR1_b.ONEHZOE, enNewSta); +} + +/** + * @brief Enable or disable clock compensation. + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void RTC_ClkCompenCmd(en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + WRITE_REG32(bM4_RTC->ERRCRH_b.COMPEN, enNewSta); +} + +/** + * @brief Set RTC current date. + * @param [in] u8Format Specifies the format of the entered parameters. + * This parameter can be one of the following values: + * @arg RTC_DATA_FORMAT_DEC: Decimal data format + * @arg RTC_DATA_FORMAT_BCD: BCD data format + * @param [in] pstcRtcDate Pointer to a @ref stc_rtc_date_t structure + * @retval An en_result_t enumeration value: + * - Ok: Set date success + * - Error: Set date failed + * - ErrorInvalidParameter: Invalid parameter + */ +en_result_t RTC_SetDate(uint8_t u8Format, stc_rtc_date_t *pstcRtcDate) +{ + en_result_t enRet = Ok; + + if (NULL == pstcRtcDate) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_RTC_DATA_FORMAT(u8Format)); + if (RTC_DATA_FORMAT_DEC != u8Format) + { + DDL_ASSERT(IS_RTC_YEAR(BCD2DEC(pstcRtcDate->u8Year))); + DDL_ASSERT(IS_RTC_MONTH(BCD2DEC(pstcRtcDate->u8Month))); + DDL_ASSERT(IS_RTC_DAY(BCD2DEC(pstcRtcDate->u8Day))); + } + else + { + DDL_ASSERT(IS_RTC_YEAR(pstcRtcDate->u8Year)); + DDL_ASSERT(IS_RTC_MONTH(pstcRtcDate->u8Month)); + DDL_ASSERT(IS_RTC_DAY(pstcRtcDate->u8Day)); + } + DDL_ASSERT(IS_RTC_WEEKDAY(pstcRtcDate->u8Weekday)); + + /* Enter read/write mode */ + if (Ok != RTC_EnterRwMode()) + { + enRet = Error; + } + else + { + if (RTC_DATA_FORMAT_DEC == u8Format) + { + pstcRtcDate->u8Year = DEC2BCD(pstcRtcDate->u8Year); + pstcRtcDate->u8Month = DEC2BCD(pstcRtcDate->u8Month); + pstcRtcDate->u8Day = DEC2BCD(pstcRtcDate->u8Day); + } + + WRITE_REG8(M4_RTC->YEAR, pstcRtcDate->u8Year); + WRITE_REG8(M4_RTC->MON, pstcRtcDate->u8Month); + WRITE_REG8(M4_RTC->DAY, pstcRtcDate->u8Day); + WRITE_REG8(M4_RTC->WEEK, pstcRtcDate->u8Weekday); + + /* Exit read/write mode */ + if (Ok != RTC_ExitRwMode()) + { + enRet = Error; + } + } + } + + return enRet; +} + +/** + * @brief Get RTC current date. + * @param [in] u8Format Specifies the format of the returned parameters. + * This parameter can be one of the following values: + * @arg RTC_DATA_FORMAT_DEC: Decimal data format + * @arg RTC_DATA_FORMAT_BCD: BCD data format + * @param [out] pstcRtcDate Pointer to a @ref stc_rtc_date_t structure + * @retval An en_result_t enumeration value: + * - Ok: Get date success + * - Error: Get date failed + * - ErrorInvalidParameter: Invalid parameter + */ +en_result_t RTC_GetDate(uint8_t u8Format, stc_rtc_date_t *pstcRtcDate) +{ + en_result_t enRet = Ok; + + if (NULL == pstcRtcDate) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_RTC_DATA_FORMAT(u8Format)); + /* Enter read/write mode */ + if (Ok != RTC_EnterRwMode()) + { + enRet = Error; + } + else + { + /* Get RTC date registers */ + pstcRtcDate->u8Year = READ_REG8(M4_RTC->YEAR); + pstcRtcDate->u8Month = READ_REG8(M4_RTC->MON); + pstcRtcDate->u8Day = READ_REG8(M4_RTC->DAY); + pstcRtcDate->u8Weekday = READ_REG8(M4_RTC->WEEK); + + /* Check decimal format*/ + if (RTC_DATA_FORMAT_DEC == u8Format) + { + pstcRtcDate->u8Year = BCD2DEC(pstcRtcDate->u8Year); + pstcRtcDate->u8Month = BCD2DEC(pstcRtcDate->u8Month); + pstcRtcDate->u8Day = BCD2DEC(pstcRtcDate->u8Day); + } + + /* exit read/write mode */ + if (Ok != RTC_ExitRwMode()) + { + enRet = Error; + } + } + } + + return enRet; +} + +/** + * @brief Set RTC current time. + * @param [in] u8Format Specifies the format of the entered parameters. + * This parameter can be one of the following values: + * @arg RTC_DATA_FORMAT_DEC: Decimal data format + * @arg RTC_DATA_FORMAT_BCD: BCD data format + * @param [in] pstcRtcTime Pointer to a @ref stc_rtc_time_t structure + * @retval An en_result_t enumeration value: + * - Ok: Set time success + * - Error: Set time failed + * - ErrorInvalidParameter: Invalid parameter + */ +en_result_t RTC_SetTime(uint8_t u8Format, stc_rtc_time_t *pstcRtcTime) +{ + en_result_t enRet = Ok; + + if (NULL == pstcRtcTime) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_RTC_DATA_FORMAT(u8Format)); + if (RTC_DATA_FORMAT_DEC != u8Format) + { + if (RTC_HOUR_FORMAT_12 == READ_REG32(bM4_RTC->CR1_b.AMPM)) + { + DDL_ASSERT(IS_RTC_HOUR12(BCD2DEC(pstcRtcTime->u8Hour))); + DDL_ASSERT(IS_RTC_HOUR12_AM_PM(pstcRtcTime->u8AmPm)); + } + else + { + DDL_ASSERT(IS_RTC_HOUR24(BCD2DEC(pstcRtcTime->u8Hour))); + } + DDL_ASSERT(IS_RTC_MINUTE(BCD2DEC(pstcRtcTime->u8Minute))); + DDL_ASSERT(IS_RTC_SECOND(BCD2DEC(pstcRtcTime->u8Second))); + } + else + { + if (RTC_HOUR_FORMAT_12 == READ_REG32(bM4_RTC->CR1_b.AMPM)) + { + DDL_ASSERT(IS_RTC_HOUR12(pstcRtcTime->u8Hour)); + DDL_ASSERT(IS_RTC_HOUR12_AM_PM(pstcRtcTime->u8AmPm)); + } + else + { + DDL_ASSERT(IS_RTC_HOUR24(pstcRtcTime->u8Hour)); + } + DDL_ASSERT(IS_RTC_MINUTE(pstcRtcTime->u8Minute)); + DDL_ASSERT(IS_RTC_SECOND(pstcRtcTime->u8Second)); + } + + /* Enter read/write mode */ + if (Ok != RTC_EnterRwMode()) + { + enRet = Error; + } + else + { + if (RTC_DATA_FORMAT_DEC == u8Format) + { + pstcRtcTime->u8Hour = DEC2BCD(pstcRtcTime->u8Hour); + pstcRtcTime->u8Minute = DEC2BCD(pstcRtcTime->u8Minute); + pstcRtcTime->u8Second = DEC2BCD(pstcRtcTime->u8Second); + } + if ((RTC_HOUR_FORMAT_12 == READ_REG32(bM4_RTC->CR1_b.AMPM)) && + (RTC_HOUR12_PM == pstcRtcTime->u8AmPm)) + { + pstcRtcTime->u8Hour |= RTC_HOUR12_PM; + } + + WRITE_REG8(M4_RTC->HOUR, pstcRtcTime->u8Hour); + WRITE_REG8(M4_RTC->MIN, pstcRtcTime->u8Minute); + WRITE_REG8(M4_RTC->SEC, pstcRtcTime->u8Second); + + /* Exit read/write mode */ + if (Ok != RTC_ExitRwMode()) + { + enRet = Error; + } + } + } + + return enRet; +} + +/** + * @brief Get RTC current time. + * @param [in] u8Format Specifies the format of the returned parameters. + * This parameter can be one of the following values: + * @arg RTC_DATA_FORMAT_DEC: Decimal data format + * @arg RTC_DATA_FORMAT_BCD: BCD data format + * @param [out] pstcRtcTime Pointer to a @ref stc_rtc_time_t structure + * @retval An en_result_t enumeration value: + * - Ok: Get time success + * - Error: Get time failed + * - ErrorInvalidParameter: Invalid parameter + */ +en_result_t RTC_GetTime(uint8_t u8Format, stc_rtc_time_t *pstcRtcTime) +{ + en_result_t enRet = Ok; + + if (NULL == pstcRtcTime) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_RTC_DATA_FORMAT(u8Format)); + /* Enter read/write mode */ + if (Ok != RTC_EnterRwMode()) + { + enRet = Error; + } + else + { + /* Get RTC time registers */ + pstcRtcTime->u8Hour = READ_REG8(M4_RTC->HOUR); + pstcRtcTime->u8Minute = READ_REG8(M4_RTC->MIN); + pstcRtcTime->u8Second = READ_REG8(M4_RTC->SEC); + + if (RTC_HOUR_FORMAT_12 == READ_REG32(bM4_RTC->CR1_b.AMPM)) + { + if (RTC_HOUR12_PM == (pstcRtcTime->u8Hour & RTC_HOUR12_PM)) + { + pstcRtcTime->u8Hour &= (uint8_t)(~RTC_HOUR12_PM); + pstcRtcTime->u8AmPm = RTC_HOUR12_PM; + } + else + { + pstcRtcTime->u8AmPm = RTC_HOUR12_AM_HOUR24; + } + } + else + { + pstcRtcTime->u8AmPm = RTC_HOUR12_AM_HOUR24; + } + + /* Check decimal format*/ + if (RTC_DATA_FORMAT_DEC == u8Format) + { + pstcRtcTime->u8Hour = BCD2DEC(pstcRtcTime->u8Hour); + pstcRtcTime->u8Minute = BCD2DEC(pstcRtcTime->u8Minute); + pstcRtcTime->u8Second = BCD2DEC(pstcRtcTime->u8Second); + } + + /* exit read/write mode */ + if (Ok != RTC_ExitRwMode()) + { + enRet = Error; + } + } + } + + return enRet; +} + +/** + * @brief Set RTC alarm time. + * @param [in] u8Format Specifies the format of the entered parameters. + * This parameter can be one of the following values: + * @arg RTC_DATA_FORMAT_DEC: Decimal data format + * @arg RTC_DATA_FORMAT_BCD: BCD data format + * @param [in] pstcRtcAlarm Pointer to a @ref stc_rtc_alarm_t structure + * @retval An en_result_t enumeration value: + * - Ok: Set RTC alarm time success + * - ErrorInvalidParameter: Invalid parameter + */ +en_result_t RTC_SetAlarm(uint8_t u8Format, stc_rtc_alarm_t *pstcRtcAlarm) +{ + en_result_t enRet = Ok; + + if (NULL == pstcRtcAlarm) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_RTC_DATA_FORMAT(u8Format)); + if (RTC_DATA_FORMAT_DEC != u8Format) + { + if (RTC_HOUR_FORMAT_12 == READ_REG32(bM4_RTC->CR1_b.AMPM)) + { + DDL_ASSERT(IS_RTC_HOUR12(BCD2DEC(pstcRtcAlarm->u8AlarmHour))); + DDL_ASSERT(IS_RTC_HOUR12_AM_PM(pstcRtcAlarm->u8AlarmAmPm)); + } + else + { + DDL_ASSERT(IS_RTC_HOUR24(BCD2DEC(pstcRtcAlarm->u8AlarmHour))); + } + DDL_ASSERT(IS_RTC_MINUTE(BCD2DEC(pstcRtcAlarm->u8AlarmMinute))); + } + else + { + if (RTC_HOUR_FORMAT_12 == READ_REG32(bM4_RTC->CR1_b.AMPM)) + { + DDL_ASSERT(IS_RTC_HOUR12(pstcRtcAlarm->u8AlarmHour)); + DDL_ASSERT(IS_RTC_HOUR12_AM_PM(pstcRtcAlarm->u8AlarmAmPm)); + } + else + { + DDL_ASSERT(IS_RTC_HOUR24(pstcRtcAlarm->u8AlarmHour)); + } + DDL_ASSERT(IS_RTC_MINUTE(pstcRtcAlarm->u8AlarmMinute)); + } + DDL_ASSERT(IS_RTC_ALARM_WEEKDAY(pstcRtcAlarm->u8AlarmWeekday)); + + /* Configure alarm registers */ + if (RTC_DATA_FORMAT_DEC == u8Format) + { + pstcRtcAlarm->u8AlarmHour = DEC2BCD(pstcRtcAlarm->u8AlarmHour); + pstcRtcAlarm->u8AlarmMinute = DEC2BCD(pstcRtcAlarm->u8AlarmMinute); + } + if ((RTC_HOUR_FORMAT_12 == READ_REG32(bM4_RTC->CR1_b.AMPM)) && + (RTC_HOUR12_PM == pstcRtcAlarm->u8AlarmAmPm)) + { + pstcRtcAlarm->u8AlarmHour |= RTC_HOUR12_PM; + } + + WRITE_REG8(M4_RTC->ALMHOUR, pstcRtcAlarm->u8AlarmHour); + WRITE_REG8(M4_RTC->ALMMIN, pstcRtcAlarm->u8AlarmMinute); + WRITE_REG8(M4_RTC->ALMWEEK, pstcRtcAlarm->u8AlarmWeekday); + } + + return enRet; +} + +/** + * @brief Get RTC alarm time. + * @param [in] u8Format Specifies the format of the returned parameters. + * This parameter can be one of the following values: + * @arg RTC_DATA_FORMAT_DEC: Decimal data format + * @arg RTC_DATA_FORMAT_BCD: BCD data format + * @param [out] pstcRtcAlarm Pointer to a @ref stc_rtc_alarm_t structure + * @retval An en_result_t enumeration value: + * - Ok: Get RTC alarm time success + * - ErrorInvalidParameter: Invalid parameter + */ +en_result_t RTC_GetAlarm(uint8_t u8Format, stc_rtc_alarm_t *pstcRtcAlarm) +{ + en_result_t enRet = Ok; + + if (NULL == pstcRtcAlarm) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_RTC_DATA_FORMAT(u8Format)); + + /* Get RTC date and time register */ + pstcRtcAlarm->u8AlarmWeekday = READ_REG8(M4_RTC->ALMWEEK); + pstcRtcAlarm->u8AlarmMinute = READ_REG8(M4_RTC->ALMMIN); + pstcRtcAlarm->u8AlarmHour = READ_REG8(M4_RTC->ALMHOUR); + + if (RTC_HOUR_FORMAT_12 == READ_REG32(bM4_RTC->CR1_b.AMPM)) + { + if (RTC_HOUR12_PM == (pstcRtcAlarm->u8AlarmHour & RTC_HOUR12_PM)) + { + pstcRtcAlarm->u8AlarmHour &= (uint8_t)(~RTC_HOUR12_PM); + pstcRtcAlarm->u8AlarmAmPm = RTC_HOUR12_PM; + } + else + { + pstcRtcAlarm->u8AlarmAmPm = RTC_HOUR12_AM_HOUR24; + } + } + + /* Check decimal format*/ + if (RTC_DATA_FORMAT_DEC == u8Format) + { + pstcRtcAlarm->u8AlarmHour = BCD2DEC(pstcRtcAlarm->u8AlarmHour); + pstcRtcAlarm->u8AlarmMinute = BCD2DEC(pstcRtcAlarm->u8AlarmMinute); + } + } + + return enRet; +} + +/** + * @brief Enable or disable RTC alarm. + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void RTC_AlarmCmd(en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + WRITE_REG32(bM4_RTC->CR2_b.ALME, enNewSta); +} + +/** + * @brief Configure RTC intrusion function. + * @param [in] u8Ch Specifies the RTC intrusion channel. + * This parameter can be one of the following values: + * @arg RTC_INTRU_CH0: Intrusion channel 0 + * @arg RTC_INTRU_CH1: Intrusion channel 1 + * @param [in] pstcIntru Pointer to a @ref stc_rtc_intrusion_t structure + * @retval An en_result_t enumeration value: + * - Ok: Configure RTC intrusion function success + * - ErrorInvalidParameter: Invalid parameter + */ +en_result_t RTC_IntrusionConfig(uint8_t u8Ch, const stc_rtc_intrusion_t *pstcIntru) +{ + en_result_t enRet = Ok; + __IO uint8_t *TPCR; + + if (NULL == pstcIntru) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_RTC_INTRUSION_CHANNEL(u8Ch)); + DDL_ASSERT(IS_RTC_INTRUSION_TIMESTAMP(pstcIntru->u8TimeStampEn)); + DDL_ASSERT(IS_RTC_RESET_BACKUP_REGISTER(pstcIntru->u8ResetBackupRegEn)); + DDL_ASSERT(IS_RTC_INTRUSION_FILTER(pstcIntru->u8Filter)); + DDL_ASSERT(IS_RTC_INTRUSION_DETECT_EDGE(pstcIntru->u8TrigEdge)); + + TPCR = (__IO uint8_t *)RTC_TPCRx(u8Ch); + /* RTC Intrusion control Configuration */ + MODIFY_REG8(*TPCR, RTC_TPCR_CLEAR_MASK, + (pstcIntru->u8TimeStampEn | pstcIntru->u8ResetBackupRegEn | + pstcIntru->u8Filter | pstcIntru->u8TrigEdge)); + } + + return enRet; +} + +/** + * @brief Get RTC intrusion timestamp. + * @param [in] u8Format Specifies the format of the returned parameters. + * This parameter can be one of the following values: + * @arg RTC_DATA_FORMAT_DEC: Decimal data format + * @arg RTC_DATA_FORMAT_BCD: BCD data format + * @param [out] pstcTimestamp Pointer to a @ref stc_rtc_timestamp_t structure + * @retval An en_result_t enumeration value: + * - Ok: Get RTC intrusion timestamp success + * - ErrorInvalidParameter: Invalid parameter + */ +en_result_t RTC_GetIntrusionTimestamp(uint8_t u8Format, stc_rtc_timestamp_t *pstcTimestamp) +{ + en_result_t enRet = Ok; + + if (NULL == pstcTimestamp) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_RTC_DATA_FORMAT(u8Format)); + + /* Get RTC Timestamp registers */ + pstcTimestamp->stcTSTime.u8Hour = READ_REG8(M4_RTC->HOURTP); + pstcTimestamp->stcTSTime.u8Minute = READ_REG8(M4_RTC->MINTP); + pstcTimestamp->stcTSTime.u8Second = READ_REG8(M4_RTC->SECTP); + pstcTimestamp->u8TSMonth = READ_REG8(M4_RTC->MONTP); + pstcTimestamp->u8TSDay = READ_REG8(M4_RTC->DAYTP); + + if (RTC_HOUR_FORMAT_12 == READ_REG32(bM4_RTC->CR1_b.AMPM)) + { + if (RTC_HOUR12_PM == (pstcTimestamp->stcTSTime.u8Hour & RTC_HOUR12_PM)) + { + pstcTimestamp->stcTSTime.u8Hour &= (uint8_t)(~RTC_HOUR12_PM); + pstcTimestamp->stcTSTime.u8AmPm = RTC_HOUR12_PM; + } + else + { + pstcTimestamp->stcTSTime.u8AmPm = RTC_HOUR12_AM_HOUR24; + } + } + else + { + pstcTimestamp->stcTSTime.u8AmPm = RTC_HOUR12_AM_HOUR24; + } + + /* Check decimal format*/ + if (RTC_DATA_FORMAT_DEC == u8Format) + { + pstcTimestamp->stcTSTime.u8Hour = BCD2DEC(pstcTimestamp->stcTSTime.u8Hour); + pstcTimestamp->stcTSTime.u8Minute = BCD2DEC(pstcTimestamp->stcTSTime.u8Minute); + pstcTimestamp->stcTSTime.u8Second = BCD2DEC(pstcTimestamp->stcTSTime.u8Second); + pstcTimestamp->u8TSMonth = BCD2DEC(pstcTimestamp->u8TSMonth); + pstcTimestamp->u8TSDay = BCD2DEC(pstcTimestamp->u8TSDay); + } + } + + return enRet; +} + +/** + * @brief Enable or disable RTC intrusion. + * @param [in] u8Ch Specifies the RTC intrusion channel. + * This parameter can be one of the following values: + * @arg RTC_INTRU_CH0: Intrusion channel 0 + * @arg RTC_INTRU_CH1: Intrusion channel 1 + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void RTC_IntrusionCmd(uint8_t u8Ch, en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_RTC_INTRUSION_CHANNEL(u8Ch)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + if (RTC_INTRU_CH0 != u8Ch) + { + WRITE_REG32(bM4_RTC->TPCR1_b.TPEN1, enNewSta); + } + else + { + WRITE_REG32(bM4_RTC->TPCR0_b.TPEN0, enNewSta); + } +} + +/** + * @brief Enable or disable specified RTC interrupt. + * @param [in] u32IntSrc Specifies the RTC interrupt source. + * This parameter can be one or any combination of the following values: + * @arg RTC_INT_PRDIE: Period interrupt + * @arg RTC_INT_ALMIE: Alarm interrupt + * @arg RTC_INT_TPIE0: RTCIC0 intrusion interrupt + * @arg RTC_INT_TPIE1: RTCIC1 intrusion interrupt + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void RTC_IntCmd(uint32_t u32IntSrc, en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_RTC_INTERRUPT(u32IntSrc)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + if (0UL != (u32IntSrc & 0x0000FFUL)) + { + if (Disable != enNewSta) + { + SET_REG8_BIT(M4_RTC->CR2, (u32IntSrc & 0x0000FFUL)); + } + else + { + CLEAR_REG8_BIT(M4_RTC->CR2, (u32IntSrc & 0x0000FFUL)); + } + } + + if (0UL != (u32IntSrc & 0x00FF00UL)) + { + WRITE_REG32(bM4_RTC->TPCR0_b.TPIE0, enNewSta); + } + + if (0UL != (u32IntSrc & 0xFF0000UL)) + { + WRITE_REG32(bM4_RTC->TPCR1_b.TPIE1, enNewSta); + } +} + +/** + * @brief Get RTC flag status. + * @param [in] u32Flag Specifies the RTC flag type. + * This parameter can be one or any combination of the following values: + * @arg RTC_FLAG_PRDF: Period flag + * @arg RTC_FLAG_ALMF: Alarm flag + * @arg RTC_FLAG_RWEN: Read and write permission flag + * @arg RTC_FLAG_TPOVF: Intrusion overflow flag + * @arg RTC_FLAG_TPF0: RTCIC0 intrusion flag + * @arg RTC_FLAG_TPF1: RTCIC1 intrusion flag + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t RTC_GetStatus(uint32_t u32Flag) +{ + en_flag_status_t enFlagSta = Reset; + uint8_t u8NormalFlag; + uint8_t u8IntruFlag; + + /* Check parameters */ + DDL_ASSERT(IS_RTC_GET_FLAG(u32Flag)); + + u8NormalFlag = (uint8_t)(u32Flag & 0xFFU); + u8IntruFlag = (uint8_t)((u32Flag >> 16U) & 0xFFU); + if (0U != u8NormalFlag) + { + if (0U != (READ_REG8_BIT(M4_RTC->CR2, u8NormalFlag))) + { + enFlagSta = Set; + } + } + if ((0U != u8IntruFlag) && (Set != enFlagSta)) + { + if (0U != (READ_REG8_BIT(M4_RTC->TPSR, u8IntruFlag))) + { + enFlagSta = Set; + } + } + + return enFlagSta; +} + +/** + * @brief Clear RTC flag. + * @param [in] u32Flag Specifies the RTC flag type. + * This parameter can be one or any combination of the following values: + * @arg RTC_FLAG_PRDF: Period flag + * @arg RTC_FLAG_ALMF: Alarm flag + * @arg RTC_FLAG_TPOVF: Intrusion overflow flag + * @arg RTC_FLAG_TPF0: RTCIC0 intrusion flag + * @arg RTC_FLAG_TPF1: RTCIC1 intrusion flag + * @retval None + */ +void RTC_ClearStatus(uint32_t u32Flag) +{ + uint8_t u8NormalFlag; + uint8_t u8IntruFlag; + + /* Check parameters */ + DDL_ASSERT(IS_RTC_CLEAR_FLAG(u32Flag)); + + u8NormalFlag = (uint8_t)(u32Flag & 0xFFU); + u8IntruFlag = (uint8_t)((u32Flag >> 16U) & 0xFFU); + if (0U != u8NormalFlag) + { + CLEAR_REG8_BIT(M4_RTC->CR2, u8NormalFlag); + } + if (0U != u8IntruFlag) + { + CLEAR_REG8_BIT(M4_RTC->TPSR, u8IntruFlag); + } +} + +/** + * @} + */ + +#endif /* DDL_RTC_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_sdioc.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_sdioc.c new file mode 100644 index 0000000000..b0642bcb0d --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_sdioc.c @@ -0,0 +1,3050 @@ +/** + ******************************************************************************* + * @file hc32f4a0_sdioc.c + * @brief This file provides firmware functions to manage the Secure Digital + * Input and Output Controller(SDIOC). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Yangjp First version + 2020-08-11 Yangjp Fix a known potential risk in SDIOC_VerifyClockDiv function + 2020-09-04 Yangjp Optimize timeout handling in functions + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_sdioc.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_SDIOC SDIOC + * @brief SDIOC Driver Library + * @{ + */ + +#if (DDL_SDIOC_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup SDIOC_Local_Macros SDIOC Local Macros + * @{ + */ + +/* Masks for R6 Response */ +#define SDMMC_R6_GENERAL_UNKNOWN_ERROR (0x00002000UL) +#define SDMMC_R6_ILLEGAL_CMD (0x00004000UL) +#define SDMMC_R6_COM_CRC_FAILED (0x00008000UL) + +/* SDMMC command parameters */ +#define SDMMC_CMD8_CHECK_PATTERN (0x000001AAUL) +/* 3.2V-3.3V */ +#define SDMMC_ACMD41_VOLTAGE_WINDOW (0x80100000UL) + +/* Command send and response timeout(ms) */ +#define SDMMC_CMD_TIMEOUT (5000UL) +/* Max erase Timeout 60s */ +#define SDMMC_MAX_ERASE_TIMEOUT (60000UL) + +/* SDIOC software reset timeout(ms) */ +#define SDIOC_SW_RESET_TIMEOUT (50UL) + +/* SDIOC NORINTSGEN register Mask */ +#define SDIOC_NORINTSGEN_CLEAR_MASK (0x01F7U) +/* SDIOC ERRINTSGEN register Mask */ +#define SDIOC_ERRINTSGEN_CLEAR_MASK (0x017FU) + +/*!< Get the specified register address of the specified SDIOC unit */ +#define SDIOC_ARG(__UNIT__) ((uint32_t)(&((__UNIT__)->ARG0))) +#define SDIOC_BUF(__UNIT__) ((uint32_t)(&((__UNIT__)->BUF0))) +#define SDIOC_RESPx(__UNIT__, RESP_REG) ((uint32_t)(&((__UNIT__)->RESP0)) + (uint32_t)(RESP_REG)) + +/** + * @defgroup SDIOC_Check_Parameters_Validity SDIOC Check Parameters Validity + * @{ + */ +#define IS_SDIOC_UNIT(x) \ +( ((x) == M4_SDIOC1) || \ + ((x) == M4_SDIOC2)) + +#define IS_SDIOC_MODE(x) \ +( ((x) == SDIOC_MODE_SD) || \ + ((x) == SDIOC_MODE_MMC)) + +#define IS_SDIOC_CARD_DETECT_SELECT(x) \ +( ((x) == SDIOC_CARD_DETECT_CD_PIN_LEVEL) || \ + ((x) == SDIOC_CARD_DETECT_TEST_SIGNAL)) + +#define IS_SDIOC_CARD_DETECT_TEST_LEVEL(x) \ +( ((x) == SDIOC_CARD_DETECT_TEST_LEVEL_LOW) || \ + ((x) == SDIOC_CARD_DETECT_TEST_LEVEL_HIGH)) + +#define IS_SDIOC_SPEED_MODE(x) \ +( ((x) == SDIOC_SPEED_MODE_NORMAL) || \ + ((x) == SDIOC_SPEED_MODE_HIGH)) + +#define IS_SDIOC_BUS_WIDTH(x) \ +( ((x) == SDIOC_BUS_WIDTH_1BIT) || \ + ((x) == SDIOC_BUS_WIDTH_4BIT) || \ + ((x) == SDIOC_BUS_WIDTH_8BIT)) + +#define IS_SDIOC_CLOCK_DIV(x) \ +( ((x) == SDIOC_CLOCK_DIV_1) || \ + ((x) == SDIOC_CLOCK_DIV_2) || \ + ((x) == SDIOC_CLOCK_DIV_4) || \ + ((x) == SDIOC_CLOCK_DIV_8) || \ + ((x) == SDIOC_CLOCK_DIV_16) || \ + ((x) == SDIOC_CLOCK_DIV_32) || \ + ((x) == SDIOC_CLOCK_DIV_64) || \ + ((x) == SDIOC_CLOCK_DIV_128) || \ + ((x) == SDIOC_CLOCK_DIV_256)) + +#define IS_SDIOC_CMD_TYPE(x) \ +( ((x) == SDIOC_CMD_TYPE_NORMAL) || \ + ((x) == SDIOC_CMD_TYPE_SUSPEND) || \ + ((x) == SDIOC_CMD_TYPE_RESUME) || \ + ((x) == SDIOC_CMD_TYPE_ABORT)) + +#define IS_SDIOC_DATA_LINE(x) \ +( ((x) == SDIOC_DATA_LINE_DISABLE) || \ + ((x) == SDIOC_DATA_LINE_ENABLE)) + +#define IS_SDIOC_TRANSFER_DIR(x) \ +( ((x) == SDIOC_TRANSFER_DIR_TO_CARD) || \ + ((x) == SDIOC_TRANSFER_DIR_TO_HOST)) + +#define IS_SDIOC_AUTO_SEND_CMD12(x) \ +( ((x) == SDIOC_AUTO_SEND_CMD12_DISABLE) || \ + ((x) == SDIOC_AUTO_SEND_CMD12_ENABLE)) + +#define IS_SDIOC_TRANSFER_MODE(x) \ +( ((x) == SDIOC_TRANSFER_MODE_SINGLE) || \ + ((x) == SDIOC_TRANSFER_MODE_INFINITE) || \ + ((x) == SDIOC_TRANSFER_MODE_MULTIPLE) || \ + ((x) == SDIOC_TRANSFER_MODE_STOP_MULTIPLE)) + +#define IS_SDIOC_DATA_TIMEOUT_TIME(x) \ +( ((x) == SDIOC_DATA_TIMEOUT_CLK_2_13) || \ + ((x) == SDIOC_DATA_TIMEOUT_CLK_2_14) || \ + ((x) == SDIOC_DATA_TIMEOUT_CLK_2_15) || \ + ((x) == SDIOC_DATA_TIMEOUT_CLK_2_16) || \ + ((x) == SDIOC_DATA_TIMEOUT_CLK_2_17) || \ + ((x) == SDIOC_DATA_TIMEOUT_CLK_2_18) || \ + ((x) == SDIOC_DATA_TIMEOUT_CLK_2_19) || \ + ((x) == SDIOC_DATA_TIMEOUT_CLK_2_20) || \ + ((x) == SDIOC_DATA_TIMEOUT_CLK_2_21) || \ + ((x) == SDIOC_DATA_TIMEOUT_CLK_2_22) || \ + ((x) == SDIOC_DATA_TIMEOUT_CLK_2_23) || \ + ((x) == SDIOC_DATA_TIMEOUT_CLK_2_24) || \ + ((x) == SDIOC_DATA_TIMEOUT_CLK_2_25) || \ + ((x) == SDIOC_DATA_TIMEOUT_CLK_2_26) || \ + ((x) == SDIOC_DATA_TIMEOUT_CLK_2_27)) + +#define IS_SDIOC_RESPONSE_REG(x) \ +( ((x) == SDIOC_RESPONSE_REG_BIT0_31) || \ + ((x) == SDIOC_RESPONSE_REG_BIT32_63) || \ + ((x) == SDIOC_RESPONSE_REG_BIT64_95) || \ + ((x) == SDIOC_RESPONSE_REG_BIT96_127)) + +#define IS_SDIOC_SW_RESET_TYPE(x) \ +( ((x) == SDIOC_SW_RESET_DATA_LINE) || \ + ((x) == SDIOC_SW_RESET_CMD_LINE) || \ + ((x) == SDIOC_SW_RESET_ALL)) + +#define IS_SDIOC_OUTPUT_CLK_FREQ(x) \ +( ((x) == SDIOC_OUTPUT_CLK_FREQ_400K) || \ + ((x) == SDIOC_OUTPUT_CLK_FREQ_25M) || \ + ((x) == SDIOC_OUTPUT_CLK_FREQ_26M) || \ + ((x) == SDIOC_OUTPUT_CLK_FREQ_50M) || \ + ((x) == SDIOC_OUTPUT_CLK_FREQ_52M)) + +#define IS_SDIOC_GET_HOST_FLAG(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(SDIOC_HOST_FLAG_CMDL | \ + SDIOC_HOST_FLAG_DATL | \ + SDIOC_HOST_FLAG_DATL_D0 | \ + SDIOC_HOST_FLAG_DATL_D1 | \ + SDIOC_HOST_FLAG_DATL_D2 | \ + SDIOC_HOST_FLAG_DATL_D3 | \ + SDIOC_HOST_FLAG_WPL | \ + SDIOC_HOST_FLAG_CDL | \ + SDIOC_HOST_FLAG_CSS | \ + SDIOC_HOST_FLAG_CIN | \ + SDIOC_HOST_FLAG_BRE | \ + SDIOC_HOST_FLAG_BWE | \ + SDIOC_HOST_FLAG_RTA | \ + SDIOC_HOST_FLAG_WTA | \ + SDIOC_HOST_FLAG_DA | \ + SDIOC_HOST_FLAG_CID | \ + SDIOC_HOST_FLAG_CIC)))))) + +#define IS_SDIOC_GET_NORMAL_ERROR_INT_FLAG(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(SDIOC_NORMAL_INT_FLAG_EI | \ + SDIOC_NORMAL_INT_FLAG_CINT | \ + SDIOC_NORMAL_INT_FLAG_CRM | \ + SDIOC_NORMAL_INT_FLAG_CIST | \ + SDIOC_NORMAL_INT_FLAG_BRR | \ + SDIOC_NORMAL_INT_FLAG_BWR | \ + SDIOC_NORMAL_INT_FLAG_BGE | \ + SDIOC_NORMAL_INT_FLAG_TC | \ + SDIOC_NORMAL_INT_FLAG_CC | \ + SDIOC_ERROR_INT_FLAG_ACE | \ + SDIOC_ERROR_INT_FLAG_DEBE | \ + SDIOC_ERROR_INT_FLAG_DCE | \ + SDIOC_ERROR_INT_FLAG_DTOE | \ + SDIOC_ERROR_INT_FLAG_CIE | \ + SDIOC_ERROR_INT_FLAG_CEBE | \ + SDIOC_ERROR_INT_FLAG_CCE | \ + SDIOC_ERROR_INT_FLAG_CTOE)))))) + +#define IS_SDIOC_CLEAR_NORMAL_ERROR_INT_FLAG(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(SDIOC_NORMAL_INT_FLAG_CRM | \ + SDIOC_NORMAL_INT_FLAG_CIST | \ + SDIOC_NORMAL_INT_FLAG_BRR | \ + SDIOC_NORMAL_INT_FLAG_BWR | \ + SDIOC_NORMAL_INT_FLAG_BGE | \ + SDIOC_NORMAL_INT_FLAG_TC | \ + SDIOC_NORMAL_INT_FLAG_CC | \ + SDIOC_ERROR_INT_FLAG_ACE | \ + SDIOC_ERROR_INT_FLAG_DEBE | \ + SDIOC_ERROR_INT_FLAG_DCE | \ + SDIOC_ERROR_INT_FLAG_DTOE | \ + SDIOC_ERROR_INT_FLAG_CIE | \ + SDIOC_ERROR_INT_FLAG_CEBE | \ + SDIOC_ERROR_INT_FLAG_CCE | \ + SDIOC_ERROR_INT_FLAG_CTOE)))))) + +#define IS_SDIOC_NORMAL_ERROR_INT(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(SDIOC_NORMAL_INT_CINTSEN | \ + SDIOC_NORMAL_INT_CRMSEN | \ + SDIOC_NORMAL_INT_CISTSEN | \ + SDIOC_NORMAL_INT_BRRSEN | \ + SDIOC_NORMAL_INT_BWRSEN | \ + SDIOC_NORMAL_INT_BGESEN | \ + SDIOC_NORMAL_INT_TCSEN | \ + SDIOC_NORMAL_INT_CCSEN | \ + SDIOC_ERROR_INT_ACESEN | \ + SDIOC_ERROR_INT_DEBESEN | \ + SDIOC_ERROR_INT_DCESEN | \ + SDIOC_ERROR_INT_DTOESEN | \ + SDIOC_ERROR_INT_CIESEN | \ + SDIOC_ERROR_INT_CEBESEN | \ + SDIOC_ERROR_INT_CCESEN | \ + SDIOC_ERROR_INT_CTOESEN)))))) + +#define IS_SDIOC_AUTO_CMD_ERROR_FLAG(x) \ +( (0U != (x)) && \ + (0U == ((x) & ((uint16_t)(~(uint16_t)(SDIOC_AUTO_CMD_ERROR_FLAG_CMDE | \ + SDIOC_AUTO_CMD_ERROR_FLAG_IE | \ + SDIOC_AUTO_CMD_ERROR_FLAG_EBE | \ + SDIOC_AUTO_CMD_ERROR_FLAG_CE | \ + SDIOC_AUTO_CMD_ERROR_FLAG_TOE | \ + SDIOC_AUTO_CMD_ERROR_FLAG_NE)))))) + +#define IS_SDIOC_FORCE_AUTO_CMD_FLAG(x) \ +( (0U != (x)) && \ + (0U == ((x) & ((uint16_t)(~(uint16_t)(SDIOC_FORCE_AUTO_CMD_ERROR_FCMDE | \ + SDIOC_FORCE_AUTO_CMD_ERROR_FIE | \ + SDIOC_FORCE_AUTO_CMD_ERROR_FEBE | \ + SDIOC_FORCE_AUTO_CMD_ERROR_FCE | \ + SDIOC_FORCE_AUTO_CMD_ERROR_FTOE | \ + SDIOC_FORCE_AUTO_CMD_ERROR_FNE)))))) + +#define IS_SDIOC_FORCE_ERROR_INT_FLAG(x) \ +( (0U != (x)) && \ + (0U == ((x) & ((uint16_t)(~(uint16_t)(SDIOC_FORCE_ERROR_INT_FACE | \ + SDIOC_FORCE_ERROR_INT_FDEBE | \ + SDIOC_FORCE_ERROR_INT_FDCE | \ + SDIOC_FORCE_ERROR_INT_FDTOE | \ + SDIOC_FORCE_ERROR_INT_FCIE | \ + SDIOC_FORCE_ERROR_INT_FCEBE | \ + SDIOC_FORCE_ERROR_INT_FCCE | \ + SDIOC_FORCE_ERROR_INT_FCTOE)))))) + +#define IS_SDIOC_RESOPNE_TYPE(x) \ +( ((x) == SDIOC_RESOPNE_TYPE_NO) || \ + ((x) == SDIOC_RESOPNE_TYPE_R2) || \ + ((x) == SDIOC_RESOPNE_TYPE_R3_R4) || \ + ((x) == SDIOC_RESOPNE_TYPE_R1_R5_R6_R7) || \ + ((x) == SDIOC_RESOPNE_TYPE_R1B_R5B)) + +#define IS_SDIOC_CMD_INDEX(x) ((x) < 0x40U) + +#define IS_SDIOC_BLOCK_SIZE(x) (((x) >= 1U) && ((x) <= 512U)) + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ +static en_result_t SDMMC_WaitResponse(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32CheckFlag, uint32_t u32Timeout, uint32_t *pu32ErrSta); +static en_result_t SDMMC_GetCmdError(M4_SDIOC_TypeDef *SDIOCx); +static en_result_t SDMMC_GetCmdResp1(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32Timeout, uint32_t *pu32ErrSta); +static en_result_t SDMMC_GetCmdResp1Busy(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32Timeout, uint32_t *pu32ErrSta); +static en_result_t SDMMC_GetCmdResp2(M4_SDIOC_TypeDef *SDIOCx, uint32_t *pu32ErrSta); +static en_result_t SDMMC_GetCmdResp3(M4_SDIOC_TypeDef *SDIOCx, uint32_t *pu32ErrSta); +static en_result_t SDMMC_GetCmdResp6(M4_SDIOC_TypeDef *SDIOCx, uint16_t *pu16RCA, uint32_t *pu32ErrSta); +static en_result_t SDMMC_GetCmdResp7(M4_SDIOC_TypeDef *SDIOCx, uint32_t *pu32ErrSta); + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup SDIOC_Global_Functions SDIOC Global Functions + * @{ + */ +/** + * @brief De-Initialize SDIOC. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @retval An en_result_t enumeration value: + * - Ok: SDIOC De-Initialize success + * - ErrorTimeout: Software reset timeout + */ +en_result_t SDIOC_DeInit(M4_SDIOC_TypeDef *SDIOCx) +{ + return SDIOC_SoftwareReset(SDIOCx, SDIOC_SW_RESET_ALL); +} + +/** + * @brief Initialize SDIOC. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] pstcSdiocInit Pointer to a @ref stc_sdioc_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: SDIOC Initialize success + * - ErrorInvalidParameter: pstcSdiocInit == NULL + */ +en_result_t SDIOC_Init(M4_SDIOC_TypeDef *SDIOCx, const stc_sdioc_init_t *pstcSdiocInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcSdiocInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_SDIOC_MODE(pstcSdiocInit->u32Mode)); + DDL_ASSERT(IS_SDIOC_CARD_DETECT_SELECT(pstcSdiocInit->u8CardDetectSelect)); + DDL_ASSERT(IS_SDIOC_SPEED_MODE(pstcSdiocInit->u8SpeedMode)); + DDL_ASSERT(IS_SDIOC_BUS_WIDTH(pstcSdiocInit->u8BusWidth)); + DDL_ASSERT(IS_SDIOC_CLOCK_DIV(pstcSdiocInit->u16ClockDiv)); + + /* Set the SDIOC mode */ + if (M4_SDIOC1 == SDIOCx) + { + WRITE_REG32(bM4_PERIC->SDIOC_SYCTLREG_b.SELMMC1, pstcSdiocInit->u32Mode); + } + else + { + WRITE_REG32(bM4_PERIC->SDIOC_SYCTLREG_b.SELMMC2, pstcSdiocInit->u32Mode); + } + + /* Set the SDIOC clock control value */ + WRITE_REG16(SDIOCx->CLKCON, (pstcSdiocInit->u16ClockDiv | SDIOC_CLKCON_ICE | SDIOC_CLKCON_CE)); + /* Set the SDIOC host control value */ + WRITE_REG8(SDIOCx->HOSTCON, (pstcSdiocInit->u8CardDetectSelect | + pstcSdiocInit->u8BusWidth | pstcSdiocInit->u8SpeedMode)); + /* Enable normal interrupt status */ + WRITE_REG16(SDIOCx->NORINTSTEN, SDIOC_NORINTSGEN_CLEAR_MASK); + /* Enable error interrupt status */ + WRITE_REG16(SDIOCx->ERRINTSTEN, SDIOC_ERRINTSGEN_CLEAR_MASK); + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_sdioc_init_t to default values. + * @param [out] pstcSdiocInit Pointer to a @ref stc_sdioc_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Structure Initialize success + * - ErrorInvalidParameter: pstcSdiocInit == NULL + */ +en_result_t SDIOC_StructInit(stc_sdioc_init_t *pstcSdiocInit) +{ + en_result_t enRet = Ok; + + if (NULL == pstcSdiocInit) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcSdiocInit->u32Mode = SDIOC_MODE_SD; + pstcSdiocInit->u8CardDetectSelect = SDIOC_CARD_DETECT_CD_PIN_LEVEL; + pstcSdiocInit->u8SpeedMode = SDIOC_SPEED_MODE_NORMAL; + pstcSdiocInit->u8BusWidth = SDIOC_BUS_WIDTH_1BIT; + pstcSdiocInit->u16ClockDiv = SDIOC_CLOCK_DIV_1; + } + + return enRet; +} + +/** + * @brief Set software reset. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u8ResetType Software reset type + * This parameter can be one of the following values: + * @arg SDIOC_SW_RESET_DATA_LINE: Only part of data circuit is reset + * @arg SDIOC_SW_RESET_CMD_LINE: Only part of command circuit is reset + * @arg SDIOC_SW_RESET_ALL: Reset the entire Host Controller except for the card detection circuit + * @retval An en_result_t enumeration value: + * - Ok: Software reset success + * - ErrorTimeout: Software reset timeout + */ +en_result_t SDIOC_SoftwareReset(M4_SDIOC_TypeDef *SDIOCx, uint8_t u8ResetType) +{ + en_result_t enRet = Ok; + __IO uint32_t u32Count; + + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_SDIOC_SW_RESET_TYPE(u8ResetType)); + + WRITE_REG8(SDIOCx->SFTRST, u8ResetType); + /* Wait for reset finish */ + u32Count = SDIOC_SW_RESET_TIMEOUT * (HCLK_VALUE / 20000UL); + while (0U != READ_REG8_BIT(SDIOCx->SFTRST, u8ResetType)) + { + if (0UL == u32Count) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + + return enRet; +} + +/** + * @brief Enable or disable power. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void SDIOC_PowerCmd(M4_SDIOC_TypeDef *SDIOCx, en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + if (Disable != enNewSta) + { + SET_REG8_BIT(SDIOCx->PWRCON, SDIOC_PWRCON_PWON); + } + else + { + CLEAR_REG8_BIT(SDIOCx->PWRCON, SDIOC_PWRCON_PWON); + } +} + +/** + * @brief Get power state. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @retval An en_result_t enumeration value: + * - Disable: Power off or SDIOCx == NULL + * - Enable: Power on + */ +en_functional_state_t SDIOC_GetPowerState(const M4_SDIOC_TypeDef *SDIOCx) +{ + en_functional_state_t enPowerSta = Disable; + + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + + if (0U != (READ_REG8_BIT(SDIOCx->PWRCON, SDIOC_PWRCON_PWON))) + { + enPowerSta = Enable; + } + + return enPowerSta; +} + +/** + * @brief Get SDIOC work mode. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @retval uint32_t value: + * - SDIOC_MODE_SD: SDIOCx selects SD mode + * - SDIOC_MODE_MMC: SDIOCx selects MMC mode + */ +uint32_t SDIOC_GetMode(const M4_SDIOC_TypeDef *SDIOCx) +{ + uint32_t u32SdMode; + + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + + u32SdMode = READ_REG32_BIT(M4_PERIC->SDIOC_SYCTLREG, ((M4_SDIOC1 == SDIOCx) ? + PERIC_SDIOC_SYCTLREG_SELMMC1 : PERIC_SDIOC_SYCTLREG_SELMMC2)); + if (0UL != u32SdMode) /* MMC mode */ + { + u32SdMode = SDIOC_MODE_MMC; + } + + return u32SdMode; +} + +/** + * @brief Enable or disable clock output. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void SDIOC_ClockCmd(M4_SDIOC_TypeDef *SDIOCx, en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + if (Disable != enNewSta) + { + SET_REG8_BIT(SDIOCx->CLKCON, SDIOC_CLKCON_CE); + } + else + { + CLEAR_REG8_BIT(SDIOCx->CLKCON, SDIOC_CLKCON_CE); + } +} + +/** + * @brief Set clock division. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u16ClkDiv Clock division + * This parameter can be one of the following values: + * @arg SDIOC_CLOCK_DIV_1: PCLK1/1 + * @arg SDIOC_CLOCK_DIV_2: PCLK1/2 + * @arg SDIOC_CLOCK_DIV_4: PCLK1/4 + * @arg SDIOC_CLOCK_DIV_8: PCLK1/8 + * @arg SDIOC_CLOCK_DIV_16: PCLK1/16 + * @arg SDIOC_CLOCK_DIV_32: PCLK1/32 + * @arg SDIOC_CLOCK_DIV_64: PCLK1/64 + * @arg SDIOC_CLOCK_DIV_128: PCLK1/128 + * @arg SDIOC_CLOCK_DIV_256: PCLK1/256 + * @retval None + */ +void SDIOC_SetClockDiv(M4_SDIOC_TypeDef *SDIOCx, uint16_t u16ClkDiv) +{ + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_SDIOC_CLOCK_DIV(u16ClkDiv)); + + MODIFY_REG16(SDIOCx->CLKCON, SDIOC_CLKCON_FS, u16ClkDiv); +} + +/** + * @brief Find the most suitable clock division for the set clock frequency. + * @note More clock values can be set as needed, but the maximum cannot exceed 50MHz. + * @param [in] u32ClkFreq SDIOCx_CK clock frequency + * This parameter can be one of the following values: + * @arg SDIOC_OUTPUT_CLK_FREQ_400K: SDIOC clock: 400KHz + * @arg SDIOC_OUTPUT_CLK_FREQ_25M: SDIOC clock: 25MHz + * @arg SDIOC_OUTPUT_CLK_FREQ_26M: SDIOC clock: 26MHz + * @arg SDIOC_OUTPUT_CLK_FREQ_50M: SDIOC clock: 50MHz + * @arg SDIOC_OUTPUT_CLK_FREQ_52M: SDIOC clock: 52MHz + * @arg Any other value + * @param [out] pu16ClkDiv Pointer to a value of clock division + * @retval An en_result_t enumeration value: + * - Ok: SDIOC Initialize success + * - Error: The Bus clock frequency is too high + * - ErrorInvalidParameter: pu16ClkDiv == NULL or 0UL == u32ClkFreq + */ +en_result_t SDIOC_GetOptimumClockDiv(uint32_t u32ClkFreq, uint16_t *pu16ClkDiv) +{ + en_result_t enRet = Ok; + uint32_t u32BusClk; + uint32_t u32ClkDiv; + uint32_t u32Temp; + + if ((NULL == pu16ClkDiv) || (0UL == u32ClkFreq)) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Get PCLK1 frequency */ + u32BusClk = SystemCoreClock / (0x01UL << (READ_REG32_BIT(M4_CMU->SCFGR, CMU_SCFGR_PCLK1S) >> CMU_SCFGR_PCLK1S_POS)); + u32ClkDiv = u32BusClk / u32ClkFreq; + if (0UL != (u32BusClk % u32ClkFreq)) + { + u32ClkDiv++; + } + + /* Check the effectiveness of clock division */ + if (u32ClkDiv > 256U) /* Maximum division is 256 */ + { + enRet = Error; + } + else + { + if (1U == u32ClkDiv) + { + *pu16ClkDiv = SDIOC_CLOCK_DIV_1; + } + else + { + for (u32Temp=SDIOC_CLOCK_DIV_2; u32Temp<=SDIOC_CLOCK_DIV_256; u32Temp<<=1U) + { + if (u32ClkDiv <= (u32Temp >> (SDIOC_CLKCON_FS_POS - 1U))) + { + break; + } + } + *pu16ClkDiv = (uint16_t)u32Temp; + } + } + } + + return enRet; +} + +/** + * @brief Verify the validity of the clock division. + * @param [in] u32Mode SDIOC work mode + * This parameter can be one of the following values: + * @arg SDIOC_MODE_SD: SDIOCx selects SD mode + * @arg SDIOC_MODE_MMC: SDIOCx selects MMC mode + * @param [in] u8SpeedMode Speed mode + * This parameter can be one of the following values: + * @arg SDIOC_SPEED_MODE_NORMAL: Normal speed mode + * @arg SDIOC_SPEED_MODE_HIGH: High speed mode + * @param [in] u16ClkDiv Clock division + * This parameter can be one of the following values: + * @arg SDIOC_CLOCK_DIV_1: PCLK1/1 + * @arg SDIOC_CLOCK_DIV_2: PCLK1/2 + * @arg SDIOC_CLOCK_DIV_4: PCLK1/4 + * @arg SDIOC_CLOCK_DIV_8: PCLK1/8 + * @arg SDIOC_CLOCK_DIV_16: PCLK1/16 + * @arg SDIOC_CLOCK_DIV_32: PCLK1/32 + * @arg SDIOC_CLOCK_DIV_64: PCLK1/64 + * @arg SDIOC_CLOCK_DIV_128: PCLK1/128 + * @arg SDIOC_CLOCK_DIV_256: PCLK1/256 + * @retval An en_result_t enumeration value: + * - Ok: The clock division is valid + * - Error: The Bus clock frequency is too high + */ +en_result_t SDIOC_VerifyClockDiv(uint32_t u32Mode, uint8_t u8SpeedMode, uint16_t u16ClkDiv) +{ + en_result_t enRet = Ok; + uint32_t u32BusClk; + uint32_t u32ClkFreq; + uint32_t u32MaxFreq; + uint32_t u32DivValue; + + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_MODE(u32Mode)); + DDL_ASSERT(IS_SDIOC_SPEED_MODE(u8SpeedMode)); + DDL_ASSERT(IS_SDIOC_CLOCK_DIV(u16ClkDiv)); + + /* Get PCLK1 frequency */ + u32BusClk = SystemCoreClock / (0x01UL << (READ_REG32_BIT(M4_CMU->SCFGR, CMU_SCFGR_PCLK1S) >> CMU_SCFGR_PCLK1S_POS)); + u32DivValue = ((uint32_t)u16ClkDiv >> (SDIOC_CLKCON_FS_POS - 1U)); + if (0UL == u32DivValue) + { + u32ClkFreq = u32BusClk; + } + else + { + u32ClkFreq = u32BusClk / u32DivValue; + } + + if (SDIOC_SPEED_MODE_NORMAL == u8SpeedMode) + { + if (SDIOC_MODE_SD != u32Mode) /* MMC mode */ + { + u32MaxFreq = SDIOC_OUTPUT_CLK_FREQ_26M; + } + else + { + u32MaxFreq = SDIOC_OUTPUT_CLK_FREQ_25M; + } + } + else + { + if (SDIOC_MODE_SD != u32Mode) /* MMC mode */ + { + u32MaxFreq = SDIOC_OUTPUT_CLK_FREQ_52M; + } + else + { + u32MaxFreq = SDIOC_OUTPUT_CLK_FREQ_50M; + } + } + + if (u32ClkFreq > u32MaxFreq) + { + enRet = Error; + } + + return enRet; +} + +/** + * @brief Get device insert state. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @retval An en_result_t enumeration value: + * - Disable: No device inserted + * - Enable: The device inserted + */ +en_functional_state_t SDIOC_GetDeviceInsertState(const M4_SDIOC_TypeDef *SDIOCx) +{ + en_functional_state_t enInsertSta = Disable; + + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + + if (0UL != (READ_REG32_BIT(SDIOCx->PSTAT, SDIOC_PSTAT_CSS))) + { + if (0UL != (READ_REG32_BIT(SDIOCx->PSTAT, SDIOC_PSTAT_CIN))) + { + enInsertSta = Enable; + } + } + + return enInsertSta; +} + +/** + * @brief Set speed mode. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u8SpeedMode Speed mode + * This parameter can be one of the following values: + * @arg SDIOC_SPEED_MODE_NORMAL: Normal speed mode + * @arg SDIOC_SPEED_MODE_HIGH: High speed mode + * @retval None + */ +void SDIOC_SetSpeedMode(M4_SDIOC_TypeDef *SDIOCx, uint8_t u8SpeedMode) +{ + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_SDIOC_SPEED_MODE(u8SpeedMode)); + + if (SDIOC_SPEED_MODE_NORMAL != u8SpeedMode) + { + SET_REG8_BIT(SDIOCx->HOSTCON, SDIOC_HOSTCON_HSEN); + } + else + { + CLEAR_REG8_BIT(SDIOCx->HOSTCON, SDIOC_HOSTCON_HSEN); + } +} + +/** + * @brief Set bus width. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u8BusWidth Bus width + * This parameter can be one of the following values: + * @arg SDIOC_BUS_WIDTH_1BIT: The Bus width is 1 bit + * @arg SDIOC_BUS_WIDTH_4BIT: The Bus width is 4 bit + * @arg SDIOC_BUS_WIDTH_8BIT: The Bus width is 8 bit + * @retval None + */ +void SDIOC_SetBusWidth(M4_SDIOC_TypeDef *SDIOCx, uint8_t u8BusWidth) +{ + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_SDIOC_BUS_WIDTH(u8BusWidth)); + + MODIFY_REG8(SDIOCx->HOSTCON, (SDIOC_HOSTCON_DW | SDIOC_HOSTCON_EXDW), u8BusWidth); +} + +/** + * @brief Set card detect line select. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u8Src Card detect source + * This parameter can be one of the following values: + * @arg SDIOC_CARD_DETECT_CD_PIN_LEVEL: SDIOCx_CD(x=1~2) line is selected (for normal use) + * @arg SDIOC_CARD_DETECT_TEST_SIGNAL: The Card Detect Test Level is selected(for test purpose) + * @retval None + */ +void SDIOC_SetCardDetectSource(M4_SDIOC_TypeDef *SDIOCx, uint8_t u8Src) +{ + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_SDIOC_CARD_DETECT_SELECT(u8Src)); + + if (SDIOC_CARD_DETECT_CD_PIN_LEVEL != u8Src) + { + SET_REG8_BIT(SDIOCx->HOSTCON, SDIOC_HOSTCON_CDSS); + } + else + { + CLEAR_REG8_BIT(SDIOCx->HOSTCON, SDIOC_HOSTCON_CDSS); + } +} + +/** + * @brief Set card detect test level. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u8Level Card test level + * This parameter can be one of the following values: + * @arg SDIOC_CARD_DETECT_TEST_LEVEL_LOW: Card identification test signal is low level (with device insertion) + * @arg SDIOC_CARD_DETECT_TEST_LEVEL_HIGH: Card identification test signal is high level (no device insertion) + * @retval None + */ +void SDIOC_SetCardDetectTestLevel(M4_SDIOC_TypeDef *SDIOCx, uint8_t u8Level) +{ + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_SDIOC_CARD_DETECT_TEST_LEVEL(u8Level)); + + if (SDIOC_CARD_DETECT_TEST_LEVEL_LOW != u8Level) + { + SET_REG8_BIT(SDIOCx->HOSTCON, SDIOC_HOSTCON_CDTL); + } + else + { + CLEAR_REG8_BIT(SDIOCx->HOSTCON, SDIOC_HOSTCON_CDTL); + } +} + +/** + * @brief Configure the SDIOCx command parameters. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] pstcCmd Pointer to a @ref stc_sdioc_cmd_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Configure SDIOCx command parameters success + * - ErrorInvalidParameter: pstcCmd == NULL + */ +en_result_t SDIOC_SendCommand(M4_SDIOC_TypeDef *SDIOCx, const stc_sdioc_cmd_init_t *pstcCmd) +{ + en_result_t enRet = Ok; + __IO uint32_t *pu32Temp; + + if (NULL == pstcCmd) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_SDIOC_CMD_INDEX(pstcCmd->u16CmdIndex)); + DDL_ASSERT(IS_SDIOC_CMD_TYPE(pstcCmd->u16CmdType)); + DDL_ASSERT(IS_SDIOC_DATA_LINE(pstcCmd->u16DataLineEn)); + DDL_ASSERT(IS_SDIOC_RESOPNE_TYPE(pstcCmd->u16RespType)); + + /* Set the SDIOC Command parameters value */ + pu32Temp = (__IO uint32_t *)SDIOC_ARG(SDIOCx); + WRITE_REG32(*pu32Temp, pstcCmd->u32Argument); + /* Set the SDIOC Command controller value */ + WRITE_REG16(SDIOCx->CMD, ((uint16_t)(pstcCmd->u16CmdIndex << SDIOC_CMD_IDX_POS) | + pstcCmd->u16CmdType | pstcCmd->u16DataLineEn | pstcCmd->u16RespType)); + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_sdioc_cmd_init_t to default values. + * @param [out] pstcCmd Pointer to a @ref stc_sdioc_cmd_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Structure Initialize success + * - ErrorInvalidParameter: pstcData == NULL + */ +en_result_t SDIOC_CmdStructInit(stc_sdioc_cmd_init_t *pstcCmd) +{ + en_result_t enRet = Ok; + + if (NULL == pstcCmd) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcCmd->u32Argument = 0U; + pstcCmd->u16CmdIndex = 0U; + pstcCmd->u16CmdType = SDIOC_CMD_TYPE_NORMAL; + pstcCmd->u16DataLineEn = SDIOC_DATA_LINE_DISABLE; + pstcCmd->u16RespType = SDIOC_RESOPNE_TYPE_NO; + } + + return enRet; +} + +/** + * @brief Get the response received from the card for the last command + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u8RespReg SDIOC response register + * This parameter can be one of the following values: + * @arg SDIOC_RESPONSE_REG_BIT0_31: Command Response Register 0-31bit + * @arg SDIOC_RESPONSE_REG_BIT32_63: Command Response Register 32-63bit + * @arg SDIOC_RESPONSE_REG_BIT64_95: Command Response Register 64-95bit + * @arg SDIOC_RESPONSE_REG_BIT96_127: Command Response Register 96-127bit + * @param [out] pu32RespVal Pointer to a Response value + * @retval An en_result_t enumeration value: + * - Ok: Get response success + * - ErrorInvalidParameter: pu32RespVal == NULL + */ +en_result_t SDIOC_GetResponse(M4_SDIOC_TypeDef *SDIOCx, uint8_t u8RespReg, uint32_t *pu32RespVal) +{ + en_result_t enRet = Ok; + + if (NULL == pu32RespVal) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_SDIOC_RESPONSE_REG(u8RespReg)); + + *pu32RespVal = READ_REG32(*(__IO uint32_t *)SDIOC_RESPx(SDIOCx, u8RespReg)); + } + + return enRet; +} + +/** + * @brief Configure the SDIOCx data parameters. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] pstcData Pointer to a @ref stc_sdioc_data_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Configure SDIOCx data parameters success + * - ErrorInvalidParameter: pstcData == NULL + */ +en_result_t SDIOC_ConfigData(M4_SDIOC_TypeDef *SDIOCx, const stc_sdioc_data_init_t *pstcData) +{ + en_result_t enRet = Ok; + uint16_t u16BlkCnt; + + if (NULL == pstcData) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_SDIOC_BLOCK_SIZE(pstcData->u16BlockSize)); + DDL_ASSERT(IS_SDIOC_TRANSFER_DIR(pstcData->u16TransferDir)); + DDL_ASSERT(IS_SDIOC_AUTO_SEND_CMD12(pstcData->u16AutoCMD12En)); + DDL_ASSERT(IS_SDIOC_TRANSFER_MODE(pstcData->u16TransferMode)); + DDL_ASSERT(IS_SDIOC_DATA_TIMEOUT_TIME(pstcData->u16DataTimeout)); + + if (SDIOC_TRANSFER_MODE_STOP_MULTIPLE == pstcData->u16TransferMode) + { + u16BlkCnt = 0U; + } + else + { + u16BlkCnt = pstcData->u16BlockCount; + } + + /* Set the SDIOC Data Transfer Timeout value */ + WRITE_REG8(SDIOCx->TOUTCON, pstcData->u16DataTimeout); + /* Set the SDIOC Block Count value */ + WRITE_REG16(SDIOCx->BLKSIZE, pstcData->u16BlockSize); + /* Set the SDIOC Block Size value */ + WRITE_REG16(SDIOCx->BLKCNT,u16BlkCnt); + /* Set the SDIOC Data Transfer Mode */ + WRITE_REG16(SDIOCx->TRANSMODE, ((pstcData->u16TransferDir | + pstcData->u16AutoCMD12En | pstcData->u16TransferMode) & 0x00FFU)); + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_sdioc_data_init_t to default values. + * @param [out] pstcData Pointer to a @ref stc_sdioc_data_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Structure Initialize success + * - ErrorInvalidParameter: pstcData == NULL + */ +en_result_t SDIOC_DataStructInit(stc_sdioc_data_init_t *pstcData) +{ + en_result_t enRet = Ok; + + if (NULL == pstcData) + { + enRet = ErrorInvalidParameter; + } + else + { + pstcData->u16BlockSize = 512U; + pstcData->u16BlockCount = 0U; + pstcData->u16TransferDir = SDIOC_TRANSFER_DIR_TO_CARD; + pstcData->u16AutoCMD12En = SDIOC_AUTO_SEND_CMD12_DISABLE; + pstcData->u16TransferMode = SDIOC_TRANSFER_MODE_SINGLE; + pstcData->u16DataTimeout = SDIOC_DATA_TIMEOUT_CLK_2_13; + } + + return enRet; +} + +/** + * @brief Read data from SDIOC FIFO. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [out] au8Data Pointer to the buffer + * @param [in] u32Len Data length + * @retval An en_result_t enumeration value: + * - Ok: Read data success + * - ErrorInvalidParameter: NULL == au8Data or (u32Len % 4U) != 0 + */ +en_result_t SDIOC_ReadBuffer(M4_SDIOC_TypeDef *SDIOCx, uint8_t au8Data[], uint32_t u32Len) +{ + en_result_t enRet = Ok; + uint32_t i; + uint32_t u32Temp; + __IO uint32_t *BUF_REG; + + if ((NULL == au8Data) || (0U != (u32Len % 4U))) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + + BUF_REG = (__IO uint32_t *)SDIOC_BUF(SDIOCx); + for (i = 0U; i < u32Len; i += 4U) + { + u32Temp = READ_REG32(*BUF_REG); + au8Data[i] = (uint8_t)(u32Temp & 0x000000FFUL); + au8Data[i+1U] = (uint8_t)((u32Temp >> 8U) & 0x000000FFUL); + au8Data[i+2U] = (uint8_t)((u32Temp >> 16U) & 0x000000FFUL); + au8Data[i+3U] = (uint8_t)((u32Temp >> 24U) & 0x000000FFUL); + } + } + + return enRet; +} + +/** + * @brief Write data to SDIOC FIFO. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] au8Data Pointer to the buffer + * @param [in] u32Len Data length + * @retval An en_result_t enumeration value: + * - Ok: Write data success + * - ErrorInvalidParameter: NULL == au8Data or (u32Len % 4U) != 0 + */ +en_result_t SDIOC_WriteBuffer(M4_SDIOC_TypeDef *SDIOCx, const uint8_t au8Data[], uint32_t u32Len) +{ + en_result_t enRet = Ok; + uint32_t i; + uint32_t u32Temp; + __IO uint32_t *BUF_REG; + + if ((NULL == au8Data) || (0U != (u32Len % 4U))) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + + BUF_REG = (__IO uint32_t *)SDIOC_BUF(SDIOCx); + for (i = 0U; i < u32Len; i += 4U) + { + u32Temp = (uint32_t)au8Data[i] | ((uint32_t)au8Data[i+1U] << 8U) | + ((uint32_t)au8Data[i+2U] << 16U) | ((uint32_t)au8Data[i+3U] << 24U); + WRITE_REG32(*BUF_REG, u32Temp); + } + } + + return enRet; +} + +/** + * @brief Enable or disable block gap stop. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void SDIOC_BlockGapStopCmd(M4_SDIOC_TypeDef *SDIOCx, en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + if (Disable != enNewSta) + { + SET_REG8_BIT(SDIOCx->BLKGPCON, SDIOC_BLKGPCON_SABGR); + } + else + { + CLEAR_REG8_BIT(SDIOCx->BLKGPCON, SDIOC_BLKGPCON_SABGR); + } +} + +/** + * @brief Restart data transfer. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @retval None + */ +void SDIOC_RestartTransfer(M4_SDIOC_TypeDef *SDIOCx) +{ + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + + SET_REG8_BIT(SDIOCx->BLKGPCON, SDIOC_BLKGPCON_CR); +} + +/** + * @brief Enable or disable read wait. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void SDIOC_ReadWaitCmd(M4_SDIOC_TypeDef *SDIOCx, en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + if (Disable != enNewSta) + { + SET_REG8_BIT(SDIOCx->BLKGPCON, SDIOC_BLKGPCON_RWC); + } + else + { + CLEAR_REG8_BIT(SDIOCx->BLKGPCON, SDIOC_BLKGPCON_RWC); + } +} + +/** + * @brief Enable or disable data block gap interrupt. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void SDIOC_BlockGapInterruptCmd(M4_SDIOC_TypeDef *SDIOCx, en_functional_state_t enNewSta) +{ + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + if (Disable != enNewSta) + { + SET_REG8_BIT(SDIOCx->BLKGPCON, SDIOC_BLKGPCON_IABG); + } + else + { + CLEAR_REG8_BIT(SDIOCx->BLKGPCON, SDIOC_BLKGPCON_IABG); + } +} + +/** + * @brief Enable or disable interrupt. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32IntSrc Normal and error interrupts source + * This parameter can be one or any combination of the following values: + * @arg SDIOC_NORMAL_INT_CINTSEN: Card Interrupt + * @arg SDIOC_NORMAL_INT_CRMSEN: Card Removal Interrupt + * @arg SDIOC_NORMAL_INT_CISTSEN: Card Insertion Interrupt + * @arg SDIOC_NORMAL_INT_BRRSEN: Buffer Read Ready Interrupt + * @arg SDIOC_NORMAL_INT_BWRSEN: Buffer Write Ready Interrupt + * @arg SDIOC_NORMAL_INT_BGESEN: Block Gap Event Interrupt + * @arg SDIOC_NORMAL_INT_TCSEN: Transfer Complete Interrupt + * @arg SDIOC_NORMAL_INT_CCSEN: Command Complete Interrupt + * @arg SDIOC_ERROR_INT_ACESEN: Auto CMD12 Error Interrupt + * @arg SDIOC_ERROR_INT_DEBESEN: Data End Bit Error Interrupt + * @arg SDIOC_ERROR_INT_DCESEN: Data CRC Error Interrupt + * @arg SDIOC_ERROR_INT_DTOESEN: Data Timeout Error Interrupt + * @arg SDIOC_ERROR_INT_CIESEN: Command Index Error Interrupt + * @arg SDIOC_ERROR_INT_CEBESEN: Command End Bit Error Interrupt + * @arg SDIOC_ERROR_INT_CCESEN: Command CRC Error Interrupt + * @arg SDIOC_ERROR_INT_CTOESEN: Command Timeout Error Interrupt + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void SDIOC_IntCmd(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32IntSrc, en_functional_state_t enNewSta) +{ + uint16_t u16NormalInt; + uint16_t u16ErrorInt; + + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_SDIOC_NORMAL_ERROR_INT(u32IntSrc)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + u16NormalInt = (uint16_t)(u32IntSrc & 0xFFFFU); + u16ErrorInt = (uint16_t)((u32IntSrc >> 16U) & 0xFFFFU); + + if (Disable != enNewSta) + { + if (0U != u16NormalInt) + { + SET_REG16_BIT(SDIOCx->NORINTSGEN, u16NormalInt); + } + if (0U != u16ErrorInt) + { + SET_REG16_BIT(SDIOCx->ERRINTSGEN, u16ErrorInt); + } + } + else + { + if (0U != u16NormalInt) + { + CLEAR_REG16_BIT(SDIOCx->NORINTSGEN, u16NormalInt); + } + if (0U != u16ErrorInt) + { + CLEAR_REG16_BIT(SDIOCx->ERRINTSGEN, u16ErrorInt); + } + } +} + +/** + * @brief Get interrupt enable state. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32IntSrc Normal and error interrupts source + * This parameter can be one or any combination of the following values: + * @arg SDIOC_NORMAL_INT_CINTSEN: Card Interrupt + * @arg SDIOC_NORMAL_INT_CRMSEN: Card Removal Interrupt + * @arg SDIOC_NORMAL_INT_CISTSEN: Card Insertion Interrupt + * @arg SDIOC_NORMAL_INT_BRRSEN: Buffer Read Ready Interrupt + * @arg SDIOC_NORMAL_INT_BWRSEN: Buffer Write Ready Interrupt + * @arg SDIOC_NORMAL_INT_BGESEN: Block Gap Event Interrupt + * @arg SDIOC_NORMAL_INT_TCSEN: Transfer Complete Interrupt + * @arg SDIOC_NORMAL_INT_CCSEN: Command Complete Interrupt + * @arg SDIOC_ERROR_INT_ACESEN: Auto CMD12 Error Interrupt + * @arg SDIOC_ERROR_INT_DEBESEN: Data End Bit Error Interrupt + * @arg SDIOC_ERROR_INT_DCESEN: Data CRC Error Interrupt + * @arg SDIOC_ERROR_INT_DTOESEN: Data Timeout Error Interrupt + * @arg SDIOC_ERROR_INT_CIESEN: Command Index Error Interrupt + * @arg SDIOC_ERROR_INT_CEBESEN: Command End Bit Error Interrupt + * @arg SDIOC_ERROR_INT_CCESEN: Command CRC Error Interrupt + * @arg SDIOC_ERROR_INT_CTOESEN: Command Timeout Error Interrupt + * @retval An en_functional_state_t enumeration value: + * - Enable: The interrupt is enable + * - Disable: The interrupt is disable + */ +en_functional_state_t SDIOC_GetIntEnableState(const M4_SDIOC_TypeDef *SDIOCx, uint32_t u32IntSrc) +{ + uint16_t u16NormalInt; + uint16_t u16ErrorInt; + en_functional_state_t enIntSta = Disable; + + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_SDIOC_NORMAL_ERROR_INT(u32IntSrc)); + + u16NormalInt = (uint16_t)(u32IntSrc & 0xFFFFU); + u16ErrorInt = (uint16_t)((u32IntSrc >> 16U) & 0xFFFFU); + + if (0U != u16NormalInt) + { + if (0U != (READ_REG16_BIT(SDIOCx->NORINTSGEN, u16NormalInt))) + { + enIntSta = Enable; + } + } + if (0U != u16ErrorInt) + { + if (0U != (READ_REG16_BIT(SDIOCx->ERRINTSGEN, u16ErrorInt))) + { + enIntSta = Enable; + } + } + + return enIntSta; +} + +/** + * @brief Get interrupt flag status. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32Flag Normal and error interrupts flag + * This parameter can be one or any combination the following values: + * @arg SDIOC_NORMAL_INT_FLAG_EI: Error Interrupt Status + * @arg SDIOC_NORMAL_INT_FLAG_CINT: Card Interrupt status + * @arg SDIOC_NORMAL_INT_FLAG_CRM: Card Removal status + * @arg SDIOC_NORMAL_INT_FLAG_CIST: Card Insertion status + * @arg SDIOC_NORMAL_INT_FLAG_BRR: Buffer Read Ready status + * @arg SDIOC_NORMAL_INT_FLAG_BWR: Buffer Write Ready status + * @arg SDIOC_NORMAL_INT_FLAG_BGE: Block Gap Event status + * @arg SDIOC_NORMAL_INT_FLAG_TC: Transfer Complete status + * @arg SDIOC_NORMAL_INT_FLAG_CC: Command Complete status + * @arg SDIOC_ERROR_INT_FLAG_ACE: Auto CMD12 Error Status + * @arg SDIOC_ERROR_INT_FLAG_DEBE: Data End Bit Error status + * @arg SDIOC_ERROR_INT_FLAG_DCE: Data CRC Error status + * @arg SDIOC_ERROR_INT_FLAG_DTOE: Data Timeout Error status + * @arg SDIOC_ERROR_INT_FLAG_CIE: Command Index Error status + * @arg SDIOC_ERROR_INT_FLAG_CEBE: Command End Bit Error status + * @arg SDIOC_ERROR_INT_FLAG_CCE: Command CRC Error status + * @arg SDIOC_ERROR_INT_FLAG_CTOE: Command Timeout Error status + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t SDIOC_GetIntStatus(const M4_SDIOC_TypeDef *SDIOCx, uint32_t u32Flag) +{ + en_flag_status_t enFlagSta = Reset; + uint16_t u16NormalFlag; + uint16_t u16ErrorFlag; + + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_SDIOC_GET_NORMAL_ERROR_INT_FLAG(u32Flag)); + + u16NormalFlag = (uint16_t)(u32Flag & 0xFFFFU); + u16ErrorFlag = (uint16_t)((u32Flag >> 16U) & 0xFFFFU); + + if (0U != u16NormalFlag) + { + if (0U != (READ_REG16_BIT(SDIOCx->NORINTST, u16NormalFlag))) + { + enFlagSta = Set; + } + } + if (0U != u16ErrorFlag) + { + if (0U != (READ_REG16_BIT(SDIOCx->ERRINTST, u16ErrorFlag))) + { + enFlagSta = Set; + } + } + + return enFlagSta; +} + +/** + * @brief Clear interrupt flag status. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32Flag Normal and error interrupts flag + * This parameter can be one or any combination of the following values: + * @arg SDIOC_NORMAL_INT_FLAG_CRM: Card Removal status + * @arg SDIOC_NORMAL_INT_FLAG_CIST: Card Insertion status + * @arg SDIOC_NORMAL_INT_FLAG_BRR: Buffer Read Ready status + * @arg SDIOC_NORMAL_INT_FLAG_BWR: Buffer Write Ready status + * @arg SDIOC_NORMAL_INT_FLAG_BGE: Block Gap Event status + * @arg SDIOC_NORMAL_INT_FLAG_TC: Transfer Complete status + * @arg SDIOC_NORMAL_INT_FLAG_CC: Command Complete status + * @arg SDIOC_ERROR_INT_FLAG_ACE: Auto CMD12 Error Status + * @arg SDIOC_ERROR_INT_FLAG_DEBE: Data End Bit Error status + * @arg SDIOC_ERROR_INT_FLAG_DCE: Data CRC Error status + * @arg SDIOC_ERROR_INT_FLAG_DTOE: Data Timeout Error status + * @arg SDIOC_ERROR_INT_FLAG_CIE: Command Index Error status + * @arg SDIOC_ERROR_INT_FLAG_CEBE: Command End Bit Error status + * @arg SDIOC_ERROR_INT_FLAG_CCE: Command CRC Error status + * @arg SDIOC_ERROR_INT_FLAG_CTOE: Command Timeout Error status + * @retval None + */ +void SDIOC_ClearIntStatus(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32Flag) +{ + uint16_t u16NormalFlag; + uint16_t u16ErrorFlag; + + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_SDIOC_CLEAR_NORMAL_ERROR_INT_FLAG(u32Flag)); + + u16NormalFlag = (uint16_t)(u32Flag & 0xFFFFU); + u16ErrorFlag = (uint16_t)((u32Flag >> 16U) & 0xFFFFU); + if (0U != u16NormalFlag) + { + WRITE_REG16(SDIOCx->NORINTST, u16NormalFlag); + } + if (0U != u16ErrorFlag) + { + WRITE_REG16(SDIOCx->ERRINTST, u16ErrorFlag); + } +} + +/** + * @brief Enable or disable interrupt status. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32IntSrc Normal and error interrupts source + * This parameter can be one or any combination of the following values: + * @arg SDIOC_NORMAL_INT_CINTSEN: Card Interrupt + * @arg SDIOC_NORMAL_INT_CRMSEN: Card Removal Interrupt + * @arg SDIOC_NORMAL_INT_CISTSEN: Card Insertion Interrupt + * @arg SDIOC_NORMAL_INT_BRRSEN: Buffer Read Ready Interrupt + * @arg SDIOC_NORMAL_INT_BWRSEN: Buffer Write Ready Interrupt + * @arg SDIOC_NORMAL_INT_BGESEN: Block Gap Event Interrupt + * @arg SDIOC_NORMAL_INT_TCSEN: Transfer Complete Interrupt + * @arg SDIOC_NORMAL_INT_CCSEN: Command Complete Interrupt + * @arg SDIOC_ERROR_INT_ACESEN: Auto CMD12 Error Interrupt + * @arg SDIOC_ERROR_INT_DEBESEN: Data End Bit Error Interrupt + * @arg SDIOC_ERROR_INT_DCESEN: Data CRC Error Interrupt + * @arg SDIOC_ERROR_INT_DTOESEN: Data Timeout Error Interrupt + * @arg SDIOC_ERROR_INT_CIESEN: Command Index Error Interrupt + * @arg SDIOC_ERROR_INT_CEBESEN: Command End Bit Error Interrupt + * @arg SDIOC_ERROR_INT_CCESEN: Command CRC Error Interrupt + * @arg SDIOC_ERROR_INT_CTOESEN: Command Timeout Error Interrupt + * @param [in] enNewSta The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void SDIOC_IntStatusCmd(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32IntSrc, en_functional_state_t enNewSta) +{ + uint16_t u16NormalInt; + uint16_t u16ErrorInt; + + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_SDIOC_NORMAL_ERROR_INT(u32IntSrc)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewSta)); + + u16NormalInt = (uint16_t)(u32IntSrc & 0xFFFFU); + u16ErrorInt = (uint16_t)((u32IntSrc >> 16U) & 0xFFFFU); + + if (Disable != enNewSta) + { + if (0U != u16NormalInt) + { + SET_REG16_BIT(SDIOCx->NORINTSTEN, u16NormalInt); + } + if (0U != u16ErrorInt) + { + SET_REG16_BIT(SDIOCx->ERRINTSTEN, u16ErrorInt); + } + } + else + { + if (0U != u16NormalInt) + { + CLEAR_REG16_BIT(SDIOCx->NORINTSTEN, u16NormalInt); + } + if (0U != u16ErrorInt) + { + CLEAR_REG16_BIT(SDIOCx->ERRINTSTEN, u16ErrorInt); + } + } +} + +/** + * @brief Get Host status. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32Flag Host flag + * This parameter can be one or any combination the following values: + * @arg SDIOC_HOST_FLAG_CMDL: CMD Line Level status + * @arg SDIOC_HOST_FLAG_DATL: DAT[3:0] Line Level status + * @arg SDIOC_HOST_FLAG_DATL_D0: DAT[0] Line Level status + * @arg SDIOC_HOST_FLAG_DATL_D1: DAT[1] Line Level status + * @arg SDIOC_HOST_FLAG_DATL_D2: DAT[2] Line Level status + * @arg SDIOC_HOST_FLAG_DATL_D3: DAT[3] Line Level status + * @arg SDIOC_HOST_FLAG_WPL: Write Protect Line Level status + * @arg SDIOC_HOST_FLAG_CDL: Card Detect Line Level status + * @arg SDIOC_HOST_FLAG_CSS: Device Stable Status + * @arg SDIOC_HOST_FLAG_CIN: Device Inserted status + * @arg SDIOC_HOST_FLAG_BRE: Data buffer full status + * @arg SDIOC_HOST_FLAG_BWE: Data buffer empty status + * @arg SDIOC_HOST_FLAG_RTA: Read operation status + * @arg SDIOC_HOST_FLAG_WTA: Write operation status + * @arg SDIOC_HOST_FLAG_DA: DAT Line transfer status + * @arg SDIOC_HOST_FLAG_CID: Command Inhibit with data status + * @arg SDIOC_HOST_FLAG_CIC: Command Inhibit status + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t SDIOC_GetHostStatus(const M4_SDIOC_TypeDef *SDIOCx, uint32_t u32Flag) +{ + en_flag_status_t enFlagSta = Reset; + + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_SDIOC_GET_HOST_FLAG(u32Flag)); + + if (0UL != (READ_REG32_BIT(SDIOCx->PSTAT, u32Flag))) + { + enFlagSta = Set; + } + + return enFlagSta; +} + +/** + * @brief Get auto CMD12 error status. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u16Flag Auto CMD12 error flag + * This parameter can be one or any combination the following values: + * @arg SDIOC_AUTO_CMD_ERROR_FLAG_CMDE: Command Not Issued By Auto CMD12 Error Status + * @arg SDIOC_AUTO_CMD_ERROR_FLAG_IE: Auto CMD12 Index Error status + * @arg SDIOC_AUTO_CMD_ERROR_FLAG_EBE: Auto CMD12 End Bit Error status + * @arg SDIOC_AUTO_CMD_ERROR_FLAG_CE: Auto CMD12 CRC Error status + * @arg SDIOC_AUTO_CMD_ERROR_FLAG_TOE: Auto CMD12 Timeout Error status + * @arg SDIOC_AUTO_CMD_ERROR_FLAG_NE: Auto CMD12 Not Executed status + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t SDIOC_GetAutoCmdErrorStatus(const M4_SDIOC_TypeDef *SDIOCx, uint16_t u16Flag) +{ + en_flag_status_t enFlagSta = Reset; + + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_SDIOC_AUTO_CMD_ERROR_FLAG(u16Flag)); + + if (0U != (READ_REG16_BIT(SDIOCx->ATCERRST, u16Flag))) + { + enFlagSta = Set; + } + + return enFlagSta; +} + +/** + * @brief Force the specified auto CMD12 error event flag. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u16CmdFlag Auto CMD12 error flag + * This parameter can be one or any combination the following values: + * @arg SDIOC_FORCE_AUTO_CMD_ERROR_FCMDE: Force Event for Command Not Issued By Auto CMD12 Error + * @arg SDIOC_FORCE_AUTO_CMD_ERROR_FIE: Force Event for Auto CMD12 Index Error + * @arg SDIOC_FORCE_AUTO_CMD_ERROR_FEBE: Force Event for Auto CMD12 End Bit Error + * @arg SDIOC_FORCE_AUTO_CMD_ERROR_FCE: Force Event for Auto CMD12 CRC Error + * @arg SDIOC_FORCE_AUTO_CMD_ERROR_FTOE: Force Event for Auto CMD12 Timeout Error + * @arg SDIOC_FORCE_AUTO_CMD_ERROR_FNE: Force Event for Auto CMD12 Not Executed + * @retval None + */ +void SDIOC_ForceAutoCmdErrorEvent(M4_SDIOC_TypeDef *SDIOCx, uint16_t u16CmdFlag) +{ + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_SDIOC_FORCE_AUTO_CMD_FLAG(u16CmdFlag)); + + WRITE_REG16(SDIOCx->FEA, u16CmdFlag); +} + +/** + * @brief Force the specified error interrupt event flag. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u16IntFlag Error interrupt flag + * This parameter can be one or any combination the following values: + * @arg SDIOC_FORCE_ERROR_INT_FACE: Force Event for Auto CMD12 Error + * @arg SDIOC_FORCE_ERROR_INT_FDEBE: Force Event for Data End Bit Error + * @arg SDIOC_FORCE_ERROR_INT_FDCE: Force Event for Data CRC Error + * @arg SDIOC_FORCE_ERROR_INT_FDTOE: Force Event for Data Timeout Error + * @arg SDIOC_FORCE_ERROR_INT_FCIE: Force Event for Command Index Error + * @arg SDIOC_FORCE_ERROR_INT_FCEBE: Force Event for Command End Bit Error + * @arg SDIOC_FORCE_ERROR_INT_FCCE: Force Event for Command CRC Error + * @arg SDIOC_FORCE_ERROR_INT_FCTOE: Force Event for Command Timeout Error + * @retval None + */ +void SDIOC_ForceErrorInterruptEvent(M4_SDIOC_TypeDef *SDIOCx, uint16_t u16IntFlag) +{ + /* Check parameters */ + DDL_ASSERT(IS_SDIOC_UNIT(SDIOCx)); + DDL_ASSERT(IS_SDIOC_FORCE_ERROR_INT_FLAG(u16IntFlag)); + + WRITE_REG16(SDIOCx->FEE, u16IntFlag); +} + +/** + * @brief Send the Go Idle State command and check the response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_CMD0_GoIdleState(M4_SDIOC_TypeDef *SDIOCx, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + *pu32ErrSta = SDMMC_ERROR_NONE; + stcCmdInit.u32Argument = 0UL; + stcCmdInit.u16CmdIndex = SDIOC_CMD0_GO_IDLE_STATE; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_DISABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_NO; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdError(SDIOCx); + } + } + + return enRet; +} + +/** + * @brief Send the Send CID command and check the response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_CMD2_AllSendCID(M4_SDIOC_TypeDef *SDIOCx, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = 0UL; + stcCmdInit.u16CmdIndex = SDIOC_CMD2_ALL_SEND_CID; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_DISABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R2; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp2(SDIOCx, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Send the command for asking the card to publish a new relative address(RCA). + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [out] pu16RCA Pointer to the new RCA value + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu16RCA == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_CMD3_SendRelativeAddr(M4_SDIOC_TypeDef *SDIOCx, uint16_t *pu16RCA, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if ((NULL == pu16RCA) || (NULL == pu32ErrSta)) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = 0UL; + stcCmdInit.u16CmdIndex = SDIOC_CMD3_SEND_RELATIVE_ADDR; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_DISABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R1_R5_R6_R7; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp6(SDIOCx, pu16RCA, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Checks switchable function and switch card function. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32Argument Argument used for the command. + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_CMD6_SwitchFunc(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32Argument, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + uint32_t u32SdMode; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = u32Argument; + stcCmdInit.u16CmdIndex = SDIOC_CMD6_SWITCH_FUNC; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + u32SdMode = SDIOC_GetMode(SDIOCx); + if (SDIOC_MODE_SD != u32SdMode) /* MMC mode */ + { + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_DISABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R1B_R5B; + } + else + { + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_ENABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R1_R5_R6_R7; + } + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + if (SDIOC_MODE_SD != u32SdMode) /* MMC mode */ + { + enRet = SDMMC_GetCmdResp1Busy(SDIOCx, SDMMC_CMD_TIMEOUT, pu32ErrSta); + } + else + { + enRet = SDMMC_GetCmdResp1(SDIOCx, SDMMC_CMD_TIMEOUT, pu32ErrSta); + } + } + } + + return enRet; +} + +/** + * @brief Send the Select Deselect command and check the response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32RCA Relative Card Address(RCA) + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_CMD7_SelectDeselectCard(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32RCA, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = u32RCA; + stcCmdInit.u16CmdIndex = SDIOC_CMD7_SELECT_DESELECT_CARD; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_DISABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R1B_R5B; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp1Busy(SDIOCx, SDMMC_CMD_TIMEOUT, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Send the Interface Condition command and check the response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_CMD8_SendInterfaceCond(M4_SDIOC_TypeDef *SDIOCx, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + uint32_t u32SdMode; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Argument: - [31:12]: Reserved (shall be set to '0') + - [11:8]: Supply Voltage (VHS) 0x1 (Range: 2.7-3.6 V) + - [7:0]: Check Pattern (recommended 0xAA) */ + stcCmdInit.u32Argument = SDMMC_CMD8_CHECK_PATTERN; + stcCmdInit.u16CmdIndex = SDIOC_CMD8_SEND_IF_COND; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R1_R5_R6_R7; + u32SdMode = SDIOC_GetMode(SDIOCx); + if (SDIOC_MODE_SD != u32SdMode) /* MMC mode */ + { + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_ENABLE; + } + else + { + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_DISABLE; + } + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + if (SDIOC_MODE_SD != u32SdMode) /* MMC mode */ + { + enRet = SDMMC_GetCmdResp1(SDIOCx, SDMMC_CMD_TIMEOUT, pu32ErrSta); + } + else + { + enRet = SDMMC_GetCmdResp7(SDIOCx, pu32ErrSta); + } + } + } + + return enRet; +} + +/** + * @brief Send the Send CSD command and check the response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32RCA Relative Card Address(RCA) + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_CMD9_SendCSD(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32RCA, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = u32RCA; + stcCmdInit.u16CmdIndex = SDIOC_CMD9_SEND_CSD; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_DISABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R2; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp2(SDIOCx, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Send the Stop Transfer command and check the response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_CMD12_StopTransmission(M4_SDIOC_TypeDef *SDIOCx, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = 0UL; + stcCmdInit.u16CmdIndex = SDIOC_CMD12_STOP_TRANSMISSION; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_DISABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R1B_R5B; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp1Busy(SDIOCx, SDMMC_CMD_TIMEOUT * 1000UL, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Send the Status command and check the response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32RCA Relative Card Address(RCA) + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_CMD13_SendStatus(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32RCA, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = u32RCA; + stcCmdInit.u16CmdIndex = SDIOC_CMD13_SEND_STATUS; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_DISABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R1_R5_R6_R7; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp1(SDIOCx, SDMMC_CMD_TIMEOUT, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Send the Data Block Lenght command and check the response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32BlockLen Block length + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_CMD16_SetBlockLength(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32BlockLen, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = u32BlockLen; + stcCmdInit.u16CmdIndex = SDIOC_CMD16_SET_BLOCKLEN; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_DISABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R1_R5_R6_R7; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp1(SDIOCx, SDMMC_CMD_TIMEOUT, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Send the Read Single Block command and check the response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32ReadAddr Data address + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_CMD17_ReadSingleBlock(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32ReadAddr, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = u32ReadAddr; + stcCmdInit.u16CmdIndex = SDIOC_CMD17_READ_SINGLE_BLOCK; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_ENABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R1_R5_R6_R7; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp1(SDIOCx, SDMMC_CMD_TIMEOUT, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Send the Read Multi Block command and check the response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32ReadAddr Data address + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_CMD18_ReadMultipleBlock(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32ReadAddr, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = u32ReadAddr; + stcCmdInit.u16CmdIndex = SDIOC_CMD18_READ_MULTIPLE_BLOCK; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_ENABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R1_R5_R6_R7; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp1(SDIOCx, SDMMC_CMD_TIMEOUT, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Send the Write Single Block command and check the response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32WriteAddr Data address + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_CMD24_WriteSingleBlock(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32WriteAddr, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = u32WriteAddr; + stcCmdInit.u16CmdIndex = SDIOC_CMD24_WRITE_SINGLE_BLOCK; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_ENABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R1_R5_R6_R7; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp1(SDIOCx, SDMMC_CMD_TIMEOUT, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Send the Write Multi Block command and check the response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32WriteAddr Data address + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_CMD25_WriteMultipleBlock(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32WriteAddr, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = u32WriteAddr; + stcCmdInit.u16CmdIndex = SDIOC_CMD25_WRITE_MULTIPLE_BLOCK; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_ENABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R1_R5_R6_R7; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp1(SDIOCx, SDMMC_CMD_TIMEOUT, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Send the Start Address Erase command for SD and check the response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32StartAddr The start address will be erased + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_CMD32_EraseBlockStartAddr(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32StartAddr, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = u32StartAddr; + stcCmdInit.u16CmdIndex = SDIOC_CMD32_ERASE_WR_BLK_START; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_DISABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R1_R5_R6_R7; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp1(SDIOCx, SDMMC_CMD_TIMEOUT, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Send the End Address Erase command for SD and check the response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32EndAddr The end address will be erased + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_CMD33_EraseBlockEndAddr(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32EndAddr, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = u32EndAddr; + stcCmdInit.u16CmdIndex = SDIOC_CMD33_ERASE_WR_BLK_END; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_DISABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R1_R5_R6_R7; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp1(SDIOCx, SDMMC_CMD_TIMEOUT, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Send the Erase command and check the response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_CMD38_Erase(M4_SDIOC_TypeDef *SDIOCx, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = 0UL; + stcCmdInit.u16CmdIndex = SDIOC_CMD38_ERASE; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_DISABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R1B_R5B; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp1Busy(SDIOCx, SDMMC_MAX_ERASE_TIMEOUT, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Send the Application command to verify that that the next command + * is an application specific command and check the response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32Argument Argument used for the command. + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_CMD55_AppCmd(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32Argument, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = u32Argument; + stcCmdInit.u16CmdIndex = SDIOC_CMD55_APP_CMD; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_DISABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R1_R5_R6_R7; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp1(SDIOCx, SDMMC_CMD_TIMEOUT, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Send the Bus Width command and check the response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32BusWidth The data bus width + * This parameter can be one of the following values: + * @arg SDMMC_SCR_BUS_WIDTH_1BIT: 1 bit bus + * @arg SDMMC_SCR_BUS_WIDTH_4BIT: 4 bits bus + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_ACMD6_SetBusWidth(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32BusWidth, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = u32BusWidth; + stcCmdInit.u16CmdIndex = SDIOC_ACMD6_SET_BUS_WIDTH; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_DISABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R1_R5_R6_R7; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp1(SDIOCx, SDMMC_CMD_TIMEOUT, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Send the Status register command and check the response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_ACMD13_SendStatus(M4_SDIOC_TypeDef *SDIOCx, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = 0UL; + stcCmdInit.u16CmdIndex = SDIOC_ACMD13_SD_STATUS; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_ENABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R1_R5_R6_R7; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp1(SDIOCx, SDMMC_CMD_TIMEOUT, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Send the command asking the accessed card to send its operating condition register(OCR). + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32Argument Argument used for the command. + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_ACMD41_SendOperatCond(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32Argument, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = u32Argument | SDMMC_ACMD41_VOLTAGE_WINDOW; + stcCmdInit.u16CmdIndex = SDIOC_ACMD41_SD_APP_OP_COND; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_DISABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R3_R4; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp3(SDIOCx, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Send the Send SCR command and check the response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_ACMD51_SendSCR(M4_SDIOC_TypeDef *SDIOCx, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = 0UL; + stcCmdInit.u16CmdIndex = SDIOC_ACMD51_SEND_SCR; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_ENABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R1_R5_R6_R7; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp1(SDIOCx, SDMMC_CMD_TIMEOUT, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Sends host capacity support information command. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32Argument Argument used for the command. + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_CMD1_SendOperatCond(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32Argument, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = u32Argument; + stcCmdInit.u16CmdIndex = SDIOC_CMD1_SEND_OP_COND; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_DISABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R3_R4; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp3(SDIOCx, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Send the Start Address Erase command and check the response + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32StartAddr The start address will be erased + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_CMD35_EraseGroupStartAddr(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32StartAddr, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = u32StartAddr; + stcCmdInit.u16CmdIndex = SDIOC_CMD35_ERASE_GRP_START; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_DISABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R1_R5_R6_R7; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp1(SDIOCx, SDMMC_CMD_TIMEOUT, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Send the End Address Erase command and check the response + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32EndAddr The end address will be erased + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorInvalidParameter: SDIOCx == NULL or pu32ErrSta == NULL + * - ErrorTimeout: Wait timeout + */ +en_result_t SDMMC_CMD36_EraseGroupEndAddr(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32EndAddr, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + stc_sdioc_cmd_init_t stcCmdInit; + + if (NULL == pu32ErrSta) + { + enRet = ErrorInvalidParameter; + } + else + { + stcCmdInit.u32Argument = u32EndAddr; + stcCmdInit.u16CmdIndex = SDIOC_CMD36_ERASE_GRP_END; + stcCmdInit.u16CmdType = SDIOC_CMD_TYPE_NORMAL; + stcCmdInit.u16DataLineEn = SDIOC_DATA_LINE_DISABLE; + stcCmdInit.u16RespType = SDIOC_RESOPNE_TYPE_R1_R5_R6_R7; + enRet = SDIOC_SendCommand(SDIOCx, &stcCmdInit); + /* Check for error conditions */ + if (Ok == enRet) + { + enRet = SDMMC_GetCmdResp1(SDIOCx, SDMMC_CMD_TIMEOUT, pu32ErrSta); + } + } + + return enRet; +} + +/** + * @brief Wait for command response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32CheckFlag Check flags + * This parameter can be one or any combination the following values: + * @arg SDIOC_NORMAL_INT_FLAG_CC: Command Complete status + * @arg SDIOC_ERROR_INT_FLAG_CIE: Command Index Error status + * @arg SDIOC_ERROR_INT_FLAG_CEBE: Command End Bit Error status + * @arg SDIOC_ERROR_INT_FLAG_CCE: Command CRC Error status + * @arg SDIOC_ERROR_INT_FLAG_CTOE: Command Timeout Error status + * @param [in] u32Timeout Timeout time(ms) for waiting SDIOC + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: The response is normal received + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorTimeout: Wait timeout + */ +static en_result_t SDMMC_WaitResponse(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32CheckFlag, uint32_t u32Timeout, uint32_t *pu32ErrSta) +{ + __IO uint32_t u32Count; + en_result_t enRet = Ok; + uint32_t u32Temp; + + *pu32ErrSta = 0UL; + /* The u32Timeout is expressed in ms */ + u32Count = u32Timeout * (HCLK_VALUE / 20000UL); + while (Reset == SDIOC_GetIntStatus(SDIOCx, u32CheckFlag)) + { + if (0UL == u32Count) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + + if (Ok == enRet) + { + enRet = Error; + u32Temp = CLEAR_REG32_BIT(u32CheckFlag, SDIOC_NORMAL_INT_FLAG_CC); + if (Reset == SDIOC_GetIntStatus(SDIOCx, u32Temp)) + { + /* No error flag set */ + *pu32ErrSta = SDMMC_ERROR_NONE; + SDIOC_ClearIntStatus(SDIOCx, SDIOC_ERROR_INT_STATIC_FLAGS); + enRet = Ok; + } + else if ((Reset != SDIOC_GetIntStatus(SDIOCx, SDIOC_ERROR_INT_FLAG_CIE)) && + (SDIOC_ERROR_INT_FLAG_CIE == (u32CheckFlag & SDIOC_ERROR_INT_FLAG_CIE))) + { + *pu32ErrSta = SDMMC_ERROR_CMD_INDEX; + SDIOC_ClearIntStatus(SDIOCx, SDIOC_ERROR_INT_FLAG_CIE); + } + else if ((Reset != SDIOC_GetIntStatus(SDIOCx, SDIOC_ERROR_INT_FLAG_CEBE)) && + (SDIOC_ERROR_INT_FLAG_CEBE == (u32CheckFlag & SDIOC_ERROR_INT_FLAG_CEBE))) + { + *pu32ErrSta = SDMMC_ERROR_CMD_STOP_BIT; + SDIOC_ClearIntStatus(SDIOCx, SDIOC_ERROR_INT_FLAG_CEBE); + } + else if ((Reset != SDIOC_GetIntStatus(SDIOCx, SDIOC_ERROR_INT_FLAG_CCE)) && + (SDIOC_ERROR_INT_FLAG_CCE == (u32CheckFlag & SDIOC_ERROR_INT_FLAG_CCE))) + { + *pu32ErrSta = SDMMC_ERROR_CMD_CRC_FAIL; + SDIOC_ClearIntStatus(SDIOCx, SDIOC_ERROR_INT_FLAG_CCE); + } + else + { + *pu32ErrSta = SDMMC_ERROR_CMD_TIMEOUT; + SDIOC_ClearIntStatus(SDIOCx, SDIOC_ERROR_INT_FLAG_CTOE); + } + } + + return enRet; +} + +/** + * @brief Checks for error conditions for no response command. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @retval An en_result_t enumeration value: + * - Ok: Command send completed + * - ErrorTimeout: Wait timeout + */ +static en_result_t SDMMC_GetCmdError(M4_SDIOC_TypeDef *SDIOCx) +{ + __IO uint32_t u32Count; + en_result_t enRet = Ok; + + /* The SDMMC_CMD_TIMEOUT is expressed in ms */ + u32Count = SDMMC_CMD_TIMEOUT * (HCLK_VALUE / 20000UL); + while (Reset == SDIOC_GetIntStatus(SDIOCx, SDIOC_NORMAL_INT_FLAG_CC)) + { + if (0UL == u32Count) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + + if (Ok == enRet) + { + SDIOC_ClearIntStatus(SDIOCx, SDIOC_ERROR_INT_STATIC_FLAGS); + } + + return enRet; +} + +/** + * @brief Checks for error conditions for R1 response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32Timeout Timeout time(ms) for waiting SDIOC + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: The response is normal received + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorTimeout: Wait timeout + */ +static en_result_t SDMMC_GetCmdResp1(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32Timeout, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + uint32_t u32RespVal; + + enRet = SDMMC_WaitResponse(SDIOCx, + (SDIOC_NORMAL_INT_FLAG_CC | SDIOC_ERROR_INT_FLAG_CIE | SDIOC_ERROR_INT_FLAG_CEBE | + SDIOC_ERROR_INT_FLAG_CCE | SDIOC_ERROR_INT_FLAG_CTOE), u32Timeout, pu32ErrSta); + + if (Ok == enRet) + { + /* Fetch has received a response. */ + (void)SDIOC_GetResponse(SDIOCx, SDIOC_RESPONSE_REG_BIT0_31, &u32RespVal); + if (0UL != (u32RespVal & SDMMC_CARD_ERROR_BITS_MASK)) + { + *pu32ErrSta = u32RespVal & SDMMC_CARD_ERROR_BITS_MASK; + enRet = Error; + } + } + + return enRet; +} + +/** + * @brief Checks for error conditions for R1 response with busy. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [in] u32Timeout Timeout time(ms) for waiting SDIOC + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: The response is normal received + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorTimeout: Wait timeout + */ +static en_result_t SDMMC_GetCmdResp1Busy(M4_SDIOC_TypeDef *SDIOCx, uint32_t u32Timeout, uint32_t *pu32ErrSta) +{ + __IO uint32_t u32Count; + en_result_t enRet; + uint32_t u32RespVal; + + enRet = SDMMC_WaitResponse(SDIOCx, + (SDIOC_NORMAL_INT_FLAG_CC | SDIOC_ERROR_INT_FLAG_CIE | SDIOC_ERROR_INT_FLAG_CEBE | + SDIOC_ERROR_INT_FLAG_CCE | SDIOC_ERROR_INT_FLAG_CTOE), u32Timeout, pu32ErrSta); + + if (Ok == enRet) + { + /* Fetch has received a response. */ + (void)SDIOC_GetResponse(SDIOCx, SDIOC_RESPONSE_REG_BIT0_31, &u32RespVal); + if (0UL != (u32RespVal & SDMMC_CARD_ERROR_BITS_MASK)) + { + *pu32ErrSta = u32RespVal & SDMMC_CARD_ERROR_BITS_MASK; + enRet = Error; + } + else + { + /* Wait for busy status to release */ + u32Count = u32Timeout * (HCLK_VALUE / 20000UL); + while (Reset == SDIOC_GetHostStatus(SDIOCx, SDIOC_HOST_FLAG_DATL_D0)) + { + if (0UL == u32Count) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + } + } + + return enRet; +} + +/** + * @brief Checks for error conditions for R2(CID or CSD) response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: The response is normal received + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorTimeout: Wait timeout + */ +static en_result_t SDMMC_GetCmdResp2(M4_SDIOC_TypeDef *SDIOCx, uint32_t *pu32ErrSta) +{ + return SDMMC_WaitResponse(SDIOCx, + (SDIOC_NORMAL_INT_FLAG_CC | SDIOC_ERROR_INT_FLAG_CEBE | SDIOC_ERROR_INT_FLAG_CCE | + SDIOC_ERROR_INT_FLAG_CTOE), SDMMC_CMD_TIMEOUT, pu32ErrSta); +} + +/** + * @brief Checks for error conditions for R3(OCR) response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: The response is normal received + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorTimeout: Wait timeout + */ +static en_result_t SDMMC_GetCmdResp3(M4_SDIOC_TypeDef *SDIOCx, uint32_t *pu32ErrSta) +{ + return SDMMC_WaitResponse(SDIOCx, + (SDIOC_NORMAL_INT_FLAG_CC | SDIOC_ERROR_INT_FLAG_CEBE | SDIOC_ERROR_INT_FLAG_CTOE), + SDMMC_CMD_TIMEOUT, pu32ErrSta); +} + +/** + * @brief Checks for error conditions for R6(RCA) response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [out] pu16RCA Pointer to a value of device RCA + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: The response is normal received + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorTimeout: Wait timeout + */ +static en_result_t SDMMC_GetCmdResp6(M4_SDIOC_TypeDef *SDIOCx, uint16_t *pu16RCA, uint32_t *pu32ErrSta) +{ + en_result_t enRet; + uint32_t u32RespVal; + + enRet = SDMMC_WaitResponse(SDIOCx, + (SDIOC_NORMAL_INT_FLAG_CC | SDIOC_ERROR_INT_FLAG_CIE | SDIOC_ERROR_INT_FLAG_CEBE | + SDIOC_ERROR_INT_FLAG_CCE | SDIOC_ERROR_INT_FLAG_CTOE), SDMMC_CMD_TIMEOUT, pu32ErrSta); + + if (Ok == enRet) + { + enRet = Error; + /* Fetch has received a response. */ + (void)SDIOC_GetResponse(SDIOCx, SDIOC_RESPONSE_REG_BIT0_31, &u32RespVal); + if (0UL == (u32RespVal & (SDMMC_R6_GENERAL_UNKNOWN_ERROR | SDMMC_R6_ILLEGAL_CMD | SDMMC_R6_COM_CRC_FAILED))) + { + enRet = Ok; + *pu16RCA = (uint16_t)((u32RespVal >> 16U) & 0xFFFFUL); + } + else if (SDMMC_R6_GENERAL_UNKNOWN_ERROR == (u32RespVal & SDMMC_R6_GENERAL_UNKNOWN_ERROR)) + { + *pu32ErrSta = SDMMC_ERROR_GENERAL_UNKNOWN_ERR; + } + else if (SDMMC_R6_ILLEGAL_CMD == (u32RespVal & SDMMC_R6_ILLEGAL_CMD)) + { + *pu32ErrSta = SDMMC_ERROR_ILLEGAL_CMD; + } + else + { + *pu32ErrSta = SDMMC_ERROR_COM_CRC_FAILED; + } + } + + return enRet; +} + +/** + * @brief Checks for error conditions for R7 response. + * @param [in] SDIOCx Pointer to SDIOC instance register base + * This parameter can be one of the following values: + * @arg M4_SDIOC1: SDIOC unit 1 instance register base + * @arg M4_SDIOC2: SDIOC unit 2 instance register base + * @param [out] pu32ErrSta Pointer to the error state value + * @retval An en_result_t enumeration value: + * - Ok: The response is normal received + * - Error: Refer to pu32ErrSta for the reason of error + * - ErrorTimeout: Wait timeout + */ +static en_result_t SDMMC_GetCmdResp7(M4_SDIOC_TypeDef *SDIOCx, uint32_t *pu32ErrSta) +{ + return SDMMC_WaitResponse(SDIOCx, + (SDIOC_NORMAL_INT_FLAG_CC | SDIOC_ERROR_INT_FLAG_CIE | SDIOC_ERROR_INT_FLAG_CEBE | + SDIOC_ERROR_INT_FLAG_CCE | SDIOC_ERROR_INT_FLAG_CTOE), SDMMC_CMD_TIMEOUT, pu32ErrSta); +} + +/** + * @} + */ + +#endif /* DDL_SDIOC_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_smc.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_smc.c new file mode 100644 index 0000000000..89cf8e7c42 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_smc.c @@ -0,0 +1,557 @@ +/** + ******************************************************************************* + * @file hc32f4a0_smc.c + * @brief This file provides firmware functions to manage the EXMC SMC + * (External Memory Controller: Static Memory Controller). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Hongjh First version + 2020-07-14 Hongjh Merge API from EXMC_SMC_Enable/Disable to EXMC_SMC_Cmd + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_smc.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_EXMC_SMC EXMC_SMC + * @brief Static Memory Controller Driver Library + * @{ + */ + +#if (DDL_SMC_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup EXMC_SMC_Local_Macros Static Memory Controller Local Macros + * @{ + */ + +/** + * @defgroup EXMC_SMC_Check_Parameters_Validity EXMC SMC Check Parameters Validity + * @{ + */ + +#define IS_EXMC_SMC_MEM_WIDTH(x) \ +( (EXMC_SMC_MEMORY_WIDTH_16BIT == (x)) || \ + (EXMC_SMC_MEMORY_WIDTH_32BIT == (x))) + +#define IS_EXMC_SMC_MEM_READ_MODE(x) \ +( (EXMC_SMC_MEM_READ_SYNC == (x)) || \ + (EXMC_SMC_MEM_READ_ASYNC == (x))) + +#define IS_EXMC_SMC_MEM_WRITE_MODE(x) \ +( (EXMC_SMC_MEM_WRITE_SYNC == (x)) || \ + (EXMC_SMC_MEM_WRITE_ASYNC == (x))) + +#define IS_EXMC_SMC_CHIP(x) \ +( (EXMC_SMC_CHIP_0 == (x)) || \ + (EXMC_SMC_CHIP_1 == (x)) || \ + (EXMC_SMC_CHIP_2 == (x)) || \ + (EXMC_SMC_CHIP_3 == (x))) + +#define IS_EXMC_SMC_MEM_READ_BURST(x) \ +( (EXMC_SMC_MEM_READ_BURST_1 == (x)) || \ + (EXMC_SMC_MEM_READ_BURST_4 == (x)) || \ + (EXMC_SMC_MEM_READ_BURST_8 == (x)) || \ + (EXMC_SMC_MEM_READ_BURST_16 == (x)) || \ + (EXMC_SMC_MEM_READ_BURST_32 == (x)) || \ + (EXMC_SMC_MEM_READ_BURST_CONTINUOUS == (x))) + +#define IS_EXMC_SMC_MEM_WRITE_BURST(x) \ +( (EXMC_SMC_MEM_WRITE_BURST_1 == (x)) || \ + (EXMC_SMC_MEM_WRITE_BURST_4 == (x)) || \ + (EXMC_SMC_MEM_WRITE_BURST_8 == (x)) || \ + (EXMC_SMC_MEM_WRITE_BURST_16 == (x)) || \ + (EXMC_SMC_MEM_WRITE_BURST_32 == (x)) || \ + (EXMC_SMC_MEM_WRITE_BURST_CONTINUOUS == (x))) + +#define IS_EXMC_SMC_BLS_SYNC(x) \ +( (EXMC_SMC_BLS_SYNC_CS == (x)) || \ + (EXMC_SMC_BLS_SYNC_WE == (x))) + +#define IS_EXMC_SMC_BAA_PORT(x) \ +( (EXMC_SMC_BAA_PORT_DISABLE == (x)) || \ + (EXMC_SMC_BAA_PORT_ENABLE == (x))) + +#define IS_EXMC_SMC_ADV_PORT(x) \ +( (EXMC_SMC_ADV_PORT_DISABLE == (x)) || \ + (EXMC_SMC_ADV_PORT_ENABLE == (x))) + +#define IS_EXMC_SMC_CMD(x) \ +( (EXMC_SMC_CMD_MDREGCONFIG == (x)) || \ + (EXMC_SMC_CMD_UPDATEREGS == (x)) || \ + (EXMC_SMC_CMD_MDREGCONFIG_AND_UPDATEREGS == (x))) + +#define IS_EXMC_SMC_CRE_POLARITY(x) \ +( (EXMC_SMC_CRE_POLARITY_LOW == (x)) || \ + (EXMC_SMC_CRE_POLARITY_HIGH == (x))) + +#define IS_EXMC_SMC_ADDRESS(match, mask) ((~(((mask) ^ (match)) << 24UL)) <= 0x7FFFFFFFUL) + +#define IS_EXMC_SMC_CS_ADDRESS_MASK(x) (((x) >= 0xE0UL) && ((x) <= 0XFFUL)) + +#define IS_EXMC_SMC_CS_ADDRESS_MATCH(x) (((x) >= 0x60UL) && ((x) <= 0x7FUL)) + +#define IS_EXMC_SMC_REFRESH_PERIOD(x) ((x) <= SMC_RFTR_REFPRD) + +#define IS_EXMC_SMC_CMDADD(x) ((x) <= 0xFFFFFUL) + +#define IS_EXMC_SMC_TIMING_RC_CYCLE(x) ((x) <= 0x0FUL) + +#define IS_EXMC_SMC_TIMING_WC_CYCLE(x) ((x) <= 0x0FUL) + +#define IS_EXMC_SMC_TIMING_CEOE_CYCLE(x) ((x) <= 7UL) + +#define IS_EXMC_SMC_TIMING_WP_CYCLE(x) ((x) <= 7UL) + +#define IS_EXMC_SMC_TIMING_PC_CYCLE(x) ((x) <= 7UL) + +#define IS_EXMC_SMC_TIMING_TR_CYCLE(x) ((x) <= 7UL) + +/** + * @} + */ + +/** + * @defgroup EXMC_SMC_Register EXMC sMC Register + * @{ + */ +#define EXMC_SMC_CPSRx(__CHIPx__) ((__IO uint32_t *)(((uint32_t)(&M4_SMC->CPSR0)) + (0x20UL * (__CHIPx__)))) +#define EXMC_SMC_TMSRx(__CHIPx__) ((__IO uint32_t *)(((uint32_t)(&M4_SMC->TMSR0)) + (0x20UL * (__CHIPx__)))) +/** + * @} + */ + +/** + * @defgroup EXMC_SMC_Register_Bit_Mask EXMC SMC Register Bit Mask + * @{ + */ +#define SMC_CSCR0_ADDMSKx_POS(__CHIPx__) ((__CHIPx__) << 3UL) +#define SMC_CSCR0_ADDMSKx(__CHIPx__) (SMC_CSCR0_ADDMSK0 << SMC_CSCR0_ADDMSKx_POS((__CHIPx__))) + +#define SMC_CSCR1_ADDMATx_POS(__CHIPx__) ((__CHIPx__) << 3UL) +#define SMC_CSCR1_ADDMATx(__CHIPx__) (SMC_CSCR1_ADDMAT0 << SMC_CSCR1_ADDMATx_POS((__CHIPx__))) +/** + * @} + */ + +/** + * @defgroup EXMC_SMC_MUX_Selection EXMC SMC MUX Selection + * @{ + */ +#define EXMC_SMC_MUX_DISABLE (0x00000300UL) +#define EXMC_SMC_MUX_ENABLE (0x00000300UL | SMC_BACR_MUXMD) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup EXMC_SMC_Global_Functions Static Memory Controller Global Functions + * @{ + */ + +/** + * @brief Initialize EXMC SMC function. + * @param [in] u32Chip The chip number. + * This parameter can be one of the following values: + * @arg EXMC_SMC_CHIP_0: Chip 0 + * @arg EXMC_SMC_CHIP_1: Chip 1 + * @arg EXMC_SMC_CHIP_2: Chip 2 + * @arg EXMC_SMC_CHIP_3: Chip 3 + * @param [in] pstcInit Pointer to a @ref stc_exmc_smc_init_t structure (EXMC SMC function configuration structure). + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: pstcInit = NULL + */ +en_result_t EXMC_SMC_Init(uint32_t u32Chip, const stc_exmc_smc_init_t *pstcInit) +{ + uint32_t u32RegVal; + en_result_t enRet = ErrorInvalidParameter; + + /* Check the pointer pstcInit */ + if (NULL != pstcInit) + { + /* Check parameters */ + DDL_ASSERT(IS_EXMC_SMC_CHIP(u32Chip)); + + DDL_ASSERT(IS_EXMC_SMC_MEM_READ_MODE(pstcInit->stcChipCfg.u32ReadMode)); + DDL_ASSERT(IS_EXMC_SMC_MEM_WRITE_MODE(pstcInit->stcChipCfg.u32WriteMode)); + DDL_ASSERT(IS_EXMC_SMC_MEM_READ_BURST(pstcInit->stcChipCfg.u32ReadBurstLen)); + DDL_ASSERT(IS_EXMC_SMC_MEM_WRITE_BURST(pstcInit->stcChipCfg.u32WriteBurstLen)); + DDL_ASSERT(IS_EXMC_SMC_MEM_WIDTH(pstcInit->stcChipCfg.u32SmcMemWidth)); + DDL_ASSERT(IS_EXMC_SMC_BAA_PORT(pstcInit->stcChipCfg.u32BAA)); + DDL_ASSERT(IS_EXMC_SMC_ADV_PORT(pstcInit->stcChipCfg.u32ADV)); + DDL_ASSERT(IS_EXMC_SMC_BLS_SYNC(pstcInit->stcChipCfg.u32BLS)); + DDL_ASSERT(IS_EXMC_SMC_CS_ADDRESS_MATCH(pstcInit->stcChipCfg.u32AddressMatch)); + DDL_ASSERT(IS_EXMC_SMC_CS_ADDRESS_MASK(pstcInit->stcChipCfg.u32AddressMask)); + DDL_ASSERT(IS_EXMC_SMC_ADDRESS(pstcInit->stcChipCfg.u32AddressMatch, pstcInit->stcChipCfg.u32AddressMask)); + + DDL_ASSERT(IS_EXMC_SMC_TIMING_RC_CYCLE(pstcInit->stcTimingCfg.u32RC)); + DDL_ASSERT(IS_EXMC_SMC_TIMING_WC_CYCLE(pstcInit->stcTimingCfg.u32WC)); + DDL_ASSERT(IS_EXMC_SMC_TIMING_CEOE_CYCLE(pstcInit->stcTimingCfg.u32CEOE)); + DDL_ASSERT(IS_EXMC_SMC_TIMING_WP_CYCLE(pstcInit->stcTimingCfg.u32WP)); + DDL_ASSERT(IS_EXMC_SMC_TIMING_RC_CYCLE(pstcInit->stcTimingCfg.u32RC)); + DDL_ASSERT(IS_EXMC_SMC_TIMING_TR_CYCLE(pstcInit->stcTimingCfg.u32TR)); + + /* Set SMC timing.*/ + u32RegVal = ((pstcInit->stcTimingCfg.u32RC << SMC_TMCR_T_RC_POS) | \ + (pstcInit->stcTimingCfg.u32WC << SMC_TMCR_T_WC_POS) | \ + (pstcInit->stcTimingCfg.u32CEOE << SMC_TMCR_T_CEOE_POS) | \ + (pstcInit->stcTimingCfg.u32WP << SMC_TMCR_T_WP_POS) | \ + (pstcInit->stcTimingCfg.u32PC << SMC_TMCR_T_PC_POS) | \ + (pstcInit->stcTimingCfg.u32TR << SMC_TMCR_T_TR_POS) | \ + 0xFF000000UL); + WRITE_REG32(M4_SMC->TMCR, u32RegVal); + + /* Set SMC chip configuration.*/ + u32RegVal = (pstcInit->stcChipCfg.u32ReadMode | \ + pstcInit->stcChipCfg.u32ReadBurstLen | \ + pstcInit->stcChipCfg.u32WriteMode | \ + pstcInit->stcChipCfg.u32WriteBurstLen | \ + pstcInit->stcChipCfg.u32SmcMemWidth | \ + pstcInit->stcChipCfg.u32BAA | \ + pstcInit->stcChipCfg.u32ADV | \ + pstcInit->stcChipCfg.u32BLS | \ + 0xFFFF0000UL); + WRITE_REG32(M4_SMC->CPCR, u32RegVal); + + /* Set chip selection address match/mask spacefor SMC.*/ + MODIFY_REG32(M4_SMC->CSCR0, \ + SMC_CSCR0_ADDMSKx(u32Chip), \ + (pstcInit->stcChipCfg.u32AddressMask << SMC_CSCR0_ADDMSKx_POS(u32Chip))); + MODIFY_REG32(M4_SMC->CSCR1, \ + SMC_CSCR0_ADDMSKx(u32Chip), \ + (pstcInit->stcChipCfg.u32AddressMatch << SMC_CSCR1_ADDMATx_POS(u32Chip))); + enRet = Ok; + } + + return enRet; +} + +/** + * @brief De-Initialize EXMC SMC function. + * @param None + * @retval None + */ +void EXMC_SMC_DeInit(void) +{ + /* Disable SMC */ + WRITE_REG32(bM4_PERIC->EXMC_ENAR_b.SMCEN, 0UL); + + /* Set SMC timing.*/ + WRITE_REG32(M4_SMC->TMCR, 0UL); + + /* Set SMC chip configuration.*/ + WRITE_REG32(M4_SMC->CPCR, 0UL); +} + +/** + * @brief Set the fields of structure @ref stc_exmc_smc_init_t to default values + * @param [out] pstcInit Pointer to a @ref stc_exmc_smc_init_t structure (EXMC SMC function configuration structure) + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: pstcInit = NULL + */ +en_result_t EXMC_SMC_StructInit(stc_exmc_smc_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (NULL != pstcInit) + { + pstcInit->stcChipCfg.u32ReadMode = EXMC_SMC_MEM_READ_ASYNC; + pstcInit->stcChipCfg.u32ReadBurstLen = EXMC_SMC_MEM_READ_BURST_1; + pstcInit->stcChipCfg.u32WriteMode = EXMC_SMC_MEM_WRITE_ASYNC; + pstcInit->stcChipCfg.u32WriteBurstLen = EXMC_SMC_MEM_WRITE_BURST_1; + pstcInit->stcChipCfg.u32SmcMemWidth = EXMC_SMC_MEMORY_WIDTH_16BIT; + pstcInit->stcChipCfg.u32BAA = EXMC_SMC_BAA_PORT_DISABLE; + pstcInit->stcChipCfg.u32ADV = EXMC_SMC_ADV_PORT_DISABLE; + pstcInit->stcChipCfg.u32BLS = EXMC_SMC_BLS_SYNC_CS; + pstcInit->stcChipCfg.u32AddressMask = 0xF8UL; /* Address space 128M: 0x60000000 ~ 0X67FFFFFF */ + pstcInit->stcChipCfg.u32AddressMatch = 0X60UL; + + pstcInit->stcTimingCfg.u32RC = 7UL; + pstcInit->stcTimingCfg.u32WC = 7UL; + pstcInit->stcTimingCfg.u32CEOE = 1UL; + pstcInit->stcTimingCfg.u32WP = 5UL; + pstcInit->stcTimingCfg.u32PC = 0UL; + pstcInit->stcTimingCfg.u32TR = 0UL; + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Enable/Disable SMC. + * @param [in] enNewState An en_functional_state_t enumeration value. + * This parameter can be one of the following values: + * @arg Enable: Enable function. + * @arg Disable: Disable function. + * @retval None + */ +void EXMC_SMC_Cmd(en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + WRITE_REG32(bM4_PERIC->EXMC_ENAR_b.SMCEN, enNewState); +} + +/** + * @brief Set EXMC SMC command. + * @param [in] u32Chip The chip number. + * This parameter can be one of the following values: + * @arg EXMC_SMC_CHIP_0: Chip 0 + * @arg EXMC_SMC_CHIP_1: Chip 1 + * @arg EXMC_SMC_CHIP_2: Chip 2 + * @arg EXMC_SMC_CHIP_3: Chip 3 + * @param [in] u32Cmd The command. + * This parameter can be one of the following values: + * @arg EXMC_SMC_CMD_MDREGCONFIG: Configure mode register + * @arg EXMC_SMC_CMD_UPDATEREGS: Update mode register + * @arg EXMC_SMC_CMD_MDREGCONFIG_AND_UPDATEREGS: Configure mode register and update + * @param [in] u32CrePolarity The command. + * This parameter can be one of the following values: + * @arg EXMC_SMC_CRE_POLARITY_LOW: CRE is LOW + * @arg EXMC_SMC_CRE_POLARITY_HIGH: CRE is HIGH when ModeReg write occurs + * @param [in] u32Address The address parameter is valid when CMD type is + * MdRegConfig or MdRegConfig and UpdateRegs only. + * @retval None + */ +void EXMC_SMC_SetCommand(uint32_t u32Chip, + uint32_t u32Cmd, + uint32_t u32CrePolarity, + uint32_t u32Address) +{ + uint32_t u32SmcCmdr; + + /* Check parameters */ + DDL_ASSERT(IS_EXMC_SMC_CHIP(u32Chip)); + DDL_ASSERT(IS_EXMC_SMC_CMD(u32Cmd)); + DDL_ASSERT(IS_EXMC_SMC_CRE_POLARITY(u32CrePolarity)); + DDL_ASSERT(IS_EXMC_SMC_CMDADD(u32Address)); + + /* Set SMC_CMDR register for SMC.*/ + u32SmcCmdr = (u32Address | u32CrePolarity | u32Cmd | (u32Chip << SMC_CMDR_CMDCHIP_POS)); + WRITE_REG32(M4_SMC->CMDR, u32SmcCmdr); +} + +/** + * @brief Get the start address of the specified SMC chip. + * @param [in] u32Chip The chip number. + * This parameter can be one of the following values: + * @arg EXMC_SMC_CHIP_0: Chip 0 + * @arg EXMC_SMC_CHIP_1: Chip 1 + * @arg EXMC_SMC_CHIP_2: Chip 2 + * @arg EXMC_SMC_CHIP_3: Chip 3 + * @retval The start address of the specified SMC chip. + */ +uint32_t EXMC_SMC_ChipStartAddress(uint32_t u32Chip) +{ + uint32_t u32StartAddress; + + /* Check parameters */ + DDL_ASSERT(IS_EXMC_SMC_CHIP(u32Chip)); + + u32StartAddress = (READ_REG32_BIT(M4_SMC->CSCR1, SMC_CSCR1_ADDMATx(u32Chip)) << (24UL - SMC_CSCR1_ADDMATx_POS(u32Chip))); + return u32StartAddress; +} + +/** + * @brief Get the end address of the specified SMC chip. + * @param [in] u32Chip The chip number. + * This parameter can be one of the following values: + * @arg EXMC_SMC_CHIP_0: Chip 0 + * @arg EXMC_SMC_CHIP_1: Chip 1 + * @arg EXMC_SMC_CHIP_2: Chip 2 + * @arg EXMC_SMC_CHIP_3: Chip 3 + * @retval The end address of the specified SMC chip + */ +uint32_t EXMC_SMC_ChipEndAddress(uint32_t u32Chip) +{ + uint32_t u32Mask; + uint32_t u32Match; + + /* Check parameters */ + DDL_ASSERT(IS_EXMC_SMC_CHIP(u32Chip)); + + u32Mask = (READ_REG32_BIT(M4_SMC->CSCR0, SMC_CSCR0_ADDMSKx(u32Chip)) >> SMC_CSCR0_ADDMSKx_POS(u32Chip)); + u32Match = (READ_REG32_BIT(M4_SMC->CSCR1, SMC_CSCR1_ADDMATx(u32Chip)) >> SMC_CSCR1_ADDMATx_POS(u32Chip)); + + return (~((u32Match ^ u32Mask) << 24UL)); +} + +/** + * @brief Check SMC chip status register value + * @param [in] u32Chip The chip number. + * This parameter can be one of the following values: + * @arg EXMC_SMC_CHIP_0: Chip 0 + * @arg EXMC_SMC_CHIP_1: Chip 1 + * @arg EXMC_SMC_CHIP_2: Chip 2 + * @arg EXMC_SMC_CHIP_3: Chip 3 + * @param [in] pstcChipCfg Pointer to a @ref stc_exmc_smc_chip_cfg_t structure + * @retval An en_result_t enumeration value: + * - Ok: Status is right + * - Error: Status is error + */ +en_result_t EXMC_SMC_CheckChipStatus(uint32_t u32Chip, + const stc_exmc_smc_chip_cfg_t *pstcChipCfg) +{ + uint32_t u32ChipCfg; + __IO uint32_t *SMC_CPSRx; + + /* Check parameters */ + DDL_ASSERT(IS_EXMC_SMC_CHIP(u32Chip)); + DDL_ASSERT(IS_EXMC_SMC_MEM_READ_MODE(pstcChipCfg->u32ReadMode)); + DDL_ASSERT(IS_EXMC_SMC_MEM_WRITE_MODE(pstcChipCfg->u32WriteMode)); + DDL_ASSERT(IS_EXMC_SMC_MEM_READ_BURST(pstcChipCfg->u32ReadBurstLen)); + DDL_ASSERT(IS_EXMC_SMC_MEM_WRITE_BURST(pstcChipCfg->u32WriteBurstLen)); + DDL_ASSERT(IS_EXMC_SMC_MEM_WIDTH(pstcChipCfg->u32SmcMemWidth)); + DDL_ASSERT(IS_EXMC_SMC_BAA_PORT(pstcChipCfg->u32BAA)); + DDL_ASSERT(IS_EXMC_SMC_ADV_PORT(pstcChipCfg->u32ADV)); + DDL_ASSERT(IS_EXMC_SMC_BLS_SYNC(pstcChipCfg->u32BLS)); + DDL_ASSERT(IS_EXMC_SMC_CS_ADDRESS_MATCH(pstcChipCfg->u32AddressMatch)); + DDL_ASSERT(IS_EXMC_SMC_CS_ADDRESS_MASK(pstcChipCfg->u32AddressMask)); + + u32ChipCfg = (pstcChipCfg->u32ReadMode | \ + pstcChipCfg->u32WriteMode | \ + pstcChipCfg->u32ReadBurstLen | \ + pstcChipCfg->u32WriteBurstLen | \ + pstcChipCfg->u32SmcMemWidth | \ + pstcChipCfg->u32BAA | \ + pstcChipCfg->u32ADV | \ + pstcChipCfg->u32BLS | \ + (pstcChipCfg->u32AddressMask << SMC_CPSR_ADDMSK_POS) | \ + (pstcChipCfg->u32AddressMatch << SMC_CPSR_ADDMAT_POS)); + SMC_CPSRx = EXMC_SMC_CPSRx(u32Chip); + return (u32ChipCfg == READ_REG32(*SMC_CPSRx)) ? Ok : Error; +} + +/** + * @brief Check SMC timing status register value + * @param [in] u32Chip The chip number. + * This parameter can be one of the following values: + * @arg EXMC_SMC_CHIP_0: Chip 0 + * @arg EXMC_SMC_CHIP_1: Chip 1 + * @arg EXMC_SMC_CHIP_2: Chip 2 + * @arg EXMC_SMC_CHIP_3: Chip 3 + * @param [in] pstcTimingCfg Pointer to a @ref stc_exmc_smc_timing_cfg_t structure + * @retval An en_result_t enumeration value: + * - Ok: Status is right + * - Error: Status is error + */ +en_result_t EXMC_SMC_CheckTimingStatus(uint32_t u32Chip, + const stc_exmc_smc_timing_cfg_t *pstcTimingCfg) +{ + uint32_t u32TimingCfg; + __IO uint32_t *SMC_TMSRx; + + /* Check parameters */ + DDL_ASSERT(IS_EXMC_SMC_CHIP(u32Chip)); + DDL_ASSERT(IS_EXMC_SMC_TIMING_RC_CYCLE(pstcTimingCfg->u32RC)); + DDL_ASSERT(IS_EXMC_SMC_TIMING_WC_CYCLE(pstcTimingCfg->u32WC)); + DDL_ASSERT(IS_EXMC_SMC_TIMING_CEOE_CYCLE(pstcTimingCfg->u32CEOE)); + DDL_ASSERT(IS_EXMC_SMC_TIMING_WP_CYCLE(pstcTimingCfg->u32WP)); + DDL_ASSERT(IS_EXMC_SMC_TIMING_RC_CYCLE(pstcTimingCfg->u32RC)); + DDL_ASSERT(IS_EXMC_SMC_TIMING_TR_CYCLE(pstcTimingCfg->u32TR)); + + u32TimingCfg = ((pstcTimingCfg->u32RC << SMC_TMCR_T_RC_POS) | \ + (pstcTimingCfg->u32WC << SMC_TMCR_T_WC_POS) | \ + (pstcTimingCfg->u32CEOE << SMC_TMCR_T_CEOE_POS) | \ + (pstcTimingCfg->u32WP << SMC_TMCR_T_WP_POS) | \ + (pstcTimingCfg->u32PC << SMC_TMCR_T_PC_POS) | \ + (pstcTimingCfg->u32TR << SMC_TMCR_T_TR_POS)); + SMC_TMSRx = EXMC_SMC_TMSRx(u32Chip); + return (u32TimingCfg == READ_REG32(*SMC_TMSRx)) ? Ok : Error; +} + +/** + * @brief Enable SMC MUX. + * @param [in] enNewState The function new state + * @arg This parameter can be: Enable or Disable + * @retval None + */ +void EXMC_SMC_PinMuxCmd(en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + WRITE_REG32(M4_SMC->BACR, (Enable == enNewState) ? EXMC_SMC_MUX_ENABLE: EXMC_SMC_MUX_DISABLE); +} + +/** + * @brief Set SMC refresh period value + * @param [in] u32PeriodVal The SMC refresh period value + * @arg number of 16bit + * @retval None + */ +void EXMC_SMC_SetRefreshPeriod(uint32_t u32PeriodVal) +{ + /* Check parameters */ + DDL_ASSERT(IS_EXMC_SMC_REFRESH_PERIOD(u32PeriodVal)); + + WRITE_REG16(M4_SMC->RFTR, u32PeriodVal); +} + +/** + * @} + */ + +#endif /* DDL_SMC_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_spi.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_spi.c new file mode 100644 index 0000000000..1dbf6acc00 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_spi.c @@ -0,0 +1,1095 @@ +/** + ******************************************************************************* + * @file hc32f4a0_spi.c + * @brief This file provides firmware functions to manage the Serial Peripheral + * Interface(SPI). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Wangmin First version + 2020-08-31 Wangmin Modify for MISRAC2012 + 2020-10-13 Wangmin Define variable for count as __IO type + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_spi.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_SPI SPI + * @brief Serial Peripheral Interface Driver Library + * @{ + */ + +#if (DDL_SPI_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup SPI_Local_Macros SPI Local Macros + * @{ + */ + +#define SPI_CFG1_DEFAULT (0x00000010UL) +#define SPI_CFG2_DEFAULT (0x00000F1DUL) +#define SPI_SR_DEFAULT (0x00000020UL) + +#define SPI_IRQ_MASK ( SPI_INT_ERROR | \ + SPI_INT_TX_BUFFER_EMPTY | \ + SPI_INT_RX_BUFFER_FULL | \ + SPI_INT_IDLE ) +#define SPI_GET_STD_MASK ( SPI_FLAG_OVERLOAD | \ + SPI_FLAG_IDLE | \ + SPI_FLAG_MODE_FAULT | \ + SPI_FLAG_PARITY_ERROR | \ + SPI_FLAG_UNDERLOAD | \ + SPI_FLAG_TX_BUFFER_EMPTY | \ + SPI_FLAG_RX_BUFFER_FULL ) +#define SPI_CLR_STD_MASK ( SPI_FLAG_OVERLOAD | \ + SPI_FLAG_MODE_FAULT | \ + SPI_FLAG_PARITY_ERROR | \ + SPI_FLAG_UNDERLOAD ) + +#define SPI_SS0_VALID_CFG (0UL) +#define SPI_SS1_VALID_CFG (SPI_CFG2_SSA_0) +#define SPI_SS2_VALID_CFG (SPI_CFG2_SSA_1) +#define SPI_SS3_VALID_CFG (SPI_CFG2_SSA_0 | SPI_CFG2_SSA_1) + +/** + * @defgroup SPI_Check_Parameters_Validity SPI check parameters validity + * @{ + */ + +/*! Parameter valid check for SPI peripheral */ +#define IS_VALID_SPI_UNIT(x) \ +( (M4_SPI1 == (x)) || \ + (M4_SPI2 == (x)) || \ + (M4_SPI3 == (x)) || \ + (M4_SPI4 == (x)) || \ + (M4_SPI5 == (x)) || \ + (M4_SPI6 == (x))) + +/*! Parameter valid check for SPI wire mode */ +#define IS_SPI_WIRE_MODE(x) \ +( ((x) == SPI_WIRE_4) || \ + ((x) == SPI_WIRE_3)) + +/*! Parameter valid check for SPI transfer mode */ +#define IS_SPI_TRANS_MODE(x) \ +( ((x) == SPI_FULL_DUPLEX) || \ + ((x) == SPI_SEND_ONLY)) + +/*! Parameter valid check for SPI master slave mode */ +#define IS_SPI_MASTER_SLAVE(x) \ +( ((x) == SPI_SLAVE) || \ + ((x) == SPI_MASTER)) + +/*! Parameter valid check for SPI loopback mode */ +#define IS_SPI_SPLPBK(x) \ +( ((x) == SPI_SPLPBK_INVALID) || \ + ((x) == SPI_SPLPBK_MOSI_INVERT) || \ + ((x) == SPI_SPLPBK_MOSI)) + +/*! Parameter valid check for SPI communication suspend function status */ +#define IS_SPI_SUSP_MODE_STD(x) \ +( ((x) == SPI_COM_SUSP_FUNC_OFF) || \ + ((x) == SPI_COM_SUSP_FUNC_ON)) + +/*! Parameter valid check for SPI fault dectet function status */ +#define IS_SPI_MODFE_CMD(x) \ +( ((x) == SPI_MODFE_DISABLE) || \ + ((x) == SPI_MODFE_ENABLE)) + +/*! Parameter valid check for SPI parity check mode */ +#define IS_SPI_PARITY_CHECK(x) \ +( ((x) == SPI_PARITY_INVALID) || \ + ((x) == SPI_PARITY_EVEN) || \ + ((x) == SPI_PARITY_ODD)) + +/*! Parameter valid check for SPI interval time delay */ +#define IS_SPI_INTERVAL_DELAY(x) \ +( ((x) == SPI_INTERVAL_TIME_1SCK_2PCLK1) || \ + ((x) == SPI_INTERVAL_TIME_2SCK_2PCLK1) || \ + ((x) == SPI_INTERVAL_TIME_3SCK_2PCLK1) || \ + ((x) == SPI_INTERVAL_TIME_4SCK_2PCLK1) || \ + ((x) == SPI_INTERVAL_TIME_5SCK_2PCLK1) || \ + ((x) == SPI_INTERVAL_TIME_6SCK_2PCLK1) || \ + ((x) == SPI_INTERVAL_TIME_7SCK_2PCLK1) || \ + ((x) == SPI_INTERVAL_TIME_8SCK_2PCLK1)) + +/*! Parameter valid check for SPI release time delay */ +#define IS_SPI_RELEASE_DELAY(x) \ +( ((x) == SPI_RELEASE_TIME_1SCK) || \ + ((x) == SPI_RELEASE_TIME_2SCK) || \ + ((x) == SPI_RELEASE_TIME_3SCK) || \ + ((x) == SPI_RELEASE_TIME_4SCK) || \ + ((x) == SPI_RELEASE_TIME_5SCK) || \ + ((x) == SPI_RELEASE_TIME_6SCK) || \ + ((x) == SPI_RELEASE_TIME_7SCK) || \ + ((x) == SPI_RELEASE_TIME_8SCK)) + +/*! Parameter valid check for SPI Setup time delay delay */ +#define IS_SPI_SETUP_DELAY(x) \ +( ((x) == SPI_SETUP_TIME_1SCK) || \ + ((x) == SPI_SETUP_TIME_2SCK) || \ + ((x) == SPI_SETUP_TIME_3SCK) || \ + ((x) == SPI_SETUP_TIME_4SCK) || \ + ((x) == SPI_SETUP_TIME_5SCK) || \ + ((x) == SPI_SETUP_TIME_6SCK) || \ + ((x) == SPI_SETUP_TIME_7SCK) || \ + ((x) == SPI_SETUP_TIME_8SCK)) + +/*! Parameter valid check for SPI SS active level */ +#define IS_SPI_SS_ACTIVE_LEVEL(x) \ +( ((x) == SPI_SS_ACTIVE_LOW) || \ + ((x) == SPI_SS_ACTIVE_HIGH)) + +/*! Parameter valid check for SPI read data register target buffer */ +#define IS_SPI_RD_TARGET_BUFF(x) \ +( ((x) == SPI_RD_TARGET_RD_BUF) || \ + ((x) == SPI_RD_TARGET_WR_BUF)) + +/*! Parameter valid check for SPI mode */ +#define IS_SPI_SPI_MODE(x) \ +( ((x) == SPI_MODE_0) || \ + ((x) == SPI_MODE_1) || \ + ((x) == SPI_MODE_2) || \ + ((x) == SPI_MODE_3)) + +/*! Parameter valid check for SPI SS signal */ +#define IS_SPI_SS_PIN(x) \ +( ((x) == SPI_PIN_SS0) || \ + ((x) == SPI_PIN_SS1) || \ + ((x) == SPI_PIN_SS2) || \ + ((x) == SPI_PIN_SS3)) + +/*! Parameter valid check for SPI baudrate prescaler */ +#define IS_SPI_BIT_RATE_DIV(x) \ +( ((x) == SPI_BR_PCLK1_DIV2) || \ + ((x) == SPI_BR_PCLK1_DIV4) || \ + ((x) == SPI_BR_PCLK1_DIV8) || \ + ((x) == SPI_BR_PCLK1_DIV16) || \ + ((x) == SPI_BR_PCLK1_DIV32) || \ + ((x) == SPI_BR_PCLK1_DIV64) || \ + ((x) == SPI_BR_PCLK1_DIV128) || \ + ((x) == SPI_BR_PCLK1_DIV256)) + +/*! Parameter valid check for SPI data bits */ +#define IS_SPI_DATA_SIZE(x) \ +( ((x) == SPI_DATA_SIZE_4BIT) || \ + ((x) == SPI_DATA_SIZE_5BIT) || \ + ((x) == SPI_DATA_SIZE_6BIT) || \ + ((x) == SPI_DATA_SIZE_7BIT) || \ + ((x) == SPI_DATA_SIZE_8BIT) || \ + ((x) == SPI_DATA_SIZE_9BIT) || \ + ((x) == SPI_DATA_SIZE_10BIT) || \ + ((x) == SPI_DATA_SIZE_11BIT) || \ + ((x) == SPI_DATA_SIZE_12BIT) || \ + ((x) == SPI_DATA_SIZE_13BIT) || \ + ((x) == SPI_DATA_SIZE_14BIT) || \ + ((x) == SPI_DATA_SIZE_15BIT) || \ + ((x) == SPI_DATA_SIZE_16BIT) || \ + ((x) == SPI_DATA_SIZE_20BIT) || \ + ((x) == SPI_DATA_SIZE_24BIT) || \ + ((x) == SPI_DATA_SIZE_32BIT)) + +/*! Parameter valid check for SPI data frame level */ +#define IS_SPI_DATA_FRAME(x) \ +( ((x) == SPI_FRAME_1) || \ + ((x) == SPI_FRAME_2) || \ + ((x) == SPI_FRAME_3) || \ + ((x) == SPI_FRAME_4)) + +/*! Parameter valid check for SPI LSB MSB mode */ +#define IS_SPI_FIRST_BIT(x) \ +( ((x) == SPI_FIRST_MSB) || \ + ((x) == SPI_FIRST_LSB)) + +/*! Parameter valid check for interrupt flag */ +#define IS_SPI_IRQ_FLAG(x) \ +( ((x) != 0UL) && \ + (((x) | SPI_IRQ_MASK) == SPI_IRQ_MASK)) + +/*! Parameter valid check for SPI status flag */ +#define IS_SPI_STD_FLAG(x) \ +( ((x) != 0UL) && \ + (((x) | SPI_GET_STD_MASK) == SPI_GET_STD_MASK)) + +/*! Parameter valid check for SPI status flag for clear */ +#define IS_SPI_CLR_STD_FLAG(x) \ +( ((x) != 0UL) && \ + (((x) | SPI_CLR_STD_MASK) == SPI_CLR_STD_MASK)) + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ +/** + * @defgroup SPI_Local_Functions SPI Local Functions + * @{ + */ + +static en_result_t SPI_TxRx(M4_SPI_TypeDef *SPIx, const void *pvTxBuf, void *pvRxBuf, uint32_t u32Length); +static en_result_t SPI_Tx(M4_SPI_TypeDef *SPIx, const void *pvTxBuf, uint32_t u32Length); + +/** + * @} + */ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup SPI_Global_Functions SPI Global Functions + * @{ + */ + +/** + * @brief Initializes the SPI peripheral according to the specified parameters + * in the structure stc_spi_init. + * @param [in] SPIx SPI unit + * @arg M4_SPI1 + * @arg M4_SPI2 + * @arg M4_SPI3 + * @arg M4_SPI4 + * @arg M4_SPI5 + * @arg M4_SPI6 + * @param [in] pstcInit Pointer to a stc_spi_init_t structure that contains + * the configuration information for the SPI. + * @retval An en_result_t enumeration value: + * @arg Ok: No errors occurred + * @arg ErrorInvalidParameter: pstcInit == NULL or configuration parameter error. + */ +en_result_t SPI_Init(M4_SPI_TypeDef *SPIx, const stc_spi_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + DDL_ASSERT(IS_VALID_SPI_UNIT(SPIx)); + + if (NULL != pstcInit) + { + DDL_ASSERT(IS_SPI_WIRE_MODE(pstcInit->u32WireMode)); + DDL_ASSERT(IS_SPI_TRANS_MODE(pstcInit->u32TransMode)); + DDL_ASSERT(IS_SPI_MASTER_SLAVE(pstcInit->u32MasterSlave)); + DDL_ASSERT(IS_SPI_SUSP_MODE_STD(pstcInit->u32SuspMode)); + DDL_ASSERT(IS_SPI_MODFE_CMD(pstcInit->u32Modfe)); + DDL_ASSERT(IS_SPI_PARITY_CHECK(pstcInit->u32Parity)); + DDL_ASSERT(IS_SPI_SPI_MODE(pstcInit->u32SpiMode)); + DDL_ASSERT(IS_SPI_BIT_RATE_DIV(pstcInit->u32BaudRatePrescaler)); + DDL_ASSERT(IS_SPI_DATA_SIZE(pstcInit->u32DataBits)); + DDL_ASSERT(IS_SPI_FIRST_BIT(pstcInit->u32FirstBit)); + DDL_ASSERT(IS_SPI_DATA_FRAME(pstcInit->u32FrameLevel)); + + /* Configuration parameter check */ + if((SPI_MASTER == pstcInit->u32MasterSlave)&&(SPI_MODFE_ENABLE == pstcInit->u32Modfe)) + { + /* pstcInit->u32Modfe can not be SPI_MODFE_ENABLE in master mode */ + } + else if((SPI_WIRE_3 == pstcInit->u32WireMode) + && (SPI_SLAVE == pstcInit->u32MasterSlave) + &&((SPI_MODE_0 == pstcInit->u32SpiMode)||(SPI_MODE_2 == pstcInit->u32SpiMode))) + { + /* SPI_WIRE_3 can not support SPI_MODE_0 and SPI_MODE_2 */ + } + else + { + WRITE_REG32(SPIx->CR1, pstcInit->u32WireMode + | pstcInit->u32TransMode + | pstcInit->u32MasterSlave + | pstcInit->u32SuspMode + | pstcInit->u32Modfe + | pstcInit->u32Parity ); + + MODIFY_REG32(SPIx->CFG1, SPI_CFG1_FTHLV, pstcInit->u32FrameLevel); + + WRITE_REG32(SPIx->CFG2, pstcInit->u32SpiMode + | pstcInit->u32BaudRatePrescaler + | pstcInit->u32DataBits + | pstcInit->u32FirstBit); + + enRet = Ok; + } + } + return enRet; +} + +/** + * @brief De-initializes the SPI peripheral. + * @param [in] SPIx SPI unit + * @arg M4_SPI1 + * @arg M4_SPI2 + * @arg M4_SPI3 + * @arg M4_SPI4 + * @arg M4_SPI5 + * @arg M4_SPI6 + * @retval None + */ +void SPI_DeInit(M4_SPI_TypeDef *SPIx) +{ + DDL_ASSERT(IS_VALID_SPI_UNIT(SPIx)); + + SPI_FunctionCmd(SPIx, Disable); + + WRITE_REG32(SPIx->CR1, 0x00000000UL); + WRITE_REG32(SPIx->CFG1, SPI_CFG1_DEFAULT); + WRITE_REG32(SPIx->CFG2, SPI_CFG2_DEFAULT); + WRITE_REG32(SPIx->SR, SPI_SR_DEFAULT); +} + +/** + * @brief Set a default value for the SPI initialization structure. + * @param [in] pstcInit Pointer to a stc_spi_init_t structure that + * contains configuration information. + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg ErrorInvalidParameter: pstcInit == NULL. + */ +en_result_t SPI_StructInit(stc_spi_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (NULL != pstcInit) + { + pstcInit->u32WireMode = SPI_WIRE_4; + pstcInit->u32TransMode = SPI_FULL_DUPLEX; + pstcInit->u32MasterSlave = SPI_MASTER; + pstcInit->u32SuspMode = SPI_COM_SUSP_FUNC_OFF; + pstcInit->u32Modfe = SPI_MODFE_DISABLE; + pstcInit->u32Parity = SPI_PARITY_INVALID; + pstcInit->u32SpiMode = SPI_MODE_0; + pstcInit->u32BaudRatePrescaler = SPI_BR_PCLK1_DIV8; + pstcInit->u32DataBits = SPI_DATA_SIZE_8BIT; + pstcInit->u32FirstBit = SPI_FIRST_MSB; + pstcInit->u32FrameLevel = SPI_FRAME_1; + + enRet = Ok; + } + return enRet; +} + +/** + * @brief Enable or disable SPI interrupt. + * @param [in] SPIx SPI unit + * @arg M4_SPI1 + * @arg M4_SPI2 + * @arg M4_SPI3 + * @arg M4_SPI4 + * @arg M4_SPI5 + * @arg M4_SPI6 + * @param [in] u32IntType SPI interrupt type. Can be one or any + * combination of the parameter @ref SPI_Interrupt_Type_Define + * @arg SPI_INT_ERROR + * @arg SPI_INT_TX_BUFFER_EMPTY + * @arg SPI_INT_RX_BUFFER_FULL + * @arg SPI_INT_IDLE + * @param [in] enNewState An en_functional_state_t enumeration value. + * @arg Enable: Enable the specified interrupt of SPI. + * @arg Disable: Disable the specified interrupt of SPI. + * @retval None + */ +void SPI_IntCmd(M4_SPI_TypeDef *SPIx, uint32_t u32IntType, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_SPI_UNIT(SPIx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_SPI_IRQ_FLAG(u32IntType)); + + if (enNewState == Enable) + { + SET_REG32_BIT(SPIx->CR1, u32IntType); + } + else + { + CLEAR_REG32_BIT(SPIx->CR1, u32IntType); + } +} + +/** + * @brief SPI function enable or disable. + * @param [in] SPIx SPI unit + * @arg M4_SPI1 + * @arg M4_SPI2 + * @arg M4_SPI3 + * @arg M4_SPI4 + * @arg M4_SPI5 + * @arg M4_SPI6 + * @param [in] enNewState An en_functional_state_t enumeration value. + * @arg Enable: Enable SPI function. + * @arg Disable: Disable SPI function. + * @retval None + */ +void SPI_FunctionCmd(M4_SPI_TypeDef *SPIx, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_SPI_UNIT(SPIx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if(Enable == enNewState) + { + SET_REG32_BIT(SPIx->CR1, SPI_CR1_SPE); + } + else + { + CLEAR_REG32_BIT(SPIx->CR1, SPI_CR1_SPE); + } +} + +/** + * @brief Write SPI data register. + * @param [in] SPIx SPI unit + * @arg M4_SPI1 + * @arg M4_SPI2 + * @arg M4_SPI3 + * @arg M4_SPI4 + * @arg M4_SPI5 + * @arg M4_SPI6 + * @param [in] u32Data The data will be written to the data register. + * @retval None. + */ +void SPI_WriteDataReg(M4_SPI_TypeDef *SPIx, uint32_t u32Data) +{ + DDL_ASSERT(IS_VALID_SPI_UNIT(SPIx)); + WRITE_REG32(SPIx->DR, u32Data); +} + +/** + * @brief Read SPI data register. + * @param [in] SPIx SPI unit + * @arg M4_SPI1 + * @arg M4_SPI2 + * @arg M4_SPI3 + * @arg M4_SPI4 + * @arg M4_SPI5 + * @arg M4_SPI6 + * @retval A 32-bit data of SPI data register. + */ +uint32_t SPI_ReadDataReg(const M4_SPI_TypeDef *SPIx) +{ + DDL_ASSERT(IS_VALID_SPI_UNIT(SPIx)); + + return READ_REG32(SPIx->DR); +} + + +/** + * @brief SPI get status flag. + * @param [in] SPIx SPI unit + * @arg M4_SPI1 + * @arg M4_SPI2 + * @arg M4_SPI3 + * @arg M4_SPI4 + * @arg M4_SPI5 + * @arg M4_SPI6 + * @param [in] u32Flag SPI state flag. Can be one or any + * combination of the parameter of @ref SPI_State_Flag_Define + * @arg SPI_FLAG_OVERLOAD + * @arg SPI_FLAG_IDLE + * @arg SPI_FLAG_MODE_FAULT + * @arg SPI_FLAG_PARITY_ERROR + * @arg SPI_FLAG_UNDERLOAD + * @arg SPI_FLAG_TX_BUFFER_EMPTY + * @arg SPI_FLAG_RX_BUFFER_FULL + * @retval An en_flag_status_t enumeration. + * @arg Set: The specified flag has set. + * @arg Reset: The specified flag has not set. + */ +en_flag_status_t SPI_GetStatus(const M4_SPI_TypeDef *SPIx, uint32_t u32Flag) +{ + en_flag_status_t enFlag = Reset; + DDL_ASSERT(IS_VALID_SPI_UNIT(SPIx)); + DDL_ASSERT(IS_SPI_STD_FLAG(u32Flag)); + + if(0U != READ_REG32_BIT(SPIx->SR, u32Flag)) + { + enFlag = Set; + } + + return enFlag; +} + +/** + * @brief SPI clear state flag. + * @param [in] SPIx SPI unit + * @arg M4_SPI1 + * @arg M4_SPI2 + * @arg M4_SPI3 + * @arg M4_SPI4 + * @arg M4_SPI5 + * @arg M4_SPI6 + * @param [in] u32Flag SPI state flag. + * Can be one or any combination of the parameter below + * @arg SPI_FLAG_OVERLOAD + * @arg SPI_FLAG_MODE_FAULT + * @arg SPI_FLAG_PARITY_ERROR + * @arg SPI_FLAG_UNDERLOAD + * @retval None + */ +void SPI_ClearFlag(M4_SPI_TypeDef *SPIx, uint32_t u32Flag) +{ + DDL_ASSERT(IS_VALID_SPI_UNIT(SPIx)); + DDL_ASSERT(IS_SPI_CLR_STD_FLAG(u32Flag)); + + CLEAR_REG32_BIT(SPIx->SR, u32Flag); +} + +/** + * @brief SPI loopback function configuration. + * @param [in] SPIx SPI unit + * @arg M4_SPI1 + * @arg M4_SPI2 + * @arg M4_SPI3 + * @arg M4_SPI4 + * @arg M4_SPI5 + * @arg M4_SPI6 + * @param [in] u32Mode Loopback mode. + * Can be one parameter @ref SPI_Loopback_Selection_Define + * @arg SPI_SPLPBK_INVALID + * @arg SPI_SPLPBK_MOSI_INVERT + * @arg SPI_SPLPBK_MOSI + * @retval None + */ +void SPI_LoopbackModeCfg(M4_SPI_TypeDef *SPIx, uint32_t u32Mode) +{ + DDL_ASSERT(IS_VALID_SPI_UNIT(SPIx)); + DDL_ASSERT(IS_SPI_SPLPBK(u32Mode)); + + MODIFY_REG32(SPIx->CR1, SPI_CR1_SPLPBK | SPI_CR1_SPLPBK2, u32Mode); +} + +/** + * @brief SPI parity check error self diagnosis function enable or disable. + * @param [in] SPIx SPI unit + * @arg M4_SPI1 + * @arg M4_SPI2 + * @arg M4_SPI3 + * @arg M4_SPI4 + * @arg M4_SPI5 + * @arg M4_SPI6 + * @param [in] enNewState An en_functional_state_t enumeration value. + * @arg Enable: Enable function. + * @arg Disable: Disable function. + * @retval None + */ +void SPI_PateCmd(M4_SPI_TypeDef *SPIx, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_SPI_UNIT(SPIx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if(Enable == enNewState) + { + SET_REG32_BIT(SPIx->CR1, SPI_CR1_PATE); + } + else + { + CLEAR_REG32_BIT(SPIx->CR1, SPI_CR1_PATE); + } +} + +/** + * @brief SPI signals delay time configuration + * @param [in] SPIx SPI unit + * @arg M4_SPI1 + * @arg M4_SPI2 + * @arg M4_SPI3 + * @arg M4_SPI4 + * @arg M4_SPI5 + * @arg M4_SPI6 + * @param [in] pstcDelayCfg Pointer to a stc_spi_delay_t structure that contains + * the configuration information for the SPI delay time. + * @retval An en_result_t enumeration value: + * @arg Ok: No errors occurred + * @arg ErrorInvalidParameter: pstcDelayCfg == NULL + */ +en_result_t SPI_DelayTimeCfg(M4_SPI_TypeDef *SPIx, const stc_spi_delay_t *pstcDelayCfg) +{ + en_result_t enRet = ErrorInvalidParameter; + + DDL_ASSERT(IS_VALID_SPI_UNIT(SPIx)); + + if (NULL != pstcDelayCfg) + { + DDL_ASSERT(IS_SPI_INTERVAL_DELAY(pstcDelayCfg->u32IntervalDelay)); + DDL_ASSERT(IS_SPI_RELEASE_DELAY(pstcDelayCfg->u32ReleaseDelay)); + DDL_ASSERT(IS_SPI_SETUP_DELAY(pstcDelayCfg->u32SetupDelay)); + + /* Interval delay */ + if(SPI_INTERVAL_TIME_1SCK_2PCLK1 == pstcDelayCfg->u32IntervalDelay) + { + CLEAR_REG32_BIT(SPIx->CFG2, SPI_CFG2_MIDIE); + CLEAR_REG32_BIT(SPIx->CFG1, SPI_CFG1_MIDI); + } + else + { + MODIFY_REG32(SPIx->CFG1, SPI_CFG1_MIDI, pstcDelayCfg->u32IntervalDelay); + SET_REG32_BIT(SPIx->CFG2, SPI_CFG2_MIDIE); + } + + /* SCK release delay */ + if(SPI_RELEASE_TIME_1SCK == pstcDelayCfg->u32ReleaseDelay) + { + CLEAR_REG32_BIT(SPIx->CFG2, SPI_CFG2_MSSDLE); + CLEAR_REG32_BIT(SPIx->CFG1, SPI_CFG1_MSSDL); + } + else + { + SET_REG32_BIT(SPIx->CFG2, SPI_CFG2_MSSDLE); + MODIFY_REG32(SPIx->CFG1, SPI_CFG1_MSSDL, pstcDelayCfg->u32ReleaseDelay); + } + + /* Setup delay */ + if(SPI_SETUP_TIME_1SCK == pstcDelayCfg->u32SetupDelay) + { + CLEAR_REG32_BIT(SPIx->CFG2, SPI_CFG2_MSSIE); + CLEAR_REG32_BIT(SPIx->CFG1, SPI_CFG1_MSSI); + } + else + { + SET_REG32_BIT(SPIx->CFG2, SPI_CFG2_MSSIE); + MODIFY_REG32(SPIx->CFG1, SPI_CFG1_MSSI, pstcDelayCfg->u32SetupDelay); + } + + enRet = Ok; + } + return enRet; +} + +/** + * @brief Set a default value for the SPI delay time configuration structure. + * @param [in] pstcDelayCfg Pointer to a stc_spi_delay_t structure that + * contains configuration information. + * @retval An en_result_t enumeration value. + * @arg Ok: No errors occurred. + * @arg ErrorInvalidParameter: pstcDelayCfg == NULL. + */ +en_result_t SPI_DelayStructInit(stc_spi_delay_t *pstcDelayCfg) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (NULL != pstcDelayCfg) + { + pstcDelayCfg->u32IntervalDelay = SPI_INTERVAL_TIME_1SCK_2PCLK1; + pstcDelayCfg->u32ReleaseDelay = SPI_RELEASE_TIME_1SCK; + pstcDelayCfg->u32SetupDelay = SPI_SETUP_TIME_1SCK; + enRet = Ok; + } + return enRet; +} + +/** + * @brief SPI SS signal valid level configuration + * @param [in] SPIx SPI unit + * @arg M4_SPI1 + * @arg M4_SPI2 + * @arg M4_SPI3 + * @arg M4_SPI4 + * @arg M4_SPI5 + * @arg M4_SPI6 + * @param [in] u32SSPin Specify the SS pin @ref SPI_SS_Pin_Define + * @param [in] enNewState An en_functional_state_t enumeration value. + * @arg Enable: SS pin high level valid. + * @arg Disable: SS pin low level valid. + * @retval None + */ +void SPI_SSValidLevelCfg(M4_SPI_TypeDef *SPIx, uint32_t u32SSPin, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_SPI_UNIT(SPIx)); + DDL_ASSERT(IS_SPI_SS_PIN(u32SSPin)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if(Enable == enNewState) + { + SET_REG32_BIT(SPIx->CFG1, u32SSPin); + } + else + { + CLEAR_REG32_BIT(SPIx->CFG1, u32SSPin); + } +} + +/** + * @brief SPI valid SS signal configuration + * @param [in] SPIx SPI unit + * @arg M4_SPI1 + * @arg M4_SPI2 + * @arg M4_SPI3 + * @arg M4_SPI4 + * @arg M4_SPI5 + * @arg M4_SPI6 + * @param [in] u32SSPin Specify the SS pin @ref SPI_SS_Pin_Define + * @retval None + */ +void SPI_SSPinSel(M4_SPI_TypeDef *SPIx, uint32_t u32SSPin) +{ + uint32_t u32RegCfg; + DDL_ASSERT(IS_VALID_SPI_UNIT(SPIx)); + DDL_ASSERT(IS_SPI_SS_PIN(u32SSPin)); + + switch (u32SSPin) + { + case SPI_PIN_SS0: + u32RegCfg = SPI_SS0_VALID_CFG; + break; + case SPI_PIN_SS1: + u32RegCfg = SPI_SS1_VALID_CFG; + break; + case SPI_PIN_SS2: + u32RegCfg = SPI_SS2_VALID_CFG; + break; + case SPI_PIN_SS3: + u32RegCfg = SPI_SS3_VALID_CFG; + break; + + default: + u32RegCfg = SPI_SS0_VALID_CFG; + break; + } + MODIFY_REG32(SPIx->CFG2, SPI_CFG2_SSA, u32RegCfg); +} + +/** + * @brief SPI read buffer configuration + * @param [in] SPIx SPI unit + * @arg M4_SPI1 + * @arg M4_SPI2 + * @arg M4_SPI3 + * @arg M4_SPI4 + * @arg M4_SPI5 + * @arg M4_SPI6 + * @param [in] u32ReadBuf Target buffer for read operation @ref SPI_Read_Target_Buffer_Define + * @retval None + */ +void SPI_ReadBufCfg(M4_SPI_TypeDef *SPIx, uint32_t u32ReadBuf) +{ + DDL_ASSERT(IS_VALID_SPI_UNIT(SPIx)); + DDL_ASSERT(IS_SPI_RD_TARGET_BUFF(u32ReadBuf)); + + MODIFY_REG32(SPIx->CFG1, SPI_CFG1_SPRDTD, u32ReadBuf); +} + +/** + * @brief SPI transmit data. + * @param [in] SPIx SPI unit + * @arg M4_SPI1 + * @arg M4_SPI2 + * @arg M4_SPI3 + * @arg M4_SPI4 + * @arg M4_SPI5 + * @arg M4_SPI6 + * @param [in] pvTxBuf The pointer to the buffer which contains the data to be sent. + * @param [in] u32TxLength The length of the data to be sent. + * @retval An en_result_t enumeration value: + * @arg Ok: No errors occurred + * @arg ErrorTimeout: SPI transmit timeout. + * @arg ErrorInvalidParameter: pvTxBuf == NULL or u32TxLength == 0U + * @note -No SS pin active and inactive operation in 3-wire mode. Add operations of SS pin depending on your application. + * -This function supports full duplex mode and send only mode. + */ +en_result_t SPI_Transmit(M4_SPI_TypeDef *SPIx, const void *pvTxBuf, uint32_t u32TxLength) +{ + uint32_t u32Flags; + en_result_t enRet = ErrorInvalidParameter; + + if ((pvTxBuf != NULL) && (u32TxLength != 0U)) + { + u32Flags = READ_REG32_BIT(SPIx->CR1, SPI_CR1_TXMDS); + if (u32Flags == SPI_SEND_ONLY) + { + /* Transmit data in send only mode. */ + enRet = SPI_Tx(SPIx, pvTxBuf, u32TxLength); + } + else + { + /* Transmit data in full duplex mode. */ + enRet = SPI_TxRx(SPIx, pvTxBuf, NULL, u32TxLength); + } + } + return enRet; +} + +/** + * @brief SPI receive data. + * @param [in] SPIx SPI unit + * @arg M4_SPI1 + * @arg M4_SPI2 + * @arg M4_SPI3 + * @arg M4_SPI4 + * @arg M4_SPI5 + * @arg M4_SPI6 + * @param [in] pvRxBuf The pointer to the buffer which the received data to be stored. + * @param [in] u32RxLength The length of the data to be received. + * @retval An en_result_t enumeration value: + * @arg Ok: No errors occurred + * @arg ErrorTimeout: SPI receive timeout. + * @arg ErrorInvalidParameter: pvRxBuf == NULL or u32RxLength == 0U + * @note -No SS pin active and inactive operation in 3-wire mode. Add operations of SS pin depending on your application. + * -This function only works in full duplex master mode. + */ +en_result_t SPI_Receive(M4_SPI_TypeDef *SPIx, void *pvRxBuf, uint32_t u32RxLength) +{ + en_result_t enRet = ErrorInvalidParameter; + + if ((pvRxBuf != NULL) && (u32RxLength != 0U)) + { + /* Receives data in full duplex master mode. */ + enRet = SPI_TxRx(SPIx, NULL, pvRxBuf, u32RxLength); + } + return enRet; +} + +/** + * @brief SPI transmit and receive data. + * @param [in] SPIx SPI unit + * @arg M4_SPI1 + * @arg M4_SPI2 + * @arg M4_SPI3 + * @arg M4_SPI4 + * @arg M4_SPI5 + * @arg M4_SPI6 + * @param [in] pvTxBuf The pointer to the buffer which contains the data to be sent. + * If this pointer is NULL and the pvRxBuf is NOT NULL, the MOSI output high + * and the the received data will be stored in the buffer pointed by pvRxBuf. + * @param [out] pvRxBuf The pointer to the buffer which the received data will be stored. + * This for full duplex transfer. + * @param [in] u32Length The length of the data(in byte or half word) to be sent and received. + * @retval An en_result_t enumeration value: + * @arg Ok: No errors occurred + * @arg ErrorTimeout: SPI transmit and receive timeout. + * @arg ErrorInvalidParameter: pvRxBuf == NULL or pvRxBuf == NULL or u32Length == 0U + * @note SPI receives data while sending data. Only works in full duplex master mode. + */ +en_result_t SPI_TransmitReceive(M4_SPI_TypeDef *SPIx, const void *pvTxBuf, void *pvRxBuf, uint32_t u32Length) +{ + en_result_t enRet = ErrorInvalidParameter; + + if ((pvTxBuf != NULL) && (pvRxBuf != NULL) && (u32Length != 0U)) + { + /* Transmit and receive data in full duplex master mode. */ + enRet = SPI_TxRx(SPIx, pvTxBuf, pvRxBuf, u32Length); + } + return enRet; +} +/** + * @} + */ + +/** + * @addtogroup SPI_Local_Functions SPI Local Functions + * @{ + */ +/** + * @brief SPI transmit and receive data in full duplex mode. + * @param [in] SPIx SPI unit + * @arg M4_SPI1 + * @arg M4_SPI2 + * @arg M4_SPI3 + * @arg M4_SPI4 + * @arg M4_SPI5 + * @arg M4_SPI6 + * @param [in] pvTxBuf The pointer to the buffer which contains the data to be sent. + * @param [out] pvRxBuf The pointer to the buffer which the received data will be stored. + * @param [in] u32Length The length of the data in byte or half word. + * @retval An en_result_t enumeration value: + * @arg Ok: No errors occurred + * @arg ErrorTimeout: SPI transmit and receive timeout. + */ +static en_result_t SPI_TxRx(M4_SPI_TypeDef *SPIx, const void *pvTxBuf, void *pvRxBuf, uint32_t u32Length) +{ + uint32_t u32BitSize; + __IO uint32_t u32Timecount; + __IO uint32_t u32Count = 0U; + en_result_t enRet = Ok; + uint32_t u32Tmp; + __UNUSED __IO uint32_t u32Read; + + /* Get data bit size, SPI_DATA_SIZE_4BIT ~ SPI_DATA_SIZE_32BIT */ + u32BitSize = READ_REG32_BIT(SPIx->CFG2, SPI_CFG2_DSIZE); + + while (u32Count < u32Length) + { + if (pvTxBuf != NULL) + { + if (u32BitSize <= SPI_DATA_SIZE_8BIT) + { + /* SPI_DATA_SIZE_4BIT ~ SPI_DATA_SIZE_8BIT */ + WRITE_REG32(SPIx->DR, ((const uint8_t *)pvTxBuf)[u32Count]); + } + else if(u32BitSize <= SPI_DATA_SIZE_16BIT) + { + /* SPI_DATA_SIZE_9BIT ~ SPI_DATA_SIZE_16BIT */ + WRITE_REG32(SPIx->DR, ((const uint16_t *)pvTxBuf)[u32Count]); + } + else + { + /* SPI_DATA_SIZE_20BIT ~ SPI_DATA_SIZE_32BIT */ + WRITE_REG32(SPIx->DR, ((const uint32_t *)pvTxBuf)[u32Count]); + } + } + else + { + WRITE_REG32(SPIx->DR, 0xFFFFFFFFUL); + } + + /* Delay about 10ms */ + u32Timecount = HCLK_VALUE/100UL; + do + { + if(0UL != READ_REG32_BIT(SPIx->SR, SPI_FLAG_RX_BUFFER_FULL)) + { + break; + } + u32Timecount--; + } while (u32Timecount != 0U); + + if (u32Timecount == 0U) + { + enRet = ErrorTimeout; + break; + } + + u32Tmp = READ_REG32(SPIx->DR); + if (pvRxBuf != NULL) + { + if (u32BitSize <= SPI_DATA_SIZE_8BIT) + { + /* SPI_DATA_SIZE_4BIT ~ SPI_DATA_SIZE_8BIT */ + ((uint8_t *)pvRxBuf)[u32Count] = (uint8_t)u32Tmp; + } + else if(u32BitSize <= SPI_DATA_SIZE_16BIT) + { + /* SPI_DATA_SIZE_9BIT ~ SPI_DATA_SIZE_16BIT */ + ((uint16_t *)pvRxBuf)[u32Count] = (uint16_t)u32Tmp; + } + else + { + /* SPI_DATA_SIZE_20BIT ~ SPI_DATA_SIZE_32BIT */ + ((uint32_t *)pvRxBuf)[u32Count] = (uint32_t)u32Tmp; + } + } + else + { + /* Dummy read */ + u32Read = READ_REG32(SPIx->DR); + } + + u32Count++; + } + return enRet; +} + +/** + * @brief SPI send data only. + * @param [in] SPIx SPI unit + * @arg M4_SPI1 + * @arg M4_SPI2 + * @arg M4_SPI3 + * @arg M4_SPI4 + * @arg M4_SPI5 + * @arg M4_SPI6 + * @param [in] pvTxBuf The pointer to the buffer which contains the data to be sent. + * @param [in] u32Length The length of the data in byte or half word or word. + * @retval An en_result_t enumeration value: + * @arg Ok: No errors occurred. + * @arg ErrorTimeout: SPI transmit timeout. + */ +static en_result_t SPI_Tx(M4_SPI_TypeDef *SPIx, const void *pvTxBuf, uint32_t u32Length) +{ + __IO uint32_t u32Count = 0U; + __IO uint32_t u32Timecount; + uint32_t u32BitSize; + en_result_t enRet = Ok; + + /* Get data bit size, SPI_DATA_SIZE_4BIT ~ SPI_DATA_SIZE_32BIT */ + u32BitSize = READ_REG32_BIT(SPIx->CFG2, SPI_CFG2_DSIZE); + + while (u32Count < u32Length) + { + if (u32BitSize <= SPI_DATA_SIZE_8BIT) + { + /* SPI_DATA_SIZE_4BIT ~ SPI_DATA_SIZE_8BIT */ + WRITE_REG32(SPIx->DR, ((const uint8_t *)pvTxBuf)[u32Count]); + } + else if(u32BitSize <= SPI_DATA_SIZE_16BIT) + { + /* SPI_DATA_SIZE_9BIT ~ SPI_DATA_SIZE_16BIT */ + WRITE_REG32(SPIx->DR, ((const uint16_t *)pvTxBuf)[u32Count]); + } + else + { + /* SPI_DATA_SIZE_20BIT ~ SPI_DATA_SIZE_32BIT */ + WRITE_REG32(SPIx->DR, ((const uint32_t *)pvTxBuf)[u32Count]); + } + + /* Delay about 10ms */ + u32Timecount = HCLK_VALUE/100UL; + do + { + if(0UL != READ_REG32_BIT(SPIx->SR, SPI_FLAG_TX_BUFFER_EMPTY)) + { + break; + } + u32Timecount--; + } while (u32Timecount != 0U); + + if (u32Timecount == 0U) + { + enRet = ErrorTimeout; + } + + u32Count++; + } + return enRet; +} + +/** + * @} + */ + +#endif /* DDL_SPI_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_sram.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_sram.c new file mode 100644 index 0000000000..19459921b9 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_sram.c @@ -0,0 +1,332 @@ +/** + ******************************************************************************* + * @file hc32f4a0_sram.c + * @brief This file provides firmware functions to manage the SRAM. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Wuze First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_sram.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_SRAM SRAM + * @brief SRAM Driver Library + * @{ + */ + +#if (DDL_SRAM_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup SRAM_Local_Macros SRAM Local Macros + * @{ + */ + +/** + * @defgroup SRAM_Configuration_Bits_Mask SRAM Configuration Bits Mask + * @{ + */ +#define SRAM_ECC_MODE_MSK (SRAMC_CKCR_ECCMOD) +#define SRAM_CYCLE_MSK (SRAMC_WTCR_SRAM123RWT) +/** + * @} + */ + +/** + * @defgroup SRAM_Check_Parameters_Validity SRAM check parameters validity + * @{ + */ +#define IS_SRAM_ERR_OP(x) \ +( ((x) == SRAM_ERR_OP_NMI) || \ + ((x) == SRAM_ERR_OP_RESET)) + +#define IS_SRAM_CYCLE(x) \ +( ((x) <= SRAM_WAIT_CYCLE_7)) + +#define IS_SRAM_ECC_MODE(x) \ +( ((x) == SRAM_ECC_MODE_INVALID) || \ + ((x) == SRAM_ECC_MODE_1) || \ + ((x) == SRAM_ECC_MODE_2) || \ + ((x) == SRAM_ECC_MODE_3)) + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup SRAM_Global_Functions SRAM Global Functions + * @{ + */ + +/** + * @brief Initializes SRAM. + * @param None + * @retval None + */ +void SRAM_Init(void) +{ + SET_REG32_BIT(M4_SRAMC->CKSR, SRAM_FLAG_ALL); +} + +/** + * @brief De-initializes SRAM. Reset the registers of SRAM. + * @param None + * @retval None + * @note Call SRAM_WTCR_Unlock to unlock register WTCR and SRAM_CKCR_Unlock to unlock register CKCR first. + */ +void SRAM_DeInit(void) +{ + /* Call SRAM_WTCR_Unlock to unlock register WTCR. */ + DDL_ASSERT(M4_SRAMC->WTPR == SRAM_UNLOCK_CMD); + /* Call SRAM_CKCR_Unlock to unlock register CKCR. */ + DDL_ASSERT(M4_SRAMC->CKPR == SRAM_UNLOCK_CMD); + + WRITE_REG32(M4_SRAMC->WTCR, 0U); + WRITE_REG32(M4_SRAMC->CKCR, 0U); + SET_REG32_BIT(M4_SRAMC->CKSR, SRAM_FLAG_ALL); +} + +/** + * @brief Set access wait cycle for SRAM(s). + * @param [in] u32SramIndex The SRAM(s) index bit mask. + * This parameter can be values of @ref SRAM_Index_Bit_Mask + * @arg SRAM_SRAMH: SRAMH. + * @arg SRAM_SRAM123: SRAM1, SRAM2 and SRAM3. When the CPU clock frequency is higher + * than 200MHz, access wait cycle is needed. + * @arg SRAM_SRAM4: SRAM4. When the CPU clock frequency is higher than 200MHz, + * access wait cycle is needed. + * @arg SRAM_SRAMB: SRAMB. When the CPU clock frequency is higher than 120MHz, + * access wait cycle is needed. + * @param [in] u32WriteCycle The write access wait cycle for the specified SRAM(s) + * This parameter can be a value of @ref SRAM_Access_Wait_Cycle + * @arg SRAM_WAIT_CYCLE_0: Wait 0 CPU cycle. + * @arg SRAM_WAIT_CYCLE_1: Wait 1 CPU cycle. + * @arg SRAM_WAIT_CYCLE_2: Wait 2 CPU cycles. + * @arg SRAM_WAIT_CYCLE_3: Wait 3 CPU cycles. + * @arg SRAM_WAIT_CYCLE_4: Wait 4 CPU cycles. + * @arg SRAM_WAIT_CYCLE_5: Wait 5 CPU cycles. + * @arg SRAM_WAIT_CYCLE_6: Wait 6 CPU cycles. + * @arg SRAM_WAIT_CYCLE_7: Wait 7 CPU cycles. + * @param [in] u32ReadCycle The read access wait cycle for the specified SRAM(s) + * This parameter can be a value of @ref SRAM_Access_Wait_Cycle + * The arguments are same as u32WriteCycle. + * @retval None + * @note Call SRAM_WTCR_Unlock to unlock register WTCR first. + */ +void SRAM_SetWaitCycle(uint32_t u32SramIndex, uint32_t u32WriteCycle, uint32_t u32ReadCycle) +{ + uint8_t i; + uint8_t u8OfsWt; + uint8_t u8OfsRd; + uint32_t au32SramList[4U] = {SRAM_SRAM123, SRAM_SRAM4, SRAM_SRAMH, SRAM_SRAMB}; + + DDL_ASSERT(IS_SRAM_CYCLE(u32WriteCycle)); + DDL_ASSERT(IS_SRAM_CYCLE(u32ReadCycle)); + DDL_ASSERT(M4_SRAMC->WTPR == SRAM_UNLOCK_CMD); + + for (i=0U; i<4U; i++) + { + if ((u32SramIndex & au32SramList[i]) != 0U) + { + u8OfsWt = i << 3U; + u8OfsRd = u8OfsWt + 4U; + MODIFY_REG32(M4_SRAMC->WTCR, + ((SRAM_CYCLE_MSK << u8OfsWt) | (SRAM_CYCLE_MSK << u8OfsRd)), + ((u32WriteCycle << u8OfsWt) | (u32ReadCycle << u8OfsRd))); + } + } +} + +/** + * @brief Set ECC mode for SRAM4 and SRAMB. + * @param [in] u32SramIndex The SRAM(s) index bit mask.This function is used to set the + * ECC mode of SRAM4 and SRAMB, so u32SramIndex must contain + * SRAM_SRAM4 or SRAM_SRAMB or both, from @ref SRAM_Index_Bit_Mask + * @param [in] u32EccMode The ECC mode of SRAM4 and SRAMB. + * This parameter can be a value of @ref SRAM_ECC_Mode + * @arg SRAM_ECC_MODE_INVALID: The ECC mode is invalid. + * @arg SRAM_ECC_MODE_1: When 1-bit error occurred: + * ECC error corrects. + * No 1-bit-error status flag setting, no interrupt or reset. + * When 2-bit error occurred: + * ECC error detects. + * 2-bit-error status flag sets and interrupt or reset occurred. + * @arg SRAM_ECC_MODE_2: When 1-bit error occurred: + * ECC error corrects. + * 1-bit-error status flag sets, no interrupt or reset. + * When 2-bit error occurred: + * ECC error detects. + * 2-bit-error status flag sets and interrupt or reset occurred. + * @arg SRAM_ECC_MODE_3: When 1-bit error occurred: + * ECC error corrects. + * 1-bit-error status flag sets and interrupt or reset occurred. + * When 2-bit error occurred: + * ECC error detects. + * 2-bit-error status flag sets and interrupt or reset occurred. + * @retval None + * @note Call SRAM_CKCR_Unlock to unlock register CKCR first. + */ +void SRAM_SetEccMode(uint32_t u32SramIndex, uint32_t u32EccMode) +{ + DDL_ASSERT(IS_SRAM_ECC_MODE(u32EccMode)); + DDL_ASSERT(M4_SRAMC->CKPR == SRAM_UNLOCK_CMD); + + if ((u32SramIndex & SRAM_SRAM4) != 0U) + { + MODIFY_REG32(M4_SRAMC->CKCR, SRAM_ECC_MODE_MSK, u32EccMode); + } + + if ((u32SramIndex & SRAM_SRAMB) != 0U) + { + MODIFY_REG32(M4_SRAMC->CKCR, SRAM_ECC_MODE_MSK<<2U, u32EccMode); + } +} + +/** + * @brief Set the operation which is operated after check error occurred. + * @param [in] u32SramIndex The SRAM(s) index bit mask. + * This parameter can be values of @ref SRAM_Index_Bit_Mask + * @arg SRAM_SRAMH: SRAMH. + * @arg SRAM_SRAM123: SRAM1, SRAM2 and SRAM3. + * @arg SRAM_SRAM4: SRAM4. + * @arg SRAM_SRAMB: SRAMB. + * @param [out] u32OpAfterError The operation after check error occurred. + * This parameter can be a value of @ref SRAM_Operation_After_Check_Error + * @arg SRAM_ERR_OP_NMI: Check error generates NMI(non-maskable interrupt). + * @arg SRAM_ERR_OP_RESET: Check error generates system reset. + * @retval None + * @note Call SRAM_CKCR_Unlock to unlock register CKCR first. + */ +void SRAM_SetErrOperation(uint32_t u32SramIndex, uint32_t u32OpAfterError) +{ + DDL_ASSERT(IS_SRAM_ERR_OP(u32OpAfterError)); + DDL_ASSERT(M4_SRAMC->CKPR == SRAM_UNLOCK_CMD); + + if ((u32SramIndex & (SRAM_SRAM123 | SRAM_SRAMH)) != 0U) + { + WRITE_REG32(bM4_SRAMC->CKCR_b.PYOAD, u32OpAfterError); + } + + if ((u32SramIndex & SRAM_SRAM4) != 0U) + { + WRITE_REG32(bM4_SRAMC->CKCR_b.ECCOAD, u32OpAfterError); + } + + if ((u32SramIndex & SRAM_SRAMB) != 0U) + { + WRITE_REG32(bM4_SRAMC->CKCR_b.BECCOAD, u32OpAfterError); + } +} + +/** + * @brief Get the status of the specified flag of SRAM. + * @param [in] u32Flag The flag of SRAM. + * This parameter can be a value of @ref SRAM_Check_Status_Flag + * @arg SRAM_FLAG_SRAM1_PYERR: SRAM1 parity error. + * @arg SRAM_FLAG_SRAM2_PYERR: SRAM2 parity error. + * @arg SRAM_FLAG_SRAM3_PYERR: SRAM3 parity error. + * @arg SRAM_FLAG_SRAMH_PYERR: SRAMH parity error. + * @arg SRAM_FLAG_SRAM4_1ERR: SRAM4 ECC 1-bit error. + * @arg SRAM_FLAG_SRAM4_2ERR: SRAM4 ECC 2-bit error. + * @arg SRAM_FLAG_SRAMB_1ERR: SRAMB ECC 1-bit error. + * @arg SRAM_FLAG_SRAMB_2ERR: SRAMB ECC 2-bit error. + * @arg SRAM_FLAG_CACHE_PYERR: Cache RAM parity error. + * @retval An en_flag_status_t enumeration type value. + * @arg Set: The specified flag is set. + * @arg Reset: The specified flag is not set. + */ +en_flag_status_t SRAM_GetStatus(uint32_t u32Flag) +{ + en_flag_status_t enFlag = Reset; + + if (READ_REG32_BIT(M4_SRAMC->CKSR, (u32Flag & SRAM_FLAG_ALL)) != 0U) + { + enFlag = Set; + } + + return enFlag; +} + +/** + * @brief Clear the status of the specified flag of SRAM. + * @param [in] u32Flag The flag of SRAM. + * This parameter can be a value(s) of @ref SRAM_Check_Status_Flag + * @arg SRAM_FLAG_SRAM1_PYERR: SRAM1 parity error. + * @arg SRAM_FLAG_SRAM2_PYERR: SRAM2 parity error. + * @arg SRAM_FLAG_SRAM3_PYERR: SRAM3 parity error. + * @arg SRAM_FLAG_SRAMH_PYERR: SRAMH parity error. + * @arg SRAM_FLAG_SRAM4_1ERR: SRAM4 ECC 1-bit error. + * @arg SRAM_FLAG_SRAM4_2ERR: SRAM4 ECC 2-bit error. + * @arg SRAM_FLAG_SRAMB_1ERR: SRAMB ECC 1-bit error. + * @arg SRAM_FLAG_SRAMB_2ERR: SRAMB ECC 2-bit error. + * @arg SRAM_FLAG_CACHE_PYERR: Cache RAM parity error. + * @retval None + */ +void SRAM_ClrStatus(uint32_t u32Flag) +{ + SET_REG32_BIT(M4_SRAMC->CKSR, (u32Flag & SRAM_FLAG_ALL)); +} + +/** + * @} + */ + +#endif /* DDL_SRAM_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_swdt.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_swdt.c new file mode 100644 index 0000000000..944b5521a8 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_swdt.c @@ -0,0 +1,262 @@ +/** + ******************************************************************************* + * @file hc32f4a0_swdt.c + * @brief This file provides firmware functions to manage the Special Watch Dog + * Timer(SWDT). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Yangjp First version + 2020-09-04 Yangjp Optimize timeout handling in functions + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_swdt.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_SWDT SWDT + * @brief Special Watch Dog Timer + * @{ + */ + +#if (DDL_SWDT_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup SWDT_Local_Macros SWDT Local Macros + * @{ + */ + +/* SWDT Registers Clear Mask */ +#define SWDT_CR_CLEAR_MASK (SWDT_CR_PERI | SWDT_CR_CKS | SWDT_CR_WDPT | \ + SWDT_CR_SLPOFF | SWDT_CR_ITS) + +/* SWDT Refresh Key */ +#define SWDT_REFRESH_KEY_START (0x0123UL) +#define SWDT_REFRESH_KEY_END (0x3210UL) + +/* SWDT clear flag timeout(ms) */ +#define SWDT_CLEAR_FLAG_TIMEOUT (5UL) + +/** + * @defgroup SWDT_Check_Parameters_Validity SWDT Check Parameters Validity + * @{ + */ +#define IS_SWDT_COUNTER_CYCLE(x) \ +( ((x) == SWDT_COUNTER_CYCLE_256) || \ + ((x) == SWDT_COUNTER_CYCLE_4096) || \ + ((x) == SWDT_COUNTER_CYCLE_16384) || \ + ((x) == SWDT_COUNTER_CYCLE_65536)) + +#define IS_SWDT_CLOCK_DIVISION(x) \ +( ((x) == SWDT_CLOCK_DIV1) || \ + ((x) == SWDT_CLOCK_DIV16) || \ + ((x) == SWDT_CLOCK_DIV32) || \ + ((x) == SWDT_CLOCK_DIV64) || \ + ((x) == SWDT_CLOCK_DIV128) || \ + ((x) == SWDT_CLOCK_DIV256) || \ + ((x) == SWDT_CLOCK_DIV2048)) + +#define IS_SWDT_ALLOW_REFRESH_RANGE(x) \ +( ((x) == SWDT_RANGE_0TO100PCT) || \ + ((x) == SWDT_RANGE_0TO25PCT) || \ + ((x) == SWDT_RANGE_25TO50PCT) || \ + ((x) == SWDT_RANGE_0TO50PCT) || \ + ((x) == SWDT_RANGE_50TO75PCT) || \ + ((x) == SWDT_RANGE_0TO25PCT_50TO75PCT) || \ + ((x) == SWDT_RANGE_25TO75PCT) || \ + ((x) == SWDT_RANGE_0TO75PCT) || \ + ((x) == SWDT_RANGE_75TO100PCT) || \ + ((x) == SWDT_RANGE_0TO25PCT_75TO100PCT) || \ + ((x) == SWDT_RANGE_25TO50PCT_75TO100PCT) || \ + ((x) == SWDT_RANGE_0TO50PCT_75TO100PCT) || \ + ((x) == SWDT_RANGE_50TO100PCT) || \ + ((x) == SWDT_RANGE_0TO25PCT_50TO100PCT) || \ + ((x) == SWDT_RANGE_25TO100PCT)) + +#define IS_SWDT_LPM_COUNT(x) \ +( ((x) == SWDT_LPM_COUNT_CONTINUE) || \ + ((x) == SWDT_LPM_COUNT_STOP)) + +#define IS_SWDT_REQUEST_TYPE(x) \ +( ((x) == SWDT_TRIG_EVENT_INT) || \ + ((x) == SWDT_TRIG_EVENT_RESET)) + +#define IS_SWDT_FLAG(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(SWDT_FLAG_UDF | SWDT_FLAG_REF)))))) + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup SWDT_Global_Functions SWDT Global Functions + * @{ + */ + +/** + * @brief Initialize SWDT. + * @param [in] pstcSwdtInit Pointer to a @ref stc_swdt_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: Invalid parameter + */ +en_result_t SWDT_Init(const stc_swdt_init_t *pstcSwdtInit) +{ + en_result_t enRet = Ok; + + if(NULL == pstcSwdtInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_SWDT_COUNTER_CYCLE(pstcSwdtInit->u32CountCycle)); + DDL_ASSERT(IS_SWDT_CLOCK_DIVISION(pstcSwdtInit->u32ClockDivision)); + DDL_ASSERT(IS_SWDT_ALLOW_REFRESH_RANGE(pstcSwdtInit->u32RefreshRange)); + DDL_ASSERT(IS_SWDT_LPM_COUNT(pstcSwdtInit->u32LPModeCountEn)); + DDL_ASSERT(IS_SWDT_REQUEST_TYPE(pstcSwdtInit->u32TrigType)); + + /* SWDT CR Configuration(Software Start Mode) */ + MODIFY_REG32(M4_SWDT->CR, SWDT_CR_CLEAR_MASK, + (pstcSwdtInit->u32CountCycle | pstcSwdtInit->u32ClockDivision | + pstcSwdtInit->u32RefreshRange | pstcSwdtInit->u32LPModeCountEn | + pstcSwdtInit->u32TrigType)); + } + + return enRet; +} + +/** + * @brief SWDT feed dog. + * @note In software startup mode, Start counter when refreshing for the first time. + * @param None + * @retval None + */ +void SWDT_Feed(void) +{ + WRITE_REG32(M4_SWDT->RR, SWDT_REFRESH_KEY_START); + WRITE_REG32(M4_SWDT->RR, SWDT_REFRESH_KEY_END); +} + +/** + * @brief Get SWDT flag status. + * @param [in] u32Flag Specifies the SWDT flag type. + * This parameter can be one or any combination of the following values: + * @arg SWDT_FLAG_UDF: Count Underflow flag + * @arg SWDT_FLAG_REF: Refresh Error flag + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t SWDT_GetStatus(uint32_t u32Flag) +{ + en_flag_status_t enFlagSta = Reset; + + /* Check parameters */ + DDL_ASSERT(IS_SWDT_FLAG(u32Flag)); + + if (0UL != (READ_REG32_BIT(M4_SWDT->SR, u32Flag))) + { + enFlagSta = Set; + } + + return enFlagSta; +} + +/** + * @brief Clear SWDT flag status. + * @param [in] u32Flag Specifies the SWDT flag type. + * This parameter can be one or any combination of the following values: + * @arg SWDT_FLAG_UDF: Count Underflow flag + * @arg SWDT_FLAG_REF: Refresh Error flag + * @retval An en_result_t enumeration value: + * - Ok: Clear flag success + * - ErrorTimeout: Clear flag timeout + */ +en_result_t SWDT_ClearStatus(uint32_t u32Flag) +{ + __IO uint32_t u32Count; + en_result_t enRet = Ok; + + /* Check parameters */ + DDL_ASSERT(IS_SWDT_FLAG(u32Flag)); + + CLEAR_REG32_BIT(M4_SWDT->SR, u32Flag); + /* Waiting for FLAG bit clear */ + u32Count = SWDT_CLEAR_FLAG_TIMEOUT * (HCLK_VALUE / 20000UL); + while (0UL != READ_REG32_BIT(M4_SWDT->SR, u32Flag)) + { + if (0UL == u32Count) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + + return enRet; +} + +/** + * @} + */ + +#endif /* DDL_SWDT_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmr0.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmr0.c new file mode 100644 index 0000000000..ae2b9a4e72 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmr0.c @@ -0,0 +1,592 @@ +/** + ******************************************************************************* + * @file hc32f4a0_tmr0.c + * @brief This file provides firmware functions to manage the TMR0 + * (TMR0). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Heqb First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_tmr0.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_TMR0 TMR0 + * @brief TMR0 Driver Library + * @{ + */ + +#if (DDL_TMR0_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup TMR0_Local_Macros TMR0 Local Macros + * @{ + */ +#define TMR0_BCONR_INIT_MSK (TMR0_BCONR_CAPMDA | TMR0_BCONR_CKDIVA | \ + TMR0_BCONR_HICPA | TMR0_BCONR_HSTAA | \ + TMR0_BCONR_HSTPA | TMR0_BCONR_HCLEA) + +#define TMR0_CHA_CLKSRC_MSK (TMR0_BCONR_SYNSA | \ + TMR0_BCONR_SYNCLKA | \ + TMR0_BCONR_ASYNCLKA) +#define TMR0_CHB_CLKSRC_MSK (TMR0_BCONR_SYNSB | \ + TMR0_BCONR_SYNCLKB | \ + TMR0_BCONR_ASYNCLKB) + +#define TMR0_CHB_POS (16U) +#define TMR0_OFFEST(ch) ((ch) * TMR0_CHB_POS) +/** + * @defgroup TMR0_Check_Parameters_Validity TMR0 Check Parameters Validity + * @{ + */ +#define IS_VALID_UNIT(x) \ +( ((x) == M4_TMR0_1) || \ + ((x) == M4_TMR0_2)) + +#define IS_VALID_CHANNEL(x) \ +( ((x) == TMR0_CH_A) || \ + ((x) == TMR0_CH_B)) + +#define IS_VALID_CLK_DIVISION(x) \ +( ((x) == TMR0_CLK_DIV1) || \ + ((x) == TMR0_CLK_DIV2) || \ + ((x) == TMR0_CLK_DIV4) || \ + ((x) == TMR0_CLK_DIV8) || \ + ((x) == TMR0_CLK_DIV16) || \ + ((x) == TMR0_CLK_DIV32) || \ + ((x) == TMR0_CLK_DIV64) || \ + ((x) == TMR0_CLK_DIV128) || \ + ((x) == TMR0_CLK_DIV256) || \ + ((x) == TMR0_CLK_DIV512) || \ + ((x) == TMR0_CLK_DIV1024)) + +#define IS_VALID_CLK_SRC(x) \ +( ((x) == TMR0_CLK_SRC_PCLK1) || \ + ((x) == TMR0_CLK_SRC_INTHWTRIG) || \ + ((x) == TMR0_CLK_SRC_XTAL32) || \ + ((x) == TMR0_CLK_SRC_LRC)) + +#define IS_VALID_HWTRG_FUNC(x) \ +( ((x) | TMR0_BT_HETRG_FUNC_MASK) == TMR0_BT_HETRG_FUNC_MASK) + +#define IS_VALID_TMR0_FUNC(x) \ +( ((x) == TMR0_FUNC_CMP) || \ + ((x) == TMR0_FUNC_CAP)) + +#define IS_VALID_TMR0_COM_TRIG(x) \ +( ((x) != 0x0UL) && \ + (((x) | TMR0_COM_TRIG_MASk) == TMR0_COM_TRIG_MASk)) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ + +/** + * @defgroup TMR0_Global_Functions TMR0 Global Functions + * @{ + */ + +/** + * @brief Set a default value for TMR0 configuration structure. + * @param [in] pstcInitStruct Tmr0 function structure + * See the structure definition for @ref stc_tmr0_init_t + * @retval Ok: Success + * ErrorInvalidParameter: Parameter error + */ +en_result_t TMR0_StructInit(stc_tmr0_init_t* pstcInitStruct) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (pstcInitStruct != NULL) + { + pstcInitStruct->u32ClockDivision = TMR0_CLK_DIV1; + pstcInitStruct->u32ClockSource = TMR0_CLK_SRC_PCLK1; + pstcInitStruct->u32Tmr0Func = TMR0_FUNC_CMP; + pstcInitStruct->u16CmpValue = 0xFFFFU; + pstcInitStruct->u16CntValue = 0x0000U; + pstcInitStruct->u32HwTrigFunc = TMR0_BT_HWTRG_FUNC_NONE; + enRet = Ok; + } + return enRet; +} + +/** + * @brief Tmr0 peripheral function initialize + * @param [in] TMR0x Pointer to TMR0 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR0_1: TMR0 unit 1 instance register base + * @arg M4_TMR0_2: TMR0 unit 2 instance register base + * @param [in] u8Channel TMR0_CH_A or TMR0_CH_B + * @arg TMR0_CH_A. + * @arg TMR0_CH_B. + * @param [in] pstcTmr0Init TMR0 function base parameter structure + * @arg See the structure definition for @ref stc_tmr0_init_t + * @retval Ok: Success + * ErrorInvalidParameter: Parameter error + * @note In capture mode, don't need configure member u32HwTrigFunc and u16CmpValue. + * In asynchronous clock, continuous operation of the BCONR register requires waiting for 3 asynchronous clocks. + */ +en_result_t TMR0_Init(M4_TMR0_TypeDef* TMR0x, uint8_t u8Channel, \ + const stc_tmr0_init_t* pstcTmr0Init) +{ + uint32_t u32Temp; + uint32_t u32CMPRAddr; + uint32_t u32CNTRAddr; + en_result_t enRet = ErrorInvalidParameter; + if (pstcTmr0Init != NULL) + { + enRet = Ok; + DDL_ASSERT(IS_VALID_UNIT(TMR0x)); + DDL_ASSERT(IS_VALID_CHANNEL(u8Channel)); + DDL_ASSERT(IS_VALID_CLK_DIVISION(pstcTmr0Init->u32ClockDivision)); + DDL_ASSERT(IS_VALID_CLK_SRC(pstcTmr0Init->u32ClockSource)); + DDL_ASSERT(IS_VALID_TMR0_FUNC(pstcTmr0Init->u32Tmr0Func)); + DDL_ASSERT(IS_VALID_HWTRG_FUNC(pstcTmr0Init->u32HwTrigFunc)); + + u32Temp = (uint32_t)u8Channel * 4UL; + u32CNTRAddr = (uint32_t)(&TMR0x->CNTAR) + u32Temp; + u32CMPRAddr = (uint32_t)(&TMR0x->CMPAR) + u32Temp; + RW_MEM32(u32CNTRAddr) = pstcTmr0Init->u16CntValue; + RW_MEM32(u32CMPRAddr) = pstcTmr0Init->u16CmpValue; + + u32Temp = pstcTmr0Init->u32ClockDivision | \ + pstcTmr0Init->u32HwTrigFunc | \ + pstcTmr0Init->u32Tmr0Func; + + u8Channel *= TMR0_CHB_POS; + /* Config mode, clock source */ + MODIFY_REG32(TMR0x->BCONR, (TMR0_BCONR_INIT_MSK << u8Channel), (u32Temp << u8Channel)); + /* Config clock mode */ + MODIFY_REG32(TMR0x->BCONR, (TMR0_CHA_CLKSRC_MSK << u8Channel), (pstcTmr0Init->u32ClockSource << u8Channel)); + } + return enRet; +} + +/** + * @brief Set clock source. + * @param [in] TMR0x Pointer to TMR0 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR0_1: TMR0 unit 1 instance register base + * @arg M4_TMR0_2: TMR0 unit 2 instance register base + * @param [in] u8Channel TMR0_ChannelA or TMR0_ChannelB + * @arg TMR0_CH_A. + * @arg TMR0_CH_B. + * @param [in] u32ClkSrc Specifies the clock source + * This parameter can be a value of the following: + * @arg TMR0_CLK_SRC_PCLK1: Synchronous clock source: PCLK1. + * @arg TMR0_CLK_SRC_INTHWTRIG: Synchronous clock source: Hardware Trigger Event. + * @arg TMR0_CLK_SRC_XTAL32: Asynchronous clock source: XTAl32 + * @arg TMR0_CLK_SRC_LRC: Asynchronous clock source: LRC + * @retval None. + * @note In asynchronous clock, continuous operation of the BCONR register requires waiting for 3 asynchronous clocks. + */ +void TMR0_SetClkSrc(M4_TMR0_TypeDef *TMR0x, uint8_t u8Channel, uint32_t u32ClkSrc) +{ + DDL_ASSERT(IS_VALID_UNIT(TMR0x)); + DDL_ASSERT(IS_VALID_CHANNEL(u8Channel)); + DDL_ASSERT(IS_VALID_CLK_SRC(u32ClkSrc)); + + u8Channel = TMR0_OFFEST(u8Channel); + MODIFY_REG32(TMR0x->BCONR, (TMR0_CHA_CLKSRC_MSK << u8Channel), (u32ClkSrc << u8Channel)); +} + +/** + * @brief Set the division of the clock source. + * @param [in] TMR0x Pointer to TMR0 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR0_1: TMR0 unit 1 instance register base + * @arg M4_TMR0_2: TMR0 unit 2 instance register base + * @param [in] u8Channel TMR0_ChannelA or TMR0_ChannelB + * @arg TMR0_CH_A. + * @arg TMR0_CH_B. + * @param [in] u32ClkDiv Specifies the clock source division + * This parameter can be a value of the following: + * @arg TMR0_CLK_DIV1: Clock source. + * @arg TMR0_CLK_DIV2: Clock source / 2. + * @arg TMR0_CLK_DIV4: Clock source / 4. + * @arg TMR0_CLK_DIV8: Clock source / 8. + * @arg TMR0_CLK_DIV16: Clock source / 16. + * @arg TMR0_CLK_DIV32: Clock source / 32. + * @arg TMR0_CLK_DIV64: Clock source / 64. + * @arg TMR0_CLK_DIV128: Clock source / 128. + * @arg TMR0_CLK_DIV256: Clock source / 256. + * @arg TMR0_CLK_DIV512: Clock source / 512. + * @arg TMR0_CLK_DIV1024: Clock source / 1024. + * @retval None. + * @note In asynchronous clock, continuous operation of the BCONR register requires waiting for 3 asynchronous clocks. + */ +void TMR0_SetClkDiv(M4_TMR0_TypeDef *TMR0x, uint8_t u8Channel, uint32_t u32ClkDiv) +{ + DDL_ASSERT(IS_VALID_UNIT(TMR0x)); + DDL_ASSERT(IS_VALID_CHANNEL(u8Channel)); + DDL_ASSERT(IS_VALID_CLK_DIVISION(u32ClkDiv)); + + u8Channel = TMR0_OFFEST(u8Channel); + MODIFY_REG32(TMR0x->BCONR, (TMR0_BCONR_CKDIVA << u8Channel), (u32ClkDiv << u8Channel)); +} + +/** + * @brief Set Tmr0 HardWare Trigger Function + * @param [in] TMR0x Pointer to TMR0 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR0_1: TMR0 unit 1 instance register base + * @arg M4_TMR0_2: TMR0 unit 2 instance register base + * @param [in] u8Channel TMR0_ChannelA or TMR0_ChannelB + * @arg TMR0_CH_A. + * @arg TMR0_CH_B. + * @param [in] u32HWFunc Select TMR0 hardware trigger function + * This parameter can be a value of @ref TMR0_HardwareTrigger_Func_define + * @param [in] enNewState Disable or Enable the function + * @retval None + * @note In asynchronous clock, continuous operation of the BCONR register requires waiting for 3 asynchronous clocks. + */ +void TMR0_HWTrigCmd(M4_TMR0_TypeDef *TMR0x, uint8_t u8Channel, \ + uint32_t u32HWFunc, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_UNIT(TMR0x)); + DDL_ASSERT(IS_VALID_CHANNEL(u8Channel)); + DDL_ASSERT(IS_VALID_HWTRG_FUNC(u32HWFunc)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u8Channel = TMR0_OFFEST(u8Channel); + if(enNewState == Enable) + { + MODIFY_REG32(TMR0x->BCONR, (u32HWFunc << u8Channel), (u32HWFunc << u8Channel)); + } + else + { + CLEAR_REG32_BIT(TMR0x->BCONR, (u32HWFunc << u8Channel)); + } +} + +/** + * @brief Set Tmr0 Function + * @param [in] TMR0x Pointer to TMR0 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR0_1: TMR0 unit 1 instance register base + * @arg M4_TMR0_2: TMR0 unit 2 instance register base + * @param [in] u8Channel TMR0_CH_A or TMR0_CH_B + * @arg TMR0_CH_A. + * @arg TMR0_CH_B. + * @param [in] u32Func Select TMR0 function + * @arg TMR0_FUNC_CMP: Select the Compare function for TMR0 + * @arg TMR0_FUNC_CAP: Select the Capture function for TMR0 + * @retval None + * @note In asynchronous clock, continuous operation of the BCONR register requires waiting for 3 asynchronous clocks. + */ +void TMR0_SetFunc(M4_TMR0_TypeDef *TMR0x, uint8_t u8Channel, uint32_t u32Func) +{ + DDL_ASSERT(IS_VALID_UNIT(TMR0x)); + DDL_ASSERT(IS_VALID_CHANNEL(u8Channel)); + DDL_ASSERT(IS_VALID_TMR0_FUNC(u32Func)); + + u8Channel = TMR0_OFFEST(u8Channel); + MODIFY_REG32(TMR0x->BCONR, (TMR0_BCONR_CAPMDA << u8Channel), (u32Func << u8Channel)); +} + +/** + * @brief Get Tmr0 status (STFLR) + * @param [in] TMR0x Pointer to TMR0 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR0_1: TMR0 unit 1 instance register base + * @arg M4_TMR0_2: TMR0 unit 2 instance register base + * @param [in] u8Channel TMR0_CH_A or TMR0_CH_B + * @arg TMR0_CH_A. + * @arg TMR0_CH_B. + * @retval Set: Flag is set + * Reset: Flag is reset + */ +en_flag_status_t TMR0_GetStatus(const M4_TMR0_TypeDef* TMR0x, uint8_t u8Channel) +{ + en_flag_status_t enRet = Reset; + DDL_ASSERT(IS_VALID_UNIT(TMR0x)); + DDL_ASSERT(IS_VALID_CHANNEL(u8Channel)); + + u8Channel = TMR0_OFFEST(u8Channel); + if (READ_REG32_BIT(TMR0x->STFLR, (TMR0_STFLR_CMFA << u8Channel)) != 0U) + { + enRet = Set; + } + return enRet; +} + +/** + * @brief Clear Tmr0 status (STFLR) + * @param [in] TMR0x Pointer to TMR0 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR0_1: TMR0 unit 1 instance register base + * @arg M4_TMR0_2: TMR0 unit 2 instance register base + * @param [in] u8Channel TMR0_CH_A or TMR0_CH_B + * @arg TMR0_CH_A. + * @arg TMR0_CH_B. + * @retval None + * @note In asynchronous clock, continuous operation of the STFLR register requires waiting for 3 asynchronous clocks. + */ +void TMR0_ClearStatus(M4_TMR0_TypeDef* TMR0x, uint8_t u8Channel) +{ + DDL_ASSERT(IS_VALID_UNIT(TMR0x)); + DDL_ASSERT(IS_VALID_CHANNEL(u8Channel)); + + u8Channel = TMR0_OFFEST(u8Channel); + /*Clear the Flag*/ + CLEAR_REG32_BIT(TMR0x->STFLR, (TMR0_STFLR_CMFA << u8Channel)); +} + +/** + * @brief Command the tmr0 function + * @param [in] TMR0x Pointer to TMR0 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR0_1: TMR0 unit 1 instance register base + * @arg M4_TMR0_2: TMR0 unit 2 instance register base + * @param [in] u8Channel TMR0_CH_A or TMR0_CH_B + * @arg TMR0_CH_A. + * @arg TMR0_CH_B. + * @param [in] enNewState Disable or Enable the function + * @retval None + * @note In asynchronous clock, continuous operation of the BCONR register requires waiting for 3 asynchronous clocks. + */ +void TMR0_Cmd(M4_TMR0_TypeDef* TMR0x, uint8_t u8Channel, + en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_UNIT(TMR0x)); + DDL_ASSERT(IS_VALID_CHANNEL(u8Channel)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u8Channel = TMR0_OFFEST(u8Channel); + MODIFY_REG32(TMR0x->BCONR, (TMR0_BCONR_CSTA <BCONR, (TMR0_BCONR_INTENA << u8Channel), ((uint32_t)enNewState << TMR0_BCONR_INTENA_POS) << u8Channel); +} + +/** + * @brief Get Tmr0 counter value + * @param [in] TMR0x Pointer to TMR0 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR0_1: TMR0 unit 1 instance register base + * @arg M4_TMR0_2: TMR0 unit 2 instance register base + * @param [in] u8Channel TMR0_ChannelA or TMR0_ChannelB + * @arg TMR0_CH_A. + * @arg TMR0_CH_B. + * @retval In asynchronous clock, Get the value requires stop timer0 + * + */ +uint16_t TMR0_GetCntVal(const M4_TMR0_TypeDef* TMR0x, uint8_t u8Channel) +{ + uint16_t u16CntVal; + uint32_t u32CNTRAddr; + DDL_ASSERT(IS_VALID_UNIT(TMR0x)); + DDL_ASSERT(IS_VALID_CHANNEL(u8Channel)); + + u32CNTRAddr = (uint32_t)&TMR0x->CNTAR + (uint32_t)u8Channel * 4UL; + u16CntVal = (uint16_t)RW_MEM32(u32CNTRAddr); + return u16CntVal; +} + +/** + * @brief Set Tmr0 counter value + * @param [in] TMR0x Pointer to TMR0 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR0_1: TMR0 unit 1 instance register base + * @arg M4_TMR0_2: TMR0 unit 2 instance register base + * @param [in] u8Channel TMR0_CH_A or TMR0_CH_B + * @arg TMR0_CH_A. + * @arg TMR0_CH_B. + * @param [in] u16Value The data to write to the counter register + * @retval None + * @note Setting the count requires stop timer0 + */ +void TMR0_SetCntVal(M4_TMR0_TypeDef* TMR0x, uint8_t u8Channel, uint16_t u16Value) +{ + uint32_t u32CNTRAddr; + DDL_ASSERT(IS_VALID_UNIT(TMR0x)); + DDL_ASSERT(IS_VALID_CHANNEL(u8Channel)); + + u32CNTRAddr = (uint32_t)&TMR0x->CNTAR + (uint32_t)u8Channel * 4UL; + RW_MEM32(u32CNTRAddr) = (uint32_t)u16Value; +} + +/** + * @brief Get Tmr0 base compare value + * @param [in] TMR0x Pointer to TMR0 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR0_1: TMR0 unit 1 instance register base + * @arg M4_TMR0_2: TMR0 unit 2 instance register base + * @param [in] u8Channel TMR0_ChannelA or TMR0_ChannelB + * @arg TMR0_CH_A. + * @arg TMR0_CH_B. + * @retval In asynchronous clock, Get the value requires stop timer0 + */ +uint16_t TMR0_GetCmpVal(const M4_TMR0_TypeDef* TMR0x, uint8_t u8Channel) +{ + uint16_t u16CmpVal; + uint32_t u32CMPRAddr; + DDL_ASSERT(IS_VALID_UNIT(TMR0x)); + DDL_ASSERT(IS_VALID_CHANNEL(u8Channel)); + + u32CMPRAddr = (uint32_t)&TMR0x->CMPAR + (uint32_t)u8Channel * 4UL; + u16CmpVal = (uint16_t)RW_MEM32(u32CMPRAddr); + return u16CmpVal; +} + +/** + * @brief Set Tmr0 compare value + * @param [in] TMR0x Pointer to TMR0 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR0_1: TMR0 unit 1 instance register base + * @arg M4_TMR0_2: TMR0 unit 2 instance register base + * @param [in] u8Channel TMR0_ChannelA or TMR0_ChannelB + * @arg TMR0_CH_A. + * @arg TMR0_CH_B. + * @param [in] u16Value The data to write to the compare register + * @retval Setting the count requires stop timer0 + */ +void TMR0_SetCmpVal(M4_TMR0_TypeDef* TMR0x, uint8_t u8Channel, uint16_t u16Value) +{ + uint32_t u32CMPRAddr; + DDL_ASSERT(IS_VALID_UNIT(TMR0x)); + DDL_ASSERT(IS_VALID_CHANNEL(u8Channel)); + + u32CMPRAddr = (uint32_t)&TMR0x->CMPAR + (uint32_t)u8Channel * 4UL; + RW_MEM32(u32CMPRAddr) = (uint32_t)u16Value; +} + +/** + * @brief De-Initialize TMR0 function + * @param [in] TMR0x Pointer to TMR0 instance register base. + * This parameter can be value of the following: + * @arg M4_TMR0_1: TMR0 unit 1 instance register base + * @arg M4_TMR0_2: TMR0 unit 2 instance register base + * @retval None + */ +void TMR0_DeInit(M4_TMR0_TypeDef* TMR0x) +{ + DDL_ASSERT(IS_VALID_UNIT(TMR0x)); + + WRITE_REG32(TMR0x->CMPAR, 0x0000FFFFUL); + WRITE_REG32(TMR0x->CMPBR, 0x0000FFFFUL); + WRITE_REG32(TMR0x->CNTAR, 0UL); + WRITE_REG32(TMR0x->CNTBR, 0UL); + WRITE_REG32(TMR0x->STFLR, 0UL); + WRITE_REG32(TMR0x->BCONR, 0UL); +} + +/** + * @brief Enable or Disable common trigger source for Tmr0 + * @param [in] u32ComTrig Common trigger event enable bit mask. + * This parameter can be value of @ref TMR0_Common_Trigger_Sel + * @arg TMR0_COM_TRIG1: Common trigger source 1. + * @arg TMR0_COM_TRIG2: Common trigger source 2. + * @param [in] enNewState Disable or Enable the function + * @retval None + */ +void TMR0_ComTriggerCmd(uint32_t u32ComTrig, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_VALID_TMR0_COM_TRIG(u32ComTrig)); + + if (enNewState == Enable) + { + SET_REG32_BIT(M4_AOS->TMR0_HTSSR, u32ComTrig); + } + else + { + CLEAR_REG32_BIT(M4_AOS->TMR0_HTSSR, u32ComTrig); + } +} + +/** + * @brief Set trigger source for Tmr0 + * @param [in] enEvent External event source, @ref en_event_src_t + * @retval None + */ +void TMR0_SetTriggerSrc(en_event_src_t enEvent) +{ + MODIFY_REG32(M4_AOS->TMR0_HTSSR, AOS_TMR0_HTSSR_TRGSEL, (uint32_t)enEvent); +} + +/** + * @} +*/ + +#endif /* DDL_TMR0_ENABLE */ + +/** + * @} +*/ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmr2.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmr2.c new file mode 100644 index 0000000000..c241c58540 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmr2.c @@ -0,0 +1,1129 @@ +/** + ******************************************************************************* + * @file hc32f4a0_tmr2.c + * @brief This file provides firmware functions to manage the TMR2(Timer2). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Wuze First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_tmr2.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_TMR2 TMR2 + * @brief TMR2 Driver Library + * @{ + */ +#if (DDL_TMR2_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup TMR2_Local_Macros TMR2 Local Macros + * @{ + */ + +/** + * @defgroup TMR2_Configuration_Bit_Mask TMR2 Configuration Bit Mask + * @{ + */ +#define TMR2_BCONR_INIT_MSK (TMR2_BCONR_CAPMDA | TMR2_BCONR_SYNSA | TMR2_BCONR_SYNCLKA | TMR2_BCONR_ASYNCLKA | \ + TMR2_BCONR_CKDIVA | TMR2_BCONR_SYNCLKAT_0 | TMR2_BCONR_SYNCLKAT_1) +#define TMR2_FUNC_MODE_MSK (TMR2_BCONR_CAPMDA) +#define TMR2_CLK_SRC_MSK (TMR2_BCONR_SYNSA |TMR2_BCONR_SYNCLKA |TMR2_BCONR_ASYNCLKA | TMR2_BCONR_SYNCLKAT_0 | \ + TMR2_BCONR_SYNCLKAT_1) +#define TMR2_CLK_DIV_MSK (TMR2_BCONR_CKDIVA) +#define TMR2_PWM_START_POLARITY_MSK (TMR2_PCONR_STACA) +#define TMR2_PWM_STOP_POLARITY_MSK (TMR2_PCONR_STPCA) +#define TMR2_PWM_CMP_POLARITY_MSK (TMR2_PCONR_CMPCA) +#define TMR2_PWM_POLARITY_MSK (TMR2_PCONR_STACA | TMR2_PCONR_STPCA | TMR2_PCONR_CMPCA) +#define TMR2_FILTER_CLK_DIV_MSK (TMR2_PCONR_NOFICKA) +#define TMR2_START_COND_MSK (TMR2_HCONR_HSTAA0 | TMR2_HCONR_HSTAA1 | TMR2_HCONR_HSTAA2) +#define TMR2_STOP_COND_MSK (TMR2_HCONR_HSTPA0 | TMR2_HCONR_HSTPA1 | TMR2_HCONR_HSTPA2) +#define TMR2_CLR_COND_MSK (TMR2_HCONR_HCLEA0 | TMR2_HCONR_HCLEA1 | TMR2_HCONR_HCLEA2) +#define TMR2_CAPT_COND_MSK (TMR2_HCONR_HICPA0 | TMR2_HCONR_HICPA1 | TMR2_HCONR_HICPA2) +#define TMR2_TRIG_COND_MSK (TMR2_START_COND_MSK | TMR2_STOP_COND_MSK | TMR2_CLR_COND_MSK | TMR2_CAPT_COND_MSK) +#define TMR2_INT_TYPE_MSK (TMR2_ICONR_CMENA | TMR2_ICONR_OVENA) +#define TMR2_COM_TRIG_MSK (TMR2_COM_TRIG1 | TMR2_COM_TRIG2) +#define TMR2_TRIG_EVENT_MSK (AOS_TMR2_HTSSR_TRGSEL) +/** + * @} + */ + +/** + * @defgroup TMR2_Channel_Cfg_Bit_Field_Offset TMR2 Channel Configuration Bit Field Offset + * @{ + */ +#define TMR2_BCONR_OFFSET (TMR2_BCONR_CSTB_POS) +#define TMR2_ICONR_OFFSET (TMR2_ICONR_CMENB_POS) +#define TMR2_PCONR_OFFSET (TMR2_PCONR_STACB_POS) +#define TMR2_HCONR_OFFSET (TMR2_HCONR_HSTAB0_POS) +/** + * @} + */ + +/** + * @defgroup TMR2_Register_Bit_Band TMR2 Register Bit Band + * @{ + */ +#define __BIT_BAND_BASE (0x42000000UL) +#define __PERIP_BASE (0x40000000UL) +#define __REG_OFS(regAddr) ((regAddr) - __PERIP_BASE) +#define __BIT_BAND_ADDR(regAddr, pos) ((__REG_OFS(regAddr) << 5U) + ((uint32_t)(pos) << 2U) + __BIT_BAND_BASE) +#define BIT_BAND(regAddr, pos) (*(__IO uint32_t *)__BIT_BAND_ADDR((regAddr), (pos))) +/** + * @} + */ + +/** + * @defgroup TMR2_Check_Parameters_Validity TMR2 check parameters validity + * @{ + */ +#define IS_TMR2_UNIT(x) \ +( ((x) == M4_TMR2_1) || \ + ((x) == M4_TMR2_2) || \ + ((x) == M4_TMR2_3) || \ + ((x) == M4_TMR2_4)) + +#define IS_TMR2_CH(x) \ +( ((x) <= TMR2_CH_B)) + +#define IS_TMR2_FUNC_MODE(x) \ +( ((x) == TMR2_FUNC_COMPARE) || \ + ((x) == TMR2_FUNC_CAPTURE)) + +#define IS_TMR2_CLK_SRC(x) \ +( ((x) == TMR2_CLK_SYNC_PCLK1) || \ + ((x) == TMR2_CLK_SYNC_TRIGR) || \ + ((x) == TMR2_CLK_SYNC_TRIGF) || \ + ((x) == TMR2_CLK_SYNC_EVENT) || \ + ((x) == TMR2_CLK_SYNC_TIMER6_OVF) || \ + ((x) == TMR2_CLK_SYNC_TIMER6_UDF) || \ + ((x) == TMR2_CLK_ASYNC_LRC) || \ + ((x) == TMR2_CLK_ASYNC_XTAL32) || \ + ((x) == TMR2_CLK_ASYNC_PIN_CLK)) + +#define IS_TMR2_STATUS_FLAG(x) \ +( ((x) == TMR2_FLAG_CMP) || \ + ((x) == TMR2_FLAG_OVF)) + +#define IS_TMR2_CLK_DIV(x) \ +( ((x) == TMR2_CLK_DIV1) || \ + ((x) == TMR2_CLK_DIV2) || \ + ((x) == TMR2_CLK_DIV4) || \ + ((x) == TMR2_CLK_DIV8) || \ + ((x) == TMR2_CLK_DIV16) || \ + ((x) == TMR2_CLK_DIV32) || \ + ((x) == TMR2_CLK_DIV64) || \ + ((x) == TMR2_CLK_DIV128) || \ + ((x) == TMR2_CLK_DIV256) || \ + ((x) == TMR2_CLK_DIV512) || \ + ((x) == TMR2_CLK_DIV1024)) + +#define IS_TMR2_FILTER_CLK_DIV(x) \ +( ((x) == TMR2_FILTER_CLK_DIV1) || \ + ((x) == TMR2_FILTER_CLK_DIV4) || \ + ((x) == TMR2_FILTER_CLK_DIV16) || \ + ((x) == TMR2_FILTER_CLK_DIV64)) + +#define IS_TMR2_PWM_START_POLARITY(x) \ +( ((x) == TMR2_PWM_START_LOW) || \ + ((x) == TMR2_PWM_START_HIGH) || \ + ((x) == TMR2_PWM_START_KEEP)) + +#define IS_TMR2_PWM_STOP_POLARITY(x) \ +( ((x) == TMR2_PWM_STOP_LOW) || \ + ((x) == TMR2_PWM_STOP_HIGH) || \ + ((x) == TMR2_PWM_STOP_KEEP)) + +#define IS_TMR2_PWM_CMP_POLARITY(x) \ +( ((x) == TMR2_PWM_CMP_LOW) || \ + ((x) == TMR2_PWM_CMP_HIGH) || \ + ((x) == TMR2_PWM_CMP_KEEP) || \ + ((x) == TMR2_PWM_CMP_REVERSE)) + +#define IS_TMR2_COM_TRIGGER(x) \ +( ((x) != 0U) && \ + (((x) | TMR2_COM_TRIG_MSK) == TMR2_COM_TRIG_MSK)) + +#define IS_TMR2_VALID_VAL(x) \ +( (x) <= 0xFFFFUL) + +/** + * @} + */ + +/** + * @defgroup TMR2_Miscellaneous_Macros TMR2 Miscellaneous Macros + * @{ + */ +#define TMR2_CH_COUNT (2U) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup TMR2_Global_Functions TMR2 Global Functions + * @{ + */ + +/** + * @brief Initializes the specified TMR2 channel according to the specified parameters \ + * in the structure stc_tmr2_init_t + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel number of TMR2. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @param [in] pstcInit Pointer to a stc_tmr2_init_t structure value that \ + * contains the configuration information for the TMR2 channel. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcInit == NULL. + */ +en_result_t TMR2_Init(M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch, const stc_tmr2_init_t *pstcInit) +{ + uint32_t u32Temp; + uint32_t u32CMPRAddr; + uint32_t u32CNTRAddr; + en_result_t enRet = ErrorInvalidParameter; + + if (pstcInit != NULL) + { + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_CH(u8Tmr2Ch)); + DDL_ASSERT(IS_TMR2_FUNC_MODE(pstcInit->u32FuncMode)); + DDL_ASSERT(IS_TMR2_CLK_SRC(pstcInit->u32ClkSrc)); + DDL_ASSERT(IS_TMR2_CLK_DIV(pstcInit->u32ClkDiv)); + DDL_ASSERT(IS_TMR2_VALID_VAL(pstcInit->u32CmpVal)); + DDL_ASSERT(IS_TMR2_VALID_VAL(pstcInit->u32CntVal)); + + u32Temp = (uint32_t)u8Tmr2Ch * 4U; + u32CMPRAddr = (uint32_t)&TMR2x->CMPAR + u32Temp; + u32CNTRAddr = (uint32_t)&TMR2x->CNTAR + u32Temp; + RW_MEM32(u32CMPRAddr) = pstcInit->u32CmpVal; + RW_MEM32(u32CNTRAddr) = pstcInit->u32CntVal; + + u32Temp = pstcInit->u32FuncMode | \ + pstcInit->u32ClkSrc | \ + pstcInit->u32ClkDiv; + + /* Channel bit filed offset. */ + u8Tmr2Ch *= TMR2_BCONR_OFFSET; + MODIFY_REG32(TMR2x->BCONR, (TMR2_BCONR_INIT_MSK << u8Tmr2Ch), (u32Temp << u8Tmr2Ch)); + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set a default value for TMR2 initialization structure. + * @param [in] pstcInit Pointer to a stc_tmr2_init_t structure that + * contains configuration information. + * @retval An en_result_t enumeration type value. + * @arg Ok: No errors occurred. + * @arg ErrorInvalidParameter: pstcInit == NULL. + */ +en_result_t TMR2_StructInit(stc_tmr2_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (pstcInit != NULL) + { + pstcInit->u32FuncMode = TMR2_FUNC_COMPARE; + pstcInit->u32ClkSrc = TMR2_CLK_SYNC_PCLK1; + pstcInit->u32ClkDiv = TMR2_CLK_DIV1; + pstcInit->u32CmpVal = 0xFFFFUL; + pstcInit->u32CntVal = 0U; + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief De-initializes the specified TMR2 unit. + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @retval None + */ +void TMR2_DeInit(M4_TMR2_TypeDef *TMR2x) +{ + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + + TMR2_Stop(TMR2x, TMR2_CH_A); + TMR2_Stop(TMR2x, TMR2_CH_B); + + CLEAR_REG32(TMR2x->CNTAR); + CLEAR_REG32(TMR2x->CNTBR); + CLEAR_REG32(TMR2x->BCONR); + CLEAR_REG32(TMR2x->ICONR); + CLEAR_REG32(TMR2x->PCONR); + CLEAR_REG32(TMR2x->HCONR); + CLEAR_REG32(TMR2x->STFLR); + + WRITE_REG32(TMR2x->CMPAR, 0xFFFFU); + WRITE_REG32(TMR2x->CMPBR, 0xFFFFU); +} + +/** + * @brief Configures the specified channel's PWM output polarity according to the specified \ + * parameters in the structure stc_tmr2_pwm_cfg_t + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel number of TMR2. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @param [in] pstcCfg Pointer to a stc_tmr2_pwm_cfg_t structure value that contains \ + * the configuration information for the PWM output polarity. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcCfg == NULL. + */ +en_result_t TMR2_PWM_Config(M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch, const stc_tmr2_pwm_cfg_t *pstcCfg) +{ + uint32_t u32Cfg; + en_result_t enRet = ErrorInvalidParameter; + + if (pstcCfg != NULL) + { + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_CH(u8Tmr2Ch)); + DDL_ASSERT(IS_TMR2_PWM_START_POLARITY(pstcCfg->u32StartPolarity)); + DDL_ASSERT(IS_TMR2_PWM_STOP_POLARITY(pstcCfg->u32StopPolarity)); + DDL_ASSERT(IS_TMR2_PWM_CMP_POLARITY(pstcCfg->u32CmpPolarity)); + + u32Cfg = pstcCfg->u32StartPolarity | \ + pstcCfg->u32StopPolarity | \ + pstcCfg->u32CmpPolarity; + u8Tmr2Ch *= TMR2_PCONR_OFFSET; + MODIFY_REG32(TMR2x->PCONR, (TMR2_PWM_POLARITY_MSK << u8Tmr2Ch), (u32Cfg << u8Tmr2Ch)); + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set a default value for TMR2 PWM configuration structure. + * @param [in] pstcCfg Pointer to a stc_tmr2_pwm_cfg_t structure value that contains \ + * the configuration information for the PWM output polarity. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcCfg == NULL. + */ +en_result_t TMR2_PWM_StructInit(stc_tmr2_pwm_cfg_t *pstcCfg) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (pstcCfg != NULL) + { + pstcCfg->u32StartPolarity = TMR2_PWM_START_HIGH; + pstcCfg->u32StopPolarity = TMR2_PWM_STOP_LOW; + pstcCfg->u32CmpPolarity = TMR2_PWM_CMP_REVERSE; + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Enable or disable PWM output of the specified TMR2's channel. + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel number of TMR2. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @param [in] enNewState An @ref en_functional_state_t value. + * @arg Enable: Enable PWM output of the specified TMR2's channel. + * @arg Disable: Disable PWM output of the specified TMR2's channel. + * @retval None + */ +void TMR2_PWM_Cmd(M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch, en_functional_state_t enNewState) +{ + uint32_t u32Addr; + uint8_t au8EnPos[] = {TMR2_PCONR_OUTENA_POS, TMR2_PCONR_OUTENB_POS}; + + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_CH(u8Tmr2Ch)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32Addr = (uint32_t)&TMR2x->PCONR; + BIT_BAND(u32Addr, au8EnPos[u8Tmr2Ch]) = (uint32_t)enNewState; +} + +/** + * @brief Specify the channel's hardware trigger condition according to the specified \ + * parameters in the structure stc_tmr2_trig_cond_t + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel number of TMR2. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @param [in] pstcCond Pointer to a stc_tmr2_trig_cond_t structure value that contains \ + * the configuration information for the hardware condition. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcCond == NULL. + */ +en_result_t TMR2_SetTrigCond(M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch, const stc_tmr2_trig_cond_t *pstcCond) +{ + uint32_t u32Cfg; + en_result_t enRet = ErrorInvalidParameter; + + if (pstcCond != NULL) + { + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_CH(u8Tmr2Ch)); + + u32Cfg = (pstcCond->u32StartCond | \ + pstcCond->u32StopCond | \ + pstcCond->u32ClrCond | \ + pstcCond->u32CaptCond) & TMR2_TRIG_COND_MSK; + u8Tmr2Ch *= TMR2_HCONR_OFFSET; + MODIFY_REG32(TMR2x->HCONR, (TMR2_TRIG_COND_MSK << u8Tmr2Ch), (u32Cfg << u8Tmr2Ch)); + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set a default value for TMR2 hardware trigger condition structure. + * @param [in] pstcCond Pointer to a stc_tmr2_trig_cond_t structure value that contains \ + * the configuration information for the hardware condition. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcCond == NULL. + */ +en_result_t TMR2_TrigCondStructInit(stc_tmr2_trig_cond_t *pstcCond) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (pstcCond != NULL) + { + pstcCond->u32StartCond = TMR2_START_COND_INVALID; + pstcCond->u32StopCond = TMR2_STOP_COND_INVALID; + pstcCond->u32ClrCond = TMR2_CLR_COND_INVALID; + pstcCond->u32CaptCond = TMR2_CAPT_COND_INVALID; + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set trigger source for TMR2. + * @param [in] enEvent An en_event_src_t enumeration type value. + * @retval None + */ +void TMR2_SetTriggerSrc(en_event_src_t enEvent) +{ + MODIFY_REG32(M4_AOS->TMR2_HTSSR, TMR2_TRIG_EVENT_MSK, enEvent); +} + +/** + * @brief Enable or disable common trigger event for the specified usage. + * @param [in] u32ComTrig Common trigger event enable bit mask. + * This parameter can be a value of @ref TMR2_Common_Trigger_Sel + * @arg TMR2_COM_TRIG1: Common trigger 1. + * @arg TMR2_COM_TRIG2: Common trigger 2. + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable the specified common trigger. + * @arg Disable: Disable the specified common trigger. + * @retval None + */ +void TMR2_ComTriggerCmd(uint32_t u32ComTrig, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_TMR2_COM_TRIGGER(u32ComTrig)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (enNewState == Enable) + { + SET_REG32_BIT(M4_AOS->TMR2_HTSSR, u32ComTrig); + } + else + { + CLEAR_REG32_BIT(M4_AOS->TMR2_HTSSR, u32ComTrig); + } +} + +/** + * @brief Set clock divider for the filter of the specified TMR2's channel. + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel number of TMR2. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @param [in] u32ClkDiv Clock divider for the specified TMR2 unit channel filter. + * This parameter can be a value of @ref TMR2_Filter_Clock_Divider + * @arg TMR2_FILTER_CLK_DIV1: Clock source. + * @arg TMR2_FILTER_CLK_DIV4: Clock source / 4. + * @arg TMR2_FILTER_CLK_DIV16: Clock source / 16. + * @arg TMR2_FILTER_CLK_DIV64: Clock source / 64. + * @retval None + */ +void TMR2_FilterConfig(M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch, uint32_t u32ClkDiv) +{ + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_CH(u8Tmr2Ch)); + DDL_ASSERT(IS_TMR2_FILTER_CLK_DIV(u32ClkDiv)); + + u8Tmr2Ch *= TMR2_PCONR_OFFSET; + MODIFY_REG32(TMR2x->PCONR, \ + (TMR2_FILTER_CLK_DIV_MSK << u8Tmr2Ch), \ + (u32ClkDiv << u8Tmr2Ch)); +} + +/** + * @brief Enable or disable the filter of the specified TMR2's channel. + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel number of TMR2. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @param [in] enNewState An @ref en_functional_state_t value. + * @arg Enable: Enable the filter of the specified channel. + * @arg Disable: Disable the filter of the specified channel. + * @retval None + */ +void TMR2_FilterCmd(M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch, en_functional_state_t enNewState) +{ + uint32_t u32Addr; + uint8_t au8EnPos[] = {TMR2_PCONR_NOFIENA_POS, TMR2_PCONR_NOFIENB_POS}; + + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_CH(u8Tmr2Ch)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32Addr = (uint32_t)&TMR2x->PCONR; + BIT_BAND(u32Addr, au8EnPos[u8Tmr2Ch]) = (uint32_t)enNewState; +} + +/** + * @brief Enable or disable the interrupt of the specified TMR2's channel. + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel number of TMR2. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @param [in] u32IntType The interrupt type. + * This parameter can be a value(s) of @ref TMR2_Interrupt_Type + * @arg TMR2_INT_CMP: TMR2 count match interrupt. + * @arg TMR2_INT_OVF: TMR2 count overflow interrupt. + * @param [in] enNewState An @ref en_functional_state_t value. + * @arg Enable: Enable the specified interrupt. + * @arg Disable: Disable the specified interrupt. + * @retval None + */ +void TMR2_IntCmd(M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch, \ + uint32_t u32IntType, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_CH(u8Tmr2Ch)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u8Tmr2Ch *= TMR2_ICONR_OFFSET; + u32IntType &= TMR2_INT_TYPE_MSK; + u32IntType <<= u8Tmr2Ch; + + if (enNewState == Enable) + { + SET_REG32_BIT(TMR2x->ICONR, u32IntType); + } + else + { + CLEAR_REG32_BIT(TMR2x->ICONR, u32IntType); + } +} + +/** + * @brief Start the specified TMR2's channel. + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel number of TMR2. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @retval None + */ +void TMR2_Start(M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch) +{ + uint32_t au32Cfg[] = {TMR2_BCONR_CSTA, TMR2_BCONR_CSTB}; + + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_CH(u8Tmr2Ch)); + SET_REG32_BIT(TMR2x->BCONR, au32Cfg[u8Tmr2Ch]); +} + +/** + * @brief Stop the specified channel of the specified TMR2 unit. + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel number of TMR2. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @retval None + */ +void TMR2_Stop(M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch) +{ + uint32_t au32Cfg[] = {TMR2_BCONR_CSTA, TMR2_BCONR_CSTB}; + + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_CH(u8Tmr2Ch)); + CLEAR_REG32_BIT(TMR2x->BCONR, au32Cfg[u8Tmr2Ch]); +} + +/** + * @brief Get the specified flag's status of the specified TMR2's channel. + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel number of TMR2. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @param [in] u32Flag TMR2 state flag. + * This parameter can be values of @ref TMR2_State_Flag + * @arg TMR2_FLAG_CMP: Counting match flag. + * @arg TMR2_FLAG_OVF: Counting overflow flag. + * @retval An en_flag_status_t enumeration type value. + * @arg Set: At least one of the specified flags is set. + * @arg Reset: None of the specified flags is set. + */ +en_flag_status_t TMR2_GetStatus(const M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch, uint32_t u32Flag) +{ + en_flag_status_t enFlag = Reset; + + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_CH(u8Tmr2Ch)); + DDL_ASSERT(IS_TMR2_STATUS_FLAG(u32Flag)); + + u32Flag &= TMR2_FLAG_ALL; + u32Flag <<= ((uint32_t)u8Tmr2Ch * TMR2_ICONR_OFFSET); + if (READ_REG32_BIT(TMR2x->STFLR, u32Flag) != 0U) + { + enFlag = Set; + } + + return enFlag; +} + +/** + * @brief Clear the specified flag state of the specified TMR2's channel. + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel number of TMR2. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @param [in] u32Flag TMR2 state flag. + * This parameter can be values of @ref TMR2_State_Flag + * @arg TMR2_FLAG_CMP: Counter match flag of channel A/B. + * @arg TMR2_FLAG_OVF: Counter overflow flag of channel A/B. + * @retval None + */ +void TMR2_ClrStatus(M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch, uint32_t u32Flag) +{ + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_CH(u8Tmr2Ch)); + + /* Bit filed offset. */ + u8Tmr2Ch *= TMR2_ICONR_OFFSET; + u32Flag &= TMR2_FLAG_ALL; + u32Flag <<= u8Tmr2Ch; + CLEAR_REG32_BIT(TMR2x->STFLR, u32Flag); +} + +/** + * @brief Set compare value for the specified TMR2's channel. + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel number of TMR2. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @param [in] u32Val The compare reference value for the specified TMR2's channel. + * This parameter can be a number between 0U and 0xFFFFU, inclusive. + * @retval None + */ +void TMR2_SetCmpVal(M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch, uint32_t u32Val) +{ + uint32_t u32CMPRAddr; + + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_VALID_VAL(u32Val)); + u32CMPRAddr = (uint32_t)&TMR2x->CMPAR + (uint32_t)u8Tmr2Ch * 4U; + RW_MEM32(u32CMPRAddr) = u32Val; +} + +/** + * @brief Get compare value of the specified TMR2's channel. + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel number of TMR2. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @retval The compare value of the specified TMR2's channel. A number between 0U and 0xFFFFU, inclusive. + */ +uint32_t TMR2_GetCmpVal(M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch) +{ + uint32_t u32CMPRAddr; + + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_CH(u8Tmr2Ch)); + + u32CMPRAddr = (uint32_t)&TMR2x->CMPAR + (uint32_t)u8Tmr2Ch * 4U; + return RW_MEM32(u32CMPRAddr); +} + +/** + * @brief Set counter value for the specified channel of the specified TMR2 unit. + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel of the specified TMR2 unit. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @param [in] u32Val The counter value for the specified TMR2's channel. + * This parameter can be a number between 0U and 0xFFFFU, inclusive. + * @retval None + */ +void TMR2_SetCntVal(M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch, uint32_t u32Val) +{ + uint32_t u32CNTRAddr; + + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_CH(u8Tmr2Ch)); + DDL_ASSERT(IS_TMR2_VALID_VAL(u32Val)); + + u32CNTRAddr = (uint32_t)&TMR2x->CNTAR + (uint32_t)u8Tmr2Ch * 4U; + RW_MEM32(u32CNTRAddr) = u32Val; +} + +/** + * @brief Get counter value of the specified TMR2's channel. + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel number of TMR2. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @retval The counter value of the specified TMR2's channel. A number between 0U and 0xFFFFU, inclusive. + */ +uint32_t TMR2_GetCntVal(M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch) +{ + uint32_t u32CNTRAddr; + + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_CH(u8Tmr2Ch)); + u32CNTRAddr = (uint32_t)&TMR2x->CNTAR + (uint32_t)u8Tmr2Ch * 4U; + + return RW_MEM32(u32CNTRAddr); +} + +/** + * @brief Set function mode for the specified TMR2's channel. + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel number of TMR2. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @param [in] u32FuncMode Specifies the function for the specified TMR2's channel. + * This parameter can be a value of @ref TMR2_Function_Mode + * @arg TMR2_FUNC_COMPARE: Set the function of the specified channel of TMR2 unit as compare output. + * @arg TMR2_FUNC_CAPTURE: Set the function of the specified channel of TMR2 unit as capturing input. + * @retval None + */ +void TMR2_SetFuncMode(M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch, uint32_t u32FuncMode) +{ + uint32_t u32Msk; + uint32_t u32Cfg; + + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_CH(u8Tmr2Ch)); + DDL_ASSERT(IS_TMR2_FUNC_MODE(u32FuncMode)); + + /* Bit filed offset. */ + u8Tmr2Ch *= TMR2_BCONR_OFFSET; + u32Msk = TMR2_FUNC_MODE_MSK << u8Tmr2Ch; + u32Cfg = u32FuncMode << u8Tmr2Ch; + MODIFY_REG32(TMR2x->BCONR, u32Msk, u32Cfg); +} + +/** + * @brief Specify the clock source for the specified TMR2 channel. + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel number of TMR2. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @param [in] u32ClkSrc Specifies the clock source for the specified TMR2's channel. + * This parameter can be a value of @ref TMR2_Clock_Source + * @arg TMR2_SYNC_CLK_PCLK1: Synchronous clock source, PCLK1. + * @arg TMR2_SYNC_CLK_TRIG_RISE: Synchronous clock source, rising edge of TIM2_x_TRIGA/B. + * @arg TMR2_SYNC_CLK_TRIG_FALL: Synchronous clock source, falling edge of TIM2_x_TRIGA/B. + * @arg TMR2_SYNC_CLK_EVENT: Synchronous clock source, peripheral event. + * @arg TMR2_CLK_SYNC_TIMER6_OVF: Synchronous clock source, the event of counting overflow of TIMER6. \ + * It is NOT need to set register TMR2_HTSSR. + * @arg TMR2_CLK_SYNC_TIMER6_UDF: Synchronous clock source, the event of counting underflow of TIMER6. \ + * It is NOT need to set register TMR2_HTSSR. + * @arg TMR2_ASYNC_CLK_LRC: Asynchronous clock source, LRC. + * @arg TMR2_ASYNC_CLK_XTAL32: Asynchronous clock source, XTAL32. + * @arg TMR2_ASYNC_CLK_PIN_CLK: Asynchronous clock source, from pin TIM2_x_CLKA/B. + * @retval None + */ +void TMR2_SetClkSrc(M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch, uint32_t u32ClkSrc) +{ + uint32_t u32Msk; + uint32_t u32Cfg; + + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_CH(u8Tmr2Ch)); + DDL_ASSERT(IS_TMR2_CLK_SRC(u32ClkSrc)); + + /* Bit filed offset. */ + u8Tmr2Ch *= TMR2_BCONR_OFFSET; + u32Msk = TMR2_CLK_SRC_MSK << u8Tmr2Ch; + u32Cfg = u32ClkSrc << u8Tmr2Ch; + MODIFY_REG32(TMR2x->BCONR, u32Msk, u32Cfg); +} + +/** + * @brief Specify the division of the clock source for the specified TMR2 channel. + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel number of TMR2. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @param [in] u32ClkDiv Specifies the clock source division for the specified TMR2's channel. + * This parameter can be a value of @ref TMR2_Clock_Divider + * @arg TMR2_CLK_DIV1: Clock source. + * @arg TMR2_CLK_DIV2: Clock source / 2. + * @arg TMR2_CLK_DIV4: Clock source / 4. + * @arg TMR2_CLK_DIV8: Clock source / 8. + * @arg TMR2_CLK_DIV16: Clock source / 16. + * @arg TMR2_CLK_DIV32: Clock source / 32. + * @arg TMR2_CLK_DIV64: Clock source / 64. + * @arg TMR2_CLK_DIV128: Clock source / 128. + * @arg TMR2_CLK_DIV256: Clock source / 256. + * @arg TMR2_CLK_DIV512: Clock source / 512. + * @arg TMR2_CLK_DIV1024: Clock source / 1024. + * @retval None + */ +void TMR2_SetClkDiv(M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch, uint32_t u32ClkDiv) +{ + uint32_t u32Msk; + uint32_t u32Cfg; + + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_CH(u8Tmr2Ch)); + DDL_ASSERT(IS_TMR2_CLK_DIV(u32ClkDiv)); + + /* Bit filed offset. */ + u8Tmr2Ch *= TMR2_BCONR_OFFSET; + u32Msk = TMR2_CLK_DIV_MSK << u8Tmr2Ch; + u32Cfg = u32ClkDiv << u8Tmr2Ch; + MODIFY_REG32(TMR2x->BCONR, u32Msk, u32Cfg); +} + +/** + * @brief Enable or disable the specified trigger conditions of the specified TMR2 channel. + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel number of TMR2. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @param [in] u32Cond The specified conditions. + * This parameter can be a value of + * @ref TMR2_Hardware_Start_Condition \ + * @ref TMR2_Hardware_Stop_Condition \ + * @ref TMR2_Hardware_Clear_Condition \ + * @ref TMR2_Hardware_Capture_Condition + * @arg TMR2_START_COND_TRIG_RISE: The condition of start is the rising edge of TIM2_x_TRIGA/B. + * @arg TMR2_START_COND_TRIG_FALL: The condition of start is the falling edge of TIM2_x_TRIGA/B. + * @arg TMR2_START_COND_EVENT: The condition of start is the specified event occurred. + * @arg TMR2_STOP_COND_TRIG_RISE: The condition of stop is the rising edge of TIM2_x_TRIGA/B. + * @arg TMR2_STOP_COND_TRIG_FALL: The condition of stop is the falling edge of TIM2_x_TRIGA/B. + * @arg TMR2_STOP_COND_EVENT: The condition of stop is the specified event occurred. + * @arg TMR2_CLR_COND_TRIG_RISE: The condition of clear(clear CNTAR/CNTBR) is the rising edge of TIM2_x_TRIGA/B. + * @arg TMR2_CLR_COND_TRIG_FALL: The condition of clear(clear CNTAR/CNTBR) is the falling edge of TIM2_x_TRIGA/B. + * @arg TMR2_CLR_COND_EVENT: The condition of clear(clear CNTAR/CNTBR) is the specified event occurred. + * @arg TMR2_CAPT_COND_TRIG_RISE: The condition for capturing is the rising edge of TIM2_x_TRIGA/B. + * @arg TMR2_CAPT_COND_TRIG_FALL: The condition for capturing is the falling edge of TIM2_x_TRIGA/B. + * @arg TMR2_CAPT_COND_EVENT: The condition for capturing is the specified event occurred. + * @param [in] enNewState An @ref en_functional_state_t value. + * @arg Enable: Enable the sepcified trigger conditions. + * @arg Disable: Disable the sepcified trigger conditions. + * @retval None + */ +void TMR2_TrigCondCmd(M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch, uint32_t u32Cond, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_CH(u8Tmr2Ch)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32Cond &= TMR2_TRIG_COND_MSK; + u8Tmr2Ch *= TMR2_HCONR_OFFSET; + u32Cond <<= u8Tmr2Ch; + if (enNewState == Enable) + { + SET_REG32_BIT(TMR2x->HCONR, u32Cond); + } + else + { + CLEAR_REG32_BIT(TMR2x->HCONR, u32Cond); + } +} + +/** + * @brief Set PWM polarity when counting start for the specified TMR2's channel. + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel number of TMR2. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @param [in] u32Polarity Specifies the PWM start polarity for the specified TMR2's channel. + * This parameter can be a value of @ref TMR2_PWM_Start_Polarity + * @arg TMR2_PWM_START_LOW: PWM output low when counting start. + * @arg TMR2_PWM_START_HIGH: PWM output high when counting start. + * @arg TMR2_PWM_START_KEEP: PWM output keeps the current polarity when counting start. + * @retval None + */ +void TMR2_PWM_SetStartPolarity(M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch, uint32_t u32Polarity) +{ + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_CH(u8Tmr2Ch)); + DDL_ASSERT(IS_TMR2_PWM_START_POLARITY(u32Polarity)); + + u8Tmr2Ch *= TMR2_PCONR_OFFSET; + MODIFY_REG32(TMR2x->PCONR, \ + (TMR2_PWM_START_POLARITY_MSK << u8Tmr2Ch), \ + (u32Polarity << u8Tmr2Ch)); +} + +/** + * @brief Set PWM polarity when counting stop for the specified TMR2's channel. + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel number of TMR2. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @param [in] u32Polarity Specifies the PWM stop polarity for the specified TMR2's channel. + * This parameter can be a value of @ref TMR2_PWM_Stop_Polarity + * @arg TMR2_PWM_STOP_LOW: PWM output low when counting stop. + * @arg TMR2_PWM_STOP_HIGH: PWM output high when counting stop. + * @arg TMR2_PWM_STOP_KEEP: PWM output keeps the current polarity when counting stop. + * @retval None + */ +void TMR2_PWM_SetStopPolarity(M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch, uint32_t u32Polarity) +{ + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_CH(u8Tmr2Ch)); + DDL_ASSERT(IS_TMR2_PWM_STOP_POLARITY(u32Polarity)); + + u8Tmr2Ch *= TMR2_PCONR_OFFSET; + MODIFY_REG32(TMR2x->PCONR, \ + (TMR2_PWM_STOP_POLARITY_MSK << u8Tmr2Ch), \ + (u32Polarity << u8Tmr2Ch)); +} + +/** + * @brief Set PWM polarity when counting compare match for the specified TMR2's channel. + * @param [in] TMR2x Pointer to TMR2 instance register base. + * This parameter can be a value of the following: + * @arg M4_TMR2_1: TMR2 unit 1 instance register base. + * @arg M4_TMR2_2: TMR2 unit 2 instance register base. + * @arg M4_TMR2_3: TMR2 unit 3 instance register base. + * @arg M4_TMR2_4: TMR2 unit 4 instance register base. + * @param [in] u8Tmr2Ch The channel number of TMR2. + * This parameter can be a value of @ref TMR2_Channel_Number + * @arg TMR2_CH_A: Channel A of TMR2. + * @arg TMR2_CH_B: Channel B of TMR2. + * @param [in] u32Polarity Specifies the PWM count match polarity for the specified TMR2's channel. + * This parameter can be a value of @ref TMR2_PWM_Cmp_Polarity + * @arg TMR2_PWM_CMP_LOW: PWM output low when counting compare match. + * @arg TMR2_PWM_CMP_HIGH: PWM output high when counting compare match. + * @arg TMR2_PWM_CMP_KEEP: PWM output keeps the current polarity when counting compare match. + * @arg TMR2_PWM_CMP_REVERSE: PWM output reverses the current polarity when counting compare match. + * @retval None + */ +void TMR2_PWM_SetCmpPolarity(M4_TMR2_TypeDef *TMR2x, uint8_t u8Tmr2Ch, uint32_t u32Polarity) +{ + DDL_ASSERT(IS_TMR2_UNIT(TMR2x)); + DDL_ASSERT(IS_TMR2_CH(u8Tmr2Ch)); + DDL_ASSERT(IS_TMR2_PWM_CMP_POLARITY(u32Polarity)); + + u8Tmr2Ch *= TMR2_PCONR_OFFSET; + MODIFY_REG32(TMR2x->PCONR, \ + (TMR2_PWM_CMP_POLARITY_MSK << u8Tmr2Ch), \ + (u32Polarity << u8Tmr2Ch)); +} + +/** + * @} + */ + +#endif /* DDL_TMR2_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmr4.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmr4.c new file mode 100644 index 0000000000..ca65d042cf --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmr4.c @@ -0,0 +1,3256 @@ +/** + ******************************************************************************* + * @file hc32f4a0_tmr4.c + * @brief This file provides firmware functions to manage the TMR4(Timer4) + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Hongjh First version + 2020-07-15 Hongjh Modify error parameter assert condition for + the function TMR4_PWM_SetPclkDiv. + 2020-07-25 Hongjh Modify TMR4_OCO_SetLowChCompareMode function + comment:from TMR4_OCO_UH/VH/WH to TMR4_OCO_UL/VL/WL + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_tmr4.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_TMR4 TMR4 + * @brief TMR4 Driver Library + * @{ + */ + +#if (DDL_TMR4_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup TMR4_Local_Macros TMR4 Local Macros + * @{ + */ + +/** + * @defgroup TMR4_Check_Parameters_Validity TMR4 Check Parameters Validity + * @{ + */ + +#define IS_VALID_TMR4_INSTANCE(x) \ +( (M4_TMR4_1 == (x)) || \ + (M4_TMR4_2 == (x)) || \ + (M4_TMR4_3 == (x))) + +#define IS_VALID_TMR4_CNT_PCLK_DIV(x) \ +( (TMR4_CNT_PCLK_DIV1 == (x)) || \ + (TMR4_CNT_PCLK_DIV2 == (x)) || \ + (TMR4_CNT_PCLK_DIV4 == (x)) || \ + (TMR4_CNT_PCLK_DIV8 == (x)) || \ + (TMR4_CNT_PCLK_DIV16 == (x)) || \ + (TMR4_CNT_PCLK_DIV32 == (x)) || \ + (TMR4_CNT_PCLK_DIV64 == (x)) || \ + (TMR4_CNT_PCLK_DIV128 == (x)) || \ + (TMR4_CNT_PCLK_DIV256 == (x)) || \ + (TMR4_CNT_PCLK_DIV512 == (x)) || \ + (TMR4_CNT_PCLK_DIV1024 == (x))) + +#define IS_VALID_TMR4_CNT_MODE(x) \ +( (TMR4_CNT_MODE_SAWTOOTH_WAVE == (x)) || \ + (TMR4_CNT_MODE_TRIANGLE_WAVE == (x))) + +#define IS_VALID_TMR4_CNT_BUF_STATE(x) \ +( (TMR4_CNT_BUFFER_ENABLE == (x)) || \ + (TMR4_CNT_BUFFER_DISABLE == (x))) + +#define IS_VALID_TMR4_CNT_CLK_SRC(x) \ +( (TMR4_CNT_PCLK == (x)) || \ + (TMR4_CNT_EXTCLK == (x))) + +#define IS_VALID_TMR4_CNT_INT_MASKTIMES(x) \ +( (TMR4_CNT_INT_MASK_0 == (x)) || \ + (TMR4_CNT_INT_MASK_1 == (x)) || \ + (TMR4_CNT_INT_MASK_2 == (x)) || \ + (TMR4_CNT_INT_MASK_3 == (x)) || \ + (TMR4_CNT_INT_MASK_4 == (x)) || \ + (TMR4_CNT_INT_MASK_5 == (x)) || \ + (TMR4_CNT_INT_MASK_6 == (x)) || \ + (TMR4_CNT_INT_MASK_7 == (x)) || \ + (TMR4_CNT_INT_MASK_8 == (x)) || \ + (TMR4_CNT_INT_MASK_9 == (x)) || \ + (TMR4_CNT_INT_MASK_10 == (x)) || \ + (TMR4_CNT_INT_MASK_11 == (x)) || \ + (TMR4_CNT_INT_MASK_12 == (x)) || \ + (TMR4_CNT_INT_MASK_13 == (x)) || \ + (TMR4_CNT_INT_MASK_14 == (x)) || \ + (TMR4_CNT_INT_MASK_15 == (x))) + +#define IS_VALID_TMR4_CNT_INT(x) \ +( (0UL != (x)) && \ + (TMR4_CNT_INT_MASK == ((x) | TMR4_CNT_INT_MASK))) + +#define IS_VALID_TMR4_CNT_FLAG(x) \ +( (0UL != (x)) && \ + (TMR4_CNT_FLAG_MASK == ((x) | TMR4_CNT_FLAG_MASK))) + +#define IS_VALID_TMR4_OCO_CH(x) \ +( (TMR4_OCO_UH == (x)) || \ + (TMR4_OCO_UL == (x)) || \ + (TMR4_OCO_VH == (x)) || \ + (TMR4_OCO_VL == (x)) || \ + (TMR4_OCO_WH == (x)) || \ + (TMR4_OCO_WL == (x))) + +#define IS_VALID_TMR4_OCO_HIGH_CH(x) \ +( (TMR4_OCO_UH == (x)) || \ + (TMR4_OCO_VH == (x)) || \ + (TMR4_OCO_WH == (x))) + +#define IS_VALID_TMR4_OCO_LOW_CH(x) \ +( (TMR4_OCO_UL == (x)) || \ + (TMR4_OCO_VL == (x)) || \ + (TMR4_OCO_WL == (x))) + +#define IS_VALID_TMR4_OCO_STATE(x) \ +( (TMR4_OCO_DISABLE == (x)) || \ + (TMR4_OCO_ENABLE == (x))) + +#define IS_VALID_TMR4_OCO_EXTEND_MATCH(x) \ +( (TMR4_OCO_EXTEND_MATCH_DISABLE == (x)) || \ + (TMR4_OCO_EXTEND_MATCH_ENABLE == (x))) + +#define IS_VALID_TMR4_OCO_OCCR_LINK_TRANSFER(x) \ +( (TMR4_OCO_OCCR_LINK_TRANSFER_DISABLE == (x)) || \ + (TMR4_OCO_OCCR_LINK_TRANSFER_ENABLE == (x))) + +#define IS_VALID_TMR4_OCO_OCCR_BUF_MODE(x) \ +( (TMR4_OCO_OCCR_BUF_DISABLE == (x)) || \ + (TMR4_OCO_OCCR_BUF_CNT_ZERO == (x)) || \ + (TMR4_OCO_OCCR_BUF_CNT_PEAK == (x)) || \ + (TMR4_OCO_OCCR_BUF_CNT_ZERO_OR_PEAK == (x))) + +#define IS_VALID_TMR4_OCO_OCMR_LINK_TRANSFER(x) \ +( (TMR4_OCO_OCMR_LINK_TRANSFER_DISABLE == (x)) || \ + (TMR4_OCO_OCMR_LINK_TRANSFER_ENABLE == (x))) + +#define IS_VALID_TMR4_OCO_OCMR_BUF_MODE(x) \ +( (TMR4_OCO_OCMR_BUF_DISABLE == (x)) || \ + (TMR4_OCO_OCMR_BUF_CNT_ZERO == (x)) || \ + (TMR4_OCO_OCMR_BUF_CNT_PEAK == (x)) || \ + (TMR4_OCO_OCMR_BUF_CNT_ZERO_OR_PEAK == (x))) + +#define IS_VALID_TMR4_OCO_PORT_INVALID_OP(x) \ +( (TMR4_OCO_INVAILD_OP_LOW == (x)) || \ + (TMR4_OCO_INVAILD_OP_HIGH == (x))) + +#define IS_VALID_TMR4_OCO_OCF_STATE(x) \ +( (TMR4_OCO_OCF_HOLD == (x)) || \ + (TMR4_OCO_OCF_SET == (x))) + +#define IS_VALID_TMR4_OCO_OUTPUT_POLARITY(x) \ +( (TMR4_OCO_OP_HOLD == (x)) || \ + (TMR4_OCO_OP_HIGH == (x)) || \ + (TMR4_OCO_OP_LOW == (x)) || \ + (TMR4_OCO_OP_INVERT == (x))) + +#define IS_VALID_TMR4_PWM_CH(x) \ +( (TMR4_PWM_U == (x)) || \ + (TMR4_PWM_V == (x)) || \ + (TMR4_PWM_W == (x))) + +#define IS_VALID_TMR4_PWM_PORT(x) \ +( (TMR4_PWM_PORT_OUH == (x)) || \ + (TMR4_PWM_PORT_OUL == (x)) || \ + (TMR4_PWM_PORT_OVH == (x)) || \ + (TMR4_PWM_PORT_OVL == (x)) || \ + (TMR4_PWM_PORT_OWH == (x)) || \ + (TMR4_PWM_PORT_OWL == (x))) + +#define IS_VALID_TMR4_PWM_MODE(x) \ +( (TMR4_PWM_THROUGH_MODE == (x)) || \ + (TMR4_PWM_DEAD_TIMER_MODE == (x)) || \ + (TMR4_PWM_DEAD_TIMER_FILTER_MODE == (x))) + +#define IS_VALID_TMR4_PWM_TRANSFORM_OCO_POLARITY(x) \ +( (TMR4_PWM_OP_OXH_HOLD_OXL_HOLD == (x)) || \ + (TMR4_PWM_OP_OXH_INVERT_OXL_HOLD == (x)) || \ + (TMR4_PWM_OP_OXH_HOLD_OXL_INVERT == (x)) || \ + (TMR4_PWM_OP_OXH_INVERT_OXL_INVERT == (x))) + +#define IS_VALID_TMR4_PWM_PCLK_DIV(x) \ +( (TMR4_PWM_PCLK_DIV1 == (x)) || \ + (TMR4_PWM_PCLK_DIV2 == (x)) || \ + (TMR4_PWM_PCLK_DIV4 == (x)) || \ + (TMR4_PWM_PCLK_DIV8 == (x)) || \ + (TMR4_PWM_PCLK_DIV16 == (x)) || \ + (TMR4_PWM_PCLK_DIV32 == (x)) || \ + (TMR4_PWM_PCLK_DIV64 == (x)) || \ + (TMR4_PWM_PCLK_DIV128 == (x))) + +#define IS_VALID_TMR4_PWM_EMB_PORT_OUTPUT_STATE(x) \ +( (TMR4_PWM_EMB_PORT_OUTPUT_NORMAL == (x)) || \ + (TMR4_PWM_EMB_PORT_OUTPUT_HIZ == (x)) || \ + (TMR4_PWM_EMB_PORT_OUTPUT_LOW == (x)) || \ + (TMR4_PWM_EMB_PORT_OUTPUT_HIGH == (x))) + +#define IS_VALID_TMR4_PWM_PORT_ENBIT_EFFECT(x) \ +( (TMR4_PWM_PORT_ENBIT_EFFECT_IMMEDIATE == (x)) || \ + (TMR4_PWM_PORT_ENBIT_EFFECT_CNTUVF == (x)) || \ + (TMR4_PWM_PORT_ENBIT_EFFECT_CNTOVF == (x))) + +#define IS_VALID_TMR4_PWM_PORT_MODE(x) \ +( (TMR4_PWM_PORT_OUTPUT_OSxy == (x)) || \ + (TMR4_PWM_PORT_OUTPUT_NORMAL == (x))) + +#define IS_VALID_TMR4_SEVT_CH(x) \ +( (TMR4_SEVT_UH == (x)) || \ + (TMR4_SEVT_UL == (x)) || \ + (TMR4_SEVT_VH == (x)) || \ + (TMR4_SEVT_VL == (x)) || \ + (TMR4_SEVT_WH == (x)) || \ + (TMR4_SEVT_WL == (x))) + +#define IS_VALID_TMR4_SEVT_LINK_TRANSFER(x) \ +( (TMR4_SEVT_LINK_TRANSFER_DISABLE == (x)) || \ + (TMR4_SEVT_LINK_TRANSFER_ENABLE == (x))) + +#define IS_VALID_TMR4_SEVT_DOWN_SEL(x) \ +( (TMR4_SEVT_DOWN_DISABLE == (x)) || \ + (TMR4_SEVT_DOWN_ENABLE == (x))) + +#define IS_VALID_TMR4_SEVT_UP_SEL(x) \ +( (TMR4_SEVT_UP_DISABLE == (x)) || \ + (TMR4_SEVT_UP_ENABLE == (x))) + +#define IS_VALID_TMR4_SEVT_PEAK_SEL(x) \ +( (TMR4_SEVT_PEAK_DISABLE == (x)) || \ + (TMR4_SEVT_PEAK_ENABLE == (x))) + +#define IS_VALID_TMR4_SEVT_ZERO_SEL(x) \ +( (TMR4_SEVT_ZERO_DISABLE == (x)) || \ + (TMR4_SEVT_ZERO_ENABLE == (x))) + +#define IS_VALID_TMR4_SEVT_ZERO_MATCH_MASK_SEL(x) \ +( (TMR4_SEVT_ZERO_MATCH_MASK_DISABLE == (x)) || \ + (TMR4_SEVT_ZERO_MATCH_MASK_ENABLE == (x))) + +#define IS_VALID_TMR4_SEVT_PEAK_MATCH_MASK_SEL(x) \ +( (TMR4_SEVT_PEAK_MATCH_MASK_DISABLE == (x)) || \ + (TMR4_SEVT_PEAK_MATCH_MASK_ENABLE == (x))) + +#define IS_VALID_TMR4_SEVT_OBJECT(x) \ +( (TMR4_SEVT_DELAY_OCCRXH == (x)) || \ + (TMR4_SEVT_DELAY_OCCRXL == (x))) + +#define IS_VALID_TMR4_SEVT_MODE(x) \ +( (TMR4_SEVT_MODE_DELAY_TRIGGER == (x)) || \ + (TMR4_SEVT_MODE_COMPARE_TRIGGER == (x))) + +#define IS_VALID_TMR4_SEVT_MASK(x) \ +( (TMR4_SEVT_MASK_0 == (x)) || \ + (TMR4_SEVT_MASK_1 == (x)) || \ + (TMR4_SEVT_MASK_2 == (x)) || \ + (TMR4_SEVT_MASK_3 == (x)) || \ + (TMR4_SEVT_MASK_4 == (x)) || \ + (TMR4_SEVT_MASK_5 == (x)) || \ + (TMR4_SEVT_MASK_6 == (x)) || \ + (TMR4_SEVT_MASK_7 == (x)) || \ + (TMR4_SEVT_MASK_8 == (x)) || \ + (TMR4_SEVT_MASK_9 == (x)) || \ + (TMR4_SEVT_MASK_10 == (x)) || \ + (TMR4_SEVT_MASK_11 == (x)) || \ + (TMR4_SEVT_MASK_12 == (x)) || \ + (TMR4_SEVT_MASK_13 == (x)) || \ + (TMR4_SEVT_MASK_14 == (x)) || \ + (TMR4_SEVT_MASK_15 == (x))) + +#define IS_VALID_TMR4_SEVT_OUTPUT_EVENT(x) \ +( (TMR4_SEVT_OUTPUT_EVENT0 == (x)) || \ + (TMR4_SEVT_OUTPUT_EVENT1 == (x)) || \ + (TMR4_SEVT_OUTPUT_EVENT2 == (x)) || \ + (TMR4_SEVT_OUTPUT_EVENT3 == (x)) || \ + (TMR4_SEVT_OUTPUT_EVENT4 == (x)) || \ + (TMR4_SEVT_OUTPUT_EVENT5 == (x))) + +#define IS_VALID_TMR4_SEVT_BUF_MODE(x) \ +( (TMR4_SEVT_BUF_DISABLE == (x)) || \ + (TMR4_SEVT_BUF_CNT_ZERO == (x)) || \ + (TMR4_SEVT_BUF_CNT_PEAK == (x)) || \ + (TMR4_SEVT_BUF_CNT_ZERO_OR_PEAK == (x))) + +#define IS_VALID_TMR4_SEVT_PORT_OUTPUT_SIGNAL(x) \ +( (TMR4_SEVT_PORT_OUTPUT_NONE == (x)) || \ + (TMR4_SEVT_PORT_OUTPUT_EVENT0_SIGNAL == (x)) || \ + (TMR4_SEVT_PORT_OUTPUT_EVENT1_SIGNAL == (x)) || \ + (TMR4_SEVT_PORT_OUTPUT_EVENT2_SIGNAL == (x)) || \ + (TMR4_SEVT_PORT_OUTPUT_EVENT3_SIGNAL == (x)) || \ + (TMR4_SEVT_PORT_OUTPUT_EVENT4_SIGNAL == (x)) || \ + (TMR4_SEVT_PORT_OUTPUT_EVENT5_SIGNAL == (x))) +/** + * @} + */ + +/** + * @defgroup TMR4_Register_Address Get TMR4 register address + * @{ + */ +#define REG_ADDR(__REG__) ((uint32_t)(&(__REG__))) +/** + * @} + */ + +/** + * @defgroup TMR4_Register_Shift_Bits Get register value shift bit + * @{ + */ +#define SHIFT_1BIT(__CH__) ((uint16_t)((__CH__) % 2UL)) +#define SHIFT_2BIT(__CH__) ((uint16_t)(((__CH__) % 2UL) << 1UL)) +/** + * @} + */ + +/** + * @defgroup TMR4_OCO_Register TMR4 OCO Register + * @brief Get the specified OCO register address of the specified TMR4 unit + * @note __CH__ value is TMR4_OCO_xy (x=U/V/W, y=H/L) + * @{ + */ +#define TMR4_OCCRx(__TMR4x__, __CH__) ((__IO uint16_t *)(REG_ADDR((__TMR4x__)->OCCRUH) + (((uint32_t)(__CH__)) << 2UL))) +#define TMR4_OCMRx(__TMR4x__, __CH__) ((__IO uint16_t *)(REG_ADDR((__TMR4x__)->OCMRHUH) + (((uint32_t)(__CH__)) << 2UL))) +#define TMR4_OCERx(__TMR4x__, __CH__) ((__IO uint16_t *)(REG_ADDR((__TMR4x__)->OCERU) + ((((uint32_t)(__CH__)) & 0x06UL) << 1UL))) +#define TMR4_OCSRx(__TMR4x__, __CH__) ((__IO uint16_t *)(REG_ADDR((__TMR4x__)->OCSRU) + ((((uint32_t)(__CH__)) & 0x06UL) << 1UL))) +/** + * @} + */ + +/** + * @defgroup TMR4_OCSR_Bit_Mask TMR4_OCSR Bit Mask + * @brief Get the specified TMR4_OCSR register bis value of the specified TMR4 OCO channel + * @note __CH__ value is TMR4_OCO_xy (x=U/V/W, y=H/L) + * @{ + */ +#define TMR4_OCSR_OCEx_MASK(__CH__) ((uint16_t)(((uint16_t)TMR4_OCSR_OCEH) << SHIFT_1BIT(__CH__))) +#define TMR4_OCSR_OCPx_MASK(__CH__) ((uint16_t)(((uint16_t)TMR4_OCSR_OCPH) << SHIFT_1BIT(__CH__))) +#define TMR4_OCSR_OCIEx_MASK(__CH__) ((uint16_t)(((uint16_t)TMR4_OCSR_OCIEH) << SHIFT_1BIT(__CH__))) +#define TMR4_OCSR_OCFx_MASK(__CH__) ((uint16_t)(((uint16_t)TMR4_OCSR_OCFH) << SHIFT_1BIT(__CH__))) +#define TMR4_OCSR_MASK(__CH__) \ +( (uint16_t)((uint16_t)(TMR4_OCSR_OCEH | TMR4_OCSR_OCPH | TMR4_OCSR_OCIEH | TMR4_OCSR_OCFH)) << SHIFT_1BIT(__CH__)) +/** + * @} + */ + +/** + * @defgroup TMR4_OCSR_Bit TMR4_OCSR Bit + * @brief Get the specified TMR4_OCSR register bis value of the specified TMR4 OCO channel + * @note __CH__ value is TMR4_OCO_xy (x=U/V/W, y=H/L) + * @{ + */ +#define TMR4_OCSR_OCEx(__CH__,__OCEx__) ((uint16_t)(((uint16_t)__OCEx__) << SHIFT_1BIT(__CH__))) +#define TMR4_OCSR_OCPx(__CH__,__OCPx__) ((uint16_t)(((uint16_t)__OCPx__) << SHIFT_1BIT(__CH__))) +#define TMR4_OCSR_OCIEx(__CH__,__OCIEx__) ((uint16_t)(((uint16_t)__OCIEx__) << SHIFT_1BIT(__CH__))) +#define TMR4_OCSR_OCFx(__CH__,__OCFx__) ((uint16_t)(((uint16_t)__OCFx__) << SHIFT_1BIT(__CH__))) +/** + * @} + */ + +/** + * @defgroup TMR4_OCER_Bit_Mask TMR4_OCER Bit Mask + * @brief Get the specified TMR4_OCER register bis value of the specified TMR4 OCO channel + * @note __CH__ value is TMR4_OCO_xy (x=U/V/W, y=H/L) + * @{ + */ +#define TMR4_OCER_CxBUFEN_MASK(__CH__) ((uint16_t)(((uint16_t)TMR4_OCER_CHBUFEN) << SHIFT_2BIT(__CH__))) +#define TMR4_OCER_MxBUFEN_MASK(__CH__) ((uint16_t)(((uint16_t)TMR4_OCER_MHBUFEN) << SHIFT_2BIT(__CH__))) +#define TMR4_OCER_LMCx_MASK(__CH__) ((uint16_t)(((uint16_t)TMR4_OCER_LMCH) << SHIFT_1BIT(__CH__))) +#define TMR4_OCER_LMMx_MASK(__CH__) ((uint16_t)(((uint16_t)TMR4_OCER_LMMH) << SHIFT_1BIT(__CH__))) +#define TMR4_OCER_MCECx_MASK(__CH__) ((uint16_t)(((uint16_t)TMR4_OCER_MCECH) << SHIFT_1BIT(__CH__))) +#define TMR4_OCER_MASK(__CH__) \ +( (uint16_t)(((uint16_t)(TMR4_OCER_CHBUFEN | TMR4_OCER_MHBUFEN)) << SHIFT_2BIT(__CH__)) | \ + (uint16_t)(((uint16_t)(TMR4_OCER_LMCH | TMR4_OCER_LMMH | TMR4_OCER_MCECH)) << SHIFT_2BIT(__CH__))) +/** + * @} + */ + +/** + * @defgroup TMR4_OCER_Bit TMR4_OCER Bit + * @brief Get the specified TMR4_OCER register bis value of the specified TMR4 OCO channel + * @note __CH__ value is TMR4_OCO_xy (x=U/V/W, y=H/L) + * @{ + */ +#define TMR4_OCER_CxBUFEN(__CH__,__CxBUFEN__) ((uint16_t)((__CxBUFEN__) << SHIFT_2BIT(__CH__))) +#define TMR4_OCER_MxBUFEN(__CH__,__MxBUFEN__) ((uint16_t)((__MxBUFEN__) << SHIFT_2BIT(__CH__))) +#define TMR4_OCER_LMCx(__CH__,__LMCx__) ((uint16_t)((__LMCx__) << SHIFT_1BIT(__CH__))) +#define TMR4_OCER_LMMx(__CH__,__LMMx__) ((uint16_t)((__LMMx__) << SHIFT_1BIT(__CH__))) +#define TMR4_OCER_MCECx(__CH__,__MCECx__) ((uint16_t)((__MCECx__) << SHIFT_1BIT(__CH__))) +/** + * @} + */ + +/** + * @defgroup TMR4_PWM_Register TMR4 PWM Register + * @brief Get the specified PWM register address of the specified TMR4 unit + * @note __CH__ value is TMR4_PWM_x (x=U/V/W) + * @{ + */ +#define TMR4_RCSRx(__TMR4x__) ((__IO uint16_t *)(REG_ADDR((__TMR4x__)->RCSR))) +#define TMR4_POCRx(__TMR4x__, __CH__) ((__IO uint16_t *)(REG_ADDR((__TMR4x__)->POCRU) + (((uint32_t)(__CH__)) << 2UL))) +#define TMR4_PDARx(__TMR4x__, __CH__) ((__IO uint16_t *)(REG_ADDR((__TMR4x__)->PDARU) + (((uint32_t)(__CH__)) << 3UL))) +#define TMR4_PDBRx(__TMR4x__, __CH__) ((__IO uint16_t *)(REG_ADDR((__TMR4x__)->PDBRU) + (((uint32_t)(__CH__)) << 3UL))) +#define TMR4_PFSRx(__TMR4x__, __CH__) ((__IO uint16_t *)(REG_ADDR((__TMR4x__)->PFSRU) + (((uint32_t)(__CH__)) << 3UL))) +/** + * @} + */ + +/** + * @defgroup TMR4_RCSR_Bit_Mask TMR4_RCSR Bit Mask + * @brief Get the specified TMR4_RCSR register bis value of the specified TMR4 PWM channel + * @note __CH__ value is TMR4_PWM_x (x=U/V/W) + * @{ + */ +#define TMR4_RCSR_RTIDx_MASK(__CH__) ((uint16_t)(((uint16_t)TMR4_RCSR_RTIDU) << (__CH__))) +#define TMR4_RCSR_RTIFx_MASK(__CH__) ((uint16_t)(((uint16_t)TMR4_RCSR_RTIFU) << ((__CH__) << 2UL))) +#define TMR4_RCSR_RTICx_MASK(__CH__) ((uint16_t)(((uint16_t)TMR4_RCSR_RTICU) << ((__CH__) << 2UL))) +#define TMR4_RCSR_RTEx_MASK(__CH__) ((uint16_t)(((uint16_t)TMR4_RCSR_RTEU) << ((__CH__) << 2UL))) +#define TMR4_RCSR_RTSx_MASK(__CH__) ((uint16_t)(((uint16_t)TMR4_RCSR_RTSU) << ((__CH__) << 2UL))) +/** + * @} + */ + +/** + * @defgroup TMR4_PSCR_Bit_Mask TMR4_PSCR Bit Mask + * @brief Get the specified TMR4_PSCR register bis value of the specified TMR4 PWM port channel + * @note __PORT__ value is TMR4_PWM_PORT_Oxy (x=U/V/W, y=H/L) + * @{ + */ +#define TMR4_PSCR_OExy_MASK(__PORT__) (TMR4_PSCR_OEUH << (__PORT__)) +#define TMR4_PSCR_OSxy_MASK(__PORT__) (TMR4_PSCR_OSUH << ((__PORT__) * 2UL)) +/** + * @} + */ + +/** + * @defgroup TMR4_PSCR_Bit TMR4_PSCR Bit + * @brief Get the specified TMR4_PSCR register bis value of the specified TMR4 PWM port channel + * @note __PORT__ value is TMR4_PWM_PORT_Oxy (x=U/V/W, y=H/L) + * @{ + */ +#define TMR4_PSCR_OExy(__PORT__, __OExy__) ((__OExy__) << (__PORT__)) +#define TMR4_PSCR_OSxy(__PORT__, __OSxy__) ((__OSxy__) << ((__PORT__) * 2UL)) +/** + * @} + */ + +/** + * @defgroup TMR4_SEVT_Register TMR4 SEVT Register + * @brief Get the specified SEVT register address of the specified TMR4 unit + * @note __CH__ value is TMR4_SEVT_xy (x=U/V/W, y=H/L) + * @{ + */ +#define TMR4_SCCRx(__TMR4x__, __CH__) ((__IO uint16_t *)(REG_ADDR((__TMR4x__)->SCCRUH) + ((__CH__) << 2UL))) +#define TMR4_SCSRx(__TMR4x__, __CH__) ((__IO uint16_t *)(REG_ADDR((__TMR4x__)->SCSRUH) + ((__CH__) << 2UL))) +#define TMR4_SCMRx(__TMR4x__, __CH__) ((__IO uint16_t *)(REG_ADDR((__TMR4x__)->SCMRUH) + ((__CH__) << 2UL))) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ + +/** + * @defgroup TMR4_Global_Functions TMR4 Global Functions + * @{ + */ + +/** + * @defgroup TMR4_CNT_Global_Functions TMR4 Counter Global Functions + * @{ + */ + +/** + * @brief Initialize TMR4 counter. + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] pstcInit Pointer to a @ref stc_tmr4_cnt_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: pstcInit = NULL + */ +en_result_t TMR4_CNT_Init(M4_TMR4_TypeDef *TMR4x, + const stc_tmr4_cnt_init_t *pstcInit) +{ + uint16_t u16Val; + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_CNT_BUF_STATE(pstcInit->u16BufState)); + DDL_ASSERT(IS_VALID_TMR4_CNT_MODE(pstcInit->u16CntMode)); + DDL_ASSERT(IS_VALID_TMR4_CNT_PCLK_DIV(pstcInit->u16PclkDiv)); + DDL_ASSERT(IS_VALID_TMR4_CNT_CLK_SRC(pstcInit->u16ClkSrc)); + DDL_ASSERT(IS_VALID_TMR4_CNT_INT_MASKTIMES(pstcInit->u16ZeroIntMask)); + DDL_ASSERT(IS_VALID_TMR4_CNT_INT_MASKTIMES(pstcInit->u16PeakIntMask)); + + /* Set default value */ + WRITE_REG16(TMR4x->CCSR, 0x0050U); + WRITE_REG16(TMR4x->CVPR, 0x0000U); + + /* Set count clock div && cnt mode && buffer enable bit && + external clock enable bit && interrupt enable bit */ + u16Val = (pstcInit->u16PclkDiv | \ + pstcInit->u16ClkSrc | \ + pstcInit->u16CntMode | \ + TMR4_CCSR_STOP | \ + pstcInit->u16BufState); + WRITE_REG16(TMR4x->CCSR, u16Val); + + /* set interrupt mask times */ + u16Val = (((uint16_t)(pstcInit->u16ZeroIntMask << TMR4_CVPR_ZIM_POS)) | \ + ((uint16_t)(pstcInit->u16PeakIntMask << TMR4_CVPR_PIM_POS))); + WRITE_REG16(TMR4x->CVPR, u16Val); + + /* Set TMR4 cycle */ + WRITE_REG16(TMR4x->CPSR, pstcInit->u16CycleVal); + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_tmr4_cnt_init_t to default values + * @param [out] pstcInit Pointer to a @ref stc_tmr4_cnt_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: pstcInit = NULL + */ +en_result_t TMR4_CNT_StructInit(stc_tmr4_cnt_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + pstcInit->u16CycleVal = 0xFFFFU; + pstcInit->u16CntMode = TMR4_CNT_MODE_SAWTOOTH_WAVE; + pstcInit->u16ClkSrc = TMR4_CNT_PCLK; + pstcInit->u16PclkDiv = TMR4_CNT_PCLK_DIV1; + pstcInit->u16ZeroIntMask = TMR4_CNT_INT_MASK_0; + pstcInit->u16PeakIntMask = TMR4_CNT_INT_MASK_0; + pstcInit->u16BufState = TMR4_CNT_BUFFER_DISABLE; + enRet = Ok; + } + + return enRet; +} + +/** + * @brief De-Initialize TMR4 counter function + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @retval None + */ +void TMR4_CNT_DeInit(M4_TMR4_TypeDef *TMR4x) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + + /* Configures the registers to reset value. */ + WRITE_REG16(TMR4x->CCSR, 0x0050U); + WRITE_REG16(TMR4x->CPSR, 0xFFFFU); + WRITE_REG16(TMR4x->CVPR, 0x0000U); +} + +/** + * @brief Set TMR4 counter clock source + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u16ClkSrc TMR4 CNT clock source + * This parameter can be one of the following values: + * @arg TMR4_CNT_PCLK: Uses the internal clock (PCLK) as counter's count clock + * @arg TMR4_CNT_EXTCLK: Uses an external input clock (EXCK) as counter's count clock + * @retval None + * @note The PCLK division function is valid when clock source is PCLK + */ +void TMR4_CNT_SetClock(M4_TMR4_TypeDef *TMR4x, uint16_t u16ClkSrc) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_CNT_CLK_SRC(u16ClkSrc)); + + /* Set external clock enable bit */ + MODIFY_REG16(TMR4x->CCSR, TMR4_CCSR_ECKEN, u16ClkSrc); +} + +/** + * @brief Get TMR4 counter clock source + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @retval Returned value can be one of the following values: + * @arg TMR4_CNT_PCLK: Uses the internal clock (PCLK) as counter's count clock + * @arg TMR4_CNT_EXTCLK: Uses an external input clock (EXCK) as counter's count clock + */ +uint16_t TMR4_CNT_GetClock(const M4_TMR4_TypeDef *TMR4x) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + + /* Get external clock enable bit */ + return READ_REG16_BIT(TMR4x->CCSR, TMR4_CCSR_ECKEN); +} + +/** + * @brief Set TMR4 counter clock division + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u16Div TMR4 clock division + * This parameter can be one of the following values: + * @arg TMR4_CNT_PCLK_DIV1: PCLK + * @arg TMR4_CNT_PCLK_DIV2: PCLK/2 + * @arg TMR4_CNT_PCLK_DIV4: PCLK/4 + * @arg TMR4_CNT_PCLK_DIV8: PCLK/8 + * @arg TMR4_CNT_PCLK_DIV16: PCLK/16 + * @arg TMR4_CNT_PCLK_DIV32: PCLK/32 + * @arg TMR4_CNT_PCLK_DIV64: PCLK/64 + * @arg TMR4_CNT_PCLK_DIV128: PCLK/128 + * @arg TMR4_CNT_PCLK_DIV256: PCLK/256 + * @arg TMR4_CNT_PCLK_DIV512: PCLK/512 + * @arg TMR4_CNT_PCLK_DIV1024: PCLK/1024 + * @retval None + * @note The PCLK division function is valid when clock source is PCLK + */ +void TMR4_CNT_SetPclkDiv(M4_TMR4_TypeDef *TMR4x, uint16_t u16Div) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_CNT_PCLK_DIV(u16Div)); + + MODIFY_REG16(TMR4x->CCSR, TMR4_CCSR_CKDIV, u16Div); +} + +/** + * @brief Get TMR4 counter clock division + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @retval Returned value can be one of the following values: + * @arg TMR4_CNT_PCLK_DIV1: PCLK + * @arg TMR4_CNT_PCLK_DIV2: PCLK/2 + * @arg TMR4_CNT_PCLK_DIV4: PCLK/4 + * @arg TMR4_CNT_PCLK_DIV8: PCLK/8 + * @arg TMR4_CNT_PCLK_DIV16: PCLK/16 + * @arg TMR4_CNT_PCLK_DIV32: PCLK/32 + * @arg TMR4_CNT_PCLK_DIV64: PCLK/64 + * @arg TMR4_CNT_PCLK_DIV128: PCLK/128 + * @arg TMR4_CNT_PCLK_DIV256: PCLK/256 + * @arg TMR4_CNT_PCLK_DIV512: PCLK/512 + * @arg TMR4_CNT_PCLK_DIV1024: PCLK/1024 + * @note The PCLK division function is valid when clock source is PCLK + */ +uint16_t TMR4_CNT_GetPclkDiv(const M4_TMR4_TypeDef *TMR4x) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + + return READ_REG16_BIT(TMR4x->CCSR, TMR4_CCSR_CKDIV); +} + +/** + * @brief Set TMR4 counter mode + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u16Mode TMR4 counter mode + * This parameter can be one of the following values: + * @arg TMR4_CNT_MODE_SAWTOOTH_WAVE: TMR4 count mode:sawtooth wave + * @arg TMR4_CNT_MODE_TRIANGLE_WAVE: TMR4 count mode:triangular wave + * @retval None + */ +void TMR4_CNT_SetMode(M4_TMR4_TypeDef *TMR4x, uint16_t u16Mode) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_CNT_MODE(u16Mode)); + + /* Set external clock enable bit */ + MODIFY_REG16(TMR4x->CCSR, TMR4_CCSR_MODE, u16Mode); +} + +/** + * @brief Get TMR4 counter mode + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @retval Returned value can be one of the following values: + * @arg TMR4_CNT_MODE_SAWTOOTH_WAVE: TMR4 count mode:sawtooth wave + * @arg TMR4_CNT_MODE_TRIANGLE_WAVE: TMR4 count mode:triangular wave + */ +uint16_t TMR4_CNT_GetMode(const M4_TMR4_TypeDef *TMR4x) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + + /* Get external clock enable bit */ + return READ_REG16_BIT(TMR4x->CCSR, TMR4_CCSR_MODE); +} + +/** + * @brief Get TMR4 counter flag + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u16Flag TMR4 flag + * This parameter can be any composed value of the following values: + * @arg TMR4_CNT_FLAG_PEAK: Overflow interrupt + * @arg TMR4_CNT_FLAG_ZERO: Underflow interrupt + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t TMR4_CNT_GetStatus(const M4_TMR4_TypeDef *TMR4x, + uint16_t u16Flag) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_CNT_FLAG(u16Flag)); + + return (READ_REG16_BIT(TMR4x->CCSR, u16Flag) != 0U) ? Set : Reset; +} + +/** + * @brief Clear TMR4 counter flag + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u16Flag TMR4 counter flag + * This parameter can be any composed value of the following values: + * @arg TMR4_CNT_FLAG_PEAK: Overflow interrupt + * @arg TMR4_CNT_FLAG_ZERO: Underflow interrupt + * @retval None + */ +void TMR4_CNT_ClearStatus(M4_TMR4_TypeDef *TMR4x, uint16_t u16Flag) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_CNT_FLAG(u16Flag)); + + CLEAR_REG16_BIT(TMR4x->CCSR, u16Flag); +} + +/** + * @brief Enable or disable specified TMR4 counter interrupt + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u16IntSource TMR4 interrupt source + * This parameter can be any composed value of the following values: + * @arg TMR4_CNT_INT_PEAK: Overflow interrupt + * @arg TMR4_CNT_INT_ZERO: Underflow interrupt + * @param [in] enNewState The function new state + * @arg This parameter can be: Enable or Disable + * @retval None + */ +void TMR4_CNT_IntCmd(M4_TMR4_TypeDef *TMR4x, + uint16_t u16IntSource, + en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_VALID_TMR4_CNT_INT(u16IntSource)); + + if (Enable == enNewState) + { + SET_REG16_BIT(TMR4x->CCSR, u16IntSource); + } + else + { + CLEAR_REG16_BIT(TMR4x->CCSR, u16IntSource); + } +} + +/** + * @brief Start TMR4 counter + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @retval None + */ +void TMR4_CNT_Start(M4_TMR4_TypeDef *TMR4x) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + + CLEAR_REG16_BIT(TMR4x->CCSR, TMR4_CCSR_STOP); +} + +/** + * @brief Stop TMR4 counter + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @retval None + */ +void TMR4_CNT_Stop(M4_TMR4_TypeDef *TMR4x) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + + SET_REG16_BIT(TMR4x->CCSR, TMR4_CCSR_STOP); +} + +/** + * @brief Set TMR4 counter cycle value + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u16CycleVal The TMR4 counter cycle value + * @arg number of 16bit + * @retval None + */ +void TMR4_CNT_SetCycleVal(M4_TMR4_TypeDef *TMR4x, uint16_t u16CycleVal) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + + WRITE_REG16(TMR4x->CPSR, u16CycleVal); +} + +/** + * @brief Get TMR4 counter cycle value + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @retval The cycle value of the TMR4 counter + */ +uint16_t TMR4_CNT_GetCycleVal(const M4_TMR4_TypeDef *TMR4x) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + + return READ_REG16(TMR4x->CPSR); +} + +/** + * @brief Clear TMR4 counter count value + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @retval None + */ +void TMR4_CNT_ClearCountVal(M4_TMR4_TypeDef *TMR4x) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + + SET_REG16_BIT(TMR4x->CCSR, TMR4_CCSR_CLEAR); +} + +/** + * @brief Set TMR4 counter count value + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u16CountVal The TMR4 counter count value + * @arg number of 16bit + * @retval None + */ +void TMR4_CNT_SetCountVal(M4_TMR4_TypeDef *TMR4x, uint16_t u16CountVal) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + + WRITE_REG16(TMR4x->CNTR, u16CountVal); +} + +/** + * @brief Get TMR4 counter count value + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @retval The count value of the TMR4 counter + */ +uint16_t TMR4_CNT_GetCountVal(const M4_TMR4_TypeDef *TMR4x) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + + return READ_REG16(TMR4x->CNTR); +} + +/** + * @brief Set TMR4 counter interrupt mask times + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u16IntSource TMR4 interrupt source + * This parameter can be one of the following values: + * @arg TMR4_CNT_INT_PEAK: Overflow interrupt + * @arg TMR4_CNT_INT_ZERO: Underflow interrupt + * @param [in] u16MaskTimes TMR4 counter interrupt mask times + * This parameter can be one of the following values: + * @arg TMR4_CNT_INT_MASK_0: Counter interrupt flag is always set(not masked) for every counter count at "0x0000" or peak + * @arg TMR4_CNT_INT_MASK_1: Counter interrupt flag is set once for 2 every counter counts at "0x0000" or peak (skiping 1 count) + * @arg TMR4_CNT_INT_MASK_2: Counter interrupt flag is set once for 3 every counter counts at "0x0000" or peak (skiping 2 count) + * @arg TMR4_CNT_INT_MASK_3: Counter interrupt flag is set once for 4 every counter counts at "0x0000" or peak (skiping 3 count) + * @arg TMR4_CNT_INT_MASK_4: Counter interrupt flag is set once for 5 every counter counts at "0x0000" or peak (skiping 4 count) + * @arg TMR4_CNT_INT_MASK_5: Counter interrupt flag is set once for 6 every counter counts at "0x0000" or peak (skiping 5 count) + * @arg TMR4_CNT_INT_MASK_6: Counter interrupt flag is set once for 7 every counter counts at "0x0000" or peak (skiping 6 count) + * @arg TMR4_CNT_INT_MASK_7: Counter interrupt flag is set once for 8 every counter counts at "0x0000" or peak (skiping 7 count) + * @arg TMR4_CNT_INT_MASK_8: Counter interrupt flag is set once for 9 every counter counts at "0x0000" or peak (skiping 8 count) + * @arg TMR4_CNT_INT_MASK_9: Counter interrupt flag is set once for 10 every counter counts at "0x0000" or peak (skiping 9 count) + * @arg TMR4_CNT_INT_MASK_10: Counter interrupt flag is set once for 11 every counter counts at "0x0000" or peak (skiping 10 count) + * @arg TMR4_CNT_INT_MASK_11: Counter interrupt flag is set once for 12 every counter counts at "0x0000" or peak (skiping 11 count) + * @arg TMR4_CNT_INT_MASK_12: Counter interrupt flag is set once for 13 every counter counts at "0x0000" or peak (skiping 12 count) + * @arg TMR4_CNT_INT_MASK_13: Counter interrupt flag is set once for 14 every counter counts at "0x0000" or peak (skiping 13 count) + * @arg TMR4_CNT_INT_MASK_14: Counter interrupt flag is set once for 15 every counter counts at "0x0000" or peak (skiping 14 count) + * @arg TMR4_CNT_INT_MASK_15: Counter interrupt flag is set once for 16 every counter counts at "0x0000" or peak (skiping 15 count) + * @retval An en_result_t enumeration value: + * - Ok: Set successfully + * - ErrorInvalidParameter: u16IntSource value is invalid + */ +en_result_t TMR4_CNT_SetIntMaskTimes(M4_TMR4_TypeDef *TMR4x, + uint16_t u16IntSource, + uint16_t u16MaskTimes) +{ + en_result_t enRet = Ok; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_CNT_INT_MASKTIMES(u16MaskTimes)); + + switch (u16IntSource) + { + case TMR4_CNT_INT_ZERO: + MODIFY_REG16(TMR4x->CVPR, TMR4_CVPR_ZIM, (uint16_t)(u16MaskTimes << TMR4_CVPR_ZIM_POS)); + break; + case TMR4_CNT_INT_PEAK: + MODIFY_REG16(TMR4x->CVPR, TMR4_CVPR_PIM, (uint16_t)(u16MaskTimes << TMR4_CVPR_PIM_POS)); + break; + default: + DDL_ASSERT(NULL); + enRet = ErrorInvalidParameter; + break; + } + + return enRet; +} + +/** + * @brief Get TMR4 CNT interrupt mask times + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u16IntSource TMR4 interrupt source + * This parameter can be one of the following values: + * @arg TMR4_CNT_INT_PEAK: Overflow interrupt + * @arg TMR4_CNT_INT_ZERO: Underflow interrupt + * @param [out] pu16MaskTimes The pointer for mask times + * This parameter can be one of the following values: + * @arg TMR4_CNT_INT_MASK_0: Counter interrupt flag is always set(not masked) for every counter count at "0x0000" or peak + * @arg TMR4_CNT_INT_MASK_1: Counter interrupt flag is set once for 2 every counter counts at "0x0000" or peak (skiping 1 count) + * @arg TMR4_CNT_INT_MASK_2: Counter interrupt flag is set once for 3 every counter counts at "0x0000" or peak (skiping 2 count) + * @arg TMR4_CNT_INT_MASK_3: Counter interrupt flag is set once for 4 every counter counts at "0x0000" or peak (skiping 3 count) + * @arg TMR4_CNT_INT_MASK_4: Counter interrupt flag is set once for 5 every counter counts at "0x0000" or peak (skiping 4 count) + * @arg TMR4_CNT_INT_MASK_5: Counter interrupt flag is set once for 6 every counter counts at "0x0000" or peak (skiping 5 count) + * @arg TMR4_CNT_INT_MASK_6: Counter interrupt flag is set once for 7 every counter counts at "0x0000" or peak (skiping 6 count) + * @arg TMR4_CNT_INT_MASK_7: Counter interrupt flag is set once for 8 every counter counts at "0x0000" or peak (skiping 7 count) + * @arg TMR4_CNT_INT_MASK_8: Counter interrupt flag is set once for 9 every counter counts at "0x0000" or peak (skiping 8 count) + * @arg TMR4_CNT_INT_MASK_9: Counter interrupt flag is set once for 10 every counter counts at "0x0000" or peak (skiping 9 count) + * @arg TMR4_CNT_INT_MASK_10: Counter interrupt flag is set once for 11 every counter counts at "0x0000" or peak (skiping 10 count) + * @arg TMR4_CNT_INT_MASK_11: Counter interrupt flag is set once for 12 every counter counts at "0x0000" or peak (skiping 11 count) + * @arg TMR4_CNT_INT_MASK_12: Counter interrupt flag is set once for 13 every counter counts at "0x0000" or peak (skiping 12 count) + * @arg TMR4_CNT_INT_MASK_13: Counter interrupt flag is set once for 14 every counter counts at "0x0000" or peak (skiping 13 count) + * @arg TMR4_CNT_INT_MASK_14: Counter interrupt flag is set once for 15 every counter counts at "0x0000" or peak (skiping 14 count) + * @arg TMR4_CNT_INT_MASK_15: Counter interrupt flag is set once for 16 every counter counts at "0x0000" or peak (skiping 15 count) + @retval An en_result_t enumeration value: + * - Ok: Set successfully + * - ErrorInvalidParameter: pu16MaskTimes = NULL or u16IntSource value is invalid + */ +en_result_t TMR4_CNT_GetIntMaskTimes(const M4_TMR4_TypeDef *TMR4x, + uint16_t u16IntSource, + uint16_t *pu16MaskTimes) +{ + en_result_t enRet = Ok; + + if (NULL == pu16MaskTimes) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + + switch (u16IntSource) + { + case TMR4_CNT_INT_ZERO: + *pu16MaskTimes = (uint16_t)(READ_REG16_BIT(TMR4x->CVPR, TMR4_CVPR_ZIM) >> TMR4_CVPR_ZIM_POS); + break; + case TMR4_CNT_INT_PEAK: + *pu16MaskTimes = (uint16_t)(READ_REG16_BIT(TMR4x->CVPR, TMR4_CVPR_PIM) >> TMR4_CVPR_PIM_POS); + break; + default: + DDL_ASSERT(NULL); + enRet = ErrorInvalidParameter; + break; + } + } + + return enRet; +} + +/** + * @brief Get TMR4 CNT interrupt mask current times + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u16IntSource TMR4 interrupt source + * This parameter can be one of the following values: + * @arg TMR4_CNT_INT_PEAK: Overflow interrupt + * @arg TMR4_CNT_INT_ZERO: Underflow interrupt + * @param [out] pu16MaskTimes The pointer for mask times + * This parameter can be one of the following values: + * @arg TMR4_CNT_INT_MASK_0: Counter interrupt flag is always set(not masked) for every counter count at "0x0000" or peak + * @arg TMR4_CNT_INT_MASK_1: Counter interrupt flag is set once for 2 every counter counts at "0x0000" or peak (skiping 1 count) + * @arg TMR4_CNT_INT_MASK_2: Counter interrupt flag is set once for 3 every counter counts at "0x0000" or peak (skiping 2 count) + * @arg TMR4_CNT_INT_MASK_3: Counter interrupt flag is set once for 4 every counter counts at "0x0000" or peak (skiping 3 count) + * @arg TMR4_CNT_INT_MASK_4: Counter interrupt flag is set once for 5 every counter counts at "0x0000" or peak (skiping 4 count) + * @arg TMR4_CNT_INT_MASK_5: Counter interrupt flag is set once for 6 every counter counts at "0x0000" or peak (skiping 5 count) + * @arg TMR4_CNT_INT_MASK_6: Counter interrupt flag is set once for 7 every counter counts at "0x0000" or peak (skiping 6 count) + * @arg TMR4_CNT_INT_MASK_7: Counter interrupt flag is set once for 8 every counter counts at "0x0000" or peak (skiping 7 count) + * @arg TMR4_CNT_INT_MASK_8: Counter interrupt flag is set once for 9 every counter counts at "0x0000" or peak (skiping 8 count) + * @arg TMR4_CNT_INT_MASK_9: Counter interrupt flag is set once for 10 every counter counts at "0x0000" or peak (skiping 9 count) + * @arg TMR4_CNT_INT_MASK_10: Counter interrupt flag is set once for 11 every counter counts at "0x0000" or peak (skiping 10 count) + * @arg TMR4_CNT_INT_MASK_11: Counter interrupt flag is set once for 12 every counter counts at "0x0000" or peak (skiping 11 count) + * @arg TMR4_CNT_INT_MASK_12: Counter interrupt flag is set once for 13 every counter counts at "0x0000" or peak (skiping 12 count) + * @arg TMR4_CNT_INT_MASK_13: Counter interrupt flag is set once for 14 every counter counts at "0x0000" or peak (skiping 13 count) + * @arg TMR4_CNT_INT_MASK_14: Counter interrupt flag is set once for 15 every counter counts at "0x0000" or peak (skiping 14 count) + * @arg TMR4_CNT_INT_MASK_15: Counter interrupt flag is set once for 16 every counter counts at "0x0000" or peak (skiping 15 count) + * @retval An en_result_t enumeration value: + * - Ok: Set successfully + * - ErrorInvalidParameter: pu16MaskTimes = NULL or u16IntSource value is invalid + */ +en_result_t TMR4_CNT_GetIntMaskCurrentTimes(const M4_TMR4_TypeDef *TMR4x, + uint16_t u16IntSource, + uint16_t *pu16MaskTimes) +{ + en_result_t enRet = Ok; + + if (NULL == pu16MaskTimes) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + + switch (u16IntSource) + { + case TMR4_CNT_INT_ZERO: + *pu16MaskTimes = (uint16_t)(READ_REG16_BIT(TMR4x->CVPR, TMR4_CVPR_ZIC) >> TMR4_CVPR_ZIC_POS); + break; + case TMR4_CNT_INT_PEAK: + *pu16MaskTimes = (uint16_t)(READ_REG16_BIT(TMR4x->CVPR, TMR4_CVPR_PIC) >> TMR4_CVPR_PIC_POS); + break; + default: + DDL_ASSERT(NULL); + enRet = ErrorInvalidParameter; + break; + } + } + + return enRet; +} + +/** + * @brief Set TMR4 count direction signal output to port + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] enNewState The function new state + * @arg This parameter can be: Enable or Disable + * @retval None + */ +void TMR4_CNT_PortOutputDirSigCmd(M4_TMR4_TypeDef *TMR4x, + en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG16_BIT(TMR4x->SCER, TMR4_SCER_PCTS); + } + else + { + CLEAR_REG16_BIT(TMR4x->SCER, TMR4_SCER_PCTS); + } +} + +/** + * @} + */ + +/** + * @defgroup TMR4_OCO_Global_Functions TMR4 OCO Global Functions + * @{ + */ + +/** + * @brief Initialize TMR4 OCO + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 OCO channel + * This parameter can be one of the following values: + * @arg TMR4_OCO_UH: TMR4 OCO channel - UH + * @arg TMR4_OCO_UL: TMR4 OCO channel - UL + * @arg TMR4_OCO_VH: TMR4 OCO channel - VH + * @arg TMR4_OCO_VL: TMR4 OCO channel - VL + * @arg TMR4_OCO_WH: TMR4 OCO channel - WH + * @arg TMR4_OCO_WL: TMR4 OCO channel - WL + * @param [in] pstcInit Pointer to a @ref stc_tmr4_oco_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: u32Ch is invalid or pstcInit = NULL + */ +en_result_t TMR4_OCO_Init(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + const stc_tmr4_oco_init_t *pstcInit) +{ + uint16_t u16Val; + __IO uint16_t *TMR4_OCER; + __IO uint16_t *TMR4_OCSR; + __IO uint16_t *TMR4_OCCR; + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_OCO_CH(u32Ch)); + DDL_ASSERT(IS_VALID_TMR4_OCO_STATE(pstcInit->u16OcoCmd)); + DDL_ASSERT(IS_VALID_TMR4_OCO_OCCR_LINK_TRANSFER(pstcInit->u16OccrLinkTransfer)); + DDL_ASSERT(IS_VALID_TMR4_OCO_OCMR_LINK_TRANSFER(pstcInit->u16OcmrLinkTransfer)); + DDL_ASSERT(IS_VALID_TMR4_OCO_OCCR_BUF_MODE(pstcInit->u16OccrBufMode)); + DDL_ASSERT(IS_VALID_TMR4_OCO_OCMR_BUF_MODE(pstcInit->u16OcmrBufMode)); + DDL_ASSERT(IS_VALID_TMR4_OCO_PORT_INVALID_OP(pstcInit->u16OcoInvalidOp)); + + /* Get pointer of current channel OCO register address */ + TMR4_OCSR = TMR4_OCSRx(TMR4x, u32Ch); + TMR4_OCER = TMR4_OCERx(TMR4x, u32Ch); + TMR4_OCCR = TMR4_OCCRx(TMR4x, u32Ch); + + /* Set port output valid && OP level && interrupt */ + u16Val = ((uint16_t)(pstcInit->u16OcoCmd << SHIFT_1BIT(u32Ch)) | \ + (uint16_t)(pstcInit->u16OcoInvalidOp << SHIFT_1BIT(u32Ch))); + MODIFY_REG16(*TMR4_OCSR, TMR4_OCSR_MASK(u32Ch), u16Val); + + /* Set OCMR&&OCCR buffer */ + u16Val = (TMR4_OCER_CxBUFEN(u32Ch, pstcInit->u16OccrBufMode) | \ + TMR4_OCER_MxBUFEN(u32Ch, pstcInit->u16OcmrBufMode) | \ + TMR4_OCER_LMCx(u32Ch, pstcInit->u16OccrLinkTransfer) | \ + TMR4_OCER_LMMx(u32Ch, pstcInit->u16OcmrLinkTransfer)); + MODIFY_REG16(*TMR4_OCER, TMR4_OCER_MASK(u32Ch), u16Val); + + /* Set OCO compare match value */ + WRITE_REG16(*TMR4_OCCR, pstcInit->u16CompareVal); + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_tmr4_oco_init_t to default values + * @param [out] pstcInit Pointer to a @ref stc_tmr4_oco_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: pstcInit = NULL + */ +en_result_t TMR4_OCO_StructInit(stc_tmr4_oco_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + pstcInit->u16OcoCmd = TMR4_OCO_ENABLE; + pstcInit->u16OccrLinkTransfer = TMR4_OCO_OCCR_LINK_TRANSFER_DISABLE; + pstcInit->u16OcmrLinkTransfer = TMR4_OCO_OCMR_LINK_TRANSFER_DISABLE; + pstcInit->u16OccrBufMode = TMR4_OCO_OCCR_BUF_DISABLE; + pstcInit->u16OcmrBufMode = TMR4_OCO_OCMR_BUF_DISABLE; + pstcInit->u16OcoInvalidOp = TMR4_OCO_INVAILD_OP_LOW; + enRet = Ok; + } + + return enRet; +} + +/** + * @brief De-initialize TMR4 OCO + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 OCO channel + * This parameter can be one of the following values: + * @arg TMR4_OCO_UH: TMR4 OCO channel - UH + * @arg TMR4_OCO_UL: TMR4 OCO channel - UL + * @arg TMR4_OCO_VH: TMR4 OCO channel - VH + * @arg TMR4_OCO_VL: TMR4 OCO channel - VL + * @arg TMR4_OCO_WH: TMR4 OCO channel - WH + * @arg TMR4_OCO_WL: TMR4 OCO channel - WL + * @retval None + */ +void TMR4_OCO_DeInit(M4_TMR4_TypeDef *TMR4x, uint32_t u32Ch) +{ + __IO uint16_t *TMR4_OCER; + __IO uint16_t *TMR4_OCSR; + __IO uint16_t *TMR4_OCCR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_OCO_CH(u32Ch)); + + /* Get pointer of current channel OCO register address */ + TMR4_OCSR = TMR4_OCSRx(TMR4x, u32Ch); + TMR4_OCER = TMR4_OCERx(TMR4x, u32Ch); + TMR4_OCCR = TMR4_OCCRx(TMR4x, u32Ch); + + /* Clear bits: port output valid && OP level && interrupt */ + CLEAR_REG16_BIT(*TMR4_OCSR, TMR4_OCSR_MASK(u32Ch)); + + /* Clear bits: OCMR&&OCCR buffer */ + CLEAR_REG16_BIT(*TMR4_OCER, TMR4_OCER_MASK(u32Ch)); + + /* Set OCO compare match value */ + WRITE_REG16(*TMR4_OCCR, 0x0000U); +} + +/** + * @brief Set TMR4 OCO OCCR buffer mode + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 OCO channel + * This parameter can be one of the following values: + * @arg TMR4_OCO_UH: TMR4 OCO channel - UH + * @arg TMR4_OCO_UL: TMR4 OCO channel - UL + * @arg TMR4_OCO_VH: TMR4 OCO channel - VH + * @arg TMR4_OCO_VL: TMR4 OCO channel - VL + * @arg TMR4_OCO_WH: TMR4 OCO channel - WH + * @arg TMR4_OCO_WL: TMR4 OCO channel - WL + * @param [in] u16OccrBufMode TMR4 OCO OCCR buffer mode + * This parameter can be one of the following values: + * @arg TMR4_OCO_OCCR_BUF_DISABLE: Disable the register OCCR buffer function + * @arg TMR4_OCO_OCCR_BUF_CNT_ZERO: Register OCCR buffer transfer when counter value is 0x0000 + * @arg TMR4_OCO_OCCR_BUF_CNT_PEAK: Register OCCR buffer transfer when counter value is CPSR + * @arg TMR4_OCO_OCCR_BUF_CNT_ZERO_OR_PEAK: Register OCCR buffer transfer when the value is both 0 and CPSR + * @retval None + */ +void TMR4_OCO_SetOccrBufMode(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16OccrBufMode) +{ + __IO uint16_t *TMR4_OCER; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_OCO_CH(u32Ch)); + DDL_ASSERT(IS_VALID_TMR4_OCO_OCCR_BUF_MODE(u16OccrBufMode)); + + /* Get pointer of current channel OCO register address */ + TMR4_OCER = TMR4_OCERx(TMR4x, u32Ch); + + /* Set OCER register: OCCR buffer mode */ + MODIFY_REG16(*TMR4_OCER, \ + TMR4_OCER_CxBUFEN_MASK(u32Ch), \ + TMR4_OCER_CxBUFEN(u32Ch, u16OccrBufMode)); +} + +/** + * @brief Get TMR4 OCO OCCR buffer mode + * This parameter can be one of the following values: + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 OCO channel + * @arg TMR4_OCO_UH: TMR4 OCO channel - UH + * @arg TMR4_OCO_UL: TMR4 OCO channel - UL + * @arg TMR4_OCO_VH: TMR4 OCO channel - VH + * @arg TMR4_OCO_VL: TMR4 OCO channel - VL + * @arg TMR4_OCO_WH: TMR4 OCO channel - WH + * @arg TMR4_OCO_WL: TMR4 OCO channel - WL + * @retval Returned value can be one of the following values: + * @arg TMR4_OCO_OCCR_BUF_DISABLE: Disable the register OCCR buffer function + * @arg TMR4_OCO_OCCR_BUF_CNT_ZERO: Register OCCR buffer transfer when counter value is 0x0000 + * @arg TMR4_OCO_OCCR_BUF_CNT_PEAK: Register OCCR buffer transfer when counter value is CPSR + * @arg TMR4_OCO_OCCR_BUF_CNT_ZERO_OR_PEAK: Register OCCR buffer transfer when the value is both 0 and CPSR + */ +uint16_t TMR4_OCO_GetOccrBufMode(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch) +{ + uint16_t OccrBufMode; + __IO uint16_t *TMR4_OCER; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_OCO_CH(u32Ch)); + + /* Get pointer of current channel OCO register address */ + TMR4_OCER = TMR4_OCERx(TMR4x, u32Ch); + + /* Get OCCR buffer mode */ + OccrBufMode = READ_REG16_BIT(*TMR4_OCER, TMR4_OCER_CxBUFEN_MASK(u32Ch)); + + return (uint16_t)(OccrBufMode >> SHIFT_2BIT(u32Ch)); +} + +/** + * @brief Set TMR4 OCO OCCR buffer link transfer function + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 OCO channel + * This parameter can be one of the following values: + * @arg TMR4_OCO_UH: TMR4 OCO channel - UH + * @arg TMR4_OCO_UL: TMR4 OCO channel - UL + * @arg TMR4_OCO_VH: TMR4 OCO channel - VH + * @arg TMR4_OCO_VL: TMR4 OCO channel - VL + * @arg TMR4_OCO_WH: TMR4 OCO channel - WH + * @arg TMR4_OCO_WL: TMR4 OCO channel - WL + * @param [in] u16TransferState The OCO OCCR buffer link transfer state + * @arg TMR4_OCO_OCCR_LINK_TRANSFER_DISABLE: Disable the register OCCR buffer link transfer function + * @arg TMR4_OCO_OCCR_LINK_TRANSFER_ENABLE: Register OCCR buffer transfer when the value is both 0 and CPSR and ZIC/PIC is 0 + * @retval None + */ +void TMR4_OCO_SetOccrLinkTransfer(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16TransferState) +{ + __IO uint16_t *TMR4_OCER; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_OCO_CH(u32Ch)); + DDL_ASSERT(IS_VALID_TMR4_OCO_OCCR_LINK_TRANSFER(u16TransferState)); + + /* Get pointer of current channel OCO register address */ + TMR4_OCER = TMR4_OCERx(TMR4x, u32Ch); + + /* Set OCER register: OCCR link transfer function */ + MODIFY_REG16(*TMR4_OCER, \ + TMR4_OCER_LMCx_MASK(u32Ch), \ + TMR4_OCER_LMCx(u32Ch, u16TransferState)); +} + +/** + * @brief Set TMR4 OCO OCMR buffer mode + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 OCO channel + * This parameter can be one of the following values: + * @arg TMR4_OCO_UH: TMR4 OCO channel - UH + * @arg TMR4_OCO_UL: TMR4 OCO channel - UL + * @arg TMR4_OCO_VH: TMR4 OCO channel - VH + * @arg TMR4_OCO_VL: TMR4 OCO channel - VL + * @arg TMR4_OCO_WH: TMR4 OCO channel - WH + * @arg TMR4_OCO_WL: TMR4 OCO channel - WL + * @param [in] u16OcmrBufMode TMR4 OCO OCCR buffer mode + * This parameter can be one of the following values: + * @arg TMR4_OCO_OCMR_BUF_DISABLE: Disable the register OCMR buffer function + * @arg TMR4_OCO_OCMR_BUF_CNT_ZERO: Register OCMR buffer transfer when counter value is 0x0000 + * @arg TMR4_OCO_OCMR_BUF_CNT_PEAK: Register OCMR buffer transfer when counter value is CPSR + * @arg TMR4_OCO_OCMR_BUF_CNT_ZERO_OR_PEAK: Register OCMR buffer transfer when the value is both 0 and CPSR + * @retval None + */ +void TMR4_OCO_SetOcmrBufMode(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16OcmrBufMode) +{ + __IO uint16_t *TMR4_OCER; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_OCO_CH(u32Ch)); + DDL_ASSERT(IS_VALID_TMR4_OCO_OCMR_BUF_MODE(u16OcmrBufMode)); + + /* Get pointer of current channel OCO register address */ + TMR4_OCER = TMR4_OCERx(TMR4x, u32Ch); + + /* Set OCER register: OCMR buffer mode */ + MODIFY_REG16(*TMR4_OCER, \ + TMR4_OCER_MxBUFEN_MASK(u32Ch), \ + TMR4_OCER_MxBUFEN(u32Ch, u16OcmrBufMode)); +} + +/** + * @brief Get TMR4 OCO OCMR buffer mode + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 OCO channel + * This parameter can be one of the following values: + * @arg TMR4_OCO_UH: TMR4 OCO channel - UH + * @arg TMR4_OCO_UL: TMR4 OCO channel - UL + * @arg TMR4_OCO_VH: TMR4 OCO channel - VH + * @arg TMR4_OCO_VL: TMR4 OCO channel - VL + * @arg TMR4_OCO_WH: TMR4 OCO channel - WH + * @arg TMR4_OCO_WL: TMR4 OCO channel - WL + * @retval Returned value can be one of the following values: + * This parameter can be one of the following values: + * @arg TMR4_OCO_OCMR_BUF_DISABLE: Disable the register OCMR buffer function + * @arg TMR4_OCO_OCMR_BUF_CNT_ZERO: Register OCMR buffer transfer when counter value is 0x0000 + * @arg TMR4_OCO_OCMR_BUF_CNT_PEAK: Register OCMR buffer transfer when counter value is CPSR + * @arg TMR4_OCO_OCMR_BUF_CNT_ZERO_OR_PEAK: Register OCMR buffer transfer when the value is both 0 and CPSR + */ +uint16_t TMR4_OCO_GetOcmrBufMode(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch) +{ + uint16_t u16OcmrBufMode; + __IO uint16_t *TMR4_OCER; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_OCO_CH(u32Ch)); + + /* Get pointer of current channel OCO register address */ + TMR4_OCER = TMR4_OCERx(TMR4x, u32Ch); + + /* Get OCCR buffer mode */ + u16OcmrBufMode = READ_REG16_BIT(*TMR4_OCER, TMR4_OCER_MxBUFEN_MASK(u32Ch)); + + return (uint16_t)(u16OcmrBufMode >> SHIFT_2BIT(u32Ch)); +} + +/** + * @brief Set TMR4 OCO OCMR buffer link transfer function + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 OCO channel + * This parameter can be one of the following values: + * @arg TMR4_OCO_UH: TMR4 OCO channel - UH + * @arg TMR4_OCO_UL: TMR4 OCO channel - UL + * @arg TMR4_OCO_VH: TMR4 OCO channel - VH + * @arg TMR4_OCO_VL: TMR4 OCO channel - VL + * @arg TMR4_OCO_WH: TMR4 OCO channel - WH + * @arg TMR4_OCO_WL: TMR4 OCO channel - WL + * @param [in] u16TransferState The OCO OCCR buffer link transfer state + * @arg TMR4_OCO_OCCR_LINK_TRANSFER_DISABLE: Disable the register OCCR buffer link transfer function + * @arg TMR4_OCO_OCCR_LINK_TRANSFER_ENABLE: Register OCCR buffer transfer when the value is both 0 and CPSR and ZIC/PIC is 0 + * @retval None + */ +void TMR4_OCO_SetOcmrLinkTransfer(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16TransferState) +{ + __IO uint16_t *TMR4_OCER; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_OCO_CH(u32Ch)); + DDL_ASSERT(IS_VALID_TMR4_OCO_OCMR_LINK_TRANSFER(u16TransferState)); + + /* Get pointer of current channel OCO register address */ + TMR4_OCER = TMR4_OCERx(TMR4x, u32Ch); + + /* Set OCER register: OCMR link transfer function */ + MODIFY_REG16(*TMR4_OCER, \ + TMR4_OCER_LMMx_MASK(u32Ch), \ + TMR4_OCER_LMMx(u32Ch, u16TransferState)); +} + +/** + * @brief Extend the matching conditions of TMR4 OCO channel + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 OCO channel + * This parameter can be one of the following values: + * @arg TMR4_OCO_UH: TMR4 OCO channel - UH + * @arg TMR4_OCO_UL: TMR4 OCO channel - UL + * @arg TMR4_OCO_VH: TMR4 OCO channel - VH + * @arg TMR4_OCO_VL: TMR4 OCO channel - VL + * @arg TMR4_OCO_WH: TMR4 OCO channel - WH + * @arg TMR4_OCO_WL: TMR4 OCO channel - WL + * @param [in] u16ExtMatch TMR4 OCO extend match function selection + * @arg TMR4_OCO_EXTEND_MATCH_DISABLE: Disable TMR4 OCO extend match function + * @arg TMR4_OCO_EXTEND_MATCH_ENABLE: Enable TMR4 OCO extend match function + * @retval None + */ +void TMR4_OCO_SetExtMatchCond(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16ExtMatch) +{ + __IO uint16_t *TMR4_OCER; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_OCO_CH(u32Ch)); + DDL_ASSERT(IS_VALID_TMR4_OCO_EXTEND_MATCH(u16ExtMatch)); + + /* Get pointer of current channel OCO register address */ + TMR4_OCER = TMR4_OCERx(TMR4x, u32Ch); + + /* Set OCER register: Extend match function */ + MODIFY_REG16(*TMR4_OCER, \ + TMR4_OCER_MCECx_MASK(u32Ch), \ + TMR4_OCER_MCECx(u32Ch, u16ExtMatch)); +} + +/** + * @brief Set the TMR4 OCO high channel mode + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 OCO channel. + * This parameter can be one of the following values: + * @arg TMR4_OCO_UH: TMR4 OCO channel - UH + * @arg TMR4_OCO_VH: TMR4 OCO channel - VH + * @arg TMR4_OCO_WH: TMR4 OCO channel - WH + * @param [in] pstcMode Pointer to a @ref stc_oco_high_ch_compare_mode_t structure of the TMR4 OCO high channel mode + * @retval An en_result_t enumeration value: + * - Ok: Set successfully + * - ErrorInvalidParameter: pstcMode = NULL + */ +en_result_t TMR4_OCO_SetHighChCompareMode(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + const stc_oco_high_ch_compare_mode_t *pstcMode) +{ + __IO uint16_t *TMR4_OCER; + __IO uint16_t *TMR4_OCMRxH; + en_result_t enRet = ErrorInvalidParameter; + + /* Check pointer */ + if (NULL != pstcMode) + { + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_OCO_HIGH_CH(u32Ch)); + DDL_ASSERT(IS_VALID_TMR4_OCO_EXTEND_MATCH(pstcMode->u16ExtendMatch)); + + /* Get pointer of current channel OCO register address */ + TMR4_OCER = TMR4_OCERx(TMR4x, u32Ch); + TMR4_OCMRxH = TMR4_OCMRx(TMR4x, u32Ch); + + WRITE_REG16(*TMR4_OCMRxH, pstcMode->OCMRx); + MODIFY_REG16(*TMR4_OCER, \ + TMR4_OCER_MCECx_MASK(u32Ch), \ + TMR4_OCER_MCECx(u32Ch, pstcMode->u16ExtendMatch)); + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set the TMR4 OCO low channel mode + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 OCO channel. + * This parameter can be one of the following values: + * @arg TMR4_OCO_UL: TMR4 OCO channel - UL + * @arg TMR4_OCO_VL: TMR4 OCO channel - VL + * @arg TMR4_OCO_WL: TMR4 OCO channel - WL + * @param [in] pstcMode Pointer to a @ref stc_oco_low_ch_compare_mode_t structure of the TMR4 OCO low channel mode + * @retval An en_result_t enumeration value: + * - Ok: Set successfully + * - ErrorInvalidParameter: pstcMode = NULL + */ +en_result_t TMR4_OCO_SetLowChCompareMode(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + const stc_oco_low_ch_compare_mode_t *pstcMode) +{ + __IO uint16_t *TMR4_OCER; + __IO uint32_t *TMR4_OCMRxL; + en_result_t enRet = ErrorInvalidParameter; + + /* Check pointer */ + if (NULL != pstcMode) + { + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_OCO_LOW_CH(u32Ch)); + DDL_ASSERT(IS_VALID_TMR4_OCO_EXTEND_MATCH(pstcMode->u16ExtendMatch)); + + /* Get pointer of current channel OCO register address */ + TMR4_OCER = TMR4_OCERx(TMR4x, u32Ch); + TMR4_OCMRxL = (__IO uint32_t*)((uint32_t)TMR4_OCMRx(TMR4x, u32Ch)); + + WRITE_REG32(*TMR4_OCMRxL, pstcMode->OCMRx); + MODIFY_REG16(*TMR4_OCER, \ + TMR4_OCER_MCECx_MASK(u32Ch), \ + TMR4_OCER_MCECx(u32Ch, pstcMode->u16ExtendMatch)); + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set the TMR4 OCO low channel mode + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 OCO channel + * This parameter can be one of the following values: + * @arg TMR4_OCO_UH: TMR4 OCO channel - UH + * @arg TMR4_OCO_UL: TMR4 OCO channel - UL + * @arg TMR4_OCO_VH: TMR4 OCO channel - VH + * @arg TMR4_OCO_VL: TMR4 OCO channel - VL + * @arg TMR4_OCO_WH: TMR4 OCO channel - WH + * @arg TMR4_OCO_WL: TMR4 OCO channel - WL + * @param [in] u16OcoCmd The function new state + * @arg TMR4_OCO_DISABLE: Disable TMR4 OCO function + * @arg TMR4_OCO_ENABLE: Enable TMR4 OCO function + * @retval None + */ +void TMR4_OCO_SetOutputCompare(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16OcoCmd) +{ + __IO uint16_t *TMR4_OCSR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_OCO_CH(u32Ch)); + DDL_ASSERT(IS_VALID_TMR4_OCO_STATE(u16OcoCmd)); + + /* Get pointer of current channel OCO register address */ + TMR4_OCSR = TMR4_OCSRx(TMR4x, u32Ch); + + /* Set OCSR port output compare */ + MODIFY_REG16(*TMR4_OCSR, \ + TMR4_OCSR_OCEx_MASK(u32Ch), \ + TMR4_OCSR_OCEx(u32Ch, u16OcoCmd)); +} + +/** + * @brief Set the TMR4 OCO interrupt function + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 OCO channel + * This parameter can be one of the following values: + * @arg TMR4_OCO_UH: TMR4 OCO channel - UH + * @arg TMR4_OCO_UL: TMR4 OCO channel - UL + * @arg TMR4_OCO_VH: TMR4 OCO channel - VH + * @arg TMR4_OCO_VL: TMR4 OCO channel - VL + * @arg TMR4_OCO_WH: TMR4 OCO channel - WH + * @arg TMR4_OCO_WL: TMR4 OCO channel - WL + * @param [in] enNewState The function new state + * @arg This parameter can be: Enable or Disable + * @retval None + */ +void TMR4_OCO_IntCmd(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + en_functional_state_t enNewState) +{ + __IO uint16_t *TMR4_OCSR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_OCO_CH(u32Ch)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + /* Get pointer of current channel OCO register address */ + TMR4_OCSR = TMR4_OCSRx(TMR4x, u32Ch); + + if (Enable == enNewState) + { + SET_REG16_BIT(*TMR4_OCSR, TMR4_OCSR_OCIEx(u32Ch, TMR4_OCSR_OCIEH)); + } + else + { + CLEAR_REG16_BIT(*TMR4_OCSR, TMR4_OCSR_OCIEx(u32Ch, TMR4_OCSR_OCIEH)); + } +} + +/** + * @brief Set the TMR4 OCO interrupt flag + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 OCO channel + * This parameter can be one of the following values: + * @arg TMR4_OCO_UH: TMR4 OCO channel - UH + * @arg TMR4_OCO_UL: TMR4 OCO channel - UL + * @arg TMR4_OCO_VH: TMR4 OCO channel - VH + * @arg TMR4_OCO_VL: TMR4 OCO channel - VL + * @arg TMR4_OCO_WH: TMR4 OCO channel - WH + * @arg TMR4_OCO_WL: TMR4 OCO channel - WL + * @retval An en_flag_status_t enumeration value: + * - Reset: None interrupt request flag is set on TMR4 OCO + * - Set: Detection interrupt request on TMR4 OCO + */ +en_flag_status_t TMR4_OCO_GetStatus(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch) +{ + __IO uint16_t *TMR4_OCSR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_OCO_CH(u32Ch)); + + /* Get pointer of current channel OCO register address */ + TMR4_OCSR = TMR4_OCSRx(TMR4x, u32Ch); + + return (READ_REG16_BIT(*TMR4_OCSR, TMR4_OCSR_OCFx(u32Ch, TMR4_OCSR_OCFH)) ? Set : Reset); +} + +/** + * @brief Clear the TMR4 OCO interrupt function + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 OCO channel + * This parameter can be one of the following values: + * @arg TMR4_OCO_UH: TMR4 OCO channel - UH + * @arg TMR4_OCO_UL: TMR4 OCO channel - UL + * @arg TMR4_OCO_VH: TMR4 OCO channel - VH + * @arg TMR4_OCO_VL: TMR4 OCO channel - VL + * @arg TMR4_OCO_WH: TMR4 OCO channel - WH + * @arg TMR4_OCO_WL: TMR4 OCO channel - WL + * @retval None + */ +void TMR4_OCO_ClearStatus(M4_TMR4_TypeDef *TMR4x, uint32_t u32Ch) +{ + __IO uint16_t *TMR4_OCSR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_OCO_CH(u32Ch)); + + /* Get pointer of current channel OCO register address */ + TMR4_OCSR = TMR4_OCSRx(TMR4x, u32Ch); + + /* Clear OCSR count compare flag */ + CLEAR_REG16_BIT(*TMR4_OCSR, TMR4_OCSR_OCFx(u32Ch, TMR4_OCSR_OCFH)); +} + +/** + * @brief Set TMR4 OCO invalid output polarity + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 OCO channel + * This parameter can be one of the following values: + * @arg TMR4_OCO_UH: TMR4 OCO channel - UH + * @arg TMR4_OCO_UL: TMR4 OCO channel - UL + * @arg TMR4_OCO_VH: TMR4 OCO channel - VH + * @arg TMR4_OCO_VL: TMR4 OCO channel - VL + * @arg TMR4_OCO_WH: TMR4 OCO channel - WH + * @arg TMR4_OCO_WL: TMR4 OCO channel - WL + * @param [in] u16OutputPolarity TMR4 OCO invalid output polarity. + * This parameter can be one of the following values: + * @arg TMR4_OCO_INVAILD_OP_LOW: TMR4 OCO output low level when OCO is invalid + * @arg TMR4_OCO_INVAILD_OP_HIGH: TMR4 OCO output high level when OCO is invalid + * @retval None + */ +void TMR4_OCO_SetOcoInvalidOp(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16OutputPolarity) +{ + __IO uint16_t *TMR4_OCSR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_OCO_CH(u32Ch)); + DDL_ASSERT(IS_VALID_TMR4_OCO_PORT_INVALID_OP(u16OutputPolarity)); + + /* Get pointer of current channel OCO register address */ + TMR4_OCSR = TMR4_OCSRx(TMR4x, u32Ch); + + /* Set OCSR register: OCO invalid output polarity */ + MODIFY_REG16(*TMR4_OCSR, \ + TMR4_OCSR_OCPx_MASK(u32Ch), \ + TMR4_OCSR_OCPx(u32Ch, u16OutputPolarity)); +} + +/** + * @brief Get TMR4 OCO output polarity + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 OCO channel + * This parameter can be one of the following values: + * @arg TMR4_OCO_UH: TMR4 OCO channel - UH + * @arg TMR4_OCO_UL: TMR4 OCO channel - UL + * @arg TMR4_OCO_VH: TMR4 OCO channel - VH + * @arg TMR4_OCO_VL: TMR4 OCO channel - VL + * @arg TMR4_OCO_WH: TMR4 OCO channel - WH + * @arg TMR4_OCO_WL: TMR4 OCO channel - WL + * @retval Returned value can be one of the following values: + * @arg TMR4_OCO_INVAILD_OP_LOW: TMR4 OCO output low level when OCO is invalid + * @arg TMR4_OCO_INVAILD_OP_HIGH: TMR4 OCO output high level when OCO is invalid + */ +uint16_t TMR4_OCO_GetOutputPolarity(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch) +{ + uint16_t u16OutputPolarity; + __IO uint16_t *TMR4_OCSR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_OCO_CH(u32Ch)); + + /* Get pointer of current channel OCO register address */ + TMR4_OCSR = TMR4_OCSRx(TMR4x, u32Ch); + + /* Get OCSR register: OCO output polarity */ + u16OutputPolarity = READ_REG16_BIT(*TMR4_OCSR, TMR4_OCSR_OCPx_MASK(u32Ch)); + + return (u16OutputPolarity >> SHIFT_1BIT(u32Ch)); +} + +/** + * @brief Set TMR4 OCO compare value + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 OCO channel + * This parameter can be one of the following values: + * @arg TMR4_OCO_UH: TMR4 OCO channel - UH + * @arg TMR4_OCO_UL: TMR4 OCO channel - UL + * @arg TMR4_OCO_VH: TMR4 OCO channel - VH + * @arg TMR4_OCO_VL: TMR4 OCO channel - VL + * @arg TMR4_OCO_WH: TMR4 OCO channel - WH + * @arg TMR4_OCO_WL: TMR4 OCO channel - WL + * @param [in] u16CompareVal The TMR4 OCO OCCR register value + * @arg number of 16bit + * @retval None + */ +void TMR4_OCO_SetCompareVal(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16CompareVal) +{ + __IO uint16_t *TMR4_OCCR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_OCO_CH(u32Ch)); + + /* Get pointer of current channel OCO register address */ + TMR4_OCCR = TMR4_OCCRx(TMR4x, u32Ch); + + WRITE_REG16(*TMR4_OCCR, u16CompareVal); +} + +/** + * @brief Get TMR4 OCO OCCR compare value + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 OCO channel + * This parameter can be one of the following values: + * @arg TMR4_OCO_UH: TMR4 OCO channel - UH + * @arg TMR4_OCO_UL: TMR4 OCO channel - UL + * @arg TMR4_OCO_VH: TMR4 OCO channel - VH + * @arg TMR4_OCO_VL: TMR4 OCO channel - VL + * @arg TMR4_OCO_WH: TMR4 OCO channel - WH + * @arg TMR4_OCO_WL: TMR4 OCO channel - WL + * @retval The OCCR register value of the TMR4 OCO + */ +uint16_t TMR4_OCO_GetCompareVal(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch) +{ + __IO uint16_t *TMR4_OCCR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_OCO_CH(u32Ch)); + + /* Get pointer of current channel OCO register address */ + TMR4_OCCR = TMR4_OCCRx(TMR4x, u32Ch); + + return READ_REG16(*TMR4_OCCR); +} + +/** + * @} + */ + +/** + * @defgroup TMR4_PWM_Global_Functions TMR4 PWM Global Functions + * @{ + */ + +/** + * @brief Initialize TMR4 PWM + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 PWM channel + * This parameter can be one of the following values: + * @arg TMR4_PWM_U: TMR4 PWM couple channel - U + * @arg TMR4_PWM_V: TMR4 PWM couple channel - V + * @arg TMR4_PWM_W: TMR4 PWM couple channel - W + * @param [in] pstcInit Pointer to a @ref stc_tmr4_pwm_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: u32Ch is invalid or pstcInit = NULL + */ +en_result_t TMR4_PWM_Init(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + const stc_tmr4_pwm_init_t *pstcInit) +{ + __IO uint16_t *TMR4_POCR; + __IO uint16_t *TMR4_RCSR; + en_result_t enRet = ErrorInvalidParameter; + + /* Check channel && structure pointer */ + if (NULL != pstcInit) + { + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_PWM_CH(u32Ch)); + DDL_ASSERT(IS_VALID_TMR4_PWM_MODE(pstcInit->u16Mode)); + DDL_ASSERT(IS_VALID_TMR4_PWM_PCLK_DIV(pstcInit->u16PclkDiv)); + DDL_ASSERT(IS_VALID_TMR4_PWM_TRANSFORM_OCO_POLARITY(pstcInit->u16TransformOcoPol)); + DDL_ASSERT(IS_VALID_TMR4_PWM_EMB_PORT_OUTPUT_STATE(pstcInit->u32EmbOxHPortState)); + DDL_ASSERT(IS_VALID_TMR4_PWM_EMB_PORT_OUTPUT_STATE(pstcInit->u32EmbOxLPortState)); + + /* Get pointer of current channel PWM register address */ + TMR4_POCR = TMR4_POCRx(TMR4x, u32Ch); + TMR4_RCSR = TMR4_RCSRx(TMR4x); + + /* Set POCR register */ + WRITE_REG16(*TMR4_POCR, (pstcInit->u16PclkDiv | pstcInit->u16Mode | pstcInit->u16TransformOcoPol)); + + /* Set RCSR register */ + MODIFY_REG16(*TMR4_RCSR, + TMR4_RCSR_RTEx_MASK(u32Ch), \ + (TMR4_RCSR_RTIDx_MASK(u32Ch) | TMR4_RCSR_RTSx_MASK(u32Ch) | TMR4_RCSR_RTICx_MASK(u32Ch))); + + /* Set PSCR register: PWM port state */ + MODIFY_REG32(TMR4x->PSCR, \ + ((TMR4_PSCR_OEUH | TMR4_PSCR_OEUL) << (u32Ch * 2UL) | \ + (TMR4_PSCR_OSUH | TMR4_PSCR_OSUL) << (u32Ch * 4UL)), \ + ((pstcInit->u32OxHPortOutMode << (u32Ch * 2UL)) | \ + (pstcInit->u32OxLPortOutMode << (u32Ch * 2UL + 1UL)) | \ + (pstcInit->u32EmbOxHPortState << (u32Ch * 4UL)) | \ + (pstcInit->u32EmbOxLPortState << (u32Ch * 4UL + 2UL)))); + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_tmr4_pwm_init_t to default values + * @param [out] pstcInit Pointer to a @ref stc_tmr4_pwm_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: pstcInit = NULL + */ +en_result_t TMR4_PWM_StructInit(stc_tmr4_pwm_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + pstcInit->u16Mode = TMR4_PWM_THROUGH_MODE; + pstcInit->u16PclkDiv = TMR4_PWM_PCLK_DIV1; + pstcInit->u16TransformOcoPol = TMR4_PWM_OP_OXH_HOLD_OXL_HOLD; + pstcInit->u32OxHPortOutMode = TMR4_PWM_PORT_OUTPUT_OSxy; + pstcInit->u32EmbOxHPortState = TMR4_PWM_EMB_PORT_OUTPUT_NORMAL; + pstcInit->u32OxLPortOutMode = TMR4_PWM_PORT_OUTPUT_OSxy; + pstcInit->u32EmbOxLPortState = TMR4_PWM_EMB_PORT_OUTPUT_NORMAL; + enRet = Ok; + } + + return enRet; +} + +/** + * @brief De-initialize TMR4 PWM + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 PWM channel + * This parameter can be one of the following values: + * @arg TMR4_PWM_U: TMR4 PWM couple channel - U + * @arg TMR4_PWM_V: TMR4 PWM couple channel - V + * @arg TMR4_PWM_W: TMR4 PWM couple channel - W + * @retval None + */ +void TMR4_PWM_DeInit(M4_TMR4_TypeDef *TMR4x, uint32_t u32Ch) +{ + __IO uint16_t *TMR4_POCR; + __IO uint16_t *TMR4_RCSR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_PWM_CH(u32Ch)); + + /* Get pointer of current channel PWM register address */ + TMR4_POCR = TMR4_POCRx(TMR4x, u32Ch); + TMR4_RCSR = TMR4_RCSRx(TMR4x); + + /* Set POCR register */ + WRITE_REG16(*TMR4_POCR, (TMR4_PWM_PCLK_DIV1 | \ + TMR4_PWM_THROUGH_MODE | \ + TMR4_PWM_OP_OXH_HOLD_OXL_HOLD)); + + /* Set RCSR register */ + MODIFY_REG16(*TMR4_RCSR, + TMR4_RCSR_RTEx_MASK(u32Ch), \ + (TMR4_RCSR_RTIDx_MASK(u32Ch) | \ + TMR4_RCSR_RTSx_MASK(u32Ch) | \ + TMR4_RCSR_RTICx_MASK(u32Ch))); +} + +/** + * @brief Set TMR4 PWM PCLK clock division + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 PWM channel + * This parameter can be one of the following values: + * @arg TMR4_PWM_U: TMR4 PWM couple channel - U + * @arg TMR4_PWM_V: TMR4 PWM couple channel - V + * @arg TMR4_PWM_W: TMR4 PWM couple channel - W + * @param [in] u16Div TMR4 PWM PCLK clock division + * This parameter can be one of the following values: + * @arg TMR4_PWM_PCLK_DIV1: PCLK + * @arg TMR4_PWM_PCLK_DIV2: PCLK/2 + * @arg TMR4_PWM_PCLK_DIV4: PCLK/4 + * @arg TMR4_PWM_PCLK_DIV8: PCLK/8 + * @arg TMR4_PWM_PCLK_DIV16: PCLK/16 + * @arg TMR4_PWM_PCLK_DIV32: PCLK/32 + * @arg TMR4_PWM_PCLK_DIV64: PCLK/64 + * @arg TMR4_PWM_PCLK_DIV128: PCLK/128 + * @retval None + * @note The PCLK division function is valid when clock source is PCLK + */ +void TMR4_PWM_SetPclkDiv(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16Div) +{ + __IO uint16_t *TMR4_POCR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_PWM_CH(u32Ch)); + DDL_ASSERT(IS_VALID_TMR4_PWM_PCLK_DIV(u16Div)); + + /* Get pointer of current channel PWM register address */ + TMR4_POCR = TMR4_POCRx(TMR4x, u32Ch); + MODIFY_REG16(*TMR4_POCR, TMR4_POCR_DIVCK, u16Div); +} + +/** + * @brief Get TMR4 PWM PCLK clock division + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 PWM channel + * This parameter can be one of the following values: + * @arg TMR4_PWM_U: TMR4 PWM couple channel - U + * @arg TMR4_PWM_V: TMR4 PWM couple channel - V + * @arg TMR4_PWM_W: TMR4 PWM couple channel - W + * @retval Returned value can be one of the following values: + * @arg TMR4_PWM_PCLK_DIV1: PCLK + * @arg TMR4_PWM_PCLK_DIV2: PCLK/2 + * @arg TMR4_PWM_PCLK_DIV4: PCLK/4 + * @arg TMR4_PWM_PCLK_DIV8: PCLK/8 + * @arg TMR4_PWM_PCLK_DIV16: PCLK/16 + * @arg TMR4_PWM_PCLK_DIV32: PCLK/32 + * @arg TMR4_PWM_PCLK_DIV64: PCLK/64 + * @arg TMR4_PWM_PCLK_DIV128: PCLK/128 + * @note The PCLK division function is valid when clock source is PCLK + */ +uint16_t TMR4_PWM_GetPclkDiv(const M4_TMR4_TypeDef *TMR4x, uint32_t u32Ch) +{ + __IO uint16_t *TMR4_POCR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_PWM_CH(u32Ch)); + + /* Get pointer of current channel PWM register address */ + TMR4_POCR = TMR4_POCRx(TMR4x, u32Ch); + return READ_REG16_BIT(*TMR4_POCR, TMR4_POCR_DIVCK); +} + +/** + * @brief Set TMR4 PWM output polarity transform + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 PWM channel + * This parameter can be one of the following values: + * @arg TMR4_PWM_U: TMR4 PWM couple channel - U + * @arg TMR4_PWM_V: TMR4 PWM couple channel - V + * @arg TMR4_PWM_W: TMR4 PWM couple channel - W + * @param [in] u16OcoPolTransform TMR4 PWM transform OCO polarity + * This parameter can be one of the following values: + * @arg TMR4_PWM_OP_OXH_HOLD_OXL_HOLD: Output PWML and PWMH signals without changing the level + * @arg TMR4_PWM_OP_OXH_INVERT_OXL_INVERT: Output both PWML and PWMH signals reversed + * @arg TMR4_PWM_OP_OXH_INVERT_OXL_HOLD: Output the PWMH signal reversed, outputs the PWML signal without changing the level + * @arg TMR4_PWM_OP_OXH_HOLD_OXL_INVERT: Output the PWMH signal without changing the level, Outputs the PWML signal reversed + * @retval None + */ +void TMR4_PWM_SetOcoPolarityTransform(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16OcoPolTransform) +{ + __IO uint16_t *TMR4_POCR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_PWM_CH(u32Ch)); + DDL_ASSERT(IS_VALID_TMR4_PWM_TRANSFORM_OCO_POLARITY(u16OcoPolTransform)); + + /* Get pointer of current channel PWM register address */ + TMR4_POCR = TMR4_POCRx(TMR4x, u32Ch); + + MODIFY_REG16(*TMR4_POCR, TMR4_POCR_LVLS, u16OcoPolTransform); +} + +/** + * @brief Get TMR4 PWM output polarity transform + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 PWM channel + * This parameter can be one of the following values: + * @arg TMR4_PWM_U: TMR4 PWM couple channel - U + * @arg TMR4_PWM_V: TMR4 PWM couple channel - V + * @arg TMR4_PWM_W: TMR4 PWM couple channel - W + * @retval Returned value can be one of the following values: + * @arg TMR4_PWM_OP_OXH_HOLD_OXL_HOLD: Output PWML and PWMH signals without changing the level + * @arg TMR4_PWM_OP_OXH_INVERT_OXL_INVERT: Output both PWML and PWMH signals reversed + * @arg TMR4_PWM_OP_OXH_INVERT_OXL_HOLD: Output the PWMH signal reversed, outputs the PWML signal without changing the level + * @arg TMR4_PWM_OP_OXH_HOLD_OXL_INVERT: Output the PWMH signal without changing the level, Outputs the PWML signal reversed + */ +uint16_t TMR4_PWM_GetOcoPolarityTransform(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch) +{ + __IO uint16_t *TMR4_POCR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_PWM_CH(u32Ch)); + + /* Get pointer of current channel PWM register address */ + TMR4_POCR = TMR4_POCRx(TMR4x, u32Ch); + + return READ_REG16_BIT(*TMR4_POCR, TMR4_POCR_LVLS); +} + +/** + * @brief Start TMR4 PWM reload-timer + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 PWM channel + * This parameter can be one of the following values: + * @arg TMR4_PWM_U: TMR4 PWM couple channel - U + * @arg TMR4_PWM_V: TMR4 PWM couple channel - V + * @arg TMR4_PWM_W: TMR4 PWM couple channel - W + * @retval None + */ +void TMR4_PWM_StartReloadTimer(M4_TMR4_TypeDef *TMR4x, uint32_t u32Ch) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_PWM_CH(u32Ch)); + + SET_REG16_BIT(TMR4x->RCSR, TMR4_RCSR_RTEx_MASK(u32Ch)); +} + +/** + * @brief Stop TMR4 PWM reload-timer + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 PWM channel + * This parameter can be one of the following values: + * @arg TMR4_PWM_U: TMR4 PWM couple channel - U + * @arg TMR4_PWM_V: TMR4 PWM couple channel - V + * @arg TMR4_PWM_W: TMR4 PWM couple channel - W + * @retval None + */ +void TMR4_PWM_StopReloadTimer(M4_TMR4_TypeDef *TMR4x, uint32_t u32Ch) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_PWM_CH(u32Ch)); + + SET_REG16_BIT(TMR4x->RCSR, TMR4_RCSR_RTSx_MASK(u32Ch)); +} + +/** + * @brief Set the TMR4 PWM interrupt function + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 PWM channel + * This parameter can be one of the following values: + * @arg TMR4_PWM_U: TMR4 PWM couple channel - U + * @arg TMR4_PWM_V: TMR4 PWM couple channel - V + * @arg TMR4_PWM_W: TMR4 PWM couple channel - W + * @param [in] enNewState The function new state + * @arg This parameter can be: Enable or Disable + * @retval None + */ +void TMR4_PWM_IntCmd(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_PWM_CH(u32Ch)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + CLEAR_REG16_BIT(TMR4x->RCSR, TMR4_RCSR_RTIDx_MASK(u32Ch)); + } + else + { + SET_REG16_BIT(TMR4x->RCSR, TMR4_RCSR_RTIDx_MASK(u32Ch)); + } +} + +/** + * @brief Get PWM reload-timer interrupt flag + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 PWM channel + * This parameter can be one of the following values: + * @arg TMR4_PWM_U: TMR4 PWM couple channel - U + * @arg TMR4_PWM_V: TMR4 PWM couple channel - V + * @arg TMR4_PWM_W: TMR4 PWM couple channel - W + * @retval An en_flag_status_t enumeration value: + * - Reset None interrupt request on PWM reload-timer + * - Set Detection interrupt request on PWM reload-timer + */ +en_flag_status_t TMR4_PWM_GetStatus(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch) +{ + __IO uint16_t *TMR4_RCSR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_PWM_CH(u32Ch)); + + /* Get pointer of current channel PWM register address */ + TMR4_RCSR = TMR4_RCSRx(TMR4x); + + return (READ_REG16_BIT(*TMR4_RCSR, TMR4_RCSR_RTIFx_MASK(u32Ch)) ? Set : Reset); +} + +/** + * @brief Clear PWM reload-timer interrupt flag + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 PWM channel + * This parameter can be one of the following values: + * @arg TMR4_PWM_U: TMR4 PWM couple channel - U + * @arg TMR4_PWM_V: TMR4 PWM couple channel - V + * @arg TMR4_PWM_W: TMR4 PWM couple channel - W + * @retval None + */ +void TMR4_PWM_ClearStatus(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_PWM_CH(u32Ch)); + + SET_REG16_BIT(TMR4x->RCSR, TMR4_RCSR_RTICx_MASK(u32Ch)); +} + +/** + * @brief Set TMR4 PWM dead region count + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 PWM channel + * This parameter can be one of the following values: + * @arg TMR4_PWM_U: TMR4 PWM couple channel - U + * @arg TMR4_PWM_V: TMR4 PWM couple channel - V + * @arg TMR4_PWM_W: TMR4 PWM couple channel - W + * @param [in] u16PDAR PDAR value + * @arg number of 16bit + * @param [in] u16PDBR PDBR value + * @arg number of 16bit + * @retval None + */ +void TMR4_PWM_SetDeadRegionValue(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16PDAR, + uint16_t u16PDBR) +{ + __IO uint16_t *TMR4_PDAR; + __IO uint16_t *TMR4_PDBR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_PWM_CH(u32Ch)); + + /* Get pointer of current channel PWM register address */ + TMR4_PDAR = TMR4_PDARx(TMR4x, u32Ch); + TMR4_PDBR = TMR4_PDBRx(TMR4x, u32Ch); + + WRITE_REG16(*TMR4_PDAR, u16PDAR); + WRITE_REG16(*TMR4_PDBR, u16PDBR); +} + +/** + * @brief Get TMR4 PWM dead region count + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 PWM channel + * This parameter can be one of the following values: + * @arg TMR4_PWM_U: TMR4 PWM couple channel - U + * @arg TMR4_PWM_V: TMR4 PWM couple channel - V + * @arg TMR4_PWM_W: TMR4 PWM couple channel - W + * @param [out] pu16PDAR Pointer of 16bit data + * @arg pointer of 16bit + * @param [out] pu16PDBR Pointer of 16bit data + * @arg pointer of 16bit + * @retval None + */ +void TMR4_PWM_GetDeadRegionValue(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t *pu16PDAR, + uint16_t *pu16PDBR) +{ + __IO uint16_t *TMR4_PDAR; + __IO uint16_t *TMR4_PDBR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_PWM_CH(u32Ch)); + + /* Get pointer of current channel PWM register address */ + TMR4_PDAR = TMR4_PDARx(TMR4x, u32Ch); + TMR4_PDBR = TMR4_PDBRx(TMR4x, u32Ch); + + *pu16PDAR = READ_REG16(*TMR4_PDAR); + *pu16PDBR = READ_REG16(*TMR4_PDBR); +} + +/** + * @brief Set TMR4 PWM filter count value + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 PWM channel + * This parameter can be one of the following values: + * @arg TMR4_PWM_U: TMR4 PWM couple channel - U + * @arg TMR4_PWM_V: TMR4 PWM couple channel - V + * @arg TMR4_PWM_W: TMR4 PWM couple channel - W + * @param [in] u16Count TMR4 PWM filter count value + * @arg number of 16bit + * @retval None + */ +void TMR4_PWM_SetFilterCountValue(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16Count) +{ + __IO uint16_t *TMR4_PFSR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_PWM_CH(u32Ch)); + + /* Get pointer of current channel PWM register address */ + TMR4_PFSR = TMR4_PFSRx(TMR4x, u32Ch); + + WRITE_REG16(*TMR4_PFSR, u16Count); +} + +/** + * @brief Enable TMR4 PWM master output + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] enNewState The function new state + * @arg This parameter can be: Enable or Disable + * @retval None + */ +void TMR4_PWM_AutoOutputCmd(M4_TMR4_TypeDef *TMR4x, + en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(TMR4x->PSCR, TMR4_PSCR_AOE); + } + else + { + CLEAR_REG32_BIT(TMR4x->PSCR, TMR4_PSCR_AOE); + } +} + +/** + * @brief Enable TMR4 PWM master output + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] enNewState The function new state + * @arg This parameter can be: Enable or Disable + * @retval None + */ +void TMR4_PWM_MasterOutputCmd(M4_TMR4_TypeDef *TMR4x, + en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(TMR4x->PSCR, TMR4_PSCR_MOE); + } + else + { + CLEAR_REG32_BIT(TMR4x->PSCR, TMR4_PSCR_MOE); + } +} + +/** + * @brief Set TMR4 PWM port output mode + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32PwmPort TMR4 PWM channel + * This parameter can be one of the following values: + * @arg TMR4_PWM_PORT_OUH: TMR4 PWM port - TIM4__OUH + * @arg TMR4_PWM_PORT_OUL: TMR4 PWM port - TIM4__OUL + * @arg TMR4_PWM_PORT_OVH: TMR4 PWM port - TIM4__OVH + * @arg TMR4_PWM_PORT_OVL: TMR4 PWM port - TIM4__OVL + * @arg TMR4_PWM_PORT_OWH: TMR4 PWM port - TIM4__OWH + * @arg TMR4_PWM_PORT_OWL: TMR4 PWM port - TIM4__OWL + * @param [in] u32Mode The PWM port output mode + * This parameter can be one of the following values: + * @arg TMR4_PWM_PORT_OUTPUT_OSxy: TIM4__Oxy output polarity by specified OSxy + * @arg TMR4_PWM_PORT_OUTPUT_NORMAL: TIM4__Oxy output normal PWM + * @retval None + */ +void TMR4_PWM_PortOutputMode(M4_TMR4_TypeDef *TMR4x, + uint32_t u32PwmPort, + uint32_t u32Mode) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_PWM_PORT(u32PwmPort)); + DDL_ASSERT(IS_VALID_TMR4_PWM_PORT_MODE(u32Mode)); + + MODIFY_REG32(TMR4x->PSCR, \ + TMR4_PSCR_OExy_MASK(u32PwmPort), \ + TMR4_PSCR_OExy(u32PwmPort, u32Mode)); +} + +/** + * @brief Set TMR4 PWM port enable bit effective time + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32EffectTime Effective time + * This parameter can be one of the following values: + * @arg TMR4_PWM_PORT_ENBIT_EFFECT_IMMEDIATE:Effective time - Immediate + * @arg TMR4_PWM_PORT_ENBIT_EFFECT_CNTUVF: Effective time - TMR4 counter underflow + * @arg TMR4_PWM_PORT_ENBIT_EFFECT_CNTOVF: Effective time - TMR4 counter overflow + * @retval None + */ +void TMR4_PWM_SetPortEnBitEffectTime(M4_TMR4_TypeDef *TMR4x, + uint32_t u32EffectTime) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_PWM_PORT_ENBIT_EFFECT(u32EffectTime)); + + MODIFY_REG32(TMR4x->PSCR, TMR4_PSCR_ODT, u32EffectTime); +} + +/** + * @brief Get TMR4 PWM port state + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @retval Returned value can be one of the following values: + * @arg TMR4_PWM_PORT_ENBIT_EFFECT_IMMEDIATE:TMR4 PWM port enable bit effective Time - Immediate + * @arg TMR4_PWM_PORT_ENBIT_EFFECT_CNTUVF: TMR4 PWM port enable bit effective Time - TMR4 counter underflow + * @arg TMR4_PWM_PORT_ENBIT_EFFECT_CNTOVF: TMR4 PWM port enable bit effective Time - TMR4 counter overflow + */ +uint32_t TMR4_PWM_GetPortEnBitEffectTime(const M4_TMR4_TypeDef *TMR4x) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + + return READ_REG32_BIT(TMR4x->PSCR, TMR4_PSCR_ODT); +} + +/** + * @brief TMR4 PWM port output when emb event occur + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32PwmPort TMR4 PWM channel + * This parameter can be one of the following values: + * @arg TMR4_PWM_PORT_OUH: TMR4 PWM port - TIM4__OUH + * @arg TMR4_PWM_PORT_OUL: TMR4 PWM port - TIM4__OUL + * @arg TMR4_PWM_PORT_OVH: TMR4 PWM port - TIM4__OVH + * @arg TMR4_PWM_PORT_OVL: TMR4 PWM port - TIM4__OVL + * @arg TMR4_PWM_PORT_OWH: TMR4 PWM port - TIM4__OWH + * @arg TMR4_PWM_PORT_OWL: TMR4 PWM port - TIM4__OWL + * @param [in] u32State The port new state + * This parameter can be one of the following values: + * @arg TMR4_PWM_EMB_PORT_OUTPUT_NORMAL:TIM4__Oxy output normal + * @arg TMR4_PWM_EMB_PORT_OUTPUT_HIZ: TIM4__Oxy output Hi-z + * @arg TMR4_PWM_EMB_PORT_OUTPUT_LOW: TIM4__Oxy output low level + * @arg TMR4_PWM_EMB_PORT_OUTPUT_HIGH: TIM4__Oxy output high level + * @retval None + */ +void TMR4_PWM_EmbPwmPortOutputState(M4_TMR4_TypeDef *TMR4x, + uint32_t u32PwmPort, + uint32_t u32State) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_PWM_PORT(u32PwmPort)); + DDL_ASSERT(IS_VALID_TMR4_PWM_EMB_PORT_OUTPUT_STATE(u32State)); + + MODIFY_REG32(TMR4x->PSCR, \ + TMR4_PSCR_OSxy_MASK(u32PwmPort), \ + TMR4_PSCR_OSxy(u32PwmPort, u32State)); +} + +/** + * @} + */ + +/** + * @defgroup TMR4_SEVT_Global_Functions TMR4 SEVT Global Functions + * @{ + */ + +/** + * @brief Initialize TMR4 SEVT + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 SEVT channel + * This parameter can be one of the following values: + * @arg TMR4_SEVT_UH: TMR4 SEVT channel - UH + * @arg TMR4_SEVT_UL: TMR4 SEVT channel - UL + * @arg TMR4_SEVT_VH: TMR4 SEVT channel - VH + * @arg TMR4_SEVT_VL: TMR4 SEVT channel - VL + * @arg TMR4_SEVT_WH: TMR4 SEVT channel - WH + * @arg TMR4_SEVT_WL: TMR4 SEVT channel - WL + * @param [in] pstcInit Pointer to a @ref stc_tmr4_sevt_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: u32Ch is invalid or pstcInit = NULL + */ +en_result_t TMR4_SEVT_Init(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + const stc_tmr4_sevt_init_t *pstcInit) +{ + __IO uint16_t *TMR4_SCCR; + __IO uint16_t *TMR4_SCSR; + __IO uint16_t *TMR4_SCMR; + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_CH(u32Ch)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_MODE(pstcInit->u16Mode)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_LINK_TRANSFER(pstcInit->u16LinkTransfer)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_OUTPUT_EVENT(pstcInit->u16OutpuEvent)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_BUF_MODE(pstcInit->u16BufMode)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_UP_SEL(pstcInit->u16UpMatchCmd)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_DOWN_SEL(pstcInit->u16DownMatchCmd)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_PEAK_SEL(pstcInit->u16PeakMatchCmd)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_ZERO_SEL(pstcInit->u16ZeroMatchCmd)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_ZERO_MATCH_MASK_SEL(pstcInit->u16ZeroMatchMaskCmd)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_PEAK_MATCH_MASK_SEL(pstcInit->u16PeakMatchMaskCmd)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_MASK(pstcInit->u16MaskTimes)); + + /* Get actual address of register list of current channel */ + TMR4_SCCR = TMR4_SCCRx(TMR4x, u32Ch); + TMR4_SCSR = TMR4_SCSRx(TMR4x, u32Ch); + TMR4_SCMR = TMR4_SCMRx(TMR4x, u32Ch); + + /* Configure default parameter */ + WRITE_REG16(*TMR4_SCSR, 0x0000U); + WRITE_REG16(*TMR4_SCMR, 0xFF00U); + + /* Set SCSR register */ + WRITE_REG16(*TMR4_SCSR, \ + (pstcInit->u16Mode | \ + pstcInit->u16OutpuEvent | \ + pstcInit->u16BufMode | \ + pstcInit->u16LinkTransfer | \ + pstcInit->u16DownMatchCmd | \ + pstcInit->u16PeakMatchCmd | \ + pstcInit->u16UpMatchCmd | \ + pstcInit->u16ZeroMatchCmd)); + + /* Set SCMR register */ + WRITE_REG16(*TMR4_SCMR, \ + (pstcInit->u16MaskTimes | \ + pstcInit->u16ZeroMatchMaskCmd | \ + pstcInit->u16PeakMatchMaskCmd)); + + WRITE_REG16(*TMR4_SCCR, pstcInit->u16CompareVal); + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_tmr4_pwm_init_t to default values + * @param [out] pstcInit Pointer to a @ref stc_tmr4_pwm_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: pstcInit = NULL + */ +en_result_t TMR4_SEVT_StructInit(stc_tmr4_sevt_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + pstcInit->u16CompareVal = 0U; + pstcInit->u16Mode = TMR4_SEVT_MODE_COMPARE_TRIGGER; + pstcInit->u16OutpuEvent = TMR4_SEVT_OUTPUT_EVENT0; + pstcInit->u16BufMode = TMR4_SEVT_BUF_DISABLE; + pstcInit->u16LinkTransfer = TMR4_SEVT_LINK_TRANSFER_DISABLE; + pstcInit->u16DownMatchCmd = TMR4_SEVT_DOWN_DISABLE; + pstcInit->u16PeakMatchCmd = TMR4_SEVT_PEAK_DISABLE; + pstcInit->u16UpMatchCmd = TMR4_SEVT_UP_DISABLE; + pstcInit->u16ZeroMatchCmd = TMR4_SEVT_ZERO_DISABLE; + pstcInit->u16ZeroMatchMaskCmd = TMR4_SEVT_ZERO_MATCH_MASK_DISABLE; + pstcInit->u16PeakMatchMaskCmd = TMR4_SEVT_PEAK_MATCH_MASK_DISABLE; + pstcInit->u16MaskTimes = TMR4_SEVT_MASK_0; + enRet = Ok; + } + + return enRet; +} + +/** + * @brief De-initialize TMR4 PWM + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 SEVT channel + * This parameter can be one of the following values: + * @arg TMR4_SEVT_UH: TMR4 SEVT channel - UH + * @arg TMR4_SEVT_UL: TMR4 SEVT channel - UL + * @arg TMR4_SEVT_VH: TMR4 SEVT channel - VH + * @arg TMR4_SEVT_VL: TMR4 SEVT channel - VL + * @arg TMR4_SEVT_WH: TMR4 SEVT channel - WH + * @arg TMR4_SEVT_WL: TMR4 SEVT channel - WL + * @retval None + */ +void TMR4_SEVT_DeInit(M4_TMR4_TypeDef *TMR4x, uint32_t u32Ch) +{ + __IO uint16_t *TMR4_SCCR; + __IO uint16_t *TMR4_SCSR; + __IO uint16_t *TMR4_SCMR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_CH(u32Ch)); + + /* Get actual address of register list of current channel */ + TMR4_SCCR = TMR4_SCCRx(TMR4x, u32Ch); + TMR4_SCSR = TMR4_SCSRx(TMR4x, u32Ch); + TMR4_SCMR = TMR4_SCMRx(TMR4x, u32Ch); + + /* Configure default parameter */ + WRITE_REG16(*TMR4_SCCR, 0x0U); + WRITE_REG16(*TMR4_SCSR, 0x0000U); + WRITE_REG16(*TMR4_SCMR, 0xFF00U); +} + +/** + * @brief Set TMR4 SEVT trigger event + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 SEVT channel + * This parameter can be one of the following values: + * @arg TMR4_SEVT_UH: TMR4 SEVT channel - UH + * @arg TMR4_SEVT_UL: TMR4 SEVT channel - UL + * @arg TMR4_SEVT_VH: TMR4 SEVT channel - VH + * @arg TMR4_SEVT_VL: TMR4 SEVT channel - VL + * @arg TMR4_SEVT_WH: TMR4 SEVT channel - WH + * @arg TMR4_SEVT_WL: TMR4 SEVT channel - WL + * @param [in] u16Event TMR4 SEVT trigger event + * This parameter can be one of the following values: + * @arg TMR4_SEVT_OUTPUT_EVENT0: TMR4 SEVT output special event 0 + * @arg TMR4_SEVT_OUTPUT_EVENT1: TMR4 SEVT output special event 1 + * @arg TMR4_SEVT_OUTPUT_EVENT2: TMR4 SEVT output special event 2 + * @arg TMR4_SEVT_OUTPUT_EVENT3: TMR4 SEVT output special event 3 + * @arg TMR4_SEVT_OUTPUT_EVENT4: TMR4 SEVT output special event 4 + * @arg TMR4_SEVT_OUTPUT_EVENT5: TMR4 SEVT output special event 5 + * @retval None + */ +void TMR4_SEVT_SetOutpuEvent(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16Event) +{ + __IO uint16_t *TMR4_SCSR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_CH(u32Ch)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_OUTPUT_EVENT(u16Event)); + + /* Get actual address of register list of current channel */ + TMR4_SCSR = TMR4_SCSRx(TMR4x, u32Ch); + + /* Set SCSR register */ + MODIFY_REG16(*TMR4_SCSR, TMR4_SCSR_EVTOS, u16Event); +} + +/** + * @brief Get TMR4 SEVT trigger event + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 SEVT channel + * This parameter can be one of the following values: + * @arg TMR4_SEVT_UH: TMR4 SEVT channel - UH + * @arg TMR4_SEVT_UL: TMR4 SEVT channel - UL + * @arg TMR4_SEVT_VH: TMR4 SEVT channel - VH + * @arg TMR4_SEVT_VL: TMR4 SEVT channel - VL + * @arg TMR4_SEVT_WH: TMR4 SEVT channel - WH + * @arg TMR4_SEVT_WL: TMR4 SEVT channel - WL + * @retval Returned value can be one of the following values: + * @arg TMR4_SEVT_OUTPUT_EVENT0: TMR4 SEVT output special event 0 + * @arg TMR4_SEVT_OUTPUT_EVENT1: TMR4 SEVT output special event 1 + * @arg TMR4_SEVT_OUTPUT_EVENT2: TMR4 SEVT output special event 2 + * @arg TMR4_SEVT_OUTPUT_EVENT3: TMR4 SEVT output special event 3 + * @arg TMR4_SEVT_OUTPUT_EVENT4: TMR4 SEVT output special event 4 + * @arg TMR4_SEVT_OUTPUT_EVENT5: TMR4 SEVT output special event 5 + */ +uint16_t TMR4_SEVT_GetOutpuEvent(M4_TMR4_TypeDef *TMR4x, uint32_t u32Ch) +{ + __IO uint16_t *TMR4_SCSR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_CH(u32Ch)); + + /* Get actual address of register list of current channel */ + TMR4_SCSR = TMR4_SCSRx(TMR4x, u32Ch); + return READ_REG16_BIT(*TMR4_SCSR, TMR4_SCSR_EVTOS); +} + +/** + * @brief Set TMR4 SEVT delay object + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 SEVT channel + * This parameter can be one of the following values: + * @arg TMR4_SEVT_UH: TMR4 SEVT channel - UH + * @arg TMR4_SEVT_UL: TMR4 SEVT channel - UL + * @arg TMR4_SEVT_VH: TMR4 SEVT channel - VH + * @arg TMR4_SEVT_VL: TMR4 SEVT channel - VL + * @arg TMR4_SEVT_WH: TMR4 SEVT channel - WH + * @arg TMR4_SEVT_WL: TMR4 SEVT channel - WL + * @param [in] u16DelayObject TMR4 SEVT delay object + * This parameter can be one of the following values: + * @arg TMR4_SEVT_DELAY_OCCRXH: TMR4 SEVT delay object - OCCRxh + * @arg TMR4_SEVT_DELAY_OCCRXL: TMR4 SEVT delay object - OCCRxl + * @retval None + */ +void TMR4_SEVT_SetDelayObject(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16DelayObject) +{ + __IO uint16_t *TMR4_SCSR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_CH(u32Ch)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_OBJECT(u16DelayObject)); + + /* Get actual address of register list of current channel */ + TMR4_SCSR = TMR4_SCSRx(TMR4x, u32Ch); + + /* Set SCSR register */ + MODIFY_REG16(*TMR4_SCSR, TMR4_SCSR_EVTDS, u16DelayObject); +} + +/** + * @brief Get TMR4 SEVT SCCR register value + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 SEVT channel + * This parameter can be one of the following values: + * @arg TMR4_SEVT_UH: TMR4 SEVT channel - UH + * @arg TMR4_SEVT_UL: TMR4 SEVT channel - UL + * @arg TMR4_SEVT_VH: TMR4 SEVT channel - VH + * @arg TMR4_SEVT_VL: TMR4 SEVT channel - VL + * @arg TMR4_SEVT_WH: TMR4 SEVT channel - WH + * @arg TMR4_SEVT_WL: TMR4 SEVT channel - WL + * @retval Returned value can be one of the following values: + * @arg TMR4_SEVT_DELAY_OCCRXH: TMR4 SEVT delay object - OCCRxh + * @arg TMR4_SEVT_DELAY_OCCRXL: TMR4 SEVT delay object - OCCRxl + */ +uint16_t TMR4_SEVT_GetDelayObject(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch) +{ + __IO uint16_t *TMR4_SCSR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_CH(u32Ch)); + + /* Get actual address of register list of current channel */ + TMR4_SCSR = TMR4_SCSRx(TMR4x, u32Ch); + + return READ_REG16_BIT(*TMR4_SCSR, TMR4_SCSR_EVTDS); +} + +/** + * @brief Set TMR4 SEVT compare value + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 SEVT channel + * This parameter can be one of the following values: + * @arg TMR4_SEVT_UH: TMR4 SEVT channel - UH + * @arg TMR4_SEVT_UL: TMR4 SEVT channel - UL + * @arg TMR4_SEVT_VH: TMR4 SEVT channel - VH + * @arg TMR4_SEVT_VL: TMR4 SEVT channel - VL + * @arg TMR4_SEVT_WH: TMR4 SEVT channel - WH + * @arg TMR4_SEVT_WL: TMR4 SEVT channel - WL + * @param [in] u16CompareVal SCCR register value + * @arg number of 16bit + * @retval None + */ +void TMR4_SEVT_SetCompareVal(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16CompareVal) +{ + __IO uint16_t *TMR4_SCCR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_CH(u32Ch)); + + /* Get actual address of register list of current channel */ + TMR4_SCCR = TMR4_SCCRx(TMR4x, u32Ch); + + /* Set SCCR register */ + WRITE_REG16(*TMR4_SCCR, u16CompareVal); +} + +/** + * @brief Get TMR4 SEVT compare value + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 SEVT channel + * This parameter can be one of the following values: + * @arg TMR4_SEVT_UH: TMR4 SEVT channel - UH + * @arg TMR4_SEVT_UL: TMR4 SEVT channel - UL + * @arg TMR4_SEVT_VH: TMR4 SEVT channel - VH + * @arg TMR4_SEVT_VL: TMR4 SEVT channel - VL + * @arg TMR4_SEVT_WH: TMR4 SEVT channel - WH + * @arg TMR4_SEVT_WL: TMR4 SEVT channel - WL + * @retval SCCR register value + */ +uint16_t TMR4_SEVT_GetCompareVal(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch) +{ + __IO uint16_t *TMR4_SCCR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_CH(u32Ch)); + + /* Get actual address of register list of current channel */ + TMR4_SCCR = TMR4_SCCRx(TMR4x, u32Ch); + + return READ_REG16(*TMR4_SCCR); +} + +/** + * @brief Set TMR4 SEVT trigger event. + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 SEVT channel + * This parameter can be one of the following values: + * @arg TMR4_SEVT_UH: TMR4 SEVT channel - UH + * @arg TMR4_SEVT_UL: TMR4 SEVT channel - UL + * @arg TMR4_SEVT_VH: TMR4 SEVT channel - VH + * @arg TMR4_SEVT_VL: TMR4 SEVT channel - VL + * @arg TMR4_SEVT_WH: TMR4 SEVT channel - WH + * @arg TMR4_SEVT_WL: TMR4 SEVT channel - WL + * @param [in] u16MaskTimes Mask times + * @arg TMR4_SEVT_MASK_0: Mask 0 times + * @arg TMR4_SEVT_MASK_1: Mask 1 times + * @arg TMR4_SEVT_MASK_2: Mask 2 times + * @arg TMR4_SEVT_MASK_3: Mask 3 times + * @arg TMR4_SEVT_MASK_4: Mask 4 times + * @arg TMR4_SEVT_MASK_5: Mask 5 times + * @arg TMR4_SEVT_MASK_6: Mask 6 times + * @arg TMR4_SEVT_MASK_7: Mask 7 times + * @arg TMR4_SEVT_MASK_8: Mask 8 times + * @arg TMR4_SEVT_MASK_9: Mask 9 times + * @arg TMR4_SEVT_MASK_10: Mask 10 times + * @arg TMR4_SEVT_MASK_11: Mask 11 times + * @arg TMR4_SEVT_MASK_12: Mask 12 times + * @arg TMR4_SEVT_MASK_13: Mask 13 times + * @arg TMR4_SEVT_MASK_14: Mask 14 times + * @arg TMR4_SEVT_MASK_15: Mask 15 times + * @retval None + */ +void TMR4_SEVT_SetMaskTimes(M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch, + uint16_t u16MaskTimes) +{ + __IO uint16_t *TMR4_SCMR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_CH(u32Ch)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_MASK(u16MaskTimes)); + + /* Get actual address of register list of current channel */ + TMR4_SCMR = TMR4_SCMRx(TMR4x, u32Ch); + + /* Set SCMR register */ + MODIFY_REG16(*TMR4_SCMR, TMR4_SCMR_AMC, u16MaskTimes); +} + +/** + * @brief Get TMR4 SEVT SCCR register value + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u32Ch TMR4 SEVT channel + * This parameter can be one of the following values: + * @arg TMR4_SEVT_UH: TMR4 SEVT channel - UH + * @arg TMR4_SEVT_UL: TMR4 SEVT channel - UL + * @arg TMR4_SEVT_VH: TMR4 SEVT channel - VH + * @arg TMR4_SEVT_VL: TMR4 SEVT channel - VL + * @arg TMR4_SEVT_WH: TMR4 SEVT channel - WH + * @arg TMR4_SEVT_WL: TMR4 SEVT channel - WL + * @retval Returned value can be one of the following values: + * @arg TMR4_SEVT_MASK_0: Mask 0 times + * @arg TMR4_SEVT_MASK_1: Mask 1 times + * @arg TMR4_SEVT_MASK_2: Mask 2 times + * @arg TMR4_SEVT_MASK_3: Mask 3 times + * @arg TMR4_SEVT_MASK_4: Mask 4 times + * @arg TMR4_SEVT_MASK_5: Mask 5 times + * @arg TMR4_SEVT_MASK_6: Mask 6 times + * @arg TMR4_SEVT_MASK_7: Mask 7 times + * @arg TMR4_SEVT_MASK_8: Mask 8 times + * @arg TMR4_SEVT_MASK_9: Mask 9 times + * @arg TMR4_SEVT_MASK_10: Mask 10 times + * @arg TMR4_SEVT_MASK_11: Mask 11 times + * @arg TMR4_SEVT_MASK_12: Mask 12 times + * @arg TMR4_SEVT_MASK_13: Mask 13 times + * @arg TMR4_SEVT_MASK_14: Mask 14 times + * @arg TMR4_SEVT_MASK_15: Mask 15 times + */ +uint16_t TMR4_SEVT_GetMaskTimes(const M4_TMR4_TypeDef *TMR4x, + uint32_t u32Ch) +{ + __IO uint16_t *TMR4_SCMR; + + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_CH(u32Ch)); + + /* Get actual address of register list of current channel */ + TMR4_SCMR = TMR4_SCMRx(TMR4x, u32Ch); + + return READ_REG16_BIT(*TMR4_SCMR, TMR4_SCMR_AMC); +} + +/** + * @brief Set TMR4 SEVT event signal output to port + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @param [in] u16EvtSignal TMR4 SEVT event signal selection + * This parameter can be one of the following values: + * @arg TMR4_SEVT_PORT_OUTPUT_NONE: Disable output event signal of TMR4 Special-EVT + * @arg TMR4_SEVT_PORT_OUTPUT_EVENT0_SIGNAL: Output the specified event 0 signal of TMR4 Special-EVT + * @arg TMR4_SEVT_PORT_OUTPUT_EVENT1_SIGNAL: Output the specified event 1 signal of TMR4 Special-EVT + * @arg TMR4_SEVT_PORT_OUTPUT_EVENT2_SIGNAL: Output the specified event 2 signal of TMR4 Special-EVT + * @arg TMR4_SEVT_PORT_OUTPUT_EVENT3_SIGNAL: Output the specified event 3 signal of TMR4 Special-EVT + * @arg TMR4_SEVT_PORT_OUTPUT_EVENT4_SIGNAL: Output the specified event 4 signal of TMR4 Special-EVT + * @arg TMR4_SEVT_PORT_OUTPUT_EVENT5_SIGNAL: Output the specified event 5 signal of TMR4 Special-EVT + * @retval None + */ +void TMR4_SEVT_SetPortOutputEventSig(M4_TMR4_TypeDef *TMR4x, + uint16_t u16EvtSignal) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + DDL_ASSERT(IS_VALID_TMR4_SEVT_PORT_OUTPUT_SIGNAL(u16EvtSignal)); + + MODIFY_REG16(TMR4x->SCER, TMR4_SCER_EVTRS, u16EvtSignal); +} + +/** + * @brief Get TMR4 SEVT event signal output to port + * @param [in] TMR4x Pointer to TMR4 instance register base + * This parameter can be one of the following values: + * @arg M4_TMR4_1: TMR4 unit 1 instance register base + * @arg M4_TMR4_2: TMR4 unit 2 instance register base + * @arg M4_TMR4_3: TMR4 unit 3 instance register base + * @retval Returned value can be one of the following values: + * @arg TMR4_SEVT_PORT_OUTPUT_NONE: Disable output event signal of TMR4 Special-EVT + * @arg TMR4_SEVT_PORT_OUTPUT_EVENT0_SIGNAL: Output the specified event 0 signal of TMR4 Special-EVT + * @arg TMR4_SEVT_PORT_OUTPUT_EVENT1_SIGNAL: Output the specified event 1 signal of TMR4 Special-EVT + * @arg TMR4_SEVT_PORT_OUTPUT_EVENT2_SIGNAL: Output the specified event 2 signal of TMR4 Special-EVT + * @arg TMR4_SEVT_PORT_OUTPUT_EVENT3_SIGNAL: Output the specified event 3 signal of TMR4 Special-EVT + * @arg TMR4_SEVT_PORT_OUTPUT_EVENT4_SIGNAL: Output the specified event 4 signal of TMR4 Special-EVT + * @arg TMR4_SEVT_PORT_OUTPUT_EVENT5_SIGNAL: Output the specified event 5 signal of TMR4 Special-EVT + */ +uint16_t TMR4_SEVT_GetPortOutputEventSig(const M4_TMR4_TypeDef *TMR4x) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR4_INSTANCE(TMR4x)); + + return READ_REG16_BIT(TMR4x->SCER, TMR4_SCER_EVTRS); +} + +/** + * @} + */ + +/** + * @} + */ + +#endif /* DDL_TMR4_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmr6.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmr6.c new file mode 100644 index 0000000000..0d1a83d485 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmr6.c @@ -0,0 +1,2325 @@ +/** + ******************************************************************************* + * @file hc32f4a0_tmr6.c + * @brief This file provides firmware functions to manage the TMR6 (TMR6). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Wangmin First version + 2020-07-15 Wangmin Refine macro define + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_tmr6.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_TMR6 TMR6 + * @brief TMR6 Driver Library + * @{ + */ + +#if (DDL_TMR6_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup TMR6_Local_Macros TMR6 Local Macros + * @{ + */ + +/* Timer6 registers reset value */ +#define TMR6_REG_REFERENCE_RESET_VALUE_U32 (0xFFFFFFFFUL) +#define TMR6_REG_REFERENCE_RESET_VALUE_U16 (0xFFFFU) +#define TMR6_REG_GCONR_RESET_VALUE (0x00000100UL) + +/* Define for BCONR register configuration */ +#define BCONR_REG_CFG_MSK (0x0000000FUL) +#define BCONR_GEN_BUF_CHA_OFFSET (0x00UL) +#define BCONR_GEN_BUF_CHB_OFFSET (0x04UL) +#define BCONR_PERIOD_BUF_OFFSET (0x08UL) +#define BCONR_SPECIAL_BUF_CHA_OFFSET (0x10UL) +#define BCONR_SPECIAL_BUF_CHB_OFFSET (0x14UL) + +/* Define mask value for port output configuration for PCNAR/PCNBR register */ +#define PCNA_BR_REG_OUTPUT_CFG_MASK (0x9003FFFFUL) +#define PCNA_BR_REG_EMB_CFG_MASK (TMR6_PCNAR_EMBSA | TMR6_PCNAR_EMBRA | TMR6_PCNAR_EMBCA) +/* Define mask value for GCONR register */ +#define TMR6_INITIAL_MASK (TMR6_GCONR_DIR | TMR6_GCONR_MODE | TMR6_GCONR_CKDIV | TMR6_GCONR_OVSTP) +#define TMR6_ZMASK_CFG_MASK (TMR6_GCONR_ZMSKVAL | TMR6_GCONR_ZMSKPOS | TMR6_GCONR_ZMSKREV) + +#define TMR6_HW_CTRL_EVENT_MASK (TMR6_HW_CTRL_PWMA_RISING | \ + TMR6_HW_CTRL_PWMA_FAILLING | \ + TMR6_HW_CTRL_PWMB_RISING | \ + TMR6_HW_CTRL_PWMB_FAILLING | \ + TMR6_HW_CTRL_INTER_EVENT0 | \ + TMR6_HW_CTRL_INTER_EVENT1 | \ + TMR6_HW_CTRL_INTER_EVENT2 | \ + TMR6_HW_CTRL_INTER_EVENT3 | \ + TMR6_HW_CTRL_TRIGEA_RISING | \ + TMR6_HW_CTRL_TRIGEA_FAILLING | \ + TMR6_HW_CTRL_TRIGEB_RISING | \ + TMR6_HW_CTRL_TRIGEB_FAILLING | \ + TMR6_HW_CTRL_TRIGEC_RISING | \ + TMR6_HW_CTRL_TRIGEC_FAILLING | \ + TMR6_HW_CTRL_TRIGED_RISING | \ + TMR6_HW_CTRL_TRIGED_FAILLING) + +#define TMR6_HW_CNT_EVENT_MASK (TMR6_HW_CNT_PWMAL_PWMBRISING | \ + TMR6_HW_CNT_PWMAL_PWMBFAILLING | \ + TMR6_HW_CNT_PWMAH_PWMBRISING | \ + TMR6_HW_CNT_PWMAH_PWMBFAILLING | \ + TMR6_HW_CNT_PWMBL_PWMARISING | \ + TMR6_HW_CNT_PWMBL_PWMAFAILLING | \ + TMR6_HW_CNT_PWMBH_PWMARISING | \ + TMR6_HW_CNT_PWMBH_PWMAFAILLING | \ + TMR6_HW_CNT_INTER_EVENT0 | \ + TMR6_HW_CNT_INTER_EVENT1 | \ + TMR6_HW_CNT_INTER_EVENT2 | \ + TMR6_HW_CNT_INTER_EVENT3 | \ + TMR6_HW_CNT_TRIGEA_RISING | \ + TMR6_HW_CNT_TRIGEA_FAILLING | \ + TMR6_HW_CNT_TRIGEB_RISING | \ + TMR6_HW_CNT_TRIGEB_FAILLING | \ + TMR6_HW_CNT_TRIGEC_RISING | \ + TMR6_HW_CNT_TRIGEC_FAILLING | \ + TMR6_HW_CNT_TRIGED_RISING | \ + TMR6_HW_CNT_TRIGED_FAILLING) + +#define TMR6_IRQ_EN_MASK (TMR6_IRQ_EN_CNT_MATCH_A | \ + TMR6_IRQ_EN_CNT_MATCH_B | \ + TMR6_IRQ_EN_CNT_MATCH_C | \ + TMR6_IRQ_EN_CNT_MATCH_D | \ + TMR6_IRQ_EN_CNT_MATCH_E | \ + TMR6_IRQ_EN_CNT_MATCH_F | \ + TMR6_IRQ_EN_OVERFLOW | \ + TMR6_IRQ_EN_UNDERFLOW | \ + TMR6_IRQ_EN_DEAD_TIME_ERR | \ + TMR6_IRQ_EN_UPCNT_SP_MATCH_A | \ + TMR6_IRQ_EN_DOWNCNT_SP_MATCH_A | \ + TMR6_IRQ_EN_UPCNT_SP_MATCH_B | \ + TMR6_IRQ_EN_DOWNCNT_SP_MATCH_B) + +#define TMR6_STAT_FLAG_MASK (TMR6_STAT_CNT_MATCH_A | \ + TMR6_STAT_CNT_MATCH_B | \ + TMR6_STAT_CNT_MATCH_C | \ + TMR6_STAT_CNT_MATCH_D | \ + TMR6_STAT_CNT_MATCH_E | \ + TMR6_STAT_CNT_MATCH_F | \ + TMR6_STAT_OVERFLOW | \ + TMR6_STAT_UNDERFLOW | \ + TMR6_STAT_DEAD_TIME_ERR | \ + TMR6_STAT_UPCNT_SP_MATCH_A | \ + TMR6_STAT_DOWNCNT_SP_MATCH_A | \ + TMR6_STAT_UPCNT_SP_MATCH_B | \ + TMR6_STAT_DOWNCNT_SP_MATCH_B | \ + TMR6_STAT_CNT_DIR) + +#define TMR6_SW_CTRL_REG_MASK (TMR6_SSTAR_SSTA1 | \ + TMR6_SSTAR_SSTA2 | \ + TMR6_SSTAR_SSTA3 | \ + TMR6_SSTAR_SSTA4 | \ + TMR6_SSTAR_SSTA5 | \ + TMR6_SSTAR_SSTA6 | \ + TMR6_SSTAR_SSTA7 | \ + TMR6_SSTAR_SSTA8) + + + + +/** + * @defgroup TMR6_Check_Parameters_Validity TMR6 Check Parameters Validity + * @{ + */ + +/*! Parameter valid check for normal timer6 unit */ +#define IS_VALID_TMR6_UNIT(__TMR6x__) \ +( (M4_TMR6_1 == (__TMR6x__)) || \ + (M4_TMR6_2 == (__TMR6x__)) || \ + (M4_TMR6_3 == (__TMR6x__)) || \ + (M4_TMR6_4 == (__TMR6x__)) || \ + (M4_TMR6_5 == (__TMR6x__)) || \ + (M4_TMR6_6 == (__TMR6x__)) || \ + (M4_TMR6_7 == (__TMR6x__)) || \ + (M4_TMR6_8 == (__TMR6x__))) + +/*! Parameter valid check for interrupt source configuration */ +#define IS_VALID_IRQ_SOURCE_CONFIG(x) \ +( ((x) != 0UL) && \ + (((x) | TMR6_IRQ_EN_MASK) == TMR6_IRQ_EN_MASK)) + +/*! Parameter valid check for status bit read */ +#define IS_VALID_STABIT_GET(x) \ +( ((x) != 0UL) && \ + (((x) | TMR6_STAT_FLAG_MASK) == TMR6_STAT_FLAG_MASK)) + +/*! Parameter valid check for period register */ +#define IS_VALID_PERIOD_REG(x) \ +( (TMR6_PERIOD_REG_A == (x)) || \ + (TMR6_PERIOD_REG_B == (x)) || \ + (TMR6_PERIOD_REG_C == (x))) + +/*! Parameter valid check for general compare register */ +#define IS_VALID_CMP_REG(x) \ +( (TMR6_CMP_REG_A == (x)) || \ + (TMR6_CMP_REG_B == (x)) || \ + (TMR6_CMP_REG_C == (x)) || \ + (TMR6_CMP_REG_D == (x)) || \ + (TMR6_CMP_REG_E == (x)) || \ + (TMR6_CMP_REG_F == (x))) + +/*! Parameter valid check for general/special compare channel */ +#define IS_VALID_CMP_CH(x) \ +( (TMR6_CH_A == (x)) || \ + (TMR6_CH_B == (x))) + +/*! Parameter valid check for buffer function status */ +#define IS_VALID_BUF_STAT(x) \ +( (TMR6_BUF_FUNC_OFF == (x)) || \ + (TMR6_BUF_FUNC_ON == (x))) + +/*! Parameter valid check for buffer function number */ +#define IS_VALID_BUF_FUN_NUM(x) \ +( (TMR6_BUF_FUNC_SINGLE == (x)) || \ + (TMR6_BUF_FUNC_DOUBLE == (x))) + +/*! Parameter valid check for buffer transfer timer configuration */ +#define IS_VALID_BUF_TRANS_TIM(x) \ +( (TMR6_BUF_TRANS_TIM_NONE == (x)) || \ + (TMR6_BUF_TRANS_TIM_OVERFLOW == (x)) || \ + (TMR6_BUF_TRANS_TIM_UNDERFLOW == (x))|| \ + (TMR6_BUF_TRANS_TIM_BOTH == (x))) + +/*! Parameter valid check for valid period function status for channel A */ +#define IS_VALID_VALID_PERIOD_STAT_CHA(x) \ +( (TMR6_VALID_PERIOD_FUNC_CHA_OFF == (x)) || \ + (TMR6_VALID_PERIOD_FUNC_CHA_ON == (x))) + +/*! Parameter valid check for valid period function status for channel B */ +#define IS_VALID_VALID_PERIOD_STAT_CHB(x) \ +( (TMR6_VALID_PERIOD_FUNC_CHB_OFF == (x)) || \ + (TMR6_VALID_PERIOD_FUNC_CHB_ON == (x))) + +/*! Parameter valid check for count condition for valid period function */ +#define IS_VALID_PERIOD_CNT_COND(x) \ +( (TMR6_VALID_PERIOD_FUNC_OFF == (x)) || \ + (TMR6_VALID_PERIOD_CNT_COND_UNDERFLOW == (x)) || \ + (TMR6_VALID_PERIOD_CNT_COND_OVERFLOW == (x)) || \ + (TMR6_VALID_PERIOD_CNT_COND_BOTH == (x))) + +/*! Parameter valid check for count condition for valid period count */ +#define IS_VALID_PERIOD_CNT(x) \ +( (TMR6_VALID_PERIOD_CNT_INVALID == (x)) || \ + (TMR6_VALID_PERIOD_CNT_1 == (x)) || \ + (TMR6_VALID_PERIOD_CNT_2 == (x)) || \ + (TMR6_VALID_PERIOD_CNT_3 == (x)) || \ + (TMR6_VALID_PERIOD_CNT_4 == (x)) || \ + (TMR6_VALID_PERIOD_CNT_5 == (x)) || \ + (TMR6_VALID_PERIOD_CNT_6 == (x)) || \ + (TMR6_VALID_PERIOD_CNT_7 == (x))) + +/*! Parameter valid check for count register data range */ +#define IS_VALID_REG_RANGE_U16(x) ((x) <= 0xFFFFUL) + +/*! Parameter valid check for dead time register */ +#define IS_VALID_DEADTIME_REG(x) \ +( (TMR6_DEADTIME_REG_UP_A == (x)) || \ + (TMR6_DEADTIME_REG_DOWN_A == (x)) || \ + (TMR6_DEADTIME_REG_UP_B == (x)) || \ + (TMR6_DEADTIME_REG_DOWN_B == (x))) + +/*! Parameter valid check for input port */ +#define IS_VALID_INPUT_PORT(x) \ +( (TMR6_IO_PWMA == (x)) || \ + (TMR6_IO_PWMB == (x)) || \ + (TMR6_INPUT_TRIGA == (x)) || \ + (TMR6_INPUT_TRIGB == (x)) || \ + (TMR6_INPUT_TRIGC == (x)) || \ + (TMR6_INPUT_TRIGD == (x))) + +/*! Parameter valid check for output port */ +#define IS_VALID_OUTPUT_PORT(x) \ +( (TMR6_IO_PWMA == (x)) || \ + (TMR6_IO_PWMB == (x))) + +/*! Parameter valid check for input port filter clock */ +#define IS_VALID_INPUT_FILTER_CLK(x) \ +( (TMR6_INPUT_FILTER_PCLK0_DIV1 == (x)) || \ + (TMR6_INPUT_FILTER_PCLK0_DIV4 == (x)) || \ + (TMR6_INPUT_FILTER_PCLK0_DIV16 == (x)) || \ + (TMR6_INPUT_FILTER_PCLK0_DIV64 == (x))) + +/*! Parameter valid check for port function mode*/ +#define IS_VALID_PORT_MODE_FUNC(x) \ +( (TMR6_PORT_COMPARE_OUTPUT == (x)) || \ + (TMR6_PORT_CAPTURE_INPUT == (x))) + +/*! Parameter valid check for port input filter function status */ +#define IS_VALID_PORT_INPUT_FILTER_STA(x) \ +( (TMR6_PORT_INPUT_FILTER_OFF == (x)) || \ + (TMR6_PORT_INPUT_FILTER_ON == (x))) + +/*! Parameter valid check for output port status for count result */ +#define IS_VALID_OUTPUT_STA_RESULT(x) \ +( (TMR6_PORT_OUTPUT_STA_LOW == (x)) || \ + (TMR6_PORT_OUTPUT_STA_HIGH == (x)) || \ + (TMR6_PORT_OUTPUT_STA_HOLD == (x)) || \ + (TMR6_PORT_OUTPUT_STA_REVERSE == (x))) + +/*! Parameter valid check for force output port status for count result */ +#define IS_VALID_FORCE_OUTPUT_STA_RESULT(x) \ +( (TMR6_FORCE_PORT_OUTPUT_INVALID == (x)) || \ + (TMR6_FORCE_PORT_OUTPUT_STA_LOW == (x)) || \ + (TMR6_FORCE_PORT_OUTPUT_STA_HIGH == (x))) + +/*! Parameter valid check for output port status for count status */ +#define IS_VALID_OUTPUT_STA_STA(x) \ +( (TMR6_PORT_OUTPUT_STA_LOW == (x)) || \ + (TMR6_PORT_OUTPUT_STA_HIGH == (x)) || \ + (TMR6_PORT_OUTPUT_STA_HOLD == (x))) + +/*! Parameter valid check for EMB event valid channel */ +#define IS_VALID_EMB_CH(x) \ +( (TMR6_EMB_EVENT_VALID_CH0 == (x)) || \ + (TMR6_EMB_EVENT_VALID_CH1 == (x)) || \ + (TMR6_EMB_EVENT_VALID_CH2 == (x)) || \ + (TMR6_EMB_EVENT_VALID_CH3 == (x))) + +/*! Parameter valid check for EMB release mode when EMB event invalid */ +#define IS_VALID_EMB_RELEASE_MODE(x) \ +( (TMR6_EMB_RELEASE_IMMEDIATE == (x)) || \ + (TMR6_EMB_RELEASE_OVERFLOW == (x)) || \ + (TMR6_EMB_RELEASE_UNDERFLOW == (x)) || \ + (TMR6_EMB_RELEASE_OVERFLOW_UNDERFLOW == (x))) + +/*! Parameter valid check for port output status when EMB event valid */ +#define IS_VALID_EMB_VALID_PORT_STA(x) \ +( (TMR6_EMB_PORTSTA_NORMAL == (x)) || \ + (TMR6_EMB_PORTSTA_HIZ == (x)) || \ + (TMR6_EMB_PORTSTA_LOW == (x)) || \ + (TMR6_EMB_PORTSTA_HIGH == (x))) + +/*! Parameter valid check for dead time buffer function for DTUAR and DTUBR register */ +#define IS_VALID_DEADTIME_BUF_FUNC_DTUAR_REG(x) \ +( (TMR6_DEADTIME_CNT_UP_BUF_OFF == (x)) || \ + (TMR6_DEADTIME_CNT_UP_BUF_ON == (x))) + +/*! Parameter valid check for dead time buffer function for DTDAR and DTDBR register */ +#define IS_VALID_DEADTIME_BUF_FUNC_DTDAR_REG(x) \ +( (TMR6_DEADTIME_CNT_DOWN_BUF_OFF == (x)) || \ + (TMR6_DEADTIME_CNT_DOWN_BUF_ON == (x))) + +/*! Parameter valid check for dead time buffer transfer condition */ +#define IS_VALID_DEADTIME_BUF_TRANS_COND_REG(x) \ +( (TMR6_DEADTIME_TRANS_COND_NONE == (x)) || \ + (TMR6_DEADTIME_TRANS_COND_OVERFLOW == (x)) || \ + (TMR6_DEADTIME_TRANS_COND_UNDERFLOW == (x)) || \ + (TMR6_DEADTIME_TRANS_COND_BOTH == (x))) + +/*! Parameter valid check for dead time equal function for DTUAR and DTDAR register */ +#define IS_VALID_DEADTIME_EQUAL_FUNC_REG(x) \ +( (TMR6_DEADTIME_EQUAL_OFF == (x)) || \ + (TMR6_DEADTIME_EQUAL_ON == (x))) + +/*! Parameter valid check for hardware control events */ +#define IS_VALID_HW_CTRL_EVENTS(x) \ +( ((x) != 0UL) && \ + (((x) | TMR6_HW_CTRL_EVENT_MASK) == TMR6_HW_CTRL_EVENT_MASK)) + +/*! Parameter valid check for hardware count events */ +#define IS_VALID_HW_CNT_EVENTS(x) \ +( ((x) != 0UL) && \ + (((x) | TMR6_HW_CNT_EVENT_MASK) == TMR6_HW_CNT_EVENT_MASK)) + +/*! Parameter valid check for count Mode */ +#define IS_VALID_CNT_MODE(x) \ +( (TMR6_MODE_SAWTOOTH == (x)) || \ + (TMR6_MODE_TRIANGLE == (x))) + +/*! Parameter valid check for count direction */ +#define IS_VALID_CNT_DIRECTION(x) \ +( (TMR6_CNT_INCREASE == (x)) || \ + (TMR6_CNT_DECREASE == (x))) + +/*! Parameter valid check for count clock source */ +#define IS_VALID_CNT_CLK_SRC(x) \ +( (TMR6_CLK_PCLK0_DIV1 == (x)) || \ + (TMR6_CLK_PCLK0_DIV2 == (x)) || \ + (TMR6_CLK_PCLK0_DIV4 == (x)) || \ + (TMR6_CLK_PCLK0_DIV8 == (x)) || \ + (TMR6_CLK_PCLK0_DIV16 == (x)) || \ + (TMR6_CLK_PCLK0_DIV32 == (x)) || \ + (TMR6_CLK_PCLK0_DIV64 == (x)) || \ + (TMR6_CLK_PCLK0_DIV128 == (x)) || \ + (TMR6_CLK_PCLK0_DIV256 == (x)) || \ + (TMR6_CLK_PCLK0_DIV512 == (x)) || \ + (TMR6_CLK_PCLK0_DIV1024 == (x))) + +/*! Parameter valid check for stop when overflow mode */ +#define IS_VALID_STOP_AFTER_OVF_MODE(x) \ +( (TMR6_CNT_CONTINUOUS == (x)) || \ + (TMR6_STOP_AFTER_OVF == (x))) + +/*! Parameter valid check for Z Mask input function mask cycles number */ +#define IS_VALID_ZMASK_CYCLES(x) \ +( (TMR6_ZMASK_CYCLE_FUNC_INVALID == (x)) || \ + (TMR6_ZMASK_CYCLE_4 == (x)) || \ + (TMR6_ZMASK_CYCLE_8 == (x)) || \ + (TMR6_ZMASK_CYCLE_16 == (x))) + +/*! Parameter valid check for Z Mask function of timer6 position unit */ +#define IS_VALID_POS_UNIT_ZMASK_FUNC(x) \ +( (TMR6_POS_CLR_ZMASK_FUNC_INVALID == (x)) || \ + (TMR6_POS_CLR_ZMASK_FUNC_VALID == (x))) + +/*! Parameter valid check for Z Mask function of timer6 revolution unit */ +#define IS_VALID_REVO_UNIT_ZMASK_FUNC(x) \ +( (TMR6_REVO_CNT_ZMASK_FUNC_INVALID == (x)) || \ + (TMR6_REVO_CNT_ZMASK_FUNC_VALID == (x))) + +/*! Parameter valid check for hardware trigger index */ +#define IS_VALID_HW_TRIGGER_INDEX(x) \ +( (TMR6_HW_TRIG_0 == (x)) || \ + (TMR6_HW_TRIG_1 == (x)) || \ + (TMR6_HW_TRIG_2 == (x)) || \ + (TMR6_HW_TRIG_3 == (x))) + +/*! Parameter valid check for software sync control unit configuration */ +#define IS_VALID_SW_CTRL_CFG(x) \ +( ((x) != 0UL) && \ + (((x) | TMR6_SW_CTRL_REG_MASK) == TMR6_SW_CTRL_REG_MASK)) + +/*! Parameter valid check for common trigger configuration. */ +#define IS_VALID_TMR6_COM_TRIG(x) \ +( ((x) != 0x00UL) && \ + (((x) | TMR6_COM_TRIG_MASK) == TMR6_COM_TRIG_MASK)) + +/* Unit check for TMR6 which data width is 32 bit */ +#define IS_TMR6_32BIT_UINT(x) \ +( (M4_TMR6_1 == (x)) || \ + (M4_TMR6_2 == (x)) || \ + (M4_TMR6_3 == (x)) || \ + (M4_TMR6_4 == (x))) + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ + +/** + * @defgroup TMR6_Global_Functions TMR6 Global Functions + * @{ + */ + +/** + * @brief Timer6 interrupt request enable or disable + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] u32Tmr6Irq Irq source, Can be one or any combination of + * the values from @ref TMR6_Interrupt_Enable_Bit_Define + * @param [in] enNewState Disable or Enable the function + * @retval None + */ +void TMR6_IntCmd(M4_TMR6_TypeDef *TMR6x, uint32_t u32Tmr6Irq, en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_VALID_IRQ_SOURCE_CONFIG(u32Tmr6Irq)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if(Enable == enNewState) + { + SET_REG32_BIT(TMR6x->ICONR, u32Tmr6Irq); + } + else + { + CLEAR_REG32_BIT(TMR6x->ICONR, u32Tmr6Irq); + } +} + +/** + * @brief Get Timer6 status flag + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] u32StaBit Status bit to be read, Can be one or any combination of + * the values from @ref TMR6_Sta_Bit_Get_Define + * @retval An en_flag_status_t enumeration value. + * @arg Set: Status bit is set + * @arg Reset: Status bit is reset + */ +en_flag_status_t TMR6_GetSta(const M4_TMR6_TypeDef *TMR6x, uint32_t u32StaBit) +{ + en_flag_status_t enRet = Reset; + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_VALID_STABIT_GET(u32StaBit)); + + if(0UL != READ_REG32_BIT(TMR6x->STFLR, u32StaBit)) + { + enRet = Set; + } + return enRet; +} + +/** + * @brief Get Timer6 period number when valid period function enable + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @retval A uint32_t data for periods number + */ +uint32_t TMR6_GetPeriodNum(const M4_TMR6_TypeDef *TMR6x) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + + return (READ_REG32_BIT(TMR6x->STFLR, TMR6_STFLR_VPERNUM) >> TMR6_STFLR_VPERNUM_POS); +} + +/** + * @brief De-initialize the timer6 unit + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @retval None + */ +void TMR6_DeInit(M4_TMR6_TypeDef *TMR6x) +{ + uint32_t u32RefRegRstValue; + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + + if(IS_TMR6_32BIT_UINT(TMR6x)) + { + u32RefRegRstValue = TMR6_REG_REFERENCE_RESET_VALUE_U32; + } + else + { + u32RefRegRstValue = TMR6_REG_REFERENCE_RESET_VALUE_U16; + } + + WRITE_REG32(TMR6x->GCONR, TMR6_REG_GCONR_RESET_VALUE); + WRITE_REG32(TMR6x->CNTER, 0x00000000UL); + WRITE_REG32(TMR6x->UPDAR, 0x00000000UL); + WRITE_REG32(TMR6x->PERAR, u32RefRegRstValue); + WRITE_REG32(TMR6x->PERBR, u32RefRegRstValue); + WRITE_REG32(TMR6x->PERCR, u32RefRegRstValue); + WRITE_REG32(TMR6x->GCMAR, u32RefRegRstValue); + WRITE_REG32(TMR6x->GCMBR, u32RefRegRstValue); + WRITE_REG32(TMR6x->GCMCR, u32RefRegRstValue); + WRITE_REG32(TMR6x->GCMDR, u32RefRegRstValue); + WRITE_REG32(TMR6x->GCMER, u32RefRegRstValue); + WRITE_REG32(TMR6x->GCMFR, u32RefRegRstValue); + WRITE_REG32(TMR6x->SCMAR, u32RefRegRstValue); + WRITE_REG32(TMR6x->SCMBR, u32RefRegRstValue); + WRITE_REG32(TMR6x->SCMCR, u32RefRegRstValue); + WRITE_REG32(TMR6x->SCMDR, u32RefRegRstValue); + WRITE_REG32(TMR6x->SCMER, u32RefRegRstValue); + WRITE_REG32(TMR6x->SCMFR, u32RefRegRstValue); + WRITE_REG32(TMR6x->DTUAR, u32RefRegRstValue); + WRITE_REG32(TMR6x->DTDAR, u32RefRegRstValue); + WRITE_REG32(TMR6x->DTUBR, u32RefRegRstValue); + WRITE_REG32(TMR6x->DTDBR, u32RefRegRstValue); + WRITE_REG32(TMR6x->ICONR, 0x00000000UL); + WRITE_REG32(TMR6x->BCONR, 0x00000000UL); + WRITE_REG32(TMR6x->DCONR, 0x00000000UL); + WRITE_REG32(TMR6x->PCNAR, 0x00000000UL); + WRITE_REG32(TMR6x->PCNBR, 0x00000000UL); + WRITE_REG32(TMR6x->FCNGR, 0x00000000UL); + WRITE_REG32(TMR6x->VPERR, 0x00000000UL); + WRITE_REG32(TMR6x->STFLR, 0x00000000UL); + WRITE_REG32(TMR6x->HSTAR, 0x00000000UL); + WRITE_REG32(TMR6x->HSTPR, 0x00000000UL); + WRITE_REG32(TMR6x->HCLRR, 0x00000000UL); + WRITE_REG32(TMR6x->HUPDR, 0x00000000UL); + WRITE_REG32(TMR6x->HCPAR, 0x00000000UL); + WRITE_REG32(TMR6x->HCPBR, 0x00000000UL); + WRITE_REG32(TMR6x->HCUPR, 0x00000000UL); + WRITE_REG32(TMR6x->HCDOR, 0x00000000UL); +} + +/** + * @brief Initialize the timer6 unit + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] pstcTmr6BaseCntCfg Pointer of configuration structure + * @retval An en_result_t enumeration value. + * @arg Ok: Successfully done + * @arg ErrorInvalidParameter: Parameter error + */ +en_result_t TMR6_Init(M4_TMR6_TypeDef *TMR6x, const stc_tmr6_basecnt_cfg_t* pstcTmr6BaseCntCfg) +{ + en_result_t enRet = ErrorInvalidParameter; + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + + if(NULL != pstcTmr6BaseCntCfg) + { + /* Check parameters */ + DDL_ASSERT(IS_VALID_CNT_MODE(pstcTmr6BaseCntCfg->u32CntMode)); + DDL_ASSERT(IS_VALID_CNT_DIRECTION(pstcTmr6BaseCntCfg->u32CntDir)); + DDL_ASSERT(IS_VALID_CNT_CLK_SRC(pstcTmr6BaseCntCfg->u32CntClkDiv)); + DDL_ASSERT(IS_VALID_STOP_AFTER_OVF_MODE(pstcTmr6BaseCntCfg->u32CntStpAftOvf)); + + MODIFY_REG32(TMR6x->GCONR, + TMR6_INITIAL_MASK, + (pstcTmr6BaseCntCfg->u32CntMode \ + | pstcTmr6BaseCntCfg->u32CntDir \ + | pstcTmr6BaseCntCfg->u32CntClkDiv \ + | pstcTmr6BaseCntCfg->u32CntStpAftOvf)); + enRet = Ok; + } + return enRet; +} + +/** + * @brief Timer6 unit Z phase input mask config + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] pstcTmr6ZMaskCfg Pointer of configuration structure + * @retval An en_result_t enumeration value. + * @arg Ok: Successfully done + * @arg ErrorInvalidParameter: Parameter error + */ +en_result_t TMR6_ZMaskCfg(M4_TMR6_TypeDef *TMR6x, const stc_tmr6_zmask_cfg_t* pstcTmr6ZMaskCfg) +{ + en_result_t enRet = ErrorInvalidParameter; + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + + if(NULL != pstcTmr6ZMaskCfg) + { + DDL_ASSERT(IS_VALID_ZMASK_CYCLES(pstcTmr6ZMaskCfg->u32ZMaskCycle)); + DDL_ASSERT(IS_VALID_POS_UNIT_ZMASK_FUNC(pstcTmr6ZMaskCfg->u32PosCntMaskEn)); + DDL_ASSERT(IS_VALID_REVO_UNIT_ZMASK_FUNC(pstcTmr6ZMaskCfg->u32RevCntMaskEn)); + + MODIFY_REG32(TMR6x->GCONR, + TMR6_ZMASK_CFG_MASK, + pstcTmr6ZMaskCfg->u32ZMaskCycle | pstcTmr6ZMaskCfg->u32PosCntMaskEn | pstcTmr6ZMaskCfg->u32RevCntMaskEn); + + enRet = Ok; + } + return enRet; +} + +/** + * @brief Timer6 counter function command + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] enNewState Disable or Enable the function + * @retval None + */ +void TMR6_CountCmd(M4_TMR6_TypeDef *TMR6x, en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if(Enable == enNewState) + { + SET_REG32_BIT(TMR6x->GCONR, TMR6_GCONR_START); + } + else + { + CLEAR_REG32_BIT(TMR6x->GCONR, TMR6_GCONR_START); + } +} + +/** + * @brief Timer6 counter register set + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] u32Value Counter value + * @retval None + */ +void TMR6_SetCntReg(M4_TMR6_TypeDef *TMR6x, uint32_t u32Value) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + + if(IS_TMR6_32BIT_UINT(TMR6x)) + { + WRITE_REG32(TMR6x->CNTER, u32Value); + } + else + { + DDL_ASSERT(IS_VALID_REG_RANGE_U16(u32Value)); + WRITE_REG16(TMR6x->CNTER, u32Value); + } + +} + +/** + * @brief Timer6 update register set + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] u32Value Counter value + * @retval None + */ +void TMR6_SetUpdateReg(M4_TMR6_TypeDef *TMR6x, uint32_t u32Value) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + + if(IS_TMR6_32BIT_UINT(TMR6x)) + { + WRITE_REG32(TMR6x->UPDAR, u32Value); + } + else + { + DDL_ASSERT(IS_VALID_REG_RANGE_U16(u32Value)); + WRITE_REG16(TMR6x->UPDAR, u32Value); + } +} + +/** + * @brief Timer6 get counter register value + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @retval A uint32_t data for the count register value + */ +uint32_t TMR6_GetCntReg(const M4_TMR6_TypeDef *TMR6x) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + + return READ_REG32(TMR6x->CNTER); +} + +/** + * @brief Timer6 get update register value + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @retval A uint32_t data for register value + */ +uint32_t TMR6_GetUpdateReg(const M4_TMR6_TypeDef *TMR6x) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + + return READ_REG32(TMR6x->UPDAR); +} + +/** + * @brief Timer6 set period register(A~C) + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] u32PeriodReg Period register to be write, @ref TMR6_Period_Register_Index_Define + * @param [in] u32PeriodVal Period value for write + * @retval None + */ +void TMR6_SetPeriodReg(M4_TMR6_TypeDef *TMR6x, uint32_t u32PeriodReg, uint32_t u32PeriodVal) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_VALID_PERIOD_REG(u32PeriodReg)); + __IO uint32_t *TMR6_PERxR = (uint32_t *)((uint32_t)&TMR6x->PERAR + 4UL * u32PeriodReg); + + if(IS_TMR6_32BIT_UINT(TMR6x)) + { + /* 32bit */ + WRITE_REG32(*TMR6_PERxR, u32PeriodVal); + } + else + { + /* 16bit */ + DDL_ASSERT(IS_VALID_REG_RANGE_U16(u32PeriodVal)); + WRITE_REG16(*TMR6_PERxR, u32PeriodVal); + } +} + +/** + * @brief Timer6 set general compare register(A~F) + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] u32GenCmpReg General compare register to be write, @ref TMR6_Compare_Register_Index_Define + * @param [in] u32CmpVal Value for write + * @retval None + */ +void TMR6_SetGenCmpReg(M4_TMR6_TypeDef *TMR6x, uint32_t u32GenCmpReg, uint32_t u32CmpVal) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_VALID_CMP_REG(u32GenCmpReg)); + __IO uint32_t *TMR6_GCMxR = (__IO uint32_t *)((uint32_t)&TMR6x->GCMAR + 4UL * u32GenCmpReg); + + if(IS_TMR6_32BIT_UINT(TMR6x)) + { + /* 32bit */ + WRITE_REG32(*TMR6_GCMxR ,u32CmpVal); + } + else + { + /* 16bit */ + DDL_ASSERT(IS_VALID_REG_RANGE_U16(u32CmpVal)); + WRITE_REG16(*TMR6_GCMxR ,u32CmpVal); + } +} + +/** + * @brief Timer6 set special compare register(A~F) + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] u32SpecialCmpReg Special compare register to be write, @ref TMR6_Compare_Register_Index_Define + * @param [in] u32CmpVal Value for write + * @retval None + */ +void TMR6_SetSpecialCmpReg(M4_TMR6_TypeDef *TMR6x, uint32_t u32SpecialCmpReg, uint32_t u32CmpVal) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_VALID_CMP_REG(u32SpecialCmpReg)); + __IO uint32_t *TMR6_SCMxR = (uint32_t *)((uint32_t)&TMR6x->SCMAR + 4UL * u32SpecialCmpReg); + + if(IS_TMR6_32BIT_UINT(TMR6x)) + { + /* 32bit */ + WRITE_REG32(*TMR6_SCMxR, u32CmpVal); + } + else + { + /* 16bit */ + DDL_ASSERT(IS_VALID_REG_RANGE_U16(u32CmpVal)); + WRITE_REG16(*TMR6_SCMxR, u32CmpVal); + } +} + +/** + * @brief Timer6 set dead time registerr + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] u32DeadTimeReg Special compare register to be write, @ref TMR6_DeadTime_Reg_Define + * @param [in] u32CmpVal Value for write + * @retval None + */ +void TMR6_SetDeadTimeReg(M4_TMR6_TypeDef *TMR6x, uint32_t u32DeadTimeReg, uint32_t u32CmpVal) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_VALID_DEADTIME_REG(u32DeadTimeReg)); + __IO uint32_t *TMR6_DTxyR = (uint32_t *)((uint32_t)&TMR6x->DTUAR + 4UL * u32DeadTimeReg); + + if(IS_TMR6_32BIT_UINT(TMR6x)) + { + /* 32bit */ + WRITE_REG32(*TMR6_DTxyR, u32CmpVal); + } + else + { + /* 16bit */ + DDL_ASSERT(IS_VALID_REG_RANGE_U16(u32CmpVal)); + WRITE_REG16(*TMR6_DTxyR, u32CmpVal); + } +} + +/** + * @brief Timer6 get general compare registers value(A~F) + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] u32GenCmpReg General compare register to be read, @ref TMR6_Compare_Register_Index_Define + * @retval A uint32_t data for value of the register + */ +uint32_t TMR6_GetGenCmpReg(const M4_TMR6_TypeDef *TMR6x, uint32_t u32GenCmpReg) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_VALID_CMP_REG(u32GenCmpReg)); + __IO uint32_t *TMR6_GCMxR = (uint32_t *)((uint32_t)&TMR6x->GCMAR + 4UL * u32GenCmpReg); + + return READ_REG32(*TMR6_GCMxR); +} + +/** + * @brief Timer6 get special compare registers value(A~F) + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] u32SpecialCmpReg Special compare register to be read, @ref TMR6_Compare_Register_Index_Define + * @retval A uint32_t data for value of the register + */ +uint32_t TMR6_GetSpecialCmpReg(const M4_TMR6_TypeDef *TMR6x, uint32_t u32SpecialCmpReg) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_VALID_CMP_REG(u32SpecialCmpReg)); + __IO uint32_t *TMR6_SCMxR = (uint32_t *)((uint32_t)&TMR6x->SCMAR + 4UL * u32SpecialCmpReg); + + return READ_REG32(*TMR6_SCMxR); +} + +/** + * @brief Timer6 Get period register(A~C) + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] u32PeriodReg Period register to be write, @ref TMR6_Period_Register_Index_Define + * @retval A uint32_t data for value of the register + */ +uint32_t TMR6_GetPeriodReg(const M4_TMR6_TypeDef *TMR6x, uint32_t u32PeriodReg) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_VALID_PERIOD_REG(u32PeriodReg)); + __IO uint32_t *TMR6_PERxR = (uint32_t *)((uint32_t)&TMR6x->PERAR + 4UL * u32PeriodReg); + + return READ_REG32(*TMR6_PERxR); +} + +/** + * @brief Timer6 get dead time register + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] u32DeadTimeReg Dead time register to be write, @ref TMR6_DeadTime_Reg_Define + * @retval A uint32_t data for value of the register + */ +uint32_t TMR6_GetDeadTimeReg(const M4_TMR6_TypeDef *TMR6x, uint32_t u32DeadTimeReg) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_VALID_DEADTIME_REG(u32DeadTimeReg)); + __IO uint32_t *TMR6_DTxyR = (uint32_t *)((uint32_t)&TMR6x->DTUAR + 4UL * u32DeadTimeReg); + + return READ_REG32(*TMR6_DTxyR); +} + +/** + * @brief Timer6 general compare buffer function configuration + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] u32CmpChIdx General compare buffer chose, @ref TMR6_Compare_channel_Define + * @param [in] pstcGenBufCfg Pointer of configuration structure + * @retval An en_result_t enumeration value. + * @arg Ok: Successfully done + * @arg ErrorInvalidParameter: Parameter error + */ +en_result_t TMR6_GenCmpBufCfg(M4_TMR6_TypeDef *TMR6x, uint32_t u32CmpChIdx, const stc_tmr6_buf_func_cfg_t* pstcGenBufCfg) +{ + en_result_t enRet = ErrorInvalidParameter; + if(NULL != pstcGenBufCfg) + { + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_VALID_CMP_CH(u32CmpChIdx)); + DDL_ASSERT(IS_VALID_BUF_STAT(pstcGenBufCfg->u32BufFunCmd)); + DDL_ASSERT(IS_VALID_BUF_FUN_NUM(pstcGenBufCfg->u32BufNum)); + DDL_ASSERT(IS_VALID_BUF_TRANS_TIM(pstcGenBufCfg->u32BufTransTim)); + + if(TMR6_CH_A == u32CmpChIdx) + { + MODIFY_REG32(TMR6x->BCONR, + BCONR_REG_CFG_MSK<u32BufFunCmd | pstcGenBufCfg->u32BufNum | pstcGenBufCfg->u32BufTransTim)<BCONR, + BCONR_REG_CFG_MSK<u32BufFunCmd | pstcGenBufCfg->u32BufNum | pstcGenBufCfg->u32BufTransTim)<u32BufFunCmd)); + DDL_ASSERT(IS_VALID_BUF_FUN_NUM(pstcSpecialBufCfg->u32BufNum)); + DDL_ASSERT(IS_VALID_BUF_TRANS_TIM(pstcSpecialBufCfg->u32BufTransTim)); + + if(TMR6_CH_A == u32CmpChIdx) + { + MODIFY_REG32(TMR6x->BCONR, + BCONR_REG_CFG_MSK<u32BufFunCmd | pstcSpecialBufCfg->u32BufNum | pstcSpecialBufCfg->u32BufTransTim)<BCONR, + BCONR_REG_CFG_MSK<u32BufFunCmd | pstcSpecialBufCfg->u32BufNum | pstcSpecialBufCfg->u32BufTransTim)<u32BufFunCmd)); + DDL_ASSERT(IS_VALID_BUF_FUN_NUM(pstcPeriodBufCfg->u32BufNum)); + DDL_ASSERT(IS_VALID_BUF_TRANS_TIM(pstcPeriodBufCfg->u32BufTransTim)); + + MODIFY_REG32(TMR6x->BCONR, + BCONR_REG_CFG_MSK<u32BufFunCmd | pstcPeriodBufCfg->u32BufNum | pstcPeriodBufCfg->u32BufTransTim)<u32StatChA)); + DDL_ASSERT(IS_VALID_VALID_PERIOD_STAT_CHB(pstcValidPeriodCfg->u32StatChB)); + DDL_ASSERT(IS_VALID_PERIOD_CNT_COND(pstcValidPeriodCfg->u32CntCond)); + DDL_ASSERT(IS_VALID_PERIOD_CNT(pstcValidPeriodCfg->u32PeriodInterval)); + + WRITE_REG32(TMR6x->VPERR, pstcValidPeriodCfg->u32StatChA | + pstcValidPeriodCfg->u32StatChB | + pstcValidPeriodCfg->u32CntCond | + pstcValidPeriodCfg->u32PeriodInterval); + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Port input configuration(Trig) + * @param [in] TMR6x Timer6 unit + * @param [in] u32PortSel Input port to be configured + * @arg TMR6_IO_PWMA + * @arg TMR6_IO_PWMB + * @arg TMR6_INPUT_TRIGA + * @arg TMR6_INPUT_TRIGB + * @arg TMR6_INPUT_TRIGC + * @arg TMR6_INPUT_TRIGD + * @param [in] pstcTmr6PortInputCfg Point Input Config Pointer + * @retval An en_result_t enumeration value. + * @arg Ok: Successfully done + * @arg ErrorInvalidParameter: Parameter error + */ +en_result_t TMR6_PortInputConfig(M4_TMR6_TypeDef *TMR6x, + uint32_t u32PortSel, + const stc_tmr6_port_input_cfg_t* pstcTmr6PortInputCfg) +{ + en_result_t enRet = ErrorInvalidParameter; + + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + + if (NULL != pstcTmr6PortInputCfg) + { + DDL_ASSERT(IS_VALID_INPUT_PORT(u32PortSel)); + DDL_ASSERT(IS_VALID_PORT_MODE_FUNC(pstcTmr6PortInputCfg->u32PortMode)); + DDL_ASSERT(IS_VALID_PORT_INPUT_FILTER_STA(pstcTmr6PortInputCfg->u32FilterSta)); + DDL_ASSERT(IS_VALID_INPUT_FILTER_CLK(pstcTmr6PortInputCfg->u32FltClk)); + + enRet = Ok; + switch (u32PortSel) + { + case TMR6_IO_PWMA: + MODIFY_REG32(TMR6x->PCNAR, + TMR6_PCNAR_CAPMDA, + pstcTmr6PortInputCfg->u32PortMode); + MODIFY_REG32(TMR6x->FCNGR, + TMR6_FCNGR_NOFIENGA | TMR6_FCNGR_NOFICKGA, + pstcTmr6PortInputCfg->u32FilterSta<u32FltClk<PCNBR, + TMR6_PCNBR_CAPMDB, + pstcTmr6PortInputCfg->u32PortMode); + MODIFY_REG32(TMR6x->FCNGR, + TMR6_FCNGR_NOFIENGB | TMR6_FCNGR_NOFICKGB, + pstcTmr6PortInputCfg->u32FilterSta<u32FltClk<FCNTR, + TMR6_FCNTR_NOFIENTA | TMR6_FCNTR_NOFICKTA, + pstcTmr6PortInputCfg->u32FilterSta<u32FltClk<FCNTR, + TMR6_FCNTR_NOFIENTB | TMR6_FCNTR_NOFICKTB, + pstcTmr6PortInputCfg->u32FilterSta<u32FltClk<FCNTR, + TMR6_FCNTR_NOFIENTC | TMR6_FCNTR_NOFICKTC, + pstcTmr6PortInputCfg->u32FilterSta<u32FltClk<FCNTR, + TMR6_FCNTR_NOFIENTD | TMR6_FCNTR_NOFICKTD, + pstcTmr6PortInputCfg->u32FilterSta<u32FltClk<u32PortMode)); + DDL_ASSERT(IS_VALID_FORCE_OUTPUT_STA_RESULT(pstcTmr6PortOutputCfg->u32NextPeriodForceSta)); + DDL_ASSERT(IS_VALID_OUTPUT_STA_RESULT(pstcTmr6PortOutputCfg->u32DownCntMatchAnotherCmpRegSta)); + DDL_ASSERT(IS_VALID_OUTPUT_STA_RESULT(pstcTmr6PortOutputCfg->u32UpCntMatchAnotherCmpRegSta)); + DDL_ASSERT(IS_VALID_OUTPUT_STA_RESULT(pstcTmr6PortOutputCfg->u32DownCntMatchCmpRegSta)); + DDL_ASSERT(IS_VALID_OUTPUT_STA_RESULT(pstcTmr6PortOutputCfg->u32UpCntMatchCmpRegSta)); + DDL_ASSERT(IS_VALID_OUTPUT_STA_RESULT(pstcTmr6PortOutputCfg->u32UnderflowSta)); + DDL_ASSERT(IS_VALID_OUTPUT_STA_RESULT(pstcTmr6PortOutputCfg->u32OverflowSta)); + + DDL_ASSERT(IS_VALID_OUTPUT_STA_STA(pstcTmr6PortOutputCfg->u32StopSta)); + DDL_ASSERT(IS_VALID_OUTPUT_STA_STA(pstcTmr6PortOutputCfg->u32StartSta)); + + if(TMR6_IO_PWMA == u32PortSel) + { + MODIFY_REG32(TMR6x->PCNAR, + PCNA_BR_REG_OUTPUT_CFG_MASK, + pstcTmr6PortOutputCfg->u32PortMode | TMR6_PCNAR_OUTENA + | pstcTmr6PortOutputCfg->u32NextPeriodForceSta << TMR6_PCNAR_FORCA_POS + | pstcTmr6PortOutputCfg->u32DownCntMatchAnotherCmpRegSta << TMR6_PCNAR_CMBDCA_POS + | pstcTmr6PortOutputCfg->u32UpCntMatchAnotherCmpRegSta << TMR6_PCNAR_CMBUCA_POS + | pstcTmr6PortOutputCfg->u32DownCntMatchCmpRegSta << TMR6_PCNAR_CMADCA_POS + | pstcTmr6PortOutputCfg->u32UpCntMatchCmpRegSta << TMR6_PCNAR_CMAUCA_POS + | pstcTmr6PortOutputCfg->u32UnderflowSta << TMR6_PCNAR_UDFCA_POS + | pstcTmr6PortOutputCfg->u32OverflowSta << TMR6_PCNAR_OVFCA_POS + | pstcTmr6PortOutputCfg->u32StopSta << TMR6_PCNAR_STPCA_POS + | pstcTmr6PortOutputCfg->u32StartSta << TMR6_PCNAR_STACA_POS); + } + else + { + MODIFY_REG32(TMR6x->PCNBR, + PCNA_BR_REG_OUTPUT_CFG_MASK, + pstcTmr6PortOutputCfg->u32PortMode | TMR6_PCNBR_OUTENB + | pstcTmr6PortOutputCfg->u32NextPeriodForceSta << TMR6_PCNBR_FORCB_POS + | pstcTmr6PortOutputCfg->u32DownCntMatchAnotherCmpRegSta << TMR6_PCNBR_CMADCB_POS + | pstcTmr6PortOutputCfg->u32UpCntMatchAnotherCmpRegSta << TMR6_PCNBR_CMAUCB_POS + | pstcTmr6PortOutputCfg->u32DownCntMatchCmpRegSta << TMR6_PCNBR_CMBDCB_POS + | pstcTmr6PortOutputCfg->u32UpCntMatchCmpRegSta << TMR6_PCNBR_CMBUCB_POS + | pstcTmr6PortOutputCfg->u32UnderflowSta << TMR6_PCNBR_UDFCB_POS + | pstcTmr6PortOutputCfg->u32OverflowSta << TMR6_PCNBR_OVFCB_POS + | pstcTmr6PortOutputCfg->u32StopSta << TMR6_PCNBR_STPCB_POS + | pstcTmr6PortOutputCfg->u32StartSta << TMR6_PCNBR_STACB_POS); + } + enRet = Ok; + } + return enRet; +} + +/** + * @brief EMB function configuration + * @param [in] TMR6x Timer6 unit + * @param [in] u32PortSel Output port to be configured + * @arg TMR6_IO_PWMA + * @arg TMR6_IO_PWMB + * @param [in] pstcTmr6EmbCfg Point EMB function Config Pointer + * @retval An en_result_t enumeration value. + * @arg Ok: Successfully done + * @arg ErrorInvalidParameter: Parameter error + */ +en_result_t TMR6_EMBConfig(M4_TMR6_TypeDef *TMR6x, + uint32_t u32PortSel, + const stc_tmr6_emb_cfg_t* pstcTmr6EmbCfg) +{ + __IO uint32_t *PCNXR; + en_result_t enRet = ErrorInvalidParameter; + + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + + if (NULL != pstcTmr6EmbCfg) + { + DDL_ASSERT(IS_VALID_OUTPUT_PORT(u32PortSel)); + DDL_ASSERT(IS_VALID_EMB_CH(pstcTmr6EmbCfg->u32ValidCh)); + DDL_ASSERT(IS_VALID_EMB_RELEASE_MODE(pstcTmr6EmbCfg->u32ReleaseMode)); + DDL_ASSERT(IS_VALID_EMB_VALID_PORT_STA(pstcTmr6EmbCfg->u32PortSta)); + + if(TMR6_IO_PWMA == u32PortSel) + { + PCNXR = (__IO uint32_t*)&TMR6x->PCNAR; + } + else + { + PCNXR = (__IO uint32_t*)&TMR6x->PCNBR; + } + + MODIFY_REG32(*PCNXR, + PCNA_BR_REG_EMB_CFG_MASK, + pstcTmr6EmbCfg->u32ValidCh + | pstcTmr6EmbCfg->u32ReleaseMode + | pstcTmr6EmbCfg->u32PortSta ); + + enRet = Ok; + } + return enRet; + +} + +/** + * @brief Timer6 dead time function command + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] enNewState Disable or Enable the function + * @retval None + */ +void TMR6_DeadTimeFuncCmd(M4_TMR6_TypeDef *TMR6x, en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if(Enable == enNewState) + { + SET_REG32_BIT(TMR6x->DCONR, TMR6_DCONR_DTCEN); + } + else + { + CLEAR_REG32_BIT(TMR6x->DCONR, TMR6_DCONR_DTCEN); + } +} + +/** + * @brief DeadTime function configuration + * @param [in] TMR6x Timer6 unit + * @param [in] pstcTmr6DTCfg Timer6 dead time config pointer + * @retval An en_result_t enumeration value. + * @arg Ok: Successfully done + * @arg ErrorInvalidParameter: Parameter error + */ +en_result_t TMR6_DeadTimeCfg(M4_TMR6_TypeDef *TMR6x, const stc_tmr6_deadtime_cfg_t* pstcTmr6DTCfg) +{ + en_result_t enRet = ErrorInvalidParameter; + + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + + if (NULL != pstcTmr6DTCfg) + { + DDL_ASSERT(IS_VALID_DEADTIME_EQUAL_FUNC_REG(pstcTmr6DTCfg->u32DtEqualUpDwn)); + DDL_ASSERT(IS_VALID_DEADTIME_BUF_FUNC_DTUAR_REG(pstcTmr6DTCfg->u32EnDtBufUp)); + DDL_ASSERT(IS_VALID_DEADTIME_BUF_FUNC_DTDAR_REG(pstcTmr6DTCfg->u32EnDtBufDwn)); + DDL_ASSERT(IS_VALID_DEADTIME_BUF_TRANS_COND_REG(pstcTmr6DTCfg->u32DtUpdCond)); + + WRITE_REG32(TMR6x->DCONR, pstcTmr6DTCfg->u32DtEqualUpDwn + | pstcTmr6DTCfg->u32EnDtBufUp + | pstcTmr6DTCfg->u32EnDtBufDwn + | pstcTmr6DTCfg->u32DtUpdCond); + enRet = Ok; + } + return enRet; +} + +/** + * @brief Software Sync Start + * @param [in] u32UnitCombine Software Sync units, This parameter can + * be one or any combination of the parameter + * @ref TMR6_Soft_Sync_Ctrl_Unit_Number_define + * @retval None + */ +void TMR6_SwSyncStart(uint32_t u32UnitCombine) +{ + DDL_ASSERT(IS_VALID_SW_CTRL_CFG(u32UnitCombine)); + WRITE_REG32(M4_TMR6_1->SSTAR, u32UnitCombine); +} + +/** + * @brief Software Sync Stop + * @param [in] u32UnitCombine Software Sync units, This parameter can + * be one or any combination of the parameter + * @ref TMR6_Soft_Sync_Ctrl_Unit_Number_define + * @retval None + */ +void TMR6_SwSyncStop(uint32_t u32UnitCombine) +{ + DDL_ASSERT(IS_VALID_SW_CTRL_CFG(u32UnitCombine)); + WRITE_REG32(M4_TMR6_1->SSTPR, u32UnitCombine); +} + +/** + * @brief Software Sync clear + * @param [in] u32UnitCombine Software Sync units, This parameter can + * be one or any combination of the parameter + * @ref TMR6_Soft_Sync_Ctrl_Unit_Number_define + * @retval None + */ +void TMR6_SwSyncClr(uint32_t u32UnitCombine) +{ + DDL_ASSERT(IS_VALID_SW_CTRL_CFG(u32UnitCombine)); + WRITE_REG32(M4_TMR6_1->SCLRR, u32UnitCombine); +} + +/** + * @brief Software Sync update + * @param [in] u32UnitCombine Software Sync units, This parameter can + * be one or any combination of the parameter + * @ref TMR6_Soft_Sync_Ctrl_Unit_Number_define + * @retval None + */ +void TMR6_SwSyncUpdate(uint32_t u32UnitCombine) +{ + DDL_ASSERT(IS_VALID_SW_CTRL_CFG(u32UnitCombine)); + WRITE_REG32(M4_TMR6_1->SUPDR, u32UnitCombine); +} + +/** + * @brief Hardware start function command + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] enNewState Disable or Enable the function + * @retval None + */ +void TMR6_HwStartFuncCmd(M4_TMR6_TypeDef *TMR6x, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + MODIFY_REG32(TMR6x->HSTAR, TMR6_HSTAR_STAS, (uint32_t)enNewState << TMR6_HSTAR_STAS_POS); +} + +/** + * @brief Hardware stop function command + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] enNewState Disable or Enable the function + * @retval None + */ +void TMR6_HwStopFuncCmd(M4_TMR6_TypeDef *TMR6x, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + MODIFY_REG32(TMR6x->HSTPR, TMR6_HSTPR_STPS, (uint32_t)enNewState << TMR6_HSTPR_STPS_POS); +} + +/** + * @brief Hardware clear function command + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] enNewState Disable or Enable the function + * @retval None + */ +void TMR6_HwClrFuncCmd(M4_TMR6_TypeDef *TMR6x, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + MODIFY_REG32(TMR6x->HCLRR, TMR6_HCLRR_CLES, (uint32_t)enNewState << TMR6_HCLRR_CLES_POS); +} + +/** + * @brief Hardware update function command + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] enNewState Disable or Enable the function + * + * @retval None + */ +void TMR6_HwUpdateFuncCmd(M4_TMR6_TypeDef *TMR6x, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + MODIFY_REG32(TMR6x->HUPDR, TMR6_HUPDR_UPDS, (uint32_t)enNewState << TMR6_HUPDR_UPDS_POS); +} + +/** + * @brief Hardware start condtion command + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] u32CondSrc Events source for hardware start, maybe one or any combination of the parameter + * @ref TMR6_hardware_control_event_define + * @param [in] enNewState The function new state + * @arg This parameter can be: Enable or Disable + * @retval None + */ +void TMR6_HwStartCondCmd(M4_TMR6_TypeDef *TMR6x, + uint32_t u32CondSrc, + en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_VALID_HW_CTRL_EVENTS(u32CondSrc)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(TMR6x->HSTAR, u32CondSrc); + } + else + { + CLEAR_REG32_BIT(TMR6x->HSTAR, u32CondSrc); + } +} + +/** + * @brief Hardware start condition clear + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @retval None + */ +void TMR6_HwStartCondClr(M4_TMR6_TypeDef *TMR6x) +{ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + + WRITE_REG32(TMR6x->HSTAR, 0UL); +} + +/** + * @brief Hardware stop condtion command + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] u32CondSrc Events source for hardware stop, maybe one or any combination of the parameter + * @ref TMR6_hardware_control_event_define + * @param [in] enNewState The function new state + * @arg This parameter can be: Enable or Disable + * @retval None + */ +void TMR6_HwStopCondCmd(M4_TMR6_TypeDef *TMR6x, + uint32_t u32CondSrc, + en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_VALID_HW_CTRL_EVENTS(u32CondSrc)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(TMR6x->HSTPR, u32CondSrc); + } + else + { + CLEAR_REG32_BIT(TMR6x->HSTPR, u32CondSrc); + } +} + +/** + * @brief Hardware stop condtion clear + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @retval None + */ +void TMR6_HwStopCondClr(M4_TMR6_TypeDef *TMR6x) +{ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + + WRITE_REG32(TMR6x->HSTPR, 0UL); +} + +/** + * @brief Hardware clear condtion command + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] u32CondSrc Events source for hardware clear, maybe one or any combination of the parameter + * @ref TMR6_hardware_control_event_define + * @param [in] enNewState The function new state + * @arg This parameter can be: Enable or Disable + * @retval None + */ +void TMR6_HwClrCondCmd(M4_TMR6_TypeDef *TMR6x, + uint32_t u32CondSrc, + en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_VALID_HW_CTRL_EVENTS(u32CondSrc)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(TMR6x->HCLRR, u32CondSrc); + } + else + { + CLEAR_REG32_BIT(TMR6x->HCLRR, u32CondSrc); + } +} + +/** + * @brief Hardware clear condtion clear + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @retval None + */ +void TMR6_HwClrCondClr(M4_TMR6_TypeDef *TMR6x) +{ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + + WRITE_REG32(TMR6x->HCLRR, 0UL); +} + +/** + * @brief Hardware update condtion command + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] u32CondSrc Events source for hardware update, maybe one or any combination of the parameter + * @ref TMR6_hardware_control_event_define + * @param [in] enNewState The function new state + * @arg This parameter can be: Enable or Disable + * @retval None + */ +void TMR6_HwUpdCondCmd(M4_TMR6_TypeDef *TMR6x, + uint32_t u32CondSrc, + en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_VALID_HW_CTRL_EVENTS(u32CondSrc)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(TMR6x->HUPDR, u32CondSrc); + } + else + { + CLEAR_REG32_BIT(TMR6x->HUPDR, u32CondSrc); + } +} + +/** + * @brief Hardware update conditon clear + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @retval None + */ +void TMR6_HwUpdCondClr(M4_TMR6_TypeDef *TMR6x) +{ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + + WRITE_REG32(TMR6x->HUPDR, 0UL); +} + +/** + * @brief Hardware capture condtion command for channel A + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] u32CondSrc Events source for hardware capture, maybe one or any combination of the parameter + * @ref TMR6_hardware_control_event_define + * @param [in] enNewState The function new state + * @arg This parameter can be: Enable or Disable + * @retval None + */ +void TMR6_HwCaptureChACondCmd(M4_TMR6_TypeDef *TMR6x, + uint32_t u32CondSrc, + en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_VALID_HW_CTRL_EVENTS(u32CondSrc)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(TMR6x->HCPAR, u32CondSrc); + } + else + { + CLEAR_REG32_BIT(TMR6x->HCPAR, u32CondSrc); + } +} + +/** + * @brief Hardware capture condition clear for channel A + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @retval None + */ +void TMR6_HwCaptureChACondClr(M4_TMR6_TypeDef *TMR6x) +{ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + + WRITE_REG32(TMR6x->HCPAR, 0UL); +} + +/** + * @brief Hardware capture condtion command for channel B + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] u32CondSrc Events source for hardware capture, maybe one or any combination of the parameter + * @ref TMR6_hardware_control_event_define + * @param [in] enNewState The function new state + * @arg This parameter can be: Enable or Disable + * @retval None + */ +void TMR6_HwCaptureChBCondCmd(M4_TMR6_TypeDef *TMR6x, + uint32_t u32CondSrc, + en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_VALID_HW_CTRL_EVENTS(u32CondSrc)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(TMR6x->HCPBR, u32CondSrc); + } + else + { + CLEAR_REG32_BIT(TMR6x->HCPBR, u32CondSrc); + } +} + +/** + * @brief Hardware capture condition clear for channel B + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @retval None + */ +void TMR6_HwCaptureChBCondClr(M4_TMR6_TypeDef *TMR6x) +{ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + + WRITE_REG32(TMR6x->HCPBR, 0UL); +} + +/** + * @brief Hardware increase conditon command + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] u32CondSrc Events source for hardware count, maybe one or any combination of the parameter + * @ref TMR6_hardware_count_event_define + * @param [in] enNewState The function new state + * @arg This parameter can be: Enable or Disable + * @retval None + */ +void TMR6_HwIncreaseCondCmd(M4_TMR6_TypeDef *TMR6x, + uint32_t u32CondSrc, + en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_VALID_HW_CNT_EVENTS(u32CondSrc)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(TMR6x->HCUPR, u32CondSrc); + } + else + { + CLEAR_REG32_BIT(TMR6x->HCUPR, u32CondSrc); + } +} + +/** + * @brief Hardware increase condition clear + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3s + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @retval None + */ +void TMR6_HwIncreaseCondClr(M4_TMR6_TypeDef *TMR6x) +{ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + + WRITE_REG32(TMR6x->HCUPR, 0UL); +} + +/** + * @brief Hardware decrease condition command + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @param [in] u32CondSrc Events source for hardware count, maybe one or any combination of the parameter + * @ref TMR6_hardware_count_event_define + * @param [in] enNewState The function new state + * @arg This parameter can be: Enable or Disable + * @retval None + */ +void TMR6_HwDecreaseCondCmd(M4_TMR6_TypeDef *TMR6x, + uint32_t u32CondSrc, + en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + DDL_ASSERT(IS_VALID_HW_CNT_EVENTS(u32CondSrc)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(TMR6x->HCDOR, u32CondSrc); + } + else + { + CLEAR_REG32_BIT(TMR6x->HCDOR, u32CondSrc); + } +} + +/** + * @brief Hardware decrease condtion clear + * @param [in] TMR6x Timer6 unit + * @arg M4_TMR6_1 + * @arg M4_TMR6_2 + * @arg M4_TMR6_3 + * @arg M4_TMR6_4 + * @arg M4_TMR6_5 + * @arg M4_TMR6_6 + * @arg M4_TMR6_7 + * @arg M4_TMR6_8 + * @retval None + */ +void TMR6_HwDecreaseCondClr(M4_TMR6_TypeDef *TMR6x) +{ + DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x)); + + WRITE_REG32(TMR6x->HCDOR, 0UL); +} + +/** + * @brief Timer6 Hardware trigger event configuration for(trigger0~trigger3) + * @param [in] u32TrigIndex Timer6 Hardware trigger index + * @ref TMR6_Hardware_Trigger_Index_define + * @param [in] enEvent Event configuration for timer6 hardware trigger + * @retval None + */ +void TMR6_SetTriggerSrc(uint32_t u32TrigIndex, en_event_src_t enEvent) +{ + DDL_ASSERT(IS_VALID_HW_TRIGGER_INDEX(u32TrigIndex)); + + __IO uint32_t *TMR6_HTSSRx = (__IO uint32_t *)((uint32_t)&M4_AOS->TMR6_HTSSR1 + 4UL * u32TrigIndex); + MODIFY_REG32(*TMR6_HTSSRx, AOS_TMR6_HTSSR_TRGSEL, enEvent); +} + +/** + * @brief Timer6 Hardware trigger common event function command for(trigger0~trigger3) + * @param [in] u32TrigIndex Timer6 Hardware trigger index + * @ref TMR6_Hardware_Trigger_Index_define + * @param [in] u32ComTrig Common trigger event enable. + * This parameter can be one of the following values: + * @arg TMR6_COM_TRIG1: Common trigger event 1. + * @arg TMR6_COM_TRIG2: Common trigger event 2. + * @param [in] enNewState New state of common trigger function. + * @retval none + */ +void TMR6_ComTriggerCmd(uint32_t u32TrigIndex, uint32_t u32ComTrig, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_VALID_HW_TRIGGER_INDEX(u32TrigIndex)); + DDL_ASSERT(IS_VALID_TMR6_COM_TRIG(u32ComTrig)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + __IO uint32_t *TMR6_HTSSRx = (__IO uint32_t *)((uint32_t)&M4_AOS->TMR6_HTSSR1 + 4UL * u32TrigIndex); + + if (Enable == enNewState) + { + SET_REG32_BIT(*TMR6_HTSSRx, u32ComTrig); + } + else + { + CLEAR_REG32_BIT(*TMR6_HTSSRx, u32ComTrig); + } +} + +/** + * @brief Set the fields of structure stc_tmr6_basecnt_cfg_t to default values + * @param [out] pstcInit Pointer to a @ref stc_tmr6_basecnt_cfg_t structure + * @retval An en_result_t enumeration value. + * @arg Ok: Successfully done + * @arg ErrorInvalidParameter: Parameter error + */ +en_result_t TMR6_BaseCntStructInit(stc_tmr6_basecnt_cfg_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + pstcInit->u32CntMode = TMR6_MODE_SAWTOOTH; + pstcInit->u32CntDir = TMR6_CNT_INCREASE; + pstcInit->u32CntClkDiv = TMR6_CLK_PCLK0_DIV1; + pstcInit->u32CntStpAftOvf = TMR6_CNT_CONTINUOUS; + enRet = Ok; + } + return enRet; +} + +/** + * @brief Set the fields of structure stc_tmr6_buf_func_cfg_t to default values + * @param [out] pstcInit Pointer to a @ref stc_tmr6_buf_func_cfg_t structure + * @retval An en_result_t enumeration value. + * @arg Ok: Successfully done + * @arg ErrorInvalidParameter: Parameter error + */ +en_result_t TMR6_BufFuncStructInit(stc_tmr6_buf_func_cfg_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + pstcInit->u32BufFunCmd = TMR6_BUF_FUNC_OFF; + pstcInit->u32BufNum = TMR6_BUF_FUNC_SINGLE; + pstcInit->u32BufTransTim = TMR6_BUF_TRANS_TIM_NONE; + + enRet = Ok; + } + return enRet; +} + +/** + * @brief Set the fields of structure stc_tmr6_valid_period_func_cfg_t to default values + * @param [out] pstcInit Pointer to a @ref stc_tmr6_valid_period_func_cfg_t structure + * @retval An en_result_t enumeration value. + * @arg Ok: Successfully done + * @arg ErrorInvalidParameter: Parameter error + */ +en_result_t TMR6_ValidPeriodStructInit(stc_tmr6_valid_period_func_cfg_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + pstcInit->u32StatChA = TMR6_VALID_PERIOD_FUNC_CHA_OFF; + pstcInit->u32StatChB = TMR6_VALID_PERIOD_FUNC_CHB_OFF; + pstcInit->u32CntCond = TMR6_VALID_PERIOD_FUNC_OFF; + pstcInit->u32PeriodInterval = TMR6_VALID_PERIOD_CNT_INVALID; + + enRet = Ok; + } + return enRet; +} + +/** + * @brief Set the fields of structure stc_tmr6_port_input_cfg_t to default values + * @param [out] pstcInit Pointer to a @ref stc_tmr6_port_input_cfg_t structure + * @retval An en_result_t enumeration value. + * @arg Ok: Successfully done + * @arg ErrorInvalidParameter: Parameter error + */ +en_result_t TMR6_PortInputStructInit(stc_tmr6_port_input_cfg_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + pstcInit->u32PortMode = TMR6_PORT_CAPTURE_INPUT; + pstcInit->u32FilterSta = TMR6_PORT_INPUT_FILTER_OFF; + pstcInit->u32FltClk = TMR6_INPUT_FILTER_PCLK0_DIV1; + + enRet = Ok; + } + return enRet; +} + +/** + * @brief Set the fields of structure stc_tmr6_port_output_cfg_t to default values + * @param [out] pstcInit Pointer to a @ref stc_tmr6_port_output_cfg_t structure + * @retval An en_result_t enumeration value. + * @arg Ok: Successfully done + * @arg ErrorInvalidParameter: Parameter error + */ +en_result_t TMR6_PortOutputStructInit(stc_tmr6_port_output_cfg_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + pstcInit->u32PortMode = TMR6_PORT_COMPARE_OUTPUT; + pstcInit->u32NextPeriodForceSta = TMR6_PORT_OUTPUT_STA_LOW; + pstcInit->u32DownCntMatchAnotherCmpRegSta = TMR6_PORT_OUTPUT_STA_LOW; + pstcInit->u32UpCntMatchAnotherCmpRegSta = TMR6_PORT_OUTPUT_STA_LOW; + pstcInit->u32DownCntMatchCmpRegSta = TMR6_PORT_OUTPUT_STA_LOW; + pstcInit->u32UpCntMatchCmpRegSta = TMR6_PORT_OUTPUT_STA_LOW; + pstcInit->u32UnderflowSta = TMR6_PORT_OUTPUT_STA_LOW; + pstcInit->u32OverflowSta = TMR6_PORT_OUTPUT_STA_LOW; + pstcInit->u32StopSta = TMR6_PORT_OUTPUT_STA_LOW; + pstcInit->u32StartSta = TMR6_PORT_OUTPUT_STA_LOW; + + enRet = Ok; + } + return enRet; +} + +/** + * @brief Set the fields of structure stc_tmr6_emb_cfg_t to default values + * @param [out] pstcInit Pointer to a @ref stc_tmr6_emb_cfg_t structure + * @retval An en_result_t enumeration value. + * @arg Ok: Successfully done + * @arg ErrorInvalidParameter: Parameter error + */ +en_result_t TMR6_EMBCfgStructInit(stc_tmr6_emb_cfg_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + pstcInit->u32ValidCh = TMR6_EMB_EVENT_VALID_CH0; + pstcInit->u32ReleaseMode = TMR6_EMB_RELEASE_IMMEDIATE; + pstcInit->u32PortSta = TMR6_EMB_PORTSTA_NORMAL; + + enRet = Ok; + } + return enRet; +} + +/** + * @brief Set the fields of structure stc_tmr6_deadtime_cfg_t to default values + * @param [out] pstcInit Pointer to a @ref stc_tmr6_deadtime_cfg_t structure + * @retval An en_result_t enumeration value. + * @arg Ok: Successfully done + * @arg ErrorInvalidParameter: Parameter error + */ +en_result_t TMR6_DeadTimeCfgStructInit(stc_tmr6_deadtime_cfg_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + pstcInit->u32DtEqualUpDwn = TMR6_DEADTIME_EQUAL_OFF; + pstcInit->u32EnDtBufUp = TMR6_DEADTIME_CNT_UP_BUF_OFF; + pstcInit->u32EnDtBufDwn = TMR6_DEADTIME_CNT_DOWN_BUF_OFF; + + enRet = Ok; + } + return enRet; +} + +/** + * @brief Set the fields of structure stc_tmr6_zmask_cfg_t to default values + * @param [out] pstcInit Pointer to a @ref stc_tmr6_zmask_cfg_t structure + * @retval An en_result_t enumeration value. + * @arg Ok: Successfully done + * @arg ErrorInvalidParameter: Parameter error + */ +en_result_t TMR6_ZMaskCfgStructInit(stc_tmr6_zmask_cfg_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + pstcInit->u32ZMaskCycle = TMR6_ZMASK_CYCLE_FUNC_INVALID; + pstcInit->u32PosCntMaskEn = TMR6_POS_CLR_ZMASK_FUNC_INVALID; + pstcInit->u32RevCntMaskEn = TMR6_REVO_CNT_ZMASK_FUNC_INVALID; + + enRet = Ok; + } + return enRet; +} +/** + * @} + */ + +#endif /* DDL_TMR6_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmra.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmra.c new file mode 100644 index 0000000000..42a73b173d --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmra.c @@ -0,0 +1,1561 @@ +/** + ******************************************************************************* + * @file hc32f4a0_tmra.c + * @brief This file provides firmware functions to manage the TMRA(TimerA). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Wuze First version + 2020-07-02 Wuze API TMRA_SyncStartCmd() refine. + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_tmra.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_TMRA TMRA + * @brief TMRA Driver Library + * @{ + */ + +#if (DDL_TMRA_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup TMRA_Local_Macros TMRA Local Macros + * @{ + */ + +/** + * @defgroup TMRA_Configuration_Bit_Mask TMRA Configuration Bit Mask + * @{ + */ +#define TMRA_BCSTR_INIT_MSK (0x01F6UL) +#define TMRA_BCSTR_INT_MSK (0x00003000UL) +#define TMRA_BCSTR_FLAG_MSK (0x0000C000UL) +#define TMRA_FCONR_FILTER_CLK_MSK (0x3UL) +#define TMRA_CCONR_FILTER_CLK_MSK (TMRA_CCONR_NOFICKCP) +#define TMRA_PWM_POLARITY_MSK (0x03FFUL) +#define TMRA_TRIG_COND_MSK (TMRA_START_COND_ALL | TMRA_STOP_COND_ALL | TMRA_CLR_COND_ALL) +#define TMRA_CACHE_COND_MSK (TMRA_BCONR_BSE0 | TMRA_BCONR_BSE1) +#define TMRA_COM_TRIG_MSK (TMRA_COM_TRIG1 | TMRA_COM_TRIG2) +#define TMRA_TRIG_EVENT_MSK (AOS_TMRA_HTSSR_TRGSEL) +/** + * @} + */ + +/** + * @defgroup TMRA_Unit_Index TMRA Unit Index + * @{ + */ +#define __TMRA_BASE (0x4003A000UL) +#define __TMRA_UNIT_SIZE (0x400UL) +#define TMRA_IDX(__TMRAx__) (((uint32_t)&(__TMRAx__)->CNTER - __TMRA_BASE) / __TMRA_UNIT_SIZE) +/** + * @} + */ + +/** + * @defgroup TMRA_Register_Bit_Band TMRA Register Bit Band + * @{ + */ +#define __BIT_BAND_BASE (0x42000000UL) +#define __PERIP_BASE (0x40000000UL) +#define __REG_OFS(regAddr) ((regAddr) - __PERIP_BASE) +#define __BIT_BAND_ADDR(regAddr, pos) ((__REG_OFS(regAddr) << 5U) + ((uint32_t)(pos) << 2U) + __BIT_BAND_BASE) +#define BIT_BAND(regAddr, pos) (*(__IO uint32_t *)__BIT_BAND_ADDR((regAddr), (pos))) +/** + * @} + */ + +/** + * @defgroup TMRA_HTSSR_Address TMRA HTSSR Address + * @{ + */ +#define TMRA_HTSSR0_ADDR (0x40010880UL) +#define TMRA_HTSSR1_ADDR (0x40010884UL) +#define TMRA_HTSSR2_ADDR (0x40010888UL) +#define TMRA_HTSSR3_ADDR (0x4001088CUL) +/** + * @} + */ + +/** + * @defgroup TMRA_Check_Parameters_Validity TMRA check parameters validity + * @{ + */ +#define IS_TMRA_UNIT(x) \ +( ((x) == M4_TMRA_1) || \ + ((x) == M4_TMRA_2) || \ + ((x) == M4_TMRA_3) || \ + ((x) == M4_TMRA_4) || \ + ((x) == M4_TMRA_5) || \ + ((x) == M4_TMRA_6) || \ + ((x) == M4_TMRA_7) || \ + ((x) == M4_TMRA_8) || \ + ((x) == M4_TMRA_9) || \ + ((x) == M4_TMRA_10) || \ + ((x) == M4_TMRA_11) || \ + ((x) == M4_TMRA_12)) + +#define IS_TMRA_EVEN_UNIT(x) \ +( ((x) == M4_TMRA_2) || \ + ((x) == M4_TMRA_4) || \ + ((x) == M4_TMRA_6) || \ + ((x) == M4_TMRA_8) || \ + ((x) == M4_TMRA_10) || \ + ((x) == M4_TMRA_12)) + +#define IS_TMRA_CH(x) \ +( ((x) <= TMRA_CH_4)) + +#define IS_TMRA_FUNC_MODE(x) \ +( ((x) == TMRA_FUNC_COMPARE) || \ + ((x) == TMRA_FUNC_CAPTURE)) + +#define IS_TMRA_PCLK_DIV(x) \ +( ((x) == TMRA_PCLK_DIV1) || \ + ((x) == TMRA_PCLK_DIV2) || \ + ((x) == TMRA_PCLK_DIV4) || \ + ((x) == TMRA_PCLK_DIV8) || \ + ((x) == TMRA_PCLK_DIV16) || \ + ((x) == TMRA_PCLK_DIV32) || \ + ((x) == TMRA_PCLK_DIV64) || \ + ((x) == TMRA_PCLK_DIV128) || \ + ((x) == TMRA_PCLK_DIV256) || \ + ((x) == TMRA_PCLK_DIV512) || \ + ((x) == TMRA_PCLK_DIV1024)) + +#define IS_TMRA_CNT_DIR(x) \ +( ((x) == TMRA_DIR_DOWN) || \ + ((x) == TMRA_DIR_UP)) + +#define IS_TMRA_CNT_MODE(x) \ +( ((x) == TMRA_MODE_SAWTOOTH) || \ + ((x) == TMRA_MODE_TRIANGLE)) + +#define IS_TMRA_OVF_OPERATION(x) \ +( ((x) == TMRA_OVF_CNT_CONTINUE) || \ + ((x) == TMRA_OVF_CNT_STOP)) + +#define IS_TMRA_FILTER_CLK_DIV(x) \ +( ((x) <= TMRA_FILTER_CLK_DIV64)) + +#define IS_TMRA_CACHE_COND(x) \ +( ((x) == TMRA_CACHE_COND_OVF_CLR) || \ + ((x) == TMRA_CACHE_COND_TW_VALLEY) || \ + ((x) == TMRA_CACHE_COND_TW_PEAK)) + +#define IS_TMRA_PWM_START_POLARITY(x) \ +( ((x) == TMRA_PWM_START_LOW) || \ + ((x) == TMRA_PWM_START_HIGH) || \ + ((x) == TMRA_PWM_START_KEEP)) + +#define IS_TMRA_PWM_STOP_POLARITY(x) \ +( ((x) == TMRA_PWM_STOP_LOW) || \ + ((x) == TMRA_PWM_STOP_HIGH) || \ + ((x) == TMRA_PWM_STOP_KEEP)) + +#define IS_TMRA_PWM_CMP_POLARITY(x) \ +( ((x) == TMRA_PWM_CMP_LOW) || \ + ((x) == TMRA_PWM_CMP_HIGH) || \ + ((x) == TMRA_PWM_CMP_KEEP) || \ + ((x) == TMRA_PWM_CMP_REVERSE)) + +#define IS_TMRA_PWM_PERIOD_POLARITY(x) \ +( ((x) == TMRA_PWM_PERIOD_LOW) || \ + ((x) == TMRA_PWM_PERIOD_HIGH) || \ + ((x) == TMRA_PWM_PERIOD_KEEP) || \ + ((x) == TMRA_PWM_PERIOD_REVERSE)) + +#define IS_TMRA_PWM_FORCE_POLARITY(x) \ +( ((x) == TMRA_PWM_FORCE_INVALID) || \ + ((x) == TMRA_PWM_FORCE_LOW) || \ + ((x) == TMRA_PWM_FORCE_HIGH)) + +#define IS_TMRA_EVT_USAGE(x) \ +( ((x) == TMRA_EVENT_USAGE_CNT) || \ + ((x) == TMRA_EVENT_USAGE_CAPT)) + +#define IS_TMRA_COM_TRIGGER(x) \ +( ((x) != 0U) && \ + (((x) | TMRA_COM_TRIG_MSK) == TMRA_COM_TRIG_MSK)) + +#define IS_TMRA_VALID_VAL(x) \ +( (x) <= 0xFFFFUL) + +/** + * @} + */ + +/** + * @defgroup TMRA_Miscellaneous_Macros TMRA Miscellaneous Macros + * @{ + */ +#define TMRA_CH_COUNT (4U) +#define TMRA_PIN_PWM_OFFSET (3U) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup TMRA_Global_Functions TMRA Global Functions + * @{ + */ + +/** + * @brief Initializes the specified TMRA peripheral according to the specified parameters \ + * in the structure stc_tmra_init_t + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] pstcInit Pointer to a stc_tmra_init_t structure value that \ + * contains the configuration information for the TMRA. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcInit == NULL. + */ +en_result_t TMRA_Init(M4_TMRA_TypeDef *TMRAx, const stc_tmra_init_t *pstcInit) +{ + uint32_t u32Cfg = 0U; + en_result_t enRet = ErrorInvalidParameter; + + if (pstcInit != NULL) + { + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_CNT_DIR(pstcInit->u32CntDir)); + DDL_ASSERT(IS_TMRA_CNT_MODE(pstcInit->u32CntMode)); + DDL_ASSERT(IS_TMRA_OVF_OPERATION(pstcInit->u32CntOvfOp)); + DDL_ASSERT(IS_TMRA_VALID_VAL(pstcInit->u32PeriodVal)); + DDL_ASSERT(IS_TMRA_VALID_VAL(pstcInit->u32CntVal)); + + if (pstcInit->u32ClkSrc == TMRA_CLK_PCLK) + { + DDL_ASSERT(IS_TMRA_PCLK_DIV(pstcInit->u32PCLKDiv)); + u32Cfg = pstcInit->u32PCLKDiv | pstcInit->u32CntDir | pstcInit->u32CntMode; + } + else + { + WRITE_REG32(TMRAx->HCUPR, (pstcInit->u32ClkSrc & TMRA_CLK_HW_UP_ALL)); + WRITE_REG32(TMRAx->HCDOR, ((pstcInit->u32ClkSrc & TMRA_CLK_HW_DOWN_ALL) >> 16U)); + } + + u32Cfg |= pstcInit->u32CntOvfOp; + + MODIFY_REG32(TMRAx->BCSTR, TMRA_BCSTR_INIT_MSK, u32Cfg); + WRITE_REG32(TMRAx->PERAR, pstcInit->u32PeriodVal); + WRITE_REG32(TMRAx->CNTER, pstcInit->u32CntVal); + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set a default value for the TMRA initialization structure. + * @param [in] pstcInit Pointer to a stc_tmra_init_t structure value that \ + * contains the configuration information for the TMRA. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcInit == NULL. + */ +en_result_t TMRA_StructInit(stc_tmra_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (pstcInit != NULL) + { + pstcInit->u32ClkSrc = TMRA_CLK_PCLK; + pstcInit->u32PCLKDiv = TMRA_PCLK_DIV1; + pstcInit->u32CntDir = TMRA_DIR_UP; + pstcInit->u32CntMode = TMRA_MODE_SAWTOOTH; + pstcInit->u32CntOvfOp = TMRA_OVF_CNT_CONTINUE; + pstcInit->u32PeriodVal = 0xFFFFUL; + pstcInit->u32CntVal = 0UL; + enRet = Ok; + } + + return enRet; +} + +/** + * @brief De-initializes the TMRA peripheral. Reset all registers of the specified TMRA unit. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @retval None + */ +void TMRA_DeInit(M4_TMRA_TypeDef *TMRAx) +{ + uint32_t i; + uint32_t u32AddrOffset; + uint32_t u32CMPARAddr; + uint32_t u32CCONRAddr; + uint32_t u32PCONRAddr; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + + u32CMPARAddr = TMRAx->CMPAR1; + u32CCONRAddr = TMRAx->CCONR1; + u32PCONRAddr = TMRAx->PCONR1; + + for (i=0U; iCNTER, 0x0U); + WRITE_REG32(TMRAx->PERAR, 0xFFFFU); + WRITE_REG32(TMRAx->BCSTR, 0x2U); + WRITE_REG32(TMRAx->ICONR, 0x0U); + WRITE_REG32(TMRAx->ECONR, 0x0U); + WRITE_REG32(TMRAx->FCONR, 0x0U); + WRITE_REG32(TMRAx->STFLR, 0x0U); + WRITE_REG32(TMRAx->BCONR1, 0x0U); + WRITE_REG32(TMRAx->BCONR2, 0x0U); + WRITE_REG32(TMRAx->HCONR, 0x0U); + WRITE_REG32(TMRAx->HCUPR, 0x0U); + WRITE_REG32(TMRAx->HCDOR, 0x0U); +} + +/** + * @brief Set general count value. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u32Val The general count value to be set. + * This parameter can be a number between 0U and 0xFFFFU, inclusive. + * @retval None + */ +void TMRA_SetCntVal(M4_TMRA_TypeDef *TMRAx, uint32_t u32Val) +{ + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_VALID_VAL(u32Val)); + WRITE_REG32(TMRAx->CNTER, u32Val); +} + +/** + * @brief Get general count value. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @retval An uint32_t type type value of general count value between 0U and 0xFFFFU, inclusive. + */ +uint32_t TMRA_GetCntVal(const M4_TMRA_TypeDef *TMRAx) +{ + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + return (TMRAx->CNTER); +} + +/** + * @brief Set period reference value. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u32Val The period reference value to be set. + * This parameter can be a number between 0U and 0xFFFFU, inclusive. + * @retval None + */ +void TMRA_SetPeriodVal(M4_TMRA_TypeDef *TMRAx, uint32_t u32Val) +{ + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_VALID_VAL(u32Val)); + WRITE_REG32(TMRAx->PERAR, u32Val); +} + +/** + * @brief Get period reference value. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @retval An uint32_t type type value of period reference value between 0U and 0xFFFFU, inclusive. + */ +uint32_t TMRA_GetPeriodVal(const M4_TMRA_TypeDef *TMRAx) +{ + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + return (TMRAx->PERAR); +} + +/** + * @brief Specifies the function mode of the specified TMRA channle. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u8TmrCh TMRA channel number. + * This parameter can be a value of @ref TMRA_Channel + * @arg TMRA_CH_1: Channel 1 of TMRA. + * @arg TMRA_CH_2: Channel 2 of TMRA. + * @arg TMRA_CH_3: Channel 3 of TMRA. + * @arg TMRA_CH_4: Channel 4 of TMRA. + * @param [in] u32FuncMode Function mode of TMRA. + * This parameter can be a value of @ref TMRA_Function_Mode + * @arg TMRA_FUNC_COMPARE: The function mode of TMRA is comparison ouput. + * @arg TMRA_FUNC_CAPTURE: The function mode of TMRA is capture the input. + * @retval None + */ +void TMRA_SetFuncMode(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32FuncMode) +{ + uint32_t u32CCONRAddr; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_CH(u8TmrCh)); + DDL_ASSERT(IS_TMRA_FUNC_MODE(u32FuncMode)); + + u32CCONRAddr = (uint32_t)&TMRAx->CCONR1 + (uint32_t)u8TmrCh * 4U; + BIT_BAND(u32CCONRAddr, TMRA_CCONR_CAPMD_POS) = u32FuncMode; +} + +/** + * @brief Set compare reference value. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u8TmrCh TMRA channel number. + * This parameter can be a value of @ref TMRA_Channel + * @arg TMRA_CH_1: Channel 1 of TMRA. + * @arg TMRA_CH_2: Channel 2 of TMRA. + * @arg TMRA_CH_3: Channel 3 of TMRA. + * @arg TMRA_CH_4: Channel 4 of TMRA. + * @param [in] u32Val The comparison reference value to be set. + * This parameter can be a number between 0U and 0xFFFFU, inclusive. + * @retval None + */ +void TMRA_SetCmpVal(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32Val) +{ + uint32_t u32CMPARAddr; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_VALID_VAL(u32Val)); + u32CMPARAddr = (uint32_t)&TMRAx->CMPAR1 + (uint32_t)u8TmrCh * 4U; + RW_MEM32(u32CMPARAddr) = u32Val; +} + +/** + * @brief Get compare reference value. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u8TmrCh TMRA channel number. + * This parameter can be a value of @ref TMRA_Channel + * @arg TMRA_CH_1: Channel 1 of TMRA. + * @arg TMRA_CH_2: Channel 2 of TMRA. + * @arg TMRA_CH_3: Channel 3 of TMRA. + * @arg TMRA_CH_4: Channel 4 of TMRA. + * @retval An uint32_t type type value of comparison reference value between 0U and 0xFFFFU, inclusive. + */ +uint32_t TMRA_GetCmpVal(const M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh) +{ + uint32_t u32CMPARAddr; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_CH(u8TmrCh)); + + u32CMPARAddr = (uint32_t)&TMRAx->CMPAR1 + (uint32_t)u8TmrCh * 4U; + return RW_MEM32(u32CMPARAddr); +} + +/** + * @brief Configures the specified channel's PWM of TMRA according to the specified parameters + * in the structure stc_tmra_pwm_cfg_t. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u8TmrCh TMRA channel number. + * This parameter can be a value of @ref TMRA_Channel + * @arg TMRA_CH_1: Channel 1 of TMRA. + * @arg TMRA_CH_2: Channel 2 of TMRA. + * @arg TMRA_CH_3: Channel 3 of TMRA. + * @arg TMRA_CH_4: Channel 4 of TMRA. + * @param [in] pstcCfg Pointer to a stc_tmra_pwm_cfg_t structure value that + * contains the configuration information for the PWM. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcCfg == NULL. + */ +en_result_t TMRA_PWM_Config(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, const stc_tmra_pwm_cfg_t *pstcCfg) +{ + uint32_t u32Cfg; + uint32_t u32PCONRAddr; + en_result_t enRet = ErrorInvalidParameter; + + if (pstcCfg != NULL) + { + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_CH(u8TmrCh)); + DDL_ASSERT(IS_TMRA_PWM_START_POLARITY(pstcCfg->u32StartPolarity)); + DDL_ASSERT(IS_TMRA_PWM_STOP_POLARITY(pstcCfg->u32StopPolarity)); + DDL_ASSERT(IS_TMRA_PWM_CMP_POLARITY(pstcCfg->u32CmpPolarity)); + DDL_ASSERT(IS_TMRA_PWM_PERIOD_POLARITY(pstcCfg->u32PeriodPolarity)); + DDL_ASSERT(IS_TMRA_PWM_FORCE_POLARITY(pstcCfg->u32ForcePolarity)); + + u32PCONRAddr = (uint32_t)&TMRAx->PCONR1 + (uint32_t)u8TmrCh * 4U; + u32Cfg = pstcCfg->u32StartPolarity | \ + pstcCfg->u32StopPolarity | \ + pstcCfg->u32CmpPolarity | \ + pstcCfg->u32PeriodPolarity | \ + pstcCfg->u32ForcePolarity; + MODIFY_REG32(RW_MEM32(u32PCONRAddr), TMRA_PWM_POLARITY_MSK, u32Cfg); + + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set a default value for the PWM configuration structure. + * @param [in] pstcCfg Pointer to a stc_tmra_pwm_cfg_t structure value that + * contains the configuration information for the PWM. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcCfg == NULL. + */ +en_result_t TMRA_PWM_StructInit(stc_tmra_pwm_cfg_t *pstcCfg) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (pstcCfg != NULL) + { + pstcCfg->u32StartPolarity = TMRA_PWM_START_HIGH; + pstcCfg->u32StopPolarity = TMRA_PWM_STOP_LOW; + pstcCfg->u32CmpPolarity = TMRA_PWM_CMP_REVERSE; + pstcCfg->u32PeriodPolarity = TMRA_PWM_PERIOD_REVERSE; + pstcCfg->u32ForcePolarity = TMRA_PWM_FORCE_INVALID; + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Enable or disable the specified channel's PWM output. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u8TmrCh TMRA channel number. + * This parameter can be a value of @ref TMRA_Channel + * @arg TMRA_CH_1: Channel 1 of TMRA. + * @arg TMRA_CH_2: Channel 2 of TMRA. + * @arg TMRA_CH_3: Channel 3 of TMRA. + * @arg TMRA_CH_4: Channel 4 of TMRA. + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable the specified channel's PWM output. + * @arg Disable: Disable the specified channel's PWM output. + * @retval None + */ +void TMRA_PWM_Cmd(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, en_functional_state_t enNewState) +{ + uint32_t u32PCONRAddr; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_CH(u8TmrCh)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32PCONRAddr = (uint32_t)&TMRAx->PCONR1 + (uint32_t)u8TmrCh * 4U; + BIT_BAND(u32PCONRAddr, TMRA_PCONR_OUTEN_POS) = (uint32_t)enNewState; +} + +/** + * @brief Specifies the divider of filter's clock source for the specified TMRA input pin. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u8InputPin The input pin of TMRA. + * This parameter can be values of @ref TMRA_Input_Pin + * @arg TMRA_PIN_TRIG: Pin TIMA__TRIG. + * @arg TMRA_PIN_CLKA: Pin TIMA__CLKA. + * @arg TMRA_PIN_CLKB: Pin TIMA__CLKB. + * @arg TMRA_PIN_PWM1: Pin TIMA__PWM1. + * @arg TMRA_PIN_PWM2: Pin TIMA__PWM2. + * @arg TMRA_PIN_PWM3: Pin TIMA__PWM3. + * @arg TMRA_PIN_PWM4: Pin TIMA__PWM4. + * @param [in] u32ClkDiv The clock source divider of the filter. + * This parameter can be a value of @ref TMRA_Filter_Clock_Divider + * @arg TMRA_FILTER_CLK_DIV1: The filter clock is PCLK / 1. + * @arg TMRA_FILTER_CLK_DIV4: The filter clock is PCLK / 4. + * @arg TMRA_FILTER_CLK_DIV16: The filter clock is PCLK / 16. + * @arg TMRA_FILTER_CLK_DIV64: The filter clock is PCLK / 64. + * @retval None + */ +void TMRA_FilterConfig(M4_TMRA_TypeDef *TMRAx, uint8_t u8InputPin, uint32_t u32ClkDiv) +{ + uint8_t u8PinIdx = 0U; + uint8_t u8TmrCh; + uint32_t u32CfgMsk; + uint32_t u32CCONRAddr; + uint8_t au8Offset[] = {TMRA_FCONR_NOFICKTG_POS, TMRA_FCONR_NOFICKCA_POS, TMRA_FCONR_NOFICKCB_POS, \ + TMRA_CCONR_NOFICKCP_POS, TMRA_CCONR_NOFICKCP_POS, TMRA_CCONR_NOFICKCP_POS, \ + TMRA_CCONR_NOFICKCP_POS}; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_FILTER_CLK_DIV(u32ClkDiv)); + + u8InputPin &= (uint8_t)TMRA_PIN_ALL; + while (u8InputPin != 0U) + { + if ((u8InputPin & 0x1U) != 0U) + { + if (u8PinIdx < TMRA_PIN_PWM_OFFSET) + { + u32CfgMsk = (uint32_t)(TMRA_FCONR_FILTER_CLK_MSK << au8Offset[u8PinIdx]); + MODIFY_REG32(TMRAx->FCONR, u32CfgMsk, (u32ClkDiv << au8Offset[u8PinIdx])); + } + else + { + u8TmrCh = u8PinIdx - TMRA_PIN_PWM_OFFSET; + u32CCONRAddr = (uint32_t)&TMRAx->CCONR1 + (uint32_t)u8TmrCh * 4U; + MODIFY_REG32(RW_MEM32(u32CCONRAddr), \ + TMRA_CCONR_FILTER_CLK_MSK, \ + (u32ClkDiv << au8Offset[u8PinIdx])); + } + } + u8InputPin >>= 1U; + u8PinIdx++; + } +} + +/** + * @brief Enable or disable the filter function of the specified TMRA input pin. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u8InputPin The input pin of TMRA. + * This parameter can be values of @ref TMRA_Input_Pin + * @arg TMRA_PIN_TRIG: Pin TIMA__TRIG. + * @arg TMRA_PIN_CLKA: Pin TIMA__CLKA. + * @arg TMRA_PIN_CLKB: Pin TIMA__CLKB. + * @arg TMRA_PIN_PWM1: Pin TIMA__PWM1. + * @arg TMRA_PIN_PWM2: Pin TIMA__PWM2. + * @arg TMRA_PIN_PWM3: Pin TIMA__PWM3. + * @arg TMRA_PIN_PWM4: Pin TIMA__PWM4. + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable the specified pin's filter. + * @arg Disable: Disable the specified pin's filter. + * @retval None + */ +void TMRA_FilterCmd(M4_TMRA_TypeDef *TMRAx, uint8_t u8InputPin, en_functional_state_t enNewState) +{ + uint8_t u8PinIdx = 0U; + uint8_t u8TmrCh; + uint32_t u32CCONRAddr; + uint8_t au8Offset[] = {TMRA_FCONR_NOFIENTG_POS, TMRA_FCONR_NOFIENCA_POS, TMRA_FCONR_NOFIENCB_POS, \ + TMRA_CCONR_NOFIENCP_POS, TMRA_CCONR_NOFIENCP_POS, TMRA_CCONR_NOFIENCP_POS, \ + TMRA_CCONR_NOFIENCP_POS}; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u8InputPin &= (uint8_t)TMRA_PIN_ALL; + while (u8InputPin != 0U) + { + if ((u8InputPin & 0x1U) != 0U) + { + if (u8PinIdx < TMRA_PIN_PWM_OFFSET) + { + u32CCONRAddr = (uint32_t)&TMRAx->FCONR; + } + else + { + u8TmrCh = u8PinIdx - TMRA_PIN_PWM_OFFSET; + u32CCONRAddr = (uint32_t)&TMRAx->CCONR1 + (uint32_t)u8TmrCh * 4U; + } + BIT_BAND(u32CCONRAddr, au8Offset[u8PinIdx]) = (uint32_t)enNewState; + } + u8InputPin >>= 1U; + u8PinIdx++; + } +} + +/** + * @brief Specifies the capture condition for the specified channel. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u8TmrCh TMRA channel number. + * This parameter can be a value of @ref TMRA_Channel + * @arg TMRA_CH_1: Channel 1 of TMRA. + * @arg TMRA_CH_2: Channel 2 of TMRA. + * @arg TMRA_CH_3: Channel 3 of TMRA. + * @arg TMRA_CH_4: Channel 4 of TMRA. + * @param [in] u32Cond The capture condition. Set this parameter to 0xFFFF to select all the conditions of capturing start. + * This parameter can be values of @ref TMRA_Channel_Capture_Condition + * @arg TMRA_CAPT_COND_INVALID: The condition of capture is INVALID. + * @arg TMRA_CAPT_COND_PWMR: The condition of capture is a rising edge is sampled on PWM(pin). + * @arg TMRA_CAPT_COND_PWMF: The condition of capture is a falling edge is sampled on PWM(pin). + * @arg TMRA_CAPT_COND_EVENT: The condition of capture is the specified event occurred. + * @arg TMRA_CAPT_COND_TRIGR: The condition of capture is a rising edge is sampled on TRIG. + * @arg TMRA_CAPT_COND_TRIGF: The condition of capture is a falling edge is sampled on TRIG. + * @retval None + */ +void TMRA_SetCaptCond(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32Cond) +{ + uint32_t u32CCONRAddr; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_CH(u8TmrCh)); + + u32CCONRAddr = (uint32_t)&TMRAx->CCONR1 + (uint32_t)u8TmrCh * 4U; + MODIFY_REG32(RW_MEM32(u32CCONRAddr), TMRA_CAPT_COND_ALL, u32Cond); +} + +/** + * @brief Specifies the hardware trigger condition of TMRA according to the specified parameters + * in the structure stc_tmra_trig_cond_t. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] pstcCond Pointer to a stc_tmra_trig_cond_t structure value that contains \ + * the configuration information of hardware trigger condition. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcCond == NULL. + */ +en_result_t TMRA_SetTrigCond(M4_TMRA_TypeDef *TMRAx, const stc_tmra_trig_cond_t *pstcCond) +{ + uint32_t u32StartCond; + en_result_t enRet = ErrorInvalidParameter; + + if (pstcCond != NULL) + { + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + + u32StartCond = (pstcCond->u32StartCond | pstcCond->u32StopCond | pstcCond->u32ClrCond) & TMRA_TRIG_COND_MSK; + WRITE_REG32(TMRAx->HCONR, u32StartCond); + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Set a default value for the hardware trigger condition configuration structure. + * @param [in] pstcCond Pointer to a stc_tmra_trig_cond_t structure value that contains \ + * the configuration information of hardware trigger condition. + * @retval An en_result_t enumeration type value. + * @arg Ok: No error occurred. + * @arg ErrorInvalidParameter: pstcCfg == NULL. + */ +en_result_t TMRA_TrigCondStructInit(stc_tmra_trig_cond_t *pstcCond) +{ + en_result_t enRet = ErrorInvalidParameter; + + if (pstcCond != NULL) + { + pstcCond->u32StartCond = TMRA_START_COND_INVALID; + pstcCond->u32StopCond = TMRA_STOP_COND_INVALID; + pstcCond->u32ClrCond = TMRA_CLR_COND_INVALID; + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Specifies the event for specified usage. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u8EvtUsage Usage of the event. + * This parameter can be a value of @ref TMRA_Event_Usage + * @arg TMRA_EVENT_USAGE_CNT: The specified event is used for counting. + * @arg TMRA_EVENT_USAGE_CAPT: The specified event is used for capturing. + * @param [in] enEvent An en_event_src_t enumeration type value. + * @retval None + * @note Correspondence of TMRA instances and the event setting registers is as follows: + * TMRA unit USAGE_CNT USAGE_CAPT + * ---------------------------------------------------------- + * TMRA uint1 | TMRA_HTSSR0 | TMRA_HTSSR1 + * TMRA uint2 | TMRA_HTSSR1 | TMRA_HTSSR0 + * TMRA uint3 | TMRA_HTSSR2 | TMRA_HTSSR3 + * TMRA uint4 | TMRA_HTSSR3 | TMRA_HTSSR2 + * TMRA uint5 | TMRA_HTSSR0 | TMRA_HTSSR1 + * TMRA uint6 | TMRA_HTSSR1 | TMRA_HTSSR0 + * TMRA uint7 | TMRA_HTSSR2 | TMRA_HTSSR3 + * TMRA uint8 | TMRA_HTSSR3 | TMRA_HTSSR2 + * TMRA uint9 | TMRA_HTSSR0 | TMRA_HTSSR1 + * TMRA uint10 | TMRA_HTSSR1 | TMRA_HTSSR0 + * TMRA uint11 | TMRA_HTSSR2 | TMRA_HTSSR3 + * TMRA uint12 | TMRA_HTSSR3 | TMRA_HTSSR2 + */ +void TMRA_SetTriggerSrc(M4_TMRA_TypeDef *TMRAx, uint8_t u8EvtUsage, en_event_src_t enEvent) +{ + uint32_t u32Idx; + uint32_t u32HTSSRAddr; + uint32_t au32CaptEventAddr[] = {TMRA_HTSSR1_ADDR, TMRA_HTSSR0_ADDR, \ + TMRA_HTSSR3_ADDR, TMRA_HTSSR2_ADDR}; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_EVT_USAGE(u8EvtUsage)); + + u32Idx = TMRA_IDX(TMRAx) % TMRA_CH_COUNT; + if (u8EvtUsage == TMRA_EVENT_USAGE_CNT) + { + u32HTSSRAddr = (uint32_t)&M4_AOS->TMRA_HTSSR0 + u32Idx * 4U; + } + else + { + u32HTSSRAddr = au32CaptEventAddr[u32Idx]; + } + + MODIFY_REG32(RW_MEM32(u32HTSSRAddr), TMRA_TRIG_EVENT_MSK, enEvent); +} + +/** + * @brief Enable or disable common trigger event for the specified usage. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u8EvtUsage Usage of the event. + * This parameter can be a value of @ref TMRA_Event_Usage + * @arg TMRA_EVENT_USAGE_CNT: The specified event is used for counting. + * @arg TMRA_EVENT_USAGE_CAPT: The specified event is used for capturing. + * @param [in] u32ComTrig Common trigger event enable bit mask. + * This parameter can be values of @ref TMRA_Common_Trigger_Sel + * @arg TMRA_COM_TRIG1: Common trigger 1. + * @arg TMRA_COM_TRIG2: Common trigger 2. + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable the specified common trigger. + * @arg Disable: Disable the specified common trigger. + * @retval None + */ +void TMRA_ComTriggerCmd(M4_TMRA_TypeDef *TMRAx, uint8_t u8EvtUsage, \ + uint32_t u32ComTrig, en_functional_state_t enNewState) +{ + uint32_t u32Idx; + uint32_t u32HTSSRAddr; + uint32_t au32CaptEventAddr[] = {TMRA_HTSSR1_ADDR, TMRA_HTSSR0_ADDR, \ + TMRA_HTSSR3_ADDR, TMRA_HTSSR2_ADDR}; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_EVT_USAGE(u8EvtUsage)); + DDL_ASSERT(IS_TMRA_COM_TRIGGER(u32ComTrig)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32Idx = TMRA_IDX(TMRAx) % TMRA_CH_COUNT; + if (u8EvtUsage == TMRA_EVENT_USAGE_CNT) + { + u32HTSSRAddr = (uint32_t)&M4_AOS->TMRA_HTSSR0 + u32Idx * 4U; + } + else + { + u32HTSSRAddr = au32CaptEventAddr[u32Idx]; + } + + if (enNewState == Enable) + { + SET_REG32_BIT(RW_MEM32(u32HTSSRAddr), u32ComTrig); + } + else + { + CLEAR_REG32_BIT(RW_MEM32(u32HTSSRAddr), u32ComTrig); + } +} + +/** + * @brief Configures cache function. Specifies the cache condition of compare value. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u8TmrCh TMRA channel number. + * This parameter can be one of the following values of @ref TMRA_Channel + * @arg TMRA_CH_1: Channel 1 of TMRA. + * @arg TMRA_CH_3: Channel 3 of TMRA. + * @param [in] u32CacheCond Cache condition of the specified TMRA unit. + * This parameter can be a value of @ref TMRA_Cmp_Value_Cache_Condition + * @arg TIEMRA_CACHE_POS_OVF_CLR: This configuration value applies to non-triangular wave counting mode. \ + * When counting overflow or underflow or counting register was cleared, \ + * transfer CMPARm(m=2,4) to CMPARn(n=1,3). + * @arg TMRA_CACHE_POS_TW_PEAK: In triangle wave count mode, when count reached peak, \ + * transfer CMMARm(m=2,4) to CMMARn(n=1,3). + * @arg TMRA_CACHE_POS_TW_VALLEY: In triangle wave count mode, when count reached valley, \ + * transfer CMMARm(m=2,4) to CMMARn(n=1,3). + * @retval None + */ +void TMRA_CmpValCacheConfig(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32CacheCond) +{ + uint32_t u32BCONRAddr; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT((u8TmrCh == TMRA_CH_1) || (u8TmrCh == TMRA_CH_3)); + DDL_ASSERT(IS_TMRA_CACHE_COND(u32CacheCond)); + + u32BCONRAddr = (uint32_t)&TMRAx->BCONR1 + (uint32_t)u8TmrCh * 4U; + MODIFY_REG32(RW_MEM32(u32BCONRAddr), TMRA_CACHE_COND_MSK, u32CacheCond); +} + +/** + * @brief Enable or disable the compare value function.. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u8TmrCh TMRA channel number. + * This parameter can be one of the following values of @ref TMRA_Channel + * @arg TMRA_CH_1: Channel 1 of TMRA. + * @arg TMRA_CH_3: Channel 3 of TMRA. + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable the comparison reference value function. + * @arg Disable: Disable the comparison reference value function. + * @retval None + */ +void TMRA_CmpValCacheCmd(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, en_functional_state_t enNewState) +{ + uint32_t u32BCONRAddr; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT((u8TmrCh == TMRA_CH_1) || (u8TmrCh == TMRA_CH_3)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32BCONRAddr = (uint32_t)&TMRAx->BCONR1 + (uint32_t)u8TmrCh * 4U; + BIT_BAND(u32BCONRAddr, TMRA_BCONR_BEN_POS) = (uint32_t)enNewState; +} + +/** + * @brief Specifies the operation when counting overflow/underflow. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u32OvfOp The operation when count overflow/underflow. + * @arg TMRA_OVF_CNT_CONTINUE: When counting overflow(or underflow), counting continue. + * @arg TMRA_OVF_CNT_STOP: When count overflow(or underflow), counting stop. + * @retval None + */ +void TMRA_SetOvfOperation(M4_TMRA_TypeDef *TMRAx, uint32_t u32OvfOp) +{ + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_OVF_OPERATION(u32OvfOp)); + MODIFY_REG32(TMRAx->BCSTR, TMRA_BCSTR_OVSTP, u32OvfOp); +} + +/** + * @brief Enable or disable synchronous-start. When an even unit enables synchronous-start function, \ + * start the symmetric odd unit can start the even unit at the same time. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_2: TMRA unit 2 instance register base. + * @arg M4_TMRA_4: TMRA unit 4 instance register base. + * @arg M4_TMRA_6: TMRA unit 6 instance register base. + * @arg M4_TMRA_8: TMRA unit 8 instance register base. + * @arg M4_TMRA_10: TMRA unit 10 instance register base. + * @arg M4_TMRA_12: TMRA unit 12 instance register base. + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable the synchronous start. + * @arg Disable: Disable the synchronous start. + * @retval None + * @note Only even units can be enabled/disabled synchronous-start function. + * @note Symmetric units: uint 1 and 2; uint 3 and 4; ...; uint 11 and 12. + */ +void TMRA_SyncStartCmd(M4_TMRA_TypeDef *TMRAx, en_functional_state_t enNewState) +{ + uint32_t u32Addr; + + DDL_ASSERT(IS_TMRA_EVEN_UNIT(TMRAx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32Addr = (uint32_t)&TMRAx->BCSTR; + BIT_BAND(u32Addr, TMRA_BCSTR_SYNST_POS) = (uint32_t)enNewState; +} + +/** + * @brief Enable of disable the specified interrupts of the specified TMRA unit. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u32IntType The interrupt type of TMRA. Set this parameter to 0xFFFFFFFF to select all interrupts. + * This parameter can be values of @ref TMRA_Interrupt_Type + * @arg TMRA_INT_OVF: Count overflow interrupt. + * @arg TMRA_INT_UNF: Count underflow interrupt. + * @arg TMRA_INT_CMP_CH1: Compare-match interrupt of channel 1. + * @arg TMRA_INT_CMP_CH2: Compare-match interrupt of channel 2. + * @arg TMRA_INT_CMP_CH3: Compare-match interrupt of channel 3. + * @arg TMRA_INT_CMP_CH4: Compare-match interrupt of channel 4. + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable the specified interrupts. + * @arg Disable: Disable the specified interrupts. + * @retval None + */ +void TMRA_IntCmd(M4_TMRA_TypeDef *TMRAx, uint32_t u32IntType, en_functional_state_t enNewState) +{ + uint32_t u32BCSTR; + uint32_t u32ICONR; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32IntType &= TMRA_INT_ALL; + u32BCSTR = u32IntType & TMRA_BCSTR_INT_MSK; + u32ICONR = u32IntType >> 16U; + if (enNewState == Enable) + { + SET_REG32_BIT(TMRAx->BCSTR, u32BCSTR); + SET_REG32_BIT(TMRAx->ICONR, u32ICONR); + } + else + { + CLEAR_REG32_BIT(TMRAx->BCSTR, u32BCSTR); + CLEAR_REG32_BIT(TMRAx->ICONR, u32ICONR); + } +} + +/** + * @brief Enable of disable the specified event of the specified TMRA unit. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u32EvtType The event type of TMRA. Set this parameter to 0xFFFF to select all events. + * This parameter can be values of @ref TMRA_Event_Type + * @arg TMRA_EVENT_CMP_CH1: Compare-match event of channel 1. + * @arg TMRA_EVENT_CMP_CH2: Compare-match event of channel 2. + * @arg TMRA_EVENT_CMP_CH3: Compare-match event of channel 3. + * @arg TMRA_EVENT_CMP_CH4: Compare-match event of channel 4. + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable the specified event. + * @arg Disable: Disable the specified event. + * @retval None + */ +void TMRA_EventCmd(M4_TMRA_TypeDef *TMRAx, uint32_t u32EvtType, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32EvtType &= TMRA_EVENT_ALL; + if (enNewState == Enable) + { + SET_REG32_BIT(TMRAx->ECONR, u32EvtType); + } + else + { + CLEAR_REG32_BIT(TMRAx->ECONR, u32EvtType); + } +} + +/** + * @brief Get the specified flag's status. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u32Flag The status flags of TMRA. + * This parameter can be values of @ref TMRA_Status_Flag + * @arg TMRA_FLAG_OVF: Count overflow flag. + * @arg TMRA_FLAG_UNF: Count underflow flag. + * @arg TMRA_FLAG_CMP_CH1: Compare-match flag of channel 1. + * @arg TMRA_FLAG_CMP_CH2: Compare-match flag of channel 2. + * @arg TMRA_FLAG_CMP_CH3: Compare-match flag of channel 3. + * @arg TMRA_FLAG_CMP_CH4: Compare-match flag of channel 4. + * @retval An en_flag_status_t enumeration type value. + * @arg Set: At least one of the specified flags is set. + * @arg Reset: None of the specified flags is set. + */ +en_flag_status_t TMRA_GetStatus(const M4_TMRA_TypeDef *TMRAx, uint32_t u32Flag) +{ + uint32_t u32BCSTR; + uint32_t u32STFLR; + en_flag_status_t enFlag = Reset; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + + u32Flag &= TMRA_FLAG_ALL; + u32BCSTR = READ_REG32_BIT(TMRAx->BCSTR, (u32Flag & TMRA_BCSTR_FLAG_MSK)); + u32STFLR = READ_REG32_BIT(TMRAx->STFLR, (u32Flag >> 16U)); + + if ((u32BCSTR != 0U) || (u32STFLR != 0U)) + { + enFlag = Set; + } + + return enFlag; +} + +/** + * @brief Clear the specified flags' status. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u32Flag The status flags of TMRA. Set this parameter to 0xFFFFFFFF to select all status flags. + * This parameter can be values of @ref TMRA_Status_Flag + * @arg TMRA_FLAG_OVF: Count overflow flag. + * @arg TMRA_FLAG_UNF: Count underflow flag. + * @arg TMRA_FLAG_CMP_CH1: Count match flag of channel 1. + * @arg TMRA_FLAG_CMP_CH2: Count match flag of channel 2. + * @arg TMRA_FLAG_CMP_CH3: Count match flag of channel 3. + * @arg TMRA_FLAG_CMP_CH4: Count match flag of channel 4. + * @retval None + */ +void TMRA_ClrStatus(M4_TMRA_TypeDef *TMRAx, uint32_t u32Flag) +{ + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + + u32Flag &= TMRA_FLAG_ALL; + TMRAx->BCSTR &= (uint32_t)(~(u32Flag & TMRA_BCSTR_FLAG_MSK)); + TMRAx->STFLR &= (uint32_t)(~(u32Flag >> 16U)); +} + +/** + * @brief Start the specified TMRA unit. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @retval None + */ +void TMRA_Start(M4_TMRA_TypeDef *TMRAx) +{ + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + SET_REG32_BIT(TMRAx->BCSTR, TMRA_BCSTR_START); +} + +/** + * @brief Stop the specified TMRA unit. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @retval None + */ +void TMRA_Stop(M4_TMRA_TypeDef *TMRAx) +{ + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + CLEAR_REG32_BIT(TMRAx->BCSTR, TMRA_BCSTR_START); +} + +/** + * @brief Specifies the counting direction for the specified TMRA unit. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u32CntDir Count direction. + * This parameter can be a value of @ref TMRA_Count_Direction + * @arg TMRA_DIR_DOWN: TMRA count down. + * @arg TMRA_DIR_UP: TMRA count up. + * @retval None + */ +void TMRA_SetCntDir(M4_TMRA_TypeDef *TMRAx, uint32_t u32CntDir) +{ + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_CNT_DIR(u32CntDir)); + MODIFY_REG32(TMRAx->BCSTR, TMRA_BCSTR_DIR, u32CntDir); +} + +/** + * @brief Specifies the counting mode for the specified TMRA unit. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u32CntMode Count mode. + * This parameter can be a value of @ref TMRA_Count_Mode + * @arg TMRA_MODE_SAWTOOTH: Count mode is sawtooth wave. + * @arg TMRA_MODE_TRIANGLE: Count mode is triangle wave. + * @retval None + */ +void TMRA_SetCntMode(M4_TMRA_TypeDef *TMRAx, uint32_t u32CntMode) +{ + uint32_t u32Addr; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_CNT_MODE(u32CntMode)); + + u32Addr = (uint32_t)&TMRAx->BCSTR; + BIT_BAND(u32Addr, TMRA_BCSTR_SYNST_POS) = (uint32_t)u32CntMode; +} + +/** + * @brief Specifies the divider of PCLK when the clock source is PCLK. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u32ClkDiv The clock source division. + * This parameter can be a value of @ref TMRA_PCLK_Divider + * @arg TMRA_PCLK_DIV1: The clock source of TMRA is PCLK. + * @arg TMRA_PCLK_DIV2: The clock source of TMRA is PCLK / 2. + * @arg TMRA_PCLK_DIV4: The clock source of TMRA is PCLK / 4. + * @arg TMRA_PCLK_DIV8: The clock source of TMRA is PCLK / 8. + * @arg TMRA_PCLK_DIV16: The clock source of TMRA is PCLK / 16. + * @arg TMRA_PCLK_DIV32: The clock source of TMRA is PCLK / 32. + * @arg TMRA_PCLK_DIV64: The clock source of TMRA is PCLK / 64. + * @arg TMRA_PCLK_DIV128: The clock source of TMRA is PCLK / 128. + * @arg TMRA_PCLK_DIV256: The clock source of TMRA is PCLK / 256. + * @arg TMRA_PCLK_DIV512: The clock source of TMRA is PCLK / 512. + * @arg TMRA_PCLK_DIV1024: The clock source of TMRA is PCLK / 1024. + * @retval None + */ +void TMRA_SetPCLKDiv(M4_TMRA_TypeDef *TMRAx, uint32_t u32ClkDiv) +{ + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_PCLK_DIV(u32ClkDiv)); + MODIFY_REG32(TMRAx->BCSTR, TMRA_BCSTR_CKDIV, u32ClkDiv); +} + +/** + * @brief Get the counting direction of the specified TMRA unit. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA1 ~ M4_TMRA12: TMRA unit 1 ~ 12 instance register base. + * @retval An uint32_t type value of counting direction. + * @arg TMRA_DIR_DOWN: TMRA count goes down. + * @arg TMRA_DIR_UP: TMRA count goes up. + */ +uint32_t TMRA_GetCntDir(const M4_TMRA_TypeDef *TMRAx) +{ + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + return READ_REG32_BIT(TMRAx->BCSTR, TMRA_BCSTR_DIR); +} + +/** + * @brief Specifies the clock source for the specified TMRA unit. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA1 ~ M4_TMRA12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u32ClkSrc The clock source of TMRA. + * This parameter can be values of @ref TMRA_Clock_Source + * @retval None + */ +void TMRA_SetClkSrc(M4_TMRA_TypeDef *TMRAx, uint32_t u32ClkSrc) +{ + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + WRITE_REG32(TMRAx->HCUPR, (u32ClkSrc & TMRA_CLK_HW_UP_ALL)); + WRITE_REG32(TMRAx->HCDOR, ((u32ClkSrc & TMRA_CLK_HW_DOWN_ALL) >> 16U)); +} + +/** + * @brief Enable or disable the specified hardware clock source of the specified TMRA unit. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA1 ~ M4_TMRA12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u32HwClkSrc The hardware clock source of TMRA. + * This parameter can be values of @ref TMRA_Clock_Source except TMRA_CLK_PCLK + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable the specified hardware clock source. + * @arg Disable: Disable the specified hardware clock source. + * @retval None + */ +void TMRA_HwClkSrcCmd(M4_TMRA_TypeDef *TMRAx, uint32_t u32HwClkSrc, en_functional_state_t enNewState) +{ + const uint32_t u32HwCntUpClk = u32HwClkSrc & TMRA_CLK_HW_UP_ALL; + const uint32_t u32HwCntDownClk = (u32HwClkSrc & TMRA_CLK_HW_DOWN_ALL) >> 16U; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + if (enNewState == Enable) + { + SET_REG32_BIT(TMRAx->HCUPR, u32HwCntUpClk); + SET_REG32_BIT(TMRAx->HCDOR, u32HwCntDownClk); + } + else + { + CLEAR_REG32_BIT(TMRAx->HCUPR, u32HwCntUpClk); + CLEAR_REG32_BIT(TMRAx->HCDOR, u32HwCntDownClk); + } +} + +/** + * @brief Specifies the PWM polarity when counting start. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u8TmrCh TMRA channel number. + * This parameter can be a value of @ref TMRA_Channel + * @arg TMRA_CH_1: Channel 1 of TMRA. + * @arg TMRA_CH_2: Channel 2 of TMRA. + * @arg TMRA_CH_3: Channel 3 of TMRA. + * @arg TMRA_CH_4: Channel 4 of TMRA. + * @param [in] u32Polarity Polarity of PWM output. + * This parameter can be a value of @ref TMRA_PWM_Start_Polarity + * @arg TMRA_PWM_START_LOW: The polarity of PWM output is low. + * @arg TMRA_PWM_START_HIGH: The polarity of PWM output is high. + * @arg TMRA_PWM_START_KEEP: The polarity of PWM output keeps the current polarity. + * @retval None + */ +void TMRA_PWM_SetStartPolarity(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32Polarity) +{ + uint32_t u32PCONRAddr; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_CH(u8TmrCh)); + DDL_ASSERT(IS_TMRA_PWM_START_POLARITY(u32Polarity)); + + u32PCONRAddr = (uint32_t)&TMRAx->PCONR1 + (uint32_t)u8TmrCh * 4U; + MODIFY_REG32(RW_MEM32(u32PCONRAddr), TMRA_PCONR_STAC, u32Polarity); +} + +/** + * @brief Specifies the PWM polarity when counting stop. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u8TmrCh TMRA channel number. + * This parameter can be a value of @ref TMRA_Channel + * @arg TMRA_CH_1: Channel 1 of TMRA. + * @arg TMRA_CH_2: Channel 2 of TMRA. + * @arg TMRA_CH_3: Channel 3 of TMRA. + * @arg TMRA_CH_4: Channel 4 of TMRA. + * @param [in] u32Polarity Polarity of PWM output. + * This parameter can be a value of @ref TMRA_PWM_Stop_Polarity + * @arg TMRA_PWM_STOP_LOW: The polarity of PWM output is low. + * @arg TMRA_PWM_STOP_HIGH: The polarity of PWM output is high. + * @arg TMRA_PWM_STOP_KEEP: The polarity of PWM output keeps the current polarity. + * @retval None + */ +void TMRA_PWM_SetStopPolarity(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32Polarity) +{ + uint32_t u32PCONRAddr; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_CH(u8TmrCh)); + DDL_ASSERT(IS_TMRA_PWM_STOP_POLARITY(u32Polarity)); + + u32PCONRAddr = (uint32_t)&TMRAx->PCONR1 + (uint32_t)u8TmrCh * 4U; + MODIFY_REG32(RW_MEM32(u32PCONRAddr), TMRA_PCONR_STPC, u32Polarity); +} + +/** + * @brief Specifies the PWM polarity when counting matches the compare reference value. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u8TmrCh TMRA channel number. + * This parameter can be a value of @ref TMRA_Channel + * @arg TMRA_CH_1: Channel 1 of TMRA. + * @arg TMRA_CH_2: Channel 2 of TMRA. + * @arg TMRA_CH_3: Channel 3 of TMRA. + * @arg TMRA_CH_4: Channel 4 of TMRA. + * @param [in] u32Polarity Polarity of PWM output. + * This parameter can be a value of @ref TMRA_PWM_Match_Cmp_Polarity + * @arg TMRA_PWM_CMP_LOW: The polarity of PWM output is low. + * @arg TMRA_PWM_CMP_HIGH: The polarity of PWM output is high. + * @arg TMRA_PWM_CMP_KEEP: The polarity of PWM output keeps the current polarity. + * @arg TMRA_PWM_CMP_REVERSE: PWM output reverses the current polarity. + * @retval None + */ +void TMRA_PWM_SetMatchCmpPolarity(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32Polarity) +{ + uint32_t u32PCONRAddr; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_CH(u8TmrCh)); + DDL_ASSERT(IS_TMRA_PWM_CMP_POLARITY(u32Polarity)); + + u32PCONRAddr = (uint32_t)&TMRAx->PCONR1 + (uint32_t)u8TmrCh * 4U; + MODIFY_REG32(RW_MEM32(u32PCONRAddr), TMRA_PCONR_CMPC, u32Polarity); +} + +/** + * @brief Specifies the PWM polarity when counting matches the period reference value. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u8TmrCh TMRA channel number. + * This parameter can be a value of @ref TMRA_Channel + * @arg TMRA_CH_1: Channel 1 of TMRA. + * @arg TMRA_CH_2: Channel 2 of TMRA. + * @arg TMRA_CH_3: Channel 3 of TMRA. + * @arg TMRA_CH_4: Channel 4 of TMRA. + * @param [in] u32Polarity Polarity of PWM output. + * This parameter can be a value of @ref TMRA_PWM_Match_Period_Polarity + * @arg TMRA_PWM_PERIOD_LOW: The polarity of PWM output is low. + * @arg TMRA_PWM_PERIOD_HIGH: The polarity of PWM output is high. + * @arg TMRA_PWM_PERIOD_KEEP: The polarity of PWM output keeps the current polarity. + * @arg TMRA_PWM_PERIOD_REVERSE: PWM output reverses the current polarity. + * @retval None + */ +void TMRA_PWM_SetMatchPeriodPolarity(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32Polarity) +{ + uint32_t u32PCONRAddr; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_CH(u8TmrCh)); + DDL_ASSERT(IS_TMRA_PWM_PERIOD_POLARITY(u32Polarity)); + + u32PCONRAddr = (uint32_t)&TMRAx->PCONR1 + (uint32_t)u8TmrCh * 4U; + MODIFY_REG32(RW_MEM32(u32PCONRAddr), TMRA_PCONR_PERC, u32Polarity); +} + +/** + * @brief Specifies the PWM polarity when next cycle start. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u8TmrCh TMRA channel number. + * This parameter can be a value of @ref TMRA_Channel + * @arg TMRA_CH_1: Channel 1 of TMRA. + * @arg TMRA_CH_2: Channel 2 of TMRA. + * @arg TMRA_CH_3: Channel 3 of TMRA. + * @arg TMRA_CH_4: Channel 4 of TMRA. + * @param [in] u32Polarity Polarity of PWM output. + * This parameter can be a value of @ref TMRA_PWM_Force_Polarity + * @arg TMRA_PWM_FORCE_INVALID: Force polarity is invalid. + * @arg TMRA_PWM_FORCE_LOW: Force the PWM output low at the beginning of the next cycle. \ + * The beginning of the next cycle: overflow position or underflow position \ + * of sawtooth wave; valley position of triangle wave. + * @arg TMRA_PWM_FORCE_HIGH: Force the PWM output high at the beginning of the next cycle. \ + * The beginning of the next cycle: overflow position or underflow position \ + * of sawtooth wave; valley position of triangle wave. + * @retval None + */ +void TMRA_PWM_SetForcePolarity(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32Polarity) +{ + uint32_t u32PCONRAddr; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_CH(u8TmrCh)); + DDL_ASSERT(IS_TMRA_PWM_FORCE_POLARITY(u32Polarity)); + + u32PCONRAddr = (uint32_t)&TMRAx->PCONR1 + (uint32_t)u8TmrCh * 4U; + MODIFY_REG32(RW_MEM32(u32PCONRAddr), TMRA_PCONR_FORC, u32Polarity); +} + +/** + * @brief Specifies the capture condition for the specified channel. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u8TmrCh TMRA channel number. + * This parameter can be a value of @ref TMRA_Channel + * @arg TMRA_CH_1: Channel 1 of TMRA. + * @arg TMRA_CH_2: Channel 2 of TMRA. + * @arg TMRA_CH_3: Channel 3 of TMRA. + * @arg TMRA_CH_4: Channel 4 of TMRA. + * @param [in] u32CaptCond The capture condition. Set this parameter to 0xFFFF to select all the conditions of capturing start. + * This parameter can be values of @ref TMRA_Channel_Capture_Condition + * @arg TMRA_CAPT_COND_PWMR: The condition of capture is a rising edge is sampled on PWM(pin). + * @arg TMRA_CAPT_COND_PWMF: The condition of capture is a falling edge is sampled on PWM(pin). + * @arg TMRA_CAPT_COND_EVENT: The condition of capture is the specified event occurred. + * @arg TMRA_CAPT_COND_TRIGR: The condition of capture is a rising edge is sampled on TRIG. + * @arg TMRA_CAPT_COND_TRIGF: The condition of capture is a falling edge is sampled on TRIG. + * @param [in] enNewState An @ref en_functional_state_t value. + * @arg Enable: Enable the sepcified capture conditions. + * @arg Disable: Disable the sepcified capture conditions. + * @retval None + */ +void TMRA_CaptCondCmd(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32CaptCond, en_functional_state_t enNewState) +{ + uint32_t u32CCONRAddr; + + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_TMRA_CH(u8TmrCh)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32CaptCond &= TMRA_CAPT_COND_ALL; + u32CCONRAddr = (uint32_t)&TMRAx->CCONR1 + (uint32_t)u8TmrCh * 4U; + if (enNewState == Enable) + { + SET_REG32_BIT(RW_MEM32(u32CCONRAddr), u32CaptCond); + } + else + { + CLEAR_REG32_BIT(RW_MEM32(u32CCONRAddr), u32CaptCond); + } +} + +/** + * @brief Enable or disable the specified hardware start condition. + * @param [in] TMRAx Pointer to TMRA instance register base. + * This parameter can be a value of the following: + * @arg M4_TMRA_1 ~ M4_TMRA_12: TMRA unit 1 ~ 12 instance register base. + * @param [in] u8TmrCh TMRA channel number. + * This parameter can be a value of @ref TMRA_Channel + * @arg TMRA_CH_1: Channel 1 of TMRA. + * @arg TMRA_CH_2: Channel 2 of TMRA. + * @arg TMRA_CH_3: Channel 3 of TMRA. + * @arg TMRA_CH_4: Channel 4 of TMRA. + * @param [in] u32TrigCond The trigger condition. + * This parameter can be a value of: + * @ref TMRA_Hardware_Start_Condition + * @ref TMRA_Hardware_Stop_Condition + * @ref TMRA_Hardware_Clear_Condition + * @arg TMRA_START_COND_TRIGR: 1. Sync start is invalid: The condition is that a rising edge is sampled on TRIG of the current TMRA unit. \ + * 2. Sync start is valid: The condition is that a rising edge is sampled on TRIG of the symmetric TMRA unit. + * @arg TMRA_START_COND_TRIGF: 1. Sync start is invalid: The condition is that a falling edge is sampled on TRIG of the current TMRA unit. \ + * 2. Sync start is valid: The condition is that a falling edge is sampled on TRIG of the symmetric TMRA unit. + * @arg TMRA_START_COND_EVENT: The condition is that the event which is set in register TMRA_HTSSR0 has occurred. + * @arg TMRA_STOP_COND_TRIGR: The condition is that a rising edge is sampled on pin TRIG of the current TMRA unit. + * @arg TMRA_STOP_COND_TRIGF: The condition is that a falling edge is sampled on pin TRIG of the current TMRA unit. + * @arg TMRA_STOP_COND_EVENT: The condition is that the event which is set in register TMRA_HTSSR0 has occurred. + * @arg TMRA_CLR_COND_TRIGR: The condition is that a rising edge is sampled on TRIG of the current TMRA unit. + * @arg TMRA_CLR_COND_TRIGF: The condition is that a falling edge is sampled on TRIG of the current TMRA unit. + * @arg TMRA_CLR_COND_EVENT: The condition is that the event which is set in register TMRA_HTSSR0 has occurred. + * @arg TMRA_CLR_COND_SYM_TRIGR: The condition is that a rising edge is sampled on TRIG of the symmetric unit. + * @arg TMRA_CLR_COND_SYM_TRIGF: The condition is that a falling edge is sampled on TRIG of the symmetric unit. + * @arg TMRA_CLR_COND_PWM3R: The condition is that a rising edge is sampled on PWM3 of the current TMRA unit. + * @arg TMRA_CLR_COND_PWM3F: The condition is that a falling edge is sampled on PWM3 of the current TMRA unit. + * @param [in] enNewState An en_functional_state_t enumeration type value. + * @arg Enable: Enable the specified hardware start condition. + * @arg Disable: Disable the specified hardware start condition. + * @retval None + */ +void TMRA_TrigCondCmd(M4_TMRA_TypeDef *TMRAx, uint8_t u8TmrCh, uint32_t u32TrigCond, en_functional_state_t enNewState) +{ + DDL_ASSERT(IS_TMRA_UNIT(TMRAx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + u32TrigCond &= TMRA_TRIG_COND_MSK; + if (enNewState == Enable) + { + SET_REG32_BIT(TMRAx->HCONR, u32TrigCond); + } + else + { + CLEAR_REG32_BIT(TMRAx->HCONR, u32TrigCond); + } +} + +/** + * @} + */ + +#endif /* DDL_TMRA_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_trng.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_trng.c new file mode 100644 index 0000000000..d75374fd7f --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_trng.c @@ -0,0 +1,182 @@ +/** + ******************************************************************************* + * @file hc32f4a0_trng.c + * @brief This file provides firmware functions to manage the True Random + * Number Generator(TRNG). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Heqb First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_trng.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_TRNG TRNG + * @brief TRNG Driver Library + * @{ + */ + +#if (DDL_TRNG_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup TRNG_Local_Macros TRNG Local Macros + * @{ + */ +#define TRNG_TIMEOUT (20000UL) + +/** + * @defgroup TRNG_Check_Parameters_Validity TRNG Check Parameters Validity + * @{ + */ +#define IS_VALID_SHIFT_CNT(x) \ +( ((x) == TRNG_SHIFT_COUNT_32) || \ + ((x) == TRNG_SHIFT_COUNT_64) || \ + ((x) == TRNG_SHIFT_COUNT_128) || \ + ((x) == TRNG_SHIFT_COUNT_256)) + +#define IS_VALID_RELOAD(x) \ +( ((x) == TRNG_RELOAD_ENABLE) || \ + ((x) == TRNG_RELOAD_DISABLE)) + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup TRNG_Global_Functions TRNG Global Functions + * @{ + */ + +/** + * @brief Set shift times + * @param [in] u32ShiftCount Config the shift times. + * This parameter can be a value of the following: + * @arg TRNG_SHIFT_COUNT_32 Shift 32 times + * @arg TRNG_SHIFT_COUNT_64 Shift 64 times + * @arg TRNG_SHIFT_COUNT_128 Shift 128 times + * @arg TRNG_SHIFT_COUNT_256 Shift 256 times + * @retval None + */ +void TRNG_SetShiftCnt(uint32_t u32ShiftCount) +{ + DDL_ASSERT(IS_VALID_SHIFT_CNT(u32ShiftCount)); + MODIFY_REG32(M4_TRNG->MR, TRNG_MR_CNT, u32ShiftCount); +} + +/** + * @brief Enable or disable load new value + * @param [in] u32ReloadCmd Enable or disable load new value. + * This parameter can be a value of the following: + * @arg TRNG_RELOAD_ENABLE Enable the function + * @arg TRNG_RELOAD_DISABLE Disable the function + * @retval None + */ +void TRNG_ReloadCmd(uint32_t u32ReloadCmd) +{ + DDL_ASSERT(IS_VALID_RELOAD(u32ReloadCmd)); + MODIFY_REG32(M4_TRNG->MR, TRNG_MR_LOAD, u32ReloadCmd); +} + +/** + * @brief Start TRNG and get random number + * @param [in] au32Random The destination address where the random number will be stored. + * @retval Ok: Success + * ErrorTimeout: Process timeout + * ErrorInvalidParameter: Parameter error + * @note Please pass in an array of 64 bits or more + */ +en_result_t TRNG_Generate(uint32_t au32Random[]) +{ + en_result_t enRet = ErrorInvalidParameter; + uint32_t u32TimeCount = 0U; + if(au32Random != NULL) + { + enRet = Ok; + /* Enable TRNG circuit. */ + SET_REG32_BIT(M4_TRNG->CR, TRNG_CR_EN); + /* Start TRNG */ + SET_REG32_BIT(M4_TRNG->CR, TRNG_CR_RUN); + /* Wait for the TRNG to stop */ + while(READ_REG32_BIT(M4_TRNG->CR, TRNG_CR_RUN) == 1U) + { + if(u32TimeCount++ > TRNG_TIMEOUT) + { + enRet = ErrorTimeout; + break; + } + } + if(enRet == Ok) + { + /* Get the random number. */ + au32Random[0U] = READ_REG32(M4_TRNG->DR0); + au32Random[1U] = READ_REG32(M4_TRNG->DR1); + /* Disable TRNG circuit. */ + CLEAR_REG32_BIT(M4_TRNG->CR, TRNG_CR_EN); + } + } + return enRet; +} + +/** + * @} + */ + +#endif /* DDL_TRNG_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_usart.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_usart.c new file mode 100644 index 0000000000..0b44342360 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_usart.c @@ -0,0 +1,2710 @@ +/** + ******************************************************************************* + * @file hc32f4a0_usart.c + * @brief This file provides firmware functions to manage the USART(Universal + * Synchronous/Asynchronous Receiver Transmitter). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Hongjh First version + 2020-07-03 Hongjh Add doxygen group:USART_Local_Functions. + 2020-08-25 Hongjh The variable f32Err un-initializes an + unnecessary assignment. + 2020-10-19 Hongjh Modify USART initialization function. + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_usart.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_USART USART + * @brief USART Driver Library + * @{ + */ + +#if (DDL_USART_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup USART_Local_Macros USART Local Macros + * @{ + */ + +/** + * @defgroup USART_Check_Parameters_Validity USART Check Parameters Validity + * @{ + */ + +#define IS_USART_INSTANCE(x) \ +( (M4_USART1 == (x)) || \ + (M4_USART2 == (x)) || \ + (M4_USART3 == (x)) || \ + (M4_USART4 == (x)) || \ + (M4_USART5 == (x)) || \ + (M4_USART6 == (x)) || \ + (M4_USART7 == (x)) || \ + (M4_USART8 == (x)) || \ + (M4_USART9 == (x)) || \ + (M4_USART10 == (x))) + +#define IS_USART_SMARTCARD_INSTANCE(x) \ +( (M4_USART1 == (x)) || \ + (M4_USART2 == (x)) || \ + (M4_USART3 == (x)) || \ + (M4_USART4 == (x)) || \ + (M4_USART6 == (x)) || \ + (M4_USART7 == (x)) || \ + (M4_USART8 == (x)) || \ + (M4_USART9 == (x))) + +#define IS_USART_LIN_INSTANCE(x) \ +( (M4_USART5 == (x)) || \ + (M4_USART10 == (x))) + +#define IS_USART_STOPMODE_INSTANCE(x) (M4_USART1 == (x)) + +#define IS_USART_TIMEOUT_INSTANCE(x) \ +( (M4_USART1 == (x)) || \ + (M4_USART2 == (x)) || \ + (M4_USART5 == (x)) || \ + (M4_USART6 == (x))) + +#define IS_USART_FRACTION_INSTANCE(x) \ +( (M4_USART1 == (x)) || \ + (M4_USART2 == (x)) || \ + (M4_USART3 == (x)) || \ + (M4_USART4 == (x)) || \ + (M4_USART6 == (x)) || \ + (M4_USART7 == (x)) || \ + (M4_USART8 == (x)) || \ + (M4_USART9 == (x))) + +#define IS_USART_FUNCTION(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & (~USART_FUNCTION_MASK)))) + +#define IS_USART_LIN_FUNCTION(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & (~USART_LIN_FUNCTION_MASK)))) + +#define IS_USART_FLAG(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & (~USART_FLAG_MASK)))) + +#define IS_USART_CLEAR_FLAG(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & (~USART_CLEAR_FLAG_MASK)))) + +#define IS_USART_TRANSMISSION_TYPE(x) \ +( (USART_TRANSMISSION_ID == (x)) || \ + (USART_TRANSMISSION_DATA == (x))) + +#define IS_USART_PARITY_CONTROL(x) \ +( (USART_PARITY_ODD == (x)) || \ + (USART_PARITY_EVEN == (x)) || \ + (USART_PARITY_NONE == (x))) + +#define IS_USART_DATA_WIDTH(x) \ +( (USART_DATA_LENGTH_8BIT == (x)) || \ + (USART_DATA_LENGTH_9BIT == (x))) + +#define IS_USART_NOISE_FILTER(x) \ +( (USART_NOISE_FILTER_ENABLE == (x)) || \ + (USART_NOISE_FILTER_DISABLE == (x))) + +#define IS_USART_OVERSAMPLING_BITS(x) \ +( (USART_OVERSAMPLING_8BIT == (x)) || \ + (USART_OVERSAMPLING_16BIT == (x))) + +#define IS_USART_SIGNIFICANT_BIT(x) \ +( (USART_MSB == (x)) || \ + (USART_LSB == (x))) + +#define IS_USART_SB_DETECT_POLARITY(x) \ +( (USART_SB_DETECT_LOW == (x)) || \ + (USART_SB_DETECT_FALLING == (x))) + +#define IS_USART_CLOCK_MODE(x) \ +( (USART_EXTCLK == (x)) || \ + (USART_INTERNCLK_OUTPUT == (x)) || \ + (USART_INTERNCLK_NONE_OUTPUT == (x))) + +#define IS_USART_SMARTCARD_CLOCK_MODE(x) \ +( (USART_INTERNCLK_OUTPUT == (x)) || \ + (USART_INTERNCLK_NONE_OUTPUT == (x))) + +#define IS_USART_CLKSYNC_CLOCK_MODE(x) \ +( (USART_EXTCLK == (x)) || \ + (USART_INTERNCLK_OUTPUT == (x))) + +#define IS_USART_STOP_BITS(x) \ +( (USART_STOPBIT_1BIT == (x)) || \ + (USART_STOPBIT_2BIT == (x))) + +#define IS_UART_DUPLEX_MODE(x) \ +( (USART_HALFDUPLEX_MODE == (x)) || \ + (USART_FULLDUPLEX_MODE == (x))) + +#define IS_USART_HWFLOWCTRL(x) \ +( (USART_HWFLOWCTRL_NONE == (x)) || \ + (USART_HWFLOWCTRL_CTS == (x)) || \ + (USART_HWFLOWCTRL_RTS == (x)) || \ + (USART_HWFLOWCTRL_RTS_CTS == (x))) + +#define IS_USART_PCLK_DIV(x) \ +( (USART_PCLK_DIV1 == (x)) || \ + (USART_PCLK_DIV4 == (x)) || \ + (USART_PCLK_DIV16 == (x)) || \ + (USART_PCLK_DIV64 == (x))) + +#define IS_USART_LIN_BMC_PCLK_DIV(x) \ +( (USART_LIN_BMC_PCLK_DIV1 == (x)) || \ + (USART_LIN_BMC_PCLK_DIV2 == (x)) || \ + (USART_LIN_BMC_PCLK_DIV4 == (x)) || \ + (USART_LIN_BMC_PCLK_DIV8 == (x))) + +#define IS_USART_STOPMODE_FILTER(x) \ +( (USART_STOP_MODE_FILTER_NONE == (x)) || \ + (USART_STOP_MODE_FILTER_WIDTH_LEVEL_1 == (x)) || \ + (USART_STOP_MODE_FILTER_WIDTH_LEVEL_2 == (x)) || \ + (USART_STOP_MODE_FILTER_WIDTH_LEVEL_3 == (x)) || \ + (USART_STOP_MODE_FILTER_WIDTH_LEVEL_4 == (x))) + +#define IS_USART_SMARTCARD_ETU_CLK(x) \ +( (USART_SC_ETU_CLK_32 == (x)) || \ + (USART_SC_ETU_CLK_64 == (x)) || \ + (USART_SC_ETU_CLK_128 == (x)) || \ + (USART_SC_ETU_CLK_256 == (x)) || \ + (USART_SC_ETU_CLK_372 == (x))) + +#define IS_USART_LIN_SEND_BREAK_MODE(x) \ +( (USART_LIN_SEND_BREAK_MODE_SBK == (x)) || \ + (USART_LIN_SEND_BREAK_MODE_TDR == (x))) + +#define IS_USART_LIN_DETECT_BREAK_LEN(x) \ +( (USART_LIN_DETECT_BREAK_10BIT == (x)) || \ + (USART_LIN_DETECT_BREAK_11BIT == (x))) + +#define IS_USART_LIN_SEND_BREAK_LEN(x) \ +( (USART_LIN_SEND_BREAK_10BIT == (x)) || \ + (USART_LIN_SEND_BREAK_11BIT == (x)) || \ + (USART_LIN_SEND_BREAK_13BIT == (x)) || \ + (USART_LIN_SEND_BREAK_14BIT == (x))) + +/** + * @} + */ + +/** + * @defgroup USART_Flag_Mask USART flag mask definition + * @{ + */ +#define USART_FLAG_MASK (USART_FLAG_PE | \ + USART_FLAG_FE | \ + USART_FLAG_ORE | \ + USART_FLAG_BE | \ + USART_FLAG_RXNE | \ + USART_FLAG_TC | \ + USART_FLAG_TXE | \ + USART_FLAG_RTOF | \ + USART_FLAG_LBD | \ + USART_FLAG_WKUP | \ + USART_FLAG_MPB) +/** + * @} + */ + +/** + * @defgroup USART_Clear_Flag_Mask USART clear flag mask definition + * @{ + */ +#define USART_CLEAR_FLAG_MASK (USART_CLEAR_FLAG_PE | \ + USART_CLEAR_FLAG_FE | \ + USART_CLEAR_FLAG_ORE | \ + USART_CLEAR_FLAG_RTOF | \ + USART_CLEAR_FLAG_BE | \ + USART_CLEAR_FLAG_WKUP | \ + USART_CLEAR_FLAG_LBD) +/** + * @} + */ + +/** + * @defgroup USART_function_Mask USART function mask definition + * @{ + */ +#define USART_FUNCTION_MASK (USART_RX | \ + USART_TX | \ + USART_RTO | \ + USART_INT_RX | \ + USART_INT_TC | \ + USART_INT_TXE | \ + USART_INT_RTO) +/** + * @} + */ + +/** + * @defgroup USART_LIN_function_Mask USART LIN function mask definition + * @{ + */ +#define USART_LIN_FUNCTION_MASK (USART_LIN | \ + USART_LIN_WKUP | \ + USART_LIN_BUSERR | \ + USART_LIN_INT_WKUP | \ + USART_LIN_INT_BREAK | \ + USART_LIN_INT_BUSERR) +/** + * @} + */ + +/** + * @defgroup USART_CR1_Clear_Flag_Mask USART register clear flag bits mask definition + * @{ + */ +#define USART_CR1_CLR_FLAG_MASK (USART_CR1_CPE | \ + USART_CR1_CORE | \ + USART_CR1_CFE | \ + USART_CR1_CRTOF | \ + USART_CR1_CBE | \ + USART_CR1_CWKUP | \ + USART_CR1_CLBD) +/** + * @} + */ + +/** + * @defgroup USART_CR2_Reserved_Bit USART CR2 register reserved bit 9/10 definition + * @{ + */ +#define USART_CR2_BIT9 (0x00000200UL) +#define USART_CR2_BIT10 (0x00000400UL) +/** + * @} + */ + +/** + * @defgroup USART_Clk_Frequency USART Clk Frequency + * @{ + */ +#define USART_DIV(INSTANCE) \ +( 1UL << (READ_REG32_BIT((INSTANCE)->PR, USART_PR_PSC) * 2UL)) + +#define USART_BMC_DIV(INSTANCE) \ +( 1UL << (READ_REG32_BIT((INSTANCE)->PR, USART_PR_LBMPSC) >> USART_PR_LBMPSC_POS)) + +#define PCLK_FREQ \ +( SystemCoreClock >> (READ_REG32_BIT(M4_CMU->SCFGR, CMU_SCFGR_PCLK1S) >> CMU_SCFGR_PCLK1S_POS)) +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ +/** + * @addtogroup USART_Local_Functions + * @{ + */ + +static en_result_t CalcUartBaudrate(const M4_USART_TypeDef *USARTx, + uint32_t u32UartClk, + uint32_t u32Baudrate, + uint32_t *pu32BrrVal, + uint32_t *pu32FractEn, + float32_t *pf32Err); +static en_result_t CalcClkSyncBaudrate(const M4_USART_TypeDef *USARTx, + uint32_t u32UsartClk, + uint32_t u32Baudrate, + uint32_t *pu32BrrVal, + uint32_t *pu32FractEn, + float32_t *pf32Err); +static en_result_t CalcSmartcardBaudrate(const M4_USART_TypeDef *USARTx, + uint32_t u32UartClk, + uint32_t u32Baudrate, + uint32_t *pu32BrrVal, + uint32_t *pu32FractEn, + float32_t *pf32Err); + +/** + * @} + */ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup USART_Global_Functions USART Global Functions + * @{ + */ + +/** + * @brief Initialize UART function. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] pstcInit Pointer to a @ref stc_usart_uart_init_t structure. + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: the pointer pstcInit is NULL or baudrate set unsuccessfully + */ +en_result_t USART_UartInit(M4_USART_TypeDef *USARTx, + const stc_usart_uart_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_CLOCK_MODE(pstcInit->u32ClkMode)); + DDL_ASSERT(IS_USART_PARITY_CONTROL(pstcInit->u32Parity)); + DDL_ASSERT(IS_USART_DATA_WIDTH(pstcInit->u32DataWidth)); + DDL_ASSERT(IS_USART_STOP_BITS(pstcInit->u32StopBit)); + DDL_ASSERT(IS_USART_OVERSAMPLING_BITS(pstcInit->u32OversamplingBits)); + DDL_ASSERT(IS_USART_SIGNIFICANT_BIT(pstcInit->u32BitDirection)); + DDL_ASSERT(IS_USART_NOISE_FILTER(pstcInit->u32NoiseFilterState)); + DDL_ASSERT(IS_USART_SB_DETECT_POLARITY(pstcInit->u32SbDetectPolarity)); + DDL_ASSERT(IS_USART_HWFLOWCTRL(pstcInit->u32HwFlowCtrl)); + + /* Disbale TX/RX && clear flag */ + WRITE_REG32(USARTx->CR1, USART_CR1_CLR_FLAG_MASK); + + /* Set CR2 */ + WRITE_REG32(USARTx->CR2, (USART_CR2_BIT9 | \ + USART_CR2_BIT10 | \ + pstcInit->u32ClkMode | + pstcInit->u32StopBit)); + + /* Set CR3 */ + WRITE_REG32(USARTx->CR3, pstcInit->u32HwFlowCtrl); + + /* Set CR1 */ + WRITE_REG32(USARTx->CR1, (pstcInit->u32Parity | \ + pstcInit->u32DataWidth | \ + pstcInit->u32OversamplingBits | \ + pstcInit->u32BitDirection | \ + pstcInit->u32NoiseFilterState | \ + pstcInit->u32SbDetectPolarity)); + + /* Set LBMC */ + WRITE_REG32(USARTx->LBMC, 0UL); + + if (USART_EXTCLK != pstcInit->u32ClkMode) + { + DDL_ASSERT(IS_USART_PCLK_DIV(pstcInit->u32PclkDiv)); + + /* Set PR */ + WRITE_REG32(USARTx->PR, pstcInit->u32PclkDiv); + + /* Set baudrate */ + enRet = USART_SetBaudrate(USARTx, pstcInit->u32Baudrate, NULL); + } + else + { + enRet = Ok; + } + } + + return enRet; +} + +/** + * @brief Initialize UART half duplex function. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] pstcInit Pointer to a @ref stc_usart_uart_init_t structure. + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: the pointer pstcInit is NULL or baudrate set unsuccessfully + */ +en_result_t USART_HalfduplexInit(M4_USART_TypeDef *USARTx, + const stc_usart_uart_init_t *pstcInit) +{ + en_result_t enRet; + + enRet = USART_UartInit(USARTx, pstcInit); + if (Ok == enRet) + { + /* Set CR3: UART half duplex */ + SET_REG32_BIT(USARTx->CR3, USART_CR3_HDSEL); + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_usart_uart_init_t to default values. + * @param [out] pstcInit Pointer to a @ref stc_usart_uart_init_t structure. + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: the pointer pstcInit is NULL + */ +en_result_t USART_UartStructInit(stc_usart_uart_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + pstcInit->u32Baudrate = 9600UL; + pstcInit->u32ClkMode = USART_INTERNCLK_NONE_OUTPUT; + pstcInit->u32PclkDiv = USART_PCLK_DIV1; + pstcInit->u32Parity = USART_PARITY_NONE; + pstcInit->u32DataWidth = USART_DATA_LENGTH_8BIT; + pstcInit->u32StopBit = USART_STOPBIT_1BIT; + pstcInit->u32OversamplingBits = USART_OVERSAMPLING_16BIT; + pstcInit->u32BitDirection = USART_LSB; + pstcInit->u32NoiseFilterState = USART_NOISE_FILTER_DISABLE; + pstcInit->u32SbDetectPolarity = USART_SB_DETECT_FALLING; + pstcInit->u32HwFlowCtrl = USART_HWFLOWCTRL_NONE; + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Initialize UART multiple processor function. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] pstcInit Pointer to a @ref stc_usart_multiprocessor_init_t structure. + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: the pointer pstcInit is NULL or baudrate set unsuccessfully + */ +en_result_t USART_MultiProcessorInit(M4_USART_TypeDef *USARTx, + const stc_usart_multiprocessor_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_CLOCK_MODE(pstcInit->u32ClkMode)); + DDL_ASSERT(IS_USART_DATA_WIDTH(pstcInit->u32DataWidth)); + DDL_ASSERT(IS_USART_STOP_BITS(pstcInit->u32StopBit)); + DDL_ASSERT(IS_USART_OVERSAMPLING_BITS(pstcInit->u32OversamplingBits)); + DDL_ASSERT(IS_USART_SIGNIFICANT_BIT(pstcInit->u32BitDirection)); + DDL_ASSERT(IS_USART_NOISE_FILTER(pstcInit->u32NoiseFilterState)); + DDL_ASSERT(IS_USART_SB_DETECT_POLARITY(pstcInit->u32SbDetectPolarity)); + DDL_ASSERT(IS_USART_HWFLOWCTRL(pstcInit->u32HwFlowCtrl)); + + /* Disbale TX/RX && clear flag */ + WRITE_REG32(USARTx->CR1, USART_CR1_CLR_FLAG_MASK); + + /* Set CR2 */ + WRITE_REG32(USARTx->CR2, (USART_CR2_MPE | \ + USART_CR2_BIT9 | \ + USART_CR2_BIT10 | \ + pstcInit->u32ClkMode | \ + pstcInit->u32StopBit)); + + /* Set CR3 */ + WRITE_REG32(USARTx->CR3, pstcInit->u32HwFlowCtrl); + + /* Set CR1 */ + WRITE_REG32(USARTx->CR1, (pstcInit->u32DataWidth | \ + pstcInit->u32OversamplingBits | \ + pstcInit->u32BitDirection | \ + pstcInit->u32NoiseFilterState | \ + pstcInit->u32SbDetectPolarity)); + + /* Set LBMC */ + WRITE_REG32(USARTx->LBMC, 0UL); + + if (USART_EXTCLK != pstcInit->u32ClkMode) + { + DDL_ASSERT(IS_USART_PCLK_DIV(pstcInit->u32PclkDiv)); + + /* Set PR */ + WRITE_REG32(USARTx->PR, pstcInit->u32PclkDiv); + + /* Set baudrate */ + enRet = USART_SetBaudrate(USARTx, pstcInit->u32Baudrate, NULL); + } + else + { + enRet = Ok; + } + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_usart_multiprocessor_init_t to default values. + * @param [out] pstcInit Pointer to a @ref stc_usart_multiprocessor_init_t structure. + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: the pointer pstcInit is NULL + */ +en_result_t USART_MultiProcessorStructInit(stc_usart_multiprocessor_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + pstcInit->u32Baudrate = 9600UL; + pstcInit->u32ClkMode = USART_INTERNCLK_NONE_OUTPUT; + pstcInit->u32PclkDiv = USART_PCLK_DIV1; + pstcInit->u32DataWidth = USART_DATA_LENGTH_8BIT; + pstcInit->u32StopBit = USART_STOPBIT_1BIT; + pstcInit->u32OversamplingBits = USART_OVERSAMPLING_16BIT; + pstcInit->u32BitDirection = USART_LSB; + pstcInit->u32NoiseFilterState = USART_NOISE_FILTER_DISABLE; + pstcInit->u32SbDetectPolarity = USART_SB_DETECT_FALLING; + pstcInit->u32HwFlowCtrl = USART_HWFLOWCTRL_NONE; + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Initialize LIN function. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] pstcInit Pointer to a @ref stc_usart_lin_init_t structure. + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: the pointer pstcInit is NULL or baudrate set unsuccessfully + * @note LIN feature is supported by M4_USART5/M4_USART10 + */ +en_result_t USART_LinInit(M4_USART_TypeDef *USARTx, + const stc_usart_lin_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + /* Check parameters */ + DDL_ASSERT(IS_USART_LIN_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_CLOCK_MODE(pstcInit->u32ClkMode)); + DDL_ASSERT(IS_USART_OVERSAMPLING_BITS(pstcInit->u32OversamplingBits)); + DDL_ASSERT(IS_USART_LIN_DETECT_BREAK_LEN(pstcInit->u32DetectBreakLen)); + DDL_ASSERT(IS_USART_LIN_SEND_BREAK_LEN(pstcInit->u32SendBreakLen)); + DDL_ASSERT(IS_USART_LIN_SEND_BREAK_MODE(pstcInit->u32SendBreakMode)); + + /* Disbale TX/RX && clear flag */ + WRITE_REG32(USARTx->CR1, USART_CR1_CLR_FLAG_MASK); + + /* Set CR2 */ + WRITE_REG32(USARTx->CR2, (USART_CR2_BIT9 | \ + USART_CR2_BIT10 | \ + pstcInit->u32ClkMode | \ + USART_CR2_LINEN | \ + pstcInit->u32DetectBreakLen | \ + pstcInit->u32SendBreakLen | \ + pstcInit->u32SendBreakMode)); + + /* Set CR3 */ + WRITE_REG32(USARTx->CR3, 0UL); + + /* Set CR1 */ + WRITE_REG32(USARTx->CR1, (pstcInit->u32OversamplingBits | \ + USART_CR1_SBS)); + + /* Set LBMC */ + WRITE_REG32(USARTx->LBMC, 0UL); + + if (USART_EXTCLK != pstcInit->u32ClkMode) + { + DDL_ASSERT(IS_USART_PCLK_DIV(pstcInit->u32PclkDiv)); + DDL_ASSERT(IS_USART_LIN_BMC_PCLK_DIV(pstcInit->u32BmcPclkDiv)); + + /* Set PR */ + WRITE_REG32(USARTx->PR, (pstcInit->u32PclkDiv | \ + pstcInit->u32BmcPclkDiv)); + + /* Set baudrate */ + enRet = USART_SetBaudrate(USARTx, pstcInit->u32Baudrate, NULL); + } + else + { + enRet = Ok; + } + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_usart_lin_init_t to default values. + * @param [out] pstcInit Pointer to a @ref stc_usart_lin_init_t structure. + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: the pointer pstcInit is NULL + */ +en_result_t USART_LinStructInit(stc_usart_lin_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + pstcInit->u32Baudrate = 9600UL; + pstcInit->u32ClkMode = USART_INTERNCLK_NONE_OUTPUT; + pstcInit->u32PclkDiv = USART_PCLK_DIV1; + pstcInit->u32BmcPclkDiv = USART_LIN_BMC_PCLK_DIV1; + pstcInit->u32OversamplingBits = USART_OVERSAMPLING_16BIT; + pstcInit->u32DetectBreakLen = USART_LIN_DETECT_BREAK_10BIT; + pstcInit->u32SendBreakLen = USART_LIN_SEND_BREAK_10BIT; + pstcInit->u32SendBreakMode = USART_LIN_SEND_BREAK_MODE_SBK; + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Initialize smartcard function. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @param [in] pstcInit Pointer to a @ref stc_usart_smartcard_init_t structure. + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: the pointer pstcInit is NULL or baudrate set unsuccessfully + * @note Smartcard feature is unsupported by M4_USART5/M4_USART10 + */ +en_result_t USART_SmartcardInit(M4_USART_TypeDef *USARTx, + const stc_usart_smartcard_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + /* Check parameters */ + DDL_ASSERT(IS_USART_SMARTCARD_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_SMARTCARD_CLOCK_MODE(pstcInit->u32ClkMode)); + DDL_ASSERT(IS_USART_PCLK_DIV(pstcInit->u32PclkDiv)); + DDL_ASSERT(IS_USART_SIGNIFICANT_BIT(pstcInit->u32BitDirection)); + + /* Disbale TX/RX && clear flag */ + WRITE_REG32(USARTx->CR1, USART_CR1_CLR_FLAG_MASK); + + /* Set CR2 */ + WRITE_REG32(USARTx->CR2, (USART_CR2_BIT9 | \ + USART_CR2_BIT10 | \ + pstcInit->u32ClkMode | \ + pstcInit->u32StopBit)); + + /* Set CR3 */ + WRITE_REG32(USARTx->CR3, USART_CR3_SCEN | USART_SC_ETU_CLK_372); + + /* Set CR1 */ + WRITE_REG32(USARTx->CR1, (USART_CR1_PCE | \ + pstcInit->u32BitDirection | \ + USART_CR1_SBS)); + + /* Set PR */ + WRITE_REG32(USARTx->PR, pstcInit->u32PclkDiv); + + /* Set LBMC */ + WRITE_REG32(USARTx->LBMC, 0UL); + + /* Set baudrate */ + enRet = USART_SetBaudrate(USARTx, pstcInit->u32Baudrate, NULL); + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_usart_smartcard_init_t to default values. + * @param [out] pstcInit Pointer to a @ref stc_usart_smartcard_init_t structure. + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: the pointer pstcInit is NULL + */ +en_result_t USART_SmartcardStructInit(stc_usart_smartcard_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + pstcInit->u32Baudrate = 9600UL; + pstcInit->u32ClkMode = USART_INTERNCLK_NONE_OUTPUT; + pstcInit->u32PclkDiv = USART_PCLK_DIV1; + pstcInit->u32BitDirection = USART_LSB; + enRet = Ok; + } + + return enRet; +} + +/** + * @brief Initialize clock synchronization function. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] pstcInit Pointer to a @ref stc_usart_clksync_init_t structure. + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: the pointer pstcInit is NULL or baudrate set unsuccessfully + */ +en_result_t USART_ClkSyncInit(M4_USART_TypeDef *USARTx, + const stc_usart_clksync_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_CLKSYNC_CLOCK_MODE(pstcInit->u32ClkMode)); + DDL_ASSERT(IS_USART_SIGNIFICANT_BIT(pstcInit->u32BitDirection)); + DDL_ASSERT(IS_USART_HWFLOWCTRL(pstcInit->u32HwFlowCtrl)); + + /* Disbale TX/RX && clear flag */ + WRITE_REG32(USARTx->CR1, USART_CR1_CLR_FLAG_MASK); + + /* Set CR2 */ + WRITE_REG32(USARTx->CR2, (USART_CR2_BIT9 | \ + USART_CR2_BIT10 | \ + pstcInit->u32ClkMode)); + + /* Set CR3 */ + WRITE_REG32(USARTx->CR3, pstcInit->u32HwFlowCtrl); + + /* Set CR1 */ + WRITE_REG32(USARTx->CR1, (USART_CR1_MS | \ + pstcInit->u32BitDirection | \ + USART_CR1_SBS)); + + /* Set LBMC */ + WRITE_REG32(USARTx->LBMC, 0UL); + + if (USART_EXTCLK != pstcInit->u32ClkMode) + { + DDL_ASSERT(IS_USART_PCLK_DIV(pstcInit->u32PclkDiv)); + + /* Set PR */ + WRITE_REG32(USARTx->PR, pstcInit->u32PclkDiv); + + /* Set baudrate */ + enRet = USART_SetBaudrate(USARTx, pstcInit->u32Baudrate, NULL); + } + else + { + enRet = Ok; + } + } + + return enRet; +} + +/** + * @brief Set the fields of structure stc_usart_clksync_init_t to default values. + * @param [out] pstcInit Pointer to a @ref stc_usart_clksync_init_t structure. + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - ErrorInvalidParameter: the pointer pstcInit is NULL + */ +en_result_t USART_ClkSyncStructInit(stc_usart_clksync_init_t *pstcInit) +{ + en_result_t enRet = ErrorInvalidParameter; + + /* Check structure pointer */ + if (NULL != pstcInit) + { + pstcInit->u32Baudrate = 9600UL; + pstcInit->u32ClkMode = USART_INTERNCLK_NONE_OUTPUT; + pstcInit->u32PclkDiv = USART_PCLK_DIV1; + pstcInit->u32BitDirection = USART_LSB; + pstcInit->u32HwFlowCtrl = USART_HWFLOWCTRL_NONE; + enRet = Ok; + } + + return enRet; +} + +/** + * @brief De-Initialize USART function. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @retval None + */ +void USART_DeInit(M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + + /* Configures the registers to reset value. */ + WRITE_REG32(USARTx->CR1, USART_CR1_CLR_FLAG_MASK); + WRITE_REG32(USARTx->PR, 0x00000000UL); + WRITE_REG32(USARTx->BRR, 0x0000FF00UL); + WRITE_REG32(USARTx->CR1, 0x80000000UL); + WRITE_REG32(USARTx->CR2, 0x00000600UL); + WRITE_REG32(USARTx->CR3, 0x00000000UL); + WRITE_REG32(USARTx->LBMC, 0x00000000UL); +} + +/** + * @brief Enable/disable USART Transmit/Receive Function. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32Func USART function type + * This parameter can be any composed value of the following values: + * @arg USART_RX: USART RX function + * @arg USART_TX: USART TX function + * @arg USART_RTO: USART RX timerout function + * @arg USART_INT_RX: USART receive data register not empty && receive error interrupt + * @arg USART_INT_TE: USART transmit data register empty interrupt + * @arg USART_INT_TC: USART transmission complete interrupt + * @arg USART_INT_RTO: USART RX timerout interrupt + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + * @note USART RX timeout feature is supported by M4_USART1/M4_USART2/M4_USART5/M4_USART6 + */ +void USART_FuncCmd(M4_USART_TypeDef *USARTx, + uint32_t u32Func, + en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_TIMEOUT_INSTANCE(USARTx) || \ + ((!IS_USART_TIMEOUT_INSTANCE(USARTx)) && (0UL == (u32Func & (USART_RTO | USART_INT_RTO))))); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_USART_FUNCTION(u32Func)); + + (Enable == enNewState) ? SET_REG32_BIT(USARTx->CR1, u32Func) : CLEAR_REG32_BIT(USARTx->CR1, u32Func); +} + +/** + * @brief Get USART function state. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32Func USART function type + * This parameter can be one of the following values: + * @arg USART_RX: USART RX function + * @arg USART_TX: USART TX function + * @arg USART_RTO: USART RX timerout function + * @arg USART_INT_RX: USART RX interrupt function + * @arg USART_INT_TXE: Transmit data register empty interrupt + * @arg USART_INT_TC: USART transmission complete interrupt + * @arg USART_INT_RTO: USART RX timerout interrupt + * @retval An en_functional_state_t enumeration value: + * - Enable: Enable function + * - Disable: Disable function + */ +en_functional_state_t USART_GetFuncState(const M4_USART_TypeDef *USARTx, + uint32_t u32Func) +{ + /* Check parameters */ + DDL_ASSERT (IS_USART_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_FUNCTION(u32Func)); + + return (READ_REG32_BIT(USARTx->CR1, u32Func) ? Enable : Disable); +} + +/** + * @brief Get USART flag. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32Flag USART flag type + * This parameter can be any composed value of the following values: + * @arg USART_FLAG_PE: Parity error flag + * @arg USART_FLAG_FE: Framing error flag + * @arg USART_FLAG_ORE: Overrun error flag + * @arg USART_FLAG_BE: LIN bus error flag + * @arg USART_FLAG_RXNE: Receive data register not empty flag + * @arg USART_FLAG_TC: Transmission complete flag + * @arg USART_FLAG_TXE: Transmit data register empty flag + * @arg USART_FLAG_MPB: Receive processor ID flag + * @arg USART_FLAG_RTOF: Receive timeout flag + * @arg USART_FLAG_LBD: LIN break signal detection flag + * @arg USART_FLAG_WKUP: LIN wakeup signal detection flag + * @arg USART_FLAG_MPB: Receive processor ID flag + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t USART_GetStatus(const M4_USART_TypeDef *USARTx, + uint32_t u32Flag) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_FLAG(u32Flag)); + + return (READ_REG32_BIT(USARTx->SR, u32Flag) ? Set : Reset); +} + +/** + * @brief Get USART flag. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32Flag USART flag type + * This parameter can be any composed value of the following values: + * @arg USART_CLEAR_FLAG_PE: Clear Parity error flag + * @arg USART_CLEAR_FLAG_FE: Clear Framing error flag + * @arg USART_CLEAR_FLAG_ORE: Clear Overrun error flag + * @arg USART_CLEAR_FLAG_RTOF:Clear RX timeout flag + * @arg USART_CLEAR_FLAG_BE: Clear LIN bus error flag + * @arg USART_CLEAR_FLAG_WKUP:Clear LIN wakeup signal flag + * @arg USART_CLEAR_FLAG_LBD: Clear Clear LIN break detection flag + * @retval None + */ +void USART_ClearStatus(M4_USART_TypeDef *USARTx, uint32_t u32Flag) +{ + /* Check parameters */ + DDL_ASSERT (IS_USART_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_CLEAR_FLAG(u32Flag)); + + SET_REG32_BIT(USARTx->CR1, u32Flag); +} + +/** + * @brief Set USART transmission type. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32Type USART transmission content type + * This parameter can be one of the following values: + * @arg USART_TRANSMISSION_ID USART transmission content type is processor ID + * @arg USART_TRANSMISSION_DATA USART transmission content type is frame data + * @retval None + */ +void USART_SetTransmissionType(M4_USART_TypeDef *USARTx, uint32_t u32Type) +{ + /* Check parameters */ + DDL_ASSERT (IS_USART_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_TRANSMISSION_TYPE(u32Type)); + + MODIFY_REG32(USARTx->DR, USART_DR_MPID, u32Type); +} + +/** + * @brief Get USART transmission type. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @retval Returned value can be one of the following values: + * @arg USART_TRANSMISSION_ID USART transmission content type is processor ID + * @arg USART_TRANSMISSION_DATA USART transmission content type is frame data + */ +uint32_t USART_GetTransmissionType(const M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + + return READ_REG32_BIT(USARTx->DR, USART_DR_MPID); +} + +/** + * @brief Set USART parity. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32Parity USART parity + * This parameter can be one of the following values: + * @arg USART_PARITY_NONE: Parity control disabled + * @arg USART_PARITY_ODD: Parity control enabled and Odd Parity is selected + * @arg USART_PARITY_EVEN: Parity control enabled and Even Parity is selected + * @retval None + */ +void USART_SetParity(M4_USART_TypeDef *USARTx, uint32_t u32Parity) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_PARITY_CONTROL(u32Parity)); + + MODIFY_REG32(USARTx->CR1, (USART_CR1_PS | USART_CR1_PCE), u32Parity); +} + +/** + * @brief Get USART parity. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @retval Returned value can be one of the following values: + * @arg USART_PARITY_NONE: Parity control disabled + * @arg USART_PARITY_ODD: Parity control enabled and Odd Parity is selected + * @arg USART_PARITY_EVEN: Parity control enabled and Even Parity is selected + */ +uint32_t USART_GetParity(const M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + + return READ_REG32_BIT(USARTx->CR1, (USART_CR1_PS | USART_CR1_PCE)); +} + +/** + * @brief Set USART data width. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32DataWidth USART data width + * This parameter can be one of the following values: + * @arg USART_DATA_LENGTH_8BIT: 8 bits word length + * @arg USART_DATA_LENGTH_9BIT: 9 bits word length + * @retval None + */ +void USART_SetDataWidth(M4_USART_TypeDef *USARTx, uint32_t u32DataWidth) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_DATA_WIDTH(u32DataWidth)); + + MODIFY_REG32(USARTx->CR1, USART_CR1_M, u32DataWidth); +} + +/** + * @brief Get USART data width. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @retval Returned value can be one of the following values: + * @arg USART_DATA_LENGTH_8BIT: 8 bits word length + * @arg USART_DATA_LENGTH_9BIT: 9 bits word length + */ +uint32_t USART_GetDataWidth(const M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + + return READ_REG32_BIT(USARTx->CR1, USART_CR1_M); +} + +/** + * @brief Set USART oversampling bits. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32OversamplingBits USART oversampling bits + * This parameter can be one of the following values: + * @arg USART_OVERSAMPLING_8BIT: Oversampling by 8 bits + * @arg USART_OVERSAMPLING_16BIT: Oversampling by 16 bits + * @retval None + */ +void USART_SetOversmaplingBits(M4_USART_TypeDef *USARTx, + uint32_t u32OversamplingBits) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_OVERSAMPLING_BITS(u32OversamplingBits)); + + MODIFY_REG32(USARTx->CR1, USART_CR1_OVER8, u32OversamplingBits); +} + +/** + * @brief Get USART oversampling bits. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @retval Returned value can be one of the following values: + * @arg USART_OVERSAMPLING_8BIT: Oversampling by 8 bits + * @arg USART_OVERSAMPLING_16BIT: Oversampling by 16 bits + */ +uint32_t USART_GetOversmaplingBits(const M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + + return READ_REG32_BIT(USARTx->CR1, USART_CR1_OVER8); +} + +/** + * @brief Set USART bit direction. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32BitDir USART bit direction + * This parameter can be one of the following values: + * @arg USART_MSB: MSB(Most Significant Bit) + * @arg USART_LSB: LSB(Least Significant Bit) + * @retval None + */ +void USART_SetBitDirection(M4_USART_TypeDef *USARTx, uint32_t u32BitDir) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_SIGNIFICANT_BIT(u32BitDir)); + + MODIFY_REG32(USARTx->CR1, USART_CR1_ML, u32BitDir); +} + +/** + * @brief Get USART bit direction. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @retval Returned value can be one of the following values: + * @arg USART_MSB: MSB(Most Significant Bit) + * @arg USART_LSB: LSB(Least Significant Bit) + */ +uint32_t USART_GetBitDirection(const M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + + return READ_REG32_BIT(USARTx->CR1, USART_CR1_ML); +} + +/** + * @brief Set USART start bit detect polarity. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32Polarity USART start bit detect polarity + * This parameter can be one of the following values: + * @arg USART_SB_DETECT_LOW: Detect RX pin low level + * @arg USART_SB_DETECT_FALLING: Detect RX pin falling edge + * @retval None + */ +void USART_SetSbDetectPolarity(M4_USART_TypeDef *USARTx, + uint32_t u32Polarity) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_SB_DETECT_POLARITY(u32Polarity)); + + MODIFY_REG32(USARTx->CR1, USART_CR1_SBS, u32Polarity); +} + +/** + * @brief Get USART start bit detect polarity. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @retval Returned value can be one of the following values: + * @arg USART_SB_DETECT_LOW: Detect RX pin low level + * @arg USART_SB_DETECT_FALLING: Detect RX pin falling edge + */ +uint32_t USART_GetSbDetectPolarity(const M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + + return READ_REG32_BIT(USARTx->CR1, USART_CR1_SBS); +} + +/** + * @brief Set USART clock mode. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32ClkMode USART clock mode + * This parameter can be one of the following values: + * @arg USART_EXTCLK: Select external clock source. + * @arg USART_INTERNCLK_OUTPUT: Select internal clock source and output clock. + * @arg USART_INTERNCLK_NONE_OUTPUT: Select internal clock source and don't output clock + * @retval None + */ +void USART_SetClockMode(M4_USART_TypeDef *USARTx, uint32_t u32ClkMode) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_CLOCK_MODE(u32ClkMode)); + + MODIFY_REG32(USARTx->CR2, USART_CR2_CLKC, u32ClkMode); +} + +/** + * @brief Get USART clock mode. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @retval Returned value can be one of the following values: + * @arg USART_EXTCLK: Select external clock source. + * @arg USART_INTERNCLK_OUTPUT: Select internal clock source and output clock. + * @arg USART_INTERNCLK_NONE_OUTPUT: Select internal clock source and don't output clock + */ +uint32_t USART_GetClockMode(const M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + + return READ_REG32_BIT(USARTx->CR2, USART_CR2_CLKC); +} + +/** + * @brief Set USART stop bits. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32StopBits USART stop bits + * This parameter can be one of the following values: + * @arg USART_STOPBIT_1BIT: 1 stop bit + * @arg USART_STOPBIT_2BIT: 2 stop bits + * @retval None + */ +void USART_SetStopBits(M4_USART_TypeDef *USARTx, uint32_t u32StopBits) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_STOP_BITS(u32StopBits)); + + MODIFY_REG32(USARTx->CR2, USART_CR2_STOP, u32StopBits); +} + +/** + * @brief Get USART clock mode. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @retval Returned value can be one of the following values: + * @arg USART_STOPBIT_1BIT: 1 stop bit + * @arg USART_STOPBIT_2BIT: 2 stop bits + */ +uint32_t USART_GetStopBits(const M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + + return READ_REG32_BIT(USARTx->CR2, USART_CR2_STOP); +} + +/** + * @brief USART receive data. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @retval Receive data + */ +uint16_t USART_RecData(const M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + + return (uint16_t)(READ_REG32(USARTx->DR) >> USART_DR_RDR_POS); +} + +/** + * @brief USART send data. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + ** \param [in] u16Data Transmit data + * @retval None + */ +void USART_SendData(M4_USART_TypeDef *USARTx, uint16_t u16Data) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + + WRITE_REG32(USARTx->DR, ((uint32_t)u16Data & 0x01FFUL)); +} + +/** + * @brief USART send processor ID. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + ** \param [in] u16ID Processor ID + * @retval None + */ +void USART_SendId(M4_USART_TypeDef *USARTx, uint16_t u16ID) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + + WRITE_REG32(USARTx->DR, (USART_DR_MPID | ((uint32_t)u16ID & 0x01FFUL))); +} + +/** + * @brief Enable or disable USART silence. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + */ +void USART_SilenceCmd(M4_USART_TypeDef *USARTx, + en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(USARTx->CR1, USART_CR1_SLME); + } + else + { + CLEAR_REG32_BIT(USARTx->CR1, USART_CR1_SLME); + } +} + +/** + * @brief Enable or disable USART loop function. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + * @note LIN feature is supported by M4_USART5/M4_USART10 + */ +void USART_LinLoopCmd(M4_USART_TypeDef *USARTx, + en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_LIN_INSTANCE(USARTx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + + if (Enable == enNewState) + { + SET_REG32_BIT(USARTx->CR3, USART_CR3_LOOP); + } + else + { + CLEAR_REG32_BIT(USARTx->CR3, USART_CR3_LOOP); + } +} + +/** + * @brief LIN Request break sending + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @retval None + * @note LIN feature is supported by M4_USART5/M4_USART10 + */ +void USART_LinRequestBreakSending(M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_LIN_INSTANCE(USARTx)); + + SET_REG32_BIT(USARTx->CR2, USART_CR2_SBK); +} + +/** + * @brief Get request break sending status + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @retval An en_flag_status_t enumeration value: + * - Set: Sending break + * - Reset: Send break completely + * @note LIN feature is supported by M4_USART5/M4_USART10 + */ +en_flag_status_t USART_GetLinRequestBreakStatus(const M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + + return READ_REG32_BIT(USARTx->CR2, USART_CR2_SBK) ? Set : Reset; +} + +/** + * @brief Set send break mode for USART LIN. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32Mode USART send break mode + * This parameter can be one of the following values: + * @arg USART_LIN_SEND_BREAK_MODE_SBK: Start send break after USART_CR2 SBK bit set 1 value + * @arg USART_LIN_SEND_BREAK_MODE_TDR: Start send break after USART_DR TDR write 0x00 value + * @retval None + * @note LIN feature is supported by M4_USART5/M4_USART10 + */ +void USART_SetLinBreakMode(M4_USART_TypeDef *USARTx, uint32_t u32Mode) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_LIN_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_LIN_SEND_BREAK_MODE(u32Mode)); + + MODIFY_REG32(USARTx->CR2, USART_CR2_SBKM, u32Mode); +} + +/** + * @brief Get send break mode for USART LIN. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @retval Returned value can be one of the following values: + * @arg USART_LIN_SEND_BREAK_MODE_SBK: Start send break after USART_CR2 SBK bit set 1 value + * @arg USART_LIN_SEND_BREAK_MODE_TDR: Start send break after USART_DR TDR write 0x00 value + * @note LIN feature is supported by M4_USART5/M4_USART10 + */ +uint32_t USART_GetLinBreakMode(const M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_LIN_INSTANCE(USARTx)); + + return READ_REG32_BIT(USARTx->CR2, USART_CR2_SBKM); +} + +/** + * @brief Set UART half/full duplex selection. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32Mode USART half/full duplex selection + * This parameter can be one of the following values: + * @arg USART_HALFDUPLEX_MODE:USART half-duplex mode + * @arg USART_FULLDUPLEX_MODE:USART full-duplex mode + * @retval None + */ +void USART_SetDuplexMode(M4_USART_TypeDef *USARTx, uint32_t u32Mode) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + DDL_ASSERT(IS_UART_DUPLEX_MODE(u32Mode)); + + MODIFY_REG32(USARTx->CR3, USART_CR3_HDSEL, u32Mode); +} + +/** + * @brief Get USART half/full duplex. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @retval Returned value can be one of the following values: + * @arg USART_HALFDUPLEX_MODE:USART half-duplex mode + * @arg USART_FULLDUPLEX_MODE:USART full-duplex mode + */ +uint32_t USART_GetDuplexMode(const M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + + return READ_REG32_BIT(USARTx->CR3, USART_CR3_HDSEL); +} + +/** + * @brief Set UART hardware flow control CTS/RTS selection. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32HwFlowCtrl USART hardware flow control CTS/RTS selection + * This parameter can be one of the following values: + * @arg USART_HWFLOWCTRL_NONE Disable USART hardware flow control + * @arg USART_HWFLOWCTRL_CTS: UART hardware flow control CTS mode + * @arg USART_HWFLOWCTRL_RTS: UART hardware flow control RTS mode + * @arg USART_HWFLOWCTRL_RTS_CTS: UART hardware flow control RTS and CTS mode + * @retval None + */ +void USART_SetHwFlowCtrl(M4_USART_TypeDef *USARTx, uint32_t u32HwFlowCtrl) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_HWFLOWCTRL(u32HwFlowCtrl)); + + MODIFY_REG32(USARTx->CR3, (USART_CR3_RTSE | USART_CR3_CTSE), u32HwFlowCtrl); +} + +/** + * @brief Get USART hardware flow control CTS/RTS selection. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @retval Returned value can be one of the following values: + * @arg USART_HWFLOWCTRL_NONE: Disable USART hardware flow control + * @arg USART_HWFLOWCTRL_CTS: UART hardware flow control CTS mode + * @arg USART_HWFLOWCTRL_RTS: UART hardware flow control RTS mode + * @arg USART_HWFLOWCTRL_RTS_CTS: UART hardware flow control RTS and CTS mode + */ +uint32_t USART_GetHwFlowCtrl(const M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + + return READ_REG32_BIT(USARTx->CR3, (USART_CR3_RTSE | USART_CR3_CTSE)); +} + +/** + * @brief Set USART Smartcard ETU Clock. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @param [in] u32EtuClk USART Smartcard ETU Clock. + * This parameter can be one of the following values: + * @arg USART_SC_ETU_CLK_32: 1 etu = 32/f + * @arg USART_SC_ETU_CLK_64: 1 etu = 64/f + * @arg USART_SC_ETU_CLK_128: 1 etu = 128/f + * @arg USART_SC_ETU_CLK_256: 1 etu = 256/f + * @arg USART_SC_ETU_CLK_372: 1 etu = 372/f + * @retval None + * @note Smartcard feature is unsupported by M4_USART5/M4_USART10 + */ +void USART_SetSmartcardEtuClk(M4_USART_TypeDef *USARTx, + uint32_t u32EtuClk) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_SMARTCARD_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_SMARTCARD_ETU_CLK(u32EtuClk)); + + MODIFY_REG32(USARTx->CR3, USART_CR3_BCN, u32EtuClk); +} + +/** + * @brief Get USART Smartcard ETU Clock. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @retval Returned value can be one of the following values: + * @arg USART_SC_ETU_CLK_32: 1 etu = 32/f + * @arg USART_SC_ETU_CLK_64: 1 etu = 64/f + * @arg USART_SC_ETU_CLK_128: 1 etu = 128/f + * @arg USART_SC_ETU_CLK_256: 1 etu = 256/f + * @arg USART_SC_ETU_CLK_372: 1 etu = 372/f + * @note Smartcard feature is unsupported by M4_USART5/M4_USART10 + */ +uint32_t USART_GetSmartcardEtuClk(const M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_SMARTCARD_INSTANCE(USARTx)); + + return READ_REG32_BIT(USARTx->CR3, USART_CR3_BCN); +} + +/** + * @brief Set USART clock prescaler division. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32PclkDiv USART clock prescaler division. + * This parameter can be one of the following values: + * @arg USART_PCLK_DIV1: PCLK + * @arg USART_PCLK_DIV4: PCLK/4 + * @arg USART_PCLK_DIV16: PCLK/16 + * @arg USART_PCLK_DIV64: PCLK/64 + * @retval None + * @note The PCLK division function is valid when clock source is PCLK + */ +void USART_SetPclkDiv(M4_USART_TypeDef *USARTx, + uint32_t u32PclkDiv) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_PCLK_DIV(u32PclkDiv)); + + MODIFY_REG32(USARTx->PR, USART_PR_PSC, u32PclkDiv); +} + +/** + * @brief Get USART clock prescaler division. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @retval Returned value can be one of the following values: + * @arg USART_PCLK_DIV1: PCLK + * @arg USART_PCLK_DIV4: PCLK/4 + * @arg USART_PCLK_DIV16: PCLK/16 + * @arg USART_PCLK_DIV64: PCLK/64 + * @note The PCLK division function is valid when clock source is PCLK + */ +uint32_t USART_GetPclkDiv(const M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + + return READ_REG32_BIT(USARTx->PR, USART_PR_PSC); +} + +/** + * @brief Set USART LIN counter clock prescaler division. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32PclkDiv USART USART LIN counter clock prescaler division. + * This parameter can be one of the following values: + * @arg USART_LIN_BMC_PCLK_DIV1: PCLK + * @arg USART_LIN_BMC_PCLK_DIV2: PCLK/2 + * @arg USART_LIN_BMC_PCLK_DIV4: PCLK/4 + * @arg USART_LIN_BMC_PCLK_DIV8: PCLK/8 + * @retval None + * @note LIN feature is supported by M4_USART5/M4_USART10 + * @note The PCLK division function is valid when clock source is PCLK + */ +void USART_SetLinBmcPclkDiv(M4_USART_TypeDef *USARTx, + uint32_t u32PclkDiv) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_LIN_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_LIN_BMC_PCLK_DIV(u32PclkDiv)); + + MODIFY_REG32(USARTx->PR, USART_PR_LBMPSC, u32PclkDiv); +} + +/** + * @brief Get USART LIN counter clock prescaler division. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @retval Returned value can be one of the following values: + * @arg USART_LIN_BMC_PCLK_DIV1: PCLK + * @arg USART_LIN_BMC_PCLK_DIV2: PCLK/2 + * @arg USART_LIN_BMC_PCLK_DIV4: PCLK/4 + * @arg USART_LIN_BMC_PCLK_DIV8: PCLK/8 + * @note LIN feature is supported by M4_USART5/M4_USART10 + */ +uint32_t USART_GetLinBmcPclkDiv(const M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_LIN_INSTANCE(USARTx)); + + return READ_REG32_BIT(USARTx->PR, USART_PR_LBMPSC); +} + +/** + * @brief Set stop mode noise filter. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @param [in] u32Filter The noise filter value + * This parameter can be one of the following values: + * @arg USART_STOP_MODE_FILTER_NONE: Disable noise filter + * @arg USART_STOP_MODE_FILTER_WIDTH_LEVEL_1: Filter width level 1 + * @arg USART_STOP_MODE_FILTER_WIDTH_LEVEL_2: Filter width level 2 + * @arg USART_STOP_MODE_FILTER_WIDTH_LEVEL_3: Filter width level 3 + * @arg USART_STOP_MODE_FILTER_WIDTH_LEVEL_4: Filter width level 4 + * @retval None + * @note The stop mode noise filter is supported by M4_USART1 + */ +void USART_SetStopModeNoiseFilter(const M4_USART_TypeDef *USARTx, + uint32_t u32Filter) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_STOPMODE_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_STOPMODE_FILTER(u32Filter)); + + WRITE_REG32(M4_PERIC->USART1_NFC, u32Filter); +} + +/** + * @brief Disable UART multiple processor function. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @retval Returned value can be one of the following values: + * @arg USART_STOP_MODE_FILTER_NONE: Disable noise filter + * @arg USART_STOP_MODE_FILTER_WIDTH_LEVEL_1: Filter width level 1 + * @arg USART_STOP_MODE_FILTER_WIDTH_LEVEL_2: Filter width level 2 + * @arg USART_STOP_MODE_FILTER_WIDTH_LEVEL_3: Filter width level 3 + * @arg USART_STOP_MODE_FILTER_WIDTH_LEVEL_4: Filter width level 4 + * @note The stop mode noise filter is supported by M4_USART1 + */ +uint32_t USART_GetStopModeNoiseFilter(const M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_STOPMODE_INSTANCE(USARTx)); + + return READ_REG32_BIT(M4_PERIC->USART1_NFC, (PERIC_USART1_NFC_NFE | PERIC_USART1_NFC_NFS)); +} + +/** + * @brief Enable/disable USART LIN Function. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32Func USART function type + * This parameter can be any composed value of the following values: + * @arg USART_LIN: USART LIN function + * @arg USART_LIN_WKUP: USART LIN wakeup signal detect function + * @arg USART_LIN_INT_WKUP: USART LIN wakeup signal detect interrupt function + * @arg USART_LIN_BUSERR: USART LIN bus error detect function + * @arg USART_LIN_INT_BUSERR: USART LIN bus error detect interrupt function + * @arg USART_LIN_INT_BREAK: USART LIN break field detect interrupt function + * @param [in] enNewState The function new state. + * @arg This parameter can be: Enable or Disable. + * @retval None + * @note LIN feature is supported by M4_USART5/M4_USART10 + */ +void USART_LinFuncCmd(M4_USART_TypeDef *USARTx, + uint32_t u32Func, + en_functional_state_t enNewState) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_LIN_INSTANCE(USARTx)); + DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); + DDL_ASSERT(IS_USART_LIN_FUNCTION(u32Func)); + + (Enable == enNewState) ? SET_REG32_BIT(USARTx->CR2, u32Func) : CLEAR_REG32_BIT(USARTx->CR2, u32Func); +} + +/** + * @brief Get USART LIN function state. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32Func USART function type + * This parameter can be one of the following values: + * @arg USART_LIN: USART LIN function + * @arg USART_LIN_WKUP: USART LIN wakeup signal detect function + * @arg USART_LIN_INT_WKUP: USART LIN wakeup signal detect interrupt function + * @arg USART_LIN_BUSERR: USART LIN bus error detect function + * @arg USART_LIN_INT_BUSERR: USART LIN bus error detect interrupt function + * @arg USART_LIN_INT_BREAK: USART LIN break field detect interrupt function + * @retval An en_functional_state_t enumeration value: + * - Enable: Enable function + * - Disable: Disable function + * @note LIN feature is supported by M4_USART5/M4_USART10 + */ +en_functional_state_t USART_GetLinFuncState(const M4_USART_TypeDef *USARTx, + uint32_t u32Func) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_LIN_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_FUNCTION(u32Func)); + + return (READ_REG32_BIT(USARTx->CR2, u32Func) ? Enable : Disable); +} + +/** + * @brief Get USART LIN baudrate measure count. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @retval LIN baudrate measure count value + * @note LIN feature is supported by M4_USART5/M4_USART10 + */ +uint32_t USART_GetLinMeasureCnt(const M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_LIN_INSTANCE(USARTx)); + + return READ_REG32_BIT(USARTx->LBMC, USART_LBMC_LBMC); +} + +/** + * @brief Get USART LIN baudrate measure count. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @retval LIN baudrate measure count value + * @note LIN feature is supported by M4_USART5/M4_USART10 + */ +uint32_t USART_GetLinMeasureBaudrate(const M4_USART_TypeDef *USARTx) +{ + uint32_t u32BmClk; + uint32_t u32BmDiv; + uint32_t u32LBMC; + + /* Check parameters */ + DDL_ASSERT(IS_USART_LIN_INSTANCE(USARTx)); + + u32BmDiv = USART_BMC_DIV(USARTx); + u32BmClk = PCLK_FREQ / u32BmDiv; + u32LBMC = READ_REG32_BIT(USARTx->LBMC, USART_LBMC_LBMC); + + return (u32LBMC > 0UL) ? (u32BmClk / u32LBMC) : 0UL; +} + +/** + * @brief Set USART LIN break detection length. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART5: USART unit 1 instance register base + * @arg M4_USART10: USART unit 2 instance register base + * @param [in] u32Len USART clock prescaler division. + * This parameter can be one of the following values: + * @arg USART_LIN_DETECT_BREAK_10BIT: 10-bit break detection + * @arg USART_LIN_DETECT_BREAK_11BIT: 11-bit break detection + * @retval None + * @note LIN feature is supported by M4_USART5/M4_USART10 + */ +void USART_SetLinDetectBreakLen(M4_USART_TypeDef *USARTx, + uint32_t u32Len) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_LIN_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_LIN_DETECT_BREAK_LEN(u32Len)); + + MODIFY_REG32(USARTx->CR2, USART_CR2_LBDL, u32Len); +} + +/** + * @brief Get USART LIN break detection length. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART5: USART unit 1 instance register base + * @arg M4_USART10: USART unit 2 instance register base + * @retval Returned value can be one of the following values: + * @arg USART_LIN_DETECT_BREAK_10BIT: 10-bit break detection + * @arg USART_LIN_DETECT_BREAK_11BIT: 11-bit break detection + * @note LIN feature is supported by M4_USART5/M4_USART10 + */ +uint32_t USART_GetLinDetectBreakLen(const M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_LIN_INSTANCE(USARTx)); + + return READ_REG32_BIT(USARTx->CR2, USART_CR2_LBDL); +} + +/** + * @brief Set USART LIN break sending length. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART5: USART unit 1 instance register base + * @arg M4_USART10: USART unit 2 instance register base + * @param [in] u32Len USART clock prescaler division. + * This parameter can be one of the following values: + * @arg USART_LIN_SEND_BREAK_10BIT: Send break 10-bit + * @arg USART_LIN_SEND_BREAK_11BIT: Send break 11-bit + * @arg USART_LIN_SEND_BREAK_13BIT: Send break 13-bit + * @arg USART_LIN_SEND_BREAK_14BIT: Send break 14-bit + * @retval None + * @note LIN feature is supported by M4_USART5/M4_USART10 + */ +void USART_SetLinSendBreakLen(M4_USART_TypeDef *USARTx, uint32_t u32Len) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_LIN_INSTANCE(USARTx)); + DDL_ASSERT(IS_USART_LIN_SEND_BREAK_LEN(u32Len)); + + MODIFY_REG32(USARTx->CR2, USART_CR2_SBKL, u32Len); +} + +/** + * @brief Get USART LIN break detection length. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART5: USART unit 1 instance register base + * @arg M4_USART10: USART unit 2 instance register base + * @retval Returned value can be one of the following values: + * @arg USART_LIN_SEND_BREAK_10BIT: Send break 10-bit + * @arg USART_LIN_SEND_BREAK_11BIT: Send break 11-bit + * @arg USART_LIN_SEND_BREAK_13BIT: Send break 13-bit + * @arg USART_LIN_SEND_BREAK_14BIT: Send break 14-bit + * @note LIN feature is supported by M4_USART5/M4_USART10 + */ +uint32_t USART_GetLinSendBreakLen(const M4_USART_TypeDef *USARTx) +{ + /* Check parameters */ + DDL_ASSERT(IS_USART_LIN_INSTANCE(USARTx)); + + return READ_REG32_BIT(USARTx->CR2, USART_CR2_SBKL); +} + +/** + * @brief Set USART baudrate. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32Baudrate UART baudrate + * @param [out] pf32Err E(%) baudrate error rate + * @retval An en_result_t enumeration value: + * - Ok: Set successfully + * - ErrorInvalidParameter: set unsuccessfully + */ +en_result_t USART_SetBaudrate(M4_USART_TypeDef *USARTx, + uint32_t u32Baudrate, + float32_t *pf32Err) +{ + uint32_t u32Mode; + uint32_t u32BrrVal = 0UL; + uint32_t u32FractEn = 0UL; + uint32_t u32UsartClk; + uint32_t u32UsartDiv; + en_result_t enRet; + + /* Check parameter */ + DDL_ASSERT(u32Baudrate > 0UL); + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + + /* Get USART clock frequency */ + u32UsartDiv = USART_DIV(USARTx); + u32UsartClk = PCLK_FREQ / u32UsartDiv; + + u32Mode = READ_REG32_BIT(USARTx->CR3, USART_CR3_SCEN); + if (u32Mode > 0UL) + { + /* Smart card */ + enRet = CalcSmartcardBaudrate(USARTx, u32UsartClk, u32Baudrate, &u32BrrVal, &u32FractEn, pf32Err); + } + else + { + u32Mode = READ_REG32_BIT(USARTx->CR1, USART_CR1_MS); + if (u32Mode > 0UL) + { + /* Clock synchronization */ + enRet = CalcClkSyncBaudrate(USARTx, u32UsartClk, u32Baudrate, &u32BrrVal, &u32FractEn, pf32Err); + } + else + { + /* UART */ + enRet = CalcUartBaudrate(USARTx, u32UsartClk, u32Baudrate, &u32BrrVal, &u32FractEn, pf32Err); + } + } + + if (Ok == enRet) + { + if ((!IS_USART_FRACTION_INSTANCE(USARTx)) && (u32FractEn > 0UL)) + { + enRet = Error; + } + else + { + /* Set baudrate */ + MODIFY_REG32(USARTx->CR1, USART_CR1_FBME, u32FractEn); + WRITE_REG32(USARTx->BRR, u32BrrVal); + } + } + + return enRet; +} + +/** + * @} + */ + +/** + * @defgroup USART_Local_Functions USART Local Functions + * @{ + */ + +/** + * @brief Calculate baudrate for UART mode. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32UsartClk USART clock + * @param [in] u32Baudrate UART baudrate + * @param [out] pu32BrrVal Pointer to BRR register value + * @param [out] pu32FractEn Pointer to CR1 FBME bit value + * @param [out] pf32Err E(%) baudrate error rate + * @retval An en_result_t enumeration value: + * - Ok: Set successfully + * - ErrorInvalidParameter: set unsuccessfully + * @note Baudrate fraction feature is unsupported by M4_USART5/M4_USART10 + */ +static en_result_t CalcUartBaudrate(const M4_USART_TypeDef *USARTx, + uint32_t u32UsartClk, + uint32_t u32Baudrate, + uint32_t *pu32BrrVal, + uint32_t *pu32FractEn, + float32_t *pf32Err) +{ + uint32_t B; + uint32_t C; + uint32_t OVER8; + float32_t DIV; + uint64_t u64Temp; + uint64_t u64Dividend; + uint32_t DIV_Integer; + uint32_t DIV_Fraction = 0UL; + float32_t f32Err; + en_result_t enRet = Ok; + + /* Check parameter */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + + C = u32UsartClk; + B = u32Baudrate; + + if ((C > 0UL) && (B > 0UL)) + { + OVER8 = READ_REG32_BIT(USARTx->CR1, USART_CR1_OVER8) ? 1UL : 0UL; + + /* UART mode baudrate integer calculation formula: */ + /* B = C / (8 * (2 - OVER8) * (DIV_Integer + 1)) */ + /* DIV_Integer = (C / (B * 8 * (2 - OVER8))) - 1 */ + DIV = ((float)C / ((float)B * 8.0F * (2.0F - (float)OVER8))) - 1.0F; + DIV_Integer = (uint32_t)(DIV); + DDL_ASSERT((DIV > 0.0F) && (DIV_Integer <= 0xFFUL)); + + u64Temp = (uint64_t)((uint64_t)8UL * ((uint64_t)2UL - (uint64_t)OVER8) * ((uint64_t)DIV_Integer + (uint64_t)1UL) * (uint64_t)B); + + if (IS_USART_FRACTION_INSTANCE(USARTx)) + { + if ((DIV - (float32_t)DIV_Integer) > 0.00001F) + { + /* UART mode baudrate fraction calculation formula: */ + /* B = C * (128 + DIV_Fraction) / (8 * (2 - OVER8) * (DIV_Integer + 1) * 256) */ + /* DIV_Fraction = (256 * (8 * (2 - OVER8) * (DIV_Integer + 1) * B) / C) - 128 */ + DIV_Fraction = (uint32_t)(256UL * u64Temp / C - 128UL); + if (DIV_Fraction > 0x7FUL) + { + enRet = ErrorInvalidParameter; + } + } + } + + if (Ok == enRet) + { + *pu32FractEn = (DIV_Fraction > 0UL) ? USART_CR1_FBME : 0UL; + *pu32BrrVal = DIV_Fraction + (uint32_t)(DIV_Integer << USART_BRR_DIV_INTEGER_POS); + + if (NULL != pf32Err) + { + if (0UL == DIV_Fraction) + { + /* E(%) = C / (8 * (2 - OVER8) * (DIV_Integer + 1) * B) - 1 */ + f32Err = (float32_t)((float64_t)C / (float64_t)u64Temp) - 1.0F; + } + else + { + /* E(%) = C * (128 + DIV_Fraction) / (256 * (8 * (2 - OVER8) * (DIV_Integer + 1) * B)) - 1 */ + u64Temp *= (uint64_t)256UL; + u64Dividend = (uint64_t)C * ((uint64_t)128UL + (uint64_t)DIV_Fraction); + f32Err = (float32_t)((float64_t)(u64Dividend) / (float64_t)(u64Temp)) - 1.0F; + } + + *pf32Err = f32Err; + } + } + } + else + { + enRet = ErrorInvalidParameter; + } + + return enRet; +} + +/** + * @brief Calculate baudrate for clock synchronization mode. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32UsartClk USART clock + * @param [in] u32Baudrate UART baudrate + * @param [out] pu32BrrVal Pointer to BRR register value + * @param [out] pu32FractEn Pointer to CR1 FBME bit value + * @param [out] pf32Err E(%) baudrate error rate + * @retval An en_result_t enumeration value: + * - Ok: Set successfully + * - ErrorInvalidParameter: set unsuccessfully + */ +static en_result_t CalcClkSyncBaudrate(const M4_USART_TypeDef *USARTx, + uint32_t u32UsartClk, + uint32_t u32Baudrate, + uint32_t *pu32BrrVal, + uint32_t *pu32FractEn, + float32_t *pf32Err) +{ + uint32_t C; + uint32_t B; + float32_t DIV; + uint64_t u64Temp; + uint64_t u64Dividend; + uint32_t DIV_Integer; + uint32_t DIV_Fraction = 0UL; + float32_t f32Err; + en_result_t enRet = Ok; + + /* Check parameter */ + DDL_ASSERT(IS_USART_INSTANCE(USARTx)); + + C = u32UsartClk; + B = u32Baudrate; + + if ((C > 0UL) && (B > 0UL)) + { + /* Clock sync mode baudrate integer calculation formula: */ + /* B = C / (4 * (DIV_Integer + 1)) */ + /* DIV_Integer = (C / (B * 4)) - 1 */ + DIV = ((float)C / ((float)B * 4.0F)) - 1.0F; + DIV_Integer = (uint32_t)DIV; + DDL_ASSERT((DIV > 0.0F) && (DIV_Integer <= 0xFFUL)); + + u64Temp = (uint64_t)((uint64_t)4U * ((uint64_t)DIV_Integer + (uint64_t)1UL) * (uint64_t)B); + + if (IS_USART_FRACTION_INSTANCE(USARTx)) + { + if ((DIV - (float32_t)DIV_Integer) > 0.00001F) + { + /* Clock sync mode baudrate fraction calculation formula: */ + /* B = C * (128 + DIV_Fraction) / (4 * (DIV_Integer + 1) * 256) */ + /* DIV_Fraction = 256 * (4 * (DIV_Integer + 1) * B / C - 128 */ + DIV_Fraction = (uint32_t)(256UL * u64Temp / C - 128UL); + if (DIV_Fraction > 0x7FUL) + { + enRet = ErrorInvalidParameter; + } + } + } + + if (Ok == enRet) + { + *pu32FractEn = (DIV_Fraction > 0UL) ? USART_CR1_FBME : 0UL; + *pu32BrrVal = DIV_Fraction + (uint32_t)(DIV_Integer << USART_BRR_DIV_INTEGER_POS); + + if (NULL != pf32Err) + { + if (0UL == DIV_Fraction) + { + /* E(%) = C / (4 * (DIV_Integer + 1) * B) - 1 */ + f32Err = (float32_t)((float64_t)C / (float64_t)u64Temp) - 1.0F; + } + else + { + /* E(%) = C * (128 + DIV_Fraction) / (4 * (DIV_Integer + 1) * B * 256) - 1 */ + u64Temp *= (uint64_t)256UL; + u64Dividend = (uint64_t)C * ((uint64_t)128UL + (uint64_t)DIV_Fraction); + f32Err = (float32_t)((float64_t)(u64Dividend) / (float64_t)(u64Temp)) - 1.0F; + } + + *pf32Err = f32Err; + } + } + } + else + { + enRet = ErrorInvalidParameter; + } + + return enRet; +} + +/** + * @brief Calculate baudrate for smart-card mode. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @param [in] u32UsartClk USART clock + * @param [in] u32Baudrate UART baudrate + * @param [out] pu32BrrVal Pointer to BRR register value + * @param [out] pu32FractEn Pointer to CR1 FBME bit value + * @param [out] pf32Err E(%) baudrate error rate + * @retval An en_result_t enumeration value: + * - Ok: Set successfully + * - ErrorInvalidParameter: set unsuccessfully + * @note Smartcard feature is unsupported by M4_USART5/M4_USART10 + */ +static en_result_t CalcSmartcardBaudrate(const M4_USART_TypeDef *USARTx, + uint32_t u32UsartClk, + uint32_t u32Baudrate, + uint32_t *pu32BrrVal, + uint32_t *pu32FractEn, + float32_t *pf32Err) +{ + uint32_t B; + uint32_t C; + uint32_t BCN; + float32_t DIV; + uint64_t u64Temp; + uint64_t u64Dividend; + uint32_t DIV_Integer; + uint32_t DIV_Fraction = 0UL; + const uint16_t au16EtuClkCnts[] = {32U, 64U, 93U, 128U, 186U, 256U, 372U, 512U}; + float32_t f32Err; + en_result_t enRet = Ok; + + /* Check parameter */ + DDL_ASSERT(IS_USART_SMARTCARD_INSTANCE(USARTx)); + + C = u32UsartClk; + B = u32Baudrate; + + if ((C > 0UL) && (B > 0UL)) + { + BCN = READ_REG32_BIT(USARTx->CR3, USART_CR3_BCN); + DDL_ASSERT(IS_USART_SMARTCARD_ETU_CLK(BCN)); + BCN = au16EtuClkCnts[BCN >> USART_CR3_BCN_POS]; + + /* Smartcard mode baudrate integer calculation formula: */ + /* B = C / (2 * BCN * (DIV_Integer + 1)) */ + /* DIV_Integer = (C / (B * 2 * BCN)) - 1 */ + DIV = ((float)C / ((float)B * (float)BCN * 2.0F)) - 1.0F; + DIV_Integer = (uint32_t)DIV; + + DDL_ASSERT((DIV > 0.0F) && (DIV_Integer <= 0xFFUL)); + + u64Temp = (uint64_t)((uint64_t)2UL * BCN * ((uint64_t)DIV_Integer + (uint64_t)1UL) * B); + + if (IS_USART_FRACTION_INSTANCE(USARTx)) + { + if ((DIV - (float32_t)DIV_Integer) > 0.00001F) + { + /* Smartcard mode baudrate fraction calculation formula: */ + /* B = C * (128 + DIV_Fraction) / ((2 * BCN) * (DIV_Integer + 1) * 256) */ + /* DIV_Fraction = (256 * (2 * BCN * (DIV_Integer + 1) * B) / C) - 128 */ + DIV_Fraction = (uint32_t)(256UL * u64Temp / C - 128UL); + if (DIV_Fraction > 0x7FUL) + { + enRet = ErrorInvalidParameter; + } + } + } + + if (Ok == enRet) + { + *pu32FractEn = (DIV_Fraction > 0UL )? USART_CR1_FBME : 0UL; + *pu32BrrVal = DIV_Fraction + (uint32_t)(DIV_Integer << USART_BRR_DIV_INTEGER_POS); + + if (NULL != pf32Err) + { + if (0UL == DIV_Fraction) + { + /* E(%) = C / (2 * BCN * (DIV_Integer + 1) * B) - 1 */ + f32Err = (float32_t)((float64_t)C / (float64_t)u64Temp) - 1.0F; + } + else + { + /* E(%) = C * (128 + DIV_Fraction) / (2 * BCN * (DIV_Integer + 1) * B * 256) - 1 */ + u64Temp *= (uint64_t)256UL; + u64Dividend = (uint64_t)C * ((uint64_t)128UL + (uint64_t)DIV_Fraction); + f32Err = (float32_t)((float64_t)u64Dividend / (float64_t)(u64Temp)) - 1.0F; + } + + *pf32Err = f32Err; + } + } + } + else + { + enRet = ErrorInvalidParameter; + } + + return enRet; +} + +/** + * @} + */ + +#endif /* DDL_USART_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_utility.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_utility.c new file mode 100644 index 0000000000..9b8b53baa1 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_utility.c @@ -0,0 +1,541 @@ +/** + ******************************************************************************* + * @file hc32f4a0_utility.c + * @brief This file provides utility functions for DDL. + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Yangjp First version + 2020-12-03 Yangjp Fixed SysTick_Delay function overflow handling + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_UTILITY UTILITY + * @brief DDL Utility Driver + * @{ + */ + +#if (DDL_UTILITY_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup UTILITY_Local_Macros UTILITY Local Macros + * @{ + */ + +#if (DDL_PRINT_ENABLE == DDL_ON) +/** + * @defgroup DDL UART channel/fcg/pin/baudrate definition + * @{ + */ +#define DDL_UART_CH (M4_USART1) +#define DDL_UART_PWC_FCG (PWC_FCG3_USART1) +#define DDL_UART_GPIO_TX_PFSR (M4_GPIO->PFSRH15) /* PH15: USART1_TX */ +#define DDL_UART_GPIO_TX_FUNC (32U) /* GPIO function: USART1_TX */ +#define DDL_UART_BAUDRATE (115200UL) +/** + * @} + */ +#endif + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/** + * @addtogroup UTILITY_Local_Functions UTILITY Local Functions + * @{ + */ + +#if (DDL_PRINT_ENABLE == DDL_ON) + +static en_result_t UartPutChar(M4_USART_TypeDef *USARTx, char cData); +static en_result_t UartSetBaudrate(M4_USART_TypeDef *USARTx, + uint32_t u32Baudrate); +#endif + +/** + * @} + */ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ +/** + * @defgroup UTILITY_Local_Variables UTILITY Local Variables + * @{ + */ + +static uint32_t m_u32TickStep = 0UL; +static __IO uint32_t m_u32TickCount = 0UL; + +/** + * @} + */ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup UTILITY_Global_Functions UTILITY Global Functions + * @{ + */ + +/** + * @brief Delay function, delay ms approximately + * @param [in] u32Cnt ms + * @retval None + */ +void DDL_DelayMS(uint32_t u32Cnt) +{ + __IO uint32_t i; + const uint32_t u32Cyc = HCLK_VALUE / 10000UL; + + while (u32Cnt-- > 0UL) + { + i = u32Cyc; + while (i-- > 0UL) + { + ; + } + } +} + +/** + * @brief Delay function, delay us approximately + * @param [in] u32Cnt us + * @retval None + */ +void DDL_DelayUS(uint32_t u32Cnt) +{ + __IO uint32_t i; + const uint32_t u32Cyc = HCLK_VALUE / 10000000UL; + + while (u32Cnt-- > 0UL) + { + i = u32Cyc; + while (i-- > 0UL) + { + ; + } + } +} + +/** + * @brief This function Initializes the interrupt frequency of the SysTick. + * @param [in] u32Freq SysTick interrupt frequency (1 to 1000). + * @retval An en_result_t enumeration value: + * - Ok: SysTick Initializes succeed + * - Error: SysTick Initializes failed + */ +__WEAKDEF en_result_t SysTick_Init(uint32_t u32Freq) +{ + en_result_t enRet = Error; + + if ((0UL != u32Freq) && (u32Freq <= 1000UL)) + { + m_u32TickStep = 1000UL / u32Freq; + /* Configure the SysTick interrupt */ + if (0UL == SysTick_Config(HCLK_VALUE / u32Freq)) + { + enRet = Ok; + } + } + + return enRet; +} + +/** + * @brief This function provides minimum delay (in milliseconds). + * @param [in] u32Delay Delay specifies the delay time. + * @retval None + */ +__WEAKDEF void SysTick_Delay(uint32_t u32Delay) +{ + const uint32_t tickStart = SysTick_GetTick(); + uint32_t tickEnd; + uint32_t tickMax; + + if (m_u32TickStep != 0UL) + { + tickMax = 0xFFFFFFFFUL / m_u32TickStep * m_u32TickStep; + /* Add a freq to guarantee minimum wait */ + if ((u32Delay >= tickMax) || ((tickMax - u32Delay) < m_u32TickStep)) + { + tickEnd = tickMax; + } + else + { + tickEnd = u32Delay + m_u32TickStep; + } + + while ((SysTick_GetTick() - tickStart) < tickEnd) + { + } + } +} + +/** + * @brief This function is called to increment a global variable "u32TickCount". + * @note This variable is incremented in SysTick ISR. + * @param None + * @retval None + */ +__WEAKDEF void SysTick_IncTick(void) +{ + m_u32TickCount += m_u32TickStep; +} + +/** + * @brief Provides a tick value in millisecond. + * @param None + * @retval Tick value + */ +__WEAKDEF uint32_t SysTick_GetTick(void) +{ + return m_u32TickCount; +} + +/** + * @brief Suspend SysTick increment. + * @param None + * @retval None + */ +__WEAKDEF void SysTick_Suspend(void) +{ + /* Disable SysTick Interrupt */ + SysTick->CTRL &= ~SysTick_CTRL_TICKINT_Msk; +} + +/** + * @brief Resume SysTick increment. + * @param None + * @retval None + */ +__WEAKDEF void SysTick_Resume(void) +{ + /* Enable SysTick Interrupt */ + SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk; +} + +#ifdef __DEBUG +/** + * @brief DDL assert error handle function + * @param [in] file Point to the current assert the wrong file. + * @param [in] line Point line assert the wrong file in the current. + * @retval None + */ +__WEAKDEF void DDL_AssertHandler(const char *file, int line) +{ + /* Users can re-implement this function to print information */ +#if (DDL_PRINT_ENABLE == DDL_ON) + (void)printf("Wrong parameters value: file %s on line %d\r\n", file, line); +#endif + + for (;;) + { + ; + } +} +#endif /* __DEBUG */ + +#if (DDL_PRINT_ENABLE == DDL_ON) + +#if defined ( __GNUC__ ) && !defined (__CC_ARM) +/** + * @brief Re-target _write function. + * @param [in] fd + * @param [in] data + * @param [in] size + * @retval int32_t + */ +int32_t _write(int fd, char data[], int32_t size) +{ + int32_t i = -1; + + if (NULL != data) + { + (void)fd; /* Prevent unused argument compilation warning */ + + for (i = 0; i < size; i++) + { + if (Ok != UartPutChar(DDL_UART_CH, data[i])) + { + break; + } + } + } + + return i ? i : -1; +} + +#else +/** + * @brief Re-target fputc function. + * @param [in] ch + * @param [in] f + * @retval int32_t + */ +int32_t fputc(int32_t ch, FILE *f) +{ + (void)f; /* Prevent unused argument compilation warning */ + + return (Ok == UartPutChar(DDL_UART_CH, (char)ch)) ? ch: -1; +} +#endif + +/** + * @brief Initialize UART for debug printf function + * @param None + * @retval An en_result_t enumeration value: + * - Ok: Initialize successfully + * - Error: Don't permit write the GPIO configuration register or set baudrate unsuccessfully + */ +en_result_t DDL_PrintfInit(void) +{ + en_result_t enRet = Error; + + /* Check whether permit write GPIO register */ + if (READ_REG16_BIT(M4_GPIO->PWPR, GPIO_PWPR_WE)) + { + /* Configure USART TX pin. */ + MODIFY_REG16(DDL_UART_GPIO_TX_PFSR, GPIO_PFSR_FSEL, DDL_UART_GPIO_TX_FUNC); + + /* Enable USART function clock gate */ + CLEAR_REG32_BIT(M4_PWC->FCG3, DDL_UART_PWC_FCG); + + /*********************************************************************** + * Configure UART + *********************************************************************** + * Baud rate: 115200 + * Bit direction: LSB + * Data bits: 8 + * Stop bits: 1 + * Parity: None + * Sampling bits: 8 + **********************************************************************/ + /* Disbale TX/RX && clear flag */ + WRITE_REG32(DDL_UART_CH->CR1, (USART_CR1_CPE | USART_CR1_CORE | \ + USART_CR1_CFE | USART_CR1_CRTOF | \ + USART_CR1_CBE | USART_CR1_CWKUP | \ + USART_CR1_CLBD)); + + /* Set CR1 */ + WRITE_REG32(DDL_UART_CH->CR1, (USART_CR1_NFE | USART_CR1_SBS)); + + /* Set CR2: reset value */ + WRITE_REG32(DDL_UART_CH->CR2, 0x00000600UL); + + /* Set CR3: reset value */ + WRITE_REG32(DDL_UART_CH->CR3, 0x00UL); + + /* Set LBMC: reset value */ + WRITE_REG32(DDL_UART_CH->LBMC, 0x00UL); + + /* Set baudrate */ + enRet = UartSetBaudrate(DDL_UART_CH, DDL_UART_BAUDRATE); + if (Ok == enRet) + { + /* Enable TX function */ + SET_REG32_BIT(DDL_UART_CH->CR1, USART_CR1_TE); + } + } + + return enRet; +} +#endif /* DDL_PRINT_ENABLE */ + +/** + * @} + */ + +/** + * @defgroup UTILITY_Local_Functions UTILITY Local Functions + * @{ + */ +#if (DDL_PRINT_ENABLE == DDL_ON) + +/** + * @brief UART transmit. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] cData The data for transmitting + * @retval An en_result_t enumeration value: + * - Ok: Send successfully + * - ErrorTimeout: Send timeout + */ +static en_result_t UartPutChar(M4_USART_TypeDef *USARTx, char cData) +{ + uint32_t u32TxEmpty; + en_result_t enRet = Ok; + __IO uint32_t u32Timeout = (HCLK_VALUE / DDL_UART_BAUDRATE); + + /* Wait TX data register empty */ + do + { + u32Timeout--; + u32TxEmpty = READ_REG32_BIT(USARTx->SR, USART_SR_TXE); + } while ((u32Timeout > 0UL) && (0UL == u32TxEmpty)); + + if (0UL != u32TxEmpty) + { + WRITE_REG32(USARTx->DR, (uint32_t)cData); + } + else + { + enRet = ErrorTimeout; + } + + return enRet; +} + +/** + * @brief Set UART baudrate. + * @param [in] USARTx Pointer to USART instance register base + * This parameter can be one of the following values: + * @arg M4_USART1: USART unit 1 instance register base + * @arg M4_USART2: USART unit 2 instance register base + * @arg M4_USART3: USART unit 3 instance register base + * @arg M4_USART4: USART unit 4 instance register base + * @arg M4_USART5: USART unit 5 instance register base + * @arg M4_USART6: USART unit 6 instance register base + * @arg M4_USART7: USART unit 7 instance register base + * @arg M4_USART8: USART unit 8 instance register base + * @arg M4_USART9: USART unit 9 instance register base + * @arg M4_USART10: USART unit 10 instance register base + * @param [in] u32Baudrate UART baudrate + * @retval An en_result_t enumeration value: + * - Ok: Set successfully + * - Error: Baudrate set unsuccessfully + */ +static en_result_t UartSetBaudrate(M4_USART_TypeDef *USARTx, + uint32_t u32Baudrate) +{ + uint32_t B; + uint32_t C; + uint32_t OVER8; + float32_t DIV; + uint32_t DIV_Integer; + uint32_t u32Prescaler; + uint32_t u32Pclk; + uint64_t u64Temp; + en_result_t enRet = Error; + uint32_t DIV_Fraction = 0UL; + + if (u32Baudrate > 0UL) + { + B = u32Baudrate; + OVER8 = (0UL != (READ_REG32(USARTx->CR1) & USART_CR1_OVER8)) ? 1UL : 0UL; + u32Pclk = (SystemCoreClock >> ((uint32_t)(READ_REG32_BIT(M4_CMU->SCFGR, CMU_SCFGR_PCLK1S) >> CMU_SCFGR_PCLK1S_POS))); + + for (u32Prescaler = 0UL; u32Prescaler <= USART_PR_PSC; u32Prescaler++) + { + C = (u32Pclk / (1UL << (u32Prescaler * 2UL))); + + if (C > 0UL) + { + /* UART mode baudrate integer calculation formula: */ + /* B = C / (8 * (2 - OVER8) * (DIV_Integer + 1)) */ + /* DIV_Integer = (C / (B * 8 * (2 - OVER8))) - 1 */ + DIV = ((float)C / ((float)B * 8.0F * (2.0F - (float)OVER8))) - 1.0F; + DIV_Integer = (uint32_t)(DIV); + + if ((DIV > 0.0F) && (DIV_Integer < 0xFFUL)) + { + enRet = Ok; + if ((DIV - (float32_t)DIV_Integer) > 0.00001F) + { + /* UART mode baudrate fraction calculation formula: */ + /* B = C * (128 + DIV_Fraction) / (8 * (2 - OVER8) * (DIV_Integer + 1) * 256) */ + /* DIV_Fraction = (256 * (8 * (2 - OVER8) * (DIV_Integer + 1) * B) / C) - 128 */ + u64Temp = (uint64_t)((uint64_t)8UL * ((uint64_t)2UL - (uint64_t)OVER8) * ((uint64_t)DIV_Integer + 1UL) * (uint64_t)B); + DIV_Fraction = (uint32_t)(256UL * u64Temp / C - 128UL); + if (DIV_Fraction > 0x7FUL) + { + enRet = Error; + } + } + + if (Ok == enRet) + { + /* Set clock prescaler */ + WRITE_REG32(USARTx->PR, u32Prescaler); + + /* Enable or disable baudrate fraction function */ + MODIFY_REG32(USARTx->CR1, USART_CR1_FBME, (0UL != DIV_Fraction) ? USART_CR1_FBME : 0UL); + + /* Set USART_BRR register */ + WRITE_REG32(USARTx->BRR, ((DIV_Integer << USART_BRR_DIV_INTEGER_POS) + DIV_Fraction)); + break; + } + } + } + } + } + + return enRet; +} + +#endif /* DDL_PRINT_ENABLE */ + +/** + * @} + */ + +#endif /* DDL_UTILITY_ENABLE */ + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_wdt.c b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_wdt.c new file mode 100644 index 0000000000..093fc41d9d --- /dev/null +++ b/bsp/hc32f4a0/Libraries/HC32F4A0_StdPeriph_Driver/src/hc32f4a0_wdt.c @@ -0,0 +1,263 @@ +/** + ******************************************************************************* + * @file hc32f4a0_wdt.c + * @brief This file provides firmware functions to manage the General Watch Dog + * Timer(WDT). + @verbatim + Change Logs: + Date Author Notes + 2020-06-12 Yangjp First version + 2020-09-04 Yangjp Optimize timeout handling in functions + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32f4a0_wdt.h" +#include "hc32f4a0_utility.h" + +/** + * @addtogroup HC32F4A0_DDL_Driver + * @{ + */ + +/** + * @defgroup DDL_WDT WDT + * @brief General Watch Dog Timer + * @{ + */ + +#if (DDL_WDT_ENABLE == DDL_ON) + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/** + * @defgroup WDT_Local_Macros WDT Local Macros + * @{ + */ + +/* WDT Registers Clear Mask */ +#define WDT_CR_CLEAR_MASK (WDT_CR_PERI | WDT_CR_CKS | WDT_CR_WDPT | \ + WDT_CR_SLPOFF | WDT_CR_ITS) + +/* WDT Refresh Key */ +#define WDT_REFRESH_KEY_START (0x0123UL) +#define WDT_REFRESH_KEY_END (0x3210UL) + +/* WDT clear flag timeout(ms) */ +#define WDT_CLEAR_FLAG_TIMEOUT (5UL) + +/** + * @defgroup WDT_Check_Parameters_Validity WDT Check Parameters Validity + * @{ + */ +#define IS_WDT_COUNTER_CYCLE(x) \ +( ((x) == WDT_COUNTER_CYCLE_256) || \ + ((x) == WDT_COUNTER_CYCLE_4096) || \ + ((x) == WDT_COUNTER_CYCLE_16384) || \ + ((x) == WDT_COUNTER_CYCLE_65536)) + +#define IS_WDT_CLOCK_DIVISION(x) \ +( ((x) == WDT_CLOCK_DIV4) || \ + ((x) == WDT_CLOCK_DIV64) || \ + ((x) == WDT_CLOCK_DIV128) || \ + ((x) == WDT_CLOCK_DIV256) || \ + ((x) == WDT_CLOCK_DIV512) || \ + ((x) == WDT_CLOCK_DIV1024) || \ + ((x) == WDT_CLOCK_DIV2048) || \ + ((x) == WDT_CLOCK_DIV8192)) + +#define IS_WDT_ALLOW_REFRESH_RANGE(x) \ +( ((x) == WDT_RANGE_0TO100PCT) || \ + ((x) == WDT_RANGE_0TO25PCT) || \ + ((x) == WDT_RANGE_25TO50PCT) || \ + ((x) == WDT_RANGE_0TO50PCT) || \ + ((x) == WDT_RANGE_50TO75PCT) || \ + ((x) == WDT_RANGE_0TO25PCT_50TO75PCT) || \ + ((x) == WDT_RANGE_25TO75PCT) || \ + ((x) == WDT_RANGE_0TO75PCT) || \ + ((x) == WDT_RANGE_75TO100PCT) || \ + ((x) == WDT_RANGE_0TO25PCT_75TO100PCT) || \ + ((x) == WDT_RANGE_25TO50PCT_75TO100PCT) || \ + ((x) == WDT_RANGE_0TO50PCT_75TO100PCT) || \ + ((x) == WDT_RANGE_50TO100PCT) || \ + ((x) == WDT_RANGE_0TO25PCT_50TO100PCT) || \ + ((x) == WDT_RANGE_25TO100PCT)) + +#define IS_WDT_LPM_COUNT(x) \ +( ((x) == WDT_LPM_COUNT_CONTINUE) || \ + ((x) == WDT_LPM_COUNT_STOP)) + +#define IS_WDT_REQUEST_TYPE(x) \ +( ((x) == WDT_TRIG_EVENT_INT) || \ + ((x) == WDT_TRIG_EVENT_RESET)) + +#define IS_WDT_FLAG(x) \ +( (0UL != (x)) && \ + (0UL == ((x) & ((uint32_t)(~(WDT_FLAG_UDF | WDT_FLAG_REF)))))) + +/** + * @} + */ + +/** + * @} + */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * @defgroup WDT_Global_Functions WDT Global Functions + * @{ + */ + +/** + * @brief Initialize WDT. + * @param [in] pstcWdtInit Pointer to a @ref stc_wdt_init_t structure + * @retval An en_result_t enumeration value: + * - Ok: Initialize success + * - ErrorInvalidParameter: Invalid parameter + */ +en_result_t WDT_Init(const stc_wdt_init_t *pstcWdtInit) +{ + en_result_t enRet = Ok; + + if(NULL == pstcWdtInit) + { + enRet = ErrorInvalidParameter; + } + else + { + /* Check parameters */ + DDL_ASSERT(IS_WDT_COUNTER_CYCLE(pstcWdtInit->u32CountCycle)); + DDL_ASSERT(IS_WDT_CLOCK_DIVISION(pstcWdtInit->u32ClockDivision)); + DDL_ASSERT(IS_WDT_ALLOW_REFRESH_RANGE(pstcWdtInit->u32RefreshRange)); + DDL_ASSERT(IS_WDT_LPM_COUNT(pstcWdtInit->u32LPModeCountEn)); + DDL_ASSERT(IS_WDT_REQUEST_TYPE(pstcWdtInit->u32TrigType)); + + /* WDT CR Configuration(Software Start Mode) */ + MODIFY_REG32(M4_WDT->CR, WDT_CR_CLEAR_MASK, + (pstcWdtInit->u32CountCycle | pstcWdtInit->u32ClockDivision | + pstcWdtInit->u32RefreshRange | pstcWdtInit->u32LPModeCountEn | + pstcWdtInit->u32TrigType)); + } + + return enRet; +} + +/** + * @brief WDT feed dog. + * @note In software startup mode, Start counter when refreshing for the first time. + * @param None + * @retval None + */ +void WDT_Feed(void) +{ + WRITE_REG32(M4_WDT->RR, WDT_REFRESH_KEY_START); + WRITE_REG32(M4_WDT->RR, WDT_REFRESH_KEY_END); +} + +/** + * @brief Get WDT flag status. + * @param [in] u32Flag Specifies the WDT flag type. + * This parameter can be one or any combination of the following values: + * @arg WDT_FLAG_UDF: Count Underflow flag + * @arg WDT_FLAG_REF: Refresh Error flag + * @retval An en_flag_status_t enumeration value: + * - Set: Flag is set + * - Reset: Flag is reset + */ +en_flag_status_t WDT_GetStatus(uint32_t u32Flag) +{ + en_flag_status_t enFlagSta = Reset; + + /* Check parameters */ + DDL_ASSERT(IS_WDT_FLAG(u32Flag)); + + if (0UL != (READ_REG32_BIT(M4_WDT->SR, u32Flag))) + { + enFlagSta = Set; + } + + return enFlagSta; +} + +/** + * @brief Clear WDT flag status. + * @param [in] u32Flag Specifies the WDT flag type. + * This parameter can be one or any combination of the following values: + * @arg WDT_FLAG_UDF: Count Underflow flag + * @arg WDT_FLAG_REF: Refresh Error flag + * @retval An en_result_t enumeration value: + * - Ok: Clear flag success + * - ErrorTimeout: Clear flag timeout + */ +en_result_t WDT_ClearStatus(uint32_t u32Flag) +{ + __IO uint32_t u32Count; + en_result_t enRet = Ok; + + /* Check parameters */ + DDL_ASSERT(IS_WDT_FLAG(u32Flag)); + + CLEAR_REG32_BIT(M4_WDT->SR, u32Flag); + /* Waiting for FLAG bit clear */ + u32Count = WDT_CLEAR_FLAG_TIMEOUT * (HCLK_VALUE / 20000UL); + while (0UL != READ_REG32_BIT(M4_WDT->SR, u32Flag)) + { + if (0UL == u32Count) + { + enRet = ErrorTimeout; + break; + } + u32Count--; + } + + return enRet; +} + +/** + * @} + */ + +#endif /* DDL_WDT_ENABLE */ + +/** + * @} + */ + +/** +* @} +*/ + +/****************************************************************************** + * EOF (not truncated) + *****************************************************************************/ diff --git a/bsp/hc32f4a0/Libraries/SConscript b/bsp/hc32f4a0/Libraries/SConscript new file mode 100644 index 0000000000..c5cb672a38 --- /dev/null +++ b/bsp/hc32f4a0/Libraries/SConscript @@ -0,0 +1,70 @@ +# RT-Thread building script for bridge + +import rtconfig +Import('RTT_ROOT') +from building import * + +# get current directory +cwd = GetCurrentDir() + +# The set of source files associated with this SConscript file. +src = Split(""" +CMSIS/Device/HDSC/HC32F4A0/Source/system_hc32f4a0.c +HC32F4A0_StdPeriph_Driver/src/hc32f4a0_clk.c +HC32F4A0_StdPeriph_Driver/src/hc32f4a0_dma.c +HC32F4A0_StdPeriph_Driver/src/hc32f4a0_efm.c +HC32F4A0_StdPeriph_Driver/src/hc32f4a0_gpio.c +HC32F4A0_StdPeriph_Driver/src/hc32f4a0_icg.c +HC32F4A0_StdPeriph_Driver/src/hc32f4a0_interrupts.c +HC32F4A0_StdPeriph_Driver/src/hc32f4a0_pwc.c +HC32F4A0_StdPeriph_Driver/src/hc32f4a0_sram.c +HC32F4A0_StdPeriph_Driver/src/hc32f4a0_utility.c +""") + +#src += Glob('HC32F4A0_StdPeriph_Driver/src/*.c') + +if GetDepend(['RT_USING_SERIAL']): + src += ['HC32F4A0_StdPeriph_Driver/src/hc32f4a0_usart.c'] + src += ['HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmr0.c'] + +if GetDepend(['RT_USING_I2C']): + src += ['HC32F4A0_StdPeriph_Driver/src/hc32f4a0_i2c.c'] + +if GetDepend(['RT_USING_SPI']): + src += ['HC32F4A0_StdPeriph_Driver/src/hc32f4a0_spi.c'] + src += ['HC32F4A0_StdPeriph_Driver/src/hc32f4a0_qspi.c'] + +if GetDepend(['RT_USING_CAN']): + src += ['HC32F4A0_StdPeriph_Driver/src/hc32f4a0_can.c'] + +if GetDepend(['RT_USING_ADC']): + src += ['HC32F4A0_StdPeriph_Driver/src/hc32f4a0_adc.c'] + +if GetDepend(['RT_USING_RTC']): + src += ['HC32F4A0_StdPeriph_Driver/src/hc32f4a0_rtc.c'] + +if GetDepend(['RT_USING_WDT']): + src += ['HC32F4A0_StdPeriph_Driver/src/hc32f4a0_wdt.c'] + src += ['HC32F4A0_StdPeriph_Driver/src/hc32f4a0_swdt.c'] + +if GetDepend(['RT_USING_HWTIMER']) or GetDepend(['RT_USING_PWM'] or GetDepend(['RT_USING_PULSE_ENCODER'])): + src += ['HC32F4A0_StdPeriph_Driver/src/hc32f4a0_tmra.c'] + +#add for startup script +if rtconfig.CROSS_TOOL == 'gcc': + src = src + ['CMSIS/Device/HDSC/HC32F4A0/Source/GCC/startup_hc32f4a0.S'] +elif rtconfig.CROSS_TOOL == 'keil': + src = src + ['CMSIS/Device/HDSC/HC32F4A0/Source/ARM/startup_hc32f4a0.s'] +elif rtconfig.CROSS_TOOL == 'iar': + src = src + ['CMSIS/Device/HDSC/HC32F4A0/Source/IAR/startup_hc32f4a0.s'] + +#add headfile script +path = [cwd + '/CMSIS/Include', + cwd + '/CMSIS/Device/HDSC/HC32F4A0/Include', + cwd + '/HC32F4A0_StdPeriph_Driver/inc'] + +CPPDEFINES = ['USE_DDL_DRIVER', rtconfig.MCU_TYPE, '__DEBUG'] + +group = DefineGroup('HC32_StdPeriph', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) + +Return('group') diff --git a/bsp/hc32f4a0/README.md b/bsp/hc32f4a0/README.md new file mode 100644 index 0000000000..456869ffd3 --- /dev/null +++ b/bsp/hc32f4a0/README.md @@ -0,0 +1,117 @@ +# HDSC EV_F4A0_LQ176 开发板 BSP 说明 + +## 简介 + +本文档为华大半导体为 EV_F4A0_LQ176 开发板提供的 BSP (板级支持包) 说明。 + +主要内容如下: + +- 开发板资源介绍 +- BSP 快速上手 +- 进阶使用方法 + +通过阅读快速上手章节开发者可以快速地上手该 BSP,将 RT-Thread 运行在开发板上。在进阶使用指南章节,将会介绍更多高级功能,帮助开发者利用 RT-Thread 驱动更多板载资源。 + +## 开发板介绍 + +EV_F4A0_LQ176 是 HDSC 官方推出的开发板,搭载 HC32F4A0SITB 芯片,基于 ARM Cortex-M4 内核,最高主频 240 MHz,具有丰富的板载资源,可以充分发挥 HC32F4A0SITB 的芯片性能。 + +开发板外观如下图所示: + +![board](figures/board.jpg) + +EV_F4A0_LQ176 开发板常用 **板载资源** 如下: + +- MCU:HC32F4A0SITB,主频 240MHz,2048KB FLASH ,512KB RAM +- 外部 RAM:IS62WV51216(SRAM,512KB) IS42S16400J(SDRAM,1MB) +- 外部 FLASH: MT29F2G08AB(Nand,256MB) W25Q64(SPI,64M) +- 常用外设 + - LED:11 个,DAP LED (D82), USB LED (D26,D19,D4), Power LED (D39,D83), JTAG LED(D80), MCU LED(D81), user LED(LED0,LED1,LED2)。 + - 按键:11 个,SW0~SW9(矩阵键盘)、WAKEUP(SW10)、RESET。 +- 常用接口:USB 转串口、SD 卡接口、以太网接口、LCD 接口、USB HS、USB FS、USB 3300、DVP接口、3.5mm 耳机接口、Line in 接口、喇叭接口 +- 调试接口:板载DAP调试器、标准 JTAG/SWD。 + +开发板更多详细信息请参考华大半导体半导体[EV_F4A0_LQ176](https://www.hdsc.com.cn) + +## 外设支持 + +本 BSP 目前对外设的支持情况如下: + +| **板载外设** | **支持情况** | **备注** | +| :------------ | :-----------: | :-----------------------------------: | +| USB 转串口 | 支持 | 使用 UART1 | +| SPI Flash | 支持 | 使用 SPI1 | +| LED | 支持 | LED | +| **片上外设** | **支持情况** | **备注** | +| :------------ | :-----------: | :-----------------------------------: | +| GPIO | 支持 | PA0, PA1... PI15 ---> PIN: 0, 1...144 | +| UART | 支持 | UART1~10 | +| SPI | 支持 | SPI1~6 | +| I2C | 支持 | 软件 I2C | +| RTC | 支持 | 支持外部晶振和内部低速时钟 | +| PWM | 支持 | | +| HWTIMER | 支持 | | +| LED | 支持 | LED2 | + + +## 使用说明 + +使用说明分为如下两个章节: + +- 快速上手 + + 本章节是为刚接触 RT-Thread 的新手准备的使用说明,遵循简单的步骤即可将 RT-Thread 操作系统运行在该开发板上,看到实验效果 。 + +- 进阶使用 + + 本章节是为需要在 RT-Thread 操作系统上使用更多开发板资源的开发者准备的。通过使用 ENV 工具对 BSP 进行配置,可以开启更多板载资源,实现更多高级功能。 + + +### 快速上手 + +本 BSP 为开发者提供 MDK4、MDK5 和 IAR 工程,并且支持 GCC 开发环境。下面以 MDK5 开发环境为例,介绍如何将系统运行起来。 + +#### 硬件连接 + +使用 Type-A to Mini-B 线连接开发板和 PC 供电,D81,D82,D39 会点亮。 + +#### 编译下载 + +双击 project.uvprojx 文件,打开 MDK5 工程,编译并下载程序到开发板。 + +> 工程默认配置使用 J-LINK 下载程序,点击下载按钮即可下载程序到开发板。 + +#### 运行结果 + +下载程序成功之后,系统会自动运行,观察开发板上 LED 的运行效果,绿色D81,D82,D39 常亮、绿色 D26 会周期性闪烁。 + +USB 虚拟 COM 端口默认连接串口 1,在终端工具里打开相应的串口,复位设备后,可以看到 RT-Thread 的输出信息: + +``` + \ | / +- RT - Thread Operating System + / | \ 4.0.3 build Dec 22 2020 + 2006 - 2020 Copyright by rt-thread team +Os is Start!!! +msh > +``` + +### 进阶使用 + +此 BSP 默认只开启了 GPIO 和 串口 1 的功能,更多高级功能需要利用 env 工具对 BSP 进行配置,步骤如下: + +1. 在 bsp 下打开 env 工具。 + +2. 输入`menuconfig`命令配置工程,配置好之后保存退出。 + +3. 输入`pkgs --update`命令更新软件包。 + +4. 输入`scons --target=mdk4/mdk5/iar` 命令重新生成工程。 + +## 注意事项 + +## 联系人信息 + +维护人: + +- [华大半导体CDT](), 邮箱:<> \ No newline at end of file diff --git a/bsp/hc32f4a0/SConscript b/bsp/hc32f4a0/SConscript new file mode 100644 index 0000000000..24bb4646ab --- /dev/null +++ b/bsp/hc32f4a0/SConscript @@ -0,0 +1,15 @@ +# for module compiling +import os +Import('RTT_ROOT') +from building import * + +cwd = GetCurrentDir() +objs = [] +list = os.listdir(cwd) + +for d in list: + path = os.path.join(cwd, d) + if os.path.isfile(os.path.join(path, 'SConscript')): + objs = objs + SConscript(os.path.join(d, 'SConscript')) + +Return('objs') diff --git a/bsp/hc32f4a0/SConstruct b/bsp/hc32f4a0/SConstruct new file mode 100644 index 0000000000..b358e0d045 --- /dev/null +++ b/bsp/hc32f4a0/SConstruct @@ -0,0 +1,45 @@ +import os +import sys +import rtconfig + +print "############sconstruct##############" +if os.getenv('RTT_ROOT'): + RTT_ROOT = os.getenv('RTT_ROOT') +else: + RTT_ROOT = os.path.normpath(os.getcwd() + '/../..') + +print "RTT_ROOT: " + RTT_ROOT + +sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')] +try: + from building import * +except: + print('Cannot found RT-Thread root directory, please check RTT_ROOT') + print(RTT_ROOT) + exit(-1) + +TARGET = 'hc32f4A0.' + rtconfig.TARGET_EXT + +DefaultEnvironment(tools=[]) +env = Environment(tools = ['mingw'], + AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, + CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS, + AR = rtconfig.AR, ARFLAGS = '-rc', + LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) +env.PrependENVPath('PATH', rtconfig.EXEC_PATH) + +if rtconfig.PLATFORM == 'iar': + env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) + env.Replace(ARFLAGS = ['']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map project.map') + +Export('RTT_ROOT') +Export('rtconfig') + +# prepare building environment +print "######################env:" +print env +objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False) + +# make a building +DoBuilding(TARGET, objs) diff --git a/bsp/hc32f4a0/applications/SConscript b/bsp/hc32f4a0/applications/SConscript new file mode 100644 index 0000000000..6f66f7ab73 --- /dev/null +++ b/bsp/hc32f4a0/applications/SConscript @@ -0,0 +1,12 @@ +import rtconfig +from building import * + +cwd = GetCurrentDir() +CPPPATH = [cwd, str(Dir('#'))] +src = Split(""" +main.c +""") + +group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH) + +Return('group') diff --git a/bsp/hc32f4a0/applications/main.c b/bsp/hc32f4a0/applications/main.c new file mode 100644 index 0000000000..8235b147ec --- /dev/null +++ b/bsp/hc32f4a0/applications/main.c @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ + + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "hc32_ddl.h" +#include "board.h" + +#include +#include + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ + +/* defined the LED pin: PC9 */ +#define LED_PIN (41) + +#define DELAY_MS (RT_TICK_PER_SECOND) /* 1s */ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ + +/** + ******************************************************************************* + ** \brief Main function of GPIO output + ** + ** \param None + ** + ** \retval int32_t Return value, if needed + ** + ******************************************************************************/ +int32_t main(void) +{ + rt_kprintf("Os is Start!!! \n"); + + while(1) + { + rt_pin_mode(LED_PIN, PIN_MODE_OUTPUT); + rt_pin_write(LED_PIN, PIN_HIGH); + rt_thread_delay(DELAY_MS); + rt_pin_write(LED_PIN, PIN_LOW); + rt_thread_delay(DELAY_MS); + }; +} + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/board/Kconfig b/bsp/hc32f4a0/board/Kconfig new file mode 100644 index 0000000000..c33c82d89e --- /dev/null +++ b/bsp/hc32f4a0/board/Kconfig @@ -0,0 +1,336 @@ +menu "Hardware Drivers Config" + +config MCU_HC32F4A0 + bool + select ARCH_ARM_CORTEX_M4 + select RT_USING_COMPONENTS_INIT + select RT_USING_USER_MAIN + default y + +menu "Onboard Peripheral Drivers" + +endmenu + +menu "On-chip Peripheral Drivers" + config BSP_USING_GPIO + bool "Enable GPIO" + select RT_USING_PIN + default y + + menuconfig BSP_USING_UART + bool "Enable UART" + default y + select RT_USING_SERIAL + if BSP_USING_UART + config BSP_USING_UART1 + bool "Enable UART1" + default y + + config BSP_UART1_RX_USING_DMA + bool "Enable UART1 RX DMA" + depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA + default n + + config BSP_UART1_TX_USING_DMA + bool "Enable UART1 TX DMA" + depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA + default n + + config BSP_USING_UART2 + bool "Enable UART2" + default n + + config BSP_UART2_RX_USING_DMA + bool "Enable UART2 RX DMA" + depends on BSP_USING_UART2 && RT_SERIAL_USING_DMA + default n + + config BSP_UART2_TX_USING_DMA + bool "Enable UART2 TX DMA" + depends on BSP_USING_UART2 && RT_SERIAL_USING_DMA + default n + + config BSP_USING_UART3 + bool "Enable UART3" + default n + + config BSP_USING_UART4 + bool "Enable UART4" + default n + + config BSP_USING_UART5 + bool "Enable UART5" + default n + + config BSP_USING_UART6 + bool "Enable UART6" + default n + + config BSP_UART6_RX_USING_DMA + bool "Enable UART6 RX DMA" + depends on BSP_USING_UART6 && RT_SERIAL_USING_DMA + default n + + config BSP_UART6_TX_USING_DMA + bool "Enable UART6 TX DMA" + depends on BSP_USING_UART6 && RT_SERIAL_USING_DMA + default n + + config BSP_USING_UART7 + bool "Enable UART7" + default n + + config BSP_UART7_RX_USING_DMA + bool "Enable UART7 RX DMA" + depends on BSP_USING_UART7 && RT_SERIAL_USING_DMA + default n + + config BSP_UART7_TX_USING_DMA + bool "Enable UART7 TX DMA" + depends on BSP_USING_UART7 && RT_SERIAL_USING_DMA + default n + + config BSP_USING_UART8 + bool "Enable UART8" + default n + + config BSP_USING_UART9 + bool "Enable UART9" + default n + + config BSP_USING_UART10 + bool "Enable UART10" + default n + endif + + menuconfig BSP_USING_I2C1 + bool "Enable I2C1 BUS (software simulation)" + default y + select RT_USING_I2C + select RT_USING_I2C_BITOPS + select RT_USING_PIN + if BSP_USING_I2C1 + config BSP_I2C1_SCL_PIN + int "i2c1 scl pin number" + range 1 176 + default 51 + config BSP_I2C1_SDA_PIN + int "I2C1 sda pin number" + range 1 176 + default 90 + endif + + menuconfig BSP_USING_SPI + bool "Enable SPI BUS" + default n + select RT_USING_SPI + if BSP_USING_SPI + config BSP_USING_SPI1 + bool "Enable SPI1 BUS" + default n + + config BSP_SPI1_TX_USING_DMA + bool "Enable SPI1 TX DMA" + depends on BSP_USING_SPI1 + default n + + config BSP_SPI1_RX_USING_DMA + bool "Enable SPI1 RX DMA" + depends on BSP_USING_SPI1 + select BSP_SPI1_TX_USING_DMA + default n + + config BSP_USING_SPI2 + bool "Enable SPI2 BUS" + default n + + config BSP_SPI2_TX_USING_DMA + bool "Enable SPI2 TX DMA" + depends on BSP_USING_SPI2 + default n + + config BSP_SPI2_RX_USING_DMA + bool "Enable SPI2 RX DMA" + depends on BSP_USING_SPI2 + select BSP_SPI2_TX_USING_DMA + default n + + config BSP_USING_SPI3 + bool "Enable SPI3 BUS" + default n + + config BSP_SPI3_TX_USING_DMA + bool "Enable SPI3 TX DMA" + depends on BSP_USING_SPI3 + default n + + config BSP_SPI3_RX_USING_DMA + bool "Enable SPI3 RX DMA" + depends on BSP_USING_SPI3 + select BSP_SPI3_TX_USING_DMA + default n + + config BSP_USING_SPI4 + bool "Enable SPI4 BUS" + default n + + config BSP_SPI4_TX_USING_DMA + bool "Enable SPI4 TX DMA" + depends on BSP_USING_SPI4 + default n + + config BSP_SPI4_RX_USING_DMA + bool "Enable SPI4 RX DMA" + depends on BSP_USING_SPI4 + select BSP_SPI4_TX_USING_DMA + default n + + config BSP_USING_SPI5 + bool "Enable SPI5 BUS" + default n + + config BSP_SPI5_RX_USING_DMA + bool "Enable SPI5 TX DMA" + depends on BSP_USING_SPI5 + default n + + config BSP_SPI5_RX_USING_DMA + bool "Enable SPI5 RX DMA" + depends on BSP_USING_SPI5 + select BSP_SPI5_TX_USING_DMA + default n + + config BSP_USING_SPI6 + bool "Enable SPI6 BUS" + default n + + config BSP_SPI6_TX_USING_DMA + bool "Enable SPI6 TX DMA" + depends on BSP_USING_SPI6 + default n + + config BSP_SPI6_RX_USING_DMA + bool "Enable SPI6 RX DMA" + depends on BSP_USING_SPI6 + select BSP_SPI6_TX_USING_DMA + default n + endif + + menuconfig BSP_USING_RTC + bool "Enable RTC" + select RT_USING_RTC + select RT_USING_LIBC + default n + + if BSP_USING_RTC + choice + prompt "Select clock source" + default BSP_RTC_USING_LRC + + config BSP_RTC_USING_XTAL32 + bool "RTC USING XTAL32" + + config BSP_RTC_USING_LRC + bool "RTC USING LRC" + endchoice + endif + + menuconfig BSP_USING_PWM + bool "Enable PWM" + default n + select RT_USING_PWM + if BSP_USING_PWM + menuconfig BSP_USING_PWM1 + bool "Enable timer1 output pwm" + default n + if BSP_USING_PWM1 + config BSP_USING_PWM1_CH1 + bool "Enable PWM1 channel1" + default n + + config BSP_USING_PWM1_CH2 + bool "Enable PWM1 channel2" + default n + + config BSP_USING_PWM1_CH3 + bool "Enable PWM1 channel3" + default n + + config BSP_USING_PWM1_CH4 + bool "Enable PWM1 channel4" + default n + endif + + menuconfig BSP_USING_PWM2 + bool "Enable timer2 output pwm" + default n + if BSP_USING_PWM2 + config BSP_USING_PWM2_CH1 + bool "Enable PWM2 channel1" + default n + + config BSP_USING_PWM2_CH2 + bool "Enable PWM2 channel2" + default n + + config BSP_USING_PWM2_CH3 + bool "Enable PWM2 channel3" + default n + + config BSP_USING_PWM2_CH4 + bool "Enable PWM2 channel4" + default n + endif + endif + + menuconfig BSP_USING_TIMER + bool "Enable TIMER" + default n + select RT_USING_HWTIMER + if BSP_USING_TIMER + config BSP_USING_TIMER5 + bool "Enable TIMER5" + default n + + config BSP_USING_TIMER6 + bool "Enable TIMER6" + default n + + config BSP_USING_TIMER7 + bool "Enable TIMER7" + default n + + config BSP_USING_TIMER8 + bool "Enable TIMER8" + default n + endif + + menuconfig BSP_USING_PULSE_ENCODER + bool "Enable Pulse Encoder" + default n + select RT_USING_PULSE_ENCODER + if BSP_USING_PULSE_ENCODER + config BSP_USING_PULSE_ENCODER9 + bool "Enable Pulse Encoder9" + default n + + config BSP_USING_PULSE_ENCODER10 + bool "Enable Pulse Encoder10" + default n + + config BSP_USING_PULSE_ENCODER11 + bool "Enable Pulse Encoder11" + default n + + config BSP_USING_PULSE_ENCODER12 + bool "Enable Pulse Encoder12" + default n + endif + +endmenu + +menu "Board extended module Drivers" + +endmenu + +endmenu diff --git a/bsp/hc32f4a0/board/SConscript b/bsp/hc32f4a0/board/SConscript new file mode 100644 index 0000000000..e06723028f --- /dev/null +++ b/bsp/hc32f4a0/board/SConscript @@ -0,0 +1,15 @@ +from building import * + +cwd = GetCurrentDir() + +CPPPATH = [cwd] + +# add general drivers +src = Split(''' +board.c +board_config.c +''') + +group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH) + +Return('group') diff --git a/bsp/hc32f4a0/board/board.c b/bsp/hc32f4a0/board/board.c new file mode 100644 index 0000000000..de249f4b7c --- /dev/null +++ b/bsp/hc32f4a0/board/board.c @@ -0,0 +1,190 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ + + + +#include +#include + +#include "board.h" + +/** + * @addtogroup HC32 + */ + +/*@{*/ + +/******************************************************************************* +* Function Name : Peripheral_WE +* Description : MCU Peripheral registers write unprotected. +* Input : None +* Output : None +* Return : None +*******************************************************************************/ +void Peripheral_WE(void) +{ + /* Unlock GPIO register: PSPCR, PCCR, PINAER, PCRxy, PFSRxy */ + GPIO_Unlock(); + /* Unlock PWC register: FCG0 */ + PWC_FCG0_Unlock(); + /* Unlock PWC, CLK, PVD registers, @ref PWC_REG_Write_Unlock_Code for details */ + PWC_Unlock(PWC_UNLOCK_CODE_0 | PWC_UNLOCK_CODE_1); + /* Unlock SRAM register: WTCR */ + SRAM_WTCR_Unlock(); + /* Unlock SRAM register: CKCR */ + // SRAM_CKCR_Unlock(); + /* Unlock all EFM registers */ + EFM_Unlock(); + /* Unlock EFM register: FWMC */ + // EFM_FWMC_Unlock(); + /* Unlock EFM OTP write protect registers */ + // EFM_OTP_WP_Unlock(); +} + +/******************************************************************************* +* Function Name : Peripheral_WP +* Description : MCU Peripheral registers write protected. +* Input : None +* Output : None +* Return : None +*******************************************************************************/ +void Peripheral_WP(void) +{ + /* Lock GPIO register: PSPCR, PCCR, PINAER, PCRxy, PFSRxy */ + GPIO_Lock(); + /* Lock PWC register: FCG0 */ + // PWC_FCG0_Lock(); + /* Lock PWC, CLK, PVD registers, @ref PWC_REG_Write_Unlock_Code for details */ + PWC_Lock(PWC_UNLOCK_CODE_0 | PWC_UNLOCK_CODE_1); + /* Lock SRAM register: WTCR */ + // SRAM_WTCR_Lock(); + /* Lock SRAM register: CKCR */ + // SRAM_CKCR_Lock(); + /* Lock all EFM registers */ + // EFM_Lock(); + /* Lock EFM OTP write protect registers */ + // EFM_OTP_WP_Lock(); + /* Lock EFM register: FWMC */ + // EFM_FWMC_Lock(); +} + +/** + * @brief BSP clock initialize. + * Set board system clock to PLLH@240MHz + * @param None + * @retval None + */ +void rt_hw_board_clock_init(void) +{ + stc_clk_pllh_init_t stcPLLHInit; + + CLK_ClkDiv(CLK_CATE_ALL, \ + (CLK_PCLK0_DIV1 | CLK_PCLK1_DIV2 | CLK_PCLK2_DIV4 | \ + CLK_PCLK3_DIV4 | CLK_PCLK4_DIV2 | CLK_EXCLK_DIV2 | \ + CLK_HCLK_DIV1)); + + (void)CLK_PLLHStrucInit(&stcPLLHInit); + /* VCO = (8/1)*120 = 960MHz*/ + stcPLLHInit.u8PLLState = CLK_PLLH_ON; + stcPLLHInit.PLLCFGR = 0UL; + stcPLLHInit.PLLCFGR_f.PLLM = 1UL - 1UL; + stcPLLHInit.PLLCFGR_f.PLLN = 120UL - 1UL; + stcPLLHInit.PLLCFGR_f.PLLP = 4UL - 1UL; + stcPLLHInit.PLLCFGR_f.PLLQ = 4UL - 1UL; + stcPLLHInit.PLLCFGR_f.PLLR = 4UL - 1UL; + stcPLLHInit.PLLCFGR_f.PLLSRC = CLK_PLLSRC_XTAL; + (void)CLK_PLLHInit(&stcPLLHInit); + + /* Highspeed SRAM set to 1 Read/Write wait cycle */ + SRAM_SetWaitCycle(SRAM_SRAMH, SRAM_WAIT_CYCLE_1, SRAM_WAIT_CYCLE_1); + /* SRAM1_2_3_4_backup set to 2 Read/Write wait cycle */ + SRAM_SetWaitCycle((SRAM_SRAM123 | SRAM_SRAM4 | SRAM_SRAMB), SRAM_WAIT_CYCLE_2, SRAM_WAIT_CYCLE_2); + /* 0-wait @ 40MHz */ + EFM_SetWaitCycle(EFM_WAIT_CYCLE_5); + /* 4 cycles for 200 ~ 250MHz */ + GPIO_SetReadWaitCycle(GPIO_READ_WAIT_4); + CLK_SetSysClkSrc(CLK_SYSCLKSOURCE_PLLH); +} + +/******************************************************************************* + * Function Name : SysTick_Configuration + * Description : Configures the SysTick for OS tick. + * Input : None + * Output : None + * Return : None + *******************************************************************************/ +void SysTick_Configuration(void) +{ + stc_clk_freq_t stcClkFreq; + rt_uint32_t cnts; + + CLK_GetClockFreq(&stcClkFreq); + + cnts = (rt_uint32_t)stcClkFreq.hclkFreq / RT_TICK_PER_SECOND; + + SysTick_Config(cnts); +} + +/** + * This is the timer interrupt service routine. + * + */ +void SysTick_Handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + rt_tick_increase(); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +/** + * This function will initialize HC32 board. + */ +void rt_hw_board_init() +{ + /* Unlock the protected registers. */ + Peripheral_WE(); + + /* Configure the System clock */ + rt_hw_board_clock_init(); + + /* Configure the SysTick */ + SysTick_Configuration(); + +#ifdef RT_USING_HEAP + rt_system_heap_init((void *)HEAP_BEGIN, (void *)HEAP_END); +#endif + +#ifdef RT_USING_COMPONENTS_INIT + rt_components_board_init(); +#endif + +#ifdef RT_USING_CONSOLE + rt_console_set_device(RT_CONSOLE_DEVICE_NAME); +#endif +} + +void rt_hw_us_delay(rt_uint32_t us) +{ + uint32_t start, now, delta, reload, us_tick; + start = SysTick->VAL; + reload = SysTick->LOAD; + us_tick = SystemCoreClock / 1000000UL; + + do{ + now = SysTick->VAL; + delta = start > now ? start - now : reload + start - now; + } + while(delta < us_tick * us); +} +/*@}*/ diff --git a/bsp/hc32f4a0/board/board.h b/bsp/hc32f4a0/board/board.h new file mode 100644 index 0000000000..927f7d78f2 --- /dev/null +++ b/bsp/hc32f4a0/board/board.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ + + +#ifndef __BOARD_H__ +#define __BOARD_H__ + +#include +#include "hc32_ddl.h" +#include "drv_gpio.h" + +/* board configuration */ +#define SRAM_BASE 0x1FFE0000 +#define SRAM_SIZE 0x20000 +#define SRAM_END (SRAM_BASE + SRAM_SIZE) + +/* High speed sram. */ +#ifdef __CC_ARM +extern int Image$$RW_IRAM1$$ZI$$Limit; +#define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit) +#elif __ICCARM__ +#pragma section="HEAP" +#define HEAP_BEGIN (__segment_end("HEAP")) +#else +extern int __bss_end; +#define HEAP_BEGIN (&__bss_end) +#endif + +#ifdef __ICCARM__ +// Use *.icf ram symbal, to avoid hardcode. +extern char __ICFEDIT_region_RAM_end__; +#define HEAP_END (&__ICFEDIT_region_RAM_end__) +#else +#define HEAP_END SRAM_END +#endif + +void Peripheral_WE(void); +void Peripheral_WP(void); +void rt_hw_board_init(void); +void rt_hw_us_delay(rt_uint32_t us); + +#endif + +// <<< Use Configuration Wizard in Context Menu >>> diff --git a/bsp/hc32f4a0/board/board_config.c b/bsp/hc32f4a0/board/board_config.c new file mode 100644 index 0000000000..292b67de37 --- /dev/null +++ b/bsp/hc32f4a0/board/board_config.c @@ -0,0 +1,146 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ +#include +#include "board_config.h" + +/** + * The below functions will initialize HC32 board. + */ + +#if defined RT_USING_SERIAL +rt_err_t rt_hw_board_uart_init(M4_USART_TypeDef *USARTx) +{ + rt_err_t result = RT_EOK; + + switch ((rt_uint32_t)USARTx) + { +#if defined(BSP_USING_UART1) + case (rt_uint32_t)M4_USART1: + /* Configure USART RX/TX pin. */ + GPIO_SetFunc(USART1_RX_PORT, USART1_RX_PIN, GPIO_FUNC_33_USART1_RX, PIN_SUBFUNC_DISABLE); + GPIO_SetFunc(USART1_TX_PORT, USART1_TX_PIN, GPIO_FUNC_32_USART1_TX, PIN_SUBFUNC_DISABLE); + break; +#endif + default: + result = -RT_ERROR; + break; + } + + return result; +} +#endif + +#if defined(RT_USING_PWM) +rt_err_t rt_hw_board_pwm_init(M4_TMRA_TypeDef *TMRAx) +{ + rt_err_t result = RT_EOK; + + switch ((rt_uint32_t)TMRAx) + { +#if defined(BSP_USING_PWM1) + case (rt_uint32_t)M4_TMRA_1: +#if defined(BSP_USING_PWM1_CH1) + GPIO_SetFunc(PWM1_CH1_PORT, PWM1_CH1_PIN, PWM1_CH1_FUNC, PIN_SUBFUNC_DISABLE); +#endif +#if defined(BSP_USING_PWM1_CH2) + GPIO_SetFunc(PWM1_CH2_PORT, PWM1_CH2_PIN, PWM1_CH2_FUNC, PIN_SUBFUNC_DISABLE); +#endif + break; +#endif + default: + result = -RT_ERROR; + break; + } + + return result; +} +#endif + +#if defined (RT_USING_SPI) +void hc32_board_spi_init(M4_SPI_TypeDef *M4_SPIx, rt_uint8_t mode) +{ +#if defined (BSP_USING_SPI1) + stc_gpio_init_t stcGpioCfg; + + GPIO_StructInit(&stcGpioCfg); + + /* Port configurate, High driving capacity for output pin. + CMOS input for input pin */ + if(mode & RT_SPI_3WIRE) + { + /* code */ + } + else + { + if(mode & RT_SPI_SLAVE) + { + stcGpioCfg.u16PinIType = PIN_ITYPE_CMOS; + } + else + { + stcGpioCfg.u16PinDrv = PIN_DRV_HIGH; + } + GPIO_Init(SPI1_NSS_PORT, SPI1_NSS_PIN, &stcGpioCfg); + GPIO_SetFunc(SPI1_NSS_PORT, SPI1_NSS_PIN, SPI1_NSS_GPIO_FUNC, PIN_SUBFUNC_DISABLE); + } + if(mode & RT_SPI_SLAVE) + { + stcGpioCfg.u16PinIType = PIN_ITYPE_CMOS; + GPIO_Init(SPI1_SCK_PORT, SPI1_SCK_PIN, &stcGpioCfg); + GPIO_Init(SPI1_MOSI_PORT, SPI1_MOSI_PIN, &stcGpioCfg); + stcGpioCfg.u16PinDrv = PIN_DRV_HIGH; + GPIO_Init(SPI1_MISO_PORT, SPI1_MISO_PIN, &stcGpioCfg); + } + else + { + stcGpioCfg.u16PinDrv = PIN_DRV_HIGH; + GPIO_Init(SPI1_SCK_PORT, SPI1_SCK_PIN, &stcGpioCfg); + GPIO_Init(SPI1_MOSI_PORT, SPI1_MOSI_PIN, &stcGpioCfg); + stcGpioCfg.u16PinIType = PIN_ITYPE_CMOS; + GPIO_Init(SPI1_MISO_PORT, SPI1_MISO_PIN, &stcGpioCfg); + } + + GPIO_SetFunc(SPI1_SCK_PORT, SPI1_SCK_PIN, SPI1_SCK_GPIO_FUNC, PIN_SUBFUNC_DISABLE); + GPIO_SetFunc(SPI1_MOSI_PORT, SPI1_MOSI_PIN, SPI1_MOSI_GPIO_FUNC, PIN_SUBFUNC_DISABLE); + GPIO_SetFunc(SPI1_MISO_PORT, SPI1_MISO_PIN, SPI1_MISO_GPIO_FUNC, PIN_SUBFUNC_DISABLE); +#endif + +#if defined (BSP_USING_SPI2) + /* Config SPI2 relevant port according to SPI1 */ +#endif + +#if defined (BSP_USING_SPI3) + /* Config SPI3 relevant port according to SPI1 */ +#endif + +} +#endif + +#if defined(RT_USING_PULSE_ENCODER) +rt_err_t rt_hw_board_pulse_encoder_init(M4_TMRA_TypeDef *TMRAx) +{ + rt_err_t result = RT_EOK; + + switch ((rt_uint32_t)TMRAx) + { +#if defined(BSP_USING_PULSE_ENCODER9) + case (rt_uint32_t)M4_TMRA_9: + GPIO_SetFunc(PULSE_ENCODER9_CLKA_PORT, PULSE_ENCODER9_CLKA_PIN, PULSE_ENCODER9_CLKA_FUNC, PIN_SUBFUNC_DISABLE); + GPIO_SetFunc(PULSE_ENCODER9_CLKB_PORT, PULSE_ENCODER9_CLKB_PIN, PULSE_ENCODER9_CLKB_FUNC, PIN_SUBFUNC_DISABLE); + break; +#endif + default: + result = -RT_ERROR; + break; + } + + return result; +} +#endif diff --git a/bsp/hc32f4a0/board/board_config.h b/bsp/hc32f4a0/board/board_config.h new file mode 100644 index 0000000000..c029ee0223 --- /dev/null +++ b/bsp/hc32f4a0/board/board_config.h @@ -0,0 +1,198 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ + + +#ifndef __BOARD_CONFIG_H__ +#define __BOARD_CONFIG_H__ + +#include +#include "hc32_ddl.h" + +/*********** Port configure *********/ +#if defined(BSP_USING_UART1) +#define USART1_RX_PORT (GPIO_PORT_H) +#define USART1_RX_PIN (GPIO_PIN_13) + +#define USART1_TX_PORT (GPIO_PORT_H) +#define USART1_TX_PIN (GPIO_PIN_15) +#endif + +#if defined(BSP_USING_SPI1) +#define SPI1_NSS_PORT (GPIO_PORT_C) +#define SPI1_NSS_PIN (GPIO_PIN_07) +#define SPI1_NSS_GPIO_FUNC (GPIO_FUNC_0_GPO) + +#define SPI1_SCK_PORT (GPIO_PORT_C) +#define SPI1_SCK_PIN (GPIO_PIN_06) +#define SPI1_SCK_GPIO_FUNC (GPIO_FUNC_40_SPI1_SCK) + +#define SPI1_MOSI_PORT (GPIO_PORT_B) +#define SPI1_MOSI_PIN (GPIO_PIN_13) +#define SPI1_MOSI_GPIO_FUNC (GPIO_FUNC_41_SPI1_MOSI) + +#define SPI1_MISO_PORT (GPIO_PORT_B) +#define SPI1_MISO_PIN (GPIO_PIN_12) +#define SPI1_MISO_GPIO_FUNC (GPIO_FUNC_42_SPI1_MISO) +#endif + +#if defined(BSP_USING_PWM1) + +#if defined(BSP_USING_PWM1_CH1) +#define PWM1_CH1_PORT (GPIO_PORT_A) +#define PWM1_CH1_PIN (GPIO_PIN_08) +#define PWM1_CH1_FUNC (GPIO_FUNC_4_TIMA1_PWM1) +#endif + +#if defined(BSP_USING_PWM1_CH2) +#define PWM1_CH2_PORT (GPIO_PORT_A) +#define PWM1_CH2_PIN (GPIO_PIN_09) +#define PWM1_CH2_FUNC (GPIO_FUNC_4_TIMA1_PWM2) +#endif + +#endif + +#if defined(BSP_USING_PULSE_ENCODER9) +#define PULSE_ENCODER9_CLKA_PORT (GPIO_PORT_G) +#define PULSE_ENCODER9_CLKA_PIN (GPIO_PIN_04) +#define PULSE_ENCODER9_CLKA_FUNC (GPIO_FUNC_4_TIMA9_PWM1) + +#define PULSE_ENCODER9_CLKB_PORT (GPIO_PORT_G) +#define PULSE_ENCODER9_CLKB_PIN (GPIO_PIN_05) +#define PULSE_ENCODER9_CLKB_FUNC (GPIO_FUNC_4_TIMA9_PWM2) +#endif + +/*********** USART configure *********/ +#if defined(BSP_USING_UART1) + +#define USART1_RXERR_INT_IRQn (Int001_IRQn) +#define USART1_RXERR_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) + +#define USART1_RX_INT_IRQn (Int002_IRQn) +#define USART1_RX_INT_PRIO (DDL_IRQ_PRIORITY_00) + +#define USART1_TX_INT_IRQn (Int003_IRQn) +#define USART1_TX_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) + +#if defined(RT_SERIAL_USING_DMA) +#if defined(BSP_UART1_RX_USING_DMA) +#define USART1_RXTO_TMR0_UNIT (M4_TMR0_1) +#define USART1_RXTO_TMR0_CH (TMR0_CH_A) +#define USART1_RXTO_INT_IRQn (Int004_IRQn) +#define USART1_RXTO_INT_PRIO (DDL_IRQ_PRIORITY_01) + +#define USART1_RX_DMA_UNIT (M4_DMA1) +#define USART1_RX_DMA_CH (DMA_CH0) +#define USART1_RX_DMA_INT_IRQn (Int005_IRQn) +#define USART1_RX_DMA_INT_SRC (INT_DMA1_TC0) +#define USART1_RX_DMA_INT_PRIO (DDL_IRQ_PRIORITY_01) +#endif + +#if defined(BSP_UART1_TX_USING_DMA) +#define USART1_TX_DMA_UNIT (M4_DMA2) +#define USART1_TX_DMA_CH (DMA_CH0) + +#define USART1_TC_INT_IRQn (Int006_IRQn) +#define USART1_TC_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) +#endif +#endif + +#endif + +/*********** Timer configure *********/ +#if defined(BSP_USING_TIMER5) +#define TIMER5_CNT_INT_IRQn (Int092_IRQn) +#define TIMER5_CNT_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) +#endif + +#if defined(BSP_USING_TIMER6) +#define TIMER6_CNT_INT_IRQn (Int093_IRQn) +#define TIMER6_CNT_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) +#endif + +/****** Pulse Encoder configure ******/ +#if defined(BSP_USING_PULSE_ENCODER9) +#define PULSE_ENCODER9_OVF_INT_IRQn (Int098_IRQn) +#define PULSE_ENCODER9_OVF_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) + +#define PULSE_ENCODER9_UNF_INT_IRQn (Int099_IRQn) +#define PULSE_ENCODER9_UNF_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) +#endif + +/*********** SPI configure *********/ +#if defined(BSP_SPI1_TX_USING_DMA) +#define SPI1_TX_DMA_INSTANCE (M4_DMA1) +#define SPI1_TX_DMA_CHANNEL (DMA_CH1) +#define SPI1_TX_DMA_IRQn (Int010_IRQn) +#define SPI1_TX_DMA_INT_SRC (INT_DMA1_TC1) +#define SPI1_TX_DMA_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) +#endif + +#if defined(BSP_SPI1_RX_USING_DMA) +#define SPI1_RX_DMA_INSTANCE (M4_DMA1) +#define SPI1_RX_DMA_CHANNEL (DMA_CH2) +#define SPI1_RX_DMA_IRQn (Int011_IRQn) +#define SPI1_RX_DMA_INT_SRC (INT_DMA1_TC2) +#define SPI1_RX_DMA_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) +#endif + +/*********** Pin configure *********/ +#if defined(RT_USING_PIN) + +#define EXINT0_INT_IRQn (Int016_IRQn) +#define EXINT0_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) + +#define EXINT1_INT_IRQn (Int017_IRQn) +#define EXINT1_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) + +#define EXINT2_INT_IRQn (Int018_IRQn) +#define EXINT2_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) + +#define EXINT3_INT_IRQn (Int019_IRQn) +#define EXINT3_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) + +#define EXINT4_INT_IRQn (Int020_IRQn) +#define EXINT4_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) + +#define EXINT5_INT_IRQn (Int021_IRQn) +#define EXINT5_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) + +#define EXINT6_INT_IRQn (Int022_IRQn) +#define EXINT6_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) + +#define EXINT7_INT_IRQn (Int023_IRQn) +#define EXINT7_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) + +#define EXINT8_INT_IRQn (Int024_IRQn) +#define EXINT8_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) + +#define EXINT9_INT_IRQn (Int025_IRQn) +#define EXINT9_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) + +#define EXINT10_INT_IRQn (Int026_IRQn) +#define EXINT10_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) + +#define EXINT11_INT_IRQn (Int027_IRQn) +#define EXINT11_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) + +#define EXINT12_INT_IRQn (Int028_IRQn) +#define EXINT12_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) + +#define EXINT13_INT_IRQn (Int029_IRQn) +#define EXINT13_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) + +#define EXINT14_INT_IRQn (Int030_IRQn) +#define EXINT14_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) + +#define EXINT15_INT_IRQn (Int031_IRQn) +#define EXINT15_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT) + +#endif + +#endif diff --git a/bsp/hc32f4a0/board/linker_scripts/link.icf b/bsp/hc32f4a0/board/linker_scripts/link.icf new file mode 100644 index 0000000000..3a80cf803b --- /dev/null +++ b/bsp/hc32f4a0/board/linker_scripts/link.icf @@ -0,0 +1,65 @@ +/*###ICF### Section handled by ICF editor, don't touch! ****/ +/*-Editor annotation file-*/ +/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_4.xml" */ +/*-Specials-*/ +define symbol __ICFEDIT_intvec_start__ = 0x00000000; +/*-Memory Regions-*/ +define symbol __ICFEDIT_region_IROM1_start__ = 0x00000000; +define symbol __ICFEDIT_region_IROM1_end__ = 0x001FFFFF; +define symbol __ICFEDIT_region_IROM2_start__ = 0x03000000; +define symbol __ICFEDIT_region_IROM2_end__ = 0x030017FF; +define symbol __ICFEDIT_region_EROM1_start__ = 0x0; +define symbol __ICFEDIT_region_EROM1_end__ = 0x0; +define symbol __ICFEDIT_region_EROM2_start__ = 0x0; +define symbol __ICFEDIT_region_EROM2_end__ = 0x0; +define symbol __ICFEDIT_region_EROM3_start__ = 0x0; +define symbol __ICFEDIT_region_EROM3_end__ = 0x0; +define symbol __ICFEDIT_region_IRAM1_start__ = 0x1FFE0000; +define symbol __ICFEDIT_region_IRAM1_end__ = 0x1FFFFFFF; +define symbol __ICFEDIT_region_IRAM2_start__ = 0x20000000; +define symbol __ICFEDIT_region_IRAM2_end__ = 0x2001FFFF; +define symbol __ICFEDIT_region_IRAM3_start__ = 0x20020000; +define symbol __ICFEDIT_region_IRAM3_end__ = 0x2003FFFF; +define symbol __ICFEDIT_region_IRAM4_start__ = 0x20040000; +define symbol __ICFEDIT_region_IRAM4_end__ = 0x20057FFF; +define symbol __ICFEDIT_region_IRAM5_start__ = 0x20058000; +define symbol __ICFEDIT_region_IRAM5_end__ = 0x2005FFFF; +define symbol __ICFEDIT_region_IRAM6_start__ = 0x200F0000; +define symbol __ICFEDIT_region_IRAM6_end__ = 0x200F0FFF; +define symbol __ICFEDIT_region_ERAM1_start__ = 0x0; +define symbol __ICFEDIT_region_ERAM1_end__ = 0x0; +define symbol __ICFEDIT_region_ERAM2_start__ = 0x0; +define symbol __ICFEDIT_region_ERAM2_end__ = 0x0; +define symbol __ICFEDIT_region_ERAM3_start__ = 0x0; +define symbol __ICFEDIT_region_ERAM3_end__ = 0x0; + +define symbol __ICFEDIT_region_RAM_end__ = __ICFEDIT_region_IRAM6_end__; +export symbol __ICFEDIT_region_RAM_end__; + + +/*-Sizes-*/ +define symbol __ICFEDIT_size_cstack__ = 0x2100; +define symbol __ICFEDIT_size_proc_stack__ = 0x0; +define symbol __ICFEDIT_size_heap__ = 0x2000; +/**** End of ICF editor section. ###ICF###*/ + +define memory mem with size = 4G; +define region ROM_region = mem:[from __ICFEDIT_region_IROM1_start__ to __ICFEDIT_region_IROM1_end__] + | mem:[from __ICFEDIT_region_IROM2_start__ to __ICFEDIT_region_IROM2_end__]; +define region RAM_region = mem:[from __ICFEDIT_region_IRAM1_start__ to __ICFEDIT_region_IRAM1_end__] + | mem:[from __ICFEDIT_region_IRAM2_start__ to __ICFEDIT_region_IRAM2_end__] + | mem:[from __ICFEDIT_region_IRAM3_start__ to __ICFEDIT_region_IRAM3_end__] + | mem:[from __ICFEDIT_region_IRAM4_start__ to __ICFEDIT_region_IRAM4_end__] + | mem:[from __ICFEDIT_region_IRAM5_start__ to __ICFEDIT_region_IRAM5_end__] + | mem:[from __ICFEDIT_region_IRAM6_start__ to __ICFEDIT_region_IRAM6_end__]; + +define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; +define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; + +initialize by copy { readwrite }; +do not initialize { section .noinit }; + +place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; + +place in ROM_region { readonly }; +place in RAM_region { readwrite, last block CSTACK, block HEAP }; \ No newline at end of file diff --git a/bsp/hc32f4a0/board/linker_scripts/link.lds b/bsp/hc32f4a0/board/linker_scripts/link.lds new file mode 100644 index 0000000000..af109a6da6 --- /dev/null +++ b/bsp/hc32f4a0/board/linker_scripts/link.lds @@ -0,0 +1,203 @@ + /** + ******************************************************************************* + * @file hc32f4a0_flash.lds + * @brief Linker script for HC32F4A0 Device with 2MByte FLASH, 512KByte RAM. + @verbatim + Change Logs: + Date Author Notes + 2020-09-15 Chengy First version + @endverbatim + ******************************************************************************* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved. + * + * This software component is licensed by HDSC under BSD 3-Clause license + * (the "License"); You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ******************************************************************************* + */ + +/* Use contiguous memory regions for simple. */ +MEMORY +{ + FLASH (rx): ORIGIN = 0x00000000, LENGTH = 2M + OTP (rx): ORIGIN = 0x03000000, LENGTH = 6876 + RAM (rwx): ORIGIN = 0x1FFE0000, LENGTH = 512K + RAMB (rwx): ORIGIN = 0x200F0000, LENGTH = 4K +} + +ENTRY(Reset_Handler) + +SECTIONS +{ + .vectors : + { + . = ALIGN(4); + KEEP(*(.vectors)) + . = ALIGN(4); + } >FLASH + + .icg_sec 0x00000400 : + { + KEEP(*(.icg_sec)) + } >FLASH + + .text : + { + . = ALIGN(4); + *(.text) + *(.text*) + *(.glue_7) + *(.glue_7t) + *(.eh_frame) + + KEEP(*(.init)) + KEEP(*(.fini)) + . = ALIGN(4); + } >FLASH + + .rodata : + { + . = ALIGN(4); + *(.rodata) + *(.rodata*) + . = ALIGN(4); + } >FLASH + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } >FLASH + + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } >FLASH + __exidx_end = .; + + .preinit_array : + { + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP(*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + . = ALIGN(4); + } >FLASH + + .init_array : + { + . = ALIGN(4); + /* init data */ + PROVIDE_HIDDEN (__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + . = ALIGN(4); + } >FLASH + + .fini_array : + { + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + . = ALIGN(4); + } >FLASH + + __etext = ALIGN(4); + + .otp_sec : + { + KEEP(*(.otp_sec)) + } >OTP + + .otp_lock_sec 0x03001800 : + { + KEEP(*(.otp_lock_sec)) + } >OTP + + .data : AT (__etext) + { + . = ALIGN(4); + __data_start__ = .; + *(vtable) + *(.data) + *(.data*) + . = ALIGN(4); + *(.ramfunc) + *(.ramfunc*) + . = ALIGN(4); + __data_end__ = .; + } >RAM + + __etext_ramb = __etext + ALIGN (SIZEOF(.data), 4); + .ramb_data : AT (__etext_ramb) + { + . = ALIGN(4); + __data_start_ramb__ = .; + *(.ramb_data) + *(.ramb_data*) + . = ALIGN(4); + __data_end_ramb__ = .; + } >RAMB + + .bss : + { + . = ALIGN(4); + _sbss = .; + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + . = ALIGN(4); + _ebss = .; + __bss_end__ = _ebss; + } >RAM + + .ramb_bss : + { + . = ALIGN(4); + __bss_start_ramb__ = .; + *(.ramb_bss) + *(.ramb_bss*) + . = ALIGN(4); + __bss_end_ramb__ = .; + } >RAMB + + .heap_stack (COPY) : + { + . = ALIGN(8); + __end__ = .; + PROVIDE(end = .); + PROVIDE(_end = .); + *(.heap*) + . = ALIGN(8); + __HeapLimit = .; + + __StackLimit = .; + *(.stack*) + . = ALIGN(8); + __StackTop = .; + } >RAM + + /DISCARD/ : + { + libc.a (*) + libm.a (*) + libgcc.a (*) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } + + PROVIDE(_stack = __StackTop); + PROVIDE(_Min_Heap_Size = __HeapLimit - __HeapBase); + PROVIDE(_Min_Stack_Size = __StackTop - __StackLimit); + + __RamEnd = ORIGIN(RAM) + LENGTH(RAM); + ASSERT(__StackTop <= __RamEnd, "region RAM overflowed with stack") +} diff --git a/bsp/hc32f4a0/board/linker_scripts/link.sct b/bsp/hc32f4a0/board/linker_scripts/link.sct new file mode 100644 index 0000000000..68e731802a --- /dev/null +++ b/bsp/hc32f4a0/board/linker_scripts/link.sct @@ -0,0 +1,15 @@ +; ************************************************************* +; *** Scatter-Loading Description File generated by uVision *** +; ************************************************************* + +LR_IROM1 0x00000000 0x00200000 { ; load region size_region + ER_IROM1 0x00000000 0x00200000 { ; load address = execution address + *.o (RESET, +First) + *(InRoot$$Sections) + .ANY (+RO) + } + RW_IRAM1 0x1FFE0000 0x80000 { ; RW data + .ANY (+RW +ZI) + } +} + diff --git a/bsp/hc32f4a0/drivers/SConscript b/bsp/hc32f4a0/drivers/SConscript new file mode 100644 index 0000000000..f9e0d18b7f --- /dev/null +++ b/bsp/hc32f4a0/drivers/SConscript @@ -0,0 +1,40 @@ +from building import * + +cwd = GetCurrentDir() + +# add the general drivers. +src = Split(""" +drv_irq.c +""") + +if GetDepend(['RT_USING_PIN']): + src += ['drv_gpio.c'] + +if GetDepend(['RT_USING_SERIAL']): + src += ['drv_usart.c'] + +if GetDepend(['RT_USING_I2C', 'RT_USING_I2C_BITOPS']): + src += ['drv_soft_i2c.c'] + +if GetDepend(['RT_USING_SPI']): + src += ['drv_spi.c'] + +if GetDepend(['RT_USING_QSPI']): + src += ['drv_qspi.c'] + +if GetDepend('BSP_USING_RTC'): + src += ['drv_rtc.c'] + +if GetDepend('RT_USING_HWTIMER'): + src += ['drv_hwtimer.c'] + +if GetDepend('RT_USING_PWM'): + src += ['drv_pwm.c'] + +if GetDepend('RT_USING_PULSE_ENCODER'): + src += ['drv_pulse_encoder.c'] + +CPPPATH = [cwd] +group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH) + +Return('group') diff --git a/bsp/hc32f4a0/drivers/drv_dma.h b/bsp/hc32f4a0/drivers/drv_dma.h new file mode 100644 index 0000000000..a54c69470a --- /dev/null +++ b/bsp/hc32f4a0/drivers/drv_dma.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ + +#ifndef __DRV_DMA_H__ +#define __DRV_DMA_H__ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include +#include "hc32_ddl.h" +#include "drv_irq.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct dma_config { + M4_DMA_TypeDef *Instance; + rt_uint32_t channel; + + en_event_src_t trigger_evt_src; + + struct hc32_irq_config irq_config; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* __DRV_DMA_H__ */ + diff --git a/bsp/hc32f4a0/drivers/drv_gpio.c b/bsp/hc32f4a0/drivers/drv_gpio.c new file mode 100644 index 0000000000..16846f4e2c --- /dev/null +++ b/bsp/hc32f4a0/drivers/drv_gpio.c @@ -0,0 +1,481 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ + +#include +#include "rthw.h" + +#ifdef RT_USING_PIN +#include "drv_gpio.h" +#include "drv_irq.h" + +#define GPIO_PIN_INDEX(pin) ((uint8_t)((pin) & 0x0F)) +#define GPIO_PORT(pin) ((uint8_t)(((pin) >> 4) & 0x0F)) +#define GPIO_PIN(pin) ((uint16_t)(0x01U << GPIO_PIN_INDEX(pin))) + +#define PIN_NUM(port, pin) (((((port) & 0x0F) << 4) | ((pin) & 0x0F))) +#define PIN_MAX_NUM ((GPIO_PORT_I * 16) + (__CLZ(__RBIT(GPIO_PIN_13))) + 1) + +#define ITEM_NUM(items) sizeof(items) / sizeof(items[0]) + +static void exint0_irq_handler(void); +static void exint1_irq_handler(void); +static void exint2_irq_handler(void); +static void exint3_irq_handler(void); +static void exint4_irq_handler(void); +static void exint5_irq_handler(void); +static void exint6_irq_handler(void); +static void exint7_irq_handler(void); +static void exint8_irq_handler(void); +static void exint9_irq_handler(void); +static void exint10_irq_handler(void); +static void exint11_irq_handler(void); +static void exint12_irq_handler(void); +static void exint13_irq_handler(void); +static void exint14_irq_handler(void); +static void exint15_irq_handler(void); + +struct hc32_pin_irq_map +{ + rt_uint16_t pinbit; + struct hc32_irq_config irq_config; + func_ptr_t irq_callback; +}; + +#ifndef HC32_PIN_CONFIG +#define HC32_PIN_CONFIG(pin, irq, src, irq_info) \ + { \ + .pinbit = pin, \ + .irq_callback = irq, \ + .irq_config = irq_info, \ + .irq_config.int_src = src, \ + } +#endif /* HC32_PIN_CONFIG */ + +static struct hc32_pin_irq_map pin_irq_map[] = +{ + HC32_PIN_CONFIG(GPIO_PIN_00, exint0_irq_handler, INT_PORT_EIRQ0, EXINT0_IRQ_CONFIG), + HC32_PIN_CONFIG(GPIO_PIN_01, exint1_irq_handler, INT_PORT_EIRQ1, EXINT1_IRQ_CONFIG), + HC32_PIN_CONFIG(GPIO_PIN_02, exint2_irq_handler, INT_PORT_EIRQ2, EXINT2_IRQ_CONFIG), + HC32_PIN_CONFIG(GPIO_PIN_03, exint3_irq_handler, INT_PORT_EIRQ3, EXINT3_IRQ_CONFIG), + HC32_PIN_CONFIG(GPIO_PIN_04, exint4_irq_handler, INT_PORT_EIRQ4, EXINT4_IRQ_CONFIG), + HC32_PIN_CONFIG(GPIO_PIN_05, exint5_irq_handler, INT_PORT_EIRQ5, EXINT5_IRQ_CONFIG), + HC32_PIN_CONFIG(GPIO_PIN_06, exint6_irq_handler, INT_PORT_EIRQ6, EXINT6_IRQ_CONFIG), + HC32_PIN_CONFIG(GPIO_PIN_07, exint7_irq_handler, INT_PORT_EIRQ7, EXINT7_IRQ_CONFIG), + HC32_PIN_CONFIG(GPIO_PIN_08, exint8_irq_handler, INT_PORT_EIRQ8, EXINT8_IRQ_CONFIG), + HC32_PIN_CONFIG(GPIO_PIN_09, exint9_irq_handler, INT_PORT_EIRQ9, EXINT9_IRQ_CONFIG), + HC32_PIN_CONFIG(GPIO_PIN_10, exint10_irq_handler, INT_PORT_EIRQ10, EXINT10_IRQ_CONFIG), + HC32_PIN_CONFIG(GPIO_PIN_11, exint11_irq_handler, INT_PORT_EIRQ11, EXINT11_IRQ_CONFIG), + HC32_PIN_CONFIG(GPIO_PIN_12, exint12_irq_handler, INT_PORT_EIRQ12, EXINT12_IRQ_CONFIG), + HC32_PIN_CONFIG(GPIO_PIN_13, exint13_irq_handler, INT_PORT_EIRQ13, EXINT13_IRQ_CONFIG), + HC32_PIN_CONFIG(GPIO_PIN_14, exint14_irq_handler, INT_PORT_EIRQ14, EXINT14_IRQ_CONFIG), + HC32_PIN_CONFIG(GPIO_PIN_15, exint15_irq_handler, INT_PORT_EIRQ15, EXINT15_IRQ_CONFIG), +}; + +struct rt_pin_irq_hdr pin_irq_hdr_tab[] = +{ + {-1, 0, RT_NULL, RT_NULL}, + {-1, 0, RT_NULL, RT_NULL}, + {-1, 0, RT_NULL, RT_NULL}, + {-1, 0, RT_NULL, RT_NULL}, + {-1, 0, RT_NULL, RT_NULL}, + {-1, 0, RT_NULL, RT_NULL}, + {-1, 0, RT_NULL, RT_NULL}, + {-1, 0, RT_NULL, RT_NULL}, + {-1, 0, RT_NULL, RT_NULL}, + {-1, 0, RT_NULL, RT_NULL}, + {-1, 0, RT_NULL, RT_NULL}, + {-1, 0, RT_NULL, RT_NULL}, + {-1, 0, RT_NULL, RT_NULL}, + {-1, 0, RT_NULL, RT_NULL}, + {-1, 0, RT_NULL, RT_NULL}, + {-1, 0, RT_NULL, RT_NULL}, +}; + +static void pin_irq_handler(rt_uint16_t pinbit) +{ + rt_int32_t irqindex = -1; + + if (Set == EXINT_GetExIntSrc(pinbit)) + { + EXINT_ClrExIntSrc(pinbit); + irqindex = __CLZ(__RBIT(pinbit)); + if (pin_irq_hdr_tab[irqindex].hdr) + { + pin_irq_hdr_tab[irqindex].hdr(pin_irq_hdr_tab[irqindex].args); + } + } +} + +static void exint0_irq_handler(void) +{ + rt_interrupt_enter(); + pin_irq_handler(pin_irq_map[0].pinbit); + rt_interrupt_leave(); +} + +static void exint1_irq_handler(void) +{ + rt_interrupt_enter(); + pin_irq_handler(pin_irq_map[1].pinbit); + rt_interrupt_leave(); +} + +static void exint2_irq_handler(void) +{ + rt_interrupt_enter(); + pin_irq_handler(pin_irq_map[2].pinbit); + rt_interrupt_leave(); +} + +static void exint3_irq_handler(void) +{ + rt_interrupt_enter(); + pin_irq_handler(pin_irq_map[3].pinbit); + rt_interrupt_leave(); +} + +static void exint4_irq_handler(void) +{ + rt_interrupt_enter(); + pin_irq_handler(pin_irq_map[4].pinbit); + rt_interrupt_leave(); +} + +static void exint5_irq_handler(void) +{ + rt_interrupt_enter(); + pin_irq_handler(pin_irq_map[5].pinbit); + rt_interrupt_leave(); +} + +static void exint6_irq_handler(void) +{ + rt_interrupt_enter(); + pin_irq_handler(pin_irq_map[6].pinbit); + rt_interrupt_leave(); +} + +static void exint7_irq_handler(void) +{ + rt_interrupt_enter(); + pin_irq_handler(pin_irq_map[7].pinbit); + rt_interrupt_leave(); +} + +static void exint8_irq_handler(void) +{ + rt_interrupt_enter(); + pin_irq_handler(pin_irq_map[8].pinbit); + rt_interrupt_leave(); +} + +static void exint9_irq_handler(void) +{ + rt_interrupt_enter(); + pin_irq_handler(pin_irq_map[9].pinbit); + rt_interrupt_leave(); +} + +static void exint10_irq_handler(void) +{ + rt_interrupt_enter(); + pin_irq_handler(pin_irq_map[10].pinbit); + rt_interrupt_leave(); +} + +static void exint11_irq_handler(void) +{ + rt_interrupt_enter(); + pin_irq_handler(pin_irq_map[11].pinbit); + rt_interrupt_leave(); +} + +static void exint12_irq_handler(void) +{ + rt_interrupt_enter(); + pin_irq_handler(pin_irq_map[12].pinbit); + rt_interrupt_leave(); +} + +static void exint13_irq_handler(void) +{ + rt_interrupt_enter(); + pin_irq_handler(pin_irq_map[13].pinbit); + rt_interrupt_leave(); +} + +static void exint14_irq_handler(void) +{ + rt_interrupt_enter(); + pin_irq_handler(pin_irq_map[14].pinbit); + rt_interrupt_leave(); +} + +static void exint15_irq_handler(void) +{ + rt_interrupt_enter(); + pin_irq_handler(pin_irq_map[15].pinbit); + rt_interrupt_leave(); +} + +static void hc32_pin_write(rt_device_t dev, rt_base_t pin, rt_base_t value) +{ + uint8_t gpio_port; + uint16_t gpio_pin; + + if (pin < PIN_MAX_NUM) + { + gpio_port = GPIO_PORT(pin); + gpio_pin = GPIO_PIN(pin); + if (PIN_LOW == value) + { + GPIO_ResetPins(gpio_port, gpio_pin); + } + else + { + GPIO_SetPins(gpio_port, gpio_pin); + } + } +} + +static int hc32_pin_read(rt_device_t dev, rt_base_t pin) +{ + uint8_t gpio_port; + uint16_t gpio_pin; + int value = PIN_LOW; + + if (pin < PIN_MAX_NUM) + { + gpio_port = GPIO_PORT(pin); + gpio_pin = GPIO_PIN(pin); + if (Pin_Reset == GPIO_ReadInputPins(gpio_port, gpio_pin)) + { + value = PIN_LOW; + } + else + { + value = PIN_HIGH; + } + } + + return value; +} + +static void hc32_pin_mode(rt_device_t dev, rt_base_t pin, rt_base_t mode) +{ + uint8_t gpio_port; + uint16_t gpio_pin; + stc_gpio_init_t stcGpioInit; + + if (pin >= PIN_MAX_NUM) + { + return; + } + + GPIO_StructInit(&stcGpioInit); + switch (mode) + { + case PIN_MODE_OUTPUT: + stcGpioInit.u16PinDir = PIN_DIR_OUT; + stcGpioInit.u16PinOType = PIN_OTYPE_CMOS; + break; + case PIN_MODE_INPUT: + stcGpioInit.u16PinDir = PIN_DIR_IN; + break; + case PIN_MODE_INPUT_PULLUP: + stcGpioInit.u16PinDir = PIN_DIR_IN; + stcGpioInit.u16PullUp = PIN_PU_ON; + break; + case PIN_MODE_INPUT_PULLDOWN: + stcGpioInit.u16PinDir = PIN_DIR_IN; + stcGpioInit.u16PullUp = PIN_PU_OFF; + break; + case PIN_MODE_OUTPUT_OD: + stcGpioInit.u16PinDir = PIN_DIR_OUT; + stcGpioInit.u16PinOType = PIN_OTYPE_NMOS; + break; + default: + break; + } + + gpio_port = GPIO_PORT(pin); + gpio_pin = GPIO_PIN(pin); + GPIO_Init(gpio_port, gpio_pin, &stcGpioInit); +} + +static void gpio_irq_config(uint8_t u8Port, uint16_t u16Pin, uint16_t u16ExInt) +{ + __IO uint16_t *PCRx; + uint16_t pin_num; + + pin_num = __CLZ(__RBIT(u16Pin)); + PCRx = (__IO uint16_t *)((uint32_t)(&M4_GPIO->PCRA0) + ((uint32_t)u8Port * 0x40UL) + (pin_num * 4UL)); + MODIFY_REG16(*PCRx, GPIO_PCR_INTE, u16ExInt); +} + +static rt_err_t hc32_pin_attach_irq(struct rt_device *device, rt_int32_t pin, + rt_uint32_t mode, void (*hdr)(void *args), void *args) +{ + rt_base_t level; + rt_int32_t irqindex = -1; + + if (pin >= PIN_MAX_NUM) + { + return -RT_ENOSYS; + } + + irqindex = GPIO_PIN_INDEX(pin); + if (irqindex >= ITEM_NUM(pin_irq_map)) + { + return RT_ENOSYS; + } + + level = rt_hw_interrupt_disable(); + if (pin_irq_hdr_tab[irqindex].pin == pin && + pin_irq_hdr_tab[irqindex].hdr == hdr && + pin_irq_hdr_tab[irqindex].mode == mode && + pin_irq_hdr_tab[irqindex].args == args) + { + rt_hw_interrupt_enable(level); + return RT_EOK; + } + if (pin_irq_hdr_tab[irqindex].pin != -1) + { + rt_hw_interrupt_enable(level); + return RT_EBUSY; + } + pin_irq_hdr_tab[irqindex].pin = pin; + pin_irq_hdr_tab[irqindex].hdr = hdr; + pin_irq_hdr_tab[irqindex].mode = mode; + pin_irq_hdr_tab[irqindex].args = args; + rt_hw_interrupt_enable(level); + + return RT_EOK; +} + +static rt_err_t hc32_pin_detach_irq(struct rt_device *device, rt_int32_t pin) +{ + rt_base_t level; + rt_int32_t irqindex = -1; + + if (pin >= PIN_MAX_NUM) + { + return -RT_ENOSYS; + } + + irqindex = GPIO_PIN_INDEX(pin); + if (irqindex >= ITEM_NUM(pin_irq_map)) + { + return RT_ENOSYS; + } + + level = rt_hw_interrupt_disable(); + if (pin_irq_hdr_tab[irqindex].pin == -1) + { + rt_hw_interrupt_enable(level); + return RT_EOK; + } + pin_irq_hdr_tab[irqindex].pin = -1; + pin_irq_hdr_tab[irqindex].hdr = RT_NULL; + pin_irq_hdr_tab[irqindex].mode = 0; + pin_irq_hdr_tab[irqindex].args = RT_NULL; + rt_hw_interrupt_enable(level); + + return RT_EOK; +} + +static rt_err_t hc32_pin_irq_enable(struct rt_device *device, rt_base_t pin, rt_uint32_t enabled) + +{ + struct hc32_pin_irq_map *irq_map; + rt_base_t level; + rt_int32_t irqindex = -1; + uint16_t gpio_pin; + stc_exint_init_t stcExintInit; + + if ((pin >= PIN_MAX_NUM) || ((PIN_IRQ_ENABLE != enabled) && (PIN_IRQ_DISABLE != enabled))) + { + return -RT_ENOSYS; + } + + irqindex = GPIO_PIN_INDEX(pin); + if (irqindex >= ITEM_NUM(pin_irq_map)) + { + return RT_ENOSYS; + } + + irq_map = &pin_irq_map[irqindex]; + gpio_pin = GPIO_PIN(pin); + if (enabled == PIN_IRQ_ENABLE) + { + level = rt_hw_interrupt_disable(); + if (pin_irq_hdr_tab[irqindex].pin == -1) + { + rt_hw_interrupt_enable(level); + return RT_ENOSYS; + } + + /* Exint config */ + EXINT_StructInit(&stcExintInit); + switch (pin_irq_hdr_tab[irqindex].mode) + { + case PIN_IRQ_MODE_RISING: + stcExintInit.u32ExIntLvl = EXINT_TRIGGER_RISING; + break; + case PIN_IRQ_MODE_FALLING: + stcExintInit.u32ExIntLvl = EXINT_TRIGGER_FALLING; + break; + case PIN_IRQ_MODE_RISING_FALLING: + stcExintInit.u32ExIntLvl = EXINT_TRIGGER_BOTH; + break; + case PIN_IRQ_MODE_LOW_LEVEL: + stcExintInit.u32ExIntLvl = EXINT_TRIGGER_LOW; + break; + } + stcExintInit.u32ExIntCh = gpio_pin; + stcExintInit.u32ExIntFAE = EXINT_FILTER_A_ON; + stcExintInit.u32ExIntFAClk = EXINT_FACLK_HCLK_DIV8; + EXINT_Init(&stcExintInit); + /* IRQ sign-in */ + hc32_install_irq_handler(&irq_map->irq_config, irq_map->irq_callback, RT_FALSE); + NVIC_EnableIRQ(irq_map->irq_config.irq); + gpio_irq_config(GPIO_PORT(pin), gpio_pin, PIN_EXINT_ON); + + rt_hw_interrupt_enable(level); + } + else + { + level = rt_hw_interrupt_disable(); + gpio_irq_config(GPIO_PORT(pin), gpio_pin, PIN_EXINT_OFF); + NVIC_DisableIRQ(irq_map->irq_config.irq); + + rt_hw_interrupt_enable(level); + } + + return RT_EOK; +} + +static const struct rt_pin_ops pin_ops = +{ + hc32_pin_mode, + hc32_pin_write, + hc32_pin_read, + hc32_pin_attach_irq, + hc32_pin_detach_irq, + hc32_pin_irq_enable, +}; + +int rt_hw_pin_init(void) +{ + return rt_device_pin_register("pin", &pin_ops, RT_NULL); +} +INIT_BOARD_EXPORT(rt_hw_pin_init); + +#endif /* RT_USING_PIN */ diff --git a/bsp/hc32f4a0/drivers/drv_gpio.h b/bsp/hc32f4a0/drivers/drv_gpio.h new file mode 100644 index 0000000000..359e8f7765 --- /dev/null +++ b/bsp/hc32f4a0/drivers/drv_gpio.h @@ -0,0 +1,152 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ + +#ifndef __DRV_GPIO_H__ +#define __DRV_GPIO_H__ + +#include +#include "board_config.h" + +#ifdef RT_USING_PIN + +#define __HC_PORT(port) GPIO_PORT_##port +#define GET_PIN(PORT, PIN) (((rt_uint16_t)__HC_PORT(PORT) * 16) + PIN) + +#ifndef EXINT0_IRQ_CONFIG +#define EXINT0_IRQ_CONFIG \ + { \ + .irq = EXINT0_INT_IRQn, \ + .irq_prio = EXINT0_INT_PRIO, \ + } +#endif /* EXINT1_IRQ_CONFIG */ + +#ifndef EXINT1_IRQ_CONFIG +#define EXINT1_IRQ_CONFIG \ + { \ + .irq = EXINT1_INT_IRQn, \ + .irq_prio = EXINT1_INT_PRIO, \ + } +#endif /* EXINT1_IRQ_CONFIG */ + +#ifndef EXINT2_IRQ_CONFIG +#define EXINT2_IRQ_CONFIG \ + { \ + .irq = EXINT2_INT_IRQn, \ + .irq_prio = EXINT2_INT_PRIO, \ + } +#endif /* EXINT2_IRQ_CONFIG */ + +#ifndef EXINT3_IRQ_CONFIG +#define EXINT3_IRQ_CONFIG \ + { \ + .irq = EXINT3_INT_IRQn, \ + .irq_prio = EXINT3_INT_PRIO, \ + } +#endif /* EXINT3_IRQ_CONFIG */ + +#ifndef EXINT4_IRQ_CONFIG +#define EXINT4_IRQ_CONFIG \ + { \ + .irq = EXINT4_INT_IRQn, \ + .irq_prio = EXINT4_INT_PRIO, \ + } +#endif /* EXINT4_IRQ_CONFIG */ + +#ifndef EXINT5_IRQ_CONFIG +#define EXINT5_IRQ_CONFIG \ + { \ + .irq = EXINT5_INT_IRQn, \ + .irq_prio = EXINT5_INT_PRIO, \ + } +#endif /* EXINT5_IRQ_CONFIG */ + +#ifndef EXINT6_IRQ_CONFIG +#define EXINT6_IRQ_CONFIG \ + { \ + .irq = EXINT6_INT_IRQn, \ + .irq_prio = EXINT6_INT_PRIO, \ + } +#endif /* EXINT6_IRQ_CONFIG */ + +#ifndef EXINT7_IRQ_CONFIG +#define EXINT7_IRQ_CONFIG \ + { \ + .irq = EXINT7_INT_IRQn, \ + .irq_prio = EXINT7_INT_PRIO, \ + } +#endif /* EXINT7_IRQ_CONFIG */ + +#ifndef EXINT8_IRQ_CONFIG +#define EXINT8_IRQ_CONFIG \ + { \ + .irq = EXINT8_INT_IRQn, \ + .irq_prio = EXINT8_INT_PRIO, \ + } +#endif /* EXINT8_IRQ_CONFIG */ + +#ifndef EXINT9_IRQ_CONFIG +#define EXINT9_IRQ_CONFIG \ + { \ + .irq = EXINT9_INT_IRQn, \ + .irq_prio = EXINT9_INT_PRIO, \ + } +#endif /* EXINT9_IRQ_CONFIG */ + +#ifndef EXINT10_IRQ_CONFIG +#define EXINT10_IRQ_CONFIG \ + { \ + .irq = EXINT10_INT_IRQn, \ + .irq_prio = EXINT10_INT_PRIO, \ + } +#endif /* EXINT10_IRQ_CONFIG */ + +#ifndef EXINT11_IRQ_CONFIG +#define EXINT11_IRQ_CONFIG \ + { \ + .irq = EXINT11_INT_IRQn, \ + .irq_prio = EXINT11_INT_PRIO, \ + } +#endif /* EXINT11_IRQ_CONFIG */ + +#ifndef EXINT12_IRQ_CONFIG +#define EXINT12_IRQ_CONFIG \ + { \ + .irq = EXINT12_INT_IRQn, \ + .irq_prio = EXINT12_INT_PRIO, \ + } +#endif /* EXINT12_IRQ_CONFIG */ + +#ifndef EXINT13_IRQ_CONFIG +#define EXINT13_IRQ_CONFIG \ + { \ + .irq = EXINT13_INT_IRQn, \ + .irq_prio = EXINT13_INT_PRIO, \ + } +#endif /* EXINT13_IRQ_CONFIG */ + +#ifndef EXINT14_IRQ_CONFIG +#define EXINT14_IRQ_CONFIG \ + { \ + .irq = EXINT14_INT_IRQn, \ + .irq_prio = EXINT14_INT_PRIO, \ + } +#endif /* EXINT14_IRQ_CONFIG */ + +#ifndef EXINT15_IRQ_CONFIG +#define EXINT15_IRQ_CONFIG \ + { \ + .irq = EXINT15_INT_IRQn, \ + .irq_prio = EXINT15_INT_PRIO, \ + } +#endif /* EXINT15_IRQ_CONFIG */ + +#endif + +#endif /* __DRV_GPIO_H__ */ diff --git a/bsp/hc32f4a0/drivers/drv_hwtimer.c b/bsp/hc32f4a0/drivers/drv_hwtimer.c new file mode 100644 index 0000000000..cc6a1ba945 --- /dev/null +++ b/bsp/hc32f4a0/drivers/drv_hwtimer.c @@ -0,0 +1,551 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ + +#include +#include + +#ifdef RT_USING_HWTIMER + +#if !defined(BSP_USING_TIMER1) && !defined(BSP_USING_TIMER2) && !defined(BSP_USING_TIMER3) && \ + !defined(BSP_USING_TIMER4) && !defined(BSP_USING_TIMER5) && !defined(BSP_USING_TIMER6) && \ + !defined(BSP_USING_TIMER7) && !defined(BSP_USING_TIMER8) && !defined(BSP_USING_TIMER9) && \ + !defined(BSP_USING_TIMER10) && !defined(BSP_USING_TIMER11) && !defined(BSP_USING_TIMER12) +#error "Please define at least one BSP_USING_TIMERx" +/* this driver can be disabled at menuconfig -> Hardware Drivers Config -> On-chip Peripheral Drivers -> Enable TIMER */ +#endif + +#include "drv_hwtimer.h" +#include "drv_irq.h" + +enum +{ +#ifdef BSP_USING_TIMER1 + TIMER1_INDEX, +#endif +#ifdef BSP_USING_TIMER2 + TIMER2_INDEX, +#endif +#ifdef BSP_USING_TIMER3 + TIMER3_INDEX, +#endif +#ifdef BSP_USING_TIMER4 + TIMER4_INDEX, +#endif +#ifdef BSP_USING_TIMER5 + TIMER5_INDEX, +#endif +#ifdef BSP_USING_TIMER6 + TIMER6_INDEX, +#endif +#ifdef BSP_USING_TIMER7 + TIMER7_INDEX, +#endif +#ifdef BSP_USING_TIMER8 + TIMER8_INDEX, +#endif +#ifdef BSP_USING_TIMER9 + TIMER9_INDEX, +#endif +#ifdef BSP_USING_TIMER10 + TIMER10_INDEX, +#endif +#ifdef BSP_USING_TIMER11 + TIMER11_INDEX, +#endif +#ifdef BSP_USING_TIMER12 + TIMER12_INDEX, +#endif +}; + +#ifdef BSP_USING_TIMER1 +static void timer1_irq_handler(void); +#endif +#ifdef BSP_USING_TIMER2 +static void timer2_irq_handler(void); +#endif +#ifdef BSP_USING_TIMER3 +static void timer3_irq_handler(void); +#endif +#ifdef BSP_USING_TIMER4 +static void timer4_irq_handler(void); +#endif +#ifdef BSP_USING_TIMER5 +static void timer5_irq_handler(void); +#endif +#ifdef BSP_USING_TIMER6 +static void timer6_irq_handler(void); +#endif +#ifdef BSP_USING_TIMER7 +static void timer7_irq_handler(void); +#endif +#ifdef BSP_USING_TIMER8 +static void timer8_irq_handler(void); +#endif +#ifdef BSP_USING_TIMER9 +static void timer9_irq_handler(void); +#endif +#ifdef BSP_USING_TIMER10 +static void timer10_irq_handler(void); +#endif +#ifdef BSP_USING_TIMER11 +static void timer11_irq_handler(void); +#endif +#ifdef BSP_USING_TIMER12 +static void timer12_irq_handler(void); +#endif + +struct hc32_hwtimer_config +{ + rt_hwtimer_t time_device; + M4_TMRA_TypeDef *timer_periph; + struct hc32_irq_config irq_config; + func_ptr_t irq_callback; + uint32_t extend_div; + uint32_t extend_cnt; + char *name; +}; + +#ifndef HC32_TIMER_CONFIG +#define HC32_TIMER_CONFIG(periph, irq, label, src, irq_info) \ + { \ + .timer_periph = periph, \ + .irq_callback = irq, \ + .name = label, \ + .irq_config = irq_info, \ + .irq_config.int_src = src, \ + } +#endif /* HC32_TIMER_CONFIG */ + +static struct hc32_hwtimer_config hwtimer_obj[] = +{ +#ifdef BSP_USING_TIMER1 + HC32_TIMER_CONFIG(M4_TMRA_1, timer1_irq_handler, "timer1", INT_TMRA_1_OVF, TIMER1_IRQ_CONFIG), +#endif +#ifdef BSP_USING_TIMER2 + HC32_TIMER_CONFIG(M4_TMRA_2, timer2_irq_handler, "timer2", INT_TMRA_2_OVF, TIMER2_IRQ_CONFIG), +#endif +#ifdef BSP_USING_TIMER3 + HC32_TIMER_CONFIG(M4_TMRA_3, timer3_irq_handler, "timer3", INT_TMRA_3_OVF, TIMER3_IRQ_CONFIG), +#endif +#ifdef BSP_USING_TIMER4 + HC32_TIMER_CONFIG(M4_TMRA_4, timer4_irq_handler, "timer4", INT_TMRA_4_OVF, TIMER4_IRQ_CONFIG), +#endif +#ifdef BSP_USING_TIMER5 + HC32_TIMER_CONFIG(M4_TMRA_5, timer5_irq_handler, "timer5", INT_TMRA_5_OVF, TIMER5_IRQ_CONFIG), +#endif +#ifdef BSP_USING_TIMER6 + HC32_TIMER_CONFIG(M4_TMRA_6, timer6_irq_handler, "timer6", INT_TMRA_6_OVF, TIMER6_IRQ_CONFIG), +#endif +#ifdef BSP_USING_TIMER7 + HC32_TIMER_CONFIG(M4_TMRA_7, timer7_irq_handler, "timer7", INT_TMRA_7_OVF, TIMER7_IRQ_CONFIG), +#endif +#ifdef BSP_USING_TIMER8 + HC32_TIMER_CONFIG(M4_TMRA_8, timer8_irq_handler, "timer8", INT_TMRA_8_OVF, TIMER8_IRQ_CONFIG), +#endif +#ifdef BSP_USING_TIMER9 + HC32_TIMER_CONFIG(M4_TMRA_9, timer9_irq_handler, "timer9", INT_TMRA_9_OVF, TIMER9_IRQ_CONFIG), +#endif +#ifdef BSP_USING_TIMER10 + HC32_TIMER_CONFIG(M4_TMRA_10, timer10_irq_handler, "timer10", INT_TMRA_10_OVF, TIMER10_IRQ_CONFIG), +#endif +#ifdef BSP_USING_TIMER11 + HC32_TIMER_CONFIG(M4_TMRA_11, timer11_irq_handler, "timer11", INT_TMRA_11_OVF, TIMER11_IRQ_CONFIG), +#endif +#ifdef BSP_USING_TIMER12 + HC32_TIMER_CONFIG(M4_TMRA_12, timer12_irq_handler, "timer12", INT_TMRA_12_OVF, TIMER12_IRQ_CONFIG), +#endif +}; + +static void hc32_timer_irq_handler(struct hc32_hwtimer_config *timer_config) +{ + if ((++timer_config->extend_cnt) >= timer_config->extend_div) + { + timer_config->extend_cnt = 0; + rt_device_hwtimer_isr(&timer_config->time_device); + } + TMRA_ClrStatus(timer_config->timer_periph, (TMRA_FLAG_OVF | TMRA_FLAG_UNF)); +} + +#ifdef BSP_USING_TIMER1 +static void timer1_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_timer_irq_handler(&hwtimer_obj[TIMER1_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_TIMER2 +static void timer2_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_timer_irq_handler(&hwtimer_obj[TIMER2_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_TIMER3 +static void timer3_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_timer_irq_handler(&hwtimer_obj[TIMER3_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_TIMER4 +static void timer4_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_timer_irq_handler(&hwtimer_obj[TIMER4_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_TIMER5 +static void timer5_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_timer_irq_handler(&hwtimer_obj[TIMER5_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_TIMER6 +static void timer6_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_timer_irq_handler(&hwtimer_obj[TIMER6_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_TIMER7 +static void timer7_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_timer_irq_handler(&hwtimer_obj[TIMER7_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_TIMER8 +static void timer8_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_timer_irq_handler(&hwtimer_obj[TIMER8_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_TIMER9 +static void timer9_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_timer_irq_handler(&hwtimer_obj[TIMER9_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_TIMER10 +static void timer10_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_timer_irq_handler(&hwtimer_obj[TIMER10_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_TIMER11 +static void timer11_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_timer_irq_handler(&hwtimer_obj[TIMER11_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_TIMER12 +static void timer12_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_timer_irq_handler(&hwtimer_obj[TIMER12_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +static rt_uint16_t hc32_timer_get_unit_number(M4_TMRA_TypeDef *TMRAx) +{ + rt_uint16_t unit_num; + const rt_uint32_t unit_step = 0x400U; + + if (((rt_uint32_t)TMRAx) >= ((rt_uint32_t)M4_TMRA_1)) + { + unit_num = (((rt_uint32_t)TMRAx) - ((rt_uint32_t)M4_TMRA_1)) / unit_step; + } + else + { + unit_num = (((rt_uint32_t)TMRAx) - ((rt_uint32_t)M4_TMRA_5)) / unit_step + 4; + } + + return unit_num; +} + +static void hc32_timer_clock_config(M4_TMRA_TypeDef *TMRAx, en_functional_state_t enNewState) +{ + rt_uint32_t timer_periph; + rt_uint16_t unit_num; + + unit_num = hc32_timer_get_unit_number(TMRAx); + timer_periph = PWC_FCG2_TMRA_1 << unit_num; + PWC_Fcg2PeriphClockCmd(timer_periph, enNewState); +} + +static void hc32_timer_get_div_value(M4_TMRA_TypeDef *TMRAx, uint32_t freq, uint16_t *div, uint32_t *extend_div) +{ + stc_clk_freq_t stcClkFreq; + rt_uint32_t divisor, remainder; + rt_uint16_t div_val; + rt_uint32_t clk_freq; + rt_uint16_t unit_num; + + CLK_GetClockFreq(&stcClkFreq); + unit_num = hc32_timer_get_unit_number(TMRAx); + if (unit_num >= 4) + { + clk_freq = stcClkFreq.pclk1Freq; + } + else + { + clk_freq = stcClkFreq.pclk0Freq; + } + divisor = clk_freq / freq; + remainder = clk_freq % freq; + for (div_val=1; div_val<=1024; div_val<<=1) + { + if (((divisor % 2) == 0) && (remainder == 0)) + { + remainder = divisor % 2; + divisor = divisor / 2; + } + else + { + break; + } + } + *extend_div = divisor; + *div = (__CLZ(__RBIT(div_val))) << TMRA_BCSTR_CKDIV_POS; +} + +static void hc32_timer_interrupt_config(struct rt_hwtimer_device *timer, en_functional_state_t enNewState) +{ + struct hc32_hwtimer_config *timer_config = RT_NULL; + + timer_config = (struct hc32_hwtimer_config *)timer; + if (INT_MAX == timer_config->irq_config.int_src) + { + LOG_D("%s interrupt init failed", timer_config->name); + return; + } + + if (Enable == enNewState) + { + /* Enable the specified interrupts of Timer */ + hc32_install_irq_handler(&timer_config->irq_config, timer_config->irq_callback, RT_FALSE); + NVIC_EnableIRQ(timer_config->irq_config.irq); + TMRA_IntCmd(timer_config->timer_periph, TMRA_INT_OVF, Enable); + } + else + { + /* Disable the specified interrupts of Timer */ + TMRA_IntCmd(timer_config->timer_periph, TMRA_INT_OVF, Disable); + NVIC_DisableIRQ(timer_config->irq_config.irq); + } +} + +static void hc32_timer_init(struct rt_hwtimer_device *timer, rt_uint32_t state) +{ + stc_tmra_init_t stcTmraInit; + struct hc32_hwtimer_config *timer_config = RT_NULL; + + RT_ASSERT(timer != RT_NULL); + timer_config = (struct hc32_hwtimer_config *)timer; + if (state) + { + /* Enable Timer peripheral clock. */ + hc32_timer_clock_config(timer_config->timer_periph, Enable); + TMRA_DeInit(timer_config->timer_periph); + TMRA_StructInit(&stcTmraInit); + stcTmraInit.u32CntDir = TMRA_DIR_UP; + TMRA_Init(timer_config->timer_periph, &stcTmraInit); + LOG_D("%s init success", timer_config->name); + } + else + { + TMRA_DeInit(timer_config->timer_periph); + hc32_timer_interrupt_config(timer, Disable); + /* Disable Timer peripheral clock. */ + hc32_timer_clock_config(timer_config->timer_periph, Disable); + } +} + +static rt_err_t hc32_timer_start(struct rt_hwtimer_device *timer, rt_uint32_t cnt, rt_hwtimer_mode_t mode) +{ + rt_err_t result = RT_EOK; + struct hc32_hwtimer_config *timer_config = RT_NULL; + + RT_ASSERT(timer != RT_NULL); + timer_config = (struct hc32_hwtimer_config *)timer; + if (mode == HWTIMER_MODE_ONESHOT) + { + TMRA_SetOvfOperation(timer_config->timer_periph, TMRA_OVF_CNT_STOP); + } + else + { + TMRA_SetOvfOperation(timer_config->timer_periph, TMRA_OVF_CNT_CONTINUE); + } + timer_config->extend_cnt = 0; + TMRA_SetCntVal(timer_config->timer_periph, 0); + TMRA_SetPeriodVal(timer_config->timer_periph, cnt - 1); + hc32_timer_interrupt_config(timer, Enable); + TMRA_Start(timer_config->timer_periph); + + return result; +} + +static void hc32_timer_stop(struct rt_hwtimer_device *timer) +{ + struct hc32_hwtimer_config *timer_config = RT_NULL; + + RT_ASSERT(timer != RT_NULL); + timer_config = (struct hc32_hwtimer_config *)timer; + /* stop timer */ + TMRA_Stop(timer_config->timer_periph); + hc32_timer_interrupt_config(timer, Disable); + TMRA_SetCntVal(timer_config->timer_periph, 0); +} + +static rt_uint32_t hc32_timer_get_counter(struct rt_hwtimer_device *timer) +{ + rt_uint32_t count_val; + rt_uint32_t period_val; + float temp; + struct hc32_hwtimer_config *timer_config = RT_NULL; + + RT_ASSERT(timer != RT_NULL); + timer_config = (struct hc32_hwtimer_config *)timer; + period_val = TMRA_GetPeriodVal(timer_config->timer_periph); + count_val = TMRA_GetCntVal(timer_config->timer_periph); + temp = (timer_config->extend_cnt * period_val + count_val); + temp = temp / (timer_config->extend_div * period_val) * period_val; + count_val = (rt_uint32_t)temp; + + return count_val; +} + +static rt_err_t hc32_timer_ctrl(struct rt_hwtimer_device *timer, rt_uint32_t cmd, void *args) +{ + struct hc32_hwtimer_config *timer_config = RT_NULL; + rt_err_t result = RT_EOK; + + RT_ASSERT(timer != RT_NULL); + RT_ASSERT(args != RT_NULL); + timer_config = (struct hc32_hwtimer_config *)timer; + switch (cmd) + { + case HWTIMER_CTRL_FREQ_SET: + { + rt_uint32_t freq; + rt_uint16_t div_val; + rt_uint32_t extend_div_val; + + /* set timer frequency */ + freq = *((rt_uint32_t *)args); + hc32_timer_get_div_value(timer_config->timer_periph, freq, &div_val, &extend_div_val); + TMRA_SetPCLKDiv(timer_config->timer_periph, div_val); + timer_config->extend_div = extend_div_val; + } + break; + default: + { + result = -RT_ENOSYS; + } + break; + } + + return result; +} + +static const struct rt_hwtimer_ops hwtimer_ops = +{ + .init = hc32_timer_init, + .start = hc32_timer_start, + .stop = hc32_timer_stop, + .count_get = hc32_timer_get_counter, + .control = hc32_timer_ctrl, +}; + +static const struct rt_hwtimer_info hwtimer_info = +{ + .maxfreq = 30000000, + .minfreq = 1000, + .maxcnt = 0xFFFF, + .cntmode = HWTIMER_CNTMODE_UP, +}; + +static int rt_hwtimer_init(void) +{ + int i = 0; + int result = RT_EOK; + + for (i = 0; i < sizeof(hwtimer_obj) / sizeof(hwtimer_obj[0]); i++) + { + hwtimer_obj[i].time_device.info = &hwtimer_info; + hwtimer_obj[i].time_device.ops = &hwtimer_ops; + if (rt_device_hwtimer_register(&hwtimer_obj[i].time_device, hwtimer_obj[i].name, hwtimer_obj[i].timer_periph) == RT_EOK) + { + LOG_D("%s register success", hwtimer_obj[i].name); + } + else + { + LOG_E("%s register failed", hwtimer_obj[i].name); + result = -RT_ERROR; + } + } + + return result; +} +INIT_BOARD_EXPORT(rt_hwtimer_init); + +#endif /* RT_USING_HWTIMER */ diff --git a/bsp/hc32f4a0/drivers/drv_hwtimer.h b/bsp/hc32f4a0/drivers/drv_hwtimer.h new file mode 100644 index 0000000000..730c3ad447 --- /dev/null +++ b/bsp/hc32f4a0/drivers/drv_hwtimer.h @@ -0,0 +1,145 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ + +#ifndef __DRV_HWTIMER_H__ +#define __DRV_HWTIMER_H__ + +#include +#include "board_config.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef BSP_USING_TIMER1 +#ifndef TIMER1_IRQ_CONFIG +#define TIMER1_IRQ_CONFIG \ + { \ + .irq = TIMER1_CNT_INT_IRQn, \ + .irq_prio = TIMER1_CNT_INT_PRIO, \ + } +#endif /* TIMER1_IRQ_CONFIG */ +#endif /* BSP_USING_TIMER1 */ + +#ifdef BSP_USING_TIMER2 +#ifndef TIMER2_IRQ_CONFIG +#define TIMER2_IRQ_CONFIG \ + { \ + .irq = TIMER2_CNT_INT_IRQn, \ + .irq_prio = TIMER2_CNT_INT_PRIO, \ + } +#endif /* TIMER2_IRQ_CONFIG */ +#endif /* BSP_USING_TIMER2 */ + +#ifdef BSP_USING_TIMER3 +#ifndef TIMER3_IRQ_CONFIG +#define TIMER3_IRQ_CONFIG \ + { \ + .irq = TIMER3_CNT_INT_IRQn, \ + .irq_prio = TIMER3_CNT_INT_PRIO, \ + } +#endif /* TIMER3_IRQ_CONFIG */ +#endif /* BSP_USING_TIMER3 */ + +#ifdef BSP_USING_TIMER4 +#ifndef TIMER4_IRQ_CONFIG +#define TIMER4_IRQ_CONFIG \ + { \ + .irq = TIMER4_CNT_INT_IRQn, \ + .irq_prio = TIMER4_CNT_INT_PRIO, \ + } +#endif /* TIMER4_IRQ_CONFIG */ +#endif /* BSP_USING_TIMER4 */ + +#ifdef BSP_USING_TIMER5 +#ifndef TIMER5_IRQ_CONFIG +#define TIMER5_IRQ_CONFIG \ + { \ + .irq = TIMER5_CNT_INT_IRQn, \ + .irq_prio = TIMER5_CNT_INT_PRIO, \ + } +#endif /* TIMER5_IRQ_CONFIG */ +#endif /* BSP_USING_TIMER5 */ + +#ifdef BSP_USING_TIMER6 +#ifndef TIMER6_IRQ_CONFIG +#define TIMER6_IRQ_CONFIG \ + { \ + .irq = TIMER6_CNT_INT_IRQn, \ + .irq_prio = TIMER6_CNT_INT_PRIO, \ + } +#endif /* TIMER6_IRQ_CONFIG */ +#endif /* BSP_USING_TIMER6 */ + +#ifdef BSP_USING_TIMER7 +#ifndef TIMER7_IRQ_CONFIG +#define TIMER7_IRQ_CONFIG \ + { \ + .irq = TIMER7_CNT_INT_IRQn, \ + .irq_prio = TIMER7_CNT_INT_PRIO, \ + } +#endif /* TIMER7_IRQ_CONFIG */ +#endif /* BSP_USING_TIMER7 */ + +#ifdef BSP_USING_TIMER8 +#ifndef TIMER8_IRQ_CONFIG +#define TIMER8_IRQ_CONFIG \ + { \ + .irq = TIMER8_CNT_INT_IRQn, \ + .irq_prio = TIMER8_CNT_INT_PRIO, \ + } +#endif /* TIMER8_IRQ_CONFIG */ +#endif /* BSP_USING_TIMER8 */ + +#ifdef BSP_USING_TIMER9 +#ifndef TIMER9_IRQ_CONFIG +#define TIMER9_IRQ_CONFIG \ + { \ + .irq = TIMER9_CNT_INT_IRQn, \ + .irq_prio = TIMER9_CNT_INT_PRIO, \ + } +#endif /* TIMER9_IRQ_CONFIG */ +#endif /* BSP_USING_TIMER9 */ + +#ifdef BSP_USING_TIMER10 +#ifndef TIMER10_IRQ_CONFIG +#define TIMER10_IRQ_CONFIG \ + { \ + .irq = TIMER10_CNT_INT_IRQn, \ + .irq_prio = TIMER10_CNT_INT_PRIO, \ + } +#endif /* TIMER10_IRQ_CONFIG */ +#endif /* BSP_USING_TIMER10 */ + +#ifdef BSP_USING_TIMER11 +#ifndef TIMER11_IRQ_CONFIG +#define TIMER11_IRQ_CONFIG \ + { \ + .irq = TIMER11_CNT_INT_IRQn, \ + .irq_prio = TIMER11_CNT_INT_PRIO, \ + } +#endif /* TIMER11_IRQ_CONFIG */ +#endif /* BSP_USING_TIMER11 */ + +#ifdef BSP_USING_TIMER12 +#ifndef TIMER12_IRQ_CONFIG +#define TIMER12_IRQ_CONFIG \ + { \ + .irq = TIMER12_CNT_INT_IRQn, \ + .irq_prio = TIMER12_CNT_INT_PRIO, \ + } +#endif /* TIMER12_IRQ_CONFIG */ +#endif /* BSP_USING_TIMER12 */ + +#ifdef __cplusplus +} +#endif + +#endif /* __DRV_HWTIMER_H__ */ diff --git a/bsp/hc32f4a0/drivers/drv_irq.c b/bsp/hc32f4a0/drivers/drv_irq.c new file mode 100644 index 0000000000..661cbe6fcb --- /dev/null +++ b/bsp/hc32f4a0/drivers/drv_irq.c @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ + + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include + +#include "drv_irq.h" + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +rt_err_t hc32_install_irq_handler(struct hc32_irq_config *irq_config, + void (*irq_hdr)(void), + rt_bool_t irq_enable) +{ + rt_err_t result = -RT_ERROR; + stc_irq_signin_config_t irq_signin; + + RT_ASSERT(RT_NULL != irq_config); + RT_ASSERT(RT_NULL != irq_hdr); + + irq_signin.enIRQn = irq_config->irq; + irq_signin.enIntSrc = irq_config->int_src; + irq_signin.pfnCallback= irq_hdr; + if (Ok == INTC_IrqSignIn(&irq_signin)) + { + NVIC_ClearPendingIRQ(irq_signin.enIRQn); + NVIC_SetPriority(irq_signin.enIRQn, irq_config->irq_prio); + + if (RT_TRUE == irq_enable) + { + NVIC_EnableIRQ(irq_signin.enIRQn); + } + else + { + NVIC_DisableIRQ(irq_signin.enIRQn); + } + + result = RT_EOK; + } + + RT_ASSERT(RT_EOK == result); + + return result; +} + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/drivers/drv_irq.h b/bsp/hc32f4a0/drivers/drv_irq.h new file mode 100644 index 0000000000..8beb17868f --- /dev/null +++ b/bsp/hc32f4a0/drivers/drv_irq.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ + +#ifndef __DRV_IRQ_H__ +#define __DRV_IRQ_H__ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include +#include "hc32_ddl.h" + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +struct hc32_irq_config +{ + IRQn_Type irq; + uint32_t irq_prio; + en_int_src_t int_src; +}; + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + * Global function prototypes (definition in C source) + ******************************************************************************/ +rt_err_t hc32_install_irq_handler(struct hc32_irq_config *irq_config, + void (*irq_hdr)(void), + rt_bool_t irq_enable); + +#ifdef __cplusplus +} +#endif + +#endif /* __DRV_IRQ_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/drivers/drv_pulse_encoder.c b/bsp/hc32f4a0/drivers/drv_pulse_encoder.c new file mode 100644 index 0000000000..ee68f5e808 --- /dev/null +++ b/bsp/hc32f4a0/drivers/drv_pulse_encoder.c @@ -0,0 +1,471 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ + +#include +#include + +#ifdef RT_USING_PULSE_ENCODER + +#if !defined(BSP_USING_PULSE_ENCODER1) && !defined(BSP_USING_PULSE_ENCODER2) && !defined(BSP_USING_PULSE_ENCODER3) && \ + !defined(BSP_USING_PULSE_ENCODER4) && !defined(BSP_USING_PULSE_ENCODER5) && !defined(BSP_USING_PULSE_ENCODER6) && \ + !defined(BSP_USING_PULSE_ENCODER7) && !defined(BSP_USING_PULSE_ENCODER8) && !defined(BSP_USING_PULSE_ENCODER9) && \ + !defined(BSP_USING_PULSE_ENCODER10) && !defined(BSP_USING_PULSE_ENCODER11) && !defined(BSP_USING_PULSE_ENCODER12) +#error "Please define at least one BSP_USING_PULSE_ENCODERx" +/* this driver can be disabled at menuconfig -> Hardware Drivers Config -> On-chip Peripheral Drivers -> Enable Pulse Encoder */ +#endif + +#include "drv_pulse_encoder.h" +#include "drv_irq.h" + +#define TIMER_AUTO_RELOAD_VALUE (0xFFFFU) + +enum +{ +#ifdef BSP_USING_PULSE_ENCODER1 + PULSE_ENCODER1_INDEX, +#endif +#ifdef BSP_USING_PULSE_ENCODER2 + PULSE_ENCODER2_INDEX, +#endif +#ifdef BSP_USING_PULSE_ENCODER3 + PULSE_ENCODER3_INDEX, +#endif +#ifdef BSP_USING_PULSE_ENCODER4 + PULSE_ENCODER4_INDEX, +#endif +#ifdef BSP_USING_PULSE_ENCODER5 + PULSE_ENCODER5_INDEX, +#endif +#ifdef BSP_USING_PULSE_ENCODER6 + PULSE_ENCODER6_INDEX, +#endif +#ifdef BSP_USING_PULSE_ENCODER7 + PULSE_ENCODER7_INDEX, +#endif +#ifdef BSP_USING_PULSE_ENCODER8 + PULSE_ENCODER8_INDEX, +#endif +#ifdef BSP_USING_PULSE_ENCODER9 + PULSE_ENCODER9_INDEX, +#endif +#ifdef BSP_USING_PULSE_ENCODER10 + PULSE_ENCODER10_INDEX, +#endif +#ifdef BSP_USING_PULSE_ENCODER11 + PULSE_ENCODER11_INDEX, +#endif +#ifdef BSP_USING_PULSE_ENCODER12 + PULSE_ENCODER12_INDEX, +#endif +}; + +#ifdef BSP_USING_PULSE_ENCODER1 +static void pulse_encoder1_irq_handler(void); +#endif +#ifdef BSP_USING_PULSE_ENCODER2 +static void pulse_encoder2_irq_handler(void); +#endif +#ifdef BSP_USING_PULSE_ENCODER3 +static void pulse_encoder3_irq_handler(void); +#endif +#ifdef BSP_USING_PULSE_ENCODER4 +static void pulse_encoder4_irq_handler(void); +#endif +#ifdef BSP_USING_PULSE_ENCODER5 +static void pulse_encoder5_irq_handler(void); +#endif +#ifdef BSP_USING_PULSE_ENCODER6 +static void pulse_encoder6_irq_handler(void); +#endif +#ifdef BSP_USING_PULSE_ENCODER7 +static void pulse_encoder7_irq_handler(void); +#endif +#ifdef BSP_USING_PULSE_ENCODER8 +static void pulse_encoder8_irq_handler(void); +#endif +#ifdef BSP_USING_PULSE_ENCODER9 +static void pulse_encoder9_irq_handler(void); +#endif +#ifdef BSP_USING_PULSE_ENCODER10 +static void pulse_encoder10_irq_handler(void); +#endif +#ifdef BSP_USING_PULSE_ENCODER11 +static void pulse_encoder11_irq_handler(void); +#endif +#ifdef BSP_USING_PULSE_ENCODER12 +static void pulse_encoder12_irq_handler(void); +#endif + +struct hc32_pulse_encoder_config +{ + struct rt_pulse_encoder_device pulse_encoder; + M4_TMRA_TypeDef *timer_periph; + struct hc32_irq_config ovf_irq_config; + struct hc32_irq_config udf_irq_config; + func_ptr_t irq_callback; + rt_int32_t ovf_udf_count; + char *name; +}; + +#ifndef HC32_PULSE_ENCODER_CONFIG +#define HC32_PULSE_ENCODER_CONFIG(periph, irq, label, ovf_src, udf_src, \ + ovf_irq_info, udf_irq_info) \ + { \ + .timer_periph = periph, \ + .irq_callback = irq, \ + .name = label, \ + .ovf_irq_config = ovf_irq_info, \ + .udf_irq_config = udf_irq_info, \ + .ovf_irq_config.int_src = ovf_src, \ + .udf_irq_config.int_src = udf_src, \ + } +#endif /* HC32_PULSE_ENCODER_CONFIG */ + +static struct hc32_pulse_encoder_config pulse_encoder_obj[] = +{ +#ifdef BSP_USING_PULSE_ENCODER1 + HC32_PULSE_ENCODER_CONFIG(M4_TMRA_1, pulse_encoder1_irq_handler, "pulse1", INT_TMRA_1_OVF, INT_TMRA_1_UDF, + PULSE_ENCODER1_OVF_IRQ_CONFIG, PULSE_ENCODER1_UDF_IRQ_CONFIG), +#endif +#ifdef BSP_USING_PULSE_ENCODER2 + HC32_PULSE_ENCODER_CONFIG(M4_TMRA_2, pulse_encoder2_irq_handler, "pulse2", INT_TMRA_2_OVF, INT_TMRA_2_UDF, + PULSE_ENCODER2_OVF_IRQ_CONFIG, PULSE_ENCODER2_UDF_IRQ_CONFIG), +#endif +#ifdef BSP_USING_PULSE_ENCODER3 + HC32_PULSE_ENCODER_CONFIG(M4_TMRA_3, pulse_encoder3_irq_handler, "pulse3", INT_TMRA_3_OVF, INT_TMRA_3_UDF, + PULSE_ENCODER3_OVF_IRQ_CONFIG, PULSE_ENCODER3_UDF_IRQ_CONFIG), +#endif +#ifdef BSP_USING_PULSE_ENCODER4 + HC32_PULSE_ENCODER_CONFIG(M4_TMRA_4, pulse_encoder4_irq_handler, "pulse4", INT_TMRA_4_OVF, INT_TMRA_4_UDF, + PULSE_ENCODER4_OVF_IRQ_CONFIG, PULSE_ENCODER4_UDF_IRQ_CONFIG), +#endif +#ifdef BSP_USING_PULSE_ENCODER5 + HC32_PULSE_ENCODER_CONFIG(M4_TMRA_5, pulse_encoder5_irq_handler, "pulse5", INT_TMRA_5_OVF, INT_TMRA_5_UDF, + PULSE_ENCODER5_OVF_IRQ_CONFIG, PULSE_ENCODER5_UDF_IRQ_CONFIG), +#endif +#ifdef BSP_USING_PULSE_ENCODER6 + HC32_PULSE_ENCODER_CONFIG(M4_TMRA_6, pulse_encoder6_irq_handler, "pulse6", INT_TMRA_6_OVF, INT_TMRA_6_UDF, + PULSE_ENCODER6_OVF_IRQ_CONFIG, PULSE_ENCODER6_UDF_IRQ_CONFIG), +#endif +#ifdef BSP_USING_PULSE_ENCODER7 + HC32_PULSE_ENCODER_CONFIG(M4_TMRA_7, pulse_encoder7_irq_handler, "pulse7", INT_TMRA_7_OVF, INT_TMRA_7_UDF, + PULSE_ENCODER7_OVF_IRQ_CONFIG, PULSE_ENCODER7_UDF_IRQ_CONFIG), +#endif +#ifdef BSP_USING_PULSE_ENCODER8 + HC32_PULSE_ENCODER_CONFIG(M4_TMRA_8, pulse_encoder8_irq_handler, "pulse8", INT_TMRA_8_OVF, INT_TMRA_8_UDF, + PULSE_ENCODER8_OVF_IRQ_CONFIG, PULSE_ENCODER8_UDF_IRQ_CONFIG), +#endif +#ifdef BSP_USING_PULSE_ENCODER9 + HC32_PULSE_ENCODER_CONFIG(M4_TMRA_9, pulse_encoder9_irq_handler, "pulse9", INT_TMRA_9_OVF, INT_TMRA_9_UDF, + PULSE_ENCODER9_OVF_IRQ_CONFIG, PULSE_ENCODER9_UDF_IRQ_CONFIG), +#endif +#ifdef BSP_USING_PULSE_ENCODER10 + HC32_PULSE_ENCODER_CONFIG(M4_TMRA_10, pulse_encoder10_irq_handler, "pulse10", INT_TMRA_10_OVF, INT_TMRA_10_UDF, + PULSE_ENCODER10_OVF_IRQ_CONFIG, PULSE_ENCODER10_UDF_IRQ_CONFIG), +#endif +#ifdef BSP_USING_PULSE_ENCODER11 + HC32_PULSE_ENCODER_CONFIG(M4_TMRA_11, pulse_encoder11_irq_handler, "pulse11", INT_TMRA_11_OVF, INT_TMRA_11_UDF, + PULSE_ENCODER11_OVF_IRQ_CONFIG, PULSE_ENCODER11_UDF_IRQ_CONFIG), +#endif +#ifdef BSP_USING_PULSE_ENCODER12 + HC32_PULSE_ENCODER_CONFIG(M4_TMRA_12, pulse_encoder12_irq_handler, "pulse12", INT_TMRA_12_OVF, INT_TMRA_12_UDF, + PULSE_ENCODER12_OVF_IRQ_CONFIG, PULSE_ENCODER12_UDF_IRQ_CONFIG), +#endif +}; + +static void hc32_pulse_encoder_irq_handler(struct hc32_pulse_encoder_config *pulse_encoder_config) +{ + if (Set == TMRA_GetStatus(pulse_encoder_config->timer_periph, TMRA_FLAG_OVF)) + { + pulse_encoder_config->ovf_udf_count++; + TMRA_ClrStatus(pulse_encoder_config->timer_periph, TMRA_FLAG_OVF); + } + if (Set == TMRA_GetStatus(pulse_encoder_config->timer_periph, TMRA_FLAG_UNF)) + { + pulse_encoder_config->ovf_udf_count--; + TMRA_ClrStatus(pulse_encoder_config->timer_periph, TMRA_FLAG_UNF); + } +} + +#ifdef BSP_USING_PULSE_ENCODER1 +static void pulse_encoder1_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_pulse_encoder_irq_handler(&pulse_encoder_obj[PULSE_ENCODER1_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_PULSE_ENCODER2 +static void pulse_encoder2_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_pulse_encoder_irq_handler(&pulse_encoder_obj[PULSE_ENCODER2_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_PULSE_ENCODER3 +static void pulse_encoder3_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_pulse_encoder_irq_handler(&pulse_encoder_obj[PULSE_ENCODER3_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_PULSE_ENCODER4 +static void pulse_encoder4_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_pulse_encoder_irq_handler(&pulse_encoder_obj[PULSE_ENCODER4_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_PULSE_ENCODER5 +static void pulse_encoder5_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_pulse_encoder_irq_handler(&pulse_encoder_obj[PULSE_ENCODER5_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_PULSE_ENCODER6 +static void pulse_encoder6_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_pulse_encoder_irq_handler(&pulse_encoder_obj[PULSE_ENCODER6_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_PULSE_ENCODER7 +static void pulse_encoder7_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_pulse_encoder_irq_handler(&pulse_encoder_obj[PULSE_ENCODER7_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_PULSE_ENCODER8 +static void pulse_encoder8_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_pulse_encoder_irq_handler(&pulse_encoder_obj[PULSE_ENCODER8_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_PULSE_ENCODER9 +static void pulse_encoder9_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_pulse_encoder_irq_handler(&pulse_encoder_obj[PULSE_ENCODER9_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_PULSE_ENCODER10 +static void pulse_encoder10_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_pulse_encoder_irq_handler(&pulse_encoder_obj[PULSE_ENCODER10_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_PULSE_ENCODER11 +static void pulse_encoder11_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_pulse_encoder_irq_handler(&pulse_encoder_obj[PULSE_ENCODER11_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +#ifdef BSP_USING_PULSE_ENCODER12 +static void pulse_encoder12_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + hc32_pulse_encoder_irq_handler(&pulse_encoder_obj[PULSE_ENCODER12_INDEX]); + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif + +static rt_uint16_t hc32_timer_get_unit_number(M4_TMRA_TypeDef *TMRAx) +{ + rt_uint16_t unit_num; + const rt_uint32_t unit_step = 0x400U; + + if (((rt_uint32_t)TMRAx) >= ((rt_uint32_t)M4_TMRA_1)) + { + unit_num = (((rt_uint32_t)TMRAx) - ((rt_uint32_t)M4_TMRA_1)) / unit_step; + } + else + { + unit_num = (((rt_uint32_t)TMRAx) - ((rt_uint32_t)M4_TMRA_5)) / unit_step + 4; + } + + return unit_num; +} + +static void hc32_timer_clock_config(M4_TMRA_TypeDef *TMRAx, en_functional_state_t enNewState) +{ + rt_uint32_t timer_periph; + rt_uint16_t unit_num; + + unit_num = hc32_timer_get_unit_number(TMRAx); + timer_periph = PWC_FCG2_TMRA_1 << unit_num; + PWC_Fcg2PeriphClockCmd(timer_periph, enNewState); +} + +extern rt_err_t rt_hw_board_pulse_encoder_init(M4_TMRA_TypeDef *TMRAx); + +rt_err_t hc32_pulse_encoder_init(struct rt_pulse_encoder_device *pulse_encoder) +{ + struct hc32_pulse_encoder_config *pulse_encoder_device; + stc_tmra_init_t stcTmraInit; + rt_err_t result; + + RT_ASSERT(pulse_encoder != RT_NULL); + pulse_encoder_device = (struct hc32_pulse_encoder_config*)pulse_encoder; + /* Enable Timer peripheral clock. */ + hc32_timer_clock_config(pulse_encoder_device->timer_periph, Enable); + /* pwm pin configuration */ + result = rt_hw_board_pulse_encoder_init(pulse_encoder_device->timer_periph); + if (RT_EOK == result) + { + TMRA_DeInit(pulse_encoder_device->timer_periph); + TMRA_StructInit(&stcTmraInit); + stcTmraInit.u32PeriodVal = TIMER_AUTO_RELOAD_VALUE; + stcTmraInit.u32ClkSrc = TMRA_CLK_HW_UP_CLKBH_CLKAR | TMRA_CLK_HW_DOWN_CLKBL_CLKAR; + TMRA_Init(pulse_encoder_device->timer_periph, &stcTmraInit); + LOG_D("%s init success", pulse_encoder_device->name); + + hc32_install_irq_handler(&pulse_encoder_device->ovf_irq_config, pulse_encoder_device->irq_callback, RT_FALSE); + NVIC_EnableIRQ(pulse_encoder_device->ovf_irq_config.irq); + hc32_install_irq_handler(&pulse_encoder_device->udf_irq_config, pulse_encoder_device->irq_callback, RT_FALSE); + NVIC_EnableIRQ(pulse_encoder_device->udf_irq_config.irq); + /* clear update flag */ + TMRA_ClrStatus(pulse_encoder_device->timer_periph, (TMRA_FLAG_OVF | TMRA_FLAG_UNF)); + } + + return result; +} + +rt_err_t hc32_pulse_encoder_clear_count(struct rt_pulse_encoder_device *pulse_encoder) +{ + struct hc32_pulse_encoder_config *pulse_encoder_device; + + pulse_encoder_device = (struct hc32_pulse_encoder_config*)pulse_encoder; + pulse_encoder_device->ovf_udf_count = 0; + TMRA_Stop(pulse_encoder_device->timer_periph); + TMRA_SetCntVal(pulse_encoder_device->timer_periph, 0); + TMRA_ClrStatus(pulse_encoder_device->timer_periph, (TMRA_FLAG_OVF | TMRA_FLAG_UNF)); + TMRA_Start(pulse_encoder_device->timer_periph); + + return RT_EOK; +} + +rt_int32_t hc32_pulse_encoder_get_count(struct rt_pulse_encoder_device *pulse_encoder) +{ + struct hc32_pulse_encoder_config *pulse_encoder_device; + rt_int32_t period_val; + rt_int32_t count_val; + + pulse_encoder_device = (struct hc32_pulse_encoder_config*)pulse_encoder; + period_val = TMRA_GetCntVal(pulse_encoder_device->timer_periph); + count_val = period_val + pulse_encoder_device->ovf_udf_count * TIMER_AUTO_RELOAD_VALUE; + + return count_val; +} + +rt_err_t hc32_pulse_encoder_control(struct rt_pulse_encoder_device *pulse_encoder, rt_uint32_t cmd, void *args) +{ + rt_err_t result = RT_EOK; + struct hc32_pulse_encoder_config *pulse_encoder_device; + pulse_encoder_device = (struct hc32_pulse_encoder_config*)pulse_encoder; + + switch (cmd) + { + case PULSE_ENCODER_CMD_ENABLE: + TMRA_IntCmd(pulse_encoder_device->timer_periph, (TMRA_INT_OVF | TMRA_INT_UNF), Enable); + TMRA_Start(pulse_encoder_device->timer_periph); + break; + case PULSE_ENCODER_CMD_DISABLE: + TMRA_Stop(pulse_encoder_device->timer_periph); + TMRA_IntCmd(pulse_encoder_device->timer_periph, (TMRA_INT_OVF | TMRA_INT_UNF), Disable); + break; + default: + result = -RT_ENOSYS; + break; + } + + return result; +} + +static const struct rt_pulse_encoder_ops pulse_encoder_ops = +{ + .init = hc32_pulse_encoder_init, + .get_count = hc32_pulse_encoder_get_count, + .clear_count = hc32_pulse_encoder_clear_count, + .control = hc32_pulse_encoder_control, +}; + +int hw_pulse_encoder_init(void) +{ + int i; + int result; + + result = RT_EOK; + for (i = 0; i < sizeof(pulse_encoder_obj) / sizeof(pulse_encoder_obj[0]); i++) + { + pulse_encoder_obj[i].pulse_encoder.type = AB_PHASE_PULSE_ENCODER; + pulse_encoder_obj[i].pulse_encoder.ops = &pulse_encoder_ops; + + if (rt_device_pulse_encoder_register(&pulse_encoder_obj[i].pulse_encoder, pulse_encoder_obj[i].name, pulse_encoder_obj[i].timer_periph) != RT_EOK) + { + LOG_E("%s register failed", pulse_encoder_obj[i].name); + result = -RT_ERROR; + } + } + + return result; +} +INIT_BOARD_EXPORT(hw_pulse_encoder_init); + +#endif diff --git a/bsp/hc32f4a0/drivers/drv_pulse_encoder.h b/bsp/hc32f4a0/drivers/drv_pulse_encoder.h new file mode 100644 index 0000000000..b338f14e64 --- /dev/null +++ b/bsp/hc32f4a0/drivers/drv_pulse_encoder.h @@ -0,0 +1,241 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ + +#ifndef __DRV_PULSE_ENCODER_H__ +#define __DRV_PULSE_ENCODER_H__ + +#include +#include "board_config.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef BSP_USING_PULSE_ENCODER1 +#ifndef PULSE_ENCODER1_OVF_IRQ_CONFIG +#define PULSE_ENCODER1_OVF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER1_OVF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER1_OVF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER1_OVF_IRQ_CONFIG */ + +#ifndef PULSE_ENCODER1_UDF_IRQ_CONFIG +#define PULSE_ENCODER1_UDF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER1_UNF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER1_UNF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER1_UDF_IRQ_CONFIG */ +#endif /* BSP_USING_PULSE_ENCODER1 */ + +#ifdef BSP_USING_PULSE_ENCODER2 +#ifndef PULSE_ENCODER2_OVF_IRQ_CONFIG +#define PULSE_ENCODER2_OVF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER2_OVF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER2_OVF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER2_OVF_IRQ_CONFIG */ + +#ifndef PULSE_ENCODER2_UDF_IRQ_CONFIG +#define PULSE_ENCODER2_UDF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER2_UNF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER2_UNF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER2_UDF_IRQ_CONFIG */ +#endif /* BSP_USING_PULSE_ENCODER2 */ + +#ifdef BSP_USING_PULSE_ENCODER3 +#ifndef PULSE_ENCODER3_OVF_IRQ_CONFIG +#define PULSE_ENCODER3_OVF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER3_OVF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER3_OVF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER3_OVF_IRQ_CONFIG */ + +#ifndef PULSE_ENCODER3_UDF_IRQ_CONFIG +#define PULSE_ENCODER3_UDF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER3_UNF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER3_UNF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER3_UDF_IRQ_CONFIG */ +#endif /* BSP_USING_PULSE_ENCODER3 */ + +#ifdef BSP_USING_PULSE_ENCODER4 +#ifndef PULSE_ENCODER4_OVF_IRQ_CONFIG +#define PULSE_ENCODER4_OVF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER4_OVF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER4_OVF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER4_OVF_IRQ_CONFIG */ + +#ifndef PULSE_ENCODER4_UDF_IRQ_CONFIG +#define PULSE_ENCODER4_UDF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER4_UNF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER4_UNF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER4_UDF_IRQ_CONFIG */ +#endif /* BSP_USING_PULSE_ENCODER4 */ + +#ifdef BSP_USING_PULSE_ENCODER5 +#ifndef PULSE_ENCODER5_OVF_IRQ_CONFIG +#define PULSE_ENCODER5_OVF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER5_OVF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER5_OVF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER5_OVF_IRQ_CONFIG */ + +#ifndef PULSE_ENCODER5_UDF_IRQ_CONFIG +#define PULSE_ENCODER5_UDF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER5_UNF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER5_UNF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER5_UDF_IRQ_CONFIG */ +#endif /* BSP_USING_PULSE_ENCODER5 */ + +#ifdef BSP_USING_PULSE_ENCODER6 +#ifndef PULSE_ENCODER6_OVF_IRQ_CONFIG +#define PULSE_ENCODER6_OVF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER6_OVF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER6_OVF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER6_OVF_IRQ_CONFIG */ + +#ifndef PULSE_ENCODER6_UDF_IRQ_CONFIG +#define PULSE_ENCODER6_UDF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER6_UNF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER6_UNF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER6_UDF_IRQ_CONFIG */ +#endif /* BSP_USING_PULSE_ENCODER6 */ + +#ifdef BSP_USING_PULSE_ENCODER7 +#ifndef PULSE_ENCODER7_OVF_IRQ_CONFIG +#define PULSE_ENCODER7_OVF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER7_OVF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER7_OVF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER7_OVF_IRQ_CONFIG */ + +#ifndef PULSE_ENCODER7_UDF_IRQ_CONFIG +#define PULSE_ENCODER7_UDF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER7_UNF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER7_UNF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER7_UDF_IRQ_CONFIG */ +#endif /* BSP_USING_PULSE_ENCODER7 */ + +#ifdef BSP_USING_PULSE_ENCODER8 +#ifndef PULSE_ENCODER8_OVF_IRQ_CONFIG +#define PULSE_ENCODER8_OVF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER8_OVF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER8_OVF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER8_OVF_IRQ_CONFIG */ + +#ifndef PULSE_ENCODER8_UDF_IRQ_CONFIG +#define PULSE_ENCODER8_UDF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER8_UNF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER8_UNF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER8_UDF_IRQ_CONFIG */ +#endif /* BSP_USING_PULSE_ENCODER8 */ + +#ifdef BSP_USING_PULSE_ENCODER9 +#ifndef PULSE_ENCODER9_OVF_IRQ_CONFIG +#define PULSE_ENCODER9_OVF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER9_OVF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER9_OVF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER9_OVF_IRQ_CONFIG */ + +#ifndef PULSE_ENCODER9_UDF_IRQ_CONFIG +#define PULSE_ENCODER9_UDF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER9_UNF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER9_UNF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER9_UDF_IRQ_CONFIG */ +#endif /* BSP_USING_PULSE_ENCODER9 */ + +#ifdef BSP_USING_PULSE_ENCODER10 +#ifndef PULSE_ENCODER10_OVF_IRQ_CONFIG +#define PULSE_ENCODER10_OVF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER10_OVF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER10_OVF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER10_OVF_IRQ_CONFIG */ + +#ifndef PULSE_ENCODER10_UDF_IRQ_CONFIG +#define PULSE_ENCODER10_UDF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER10_UNF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER10_UNF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER10_UDF_IRQ_CONFIG */ +#endif /* BSP_USING_PULSE_ENCODER10 */ + +#ifdef BSP_USING_PULSE_ENCODER11 +#ifndef PULSE_ENCODER11_OVF_IRQ_CONFIG +#define PULSE_ENCODER11_OVF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER11_OVF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER11_OVF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER11_OVF_IRQ_CONFIG */ + +#ifndef PULSE_ENCODER11_UDF_IRQ_CONFIG +#define PULSE_ENCODER11_UDF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER11_UNF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER11_UNF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER11_UDF_IRQ_CONFIG */ +#endif /* BSP_USING_PULSE_ENCODER11 */ + +#ifdef BSP_USING_PULSE_ENCODER12 +#ifndef PULSE_ENCODER12_OVF_IRQ_CONFIG +#define PULSE_ENCODER12_OVF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER12_OVF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER12_OVF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER12_OVF_IRQ_CONFIG */ + +#ifndef PULSE_ENCODER12_UDF_IRQ_CONFIG +#define PULSE_ENCODER12_UDF_IRQ_CONFIG \ + { \ + .irq = PULSE_ENCODER12_UNF_INT_IRQn, \ + .irq_prio = PULSE_ENCODER12_UNF_INT_PRIO, \ + } +#endif /* PULSE_ENCODER12_UDF_IRQ_CONFIG */ +#endif /* BSP_USING_PULSE_ENCODER12 */ + +#ifdef __cplusplus +} +#endif + +#endif /* __DRV_PULSE_ENCODER_H__ */ diff --git a/bsp/hc32f4a0/drivers/drv_pwm.c b/bsp/hc32f4a0/drivers/drv_pwm.c new file mode 100644 index 0000000000..a13560e16e --- /dev/null +++ b/bsp/hc32f4a0/drivers/drv_pwm.c @@ -0,0 +1,528 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ + +#include +#include + +#ifdef RT_USING_PWM + +#if !defined(BSP_USING_PWM1) && !defined(BSP_USING_PWM2) && !defined(BSP_USING_PWM3) && \ + !defined(BSP_USING_PWM4) && !defined(BSP_USING_PWM5) && !defined(BSP_USING_PWM6) && \ + !defined(BSP_USING_PWM7) && !defined(BSP_USING_PWM8) && !defined(BSP_USING_PWM9) && \ + !defined(BSP_USING_PWM10) && !defined(BSP_USING_PWM11) && !defined(BSP_USING_PWM12) +#error "Please define at least one BSP_USING_PWMx" +/* this driver can be disabled at menuconfig -> Hardware Drivers Config -> On-chip Peripheral Drivers -> Enable PWM */ +#endif + +#define PWM_MAX_PERIOD (65535U) +#define PWM_MIN_PERIOD (1U) +#define PWM_MIN_PULSE (1U) + +#define PWM_MAX_CHANNEL (TMRA_CH_4) + +enum +{ +#ifdef BSP_USING_PWM1 + PWM1_INDEX, +#endif +#ifdef BSP_USING_PWM2 + PWM2_INDEX, +#endif +#ifdef BSP_USING_PWM3 + PWM3_INDEX, +#endif +#ifdef BSP_USING_PWM4 + PWM4_INDEX, +#endif +#ifdef BSP_USING_PWM5 + PWM5_INDEX, +#endif +#ifdef BSP_USING_PWM6 + PWM6_INDEX, +#endif +#ifdef BSP_USING_PWM7 + PWM7_INDEX, +#endif +#ifdef BSP_USING_PWM8 + PWM8_INDEX, +#endif +#ifdef BSP_USING_PWM9 + PWM9_INDEX, +#endif +#ifdef BSP_USING_PWM10 + PWM10_INDEX, +#endif +#ifdef BSP_USING_PWM11 + PWM11_INDEX, +#endif +#ifdef BSP_USING_PWM12 + PWM12_INDEX, +#endif +}; + +struct hc32_pwm_config +{ + struct rt_device_pwm pwm_device; + M4_TMRA_TypeDef *timer_periph; + rt_uint8_t channel; + char *name; +}; + +#ifndef HC32_PWM_CONFIG +#define HC32_PWM_CONFIG(periph, ch, label) \ + { \ + .timer_periph = periph, \ + .channel = ch, \ + .name = label \ + } +#endif /* HC32_PWM_CONFIG */ + +static struct hc32_pwm_config pwm_obj[] = +{ +#ifdef BSP_USING_PWM1 + HC32_PWM_CONFIG(M4_TMRA_1 , 0, "pwm1"), +#endif +#ifdef BSP_USING_PWM2 + HC32_PWM_CONFIG(M4_TMRA_2 , 0, "pwm2"), +#endif +#ifdef BSP_USING_PWM3 + HC32_PWM_CONFIG(M4_TMRA_3 , 0, "pwm3"), +#endif +#ifdef BSP_USING_PWM4 + HC32_PWM_CONFIG(M4_TMRA_4 , 0, "pwm4"), +#endif +#ifdef BSP_USING_PWM5 + HC32_PWM_CONFIG(M4_TMRA_5 , 0, "pwm5"), +#endif +#ifdef BSP_USING_PWM6 + HC32_PWM_CONFIG(M4_TMRA_6 , 0, "pwm6"), +#endif +#ifdef BSP_USING_PWM7 + HC32_PWM_CONFIG(M4_TMRA_7 , 0, "pwm7"), +#endif +#ifdef BSP_USING_PWM8 + HC32_PWM_CONFIG(M4_TMRA_8 , 0, "pwm8"), +#endif +#ifdef BSP_USING_PWM9 + HC32_PWM_CONFIG(M4_TMRA_9 , 0, "pwm9"), +#endif +#ifdef BSP_USING_PWM10 + HC32_PWM_CONFIG(M4_TMRA_10 , 0, "pwm10"), +#endif +#ifdef BSP_USING_PWM11 + HC32_PWM_CONFIG(M4_TMRA_11 , 0, "pwm11"), +#endif +#ifdef BSP_USING_PWM12 + HC32_PWM_CONFIG(M4_TMRA_12 , 0, "pwm12"), +#endif +}; + +static rt_uint16_t hc32_pwm_get_unit_number(M4_TMRA_TypeDef *TMRAx) +{ + rt_uint16_t unit_num; + const rt_uint32_t unit_step = 0x400U; + + if (((rt_uint32_t)TMRAx) >= ((rt_uint32_t)M4_TMRA_1)) + { + unit_num = (((rt_uint32_t)TMRAx) - ((rt_uint32_t)M4_TMRA_1)) / unit_step; + } + else + { + unit_num = (((rt_uint32_t)TMRAx) - ((rt_uint32_t)M4_TMRA_5)) / unit_step + 4; + } + + return unit_num; +} + +static void hc32_pwm_clock_config(M4_TMRA_TypeDef *TMRAx, en_functional_state_t enNewState) +{ + rt_uint32_t timer_periph; + rt_uint16_t unit_num; + + unit_num = hc32_pwm_get_unit_number(TMRAx); + timer_periph = PWC_FCG2_TMRA_1 << unit_num; + PWC_Fcg2PeriphClockCmd(timer_periph, enNewState); +} + +static rt_err_t hc32_pwm_enable(M4_TMRA_TypeDef *TMRAx, struct rt_pwm_configuration *configuration, rt_bool_t enable) +{ + if (configuration->channel > PWM_MAX_CHANNEL) + { + return RT_EINVAL; + } + + if (!enable) + { + TMRA_PWM_Cmd(TMRAx, configuration->channel, Disable); + } + else + { + TMRA_PWM_Cmd(TMRAx, configuration->channel, Enable); + } + + return RT_EOK; +} + +static rt_err_t hc32_pwm_get(M4_TMRA_TypeDef *TMRAx, struct rt_pwm_configuration *configuration) +{ + stc_clk_freq_t stcClkFreq; + rt_uint32_t clk_freq; + rt_uint16_t unit_num; + rt_uint16_t div_val; + + CLK_GetClockFreq(&stcClkFreq); + unit_num = hc32_pwm_get_unit_number(TMRAx); + if (unit_num >= 4) + { + clk_freq = stcClkFreq.pclk1Freq; + } + else + { + clk_freq = stcClkFreq.pclk0Freq; + } + + /* Convert nanosecond to frequency and duty cycle */ + div_val = 0x01 << (READ_REG32_BIT(TMRAx->BCSTR, TMRA_BCSTR_CKDIV) >> TMRA_BCSTR_CKDIV_POS); + clk_freq /= 1000000UL; + configuration->period = (TMRA_GetPeriodVal(TMRAx) + 1) * div_val * 1000UL / clk_freq; + configuration->pulse = (TMRA_GetCmpVal(TMRAx, configuration->channel) + 1) * div_val * 1000UL / clk_freq; + + return RT_EOK; +} + +static rt_err_t hc32_pwm_set(M4_TMRA_TypeDef *TMRAx, struct rt_pwm_configuration *configuration) +{ + rt_uint32_t period, pulse; + rt_uint64_t clk_div; + stc_clk_freq_t stcClkFreq; + rt_uint32_t clk_freq; + rt_uint16_t unit_num; + rt_uint16_t div_val; + + CLK_GetClockFreq(&stcClkFreq); + unit_num = hc32_pwm_get_unit_number(TMRAx); + if (unit_num >= 4) + { + clk_freq = stcClkFreq.pclk1Freq; + } + else + { + clk_freq = stcClkFreq.pclk0Freq; + } + /* Convert nanosecond to frequency and duty cycle */ + clk_freq /= 1000000UL; + period = (unsigned long long)configuration->period * clk_freq / 1000UL; + clk_div = period / PWM_MAX_PERIOD + 1; + + if (clk_div > 1024) + { + return RT_EINVAL; + } + else if (clk_div != 1) + { + for (div_val=512; div_val>1; div_val>>=1) + { + if (clk_div > div_val) + { + clk_div = div_val << 1; + break; + } + } + } + period = period / clk_div; + TMRA_SetPCLKDiv(TMRAx, ((__CLZ(__RBIT(clk_div))) << TMRA_BCSTR_CKDIV_POS)); + + if (period < PWM_MIN_PERIOD) + { + period = PWM_MIN_PERIOD; + } + TMRA_SetPeriodVal(TMRAx, period - 1); + + pulse = (unsigned long long)configuration->pulse * clk_freq / clk_div / 1000UL; + if (pulse < PWM_MIN_PULSE) + { + pulse = PWM_MIN_PULSE; + } + else if (pulse > period) + { + pulse = period; + } + TMRA_SetCmpVal(TMRAx, configuration->channel, pulse - 1); + TMRA_SetCntVal(TMRAx, 0); + + return RT_EOK; +} + +static rt_err_t hc32_pwm_control(struct rt_device_pwm *device, int cmd, void *arg) +{ + struct rt_pwm_configuration *configuration = (struct rt_pwm_configuration *)arg; + M4_TMRA_TypeDef *timer_periph = (M4_TMRA_TypeDef *)device->parent.user_data; + + switch (cmd) + { + case PWM_CMD_ENABLE: + return hc32_pwm_enable(timer_periph, configuration, RT_TRUE); + case PWM_CMD_DISABLE: + return hc32_pwm_enable(timer_periph, configuration, RT_FALSE); + case PWM_CMD_SET: + return hc32_pwm_set(timer_periph, configuration); + case PWM_CMD_GET: + return hc32_pwm_get(timer_periph, configuration); + default: + return RT_EINVAL; + } +} + +extern rt_err_t rt_hw_board_pwm_init(M4_TMRA_TypeDef *TMRAx); + +static rt_err_t hc32_pwm_init(struct hc32_pwm_config *device) +{ + rt_err_t result = RT_EOK; + stc_tmra_init_t stcTmraInit; + stc_tmra_pwm_cfg_t stcPwmCfg; + + RT_ASSERT(device != RT_NULL); + + /* Enable Timer peripheral clock. */ + hc32_pwm_clock_config(device->timer_periph, Enable); + /* pwm pin configuration */ + result = rt_hw_board_pwm_init(device->timer_periph); + if (RT_EOK == result) + { + TMRA_DeInit(device->timer_periph); + TMRA_StructInit(&stcTmraInit); + stcTmraInit.u32PCLKDiv = TMRA_PCLK_DIV1; + stcTmraInit.u32CntOvfOp = TMRA_OVF_CNT_CONTINUE; + stcTmraInit.u32PeriodVal = 0xFFFF; + stcTmraInit.u32CntVal = 0; + TMRA_Init(device->timer_periph, &stcTmraInit); + + /* Set the comparison reference value */ + TMRA_PWM_StructInit(&stcPwmCfg); + stcPwmCfg.u32StartPolarity = TMRA_PWM_START_HIGH; + stcPwmCfg.u32StopPolarity = TMRA_PWM_STOP_LOW; + stcPwmCfg.u32CmpPolarity = TMRA_PWM_CMP_LOW; + stcPwmCfg.u32PeriodPolarity = TMRA_PWM_PERIOD_HIGH; + + /* config pwm channel */ + if (0 != (device->channel & 0x01)) + { + TMRA_PWM_Config(device->timer_periph, TMRA_CH_1, &stcPwmCfg); + TMRA_SetCmpVal(device->timer_periph, TMRA_CH_1, 0x7FFF); + } + if (0 != (device->channel & 0x02)) + { + TMRA_PWM_Config(device->timer_periph, TMRA_CH_2, &stcPwmCfg); + TMRA_SetCmpVal(device->timer_periph, TMRA_CH_2, 0x7FFF); + } + if (0 != (device->channel & 0x04)) + { + TMRA_PWM_Config(device->timer_periph, TMRA_CH_3, &stcPwmCfg); + TMRA_SetCmpVal(device->timer_periph, TMRA_CH_3, 0x7FFF); + } + if (0 != (device->channel & 0x08)) + { + TMRA_PWM_Config(device->timer_periph, TMRA_CH_4, &stcPwmCfg); + TMRA_SetCmpVal(device->timer_periph, TMRA_CH_4, 0x7FFF); + } + /* start timer */ + TMRA_Start(device->timer_periph); + } + + return result; +} + +static void hc32_pwm_get_channel(void) +{ +#ifdef BSP_USING_PWM1_CH1 + pwm_obj[PWM1_INDEX].channel |= (0x01 << 0); +#endif +#ifdef BSP_USING_PWM1_CH2 + pwm_obj[PWM1_INDEX].channel |= (0x01 << 1); +#endif +#ifdef BSP_USING_PWM1_CH3 + pwm_obj[PWM1_INDEX].channel |= (0x01 << 2); +#endif +#ifdef BSP_USING_PWM1_CH4 + pwm_obj[PWM1_INDEX].channel |= (0x01 << 3); +#endif +#ifdef BSP_USING_PWM2_CH1 + pwm_obj[PWM2_INDEX].channel |= (0x01 << 0); +#endif +#ifdef BSP_USING_PWM2_CH2 + pwm_obj[PWM2_INDEX].channel |= (0x01 << 1); +#endif +#ifdef BSP_USING_PWM2_CH3 + pwm_obj[PWM2_INDEX].channel |= (0x01 << 2); +#endif +#ifdef BSP_USING_PWM2_CH4 + pwm_obj[PWM2_INDEX].channel |= (0x01 << 3); +#endif +#ifdef BSP_USING_PWM3_CH1 + pwm_obj[PWM3_INDEX].channel |= (0x01 << 0); +#endif +#ifdef BSP_USING_PWM3_CH2 + pwm_obj[PWM3_INDEX].channel |= (0x01 << 1); +#endif +#ifdef BSP_USING_PWM3_CH3 + pwm_obj[PWM3_INDEX].channel |= (0x01 << 2); +#endif +#ifdef BSP_USING_PWM3_CH4 + pwm_obj[PWM3_INDEX].channel |= (0x01 << 3); +#endif +#ifdef BSP_USING_PWM4_CH1 + pwm_obj[PWM4_INDEX].channel |= (0x01 << 0); +#endif +#ifdef BSP_USING_PWM4_CH2 + pwm_obj[PWM4_INDEX].channel |= (0x01 << 1); +#endif +#ifdef BSP_USING_PWM4_CH3 + pwm_obj[PWM4_INDEX].channel |= (0x01 << 2); +#endif +#ifdef BSP_USING_PWM4_CH4 + pwm_obj[PWM4_INDEX].channel |= (0x01 << 3); +#endif +#ifdef BSP_USING_PWM5_CH1 + pwm_obj[PWM5_INDEX].channel |= (0x01 << 0); +#endif +#ifdef BSP_USING_PWM5_CH2 + pwm_obj[PWM5_INDEX].channel |= (0x01 << 1); +#endif +#ifdef BSP_USING_PWM5_CH3 + pwm_obj[PWM5_INDEX].channel |= (0x01 << 2); +#endif +#ifdef BSP_USING_PWM5_CH4 + pwm_obj[PWM5_INDEX].channel |= (0x01 << 3); +#endif +#ifdef BSP_USING_PWM6_CH1 + pwm_obj[PWM6_INDEX].channel |= (0x01 << 0); +#endif +#ifdef BSP_USING_PWM6_CH2 + pwm_obj[PWM6_INDEX].channel |= (0x01 << 1); +#endif +#ifdef BSP_USING_PWM6_CH3 + pwm_obj[PWM6_INDEX].channel |= (0x01 << 2); +#endif +#ifdef BSP_USING_PWM6_CH4 + pwm_obj[PWM6_INDEX].channel |= (0x01 << 3); +#endif +#ifdef BSP_USING_PWM7_CH1 + pwm_obj[PWM7_INDEX].channel |= (0x01 << 0); +#endif +#ifdef BSP_USING_PWM7_CH2 + pwm_obj[PWM7_INDEX].channel |= (0x01 << 1); +#endif +#ifdef BSP_USING_PWM7_CH3 + pwm_obj[PWM7_INDEX].channel |= (0x01 << 2); +#endif +#ifdef BSP_USING_PWM7_CH4 + pwm_obj[PWM7_INDEX].channel |= (0x01 << 3); +#endif +#ifdef BSP_USING_PWM8_CH1 + pwm_obj[PWM8_INDEX].channel |= (0x01 << 0); +#endif +#ifdef BSP_USING_PWM8_CH2 + pwm_obj[PWM8_INDEX].channel |= (0x01 << 1); +#endif +#ifdef BSP_USING_PWM8_CH3 + pwm_obj[PWM8_INDEX].channel |= (0x01 << 2); +#endif +#ifdef BSP_USING_PWM8_CH4 + pwm_obj[PWM8_INDEX].channel |= (0x01 << 3); +#endif +#ifdef BSP_USING_PWM9_CH1 + pwm_obj[PWM9_INDEX].channel |= (0x01 << 0); +#endif +#ifdef BSP_USING_PWM9_CH2 + pwm_obj[PWM9_INDEX].channel |= (0x01 << 1); +#endif +#ifdef BSP_USING_PWM9_CH3 + pwm_obj[PWM9_INDEX].channel |= (0x01 << 2); +#endif +#ifdef BSP_USING_PWM9_CH4 + pwm_obj[PWM9_INDEX].channel |= (0x01 << 3); +#endif +#ifdef BSP_USING_PWM10_CH1 + pwm_obj[PWM10_INDEX].channel |= (0x01 << 0); +#endif +#ifdef BSP_USING_PWM10_CH2 + pwm_obj[PWM10_INDEX].channel |= (0x01 << 1); +#endif +#ifdef BSP_USING_PWM10_CH3 + pwm_obj[PWM10_INDEX].channel |= (0x01 << 2); +#endif +#ifdef BSP_USING_PWM10_CH4 + pwm_obj[PWM10_INDEX].channel |= (0x01 << 3); +#endif +#ifdef BSP_USING_PWM11_CH1 + pwm_obj[PWM11_INDEX].channel |= (0x01 << 0); +#endif +#ifdef BSP_USING_PWM11_CH2 + pwm_obj[PWM11_INDEX].channel |= (0x01 << 1); +#endif +#ifdef BSP_USING_PWM11_CH3 + pwm_obj[PWM11_INDEX].channel |= (0x01 << 2); +#endif +#ifdef BSP_USING_PWM11_CH4 + pwm_obj[PWM11_INDEX].channel |= (0x01 << 3); +#endif +#ifdef BSP_USING_PWM12_CH1 + pwm_obj[PWM12_INDEX].channel |= (0x01 << 0); +#endif +#ifdef BSP_USING_PWM12_CH2 + pwm_obj[PWM12_INDEX].channel |= (0x01 << 1); +#endif +#ifdef BSP_USING_PWM12_CH3 + pwm_obj[PWM12_INDEX].channel |= (0x01 << 2); +#endif +#ifdef BSP_USING_PWM12_CH4 + pwm_obj[PWM12_INDEX].channel |= (0x01 << 3); +#endif +} + +static struct rt_pwm_ops pwm_ops = +{ + .control = hc32_pwm_control +}; + +static int rt_hw_pwm_init(void) +{ + int i = 0; + int result = RT_EOK; + + hc32_pwm_get_channel(); + for (i = 0; i < sizeof(pwm_obj) / sizeof(pwm_obj[0]); i++) + { + if (hc32_pwm_init(&pwm_obj[i]) != RT_EOK) + { + LOG_E("%s init failed", pwm_obj[i].name); + result = -RT_ERROR; + } + else + { + LOG_D("%s init success", pwm_obj[i].name); + /* register pwm device */ + if (rt_device_pwm_register(&pwm_obj[i].pwm_device, pwm_obj[i].name, &pwm_ops, pwm_obj[i].timer_periph) == RT_EOK) + { + LOG_D("%s register success", pwm_obj[i].name); + } + else + { + LOG_E("%s register failed", pwm_obj[i].name); + result = -RT_ERROR; + } + } + } + + return result; +} +INIT_DEVICE_EXPORT(rt_hw_pwm_init); + +#endif /* RT_USING_PWM */ diff --git a/bsp/hc32f4a0/drivers/drv_rtc.c b/bsp/hc32f4a0/drivers/drv_rtc.c new file mode 100644 index 0000000000..4ccaa46253 --- /dev/null +++ b/bsp/hc32f4a0/drivers/drv_rtc.c @@ -0,0 +1,192 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ + +#include "board.h" +#include + +#ifdef BSP_USING_RTC + +static struct rt_device rtc; + +static time_t hc32_rtc_get_time_stamp(void) +{ + stc_rtc_time_t stcRtcTime = {0}; + stc_rtc_date_t stcRtcDate = {0}; + struct tm tm_new = {0}; + + RTC_GetTime(RTC_DATA_FORMAT_DEC, &stcRtcTime); + RTC_GetDate(RTC_DATA_FORMAT_DEC, &stcRtcDate); + + tm_new.tm_sec = stcRtcTime.u8Second; + tm_new.tm_min = stcRtcTime.u8Minute; + tm_new.tm_hour = stcRtcTime.u8Hour; + tm_new.tm_mday = stcRtcDate.u8Day; + tm_new.tm_mon = stcRtcDate.u8Month - 1; + tm_new.tm_year = stcRtcDate.u8Year + 100; + tm_new.tm_wday = stcRtcDate.u8Weekday; + + LOG_D("get rtc time."); + return mktime(&tm_new); +} + +static rt_err_t hc32_rtc_set_time_stamp(time_t time_stamp) +{ + stc_rtc_time_t stcRtcTime = {0}; + stc_rtc_date_t stcRtcDate = {0}; + struct tm *p_tm; + + p_tm = localtime(&time_stamp); + if (p_tm->tm_year < 100) + { + return -RT_ERROR; + } + + stcRtcTime.u8Second = p_tm->tm_sec ; + stcRtcTime.u8Minute = p_tm->tm_min ; + stcRtcTime.u8Hour = p_tm->tm_hour; + stcRtcDate.u8Day = p_tm->tm_mday; + stcRtcDate.u8Month = p_tm->tm_mon + 1 ; + stcRtcDate.u8Year = p_tm->tm_year - 100; + stcRtcDate.u8Weekday = p_tm->tm_wday; + + if (Ok != RTC_SetTime(RTC_DATA_FORMAT_DEC, &stcRtcTime)) + { + return -RT_ERROR; + } + if (Ok != RTC_SetDate(RTC_DATA_FORMAT_DEC, &stcRtcDate)) + { + return -RT_ERROR; + } + + LOG_D("set rtc time."); + return RT_EOK; +} + +static rt_err_t hc32_rtc_init(struct rt_device *dev) +{ + stc_rtc_init_t stcRtcInit; + +#ifdef BSP_RTC_USING_XTAL32 + stc_clk_xtal32_init_t stcXtal32Init; + + /* Xtal32 config */ + stcXtal32Init.u8Xtal32State = CLK_XTAL32_ON; + stcXtal32Init.u8Xtal32Drv = CLK_XTAL32DRV_HIGH; + stcXtal32Init.u8Xtal32NF = CLK_XTAL32NF_PART; + (void)CLK_Xtal32Init(&stcXtal32Init); + /* Waiting for XTAL32 stabilization */ + rt_thread_delay(1000); +#endif + + /* Reset RTC counter */ + if (ErrorTimeout == RTC_DeInit()) + { + return -RT_ERROR; + } + else + { + /* Configure structure initialization */ + (void)RTC_StructInit(&stcRtcInit); + /* Configuration RTC structure */ +#ifdef BSP_RTC_USING_XTAL32 + stcRtcInit.u8ClockSource = RTC_CLOCK_SOURCE_XTAL32; +#else + stcRtcInit.u8ClockSource = RTC_CLOCK_SOURCE_RTCLRC; +#endif + stcRtcInit.u8HourFormat = RTC_HOUR_FORMAT_24; + (void)RTC_Init(&stcRtcInit); + /* Startup RTC count */ + RTC_Cmd(Enable); + } + + return RT_EOK; +} + +static rt_err_t hc32_rtc_control(rt_device_t dev, int cmd, void *args) +{ + rt_err_t result = RT_EOK; + + RT_ASSERT(dev != RT_NULL); + switch (cmd) + { + case RT_DEVICE_CTRL_RTC_GET_TIME: + *(rt_uint32_t *)args = hc32_rtc_get_time_stamp(); + LOG_D("RTC: get rtc_time %x\n", *(rt_uint32_t *)args); + break; + + case RT_DEVICE_CTRL_RTC_SET_TIME: + if (hc32_rtc_set_time_stamp(*(rt_uint32_t *)args)) + { + result = -RT_ERROR; + } + LOG_D("RTC: set rtc_time %x\n", *(rt_uint32_t *)args); + break; + default: + return RT_EINVAL; + } + + return result; +} + +#ifdef RT_USING_DEVICE_OPS +const static struct rt_device_ops rtc_ops = +{ + RT_NULL, + RT_NULL, + RT_NULL, + RT_NULL, + RT_NULL, + hc32_rtc_control +}; +#endif + +static rt_err_t rt_hw_rtc_register(rt_device_t device, const char *name, rt_uint32_t flag) +{ + RT_ASSERT(device != RT_NULL); + + if (hc32_rtc_init(device) != RT_EOK) + { + return -RT_ERROR; + } +#ifdef RT_USING_DEVICE_OPS + device->ops = &rtc_ops; +#else + device->init = RT_NULL; + device->open = RT_NULL; + device->close = RT_NULL; + device->read = RT_NULL; + device->write = RT_NULL; + device->control = hc32_rtc_control; +#endif + device->type = RT_Device_Class_RTC; + device->rx_indicate = RT_NULL; + device->tx_complete = RT_NULL; + device->user_data = RT_NULL; + + /* register a character device */ + return rt_device_register(device, name, flag); +} + +int rt_hw_rtc_init(void) +{ + rt_err_t result; + + result = rt_hw_rtc_register(&rtc, "rtc", RT_DEVICE_FLAG_RDWR); + if (result != RT_EOK) + { + LOG_E("rtc register err code: %d", result); + return result; + } + LOG_D("rtc init success"); + return RT_EOK; +} +INIT_DEVICE_EXPORT(rt_hw_rtc_init); + +#endif /* BSP_USING_RTC */ diff --git a/bsp/hc32f4a0/drivers/drv_soft_i2c.c b/bsp/hc32f4a0/drivers/drv_soft_i2c.c new file mode 100644 index 0000000000..38258ba7ee --- /dev/null +++ b/bsp/hc32f4a0/drivers/drv_soft_i2c.c @@ -0,0 +1,218 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ + + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include "drv_soft_i2c.h" +#include "board.h" + +#if defined RT_USING_I2C + +#if !defined(BSP_USING_I2C1) && !defined(BSP_USING_I2C2) && \ + !defined(BSP_USING_I2C3) && !defined(BSP_USING_I2C4) && \ + !defined(BSP_USING_I2C5) && !defined(BSP_USING_I2C6) +#error "Please define at least one BSP_USING_I2Cx" +#endif + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ + +static const struct hc32_soft_i2c_config soft_i2c_config[] = +{ +#ifdef BSP_USING_I2C1 + I2C1_BUS_CONFIG, +#endif +#ifdef BSP_USING_I2C2 + I2C2_BUS_CONFIG, +#endif +#ifdef BSP_USING_I2C3 + I2C3_BUS_CONFIG, +#endif +#ifdef BSP_USING_I2C4 + I2C4_BUS_CONFIG, +#endif +#ifdef BSP_USING_I2C5 + I2C5_BUS_CONFIG, +#endif +#ifdef BSP_USING_I2C6 + I2C6_BUS_CONFIG, +#endif +}; + + +static struct hc32_i2c i2c_obj[sizeof(soft_i2c_config) / sizeof(soft_i2c_config[0])]; + + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +/** + * This function initializes the i2c pin. + * + * @param Hc32 i2c dirver class. + */ +static void hc32_i2c_gpio_init(struct hc32_i2c *i2c) +{ + struct hc32_soft_i2c_config* cfg = (struct hc32_soft_i2c_config*)i2c->ops.data; + + rt_pin_mode(cfg->scl_pin, PIN_MODE_OUTPUT); + rt_pin_mode(cfg->sda_pin, PIN_MODE_OUTPUT); + + rt_pin_write(cfg->scl_pin, PIN_HIGH); + rt_pin_write(cfg->sda_pin, PIN_HIGH); +} + +/** + * This function sets the sda pin. + * + * @param Hc32 config class. + * @param The sda pin state. + */ +static void hc32_set_sda(void *data, rt_int32_t state) +{ + struct hc32_soft_i2c_config* cfg = (struct hc32_soft_i2c_config*)data; + + rt_pin_mode(cfg->sda_pin, PIN_MODE_OUTPUT); + + if (state) + rt_pin_write(cfg->sda_pin, PIN_HIGH); + else + rt_pin_write(cfg->sda_pin, PIN_LOW); +} + +/** + * This function sets the scl pin. + * + * @param Hc32 config class. + * @param The scl pin state. + */ +static void hc32_set_scl(void *data, rt_int32_t state) +{ + struct hc32_soft_i2c_config* cfg = (struct hc32_soft_i2c_config*)data; + + rt_pin_mode(cfg->scl_pin, PIN_MODE_OUTPUT); + + if (state) + rt_pin_write(cfg->scl_pin, PIN_HIGH); + else + rt_pin_write(cfg->scl_pin, PIN_LOW); +} + +/** + * This function gets the sda pin state. + * + * @param The sda pin state. + */ +static rt_int32_t hc32_get_sda(void *data) +{ + struct hc32_soft_i2c_config* cfg = (struct hc32_soft_i2c_config*)data; + + rt_pin_mode(cfg->sda_pin, PIN_MODE_INPUT); + + return rt_pin_read(cfg->sda_pin); +} + +/** + * This function gets the scl pin state. + * + * @param The scl pin state. + */ +static rt_int32_t hc32_get_scl(void *data) +{ + struct hc32_soft_i2c_config* cfg = (struct hc32_soft_i2c_config*)data; + + rt_pin_mode(cfg->scl_pin, PIN_MODE_INPUT); + + return rt_pin_read(cfg->scl_pin); +} + +static void hc32_udelay(rt_uint32_t us) +{ + rt_hw_us_delay(us); +} + +static const struct rt_i2c_bit_ops hc32_bit_ops = +{ + .data = RT_NULL, + .set_sda = hc32_set_sda, + .set_scl = hc32_set_scl, + .get_sda = hc32_get_sda, + .get_scl = hc32_get_scl, + .udelay = hc32_udelay, + .delay_us = 1, + .timeout = 100 +}; + +static rt_err_t hc32_i2c_bus_unlock(const struct hc32_soft_i2c_config *cfg) +{ + rt_uint32_t i = 0; + + if (PIN_LOW == rt_pin_read(cfg->sda_pin)) + { + while (i++ < 9) + { + rt_pin_write(cfg->scl_pin, PIN_HIGH); + //HC32_udelay(100); + rt_pin_write(cfg->scl_pin, PIN_LOW); + //hc32_udelay(100); + } + } + if(PIN_LOW == rt_pin_read(cfg->sda_pin)) + return RT_ERROR; + + return RT_EOK; +} + +/* I2C initialization function */ +int hc32_hw_i2c_init(void) +{ + rt_size_t obj_num = sizeof(i2c_obj) / sizeof(struct hc32_i2c); + rt_err_t result; + + for (int i = 0; i < obj_num; i++) + { + i2c_obj[i].ops = hc32_bit_ops; + i2c_obj[i].ops.data = (void*)&soft_i2c_config[i]; + i2c_obj[i].i2c1_bus.priv = &i2c_obj[i].ops; + hc32_i2c_gpio_init(&i2c_obj[i]); + result = rt_i2c_bit_add_bus(&i2c_obj[i].i2c1_bus, soft_i2c_config[i].bus_name); + RT_ASSERT(result == RT_EOK); + hc32_i2c_bus_unlock(&soft_i2c_config[i]); + } + + return RT_EOK; +} +INIT_BOARD_EXPORT(hc32_hw_i2c_init); + + +#endif /* RT_USING_I2C */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/drivers/drv_soft_i2c.h b/bsp/hc32f4a0/drivers/drv_soft_i2c.h new file mode 100644 index 0000000000..64dec1184b --- /dev/null +++ b/bsp/hc32f4a0/drivers/drv_soft_i2c.h @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ + + +#ifndef __DRV_I2C_H__ +#define __DRV_I2C_H__ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include +#include "hc32_ddl.h" + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ +struct hc32_soft_i2c_config +{ + rt_uint16_t scl_pin; + rt_uint16_t sda_pin; + const char *bus_name; +}; + +#ifdef BSP_USING_I2C1 +#define I2C1_BUS_CONFIG \ + { \ + .scl_pin = BSP_I2C1_SCL_PIN, \ + .sda_pin = BSP_I2C1_SDA_PIN, \ + .bus_name = "i2c1", \ + } +#endif + +#ifdef BSP_USING_I2C2 +#define I2C2_BUS_CONFIG \ + { \ + .scl = BSP_I2C2_SCL_PIN, \ + .sda = BSP_I2C2_SDA_PIN, \ + .bus_name = "i2c2", \ + } +#endif + +#ifdef BSP_USING_I2C3 +#define I2C3_BUS_CONFIG \ + { \ + .scl = BSP_I2C3_SCL_PIN, \ + .sda = BSP_I2C3_SDA_PIN, \ + .bus_name = "i2c3", \ + } +#endif + +#ifdef BSP_USING_I2C4 +#define I2C4_BUS_CONFIG \ + { \ + .scl = BSP_I2C4_SCL_PIN, \ + .sda = BSP_I2C4_SDA_PIN, \ + .bus_name = "i2c4", \ + } +#endif + +#ifdef BSP_USING_I2C5 +#define I2C5_BUS_CONFIG \ + { \ + .scl = BSP_I2C5_SCL_PIN, \ + .sda = BSP_I2C5_SDA_PIN, \ + .bus_name = "i2c5", \ + } +#endif + +#ifdef BSP_USING_I2C6 +#define I2C6_BUS_CONFIG \ + { \ + .scl = BSP_I2C6_SCL_PIN, \ + .sda = BSP_I2C6_SDA_PIN, \ + .bus_name = "i2c6", \ + } +#endif + +/** + ******************************************************************************* + ** \brief Open parameters. + ******************************************************************************* + */ +struct hc32_i2c_config +{ + rt_uint8_t scl; + rt_uint8_t sda; + const char *bus_name; +}; + +struct hc32_i2c +{ + struct rt_i2c_bit_ops ops; + struct rt_i2c_bus_device i2c1_bus; +}; + + +typedef struct hc32_i2c_instance +{ + rt_uint32_t id; + void *handle; + stc_i2c_init_t init; +} hc32_i2c_instance_t; + + +int hc32_hw_i2c_init(void); + +#ifdef __cplusplus +} +#endif + +#endif /* __DRV_I2C_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/drivers/drv_spi.c b/bsp/hc32f4a0/drivers/drv_spi.c new file mode 100644 index 0000000000..e4e29f6910 --- /dev/null +++ b/bsp/hc32f4a0/drivers/drv_spi.c @@ -0,0 +1,1004 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ + + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include +#include "drv_spi.h" + + +#if defined(RT_USING_SPI) && defined(RT_USING_PIN) +#include + +#if !defined(BSP_USING_SPI1) && !defined(BSP_USING_SPI2) && \ + !defined(BSP_USING_SPI3) && !defined(BSP_USING_SPI4) && \ + !defined(BSP_USING_SPI5) && !defined(BSP_USING_SPI6) +#error "Please define at least one SPIx" +#endif + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +/* #define DEBUG */ +#ifndef HC32_SPI_DEBUG +#define SPI_PRINT_DBG(fmt, args...) +#define SPI_PRINT_ERR(fmt, args...) rt_kprintf(fmt, ##args); +#else +#define SPI_PRINT_DBG(fmt, args...) rt_kprintf(fmt, ##args); +#define SPI_PRINT_ERR(fmt, args...) rt_kprintf(fmt, ##args); +#endif + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ + +/* private rt-thread spi ops function */ +static rt_err_t hc32_spi_configure(struct rt_spi_device* device, + struct rt_spi_configuration* configuration); +static rt_uint32_t hc32_spi_xfer(struct rt_spi_device* device, + struct rt_spi_message* message); + +#if defined(BSP_USING_SPI1) +static void spi1_rx_dma_irq_handle(void); +static void spi1_tx_dma_irq_handle(void); +#endif /* BSP_USING_SPI1 */ + +#if defined(BSP_USING_SPI2) +static void spi2_rx_dma_irq_handle(void); +static void spi2_tx_dma_irq_handle(void); +#endif /* BSP_USING_SPI2 */ + +#if defined(BSP_USING_SPI3) +static void spi3_rx_dma_irq_handle(void); +static void spi3_tx_dma_irq_handle(void); +#endif /* BSP_USING_SPI3 */ + +#if defined(BSP_USING_SPI4) +static void spi4_rx_dma_irq_handle(void); +static void spi4_tx_dma_irq_handle(void); +#endif /* BSP_USING_SPI4 */ + +#if defined(BSP_USING_SPI5) +static void spi5_rx_dma_irq_handle(void); +static void spi5_tx_dma_irq_handle(void); +#endif /* BSP_USING_SPI5 */ + +#if defined(BSP_USING_SPI6) +static void spi6_rx_dma_irq_handle(void); +static void spi6_tx_dma_irq_handle(void); +#endif /* BSP_USING_SPI6 */ + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ +enum +{ +#ifdef BSP_USING_SPI1 + SPI1_INDEX, +#endif +#ifdef BSP_USING_SPI2 + SPI2_INDEX, +#endif +#ifdef BSP_USING_SPI3 + SPI3_INDEX, +#endif +#ifdef BSP_USING_SPI4 + SPI4_INDEX, +#endif +#ifdef BSP_USING_SPI5 + SPI5_INDEX, +#endif +#ifdef BSP_USING_SPI6 + SPI6_INDEX, +#endif + SPI_INDEX_MAX, +}; + +static const struct spi_index spi_map[] = +{ +#ifdef BSP_USING_SPI1 + {SPI1_INDEX, M4_SPI1}, +#endif +#ifdef BSP_USING_SPI2 + {SPI2_INDEX, M4_SPI2}, +#endif +#ifdef BSP_USING_SPI3 + {SPI3_INDEX, M4_SPI3}, +#endif +#ifdef BSP_USING_SPI4 + {SPI4_INDEX, M4_SPI4}, +#endif +#ifdef BSP_USING_SPI5 + {SPI5_INDEX, M4_SPI5}, +#endif +#ifdef BSP_USING_SPI6 + {SPI6_INDEX, M4_SPI6}, +#endif +}; + +static struct hc32_spi_config spi_config[] = +{ +#ifdef BSP_USING_SPI1 + SPI1_BUS_CONFIG, +#endif + +#ifdef BSP_USING_SPI2 + SPI2_BUS_CONFIG, +#endif + +#ifdef BSP_USING_SPI3 + SPI3_BUS_CONFIG, +#endif + +#ifdef BSP_USING_SPI4 + SPI4_BUS_CONFIG, +#endif + +#ifdef BSP_USING_SPI5 + SPI5_BUS_CONFIG, +#endif + +#ifdef BSP_USING_SPI6 + SPI6_BUS_CONFIG, +#endif +}; + +static const struct spi_irq_handler spi_irq_handlers[] = +{ +#ifdef BSP_USING_SPI1 + {spi1_rx_dma_irq_handle, spi1_tx_dma_irq_handle}, +#endif + +#ifdef BSP_USING_SPI2 + {spi2_rx_dma_irq_handle, spi2_tx_dma_irq_handle}, +#endif + +#ifdef BSP_USING_SPI3 + {spi3_rx_dma_irq_handle, spi3_tx_dma_irq_handle}, +#endif + +#ifdef BSP_USING_SPI4 + {spi4_rx_dma_irq_handle, spi4_tx_dma_irq_handle}, +#endif + +#ifdef BSP_USING_SPI5 + {spi5_rx_dma_irq_handle, spi5_tx_dma_irq_handle}, +#endif + +#ifdef BSP_USING_SPI6 + {spi6_rx_dma_irq_handle, spi6_tx_dma_irq_handle}, +#endif +}; + +static struct hc32_spi spi_bus_obj[sizeof(spi_config) / sizeof(spi_config[0])] = {0}; + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ +extern void hc32_board_spi_init(M4_SPI_TypeDef *M4_SPIx, rt_uint8_t mode); + +/** + * @brief This function gets index for specific SPI_Instance. + * @param Instance + * @retval index + */ +static uint32_t get_spi_index(M4_SPI_TypeDef *Instance) +{ + uint32_t index = SPI_INDEX_MAX; + + for (uint8_t i = 0U; i < ARRAY_SZ(spi_map); i++) + { + if (spi_map[i].Instance == Instance) + { + index = spi_map[i].index; + RT_ASSERT(index < SPI_INDEX_MAX) + break; + } + } + + return index; +} + +static uint32_t get_spi_fcg(M4_SPI_TypeDef *Instance) +{ + return (PWC_FCG1_SPI1 << get_spi_index(Instance)); +} + +rt_err_t hc32_spi_init(struct hc32_spi *spi_drv, struct rt_spi_configuration *cfg) +{ + RT_ASSERT(spi_drv != RT_NULL); + RT_ASSERT(cfg != RT_NULL); + + stc_spi_init_t stcSpiInit; + stc_clk_freq_t stcClkFreq; + + M4_SPI_TypeDef *spi_handle = spi_drv->handle.Instance; + + /* Enable spi clock gate */ + PWC_Fcg1PeriphClockCmd(get_spi_fcg(spi_handle), Enable); + + /* Init spi struct as default value */ + SPI_StructInit(&stcSpiInit); + + /* Slave or master mode */ + if (cfg->mode & RT_SPI_SLAVE) + { + stcSpiInit.u32MasterSlave = SPI_SLAVE; + } + else + { + stcSpiInit.u32MasterSlave = SPI_MASTER; + } + /* 3 wire or 4 wire mode */ + if (cfg->mode & RT_SPI_3WIRE) + { + stcSpiInit.u32WireMode = SPI_WIRE_3; + } + else + { + stcSpiInit.u32WireMode = SPI_WIRE_4; + } + /* spi mode */ + if (0x00 == (cfg->mode & (RT_SPI_CPHA | RT_SPI_CPOL))) + { + stcSpiInit.u32SpiMode = SPI_MODE_0; + } + else if (0x01 == (cfg->mode & (RT_SPI_CPHA | RT_SPI_CPOL))) + { + stcSpiInit.u32SpiMode = SPI_MODE_1; + } + else if (0x02 == (cfg->mode & (RT_SPI_CPHA | RT_SPI_CPOL))) + { + stcSpiInit.u32SpiMode = SPI_MODE_2; + } + else if (0x03 == (cfg->mode & (RT_SPI_CPHA | RT_SPI_CPOL))) + { + stcSpiInit.u32SpiMode = SPI_MODE_3; + } + /* LSB or MSB */ + if (cfg->mode & RT_SPI_MSB) + { + stcSpiInit.u32FirstBit = SPI_FIRST_MSB; + } + else + { + stcSpiInit.u32FirstBit = SPI_FIRST_LSB; + } + + /* config data width 4~16, 20, 24, 32 */ + if (4u > cfg->data_width) + { + return RT_EIO; + } + else if (16u >= cfg->data_width) + { + stcSpiInit.u32DataBits = ((cfg->data_width - 4u) << 8u); + } + else if (20u == cfg->data_width) + { + stcSpiInit.u32DataBits = SPI_DATA_SIZE_20BIT; + } + else if (24u == cfg->data_width) + { + stcSpiInit.u32DataBits = SPI_DATA_SIZE_24BIT; + } + else if (32u == cfg->data_width) + { + stcSpiInit.u32DataBits = SPI_DATA_SIZE_32BIT; + } + else + { + return RT_EIO; + } + + /* Get APB clock */ + CLK_GetClockFreq(&stcClkFreq); + if (cfg->max_hz >= stcClkFreq.pclk1Freq / 2u) + { + stcSpiInit.u32BaudRatePrescaler = SPI_BR_PCLK1_DIV2; + } + else if (cfg->max_hz >= stcClkFreq.pclk1Freq / 4u) + { + stcSpiInit.u32BaudRatePrescaler = SPI_BR_PCLK1_DIV4; + } + else if (cfg->max_hz >= stcClkFreq.pclk1Freq / 8u) + { + stcSpiInit.u32BaudRatePrescaler = SPI_BR_PCLK1_DIV8; + } + else if (cfg->max_hz >= stcClkFreq.pclk1Freq / 16u) + { + stcSpiInit.u32BaudRatePrescaler = SPI_BR_PCLK1_DIV16; + } + else if (cfg->max_hz >= stcClkFreq.pclk1Freq / 32u) + { + stcSpiInit.u32BaudRatePrescaler = SPI_BR_PCLK1_DIV32; + } + else if (cfg->max_hz >= stcClkFreq.pclk1Freq / 64u) + { + stcSpiInit.u32BaudRatePrescaler = SPI_BR_PCLK1_DIV64; + } + else if (cfg->max_hz >= stcClkFreq.pclk1Freq / 128u) + { + stcSpiInit.u32BaudRatePrescaler = SPI_BR_PCLK1_DIV128; + } + else if (cfg->max_hz >= stcClkFreq.pclk1Freq / 256u) + { + stcSpiInit.u32BaudRatePrescaler = SPI_BR_PCLK1_DIV256; + } + + /* spi port init */ + hc32_board_spi_init(spi_handle, cfg->mode); + + if (Ok != SPI_Init(spi_handle, &stcSpiInit)) + { + return RT_EIO; + } + + /* DMA configuration */ + if (spi_drv->spi_dma_flag & RT_DEVICE_FLAG_DMA_RX) + { + struct dma_config *spi_dma; + stc_dma_init_t stcDmaInit; + + /* Get spi dma_rx */ + spi_dma = spi_drv->config->dma_rx; + + /* Config Dma */ + DMA_StructInit(&stcDmaInit); + stcDmaInit.u32IntEn = DMA_INT_ENABLE; + stcDmaInit.u32BlockSize = 1UL; + stcDmaInit.u32TransCnt = 0; + stcDmaInit.u32DestAddr = 0; + stcDmaInit.u32SrcAddr = (uint32_t)(&spi_handle->DR); + stcDmaInit.u32SrcInc = DMA_SRC_ADDR_FIX; + stcDmaInit.u32DestInc = DMA_DEST_ADDR_INC; + + if (8u >= cfg->data_width) + { + stcDmaInit.u32DataWidth = DMA_DATAWIDTH_8BIT; + } + else if (16u >= cfg->data_width) + { + stcDmaInit.u32DataWidth = DMA_DATAWIDTH_16BIT; + } + else + { + stcDmaInit.u32DataWidth = DMA_DATAWIDTH_32BIT; + } + /* Enable Dma clock gate */ + if (M4_DMA1 == spi_dma->Instance) + { + PWC_Fcg0PeriphClockCmd(PWC_FCG0_DMA1, Enable); + } + else + { + PWC_Fcg0PeriphClockCmd(PWC_FCG0_DMA2, Enable); + } + /* Init Dma */ + if (Ok != DMA_Init(spi_dma->Instance, spi_dma->channel, &stcDmaInit)) + { + return RT_EIO; + } + + /* register interrupt */ + hc32_install_irq_handler(&spi_dma->irq_config, + spi_irq_handlers[get_spi_index(spi_handle)].rx_dma_irq_handler, + RT_TRUE); + + /* Enable Dma */ + DMA_Cmd(spi_dma->Instance, Enable); + } + if (spi_drv->spi_dma_flag & RT_DEVICE_FLAG_DMA_TX) + { + struct dma_config *spi_dma; + stc_dma_init_t stcDmaInit; + + /* Get spi dma_tx */ + spi_dma = spi_drv->config->dma_tx; + + /* Config Dma */ + DMA_StructInit(&stcDmaInit); + stcDmaInit.u32IntEn = DMA_INT_ENABLE; + stcDmaInit.u32BlockSize = 1UL; + stcDmaInit.u32TransCnt = 0; + stcDmaInit.u32DestAddr = (uint32_t)(&spi_handle->DR);; + stcDmaInit.u32SrcAddr = 0; + stcDmaInit.u32SrcInc = DMA_SRC_ADDR_INC; + stcDmaInit.u32DestInc = DMA_DEST_ADDR_FIX; + + if (8u >= cfg->data_width) + { + stcDmaInit.u32DataWidth = DMA_DATAWIDTH_8BIT; + } + else if (16u >= cfg->data_width) + { + stcDmaInit.u32DataWidth = DMA_DATAWIDTH_16BIT; + } + else + { + stcDmaInit.u32DataWidth = DMA_DATAWIDTH_32BIT; + } + /* Enable Dma clock gate */ + if (M4_DMA1 == spi_dma->Instance) + { + PWC_Fcg0PeriphClockCmd(PWC_FCG0_DMA1 | PWC_FCG0_AOS, Enable); + } + else + { + PWC_Fcg0PeriphClockCmd(PWC_FCG0_DMA2 | PWC_FCG0_AOS, Enable); + } + /* Init Dma */ + if (Ok != DMA_Init(spi_dma->Instance, spi_dma->channel, &stcDmaInit)) + { + return RT_EIO; + } + + /* register interrupt */ + hc32_install_irq_handler(&spi_dma->irq_config, + spi_irq_handlers[get_spi_index(spi_handle)].tx_dma_irq_handler, + RT_TRUE); + + /* Enable Dma */ + DMA_Cmd(spi_dma->Instance, Enable); + } + + return RT_EOK; +} + +static void hc32_spi_deinit(struct hc32_spi *spi_drv) +{ + M4_SPI_TypeDef *spi_handle = spi_drv->handle.Instance; + + SPI_DeInit(spi_handle); + + /* Disable spi clock gate */ + PWC_Fcg1PeriphClockCmd(get_spi_fcg(spi_handle), Disable); +} + +static rt_err_t hc32_spi_dma(struct hc32_spi_config *spi_dma, const uint8_t *pvTxBuf, void *pvRxBuf, uint32_t u32Length) +{ + if (RT_NULL == pvTxBuf) + { + DMA_SetDestAddr(spi_dma->dma_rx->Instance, spi_dma->dma_rx->channel, (uint32_t)pvRxBuf); + DMA_SetTransCnt(spi_dma->dma_rx->Instance, spi_dma->dma_rx->channel, u32Length); + DMA_SetTriggerSrc(spi_dma->dma_rx->Instance, spi_dma->dma_rx->channel,spi_dma->dma_rx->trigger_evt_src); + DMA_ChannelCmd(spi_dma->dma_rx->Instance, spi_dma->dma_rx->channel, Enable); + } + else if (RT_NULL == pvRxBuf) + { + DMA_SetSrcAddr(spi_dma->dma_tx->Instance, spi_dma->dma_tx->channel, (uint32_t)pvTxBuf); + DMA_SetTransCnt(spi_dma->dma_tx->Instance, spi_dma->dma_tx->channel, u32Length); + DMA_SetTriggerSrc(spi_dma->dma_tx->Instance, spi_dma->dma_tx->channel,spi_dma->dma_tx->trigger_evt_src); + DMA_ChannelCmd(spi_dma->dma_tx->Instance, spi_dma->dma_tx->channel, Enable); + } + else + { + DMA_SetDestAddr(spi_dma->dma_rx->Instance, spi_dma->dma_rx->channel, (uint32_t)pvRxBuf); + DMA_SetTransCnt(spi_dma->dma_rx->Instance, spi_dma->dma_rx->channel, u32Length); + DMA_SetTriggerSrc(spi_dma->dma_rx->Instance, spi_dma->dma_rx->channel,spi_dma->dma_rx->trigger_evt_src); + + DMA_SetSrcAddr(spi_dma->dma_tx->Instance, spi_dma->dma_tx->channel, (uint32_t)pvTxBuf); + DMA_SetTransCnt(spi_dma->dma_tx->Instance, spi_dma->dma_tx->channel, u32Length); + DMA_SetTriggerSrc(spi_dma->dma_tx->Instance, spi_dma->dma_tx->channel,spi_dma->dma_tx->trigger_evt_src); + + DMA_ChannelCmd(spi_dma->dma_tx->Instance, spi_dma->dma_tx->channel, Enable); + DMA_ChannelCmd(spi_dma->dma_rx->Instance, spi_dma->dma_rx->channel, Enable); + } + + SPI_FunctionCmd(spi_dma->Instance, Enable); + + return RT_EOK; +} + +static struct rt_spi_ops hc32_spi_ops = +{ + .configure = hc32_spi_configure, + .xfer = hc32_spi_xfer, +}; + +static rt_err_t hc32_spi_configure(struct rt_spi_device *device, + struct rt_spi_configuration *configuration) +{ + RT_ASSERT(device != RT_NULL); + RT_ASSERT(configuration != RT_NULL); + + struct hc32_spi *spi_drv = rt_container_of(device->bus, struct hc32_spi, spi_bus); + spi_drv->cfg = configuration; + return hc32_spi_init(spi_drv, configuration); +} + +static rt_uint32_t hc32_spi_xfer(struct rt_spi_device *device, struct rt_spi_message *message) +{ + rt_uint8_t state; + rt_size_t message_length, already_send_length; + rt_uint16_t send_length; + rt_uint8_t *recv_buf; + const rt_uint8_t *send_buf; + + RT_ASSERT(device != RT_NULL); + RT_ASSERT(device->bus != RT_NULL); + RT_ASSERT(device->bus->parent.user_data != RT_NULL); + RT_ASSERT(message != RT_NULL); + + struct hc32_spi *spi_drv = rt_container_of(device->bus, struct hc32_spi, spi_bus); + SPI_HandleType *spi_handle = &spi_drv->handle; + struct hc32_hw_spi_cs *cs = device->parent.user_data; + + if (message->cs_take) + { + GPIO_ResetPins(cs->port, cs->pin); + } + message_length = message->length; + recv_buf = message->recv_buf; + send_buf = message->send_buf; + while (message_length) + { + if (message_length > 65535) + { + send_length = 65535; + message_length = message_length - 65535; + } + else + { + send_length = message_length; + message_length = 0; + } + + /* calculate the start address */ + already_send_length = message->length - send_length - message_length; + send_buf = (rt_uint8_t *)message->send_buf + already_send_length; + recv_buf = (rt_uint8_t *)message->recv_buf + already_send_length; + + if(message->send_buf && message->recv_buf) + { + if ((spi_drv->spi_dma_flag & RT_DEVICE_FLAG_DMA_TX) && (spi_drv->spi_dma_flag & RT_DEVICE_FLAG_DMA_RX)) + { + state = hc32_spi_dma(spi_drv->config, send_buf, recv_buf, send_length); + } + else + { + SPI_FunctionCmd(spi_handle->Instance, Enable); + state = SPI_TransmitReceive(spi_handle->Instance, send_buf, recv_buf, send_length); + } + } + else if(message->send_buf) + { + if (spi_drv->spi_dma_flag & RT_DEVICE_FLAG_DMA_TX) + { + state = hc32_spi_dma(spi_drv->config, send_buf, RT_NULL, send_length); + } + else + { + SPI_FunctionCmd(spi_handle->Instance, Enable); + state = SPI_Transmit(spi_handle->Instance, send_buf, send_length); + } + if (message->cs_release && (device->config.mode & RT_SPI_3WIRE)) + { + SPI_FunctionCmd(spi_handle->Instance, Disable); + } + } + else + { + rt_memset((uint8_t *)recv_buf, 0xff, send_length); + if (spi_drv->spi_dma_flag & RT_DEVICE_FLAG_DMA_RX) + { + state = hc32_spi_dma(spi_drv->config, RT_NULL, recv_buf, send_length); + } + else + { + SPI_FunctionCmd(spi_handle->Instance, Enable); + state = SPI_Receive(spi_handle->Instance, recv_buf, send_length); + } + } + if(state != RT_EOK) + { + message->length = 0; + } + /* wait spi transfer complete */ + while(Reset != SPI_GetStatus(spi_handle->Instance, SPI_FLAG_IDLE)); + } + + if (message->cs_release) + { + GPIO_SetPins(cs->port, cs->pin); + } + + return message->length; +} + +/** + * Attach the spi device to SPI bus, this function must be used after initialization. + */ +rt_err_t hc32_hw_spi_device_attach(const char *bus_name, + const char *device_name, + uint8_t cs_gpio_port, + uint16_t cs_gpio_pin) +{ + RT_ASSERT(bus_name != RT_NULL); + RT_ASSERT(device_name != RT_NULL); + + rt_err_t result; + struct rt_spi_device *spi_device; + struct hc32_hw_spi_cs *cs_pin; + stc_gpio_init_t stcGpioInit; + + GPIO_StructInit(&stcGpioInit); + stcGpioInit.u16PinState = PIN_STATE_SET; + stcGpioInit.u16PinDir = PIN_DIR_OUT; + stcGpioInit.u16PullUp = PIN_PU_ON; + stcGpioInit.u16PinDrv = PIN_DRV_HIGH; + GPIO_Init(SPI1_NSS_PORT, SPI1_NSS_PIN, &stcGpioInit); + + /* attach the device to spi bus*/ + spi_device = (struct rt_spi_device *)rt_malloc(sizeof(struct rt_spi_device)); + RT_ASSERT(spi_device != RT_NULL); + cs_pin = (struct hc32_hw_spi_cs *)rt_malloc(sizeof(struct hc32_hw_spi_cs)); + RT_ASSERT(cs_pin != RT_NULL); + cs_pin->port = cs_gpio_port; + cs_pin->pin = cs_gpio_pin; + result = rt_spi_bus_attach_device(spi_device, device_name, bus_name, (void *)cs_pin); + + return result; +} + +static int hc32_hw_spi_bus_init(void) +{ + rt_err_t result; + + for (int i = 0; i < sizeof(spi_config) / sizeof(spi_config[0]); i++) + { + spi_bus_obj[i].config = &spi_config[i]; + spi_bus_obj[i].spi_bus.parent.user_data = &spi_config[i]; + spi_bus_obj[i].handle.Instance = spi_config[i].Instance; + result = rt_spi_bus_register(&spi_bus_obj[i].spi_bus, spi_config[i].bus_name, &hc32_spi_ops); + } + return result; +} + +/** + * @brief Clear DMA transfer complete flag. + * @param dma specific dam witch spi used. + * @retval None + */ +static void hc32_dma_irq_handle(struct dma_config *dma) +{ + dma->Instance->INTCLR1 |= (1u << dma->channel); +} + + +#if defined(BSP_USING_SPI1) +/** + * @brief This function handles DMA Rx complete interrupt request. + * @param None + * @retval None + */ +static void spi1_rx_dma_irq_handle(void) +{ + #if defined(BSP_SPI1_RX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_dma_irq_handle(spi_config[SPI1_INDEX].dma_rx); + SPI_FunctionCmd(spi_config[SPI1_INDEX].Instance, Disable); + + /* leave interrupt */ + rt_interrupt_leave(); + #endif /* BSP_SPI1_RX_USING_DMA */ +} + +/** + * @brief This function handles DMA Tx complete interrupt request. + * @param None + * @retval None + */ +static void spi1_tx_dma_irq_handle(void) +{ + #if defined(BSP_SPI1_TX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_dma_irq_handle(spi_config[SPI1_INDEX].dma_tx); + + /* leave interrupt */ + rt_interrupt_leave(); + #endif /* BSP_SPI1_TX_USING_DMA */ +} +#endif /* BSP_USING_SPI1 */ + +#if defined(BSP_USING_SPI2) +/** + * @brief This function handles DMA Rx complete interrupt request. + * @param None + * @retval None + */ +static void spi2_rx_dma_irq_handle(void) +{ + #if defined(BSP_SPI2_RX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_dma_irq_handle(spi_config[SPI2_INDEX].dma_rx); + SPI_FunctionCmd(spi_config[SPI2_INDEX].Instance, Disable); + + /* leave interrupt */ + rt_interrupt_leave(); + #endif /* BSP_SPI2_RX_USING_DMA */ +} + +/** + * @brief This function handles DMA Tx complete interrupt request. + * @param None + * @retval None + */ +static void spi2_tx_dma_irq_handle(void) +{ + #if defined(BSP_SPI2_TX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_dma_irq_handle(spi_config[SPI2_INDEX].dma_tx); + + /* leave interrupt */ + rt_interrupt_leave(); + #endif /* BSP_SPI2_TX_USING_DMA */ +} +#endif /* BSP_USING_SPI2 */ + +#if defined(BSP_USING_SPI3) +/** + * @brief This function handles DMA Rx complete interrupt request. + * @param None + * @retval None + */ +static void spi3_rx_dma_irq_handle(void) +{ + #if defined(BSP_SPI3_RX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_dma_irq_handle(spi_config[SPI3_INDEX].dma_rx); + SPI_FunctionCmd(spi_config[SPI3_INDEX].Instance, Disable); + + /* leave interrupt */ + rt_interrupt_leave(); + #endif /* BSP_SPI3_RX_USING_DMA */ +} + +/** + * @brief This function handles DMA Tx complete interrupt request. + * @param None + * @retval None + */ +static void spi3_tx_dma_irq_handle(void) +{ + #if defined(BSP_SPI3_TX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_dma_irq_handle(spi_config[SPI3_INDEX].dma_tx); + + + /* leave interrupt */ + rt_interrupt_leave(); + #endif /* BSP_SPI3_TX_USING_DMA */ +} +#endif /* BSP_USING_SPI3 */ + +#if defined(BSP_USING_SPI4) +/** + * @brief This function handles DMA Rx complete interrupt request. + * @param None + * @retval None + */ +static void spi4_rx_dma_irq_handle(void) +{ + #if defined(BSP_SPI4_RX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_dma_irq_handle(spi_config[SPI4_INDEX].dma_rx); + SPI_FunctionCmd(spi_config[SPI4_INDEX].Instance, Disable); + + /* leave interrupt */ + rt_interrupt_leave(); + #endif /* BSP_SPI4_RX_USING_DMA */ +} + +/** + * @brief This function handles DMA Tx complete interrupt request. + * @param None + * @retval None + */ +static void spi4_tx_dma_irq_handle(void) +{ + #if defined(BSP_SPI4_TX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_dma_irq_handle(spi_config[SPI4_INDEX].dma_tx); + + /* leave interrupt */ + rt_interrupt_leave(); + #endif /* BSP_SPI4_TX_USING_DMA */ +} +#endif /* BSP_USING_SPI4 */ + +#if defined(BSP_USING_SPI5) +/** + * @brief This function handles DMA Rx complete interrupt request. + * @param None + * @retval None + */ +static void spi5_rx_dma_irq_handle(void) +{ + #if defined(BSP_SPI5_RX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_dma_irq_handle(spi_config[SPI5_INDEX].dma_rx); + SPI_FunctionCmd(spi_config[SPI5_INDEX].Instance, Disable); + + /* leave interrupt */ + rt_interrupt_leave(); + #endif /* BSP_SPI5_RX_USING_DMA */ +} + +/** + * @brief This function handles DMA Tx complete interrupt request. + * @param None + * @retval None + */ +static void spi5_tx_dma_irq_handle(void) +{ + #if defined(BSP_SPI5_TX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_dma_irq_handle(spi_config[SPI5_INDEX].dma_tx); + + /* leave interrupt */ + rt_interrupt_leave(); + #endif /* BSP_SPI5_TX_USING_DMA */ +} +#endif /* BSP_USING_SPI5 */ + +#if defined(BSP_USING_SPI6) +/** + * @brief This function handles DMA Rx complete interrupt request. + * @param None + * @retval None + */ +static void spi6_rx_dma_irq_handle(void) +{ + #if defined(BSP_SPI6_RX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_dma_irq_handle(spi_config[SPI6_INDEX].dma_rx); + SPI_FunctionCmd(spi_config[SPI6_INDEX].Instance, Disable); + + /* leave interrupt */ + rt_interrupt_leave(); + #endif /* BSP_SPI6_RX_USING_DMA */ +} + +/** + * @brief This function handles DMA Tx complete interrupt request. + * @param None + * @retval None + */ +static void spi6_tx_dma_irq_handle(void) +{ + #if defined(BSP_SPI6_TX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_dma_irq_handle(spi_config[SPI6_INDEX].dma_tx); + + /* leave interrupt */ + rt_interrupt_leave(); + #endif /* BSP_SPI6_TX_USING_DMA */ +} +#endif /* BSP_USING_SPI6 */ + +/** + * @brief This function gets dma witch spi used infomation include unit, + * channel, interrupt etc. + * @param None + * @retval None + */ +static void hc32_get_dma_info(void) +{ +#ifdef BSP_SPI1_RX_USING_DMA + spi_bus_obj[SPI1_INDEX].spi_dma_flag |= RT_DEVICE_FLAG_DMA_RX; + static struct dma_config spi1_dma_rx = SPI1_RX_DMA_CONFIG; + spi_config[SPI1_INDEX].dma_rx = &spi1_dma_rx; +#endif +#ifdef BSP_SPI1_TX_USING_DMA + spi_bus_obj[SPI1_INDEX].spi_dma_flag |= RT_DEVICE_FLAG_DMA_TX; + static struct dma_config spi1_dma_tx = SPI1_TX_DMA_CONFIG; + spi_config[SPI1_INDEX].dma_tx = &spi1_dma_tx; +#endif + +#ifdef BSP_SPI2_RX_USING_DMA + spi_bus_obj[SPI2_INDEX].spi_dma_flag |= RT_DEVICE_FLAG_DMA_RX; + static struct dma_config spi2_dma_rx = SPI2_RX_DMA_CONFIG; + spi_config[SPI2_INDEX].dma_rx = &spi2_dma_rx; +#endif +#ifdef BSP_SPI2_TX_USING_DMA + spi_bus_obj[SPI2_INDEX].spi_dma_flag |= RT_DEVICE_FLAG_DMA_TX; + static struct dma_config spi2_dma_tx = SPI2_TX_DMA_CONFIG; + spi_config[SPI2_INDEX].dma_tx = &spi2_dma_tx; +#endif + +#ifdef BSP_SPI3_RX_USING_DMA + spi_bus_obj[SPI3_INDEX].spi_dma_flag |= RT_DEVICE_FLAG_DMA_RX; + static struct dma_config spi3_dma_rx = SPI3_RX_DMA_CONFIG; + spi_config[SPI3_INDEX].dma_rx = &spi3_dma_rx; +#endif +#ifdef BSP_SPI3_TX_USING_DMA + spi_bus_obj[SPI3_INDEX].spi_dma_flag |= RT_DEVICE_FLAG_DMA_TX; + static struct dma_config spi3_dma_tx = SPI3_TX_DMA_CONFIG; + spi_config[SPI3_INDEX].dma_tx = &spi3_dma_tx; +#endif + +#ifdef BSP_SPI4_RX_USING_DMA + spi_bus_obj[SPI4_INDEX].spi_dma_flag |= RT_DEVICE_FLAG_DMA_RX; + static struct dma_config spi4_dma_rx = SPI4_RX_DMA_CONFIG; + spi_config[SPI4_INDEX].dma_rx = &spi4_dma_rx; +#endif +#ifdef BSP_SPI4_TX_USING_DMA + spi_bus_obj[SPI4_INDEX].spi_dma_flag |= RT_DEVICE_FLAG_DMA_TX; + static struct dma_config spi4_dma_tx = SPI4_TX_DMA_CONFIG; + spi_config[SPI4_INDEX].dma_tx = &spi4_dma_tx; +#endif + +#ifdef BSP_SPI5_RX_USING_DMA + spi_bus_obj[SPI5_INDEX].spi_dma_flag |= RT_DEVICE_FLAG_DMA_RX; + static struct dma_config spi5_dma_rx = SPI5_RX_DMA_CONFIG; + spi_config[SPI5_INDEX].dma_rx = &spi5_dma_rx; +#endif +#ifdef BSP_SPI5_TX_USING_DMA + spi_bus_obj[SPI5_INDEX].spi_dma_flag |= RT_DEVICE_FLAG_DMA_TX; + static struct dma_config spi5_dma_tx = SPI5_TX_DMA_CONFIG; + spi_config[SPI5_INDEX].dma_tx = &spi5_dma_tx; +#endif + +#ifdef BSP_SPI6_RX_USING_DMA + spi_bus_obj[SPI6_INDEX].spi_dma_flag |= RT_DEVICE_FLAG_DMA_RX; + static struct dma_config spi6_dma_rx = SPI6_RX_DMA_CONFIG; + spi_config[SPI6_INDEX].dma_rx = &spi6_dma_rx; +#endif +#ifdef BSP_SPI6_TX_USING_DMA + spi_bus_obj[SPI6_INDEX].spi_dma_flag |= RT_DEVICE_FLAG_DMA_TX; + static struct dma_config spi6_dma_tx = SPI6_TX_DMA_CONFIG; + spi_config[SPI6_INDEX].dma_tx = &spi6_dma_tx; +#endif +} + +int hc32_hw_spi_init(void) +{ + hc32_get_dma_info(); + return hc32_hw_spi_bus_init(); +} + +INIT_BOARD_EXPORT(hc32_hw_spi_init); + +#endif /* BSP_USING_SPI */ diff --git a/bsp/hc32f4a0/drivers/drv_spi.h b/bsp/hc32f4a0/drivers/drv_spi.h new file mode 100644 index 0000000000..6458325222 --- /dev/null +++ b/bsp/hc32f4a0/drivers/drv_spi.h @@ -0,0 +1,377 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ + + +#ifndef __DRV_SPI_H__ +#define __DRV_SPI_H__ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include +#include "rtdevice.h" +#include "drv_dma.h" +#include "board_config.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef BSP_USING_SPI1 +#define SPI1_BUS_NAME "spi1" +#define SPI1_BUS_MUTEX_NAME "spi1_bus_mutex" +#endif +#ifdef BSP_USING_SPI2 +#define SPI2_BUS_NAME "spi2" +#define SPI2_BUS_MUTEX_NAME "spi2_bus_mutex" +#endif +#ifdef BSP_USING_SPI3 +#define SPI3_BUS_NAME "spi3" +#define SPI3_BUS_MUTEX_NAME "spi3_bus_mutex" +#endif +#ifdef BSP_USING_SPI4 +#define SPI4_BUS_NAME "spi4" +#define SPI4_BUS_MUTEX_NAME "spi4_bus_mutex" +#endif +#ifdef BSP_USING_SPI5 +#define SPI4_BUS_NAME "spi5" +#define SPI4_BUS_MUTEX_NAME "spi5_bus_mutex" +#endif +#ifdef BSP_USING_SPI6 +#define SPI4_BUS_NAME "spi6" +#define SPI4_BUS_MUTEX_NAME "spi6_bus_mutex" +#endif + +#ifdef BSP_USING_SPI1 +#ifndef SPI1_BUS_CONFIG +#define SPI1_BUS_CONFIG \ + { \ + .Instance = M4_SPI1, \ + .bus_name = SPI1_BUS_NAME, \ + } +#endif /* SPI1_BUS_CONFIG */ +#endif /* BSP_USING_SPI1 */ + +#ifdef BSP_SPI1_TX_USING_DMA +#ifndef SPI1_TX_DMA_CONFIG +#define SPI1_TX_DMA_CONFIG \ + { \ + .Instance = SPI1_TX_DMA_INSTANCE, \ + .channel = SPI1_TX_DMA_CHANNEL, \ + .trigger_evt_src = EVT_SPI1_SPTI, \ + .irq_config = \ + { \ + .irq = SPI1_TX_DMA_IRQn, \ + .irq_prio = SPI1_TX_DMA_INT_PRIO, \ + .int_src = SPI1_TX_DMA_INT_SRC, \ + } \ + } +#endif /* SPI1_TX_DMA_CONFIG */ +#endif /* BSP_SPI1_TX_USING_DMA */ + +#ifdef BSP_SPI1_RX_USING_DMA +#ifndef SPI1_RX_DMA_CONFIG +#define SPI1_RX_DMA_CONFIG \ + { \ + .Instance = SPI1_RX_DMA_INSTANCE, \ + .channel = SPI1_RX_DMA_CHANNEL, \ + .trigger_evt_src = EVT_SPI1_SPRI, \ + .irq_config = \ + { \ + .irq = SPI1_RX_DMA_IRQn, \ + .irq_prio = SPI1_RX_DMA_INT_PRIO, \ + .int_src = SPI1_RX_DMA_INT_SRC, \ + } \ + } +#endif /* SPI1_RX_DMA_CONFIG */ +#endif /* BSP_SPI1_RX_USING_DMA */ + +#ifdef BSP_USING_SPI2 +#ifndef SPI2_BUS_CONFIG +#define SPI2_BUS_CONFIG \ + { \ + .Instance = M4_SPI2, \ + .bus_name = SPI2_BUS_NAME, \ + } +#endif /* SPI2_BUS_CONFIG */ +#endif /* BSP_USING_SPI2 */ + +#ifdef BSP_SPI2_TX_USING_DMA +#ifndef SPI2_TX_DMA_CONFIG +#define SPI2_TX_DMA_CONFIG \ + { \ + .Instance = SPI2_TX_DMA_INSTANCE, \ + .channel = SPI2_TX_DMA_CHANNEL, \ + .trigger_evt_src = EVT_SPI2_SPTI, \ + .irq_config = \ + { \ + .irq = SPI2_TX_DMA_IRQn, \ + .irq_prio = SPI2_TX_DMA_INT_PRIO, \ + .int_src = SPI2_TX_DMA_INT_SRC, \ + } \ + } +#endif /* SPI2_TX_DMA_CONFIG */ +#endif /* BSP_SPI2_TX_USING_DMA */ + +#ifdef BSP_SPI2_RX_USING_DMA +#ifndef SPI2_RX_DMA_CONFIG +#define SPI2_RX_DMA_CONFIG \ + { \ + .Instance = SPI2_RX_DMA_INSTANCE, \ + .channel = SPI2_RX_DMA_CHANNEL, \ + .trigger_evt_src = EVT_SPI2_SPRI, \ + .irq_config = \ + { \ + .irq = SPI2_RX_DMA_IRQn, \ + .irq_prio = SPI2_RX_DMA_INT_PRIO, \ + .int_src = SPI2_RX_DMA_INT_SRC, \ + } \ + } +#endif /* SPI2_RX_DMA_CONFIG */ +#endif /* BSP_SPI2_RX_USING_DMA */ + +#ifdef BSP_USING_SPI3 +#ifndef SPI3_BUS_CONFIG +#define SPI3_BUS_CONFIG \ + { \ + .Instance = M4_SPI3, \ + .bus_name = SPI3_BUS_NAME, \ + } +#endif /* SPI3_BUS_CONFIG */ +#endif /* BSP_USING_SPI3 */ + +#ifdef BSP_SPI3_TX_USING_DMA +#ifndef SPI3_TX_DMA_CONFIG +#define SPI3_TX_DMA_CONFIG \ + { \ + .Instance = SPI3_TX_DMA_INSTANCE, \ + .channel = SPI3_TX_DMA_CHANNEL, \ + .trigger_evt_src = EVT_SPI3_SPTI, \ + .irq_config = \ + { \ + .irq = SPI3_TX_DMA_IRQn, \ + .irq_prio = SPI3_TX_DMA_INT_PRIO, \ + .int_src = SPI3_TX_DMA_INT_SRC, \ + } \ + } +#endif /* SPI3_TX_DMA_CONFIG */ +#endif /* BSP_SPI3_TX_USING_DMA */ + +#ifdef BSP_SPI3_RX_USING_DMA +#ifndef SPI3_RX_DMA_CONFIG +#define SPI3_RX_DMA_CONFIG \ + { \ + .Instance = SPI3_RX_DMA_INSTANCE, \ + .channel = SPI3_RX_DMA_CHANNEL, \ + .trigger_evt_src = EVT_SPI3_SPRI, \ + .irq_config = \ + { \ + .irq = SPI3_RX_DMA_IRQn, \ + .irq_prio = SPI3_RX_DMA_INT_PRIO, \ + .int_src = SPI3_RX_DMA_INT_SRC, \ + } \ + } +#endif /* SPI3_RX_DMA_CONFIG */ +#endif /* BSP_SPI3_RX_USING_DMA */ + +#ifdef BSP_USING_SPI4 +#ifndef SPI4_BUS_CONFIG +#define SPI4_BUS_CONFIG \ + { \ + .Instance = M4_SPI4, \ + .bus_name = SPI4_BUS_NAME, \ + } +#endif /* SPI4_BUS_CONFIG */ +#endif /* BSP_USING_SPI4 */ + +#ifdef BSP_SPI4_TX_USING_DMA +#ifndef SPI4_TX_DMA_CONFIG +#define SPI4_TX_DMA_CONFIG \ + { \ + .Instance = SPI4_TX_DMA_INSTANCE, \ + .channel = SPI4_TX_DMA_CHANNEL, \ + .trigger_evt_src = EVT_SPI4_SPTI, \ + .irq_config = \ + { \ + .irq = SPI4_TX_DMA_IRQn, \ + .irq_prio = SPI4_TX_DMA_INT_PRIO, \ + .int_src = SPI4_TX_DMA_INT_SRC, \ + } \ + } +#endif /* SPI4_TX_DMA_CONFIG */ +#endif /* BSP_SPI4_TX_USING_DMA */ + +#ifdef BSP_SPI4_RX_USING_DMA +#ifndef SPI4_RX_DMA_CONFIG +#define SPI4_RX_DMA_CONFIG \ + { \ + .Instance = SPI4_RX_DMA_INSTANCE, \ + .channel = SPI4_RX_DMA_CHANNEL, \ + .trigger_evt_src = EVT_SPI4_SPRI, \ + .irq_config = \ + { \ + .irq = SPI4_RX_DMA_IRQn, \ + .irq_prio = SPI4_RX_DMA_INT_PRIO, \ + .int_src = SPI4_RX_DMA_INT_SRC, \ + } \ + } +#endif /* SPI4_RX_DMA_CONFIG */ +#endif /* BSP_SPI4_RX_USING_DMA */ + +#ifdef BSP_USING_SPI5 +#ifndef SPI5_BUS_CONFIG +#define SPI5_BUS_CONFIG \ + { \ + .Instance = M4_SPI5, \ + .bus_name = SPI5_BUS_NAME, \ + } +#endif /* SPI5_BUS_CONFIG */ +#endif /* BSP_USING_SPI5 */ + +#ifdef BSP_SPI5_TX_USING_DMA +#ifndef SPI5_TX_DMA_CONFIG +#define SPI5_TX_DMA_CONFIG \ + { \ + .Instance = SPI5_TX_DMA_INSTANCE, \ + .channel = SPI5_TX_DMA_CHANNEL, \ + .trigger_evt_src = EVT_SPI5_SPTI, \ + .irq_config = \ + { \ + .irq = SPI5_TX_DMA_IRQn, \ + .irq_prio = SPI5_TX_DMA_INT_PRIO, \ + .int_src = SPI5_TX_DMA_INT_SRC, \ + } \ + } +#endif /* SPI5_TX_DMA_CONFIG */ +#endif /* BSP_SPI5_TX_USING_DMA */ + +#ifdef BSP_SPI5_RX_USING_DMA +#ifndef SPI5_RX_DMA_CONFIG +#define SPI5_RX_DMA_CONFIG \ + { \ + .Instance = SPI5_RX_DMA_INSTANCE, \ + .channel = SPI5_RX_DMA_CHANNEL, \ + .trigger_evt_src = EVT_SPI5_SPRI, \ + .irq_config = \ + { \ + .irq = SPI5_RX_DMA_IRQn, \ + .irq_prio = SPI5_RX_DMA_INT_PRIO, \ + .int_src = SPI5_RX_DMA_INT_SRC, \ + } \ + } +#endif /* SPI5_RX_DMA_CONFIG */ +#endif /* BSP_SPI5_RX_USING_DMA */ + +#ifdef BSP_USING_SPI6 +#ifndef SPI6_BUS_CONFIG +#define SPI6_BUS_CONFIG \ + { \ + .Instance = M4_SPI6, \ + .bus_name = SPI6_BUS_NAME, \ + } +#endif /* SPI6_BUS_CONFIG */ +#endif /* BSP_USING_SPI6 */ + +#ifdef BSP_SPI6_TX_USING_DMA +#ifndef SPI6_TX_DMA_CONFIG +#define SPI6_TX_DMA_CONFIG \ + { \ + .Instance = SPI6_TX_DMA_INSTANCE, \ + .channel = SPI6_TX_DMA_CHANNEL, \ + .trigger_evt_src = EVT_SPI6_SPTI, \ + .irq_config = \ + { \ + .irq = SPI6_TX_DMA_IRQn, \ + .irq_prio = SPI6_TX_DMA_INT_PRIO, \ + .int_src = SPI6_TX_DMA_INT_SRC, \ + } \ + } +#endif /* SPI6_TX_DMA_CONFIG */ +#endif /* BSP_SPI6_TX_USING_DMA */ + +#ifdef BSP_SPI6_RX_USING_DMA +#ifndef SPI6_RX_DMA_CONFIG +#define SPI6_RX_DMA_CONFIG \ + { \ + .Instance = SPI6_RX_DMA_INSTANCE, \ + .channel = SPI6_RX_DMA_CHANNEL, \ + .trigger_evt_src = EVT_SPI6_SPRI, \ + .irq_config = \ + { \ + .irq = SPI6_RX_DMA_IRQn, \ + .irq_prio = SPI6_RX_DMA_INT_PRIO, \ + .int_src = SPI6_RX_DMA_INT_SRC, \ + } \ + } +#endif /* SPI6_RX_DMA_CONFIG */ +#endif /* BSP_SPI6_RX_USING_DMA */ + +typedef struct __SPI_HandleType +{ + M4_SPI_TypeDef *Instance; /* SPI registers base address */ + stc_spi_init_t Init; /* SPI communication parameters */ +}SPI_HandleType; + +struct hc32_hw_spi_cs +{ + rt_uint8_t port; + rt_uint16_t pin; +}; + +struct hc32_spi_config +{ + M4_SPI_TypeDef *Instance; + char *bus_name; + struct dma_config *dma_rx; + struct dma_config *dma_tx; +}; + +struct stm32_spi_device +{ + rt_uint32_t pin; + char *bus_name; + char *device_name; +}; + +/* HC32 SPI index */ +struct spi_index +{ + rt_uint32_t index; + M4_SPI_TypeDef *Instance; +}; + +struct hc32_spi +{ + struct rt_spi_bus spi_bus; + SPI_HandleType handle; + struct hc32_spi_config *config; + struct rt_spi_configuration *cfg; + rt_uint16_t spi_dma_flag; +}; + +/* HC32 SPI irq handler */ +struct spi_irq_handler +{ + void (*rx_dma_irq_handler)(void); + void (*tx_dma_irq_handler)(void); +}; + +rt_err_t hc32_hw_spi_device_attach(const char *bus_name, + const char *device_name, + uint8_t cs_gpio_port, + uint16_t cs_gpio_pin); + + +#ifdef __cplusplus +} +#endif + +#endif /* __DRV_SPI_H__ */ + diff --git a/bsp/hc32f4a0/drivers/drv_usart.c b/bsp/hc32f4a0/drivers/drv_usart.c new file mode 100644 index 0000000000..b6b75cd281 --- /dev/null +++ b/bsp/hc32f4a0/drivers/drv_usart.c @@ -0,0 +1,1546 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include +#include + +#include "drv_usart.h" +#include "board_config.h" + +#ifdef RT_USING_SERIAL + +#if !defined(BSP_USING_UART1) && !defined(BSP_USING_UART2) && !defined(BSP_USING_UART3) && \ + !defined(BSP_USING_UART4) && !defined(BSP_USING_UART5) && !defined(BSP_USING_UART6) && \ + !defined(BSP_USING_UART7) && !defined(BSP_USING_UART8) && !defined(BSP_USING_UART9) && \ + !defined(BSP_USING_UART10) +#error "Please define at least one BSP_USING_UARTx" +/* UART instance can be selected at menuconfig -> Hardware Drivers Config -> On-chip Peripheral Drivers -> Enable UART */ +#endif + +/******************************************************************************* + * Local type definitions ('typedef') + ******************************************************************************/ +/* HC32 config Rx timeout */ +struct hc32_uart_rxto +{ + M4_TMR0_TypeDef *TMR0_Instance; + rt_uint32_t channel; + + rt_size_t timeout_bits; + + struct hc32_irq_config irq_config; +}; + +/* HC32 config uart class */ +struct hc32_uart_config +{ + struct hc32_irq_config rxerr_irq_config; + + struct hc32_irq_config rx_irq_config; + + struct hc32_irq_config tx_irq_config; + +#ifdef RT_SERIAL_USING_DMA + struct hc32_uart_rxto *rx_timeout; + struct dma_config *dma_rx; + + struct dma_config *dma_tx; +#endif +}; + +/* HC32 UART index */ +struct uart_index +{ + rt_uint32_t index; + M4_USART_TypeDef *Instance; +}; + +/* HC32 UART irq handler */ +struct uart_irq_handler +{ + void (*rxerr_irq_handler)(void); + void (*rx_irq_handler)(void); + void (*tx_irq_handler)(void); + void (*tc_irq_handler)(void); + void (*rxto_irq_handler)(void); + void (*dma_rx_irq_handler)(void); +}; + +/* HC32 uart dirver class */ +struct hc32_uart +{ + struct rt_serial_device serial; + + const char *name; + + M4_USART_TypeDef *Instance; + + struct hc32_uart_config config; + +#ifdef RT_SERIAL_USING_DMA + rt_size_t dma_rx_last_index; +#endif + + rt_uint16_t uart_dma_flag; +}; + +/******************************************************************************* + * Local pre-processor symbols/macros ('#define') + ******************************************************************************/ +#ifndef UART_CONFIG +#define UART_CONFIG(uart_name, USART) \ + { \ + .name = uart_name, \ + .Instance = M4_##USART, \ + .config = { \ + .rxerr_irq_config = { \ + .irq = USART##_RXERR_INT_IRQn, \ + .irq_prio = USART##_RXERR_INT_PRIO, \ + .int_src = INT_##USART##_EI, \ + }, \ + .rx_irq_config = { \ + .irq = USART##_RX_INT_IRQn, \ + .irq_prio = USART##_RX_INT_PRIO, \ + .int_src = INT_##USART##_RI, \ + }, \ + .tx_irq_config = { \ + .irq = USART##_TX_INT_IRQn, \ + .irq_prio = USART##_TX_INT_PRIO, \ + .int_src = INT_##USART##_TI, \ + }, \ + }, \ + } +#endif /* UART_CONFIG */ + +#ifndef UART_RXTO_CONFIG +#define UART_RXTO_CONFIG(USART) \ + { \ + .TMR0_Instance = USART##_RXTO_TMR0_UNIT, \ + .channel = USART##_RXTO_TMR0_CH, \ + .timeout_bits = 20UL, \ + .irq_config = { \ + .irq = USART##_RXTO_INT_IRQn, \ + .irq_prio = USART##_RXTO_INT_PRIO, \ + .int_src = INT_##USART##_RTO, \ + } \ + } +#endif /* UART_RXTO_CONFIG */ + +#ifndef UART_DMA_RX_CONFIG +#define UART_DMA_RX_CONFIG(USART) \ + { \ + .Instance = USART##_RX_DMA_UNIT, \ + .channel = USART##_RX_DMA_CH, \ + .trigger_evt_src = EVT_##USART##_RI, \ + .irq_config = { \ + .irq = USART##_RX_DMA_INT_IRQn, \ + .irq_prio = USART##_RX_DMA_INT_PRIO, \ + .int_src = USART##_RX_DMA_INT_SRC, \ + } \ + } +#endif /* UART_DMA_RX_CONFIG */ + +#ifndef UART_DMA_TX_CONFIG +#define UART_DMA_TX_CONFIG(USART) \ + { \ + .Instance = USART##_TX_DMA_UNIT, \ + .channel = USART##_TX_DMA_CH, \ + .trigger_evt_src = EVT_##USART##_TI, \ + .irq_config = { \ + .irq = USART##_TC_INT_IRQn, \ + .irq_prio = USART##_TC_INT_PRIO, \ + .int_src = INT_##USART##_TCI, \ + } \ + } +#endif /* UART_DMA_TX_CONFIG */ + +#define DMA_CH_REG(reg_base, ch) \ + (*(uint32_t *)((uint32_t)(&(reg_base)) + ((ch) * 0x40UL))) + +#define DMA_TRANS_CNT(unit, ch) \ + (READ_REG32(DMA_CH_REG((unit)->MONDTCTL0, (ch))) >> DMA_DTCTL_CNT_POS) + +#define USART_TCI_ENABLE(unit) \ + SET_REG32_BIT(unit->CR1, USART_INT_TC) + +/******************************************************************************* + * Global variable definitions (declared in header file with 'extern') + ******************************************************************************/ + +/******************************************************************************* + * Local function prototypes ('static') + ******************************************************************************/ +#ifdef RT_SERIAL_USING_DMA +static void hc32_dma_config(struct rt_serial_device *serial, rt_ubase_t flag); +#endif + +/******************************************************************************* + * Local variable definitions ('static') + ******************************************************************************/ +enum +{ +#ifdef BSP_USING_UART1 + UART1_INDEX, +#endif +#ifdef BSP_USING_UART2 + UART2_INDEX, +#endif +#ifdef BSP_USING_UART3 + UART3_INDEX, +#endif +#ifdef BSP_USING_UART4 + UART4_INDEX, +#endif +#ifdef BSP_USING_UART5 + UART5_INDEX, +#endif +#ifdef BSP_USING_UART6 + UART6_INDEX, +#endif +#ifdef BSP_USING_UART7 + UART7_INDEX, +#endif +#ifdef BSP_USING_UART8 + UART8_INDEX, +#endif +#ifdef BSP_USING_UART9 + UART9_INDEX, +#endif +#ifdef BSP_USING_UART10 + UART10_INDEX, +#endif + UART_INDEX_MAX, +}; + +static const struct uart_index uart_map[] = +{ +#ifdef BSP_USING_UART1 + {UART1_INDEX, M4_USART1}, +#endif +#ifdef BSP_USING_UART2 + {UART2_INDEX, M4_USART2}, +#endif +#ifdef BSP_USING_UART3 + {UART3_INDEX, M4_USART3}, +#endif +#ifdef BSP_USING_UART4 + {UART4_INDEX, M4_USART4}, +#endif +#ifdef BSP_USING_UART5 + {UART5_INDEX, M4_USART5}, +#endif +#ifdef BSP_USING_UART6 + {UART6_INDEX, M4_USART6}, +#endif +#ifdef BSP_USING_UART7 + {UART7_INDEX, M4_USART7}, +#endif +#ifdef BSP_USING_UART8 + {UART8_INDEX, M4_USART8}, +#endif +#ifdef BSP_USING_UART9 + {UART9_INDEX, M4_USART9}, +#endif +#ifdef BSP_USING_UART10 + {UART10_INDEX, M4_USART10}, +#endif +}; + +static struct hc32_uart uart_obj[] = +{ +#ifdef BSP_USING_UART1 + UART_CONFIG("uart1", USART1), +#endif +#ifdef BSP_USING_UART2 + UART_CONFIG("uart2", USART2), +#endif +#ifdef BSP_USING_UART3 + UART_CONFIG("uart3", USART3), +#endif +#ifdef BSP_USING_UART4 + UART_CONFIG("uart4", USART4), +#endif +#ifdef BSP_USING_UART5 + UART_CONFIG("uart5", USART5), +#endif +#ifdef BSP_USING_UART6 + UART_CONFIG("uart6", USART6), +#endif +#ifdef BSP_USING_UART7 + UART_CONFIG("uart7", USART7), +#endif +#ifdef BSP_USING_UART8 + UART_CONFIG("uart8", USART8), +#endif +#ifdef BSP_USING_UART9 + UART_CONFIG("uart9", USART9), +#endif +#ifdef BSP_USING_UART10 + UART_CONFIG("uart10", USART10), +#endif +}; + +static const struct uart_irq_handler uart_irq_handlers[sizeof(uart_obj) / sizeof(uart_obj[0])]; + +/******************************************************************************* + * Function implementation - global ('extern') and local ('static') + ******************************************************************************/ + +static uint32_t hc32_get_uart_index(M4_USART_TypeDef *Instance) +{ + uint32_t index = UART_INDEX_MAX; + + for (uint8_t i = 0U; i < ARRAY_SZ(uart_map); i++) + { + if (uart_map[i].Instance == Instance) + { + index = uart_map[i].index; + RT_ASSERT(index < UART_INDEX_MAX) + break; + } + } + + return index; +} + +static uint32_t hc32_get_usart_fcg(M4_USART_TypeDef *Instance) +{ + return (PWC_FCG3_USART1 << hc32_get_uart_index(Instance)); +} + +static rt_err_t hc32_configure(struct rt_serial_device *serial, + struct serial_configure *cfg) +{ + struct hc32_uart *uart; + stc_usart_uart_init_t uart_init; + + RT_ASSERT(RT_NULL != cfg); + RT_ASSERT(RT_NULL != serial); + + uart = rt_container_of(serial, struct hc32_uart, serial); + RT_ASSERT(RT_NULL != uart->Instance); + + /* Configure USART initialization structure */ + USART_UartStructInit(&uart_init); + uart_init.u32OversamplingBits = USART_OVERSAMPLING_8BIT; + uart_init.u32Baudrate = cfg->baud_rate; + if ((M4_USART1 == uart->Instance) || \ + (M4_USART2 == uart->Instance) || \ + (M4_USART6 == uart->Instance) || \ + (M4_USART7 == uart->Instance)) + { + uart_init.u32ClkMode = USART_INTERNCLK_OUTPUT; + } + + if(BIT_ORDER_LSB == cfg->bit_order) + { + uart_init.u32BitDirection = USART_LSB; + } + else + { + uart_init.u32BitDirection = USART_MSB; + } + + switch(cfg->stop_bits) + { + case STOP_BITS_1: + uart_init.u32StopBit = USART_STOPBIT_1BIT; + break; + case STOP_BITS_2: + uart_init.u32StopBit = USART_STOPBIT_2BIT; + break; + default: + uart_init.u32StopBit = USART_STOPBIT_1BIT; + break; + } + + switch(cfg->parity) + { + case PARITY_NONE: + uart_init.u32Parity = USART_PARITY_NONE; + break; + case PARITY_EVEN: + uart_init.u32Parity = USART_PARITY_EVEN; + break; + case PARITY_ODD: + uart_init.u32Parity = USART_PARITY_ODD; + break; + default: + uart_init.u32Parity = USART_PARITY_NONE; + break; + } + + switch(cfg->data_bits) + { + case DATA_BITS_8: + uart_init.u32DataWidth = USART_DATA_LENGTH_8BIT; + break; + default: + return -RT_ERROR; + } + + /* Enable USART clock */ + PWC_Fcg3PeriphClockCmd(hc32_get_usart_fcg(uart->Instance), Enable); + + rt_err_t rt_hw_board_uart_init(M4_USART_TypeDef *USARTx); + if (RT_EOK != rt_hw_board_uart_init(uart->Instance)) + { + return -RT_ERROR; + } + + USART_DeInit(uart->Instance); + if (Error == USART_UartInit(uart->Instance, &uart_init)) + { + return -RT_ERROR; + } + + /* Register RX error interrupt */ + hc32_install_irq_handler(&uart->config.rxerr_irq_config, + uart_irq_handlers[hc32_get_uart_index(uart->Instance)].rxerr_irq_handler, + RT_TRUE); + + USART_FuncCmd(uart->Instance, USART_INT_RX, Enable); + + if ((serial->parent.flag & RT_DEVICE_FLAG_RDWR) || \ + (serial->parent.flag & RT_DEVICE_FLAG_RDONLY)) + { + USART_FuncCmd(uart->Instance, USART_RX, Enable); + } + + if ((serial->parent.flag & RT_DEVICE_FLAG_RDWR) || \ + (serial->parent.flag & RT_DEVICE_FLAG_WRONLY)) + { + USART_FuncCmd(uart->Instance, USART_TX, Enable); + } + + return RT_EOK; +} + +static rt_err_t hc32_control(struct rt_serial_device *serial, int cmd, void *arg) +{ + struct hc32_uart *uart; + uint32_t uart_index; +#ifdef RT_SERIAL_USING_DMA + rt_ubase_t ctrl_arg = (rt_ubase_t)arg; +#endif + + RT_ASSERT(RT_NULL != serial); + + uart = rt_container_of(serial, struct hc32_uart, serial); + RT_ASSERT(RT_NULL != uart->Instance); + + switch (cmd) + { + /* Disable interrupt */ + case RT_DEVICE_CTRL_CLR_INT: + if(RT_DEVICE_FLAG_INT_RX == ctrl_arg) + { + /* Disable RX irq */ + NVIC_DisableIRQ(uart->config.rx_irq_config.irq); + INTC_IrqSignOut(uart->config.rx_irq_config.irq); + } + else + { + /* Disable TX irq */ + NVIC_DisableIRQ(uart->config.tx_irq_config.irq); + USART_FuncCmd(uart->Instance, USART_INT_TC, Disable); + INTC_IrqSignOut(uart->config.tx_irq_config.irq); + } + break; + + /* Enable interrupt */ + case RT_DEVICE_CTRL_SET_INT: + uart_index = hc32_get_uart_index(uart->Instance); + + if(RT_DEVICE_FLAG_INT_RX == ctrl_arg) + { + /* Install RX irq handler */ + hc32_install_irq_handler(&uart->config.rx_irq_config, + uart_irq_handlers[uart_index].rx_irq_handler, + RT_TRUE); + } + else + { + /* Enable TX interrupt */ + USART_FuncCmd(uart->Instance, USART_INT_TXE, Enable); + + /* Install TX irq handler */ + hc32_install_irq_handler(&uart->config.tx_irq_config, + uart_irq_handlers[uart_index].tx_irq_handler, + RT_TRUE); + } + break; + +#ifdef RT_SERIAL_USING_DMA + case RT_DEVICE_CTRL_CONFIG: + hc32_dma_config(serial, ctrl_arg); + + if (RT_DEVICE_FLAG_DMA_TX == ctrl_arg) + { + USART_FuncCmd(uart->Instance, (USART_TX | USART_INT_TC), Disable); + + /* Install TC irq handler */ + uart_index = hc32_get_uart_index(uart->Instance); + hc32_install_irq_handler(&uart->config.dma_tx->irq_config, + uart_irq_handlers[uart_index].tc_irq_handler, + RT_TRUE); + } + break; +#endif + + case RT_DEVICE_CTRL_CLOSE: + USART_DeInit(uart->Instance); + break; + } + + return RT_EOK; +} + +static int hc32_putc(struct rt_serial_device *serial, char c) +{ + struct hc32_uart *uart; + + RT_ASSERT(RT_NULL != serial); + + uart = rt_container_of(serial, struct hc32_uart, serial); + RT_ASSERT(RT_NULL != uart->Instance); + + if(serial->parent.open_flag & RT_DEVICE_FLAG_INT_TX) + { + if (USART_GetStatus(uart->Instance, USART_FLAG_TXE) != Set) + { + return -1; + } + } + else + { + /* Polling mode. */ + while (USART_GetStatus(uart->Instance, USART_FLAG_TXE) != Set); + } + + USART_SendData(uart->Instance, c); + + return 1; +} + +static int hc32_getc(struct rt_serial_device *serial) +{ + int ch= -1; + struct hc32_uart *uart; + + RT_ASSERT(RT_NULL != serial); + + uart = rt_container_of(serial, struct hc32_uart, serial); + RT_ASSERT(RT_NULL != uart->Instance); + + if(Set == USART_GetStatus(uart->Instance, USART_FLAG_RXNE)) + { + ch = (rt_uint8_t)USART_RecData(uart->Instance); + } + + return ch; +} + +static rt_size_t hc32_dma_transmit(struct rt_serial_device *serial, + rt_uint8_t *buf, + rt_size_t size, + int direction) +{ + struct hc32_uart *uart; + M4_DMA_TypeDef *DMA_Instance; + uint8_t ch; + + RT_ASSERT(RT_NULL != serial); + RT_ASSERT(RT_NULL != buf); + + if (size == 0) + { + return 0; + } + + uart = rt_container_of(serial, struct hc32_uart, serial); + + if (RT_SERIAL_DMA_TX == direction) + { + DMA_Instance = uart->config.dma_tx->Instance; + ch = uart->config.dma_tx->channel; + + if (Reset == USART_GetStatus(uart->Instance, USART_FLAG_TC)) + { + RT_ASSERT(0); + } + + DMA_SetSrcAddr(DMA_Instance, ch, (uint32_t)buf); + DMA_SetTransCnt(DMA_Instance, ch, size); + DMA_ChannelCmd(DMA_Instance, ch, Enable); + + USART_FuncCmd(uart->Instance, USART_TX, Enable); + USART_TCI_ENABLE(uart->Instance); + return size; + } + return 0; +} + +static void hc32_uart_rx_irq_handler(struct hc32_uart *uart) +{ + RT_ASSERT(RT_NULL != uart); + + rt_hw_serial_isr(&uart->serial, RT_SERIAL_EVENT_RX_IND); +} + +static void hc32_uart_tx_irq_handler(struct hc32_uart *uart) +{ + RT_ASSERT(RT_NULL != uart); + + if (uart->serial.parent.open_flag & RT_DEVICE_FLAG_INT_TX) + { + rt_hw_serial_isr(&uart->serial, RT_SERIAL_EVENT_TX_DONE); + } +} + +static void hc32_uart_rxerr_irq_handler(struct hc32_uart *uart) +{ + RT_ASSERT(RT_NULL != uart); + RT_ASSERT(RT_NULL != uart->Instance); + + if (Set == USART_GetStatus(uart->Instance, (USART_FLAG_PE | USART_FLAG_FE))) + { + USART_RecData(uart->Instance); + } + + USART_ClearStatus(uart->Instance, (USART_CLEAR_FLAG_PE | \ + USART_CLEAR_FLAG_FE | \ + USART_CLEAR_FLAG_ORE)); +} + +#ifdef RT_SERIAL_USING_DMA +static void hc32_uart_rx_timeout(struct rt_serial_device *serial) +{ + struct hc32_uart *uart; + uint32_t cmp_val; + uint32_t timeout_bits; + M4_TMR0_TypeDef* TMR0_Instance; + uint8_t ch; + stc_tmr0_init_t stcTmr0Init; + + RT_ASSERT(RT_NULL != serial); + + uart = rt_container_of(serial, struct hc32_uart, serial); + RT_ASSERT(RT_NULL != uart->Instance); + + TMR0_Instance = uart->config.rx_timeout->TMR0_Instance; + ch = uart->config.rx_timeout->channel; + timeout_bits = uart->config.rx_timeout->timeout_bits; + + if ((M4_USART1 == uart->Instance) || (M4_USART6 == uart->Instance)) + { + RT_ASSERT(TMR0_CH_A == ch); + } + else if ((M4_USART2 == uart->Instance) || (M4_USART7 == uart->Instance)) + { + RT_ASSERT(TMR0_CH_B == ch); + } + + if ((M4_USART1 == uart->Instance) || (M4_USART2 == uart->Instance)) + { + RT_ASSERT(M4_TMR0_1 == TMR0_Instance); + PWC_Fcg2PeriphClockCmd(PWC_FCG2_TMR0_1, Enable); + } + else if ((M4_USART6 == uart->Instance) || (M4_USART7 == uart->Instance)) + { + RT_ASSERT(M4_TMR0_2 == TMR0_Instance); + PWC_Fcg2PeriphClockCmd(PWC_FCG2_TMR0_2, Enable); + } + + /* De-initialize TMR0 */ + TMR0_DeInit(TMR0_Instance); + + /* Clear CNTAR register */ + TMR0_SetCntVal(TMR0_Instance, ch, 0U); + + /* TIMER0 basetimer function initialize */ + TMR0_StructInit(&stcTmr0Init); + stcTmr0Init.u32ClockDivision = TMR0_CLK_DIV1; + stcTmr0Init.u32ClockSource = TMR0_CLK_SRC_XTAL32; + stcTmr0Init.u32HwTrigFunc = (TMR0_BT_HWTRG_FUNC_START | TMR0_BT_HWTRG_FUNC_CLEAR); + if (TMR0_CLK_DIV1 == stcTmr0Init.u32ClockDivision) + { + cmp_val = (timeout_bits - 4UL); + } + else if (TMR0_CLK_DIV2 == stcTmr0Init.u32ClockDivision) + { + cmp_val = (timeout_bits/2UL - 2UL); + } + else + { + cmp_val = (timeout_bits / (1UL << (stcTmr0Init.u32ClockDivision >> TMR0_BCONR_CKDIVA_POS)) - 1UL); + } + DDL_ASSERT(cmp_val <= 0xFFFFUL); + stcTmr0Init.u16CmpValue = (uint16_t)(cmp_val); + TMR0_Init(TMR0_Instance, ch, &stcTmr0Init); + + /* Clear compare flag */ + TMR0_ClearStatus(TMR0_Instance, ch); + + /* Register RTO interrupt */ + hc32_install_irq_handler(&uart->config.rx_timeout->irq_config, + uart_irq_handlers[hc32_get_uart_index(uart->Instance)].rxto_irq_handler, + RT_TRUE); + + USART_ClearStatus(uart->Instance, USART_CLEAR_FLAG_RTOF); + USART_FuncCmd(uart->Instance, (USART_RTO | USART_INT_RTO), Enable); +} + +static void hc32_dma_config(struct rt_serial_device *serial, rt_ubase_t flag) +{ + struct hc32_uart *uart; + stc_dma_init_t dma_init; + M4_DMA_TypeDef *DMA_Instance; + uint32_t DMA_ch; + uint32_t u32Fcg0Periph = PWC_FCG0_AOS; + + RT_ASSERT(RT_NULL != serial); + + uart = rt_container_of(serial, struct hc32_uart, serial); + RT_ASSERT(RT_NULL != uart->Instance); + + if (RT_DEVICE_FLAG_DMA_RX == flag) + { + stc_dma_llp_init_t llp_init; + struct rt_serial_rx_fifo *rx_fifo = (struct rt_serial_rx_fifo *)serial->serial_rx; + + RT_ASSERT(RT_NULL != uart->config.rx_timeout->TMR0_Instance); + RT_ASSERT(RT_NULL != uart->config.dma_rx->Instance); + + /* Initialization uart rx timeout for DMA */ + hc32_uart_rx_timeout(serial); + + uart->dma_rx_last_index = 0UL; + + /* Get DMA unit&channel */ + DMA_Instance = uart->config.dma_rx->Instance; + DMA_ch = uart->config.dma_rx->channel; + + /* Enable DMA clock */ + u32Fcg0Periph |= (M4_DMA1 == DMA_Instance) ? PWC_FCG0_DMA1:PWC_FCG0_DMA2; + PWC_Fcg0PeriphClockCmd(u32Fcg0Periph, Enable); + + /* Disable DMA */ + DMA_ChannelCmd(DMA_Instance, DMA_ch, Disable); + + /* Initialize DMA */ + DMA_StructInit(&dma_init); + dma_init.u32IntEn = DMA_INT_ENABLE; + dma_init.u32SrcAddr = ((uint32_t)(&uart->Instance->DR) + 2UL); + dma_init.u32DestAddr = (uint32_t)rx_fifo->buffer; + dma_init.u32DataWidth = DMA_DATAWIDTH_8BIT; + dma_init.u32BlockSize = 1UL; + dma_init.u32TransCnt = serial->config.bufsz; + dma_init.u32SrcInc = DMA_SRC_ADDR_FIX; + dma_init.u32DestInc = DMA_DEST_ADDR_INC; + DMA_Init(DMA_Instance, DMA_ch, &dma_init); + + /* Initialize LLP */ + static stc_dma_llp_descriptor_t llp_desc; + llp_init.u32LlpEn = DMA_LLP_ENABLE; + llp_init.u32LlpRun = DMA_LLP_WAIT; + llp_init.u32LlpAddr= (uint32_t)&llp_desc; + DMA_LlpInit(DMA_Instance, DMA_ch, &llp_init); + + /* Configure LLP descriptor */ + llp_desc.SARx = dma_init.u32SrcAddr; + llp_desc.DARx = dma_init.u32DestAddr; + llp_desc.DTCTLx= (dma_init.u32TransCnt << DMA_DTCTL_CNT_POS) | (dma_init.u32BlockSize << DMA_DTCTL_BLKSIZE_POS); + llp_desc.LLPx = (uint32_t)&llp_desc; + llp_desc.CHCTLx= (dma_init.u32SrcInc | dma_init.u32DestInc | dma_init.u32DataWidth | \ + llp_init.u32LlpEn | llp_init.u32LlpRun | dma_init.u32IntEn); + + /* Register DMA interrupt */ + hc32_install_irq_handler(&uart->config.dma_rx->irq_config, + uart_irq_handlers[hc32_get_uart_index(uart->Instance)].dma_rx_irq_handler, + RT_TRUE); + + /* Enable DMA module */ + DMA_Cmd(DMA_Instance, Enable); + DMA_TransIntCmd(DMA_Instance, (DMA_TC_INT_CH0 << DMA_ch), Enable); + DMA_SetTriggerSrc(DMA_Instance, DMA_ch, uart->config.dma_rx->trigger_evt_src); + DMA_ChannelCmd(DMA_Instance, DMA_ch, Enable); + } + else if (RT_DEVICE_FLAG_DMA_TX == flag) + { + RT_ASSERT(RT_NULL != uart->config.dma_tx->Instance); + + DMA_Instance = uart->config.dma_tx->Instance; + DMA_ch = uart->config.dma_tx->channel; + + /* Enable DMA clock */ + u32Fcg0Periph |= (M4_DMA1 == DMA_Instance) ? PWC_FCG0_DMA1:PWC_FCG0_DMA2; + PWC_Fcg0PeriphClockCmd(u32Fcg0Periph, Enable); + + /* Disable DMA */ + DMA_ChannelCmd(DMA_Instance, DMA_ch, Disable); + + /* Initialize DMA */ + DMA_StructInit(&dma_init); + dma_init.u32IntEn = DMA_INT_DISABLE; + dma_init.u32SrcAddr = 0UL; + dma_init.u32DestAddr = (uint32_t)(&uart->Instance->DR); + dma_init.u32DataWidth = DMA_DATAWIDTH_8BIT; + dma_init.u32BlockSize = 1UL; + dma_init.u32TransCnt = 0UL; + dma_init.u32SrcInc = DMA_SRC_ADDR_INC; + dma_init.u32DestInc = DMA_DEST_ADDR_FIX; + DMA_Init(DMA_Instance, DMA_ch, &dma_init); + + /* Enable DMA module */ + DMA_Cmd(DMA_Instance, Enable); + DMA_SetTriggerSrc(DMA_Instance, DMA_ch, uart->config.dma_tx->trigger_evt_src); + } +} + +static void hc32_uart_tc_irq_handler(struct hc32_uart *uart) +{ + RT_ASSERT(uart != RT_NULL); + + USART_FuncCmd(uart->Instance, (USART_TX|USART_INT_TC), Disable); + + if (uart->serial.parent.open_flag & RT_DEVICE_FLAG_DMA_TX) + { + rt_hw_serial_isr(&uart->serial, RT_SERIAL_EVENT_TX_DMADONE); + } +} + +static void hc32_uart_dma_rx_irq_handler(struct hc32_uart *uart) +{ + struct rt_serial_device *serial; + rt_size_t recv_len; + rt_base_t level; + + RT_ASSERT(RT_NULL != uart); + RT_ASSERT(RT_NULL != uart->Instance); + + serial = &uart->serial; + + level = rt_hw_interrupt_disable(); + recv_len = serial->config.bufsz - uart->dma_rx_last_index; + uart->dma_rx_last_index = 0UL; + rt_hw_interrupt_enable(level); + + if (recv_len) + { + rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_DMADONE | (recv_len << 8)); + } +} + +static void hc32_uart_rxto_irq_handler(struct hc32_uart *uart) +{ + rt_base_t level; + rt_size_t cnt; + rt_size_t recv_len; + rt_size_t recv_total_index; + + cnt = DMA_TRANS_CNT(uart->config.dma_rx->Instance , uart->config.dma_rx->channel); + recv_total_index = uart->serial.config.bufsz - cnt; + if (0UL != recv_total_index) + { + level = rt_hw_interrupt_disable(); + recv_len = recv_total_index - uart->dma_rx_last_index; + uart->dma_rx_last_index = recv_total_index; + rt_hw_interrupt_enable(level); + + if (recv_len) + { + rt_hw_serial_isr(&uart->serial, RT_SERIAL_EVENT_RX_DMADONE | (recv_len << 8)); + } + } + + TMR0_Cmd(uart->config.rx_timeout->TMR0_Instance, uart->config.rx_timeout->channel, Disable); + USART_ClearStatus(uart->Instance, USART_CLEAR_FLAG_RTOF); +} +#endif + +#if defined(BSP_USING_UART1) +static void hc32_uart1_rx_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rx_irq_handler(&uart_obj[UART1_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +static void hc32_uart1_tx_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_tx_irq_handler(&uart_obj[UART1_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +static void hc32_uart1_rxerr_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rxerr_irq_handler(&uart_obj[UART1_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +#if defined(RT_SERIAL_USING_DMA) +static void hc32_uart1_tc_irq_handler(void) +{ +#if defined(BSP_UART1_TX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_tc_irq_handler(&uart_obj[UART1_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +#endif +} + +static void hc32_uart1_rxto_irq_handler(void) +{ +#if defined(BSP_UART1_RX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rxto_irq_handler(&uart_obj[UART1_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +#endif +} + +static void hc32_uart1_dma_rx_irq_handler(void) +{ +#if defined(BSP_UART1_RX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_dma_rx_irq_handler(&uart_obj[UART1_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +#endif +} +#endif /* RT_SERIAL_USING_DMA */ +#endif /* BSP_USING_UART1 */ + +#if defined(BSP_USING_UART2) +static void hc32_uart2_rx_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rx_irq_handler(&uart_obj[UART2_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +static void hc32_uart2_tx_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_tx_irq_handler(&uart_obj[UART2_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +static void hc32_uart2_rxerr_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rxerr_irq_handler(&uart_obj[UART2_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +#if defined(RT_SERIAL_USING_DMA) +static void hc32_uart2_tc_irq_handler(void) +{ +#if defined(BSP_UART2_TX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_tc_irq_handler(&uart_obj[UART2_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +#endif +} + +static void hc32_uart2_rxto_irq_handler(void) +{ +#if defined(BSP_UART2_RX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rxto_irq_handler(&uart_obj[UART2_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +#endif +} + +static void hc32_uart2_dma_rx_irq_handler(void) +{ +#if defined(BSP_UART2_RX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_dma_rx_irq_handler(&uart_obj[UART2_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +#endif +} +#endif /* RT_SERIAL_USING_DMA */ +#endif /* BSP_USING_UART2 */ + +#if defined(BSP_USING_UART3) +static void hc32_uart3_rx_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rx_irq_handler(&uart_obj[UART3_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +static void hc32_uart3_tx_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_tx_irq_handler(&uart_obj[UART3_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +static void hc32_uart3_rxerr_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rxerr_irq_handler(&uart_obj[UART3_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif /* BSP_USING_UART3 */ + +#if defined(BSP_USING_UART4) +static void hc32_uart4_rx_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rx_irq_handler(&uart_obj[UART4_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +static void hc32_uart4_tx_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_tx_irq_handler(&uart_obj[UART4_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +static void hc32_uart4_rxerr_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rxerr_irq_handler(&uart_obj[UART4_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif /* BSP_USING_UART4 */ + +#if defined(BSP_USING_UART5) +static void hc32_uart5_rx_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rx_irq_handler(&uart_obj[UART5_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +static void hc32_uart5_tx_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_tx_irq_handler(&uart_obj[UART5_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +static void hc32_uart5_rxerr_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rxerr_irq_handler(&uart_obj[UART5_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif /* BSP_USING_UART5 */ + +#if defined(BSP_USING_UART6) +static void hc32_uart6_rx_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rx_irq_handler(&uart_obj[UART6_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +static void hc32_uart6_tx_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_tx_irq_handler(&uart_obj[UART6_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +static void hc32_uart6_rxerr_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rxerr_irq_handler(&uart_obj[UART6_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +#if defined(RT_SERIAL_USING_DMA) +static void hc32_uart6_tc_irq_handler(void) +{ +#if defined(BSP_UART6_TX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_tc_irq_handler(&uart_obj[UART6_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +#endif +} + +static void hc32_uart6_rxto_irq_handler(void) +{ +#if defined(BSP_UART6_RX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rxto_irq_handler(&uart_obj[UART6_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +#endif +} + +static void hc32_uart6_dma_rx_irq_handler(void) +{ +#if defined(BSP_UART6_RX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_dma_rx_irq_handler(&uart_obj[UART6_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +#endif +} +#endif /* RT_SERIAL_USING_DMA */ +#endif /* BSP_USING_UART6 */ + +#if defined(BSP_USING_UART7) +static void hc32_uart7_rx_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rx_irq_handler(&uart_obj[UART7_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +static void hc32_uart7_tx_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_tx_irq_handler(&uart_obj[UART7_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +static void hc32_uart7_rxerr_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rxerr_irq_handler(&uart_obj[UART7_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +#if defined(RT_SERIAL_USING_DMA) +static void hc32_uart7_tc_irq_handler(void) +{ +#if defined(BSP_UART7_TX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_tc_irq_handler(&uart_obj[UART7_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +#endif +} + +static void hc32_uart7_rxto_irq_handler(void) +{ +#if defined(BSP_UART7_RX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rxto_irq_handler(&uart_obj[UART7_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +#endif +} + +static void hc32_uart7_dma_rx_irq_handler(void) +{ +#if defined(BSP_UART7_RX_USING_DMA) + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_dma_rx_irq_handler(&uart_obj[UART7_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +#endif +} +#endif /* RT_SERIAL_USING_DMA */ +#endif /* BSP_USING_UART7 */ + +#if defined(BSP_USING_UART8) +static void hc32_uart8_rx_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rx_irq_handler(&uart_obj[UART8_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +static void hc32_uart8_tx_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_tx_irq_handler(&uart_obj[UART8_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +static void hc32_uart8_rxerr_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rxerr_irq_handler(&uart_obj[UART8_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif /* BSP_USING_UART8 */ + +#if defined(BSP_USING_UART9) +static void hc32_uart9_rx_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rx_irq_handler(&uart_obj[UART9_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +static void hc32_uart9_tx_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_tx_irq_handler(&uart_obj[UART9_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +static void hc32_uart9_rxerr_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rxerr_irq_handler(&uart_obj[UART9_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif /* BSP_USING_UART9 */ + +#if defined(BSP_USING_UART10) +static void hc32_uart10_rx_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rx_irq_handler(&uart_obj[UART10_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +static void hc32_uart10_tx_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_tx_irq_handler(&uart_obj[UART10_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} + +static void hc32_uart10_rxerr_irq_handler(void) +{ + /* enter interrupt */ + rt_interrupt_enter(); + + hc32_uart_rxerr_irq_handler(&uart_obj[UART10_INDEX]); + + /* leave interrupt */ + rt_interrupt_leave(); +} +#endif /* BSP_USING_UART10 */ + +static const struct uart_irq_handler uart_irq_handlers[] = +{ +#ifdef BSP_USING_UART1 + {hc32_uart1_rxerr_irq_handler, hc32_uart1_rx_irq_handler, hc32_uart1_tx_irq_handler, + hc32_uart1_tc_irq_handler, hc32_uart1_rxto_irq_handler, hc32_uart1_dma_rx_irq_handler}, +#endif +#ifdef BSP_USING_UART2 + {hc32_uart2_rxerr_irq_handler, hc32_uart2_rx_irq_handler, hc32_uart2_tx_irq_handler, + hc32_uart2_tc_irq_handler, hc32_uart2_rxto_irq_handler, hc32_uart2_dma_rx_irq_handler}, +#endif +#ifdef BSP_USING_UART3 + {hc32_uart3_rxerr_irq_handler, hc32_uart3_rx_irq_handler, hc32_uart3_tx_irq_handler}, +#endif +#ifdef BSP_USING_UART4 + {hc32_uart4_rxerr_irq_handler, hc32_uart4_rx_irq_handler, hc32_uart4_tx_irq_handler}, +#endif +#ifdef BSP_USING_UART5 + {hc32_uart5_rxerr_irq_handler, hc32_uart5_rx_irq_handler, hc32_uart5_tx_irq_handler}, +#endif +#ifdef BSP_USING_UART6 + {hc32_uart6_rxerr_irq_handler, hc32_uart6_rx_irq_handler, hc32_uart6_tx_irq_handler, + hc32_uart6_tc_irq_handler, hc32_uart6_rxto_irq_handler, hc32_uart6_dma_rx_irq_handler}, +#endif +#ifdef BSP_USING_UART7 + {hc32_uart7_rxerr_irq_handler, hc32_uart7_rx_irq_handler, hc32_uart7_tx_irq_handler, + hc32_uart7_tc_irq_handler, hc32_uart7_rxto_irq_handler, hc32_uart7_dma_rx_irq_handler}, +#endif +#ifdef BSP_USING_UART8 + {hc32_uart8_rxerr_irq_handler, hc32_uart8_rx_irq_handler, hc32_uart8_tx_irq_handler}, +#endif +#ifdef BSP_USING_UART9 + {hc32_uart9_rxerr_irq_handler, hc32_uart9_rx_irq_handler, hc32_uart9_tx_irq_handler}, +#endif +#ifdef BSP_USING_UART10 + {hc32_uart10_rxerr_irq_handler, hc32_uart10_rx_irq_handler, hc32_uart10_tx_irq_handler}, +#endif +}; + +static void hc32_uart_get_dma_config(void) +{ +#ifdef BSP_USING_UART1 + uart_obj[UART1_INDEX].uart_dma_flag = 0; +#ifdef BSP_UART1_RX_USING_DMA + uart_obj[UART1_INDEX].uart_dma_flag |= RT_DEVICE_FLAG_DMA_RX; + + static struct hc32_uart_rxto uart1_rx_timeout = UART_RXTO_CONFIG(USART1); + uart_obj[UART1_INDEX].config.rx_timeout = &uart1_rx_timeout; + + static struct dma_config uart1_dma_rx = UART_DMA_RX_CONFIG(USART1); + uart_obj[UART1_INDEX].config.dma_rx = &uart1_dma_rx; +#endif +#ifdef BSP_UART1_TX_USING_DMA + uart_obj[UART1_INDEX].uart_dma_flag |= RT_DEVICE_FLAG_DMA_TX; + + static struct dma_config uart1_dma_tx = UART_DMA_TX_CONFIG(USART1); + uart_obj[UART1_INDEX].config.dma_tx = &uart1_dma_tx; +#endif +#endif + +#ifdef BSP_USING_UART2 + uart_obj[UART2_INDEX].uart_dma_flag = 0; +#ifdef BSP_UART2_RX_USING_DMA + uart_obj[UART2_INDEX].uart_dma_flag |= RT_DEVICE_FLAG_DMA_RX; + + static struct hc32_uart_rxto uart2_rx_timeout = UART_RXTO_CONFIG(USART2); + uart_obj[UART2_INDEX].config.rx_timeout = &uart2_rx_timeout; + + static struct dma_config uart2_dma_rx = UART_DMA_RX_CONFIG(USART2); + uart_obj[UART2_INDEX].config.dma_rx = &uart2_dma_rx; +#endif +#ifdef BSP_UART2_TX_USING_DMA + uart_obj[UART2_INDEX].uart_dma_flag |= RT_DEVICE_FLAG_DMA_TX; + + static struct dma_config uart2_dma_tx = UART_DMA_TX_CONFIG(USART2); + uart_obj[UART2_INDEX].config.dma_tx = &uart2_dma_tx; +#endif +#endif + +#ifdef BSP_USING_UART6 + uart_obj[UART6_INDEX].uart_dma_flag = 0; +#ifdef BSP_UART6_RX_USING_DMA + uart_obj[UART6_INDEX].uart_dma_flag |= RT_DEVICE_FLAG_DMA_RX; + + static struct hc32_uart_rxto uart6_rx_timeout = UART_RXTO_CONFIG(USART6); + uart_obj[UART6_INDEX].config.rx_timeout = &uart6_rx_timeout; + + static struct dma_config uart6_dma_rx = UART_DMA_RX_CONFIG(USART6); + uart_obj[UART6_INDEX].config.dma_rx = &uart6_dma_rx; +#endif +#ifdef BSP_UART6_TX_USING_DMA + uart_obj[UART6_INDEX].uart_dma_flag |= RT_DEVICE_FLAG_DMA_TX; + + static struct dma_config uart6_dma_tx = UART_DMA_TX_CONFIG(USART6); + uart_obj[UART6_INDEX].config.dma_tx = &uart6_dma_tx; +#endif +#endif + +#ifdef BSP_USING_UART7 + uart_obj[UART7_INDEX].uart_dma_flag = 0; +#ifdef BSP_UART7_RX_USING_DMA + uart_obj[UART7_INDEX].uart_dma_flag |= RT_DEVICE_FLAG_DMA_RX; + + static struct hc32_uart_rxto uart7_rx_timeout = UART_RXTO_CONFIG(USART7); + uart_obj[UART7_INDEX].config.rx_timeout = &uart7_rx_timeout; + + static struct dma_config uart7_dma_rx = UART_DMA_RX_CONFIG(USART7); + uart_obj[UART7_INDEX].config.dma_rx = &uart7_dma_rx; +#endif +#ifdef BSP_UART7_TX_USING_DMA + uart_obj[UART7_INDEX].uart_dma_flag |= RT_DEVICE_FLAG_DMA_TX; + + static struct dma_config uart7_dma_tx = UART_DMA_TX_CONFIG(USART7); + uart_obj[UART7_INDEX].config.dma_tx = &uart7_dma_tx; +#endif +#endif +} + +static const struct rt_uart_ops hc32_uart_ops = +{ + .configure = hc32_configure, + .control = hc32_control, + .putc = hc32_putc, + .getc = hc32_getc, + .dma_transmit = hc32_dma_transmit +}; + +int hc32_hw_uart_init(void) +{ + rt_err_t result = RT_EOK; + rt_size_t obj_num = sizeof(uart_obj) / sizeof(struct hc32_uart); + struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT; + + hc32_uart_get_dma_config(); + + for (int i = 0; i < obj_num; i++) + { + /* init UART object */ + uart_obj[i].serial.ops = &hc32_uart_ops; + uart_obj[i].serial.config = config; + + /* register UART device */ + result = rt_hw_serial_register(&uart_obj[i].serial, + uart_obj[i].name, + (RT_DEVICE_FLAG_RDWR | + RT_DEVICE_FLAG_INT_RX | + RT_DEVICE_FLAG_INT_TX | + uart_obj[i].uart_dma_flag), + &uart_obj[i]); + RT_ASSERT(result == RT_EOK); + } + + return result; +} + +INIT_BOARD_EXPORT(hc32_hw_uart_init); + +#endif /* RT_USING_SERIAL */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/drivers/drv_usart.h b/bsp/hc32f4a0/drivers/drv_usart.h new file mode 100644 index 0000000000..ba45e1dd41 --- /dev/null +++ b/bsp/hc32f4a0/drivers/drv_usart.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2020, Huada Semiconductor Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2020-10-30 CDT first version + */ + + +#ifndef __DRV_USART_H__ +#define __DRV_USART_H__ + +/******************************************************************************* + * Include files + ******************************************************************************/ +#include +#include "rtdevice.h" + +#include "hc32_ddl.h" +#include "drv_irq.h" +#include "drv_dma.h" + +/* C binding of definitions if building with C++ compiler */ +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * Global type definitions ('typedef') + ******************************************************************************/ + +/******************************************************************************* + * Global pre-processor symbols/macros ('#define') + ******************************************************************************/ + +/******************************************************************************* + * Global variable definitions ('extern') + ******************************************************************************/ + +/******************************************************************************* + * Global function prototypes (definition in C source) + ******************************************************************************/ +int rt_hw_uart_init(void); + +#ifdef __cplusplus +} +#endif + +#endif /* __DRV_USART_H__ */ + +/******************************************************************************* + * EOF (not truncated) + ******************************************************************************/ diff --git a/bsp/hc32f4a0/figures/board.jpg b/bsp/hc32f4a0/figures/board.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e0b1988d82d82bc44b93da9e1c82c66c4ae34dba GIT binary patch literal 120964 zcmb4pbx<5nwDkhPf`#Dj?(S~E-QC?;ToMx8-QC^Y-Pz!t;EM-XTt9way?Xz@o~o&? zzSCV(Gjq>9ea^hEzHbA*$Vtme1E8Rw045&?;C%xi0YHF*gNK7ffQN@iL`3+EjERDb zgoKRu6$1^E2%m(Q2%nIUl#-c-l$?=*kdT&#j**p(larH#hEIr>U67fBll{L%pb!xe zk&%#bQBZK%$q32V|Ih7x5P*&VEd@gg14RyiMu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}Ch`LpPi;Gy|aa zOlGNexCElrOl`=15wzPlB?9gcV148>1mt|i+%U=s?Gjh?mfSB=Dg()?o5shs$V<_- znDJ0s4&V)a zLd}&A!8`VlGZ6NQ@op+;w6-(M#_q3(@KxK= zql?^$Xe^TMAOW{}YF(jERRL{Hu;%Go#9f%^g}6NHyN(-!9M>(4V zbNiPR#b7IUU#Yzems!>&R8Y~j5+@kl6LEVg`Ii?I@`7pWkoiD@wnOW1ew7MXaSQXW z9LFXGq3%9ulBKy~U~USfxm}zNsr|uZp+svrmk%5hJ6gt1k`al2sl+)owGGWZG}y4i5QRn)HR1)|f)xE5rrfcvXXns5Ob$ zp2V#7mcVACRXQunxl;xUM0_M2Tr##d9#s&*xCfoe+c_PYhVz77j$zfJj?)ydND@E0YSh40#jp`~`!yG$T^hH&&L;{y56z%a8ak_%TeQPcoV@ zdw8(^q4Le}5NQXpVTPN|X~*gWC05MNK;AM`&GZ3rSD9r)rC&oZ#@1?88Xo8l0m#+D zmY-8Ds?*(QC)m|^W-40+?r-SlV}0PgZSu!bh*8T0G_Y43Oh}PIyUZ1q+E-`KF&Gul z*V5eOG$jFaDFQQJy^pukJXNa&!7Z&{;Kw-zqTU<;0YU!02O9CHKnVG0cQRznR$ zou=EVflQ566u8q|dBf6dl{F1~L7WpsA2@|VZ(u)Ov1d&wdmpGN_=cNcihmf1 zcZ=^!ArD`mJXj3TIT49BNOtG`MWVpBe@gMb%y=LcbTo$CV!3pQqH?9wyzp=fwA4^< z0
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + rt-thread + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\build\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 0 + 0 + 1 + + 255 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD1FFE0000 -FC1000 -FN1 -FF0HC32F4A0 -FS00 -FL0200000 -FP0($$Device:HC32F4A0SITB$FlashARM\HC32F4A0_2M.FLM)) + + + 0 + JL2CM3 + -U158007610 -O78 -S2 -ZTIFSpeedSel5000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST2 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO7 -FD1FFE0000 -FC1000 -FN1 -FF0HC32F4A0 -FS00 -FL0200000 -FP0($$Device:HC32F4A0SITB$FlashARM\HC32F4A0_2M.FLM) + + + + + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + + 1 + 0 + 2 + 1000000 + + + + + diff --git a/bsp/hc32f4a0/project.uvprojx b/bsp/hc32f4a0/project.uvprojx new file mode 100644 index 0000000000..1717d8b352 --- /dev/null +++ b/bsp/hc32f4a0/project.uvprojx @@ -0,0 +1,961 @@ + + + 2.1 +
### uVision Project, (C) Keil Software
+ + + rt-thread + 0x4 + ARM-ADS + 5060020::V5.06 (build 20)::ARMCC + + + HC32F4A0SITB + HDSC + HDSC.HC32F4A0.1.0.0 + https://raw.githubusercontent.com/hdscmcu/pack/master/ + IROM(0x00000000,0x200000) IRAM(0x1FFE0000,0x80000) IRAM2(0X200F0000,0x1000) CPUTYPE("Cortex-M4") FPU2 CLOCK(240000000) ESEL ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD1FFE0000 -FC1000 -FN1 -FF0HC32F4A0 -FS00 -FL0200000 -FP0($$Device:HC32F4A0SITB$FlashARM\HC32F4A0_2M.FLM)) + 0 + $$Device:HC32F4A0SITB$Device\Include\HC32F4A0SITB.h + + + + + + + + + + $$Device:HC32F4A0SITB$CMSIS\SVD\hdsc_hc32f4a0.SFR + 1 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\build\keil\Obj\ + rtthread + 1 + 0 + 0 + 1 + 0 + .\build\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 1 + 0 + fromelf --bin !L --output rtthread.bin + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -MPU + DCM.DLL + -pCM4 + SARMCM3.DLL + -MPU + TCM.DLL + -pCM4 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M4" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 0 + 8 + 0 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x1fff8000 + 0x8000 + + + 1 + 0x0 + 0x80000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x80000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x1fff8000 + 0x8000 + + + 0 + 0x20000000 + 0x10000 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + + --diag_suppress=186,66 + RT_USING_ARM_LIBC, USE_DDL_DRIVER, __DEBUG, HC32F4A0, __RTTHREAD__ + + applications;.;..\..\libcpu\arm\common;..\..\libcpu\arm\cortex-m4;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\drivers\include;board;drivers;..\..\components\dfs\include;..\..\components\dfs\filesystems\devfs;..\..\components\finsh;Libraries\CMSIS\Include;Libraries\CMSIS\Device\HDSC\HC32F4A0\Include;Libraries\HC32F4A0_StdPeriph_Driver\inc;.;..\..\include;..\..\components\libc\compilers\armlibc;..\..\components\libc\compilers\common + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + 0 + 1 + 0 + 0x00000000 + 0x1FFF8000 + + .\board\linker_scripts\link.sct + + + + + + + + + + + Applications + + + main.c + 1 + applications\main.c + + + + + cpu + + + backtrace.c + 1 + ..\..\libcpu\arm\common\backtrace.c + + + + + div0.c + 1 + ..\..\libcpu\arm\common\div0.c + + + + + showmem.c + 1 + ..\..\libcpu\arm\common\showmem.c + + + + + cpuport.c + 1 + ..\..\libcpu\arm\cortex-m4\cpuport.c + + + + + context_rvds.S + 2 + ..\..\libcpu\arm\cortex-m4\context_rvds.S + + + + + DeviceDrivers + + + pin.c + 1 + ..\..\components\drivers\misc\pin.c + + + + + serial.c + 1 + ..\..\components\drivers\serial\serial.c + + + + + completion.c + 1 + ..\..\components\drivers\src\completion.c + + + + + dataqueue.c + 1 + ..\..\components\drivers\src\dataqueue.c + + + + + pipe.c + 1 + ..\..\components\drivers\src\pipe.c + + + + + ringblk_buf.c + 1 + ..\..\components\drivers\src\ringblk_buf.c + + + + + ringbuffer.c + 1 + ..\..\components\drivers\src\ringbuffer.c + + + + + waitqueue.c + 1 + ..\..\components\drivers\src\waitqueue.c + + + + + workqueue.c + 1 + ..\..\components\drivers\src\workqueue.c + + + + + Drivers + + + board.c + 1 + board\board.c + + + + + board_config.c + 1 + board\board_config.c + + + + + drv_irq.c + 1 + drivers\drv_irq.c + + + + + drv_gpio.c + 1 + drivers\drv_gpio.c + + + + + drv_usart.c + 1 + drivers\drv_usart.c + + + + + Filesystem + + + dfs.c + 1 + ..\..\components\dfs\src\dfs.c + + + + + dfs_file.c + 1 + ..\..\components\dfs\src\dfs_file.c + + + + + dfs_fs.c + 1 + ..\..\components\dfs\src\dfs_fs.c + + + + + dfs_posix.c + 1 + ..\..\components\dfs\src\dfs_posix.c + + + + + poll.c + 1 + ..\..\components\dfs\src\poll.c + + + + + select.c + 1 + ..\..\components\dfs\src\select.c + + + + + devfs.c + 1 + ..\..\components\dfs\filesystems\devfs\devfs.c + + + + + finsh + + + shell.c + 1 + ..\..\components\finsh\shell.c + + + + + cmd.c + 1 + ..\..\components\finsh\cmd.c + + + + + msh.c + 1 + ..\..\components\finsh\msh.c + + + + + msh_file.c + 1 + ..\..\components\finsh\msh_file.c + + + + + finsh_compiler.c + 1 + ..\..\components\finsh\finsh_compiler.c + + + + + finsh_error.c + 1 + ..\..\components\finsh\finsh_error.c + + + + + finsh_heap.c + 1 + ..\..\components\finsh\finsh_heap.c + + + + + finsh_init.c + 1 + ..\..\components\finsh\finsh_init.c + + + + + finsh_node.c + 1 + ..\..\components\finsh\finsh_node.c + + + + + finsh_ops.c + 1 + ..\..\components\finsh\finsh_ops.c + + + + + finsh_parser.c + 1 + ..\..\components\finsh\finsh_parser.c + + + + + finsh_var.c + 1 + ..\..\components\finsh\finsh_var.c + + + + + finsh_vm.c + 1 + ..\..\components\finsh\finsh_vm.c + + + + + finsh_token.c + 1 + ..\..\components\finsh\finsh_token.c + + + + + HC32_StdPeriph + + + system_hc32f4a0.c + 1 + Libraries\CMSIS\Device\HDSC\HC32F4A0\Source\system_hc32f4a0.c + + + + + hc32f4a0_clk.c + 1 + Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_clk.c + + + + + hc32f4a0_dma.c + 1 + Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_dma.c + + + + + hc32f4a0_efm.c + 1 + Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_efm.c + + + + + hc32f4a0_gpio.c + 1 + Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_gpio.c + + + + + hc32f4a0_icg.c + 1 + Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_icg.c + + + + + hc32f4a0_interrupts.c + 1 + Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_interrupts.c + + + + + hc32f4a0_pwc.c + 1 + Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_pwc.c + + + + + hc32f4a0_sram.c + 1 + Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_sram.c + + + + + hc32f4a0_utility.c + 1 + Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_utility.c + + + + + hc32f4a0_usart.c + 1 + Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_usart.c + + + + + hc32f4a0_tmr0.c + 1 + Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_tmr0.c + + + + + startup_hc32f4a0.s + 2 + Libraries\CMSIS\Device\HDSC\HC32F4A0\Source\ARM\startup_hc32f4a0.s + + + + + Kernel + + + clock.c + 1 + ..\..\src\clock.c + + + + + components.c + 1 + ..\..\src\components.c + + + + + device.c + 1 + ..\..\src\device.c + + + + + idle.c + 1 + ..\..\src\idle.c + + + + + ipc.c + 1 + ..\..\src\ipc.c + + + + + irq.c + 1 + ..\..\src\irq.c + + + + + kservice.c + 1 + ..\..\src\kservice.c + + + + + mem.c + 1 + ..\..\src\mem.c + + + + + mempool.c + 1 + ..\..\src\mempool.c + + + + + object.c + 1 + ..\..\src\object.c + + + + + scheduler.c + 1 + ..\..\src\scheduler.c + + + + + signal.c + 1 + ..\..\src\signal.c + + + + + thread.c + 1 + ..\..\src\thread.c + + + + + timer.c + 1 + ..\..\src\timer.c + + + + + libc + + + libc.c + 1 + ..\..\components\libc\compilers\armlibc\libc.c + + + + + mem_std.c + 1 + ..\..\components\libc\compilers\armlibc\mem_std.c + + + + + stdio.c + 1 + ..\..\components\libc\compilers\armlibc\stdio.c + + + + + stubs.c + 1 + ..\..\components\libc\compilers\armlibc\stubs.c + + + + + time.c + 1 + ..\..\components\libc\compilers\common\time.c + + + + + unistd.c + 1 + ..\..\components\libc\compilers\common\unistd.c + + + + + + +
diff --git a/bsp/hc32f4a0/rtconfig.h b/bsp/hc32f4a0/rtconfig.h new file mode 100644 index 0000000000..dc456da17e --- /dev/null +++ b/bsp/hc32f4a0/rtconfig.h @@ -0,0 +1,184 @@ +#ifndef RT_CONFIG_H__ +#define RT_CONFIG_H__ + +/* Automatically generated file; DO NOT EDIT. */ +/* RT-Thread Project Configuration */ + +/* RT-Thread Kernel */ + +#define RT_NAME_MAX 8 +#define RT_ALIGN_SIZE 4 +#define RT_THREAD_PRIORITY_32 +#define RT_THREAD_PRIORITY_MAX 32 +#define RT_TICK_PER_SECOND 1000 +#define RT_USING_OVERFLOW_CHECK +#define RT_USING_HOOK +#define RT_USING_IDLE_HOOK +#define RT_IDLE_HOOK_LIST_SIZE 4 +#define IDLE_THREAD_STACK_SIZE 256 +#define RT_USING_TIMER_SOFT +#define RT_TIMER_THREAD_PRIO 4 +#define RT_TIMER_THREAD_STACK_SIZE 512 +#define RT_DEBUG + +/* Inter-Thread communication */ + +#define RT_USING_SEMAPHORE +#define RT_USING_MUTEX +#define RT_USING_EVENT +#define RT_USING_MAILBOX +#define RT_USING_MESSAGEQUEUE + +/* Memory Management */ + +#define RT_USING_MEMPOOL +#define RT_USING_SMALL_MEM +#define RT_USING_HEAP + +/* Kernel Device Object */ + +#define RT_USING_DEVICE +#define RT_USING_CONSOLE +#define RT_CONSOLEBUF_SIZE 128 +#define RT_CONSOLE_DEVICE_NAME "uart1" +#define RT_VER_NUM 0x40003 +#define ARCH_ARM +#define RT_USING_CPU_FFS +#define ARCH_ARM_CORTEX_M +#define ARCH_ARM_CORTEX_M4 + +/* RT-Thread Components */ + +#define RT_USING_COMPONENTS_INIT +#define RT_USING_USER_MAIN +#define RT_MAIN_THREAD_STACK_SIZE 2048 +#define RT_MAIN_THREAD_PRIORITY 10 + +/* C++ features */ + + +/* Command shell */ + +#define RT_USING_FINSH +#define FINSH_THREAD_NAME "tshell" +#define FINSH_USING_HISTORY +#define FINSH_HISTORY_LINES 5 +#define FINSH_USING_SYMTAB +#define FINSH_USING_DESCRIPTION +#define FINSH_THREAD_PRIORITY 20 +#define FINSH_THREAD_STACK_SIZE 4096 +#define FINSH_CMD_SIZE 80 +#define FINSH_USING_MSH +#define FINSH_USING_MSH_DEFAULT +#define FINSH_ARG_MAX 10 + +/* Device virtual file system */ + +#define RT_USING_DFS +#define DFS_USING_WORKDIR +#define DFS_FILESYSTEMS_MAX 2 +#define DFS_FILESYSTEM_TYPES_MAX 2 +#define DFS_FD_MAX 16 +#define RT_USING_DFS_DEVFS + +/* Device Drivers */ + +#define RT_USING_DEVICE_IPC +#define RT_PIPE_BUFSZ 512 +#define RT_USING_SERIAL +#define RT_SERIAL_USING_DMA +#define RT_SERIAL_RB_BUFSZ 64 +#define RT_USING_PIN + +/* Using USB */ + + +/* POSIX layer and C standard library */ + +#define RT_USING_LIBC +#define RT_USING_POSIX + +/* Network */ + +/* Socket abstraction layer */ + + +/* Network interface device */ + + +/* light weight TCP/IP stack */ + + +/* AT commands */ + + +/* VBUS(Virtual Software BUS) */ + + +/* Utilities */ + + +/* RT-Thread online packages */ + +/* IoT - internet of things */ + + +/* Wi-Fi */ + +/* Marvell WiFi */ + + +/* Wiced WiFi */ + + +/* IoT Cloud */ + + +/* security packages */ + + +/* language packages */ + + +/* multimedia packages */ + + +/* tools packages */ + + +/* system packages */ + + +/* Micrium: Micrium software products porting for RT-Thread */ + + +/* peripheral libraries and drivers */ + + +/* miscellaneous packages */ + + +/* samples: kernel and components samples */ + + +/* games: games run on RT-Thread console */ + + +/* Hardware Drivers Config */ + +#define MCU_HC32F4A0 + +/* Onboard Peripheral Drivers */ + +/* On-chip Peripheral Drivers */ + +#define BSP_USING_GPIO +#define BSP_USING_UART +#define BSP_USING_UART1 +#define BSP_UART1_RX_USING_DMA +#define BSP_UART1_TX_USING_DMA + +/* Board extended module Drivers */ + + +#endif diff --git a/bsp/hc32f4a0/rtconfig.py b/bsp/hc32f4a0/rtconfig.py new file mode 100644 index 0000000000..5a57c9a84e --- /dev/null +++ b/bsp/hc32f4a0/rtconfig.py @@ -0,0 +1,132 @@ +import os + +# toolchains options +ARCH='arm' +CPU='cortex-m4' +CROSS_TOOL='iar' + +print "############rtconfig##############" + +if os.getenv('RTT_CC'): + CROSS_TOOL = os.getenv('RTT_CC') + +print "CROSS_TOOL: " + CROSS_TOOL + +# cross_tool provides the cross compiler +# EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR +if CROSS_TOOL == 'gcc': + PLATFORM = 'gcc' + EXEC_PATH = r'E:/Program Files/CodeSourcery/Sourcery G++ Lite/bin' +elif CROSS_TOOL == 'keil': + PLATFORM = 'armcc' + EXEC_PATH = r'D:\03_software\Program Files\Keil_v5' +elif CROSS_TOOL == 'iar': + PLATFORM = 'iar' + EXEC_PATH = r'D:\03_software\Program Files\IAR Systems\Embedded Workbench 7.5' + +if os.getenv('RTT_EXEC_PATH'): + EXEC_PATH = os.getenv('RTT_EXEC_PATH') + +BUILD = 'debug' +MCU_TYPE = 'HC32F4A0' + +if PLATFORM == 'gcc': + # toolchains + PREFIX = 'arm-none-eabi-' + CC = PREFIX + 'gcc' + AS = PREFIX + 'gcc' + AR = PREFIX + 'ar' + LINK = PREFIX + 'gcc' + TARGET_EXT = 'elf' + SIZE = PREFIX + 'size' + OBJDUMP = PREFIX + 'objdump' + OBJCPY = PREFIX + 'objcopy' + + DEVICE = ' -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections' + CFLAGS = DEVICE + ' -g -Wall -DHC32F4A0 -D__DEBUG -DUSE_DDL_DRIVER -D__ASSEMBLY__ -D__FPU_USED' + AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb ' + LFLAGS = DEVICE + ' -lm -lgcc -lc' + ' -nostartfiles -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds' + + CPATH = '' + LPATH = '' + + if BUILD == 'debug': + CFLAGS += ' -O0 -gdwarf-2' + AFLAGS += ' -gdwarf-2' + else: + CFLAGS += ' -O2' + + POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' + +elif PLATFORM == 'armcc': + # toolchains + CC = 'armcc' + AS = 'armasm' + AR = 'armar' + LINK = 'armlink' + TARGET_EXT = 'axf' + + DEVICE = ' --cpu=cortex-m4.fp' + CFLAGS = DEVICE + ' --apcs=interwork -DUSE_DDL_DRIVER -DHC32F4A0 -D__DEBUG' + AFLAGS = DEVICE + LFLAGS = DEVICE + ' --info sizes --info totals --info unused --info veneers --list rtthread.map --scatter "board/linker_scripts/link.sct"' + + CFLAGS += ' -I' + EXEC_PATH + '/ARM/RV31/INC' + LFLAGS += ' --libpath ' + EXEC_PATH + '/ARM/RV31/LIB' + + EXEC_PATH += '/arm/bin40/' + + if BUILD == 'debug': + CFLAGS += ' -g -O0' + AFLAGS += ' -g' + else: + CFLAGS += ' -O2' + + POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET' + +elif PLATFORM == 'iar': + # toolchains + CC = 'iccarm' + AS = 'iasmarm' + AR = 'iarchive' + LINK = 'ilinkarm' + TARGET_EXT = 'out' + + DEVICE = ' -D __DEBUG' + ' -D USE_DDL_DRIVER' + ' -D HC32F4A0' + + CFLAGS = DEVICE + CFLAGS += ' --diag_suppress Pa050' + CFLAGS += ' --no_cse' + CFLAGS += ' --no_unroll' + CFLAGS += ' --no_inline' + CFLAGS += ' --no_code_motion' + CFLAGS += ' --no_tbaa' + CFLAGS += ' --no_clustering' + CFLAGS += ' --no_scheduling' + CFLAGS += ' --endian=little' + CFLAGS += ' --cpu=Cortex-M4' + CFLAGS += ' -e' + CFLAGS += ' --fpu=None' + CFLAGS += ' --dlib_config "' + EXEC_PATH + '/arm/INC/c/DLib_Config_Normal.h"' + CFLAGS += ' -Ol' + CFLAGS += ' --use_c++_inline' + + AFLAGS = '' + AFLAGS += ' -s+' + AFLAGS += ' -w+' + AFLAGS += ' -r' + AFLAGS += ' --cpu Cortex-M4' + AFLAGS += ' --fpu None' + if BUILD == 'debug': + CFLAGS += ' --debug' + CFLAGS += ' -On' + else: + CFLAGS += ' -Oh' + + LFLAGS = ' --config "board/linker_scripts/link.icf"' + LFLAGS += ' --redirect _Printf=_PrintfTiny' + LFLAGS += ' --redirect _Scanf=_ScanfSmall' + LFLAGS += ' --entry __iar_program_start' + + EXEC_PATH = EXEC_PATH + '/arm/bin/' + POST_ACTION = '' diff --git a/bsp/hc32f4a0/template.ewp b/bsp/hc32f4a0/template.ewp new file mode 100644 index 0000000000..1f81171738 --- /dev/null +++ b/bsp/hc32f4a0/template.ewp @@ -0,0 +1,1925 @@ + + + + 2 + + Release + + ARM + + 0 + + General + 3 + + 24 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 0 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 17 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 0 + + + + + + + BILINK + 0 + + + + + Debug + + ARM + + 0 + + General + 3 + + 24 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 0 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 17 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 0 + + + + + + + BILINK + 0 + + + + + + diff --git a/bsp/hc32f4a0/template.eww b/bsp/hc32f4a0/template.eww new file mode 100644 index 0000000000..bd036bb4c9 --- /dev/null +++ b/bsp/hc32f4a0/template.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\template.ewp + + + + + diff --git a/bsp/hc32f4a0/template.uvoptx b/bsp/hc32f4a0/template.uvoptx new file mode 100644 index 0000000000..916421140c --- /dev/null +++ b/bsp/hc32f4a0/template.uvoptx @@ -0,0 +1,170 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + rt-thread + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\build\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 0 + 0 + 1 + + 255 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 6 + + + + + + + + + + + Segger\JL2CM3.dll + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD1FFE0000 -FC1000 -FN1 -FF0HC32F4A0 -FS00 -FL0200000 -FP0($$Device:HC32F4A0SITB$FlashARM\HC32F4A0_2M.FLM)) + + + 0 + JL2CM3 + -U158007610 -O78 -S2 -ZTIFSpeedSel5000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST2 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO7 -FD1FFE0000 -FC1000 -FN1 -FF0HC32F4A0 -FS00 -FL0200000 -FP0($$Device:HC32F4A0SITB$FlashARM\HC32F4A0_2M.FLM) + + + + + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + + 1 + 0 + 2 + 1000000 + + + + +
diff --git a/bsp/hc32f4a0/template.uvprojx b/bsp/hc32f4a0/template.uvprojx new file mode 100644 index 0000000000..a684e588ed --- /dev/null +++ b/bsp/hc32f4a0/template.uvprojx @@ -0,0 +1,418 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + rt-thread + 0x4 + ARM-ADS + 5060020::V5.06 (build 20)::ARMCC + + + HC32F4A0SITB + HDSC + HDSC.HC32F4A0.1.0.0 + https://raw.githubusercontent.com/hdscmcu/pack/master/ + IROM(0x00000000,0x200000) IRAM(0x1FFE0000,0x80000) IRAM2(0X200F0000,0x1000) CPUTYPE("Cortex-M4") FPU2 CLOCK(240000000) ESEL ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD1FFE0000 -FC1000 -FN1 -FF0HC32F4A0 -FS00 -FL0200000 -FP0($$Device:HC32F4A0SITB$FlashARM\HC32F4A0_2M.FLM)) + 0 + $$Device:HC32F4A0SITB$Device\Include\HC32F4A0SITB.h + + + + + + + + + + $$Device:HC32F4A0SITB$CMSIS\SVD\hdsc_hc32f4a0.SFR + 1 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\build\keil\Obj\ + rtthread + 1 + 0 + 0 + 1 + 0 + .\build\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 1 + 0 + fromelf --bin !L --output rtthread.bin + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -MPU + DCM.DLL + -pCM4 + SARMCM3.DLL + -MPU + TCM.DLL + -pCM4 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + + 0 + 6 + + + + + + + + + + + + + + Segger\JL2CM3.dll + + + + + 1 + 0 + 0 + 1 + 1 + 4096 + + 1 + BIN\UL2CM3.DLL + "" () + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M4" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 0 + 8 + 0 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x1fff8000 + 0x8000 + + + 1 + 0x0 + 0x80000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x80000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x1fff8000 + 0x8000 + + + 0 + 0x20000000 + 0x10000 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + + --diag_suppress=186,66 + __DEBUG,HC32F4A0,USE_DDL_DRIVER + + + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + 0 + 1 + 0 + 0x00000000 + 0x1FFF8000 + + .\board\linker_scripts\link.sct + + + --keep=*Handler + + + + + + + + +

>7#BHr)lJGOt&98; zVYTo?z8HNjaDJq!nS7~|XCKfdHFP2Oiq}8yQ8aX1U9GBw zYF7jgu1`2#C^-2g7UaJ@N|;1js2p{^(Iz`^oWq6MH2MiK!`Gr$((?%H9`URMJwu47 zeAn(!EDtCt_=o6gV^B)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Y% zH=!(2WaxEZVjqy^=iYgZJkO@Cj1DhVCd8AlLxhv>LT!a^}Zl-D-` zg63O47-{N4y9fT@APTTFZxinaS}FAT!0~9wDp{kBT(~d=9JLJ>^N<->j_M)!QwwB~CJAf}ewpIIpnt z4!=1!$Wy1hqH%Zy!^iDKMfh=lKG4_qjip!wg1hD~=Rb}Cf#@o(?v$Q#zOV!U7)NjY z{AXDGzt#=N{(shaN9q3nSswoYKL$7StQynp{_*io{r8FA;^*m5=F>18zd?uP{?GM; zrF@U|lFj?w?-vsGgU$^F-HMngiOvHecLEkrfW+ORhj$v29BY~D4cb2`E>!l3Ies%! z`8>H2u1dc0agBQILBOnI+Rn044_JYxSlb8!F}KcEE_x5^6DTg&f2>mP@W0krW={}v z<0li1RUT$7rN`q`M|aJTnPx~fW9JSJ~)QA*CB`@K|b+F zAg!%^fInDk+-8IJ&Q4;Yrg`oJt} z4Xg=_P70+hbo!d@aI2A%P9m!U7#<)816ezOKrk)@CQFFNBM@R-4amUU34&0soaBR>fKW#vtkjqY0(iyr z{AaEB!^X$JU^rvEG{F}hF*kx3Vg5+GVX@8teshik>nLR6X@NMv;EfCdhLd;>9(-Ux znR8ea!vO;xn0_(H5XUxRZ~(yHf;z)=a0Z!h-b_Pyi-F@IG7|%Me~-MFis7#C+liQx P;4@rfxs!N*lRy92anC&b literal 0 HcmV?d00001 diff --git a/bsp/hc32f4a0/project.ewd b/bsp/hc32f4a0/project.ewd new file mode 100644 index 0000000000..6b666cfa95 --- /dev/null +++ b/bsp/hc32f4a0/project.ewd @@ -0,0 +1,3269 @@ + + + + 2 + + Release + + ARM + + 0 + + C-SPY + 2 + + 28 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 0 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 0 + + + + + + + + + + + + CADI_ID + 2 + + 0 + 1 + 0 + + + + + + + + + CMSISDAP_ID + 2 + + 4 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 0 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 0 + + + + + + + + + IJET_ID + 2 + + 8 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 16 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 0 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 3 + 1 + 0 + + + + + + + + RDI_ID + 2 + + 2 + 1 + 0 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 3 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 0 + + + + + + + + TIFET_ID + 2 + + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + XDS100_ID + 2 + + 5 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\middleware\PercepioTraceExporter\PercepioTraceExportPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + Debug + + ARM + + 0 + + C-SPY + 2 + + 28 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ARMSIM_ID + 2 + + 1 + 1 + 0 + + + + + + + + ANGEL_ID + 2 + + 0 + 1 + 0 + + + + + + + + + + + + CADI_ID + 2 + + 0 + 1 + 0 + + + + + + + + + CMSISDAP_ID + 2 + + 4 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GDBSERVER_ID + 2 + + 0 + 1 + 0 + + + + + + + + + + + IARROM_ID + 2 + + 1 + 1 + 0 + + + + + + + + + IJET_ID + 2 + + 8 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JLINK_ID + 2 + + 16 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMIFTDI_ID + 2 + + 2 + 1 + 0 + + + + + + + + + + MACRAIGOR_ID + 2 + + 3 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + PEMICRO_ID + 2 + + 3 + 1 + 0 + + + + + + + + RDI_ID + 2 + + 2 + 1 + 0 + + + + + + + + + + + + + + + + STLINK_ID + 2 + + 3 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + THIRDPARTY_ID + 2 + + 0 + 1 + 0 + + + + + + + + TIFET_ID + 2 + + 1 + 1 + 0 + + + + + + + + + + + + + + + + + + + XDS100_ID + 2 + + 5 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $TOOLKIT_DIR$\plugins\middleware\HCCWare\HCCWare.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\middleware\PercepioTraceExporter\PercepioTraceExportPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB7_Plugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin + 0 + + + $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin + 0 + + + $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin + 0 + + + + + + diff --git a/bsp/hc32f4a0/project.ewp b/bsp/hc32f4a0/project.ewp new file mode 100644 index 0000000000..ac6a3ad4f5 --- /dev/null +++ b/bsp/hc32f4a0/project.ewp @@ -0,0 +1,2240 @@ + + 2 + + Release + + ARM + + 0 + + General + 3 + + 24 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 0 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 17 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 0 + + + + + + + BILINK + 0 + + + + + Debug + + ARM + + 0 + + General + 3 + + 24 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 31 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 9 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 0 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 17 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 0 + + + + + + + BILINK + 0 + + + + + Applications + + $PROJ_DIR$\applications\main.c + + + + cpu + + $PROJ_DIR$\..\..\libcpu\arm\common\backtrace.c + + + $PROJ_DIR$\..\..\libcpu\arm\common\div0.c + + + $PROJ_DIR$\..\..\libcpu\arm\common\showmem.c + + + $PROJ_DIR$\..\..\libcpu\arm\cortex-m4\cpuport.c + + + $PROJ_DIR$\..\..\libcpu\arm\cortex-m4\context_iar.S + + + + DeviceDrivers + + $PROJ_DIR$\..\..\components\drivers\misc\pin.c + + + $PROJ_DIR$\..\..\components\drivers\serial\serial.c + + + $PROJ_DIR$\..\..\components\drivers\src\completion.c + + + $PROJ_DIR$\..\..\components\drivers\src\dataqueue.c + + + $PROJ_DIR$\..\..\components\drivers\src\pipe.c + + + $PROJ_DIR$\..\..\components\drivers\src\ringblk_buf.c + + + $PROJ_DIR$\..\..\components\drivers\src\ringbuffer.c + + + $PROJ_DIR$\..\..\components\drivers\src\waitqueue.c + + + $PROJ_DIR$\..\..\components\drivers\src\workqueue.c + + + + dlib + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\environ.c + + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\libc.c + + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\rmtx.c + + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\stdio.c + + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_close.c + + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_lseek.c + + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_mem.c + + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_open.c + + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_read.c + + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_remove.c + + + $PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_write.c + + + + Drivers + + $PROJ_DIR$\board\board.c + + + $PROJ_DIR$\board\board_config.c + + + $PROJ_DIR$\drivers\drv_irq.c + + + $PROJ_DIR$\drivers\drv_gpio.c + + + $PROJ_DIR$\drivers\drv_usart.c + + + + Filesystem + + $PROJ_DIR$\..\..\components\dfs\src\dfs.c + + + $PROJ_DIR$\..\..\components\dfs\src\dfs_file.c + + + $PROJ_DIR$\..\..\components\dfs\src\dfs_fs.c + + + $PROJ_DIR$\..\..\components\dfs\src\dfs_posix.c + + + $PROJ_DIR$\..\..\components\dfs\src\poll.c + + + $PROJ_DIR$\..\..\components\dfs\src\select.c + + + $PROJ_DIR$\..\..\components\dfs\filesystems\devfs\devfs.c + + + + finsh + + $PROJ_DIR$\..\..\components\finsh\shell.c + + + $PROJ_DIR$\..\..\components\finsh\cmd.c + + + $PROJ_DIR$\..\..\components\finsh\msh.c + + + $PROJ_DIR$\..\..\components\finsh\msh_file.c + + + $PROJ_DIR$\..\..\components\finsh\finsh_compiler.c + + + $PROJ_DIR$\..\..\components\finsh\finsh_error.c + + + $PROJ_DIR$\..\..\components\finsh\finsh_heap.c + + + $PROJ_DIR$\..\..\components\finsh\finsh_init.c + + + $PROJ_DIR$\..\..\components\finsh\finsh_node.c + + + $PROJ_DIR$\..\..\components\finsh\finsh_ops.c + + + $PROJ_DIR$\..\..\components\finsh\finsh_parser.c + + + $PROJ_DIR$\..\..\components\finsh\finsh_var.c + + + $PROJ_DIR$\..\..\components\finsh\finsh_vm.c + + + $PROJ_DIR$\..\..\components\finsh\finsh_token.c + + + + HC32_StdPeriph + + $PROJ_DIR$\Libraries\CMSIS\Device\HDSC\HC32F4A0\Source\system_hc32f4a0.c + + + $PROJ_DIR$\Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_clk.c + + + $PROJ_DIR$\Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_dma.c + + + $PROJ_DIR$\Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_efm.c + + + $PROJ_DIR$\Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_gpio.c + + + $PROJ_DIR$\Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_icg.c + + + $PROJ_DIR$\Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_interrupts.c + + + $PROJ_DIR$\Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_pwc.c + + + $PROJ_DIR$\Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_sram.c + + + $PROJ_DIR$\Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_utility.c + + + $PROJ_DIR$\Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_usart.c + + + $PROJ_DIR$\Libraries\HC32F4A0_StdPeriph_Driver\src\hc32f4a0_tmr0.c + + + $PROJ_DIR$\Libraries\CMSIS\Device\HDSC\HC32F4A0\Source\IAR\startup_hc32f4a0.s + + + + Kernel + + $PROJ_DIR$\..\..\src\clock.c + + + $PROJ_DIR$\..\..\src\components.c + + + $PROJ_DIR$\..\..\src\device.c + + + $PROJ_DIR$\..\..\src\idle.c + + + $PROJ_DIR$\..\..\src\ipc.c + + + $PROJ_DIR$\..\..\src\irq.c + + + $PROJ_DIR$\..\..\src\kservice.c + + + $PROJ_DIR$\..\..\src\mem.c + + + $PROJ_DIR$\..\..\src\mempool.c + + + $PROJ_DIR$\..\..\src\object.c + + + $PROJ_DIR$\..\..\src\scheduler.c + + + $PROJ_DIR$\..\..\src\signal.c + + + $PROJ_DIR$\..\..\src\thread.c + + + $PROJ_DIR$\..\..\src\timer.c + + + + libc + + $PROJ_DIR$\..\..\components\libc\compilers\common\time.c + + + $PROJ_DIR$\..\..\components\libc\compilers\common\unistd.c + + + diff --git a/bsp/hc32f4a0/project.eww b/bsp/hc32f4a0/project.eww new file mode 100644 index 0000000000..c2cb02eb1e --- /dev/null +++ b/bsp/hc32f4a0/project.eww @@ -0,0 +1,10 @@ + + + + + $WS_DIR$\project.ewp + + + + + diff --git a/bsp/hc32f4a0/project.uvoptx b/bsp/hc32f4a0/project.uvoptx new file mode 100644 index 0000000000..916421140c --- /dev/null +++ b/bsp/hc32f4a0/project.uvoptx @@ -0,0 +1,170 @@ + + + + 1.0 + +